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.

Dependency Surface

Detected Declarations

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

Implementation Notes