drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c- Extension
.c- Size
- 118715 bytes
- Lines
- 4226
- 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
ixgbe_x540.hixgbe_x550.hixgbe_type.hixgbe_common.hixgbe_mbx.hixgbe_phy.h
Detected Declarations
function ixgbe_get_invariants_X550_xfunction ixgbe_get_invariants_X550_x_fwfunction ixgbe_get_invariants_X550_afunction ixgbe_get_invariants_X550_a_fwfunction ixgbe_setup_mux_ctlfunction ixgbe_read_cs4227function ixgbe_write_cs4227function ixgbe_read_pefunction ixgbe_write_pefunction ixgbe_reset_cs4227function ixgbe_check_cs4227function ixgbe_identify_phy_x550emfunction ixgbe_read_phy_reg_x550emfunction ixgbe_write_phy_reg_x550emfunction ixgbe_read_i2c_combined_genericfunction ixgbe_read_i2c_combined_generic_unlockedfunction ixgbe_write_i2c_combined_genericfunction ixgbe_write_i2c_combined_generic_unlockedfunction ixgbe_fw_phy_activityfunction ixgbe_get_phy_id_fwfunction ixgbe_identify_phy_fwfunction ixgbe_shutdown_fw_phyfunction ixgbe_setup_fw_linkfunction ixgbe_fc_autoneg_fwfunction ixgbe_init_eeprom_params_X550function ixgbe_iosf_waitfunction ixgbe_read_iosf_sb_reg_x550function ixgbe_get_phy_tokenfunction ixgbe_put_phy_tokenfunction ixgbe_write_iosf_sb_reg_x550afunction ixgbe_read_iosf_sb_reg_x550afunction wordfunction ixgbe_checksum_ptr_x550function ixgbe_calc_checksum_X550function ixgbe_calc_eeprom_checksum_X550function ixgbe_read_ee_hostif_X550function ixgbe_validate_eeprom_checksum_X550function ixgbe_write_ee_hostif_data_X550function ixgbe_write_ee_hostif_X550function ixgbe_update_flash_X550function ixgbe_get_bus_info_X550emfunction ixgbe_fw_recovery_mode_X550function ixgbe_disable_rx_x550function ixgbe_update_eeprom_checksum_X550function wordfunction ixgbe_write_iosf_sb_reg_x550function ixgbe_setup_ixfi_x550em_xfunction ixgbe_restart_an_internal_phy_x550em
Annotated Snippet
if (status) {
hw_err(hw, "semaphore failed with %d\n", status);
msleep(IXGBE_CS4227_CHECK_DELAY);
continue;
}
/* Get status of reset flow. */
status = ixgbe_read_cs4227(hw, IXGBE_CS4227_SCRATCH, &value);
if (!status && value == IXGBE_CS4227_RESET_COMPLETE)
goto out;
if (status || value != IXGBE_CS4227_RESET_PENDING)
break;
/* Reset is pending. Wait and check again. */
hw->mac.ops.release_swfw_sync(hw, swfw_mask);
msleep(IXGBE_CS4227_CHECK_DELAY);
}
/* If still pending, assume other instance failed. */
if (retry == IXGBE_CS4227_RETRIES) {
status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask);
if (status) {
hw_err(hw, "semaphore failed with %d\n", status);
return;
}
}
/* Reset the CS4227. */
status = ixgbe_reset_cs4227(hw);
if (status) {
hw_err(hw, "CS4227 reset failed: %d", status);
goto out;
}
/* Reset takes so long, temporarily release semaphore in case the
* other driver instance is waiting for the reset indication.
*/
ixgbe_write_cs4227(hw, IXGBE_CS4227_SCRATCH,
IXGBE_CS4227_RESET_PENDING);
hw->mac.ops.release_swfw_sync(hw, swfw_mask);
usleep_range(10000, 12000);
status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask);
if (status) {
hw_err(hw, "semaphore failed with %d", status);
return;
}
/* Record completion for next time. */
status = ixgbe_write_cs4227(hw, IXGBE_CS4227_SCRATCH,
IXGBE_CS4227_RESET_COMPLETE);
out:
hw->mac.ops.release_swfw_sync(hw, swfw_mask);
msleep(hw->eeprom.semaphore_delay);
}
/** ixgbe_identify_phy_x550em - Get PHY type based on device id
* @hw: pointer to hardware structure
*
* Returns error code
*/
static int ixgbe_identify_phy_x550em(struct ixgbe_hw *hw)
{
switch (hw->device_id) {
case IXGBE_DEV_ID_X550EM_A_SFP:
if (hw->bus.lan_id)
hw->phy.phy_semaphore_mask = IXGBE_GSSR_PHY1_SM;
else
hw->phy.phy_semaphore_mask = IXGBE_GSSR_PHY0_SM;
return ixgbe_identify_module_generic(hw);
case IXGBE_DEV_ID_X550EM_X_SFP:
/* set up for CS4227 usage */
hw->phy.phy_semaphore_mask = IXGBE_GSSR_SHARED_I2C_SM;
ixgbe_setup_mux_ctl(hw);
ixgbe_check_cs4227(hw);
fallthrough;
case IXGBE_DEV_ID_X550EM_A_SFP_N:
return ixgbe_identify_module_generic(hw);
case IXGBE_DEV_ID_X550EM_X_KX4:
hw->phy.type = ixgbe_phy_x550em_kx4;
break;
case IXGBE_DEV_ID_X550EM_X_XFI:
hw->phy.type = ixgbe_phy_x550em_xfi;
break;
case IXGBE_DEV_ID_X550EM_X_KR:
case IXGBE_DEV_ID_X550EM_A_KR:
case IXGBE_DEV_ID_X550EM_A_KR_L:
hw->phy.type = ixgbe_phy_x550em_kr;
break;
case IXGBE_DEV_ID_X550EM_A_10G_T:
Annotation
- Immediate include surface: `ixgbe_x540.h`, `ixgbe_x550.h`, `ixgbe_type.h`, `ixgbe_common.h`, `ixgbe_mbx.h`, `ixgbe_phy.h`.
- Detected declarations: `function ixgbe_get_invariants_X550_x`, `function ixgbe_get_invariants_X550_x_fw`, `function ixgbe_get_invariants_X550_a`, `function ixgbe_get_invariants_X550_a_fw`, `function ixgbe_setup_mux_ctl`, `function ixgbe_read_cs4227`, `function ixgbe_write_cs4227`, `function ixgbe_read_pe`, `function ixgbe_write_pe`, `function ixgbe_reset_cs4227`.
- 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.