drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.c- Extension
.c- Size
- 5588 bytes
- Lines
- 216
- 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.
- 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/slab.hnet/mac80211.hmain.hmac80211_if.hphy_shim.h
Detected Declarations
struct phy_shim_infofunction wlc_phy_shim_detachfunction voidfunction wlapi_free_timerfunction wlapi_add_timerfunction wlapi_del_timerfunction wlapi_intrsonfunction wlapi_intrsofffunction wlapi_intrsrestorefunction wlapi_bmac_write_shmfunction wlapi_bmac_read_shmfunction wlapi_bmac_mhffunction wlapi_bmac_coreresetfunction wlapi_suspend_mac_and_waitfunction wlapi_switch_macfreqfunction wlapi_enable_macfunction wlapi_bmac_mctrlfunction wlapi_bmac_phy_resetfunction wlapi_bmac_bw_setfunction wlapi_bmac_get_txantfunction wlapi_bmac_phyclk_fgcfunction wlapi_bmac_macphyclk_setfunction wlapi_bmac_core_phypll_ctlfunction wlapi_bmac_core_phypll_resetfunction wlapi_bmac_ucode_wake_override_phyreg_setfunction wlapi_bmac_ucode_wake_override_phyreg_clearfunction wlapi_bmac_write_template_ramfunction wlapi_bmac_rate_shm_offsetfunction wlapi_ucode_sample_initfunction wlapi_copyto_objmem
Annotated Snippet
struct phy_shim_info {
struct brcms_hardware *wlc_hw; /* pointer to main wlc_hw structure */
struct brcms_c_info *wlc; /* pointer to main wlc structure */
struct brcms_info *wl; /* pointer to os-specific private state */
};
struct phy_shim_info *wlc_phy_shim_attach(struct brcms_hardware *wlc_hw,
struct brcms_info *wl,
struct brcms_c_info *wlc) {
struct phy_shim_info *physhim;
physhim = kzalloc_obj(*physhim, GFP_ATOMIC);
if (!physhim)
return NULL;
physhim->wlc_hw = wlc_hw;
physhim->wlc = wlc;
physhim->wl = wl;
return physhim;
}
void wlc_phy_shim_detach(struct phy_shim_info *physhim)
{
kfree(physhim);
}
struct wlapi_timer *wlapi_init_timer(struct phy_shim_info *physhim,
void (*fn)(void *pi),
void *arg, const char *name)
{
return (struct wlapi_timer *)
brcms_init_timer(physhim->wl, fn, arg, name);
}
void wlapi_free_timer(struct wlapi_timer *t)
{
brcms_free_timer((struct brcms_timer *)t);
}
void
wlapi_add_timer(struct wlapi_timer *t, uint ms, int periodic)
{
brcms_add_timer((struct brcms_timer *)t, ms, periodic);
}
bool wlapi_del_timer(struct wlapi_timer *t)
{
return brcms_del_timer((struct brcms_timer *)t);
}
void wlapi_intrson(struct phy_shim_info *physhim)
{
brcms_intrson(physhim->wl);
}
u32 wlapi_intrsoff(struct phy_shim_info *physhim)
{
return brcms_intrsoff(physhim->wl);
}
void wlapi_intrsrestore(struct phy_shim_info *physhim, u32 macintmask)
{
brcms_intrsrestore(physhim->wl, macintmask);
}
void wlapi_bmac_write_shm(struct phy_shim_info *physhim, uint offset, u16 v)
{
brcms_b_write_shm(physhim->wlc_hw, offset, v);
}
u16 wlapi_bmac_read_shm(struct phy_shim_info *physhim, uint offset)
{
return brcms_b_read_shm(physhim->wlc_hw, offset);
}
void
wlapi_bmac_mhf(struct phy_shim_info *physhim, u8 idx, u16 mask,
u16 val, int bands)
{
brcms_b_mhf(physhim->wlc_hw, idx, mask, val, bands);
}
void wlapi_bmac_corereset(struct phy_shim_info *physhim, u32 flags)
{
brcms_b_corereset(physhim->wlc_hw, flags);
}
void wlapi_suspend_mac_and_wait(struct phy_shim_info *physhim)
{
Annotation
- Immediate include surface: `linux/slab.h`, `net/mac80211.h`, `main.h`, `mac80211_if.h`, `phy_shim.h`.
- Detected declarations: `struct phy_shim_info`, `function wlc_phy_shim_detach`, `function void`, `function wlapi_free_timer`, `function wlapi_add_timer`, `function wlapi_del_timer`, `function wlapi_intrson`, `function wlapi_intrsoff`, `function wlapi_intrsrestore`, `function wlapi_bmac_write_shm`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source 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.