drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c- Extension
.c- Size
- 27128 bytes
- Lines
- 982
- 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.
- 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
../aq_hw.h../aq_hw_utils.h../aq_ring.h../aq_nic.hhw_atl_a0.hhw_atl_utils.hhw_atl_llh.hhw_atl_a0_internal.h
Detected Declarations
function hw_atl_a0_hw_resetfunction hw_atl_a0_hw_qos_setfunction hw_atl_a0_hw_rss_hash_setfunction hw_atl_a0_hw_rss_setfunction hw_atl_a0_hw_offload_setfunction hw_atl_a0_hw_init_tx_pathfunction hw_atl_a0_hw_init_rx_pathfunction hw_atl_a0_hw_mac_addr_setfunction hw_atl_a0_hw_initfunction hw_atl_a0_hw_ring_tx_startfunction hw_atl_a0_hw_ring_rx_startfunction hw_atl_a0_hw_startfunction hw_atl_a0_hw_tx_ring_tail_updatefunction hw_atl_a0_hw_ring_tx_xmitfunction hw_atl_a0_hw_ring_rx_initfunction hw_atl_a0_hw_ring_tx_initfunction hw_atl_a0_hw_ring_rx_fillfunction hw_atl_a0_hw_ring_tx_head_updatefunction hw_atl_a0_hw_ring_rx_receivefunction hw_atl_a0_hw_irq_enablefunction hw_atl_a0_hw_irq_disablefunction hw_atl_a0_hw_irq_readfunction hw_atl_a0_hw_packet_filter_setfunction hw_atl_a0_hw_multicast_list_setfunction hw_atl_a0_hw_interrupt_moderation_setfunction hw_atl_a0_hw_stopfunction hw_atl_a0_hw_ring_tx_stopfunction hw_atl_a0_hw_ring_rx_stopfunction hw_atl_a0_hw_fl3l4_clearfunction hw_atl_a0_hw_fl3l4_set
Annotated Snippet
if (buff->is_gso_tcp) {
txd->ctl |= (buff->len_l3 << 31) |
(buff->len_l2 << 24) |
HW_ATL_A0_TXD_CTL_CMD_TCP |
HW_ATL_A0_TXD_CTL_DESC_TYPE_TXC;
txd->ctl2 |= (buff->mss << 16) |
(buff->len_l4 << 8) |
(buff->len_l3 >> 1);
pkt_len -= (buff->len_l4 +
buff->len_l3 +
buff->len_l2);
is_gso = true;
if (buff->is_ipv6)
txd->ctl |= HW_ATL_A0_TXD_CTL_CMD_IPV6;
} else {
buff_pa_len = buff->len;
txd->buf_addr = buff->pa;
txd->ctl |= (HW_ATL_A0_TXD_CTL_BLEN &
((u32)buff_pa_len << 4));
txd->ctl |= HW_ATL_A0_TXD_CTL_DESC_TYPE_TXD;
/* PAY_LEN */
txd->ctl2 |= HW_ATL_A0_TXD_CTL2_LEN & (pkt_len << 14);
if (is_gso) {
txd->ctl |= HW_ATL_A0_TXD_CTL_CMD_LSO;
txd->ctl2 |= HW_ATL_A0_TXD_CTL2_CTX_EN;
}
/* Tx checksum offloads */
if (buff->is_ip_cso)
txd->ctl |= HW_ATL_A0_TXD_CTL_CMD_IPCSO;
if (buff->is_udp_cso || buff->is_tcp_cso)
txd->ctl |= HW_ATL_A0_TXD_CTL_CMD_TUCSO;
if (unlikely(buff->is_eop)) {
txd->ctl |= HW_ATL_A0_TXD_CTL_EOP;
txd->ctl |= HW_ATL_A0_TXD_CTL_CMD_WB;
is_gso = false;
}
}
ring->sw_tail = aq_ring_next_dx(ring, ring->sw_tail);
}
hw_atl_a0_hw_tx_ring_tail_update(self, ring);
return aq_hw_err_from_flags(self);
}
static int hw_atl_a0_hw_ring_rx_init(struct aq_hw_s *self,
struct aq_ring_s *aq_ring,
struct aq_ring_param_s *aq_ring_param)
{
u32 dma_desc_addr_msw = (u32)(((u64)aq_ring->dx_ring_pa) >> 32);
u32 dma_desc_addr_lsw = (u32)aq_ring->dx_ring_pa;
hw_atl_rdm_rx_desc_en_set(self, false, aq_ring->idx);
hw_atl_rdm_rx_desc_head_splitting_set(self, 0U, aq_ring->idx);
hw_atl_reg_rx_dma_desc_base_addresslswset(self, dma_desc_addr_lsw,
aq_ring->idx);
hw_atl_reg_rx_dma_desc_base_addressmswset(self,
dma_desc_addr_msw,
aq_ring->idx);
hw_atl_rdm_rx_desc_len_set(self, aq_ring->size / 8U, aq_ring->idx);
hw_atl_rdm_rx_desc_data_buff_size_set(self,
aq_ring->frame_max / 1024U,
aq_ring->idx);
hw_atl_rdm_rx_desc_head_buff_size_set(self, 0U, aq_ring->idx);
hw_atl_rdm_rx_desc_head_splitting_set(self, 0U, aq_ring->idx);
hw_atl_rpo_rx_desc_vlan_stripping_set(self, 0U, aq_ring->idx);
/* Rx ring set mode */
/* Mapping interrupt vector */
hw_atl_itr_irq_map_rx_set(self, aq_ring_param->vec_idx, aq_ring->idx);
hw_atl_itr_irq_map_en_rx_set(self, true, aq_ring->idx);
hw_atl_rdm_cpu_id_set(self, aq_ring_param->cpu, aq_ring->idx);
hw_atl_rdm_rx_desc_dca_en_set(self, 0U, aq_ring->idx);
hw_atl_rdm_rx_head_dca_en_set(self, 0U, aq_ring->idx);
Annotation
- Immediate include surface: `../aq_hw.h`, `../aq_hw_utils.h`, `../aq_ring.h`, `../aq_nic.h`, `hw_atl_a0.h`, `hw_atl_utils.h`, `hw_atl_llh.h`, `hw_atl_a0_internal.h`.
- Detected declarations: `function hw_atl_a0_hw_reset`, `function hw_atl_a0_hw_qos_set`, `function hw_atl_a0_hw_rss_hash_set`, `function hw_atl_a0_hw_rss_set`, `function hw_atl_a0_hw_offload_set`, `function hw_atl_a0_hw_init_tx_path`, `function hw_atl_a0_hw_init_rx_path`, `function hw_atl_a0_hw_mac_addr_set`, `function hw_atl_a0_hw_init`, `function hw_atl_a0_hw_ring_tx_start`.
- 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.
- 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.