drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c- Extension
.c- Size
- 107537 bytes
- Lines
- 4199
- 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
linux/fs.hmt7915.hmcu.hmac.heeprom.h
Detected Declarations
struct mt7915_he_obss_narrow_bw_ru_datastruct req_hdrstruct req_tlvstruct mt7915_sku_valstruct mt7915_skustruct mt7915_mcu_wa_tx_statfunction mt7915_mcu_get_sta_nssfunction mt7915_mcu_set_sta_he_mcsfunction mt7915_mcu_set_sta_vht_mcsfunction mt7915_mcu_set_sta_ht_mcsfunction mt7915_mcu_parse_responsefunction mt7915_mcu_set_timeoutfunction mt7915_mcu_send_messagefunction mt7915_mcu_wa_cmdfunction mt7915_mcu_csa_finishfunction mt7915_mcu_rx_csa_notifyfunction mt7915_mcu_rx_thermal_notifyfunction mt7915_mcu_rx_radar_detectedfunction mt7915_mcu_rx_log_messagefunction mt7915_mcu_cca_finishfunction mt7915_mcu_rx_bcc_notifyfunction mt7915_mcu_rx_ext_eventfunction mt7915_mcu_rx_unsolicited_eventfunction mt7915_mcu_rx_eventfunction mt7915_mcu_add_nested_subtlvfunction mt7915_check_he_obss_narrow_bw_ru_iterfunction mt7915_check_he_obss_narrow_bw_rufunction mt7915_mcu_bss_rfch_tlvfunction mt7915_mcu_bss_ra_tlvfunction mt7915_mcu_bss_he_tlvfunction mt7915_mcu_bss_hw_amsdu_tlvfunction mt7915_mcu_bss_bmc_tlvfunction mt7915_mcu_muar_configfunction mt7915_mcu_add_bss_infofunction mt7915_mcu_add_tx_bafunction mt7915_mcu_add_rx_bafunction mt7915_mcu_sta_he_tlvfunction mt7915_mcu_sta_muru_tlvfunction mt7915_mcu_sta_ht_tlvfunction mt7915_mcu_sta_vht_tlvfunction mt7915_mcu_sta_amsdu_tlvfunction mt7915_mcu_sta_wtbl_tlvfunction mt7915_is_ebf_supportedfunction mt7915_mcu_sta_sounding_ratefunction mt7915_mcu_sta_bfer_htfunction mt7915_mcu_sta_bfer_vhtfunction mt7915_mcu_sta_bfer_hefunction mt7915_mcu_sta_bfer_tlv
Annotated Snippet
struct mt7915_he_obss_narrow_bw_ru_data {
bool tolerated;
};
static void mt7915_check_he_obss_narrow_bw_ru_iter(struct wiphy *wiphy,
struct cfg80211_bss *bss,
void *_data)
{
struct mt7915_he_obss_narrow_bw_ru_data *data = _data;
const struct element *elem;
rcu_read_lock();
elem = ieee80211_bss_get_elem(bss, WLAN_EID_EXT_CAPABILITY);
if (!elem || elem->datalen <= 10 ||
!(elem->data[10] &
WLAN_EXT_CAPA10_OBSS_NARROW_BW_RU_TOLERANCE_SUPPORT))
data->tolerated = false;
rcu_read_unlock();
}
static bool mt7915_check_he_obss_narrow_bw_ru(struct ieee80211_hw *hw,
struct ieee80211_vif *vif)
{
struct mt7915_he_obss_narrow_bw_ru_data iter_data = {
.tolerated = true,
};
if (!(vif->bss_conf.chanreq.oper.chan->flags & IEEE80211_CHAN_RADAR))
return false;
cfg80211_bss_iter(hw->wiphy, &vif->bss_conf.chanreq.oper,
mt7915_check_he_obss_narrow_bw_ru_iter,
&iter_data);
/*
* If there is at least one AP on radar channel that cannot
* tolerate 26-tone RU UL OFDMA transmissions using HE TB PPDU.
*/
return !iter_data.tolerated;
}
static void
mt7915_mcu_bss_rfch_tlv(struct sk_buff *skb, struct ieee80211_vif *vif,
struct mt7915_phy *phy)
{
struct cfg80211_chan_def *chandef = &phy->mt76->chandef;
struct bss_info_rf_ch *ch;
struct tlv *tlv;
int freq1 = chandef->center_freq1;
tlv = mt76_connac_mcu_add_tlv(skb, BSS_INFO_RF_CH, sizeof(*ch));
ch = (struct bss_info_rf_ch *)tlv;
ch->pri_ch = chandef->chan->hw_value;
ch->center_ch0 = ieee80211_frequency_to_channel(freq1);
ch->bw = mt76_connac_chan_bw(chandef);
if (chandef->width == NL80211_CHAN_WIDTH_80P80) {
int freq2 = chandef->center_freq2;
ch->center_ch1 = ieee80211_frequency_to_channel(freq2);
}
if (vif->bss_conf.he_support && vif->type == NL80211_IFTYPE_STATION) {
struct mt76_phy *mphy = phy->mt76;
ch->he_ru26_block =
mt7915_check_he_obss_narrow_bw_ru(mphy->hw, vif);
ch->he_all_disable = false;
} else {
ch->he_all_disable = true;
}
}
static void
mt7915_mcu_bss_ra_tlv(struct sk_buff *skb, struct ieee80211_vif *vif,
struct mt7915_phy *phy)
{
int max_nss = hweight8(phy->mt76->antenna_mask);
struct bss_info_ra *ra;
struct tlv *tlv;
tlv = mt76_connac_mcu_add_tlv(skb, BSS_INFO_RA, sizeof(*ra));
ra = (struct bss_info_ra *)tlv;
ra->op_mode = vif->type == NL80211_IFTYPE_AP;
ra->adhoc_en = vif->type == NL80211_IFTYPE_ADHOC;
ra->short_preamble = true;
Annotation
- Immediate include surface: `linux/fs.h`, `mt7915.h`, `mcu.h`, `mac.h`, `eeprom.h`.
- Detected declarations: `struct mt7915_he_obss_narrow_bw_ru_data`, `struct req_hdr`, `struct req_tlv`, `struct mt7915_sku_val`, `struct mt7915_sku`, `struct mt7915_mcu_wa_tx_stat`, `function mt7915_mcu_get_sta_nss`, `function mt7915_mcu_set_sta_he_mcs`, `function mt7915_mcu_set_sta_vht_mcs`, `function mt7915_mcu_set_sta_ht_mcs`.
- 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.