eth_hw_addr_gen(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 NAME 🌸

eth_hw_addr_gen β€” Generate and assign Ethernet address to a port πŸ’–

okay so this page is eth_hw_addr_gen(9) from the Kernel API Manual, and it's literally here to help you generate and assign an Ethernet address to a port. iconic.


✨ SYNOPSIS ✨

void eth_hw_addr_gen (struct net_device *dev , const u8 *base_addr ,
       unsigned int id );

πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” pointer to port's net_device structure 🫢
  • base_addr β€” base Ethernet address ✨
  • id β€” offset to add to the base address πŸŽ€

πŸ’… DESCRIPTION πŸ’…

So basically: generate a MAC address using a base address and an offset, then assign it to a net_device. That's the whole vibe check βœ….

Switch drivers are the ones that commonly use this, because they need to compute addresses for all their ports β€” it's giving β€œone base address, many ports” main character energy πŸ‘‘.

important note bestie: addr_assign_type is not changed. Not even a little. No cap. πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹

fr fr, check the kernel file ./include/linux/etherdevice.h, plus all these besties:


made with πŸ’– from ./include/linux, October 2026, for eth_hw_addr_gen(9) β€” bye bestie, go generate those addresses slay ✨🫢

πŸ“¦ where this page comes from