drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
Source file repositories/reference/linux-study-clean/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/rtl8723bs/core/rtw_sta_mgt.c- Extension
.c- Size
- 14808 bytes
- Lines
- 551
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
drv_types.h
Detected Declarations
function _rtw_init_stainfofunction _rtw_init_sta_privfunction rtw_stainfo_offsetfunction kfree_all_stainfofunction kfree_sta_priv_lockfunction _rtw_free_sta_privfunction list_for_eachfunction rtw_free_stainfofunction rtw_free_all_stainfofunction list_for_each_safefunction list_for_each_safefunction rtw_init_bcmc_stainfofunction rtw_access_ctrl
Annotated Snippet
list_for_each(plist, phead) {
int i;
psta = list_entry(plist, struct sta_info,
hash_list);
for (i = 0; i < 16 ; i++) {
preorder_ctrl = &psta->recvreorder_ctrl[i];
timer_delete_sync(&preorder_ctrl->reordering_ctrl_timer);
}
}
}
spin_unlock_bh(&pstapriv->sta_hash_lock);
/*===============================*/
kfree_sta_priv_lock(pstapriv);
vfree(pstapriv->pallocated_stainfo_buf);
}
return _SUCCESS;
}
/* struct sta_info *rtw_alloc_stainfo(_queue *pfree_sta_queue, unsigned char *hwaddr) */
struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
{
s32 index;
struct list_head *phash_list;
struct sta_info *psta;
struct __queue *pfree_sta_queue;
struct recv_reorder_ctrl *preorder_ctrl;
int i = 0;
u16 wRxSeqInitialValue = 0xffff;
pfree_sta_queue = &pstapriv->free_sta_queue;
/* spin_lock_bh(&(pfree_sta_queue->lock)); */
spin_lock_bh(&pstapriv->sta_hash_lock);
if (list_empty(&pfree_sta_queue->queue)) {
/* spin_unlock_bh(&(pfree_sta_queue->lock)); */
spin_unlock_bh(&pstapriv->sta_hash_lock);
return NULL;
}
psta = container_of(get_next(&pfree_sta_queue->queue), struct sta_info, list);
list_del_init(&psta->list);
/* spin_unlock_bh(&(pfree_sta_queue->lock)); */
_rtw_init_stainfo(psta);
psta->padapter = pstapriv->padapter;
memcpy(psta->hwaddr, hwaddr, ETH_ALEN);
index = wifi_mac_hash(hwaddr);
if (index >= NUM_STA) {
spin_unlock_bh(&pstapriv->sta_hash_lock);
psta = NULL;
goto exit;
}
phash_list = &pstapriv->sta_hash[index];
/* spin_lock_bh(&(pstapriv->sta_hash_lock)); */
list_add_tail(&psta->hash_list, phash_list);
pstapriv->asoc_sta_count++;
/* spin_unlock_bh(&(pstapriv->sta_hash_lock)); */
/* Commented by Albert 2009/08/13 */
/* For the SMC router, the sequence number of first packet of WPS handshake will be 0. */
/* In this case, this packet will be dropped by recv_decache function if we use the 0x00 as the default value for tid_rxseq variable. */
/* So, we initialize the tid_rxseq variable as the 0xffff. */
for (i = 0; i < 16; i++)
memcpy(&psta->sta_recvpriv.rxcache.tid_rxseq[i], &wRxSeqInitialValue, 2);
timer_setup(&psta->addba_retry_timer, addba_timer_hdl, 0);
/* for A-MPDU Rx reordering buffer control */
for (i = 0; i < 16 ; i++) {
preorder_ctrl = &psta->recvreorder_ctrl[i];
preorder_ctrl->padapter = pstapriv->padapter;
preorder_ctrl->enable = false;
preorder_ctrl->indicate_seq = 0xffff;
Annotation
- Immediate include surface: `drv_types.h`.
- Detected declarations: `function _rtw_init_stainfo`, `function _rtw_init_sta_priv`, `function rtw_stainfo_offset`, `function kfree_all_stainfo`, `function kfree_sta_priv_lock`, `function _rtw_free_sta_priv`, `function list_for_each`, `function rtw_free_stainfo`, `function rtw_free_all_stainfo`, `function list_for_each_safe`.
- 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.