drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c- Extension
.c- Size
- 23913 bytes
- Lines
- 736
- 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
rs.hfw-api.hsta.hiwl-op-mode.hmvm.h
Detected Declarations
function Copyrightfunction rs_fw_set_active_chainsfunction rs_fw_sgi_cw_supportfunction rs_fw_get_config_flagsfunction rs_fw_vht_highest_rx_mcs_indexfunction rs_fw_vht_set_enabled_ratesfunction rs_fw_he_ieee80211_mcs_to_rs_mcsfunction rs_fw_he_set_enabled_ratesfunction rs_fw_eht_max_nssfunction rs_fw_set_eht_mcs_nssfunction rs_fw_rs_mcs2eht_mcsfunction rs_fw_eht_set_enabled_ratesfunction rs_fw_set_supp_ratesfunction iwl_mvm_tlc_update_notiffunction rs_fw_get_max_amsdu_lenfunction iwl_mvm_rs_fw_rate_initfunction rs_fw_tx_protectionfunction iwl_mvm_rs_add_sta_linkfunction iwl_mvm_rs_add_sta
Annotated Snippet
if (size < 2000) {
size = 0;
enabled = 0;
}
if (link_sta->agg.max_amsdu_len < size) {
/*
* In debug link_sta->agg.max_amsdu_len < size
* so also check with orig_amsdu_len which holds the
* original data before debugfs changed the value
*/
WARN_ON(mvm_link_sta->orig_amsdu_len < size);
goto out;
}
mvmsta->amsdu_enabled = enabled;
mvmsta->max_amsdu_len = size;
link_sta->agg.max_rc_amsdu_len = mvmsta->max_amsdu_len;
for (i = 0; i < IWL_MAX_TID_COUNT; i++) {
if (mvmsta->amsdu_enabled & BIT(i))
link_sta->agg.max_tid_amsdu_len[i] =
iwl_mvm_max_amsdu_size(mvm, sta, i);
else
/*
* Not so elegant, but this will effectively
* prevent AMSDU on this TID
*/
link_sta->agg.max_tid_amsdu_len[i] = 1;
}
ieee80211_sta_recalc_aggregates(sta);
IWL_DEBUG_RATE(mvm,
"AMSDU update. AMSDU size: %d, AMSDU selected size: %d, AMSDU TID bitmap 0x%X\n",
le32_to_cpu(notif->amsdu_size), size,
mvmsta->amsdu_enabled);
}
out:
rcu_read_unlock();
}
u16 rs_fw_get_max_amsdu_len(struct ieee80211_sta *sta,
struct ieee80211_bss_conf *link_conf,
struct ieee80211_link_sta *link_sta)
{
const struct ieee80211_sta_vht_cap *vht_cap = &link_sta->vht_cap;
const struct ieee80211_sta_ht_cap *ht_cap = &link_sta->ht_cap;
const struct ieee80211_sta_eht_cap *eht_cap = &link_sta->eht_cap;
if (WARN_ON_ONCE(!link_conf->chanreq.oper.chan))
return IEEE80211_MAX_MPDU_LEN_VHT_3895;
if (link_conf->chanreq.oper.chan->band == NL80211_BAND_6GHZ) {
switch (le16_get_bits(link_sta->he_6ghz_capa.capa,
IEEE80211_HE_6GHZ_CAP_MAX_MPDU_LEN)) {
case IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454:
return IEEE80211_MAX_MPDU_LEN_VHT_11454;
case IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991:
return IEEE80211_MAX_MPDU_LEN_VHT_7991;
default:
return IEEE80211_MAX_MPDU_LEN_VHT_3895;
}
} else if (link_conf->chanreq.oper.chan->band == NL80211_BAND_2GHZ &&
eht_cap->has_eht) {
switch (u8_get_bits(eht_cap->eht_cap_elem.mac_cap_info[0],
IEEE80211_EHT_MAC_CAP0_MAX_MPDU_LEN_MASK)) {
case IEEE80211_EHT_MAC_CAP0_MAX_MPDU_LEN_11454:
return IEEE80211_MAX_MPDU_LEN_VHT_11454;
case IEEE80211_EHT_MAC_CAP0_MAX_MPDU_LEN_7991:
return IEEE80211_MAX_MPDU_LEN_VHT_7991;
default:
return IEEE80211_MAX_MPDU_LEN_VHT_3895;
}
} else if (vht_cap->vht_supported) {
switch (vht_cap->cap & IEEE80211_VHT_CAP_MAX_MPDU_MASK) {
case IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454:
return IEEE80211_MAX_MPDU_LEN_VHT_11454;
case IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991:
return IEEE80211_MAX_MPDU_LEN_VHT_7991;
default:
return IEEE80211_MAX_MPDU_LEN_VHT_3895;
}
} else if (ht_cap->ht_supported) {
if (ht_cap->cap & IEEE80211_HT_CAP_MAX_AMSDU)
/*
* agg is offloaded so we need to assume that agg
* are enabled and max mpdu in ampdu is 4095
* (spec 802.11-2016 9.3.2.1)
*/
Annotation
- Immediate include surface: `rs.h`, `fw-api.h`, `sta.h`, `iwl-op-mode.h`, `mvm.h`.
- Detected declarations: `function Copyright`, `function rs_fw_set_active_chains`, `function rs_fw_sgi_cw_support`, `function rs_fw_get_config_flags`, `function rs_fw_vht_highest_rx_mcs_index`, `function rs_fw_vht_set_enabled_rates`, `function rs_fw_he_ieee80211_mcs_to_rs_mcs`, `function rs_fw_he_set_enabled_rates`, `function rs_fw_eht_max_nss`, `function rs_fw_set_eht_mcs_nss`.
- 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.