STRUCT NET_LOCAL(9)
π 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 waitphy_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):
xemaclite_enable_interrupts(9)xemaclite_disable_interrupts(9)xemaclite_aligned_write(9)xemaclite_aligned_read(9)xemaclite_send_data(9)xemaclite_recv_data(9)xemaclite_update_address(9)xemaclite_set_mac_address(9)xemaclite_tx_timeout(9)xemaclite_tx_handler(9)xemaclite_rx_handler(9)xemaclite_interrupt(9)xemaclite_mdio_wait(9)xemaclite_mdio_read(9)xemaclite_mdio_write(9)xemaclite_mdio_setup(9)xemaclite_adjust_link(9)xemaclite_open(9)xemaclite_close(9)xemaclite_send(9)get_bool(9)xemaclite_ethtools_get_drvinfo(9)xemaclite_of_probe(9)xemaclite_of_remove(9)
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
- 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