device_get_ethdev_address(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

๐Ÿ‘‘ device_get_ethdev_address(9) โ€” Kernel API Manual, bestie edition

okay so picture this: it's a (9) man page, it lives in the Kernel API Manual, and its whole personality is "hey, grab that MAC address and put it where it belongs." that's the vibe. let's get into it ๐ŸŽ€


โœจ NAME โœจ

device_get_ethdev_address โ€” literally just set the netdev's MAC address from a given device. that's it. that's the whole job. slay ๐Ÿ’…


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

int device_get_ethdev_address (struct device *dev , struct net_device
*netdev );

look at that signature. it's giving clean, it's giving intentional. two pointers and a return code, no drama ๐ŸŒธ


๐Ÿ’– ARGUMENTS ๐Ÿ’–

  • dev โ€” a pointer to the device. yes, the struct device * one. you're handing it over, it's the source of truth ๐Ÿซถ
  • netdev โ€” a pointer to the netdev you're writing the address to. this is the destination, the main character of this little operation โœจ

๐ŸŒˆ DESCRIPTION ๐ŸŒˆ

so basically, device_get_ethdev_address is a wrapper around device_get_mac_address โ€” and the way it does its thing is by writing the address directly into netdev->dev_addr. no middleman vibes, no extra steps, just straight to the field. iconic honestly ๐Ÿ˜ญ

like, it's a small function, but it knows exactly what it is, and that's more than most of us can say ๐Ÿ’€


๐Ÿ”ฅ SEE ALSO ๐Ÿ”ฅ

the whole friend group, fr fr โ€” these live in the kernel file ./net/ethernet/eth.c:

ngl that's a stacked roster ๐Ÿ˜ฎโ€๐Ÿ’จ go read them all, iykyk ๐Ÿ“š


anyway that's the page!! sourced from ./net/ethernet, dated October 2026, and yes that date is giving slightly futuristic but we move ๐Ÿ’œ bye bestie, go set some MAC addresses ๐Ÿงš

๐Ÿ“ฆ where this page comes from