drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c- Extension
.c- Size
- 24766 bytes
- Lines
- 916
- 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
mvm.htime-sync.hsta.h
Detected Declarations
function Copyrightfunction iwl_mvm_mld_send_sta_cmdfunction iwl_mvm_mld_add_int_sta_to_fwfunction driverfunction iwl_mvm_add_aux_sta_to_fwfunction iwl_mvm_mld_add_int_sta_with_queuefunction iwl_mvm_mld_add_int_stafunction iwl_mvm_mld_add_bcast_stafunction iwl_mvm_mld_add_mcast_stafunction iwl_mvm_mld_add_snif_stafunction iwl_mvm_mld_add_aux_stafunction iwl_mvm_mld_disable_txqfunction iwl_mvm_mld_rm_int_stafunction iwl_mvm_mld_rm_bcast_stafunction iwl_mvm_mld_rm_mcast_stafunction iwl_mvm_mld_rm_snif_stafunction iwl_mvm_mld_rm_aux_stafunction iwl_mvm_mld_cfg_stafunction iwl_mvm_mld_free_sta_linkfunction iwl_mvm_mld_sta_rm_all_sta_linksfunction iwl_mvm_mld_alloc_sta_linkfunction iwl_mvm_mld_alloc_sta_linksfunction for_each_sta_active_linkfunction iwl_mvm_mld_set_ap_sta_idfunction iwl_mvm_alloc_sta_after_restartfunction iwl_mvm_mld_add_stafunction for_each_sta_active_linkfunction iwl_mvm_mld_update_stafunction for_each_sta_active_linkfunction iwl_mvm_mld_disable_sta_queuesfunction iwl_mvm_mld_rm_stafunction for_each_sta_active_linkfunction iwl_mvm_mld_rm_sta_idfunction iwl_mvm_mld_sta_modify_disable_txfunction iwl_mvm_mld_sta_modify_disable_tx_apfunction iwl_mvm_mld_modify_all_sta_disable_tx
Annotated Snippet
if (WARN_ON(!link_conf || !mvm_link_sta)) {
ret = -EINVAL;
goto err;
}
ret = iwl_mvm_mld_cfg_sta(mvm, sta, vif, link_sta, link_conf,
mvm_link_sta);
if (ret)
goto err;
link_sta_added_to_fw |= BIT(link_id);
if (vif->type == NL80211_IFTYPE_STATION)
iwl_mvm_mld_set_ap_sta_id(sta, mvm_vif->link[link_id],
mvm_link_sta);
}
return 0;
err:
/* remove all already allocated stations in FW */
for_each_set_bit(link_id, &link_sta_added_to_fw,
IEEE80211_MLD_MAX_NUM_LINKS) {
struct iwl_mvm_link_sta *mvm_link_sta =
rcu_dereference_protected(mvm_sta->link[link_id],
lockdep_is_held(&mvm->mutex));
iwl_mvm_mld_rm_sta_from_fw(mvm, mvm_link_sta->sta_id);
}
/* free all sta resources in the driver */
iwl_mvm_mld_sta_rm_all_sta_links(mvm, mvm_sta);
return ret;
}
int iwl_mvm_mld_update_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
struct ieee80211_sta *sta)
{
struct iwl_mvm_sta *mvm_sta = iwl_mvm_sta_from_mac80211(sta);
struct ieee80211_link_sta *link_sta;
unsigned int link_id;
int ret = -EINVAL;
lockdep_assert_held(&mvm->mutex);
for_each_sta_active_link(vif, sta, link_sta, link_id) {
struct ieee80211_bss_conf *link_conf =
link_conf_dereference_protected(vif, link_id);
struct iwl_mvm_link_sta *mvm_link_sta =
rcu_dereference_protected(mvm_sta->link[link_id],
lockdep_is_held(&mvm->mutex));
if (WARN_ON(!link_conf || !mvm_link_sta))
return -EINVAL;
ret = iwl_mvm_mld_cfg_sta(mvm, sta, vif, link_sta, link_conf,
mvm_link_sta);
if (ret) {
IWL_ERR(mvm, "Failed to update sta link %d\n", link_id);
break;
}
}
return ret;
}
static void iwl_mvm_mld_disable_sta_queues(struct iwl_mvm *mvm,
struct ieee80211_vif *vif,
struct ieee80211_sta *sta)
{
struct iwl_mvm_sta *mvm_sta = iwl_mvm_sta_from_mac80211(sta);
u32 sta_mask = iwl_mvm_sta_fw_id_mask(mvm, sta, -1);
int i;
lockdep_assert_held(&mvm->mutex);
for (i = 0; i < ARRAY_SIZE(mvm_sta->tid_data); i++) {
if (mvm_sta->tid_data[i].txq_id == IWL_MVM_INVALID_QUEUE)
continue;
iwl_mvm_mld_disable_txq(mvm, sta_mask,
&mvm_sta->tid_data[i].txq_id, i);
mvm_sta->tid_data[i].txq_id = IWL_MVM_INVALID_QUEUE;
}
for (i = 0; i < ARRAY_SIZE(sta->txq); i++) {
struct iwl_mvm_txq *mvmtxq =
iwl_mvm_txq_from_mac80211(sta->txq[i]);
mvmtxq->txq_id = IWL_MVM_INVALID_QUEUE;
Annotation
- Immediate include surface: `mvm.h`, `time-sync.h`, `sta.h`.
- Detected declarations: `function Copyright`, `function iwl_mvm_mld_send_sta_cmd`, `function iwl_mvm_mld_add_int_sta_to_fw`, `function driver`, `function iwl_mvm_add_aux_sta_to_fw`, `function iwl_mvm_mld_add_int_sta_with_queue`, `function iwl_mvm_mld_add_int_sta`, `function iwl_mvm_mld_add_bcast_sta`, `function iwl_mvm_mld_add_mcast_sta`, `function iwl_mvm_mld_add_snif_sta`.
- 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.