drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
Source file repositories/reference/linux-study-clean/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c- Extension
.c- Size
- 170952 bytes
- Lines
- 5987
- Domain
- Driver Families
- Bucket
- drivers/staging
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- 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
drv_types.hrtw_wifi_regd.hhal_btcoex.hlinux/kernel.hlinux/minmax.hlinux/unaligned.h
Detected Declarations
function rtw_ch_set_search_chfunction init_hw_mlme_extfunction init_mlme_default_rate_setfunction init_mlme_ext_priv_valuefunction has_channelfunction init_channel_listfunction init_channel_setfunction init_mlme_ext_timerfunction init_mlme_ext_privfunction free_mlme_ext_privfunction _mgt_dispatcherfunction mgt_dispatcherfunction OnProbeReqfunction OnProbeRspfunction OnBeaconfunction OnAuthfunction OnAuthClientfunction OnAssocReqfunction OnAssocRspfunction OnDeAuthfunction OnDisassocfunction OnAtimfunction on_action_spctfunction OnAction_backfunction rtw_action_public_decachefunction on_action_public_p2pfunction on_action_public_vendorfunction on_action_public_defaultfunction on_action_publicfunction OnAction_htfunction OnAction_sa_queryfunction OnActionfunction DoReservedfunction update_mgnt_tx_ratefunction update_mgntframe_attribfunction update_mgntframe_attrib_addrfunction dump_mgntframefunction dump_mgntframe_and_waitfunction dump_mgntframe_and_wait_ackfunction update_hidden_ssidfunction issue_beaconfunction issue_proberspfunction _issue_probereqfunction issue_probereqfunction issue_probereq_exfunction issue_authfunction issue_asocrspfunction issue_assocreq
Annotated Snippet
if (!reg) {
reg = &channel_list->reg_class[cla];
cla++;
reg->reg_class = o->op_class;
reg->channels = 0;
}
reg->channel[reg->channels] = ch;
reg->channels++;
}
}
channel_list->reg_classes = cla;
}
static u8 init_channel_set(struct adapter *padapter, u8 ChannelPlan, struct rt_channel_info *channel_set)
{
u8 index, chanset_size = 0;
u8 b2_4GBand = false;
u8 Index2G = 0;
memset(channel_set, 0, sizeof(struct rt_channel_info)*MAX_CHANNEL_NUM);
if (ChannelPlan >= RT_CHANNEL_DOMAIN_MAX && ChannelPlan != RT_CHANNEL_DOMAIN_REALTEK_DEFINE)
return chanset_size;
if (is_supported_24g(padapter->registrypriv.wireless_mode)) {
b2_4GBand = true;
if (ChannelPlan == RT_CHANNEL_DOMAIN_REALTEK_DEFINE)
Index2G = RTW_CHANNEL_PLAN_MAP_REALTEK_DEFINE.Index2G;
else
Index2G = RTW_ChannelPlanMap[ChannelPlan].Index2G;
}
if (b2_4GBand) {
for (index = 0; index < RTW_ChannelPlan2G[Index2G].Len; index++) {
channel_set[chanset_size].ChannelNum = RTW_ChannelPlan2G[Index2G].Channel[index];
if ((ChannelPlan == RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN) ||/* Channel 1~11 is active, and 12~14 is passive */
(ChannelPlan == RT_CHANNEL_DOMAIN_GLOBAL_NULL)) {
if (channel_set[chanset_size].ChannelNum >= 1 && channel_set[chanset_size].ChannelNum <= 11)
channel_set[chanset_size].ScanType = SCAN_ACTIVE;
else if ((channel_set[chanset_size].ChannelNum >= 12 && channel_set[chanset_size].ChannelNum <= 14))
channel_set[chanset_size].ScanType = SCAN_PASSIVE;
} else if (ChannelPlan == RT_CHANNEL_DOMAIN_WORLD_WIDE_13 ||
Index2G == RT_CHANNEL_DOMAIN_2G_WORLD) { /* channel 12~13, passive scan */
if (channel_set[chanset_size].ChannelNum <= 11)
channel_set[chanset_size].ScanType = SCAN_ACTIVE;
else
channel_set[chanset_size].ScanType = SCAN_PASSIVE;
} else
channel_set[chanset_size].ScanType = SCAN_ACTIVE;
chanset_size++;
}
}
return chanset_size;
}
static void init_mlme_ext_timer(struct adapter *padapter)
{
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
timer_setup(&pmlmeext->survey_timer, survey_timer_hdl, 0);
timer_setup(&pmlmeext->link_timer, link_timer_hdl, 0);
timer_setup(&pmlmeext->sa_query_timer, sa_query_timer_hdl, 0);
}
void init_mlme_ext_priv(struct adapter *padapter)
{
struct registry_priv *pregistrypriv = &padapter->registrypriv;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
pmlmeext->padapter = padapter;
/* fill_fwpriv(padapter, &(pmlmeext->fwpriv)); */
init_mlme_ext_priv_value(padapter);
pmlmeinfo->accept_addba_req = pregistrypriv->accept_addba_req;
init_mlme_ext_timer(padapter);
init_mlme_ap_info(padapter);
pmlmeext->max_chan_nums = init_channel_set(padapter, pmlmepriv->ChannelPlan, pmlmeext->channel_set);
init_channel_list(padapter, pmlmeext->channel_set, pmlmeext->max_chan_nums, &pmlmeext->channel_list);
pmlmeext->last_scan_time = 0;
pmlmeext->chan_scan_time = SURVEY_TO;
Annotation
- Immediate include surface: `drv_types.h`, `rtw_wifi_regd.h`, `hal_btcoex.h`, `linux/kernel.h`, `linux/minmax.h`, `linux/unaligned.h`.
- Detected declarations: `function rtw_ch_set_search_ch`, `function init_hw_mlme_ext`, `function init_mlme_default_rate_set`, `function init_mlme_ext_priv_value`, `function has_channel`, `function init_channel_list`, `function init_channel_set`, `function init_mlme_ext_timer`, `function init_mlme_ext_priv`, `function free_mlme_ext_priv`.
- Atlas domain: Driver Families / drivers/staging.
- Implementation status: source 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.