fwnode_get_mac_address(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 through
  • addr β€” 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 πŸ‘‘


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