drivers/net/ethernet/realtek/r8169_phy_config.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/realtek/r8169_phy_config.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/realtek/r8169_phy_config.c- Extension
.c- Size
- 40599 bytes
- Lines
- 1381
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/delay.hlinux/phy.hr8169.h
Detected Declarations
struct phy_regfunction r8168d_modify_extpagefunction r8168d_phy_paramfunction r8168g_phy_paramfunction rtl8125_phy_paramfunction __rtl_writephy_batchfunction rtl8168f_config_eee_phyfunction rtl8168g_config_eee_phyfunction rtl8168h_config_eee_phyfunction rtl8125_common_config_eee_phyfunction rtl8125_config_eee_phyfunction rtl8169s_hw_phy_configfunction rtl8169sb_hw_phy_configfunction rtl8169scd_hw_phy_configfunction rtl8169sce_hw_phy_configfunction rtl8168bef_hw_phy_configfunction rtl8168cp_1_hw_phy_configfunction rtl8168cp_2_hw_phy_configfunction rtl8168c_1_hw_phy_configfunction rtl8168c_2_hw_phy_configfunction rtl8168c_3_hw_phy_configfunction rtl8168d_apply_firmware_condfunction rtl8168d_1_commonfunction rtl8168d_1_hw_phy_configfunction rtl8168d_2_hw_phy_configfunction rtl8168d_4_hw_phy_configfunction rtl8168e_1_hw_phy_configfunction rtl8168e_2_hw_phy_configfunction rtl8168f_hw_phy_configfunction rtl8168f_1_hw_phy_configfunction rtl8168f_2_hw_phy_configfunction rtl8411_hw_phy_configfunction rtl8168g_disable_aldpsfunction rtl8168g_enable_gphy_10mfunction rtl8168g_phy_adjust_10m_aldpsfunction rtl8168g_1_hw_phy_configfunction rtl8168g_2_hw_phy_configfunction rtl8168h_2_hw_phy_configfunction rtl8168ep_2_hw_phy_configfunction rtl8117_hw_phy_configfunction rtl8102e_hw_phy_configfunction rtl8401_hw_phy_configfunction rtl8105e_hw_phy_configfunction rtl8402_hw_phy_configfunction rtl8106e_hw_phy_configfunction rtl8125_legacy_force_modefunction rtl8125a_2_hw_phy_configfunction rtl8125b_hw_phy_config
Annotated Snippet
struct phy_reg {
u16 reg;
u16 val;
};
static void __rtl_writephy_batch(struct phy_device *phydev,
const struct phy_reg *regs, int len)
{
phy_lock_mdio_bus(phydev);
while (len-- > 0) {
__phy_write(phydev, regs->reg, regs->val);
regs++;
}
phy_unlock_mdio_bus(phydev);
}
#define rtl_writephy_batch(p, a) __rtl_writephy_batch(p, a, ARRAY_SIZE(a))
static void rtl8168f_config_eee_phy(struct phy_device *phydev)
{
r8168d_modify_extpage(phydev, 0x0020, 0x15, 0, BIT(8));
r8168d_phy_param(phydev, 0x8b85, 0, BIT(13));
}
static void rtl8168g_config_eee_phy(struct phy_device *phydev)
{
phy_modify_paged(phydev, 0x0a43, 0x11, 0, BIT(4));
}
static void rtl8168h_config_eee_phy(struct phy_device *phydev)
{
rtl8168g_config_eee_phy(phydev);
phy_modify_paged(phydev, 0xa4a, 0x11, 0x0000, 0x0200);
phy_modify_paged(phydev, 0xa42, 0x14, 0x0000, 0x0080);
}
static void rtl8125_common_config_eee_phy(struct phy_device *phydev)
{
phy_modify_paged(phydev, 0xa6d, 0x14, 0x0010, 0x0000);
phy_modify_paged(phydev, 0xa42, 0x14, 0x0080, 0x0000);
phy_modify_paged(phydev, 0xa4a, 0x11, 0x0200, 0x0000);
}
static void rtl8125_config_eee_phy(struct phy_device *phydev)
{
rtl8168g_config_eee_phy(phydev);
rtl8125_common_config_eee_phy(phydev);
}
static void rtl8169s_hw_phy_config(struct rtl8169_private *tp,
struct phy_device *phydev)
{
static const struct phy_reg phy_reg_init[] = {
{ 0x1f, 0x0001 },
{ 0x06, 0x006e },
{ 0x08, 0x0708 },
{ 0x15, 0x4000 },
{ 0x18, 0x65c7 },
{ 0x1f, 0x0001 },
{ 0x03, 0x00a1 },
{ 0x02, 0x0008 },
{ 0x01, 0x0120 },
{ 0x00, 0x1000 },
{ 0x04, 0x0800 },
{ 0x04, 0x0000 },
{ 0x03, 0xff41 },
{ 0x02, 0xdf60 },
{ 0x01, 0x0140 },
{ 0x00, 0x0077 },
{ 0x04, 0x7800 },
{ 0x04, 0x7000 },
{ 0x03, 0x802f },
{ 0x02, 0x4f02 },
{ 0x01, 0x0409 },
{ 0x00, 0xf0f9 },
{ 0x04, 0x9800 },
{ 0x04, 0x9000 },
{ 0x03, 0xdf01 },
{ 0x02, 0xdf20 },
{ 0x01, 0xff95 },
{ 0x00, 0xba00 },
{ 0x04, 0xa800 },
{ 0x04, 0xa000 },
Annotation
- Immediate include surface: `linux/delay.h`, `linux/phy.h`, `r8169.h`.
- Detected declarations: `struct phy_reg`, `function r8168d_modify_extpage`, `function r8168d_phy_param`, `function r8168g_phy_param`, `function rtl8125_phy_param`, `function __rtl_writephy_batch`, `function rtl8168f_config_eee_phy`, `function rtl8168g_config_eee_phy`, `function rtl8168h_config_eee_phy`, `function rtl8125_common_config_eee_phy`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
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.