drivers/net/wireless/intel/iwlwifi/mvm/sta.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/intel/iwlwifi/mvm/sta.c- Extension
.c- Size
- 120355 bytes
- Lines
- 4318
- 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.
- 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.hmvm.hsta.hrs.h
Detected Declarations
function Copyrightfunction iwl_mvm_find_free_sta_idfunction iwl_mvm_get_sta_ampdu_densfunction iwl_mvm_get_sta_uapsd_acsfunction iwl_mvm_sta_send_to_fwfunction iwl_mvm_rx_agg_session_expiredfunction iwl_mvm_invalidate_sta_queuefunction iwl_mvm_disable_txqfunction iwl_mvm_get_queue_agg_tidsfunction iwl_mvm_remove_sta_queue_markingfunction iwl_mvm_free_inactive_queuefunction iwl_mvm_get_shared_queuefunction iwl_mvm_reconfig_scdfunction iwl_mvm_redirect_queuefunction iwl_mvm_find_free_queuefunction iwl_mvm_get_queue_sizefunction iwl_mvm_tvqm_enable_txqfunction for_each_sta_active_linkfunction iwl_mvm_sta_alloc_queue_tvqmfunction iwl_mvm_update_txq_mappingfunction iwl_mvm_enable_txqfunction iwl_mvm_change_queue_tidfunction iwl_mvm_unshare_queuefunction iwl_mvm_remove_inactive_tidsfunction onefunction for_each_set_bitfunction iwl_mvm_sta_alloc_queuefunction iwl_mvm_sta_ensure_queuefunction iwl_mvm_add_new_dqa_stream_wkfunction iwl_mvm_reserve_sta_streamfunction iwl_mvm_realloc_queues_after_restartfunction iwl_mvm_add_int_sta_commonfunction iwl_mvm_sta_initfunction iwl_mvm_add_stafunction iwl_mvm_drain_stafunction driverfunction iwl_mvm_disable_sta_queuesfunction iwl_mvm_wait_sta_queues_emptyfunction iwl_mvm_sta_delfunction iwl_mvm_rm_stafunction iwl_mvm_rm_sta_idfunction iwl_mvm_allocate_int_stafunction iwl_mvm_dealloc_int_stafunction iwl_mvm_enable_aux_snif_queuefunction iwl_mvm_enable_aux_snif_queue_tvqmfunction iwl_mvm_add_int_sta_with_queuefunction iwl_mvm_add_aux_stafunction iwl_mvm_add_snif_sta
Annotated Snippet
if (!iwl_mvm_has_new_tx_api(mvm)) {
add_sta_cmd.tfd_queue_msk =
cpu_to_le32(mvm_sta->tfd_queue_msk);
if (flags & STA_MODIFY_QUEUES)
add_sta_cmd.modify_mask |= STA_MODIFY_QUEUES;
} else {
WARN_ON(flags & STA_MODIFY_QUEUES);
}
}
switch (sta->deflink.bandwidth) {
case IEEE80211_STA_RX_BW_320:
case IEEE80211_STA_RX_BW_160:
add_sta_cmd.station_flags |= cpu_to_le32(STA_FLG_FAT_EN_160MHZ);
fallthrough;
case IEEE80211_STA_RX_BW_80:
add_sta_cmd.station_flags |= cpu_to_le32(STA_FLG_FAT_EN_80MHZ);
fallthrough;
case IEEE80211_STA_RX_BW_40:
add_sta_cmd.station_flags |= cpu_to_le32(STA_FLG_FAT_EN_40MHZ);
fallthrough;
case IEEE80211_STA_RX_BW_20:
if (sta->deflink.ht_cap.ht_supported)
add_sta_cmd.station_flags |=
cpu_to_le32(STA_FLG_FAT_EN_20MHZ);
break;
}
switch (sta->deflink.rx_nss) {
case 1:
add_sta_cmd.station_flags |= cpu_to_le32(STA_FLG_MIMO_EN_SISO);
break;
case 2:
add_sta_cmd.station_flags |= cpu_to_le32(STA_FLG_MIMO_EN_MIMO2);
break;
case 3 ... 8:
add_sta_cmd.station_flags |= cpu_to_le32(STA_FLG_MIMO_EN_MIMO3);
break;
}
switch (sta->deflink.smps_mode) {
case IEEE80211_SMPS_AUTOMATIC:
case IEEE80211_SMPS_NUM_MODES:
WARN_ON(1);
break;
case IEEE80211_SMPS_STATIC:
/* override NSS */
add_sta_cmd.station_flags &= ~cpu_to_le32(STA_FLG_MIMO_EN_MSK);
add_sta_cmd.station_flags |= cpu_to_le32(STA_FLG_MIMO_EN_SISO);
break;
case IEEE80211_SMPS_DYNAMIC:
add_sta_cmd.station_flags |= cpu_to_le32(STA_FLG_RTS_MIMO_PROT);
break;
case IEEE80211_SMPS_OFF:
/* nothing */
break;
}
if (sta->deflink.ht_cap.ht_supported ||
mvm_sta->vif->bss_conf.chanreq.oper.chan->band == NL80211_BAND_6GHZ)
add_sta_cmd.station_flags_msk |=
cpu_to_le32(STA_FLG_MAX_AGG_SIZE_MSK |
STA_FLG_AGG_MPDU_DENS_MSK);
mpdu_dens = iwl_mvm_get_sta_ampdu_dens(&sta->deflink,
&mvm_sta->vif->bss_conf,
&agg_size);
add_sta_cmd.station_flags |=
cpu_to_le32(agg_size << STA_FLG_MAX_AGG_SIZE_SHIFT);
add_sta_cmd.station_flags |=
cpu_to_le32(mpdu_dens << STA_FLG_AGG_MPDU_DENS_SHIFT);
if (mvm_sta->sta_state >= IEEE80211_STA_ASSOC)
add_sta_cmd.assoc_id = cpu_to_le16(sta->aid);
if (sta->wme) {
add_sta_cmd.modify_mask |= STA_MODIFY_UAPSD_ACS;
add_sta_cmd.uapsd_acs = iwl_mvm_get_sta_uapsd_acs(sta);
add_sta_cmd.sp_length = sta->max_sp ? sta->max_sp * 2 : 128;
}
status = ADD_STA_SUCCESS;
ret = iwl_mvm_send_cmd_pdu_status(mvm, ADD_STA,
iwl_mvm_add_sta_cmd_size(mvm),
&add_sta_cmd, &status);
if (ret)
return ret;
switch (status & IWL_ADD_STA_STATUS_MASK) {
Annotation
- Immediate include surface: `net/mac80211.h`, `mvm.h`, `sta.h`, `rs.h`.
- Detected declarations: `function Copyright`, `function iwl_mvm_find_free_sta_id`, `function iwl_mvm_get_sta_ampdu_dens`, `function iwl_mvm_get_sta_uapsd_acs`, `function iwl_mvm_sta_send_to_fw`, `function iwl_mvm_rx_agg_session_expired`, `function iwl_mvm_invalidate_sta_queue`, `function iwl_mvm_disable_txq`, `function iwl_mvm_get_queue_agg_tids`, `function iwl_mvm_remove_sta_queue_marking`.
- 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.