drivers/net/phy/air_en8811h.c
Source file repositories/reference/linux-study-clean/drivers/net/phy/air_en8811h.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/phy/air_en8811h.c- Extension
.c- Size
- 39883 bytes
- Lines
- 1571
- 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/clk.hlinux/clk-provider.hlinux/phy.hlinux/phy/phy-common-props.hlinux/firmware.hlinux/bitfield.hlinux/property.hlinux/wordpart.hlinux/unaligned.hair_phy_lib.h
Detected Declarations
struct ledstruct en8811h_privfunction __air_pbus_reg_writefunction __air_write_buffunction air_write_buffunction en8811h_wait_mcu_readyfunction an8811hb_check_crcfunction en8811h_print_fw_versionfunction an8811hb_load_filefunction an8811hb_mcu_assertfunction an8811hb_mcu_deassertfunction an8811hb_load_firmwarefunction en8811h_load_firmwarefunction en8811h_restart_mcufunction air_hw_led_on_setfunction air_hw_led_blink_setfunction air_led_blink_setfunction air_led_brightness_setfunction air_led_hw_control_getfunction air_led_hw_control_setfunction air_led_initfunction air_leds_initfunction en8811h_led_hw_is_supportedfunction an8811hb_clk_recalc_ratefunction an8811hb_clk_enablefunction an8811hb_clk_disablefunction an8811hb_clk_is_enabledfunction an8811hb_clk_save_contextfunction an8811hb_clk_restore_contextfunction an8811hb_clk_provider_setupfunction en8811h_clk_recalc_ratefunction en8811h_clk_enablefunction en8811h_clk_disablefunction en8811h_clk_is_enabledfunction en8811h_clk_save_contextfunction en8811h_clk_restore_contextfunction en8811h_clk_provider_setupfunction en8811h_leds_setupfunction an8811hb_probefunction en8811h_probefunction an8811hb_config_serdes_polarityfunction en8811h_config_serdes_polarityfunction an8811hb_config_initfunction en8811h_config_initfunction en8811h_get_featuresfunction en8811h_get_rate_matchingfunction en8811h_config_anegfunction en8811h_read_status
Annotated Snippet
struct led {
unsigned long rules;
unsigned long state;
};
#define clk_hw_to_en8811h_priv(_hw) \
container_of(_hw, struct en8811h_priv, hw)
struct en8811h_priv {
u32 firmware_version;
bool mcu_needs_restart;
struct led led[EN8811H_LED_COUNT];
struct clk_hw hw;
struct phy_device *phydev;
unsigned int cko_is_enabled;
struct mdio_device *pbusdev;
};
enum {
AIR_PHY_LED_STATE_FORCE_ON,
AIR_PHY_LED_STATE_FORCE_BLINK,
};
enum {
AIR_PHY_LED_DUR_BLINK_32MS,
AIR_PHY_LED_DUR_BLINK_64MS,
AIR_PHY_LED_DUR_BLINK_128MS,
AIR_PHY_LED_DUR_BLINK_256MS,
AIR_PHY_LED_DUR_BLINK_512MS,
AIR_PHY_LED_DUR_BLINK_1024MS,
};
enum {
AIR_LED_DISABLE,
AIR_LED_ENABLE,
};
enum {
AIR_ACTIVE_LOW,
AIR_ACTIVE_HIGH,
};
enum {
AIR_LED_MODE_DISABLE,
AIR_LED_MODE_USER_DEFINE,
};
#define AIR_PHY_LED_DUR_UNIT 1024
#define AIR_PHY_LED_DUR (AIR_PHY_LED_DUR_UNIT << AIR_PHY_LED_DUR_BLINK_64MS)
static const unsigned long en8811h_led_trig = BIT(TRIGGER_NETDEV_FULL_DUPLEX) |
BIT(TRIGGER_NETDEV_LINK) |
BIT(TRIGGER_NETDEV_LINK_10) |
BIT(TRIGGER_NETDEV_LINK_100) |
BIT(TRIGGER_NETDEV_LINK_1000) |
BIT(TRIGGER_NETDEV_LINK_2500) |
BIT(TRIGGER_NETDEV_RX) |
BIT(TRIGGER_NETDEV_TX);
static int __air_pbus_reg_write(struct mdio_device *mdiodev,
u32 pbus_reg, u32 pbus_data)
{
int ret;
ret = __mdiobus_write(mdiodev->bus, mdiodev->addr, AIR_EXT_PAGE_ACCESS,
upper_16_bits(pbus_reg));
if (ret < 0)
return ret;
ret = __mdiobus_write(mdiodev->bus, mdiodev->addr, AIR_PBUS_ADDR_HIGH,
FIELD_GET(AIR_PBUS_REG_ADDR_HIGH_MASK, pbus_reg));
if (ret < 0)
return ret;
ret = __mdiobus_write(mdiodev->bus, mdiodev->addr,
FIELD_GET(AIR_PBUS_REG_ADDR_LOW_MASK, pbus_reg),
lower_16_bits(pbus_data));
if (ret < 0)
return ret;
return __mdiobus_write(mdiodev->bus, mdiodev->addr, AIR_PBUS_DATA_HIGH,
upper_16_bits(pbus_data));
}
static int __air_write_buf(struct phy_device *phydev, u32 address,
const struct firmware *fw)
{
unsigned int offset;
int ret;
u16 val;
Annotation
- Immediate include surface: `linux/clk.h`, `linux/clk-provider.h`, `linux/phy.h`, `linux/phy/phy-common-props.h`, `linux/firmware.h`, `linux/bitfield.h`, `linux/property.h`, `linux/wordpart.h`.
- Detected declarations: `struct led`, `struct en8811h_priv`, `function __air_pbus_reg_write`, `function __air_write_buf`, `function air_write_buf`, `function en8811h_wait_mcu_ready`, `function an8811hb_check_crc`, `function en8811h_print_fw_version`, `function an8811hb_load_file`, `function an8811hb_mcu_assert`.
- 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.