net/wireless/tests/chan.c
Source file repositories/reference/linux-study-clean/net/wireless/tests/chan.c
File Facts
- System
- Linux kernel
- Corpus path
net/wireless/tests/chan.c- Extension
.c- Size
- 9385 bytes
- Lines
- 409
- 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
net/cfg80211.hkunit/test.h
Detected Declarations
function test_chandef_compatfunction test_chandef_dbe
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* KUnit tests for channel helper functions
*
* Copyright (C) 2023-2024, 2026 Intel Corporation
*/
#include <net/cfg80211.h>
#include <kunit/test.h>
MODULE_IMPORT_NS("EXPORTED_FOR_KUNIT_TESTING");
static struct ieee80211_channel chan_2ghz_1 = {
.band = NL80211_BAND_2GHZ,
.center_freq = 2412,
};
static struct ieee80211_channel chan_6ghz_1 = {
.band = NL80211_BAND_6GHZ,
.center_freq = 5955,
};
static struct ieee80211_channel chan_6ghz_5 = {
.band = NL80211_BAND_6GHZ,
.center_freq = 5975,
};
static struct ieee80211_channel chan_6ghz_105 = {
.band = NL80211_BAND_6GHZ,
.center_freq = 6475,
};
static const struct chandef_compat_case {
const char *desc;
/* leave c1 empty for tests for identical */
struct cfg80211_chan_def c1, c2;
/* we test both ways around, so c2 should always be the compat one */
bool compat;
} chandef_compat_cases[] = {
{
.desc = "identical non-HT",
.c2 = {
.width = NL80211_CHAN_WIDTH_20_NOHT,
.chan = &chan_6ghz_1,
.center_freq1 = 5955,
},
.compat = true,
},
{
.desc = "identical 20 MHz",
.c2 = {
.width = NL80211_CHAN_WIDTH_20,
.chan = &chan_6ghz_1,
.center_freq1 = 5955,
},
.compat = true,
},
{
.desc = "identical 40 MHz",
.c2 = {
.width = NL80211_CHAN_WIDTH_40,
.chan = &chan_6ghz_1,
.center_freq1 = 5955 + 10,
},
.compat = true,
},
{
.desc = "identical 80 MHz",
.c2 = {
.width = NL80211_CHAN_WIDTH_80,
.chan = &chan_6ghz_1,
.center_freq1 = 5955 + 10 + 20,
},
.compat = true,
},
{
.desc = "identical 160 MHz",
.c2 = {
.width = NL80211_CHAN_WIDTH_160,
.chan = &chan_6ghz_1,
.center_freq1 = 5955 + 10 + 20 + 40,
},
.compat = true,
},
{
.desc = "identical 320 MHz",
.c2 = {
.width = NL80211_CHAN_WIDTH_320,
.chan = &chan_6ghz_1,
.center_freq1 = 5955 + 10 + 20 + 40 + 80,
},
Annotation
- Immediate include surface: `net/cfg80211.h`, `kunit/test.h`.
- Detected declarations: `function test_chandef_compat`, `function test_chandef_dbe`.
- 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.