drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/ixgbe/ixgbe_common.c- Extension
.c- Size
- 122142 bytes
- Lines
- 4415
- 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.hlinux/netdevice.hixgbe.hixgbe_common.hixgbe_phy.h
Detected Declarations
function ixgbe_device_supports_autoneg_fcfunction ixgbe_setup_fc_genericfunction ixgbe_device_supports_autoneg_fcfunction ixgbe_start_hw_genericfunction ixgbe_start_hw_gen2function ixgbe_init_hw_genericfunction ixgbe_clear_hw_cntrs_genericfunction ixgbe_read_pba_string_genericfunction ixgbe_get_mac_addr_genericfunction ixgbe_convert_bus_widthfunction ixgbe_convert_bus_speedfunction infofunction ixgbe_set_lan_id_multi_port_pciefunction ixgbe_stop_adapter_genericfunction ixgbe_init_led_link_act_genericfunction ixgbe_led_on_genericfunction ixgbe_led_off_genericfunction ixgbe_init_eeprom_params_genericfunction wordfunction ixgbe_write_eeprom_buffer_bit_bangfunction ixgbe_write_eeprom_genericfunction wordfunction wordfunction ixgbe_read_eeprom_bit_bang_genericfunction wordfunction ixgbe_detect_eeprom_page_size_genericfunction ixgbe_read_eerd_genericfunction wordfunction ixgbe_write_eewr_genericfunction bitfunction ixgbe_acquire_eepromfunction ixgbe_get_eeprom_semaphorefunction ixgbe_release_eeprom_semaphorefunction ixgbe_ready_eepromfunction devicesfunction ixgbe_standby_eepromfunction ixgbe_shift_out_eeprom_bitsfunction ixgbe_shift_in_eeprom_bitsfunction ixgbe_raise_eeprom_clkfunction ixgbe_lower_eeprom_clkfunction ixgbe_release_eepromfunction ixgbe_calc_eeprom_checksum_genericfunction ixgbe_validate_eeprom_checksum_genericfunction ixgbe_update_eeprom_checksum_genericfunction ixgbe_set_rar_genericfunction ixgbe_clear_rar_genericfunction ixgbe_init_rx_addrs_genericfunction ixgbe_mta_vector
Annotated Snippet
switch (hw->device_id) {
case IXGBE_DEV_ID_X550EM_A_SFP:
case IXGBE_DEV_ID_X550EM_A_SFP_N:
case IXGBE_DEV_ID_E610_SFP:
supported = false;
break;
default:
hw->mac.ops.check_link(hw, &speed, &link_up, false);
/* if link is down, assume supported */
if (link_up)
supported = speed == IXGBE_LINK_SPEED_1GB_FULL;
else
supported = true;
}
break;
case ixgbe_media_type_backplane:
if (hw->device_id == IXGBE_DEV_ID_X550EM_X_XFI)
supported = false;
else
supported = true;
break;
case ixgbe_media_type_copper:
/* only some copper devices support flow control autoneg */
switch (hw->device_id) {
case IXGBE_DEV_ID_82599_T3_LOM:
case IXGBE_DEV_ID_X540T:
case IXGBE_DEV_ID_X540T1:
case IXGBE_DEV_ID_X550T:
case IXGBE_DEV_ID_X550T1:
case IXGBE_DEV_ID_X550EM_X_10G_T:
case IXGBE_DEV_ID_X550EM_A_10G_T:
case IXGBE_DEV_ID_X550EM_A_1G_T:
case IXGBE_DEV_ID_X550EM_A_1G_T_L:
case IXGBE_DEV_ID_E610_10G_T:
case IXGBE_DEV_ID_E610_2_5G_T:
supported = true;
break;
default:
break;
}
break;
default:
break;
}
if (!supported)
hw_dbg(hw, "Device %x does not support flow control autoneg\n",
hw->device_id);
return supported;
}
/**
* ixgbe_setup_fc_generic - Set up flow control
* @hw: pointer to hardware structure
*
* Called at init time to set up flow control.
**/
int ixgbe_setup_fc_generic(struct ixgbe_hw *hw)
{
u32 reg = 0, reg_bp = 0;
bool locked = false;
int ret_val = 0;
u16 reg_cu = 0;
/*
* Validate the requested mode. Strict IEEE mode does not allow
* ixgbe_fc_rx_pause because it will cause us to fail at UNH.
*/
if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) {
hw_dbg(hw, "ixgbe_fc_rx_pause not valid in strict IEEE mode\n");
return -EINVAL;
}
/*
* 10gig parts do not have a word in the EEPROM to determine the
* default flow control setting, so we explicitly set it to full.
*/
if (hw->fc.requested_mode == ixgbe_fc_default)
hw->fc.requested_mode = ixgbe_fc_full;
/*
* Set up the 1G and 10G flow control advertisement registers so the
* HW will be able to do fc autoneg once the cable is plugged in. If
* we link at 10G, the 1G advertisement is harmless and vice versa.
*/
switch (hw->phy.media_type) {
case ixgbe_media_type_backplane:
/* some MAC's need RMW protection on AUTOC */
Annotation
- Immediate include surface: `linux/pci.h`, `linux/delay.h`, `linux/sched.h`, `linux/netdevice.h`, `ixgbe.h`, `ixgbe_common.h`, `ixgbe_phy.h`.
- Detected declarations: `function ixgbe_device_supports_autoneg_fc`, `function ixgbe_setup_fc_generic`, `function ixgbe_device_supports_autoneg_fc`, `function ixgbe_start_hw_generic`, `function ixgbe_start_hw_gen2`, `function ixgbe_init_hw_generic`, `function ixgbe_clear_hw_cntrs_generic`, `function ixgbe_read_pba_string_generic`, `function ixgbe_get_mac_addr_generic`, `function ixgbe_convert_bus_width`.
- 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.