drivers/staging/rtl8723bs/hal/sdio_ops.c
Source file repositories/reference/linux-study-clean/drivers/staging/rtl8723bs/hal/sdio_ops.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/rtl8723bs/hal/sdio_ops.c- Extension
.c- Size
- 21749 bytes
- Lines
- 1004
- Domain
- Driver Families
- Bucket
- drivers/staging
- 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
drv_types.hrtl8723b_hal.h
Detected Declarations
function Copyrightfunction get_deviceidfunction _cvrt2ftaddrfunction sdio_read8function sdio_read16function sdio_read32function sdio_readNfunction sdio_write8function sdio_write16function sdio_write32function sdio_writeNfunction sdio_read_memfunction sdio_write_memfunction sdio_read_portfunction sdio_write_portfunction sdio_set_intf_opsfunction _sdio_local_readfunction sdio_local_readfunction sdio_local_writefunction SdioLocalCmd52Read1Bytefunction sdio_local_cmd52_read2bytefunction sdio_local_cmd53_read4bytefunction SdioLocalCmd52Write1Bytefunction sdio_local_cmd52_write4bytefunction read_interrupt_8723b_sdiofunction InitInterrupt8723BSdiofunction InitSysInterrupt8723BSdiofunction EnableInterrupt8723BSdiofunction DisableInterrupt8723BSdiofunction CheckIPSStatusfunction sd_rxhandlerfunction sd_int_dpcfunction sd_int_hdlfunction HalQueryTxBufferStatus8723BSdiofunction HalQueryTxOQTBufferStatus8723BSdio
Annotated Snippet
if (err) {
kfree(tmpbuf);
return err;
}
memcpy(tmpbuf + shift, buf, cnt);
err = sd_write(intfhdl, ftaddr, n, tmpbuf);
kfree(tmpbuf);
}
return err;
}
static void sdio_read_mem(
struct intf_hdl *intfhdl,
u32 addr,
u32 cnt,
u8 *rmem
)
{
sdio_readN(intfhdl, addr, cnt, rmem);
}
static void sdio_write_mem(
struct intf_hdl *intfhdl,
u32 addr,
u32 cnt,
u8 *wmem
)
{
sdio_writeN(intfhdl, addr, cnt, wmem);
}
/*
* Description:
*Read from RX FIFO
*Round read size to block size,
*and make sure data transfer will be done in one command.
*
* Parameters:
*intfhdl a pointer of intf_hdl
*addr port ID
*cnt size to read
*rmem address to put data
*
* Return:
*_SUCCESS(1) Success
*_FAIL(0) Fail
*/
static u32 sdio_read_port(
struct intf_hdl *intfhdl,
u32 addr,
u32 cnt,
u8 *mem
)
{
struct adapter *adapter;
struct sdio_data *psdio;
struct hal_com_data *hal;
s32 err;
adapter = intfhdl->padapter;
psdio = &adapter_to_dvobj(adapter)->intf_data;
hal = GET_HAL_DATA(adapter);
hal_sdio_get_cmd_addr_8723b(adapter, addr, hal->SdioRxFIFOCnt++, &addr);
if (cnt > psdio->block_transfer_len)
cnt = _RND(cnt, psdio->block_transfer_len);
err = _sd_read(intfhdl, addr, cnt, mem);
if (err)
return _FAIL;
return _SUCCESS;
}
/*
* Description:
*Write to TX FIFO
*Align write size block size,
*and make sure data could be written in one command.
*
* Parameters:
*intfhdl a pointer of intf_hdl
*addr port ID
*cnt size to write
*wmem data pointer to write
*
* Return:
*_SUCCESS(1) Success
*_FAIL(0) Fail
Annotation
- Immediate include surface: `drv_types.h`, `rtl8723b_hal.h`.
- Detected declarations: `function Copyright`, `function get_deviceid`, `function _cvrt2ftaddr`, `function sdio_read8`, `function sdio_read16`, `function sdio_read32`, `function sdio_readN`, `function sdio_write8`, `function sdio_write16`, `function sdio_write32`.
- Atlas domain: Driver Families / drivers/staging.
- 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.