drivers/net/phy/mscc/mscc_main.c
Source file repositories/reference/linux-study-clean/drivers/net/phy/mscc/mscc_main.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/phy/mscc/mscc_main.c- Extension
.c- Size
- 84128 bytes
- Lines
- 3004
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- 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/firmware.hlinux/jiffies.hlinux/kernel.hlinux/module.hlinux/mdio.hlinux/mii.hlinux/phy.hlinux/of.hlinux/netdevice.hdt-bindings/net/mscc-phy-vsc8531.h../phylib.hmscc_serdes.hmscc.h
Detected Declarations
struct vsc85xx_probe_configfunction vsc85xx_phy_read_pagefunction vsc85xx_phy_write_pagefunction vsc85xx_get_sset_countfunction vsc85xx_get_stringsfunction vsc85xx_get_statfunction vsc85xx_get_statsfunction vsc85xx_led_cntl_setfunction vsc85xx_led_combine_disable_setfunction vsc85xx_mdix_getfunction vsc85xx_mdix_setfunction vsc85xx_downshift_getfunction vsc85xx_downshift_setfunction vsc85xx_wol_setfunction vsc85xx_wol_getfunction vsc85xx_edge_rate_magic_getfunction vsc85xx_dt_led_mode_getfunction vsc85xx_edge_rate_magic_getfunction vsc85xx_dt_led_mode_getfunction vsc85xx_dt_led_modes_getfunction vsc85xx_edge_rate_cntl_setfunction vsc85xx_mac_if_setfunction vsc85xx_update_rgmii_cntlfunction vsc85xx_default_configfunction vsc85xx_get_tunablefunction vsc85xx_set_tunablefunction vsc85xx_tr_writefunction vsc8531_pre_init_seq_setfunction vsc85xx_eee_init_seq_setfunction phy_base_writefunction phy_base_readfunction vsc85xx_csr_readfunction vsc85xx_csr_writefunction vsc8584_csr_writefunction vsc8584_cmdfunction vsc8584_micro_deassert_resetfunction vsc8584_micro_assert_resetfunction vsc8584_get_fw_crcfunction vsc8584_patch_fwfunction vsc8574_is_serdes_initfunction vsc8574_config_pre_initfunction vsc8584_pll5g_cfg2_wrfunction vsc8584_mcb_rd_trigfunction vsc8584_mcb_wr_trigfunction vsc8584_pll5g_resetfunction vsc8584_config_pre_initfunction vsc8584_get_base_addrfunction vsc85xx_coma_mode_release
Annotated Snippet
struct vsc85xx_probe_config {
const struct vsc85xx_hw_stat *hw_stats;
size_t shared_size;
size_t nstats;
u16 supp_led_modes;
u8 nleds;
bool check_rate_magic;
bool use_package;
bool has_ptp;
};
static const u32 vsc85xx_default_led_modes_4[] = {
VSC8531_LINK_1000_ACTIVITY,
VSC8531_LINK_100_ACTIVITY,
VSC8531_LINK_ACTIVITY,
VSC8531_DUPLEX_COLLISION
};
static const struct vsc85xx_hw_stat vsc85xx_hw_stats[] = {
{
.string = "phy_receive_errors",
.reg = MSCC_PHY_ERR_RX_CNT,
.page = MSCC_PHY_PAGE_STANDARD,
.mask = ERR_CNT_MASK,
}, {
.string = "phy_false_carrier",
.reg = MSCC_PHY_ERR_FALSE_CARRIER_CNT,
.page = MSCC_PHY_PAGE_STANDARD,
.mask = ERR_CNT_MASK,
}, {
.string = "phy_cu_media_link_disconnect",
.reg = MSCC_PHY_ERR_LINK_DISCONNECT_CNT,
.page = MSCC_PHY_PAGE_STANDARD,
.mask = ERR_CNT_MASK,
}, {
.string = "phy_cu_media_crc_good_count",
.reg = MSCC_PHY_CU_MEDIA_CRC_VALID_CNT,
.page = MSCC_PHY_PAGE_EXTENDED,
.mask = VALID_CRC_CNT_CRC_MASK,
}, {
.string = "phy_cu_media_crc_error_count",
.reg = MSCC_PHY_EXT_PHY_CNTL_4,
.page = MSCC_PHY_PAGE_EXTENDED,
.mask = ERR_CNT_MASK,
},
};
static const struct vsc85xx_hw_stat vsc8584_hw_stats[] = {
{
.string = "phy_receive_errors",
.reg = MSCC_PHY_ERR_RX_CNT,
.page = MSCC_PHY_PAGE_STANDARD,
.mask = ERR_CNT_MASK,
}, {
.string = "phy_false_carrier",
.reg = MSCC_PHY_ERR_FALSE_CARRIER_CNT,
.page = MSCC_PHY_PAGE_STANDARD,
.mask = ERR_CNT_MASK,
}, {
.string = "phy_cu_media_link_disconnect",
.reg = MSCC_PHY_ERR_LINK_DISCONNECT_CNT,
.page = MSCC_PHY_PAGE_STANDARD,
.mask = ERR_CNT_MASK,
}, {
.string = "phy_cu_media_crc_good_count",
.reg = MSCC_PHY_CU_MEDIA_CRC_VALID_CNT,
.page = MSCC_PHY_PAGE_EXTENDED,
.mask = VALID_CRC_CNT_CRC_MASK,
}, {
.string = "phy_cu_media_crc_error_count",
.reg = MSCC_PHY_EXT_PHY_CNTL_4,
.page = MSCC_PHY_PAGE_EXTENDED,
.mask = ERR_CNT_MASK,
}, {
.string = "phy_serdes_tx_good_pkt_count",
.reg = MSCC_PHY_SERDES_TX_VALID_CNT,
.page = MSCC_PHY_PAGE_EXTENDED_3,
.mask = VALID_CRC_CNT_CRC_MASK,
}, {
.string = "phy_serdes_tx_bad_crc_count",
.reg = MSCC_PHY_SERDES_TX_CRC_ERR_CNT,
.page = MSCC_PHY_PAGE_EXTENDED_3,
.mask = ERR_CNT_MASK,
}, {
.string = "phy_serdes_rx_good_pkt_count",
.reg = MSCC_PHY_SERDES_RX_VALID_CNT,
.page = MSCC_PHY_PAGE_EXTENDED_3,
.mask = VALID_CRC_CNT_CRC_MASK,
}, {
.string = "phy_serdes_rx_bad_crc_count",
Annotation
- Immediate include surface: `linux/firmware.h`, `linux/jiffies.h`, `linux/kernel.h`, `linux/module.h`, `linux/mdio.h`, `linux/mii.h`, `linux/phy.h`, `linux/of.h`.
- Detected declarations: `struct vsc85xx_probe_config`, `function vsc85xx_phy_read_page`, `function vsc85xx_phy_write_page`, `function vsc85xx_get_sset_count`, `function vsc85xx_get_strings`, `function vsc85xx_get_stat`, `function vsc85xx_get_stats`, `function vsc85xx_led_cntl_set`, `function vsc85xx_led_combine_disable_set`, `function vsc85xx_mdix_get`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source 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.