add_mac_addr(9)
π add_mac_addr(9) β like, the whole manual page, bestie
okay so this is add_mac_addr(9) from the Kernel API Manual, and honestly? it's a little one. a snack-sized syscall-adjacent moment. but we're gonna give it the full main character treatment anyway because every function deserves to be understood. π
β¨ NAME β¨
add_mac_addr β adds a mac address to a network device. that's it. that's the whole vibe. π¦
β¨ SYNOPSIS β¨
int add_mac_addr (struct net_device *netdev , const u8 *addr );
literally just copy that exactly, do not "fix" the spacing, the spacing is iconic and we respect it. π
β¨ ARGUMENTS β¨
netdevβ the network device in question. the little guy you're handing a mac address to. π«Άaddrβ the mac address you want to add. the actual bytes. the moment. β¨
β¨ DESCRIPTION β¨
so here's the tea: it returns 0 when it works β that's success, slay β and a negative value when it doesn't. that's failure, and we do not stan failure, but we do respect it as a documented outcome. π
like, that's genuinely the whole description in the original. return 0 = success, negative = failure. no cap. π
ngl bestie, there's nothing else documented here β no error codes, no preconditions, no nothing. if you need more deets, go read the source. π₯
β¨ SEE ALSO β¨
- the kernel file
./drivers/net/ethernet/huawei/hinic/hinic_main.cβ that's where the real lore lives π create_txqs(9),free_txqs(9),create_rxqs(9),free_rxqs(9)β the queue girlies πΈchange_mac_addr(9),remove_mac_addr(9)β the mac address trilogy, and you're on part one π§link_status_event_handler(9)β handles the link status events, very busy, very important πnic_dev_init(9)β where the nic gets its life together π
aaaand that's the page!! short and sweet, just like the original. it's giving "one job, done correctly, returns zero." β
to wrap up with the cute sign-off: this page lives under the source path ./drivers/net/ethernet/huawei/... and it's dated October 2026, and yes, the title at the bottom is still add_mac_addr(9) because we love a consistent footer. bye bestie, go add those mac addresses responsibly π
π¦ 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