drivers/net/wireless/realtek/rtw88/mac80211.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/realtek/rtw88/mac80211.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/realtek/rtw88/mac80211.c- Extension
.c- Size
- 25473 bytes
- Lines
- 992
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
main.hsec.htx.hfw.hmac.hcoex.hps.hreg.hbf.hdebug.hwow.hsar.h
Detected Declarations
struct rtw_iter_bitrate_mask_datafunction rtw_ops_txfunction rtw_ops_wake_tx_queuefunction rtw_ops_startfunction rtw_ops_stopfunction rtw_ops_configfunction rtw_ops_add_interfacefunction rtw_ops_remove_interfacefunction rtw_ops_change_interfacefunction rtw_ops_configure_filterfunction rtw_aifsn_to_aifsfunction __rtw_conf_txfunction rtw_conf_txfunction rtw_ops_bss_info_changedfunction rtw_ops_start_apfunction rtw_ops_stop_apfunction rtw_ops_conf_txfunction rtw_ops_sta_addfunction rtw_ops_sta_removefunction rtw_ops_set_timfunction rtw_ops_set_keyfunction rtw_ops_ampdu_actionfunction rtw_ops_can_aggregate_in_amsdufunction rtw_ops_sw_scan_startfunction rtw_ops_sw_scan_completefunction rtw_ops_mgd_prepare_txfunction rtw_ops_set_rts_thresholdfunction rtw_ops_sta_statisticsfunction rtw_ops_flushfunction rtw_ra_mask_info_update_iterfunction rtw_ra_mask_info_updatefunction rtw_ops_set_bitrate_maskfunction rtw_ops_set_antennafunction rtw_ops_get_antennafunction rtw_ops_suspendfunction rtw_ops_resumefunction rtw_ops_set_wakeupfunction rtw_reconfig_completefunction rtw_ops_hw_scanfunction rtw_ops_cancel_hw_scanfunction rtw_ops_set_sar_specsfunction rtw_ops_sta_rc_updateexport rtw_ops
Annotated Snippet
struct rtw_iter_bitrate_mask_data {
struct rtw_dev *rtwdev;
struct ieee80211_vif *vif;
const struct cfg80211_bitrate_mask *mask;
};
static void rtw_ra_mask_info_update_iter(void *data, struct ieee80211_sta *sta)
{
struct rtw_iter_bitrate_mask_data *br_data = data;
struct rtw_sta_info *si = (struct rtw_sta_info *)sta->drv_priv;
if (si->vif != br_data->vif)
return;
/* free previous mask setting */
kfree(si->mask);
si->mask = kmemdup(br_data->mask, sizeof(struct cfg80211_bitrate_mask),
GFP_ATOMIC);
if (!si->mask) {
si->use_cfg_mask = false;
return;
}
si->use_cfg_mask = true;
rtw_update_sta_info(br_data->rtwdev, si, true);
}
static void rtw_ra_mask_info_update(struct rtw_dev *rtwdev,
struct ieee80211_vif *vif,
const struct cfg80211_bitrate_mask *mask)
{
struct rtw_iter_bitrate_mask_data br_data;
br_data.rtwdev = rtwdev;
br_data.vif = vif;
br_data.mask = mask;
rtw_iterate_stas(rtwdev, rtw_ra_mask_info_update_iter, &br_data);
}
static int rtw_ops_set_bitrate_mask(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
const struct cfg80211_bitrate_mask *mask)
{
struct rtw_dev *rtwdev = hw->priv;
mutex_lock(&rtwdev->mutex);
rtw_ra_mask_info_update(rtwdev, vif, mask);
mutex_unlock(&rtwdev->mutex);
return 0;
}
static int rtw_ops_set_antenna(struct ieee80211_hw *hw,
int radio_idx,
u32 tx_antenna,
u32 rx_antenna)
{
struct rtw_dev *rtwdev = hw->priv;
const struct rtw_chip_info *chip = rtwdev->chip;
int ret;
if (!chip->ops->set_antenna)
return -EOPNOTSUPP;
mutex_lock(&rtwdev->mutex);
ret = chip->ops->set_antenna(rtwdev, -1, tx_antenna, rx_antenna);
mutex_unlock(&rtwdev->mutex);
return ret;
}
static int rtw_ops_get_antenna(struct ieee80211_hw *hw,
int radio_idx,
u32 *tx_antenna,
u32 *rx_antenna)
{
struct rtw_dev *rtwdev = hw->priv;
struct rtw_hal *hal = &rtwdev->hal;
*tx_antenna = hal->antenna_tx;
*rx_antenna = hal->antenna_rx;
return 0;
}
#ifdef CONFIG_PM
static int rtw_ops_suspend(struct ieee80211_hw *hw,
struct cfg80211_wowlan *wowlan)
{
struct rtw_dev *rtwdev = hw->priv;
Annotation
- Immediate include surface: `main.h`, `sec.h`, `tx.h`, `fw.h`, `mac.h`, `coex.h`, `ps.h`, `reg.h`.
- Detected declarations: `struct rtw_iter_bitrate_mask_data`, `function rtw_ops_tx`, `function rtw_ops_wake_tx_queue`, `function rtw_ops_start`, `function rtw_ops_stop`, `function rtw_ops_config`, `function rtw_ops_add_interface`, `function rtw_ops_remove_interface`, `function rtw_ops_change_interface`, `function rtw_ops_configure_filter`.
- 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.