drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c- Extension
.c- Size
- 235496 bytes
- Lines
- 8502
- 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.
- 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/etherdevice.hlinux/module.hlinux/vmalloc.hnet/cfg80211.hnet/netlink.huapi/linux/if_arp.hbrcmu_utils.hdefs.hbrcmu_wifi.hbrcm_hw_ids.hcore.hdebug.htracepoint.hfwil_types.hp2p.hbtcoex.hpno.hfwsignal.hcfg80211.hfeature.hfwil.hproto.hvendor.hbus.hcommon.hfwvid.h
Detected Declarations
struct brcmf_dump_surveystruct cca_stats_n_flagsstruct cca_msrmnt_querystruct brcmf_vs_tlvstruct parsed_vndr_ie_infostruct parsed_vndr_iesstruct wl_interface_create_v1struct wl_interface_create_v2struct wl_interface_create_v3function check_vif_upfunction nl80211_band_to_fwilfunction chandef_to_chanspecfunction channel_to_chanspecfunction brcmf_parse_tlvsfunction brcmf_tlv_has_iefunction brcmf_find_wpaiefunction brcmf_find_wpsiefunction brcmf_vif_change_validatefunction list_for_each_entryfunction brcmf_vif_add_validatefunction convert_key_from_CPUfunction send_key_to_donglefunction brcmf_cfg80211_update_proto_addr_modefunction brcmf_get_first_free_bsscfgidxfunction brcmf_set_vif_sta_macaddrfunction brcmf_cfg80211_request_sta_iffunction brcmf_cfg80211_request_ap_iffunction brcmf_apsta_add_viffunction brcmf_is_apmodefunction brcmf_is_ibssmodefunction brcmf_mon_add_viffunction brcmf_mon_del_viffunction brcmf_scan_config_mpcfunction brcmf_set_mpcfunction brcmf_is_apmode_operatingfunction list_for_each_entryfunction brcmf_scan_params_v2_to_v1function brcmf_escan_prepfunction brcmf_notify_escan_completefunction brcmf_cfg80211_del_apsta_ifacefunction brcmf_cfg80211_del_ifacefunction brcmf_cfg80211_change_ifacefunction initiallyfunction brcmf_run_escanfunction brcmf_do_escanfunction brcmf_cfg80211_scanfunction brcmf_set_rtsfunction brcmf_set_frag
Annotated Snippet
struct brcmf_dump_survey {
u32 obss;
u32 ibss;
u32 no_ctg;
u32 no_pckt;
u32 tx;
u32 idle;
};
struct cca_stats_n_flags {
u32 msrmnt_time; /* Time for Measurement (msec) */
u32 msrmnt_done; /* flag set when measurement complete */
char buf[1];
};
struct cca_msrmnt_query {
u32 msrmnt_query;
u32 time_req;
};
static bool check_vif_up(struct brcmf_cfg80211_vif *vif)
{
if (!test_bit(BRCMF_VIF_STATUS_READY, &vif->sme_state)) {
brcmf_dbg(INFO, "device is not ready : status (%lu)\n",
vif->sme_state);
return false;
}
return true;
}
#define RATE_TO_BASE100KBPS(rate) (((rate) * 10) / 2)
#define RATETAB_ENT(_rateid, _flags) \
{ \
.bitrate = RATE_TO_BASE100KBPS(_rateid), \
.hw_value = (_rateid), \
.flags = (_flags), \
}
static struct ieee80211_rate __wl_rates[] = {
RATETAB_ENT(BRCM_RATE_1M, 0),
RATETAB_ENT(BRCM_RATE_2M, IEEE80211_RATE_SHORT_PREAMBLE),
RATETAB_ENT(BRCM_RATE_5M5, IEEE80211_RATE_SHORT_PREAMBLE),
RATETAB_ENT(BRCM_RATE_11M, IEEE80211_RATE_SHORT_PREAMBLE),
RATETAB_ENT(BRCM_RATE_6M, 0),
RATETAB_ENT(BRCM_RATE_9M, 0),
RATETAB_ENT(BRCM_RATE_12M, 0),
RATETAB_ENT(BRCM_RATE_18M, 0),
RATETAB_ENT(BRCM_RATE_24M, 0),
RATETAB_ENT(BRCM_RATE_36M, 0),
RATETAB_ENT(BRCM_RATE_48M, 0),
RATETAB_ENT(BRCM_RATE_54M, 0),
};
#define wl_g_rates (__wl_rates + 0)
#define wl_g_rates_size ARRAY_SIZE(__wl_rates)
#define wl_a_rates (__wl_rates + 4)
#define wl_a_rates_size (wl_g_rates_size - 4)
#define CHAN2G(_channel, _freq) { \
.band = NL80211_BAND_2GHZ, \
.center_freq = (_freq), \
.hw_value = (_channel), \
.max_antenna_gain = 0, \
.max_power = 30, \
}
#define CHAN5G(_channel) { \
.band = NL80211_BAND_5GHZ, \
.center_freq = 5000 + (5 * (_channel)), \
.hw_value = (_channel), \
.max_antenna_gain = 0, \
.max_power = 30, \
}
static struct ieee80211_channel __wl_2ghz_channels[] = {
CHAN2G(1, 2412), CHAN2G(2, 2417), CHAN2G(3, 2422), CHAN2G(4, 2427),
CHAN2G(5, 2432), CHAN2G(6, 2437), CHAN2G(7, 2442), CHAN2G(8, 2447),
CHAN2G(9, 2452), CHAN2G(10, 2457), CHAN2G(11, 2462), CHAN2G(12, 2467),
CHAN2G(13, 2472), CHAN2G(14, 2484)
};
static struct ieee80211_channel __wl_5ghz_channels[] = {
CHAN5G(34), CHAN5G(36), CHAN5G(38), CHAN5G(40), CHAN5G(42),
CHAN5G(44), CHAN5G(46), CHAN5G(48), CHAN5G(52), CHAN5G(56),
CHAN5G(60), CHAN5G(64), CHAN5G(100), CHAN5G(104), CHAN5G(108),
CHAN5G(112), CHAN5G(116), CHAN5G(120), CHAN5G(124), CHAN5G(128),
CHAN5G(132), CHAN5G(136), CHAN5G(140), CHAN5G(144), CHAN5G(149),
CHAN5G(153), CHAN5G(157), CHAN5G(161), CHAN5G(165)
};
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/etherdevice.h`, `linux/module.h`, `linux/vmalloc.h`, `net/cfg80211.h`, `net/netlink.h`, `uapi/linux/if_arp.h`, `brcmu_utils.h`.
- Detected declarations: `struct brcmf_dump_survey`, `struct cca_stats_n_flags`, `struct cca_msrmnt_query`, `struct brcmf_vs_tlv`, `struct parsed_vndr_ie_info`, `struct parsed_vndr_ies`, `struct wl_interface_create_v1`, `struct wl_interface_create_v2`, `struct wl_interface_create_v3`, `function check_vif_up`.
- Atlas domain: Driver Families / drivers/net.
- 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.