Re: [PATCH] smsc95xx: add macaddr module parameter

From
Danny Kukawka <hidden>
Date
2012-01-31 18:18:01
Also in
lkml
Reply to
Alan Cox, 2012-01-31
On Dienstag, 31. Januar 2012, Alan Cox wrote:
On Tue, 31 Jan 2012 18:20:33 +0100

Danny Kukawka [off-list ref] wrote:
quoted
Added smsc95xx.macaddr module parameter to allow the user to
change the MAC address on boot if there was no MAC on the EEPROM.
NAK. Please see the discussion on this and ifconfig hw for other devices.

In summary - make the device refuse to ifconfig up without a valid
address, allow it to come into existance without a valid address and then
use ifconfig.


Your patch also seems to break if there are several attached to a board.
There are already other kernel driver which allow to override the (hw) MAC 
address via a module parameter (macaddr): 
- KSZ8841/2 PCI network driver (drivers/net/ethernet/micrel/ksz884x.c)
- FEC Ethernet driver (drivers/net/ethernet/freescale/fec.c)
- Sun HappyMealEthernet(HME) 10/100baseT ethernet driver
  (drivers/net/ethernet/sun/sunhme.c)

By default the MAC from the module parameter get only assigned to the first 
device which got a random MAC (caused by missing EEPROM) before. If you have 
more than one device you can simply assign the MAC to a specific interface 
(e.g. use: macaddr=01:23:45:67:89:ab;eth0). If there are only devices with 
hardware MAC nothing will get changed.

Danny
Thread (4 messages) 4 messages, 3 authors, 2012-01-31
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help