drivers/net/ethernet/intel/e1000e/82571.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/e1000e/82571.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/e1000e/82571.c- Extension
.c- Size
- 54807 bytes
- Lines
- 2049
- 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.
- 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
e1000.h
Detected Declarations
function e1000_init_phy_params_82571function e1000_init_nvm_params_82571function e1000_init_mac_params_82571function e1000_get_variants_82571function e1000_get_phy_id_82571function e1000_get_hw_semaphore_82571function e1000_put_hw_semaphore_82571function e1000_get_hw_semaphore_82573function e1000_put_hw_semaphore_82573function e1000_get_hw_semaphore_82574function e1000_put_hw_semaphore_82574function e1000_set_d0_lplu_state_82574function upfunction e1000_acquire_nvm_82571function e1000_release_nvm_82571function e1000_write_nvm_82571function e1000_update_nvm_checksum_82571function e1000_validate_nvm_checksum_82571function e1000_write_nvm_eewr_82571function e1000_get_cfg_done_82571function e1000_set_d0_lplu_state_82571function e1000_reset_hw_82571function e1000_init_hw_82571function e1000_initialize_hw_bits_82571function e1000_clear_vfta_82571function e1000_check_mng_mode_82574function e1000_led_on_82574function e1000_check_phy_82574function e1000_setup_link_82571function e1000_setup_copper_link_82571function e1000_setup_fiber_serdes_link_82571function e1000_check_for_serdes_link_82571function e1000_valid_led_default_82571function e1000e_get_laa_state_82571function e1000e_set_laa_state_82571function e1000_fix_nvm_checksum_82571function e1000_read_mac_addr_82571function e1000_power_down_phy_copper_82571function e1000_clear_hw_cntrs_82571
Annotated Snippet
if (((eecd >> 15) & 0x3) == 0x3) {
nvm->type = e1000_nvm_flash_hw;
nvm->word_size = 2048;
/* Autonomous Flash update bit must be cleared due
* to Flash update issue.
*/
eecd &= ~E1000_EECD_AUPDEN;
ew32(EECD, eecd);
break;
}
fallthrough;
default:
nvm->type = e1000_nvm_eeprom_spi;
size = (u16)FIELD_GET(E1000_EECD_SIZE_EX_MASK, eecd);
/* Added to a constant, "size" becomes the left-shift value
* for setting word_size.
*/
size += NVM_WORD_SIZE_BASE_SHIFT;
/* EEPROM access above 16k is unsupported */
if (size > 14)
size = 14;
nvm->word_size = BIT(size);
break;
}
/* Function Pointers */
switch (hw->mac.type) {
case e1000_82574:
case e1000_82583:
nvm->ops.acquire = e1000_get_hw_semaphore_82574;
nvm->ops.release = e1000_put_hw_semaphore_82574;
break;
default:
break;
}
return 0;
}
/**
* e1000_init_mac_params_82571 - Init MAC func ptrs.
* @hw: pointer to the HW structure
**/
static s32 e1000_init_mac_params_82571(struct e1000_hw *hw)
{
struct e1000_mac_info *mac = &hw->mac;
u32 swsm = 0;
u32 swsm2 = 0;
bool force_clear_smbi = false;
/* Set media type and media-dependent function pointers */
switch (hw->adapter->pdev->device) {
case E1000_DEV_ID_82571EB_FIBER:
case E1000_DEV_ID_82572EI_FIBER:
case E1000_DEV_ID_82571EB_QUAD_FIBER:
hw->phy.media_type = e1000_media_type_fiber;
mac->ops.setup_physical_interface =
e1000_setup_fiber_serdes_link_82571;
mac->ops.check_for_link = e1000e_check_for_fiber_link;
mac->ops.get_link_up_info =
e1000e_get_speed_and_duplex_fiber_serdes;
break;
case E1000_DEV_ID_82571EB_SERDES:
case E1000_DEV_ID_82571EB_SERDES_DUAL:
case E1000_DEV_ID_82571EB_SERDES_QUAD:
case E1000_DEV_ID_82572EI_SERDES:
hw->phy.media_type = e1000_media_type_internal_serdes;
mac->ops.setup_physical_interface =
e1000_setup_fiber_serdes_link_82571;
mac->ops.check_for_link = e1000_check_for_serdes_link_82571;
mac->ops.get_link_up_info =
e1000e_get_speed_and_duplex_fiber_serdes;
break;
default:
hw->phy.media_type = e1000_media_type_copper;
mac->ops.setup_physical_interface =
e1000_setup_copper_link_82571;
mac->ops.check_for_link = e1000e_check_for_copper_link;
mac->ops.get_link_up_info = e1000e_get_speed_and_duplex_copper;
break;
}
/* Set mta register count */
mac->mta_reg_count = 128;
/* Set rar entry count */
mac->rar_entry_count = E1000_RAR_ENTRIES;
/* Adaptive IFS supported */
mac->adaptive_ifs = true;
Annotation
- Immediate include surface: `e1000.h`.
- Detected declarations: `function e1000_init_phy_params_82571`, `function e1000_init_nvm_params_82571`, `function e1000_init_mac_params_82571`, `function e1000_get_variants_82571`, `function e1000_get_phy_id_82571`, `function e1000_get_hw_semaphore_82571`, `function e1000_put_hw_semaphore_82571`, `function e1000_get_hw_semaphore_82573`, `function e1000_put_hw_semaphore_82573`, `function e1000_get_hw_semaphore_82574`.
- 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.
- 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.