drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.c- Extension
.c- Size
- 46460 bytes
- Lines
- 1665
- 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
aq_hw.haq_hw_utils.haq_ring.haq_nic.haq_ptp.hhw_atl/hw_atl_b0.hhw_atl/hw_atl_utils.hhw_atl/hw_atl_llh.hhw_atl/hw_atl_llh_internal.hhw_atl2.hhw_atl2_utils.hhw_atl2_llh.hhw_atl2_internal.hhw_atl2_llh_internal.h
Detected Declarations
function hw_atl2_filter_tag_getfunction hw_atl2_filter_tag_putfunction hw_atl2_sem_act_rslvr_getfunction hw_atl2_hw_resetfunction hw_atl2_tc_ptp_setfunction hw_atl2_hw_queue_to_tc_map_setfunction hw_atl2_hw_qos_setfunction hw_atl2_hw_rss_setfunction hw_atl2_hw_init_tx_tc_rate_limitfunction hw_atl2_hw_init_tx_pathfunction hw_atl2_hw_init_new_rx_filtersfunction hw_atl2_hw_new_rx_filter_vlan_promiscfunction hw_atl2_hw_new_rx_filter_promiscfunction hw_atl2_act_rslvr_table_setfunction hw_atl2_hw_init_rx_pathfunction hw_atl2_hw_mac_addr_setfunction hw_atl2_hw_initfunction hw_atl2_hw_ring_rx_initfunction hw_atl2_hw_ring_tx_initfunction hw_atl2_hw_packet_filter_setfunction hw_atl2_hw_multicast_list_setfunction hw_atl2_hw_interrupt_moderation_setfunction hw_atl2_hw_stopfunction hw_atl2_enable_ptpfunction aq_get_ptp_tsfunction hw_atl2_hw_ring_tx_ptp_get_tsfunction hw_atl2_hw_rx_extract_tsfunction hw_atl2_adj_sys_clockfunction hw_atl2_adj_clock_freqfunction hw_atl2_hw_tx_ptp_ring_initfunction hw_atl2_hw_rx_ptp_ring_initfunction hw_atl2_hw_get_clk_selfunction hw_atl2_gpio_pulsefunction hw_atl2_rxf_l3_is_equalfunction hw_atl2_new_fl3l4_find_l3function hw_atl2_rxf_l3_getfunction hw_atl2_rxf_l3_putfunction hw_atl2_rxf_l4_is_equalfunction hw_atl2_new_fl3l4_find_l4function hw_atl2_rxf_l4_putfunction hw_atl2_rxf_l4_getfunction hw_atl2_new_fl3l4_configurefunction hw_atl2_hw_fl3l4_setfunction hw_atl2_hw_fl2_setfunction hw_atl2_hw_fl2_clearfunction acceptfunction hw_atl2_hw_vlan_ctrl
Annotated Snippet
if (tags[i].usage > 0 && tags[i].action == action) {
tags[i].usage++;
return i;
}
for (i = 1; i <= top; i++)
if (tags[i].usage == 0) {
tags[i].usage = 1;
tags[i].action = action;
return i;
}
return -ENOSPC;
}
static void hw_atl2_filter_tag_put(struct hw_atl2_tag_policy *tags,
int tag)
{
if (tags[tag].usage > 0)
tags[tag].usage--;
}
static u32 hw_atl2_sem_act_rslvr_get(struct aq_hw_s *self)
{
return hw_atl_reg_glb_cpu_sem_get(self, HW_ATL2_FW_SM_ACT_RSLVR);
}
static int hw_atl2_hw_reset(struct aq_hw_s *self)
{
struct hw_atl2_priv *priv = self->priv;
s8 clk_sel;
int err;
int i;
err = hw_atl2_utils_soft_reset(self);
if (err)
return err;
memset(&priv->last_stats, 0, sizeof(priv->last_stats));
memset(priv->l3_v4_filters, 0, sizeof(priv->l3_v4_filters));
memset(priv->l3_v6_filters, 0, sizeof(priv->l3_v6_filters));
memset(priv->l4_filters, 0, sizeof(priv->l4_filters));
memset(priv->etype_policy, 0, sizeof(priv->etype_policy));
for (i = 0; i < HW_ATL2_RPF_L3L4_FILTERS; i++) {
priv->l3l4_filters[i].l3_index = -1;
priv->l3l4_filters[i].l4_index = -1;
}
clk_sel = READ_ONCE(self->clk_select);
if (clk_sel != -1)
hw_atl2_enable_ptp(self,
clk_sel,
aq_utils_obj_test(&self->flags, AQ_HW_PTP_AVAILABLE) ?
1 : 0);
self->aq_fw_ops->set_state(self, MPI_RESET);
err = aq_hw_err_from_flags(self);
return err;
}
static int hw_atl2_tc_ptp_set(struct aq_hw_s *self)
{
/* Init TC2 for PTP_TX */
hw_atl_tpb_tx_pkt_buff_size_per_tc_set(self, HW_ATL2_PTP_TXBUF_SIZE,
AQ_HW_PTP_TC);
/* Init TC2 for PTP_RX */
hw_atl_rpb_rx_pkt_buff_size_per_tc_set(self, HW_ATL2_PTP_RXBUF_SIZE,
AQ_HW_PTP_TC);
/* No flow control for PTP */
hw_atl_rpb_rx_xoff_en_per_tc_set(self, 0U, AQ_HW_PTP_TC);
hw_atl2_tpb_tps_highest_priority_tc_set(self, AQ_HW_PTP_TC);
return aq_hw_err_from_flags(self);
}
static int hw_atl2_hw_queue_to_tc_map_set(struct aq_hw_s *self)
{
struct aq_nic_cfg_s *cfg = self->aq_nic_cfg;
unsigned int tcs, q_per_tc;
unsigned int tc, q;
u32 rx_map = 0;
u32 tx_map = 0;
hw_atl2_tpb_tx_tc_q_rand_map_en_set(self, 1U);
Annotation
- Immediate include surface: `aq_hw.h`, `aq_hw_utils.h`, `aq_ring.h`, `aq_nic.h`, `aq_ptp.h`, `hw_atl/hw_atl_b0.h`, `hw_atl/hw_atl_utils.h`, `hw_atl/hw_atl_llh.h`.
- Detected declarations: `function hw_atl2_filter_tag_get`, `function hw_atl2_filter_tag_put`, `function hw_atl2_sem_act_rslvr_get`, `function hw_atl2_hw_reset`, `function hw_atl2_tc_ptp_set`, `function hw_atl2_hw_queue_to_tc_map_set`, `function hw_atl2_hw_qos_set`, `function hw_atl2_hw_rss_set`, `function hw_atl2_hw_init_tx_tc_rate_limit`, `function hw_atl2_hw_init_tx_path`.
- 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.