Skip to content

MAC address is forced on all connected lan95xx devices #394

Closed

Description

@P33M

Ref commit b102abd

If additional 10/100 ethernet dongles using the smsc 9500/951x chipset are attached to the Pi. they all end up with the same MAC address. This is bad if they end up attached to the same network segment.

Activity

  1. ghost assigned on Oct 8, 2013
  2. notro commented on Oct 24, 2013

    @notro
    Contributor

    Changing the order will help chips that has an eeprom connected:

     static void smsc95xx_init_mac_address(struct usbnet *dev)
     {
    -      /* Check module parameters */
    -      if (smsc95xx_is_macaddr_param(dev, dev->net->dev_addr))
    -              return;
    - 
        /* try reading mac address from EEPROM */
        if (smsc95xx_read_eeprom(dev, EEPROM_MAC_OFFSET, ETH_ALEN,
                dev->net->dev_addr) == 0) {
            if (is_valid_ether_addr(dev->net->dev_addr)) {
                /* eeprom values are valid so use them */
                netif_dbg(dev, ifup, dev->net, "MAC address read from EEPROM\n");
                return;
            }
        }
    
    +        /* Check module parameters */
    +        if (smsc95xx_is_macaddr_param(dev, dev->net->dev_addr))
    +                return;
    + 
        /* no eeprom, or eeprom values are invalid. generate random MAC */
        eth_hw_addr_random(dev->net);
        netif_dbg(dev, ifup, dev->net, "MAC address set to eth_random_addr\n");
     }
    

    In the case of more than one chip without an eeprom, the address can be changed like this:

    /etc/network/interfaces

    auto eth0
    iface eth0 inet dhcp
    hwaddress ether b8:27:eb:39:78:8f
    

    I don't know how common it is to not have an eeprom with these chips. Maybe the cheap dongles don't have it?

  3. Ruffio commented on Aug 10, 2016

    @Ruffio

    @P33M has this issue been resolved? If yes, then please close this issue.

  4. popcornmix commented on Aug 10, 2016

    @popcornmix
    Collaborator

    If there is an eprom, it will now take precedence: 55e8519

  5. Ruffio commented on Aug 29, 2016

    @Ruffio

    @P33M has this issue been fixed? If so, please this issue, thanks.

  6. JamesH65 commented on May 17, 2017

    @JamesH65
    Contributor

    @P33M Can this be closed?

  7. P33M commented on May 17, 2017

    @P33M
    ContributorAuthor

    smsc95xx.c now looks up of_get_mac_address. Our DT specifies a local-mac-address for one USB device node only, so this is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions