drivers/net/wireless/realtek/rtw88/util.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/realtek/rtw88/util.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/realtek/rtw88/util.c- Extension
.c- Size
- 4817 bytes
- Lines
- 209
- 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.
- 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
main.hutil.hreg.h
Detected Declarations
struct rtw_stas_entrystruct rtw_iter_stas_datastruct rtw_vifs_entrystruct rtw_iter_vifs_datafunction check_hw_readyfunction ltecoex_read_regfunction ltecoex_reg_writefunction rtw_restore_regfunction rtw_desc_to_mcsratefunction rtw_collect_sta_iterfunction rtw_iterate_stasfunction list_for_each_entry_safefunction rtw_collect_vif_iterfunction rtw_iterate_vifsfunction list_for_each_entry_safeexport check_hw_readyexport rtw_restore_reg
Annotated Snippet
struct rtw_stas_entry {
struct list_head list;
struct ieee80211_sta *sta;
};
struct rtw_iter_stas_data {
struct rtw_dev *rtwdev;
struct list_head list;
};
static void rtw_collect_sta_iter(void *data, struct ieee80211_sta *sta)
{
struct rtw_iter_stas_data *iter_stas = data;
struct rtw_stas_entry *stas_entry;
stas_entry = kmalloc_obj(*stas_entry, GFP_ATOMIC);
if (!stas_entry)
return;
stas_entry->sta = sta;
list_add_tail(&stas_entry->list, &iter_stas->list);
}
void rtw_iterate_stas(struct rtw_dev *rtwdev,
void (*iterator)(void *data,
struct ieee80211_sta *sta),
void *data)
{
struct rtw_iter_stas_data iter_data;
struct rtw_stas_entry *sta_entry, *tmp;
/* &rtwdev->mutex makes sure no stations can be removed between
* collecting the stations and iterating over them.
*/
lockdep_assert_held(&rtwdev->mutex);
iter_data.rtwdev = rtwdev;
INIT_LIST_HEAD(&iter_data.list);
ieee80211_iterate_stations_atomic(rtwdev->hw, rtw_collect_sta_iter,
&iter_data);
list_for_each_entry_safe(sta_entry, tmp, &iter_data.list,
list) {
list_del_init(&sta_entry->list);
iterator(data, sta_entry->sta);
kfree(sta_entry);
}
}
struct rtw_vifs_entry {
struct list_head list;
struct ieee80211_vif *vif;
};
struct rtw_iter_vifs_data {
struct rtw_dev *rtwdev;
struct list_head list;
};
static void rtw_collect_vif_iter(void *data, u8 *mac, struct ieee80211_vif *vif)
{
struct rtw_iter_vifs_data *iter_stas = data;
struct rtw_vifs_entry *vifs_entry;
vifs_entry = kmalloc_obj(*vifs_entry, GFP_ATOMIC);
if (!vifs_entry)
return;
vifs_entry->vif = vif;
list_add_tail(&vifs_entry->list, &iter_stas->list);
}
void rtw_iterate_vifs(struct rtw_dev *rtwdev,
void (*iterator)(void *data, struct ieee80211_vif *vif),
void *data)
{
struct rtw_iter_vifs_data iter_data;
struct rtw_vifs_entry *vif_entry, *tmp;
/* &rtwdev->mutex makes sure no interfaces can be removed between
* collecting the interfaces and iterating over them.
*/
lockdep_assert_held(&rtwdev->mutex);
iter_data.rtwdev = rtwdev;
INIT_LIST_HEAD(&iter_data.list);
ieee80211_iterate_active_interfaces_atomic(rtwdev->hw,
IEEE80211_IFACE_ITER_NORMAL,
Annotation
- Immediate include surface: `main.h`, `util.h`, `reg.h`.
- Detected declarations: `struct rtw_stas_entry`, `struct rtw_iter_stas_data`, `struct rtw_vifs_entry`, `struct rtw_iter_vifs_data`, `function check_hw_ready`, `function ltecoex_read_reg`, `function ltecoex_reg_write`, `function rtw_restore_reg`, `function rtw_desc_to_mcsrate`, `function rtw_collect_sta_iter`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration implementation candidate.
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.