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.
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
kunit/static_stub.hutils.hmld.hlink.hiface.hphy.hmlo.h
Detected Declarations
struct link_grading_inputfunction fake_dup_beacon_rssi_adjustfunction fake_psd_eirp_rssi_adjustfunction setup_linkfunction test_link_gradingfunction test_iwl_mld_link_pair_allows_emlsr
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
- Immediate include surface: `kunit/static_stub.h`, `utils.h`, `mld.h`, `link.h`, `iface.h`, `phy.h`, `mlo.h`.
- Detected declarations: `struct link_grading_input`, `function fake_dup_beacon_rssi_adjust`, `function fake_psd_eirp_rssi_adjust`, `function setup_link`, `function test_link_grading`, `function test_iwl_mld_link_pair_allows_emlsr`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
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.