drivers/net/wireless/ath/ath12k/mac.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath12k/mac.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath12k/mac.c- Extension
.c- Size
- 426001 bytes
- Lines
- 15498
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
net/mac80211.hnet/cfg80211.hlinux/etherdevice.hmac.hcore.hdebug.hwmi.hhw.hdp_tx.hdp_rx.htestmode.hpeer.hdebugfs.hhif.hwow.hdebugfs_sta.hdp.hdp_cmn.h
Detected Declarations
struct ath12k_mac_change_chanctx_argfunction Copyrightfunction ath12k_mac_he_convert_tones_to_ru_tonesfunction ath12k_mac_eht_gi_to_nl80211_eht_gifunction ath12k_mac_eht_ru_tones_to_nl80211_eht_ru_allocfunction ath12k_mac_bw_to_mac80211_bwfunction ath12k_mac_mac80211_bw_to_ath12k_bwfunction ath12k_mac_hw_ratecode_to_legacy_ratefunction ath12k_mac_bitrate_to_idxfunction ath12k_mac_max_ht_nssfunction ath12k_mac_max_vht_nssfunction ath12k_mac_max_he_nssfunction ath12k_mac_max_eht_nssfunction ath12k_mac_max_eht_mcs_nssfunction ath12k_parse_mpdudensityfunction ath12k_mac_vif_link_chanfunction ath12k_mac_get_tx_arviffunction ath12k_mac_get_link_bss_conffunction ath12k_mac_bitrate_is_cckfunction ath12k_mac_hw_rate_to_idxfunction ath12k_mac_bitrate_to_ratefunction ath12k_get_arvif_iterfunction for_each_set_bitfunction ath12k_mac_is_ml_arviffunction for_each_arfunction ath12k_mac_get_any_chanctx_conf_iterfunction list_for_each_entryfunction ath12k_mac_band_matchfunction ath12k_mac_get_target_pdev_id_from_viffunction ath12k_mac_get_target_pdev_idfunction ath12k_pdev_caps_updatefunction ath12k_mac_txpower_recalcfunction list_for_each_entryfunction ath12k_recalc_rtscts_protfunction ath12k_mac_set_kickoutfunction ath12k_mac_link_sta_rhash_cleanupfunction ath12k_mac_peer_cleanup_allfunction list_for_each_entry_safefunction ath12k_mac_dp_peer_cleanupfunction list_for_each_entry_safefunction ath12k_mac_vdev_setup_syncfunction ath12k_monitor_vdev_upfunction ath12k_mac_monitor_vdev_startfunction ath12k_mac_monitor_vdev_stopfunction ath12k_mac_monitor_vdev_deletefunction ath12k_mac_monitor_startfunction ath12k_mac_monitor_stopfunction ath12k_mac_vdev_stop
Annotated Snippet
struct ath12k_mac_change_chanctx_arg {
struct ieee80211_chanctx_conf *ctx;
struct ieee80211_vif_chanctx_switch *vifs;
int n_vifs;
int next_vif;
struct ath12k *ar;
};
static void
ath12k_mac_change_chanctx_cnt_iter(void *data, u8 *mac,
struct ieee80211_vif *vif)
{
struct ath12k_vif *ahvif = ath12k_vif_to_ahvif(vif);
struct ath12k_mac_change_chanctx_arg *arg = data;
struct ieee80211_bss_conf *link_conf;
struct ath12k_link_vif *arvif;
unsigned long links_map;
u8 link_id;
lockdep_assert_wiphy(ahvif->ah->hw->wiphy);
links_map = ahvif->links_map;
for_each_set_bit(link_id, &links_map, IEEE80211_MLD_MAX_NUM_LINKS) {
arvif = wiphy_dereference(ahvif->ah->hw->wiphy, ahvif->link[link_id]);
if (WARN_ON(!arvif))
continue;
if (!arvif->is_created || arvif->ar != arg->ar)
continue;
link_conf = wiphy_dereference(ahvif->ah->hw->wiphy,
vif->link_conf[link_id]);
if (WARN_ON(!link_conf))
continue;
if (rcu_access_pointer(link_conf->chanctx_conf) != arg->ctx)
continue;
arg->n_vifs++;
}
}
static void
ath12k_mac_change_chanctx_fill_iter(void *data, u8 *mac,
struct ieee80211_vif *vif)
{
struct ath12k_vif *ahvif = ath12k_vif_to_ahvif(vif);
struct ath12k_mac_change_chanctx_arg *arg = data;
struct ieee80211_bss_conf *link_conf;
struct ieee80211_chanctx_conf *ctx;
struct ath12k_link_vif *arvif;
unsigned long links_map;
u8 link_id;
lockdep_assert_wiphy(ahvif->ah->hw->wiphy);
links_map = ahvif->links_map;
for_each_set_bit(link_id, &links_map, IEEE80211_MLD_MAX_NUM_LINKS) {
arvif = wiphy_dereference(ahvif->ah->hw->wiphy, ahvif->link[link_id]);
if (WARN_ON(!arvif))
continue;
if (!arvif->is_created || arvif->ar != arg->ar)
continue;
link_conf = wiphy_dereference(ahvif->ah->hw->wiphy,
vif->link_conf[arvif->link_id]);
if (WARN_ON(!link_conf))
continue;
ctx = rcu_access_pointer(link_conf->chanctx_conf);
if (ctx != arg->ctx)
continue;
if (WARN_ON(arg->next_vif == arg->n_vifs))
return;
arg->vifs[arg->next_vif].vif = vif;
arg->vifs[arg->next_vif].old_ctx = ctx;
arg->vifs[arg->next_vif].new_ctx = ctx;
arg->vifs[arg->next_vif].link_conf = link_conf;
arg->next_vif++;
}
}
static u32 ath12k_mac_nlwidth_to_wmiwidth(enum nl80211_chan_width width)
{
switch (width) {
case NL80211_CHAN_WIDTH_20:
return WMI_CHAN_WIDTH_20;
Annotation
- Immediate include surface: `net/mac80211.h`, `net/cfg80211.h`, `linux/etherdevice.h`, `mac.h`, `core.h`, `debug.h`, `wmi.h`, `hw.h`.
- Detected declarations: `struct ath12k_mac_change_chanctx_arg`, `function Copyright`, `function ath12k_mac_he_convert_tones_to_ru_tones`, `function ath12k_mac_eht_gi_to_nl80211_eht_gi`, `function ath12k_mac_eht_ru_tones_to_nl80211_eht_ru_alloc`, `function ath12k_mac_bw_to_mac80211_bw`, `function ath12k_mac_mac80211_bw_to_ath12k_bw`, `function ath12k_mac_hw_ratecode_to_legacy_rate`, `function ath12k_mac_bitrate_to_idx`, `function ath12k_mac_max_ht_nss`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration 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.