drivers/net/wireless/realtek/rtw89/core.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/realtek/rtw89/core.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/realtek/rtw89/core.c- Extension
.c- Size
- 227596 bytes
- Lines
- 7634
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/ip.hlinux/sort.hlinux/udp.hcam.hchan.hcoex.hcore.hefuse.hfw.hmac.hphy.hps.hreg.hsar.hser.htxrx.hutil.hwow.h
Detected Declarations
struct rtw89_vif_rx_stats_iter_datastruct rtw89_core_iter_rx_statusfunction rtw89_get_6ghz_spanfunction rtw89_legacy_rate_to_bitratefunction rtw89_core_tx_skb_proto_statsfunction __rtw89_traffic_stats_accufunction rtw89_traffic_stats_accufunction rtw89_get_default_chandeffunction rtw89_get_channel_paramsfunction __rtw89_core_set_chip_txpwrfunction rtw89_core_set_chip_txpwrfunction rtw89_chip_rfk_channelfunction rtw89_chip_rfk_channel_for_pure_mon_viffunction __rtw89_set_channelfunction rtw89_set_channelfunction rtw89_core_get_tx_typefunction rtw89_core_tx_update_ampdu_infofunction rtw89_core_tx_update_sec_keyfunction rtw89_core_get_mgmt_ratefunction rtw89_core_tx_get_mac_idfunction rtw89_core_tx_update_llc_hdrfunction rtw89_core_get_ch_dmafunction rtw89_core_get_ch_dma_v1function rtw89_core_get_ch_dma_v2function rtw89_core_tx_update_mgmt_infofunction rtw89_core_tx_update_h2c_infofunction rtw89_core_get_no_ul_ofdma_htcfunction __rtw89_core_tx_check_he_qos_htcfunction __rtw89_core_tx_adjust_he_qos_htcfunction rtw89_core_tx_update_he_qos_htcfunction rtw89_core_get_data_ratefunction rtw89_core_tx_update_data_infofunction rtw89_core_tx_btc_spec_pkt_notifyfunction rtw89_core_tx_wakefunction rtw89_core_tx_update_injectionfunction rtw89_core_tx_update_desc_infofunction rtw89_tx_wait_workfunction rtw89_core_tx_kick_offfunction rtw89_core_tx_kick_off_and_waitfunction rtw89_h2c_txfunction rtw89_core_tx_write_linkfunction rtw89_core_tx_writefunction rtw89_build_txwd_body0function rtw89_build_txwd_body0_v1function rtw89_build_txwd_body1_v1function rtw89_build_txwd_body2function rtw89_build_txwd_body3function rtw89_build_txwd_body4
Annotated Snippet
struct rtw89_vif_rx_stats_iter_data {
struct rtw89_dev *rtwdev;
struct rtw89_rx_phy_ppdu *phy_ppdu;
struct rtw89_rx_desc_info *desc_info;
struct sk_buff *skb;
const u8 *bssid;
};
static void rtw89_stats_trigger_frame(struct rtw89_dev *rtwdev,
struct rtw89_vif_link *rtwvif_link,
struct ieee80211_bss_conf *bss_conf,
struct sk_buff *skb)
{
struct ieee80211_trigger *tf = (struct ieee80211_trigger *)skb->data;
struct ieee80211_vif *vif = rtwvif_link_to_vif(rtwvif_link);
struct rtw89_vif *rtwvif = rtwvif_link->rtwvif;
u8 *pos, *end, type, tf_bw;
u16 aid, tf_rua;
if (!ether_addr_equal(bss_conf->bssid, tf->ta) ||
rtwvif_link->wifi_role != RTW89_WIFI_ROLE_STATION ||
rtwvif_link->net_type == RTW89_NET_TYPE_NO_LINK)
return;
type = le64_get_bits(tf->common_info, IEEE80211_TRIGGER_TYPE_MASK);
if (type != IEEE80211_TRIGGER_TYPE_BASIC && type != IEEE80211_TRIGGER_TYPE_MU_BAR)
return;
end = (u8 *)tf + skb->len;
pos = tf->variable;
while (end - pos >= RTW89_TF_BASIC_USER_INFO_SZ) {
aid = RTW89_GET_TF_USER_INFO_AID12(pos);
tf_rua = RTW89_GET_TF_USER_INFO_RUA(pos);
tf_bw = le64_get_bits(tf->common_info, IEEE80211_TRIGGER_ULBW_MASK);
rtw89_debug(rtwdev, RTW89_DBG_TXRX,
"[TF] aid: %d, ul_mcs: %d, rua: %d, bw: %d\n",
aid, RTW89_GET_TF_USER_INFO_UL_MCS(pos),
tf_rua, tf_bw);
if (aid == RTW89_TF_PAD)
break;
if (aid == vif->cfg.aid) {
enum nl80211_he_ru_alloc rua;
rtwvif->stats.rx_tf_acc++;
rtwdev->stats.rx_tf_acc++;
/* The following only required for HE trigger frame, but we
* cannot use UL HE-SIG-A2 reserved subfield to identify it
* since some 11ax APs will fill it with all 0s, which will
* be misunderstood as EHT trigger frame.
*/
if (bss_conf->eht_support)
break;
rua = rtw89_he_rua_to_ru_alloc(tf_rua >> 1);
if (tf_bw == IEEE80211_TRIGGER_ULBW_160_80P80MHZ &&
rua <= NL80211_RATE_INFO_HE_RU_ALLOC_106)
rtwvif_link->pwr_diff_en = true;
break;
}
pos += RTW89_TF_BASIC_USER_INFO_SZ;
}
}
static void rtw89_cancel_6ghz_probe_work(struct wiphy *wiphy, struct wiphy_work *work)
{
struct rtw89_dev *rtwdev = container_of(work, struct rtw89_dev,
cancel_6ghz_probe_work);
struct list_head *pkt_list = rtwdev->scan_info.pkt_list;
struct rtw89_pktofld_info *info;
lockdep_assert_wiphy(wiphy);
if (!rtwdev->scanning)
return;
list_for_each_entry(info, &pkt_list[NL80211_BAND_6GHZ], list) {
if (!info->cancel || !test_bit(info->id, rtwdev->pkt_offload))
continue;
rtw89_fw_h2c_del_pkt_offload(rtwdev, info->id);
/* Don't delete/free info from pkt_list at this moment. Let it
* be deleted/freed in rtw89_release_pkt_list() after scanning,
* since if during scanning, pkt_list is accessed in bottom half.
Annotation
- Immediate include surface: `linux/ip.h`, `linux/sort.h`, `linux/udp.h`, `cam.h`, `chan.h`, `coex.h`, `core.h`, `efuse.h`.
- Detected declarations: `struct rtw89_vif_rx_stats_iter_data`, `struct rtw89_core_iter_rx_status`, `function rtw89_get_6ghz_span`, `function rtw89_legacy_rate_to_bitrate`, `function rtw89_core_tx_skb_proto_stats`, `function __rtw89_traffic_stats_accu`, `function rtw89_traffic_stats_accu`, `function rtw89_get_default_chandef`, `function rtw89_get_channel_params`, `function __rtw89_core_set_chip_txpwr`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration 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.