nps_enet_set_mac_address(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 the net_device structure. 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 now
  • 0 β€” 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:

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