include/linux/rtsx_usb.h
Source file repositories/reference/linux-study-clean/include/linux/rtsx_usb.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/rtsx_usb.h- Extension
.h- Size
- 16109 bytes
- Lines
- 631
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/usb.h
Detected Declarations
struct rtsx_ucrfunction rtsx_usb_init_cmdfunction rtsx_usb_turn_on_ledfunction rtsx_usb_turn_off_ledfunction rtsx_usb_clear_fsm_errfunction rtsx_usb_clear_dma_err
Annotated Snippet
struct rtsx_ucr {
u16 vendor_id;
u16 product_id;
int package;
u8 ic_version;
bool is_rts5179;
unsigned int cur_clk;
u8 *cmd_buf;
unsigned int cmd_idx;
u8 *rsp_buf;
struct usb_device *pusb_dev;
struct usb_interface *pusb_intf;
struct usb_sg_request current_sg;
struct timer_list sg_timer;
struct mutex dev_mutex;
};
/* buffer size */
#define IOBUF_SIZE 1024
/* prototypes of exported functions */
extern int rtsx_usb_get_card_status(struct rtsx_ucr *ucr, u16 *status);
extern int rtsx_usb_read_register(struct rtsx_ucr *ucr, u16 addr, u8 *data);
extern int rtsx_usb_write_register(struct rtsx_ucr *ucr, u16 addr, u8 mask,
u8 data);
extern int rtsx_usb_ep0_write_register(struct rtsx_ucr *ucr, u16 addr, u8 mask,
u8 data);
extern int rtsx_usb_ep0_read_register(struct rtsx_ucr *ucr, u16 addr,
u8 *data);
extern void rtsx_usb_add_cmd(struct rtsx_ucr *ucr, u8 cmd_type,
u16 reg_addr, u8 mask, u8 data);
extern int rtsx_usb_send_cmd(struct rtsx_ucr *ucr, u8 flag, int timeout);
extern int rtsx_usb_get_rsp(struct rtsx_ucr *ucr, int rsp_len, int timeout);
extern int rtsx_usb_transfer_data(struct rtsx_ucr *ucr, unsigned int pipe,
void *buf, unsigned int len, int use_sg,
unsigned int *act_len, int timeout);
extern int rtsx_usb_read_ppbuf(struct rtsx_ucr *ucr, u8 *buf, int buf_len);
extern int rtsx_usb_write_ppbuf(struct rtsx_ucr *ucr, u8 *buf, int buf_len);
extern int rtsx_usb_switch_clock(struct rtsx_ucr *ucr, unsigned int card_clock,
u8 ssc_depth, bool initial_mode, bool double_clk, bool vpclk);
extern int rtsx_usb_card_exclusive_check(struct rtsx_ucr *ucr, int card);
/* card status */
#define SD_CD 0x01
#define MS_CD 0x02
#define XD_CD 0x04
#define CD_MASK (SD_CD | MS_CD | XD_CD)
#define SD_WP 0x08
/* OCPCTL */
#define MS_OCP_DETECT_EN 0x08
#define MS_OCP_INT_EN 0x04
#define MS_OCP_INT_CLR 0x02
#define MS_OCP_CLEAR 0x01
/* OCPSTAT */
#define MS_OCP_DETECT 0x80
#define MS_OCP_NOW 0x02
#define MS_OCP_EVER 0x01
/* reader command field offset & parameters */
#define READ_REG_CMD 0
#define WRITE_REG_CMD 1
#define CHECK_REG_CMD 2
#define PACKET_TYPE 4
#define CNT_H 5
#define CNT_L 6
#define STAGE_FLAG 7
#define CMD_OFFSET 8
#define SEQ_WRITE_DATA_OFFSET 12
#define BATCH_CMD 0
#define SEQ_READ 1
#define SEQ_WRITE 2
#define STAGE_R 0x01
#define STAGE_DI 0x02
#define STAGE_DO 0x04
#define STAGE_MS_STATUS 0x08
#define STAGE_XD_STATUS 0x10
Annotation
- Immediate include surface: `linux/usb.h`.
- Detected declarations: `struct rtsx_ucr`, `function rtsx_usb_init_cmd`, `function rtsx_usb_turn_on_led`, `function rtsx_usb_turn_off_led`, `function rtsx_usb_clear_fsm_err`, `function rtsx_usb_clear_dma_err`.
- Atlas domain: Core OS / Core Kernel Interface.
- 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.