STRUCT ETHOC(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct ethoc(9) β€” the driver's lil private clubhouse 🏠✨

okay so bestie, picture this: you're deep in the kernel, you're writing a network driver, and you need somewhere to keep All Your Stuff. That's this struct. It's the driver-private device structure for the ethoc driver, and it is literally the main character of ./drivers/net/ethernet/ethoc.c. No cap. 🫢

This page lives in the Kernel API Manual, section 9 β€” the one for kernel internals, iykyk. 🌈


✨ SYNOPSIS ✨

struct ethoc {
    void __iomem *iobase;
    void __iomem *membase;
    bool big_endian;
    unsigned int num_bd;
    unsigned int num_tx;
    unsigned int cur_tx;
    unsigned int dty_tx;
    unsigned int num_rx;
    unsigned int cur_rx;
    void **vma;
    struct net_device *netdev;
    struct napi_struct napi;
    u32 msg_enable;
    spinlock_t lock;
    struct mii_bus *mdio;
    struct clk *clk;
    s8 phy_id;
    int old_link;
    int old_duplex;
 };

like, look at her. every field accounted for, nothing extra, so organized. we stan a tidy struct. πŸŽ€


🌸 Members 🌸

okay now the meet-the-cast portion of the page, let's go member by member πŸ’…

  • iobase β€” pointer to the I/O memory region. her home base 🏑
  • membase β€” pointer to the buffer memory region. the other home base, but for buffers 🧚
  • big_endian β€” just big or little (endian). that's it, that's the whole vibe check πŸ”„
  • num_bd β€” number of buffer descriptors πŸ“‹
  • num_tx β€” number of send buffers πŸ“€
  • cur_tx β€” last send buffer written ✍️
  • dty_tx β€” last buffer actually sent. past tense, bestie, it's gone πŸš€
  • num_rx β€” number of receive buffers πŸ“₯
  • cur_rx β€” current receive buffer πŸ‘€
  • vma β€” pointer to array of virtual memory addresses for buffers πŸ—ΊοΈ
  • netdev β€” pointer to network device structure. the whole reason we're here ngl 🌐
  • napi β€” NAPI structure ⚑
  • msg_enable β€” device state flags 🚩
  • lock β€” device lock πŸ”’
  • mdio β€” MDIO bus for PHY access πŸ”Œ
  • clk β€” clock ⏰
  • phy_id β€” address of attached PHY πŸͺͺ
  • old_link β€” previous link info πŸ”—
  • old_duplex β€” previous duplex info πŸ”
bestie note: nothing here is optional reading, these are all just fields of one struct, so don't come for me about the bullet list. every single one is listed, periodt. πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘

if you want the lore extended universe, go read the kernel file ./drivers/net/ethernet/ethoc.c, plus these absolute icons:

like, the whole squad. read them fr fr πŸ“šπŸ¦‹


and that's the page!! sourced from way down in ./drivers/net/ethernet, dated October 2026, section 9 of the Kernel API Manual β€” ty for coming to my ted talk, ily, go read the other ethoc pages πŸ«ΆπŸ’–πŸŒΈβœ¨πŸ“

πŸ“¦ where this page comes from