drivers/net/dsa/microchip/ksz_common.c
Source file repositories/reference/linux-study-clean/drivers/net/dsa/microchip/ksz_common.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/dsa/microchip/ksz_common.c- Extension
.c- Size
- 129329 bytes
- Lines
- 4576
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/delay.hlinux/dsa/ksz_common.hlinux/export.hlinux/gpio/consumer.hlinux/kernel.hlinux/module.hlinux/platform_data/microchip-ksz.hlinux/phy.hlinux/etherdevice.hlinux/if_bridge.hlinux/if_vlan.hlinux/irq.hlinux/irqdomain.hlinux/of.hlinux/of_mdio.hlinux/of_net.hlinux/micrel_phy.hlinux/pinctrl/consumer.hnet/dsa.hnet/ieee8021q.hnet/pkt_cls.hnet/switchdev.hksz_common.hksz_dcb.hksz_ptp.hksz8.hksz9477.hlan937x.h
Detected Declarations
struct ksz_stats_rawstruct ksz88xx_stats_rawstruct ksz_driver_strength_propstruct ksz_drive_strengthenum ksz_driver_strength_typefunction ksz_phylink_mac_disable_tx_lpifunction ksz_check_device_idfunction ksz_phylink_get_capsfunction ksz_r_mib_stats64function ksz88xx_r_mib_stats64function ksz_get_stats64function ksz_get_pause_statsfunction ksz_get_stringsfunction ksz_update_port_memberfunction ksz_sw_mdio_readfunction ksz_sw_mdio_writefunction ksz_parent_mdio_readfunction ksz_parent_mdio_writefunction ksz_phy_addr_to_portfunction dsa_switch_for_each_user_portfunction ksz_irq_phy_setupfunction ksz_irq_phy_freefunction ksz_parse_dt_phy_configfunction dsa_switch_for_each_user_portfunction ksz_mdio_registerfunction ksz_irq_maskfunction ksz_irq_unmaskfunction ksz_irq_bus_lockfunction ksz_irq_bus_sync_unlockfunction ksz_irq_domain_mapfunction ksz_irq_freefunction ksz_irq_thread_fnfunction ksz_irq_common_setupfunction ksz_girq_setupfunction ksz_pirq_setupfunction ksz_teardownfunction port_r_cntfunction ksz_mib_read_workfunction ksz_init_mib_timerfunction ksz_phylink_mac_link_downfunction ksz_sset_countfunction ksz_get_ethtool_statsfunction ksz_port_bridge_joinfunction ksz_port_bridge_leavefunction ksz_port_stp_state_setfunction ksz_port_pre_bridge_flagsfunction ksz_port_bridge_flagsfunction ksz_max_mtu
Annotated Snippet
struct ksz_stats_raw {
u64 rx_hi;
u64 rx_undersize;
u64 rx_fragments;
u64 rx_oversize;
u64 rx_jabbers;
u64 rx_symbol_err;
u64 rx_crc_err;
u64 rx_align_err;
u64 rx_mac_ctrl;
u64 rx_pause;
u64 rx_bcast;
u64 rx_mcast;
u64 rx_ucast;
u64 rx_64_or_less;
u64 rx_65_127;
u64 rx_128_255;
u64 rx_256_511;
u64 rx_512_1023;
u64 rx_1024_1522;
u64 rx_1523_2000;
u64 rx_2001;
u64 tx_hi;
u64 tx_late_col;
u64 tx_pause;
u64 tx_bcast;
u64 tx_mcast;
u64 tx_ucast;
u64 tx_deferred;
u64 tx_total_col;
u64 tx_exc_col;
u64 tx_single_col;
u64 tx_mult_col;
u64 rx_total;
u64 tx_total;
u64 rx_discards;
u64 tx_discards;
};
struct ksz88xx_stats_raw {
u64 rx;
u64 rx_hi;
u64 rx_undersize;
u64 rx_fragments;
u64 rx_oversize;
u64 rx_jabbers;
u64 rx_symbol_err;
u64 rx_crc_err;
u64 rx_align_err;
u64 rx_mac_ctrl;
u64 rx_pause;
u64 rx_bcast;
u64 rx_mcast;
u64 rx_ucast;
u64 rx_64_or_less;
u64 rx_65_127;
u64 rx_128_255;
u64 rx_256_511;
u64 rx_512_1023;
u64 rx_1024_1522;
u64 tx;
u64 tx_hi;
u64 tx_late_col;
u64 tx_pause;
u64 tx_bcast;
u64 tx_mcast;
u64 tx_ucast;
u64 tx_deferred;
u64 tx_total_col;
u64 tx_exc_col;
u64 tx_single_col;
u64 tx_mult_col;
u64 rx_discards;
u64 tx_discards;
};
static const struct ksz_mib_names ksz88xx_mib_names[] = {
{ 0x00, "rx" },
{ 0x01, "rx_hi" },
{ 0x02, "rx_undersize" },
{ 0x03, "rx_fragments" },
{ 0x04, "rx_oversize" },
{ 0x05, "rx_jabbers" },
{ 0x06, "rx_symbol_err" },
{ 0x07, "rx_crc_err" },
{ 0x08, "rx_align_err" },
{ 0x09, "rx_mac_ctrl" },
{ 0x0a, "rx_pause" },
{ 0x0b, "rx_bcast" },
{ 0x0c, "rx_mcast" },
Annotation
- Immediate include surface: `linux/delay.h`, `linux/dsa/ksz_common.h`, `linux/export.h`, `linux/gpio/consumer.h`, `linux/kernel.h`, `linux/module.h`, `linux/platform_data/microchip-ksz.h`, `linux/phy.h`.
- Detected declarations: `struct ksz_stats_raw`, `struct ksz88xx_stats_raw`, `struct ksz_driver_strength_prop`, `struct ksz_drive_strength`, `enum ksz_driver_strength_type`, `function ksz_phylink_mac_disable_tx_lpi`, `function ksz_check_device_id`, `function ksz_phylink_get_caps`, `function ksz_r_mib_stats64`, `function ksz88xx_r_mib_stats64`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.