drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c- Extension
.c- Size
- 68509 bytes
- Lines
- 2269
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/pci.hlinux/delay.hlinux/sched.hixgbe.hixgbe_phy.hixgbe_mbx.h
Detected Declarations
function ixgbe_mng_enabledfunction ixgbe_init_mac_link_ops_82599function ixgbe_setup_sfp_modules_82599function partfunction partfunction ixgbe_get_invariants_82599function ixgbe_init_phy_ops_82599function ixgbe_get_link_capabilities_82599function typefunction ixgbe_stop_mac_link_on_d3_82599function ixgbe_start_mac_link_82599function ixgbe_disable_tx_laser_multispeed_fiberfunction ixgbe_enable_tx_laser_multispeed_fiberfunction ixgbe_flap_tx_laser_multispeed_fiberfunction ixgbe_set_hard_rate_select_speedfunction ixgbe_setup_mac_link_smartspeedfunction ixgbe_setup_mac_link_82599function ixgbe_setup_copper_link_82599function ixgbe_reset_hw_82599function ixgbe_fdir_check_cmd_completefunction ixgbe_reinit_fdir_tables_82599function ixgbe_fdir_enable_82599function ixgbe_init_fdir_signature_82599function ixgbe_init_fdir_perfect_82599function ixgbe_atr_compute_sig_hash_82599function ixgbe_fdir_add_signature_filter_82599function ixgbe_atr_compute_perfect_hash_82599function ixgbe_get_fdirtcpm_82599function ixgbe_fdir_set_input_mask_82599function ixgbe_fdir_write_perfect_filter_82599function ixgbe_fdir_erase_perfect_filter_82599function ixgbe_read_analog_reg8_82599function ixgbe_write_analog_reg8_82599function ixgbe_start_hw_82599function ixgbe_identify_phy_82599function ixgbe_enable_rx_dma_82599function ixgbe_verify_fw_version_82599function ixgbe_verify_lesm_fw_enabled_82599function wordfunction ixgbe_read_eeprom_82599function ixgbe_reset_pipeline_82599function ixgbe_read_i2c_byte_82599function ixgbe_write_i2c_byte_82599
Annotated Snippet
while (data_value != 0xffff) {
IXGBE_WRITE_REG(hw, IXGBE_CORECTL, data_value);
IXGBE_WRITE_FLUSH(hw);
if (hw->eeprom.ops.read(hw, ++data_offset, &data_value))
goto setup_sfp_err;
}
/* Release the semaphore */
hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_MAC_CSR_SM);
/*
* Delay obtaining semaphore again to allow FW access,
* semaphore_delay is in ms usleep_range needs us.
*/
usleep_range(hw->eeprom.semaphore_delay * 1000,
hw->eeprom.semaphore_delay * 2000);
/* Restart DSP and set SFI mode */
ret_val = hw->mac.ops.prot_autoc_write(hw,
hw->mac.orig_autoc | IXGBE_AUTOC_LMS_10G_SERIAL,
false);
if (ret_val) {
hw_dbg(hw, " sfp module setup not complete\n");
return -EIO;
}
}
return 0;
setup_sfp_err:
/* Release the semaphore */
hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_MAC_CSR_SM);
/* Delay obtaining semaphore again to allow FW access,
* semaphore_delay is in ms usleep_range needs us.
*/
usleep_range(hw->eeprom.semaphore_delay * 1000,
hw->eeprom.semaphore_delay * 2000);
hw_err(hw, "eeprom read at offset %d failed\n", data_offset);
return -EIO;
}
/**
* prot_autoc_read_82599 - Hides MAC differences needed for AUTOC read
* @hw: pointer to hardware structure
* @locked: Return the if we locked for this read.
* @reg_val: Value we read from AUTOC
*
* For this part (82599) we need to wrap read-modify-writes with a possible
* FW/SW lock. It is assumed this lock will be freed with the next
* prot_autoc_write_82599(). Note, that locked can only be true in cases
* where this function doesn't return an error.
**/
static int prot_autoc_read_82599(struct ixgbe_hw *hw, bool *locked,
u32 *reg_val)
{
int ret_val;
*locked = false;
/* If LESM is on then we need to hold the SW/FW semaphore. */
if (ixgbe_verify_lesm_fw_enabled_82599(hw)) {
ret_val = hw->mac.ops.acquire_swfw_sync(hw,
IXGBE_GSSR_MAC_CSR_SM);
if (ret_val)
return -EBUSY;
*locked = true;
}
*reg_val = IXGBE_READ_REG(hw, IXGBE_AUTOC);
return 0;
}
/**
* prot_autoc_write_82599 - Hides MAC differences needed for AUTOC write
* @hw: pointer to hardware structure
* @autoc: value to write to AUTOC
* @locked: bool to indicate whether the SW/FW lock was already taken by
* previous prot_autoc_read_82599.
*
* This part (82599) may need to hold a the SW/FW lock around all writes to
* AUTOC. Likewise after a write we need to do a pipeline reset.
**/
static int prot_autoc_write_82599(struct ixgbe_hw *hw, u32 autoc, bool locked)
{
int ret_val = 0;
/* Blocked by MNG FW so bail */
if (ixgbe_check_reset_blocked(hw))
goto out;
Annotation
- Immediate include surface: `linux/pci.h`, `linux/delay.h`, `linux/sched.h`, `ixgbe.h`, `ixgbe_phy.h`, `ixgbe_mbx.h`.
- Detected declarations: `function ixgbe_mng_enabled`, `function ixgbe_init_mac_link_ops_82599`, `function ixgbe_setup_sfp_modules_82599`, `function part`, `function part`, `function ixgbe_get_invariants_82599`, `function ixgbe_init_phy_ops_82599`, `function ixgbe_get_link_capabilities_82599`, `function type`, `function ixgbe_stop_mac_link_on_d3_82599`.
- 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.