drivers/staging/rtl8723bs/core/rtw_mlme.c
Source file repositories/reference/linux-study-clean/drivers/staging/rtl8723bs/core/rtw_mlme.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/rtl8723bs/core/rtw_mlme.c- Extension
.c- Size
- 76032 bytes
- Lines
- 2593
- 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
linux/etherdevice.hdrv_types.hhal_btcoex.hlinux/jiffies.h
Detected Declarations
function Copyrightfunction _rtw_set_scan_deny_timer_hdlfunction rtw_init_mlme_timerfunction rtw_init_mlme_privfunction rtw_free_mlme_ie_datafunction rtw_free_mlme_priv_ie_datafunction _rtw_free_mlme_privfunction _rtw_free_networkfunction _rtw_free_network_nolockfunction rtw_free_network_queuefunction rtw_if_upfunction rtw_generate_random_ibssfunction rtw_get_capabilityfunction rtw_free_mlme_privfunction rtw_free_network_nolockfunction rtw_is_same_ibssfunction is_same_essfunction is_same_networkfunction list_for_eachfunction update_networkfunction update_current_networkfunction rtw_update_scanned_networkfunction rtw_add_networkfunction rtw_is_desired_networkfunction rtw_atimdone_event_callbackfunction rtw_surveydone_event_callbackfunction rtw_dummy_event_callbackfunction find_networkfunction rtw_free_assoc_resourcesfunction rtw_indicate_connectfunction rtw_indicate_disconnectfunction rtw_indicate_scan_donefunction rtw_scan_abortfunction rtw_joinbss_update_networkfunction rtw_reset_securityprivfunction rtw_joinbss_event_prehandlefunction rtw_joinbss_event_callbackfunction rtw_sta_media_status_rptfunction rtw_stassoc_event_callbackfunction rtw_stadel_event_callbackfunction rtw_cpwm_event_callbackfunction rtw_wmm_event_callbackfunction _rtw_join_timeout_handlerfunction rtw_scan_timeout_handlerfunction rtw_mlme_reset_auto_scan_intfunction rtw_auto_scan_handlerfunction rtw_dynamic_check_timer_handlerfunction rtw_is_scan_deny
Annotated Snippet
if (!pwlan->fixed) {
if (!oldest || time_after(oldest->last_scanned, pwlan->last_scanned))
oldest = pwlan;
}
}
return oldest;
}
void update_network(struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src,
struct adapter *padapter, bool update_ie)
{
long rssi_ori = dst->rssi;
u8 sq_smp = src->phy_info.signal_quality;
u8 ss_final;
u8 sq_final;
long rssi_final;
/* The rule below is 1/5 for sample value, 4/5 for history value */
if (check_fwstate(&padapter->mlmepriv, _FW_LINKED) && is_same_network(&padapter->mlmepriv.cur_network.network, src, 0)) {
/* Take the recvpriv's value for the connected AP*/
ss_final = padapter->recvpriv.signal_strength;
sq_final = padapter->recvpriv.signal_qual;
/* the rssi value here is undecorated, and will be used for antenna diversity */
if (sq_smp != 101) /* from the right channel */
rssi_final = (src->rssi + dst->rssi * 4) / 5;
else
rssi_final = rssi_ori;
} else {
if (sq_smp != 101) { /* from the right channel */
ss_final = ((u32)(src->phy_info.signal_strength) + (u32)(dst->phy_info.signal_strength) * 4) / 5;
sq_final = ((u32)(src->phy_info.signal_quality) + (u32)(dst->phy_info.signal_quality) * 4) / 5;
rssi_final = (src->rssi + dst->rssi * 4) / 5;
} else {
/* bss info not receiving from the right channel, use the original RX signal infos */
ss_final = dst->phy_info.signal_strength;
sq_final = dst->phy_info.signal_quality;
rssi_final = dst->rssi;
}
}
if (update_ie) {
dst->reserved[0] = src->reserved[0];
dst->reserved[1] = src->reserved[1];
memcpy((u8 *)dst, (u8 *)src, get_wlan_bssid_ex_sz(src));
}
dst->phy_info.signal_strength = ss_final;
dst->phy_info.signal_quality = sq_final;
dst->rssi = rssi_final;
}
static void update_current_network(struct adapter *adapter, struct wlan_bssid_ex *pnetwork)
{
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
rtw_bug_check(&pmlmepriv->cur_network.network,
&pmlmepriv->cur_network.network,
&pmlmepriv->cur_network.network,
&pmlmepriv->cur_network.network);
if (check_fwstate(pmlmepriv, _FW_LINKED) && (is_same_network(&pmlmepriv->cur_network.network, pnetwork, 0))) {
update_network(&pmlmepriv->cur_network.network, pnetwork, adapter, true);
if (pmlmepriv->cur_network.network.ie_length < sizeof(struct ndis_802_11_fix_ie))
return;
rtw_update_protection(adapter, (pmlmepriv->cur_network.network.ies) + sizeof(struct ndis_802_11_fix_ie),
pmlmepriv->cur_network.network.ie_length - sizeof(struct ndis_802_11_fix_ie));
}
}
/* Caller must hold pmlmepriv->lock first. */
void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *target)
{
struct list_head *plist, *phead;
u32 bssid_ex_sz;
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
struct __queue *queue = &pmlmepriv->scanned_queue;
struct wlan_network *pnetwork = NULL;
struct wlan_network *oldest = NULL;
int target_find = 0;
u8 feature = 0;
spin_lock_bh(&queue->lock);
phead = get_list_head(queue);
list_for_each(plist, phead) {
pnetwork = list_entry(plist, struct wlan_network, list);
rtw_bug_check(pnetwork, pnetwork, pnetwork, pnetwork);
Annotation
- Immediate include surface: `linux/etherdevice.h`, `drv_types.h`, `hal_btcoex.h`, `linux/jiffies.h`.
- Detected declarations: `function Copyright`, `function _rtw_set_scan_deny_timer_hdl`, `function rtw_init_mlme_timer`, `function rtw_init_mlme_priv`, `function rtw_free_mlme_ie_data`, `function rtw_free_mlme_priv_ie_data`, `function _rtw_free_mlme_priv`, `function _rtw_free_network`, `function _rtw_free_network_nolock`, `function rtw_free_network_queue`.
- 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.