drivers/net/wireless/intel/iwlwifi/mld/tests/agg.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/iwlwifi/mld/tests/agg.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/intel/iwlwifi/mld/tests/agg.c- Extension
.c- Size
- 16709 bytes
- Lines
- 664
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
kunit/test.hkunit/static_stub.hkunit/skbuff.hutils.hmld.hsta.hagg.hrx.h
Detected Declarations
function fake_iwl_mld_pass_packet_to_mac80211function fake_iwl_mld_fw_sta_id_maskfunction setup_reorder_bufferfunction test_reorder_buffer
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
/*
* KUnit tests for channel helper functions
*
* Copyright (C) 2024-2025 Intel Corporation
*/
#include <kunit/test.h>
#include <kunit/static_stub.h>
#include <kunit/skbuff.h>
#include "utils.h"
#include "mld.h"
#include "sta.h"
#include "agg.h"
#include "rx.h"
#define FC_QOS_DATA (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_QOS_DATA)
#define BA_WINDOW_SIZE 64
#define QUEUE 0
static const struct reorder_buffer_case {
const char *desc;
struct {
/* ieee80211_hdr fields */
u16 fc;
u8 tid;
bool multicast;
/* iwl_rx_mpdu_desc fields */
u16 nssn;
/* used also for setting hdr::seq_ctrl */
u16 sn;
u8 baid;
bool amsdu;
bool last_subframe;
bool old_sn;
bool dup;
} rx_pkt;
struct {
bool valid;
u16 head_sn;
u8 baid;
u16 num_entries;
/* The test prepares the reorder buffer with fake skbs based
* on the sequence numbers provided in @entries array.
*/
struct {
u16 sn;
/* Set add_subframes > 0 to simulate an A-MSDU by
* queueing additional @add_subframes skbs in the
* appropriate reorder buffer entry (based on the @sn)
*/
u8 add_subframes;
} entries[BA_WINDOW_SIZE];
} reorder_buf_state;
struct {
enum iwl_mld_reorder_result reorder_res;
u16 head_sn;
u16 num_stored;
u16 skb_release_order[BA_WINDOW_SIZE];
u16 skb_release_order_count;
} expected;
} reorder_buffer_cases[] = {
{
.desc = "RX packet with invalid BAID",
.rx_pkt = {
.fc = FC_QOS_DATA,
.baid = IWL_RX_REORDER_DATA_INVALID_BAID,
},
.reorder_buf_state = {
.valid = true,
},
.expected = {
/* Invalid BAID should not be buffered. The frame is
* passed to the network stack immediately.
*/
.reorder_res = IWL_MLD_PASS_SKB,
.num_stored = 0,
},
},
{
.desc = "RX Multicast packet",
.rx_pkt = {
.fc = FC_QOS_DATA,
.multicast = true,
},
.reorder_buf_state = {
.valid = true,
},
.expected = {
/* Multicast packets are not buffered. The packet is
Annotation
- Immediate include surface: `kunit/test.h`, `kunit/static_stub.h`, `kunit/skbuff.h`, `utils.h`, `mld.h`, `sta.h`, `agg.h`, `rx.h`.
- Detected declarations: `function fake_iwl_mld_pass_packet_to_mac80211`, `function fake_iwl_mld_fw_sta_id_mask`, `function setup_reorder_buffer`, `function test_reorder_buffer`.
- 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.