21 May, 2015
2 commits
-
When the ethaddr is changed in the env, update the device pdata at the
same time (only if it is probed for the DM case; only if registered for
the non-DM case). Again this gets us closer to completely non-polled
env needed to simplify the net_loop.This requires that the NET feature select the REGEX feature.
Signed-off-by: Joe Hershberger
-
The bootfile env var is already kept up to date by the callback in net.c
so there is no need to poll it too.Signed-off-by: Joe Hershberger
20 May, 2015
2 commits
-
Implement the random ethaddr fallback in eth.c so it is in a common
place and not reimplemented in each board or driver that wants this
behavior.Signed-off-by: Joe Hershberger
Reviewed-by: Simon Glass -
When the ethaddr changes in the env, the hardware should also be updated
so that MAC filtering will work properly without resetting U-Boot.Also remove the manual calls to set the hwaddr that was included in a
few drivers as a result of the framework not doing it.Reported-by: Michal Simek
Signed-off-by: Joe Hershberger
Tested-by: Michal Simek
19 Apr, 2015
17 commits
-
At present even with driver model is used there is still much manual init
of related devices: PHY, environment and board init. Until these requirements
are dealt with in another way we need to keep them around.Break out the init portion of the legacy eth_initialize() into a separate
function and call it from both the legacy and driver model eth_initialize()
functions.Signed-off-by: Simon Glass
Acked-by: Joe Hershberger -
Finish eliminating CamelCase from net.c and other failures
Signed-off-by: Joe Hershberger
Acked-by: Simon Glass -
There were still a few failures in net/eth.c, especially in the legacy
part of the code.Signed-off-by: Joe Hershberger
Acked-by: Simon Glass -
Use "_ethaddr" at the end of variables and drop CamelCase.
Make constant values actually 'const'.Signed-off-by: Joe Hershberger
Acked-by: Simon Glass -
The variables around the bootfile were inconsistent and used CamelCase.
Update them to make the code more readable.Signed-off-by: Joe Hershberger
Acked-by: Simon Glass -
This patch is simply clean-up to make the IPv4 type that is used match
what Linux uses. It also attempts to move all variables that are IP
addresses use good naming instead of CamelCase. No functional change.Signed-off-by: Joe Hershberger
Acked-by: Simon Glass -
Some drivers need a chance to manage their receive buffers after the
packet has been handled by the network stack. Add an operation that
will allow the driver to be called in that case.Reported-by: Simon Glass
Signed-off-by: Joe Hershberger
Acked-by: Simon Glass
Tested-by: Simon Glass
Tested-on: pcduino3 -
Take a pass at plumbing errors through to the users of the network stack
Currently only the start() function errors will be returned from
NetLoop(). recv() tends not to have errors, so that is likely not worth
adding. send() certainly can return errors, but this patch does not
attempt to plumb them yet. halt() is not expected to error.Signed-off-by: Joe Hershberger
Reviewed-by: Simon Glass -
The ethprime env var is used to indicate the starting device if none is
specified in ethact. Also support aliases specified in the ethprime var.Signed-off-by: Joe Hershberger
Reviewed-by: Simon Glass -
Allow network devices to be referred to as "eth0" instead of
"eth@12345678" when specified in ethact.Add tests to verify this behavior.
Signed-off-by: Joe Hershberger
Reviewed-by: Simon Glass -
Stop forcing drivers to call net_process_received_packet() - formerly
called NetReceive(). Now the uclass will handle calling the driver for
each packet until the driver errors or has nothing to return. The uclass
will then pass the good packets off to the network stack by calling
net_process_received_packet().Signed-off-by: Joe Hershberger
-
First just add support for MAC drivers.
Signed-off-by: Joe Hershberger
Reviewed-by: Simon Glass -
This value is not used by the network stack and is available in the
global data, so stop passing it around. For the one legacy function
that still expects it (init op on old Ethernet drivers) pass in the
global pointer version directly to avoid changing that interface.Signed-off-by: Joe Hershberger
Reported-by: Simon Glass
Reviewed-by: Simon Glass
Signed-off-by: Simon Glass
(Trival fix to remove an unneeded variable declaration in 4xx_enet.c) -
On some archs masking the parameter is inefficient, so don't use u8.
Signed-off-by: Joe Hershberger
Reported-by: Simon Glass
Reviewed-by: Simon Glass -
Many functions returned -1 previously. Change them to return appropriate error
codes.Signed-off-by: Joe Hershberger
Reported-by: Simon Glass
Reviewed-by: Simon Glass -
Move some things around and organize things so that the driver model
implementation will fit in more easily.Signed-off-by: Joe Hershberger
Reviewed-by: Simon Glass -
Make it clear that the helper is checking the addr, not setting it.
Signed-off-by: Joe Hershberger
Reviewed-by: Simon Glass
25 Oct, 2014
1 commit
-
Signed-off-by: Jeroen Hofstee
22 Jul, 2014
1 commit
-
Improve error messages in case of invalid/unset ethernet addresses.
Signed-off-by: Pavel Machek
13 May, 2014
1 commit
-
Some functions in include/net.h are ported from
include/linux/etherdevice.h of Linux Kernel.For ex.
is_zero_ether_addr()
is_multicast_ether_addr()
is_broadcast_ether_addr()
is_valid_ether_addr();So, we should use the same function name as that of Linux Kernel,
eth_rand_addr(), for consistency.Besides, eth_rand_addr() has been implemented as an inline function.
So it should not be surrounded by #ifdef CONFIG_RANDOM_MACADDR.Signed-off-by: Masahiro Yamada
Acked-by: Joe Hershberger
07 Feb, 2014
1 commit
-
In "common/Makefile" "miiphyutil.o" gets built if any of the following
items enabled:
* CONFIG_PHYLIB
* CONFIG_MII
* CONFIG_CMD_MIISo it's possible to not define CONFIG_MII or CONFIG_CMD_MII and still
use functions like "miiphy_get_dev_by_name".In its turn "miiphy_get_dev_by_name" traverses "mii_devs" list which is
not initialized because "miiphy_init" never got called.Cc: Rob Herring
Cc: Simon Glass
Cc: Wolfgang Denk
Acked-by: Joe Hershberger
Signed-off-by: Alexey Brodkin
24 Jul, 2013
1 commit
-
Signed-off-by: Wolfgang Denk
[trini: Fixup common/cmd_io.c]
Signed-off-by: Tom Rini
28 Sep, 2012
1 commit
-
If dev->enetaddr was supposed to be set with dev->write_hwaddr() but the MAC
address was not valid, return an error.Signed-off-by: Benoît Thébaudeau
Cc: Joe Hershberger
Acked-by: Mike Frysinger
25 Sep, 2012
2 commits
-
Previously u-boot would initialize the network interface for every
network operation and then shut it down again. This makes sense for
most operations where the network in not known to be needed soon after
the operation is complete. In the case of netconsole, it will use the
network for every interaction with the shell or every printf. This
means that the network is being reinitialized very often. On many
devices, this intialization is very slow.This patch checks for consecutive netconsole actions and leaves the
ethernet hardware initialized between them. It will still behave the
same old way for all other network operations and any time another
network operation happens between netconsole operations.Signed-off-by: Joe Hershberger
Cc: Stefano Babic
Acked-by: Stefano Babic -
If the requested length is too small to hold the received packet,
eth_receive() will return -1 and will leave the packet in the receive
buffers. Instead of returning an error in this case, we return the first
portion of the received packet and remove it from the receive buffers.This fixes FreeBSD's ubldr. Without this patch it will just stop receiving
packets if the NIC receives more than PKTBUFSRX too large packets.Signed-off-by: Michael Walle
Cc: Joe Hershberger
Cc: Rafal Jaworowski
Cc: Piotr Kruszynski
12 Jul, 2012
2 commits
-
This function is currently only used in one case. Inline for now.
Signed-off-by: Joe Hershberger
-
If the net driver has setup a valid ethernet address and an ethernet
address is not set in the environment already, then set the environment
variables from the net driver setting.This enables pxe booting on boards which don't set ethaddr env variable.
Signed-off-by: Rob Herring
07 Jul, 2012
1 commit
-
Add new function eth_random_enetaddr() to generate a locally administered
ethernet address.Signed-off-by: Michael Walle
Acked-by: Joe Hershberger
16 May, 2012
3 commits
-
All arches init this the same way, so move the logic into the core
net code to avoid duplicating it everywhere else.Signed-off-by: Mike Frysinger
Reviewed-by: Joe Hershberger -
Signed-off-by: Joe Hershberger
Acked-by: Simon Glass -
Signed-off-by: Joe Hershberger
Acked-by: Simon Glass
04 Apr, 2012
1 commit
-
Ignore the return value of eth_getenv_enetaddr_by_index(), and if it
fails, fall back to use dev->enetaddr, which could be filled up by
the ethernet device driver:With the current code, introduced with below commit, eth_write_hwaddr()
will fail immediately if there is no ethaddr in the environment variables.However, e.g. for an overo based product that uses the SMSC911x ethernet
chip (with the MAC address set via EEPROM connected to the SMSC911x chip),
the MAC address is still OK.On mx28 boards that are depending on the OCOTP bits to set the MAC address
(like the Denx m28 board), the OCOTP bits should be used instead of
failing on the environment variables.Actually, this was the original behavior, and was later changed by
commit 7616e7850804c7c69e0a22c179dfcba9e8f3f587.Signed-off-by: Eric Miao
Acked-by: Simon Glass
Acked-by: Dirk Behme
CC: Stefan Roese
CC: Eric Miao
CC: Wolfgang Denk
CC: Philip Balister
CC: Zach Sadecki
19 Mar, 2012
4 commits
-
These calls should not be made directly any more, since bootstage
will call the show_boot_...() functions as needed.Signed-off-by: Simon Glass
-
This changes over the network-related progress numbers to use enums
from bootstage.h.Signed-off-by: Simon Glass
-
Rather than the caller negating our progress numbers to indicate an
error has occurred, which seems hacky, add a function to indicate this.Signed-off-by: Simon Glass
Acked-by: Mike Frysinger -
A few subsystems are using the same define "NAMESIZE". This has been
working so far because they define it to the same number. However, I
want to change the size of eth_device's NAMESIZE, so rather than tweak
the define names, simply drop references to it. Almost no one does,
and the handful that do can easily be changed to a sizeof().Signed-off-by: Mike Frysinger