nps_enet_set_mac_address(9)
π nps_enet_set_mac_address(9) β the Kernel API Manual, bestie edition
okay so like, welcome to the Kernel API Manual β¨ this one's a little function from the EZchip NPS ethernet world and it does exactly one (1) job: giving your device its MAC address. slay. let's get into it π
πΈ NAME πΈ
nps_enet_set_mac_address β set the MAC address for this device. literally that's it, that's the whole vibe π
β¨ SYNOPSIS β¨
s32 nps_enet_set_mac_address (struct net_device *ndev , void *p );
that's the whole signature, no cap. two arguments, returns an s32. iconic π«Ά
π¦ ARGUMENTS π¦
ndevβ pointer to thenet_devicestructure. like, the device we're doing this for πpβ the 6 byte address that's gonna be written as the MAC address. six bytes, that's the whole thing, don't come at me with more π
π DESCRIPTION π
so what it actually does β and this part is important so listen up β this function copies the HW address from the sockaddr structure over to the net_device structure, and then it updates the address in the HW too. so it's a double whammy: the software struct gets it and the hardware gets it. main character energy on both fronts fr fr π
no extra steps, no secret tricks, that is the entire bit π§
β RETURN β
-EBUSYβ if the net device is busy π like it's occupied, can't do it right now0β if the address was set successfully π slay
π₯ SEE ALSO π₯
kernel file ./drivers/net/ethernet/ezchip/nps_enet.c β go read it, iykyk π
and the whole friend group:
nps_enet_poll(9)nps_enet_irq_handler(9)nps_enet_hw_reset(9)nps_enet_set_rx_mode(9)nps_enet_open(9)nps_enet_stop(9)nps_enet_start_xmit(9)
all of them, no skips, we love a complete set π
ngl this page lives in ./drivers/net/ethernet/ezchip and it's dated October 2026 β so like, shoutout to the source and the version, they ate and left no crumbs ππ 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