drivers/net/wireless/intel/iwlwifi/mld/tests/rx.c

Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/iwlwifi/mld/tests/rx.c

File Facts

System
Linux kernel
Corpus path
drivers/net/wireless/intel/iwlwifi/mld/tests/rx.c
Extension
.c
Size
8160 bytes
Lines
354
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 Intel Corporation
 */
#include <kunit/test.h>
#include "utils.h"
#include "iwl-trans.h"
#include "mld.h"
#include "sta.h"

static const struct is_dup_case {
	const char *desc;
	struct {
		/* ieee80211_hdr fields */
		__le16 fc;
		__le16 seq;
		u8 tid;
		bool multicast;
		/* iwl_rx_mpdu_desc fields */
		bool is_amsdu;
		u8 sub_frame_idx;
	} rx_pkt;
	struct {
		__le16 last_seq;
		u8 last_sub_frame_idx;
		u8 tid;
	} dup_data_state;
	struct {
		bool is_dup;
		u32 rx_status_flag;
	} result;
} is_dup_cases[] = {
	{
		.desc = "Control frame",
		.rx_pkt = {
			.fc = __cpu_to_le16(IEEE80211_FTYPE_CTL),
		},
		.result = {
			.is_dup = false,
			.rx_status_flag = 0,
		}
	},
	{
		.desc = "Null func frame",
		.rx_pkt = {
			.fc = __cpu_to_le16(IEEE80211_FTYPE_DATA |
					    IEEE80211_STYPE_NULLFUNC),
		},
		.result = {
			.is_dup = false,
			.rx_status_flag = 0,
		}
	},
	{
		.desc = "Multicast data",
		.rx_pkt = {
			.fc = __cpu_to_le16(IEEE80211_FTYPE_DATA),
			.multicast = true,
		},
		.result = {
			.is_dup = false,
			.rx_status_flag = 0,
		}
	},
	{
		.desc = "QoS null func frame",
		.rx_pkt = {
			.fc = __cpu_to_le16(IEEE80211_FTYPE_DATA |
					    IEEE80211_STYPE_QOS_NULLFUNC),
		},
		.result = {
			.is_dup = false,
			.rx_status_flag = 0,
		}
	},
	{
		.desc = "QoS data new sequence",
		.rx_pkt = {
			.fc = __cpu_to_le16(IEEE80211_FTYPE_DATA |
					    IEEE80211_STYPE_QOS_DATA),
			.seq = __cpu_to_le16(0x101),
		},
		.dup_data_state = {
			.last_seq = __cpu_to_le16(0x100),
			.last_sub_frame_idx = 0,
		},
		.result = {
			.is_dup = false,

Annotation

Implementation Notes