drivers/net/wireless/realtek/rtw88/fw.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/realtek/rtw88/fw.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/realtek/rtw88/fw.c- Extension
.c- Size
- 67126 bytes
- Lines
- 2472
- 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/iopoll.hmain.hcoex.hfw.htx.hreg.hsec.hdebug.hutil.hwow.hps.hphy.hmac.h
Detected Declarations
struct rtw_fw_iter_ra_datastruct rtw_beacon_filter_iter_datafunction _rtw_fw_dump_dbg_infofunction rtw_fw_dump_dbg_infofunction rtw_fw_c2h_cmd_handle_extfunction get_max_amsdu_lenfunction rtw_fw_ra_report_iterfunction rtw_fw_ra_report_handlefunction rtw_fw_bcn_filter_notify_vif_iterfunction rtw_fw_bcn_filter_notifyfunction rtw_fw_scan_resultfunction rtw_fw_adaptivity_resultfunction rtw_fw_c2h_cmd_handlefunction rtw_fw_c2h_cmd_rx_irqsafefunction rtw_fw_c2h_cmd_isrfunction rtw_fw_send_h2c_command_registerfunction rtw_fw_send_h2c_commandfunction rtw_fw_h2c_cmd_dbgfunction rtw_fw_send_h2c_packetfunction rtw_fw_send_general_infofunction rtw_fw_send_phydm_infofunction rtw_fw_do_iqkfunction rtw_fw_inform_rfk_statusfunction rtw_fw_query_bt_infofunction rtw_fw_default_portfunction rtw_fw_wl_ch_infofunction rtw_fw_query_bt_mp_infofunction rtw_fw_force_bt_tx_powerfunction rtw_fw_bt_ignore_wlan_actionfunction rtw_fw_coex_tdma_typefunction rtw_fw_coex_query_hid_infofunction rtw_fw_bt_wifi_controlfunction rtw_fw_send_rssi_infofunction rtw_fw_send_ra_infofunction rtw_fw_media_status_reportfunction rtw_fw_update_wl_phy_infofunction rtw_fw_beacon_filter_configfunction rtw_fw_set_pwr_modefunction rtw_fw_set_keep_alive_cmdfunction rtw_fw_set_disconnect_decision_cmdfunction rtw_fw_set_wowlan_ctrl_cmdfunction rtw_fw_set_aoac_global_info_cmdfunction rtw_fw_set_remote_wake_ctrl_cmdfunction rtw_get_rsvd_page_locationfunction list_for_each_entryfunction rtw_fw_set_nlo_infofunction rtw_fw_set_recover_bt_devicefunction rtw_fw_set_pg_info
Annotated Snippet
struct rtw_fw_iter_ra_data {
struct rtw_dev *rtwdev;
u8 *payload;
u8 length;
};
static void rtw_fw_ra_report_iter(void *data, struct ieee80211_sta *sta)
{
struct rtw_fw_iter_ra_data *ra_data = data;
struct rtw_c2h_ra_rpt *ra_rpt = (struct rtw_c2h_ra_rpt *)ra_data->payload;
struct rtw_sta_info *si = (struct rtw_sta_info *)sta->drv_priv;
u8 mac_id, rate, sgi, bw;
u8 mcs, nss;
u32 bit_rate;
mac_id = ra_rpt->mac_id;
if (si->mac_id != mac_id)
return;
si->ra_report.txrate.flags = 0;
rate = u8_get_bits(ra_rpt->rate_sgi, RTW_C2H_RA_RPT_RATE);
sgi = u8_get_bits(ra_rpt->rate_sgi, RTW_C2H_RA_RPT_SGI);
if (ra_data->length >= offsetofend(typeof(*ra_rpt), bw))
bw = ra_rpt->bw;
else
bw = si->bw_mode;
if (rate < DESC_RATEMCS0) {
si->ra_report.txrate.legacy = rtw_desc_to_bitrate(rate);
goto legacy;
}
rtw_desc_to_mcsrate(rate, &mcs, &nss);
if (rate >= DESC_RATEVHT1SS_MCS0)
si->ra_report.txrate.flags |= RATE_INFO_FLAGS_VHT_MCS;
else if (rate >= DESC_RATEMCS0)
si->ra_report.txrate.flags |= RATE_INFO_FLAGS_MCS;
if (rate >= DESC_RATEMCS0) {
si->ra_report.txrate.mcs = mcs;
si->ra_report.txrate.nss = nss;
}
if (sgi)
si->ra_report.txrate.flags |= RATE_INFO_FLAGS_SHORT_GI;
if (bw == RTW_CHANNEL_WIDTH_80)
si->ra_report.txrate.bw = RATE_INFO_BW_80;
else if (bw == RTW_CHANNEL_WIDTH_40)
si->ra_report.txrate.bw = RATE_INFO_BW_40;
else
si->ra_report.txrate.bw = RATE_INFO_BW_20;
legacy:
bit_rate = cfg80211_calculate_bitrate(&si->ra_report.txrate);
si->ra_report.desc_rate = rate;
si->ra_report.bit_rate = bit_rate;
sta->deflink.agg.max_rc_amsdu_len = get_max_amsdu_len(bit_rate);
}
static void rtw_fw_ra_report_handle(struct rtw_dev *rtwdev, u8 *payload,
u8 length)
{
struct rtw_c2h_ra_rpt *ra_rpt = (struct rtw_c2h_ra_rpt *)payload;
struct rtw_fw_iter_ra_data ra_data;
if (WARN(length < rtwdev->chip->c2h_ra_report_size,
"invalid ra report c2h length %d\n", length))
return;
rtwdev->dm_info.tx_rate = u8_get_bits(ra_rpt->rate_sgi,
RTW_C2H_RA_RPT_RATE);
ra_data.rtwdev = rtwdev;
ra_data.payload = payload;
ra_data.length = length;
rtw_iterate_stas_atomic(rtwdev, rtw_fw_ra_report_iter, &ra_data);
}
struct rtw_beacon_filter_iter_data {
struct rtw_dev *rtwdev;
u8 *payload;
};
static void rtw_fw_bcn_filter_notify_vif_iter(void *data,
struct ieee80211_vif *vif)
{
struct rtw_beacon_filter_iter_data *iter_data = data;
Annotation
- Immediate include surface: `linux/iopoll.h`, `main.h`, `coex.h`, `fw.h`, `tx.h`, `reg.h`, `sec.h`, `debug.h`.
- Detected declarations: `struct rtw_fw_iter_ra_data`, `struct rtw_beacon_filter_iter_data`, `function _rtw_fw_dump_dbg_info`, `function rtw_fw_dump_dbg_info`, `function rtw_fw_c2h_cmd_handle_ext`, `function get_max_amsdu_len`, `function rtw_fw_ra_report_iter`, `function rtw_fw_ra_report_handle`, `function rtw_fw_bcn_filter_notify_vif_iter`, `function rtw_fw_bcn_filter_notify`.
- 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.