09 Dec, 2019

2 commits

  • device_probe() may fail in which case the seq_id will be -1. Don't
    display these devices during startup. While this is only a cosmetic
    change, the return value of eth_initialize() will also change to the
    actual number of available devices. The return value is only used in
    spl_net to decide whether there are any devices to boot from. So
    returning only available devices is also more correct in that case.

    Signed-off-by: Michael Walle
    Acked-by: Joe Hershberger

    Michael Walle
     
  • Part of the env cleanup moved this out of the environment code and into
    the net code. However, this helper is sometimes needed even when the net
    stack isn't included.

    Move the helper to lib/net_utils.c like it's similarly-purposed
    string_to_ip(). Also rename the moved function to similar naming.

    Signed-off-by: Joe Hershberger
    Reported-by: Ondrej Jirman

    Joe Hershberger
     

05 Sep, 2019

1 commit

  • Add support for capturing ethernet packets and storing
    them in memory in PCAP(2.4) format, later to be analyzed by
    any PCAP viewer software (IE. Wireshark)

    This feature greatly assist debugging network issues such
    as detecting dropped packets, packet corruption etc.

    Signed-off-by: Ramon Fried
    Reviewed-by: Alex Marginean
    Tested-by: Alex Marginean
    Acked-by: Joe Hershberger

    Ramon Fried
     

12 Aug, 2019

2 commits


02 Jun, 2019

2 commits

  • 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: Joe Hershberger
    Reviewed-by: Grygorii Strashko
    Signed-off-by: Thierry Reding

    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: Joe Hershberger
    Signed-off-by: Thierry Reding

    Thierry Reding
     

25 Jan, 2019

1 commit

  • 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
    Signed-off-by: Chris Packham
    Acked-by: Joe Hershberger

    Chris Packham
     

21 Aug, 2018

1 commit

  • 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: Jean-Jacques Hiblot
    Acked-by: Joe Hershberger

    Jean-Jacques Hiblot
     

27 Jul, 2018

1 commit

  • 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: Joe Hershberger
    Reviewed-by: Simon Glass

    Joe Hershberger
     

14 Jun, 2018

1 commit

  • 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: Mario Six
    Acked-by: Joe Hershberger

    Mario Six
     

07 May, 2018

1 commit

  • 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: Tom Rini

    Tom Rini
     

23 Mar, 2018

1 commit

  • 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: Alexander Graf
    Acked-by: Joe Hershberger

    Alexander Graf
     

16 Aug, 2017

3 commits


03 Jun, 2017

1 commit


08 Feb, 2017

2 commits


08 Nov, 2016

1 commit


14 Oct, 2016

1 commit


06 Feb, 2016

1 commit

  • 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: Simon Glass
    Acked-by: Joe Hershberger

    Simon Glass
     

29 Jan, 2016

1 commit