STRUCT MXL862XX_PRIV(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

struct mxl862xx_priv β€” the driver's own private little lore vault for an MxL862xx switch πŸ’… (this page lives in the Kernel API Manual, bestie, so you know it's official)


🌸 SYNOPSIS 🌸

struct mxl862xx_priv {
    struct dsa_switch *ds;
    struct mdio_device *mdiodev;
    struct work_struct crc_err_work;
    unsigned long flags;
    u16 drop_meter;
    struct mxl862xx_fw_version fw_version;
    struct mxl862xx_pcs serdes_ports[8];
    int serdes_refcount[2];
    struct mutex serdes_lock;
    struct mxl862xx_port ports[MXL862XX_MAX_PORTS];
    u16 bridges[MXL862XX_MAX_BRIDGES + 1];
    u16 evlan_ingress_size;
    u16 evlan_egress_size;
    u16 vf_block_size;
    struct delayed_work stats_work;
 };

Look at that struct. It's giving "organized chaos but make it iconic" πŸŽ€ Every field is copy-pasted exactly as-is, no cap, don't touch a single character.


πŸ’… Members πŸ’…

okay so let's go through the whole roster, main character by main character 🌟

  • ds β€” pointer to the DSA switch instance. That's the whole reason we're here fr fr πŸ¦‹
  • mdiodev β€” the MDIO device we use to talk to the switch firmware. think of it as the group chat where the driver and the firmware actually communicate 😭
  • crc_err_work β€” deferred work for shutting down all ports when MDIO CRC errors happen. yes, all of them. dramatic? absolutely. necessary? also yes πŸ’€
  • flags β€” atomic status flags, lowkey important:
    • MXL862XX_FLAG_CRC_ERR gets set before the CRC-triggered shutdown and cleared after it.
    • MXL862XX_FLAG_WORK_STOPPED gets set before cancelling stats_work, so nothing tries to reschedule during teardown. protective queen behavior 🫢
  • drop_meter β€” index of the single shared zero-rate firmware meter used to unconditionally drop traffic (used to block flooding). one meter, one job, zero forgiveness ✨
  • fw_version β€” the cached firmware version, populated at probe and compared with MXL862XX_FW_VER_MIN. vibe check for firmware, basically 🌈
  • serdes_ports β€” SerDes interfaces incl. sub-interfaces in case of 10G_QXGMII or QSGMII. yes, the sub-interfaces too, we don't leave the siblings out πŸ’œ
  • serdes_refcount β€” per-XPCS count of sub-ports enabled by phylink; pcs_disable powers an XPCS down when the count reaches zero. protected by serdes_lock. the count hitting zero is the whole plot twist πŸ”₯
  • serdes_lock β€” serializes the serdes_refcount transitions with the XPCS power-down, so a sibling sub-port enable cannot race a power-down to zero. literally the chaos-prevention lock, we stan πŸŽ€
  • ports β€” per-port state, indexed by switch port number. one entry per port, no skipping πŸ“
  • bridges β€” maps DSA bridge number β†’ firmware bridge ID. a value of zero means no firmware bridge was allocated for that DSA bridge number. indexed by dsa_bridge.num (0 .. ds->max_num_bridges). careful with the range, bestie πŸ‘‘
  • evlan_ingress_size β€” per-port ingress Extended VLAN block size 🌸
  • evlan_egress_size β€” per-port egress Extended VLAN block size 🌸 (yes, egress, they're different, don't mix them up)
  • vf_block_size β€” per-port VLAN Filter block size ⭐
  • stats_work β€” periodic work item that polls RMON hardware counters and accumulates them into 64-bit per-port stats. it just keeps showing up and doing the work, honestly relatable πŸ˜­πŸ’–

πŸ¦‹ SEE ALSO πŸ¦‹

the whole friend group, no one left behind 🫢


ngl this whole page came from ./drivers/net/dsa/mxl862xx, dated October 2026 β€” so if you're reading this in the future, hey bestie, you're right on time πŸ’–βœ¨πŸ‘‘
πŸ“¦ where this page comes from