STRUCT MXL862XX_PRIV(9)
β¨ 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_ERRgets set before the CRC-triggered shutdown and cleared after it.MXL862XX_FLAG_WORK_STOPPEDgets set before cancellingstats_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 withMXL862XX_FW_VER_MIN. vibe check for firmware, basically πserdes_portsβ SerDes interfaces incl. sub-interfaces in case of10G_QXGMIIorQSGMII. yes, the sub-interfaces too, we don't leave the siblings out πserdes_refcountβ per-XPCS count of sub-ports enabled by phylink;pcs_disablepowers an XPCS down when the count reaches zero. protected byserdes_lock. the count hitting zero is the whole plot twist π₯serdes_lockβ serializes theserdes_refcounttransitions 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 bydsa_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 π«Ά
- Kernel file
./drivers/net/dsa/mxl862xx/mxl862xx.h mxl862xx_fw_portmap_set_bit(9)mxl862xx_fw_portmap_clear_bit(9)mxl862xx_fw_portmap_is_empty(9)struct mxl862xx_vf_vid(9)struct mxl862xx_vf_block(9)struct mxl862xx_evlan_block(9)struct mxl862xx_port_stats(9)struct mxl862xx_port(9)struct mxl862xx_pcs(9)struct mxl862xx_fw_version(9)
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
- 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