drivers/staging/rtl8723bs/core/rtw_ap.c
Source file repositories/reference/linux-study-clean/drivers/staging/rtl8723bs/core/rtw_ap.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/rtl8723bs/core/rtw_ap.c- Extension
.c- Size
- 56200 bytes
- Lines
- 2110
- 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.hlinux/unaligned.h
Detected Declarations
function Copyrightfunction free_mlme_ap_infofunction update_BCNTIMfunction chk_sta_is_alivefunction expire_timeout_chkfunction list_for_each_entry_safefunction add_ratidfunction update_bmc_stafunction update_sta_info_apmodefunction update_ap_infofunction update_hw_ht_paramfunction start_bss_networkfunction rtw_check_beacon_datafunction rtw_set_macaddr_aclfunction rtw_acl_add_stafunction rtw_acl_remove_stafunction rtw_ap_set_pairwise_keyfunction rtw_ap_set_keyfunction rtw_ap_set_group_keyfunction rtw_ap_set_wep_keyfunction update_bcn_fixed_iefunction update_bcn_htcap_iefunction update_bcn_p2p_iefunction update_beaconfunction rtw_ht_operation_updatefunction associated_clients_updatefunction list_for_eachfunction bss_cap_update_on_sta_joinfunction bss_cap_update_on_sta_leavefunction ap_free_stafunction rtw_sta_flushfunction sta_info_updatefunction ap_sta_info_defer_updatefunction rtw_ap_restore_networkfunction start_ap_modefunction stop_ap_mode
Annotated Snippet
if (psta->expire_to > 0) {
psta->expire_to--;
if (psta->expire_to == 0) {
list_move(&psta->auth_list, &free_list);
pstapriv->auth_list_cnt--;
}
}
}
spin_unlock_bh(&pstapriv->auth_list_lock);
list_for_each_entry_safe(psta, psta_tmp, &free_list, auth_list) {
list_del_init(&psta->auth_list);
rtw_free_stainfo(padapter, psta);
}
psta = NULL;
spin_lock_bh(&pstapriv->asoc_list_lock);
phead = &pstapriv->asoc_list;
/* check asoc_queue */
list_for_each_safe(plist, tmp, phead) {
psta = list_entry(plist, struct sta_info, asoc_list);
if (chk_sta_is_alive(psta) || !psta->expire_to) {
psta->expire_to = pstapriv->expire_to;
psta->keep_alive_trycnt = 0;
psta->under_exist_checking = 0;
} else {
if (psta->expire_to > 0)
psta->expire_to--;
}
if (psta->expire_to == 0) {
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
if (padapter->registrypriv.wifi_spec == 1) {
psta->expire_to = pstapriv->expire_to;
continue;
}
if (psta->state & WIFI_SLEEP_STATE) {
if (!(psta->state & WIFI_STA_ALIVE_CHK_STATE)) {
/* to check if alive by another methods */
/* if station is at ps mode. */
psta->expire_to = pstapriv->expire_to;
psta->state |= WIFI_STA_ALIVE_CHK_STATE;
/* to update bcn with tim_bitmap for this station */
pstapriv->tim_bitmap |= BIT(psta->aid);
update_beacon(padapter, WLAN_EID_TIM, NULL, true);
if (!pmlmeext->active_keep_alive_check)
continue;
}
}
if (pmlmeext->active_keep_alive_check) {
int stainfo_offset;
stainfo_offset = rtw_stainfo_offset(pstapriv, psta);
if (stainfo_offset_valid(stainfo_offset))
chk_alive_list[chk_alive_num++] = stainfo_offset;
continue;
}
list_del_init(&psta->asoc_list);
pstapriv->asoc_list_cnt--;
updated = ap_free_sta(padapter, psta, false, WLAN_REASON_DEAUTH_LEAVING);
} else {
/* TODO: Aging mechanism to digest frames in sleep_q to */
/* avoid running out of xmitframe */
if (psta->sleepq_len > (NR_XMITFRAME / pstapriv->asoc_list_cnt) &&
padapter->xmitpriv.free_xmitframe_cnt <
((NR_XMITFRAME / pstapriv->asoc_list_cnt) / 2))
wakeup_sta_to_xmit(padapter, psta);
}
}
spin_unlock_bh(&pstapriv->asoc_list_lock);
if (chk_alive_num) {
u8 backup_oper_channel = 0;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
/* switch to correct channel of current network before issue keep-alive frames */
if (rtw_get_oper_ch(padapter) != pmlmeext->cur_channel) {
backup_oper_channel = rtw_get_oper_ch(padapter);
r8723bs_select_channel(padapter, pmlmeext->cur_channel);
}
Annotation
- Immediate include surface: `drv_types.h`, `linux/unaligned.h`.
- Detected declarations: `function Copyright`, `function free_mlme_ap_info`, `function update_BCNTIM`, `function chk_sta_is_alive`, `function expire_timeout_chk`, `function list_for_each_entry_safe`, `function add_ratid`, `function update_bmc_sta`, `function update_sta_info_apmode`, `function update_ap_info`.
- 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.