drivers/net/wireless/ath/ath11k/reg.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath11k/reg.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath11k/reg.c- Extension
.c- Size
- 30008 bytes
- Lines
- 1069
- 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.
- 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/rtnetlink.hcore.hdebug.h
Detected Declarations
function ath11k_regdom_changesfunction ath11k_reg_notifierfunction ath11k_reg_update_chan_listfunction ath11k_copy_regdfunction ath11k_regd_updatefunction ath11k_map_fw_dfs_regionfunction ath11k_map_fw_reg_flagsfunction ath11k_map_fw_phy_flagsfunction ath11k_reg_can_intersectfunction ath11k_reg_intersect_rulesfunction ath11k_regd_intersectfunction ath11k_reg_get_regdom_strfunction ath11k_reg_adjust_bwfunction ath11k_reg_update_rulefunction ath11k_reg_update_weather_radar_bandfunction ath11k_reg_ap_pwr_convertfunction ath11k_reg_build_regdfunction ath11k_regd_update_chan_list_workfunction ath11k_reg_is_world_alphafunction ath11k_reg_get_ar_vdev_typefunction ath11k_reg_handle_chan_listfunction ath11k_regd_update_workfunction ath11k_reg_initfunction ath11k_reg_reset_infofunction ath11k_reg_freefunction ath11k_reg_set_cc
Annotated Snippet
if (ab->default_regd[pdev_id]) {
regd = ab->default_regd[pdev_id];
} else {
ath11k_warn(ab,
"failed to receive default regd during init\n");
regd = (struct ieee80211_regdomain *)&ath11k_world_regd;
}
}
if (!regd) {
ret = -EINVAL;
spin_unlock_bh(&ab->base_lock);
goto err;
}
regd_len = sizeof(*regd) + (regd->n_reg_rules *
sizeof(struct ieee80211_reg_rule));
regd_copy = kzalloc(regd_len, GFP_ATOMIC);
if (regd_copy)
ath11k_copy_regd(regd, regd_copy);
spin_unlock_bh(&ab->base_lock);
if (!regd_copy) {
ret = -ENOMEM;
goto err;
}
ret = regulatory_set_wiphy_regd(ar->hw->wiphy, regd_copy);
kfree(regd_copy);
if (ret)
goto err;
return 0;
err:
ath11k_warn(ab, "failed to perform regd update : %d\n", ret);
return ret;
}
static enum nl80211_dfs_regions
ath11k_map_fw_dfs_region(enum ath11k_dfs_region dfs_region)
{
switch (dfs_region) {
case ATH11K_DFS_REG_FCC:
case ATH11K_DFS_REG_CN:
return NL80211_DFS_FCC;
case ATH11K_DFS_REG_ETSI:
case ATH11K_DFS_REG_KR:
return NL80211_DFS_ETSI;
case ATH11K_DFS_REG_MKK:
case ATH11K_DFS_REG_MKK_N:
return NL80211_DFS_JP;
default:
return NL80211_DFS_UNSET;
}
}
static u32 ath11k_map_fw_reg_flags(u16 reg_flags)
{
u32 flags = 0;
if (reg_flags & REGULATORY_CHAN_NO_IR)
flags = NL80211_RRF_NO_IR;
if (reg_flags & REGULATORY_CHAN_RADAR)
flags |= NL80211_RRF_DFS;
if (reg_flags & REGULATORY_CHAN_NO_OFDM)
flags |= NL80211_RRF_NO_OFDM;
if (reg_flags & REGULATORY_CHAN_INDOOR_ONLY)
flags |= NL80211_RRF_NO_OUTDOOR;
if (reg_flags & REGULATORY_CHAN_NO_HT40)
flags |= NL80211_RRF_NO_HT40;
if (reg_flags & REGULATORY_CHAN_NO_80MHZ)
flags |= NL80211_RRF_NO_80MHZ;
if (reg_flags & REGULATORY_CHAN_NO_160MHZ)
flags |= NL80211_RRF_NO_160MHZ;
return flags;
}
static u32 ath11k_map_fw_phy_flags(u32 phy_flags)
{
Annotation
- Immediate include surface: `linux/rtnetlink.h`, `core.h`, `debug.h`.
- Detected declarations: `function ath11k_regdom_changes`, `function ath11k_reg_notifier`, `function ath11k_reg_update_chan_list`, `function ath11k_copy_regd`, `function ath11k_regd_update`, `function ath11k_map_fw_dfs_region`, `function ath11k_map_fw_reg_flags`, `function ath11k_map_fw_phy_flags`, `function ath11k_reg_can_intersect`, `function ath11k_reg_intersect_rules`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source 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.