1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24#ifndef __REALTEK_RTSX_TRANSPORT_H
25#define __REALTEK_RTSX_TRANSPORT_H
26
27#include "rtsx.h"
28#include "rtsx_chip.h"
29
30#define WAIT_TIME 2000
31
32unsigned int rtsx_stor_access_xfer_buf(unsigned char *buffer,
33 unsigned int buflen,
34 struct scsi_cmnd *srb,
35 unsigned int *index,
36 unsigned int *offset,
37 enum xfer_buf_dir dir);
38void rtsx_stor_set_xfer_buf(unsigned char *buffer, unsigned int buflen,
39 struct scsi_cmnd *srb);
40void rtsx_stor_get_xfer_buf(unsigned char *buffer, unsigned int buflen,
41 struct scsi_cmnd *srb);
42void rtsx_invoke_transport(struct scsi_cmnd *srb, struct rtsx_chip *chip);
43
44#define rtsx_init_cmd(chip) ((chip)->ci = 0)
45
46void rtsx_add_cmd(struct rtsx_chip *chip, u8 cmd_type, u16 reg_addr, u8 mask,
47 u8 data);
48void rtsx_send_cmd_no_wait(struct rtsx_chip *chip);
49int rtsx_send_cmd(struct rtsx_chip *chip, u8 card, int timeout);
50
51static inline u8 *rtsx_get_cmd_data(struct rtsx_chip *chip)
52{
53#ifdef CMD_USING_SG
54 return (u8 *)(chip->host_sg_tbl_ptr);
55#else
56 return (u8 *)(chip->host_cmds_ptr);
57#endif
58}
59
60int rtsx_transfer_data(struct rtsx_chip *chip, u8 card, void *buf, size_t len,
61 int use_sg, enum dma_data_direction dma_dir,
62 int timeout);
63
64int rtsx_transfer_data_partial(struct rtsx_chip *chip, u8 card, void *buf,
65 size_t len, int use_sg, unsigned int *index,
66 unsigned int *offset,
67 enum dma_data_direction dma_dir, int timeout);
68
69#endif
70