drivers/net/ethernet/intel/igb/e1000_i210.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/igb/e1000_i210.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/igb/e1000_i210.c- Extension
.c- Size
- 23909 bytes
- Lines
- 913
- 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/if_ether.hlinux/types.he1000_hw.he1000_i210.h
Detected Declarations
function igb_get_hw_semaphore_i210function igb_acquire_nvm_i210function igb_release_nvm_i210function igb_acquire_swfw_sync_i210function igb_release_swfw_sync_i210function igb_read_nvm_srrd_i210function igb_write_nvm_srwrfunction igb_write_nvm_srwr_i210function igb_read_invm_word_i210function igb_read_invm_i210function igb_read_invm_versionfunction igb_validate_nvm_checksum_i210function igb_update_nvm_checksum_i210function igb_pool_flash_update_done_i210function igb_get_flash_presence_i210function igb_update_flash_i210function igb_valid_led_default_i210function __igb_access_xmdio_regfunction igb_read_xmdio_regfunction igb_write_xmdio_regfunction igb_init_nvm_params_i210function igb_pll_workaround_i210function igb_get_cfg_done_i210
Annotated Snippet
if (hw->dev_spec._82575.clear_semaphore_once) {
hw->dev_spec._82575.clear_semaphore_once = false;
igb_put_hw_semaphore(hw);
for (i = 0; i < timeout; i++) {
swsm = rd32(E1000_SWSM);
if (!(swsm & E1000_SWSM_SMBI))
break;
udelay(50);
}
}
/* If we do not have the semaphore here, we have to give up. */
if (i == timeout) {
hw_dbg("Driver can't access device - SMBI bit is set.\n");
return -E1000_ERR_NVM;
}
}
/* Get the FW semaphore. */
for (i = 0; i < timeout; i++) {
swsm = rd32(E1000_SWSM);
wr32(E1000_SWSM, swsm | E1000_SWSM_SWESMBI);
/* Semaphore acquired if bit latched */
if (rd32(E1000_SWSM) & E1000_SWSM_SWESMBI)
break;
udelay(50);
}
if (i == timeout) {
/* Release semaphores */
igb_put_hw_semaphore(hw);
hw_dbg("Driver can't access the NVM\n");
return -E1000_ERR_NVM;
}
return 0;
}
/**
* igb_acquire_nvm_i210 - Request for access to EEPROM
* @hw: pointer to the HW structure
*
* Acquire the necessary semaphores for exclusive access to the EEPROM.
* Set the EEPROM access request bit and wait for EEPROM access grant bit.
* Return successful if access grant bit set, else clear the request for
* EEPROM access and return -E1000_ERR_NVM (-1).
**/
static s32 igb_acquire_nvm_i210(struct e1000_hw *hw)
{
return igb_acquire_swfw_sync_i210(hw, E1000_SWFW_EEP_SM);
}
/**
* igb_release_nvm_i210 - Release exclusive access to EEPROM
* @hw: pointer to the HW structure
*
* Stop any current commands to the EEPROM and clear the EEPROM request bit,
* then release the semaphores acquired.
**/
static void igb_release_nvm_i210(struct e1000_hw *hw)
{
igb_release_swfw_sync_i210(hw, E1000_SWFW_EEP_SM);
}
/**
* igb_acquire_swfw_sync_i210 - Acquire SW/FW semaphore
* @hw: pointer to the HW structure
* @mask: specifies which semaphore to acquire
*
* Acquire the SW/FW semaphore to access the PHY or NVM. The mask
* will also specify which port we're acquiring the lock for.
**/
s32 igb_acquire_swfw_sync_i210(struct e1000_hw *hw, u16 mask)
{
u32 swfw_sync;
u32 swmask = mask;
u32 fwmask = mask << 16;
s32 ret_val = 0;
s32 i = 0, timeout = 200; /* FIXME: find real value to use here */
while (i < timeout) {
if (igb_get_hw_semaphore_i210(hw)) {
ret_val = -E1000_ERR_SWFW_SYNC;
goto out;
}
swfw_sync = rd32(E1000_SW_FW_SYNC);
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/if_ether.h`, `linux/types.h`, `e1000_hw.h`, `e1000_i210.h`.
- Detected declarations: `function igb_get_hw_semaphore_i210`, `function igb_acquire_nvm_i210`, `function igb_release_nvm_i210`, `function igb_acquire_swfw_sync_i210`, `function igb_release_swfw_sync_i210`, `function igb_read_nvm_srrd_i210`, `function igb_write_nvm_srwr`, `function igb_write_nvm_srwr_i210`, `function igb_read_invm_word_i210`, `function igb_read_invm_i210`.
- 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.