drivers/net/wireless/ath/regd.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/regd.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/regd.c- Extension
.c- Size
- 20404 bytes
- Lines
- 813
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/export.hnet/cfg80211.hnet/mac80211.hregd.hregd_common.h
Detected Declarations
function dynamic_country_user_possiblefunction ath_reg_dyn_country_user_allowfunction is_wwr_skufunction ath_regd_get_eepromRDfunction ath_is_world_regdfunction ath_is_49ghz_allowedfunction ath_is_radar_freqfunction ath_force_clear_no_ir_chanfunction ath_force_clear_no_ir_freqfunction ath_force_no_ir_chanfunction ath_force_no_ir_freqfunction __ath_reg_apply_beaconing_flagsfunction ath_reg_apply_beaconing_flagsfunction ath_reg_apply_ir_flagsfunction ath_reg_apply_radar_flagsfunction ath_reg_apply_world_flagsfunction ath_regd_find_country_by_namefunction __ath_reg_dyn_countryfunction ath_reg_dyn_countryfunction ath_reg_notifier_applyfunction ath_regd_is_eeprom_validfunction ath_regd_find_countryfunction ath_regd_find_country_by_rdfunction ath_regd_get_default_countryfunction ath_get_regpairfunction ath_regd_init_wiphyfunction ath_regd_sanitizefunction __ath_regd_initfunction ath_regd_initfunction ath_regd_get_band_ctlexport ath_is_world_regdexport ath_is_49ghz_allowedexport ath_regd_find_country_by_nameexport ath_reg_notifier_applyexport ath_regd_initexport ath_regd_get_band_ctl
Annotated Snippet
if (country == NULL) {
printk(KERN_DEBUG
"ath: no valid country maps found for "
"country code: 0x%0x\n",
reg->country_code);
return -EINVAL;
} else {
regdmn = country->regDmnEnum;
printk(KERN_DEBUG "ath: country maps to "
"regdmn code: 0x%0x\n",
regdmn);
}
}
reg->regpair = ath_get_regpair(regdmn);
if (!reg->regpair) {
printk(KERN_DEBUG "ath: "
"No regulatory domain pair found, cannot continue\n");
return -EINVAL;
}
if (!country)
country = ath_regd_find_country_by_rd(regdmn);
if (country) {
reg->alpha2[0] = country->isoName[0];
reg->alpha2[1] = country->isoName[1];
} else {
reg->alpha2[0] = '0';
reg->alpha2[1] = '0';
}
printk(KERN_DEBUG "ath: Country alpha2 being used: %c%c\n",
reg->alpha2[0], reg->alpha2[1]);
printk(KERN_DEBUG "ath: Regpair used: 0x%0x\n",
reg->regpair->reg_domain);
return 0;
}
int
ath_regd_init(struct ath_regulatory *reg,
struct wiphy *wiphy,
void (*reg_notifier)(struct wiphy *wiphy,
struct regulatory_request *request))
{
struct ath_common *common = container_of(reg, struct ath_common,
regulatory);
int r;
r = __ath_regd_init(reg);
if (r)
return r;
if (ath_is_world_regd(reg))
memcpy(&common->reg_world_copy, reg,
sizeof(struct ath_regulatory));
ath_regd_init_wiphy(reg, wiphy, reg_notifier);
return 0;
}
EXPORT_SYMBOL(ath_regd_init);
u32 ath_regd_get_band_ctl(struct ath_regulatory *reg,
enum nl80211_band band)
{
if (!reg->regpair ||
(reg->country_code == CTRY_DEFAULT &&
is_wwr_sku(ath_regd_get_eepromRD(reg)))) {
return SD_NO_CTL;
}
if (ath_regd_get_eepromRD(reg) == CTRY_DEFAULT) {
switch (reg->region) {
case NL80211_DFS_FCC:
return CTL_FCC;
case NL80211_DFS_ETSI:
return CTL_ETSI;
case NL80211_DFS_JP:
return CTL_MKK;
default:
break;
}
}
switch (band) {
case NL80211_BAND_2GHZ:
return reg->regpair->reg_2ghz_ctl;
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/export.h`, `net/cfg80211.h`, `net/mac80211.h`, `regd.h`, `regd_common.h`.
- Detected declarations: `function dynamic_country_user_possible`, `function ath_reg_dyn_country_user_allow`, `function is_wwr_sku`, `function ath_regd_get_eepromRD`, `function ath_is_world_regd`, `function ath_is_49ghz_allowed`, `function ath_is_radar_freq`, `function ath_force_clear_no_ir_chan`, `function ath_force_clear_no_ir_freq`, `function ath_force_no_ir_chan`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration 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.