drivers/net/phy/as21xxx.c
Source file repositories/reference/linux-study-clean/drivers/net/phy/as21xxx.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/phy/as21xxx.c- Extension
.c- Size
- 29454 bytes
- Lines
- 1089
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/bitfield.hlinux/firmware.hlinux/module.hlinux/of.hlinux/phy.h
Detected Declarations
struct as21xxx_led_pattern_infostruct as21xxx_privenum as21xxx_led_eventfunction aeon_firmware_bootfunction aeon_firmware_loadfunction aeon_ipc_readyfunction aeon_ipc_wait_cmdfunction aeon_ipc_send_cmdfunction aeon_ipc_send_msgfunction aeon_ipc_noopfunction aeon_ipc_sync_parityfunction aeon_ipc_get_fw_versionfunction aeon_dpc_ra_enablefunction as21xxx_probefunction as21xxx_read_linkfunction as21xxx_read_c22_lpafunction as21xxx_read_statusfunction as21xxx_led_brightness_setfunction as21xxx_led_hw_is_supportedfunction as21xxx_led_hw_control_getfunction as21xxx_led_hw_control_setfunction as21xxx_led_polarity_setfunction for_each_set_bitfunction as21xxx_match_phy_device
Annotated Snippet
struct as21xxx_led_pattern_info {
unsigned int pattern;
u16 val;
};
struct as21xxx_priv {
bool parity_status;
/* Protect concurrent IPC access */
struct mutex ipc_lock;
};
static struct as21xxx_led_pattern_info as21xxx_led_supported_pattern[] = {
{
.pattern = BIT(TRIGGER_NETDEV_LINK_10),
.val = VEND1_LED_REG_A_EVENT_ON_10
},
{
.pattern = BIT(TRIGGER_NETDEV_LINK_100),
.val = VEND1_LED_REG_A_EVENT_ON_100
},
{
.pattern = BIT(TRIGGER_NETDEV_LINK_1000),
.val = VEND1_LED_REG_A_EVENT_ON_1000
},
{
.pattern = BIT(TRIGGER_NETDEV_LINK_2500),
.val = VEND1_LED_REG_A_EVENT_ON_2500
},
{
.pattern = BIT(TRIGGER_NETDEV_LINK_5000),
.val = VEND1_LED_REG_A_EVENT_ON_5000
},
{
.pattern = BIT(TRIGGER_NETDEV_LINK_10000),
.val = VEND1_LED_REG_A_EVENT_ON_10000
},
{
.pattern = BIT(TRIGGER_NETDEV_LINK),
.val = VEND1_LED_REG_A_EVENT_ON_LINK
},
{
.pattern = BIT(TRIGGER_NETDEV_LINK_10) |
BIT(TRIGGER_NETDEV_LINK_100) |
BIT(TRIGGER_NETDEV_LINK_1000),
.val = VEND1_LED_REG_A_EVENT_ON_FE_GE
},
{
.pattern = BIT(TRIGGER_NETDEV_LINK_2500) |
BIT(TRIGGER_NETDEV_LINK_5000) |
BIT(TRIGGER_NETDEV_LINK_10000),
.val = VEND1_LED_REG_A_EVENT_ON_NG
},
{
.pattern = BIT(TRIGGER_NETDEV_FULL_DUPLEX),
.val = VEND1_LED_REG_A_EVENT_ON_FULL_DUPLEX
},
{
.pattern = BIT(TRIGGER_NETDEV_TX),
.val = VEND1_LED_REG_A_EVENT_BLINK_TX
},
{
.pattern = BIT(TRIGGER_NETDEV_RX),
.val = VEND1_LED_REG_A_EVENT_BLINK_RX
},
{
.pattern = BIT(TRIGGER_NETDEV_TX) |
BIT(TRIGGER_NETDEV_RX),
.val = VEND1_LED_REG_A_EVENT_BLINK_ACT
},
{
.pattern = BIT(TRIGGER_NETDEV_LINK_10) |
BIT(TRIGGER_NETDEV_LINK_100) |
BIT(TRIGGER_NETDEV_LINK_1000) |
BIT(TRIGGER_NETDEV_LINK_2500) |
BIT(TRIGGER_NETDEV_LINK_5000) |
BIT(TRIGGER_NETDEV_LINK_10000),
.val = VEND1_LED_REG_A_EVENT_ON_LINK
},
{
.pattern = BIT(TRIGGER_NETDEV_LINK_10) |
BIT(TRIGGER_NETDEV_LINK_100) |
BIT(TRIGGER_NETDEV_LINK_1000) |
BIT(TRIGGER_NETDEV_LINK_2500) |
BIT(TRIGGER_NETDEV_LINK_5000) |
BIT(TRIGGER_NETDEV_LINK_10000) |
BIT(TRIGGER_NETDEV_TX) |
BIT(TRIGGER_NETDEV_RX),
.val = VEND1_LED_REG_A_EVENT_ON_LINK_BLINK_ACT
},
{
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/firmware.h`, `linux/module.h`, `linux/of.h`, `linux/phy.h`.
- Detected declarations: `struct as21xxx_led_pattern_info`, `struct as21xxx_priv`, `enum as21xxx_led_event`, `function aeon_firmware_boot`, `function aeon_firmware_load`, `function aeon_ipc_ready`, `function aeon_ipc_wait_cmd`, `function aeon_ipc_send_cmd`, `function aeon_ipc_send_msg`, `function aeon_ipc_noop`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.