drivers/net/wireless/intel/iwlwifi/mld/key.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/iwlwifi/mld/key.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/intel/iwlwifi/mld/key.c- Extension
.c- Size
- 12191 bytes
- Lines
- 473
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
key.hiface.hsta.hfw/api/datapath.h
Detected Declarations
struct remove_ap_keys_iter_datastruct iwl_mvm_sta_key_update_datafunction Copyrightfunction iwl_mld_get_key_sta_maskfunction iwl_mld_add_key_to_fwfunction iwl_mld_remove_key_from_fwfunction iwl_mld_get_igtk_ptrfunction iwl_mld_remove_keyfunction iwl_mld_add_keyfunction iwl_mld_remove_ap_keys_iterfunction iwl_mld_remove_ap_keysfunction iwl_mld_update_sta_key_iterfunction iwl_mld_update_sta_keysfunction iwl_mld_track_bigtkfunction iwl_mld_beacon_protection_enabled
Annotated Snippet
struct remove_ap_keys_iter_data {
u8 link_id;
struct ieee80211_sta *sta;
};
static void iwl_mld_remove_ap_keys_iter(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct ieee80211_sta *sta,
struct ieee80211_key_conf *key,
void *_data)
{
struct iwl_mld *mld = IWL_MAC80211_GET_MLD(hw);
struct remove_ap_keys_iter_data *data = _data;
if (key->hw_key_idx == STA_KEY_IDX_INVALID)
return;
/* All the pairwise keys should have been removed by now */
if (WARN_ON(sta))
return;
if (key->link_id >= 0 && key->link_id != data->link_id)
return;
iwl_mld_remove_key(mld, vif, data->sta, key);
}
void iwl_mld_remove_ap_keys(struct iwl_mld *mld, struct ieee80211_vif *vif,
struct ieee80211_sta *sta, unsigned int link_id)
{
struct remove_ap_keys_iter_data iter_data = {
.link_id = link_id,
.sta = sta,
};
if (WARN_ON_ONCE(vif->type != NL80211_IFTYPE_STATION))
return;
ieee80211_iter_keys(mld->hw, vif,
iwl_mld_remove_ap_keys_iter,
&iter_data);
}
struct iwl_mvm_sta_key_update_data {
struct ieee80211_sta *sta;
u32 old_sta_mask;
u32 new_sta_mask;
int err;
};
static void iwl_mld_update_sta_key_iter(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct ieee80211_sta *sta,
struct ieee80211_key_conf *key,
void *_data)
{
struct iwl_mvm_sta_key_update_data *data = _data;
struct iwl_mld *mld = IWL_MAC80211_GET_MLD(hw);
struct iwl_sec_key_cmd cmd = {
.action = cpu_to_le32(FW_CTXT_ACTION_MODIFY),
.u.modify.old_sta_mask = cpu_to_le32(data->old_sta_mask),
.u.modify.new_sta_mask = cpu_to_le32(data->new_sta_mask),
.u.modify.key_id = cpu_to_le32(key->keyidx),
.u.modify.key_flags =
cpu_to_le32(iwl_mld_get_key_flags(mld, vif, sta, key)),
};
int err;
/* only need to do this for pairwise keys (link_id == -1) */
if (sta != data->sta || key->link_id >= 0)
return;
err = iwl_mld_send_cmd_pdu(mld, WIDE_ID(DATA_PATH_GROUP, SEC_KEY_CMD),
&cmd);
if (err)
data->err = err;
}
int iwl_mld_update_sta_keys(struct iwl_mld *mld,
struct ieee80211_vif *vif,
struct ieee80211_sta *sta,
u32 old_sta_mask,
u32 new_sta_mask)
{
struct iwl_mvm_sta_key_update_data data = {
.sta = sta,
.old_sta_mask = old_sta_mask,
.new_sta_mask = new_sta_mask,
};
Annotation
- Immediate include surface: `key.h`, `iface.h`, `sta.h`, `fw/api/datapath.h`.
- Detected declarations: `struct remove_ap_keys_iter_data`, `struct iwl_mvm_sta_key_update_data`, `function Copyright`, `function iwl_mld_get_key_sta_mask`, `function iwl_mld_add_key_to_fw`, `function iwl_mld_remove_key_from_fw`, `function iwl_mld_get_igtk_ptr`, `function iwl_mld_remove_key`, `function iwl_mld_add_key`, `function iwl_mld_remove_ap_keys_iter`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
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.