drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c- Extension
.c- Size
- 44473 bytes
- Lines
- 1739
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/etherdevice.hlinux/sched.hlinux/firmware.hlinux/interrupt.hlinux/module.hlinux/bcma/bcma.hlinux/string_choices.hnet/mac80211.hdefs.hphy/phy_int.hd11.hchannel.hscb.hpub.hucode_loader.hmac80211_if.hmain.hdebug.hled.h
Detected Declarations
struct firmware_hdrfunction Copyrightfunction brcms_set_basic_ratefunction brcms_freefunction modulefunction brcms_release_fwfunction brcms_request_fwfunction brcms_ops_txfunction brcms_ops_startfunction brcms_ops_stopfunction brcms_ops_add_interfacefunction brcms_ops_remove_interfacefunction brcms_ops_configfunction brcms_ops_bss_info_changedfunction brcms_ops_configure_filterfunction brcms_ops_sw_scan_startfunction brcms_ops_sw_scan_completefunction brcms_ops_conf_txfunction brcms_ops_sta_addfunction brcms_ops_ampdu_actionfunction brcms_ops_rfkill_pollfunction brcms_tx_flush_completedfunction brcms_ops_flushfunction brcms_ops_get_tsffunction brcms_ops_set_tsffunction brcms_ops_beacon_set_timfunction brcms_dpcfunction brcms_isrfunction brcms_pci_probefunction brcms_pci_probefunction brcms_bcma_probefunction brcms_bcma_probefunction brcms_suspendfunction brcms_resumefunction brcms_driver_initfunction brcms_module_initfunction brcms_module_exitfunction brcms_txflowcontrolfunction brcms_initfunction brcms_resetfunction brcms_fatal_errorfunction brcms_intrsonfunction brcms_intrsofffunction brcms_intrsrestorefunction brcms_upfunction brcms_downfunction _brcms_timerfunction void
Annotated Snippet
module_init(brcms_module_init);
module_exit(brcms_module_exit);
/*
* precondition: perimeter lock has been acquired
*/
void brcms_txflowcontrol(struct brcms_info *wl, struct brcms_if *wlif,
bool state, int prio)
{
brcms_err(wl->wlc->hw->d11core, "Shouldn't be here %s\n", __func__);
}
/*
* precondition: perimeter lock has been acquired
*/
void brcms_init(struct brcms_info *wl)
{
brcms_dbg_info(wl->wlc->hw->d11core, "Initializing wl%d\n",
wl->pub->unit);
brcms_reset(wl);
brcms_c_init(wl->wlc, wl->mute_tx);
}
/*
* precondition: perimeter lock has been acquired
*/
uint brcms_reset(struct brcms_info *wl)
{
brcms_dbg_info(wl->wlc->hw->d11core, "Resetting wl%d\n", wl->pub->unit);
brcms_c_reset(wl->wlc);
/* dpc will not be rescheduled */
wl->resched = false;
/* inform publicly that interface is down */
wl->pub->up = false;
return 0;
}
void brcms_fatal_error(struct brcms_info *wl)
{
brcms_err(wl->wlc->hw->d11core, "wl%d: fatal error, reinitializing\n",
wl->wlc->pub->unit);
brcms_reset(wl);
ieee80211_restart_hw(wl->pub->ieee_hw);
}
/*
* These are interrupt on/off entry points. Disable interrupts
* during interrupt state transition.
*/
void brcms_intrson(struct brcms_info *wl)
{
unsigned long flags;
spin_lock_irqsave(&wl->isr_lock, flags);
brcms_c_intrson(wl->wlc);
spin_unlock_irqrestore(&wl->isr_lock, flags);
}
u32 brcms_intrsoff(struct brcms_info *wl)
{
unsigned long flags;
u32 status;
spin_lock_irqsave(&wl->isr_lock, flags);
status = brcms_c_intrsoff(wl->wlc);
spin_unlock_irqrestore(&wl->isr_lock, flags);
return status;
}
void brcms_intrsrestore(struct brcms_info *wl, u32 macintmask)
{
unsigned long flags;
spin_lock_irqsave(&wl->isr_lock, flags);
brcms_c_intrsrestore(wl->wlc, macintmask);
spin_unlock_irqrestore(&wl->isr_lock, flags);
}
/*
* precondition: perimeter lock has been acquired
*/
int brcms_up(struct brcms_info *wl)
{
int error = 0;
if (wl->pub->up)
return 0;
Annotation
- Immediate include surface: `linux/etherdevice.h`, `linux/sched.h`, `linux/firmware.h`, `linux/interrupt.h`, `linux/module.h`, `linux/bcma/bcma.h`, `linux/string_choices.h`, `net/mac80211.h`.
- Detected declarations: `struct firmware_hdr`, `function Copyright`, `function brcms_set_basic_rate`, `function brcms_free`, `function module`, `function brcms_release_fw`, `function brcms_request_fw`, `function brcms_ops_tx`, `function brcms_ops_start`, `function brcms_ops_stop`.
- 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.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.