1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27#ifndef __RTS51X_SCSI_H
28#define __RTS51X_SCSI_H
29
30#include <linux/usb.h>
31#include <linux/usb_usual.h>
32#include <linux/blkdev.h>
33#include <linux/completion.h>
34#include <linux/mutex.h>
35#include <scsi/scsi_host.h>
36
37#include "rts51x_chip.h"
38
39#define MS_SP_CMND 0xFA
40#define MS_FORMAT 0xA0
41#define GET_MS_INFORMATION 0xB0
42
43#define VENDOR_CMND 0xF0
44
45#define READ_STATUS 0x09
46
47#define READ_MEM 0x0D
48#define WRITE_MEM 0x0E
49#define GET_BUS_WIDTH 0x13
50#define GET_SD_CSD 0x14
51#define TOGGLE_GPIO 0x15
52#define TRACE_MSG 0x18
53
54#define SCSI_APP_CMD 0x10
55
56#define PP_READ10 0x1A
57#define PP_WRITE10 0x0A
58#define READ_HOST_REG 0x1D
59#define WRITE_HOST_REG 0x0D
60#define SET_VAR 0x05
61#define GET_VAR 0x15
62#define DMA_READ 0x16
63#define DMA_WRITE 0x06
64#define GET_DEV_STATUS 0x10
65#define SET_CHIP_MODE 0x27
66#define SUIT_CMD 0xE0
67#define WRITE_PHY 0x07
68#define READ_PHY 0x17
69
70#define INIT_BATCHCMD 0x41
71#define ADD_BATCHCMD 0x42
72#define SEND_BATCHCMD 0x43
73#define GET_BATCHRSP 0x44
74
75#ifdef SUPPORT_CPRM
76
77#define SD_PASS_THRU_MODE 0xD0
78#define SD_EXECUTE_NO_DATA 0xD1
79#define SD_EXECUTE_READ 0xD2
80#define SD_EXECUTE_WRITE 0xD3
81#define SD_GET_RSP 0xD4
82#define SD_HW_RST 0xD6
83#endif
84
85#ifdef SUPPORT_MAGIC_GATE
86#define CMD_MSPRO_MG_RKEY 0xA4
87#define CMD_MSPRO_MG_SKEY 0xA3
88
89
90#define KC_MG_R_PRO 0xBE
91
92
93#define KF_SET_LEAF_ID 0x31
94#define KF_GET_LOC_EKB 0x32
95#define KF_CHG_HOST 0x33
96#define KF_RSP_CHG 0x34
97#define KF_RSP_HOST 0x35
98#define KF_GET_ICV 0x36
99#define KF_SET_ICV 0x37
100#endif
101
102struct rts51x_chip;
103
104
105
106
107#define STOP_MEDIUM 0x00
108#define MAKE_MEDIUM_READY 0x01
109#define UNLOAD_MEDIUM 0x02
110#define LOAD_MEDIUM 0x03
111
112
113
114
115#define QULIFIRE 0x00
116#define AENC_FNC 0x00
117#define TRML_IOP 0x00
118#define REL_ADR 0x00
119#define WBUS_32 0x00
120#define WBUS_16 0x00
121#define SYNC 0x00
122#define LINKED 0x00
123#define CMD_QUE 0x00
124#define SFT_RE 0x00
125
126#define VEN_ID_LEN 8
127#define PRDCT_ID_LEN 16
128#define PRDCT_REV_LEN 4
129
130#define DRCT_ACCESS_DEV 0x00
131#define RMB_DISC 0x80
132#define ANSI_SCSI2 0x02
133
134#define SCSI 0x00
135
136void scsi_show_command(struct scsi_cmnd *srb);
137void set_sense_type(struct rts51x_chip *chip, unsigned int lun, int sense_type);
138void set_sense_data(struct rts51x_chip *chip, unsigned int lun, u8 err_code,
139 u8 sense_key, u32 info, u8 asc, u8 ascq, u8 sns_key_info0,
140 u16 sns_key_info1);
141
142int rts51x_scsi_handler(struct scsi_cmnd *srb, struct rts51x_chip *chip);
143
144struct Scsi_Host;
145struct scsi_device;
146struct scsi_cmnd;
147
148const char *host_info(struct Scsi_Host *host);
149int slave_alloc(struct scsi_device *sdev);
150int slave_configure(struct scsi_device *sdev);
151int proc_info(struct Scsi_Host *host, char *buffer,
152 char **start, off_t offset, int length, int inout);
153#if 0
154int queuecommand(struct scsi_cmnd *srb, void (*done) (struct scsi_cmnd *));
155#else
156int queuecommand(struct Scsi_Host *, struct scsi_cmnd *);
157#endif
158int command_abort(struct scsi_cmnd *srb);
159int device_reset(struct scsi_cmnd *srb);
160int bus_reset(struct scsi_cmnd *srb);
161
162#endif
163