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
28
29
30
31
32
33 #ifndef __STORAGE_COMMON__
34 #define __STORAGE_COMMON__
35
36
37
38
39
40 #define SCSI_MAX_NUM_OF_CMDQS (NUM_OF_GLOBAL_QUEUES / 2)
41 #define BDQ_NUM_RESOURCES (4)
42
43 #define BDQ_ID_RQ (0)
44 #define BDQ_ID_IMM_DATA (1)
45 #define BDQ_ID_TQ (2)
46 #define BDQ_NUM_IDS (3)
47
48 #define SCSI_NUM_SGES_SLOW_SGL_THR 8
49
50 #define BDQ_MAX_EXTERNAL_RING_SIZE BIT(15)
51
52
53 #define SCSI_OPCODE_COMPARE_AND_WRITE (0x89)
54 #define SCSI_OPCODE_READ_10 (0x28)
55 #define SCSI_OPCODE_WRITE_6 (0x0A)
56 #define SCSI_OPCODE_WRITE_10 (0x2A)
57 #define SCSI_OPCODE_WRITE_12 (0xAA)
58 #define SCSI_OPCODE_WRITE_16 (0x8A)
59 #define SCSI_OPCODE_WRITE_AND_VERIFY_10 (0x2E)
60 #define SCSI_OPCODE_WRITE_AND_VERIFY_12 (0xAE)
61 #define SCSI_OPCODE_WRITE_AND_VERIFY_16 (0x8E)
62
63
64 struct iscsi_drv_opaque {
65 __le16 reserved_zero[3];
66 __le16 opaque;
67 };
68
69
70 union scsi_opaque {
71 struct regpair fcoe_opaque;
72 struct iscsi_drv_opaque iscsi_opaque;
73 };
74
75
76 struct scsi_bd {
77 struct regpair address;
78 union scsi_opaque opaque;
79 };
80
81
82 struct scsi_bdq_ram_drv_data {
83 __le16 external_producer;
84 __le16 reserved0[3];
85 };
86
87
88 struct scsi_sge {
89 struct regpair sge_addr;
90 __le32 sge_len;
91 __le32 reserved;
92 };
93
94
95 struct scsi_cached_sges {
96 struct scsi_sge sge[4];
97 };
98
99
100 struct scsi_drv_cmdq {
101 __le16 cmdq_cons;
102 __le16 reserved0;
103 __le32 reserved1;
104 };
105
106
107 struct scsi_init_func_params {
108 __le16 num_tasks;
109 u8 log_page_size;
110 u8 debug_mode;
111 u8 reserved2[12];
112 };
113
114
115 struct scsi_init_func_queues {
116 struct regpair glbl_q_params_addr;
117 __le16 rq_buffer_size;
118 __le16 cq_num_entries;
119 __le16 cmdq_num_entries;
120 u8 bdq_resource_id;
121 u8 q_validity;
122 #define SCSI_INIT_FUNC_QUEUES_RQ_VALID_MASK 0x1
123 #define SCSI_INIT_FUNC_QUEUES_RQ_VALID_SHIFT 0
124 #define SCSI_INIT_FUNC_QUEUES_IMM_DATA_VALID_MASK 0x1
125 #define SCSI_INIT_FUNC_QUEUES_IMM_DATA_VALID_SHIFT 1
126 #define SCSI_INIT_FUNC_QUEUES_CMD_VALID_MASK 0x1
127 #define SCSI_INIT_FUNC_QUEUES_CMD_VALID_SHIFT 2
128 #define SCSI_INIT_FUNC_QUEUES_TQ_VALID_MASK 0x1
129 #define SCSI_INIT_FUNC_QUEUES_TQ_VALID_SHIFT 3
130 #define SCSI_INIT_FUNC_QUEUES_SOC_EN_MASK 0x1
131 #define SCSI_INIT_FUNC_QUEUES_SOC_EN_SHIFT 4
132 #define SCSI_INIT_FUNC_QUEUES_SOC_NUM_OF_BLOCKS_LOG_MASK 0x7
133 #define SCSI_INIT_FUNC_QUEUES_SOC_NUM_OF_BLOCKS_LOG_SHIFT 5
134 __le16 cq_cmdq_sb_num_arr[SCSI_MAX_NUM_OF_CMDQS];
135 u8 num_queues;
136 u8 queue_relative_offset;
137 u8 cq_sb_pi;
138 u8 cmdq_sb_pi;
139 u8 bdq_pbl_num_entries[BDQ_NUM_IDS];
140 u8 reserved1;
141 struct regpair bdq_pbl_base_address[BDQ_NUM_IDS];
142 __le16 bdq_xoff_threshold[BDQ_NUM_IDS];
143 __le16 cmdq_xoff_threshold;
144 __le16 bdq_xon_threshold[BDQ_NUM_IDS];
145 __le16 cmdq_xon_threshold;
146 };
147
148
149 struct scsi_ram_per_bdq_resource_drv_data {
150 struct scsi_bdq_ram_drv_data drv_data_per_bdq_id[BDQ_NUM_IDS];
151 };
152
153
154 enum scsi_sgl_mode {
155 SCSI_TX_SLOW_SGL,
156 SCSI_FAST_SGL,
157 MAX_SCSI_SGL_MODE
158 };
159
160
161 struct scsi_sgl_params {
162 struct regpair sgl_addr;
163 __le32 sgl_total_length;
164 __le32 sge_offset;
165 __le16 sgl_num_sges;
166 u8 sgl_index;
167 u8 reserved;
168 };
169
170
171 struct scsi_terminate_extra_params {
172 __le16 unsolicited_cq_count;
173 __le16 cmdq_count;
174 u8 reserved[4];
175 };
176
177
178 struct scsi_tqe {
179 __le16 itid;
180 };
181
182 #endif