- 12 8月, 2019 1 次提交
-
-
由 Simon Glass 提交于
Move env_set() over to the new header file. Acked-by: NJoe Hershberger <joe.hershberger@ni.com> Signed-off-by: NSimon Glass <sjg@chromium.org>
-
- 02 6月, 2019 2 次提交
-
-
由 Thierry Reding 提交于
Add the standard Ethernet device tree bindings (imported from v5.0 of the Linux kernel) and implement support for reading the MAC address for Ethernet devices in the Ethernet uclass. If the "mac-address" property exists, the MAC address will be parsed from that. If that property does not exist, the "local-mac-address" property will be tried as fallback. MAC addresses from device tree take precedence over the ones stored in a network interface card's ROM. Acked-by: NJoe Hershberger <joe.hershberger@ni.com> Reviewed-by: NGrygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: NThierry Reding <treding@nvidia.com>
-
由 Thierry Reding 提交于
In order for the device to use the proper MAC address, which can have been configured in the environment prior to the device being registered, ensure that the MAC address is written after the device has been probed. For devices that are registered before the network stack is initialized, this is already done during eth_initialize(). If the Ethernet device is on a bus that is not initialized on early boot, such as PCI, the device is not available at the time eth_initialize() is called, so we need the MAC address programming to also happen after probe. Acked-by: NJoe Hershberger <joe.hershberger@ni.com> Signed-off-by: NThierry Reding <treding@nvidia.com>
-
- 25 1月, 2019 1 次提交
-
-
由 Chris Packham 提交于
No mainline board enables CONFIG_MCAST_TFTP and there have been compilation issues with the code for some time. Additionally, it has a potential buffer underrun issue (reported as a side note in CVE-2018-18439). Remove the multicast TFTP code but keep the driver API for the future addition of IPv6. Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Signed-off-by: NChris Packham <judge.packham@gmail.com> Acked-by: NJoe Hershberger <joe.hershberger@ni.com>
-
- 21 8月, 2018 1 次提交
-
-
由 Jean-Jacques Hiblot 提交于
When a USB ethernet device is halted, the device driver is removed. When this happens the uclass private memory is freed and uclass_priv is set to NULL. This causes a data abort when uclass_priv->state is then set to ETH_STATE_PASSIVE. Fix it by checking if uclass_priv is NULL before setting uclass_priv->state Signed-off-by: NJean-Jacques Hiblot <jjhiblot@ti.com> Acked-by: NJoe Hershberger <joe.hershberger@ni.com>
-
- 27 7月, 2018 1 次提交
-
-
由 Joe Hershberger 提交于
With driver model, we were not checking if the state of the device was marked as active before calling the halt function. Check that the device is probed and also marked as active. This avoids the case where we were calling halt on the first device in net_init() and the driver would operate on bogus data structures causing problems. In this case, the priv was all 0, so halt() would close STDIN. Signed-off-by: NJoe Hershberger <joe.hershberger@ni.com> Reviewed-by: NSimon Glass <sjg@chromium.org>
-
- 14 6月, 2018 1 次提交
-
-
由 Mario Six 提交于
On devices that have their first network interface provided by a FPGA, the initialization of further interfaces will fail if the FPGA is not yet programmed. This leads to problems during factory setup when the data is supposed to be loaded over secondary netowork interfaces. To avoid this, use the uclass_{first,next}_device_check functions to initialize as many ethernet devices as possible. Signed-off-by: NMario Six <mario.six@gdsys.cc> Acked-by: NJoe Hershberger <joe.hershberger@ni.com>
-
- 07 5月, 2018 1 次提交
-
-
由 Tom Rini 提交于
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: NTom Rini <trini@konsulko.com>
-
- 23 3月, 2018 1 次提交
-
-
由 Alexander Graf 提交于
In the efi_loader main loop we call eth_rx() occasionally. This rx function might end up calling into devices that haven't been initialized yet, potentially resulting in a lot of transfer timeouts. Instead, let's make sure the ethernet device is actually initialized before reading from or writing to it. Signed-off-by: NAlexander Graf <agraf@suse.de> Acked-by: NJoe Hershberger <joe.hershberger@ni.com>
-
- 16 8月, 2017 3 次提交
-
-
由 Simon Glass 提交于
Rename this function for consistency with env_get(). Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
We are now using an env_ prefix for environment functions. Rename these two functions for consistency. Also add function comments in common.h. Quite a few places use getenv() in a condition context, provoking a warning from checkpatch. These are fixed up in this patch also. Suggested-by: NWolfgang Denk <wd@denx.de> Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
Rename this function for consistency with env_set(). Signed-off-by: NSimon Glass <sjg@chromium.org>
-
- 03 6月, 2017 1 次提交
-
-
由 xypron.glpk@gmx.de 提交于
Checking if dev is NULL after dereferencing it does not make sense. Signed-off-by: NHeinrich Schuchardt <xypron.glpk@gmx.de> Acked-by: NJoe Hershberger <joe.hershberger@ni.com>
-
- 08 2月, 2017 2 次提交
-
-
由 oliver@schinagl.nl 提交于
Currently, we print that the MAC from the SROM does not match. It can be many forms of ROM, so lets drop the S. Signed-off-by: NOlliver Schinagl <oliver@schinagl.nl> Acked-by: NJoe Hershberger <joe.hershberger@ni.com>
-
由 oliver@schinagl.nl 提交于
Commit 674bb249 ("net: cosmetic: Replace magic numbers in arp.c with constants") introduced a nice define to replace the magic value 6 for the ethernet hardware address. Replace more hardcoded instances of 6 which really reference the ARP_HLEN (iow the MAC/Hardware/Ethernet address). Signed-off-by: NOlliver Schinagl <oliver@schinagl.nl> Acked-by: NJoe Hershberger <joe.hershberger@ni.com>
-
- 08 11月, 2016 1 次提交
-
-
Use random ethernet address if the ethernet address found is invalid, not zero and config for random address is defined. Signed-off-by: NSiva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: NMichal Simek <michal.simek@xilinx.com> Acked-by: NJoe Hershberger <joe.hershberger@ni.com>
-
- 14 10月, 2016 1 次提交
-
-
由 Hannes Schmelzer 提交于
If mac-address is changed using "setenv ethaddr ...." command the new mac-adress also must be written into the responsible ethernet driver. Signed-off-by: NHannes Schmelzer <oe5hpm@oevsv.at> Acked-by: NJoe Hershberger <joe.hershberger@ni.com>
-
- 06 2月, 2016 1 次提交
-
-
由 Simon Glass 提交于
This fixes the following error when building microblaze-generic: net/eth-uclass.c: In function 'eth_post_probe': net/eth-uclass.c:466:18: error: 'gd' undeclared (first use in this function) ops->start += gd->reloc_off; Fixes: db9391e1 ("net: Move driver-model code into its own file") Signed-off-by: NSimon Glass <sjg@chromium.org> Acked-by: NJoe Hershberger <joe.hershberger@ni.com>
-
- 29 1月, 2016 5 次提交
-
-
由 Simon Glass 提交于
Every other uclass is in its own file. Create a new eth-uclass.c file and move the driver-model code into it, so that networking is consistent. Signed-off-by: NSimon Glass <sjg@chromium.org> Reviewed-by: NBin Meng <bmeng.cn@gmail.com> Acked-by: NJoe Hershberger <joe.hershberger@ni.com>
-
由 Simon Glass 提交于
Move eth_current_changed(), eth_set_current(), eth_mac_skip() and eth_get_name() into the common file. Signed-off-by: NSimon Glass <sjg@chromium.org> Reviewed-by: NBin Meng <bmeng.cn@gmail.com> Acked-by: NJoe Hershberger <joe.hershberger@ni.com>
-
由 Simon Glass 提交于
Move the functions which set ethernet environment variables to the common file. Signed-off-by: NSimon Glass <sjg@chromium.org> Acked-by: NJoe Hershberger <joe.hershberger@ni.com>
-
由 Simon Glass 提交于
Only half of the init is actually common. Move that part into a new common file and call it from driver-model and legacy code. More common functions will be added in future patches. Signed-off-by: NSimon Glass <sjg@chromium.org> Reviewed-by: NBin Meng <bmeng.cn@gmail.com> Acked-by: NJoe Hershberger <joe.hershberger@ni.com>
-
由 Simon Glass 提交于
We should avoid weak functions with driver model. Existing boards that use driver model don't need them, so let's kill them off. Signed-off-by: NSimon Glass <sjg@chromium.org> Reviewed-by: NBin Meng <bmeng.cn@gmail.com> Acked-by: NJoe Hershberger <joe.hershberger@ni.com>
-
- 08 1月, 2016 3 次提交
-
-
由 Andre Przywara 提交于
In many parts of the computing world having a unique MAC address sitting in some on-NIC storage is considered the normal case. Remove the warning to not scare the user unnecessarily. This applies to Highbank/Midway and ARM's Juno, for instance. Besides that this fixes the formatting on Midway, for instance, which currently looks like: ... Net: xgmac0 Warning: xgmac0 using MAC address from net device , xgmac1 Warning: xgmac1 using MAC address from net device ... Signed-off-by: NAndre Przywara <andre.przywara@arm.com>
-
由 Bin Meng 提交于
When 'ethrotate' variable is set to 'no' and 'ethact' variable is already set to an ethernet device, we should stick to 'ethact'. Signed-off-by: NBin Meng <bmeng.cn@gmail.com> Acked-by: NJoe Hershberger <joe.hershberger@ni.com> Acked-by: NSimon Glass <sjg@chromium.org> Tested-by: NSimon Glass <sjg@chromium.org>
-
由 Bin Meng 提交于
In eth_current_changed(), the call to eth_get_dev() below has a side effect of rotating ethernet device if uc_priv->current == NULL. This is not what we want when 'ethrotate' variable is 'no'. Signed-off-by: NBin Meng <bmeng.cn@gmail.com> Acked-by: NJoe Hershberger <joe.hershberger@ni.com> Acked-by: NSimon Glass <sjg@chromium.org> Tested-by: NSimon Glass <sjg@chromium.org>
-
- 18 12月, 2015 1 次提交
-
-
由 Michal Simek 提交于
All ethernet operation needs to be updated for architectures which requires MANUAL_RELOC. Signed-off-by: NMichal Simek <michal.simek@xilinx.com> Acked-by: NJoe Hershberger <joe.hershberger@ni.com>
-
- 30 10月, 2015 2 次提交
-
-
由 Bin Meng 提交于
eth_get_dev() can return NULL which means device_probe() fails for that ethernet device. Add return value check in various places or U-Boot will crash due to NULL pointer access. With this commit, 'dm_test_eth_act' test case passes. Signed-off-by: NBin Meng <bmeng.cn@gmail.com> Acked-by: NJoe Hershberger <joe.hershberger@ni.com>
-
由 Bin Meng 提交于
platdata->enetaddr was assigned to a value in dev_probe() last time. If we don't clear it, for dev_probe() at the second time, dm eth will end up treating it as a MAC address from ROM no matter where it came from originally (maybe env, ROM, or even random). Fix this by clearing platdata->enetaddr when removing an Ethernet device. Signed-off-by: NBin Meng <bmeng.cn@gmail.com> Acked-by: NJoe Hershberger <joe.hershberger@ni.com>
-
- 29 10月, 2015 2 次提交
-
-
由 Josh Wu 提交于
As we don't modify the 'name' parameter, so change it to const. Signed-off-by: NJosh Wu <josh.wu@atmel.com> Reviewed-by: NSimon Glass <sjg@chromium.org> Acked-by: NJoe Hershberger <joe.hershberger@ni.com>
-
由 Gong Qianyu 提交于
The loop should check all ethenet devices, not only the first device, to set each specified ethaddr, or it'll cause failure when we use other devices. Signed-off-by: NGong Qianyu <Qianyu.Gong@freescale.com> Acked-by: NJoe Hershberger <joe.hershberger@ni.com>
-
- 30 9月, 2015 1 次提交
-
-
由 Bernhard Nortmann 提交于
The previous eth_device struct returned by eth_get_dev() allowed code to directly query the state member field. However, with CONFIG_DM_ETH this data gets encapsulated (i.e. private), and eth_get_dev() returns a udevice struct 'abstraction' instead. This breaks legacy code relying on the former behaviour - e.g. netconsole. (see http://lists.denx.de/pipermail/u-boot/2015-June/216528.html) The patch introduces a method to retrieve the ethernet device state in a 'clean' and uniform way, supporting both legacy code and driver model. The new function eth_is_active() accepts a device struct pointer and tests it for ETH_STATE_ACTIVE. Signed-off-by: NBernhard Nortmann <bernhard.nortmann@web.de> Reviewed-by: NSimon Glass <sjg@chromium.org> Acked-by: NJoe Hershberger <joe.hershberger@ni.com>
-
- 09 9月, 2015 2 次提交
-
-
由 Bin Meng 提交于
When given a device name string, we should test to see if it is really an alias like "eth#". Signed-off-by: NBin Meng <bmeng.cn@gmail.com> Acked-by: NJoe Hershberger <joe.hershberger@ni.com>
-
由 Bin Meng 提交于
With driver model, board_eth_init() or cpu_eth_init() is not a must. Thus we don't need print a misleading "Net Initialization Skipped". Signed-off-by: NBin Meng <bmeng.cn@gmail.com> Acked-by: NJoe Hershberger <joe.hershberger@ni.com>
-
- 22 7月, 2015 2 次提交
-
-
由 Simon Glass 提交于
Some drivers may want to implement this method for some of their devices but not for others. So it is not possible to just leave the operation out of the table. Drivers could get around this by masquerading as two separate drivers but that seems unpleasant. Allow the driver to return an error when it does not want to process the write_hwaddr() method. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
Some devices can take a long time to work out whether they have a new packet or now. For example the ASIX USB Ethernet dongle can take 5 seconds to do this, since it waits until it gets a new packet on the wire before allowing the USB bulk read packet to be submitted. At present with driver mode the Ethernet receive code reads 32 packets. This can take a very long time if we must wait for all 32 packets. The old code (before driver model) worked by reading a single set of packets from the USB device, then processing all the packets with in. It would be nice to use the same behaviour with driver model. Add a flag to the receive method which indicates that the driver should try to find a packet if available, by consulting the hardware. When the flag is not set, it should just return any packet data it has already received. If there is none, it should return -EAGAIN so that the loop will terminate. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
- 21 5月, 2015 2 次提交
-
-
由 Joe Hershberger 提交于
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: NJoe Hershberger <joe.hershberger@ni.com>
-
由 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: NJoe Hershberger <joe.hershberger@ni.com>
-
- 20 5月, 2015 2 次提交
-
-
由 Joe Hershberger 提交于
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: NJoe Hershberger <joe.hershberger@ni.com> Reviewed-by: NSimon Glass <sjg@chromium.org>
-
由 Joe Hershberger 提交于
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: NMichal Simek <michal.simek@xilinx.com> Signed-off-by: NJoe Hershberger <joe.hershberger@ni.com> Tested-by: NMichal Simek <michal.simek@xilinx.com>
-