drivers/net/phy/dp83tc811.c
Source file repositories/reference/linux-study-clean/drivers/net/phy/dp83tc811.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/phy/dp83tc811.c- Extension
.c- Size
- 10658 bytes
- Lines
- 416
- 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.
- 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/netdevice.h
Detected Declarations
function Copyrightfunction dp83811_set_wolfunction dp83811_get_wolfunction dp83811_config_intrfunction dp83811_handle_interruptfunction dp83811_config_anegfunction dp83811_config_initfunction dp83811_phy_resetfunction dp83811_suspendfunction dp83811_resume
Annotated Snippet
if (wol->wolopts & WAKE_MAGICSECURE) {
phy_write_mmd(phydev, DP83811_DEVADDR,
MII_DP83811_RXSOP1,
(wol->sopass[1] << 8) | wol->sopass[0]);
phy_write_mmd(phydev, DP83811_DEVADDR,
MII_DP83811_RXSOP2,
(wol->sopass[3] << 8) | wol->sopass[2]);
phy_write_mmd(phydev, DP83811_DEVADDR,
MII_DP83811_RXSOP3,
(wol->sopass[5] << 8) | wol->sopass[4]);
value |= DP83811_WOL_SECURE_ON;
} else {
value &= ~DP83811_WOL_SECURE_ON;
}
/* Clear any pending WoL interrupt */
phy_read(phydev, MII_DP83811_INT_STAT1);
value |= DP83811_WOL_EN | DP83811_WOL_INDICATION_SEL |
DP83811_WOL_CLR_INDICATION;
return phy_write_mmd(phydev, DP83811_DEVADDR,
MII_DP83811_WOL_CFG, value);
} else {
return phy_clear_bits_mmd(phydev, DP83811_DEVADDR,
MII_DP83811_WOL_CFG, DP83811_WOL_EN);
}
}
static void dp83811_get_wol(struct phy_device *phydev,
struct ethtool_wolinfo *wol)
{
u16 sopass_val;
int value;
wol->supported = (WAKE_MAGIC | WAKE_MAGICSECURE);
wol->wolopts = 0;
value = phy_read_mmd(phydev, DP83811_DEVADDR, MII_DP83811_WOL_CFG);
if (value & DP83811_WOL_MAGIC_EN)
wol->wolopts |= WAKE_MAGIC;
if (value & DP83811_WOL_SECURE_ON) {
sopass_val = phy_read_mmd(phydev, DP83811_DEVADDR,
MII_DP83811_RXSOP1);
wol->sopass[0] = (sopass_val & 0xff);
wol->sopass[1] = (sopass_val >> 8);
sopass_val = phy_read_mmd(phydev, DP83811_DEVADDR,
MII_DP83811_RXSOP2);
wol->sopass[2] = (sopass_val & 0xff);
wol->sopass[3] = (sopass_val >> 8);
sopass_val = phy_read_mmd(phydev, DP83811_DEVADDR,
MII_DP83811_RXSOP3);
wol->sopass[4] = (sopass_val & 0xff);
wol->sopass[5] = (sopass_val >> 8);
wol->wolopts |= WAKE_MAGICSECURE;
}
/* WoL is not enabled so set wolopts to 0 */
if (!(value & DP83811_WOL_EN))
wol->wolopts = 0;
}
static int dp83811_config_intr(struct phy_device *phydev)
{
int misr_status, err;
if (phydev->interrupts == PHY_INTERRUPT_ENABLED) {
err = dp83811_ack_interrupt(phydev);
if (err)
return err;
misr_status = phy_read(phydev, MII_DP83811_INT_STAT1);
if (misr_status < 0)
return misr_status;
misr_status |= (DP83811_RX_ERR_HF_INT_EN |
DP83811_MS_TRAINING_INT_EN |
DP83811_ANEG_COMPLETE_INT_EN |
DP83811_ESD_EVENT_INT_EN |
DP83811_WOL_INT_EN |
DP83811_LINK_STAT_INT_EN |
DP83811_ENERGY_DET_INT_EN |
DP83811_LINK_QUAL_INT_EN);
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/netdevice.h`.
- Detected declarations: `function Copyright`, `function dp83811_set_wol`, `function dp83811_get_wol`, `function dp83811_config_intr`, `function dp83811_handle_interrupt`, `function dp83811_config_aneg`, `function dp83811_config_init`, `function dp83811_phy_reset`, `function dp83811_suspend`, `function dp83811_resume`.
- 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.