drivers/net/wireless/rsi/rsi_91x_sdio_ops.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/rsi/rsi_91x_sdio_ops.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/rsi/rsi_91x_sdio_ops.c- Extension
.c- Size
- 10321 bytes
- Lines
- 416
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/firmware.hnet/rsi_91x.hrsi_sdio.hrsi_common.h
Detected Declarations
function Copyrightfunction rsi_sdio_rx_threadfunction rsi_process_pktfunction rsi_init_sdio_slave_regsfunction rsi_rx_handlerfunction rsi_sdio_check_buffer_statusfunction rsi_sdio_determine_event_timeout
Annotated Snippet
if (status) {
rsi_dbg(ERR_ZONE,
"%s: Failed to read pkt length from the card:\n",
__func__);
return status;
}
num_blks = value & 0x1f;
}
if (dev->write_fail == 2)
rsi_sdio_ack_intr(common->priv, (1 << MSDU_PKT_PENDING));
if (unlikely(!num_blks)) {
dev->write_fail = 2;
return -1;
}
rcv_pkt_len = (num_blks * 256);
status = rsi_sdio_host_intf_read_pkt(adapter, dev->pktbuffer,
rcv_pkt_len);
if (status) {
rsi_dbg(ERR_ZONE, "%s: Failed to read packet from card\n",
__func__);
return status;
}
status = rsi_read_pkt(common, dev->pktbuffer, rcv_pkt_len);
if (status) {
rsi_dbg(ERR_ZONE, "Failed to read the packet\n");
return status;
}
return 0;
}
/**
* rsi_init_sdio_slave_regs() - This function does the actual initialization
* of SDBUS slave registers.
* @adapter: Pointer to the adapter structure.
*
* Return: status: 0 on success, -1 on failure.
*/
int rsi_init_sdio_slave_regs(struct rsi_hw *adapter)
{
struct rsi_91x_sdiodev *dev = adapter->rsi_dev;
u8 function = 0;
u8 byte;
int status = 0;
if (dev->next_read_delay) {
byte = dev->next_read_delay;
status = rsi_sdio_write_register(adapter,
function,
SDIO_NXT_RD_DELAY2,
&byte);
if (status) {
rsi_dbg(ERR_ZONE,
"%s: Failed to write SDIO_NXT_RD_DELAY2\n",
__func__);
return -1;
}
}
if (dev->sdio_high_speed_enable) {
rsi_dbg(INIT_ZONE, "%s: Enabling SDIO High speed\n", __func__);
byte = 0x3;
status = rsi_sdio_write_register(adapter,
function,
SDIO_REG_HIGH_SPEED,
&byte);
if (status) {
rsi_dbg(ERR_ZONE,
"%s: Failed to enable SDIO high speed\n",
__func__);
return -1;
}
}
/* This tells SDIO FIFO when to start read to host */
rsi_dbg(INIT_ZONE, "%s: Initializing SDIO read start level\n", __func__);
byte = 0x24;
status = rsi_sdio_write_register(adapter,
function,
SDIO_READ_START_LVL,
&byte);
if (status) {
rsi_dbg(ERR_ZONE,
Annotation
- Immediate include surface: `linux/firmware.h`, `net/rsi_91x.h`, `rsi_sdio.h`, `rsi_common.h`.
- Detected declarations: `function Copyright`, `function rsi_sdio_rx_thread`, `function rsi_process_pkt`, `function rsi_init_sdio_slave_regs`, `function rsi_rx_handler`, `function rsi_sdio_check_buffer_status`, `function rsi_sdio_determine_event_timeout`.
- 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.