drivers/net/phy/mxl-86110.c
Source file repositories/reference/linux-study-clean/drivers/net/phy/mxl-86110.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/phy/mxl-86110.c- Extension
.c- Size
- 29025 bytes
- Lines
- 982
- 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/bitfield.hlinux/etherdevice.hlinux/kernel.hlinux/module.hlinux/of.hlinux/phy.h
Detected Declarations
function __mxl86110_write_extended_regfunction __mxl86110_read_extended_regfunction __mxl86110_modify_extended_regfunction mxl86110_write_extended_regfunction mxl86110_read_extended_regfunction mxl86110_modify_extended_regfunction mxl86110_get_wolfunction mxl86110_set_wolfunction mxl86110_led_hw_is_supportedfunction mxl86110_led_hw_control_getfunction mxl86110_led_hw_control_setfunction mxl86110_led_brightness_setfunction mxl86110_synce_clk_cfgfunction mxl86110_broadcast_cfgfunction mxl86110_enable_led_activity_blinkfunction mxl86110_config_rgmii_delayfunction mxl86110_config_initfunction mxl86111_probefunction mxl86111_config_initfunction mxl86111_read_pagefunction mxl86111_write_pagefunction mxl86111_config_inbandfunction mxl86111_inband_caps
Annotated Snippet
if (!netdev) {
ret = -ENODEV;
goto out;
}
/* Configure the MAC address of the WOL magic packet */
mac = netdev->dev_addr;
ret = __mxl86110_write_extended_reg(phydev,
MXL86110_EXT_MAC_ADDR_CFG1,
((mac[0] << 8) | mac[1]));
if (ret < 0)
goto out;
ret = __mxl86110_write_extended_reg(phydev,
MXL86110_EXT_MAC_ADDR_CFG2,
((mac[2] << 8) | mac[3]));
if (ret < 0)
goto out;
ret = __mxl86110_write_extended_reg(phydev,
MXL86110_EXT_MAC_ADDR_CFG3,
((mac[4] << 8) | mac[5]));
if (ret < 0)
goto out;
ret = __mxl86110_modify_extended_reg(phydev,
MXL86110_EXT_WOL_CFG_REG,
MXL86110_WOL_CFG_WOL_MASK,
MXL86110_WOL_CFG_WOL_MASK);
if (ret < 0)
goto out;
/* Enables Wake-on-LAN interrupt in the PHY. */
ret = __phy_modify(phydev, PHY_IRQ_ENABLE_REG, 0,
PHY_IRQ_ENABLE_REG_WOL);
if (ret < 0)
goto out;
phydev_dbg(phydev,
"%s, MAC Addr: %02X:%02X:%02X:%02X:%02X:%02X\n",
__func__,
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
} else {
ret = __mxl86110_modify_extended_reg(phydev,
MXL86110_EXT_WOL_CFG_REG,
MXL86110_WOL_CFG_WOL_MASK,
0);
if (ret < 0)
goto out;
/* Disables Wake-on-LAN interrupt in the PHY. */
ret = __phy_modify(phydev, PHY_IRQ_ENABLE_REG,
PHY_IRQ_ENABLE_REG_WOL, 0);
}
out:
phy_unlock_mdio_bus(phydev);
return ret;
}
static const unsigned long supported_trgs = (BIT(TRIGGER_NETDEV_LINK_10) |
BIT(TRIGGER_NETDEV_LINK_100) |
BIT(TRIGGER_NETDEV_LINK_1000) |
BIT(TRIGGER_NETDEV_HALF_DUPLEX) |
BIT(TRIGGER_NETDEV_FULL_DUPLEX) |
BIT(TRIGGER_NETDEV_TX) |
BIT(TRIGGER_NETDEV_RX));
static int mxl86110_led_hw_is_supported(struct phy_device *phydev, u8 index,
unsigned long rules)
{
if (index >= MXL86110_MAX_LEDS)
return -EINVAL;
/* All combinations of the supported triggers are allowed */
if (rules & ~supported_trgs)
return -EOPNOTSUPP;
return 0;
}
static int mxl86110_led_hw_control_get(struct phy_device *phydev, u8 index,
unsigned long *rules)
{
int val;
if (index >= MXL86110_MAX_LEDS)
return -EINVAL;
val = mxl86110_read_extended_reg(phydev,
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/etherdevice.h`, `linux/kernel.h`, `linux/module.h`, `linux/of.h`, `linux/phy.h`.
- Detected declarations: `function __mxl86110_write_extended_reg`, `function __mxl86110_read_extended_reg`, `function __mxl86110_modify_extended_reg`, `function mxl86110_write_extended_reg`, `function mxl86110_read_extended_reg`, `function mxl86110_modify_extended_reg`, `function mxl86110_get_wol`, `function mxl86110_set_wol`, `function mxl86110_led_hw_is_supported`, `function mxl86110_led_hw_control_get`.
- 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.