drivers/net/wireless/realtek/rtw89/chan.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/realtek/rtw89/chan.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/realtek/rtw89/chan.c- Extension
.c- Size
- 93092 bytes
- Lines
- 3536
- 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
chan.hcoex.hdebug.hfw.hmac.hphy.hps.hsar.hutil.h
Detected Declarations
struct rtw89_mcc_fill_role_selectorstruct rtw89_mcc_mod_dur_datastruct rtw89_mcc_stop_selfunction rtw89_get_subband_typefunction rtw89_get_tx_comp_bandfunction rtw89_get_primary_chan_idxfunction rtw89_get_primary_sb_idxfunction rtw89_chan_createfunction _rtw89_chan_update_puncturedfunction rtw89_chan_update_puncturedfunction rtw89_for_each_rtwviffunction rtw89_assign_entity_chanfunction rtw89_iterate_entity_chanfunction for_each_set_bitfunction __rtw89_config_entity_chandeffunction rtw89_config_entity_chandeffunction rtw89_config_roc_chandeffunction rtw89_config_default_chandeffunction rtw89_entity_initfunction rtw89_vif_is_active_rolefunction rtw89_entity_calculate_weightfunction for_each_set_bitfunction rtw89_for_each_rtwviffunction rtw89_normalize_link_chanctxfunction rtw89_entity_role_get_indexfunction rtw89_entity_check_hwfunction rtw89_entity_force_hwfunction rtw89_entity_get_conffunction rtw89_entity_sel_mlo_dbcc_modefunction rtw89_entity_recalc_mlo_dbcc_modefunction rtw89_entity_recalc_mgnt_rolesfunction rtw89_entity_recalcfunction for_each_set_bitfunction rtw89_chanctx_notifyfunction rtw89_concurrent_via_mrcfunction rtw89_iterate_mcc_rolesfunction rtw89_mcc_get_tbtt_ofstfunction __mcc_fw_req_tsffunction __mrc_fw_req_tsffunction rtw89_mcc_get_bcn_ofstfunction rtw89_mcc_role_fw_macid_bitmap_set_bitfunction rtw89_mcc_role_fw_macid_bitmap_to_u32function rtw89_mcc_role_macid_sta_iterfunction rtw89_mcc_fill_role_macid_bitmapfunction rtw89_mcc_fill_role_policyfunction rtw89_mcc_fill_role_limitfunction rtw89_mcc_fill_rolefunction rtw89_mcc_fill_bt_role
Annotated Snippet
struct rtw89_mcc_fill_role_selector {
struct rtw89_vif_link *bind_vif[NUM_OF_RTW89_CHANCTX];
};
static_assert((u8)NUM_OF_RTW89_CHANCTX >= NUM_OF_RTW89_MCC_ROLES);
static_assert(RTW89_MAX_INTERFACE_NUM >= NUM_OF_RTW89_MCC_ROLES);
static int rtw89_mcc_fill_role_iterator(struct rtw89_dev *rtwdev,
struct rtw89_mcc_role *mcc_role,
unsigned int ordered_idx,
void *data)
{
struct rtw89_mcc_fill_role_selector *sel = data;
struct rtw89_vif_link *role_vif = sel->bind_vif[ordered_idx];
int ret;
if (!role_vif) {
rtw89_warn(rtwdev, "cannot handle MCC without role[%d]\n",
ordered_idx);
return -EINVAL;
}
rtw89_debug(rtwdev, RTW89_DBG_CHAN,
"MCC fill role[%d] with vif <macid %d>\n",
ordered_idx, role_vif->mac_id);
ret = rtw89_mcc_fill_role(rtwdev, role_vif, mcc_role);
if (ret)
return ret;
return 0;
}
static int rtw89_mcc_fill_all_roles(struct rtw89_dev *rtwdev)
{
struct rtw89_hal *hal = &rtwdev->hal;
struct rtw89_entity_mgnt *mgnt = &hal->entity_mgnt;
struct rtw89_mcc_fill_role_selector sel = {};
struct rtw89_vif_link *rtwvif_link;
struct rtw89_vif *rtwvif;
int ret;
int i;
for (i = 0; i < NUM_OF_RTW89_MCC_ROLES; i++) {
rtwvif = mgnt->active_roles[i];
if (!rtwvif)
break;
rtwvif_link = rtw89_vif_get_link_inst(rtwvif, 0);
if (unlikely(!rtwvif_link)) {
rtw89_err(rtwdev, "mcc fill roles: find no link on HW-0\n");
continue;
}
sel.bind_vif[i] = rtwvif_link;
rtw89_p2p_disable_all_noa(rtwdev, rtwvif_link, NULL);
}
ret = rtw89_iterate_mcc_roles(rtwdev, rtw89_mcc_fill_role_iterator, &sel);
if (ret)
return ret;
rtw89_mcc_fill_bt_role(rtwdev);
return 0;
}
static bool rtw89_mcc_can_courtesy(const struct rtw89_mcc_role *provider,
const struct rtw89_mcc_role *receiver)
{
if (provider->is_go || receiver->is_gc)
return false;
return true;
}
static void rtw89_mcc_assign_pattern(struct rtw89_dev *rtwdev,
const struct rtw89_mcc_pattern *new)
{
struct rtw89_mcc_info *mcc = &rtwdev->mcc;
struct rtw89_mcc_role *ref = &mcc->role_ref;
struct rtw89_mcc_role *aux = &mcc->role_aux;
struct rtw89_mcc_config *config = &mcc->config;
struct rtw89_mcc_pattern *pattern = &config->pattern;
struct rtw89_mcc_courtesy_cfg *crtz;
rtw89_debug(rtwdev, RTW89_DBG_CHAN,
"MCC assign pattern: ref {%d | %d}, aux {%d | %d}\n",
new->tob_ref, new->toa_ref, new->tob_aux, new->toa_aux);
rtw89_debug(rtwdev, RTW89_DBG_CHAN, "MCC pattern plan: %d\n", new->plan);
Annotation
- Immediate include surface: `chan.h`, `coex.h`, `debug.h`, `fw.h`, `mac.h`, `phy.h`, `ps.h`, `sar.h`.
- Detected declarations: `struct rtw89_mcc_fill_role_selector`, `struct rtw89_mcc_mod_dur_data`, `struct rtw89_mcc_stop_sel`, `function rtw89_get_subband_type`, `function rtw89_get_tx_comp_band`, `function rtw89_get_primary_chan_idx`, `function rtw89_get_primary_sb_idx`, `function rtw89_chan_create`, `function _rtw89_chan_update_punctured`, `function rtw89_chan_update_punctured`.
- 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.