drivers/net/phy/marvell-88q2xxx.c
Source file repositories/reference/linux-study-clean/drivers/net/phy/marvell-88q2xxx.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/phy/marvell-88q2xxx.c- Extension
.c- Size
- 31356 bytes
- Lines
- 1155
- 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.
- 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/ethtool_netlink.hlinux/hwmon.hlinux/marvell_phy.hlinux/of.hlinux/phy.h
Detected Declarations
struct mv88q2xxx_privstruct mmd_valfunction mv88q2xxx_write_mmd_valsfunction mv88q2xxx_soft_resetfunction mv88q2xxx_read_link_gbitfunction mv88q2xxx_read_link_100mfunction mv88q2xxx_read_linkfunction mv88q2xxx_read_master_slave_statefunction mv88q2xxx_read_aneg_speedfunction mv88q2xxx_read_statusfunction mv88q2xxx_get_featuresfunction mv88q2xxx_config_anegfunction mv88q2xxx_get_sqifunction mv88q2xxx_get_sqi_maxfunction mv88q2xxx_config_intrfunction mv88q2xxx_handle_interruptfunction mv88q2xxx_suspendfunction mv88q2xxx_resumefunction mv88q2xxx_enable_temp_sensefunction mv88q2xxx_hwmon_is_visiblefunction mv88q2xxx_hwmon_readfunction mv88q2xxx_hwmon_writefunction mv88q2xxx_hwmon_probefunction mv88q2xxx_enable_temp_sensefunction mv88q2xxx_hwmon_probefunction mv88q2xxx_leds_probefunction for_each_available_child_of_node_scopedfunction mv88q2xxx_leds_probefunction mv88q2xxx_probefunction mv88q2xxx_config_initfunction mv88q2110_config_initfunction mv88q222x_revb0_config_initfunction mv88q222x_revb1_revb2_config_initfunction mv88q222x_config_initfunction mv88q222x_cable_test_startfunction mv88q222x_cable_test_get_statusfunction mv88q2xxx_led_modefunction mv88q2xxx_led_hw_is_supportedfunction mv88q2xxx_led_hw_control_setfunction mv88q2xxx_led_hw_control_get
Annotated Snippet
struct mv88q2xxx_priv {
bool enable_led0;
};
struct mmd_val {
int devad;
u32 regnum;
u16 val;
};
static const struct mmd_val mv88q2110_init_seq0[] = {
{ MDIO_MMD_PCS, 0xffe4, 0x07b5 },
{ MDIO_MMD_PCS, 0xffe4, 0x06b6 },
};
static const struct mmd_val mv88q2110_init_seq1[] = {
{ MDIO_MMD_PCS, 0xffde, 0x402f },
{ MDIO_MMD_PCS, 0xfe34, 0x4040 },
{ MDIO_MMD_PCS, 0xfe2a, 0x3c1d },
{ MDIO_MMD_PCS, 0xfe34, 0x0040 },
{ MDIO_MMD_AN, 0x8032, 0x0064 },
{ MDIO_MMD_AN, 0x8031, 0x0a01 },
{ MDIO_MMD_AN, 0x8031, 0x0c01 },
{ MDIO_MMD_PCS, 0xffdb, 0x0010 },
};
static const struct mmd_val mv88q222x_revb0_init_seq0[] = {
{ MDIO_MMD_PCS, 0x8033, 0x6801 },
{ MDIO_MMD_AN, MDIO_AN_T1_CTRL, 0x0 },
{ MDIO_MMD_PMAPMD, MDIO_CTRL1,
MDIO_CTRL1_LPOWER | MDIO_PMA_CTRL1_SPEED1000 },
{ MDIO_MMD_PCS, 0xfe1b, 0x48 },
{ MDIO_MMD_PCS, 0xffe4, 0x6b6 },
{ MDIO_MMD_PMAPMD, MDIO_CTRL1, 0x0 },
{ MDIO_MMD_PCS, MDIO_CTRL1, 0x0 },
};
static const struct mmd_val mv88q222x_revb0_init_seq1[] = {
{ MDIO_MMD_PCS, 0xfe79, 0x0 },
{ MDIO_MMD_PCS, 0xfe07, 0x125a },
{ MDIO_MMD_PCS, 0xfe09, 0x1288 },
{ MDIO_MMD_PCS, 0xfe08, 0x2588 },
{ MDIO_MMD_PCS, 0xfe11, 0x1105 },
{ MDIO_MMD_PCS, 0xfe72, 0x042c },
{ MDIO_MMD_PCS, 0xfbba, 0xcb2 },
{ MDIO_MMD_PCS, 0xfbbb, 0xc4a },
{ MDIO_MMD_AN, 0x8032, 0x2020 },
{ MDIO_MMD_AN, 0x8031, 0xa28 },
{ MDIO_MMD_AN, 0x8031, 0xc28 },
{ MDIO_MMD_PCS, 0xffdb, 0xfc10 },
{ MDIO_MMD_PCS, 0xfe1b, 0x58 },
{ MDIO_MMD_PCS, 0xfe79, 0x4 },
{ MDIO_MMD_PCS, 0xfe5f, 0xe8 },
{ MDIO_MMD_PCS, 0xfe05, 0x755c },
};
static const struct mmd_val mv88q222x_revb1_init_seq0[] = {
{ MDIO_MMD_PCS, 0xffe4, 0x0007 },
{ MDIO_MMD_AN, MDIO_AN_T1_CTRL, 0x0 },
{ MDIO_MMD_PCS, 0xffe3, 0x7000 },
{ MDIO_MMD_PMAPMD, MDIO_CTRL1, 0x0840 },
};
static const struct mmd_val mv88q222x_revb2_init_seq0[] = {
{ MDIO_MMD_PCS, 0xffe4, 0x0007 },
{ MDIO_MMD_AN, MDIO_AN_T1_CTRL, 0x0 },
{ MDIO_MMD_PMAPMD, MDIO_CTRL1, 0x0840 },
};
static const struct mmd_val mv88q222x_revb1_revb2_init_seq1[] = {
{ MDIO_MMD_PCS, 0xfe07, 0x125a },
{ MDIO_MMD_PCS, 0xfe09, 0x1288 },
{ MDIO_MMD_PCS, 0xfe08, 0x2588 },
{ MDIO_MMD_PCS, 0xfe72, 0x042c },
{ MDIO_MMD_PCS, 0xffe4, 0x0071 },
{ MDIO_MMD_PCS, 0xffe4, 0x0001 },
{ MDIO_MMD_PCS, 0xfe1b, 0x0048 },
{ MDIO_MMD_PMAPMD, 0x0000, 0x0000 },
{ MDIO_MMD_PCS, 0x0000, 0x0000 },
{ MDIO_MMD_PCS, 0xffdb, 0xfc10 },
{ MDIO_MMD_PCS, 0xfe1b, 0x58 },
{ MDIO_MMD_PCS, 0xfcad, 0x030c },
{ MDIO_MMD_PCS, 0x8032, 0x6001 },
{ MDIO_MMD_PCS, 0xfdff, 0x05a5 },
{ MDIO_MMD_PCS, 0xfdec, 0xdbaf },
{ MDIO_MMD_PCS, 0xfcab, 0x1054 },
{ MDIO_MMD_PCS, 0xfcac, 0x1483 },
{ MDIO_MMD_PCS, 0x8033, 0xc801 },
{ MDIO_MMD_AN, 0x8032, 0x2020 },
{ MDIO_MMD_AN, 0x8031, 0xa28 },
Annotation
- Immediate include surface: `linux/ethtool_netlink.h`, `linux/hwmon.h`, `linux/marvell_phy.h`, `linux/of.h`, `linux/phy.h`.
- Detected declarations: `struct mv88q2xxx_priv`, `struct mmd_val`, `function mv88q2xxx_write_mmd_vals`, `function mv88q2xxx_soft_reset`, `function mv88q2xxx_read_link_gbit`, `function mv88q2xxx_read_link_100m`, `function mv88q2xxx_read_link`, `function mv88q2xxx_read_master_slave_state`, `function mv88q2xxx_read_aneg_speed`, `function mv88q2xxx_read_status`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- 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.