drivers/net/wireless/marvell/mwifiex/11n_rxreorder.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/marvell/mwifiex/11n_rxreorder.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/marvell/mwifiex/11n_rxreorder.c- Extension
.c- Size
- 27757 bytes
- Lines
- 984
- Domain
- Driver Families
- Bucket
- drivers/net
- 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
decl.hioctl.hutil.hfw.hmain.hwmm.h11n.h11n_rxreorder.h
Detected Declarations
function mwifiex_11n_dispatch_amsdu_pktfunction mwifiex_11n_dispatch_pktfunction mwifiex_11n_dispatch_pkt_until_start_winfunction mwifiex_11n_scan_and_dispatchfunction mwifiex_del_rx_reorder_entryfunction mwifiex_11n_get_rx_reorder_tblfunction mwifiex_11n_del_rx_reorder_tbl_by_tafunction mwifiex_11n_find_last_seq_numfunction mwifiex_flush_datafunction mwifiex_11n_create_rx_reorder_tblfunction mwifiex_11n_rxreorder_timer_restartfunction mwifiex_cmd_11n_addba_reqfunction mwifiex_cmd_11n_addba_rsp_genfunction mwifiex_cmd_11n_delbafunction mwifiex_11n_rx_reorder_pktfunction mwifiex_del_ba_tblfunction mwifiex_ret_11n_addba_respfunction mwifiex_11n_ba_stream_timeoutfunction mwifiex_11n_cleanup_reorder_tblfunction mwifiex_update_rxreor_flagsfunction mwifiex_update_ampdu_rxwinsizefunction mwifiex_coex_ampdu_rxwinsizefunction mwifiex_11n_rxba_sync_event
Annotated Snippet
while (!skb_queue_empty(&list)) {
struct rx_packet_hdr *rx_hdr;
rx_skb = __skb_dequeue(&list);
rx_hdr = (struct rx_packet_hdr *)rx_skb->data;
if (ISSUPP_TDLS_ENABLED(priv->adapter->fw_cap_info) &&
ntohs(rx_hdr->eth803_hdr.h_proto) == ETH_P_TDLS) {
mwifiex_process_tdls_action_frame(priv,
(u8 *)rx_hdr,
skb->len);
}
if (priv->bss_role == MWIFIEX_BSS_ROLE_UAP)
ret = mwifiex_uap_recv_packet(priv, rx_skb);
else
ret = mwifiex_recv_packet(priv, rx_skb);
if (ret == -1)
mwifiex_dbg(priv->adapter, ERROR,
"Rx of A-MSDU failed");
}
return 0;
}
return -1;
}
/* This function will process the rx packet and forward it to kernel/upper
* layer.
*/
static int mwifiex_11n_dispatch_pkt(struct mwifiex_private *priv,
struct sk_buff *payload)
{
int ret;
if (!payload) {
mwifiex_dbg(priv->adapter, INFO, "info: fw drop data\n");
return 0;
}
ret = mwifiex_11n_dispatch_amsdu_pkt(priv, payload);
if (!ret)
return 0;
if (priv->bss_role == MWIFIEX_BSS_ROLE_UAP)
return mwifiex_handle_uap_rx_forward(priv, payload);
return mwifiex_process_rx_packet(priv, payload);
}
/*
* This function dispatches all packets in the Rx reorder table until the
* start window.
*
* There could be holes in the buffer, which are skipped by the function.
* Since the buffer is linear, the function uses rotation to simulate
* circular buffer.
*/
static void
mwifiex_11n_dispatch_pkt_until_start_win(struct mwifiex_private *priv,
struct mwifiex_rx_reorder_tbl *tbl,
int start_win)
{
struct sk_buff_head list;
struct sk_buff *skb;
int pkt_to_send, i;
__skb_queue_head_init(&list);
spin_lock_bh(&priv->rx_reorder_tbl_lock);
pkt_to_send = (start_win > tbl->start_win) ?
min((start_win - tbl->start_win), tbl->win_size) :
tbl->win_size;
for (i = 0; i < pkt_to_send; ++i) {
if (tbl->rx_reorder_ptr[i]) {
skb = tbl->rx_reorder_ptr[i];
__skb_queue_tail(&list, skb);
tbl->rx_reorder_ptr[i] = NULL;
}
}
/*
* We don't have a circular buffer, hence use rotation to simulate
* circular buffer
*/
for (i = 0; i < tbl->win_size - pkt_to_send; ++i) {
tbl->rx_reorder_ptr[i] = tbl->rx_reorder_ptr[pkt_to_send + i];
tbl->rx_reorder_ptr[pkt_to_send + i] = NULL;
}
Annotation
- Immediate include surface: `decl.h`, `ioctl.h`, `util.h`, `fw.h`, `main.h`, `wmm.h`, `11n.h`, `11n_rxreorder.h`.
- Detected declarations: `function mwifiex_11n_dispatch_amsdu_pkt`, `function mwifiex_11n_dispatch_pkt`, `function mwifiex_11n_dispatch_pkt_until_start_win`, `function mwifiex_11n_scan_and_dispatch`, `function mwifiex_del_rx_reorder_entry`, `function mwifiex_11n_get_rx_reorder_tbl`, `function mwifiex_11n_del_rx_reorder_tbl_by_ta`, `function mwifiex_11n_find_last_seq_num`, `function mwifiex_flush_data`, `function mwifiex_11n_create_rx_reorder_tbl`.
- Atlas domain: Driver Families / drivers/net.
- 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.