drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c- Extension
.c- Size
- 129294 bytes
- Lines
- 4654
- 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.
- 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/atomic.hlinux/kernel.hlinux/kthread.hlinux/printk.hlinux/pci_ids.hlinux/netdevice.hlinux/interrupt.hlinux/sched/signal.hlinux/mmc/sdio.hlinux/mmc/sdio_ids.hlinux/mmc/sdio_func.hlinux/mmc/card.hlinux/mmc/core.hlinux/semaphore.hlinux/firmware.hlinux/module.hlinux/bcma/bcma.hlinux/debugfs.hlinux/vmalloc.hlinux/unaligned.hdefs.hbrcmu_wifi.hbrcmu_utils.hbrcm_hw_ids.hsoc.hsdio.hchip.hfirmware.hcore.hcommon.hbcdc.h
Detected Declarations
struct rte_log_lestruct rte_consolestruct brcmf_consolestruct brcmf_trap_infostruct sdpcm_sharedstruct sdpcm_shared_lestruct brcmf_sdio_hdrinfostruct brcmf_sdio_countstruct brcmf_sdiostruct sdiod_drive_strenum brcmf_sdio_frmtypefunction pkt_alignfunction data_okfunction txctl_okfunction brcmf_sdio_kso_controlfunction brcmf_sdio_htclkfunction brcmf_sdio_sdclkfunction brcmf_sdio_clkctlfunction brcmf_sdio_bus_sleepfunction brcmf_sdio_valid_shared_addressfunction brcmf_sdio_readsharedfunction brcmf_sdio_get_console_addrfunction brcmf_sdio_get_console_addrfunction brcmf_sdio_rxfailfunction brcmf_sdio_txfailfunction brcmf_sdio_glom_lenfunction brcmf_sdio_free_glomfunction skb_queue_walk_safefunction headerfunction brcmf_sdio_fromevntchanfunction brcmf_sdio_hdparsefunction brcmf_sdio_update_hwhdrfunction brcmf_sdio_hdpackfunction brcmf_sdio_rxglomfunction skb_queue_walkfunction skb_queue_walkfunction skb_queue_walk_safefunction brcmf_sdio_dcmd_resp_waitfunction brcmf_sdio_dcmd_resp_wakefunction brcmf_sdio_read_controlfunction brcmf_sdio_padfunction brcmf_sdio_readframesfunction brcmf_sdio_wait_event_wakeupfunction brcmf_sdio_txpkt_hdalignfunction brcmf_sdio_txpkt_prep_sgfunction brcmf_sdio_txpkt_prepfunction brcmf_sdio_txpkt_postpfunction skb_queue_walk_safe
Annotated Snippet
struct rte_log_le {
__le32 buf; /* Can't be pointer on (64-bit) hosts */
__le32 buf_size;
__le32 idx;
char *_buf_compat; /* Redundant pointer for backward compat. */
};
struct rte_console {
/* Virtual UART
* When there is no UART (e.g. Quickturn),
* the host should write a complete
* input line directly into cbuf and then write
* the length into vcons_in.
* This may also be used when there is a real UART
* (at risk of conflicting with
* the real UART). vcons_out is currently unused.
*/
uint vcons_in;
uint vcons_out;
/* Output (logging) buffer
* Console output is written to a ring buffer log_buf at index log_idx.
* The host may read the output when it sees log_idx advance.
* Output will be lost if the output wraps around faster than the host
* polls.
*/
struct rte_log_le log_le;
/* Console input line buffer
* Characters are read one at a time into cbuf
* until <CR> is received, then
* the buffer is processed as a command line.
* Also used for virtual UART.
*/
uint cbuf_idx;
char cbuf[CBUF_LEN];
};
#endif /* DEBUG */
#include <chipcommon.h>
#include "bus.h"
#include "debug.h"
#include "tracepoint.h"
#define TXQLEN 2048 /* bulk tx queue length */
#define TXHI (TXQLEN - 256) /* turn on flow control above TXHI */
#define TXLOW (TXHI - 256) /* turn off flow control below TXLOW */
#define PRIOMASK 7
#define TXRETRIES 2 /* # of retries for tx frames */
#define BRCMF_RXBOUND 50 /* Default for max rx frames in
one scheduling */
#define BRCMF_TXBOUND 20 /* Default for max tx frames in
one scheduling */
#define BRCMF_TXMINMAX 1 /* Max tx frames if rx still pending */
#define MEMBLOCK 2048 /* Block size used for downloading
of dongle image */
#define MAX_DATA_BUF (32 * 1024) /* Must be large enough to hold
biggest possible glom */
#define BRCMF_FIRSTREAD (1 << 6)
/* SBSDIO_DEVICE_CTL */
/* 1: device will assert busy signal when receiving CMD53 */
#define SBSDIO_DEVCTL_SETBUSY 0x01
/* 1: assertion of sdio interrupt is synchronous to the sdio clock */
#define SBSDIO_DEVCTL_SPI_INTR_SYNC 0x02
/* 1: mask all interrupts to host except the chipActive (rev 8) */
#define SBSDIO_DEVCTL_CA_INT_ONLY 0x04
/* 1: isolate internal sdio signals, put external pads in tri-state; requires
* sdio bus power cycle to clear (rev 9) */
#define SBSDIO_DEVCTL_PADS_ISO 0x08
/* 1: enable F2 Watermark */
#define SBSDIO_DEVCTL_F2WM_ENAB 0x10
/* Force SD->SB reset mapping (rev 11) */
#define SBSDIO_DEVCTL_SB_RST_CTL 0x30
/* Determined by CoreControl bit */
#define SBSDIO_DEVCTL_RST_CORECTL 0x00
/* Force backplane reset */
#define SBSDIO_DEVCTL_RST_BPRESET 0x10
/* Force no backplane reset */
#define SBSDIO_DEVCTL_RST_NOBPRESET 0x20
/* direct(mapped) cis space */
Annotation
- Immediate include surface: `linux/types.h`, `linux/atomic.h`, `linux/kernel.h`, `linux/kthread.h`, `linux/printk.h`, `linux/pci_ids.h`, `linux/netdevice.h`, `linux/interrupt.h`.
- Detected declarations: `struct rte_log_le`, `struct rte_console`, `struct brcmf_console`, `struct brcmf_trap_info`, `struct sdpcm_shared`, `struct sdpcm_shared_le`, `struct brcmf_sdio_hdrinfo`, `struct brcmf_sdio_count`, `struct brcmf_sdio`, `struct sdiod_drive_str`.
- 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.
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.