Skip to contentSkip to conversation

Usage of arch_get_platform_mac_address() or the lack thereof

DISCUSSION Rolf Eike Beer 1 participant 1 message Sep 5, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,

just for the fun of it I'm poking a bit through the sunhme driver. I noticed that this driver as well as many other sun related drivers directly use idprom->id_ethaddr, but noone uses arch_get_platform_mac_address(). Some drivers use eth_platform_get_mac_address() instead, which does some more querying of of_* properties to find out the mac address.

So, what is the right way of doing this? sungem and sunhme query "local-mac- address" before, but do not query the other possibilities used in of_get_mac_address(), and neither of them checks for all-zeroes and other things in the returned addresses. sungme will error out if that does not return any address, sunhme will simply leave the mac address unassigned.

What would be the correct way of doing this? Should all these driver be ported to use arch_get_platform_mac_address() or eth_platform_get_mac_address()?

Eike