User: Password:
|
|
Subscribe / Log in / New account

Platform devices and device trees

Platform devices and device trees

Posted Jun 24, 2011 0:28 UTC (Fri) by dlang (subscriber, #313)
In reply to: Platform devices and device trees by glikely
Parent article: Platform devices and device trees

this is a common enough issue that it may be worth defining a 'magic' MAC address (all 0's??) and if you see that going through a list of steps to create a MAC address (ending with generate something random). Ideally each step on this list could fail cleanly so all such checks could be gathered into one 'I have no real MAC address, generate one' routine.


(Log in to post comments)

Platform devices and device trees

Posted Jun 24, 2011 18:47 UTC (Fri) by broonie (subscriber, #7078) [Link]

It's extremely common and the kernel is already doing stuff to handle the case where it can't get a MAC address at all. The issue here is not that there's no MAC address, it's that the MAC is being shipped in a non-standard location (eg, a bootloader variable) and we need a way to hand that value to the chip. Once the kernel has the data there's not much problem.

Platform devices and device trees

Posted Jun 24, 2011 22:17 UTC (Fri) by dlang (subscriber, #313) [Link]

in reading the post, it sounded to me like he had special code in the driver so that if there was no eeprom with the MAC address, he would generate it from the cpuid.

yes, it would be nice for the code to look in the device tree to see if there is a MAC address provided.

but if there isn't, he shouldn't have special case code in that one driver to calculate the MAC, he should call the general case code to handle the case where there is no MAC (and come to think of it, that general case code should probably be what is taught to look in the device tree for the MAC)


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds