drivers/net/wireless/microchip/wilc1000/sdio.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/microchip/wilc1000/sdio.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/microchip/wilc1000/sdio.c- Extension
.c- Size
- 23263 bytes
- Lines
- 1077
- 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/clk.hlinux/mmc/sdio_func.hlinux/mmc/sdio_ids.hlinux/mmc/host.hlinux/mmc/sdio.hlinux/of_irq.hnetdev.hcfg80211.h
Detected Declarations
struct wilc_sdiostruct sdio_cmd52struct sdio_cmd53function wilc_sdio_interruptfunction wilc_sdio_cmd52function wilc_sdio_cmd53function wilc_sdio_probefunction wilc_sdio_removefunction wilc_sdio_resetfunction wilc_sdio_is_initfunction wilc_sdio_enable_interruptfunction wilc_sdio_disable_interruptfunction wilc_sdio_set_func0_csa_addressfunction wilc_sdio_set_block_sizefunction wilc_sdio_write_regfunction wilc_sdio_writefunction wilc_sdio_read_regfunction wilc_sdio_readfunction wilc_sdio_deinitfunction wilc_sdio_initfunction wilc_sdio_read_sizefunction wilc_sdio_read_intfunction wilc_sdio_clear_int_extfunction wilc_sdio_sync_extfunction wilc_sdio_suspendfunction wilc_sdio_resume
Annotated Snippet
struct wilc_sdio {
bool irq_gpio;
u32 block_size;
bool isinit;
u8 *cmd53_buf;
};
struct sdio_cmd52 {
u32 read_write: 1;
u32 function: 3;
u32 raw: 1;
u32 address: 17;
u32 data: 8;
};
struct sdio_cmd53 {
u32 read_write: 1;
u32 function: 3;
u32 block_mode: 1;
u32 increment: 1;
u32 address: 17;
u32 count: 9;
u8 *buffer;
u32 block_size;
bool use_global_buf;
};
static const struct wilc_hif_func wilc_hif_sdio;
static void wilc_sdio_interrupt(struct sdio_func *func)
{
sdio_release_host(func);
wilc_handle_isr(sdio_get_drvdata(func));
sdio_claim_host(func);
}
static int wilc_sdio_cmd52(struct wilc *wilc, struct sdio_cmd52 *cmd)
{
struct sdio_func *func = container_of(wilc->dev, struct sdio_func, dev);
int ret;
u8 data;
sdio_claim_host(func);
func->num = cmd->function;
if (cmd->read_write) { /* write */
if (cmd->raw) {
sdio_writeb(func, cmd->data, cmd->address, &ret);
data = sdio_readb(func, cmd->address, &ret);
cmd->data = data;
} else {
sdio_writeb(func, cmd->data, cmd->address, &ret);
}
} else { /* read */
data = sdio_readb(func, cmd->address, &ret);
cmd->data = data;
}
sdio_release_host(func);
if (ret)
dev_err(&func->dev, "%s..failed, err(%d)\n", __func__, ret);
return ret;
}
static int wilc_sdio_cmd53(struct wilc *wilc, struct sdio_cmd53 *cmd)
{
struct sdio_func *func = container_of(wilc->dev, struct sdio_func, dev);
int size, ret;
struct wilc_sdio *sdio_priv = wilc->bus_data;
u8 *buf = cmd->buffer;
sdio_claim_host(func);
func->num = cmd->function;
func->cur_blksize = cmd->block_size;
if (cmd->block_mode)
size = cmd->count * cmd->block_size;
else
size = cmd->count;
if (cmd->use_global_buf) {
if (size > sizeof(u32)) {
ret = -EINVAL;
goto out;
}
buf = sdio_priv->cmd53_buf;
}
if (cmd->read_write) { /* write */
Annotation
- Immediate include surface: `linux/clk.h`, `linux/mmc/sdio_func.h`, `linux/mmc/sdio_ids.h`, `linux/mmc/host.h`, `linux/mmc/sdio.h`, `linux/of_irq.h`, `netdev.h`, `cfg80211.h`.
- Detected declarations: `struct wilc_sdio`, `struct sdio_cmd52`, `struct sdio_cmd53`, `function wilc_sdio_interrupt`, `function wilc_sdio_cmd52`, `function wilc_sdio_cmd53`, `function wilc_sdio_probe`, `function wilc_sdio_remove`, `function wilc_sdio_reset`, `function wilc_sdio_is_init`.
- 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.