drivers/net/wireless/intel/iwlwifi/mvm/d3.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/intel/iwlwifi/mvm/d3.c- Extension
.c- Size
- 90021 bytes
- Lines
- 3281
- 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
linux/etherdevice.hlinux/ip.hlinux/fs.hnet/cfg80211.hnet/ipv6.hnet/tcp.hnet/addrconf.hiwl-modparams.hfw-api.hmvm.hfw/img.h
Detected Declarations
struct wowlan_key_reprogram_datastruct wowlan_key_rsc_tsc_datastruct wowlan_key_rsc_v5_datastruct wowlan_key_tkip_datastruct wowlan_key_gtk_type_iterstruct iwl_multicast_key_datastruct iwl_wowlan_status_datastruct iwl_mvm_d3_gtk_iter_datastruct iwl_mvm_nd_resultsstruct iwl_d3_dataenum iwl_d3_notifenum rt_statusfunction Copyrightfunction iwl_mvm_ipv6_addr_changefunction iwl_mvm_set_default_unicast_keyfunction iwl_mvm_convert_p1kfunction iwl_mvm_wowlan_program_keysfunction iwl_mvm_wowlan_get_rsc_tsc_datafunction iwl_mvm_wowlan_get_rsc_v5_datafunction iwl_mvm_wowlan_config_rsc_tscfunction iwl_mvm_wowlan_get_tkip_datafunction iwl_mvm_wowlan_gtk_type_iterfunction iwl_mvm_send_patterns_v1function iwl_mvm_send_patternsfunction iwl_mvm_d3_reprogramfunction iwl_mvm_get_last_nonqos_seqfunction iwl_mvm_set_last_nonqos_seqfunction iwl_mvm_switch_to_d3function iwl_mvm_get_wowlan_configfunction iwl_mvm_wowlan_config_key_paramsfunction iwl_mvm_wowlan_configfunction iwl_mvm_netdetect_configfunction iwl_mvm_free_ndfunction __iwl_mvm_suspendfunction iwl_mvm_suspendfunction iwl_mvm_report_wakeup_reasonsfunction iwl_mvm_le64_to_aes_seqfunction iwl_mvm_aes_sc_to_seqfunction iwl_mvm_le64_to_tkip_seqfunction iwl_mvm_tkip_sc_to_seqfunction iwl_mvm_set_key_rx_seq_tidsfunction iwl_mvm_set_aes_ptk_rx_seqfunction iwl_mvm_convert_key_countersfunction iwl_mvm_convert_key_counters_v5_gtk_seqfunction iwl_mvm_convert_key_counters_v5function iwl_mvm_set_key_rx_seq_idxfunction iwl_mvm_set_key_rx_seqfunction iwl_mvm_d3_set_igtk_bigtk_ipn
Annotated Snippet
struct wowlan_key_reprogram_data {
bool error;
int wep_key_idx;
};
static void iwl_mvm_wowlan_program_keys(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct ieee80211_sta *sta,
struct ieee80211_key_conf *key,
void *_data)
{
struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
struct wowlan_key_reprogram_data *data = _data;
int ret;
switch (key->cipher) {
case WLAN_CIPHER_SUITE_WEP40:
case WLAN_CIPHER_SUITE_WEP104: { /* hack it for now */
DEFINE_RAW_FLEX(struct iwl_mvm_wep_key_cmd, wkc, wep_key, 1);
struct iwl_mvm_wep_key *wep_key = wkc->wep_key;
wkc->mac_id_n_color =
cpu_to_le32(FW_CMD_ID_AND_COLOR(mvmvif->id,
mvmvif->color));
wkc->num_keys = 1;
/* firmware sets STA_KEY_FLG_WEP_13BYTES */
wkc->decryption_type = STA_KEY_FLG_WEP;
wep_key->key_index = key->keyidx;
wep_key->key_size = key->keylen;
/*
* This will fail -- the key functions don't set support
* pairwise WEP keys. However, that's better than silently
* failing WoWLAN. Or maybe not?
*/
if (key->flags & IEEE80211_KEY_FLAG_PAIRWISE)
break;
memcpy(&wep_key->key[3], key->key, key->keylen);
if (key->keyidx == mvmvif->tx_key_idx) {
/* TX key must be at offset 0 */
wep_key->key_offset = 0;
} else {
/* others start at 1 */
data->wep_key_idx++;
wep_key->key_offset = data->wep_key_idx;
}
mutex_lock(&mvm->mutex);
ret = iwl_mvm_send_cmd_pdu(mvm, WEP_KEY, 0,
__struct_size(wkc), wkc);
data->error = ret != 0;
mvm->ptk_ivlen = key->iv_len;
mvm->ptk_icvlen = key->icv_len;
mvm->gtk_ivlen = key->iv_len;
mvm->gtk_icvlen = key->icv_len;
mutex_unlock(&mvm->mutex);
/* don't upload key again */
return;
}
default:
data->error = true;
return;
case WLAN_CIPHER_SUITE_BIP_GMAC_256:
case WLAN_CIPHER_SUITE_BIP_GMAC_128:
return;
case WLAN_CIPHER_SUITE_AES_CMAC:
/*
* Ignore CMAC keys -- the WoWLAN firmware doesn't support them
* but we also shouldn't abort suspend due to that. It does have
* support for the IGTK key renewal, but doesn't really use the
* IGTK for anything. This means we could spuriously wake up or
* be deauthenticated, but that was considered acceptable.
*/
return;
case WLAN_CIPHER_SUITE_TKIP:
case WLAN_CIPHER_SUITE_CCMP:
case WLAN_CIPHER_SUITE_GCMP:
case WLAN_CIPHER_SUITE_GCMP_256:
break;
}
mutex_lock(&mvm->mutex);
/*
* The D3 firmware hardcodes the key offset 0 as the key it
* uses to transmit packets to the AP, i.e. the PTK.
*/
Annotation
- Immediate include surface: `linux/etherdevice.h`, `linux/ip.h`, `linux/fs.h`, `net/cfg80211.h`, `net/ipv6.h`, `net/tcp.h`, `net/addrconf.h`, `iwl-modparams.h`.
- Detected declarations: `struct wowlan_key_reprogram_data`, `struct wowlan_key_rsc_tsc_data`, `struct wowlan_key_rsc_v5_data`, `struct wowlan_key_tkip_data`, `struct wowlan_key_gtk_type_iter`, `struct iwl_multicast_key_data`, `struct iwl_wowlan_status_data`, `struct iwl_mvm_d3_gtk_iter_data`, `struct iwl_mvm_nd_results`, `struct iwl_d3_data`.
- 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.