drivers/net/wireless/intel/iwlwifi/mld/tests/link-selection.c

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

File Facts

System
Linux kernel
Corpus path
drivers/net/wireless/intel/iwlwifi/mld/tests/link-selection.c
Extension
.c
Size
14072 bytes
Lines
556
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

struct link_grading_input {
	u8 link_id;
	const struct cfg80211_chan_def *chandef;
	bool active;
	s32 signal;
	bool has_chan_util_elem;
	u8 chan_util;
	u8 chan_load_by_us;
	s8 dup_beacon_adj;
	s8 psd_eirp_adj;
	u16 punctured;
};

static const struct link_grading_test_case {
	const char *desc;
	struct link_grading_input link;
	unsigned int expected_grade;
} link_grading_cases[] = {
	/* Per-bandwidth grading table tests */
	{
		.desc = "20 MHz grading table: -75 dBm",
		.link = {
			.link_id = 0,
			.chandef = &chandef_2ghz_20mhz,
			.active = false,
			.signal = -75,
		},
		/* 137 * 0.7 (default 2.4GHz channel load 30%) */
		.expected_grade = 96,
	},
	{
		.desc = "20 MHz with channel util 128 (50%): -70 dBm",
		.link = {
			.link_id = 0,
			.chandef = &chandef_2ghz_20mhz,
			.active = false,
			.signal = -70,
			.has_chan_util_elem = true,
			.chan_util = 128,
		},
		.expected_grade = 86,
	},
	{
		.desc = "20 MHz with channel util 180 (70%): -70 dBm",
		.link = {
			.link_id = 0,
			.chandef = &chandef_2ghz_20mhz,
			.active = false,
			.signal = -70,
			.has_chan_util_elem = true,
			.chan_util = 180,
		},
		.expected_grade = 51,
	},
	{
		.desc = "20 MHz active link with chan load by us 10%: -70 dBm",
		.link = {
			.link_id = 0,
			.chandef = &chandef_2ghz_20mhz,
			.active = true,
			.signal = -70,
			.has_chan_util_elem = true,
			.chan_util = 180,
			.chan_load_by_us = 10,
		},
		.expected_grade = 67,
	},
	{
		.desc = "40 MHz grading table: -80 dBm",
		.link = {
			.link_id = 0,
			.chandef = &chandef_5ghz_40mhz,
			.active = false,
			.signal = -80,
		},
		/* 206 * 0.85 (default 5GHz channel load 15%) */
		.expected_grade = 175,
	},
	{
		.desc = "80 MHz grading table: -70 dBm",
		.link = {
			.link_id = 0,
			.chandef = &chandef_5ghz_80mhz,
			.active = false,
			.signal = -70,
		},
		/* 548 * 0.85 (default 5GHz channel load 15%) */
		.expected_grade = 466,
	},
	{

Annotation

Implementation Notes