fwnode_get_mac_address(9)
π fwnode_get_mac_address(9) π
okay so welcome to the Kernel API Manual, section 9 bestie β this is the page for fwnode_get_mac_address, and we're gonna get you the MAC address straight out of a firmware node. it's giving "finding your friend's actual number in a group chat full of burner phones" β¨
πΈ NAME πΈ
fwnode_get_mac_address β get the MAC from the firmware node. literally that's the whole thing, no cap π
β¨ SYNOPSIS β¨
int fwnode_get_mac_address (struct fwnode_handle *fwnode , char *addr );
π¦ ARGUMENTS π¦
fwnodeβ pointer to the firmware node π like, the node we're snooping throughaddrβ address of the buffer where the MAC gets stored π bring your own buffer, this function doesn't bring one for you
π DESCRIPTION π
so the whole job is: search the firmware node for the best MAC address to use. bestie, there's a whole priority order here and it's lowkey a ranking system π
'mac-address' gets checked first, because that one is supposed to contain the "most recent" MAC address. main character energy fr fr.
if that isn't set, then 'local-mac-address' is checked next, because that's the default address. the reliable backup bestie π«Ά
if that isn't set, then the obsolete
π okay so the source page literally cuts off right there. "then the obsolete" and nothing else. not me staring at the screen waiting for the rest π i'm not gonna invent a third property for you β that's a no from me, we don't make stuff up in this house.
also important, and this is the iconic chaotic bit: the 'address' property is supposed to contain a virtual address of the register set, but some DTS files have redefined that property to be the MAC address. π yes, really. redefining a whole property, the audacity.
and β¨ all-zero MAC addresses are rejected β¨ β because those could be properties that exist in the firmware tables, but were not updated by the firmware. like a placeholder contact you never saved π
for example: the DTS could define 'mac-address' and 'local-mac-address', with zero MAC addresses. some older U-Boots only initialized 'local-mac-address'. in that case, the real MAC is in 'local-mac-address', and 'mac-address' exists but is all zeros. so yeah β zero means "not it, keep looking", and this function knows better than to hand you a fake one π
π₯ SEE ALSO π₯
kernel file ./net/ethernet/eth.c and honestly the whole ethernet friend group π
eth_header(9)eth_get_headlen(9)eth_type_trans(9)eth_header_cache(9)eth_header_cache_update(9)eth_header_parse_protocol(9)eth_prepare_mac_addr_change(9)eth_commit_mac_addr_change(9)eth_mac_addr(9)ether_setup(9)alloc_etherdev_mqs(9)platform_get_ethdev_address(9)nvmem_get_mac_address(9)device_get_mac_address(9)device_get_ethdev_address(9)
anyway that's the page π it lives in ./net/ethernet, dated October 2026, and it's fwnode_get_mac_address(9) forever and always. go get that MAC, bestie β slay π
β¨π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms