device_get_ethdev_address(9)
๐ 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, thestruct 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:
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)fwnode_get_mac_address(9)device_get_mac_address(9)
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
- 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