drivers/net/phy/dp83869.c
Source file repositories/reference/linux-study-clean/drivers/net/phy/dp83869.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/phy/dp83869.c- Extension
.c- Size
- 24440 bytes
- Lines
- 951
- 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.hlinux/etherdevice.hlinux/kernel.hlinux/mii.hlinux/module.hlinux/of.hlinux/phy.hlinux/delay.hlinux/bitfield.hdt-bindings/net/ti-dp83869.h
Detected Declarations
struct dp83869_privatefunction dp83869_config_anegfunction dp83869_read_statusfunction dp83869_ack_interruptfunction dp83869_config_intrfunction dp83869_handle_interruptfunction dp83869_set_wolfunction dp83869_get_wolfunction dp83869_get_downshiftfunction dp83869_set_downshiftfunction dp83869_get_tunablefunction dp83869_set_tunablefunction dp83869_config_port_mirroringfunction dp83869_set_strapped_modefunction dp83869_of_initfunction dp83869_of_initfunction dp83869_configure_rgmiifunction dp83869_configure_fiberfunction dp83869_configure_modefunction dp83869_config_initfunction dp83869_probefunction dp83869_phy_reset
Annotated Snippet
struct dp83869_private {
int tx_fifo_depth;
int rx_fifo_depth;
s32 rx_int_delay;
s32 tx_int_delay;
int io_impedance;
int port_mirroring;
bool rxctrl_strap_quirk;
int clk_output_sel;
int mode;
};
static int dp83869_config_aneg(struct phy_device *phydev)
{
struct dp83869_private *dp83869 = phydev->priv;
if (dp83869->mode != DP83869_RGMII_1000_BASE)
return genphy_config_aneg(phydev);
return genphy_c37_config_aneg(phydev);
}
static int dp83869_read_status(struct phy_device *phydev)
{
struct dp83869_private *dp83869 = phydev->priv;
bool changed;
int ret;
if (dp83869->mode == DP83869_RGMII_1000_BASE)
return genphy_c37_read_status(phydev, &changed);
ret = genphy_read_status(phydev);
if (ret)
return ret;
if (dp83869->mode == DP83869_RGMII_100_BASE) {
if (phydev->link) {
phydev->speed = SPEED_100;
} else {
phydev->speed = SPEED_UNKNOWN;
phydev->duplex = DUPLEX_UNKNOWN;
}
}
return 0;
}
static int dp83869_ack_interrupt(struct phy_device *phydev)
{
int err = phy_read(phydev, MII_DP83869_ISR);
if (err < 0)
return err;
return 0;
}
static int dp83869_config_intr(struct phy_device *phydev)
{
int micr_status = 0, err;
if (phydev->interrupts == PHY_INTERRUPT_ENABLED) {
err = dp83869_ack_interrupt(phydev);
if (err)
return err;
micr_status = phy_read(phydev, MII_DP83869_MICR);
if (micr_status < 0)
return micr_status;
micr_status |=
(MII_DP83869_MICR_AN_ERR_INT_EN |
MII_DP83869_MICR_SPEED_CHNG_INT_EN |
MII_DP83869_MICR_AUTONEG_COMP_INT_EN |
MII_DP83869_MICR_LINK_STS_CHNG_INT_EN |
MII_DP83869_MICR_DUP_MODE_CHNG_INT_EN |
MII_DP83869_MICR_SLEEP_MODE_CHNG_INT_EN);
err = phy_write(phydev, MII_DP83869_MICR, micr_status);
} else {
err = phy_write(phydev, MII_DP83869_MICR, micr_status);
if (err)
return err;
err = dp83869_ack_interrupt(phydev);
}
return err;
}
Annotation
- Immediate include surface: `linux/ethtool.h`, `linux/etherdevice.h`, `linux/kernel.h`, `linux/mii.h`, `linux/module.h`, `linux/of.h`, `linux/phy.h`, `linux/delay.h`.
- Detected declarations: `struct dp83869_private`, `function dp83869_config_aneg`, `function dp83869_read_status`, `function dp83869_ack_interrupt`, `function dp83869_config_intr`, `function dp83869_handle_interrupt`, `function dp83869_set_wol`, `function dp83869_get_wol`, `function dp83869_get_downshift`, `function dp83869_set_downshift`.
- 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.