STRUCT NET_LOCAL(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct net_local(9) πŸ’–

okay so this is a page from the Kernel API Manual, and it's all about struct net_local β€” literally our private per device data. yes bestie, "our" β€” it's the driver's own lil stash of stuff it needs to remember about each device πŸŽ€


✨ SYNOPSIS ✨

struct net_local {
    struct net_device *ndev;
    bool tx_ping_pong;
    bool rx_ping_pong;
    u32 next_tx_buf_to_use;
    u32 next_rx_buf_to_use;
    void __iomem *base_addr;
    spinlock_t reset_lock;
    struct sk_buff *deferred_skb;
    struct phy_device *phy_dev;
    struct device_node *phy_node;
    struct mii_bus *mii_bus;
    int last_link;
 };

like, that's the whole struct, she's not huge but she's doing a LOT πŸ’…


🌸 Members 🌸

  • ndev β€” the instance of the network device. the main character, fr fr πŸ‘‘
  • tx_ping_pong β€” tells you whether the Tx Pong buffer is configured in HW πŸ“
  • rx_ping_pong β€” tells you whether the Rx Pong buffer is configured in HW. yep, matching energy πŸ“
  • next_tx_buf_to_use β€” the next Tx buffer to write to ✍️
  • next_rx_buf_to_use β€” the next Rx buffer to read from πŸ‘€
  • base_addr β€” base address of the Emaclite device πŸ“
  • reset_lock β€” lock to serialize xmit and tx_timeout execution. no cap, nobody's cutting in line πŸ”’
  • deferred_skb β€” holds an skb (for transmission at a later time) when the Tx buffer is not free 😭 like sorry babe, you're gonna have to wait
  • phy_dev β€” pointer to the PHY device πŸ¦‹
  • phy_node β€” pointer to the PHY device node 🌸
  • mii_bus β€” pointer to the MII bus 🚌
  • last_link β€” last link status. keeping receipts on the link, always πŸ“

🌈 SEE ALSO 🌈

Kernel file ./drivers/net/ethernet/xilinx/xilinx_emaclite.c β€” that's the whole vibe, iykyk πŸ’œ

and then, in no particular order but like, ALL of them (do not skip, we don't do that here):

like, that's the entire friend group right there 🫢


ok that's the page!! πŸ’– it came from ./drivers/net/ethernet/xilinx, dated October 2026, and it's page struct net_local(9) of the Kernel API Manual. go forth and slay ur network driver bestie βœ¨πŸŽ€πŸ¦‹
πŸ“¦ where this page comes from