net/wireless/reg.c
Source file repositories/reference/linux-study-clean/net/wireless/reg.c
File Facts
- System
- Linux kernel
- Corpus path
net/wireless/reg.c- Extension
.c- Size
- 116090 bytes
- Lines
- 4389
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/export.hlinux/slab.hlinux/list.hlinux/ctype.hlinux/nl80211.hlinux/device/faux.hlinux/verification.hlinux/moduleparam.hlinux/firmware.hlinux/units.hnet/cfg80211.hcore.hreg.hrdev-ops.hnl80211.hkeys/asymmetric-type.h
Detected Declarations
struct reg_beaconstruct reg_regdb_apply_requeststruct fwdb_countrystruct fwdb_collectionstruct fwdb_wmm_acstruct fwdb_wmm_rulestruct fwdb_rulestruct fwdb_headerenum reg_request_treatmentenum fwdb_flagsfunction reg_get_dfs_regionfunction rcu_free_regdomfunction reg_free_requestfunction reg_free_last_requestfunction reg_update_last_requestfunction reset_regdomainsfunction update_world_regdomainfunction is_world_regdomfunction is_alpha2_setfunction is_unknown_alpha2function is_intersected_alpha2function is_an_alpha2function alpha2_equalfunction regdom_changesfunction is_user_regdom_savedfunction reg_copy_regdfunction cfg80211_save_user_regdomfunction reg_regdb_applyfunction reg_schedule_applyfunction crda_timeout_workfunction cancel_crda_timeoutfunction cancel_crda_timeout_syncfunction reset_crda_timeoutsfunction call_crdafunction cancel_crda_timeoutfunction ecw2cwfunction valid_wmmfunction valid_rulefunction valid_countryfunction load_builtin_regdb_keysfunction regdb_has_valid_signaturefunction free_regdb_keyringfunction load_builtin_regdb_keysfunction regdb_has_valid_signaturefunction free_regdb_keyringfunction set_wmm_rulefunction __regdb_query_wmmfunction reg_query_regdb_wmm
Annotated Snippet
struct reg_beacon {
struct list_head list;
struct ieee80211_channel chan;
};
static void reg_check_chans_work(struct work_struct *work);
static DECLARE_DELAYED_WORK(reg_check_chans, reg_check_chans_work);
static void reg_todo(struct work_struct *work);
static DECLARE_WORK(reg_work, reg_todo);
/* We keep a static world regulatory domain in case of the absence of CRDA */
static const struct ieee80211_regdomain world_regdom = {
.n_reg_rules = 8,
.alpha2 = "00",
.reg_rules = {
/* IEEE 802.11b/g, channels 1..11 */
REG_RULE(2412-10, 2462+10, 40, 6, 20, 0),
/* IEEE 802.11b/g, channels 12..13. */
REG_RULE(2467-10, 2472+10, 20, 6, 20,
NL80211_RRF_NO_IR | NL80211_RRF_AUTO_BW),
/* IEEE 802.11 channel 14 - Only JP enables
* this and for 802.11b only */
REG_RULE(2484-10, 2484+10, 20, 6, 20,
NL80211_RRF_NO_IR |
NL80211_RRF_NO_OFDM),
/* IEEE 802.11a, channel 36..48 */
REG_RULE(5180-10, 5240+10, 80, 6, 20,
NL80211_RRF_NO_IR |
NL80211_RRF_AUTO_BW),
/* IEEE 802.11a, channel 52..64 - DFS required */
REG_RULE(5260-10, 5320+10, 80, 6, 20,
NL80211_RRF_NO_IR |
NL80211_RRF_AUTO_BW |
NL80211_RRF_DFS),
/* IEEE 802.11a, channel 100..144 - DFS required */
REG_RULE(5500-10, 5720+10, 160, 6, 20,
NL80211_RRF_NO_IR |
NL80211_RRF_DFS),
/* IEEE 802.11a, channel 149..165 */
REG_RULE(5745-10, 5825+10, 80, 6, 20,
NL80211_RRF_NO_IR),
/* IEEE 802.11ad (60GHz), channels 1..3 */
REG_RULE(56160+2160*1-1080, 56160+2160*3+1080, 2160, 0, 0, 0),
}
};
/* protected by RTNL */
static const struct ieee80211_regdomain *cfg80211_world_regdom =
&world_regdom;
static char *ieee80211_regdom = "00";
static char user_alpha2[2];
static const struct ieee80211_regdomain *cfg80211_user_regdom;
module_param(ieee80211_regdom, charp, 0444);
MODULE_PARM_DESC(ieee80211_regdom, "IEEE 802.11 regulatory domain code");
static void reg_free_request(struct regulatory_request *request)
{
if (request == &core_request_world)
return;
if (request != get_last_request())
kfree(request);
}
static void reg_free_last_request(void)
{
struct regulatory_request *lr = get_last_request();
if (lr != &core_request_world && lr)
kfree_rcu(lr, rcu_head);
}
static void reg_update_last_request(struct regulatory_request *request)
{
struct regulatory_request *lr;
lr = get_last_request();
if (lr == request)
return;
reg_free_last_request();
rcu_assign_pointer(last_request, request);
}
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/export.h`, `linux/slab.h`, `linux/list.h`, `linux/ctype.h`, `linux/nl80211.h`, `linux/device/faux.h`, `linux/verification.h`.
- Detected declarations: `struct reg_beacon`, `struct reg_regdb_apply_request`, `struct fwdb_country`, `struct fwdb_collection`, `struct fwdb_wmm_ac`, `struct fwdb_wmm_rule`, `struct fwdb_rule`, `struct fwdb_header`, `enum reg_request_treatment`, `enum fwdb_flags`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.