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.

Dependency Surface

Detected Declarations

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

Implementation Notes