drivers/staging/rtl8723bs/core/rtw_recv.c
Source file repositories/reference/linux-study-clean/drivers/staging/rtl8723bs/core/rtw_recv.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/rtl8723bs/core/rtw_recv.c- Extension
.c- Size
- 62554 bytes
- Lines
- 2321
- 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/jiffies.hrtw_recv.hnet/cfg80211.hlinux/unaligned.h
Detected Declarations
function _rtw_init_sta_recv_privfunction _rtw_init_recv_privfunction _rtw_free_recv_privfunction rtw_free_recvframefunction _rtw_enqueue_recvframefunction rtw_enqueue_recvframefunction rtw_free_recvframe_queuefunction rtw_free_uc_swdec_pending_queuefunction rtw_enqueue_recvbuf_to_headfunction rtw_enqueue_recvbuffunction rtw_handle_tkip_mic_errfunction recvframe_chkmicfunction recv_decachefunction process_pwrbit_datafunction process_wmmps_datafunction count_rx_statsfunction sta2sta_data_framefunction ap2sta_data_framefunction sta2ap_data_framefunction validate_recv_ctrl_framefunction validate_recv_mgnt_framefunction validate_recv_data_framefunction validate_80211w_mgmtfunction validate_recv_framefunction wlanhdr_to_ethhdrfunction rtw_recv_indicate_pktfunction amsdu_to_msdufunction check_indicate_seqfunction enqueue_reorder_recvframefunction rtw_recv_indicatepktfunction recv_indicatepkts_in_orderfunction recv_indicatepkt_reorderfunction rtw_reordering_ctrl_timeout_handlerfunction process_recv_indicatepktsfunction recv_func_prehandlefunction recv_func_posthandlefunction recv_funcfunction rtw_recv_entryfunction rtw_signal_stat_timer_hdl
Annotated Snippet
if (precvframe->u.hdr.pkt) {
/* free skb by driver */
dev_kfree_skb_any(precvframe->u.hdr.pkt);
precvframe->u.hdr.pkt = NULL;
}
precvframe++;
}
vfree(precvpriv->pallocated_frame_buf);
rtw_hal_free_recv_priv(padapter);
}
union recv_frame *_rtw_alloc_recvframe(struct __queue *pfree_recv_queue)
{
union recv_frame *precvframe;
struct list_head *plist, *phead;
struct adapter *padapter;
struct recv_priv *precvpriv;
if (list_empty(&pfree_recv_queue->queue))
precvframe = NULL;
else {
phead = get_list_head(pfree_recv_queue);
plist = get_next(phead);
precvframe = (union recv_frame *)plist;
list_del_init(&precvframe->u.hdr.list);
padapter = precvframe->u.hdr.adapter;
if (padapter) {
precvpriv = &padapter->recvpriv;
if (pfree_recv_queue == &precvpriv->free_recv_queue)
precvpriv->free_recvframe_cnt--;
}
}
return precvframe;
}
union recv_frame *rtw_alloc_recvframe(struct __queue *pfree_recv_queue)
{
union recv_frame *precvframe;
spin_lock_bh(&pfree_recv_queue->lock);
precvframe = _rtw_alloc_recvframe(pfree_recv_queue);
spin_unlock_bh(&pfree_recv_queue->lock);
return precvframe;
}
int rtw_free_recvframe(union recv_frame *precvframe, struct __queue *pfree_recv_queue)
{
struct adapter *padapter = precvframe->u.hdr.adapter;
struct recv_priv *precvpriv = &padapter->recvpriv;
if (precvframe->u.hdr.pkt) {
dev_kfree_skb_any(precvframe->u.hdr.pkt);/* free skb by driver */
precvframe->u.hdr.pkt = NULL;
}
spin_lock_bh(&pfree_recv_queue->lock);
list_del_init(&(precvframe->u.hdr.list));
precvframe->u.hdr.len = 0;
list_add_tail(&(precvframe->u.hdr.list), get_list_head(pfree_recv_queue));
if (padapter) {
if (pfree_recv_queue == &precvpriv->free_recv_queue)
precvpriv->free_recvframe_cnt++;
}
spin_unlock_bh(&pfree_recv_queue->lock);
return _SUCCESS;
}
signed int _rtw_enqueue_recvframe(union recv_frame *precvframe, struct __queue *queue)
{
struct adapter *padapter = precvframe->u.hdr.adapter;
struct recv_priv *precvpriv = &padapter->recvpriv;
/* INIT_LIST_HEAD(&(precvframe->u.hdr.list)); */
Annotation
- Immediate include surface: `drv_types.h`, `linux/jiffies.h`, `rtw_recv.h`, `net/cfg80211.h`, `linux/unaligned.h`.
- Detected declarations: `function _rtw_init_sta_recv_priv`, `function _rtw_init_recv_priv`, `function _rtw_free_recv_priv`, `function rtw_free_recvframe`, `function _rtw_enqueue_recvframe`, `function rtw_enqueue_recvframe`, `function rtw_free_recvframe_queue`, `function rtw_free_uc_swdec_pending_queue`, `function rtw_enqueue_recvbuf_to_head`, `function rtw_enqueue_recvbuf`.
- 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.