drivers/net/wireless/intel/iwlwifi/mvm/link.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/iwlwifi/mvm/link.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/intel/iwlwifi/mvm/link.c- Extension
.c- Size
- 8991 bytes
- Lines
- 298
- 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
mvm.htime-event.h
Detected Declarations
function Copyrightfunction iwl_mvm_set_link_fw_idfunction iwl_mvm_add_linkfunction iwl_mvm_link_changedfunction iwl_mvm_remove_linkfunction iwl_mvm_disable_linkfunction iwl_mvm_init_link
Annotated Snippet
if (!active && vif->type == NL80211_IFTYPE_STATION) {
iwl_mvm_stop_session_protection(mvm, vif);
if (link_info->csa_block_tx) {
cmd.block_tx = 1;
link_info->csa_block_tx = false;
}
}
}
cmd.link_id = cpu_to_le32(link_info->fw_link_id);
/* The phy_id, link address and listen_lmac can be modified only until
* the link becomes active, otherwise they will be ignored.
*/
phyctxt = link_info->phy_ctxt;
if (phyctxt)
cmd.phy_id = cpu_to_le32(phyctxt->id);
else
cmd.phy_id = cpu_to_le32(FW_CTXT_INVALID);
cmd.mac_id = cpu_to_le32(mvmvif->id);
memcpy(cmd.local_link_addr, link_conf->addr, ETH_ALEN);
cmd.active = cpu_to_le32(active);
if (vif->type == NL80211_IFTYPE_ADHOC && link_conf->bssid)
memcpy(cmd.ibss_bssid_addr, link_conf->bssid, ETH_ALEN);
iwl_mvm_set_fw_basic_rates(mvm, vif, link_info,
&cmd.cck_rates, &cmd.ofdm_rates);
cmd.cck_short_preamble = cpu_to_le32(link_conf->use_short_preamble);
cmd.short_slot = cpu_to_le32(link_conf->use_short_slot);
/* The fw does not distinguish between ht and fat */
ht_flag = LINK_PROT_FLG_HT_PROT | LINK_PROT_FLG_FAT_PROT;
iwl_mvm_set_fw_protection_flags(mvm, vif, link_conf,
&cmd.protection_flags,
ht_flag, LINK_PROT_FLG_TGG_PROTECT);
iwl_mvm_set_fw_qos_params(mvm, vif, link_conf, cmd.ac,
&cmd.qos_flags);
cmd.bi = cpu_to_le32(link_conf->beacon_int);
cmd.dtim_interval = cpu_to_le32(link_conf->beacon_int *
link_conf->dtim_period);
if (!link_conf->he_support || iwlwifi_mod_params.disable_11ax ||
(vif->type == NL80211_IFTYPE_STATION && !vif->cfg.assoc)) {
changes &= ~LINK_CONTEXT_MODIFY_HE_PARAMS;
goto send_cmd;
}
cmd.htc_trig_based_pkt_ext = link_conf->htc_trig_based_pkt_ext;
if (link_conf->uora_exists) {
cmd.rand_alloc_ecwmin =
link_conf->uora_ocw_range & 0x7;
cmd.rand_alloc_ecwmax =
(link_conf->uora_ocw_range >> 3) & 0x7;
}
/* ap_sta may be NULL if we're disconnecting */
if (changes & LINK_CONTEXT_MODIFY_HE_PARAMS && mvmvif->ap_sta) {
struct ieee80211_link_sta *link_sta =
link_sta_dereference_check(mvmvif->ap_sta, link_id);
if (!WARN_ON(!link_sta) && link_sta->he_cap.has_he &&
link_sta->he_cap.he_cap_elem.mac_cap_info[5] &
IEEE80211_HE_MAC_CAP5_OM_CTRL_UL_MU_DATA_DIS_RX)
cmd.ul_mu_data_disable = 1;
}
/* TODO how to set ndp_fdbk_buff_th_exp? */
if (iwl_mvm_set_fw_mu_edca_params(mvm, mvmvif->link[link_id],
&cmd.trig_based_txf[0])) {
flags |= LINK_FLG_MU_EDCA_CW;
flags_mask |= LINK_FLG_MU_EDCA_CW;
}
if (changes & LINK_CONTEXT_MODIFY_EHT_PARAMS) {
struct ieee80211_chanctx_conf *ctx;
struct cfg80211_chan_def *def = NULL;
rcu_read_lock();
ctx = rcu_dereference(link_conf->chanctx_conf);
if (ctx)
def = iwl_mvm_chanctx_def(mvm, ctx);
Annotation
- Immediate include surface: `mvm.h`, `time-event.h`.
- Detected declarations: `function Copyright`, `function iwl_mvm_set_link_fw_id`, `function iwl_mvm_add_link`, `function iwl_mvm_link_changed`, `function iwl_mvm_remove_link`, `function iwl_mvm_disable_link`, `function iwl_mvm_init_link`.
- 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.