net/mac80211/tests/tpe.c
Source file repositories/reference/linux-study-clean/net/mac80211/tests/tpe.c
File Facts
- System
- Linux kernel
- Corpus path
net/mac80211/tests/tpe.c- Extension
.c- Size
- 6743 bytes
- Lines
- 285
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: implementation source
- Status
- source implementation candidate
Why This File Exists
Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
kunit/test.h../ieee80211_i.h
Detected Declarations
function subchan_offsetfunction psd_reorder
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* KUnit tests for TPE element handling
*
* Copyright (C) 2024 Intel Corporation
*/
#include <kunit/test.h>
#include "../ieee80211_i.h"
MODULE_IMPORT_NS("EXPORTED_FOR_KUNIT_TESTING");
static struct ieee80211_channel chan6g_1 = {
.band = NL80211_BAND_6GHZ,
.center_freq = 5955,
};
static struct ieee80211_channel chan6g_33 = {
.band = NL80211_BAND_6GHZ,
.center_freq = 6115,
};
static struct ieee80211_channel chan6g_61 = {
.band = NL80211_BAND_6GHZ,
.center_freq = 6255,
};
static const struct subchan_test_case {
const char *desc;
struct cfg80211_chan_def c;
u8 n;
int expect;
} subchan_offset_cases[] = {
{
.desc = "identical 20 MHz",
.c.width = NL80211_CHAN_WIDTH_20,
.c.chan = &chan6g_1,
.c.center_freq1 = 5955,
.n = 1,
.expect = 0,
},
{
.desc = "identical 40 MHz",
.c.width = NL80211_CHAN_WIDTH_40,
.c.chan = &chan6g_1,
.c.center_freq1 = 5965,
.n = 2,
.expect = 0,
},
{
.desc = "identical 80+80 MHz",
/* not really is valid? doesn't matter for the test */
.c.width = NL80211_CHAN_WIDTH_80P80,
.c.chan = &chan6g_1,
.c.center_freq1 = 5985,
.c.center_freq2 = 6225,
.n = 16,
.expect = 0,
},
{
.desc = "identical 320 MHz",
.c.width = NL80211_CHAN_WIDTH_320,
.c.chan = &chan6g_1,
.c.center_freq1 = 6105,
.n = 16,
.expect = 0,
},
{
.desc = "lower 160 MHz of 320 MHz",
.c.width = NL80211_CHAN_WIDTH_320,
.c.chan = &chan6g_1,
.c.center_freq1 = 6105,
.n = 8,
.expect = 0,
},
{
.desc = "upper 160 MHz of 320 MHz",
.c.width = NL80211_CHAN_WIDTH_320,
.c.chan = &chan6g_61,
.c.center_freq1 = 6105,
.n = 8,
.expect = 8,
},
{
.desc = "upper 160 MHz of 320 MHz, go to 40",
.c.width = NL80211_CHAN_WIDTH_320,
.c.chan = &chan6g_61,
.c.center_freq1 = 6105,
.n = 2,
.expect = 8 + 4 + 2,
},
Annotation
- Immediate include surface: `kunit/test.h`, `../ieee80211_i.h`.
- Detected declarations: `function subchan_offset`, `function psd_reorder`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- 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.