drivers/net/ethernet/intel/i40e/i40e_adminq.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/i40e/i40e_adminq.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/i40e/i40e_adminq.c- Extension
.c- Size
- 31562 bytes
- Lines
- 1152
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/delay.hi40e_alloc.hi40e_register.hi40e_prototype.h
Detected Declarations
function i40e_alloc_adminq_asq_ringfunction i40e_alloc_adminq_arq_ringfunction i40e_free_adminq_asqfunction i40e_free_adminq_arqfunction i40e_alloc_arq_bufsfunction i40e_alloc_asq_bufsfunction i40e_free_arq_bufsfunction i40e_free_asq_bufsfunction i40e_config_asq_regsfunction receivefunction i40e_init_asqfunction Receivefunction i40e_shutdown_asqfunction i40e_shutdown_arqfunction i40e_set_hw_capsfunction i40e_init_adminqfunction i40e_shutdown_adminqfunction i40e_clean_asqfunction i40e_asq_donefunction i40e_asq_send_command_atomic_execfunction i40e_asq_send_command_atomicfunction i40e_asq_send_commandfunction i40e_asq_send_command_atomic_v2function i40e_fill_default_direct_cmd_descfunction i40e_clean_arq_elementfunction i40e_resume_aq
Annotated Snippet
if (i40e_is_aq_api_ver_ge(hw, 1, 5)) {
/* Supported in FW API version higher than 1.4 */
set_bit(I40E_HW_CAP_GENEVE_OFFLOAD, hw->caps);
}
if (i40e_is_fw_ver_lt(hw, 4, 33)) {
set_bit(I40E_HW_CAP_RESTART_AUTONEG, hw->caps);
/* No DCB support for FW < v4.33 */
set_bit(I40E_HW_CAP_NO_DCB_SUPPORT, hw->caps);
}
if (i40e_is_fw_ver_lt(hw, 4, 3)) {
/* Disable FW LLDP if FW < v4.3 */
set_bit(I40E_HW_CAP_STOP_FW_LLDP, hw->caps);
}
if (i40e_is_fw_ver_ge(hw, 4, 40)) {
/* Use the FW Set LLDP MIB API if FW >= v4.40 */
set_bit(I40E_HW_CAP_USE_SET_LLDP_MIB, hw->caps);
}
if (i40e_is_fw_ver_ge(hw, 6, 0)) {
/* Enable PTP L4 if FW > v6.0 */
set_bit(I40E_HW_CAP_PTP_L4, hw->caps);
}
break;
case I40E_MAC_X722:
set_bit(I40E_HW_CAP_AQ_SRCTL_ACCESS_ENABLE, hw->caps);
set_bit(I40E_HW_CAP_NVM_READ_REQUIRES_LOCK, hw->caps);
set_bit(I40E_HW_CAP_RSS_AQ, hw->caps);
set_bit(I40E_HW_CAP_128_QP_RSS, hw->caps);
set_bit(I40E_HW_CAP_ATR_EVICT, hw->caps);
set_bit(I40E_HW_CAP_WB_ON_ITR, hw->caps);
set_bit(I40E_HW_CAP_MULTI_TCP_UDP_RSS_PCTYPE, hw->caps);
set_bit(I40E_HW_CAP_NO_PCI_LINK_CHECK, hw->caps);
set_bit(I40E_HW_CAP_USE_SET_LLDP_MIB, hw->caps);
set_bit(I40E_HW_CAP_GENEVE_OFFLOAD, hw->caps);
set_bit(I40E_HW_CAP_PTP_L4, hw->caps);
set_bit(I40E_HW_CAP_WOL_MC_MAGIC_PKT_WAKE, hw->caps);
set_bit(I40E_HW_CAP_OUTER_UDP_CSUM, hw->caps);
if (rd32(hw, I40E_GLQF_FDEVICTENA(1)) !=
I40E_FDEVICT_PCTYPE_DEFAULT) {
hw_warn(hw, "FD EVICT PCTYPES are not right, disable FD HW EVICT\n");
clear_bit(I40E_HW_CAP_ATR_EVICT, hw->caps);
}
if (i40e_is_aq_api_ver_ge(hw, 1,
I40E_MINOR_VER_FW_LLDP_STOPPABLE_X722))
set_bit(I40E_HW_CAP_FW_LLDP_STOPPABLE, hw->caps);
if (i40e_is_aq_api_ver_ge(hw, 1,
I40E_MINOR_VER_GET_LINK_INFO_X722))
set_bit(I40E_HW_CAP_AQ_PHY_ACCESS, hw->caps);
if (i40e_is_aq_api_ver_ge(hw, 1,
I40E_MINOR_VER_FW_REQUEST_FEC_X722))
set_bit(I40E_HW_CAP_X722_FEC_REQUEST, hw->caps);
fallthrough;
default:
break;
}
/* Newer versions of firmware require lock when reading the NVM */
if (i40e_is_aq_api_ver_ge(hw, 1, 5))
set_bit(I40E_HW_CAP_NVM_READ_REQUIRES_LOCK, hw->caps);
/* The ability to RX (not drop) 802.1ad frames was added in API 1.7 */
if (i40e_is_aq_api_ver_ge(hw, 1, 7))
set_bit(I40E_HW_CAP_802_1AD, hw->caps);
if (i40e_is_aq_api_ver_ge(hw, 1, 8))
set_bit(I40E_HW_CAP_FW_LLDP_PERSISTENT, hw->caps);
if (i40e_is_aq_api_ver_ge(hw, 1, 9))
set_bit(I40E_HW_CAP_AQ_PHY_ACCESS_EXTENDED, hw->caps);
}
/**
* i40e_init_adminq - main initialization routine for Admin Queue
* @hw: pointer to the hardware structure
*
* Prior to calling this function, drivers *MUST* set the following fields
* in the hw->aq structure:
* - hw->aq.num_asq_entries
* - hw->aq.num_arq_entries
* - hw->aq.arq_buf_size
* - hw->aq.asq_buf_size
**/
int i40e_init_adminq(struct i40e_hw *hw)
{
u16 cfg_ptr, oem_hi, oem_lo;
u16 eetrack_lo, eetrack_hi;
Annotation
- Immediate include surface: `linux/delay.h`, `i40e_alloc.h`, `i40e_register.h`, `i40e_prototype.h`.
- Detected declarations: `function i40e_alloc_adminq_asq_ring`, `function i40e_alloc_adminq_arq_ring`, `function i40e_free_adminq_asq`, `function i40e_free_adminq_arq`, `function i40e_alloc_arq_bufs`, `function i40e_alloc_asq_bufs`, `function i40e_free_arq_bufs`, `function i40e_free_asq_bufs`, `function i40e_config_asq_regs`, `function receive`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.