drivers/net/ethernet/intel/igb/e1000_mac.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/igb/e1000_mac.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/igb/e1000_mac.c- Extension
.c- Size
- 48808 bytes
- Lines
- 1686
- 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/delay.hlinux/pci.hlinux/netdevice.hlinux/etherdevice.he1000_mac.higb.h
Detected Declarations
function igb_get_bus_info_pciefunction igb_clear_vftafunction igb_write_vftafunction igb_init_rx_addrsfunction igb_find_vlvf_slotfunction igb_vfta_setfunction igb_check_alt_mac_addrfunction igb_rar_setfunction igb_mta_setfunction igb_mta_setfunction igb_i21x_hw_doublecheckfunction igb_update_mc_addr_listfunction igb_clear_hw_cntrs_basefunction igb_check_for_copper_linkfunction igb_setup_linkfunction igb_config_collision_distfunction igb_set_fc_watermarksfunction igb_set_default_fcfunction igb_force_mac_fcfunction igb_config_fc_after_link_upfunction Registerfunction capabilityfunction Registerfunction igb_get_speed_and_duplex_copperfunction igb_get_hw_semaphorefunction igb_put_hw_semaphorefunction igb_get_auto_rd_donefunction igb_valid_led_defaultfunction igb_id_led_initfunction igb_cleanup_ledfunction igb_blink_ledfunction igb_led_offfunction igb_disable_pcie_masterfunction igb_validate_mdi_settingfunction igb_write_8bit_ctrl_regfunction igb_enable_mng_pass_thru
Annotated Snippet
switch (pcie_link_status & PCI_EXP_LNKSTA_CLS) {
case PCI_EXP_LNKSTA_CLS_2_5GB:
bus->speed = e1000_bus_speed_2500;
break;
case PCI_EXP_LNKSTA_CLS_5_0GB:
bus->speed = e1000_bus_speed_5000;
break;
default:
bus->speed = e1000_bus_speed_unknown;
break;
}
bus->width = (enum e1000_bus_width)FIELD_GET(PCI_EXP_LNKSTA_NLW,
pcie_link_status);
}
reg = rd32(E1000_STATUS);
bus->func = FIELD_GET(E1000_STATUS_FUNC_MASK, reg);
return 0;
}
/**
* igb_clear_vfta - Clear VLAN filter table
* @hw: pointer to the HW structure
*
* Clears the register array which contains the VLAN filter table by
* setting all the values to 0.
**/
void igb_clear_vfta(struct e1000_hw *hw)
{
u32 offset;
for (offset = E1000_VLAN_FILTER_TBL_SIZE; offset--;)
hw->mac.ops.write_vfta(hw, offset, 0);
}
/**
* igb_write_vfta - Write value to VLAN filter table
* @hw: pointer to the HW structure
* @offset: register offset in VLAN filter table
* @value: register value written to VLAN filter table
*
* Writes value at the given offset in the register array which stores
* the VLAN filter table.
**/
void igb_write_vfta(struct e1000_hw *hw, u32 offset, u32 value)
{
struct igb_adapter *adapter = hw->back;
array_wr32(E1000_VFTA, offset, value);
wrfl();
adapter->shadow_vfta[offset] = value;
}
/**
* igb_init_rx_addrs - Initialize receive address's
* @hw: pointer to the HW structure
* @rar_count: receive address registers
*
* Setups the receive address registers by setting the base receive address
* register to the devices MAC address and clearing all the other receive
* address registers to 0.
**/
void igb_init_rx_addrs(struct e1000_hw *hw, u16 rar_count)
{
u32 i;
u8 mac_addr[ETH_ALEN] = {0};
/* Setup the receive address */
hw_dbg("Programming MAC Address into RAR[0]\n");
hw->mac.ops.rar_set(hw, hw->mac.addr, 0);
/* Zero out the other (rar_entry_count - 1) receive addresses */
hw_dbg("Clearing RAR[1-%u]\n", rar_count-1);
for (i = 1; i < rar_count; i++)
hw->mac.ops.rar_set(hw, mac_addr, i);
}
/**
* igb_find_vlvf_slot - find the VLAN id or the first empty slot
* @hw: pointer to hardware structure
* @vlan: VLAN id to write to VLAN filter
* @vlvf_bypass: skip VLVF if no match is found
*
* return the VLVF index where this VLAN id should be placed
*
**/
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/if_ether.h`, `linux/delay.h`, `linux/pci.h`, `linux/netdevice.h`, `linux/etherdevice.h`, `e1000_mac.h`, `igb.h`.
- Detected declarations: `function igb_get_bus_info_pcie`, `function igb_clear_vfta`, `function igb_write_vfta`, `function igb_init_rx_addrs`, `function igb_find_vlvf_slot`, `function igb_vfta_set`, `function igb_check_alt_mac_addr`, `function igb_rar_set`, `function igb_mta_set`, `function igb_mta_set`.
- 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.