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_MII

    So 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

    Alexey Brodkin
     

24 Jul, 2013

1 commit


28 Sep, 2012

1 commit


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

    Joe Hershberger
     
  • 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

    Michael Walle
     

12 Jul, 2012

2 commits


07 Jul, 2012

1 commit


16 May, 2012

3 commits


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

    Eric Miao
     

19 Mar, 2012

4 commits


07 Mar, 2012

2 commits


03 Mar, 2012

1 commit


21 Dec, 2011

1 commit

  • Instead of counting the device index everytime a functions needs it, store
    it in the eth_device struct. eth_register() keeps track of the indices and
    updates the device's index number. This simplifies some functions in
    net/eth.c.

    Additionally, a network driver can now query its index, eg. to get the
    correct environment ethaddr name.

    Signed-off-by: Michael Walle
    Cc: Prafulla Wadaskar
    Cc: Mike Frysinger
    Cc: Wolfgang Denk
    Acked-by: Mike Frysinger

    Michael Walle
     

06 Oct, 2011

2 commits


02 Oct, 2011

1 commit


22 Sep, 2011

1 commit

  • The new sanity check introduces a printf warning for some systems:
    eth.c:233: warning: format '%zu' expects type 'size_t', but argument 3 has type 'int'

    Rather than tweak the format string, use the new assert() helper instead.

    Signed-off-by: Mike Frysinger

    Mike Frysinger
     

10 Sep, 2011

1 commit


05 Sep, 2011

2 commits

  • This fixes "Warning: failed to set MAC address" on platforms which rely on
    an 'ethaddr' environment variable to set the MAC address.

    This bug was introduced by this commit:

    7616e785 Add Ethernet hardware MAC address framework to usbnet

    Signed-off-by: Simon Glass
    Tested-by: Kumar Gala
    Tested-by: Michal Simek
    Tested-by: Heiko Schocher

    Simon Glass
     
  • If name is longer than allocated space NAMESIZE
    mac address is rewritten which show error
    message like:

    Error message:
    Warning: Xlltemac.87000000 MAC addresses don't match:
    Address in SROM is 30:00:00:00:00:00
    Address in environment is 00:0a:35:00:6a:04

    NAMESIZE contains Driver name + zero terminated character.

    Signed-off-by: Michal Simek

    Michal Simek
     

09 Aug, 2011

1 commit

  • Built-in Ethernet adapters support setting the mac address by means of a
    ethaddr environment variable for each interface (ethaddr, eth1addr, eth2addr).

    This adds similar support to the USB network side, using the names
    usbethaddr, usbeth1addr, etc. They are kept separate since we don't want
    a USB device taking the MAC address of a built-in device or vice versa.

    Signed-off-by: Simon Glass
    Tested-by: Eric Bénard

    Simon Glass
     

03 Aug, 2011

1 commit


21 Apr, 2011

1 commit

  • Extends the mii_dev structure to participate in a full-blown MDIO and
    PHY driver scheme. The mii_dev structure and miiphy calls are modified
    in such a way to allow the original mii command and miiphy
    infrastructure to work as before, but also to support a new set of APIs
    which allow (among other things) sharing of PHY driver code and 10G support

    The mii command will continue to support normal PHY management functions
    (Clause 22 of 802.3), but will not be changed to support 10G
    (Clause 45).

    The basic design is similar to PHY Lib from Linux, but simplified for
    U-Boot's network and driver infrastructure.

    We now have MDIO drivers and PHY drivers

    An MDIO driver provides:
    read
    write
    reset

    A PHY driver provides:
    (optionally): probe
    config - initial setup, starting of auto-negotiation
    startup - waiting for AN, and reading link state
    shutdown - any cleanup needed

    The ethernet drivers interact with the PHY Lib using these functions:
    phy_connect()
    phy_config()
    phy_startup()
    phy_shutdown()

    Each PHY driver can be configured separately, or all at once using
    config_phylib_all_drivers.h (added in the patch which adds the drivers)

    We also provide generic drivers for Clause 22 (10/100/1000), and
    Clause 45 (10G) PHYs.

    We also implement phy_reset(), and call it in phy_connect(). Because
    phy_reset() is essentially the same as miiphy_reset, but:
    a) must support 10G PHYs, and
    b) should use the phylib primitives,

    we implement miiphy_reset, using phy_reset(), but only when
    CONFIG_PHYLIB is set. Otherwise, we just use the old version. In this
    way, we save on compile size, even if we don't manage to save code size.

    Pulled ethtool.h and mdio.h from:
    git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
    782d640afd15af7a1faf01cfe566ca4ac511319d
    With many, many deletions so as to enable compilation under u-boot

    Signed-off-by: Andy Fleming
    Signed-off-by: Kumar Gala
    Acked-by: Detlev Zundel

    Andy Fleming
     

20 Feb, 2011

2 commits


15 Nov, 2010

1 commit

  • This has always been confusing, and the idea of these functions returning the
    number of interfaces initialized was half-baked and ultimately pointless.
    Instead, act more like regular functions and return < 0 on failure, >= 0 on
    success.

    This change shouldn't break anything.

    Signed-off-by: Ben Warren

    Ben Warren
     

12 Oct, 2010

1 commit


10 Aug, 2010

1 commit

  • Commit 6e37b1a3a25004d3df5867de49fff6b3fc9c4f04 modifies several net calls
    to take a (const char *) parameter instead of (char *), but in some cases
    the modified functions call other functions taking (char *). The end result
    is warnings about discarding the const qualifier.

    This patch fixes these other function signatures.

    Signed-off-by: Ben Warren

    Ben Warren
     

12 Jul, 2010

1 commit

  • Some commands operate on eth device names (like 'mii'), but those cannot
    be passed on the command line as one argument. So detect devices like
    these and warn about them so someone will fix it.

    Signed-off-by: Mike Frysinger
    Signed-off-by: Ben Warren

    Mike Frysinger
     

20 Jun, 2010

1 commit


04 May, 2010

2 commits


14 Dec, 2009

1 commit