Skip to content

Commit

Permalink
net: smsc911x: allow platform_data to specify mac address
Browse files Browse the repository at this point in the history
Extend the driver to accept a MAC address specified in platform_data.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Manuel Lauss authored and David S. Miller committed Oct 13, 2009
1 parent b4efc56 commit aace495
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/smsc911x.c
Original file line number Diff line number Diff line change
Expand Up @@ -2071,6 +2071,9 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)
if (is_valid_ether_addr(dev->dev_addr)) {
smsc911x_set_hw_mac_address(pdata, dev->dev_addr);
SMSC_TRACE(PROBE, "MAC Address is specified by configuration");
} else if (is_valid_ether_addr(pdata->config.mac)) {
memcpy(dev->dev_addr, pdata->config.mac, 6);
SMSC_TRACE(PROBE, "MAC Address specified by platform data");
} else {
/* Try reading mac address from device. if EEPROM is present
* it will already have been set */
Expand Down
1 change: 1 addition & 0 deletions include/linux/smsc911x.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ struct smsc911x_platform_config {
unsigned int irq_type;
unsigned int flags;
phy_interface_t phy_interface;
unsigned char mac[6];
};

/* Constants for platform_device irq polarity configuration */
Expand Down

0 comments on commit aace495

Please sign in to comment.