drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c- Extension
.c- Size
- 28859 bytes
- Lines
- 979
- 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.h
Detected Declarations
function Copyrightfunction iwl_mvm_mld_mac_remove_interfacefunction iwl_mvm_prepare_mac_removalfunction __iwl_mvm_mld_assign_vif_chanctxfunction switchingfunction iwl_mvm_mld_assign_vif_chanctxfunction __iwl_mvm_mld_unassign_vif_chanctxfunction iwl_mvm_mld_unassign_vif_chanctxfunction iwl_mvm_tpe_sta_cmd_datafunction iwl_mvm_send_ap_tx_power_constraint_cmdfunction iwl_mvm_mld_start_ap_ibssfunction iwl_mvm_mld_start_apfunction iwl_mvm_mld_start_ibssfunction iwl_mvm_mld_stop_ap_ibssfunction iwl_mvm_mld_stop_apfunction iwl_mvm_mld_stop_ibssfunction iwl_mvm_mld_mac_sta_statefunction iwl_mvm_mld_link_info_changed_stationfunction iwl_mvm_mld_vif_have_valid_ap_stafunction for_each_mvm_vif_valid_linkfunction iwl_mvm_mld_vif_cfg_changed_stationfunction for_each_mvm_vif_valid_linkfunction iwl_mvm_mld_link_info_changed_ap_ibssfunction iwl_mvm_mld_link_info_changedfunction iwl_mvm_mld_vif_cfg_changedfunction iwl_mvm_mld_switch_vif_chanctxfunction iwl_mvm_mld_config_iface_filterfunction iwl_mvm_mld_mac_conf_txfunction iwl_mvm_mld_roc_linkfunction iwl_mvm_mld_roc
Annotated Snippet
if (mvmvif->deflink.phy_ctxt) {
iwl_mvm_phy_ctxt_unref(mvm, mvmvif->deflink.phy_ctxt);
mvmvif->deflink.phy_ctxt = NULL;
}
mvm->p2p_device_vif = NULL;
iwl_mvm_remove_link(mvm, vif, &vif->bss_conf);
} else {
iwl_mvm_disable_link(mvm, vif, &vif->bss_conf);
}
iwl_mvm_mld_mac_ctxt_remove(mvm, vif);
RCU_INIT_POINTER(mvm->vif_id_to_mac[mvmvif->id], NULL);
probe_data = rcu_dereference_protected(mvmvif->deflink.probe_resp_data,
lockdep_is_held(&mvm->mutex));
RCU_INIT_POINTER(mvmvif->deflink.probe_resp_data, NULL);
if (probe_data)
kfree_rcu(probe_data, rcu_head);
if (vif->type == NL80211_IFTYPE_MONITOR) {
mvm->monitor_on = false;
__clear_bit(IEEE80211_HW_RX_INCLUDES_FCS, mvm->hw->flags);
}
}
static int
__iwl_mvm_mld_assign_vif_chanctx(struct iwl_mvm *mvm,
struct ieee80211_vif *vif,
struct ieee80211_bss_conf *link_conf,
struct ieee80211_chanctx_conf *ctx,
bool switching_chanctx)
{
u16 *phy_ctxt_id = (u16 *)ctx->drv_priv;
struct iwl_mvm_phy_ctxt *phy_ctxt = &mvm->phy_ctxts[*phy_ctxt_id];
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
unsigned int link_id = link_conf->link_id;
int ret;
if (WARN_ON_ONCE(!mvmvif->link[link_id]))
return -EINVAL;
/* mac parameters such as HE support can change at this stage
* For sta, need first to configure correct state from drv_sta_state
* and only after that update mac config.
*/
if (vif->type == NL80211_IFTYPE_AP) {
ret = iwl_mvm_mld_mac_ctxt_changed(mvm, vif, false);
if (ret) {
IWL_ERR(mvm, "failed to update MAC %pM\n", vif->addr);
return -EINVAL;
}
}
mvmvif->link[link_id]->phy_ctxt = phy_ctxt;
if (switching_chanctx) {
/* reactivate if we turned this off during channel switch */
if (vif->type == NL80211_IFTYPE_AP)
mvmvif->ap_ibss_active = true;
}
/* send it first with phy context ID */
ret = iwl_mvm_link_changed(mvm, vif, link_conf, 0, false);
if (ret)
goto out;
/*
* if link switching (link not active yet) we'll activate it in
* firmware later on link-info change, which mac80211 guarantees
* for link switch after the stations are set up
*/
if (ieee80211_vif_link_active(vif, link_conf->link_id)) {
ret = iwl_mvm_link_changed(mvm, vif, link_conf,
LINK_CONTEXT_MODIFY_ACTIVE |
LINK_CONTEXT_MODIFY_RATES_INFO,
true);
if (ret)
goto out;
}
if (vif->type == NL80211_IFTYPE_STATION)
iwl_mvm_send_ap_tx_power_constraint_cmd(mvm, vif,
link_conf,
false);
/*
* Power state must be updated before quotas,
* otherwise fw will complain.
*/
Annotation
- Immediate include surface: `mvm.h`.
- Detected declarations: `function Copyright`, `function iwl_mvm_mld_mac_remove_interface`, `function iwl_mvm_prepare_mac_removal`, `function __iwl_mvm_mld_assign_vif_chanctx`, `function switching`, `function iwl_mvm_mld_assign_vif_chanctx`, `function __iwl_mvm_mld_unassign_vif_chanctx`, `function iwl_mvm_mld_unassign_vif_chanctx`, `function iwl_mvm_tpe_sta_cmd_data`, `function iwl_mvm_send_ap_tx_power_constraint_cmd`.
- 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.