drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c- Extension
.c- Size
- 32935 bytes
- Lines
- 1269
- 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.
- 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/types.hlinux/netdevice.hlinux/pci.hlinux/pci_ids.hlinux/sched.hlinux/completion.hlinux/interrupt.hlinux/scatterlist.hlinux/mmc/sdio.hlinux/mmc/core.hlinux/mmc/sdio_func.hlinux/mmc/card.hlinux/mmc/host.hlinux/pm_runtime.hlinux/suspend.hlinux/errno.hlinux/module.hlinux/acpi.hnet/cfg80211.hdefs.hbrcm_hw_ids.hbrcmu_utils.hbrcmu_wifi.hchipcommon.hsoc.hchip.hbus.hdebug.hsdio.hcore.hcommon.h
Detected Declarations
struct brcmf_sdiod_freezerfunction brcmf_sdiod_oob_irqhandlerfunction brcmf_sdiod_ib_irqhandlerfunction brcmf_sdiod_dummy_irqhandlerfunction brcmf_sdiod_intr_unregisterfunction brcmf_sdiod_change_statefunction brcmf_sdiod_set_backplane_windowfunction brcmf_sdiod_readlfunction brcmf_sdiod_writelfunction brcmf_sdiod_skbuff_readfunction brcmf_sdiod_skbuff_writefunction mmc_submit_onefunction brcmf_sdiod_sglist_rwfunction skb_queue_walkfunction brcmf_sdiod_recv_buffunction brcmf_sdiod_recv_pktfunction brcmf_sdiod_recv_chainfunction skb_queue_walkfunction brcmf_sdiod_send_buffunction brcmf_sdiod_send_pktfunction brcmf_sdiod_ramrwfunction brcmf_sdiod_abortfunction brcmf_sdiod_sgtable_allocfunction brcmf_sdiod_freezer_attachfunction brcmf_sdiod_freezer_detachfunction brcmf_sdiod_freezer_onfunction brcmf_sdiod_freezer_offfunction brcmf_sdiod_freezingfunction brcmf_sdiod_try_freezefunction brcmf_sdiod_freezer_countfunction brcmf_sdiod_freezer_uncountfunction brcmf_sdiod_removefunction brcmf_sdiod_host_fixupfunction brcmf_sdiod_probefunction brcmf_sdiod_acpi_save_power_manageablefunction brcmf_sdiod_acpi_set_power_manageablefunction brcmf_ops_sdio_probefunction brcmf_ops_sdio_removefunction brcmf_sdio_wowl_configfunction brcmf_ops_sdio_suspendfunction brcmf_ops_sdio_resumefunction brcmf_sdio_registerfunction brcmf_sdio_exit
Annotated Snippet
struct brcmf_sdiod_freezer {
atomic_t freezing;
atomic_t thread_count;
u32 frozen_count;
wait_queue_head_t thread_freeze;
struct completion resumed;
};
static irqreturn_t brcmf_sdiod_oob_irqhandler(int irq, void *dev_id)
{
struct brcmf_bus *bus_if = dev_get_drvdata(dev_id);
struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio;
brcmf_dbg(INTR, "OOB intr triggered\n");
/* out-of-band interrupt is level-triggered which won't
* be cleared until dpc
*/
if (sdiodev->irq_en) {
disable_irq_nosync(irq);
sdiodev->irq_en = false;
}
brcmf_sdio_isr(sdiodev->bus, true);
return IRQ_HANDLED;
}
static void brcmf_sdiod_ib_irqhandler(struct sdio_func *func)
{
struct brcmf_bus *bus_if = dev_get_drvdata(&func->dev);
struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio;
brcmf_dbg(INTR, "IB intr triggered\n");
brcmf_sdio_isr(sdiodev->bus, false);
}
/* dummy handler for SDIO function 2 interrupt */
static void brcmf_sdiod_dummy_irqhandler(struct sdio_func *func)
{
}
int brcmf_sdiod_intr_register(struct brcmf_sdio_dev *sdiodev)
{
struct brcmfmac_sdio_pd *pdata;
int ret = 0;
u8 data;
u32 addr, gpiocontrol;
pdata = &sdiodev->settings->bus.sdio;
if (pdata->oob_irq_supported) {
brcmf_dbg(SDIO, "Enter, register OOB IRQ %d\n",
pdata->oob_irq_nr);
spin_lock_init(&sdiodev->irq_en_lock);
sdiodev->irq_en = true;
ret = request_irq(pdata->oob_irq_nr, brcmf_sdiod_oob_irqhandler,
pdata->oob_irq_flags, "brcmf_oob_intr",
&sdiodev->func1->dev);
if (ret != 0) {
brcmf_err("request_irq failed %d\n", ret);
return ret;
}
sdiodev->oob_irq_requested = true;
ret = enable_irq_wake(pdata->oob_irq_nr);
if (ret != 0) {
brcmf_err("enable_irq_wake failed %d\n", ret);
return ret;
}
disable_irq_wake(pdata->oob_irq_nr);
sdio_claim_host(sdiodev->func1);
if (sdiodev->bus_if->chip == BRCM_CC_43362_CHIP_ID) {
/* assign GPIO to SDIO core */
addr = brcmf_chip_enum_base(sdiodev->func1->device);
addr = CORE_CC_REG(addr, gpiocontrol);
gpiocontrol = brcmf_sdiod_readl(sdiodev, addr, &ret);
gpiocontrol |= 0x2;
brcmf_sdiod_writel(sdiodev, addr, gpiocontrol, &ret);
brcmf_sdiod_writeb(sdiodev, SBSDIO_GPIO_SELECT,
0xf, &ret);
brcmf_sdiod_writeb(sdiodev, SBSDIO_GPIO_OUT, 0, &ret);
brcmf_sdiod_writeb(sdiodev, SBSDIO_GPIO_EN, 0x2, &ret);
}
/* must configure SDIO_CCCR_IENx to enable irq */
Annotation
- Immediate include surface: `linux/types.h`, `linux/netdevice.h`, `linux/pci.h`, `linux/pci_ids.h`, `linux/sched.h`, `linux/completion.h`, `linux/interrupt.h`, `linux/scatterlist.h`.
- Detected declarations: `struct brcmf_sdiod_freezer`, `function brcmf_sdiod_oob_irqhandler`, `function brcmf_sdiod_ib_irqhandler`, `function brcmf_sdiod_dummy_irqhandler`, `function brcmf_sdiod_intr_unregister`, `function brcmf_sdiod_change_state`, `function brcmf_sdiod_set_backplane_window`, `function brcmf_sdiod_readl`, `function brcmf_sdiod_writel`, `function brcmf_sdiod_skbuff_read`.
- 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.
- 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.