diff options
Diffstat (limited to 'drivers/scsi/hpsa_cmd.h')
-rw-r--r-- | drivers/scsi/hpsa_cmd.h | 204 |
1 files changed, 126 insertions, 78 deletions
diff --git a/drivers/scsi/hpsa_cmd.h b/drivers/scsi/hpsa_cmd.h index 12d71387ed9a..3e0abdf76689 100644 --- a/drivers/scsi/hpsa_cmd.h +++ b/drivers/scsi/hpsa_cmd.h | |||
@@ -101,19 +101,20 @@ | |||
101 | #define CFGTBL_AccCmds 0x00000001l | 101 | #define CFGTBL_AccCmds 0x00000001l |
102 | 102 | ||
103 | #define CFGTBL_Trans_Simple 0x00000002l | 103 | #define CFGTBL_Trans_Simple 0x00000002l |
104 | #define CFGTBL_Trans_Performant 0x00000004l | ||
104 | 105 | ||
105 | #define CFGTBL_BusType_Ultra2 0x00000001l | 106 | #define CFGTBL_BusType_Ultra2 0x00000001l |
106 | #define CFGTBL_BusType_Ultra3 0x00000002l | 107 | #define CFGTBL_BusType_Ultra3 0x00000002l |
107 | #define CFGTBL_BusType_Fibre1G 0x00000100l | 108 | #define CFGTBL_BusType_Fibre1G 0x00000100l |
108 | #define CFGTBL_BusType_Fibre2G 0x00000200l | 109 | #define CFGTBL_BusType_Fibre2G 0x00000200l |
109 | struct vals32 { | 110 | struct vals32 { |
110 | __u32 lower; | 111 | u32 lower; |
111 | __u32 upper; | 112 | u32 upper; |
112 | }; | 113 | }; |
113 | 114 | ||
114 | union u64bit { | 115 | union u64bit { |
115 | struct vals32 val32; | 116 | struct vals32 val32; |
116 | __u64 val; | 117 | u64 val; |
117 | }; | 118 | }; |
118 | 119 | ||
119 | /* FIXME this is a per controller value (barf!) */ | 120 | /* FIXME this is a per controller value (barf!) */ |
@@ -126,34 +127,34 @@ union u64bit { | |||
126 | 127 | ||
127 | #define HPSA_INQUIRY 0x12 | 128 | #define HPSA_INQUIRY 0x12 |
128 | struct InquiryData { | 129 | struct InquiryData { |
129 | __u8 data_byte[36]; | 130 | u8 data_byte[36]; |
130 | }; | 131 | }; |
131 | 132 | ||
132 | #define HPSA_REPORT_LOG 0xc2 /* Report Logical LUNs */ | 133 | #define HPSA_REPORT_LOG 0xc2 /* Report Logical LUNs */ |
133 | #define HPSA_REPORT_PHYS 0xc3 /* Report Physical LUNs */ | 134 | #define HPSA_REPORT_PHYS 0xc3 /* Report Physical LUNs */ |
134 | struct ReportLUNdata { | 135 | struct ReportLUNdata { |
135 | __u8 LUNListLength[4]; | 136 | u8 LUNListLength[4]; |
136 | __u32 reserved; | 137 | u32 reserved; |
137 | __u8 LUN[HPSA_MAX_LUN][8]; | 138 | u8 LUN[HPSA_MAX_LUN][8]; |
138 | }; | 139 | }; |
139 | 140 | ||
140 | struct ReportExtendedLUNdata { | 141 | struct ReportExtendedLUNdata { |
141 | __u8 LUNListLength[4]; | 142 | u8 LUNListLength[4]; |
142 | __u8 extended_response_flag; | 143 | u8 extended_response_flag; |
143 | __u8 reserved[3]; | 144 | u8 reserved[3]; |
144 | __u8 LUN[HPSA_MAX_LUN][24]; | 145 | u8 LUN[HPSA_MAX_LUN][24]; |
145 | }; | 146 | }; |
146 | 147 | ||
147 | struct SenseSubsystem_info { | 148 | struct SenseSubsystem_info { |
148 | __u8 reserved[36]; | 149 | u8 reserved[36]; |
149 | __u8 portname[8]; | 150 | u8 portname[8]; |
150 | __u8 reserved1[1108]; | 151 | u8 reserved1[1108]; |
151 | }; | 152 | }; |
152 | 153 | ||
153 | #define HPSA_READ_CAPACITY 0x25 /* Read Capacity */ | 154 | #define HPSA_READ_CAPACITY 0x25 /* Read Capacity */ |
154 | struct ReadCapdata { | 155 | struct ReadCapdata { |
155 | __u8 total_size[4]; /* Total size in blocks */ | 156 | u8 total_size[4]; /* Total size in blocks */ |
156 | __u8 block_size[4]; /* Size of blocks in bytes */ | 157 | u8 block_size[4]; /* Size of blocks in bytes */ |
157 | }; | 158 | }; |
158 | 159 | ||
159 | #if 0 | 160 | #if 0 |
@@ -174,112 +175,131 @@ struct ReadCapdata { | |||
174 | /* Command List Structure */ | 175 | /* Command List Structure */ |
175 | union SCSI3Addr { | 176 | union SCSI3Addr { |
176 | struct { | 177 | struct { |
177 | __u8 Dev; | 178 | u8 Dev; |
178 | __u8 Bus:6; | 179 | u8 Bus:6; |
179 | __u8 Mode:2; /* b00 */ | 180 | u8 Mode:2; /* b00 */ |
180 | } PeripDev; | 181 | } PeripDev; |
181 | struct { | 182 | struct { |
182 | __u8 DevLSB; | 183 | u8 DevLSB; |
183 | __u8 DevMSB:6; | 184 | u8 DevMSB:6; |
184 | __u8 Mode:2; /* b01 */ | 185 | u8 Mode:2; /* b01 */ |
185 | } LogDev; | 186 | } LogDev; |
186 | struct { | 187 | struct { |
187 | __u8 Dev:5; | 188 | u8 Dev:5; |
188 | __u8 Bus:3; | 189 | u8 Bus:3; |
189 | __u8 Targ:6; | 190 | u8 Targ:6; |
190 | __u8 Mode:2; /* b10 */ | 191 | u8 Mode:2; /* b10 */ |
191 | } LogUnit; | 192 | } LogUnit; |
192 | }; | 193 | }; |
193 | 194 | ||
194 | struct PhysDevAddr { | 195 | struct PhysDevAddr { |
195 | __u32 TargetId:24; | 196 | u32 TargetId:24; |
196 | __u32 Bus:6; | 197 | u32 Bus:6; |
197 | __u32 Mode:2; | 198 | u32 Mode:2; |
198 | /* 2 level target device addr */ | 199 | /* 2 level target device addr */ |
199 | union SCSI3Addr Target[2]; | 200 | union SCSI3Addr Target[2]; |
200 | }; | 201 | }; |
201 | 202 | ||
202 | struct LogDevAddr { | 203 | struct LogDevAddr { |
203 | __u32 VolId:30; | 204 | u32 VolId:30; |
204 | __u32 Mode:2; | 205 | u32 Mode:2; |
205 | __u8 reserved[4]; | 206 | u8 reserved[4]; |
206 | }; | 207 | }; |
207 | 208 | ||
208 | union LUNAddr { | 209 | union LUNAddr { |
209 | __u8 LunAddrBytes[8]; | 210 | u8 LunAddrBytes[8]; |
210 | union SCSI3Addr SCSI3Lun[4]; | 211 | union SCSI3Addr SCSI3Lun[4]; |
211 | struct PhysDevAddr PhysDev; | 212 | struct PhysDevAddr PhysDev; |
212 | struct LogDevAddr LogDev; | 213 | struct LogDevAddr LogDev; |
213 | }; | 214 | }; |
214 | 215 | ||
215 | struct CommandListHeader { | 216 | struct CommandListHeader { |
216 | __u8 ReplyQueue; | 217 | u8 ReplyQueue; |
217 | __u8 SGList; | 218 | u8 SGList; |
218 | __u16 SGTotal; | 219 | u16 SGTotal; |
219 | struct vals32 Tag; | 220 | struct vals32 Tag; |
220 | union LUNAddr LUN; | 221 | union LUNAddr LUN; |
221 | }; | 222 | }; |
222 | 223 | ||
223 | struct RequestBlock { | 224 | struct RequestBlock { |
224 | __u8 CDBLen; | 225 | u8 CDBLen; |
225 | struct { | 226 | struct { |
226 | __u8 Type:3; | 227 | u8 Type:3; |
227 | __u8 Attribute:3; | 228 | u8 Attribute:3; |
228 | __u8 Direction:2; | 229 | u8 Direction:2; |
229 | } Type; | 230 | } Type; |
230 | __u16 Timeout; | 231 | u16 Timeout; |
231 | __u8 CDB[16]; | 232 | u8 CDB[16]; |
232 | }; | 233 | }; |
233 | 234 | ||
234 | struct ErrDescriptor { | 235 | struct ErrDescriptor { |
235 | struct vals32 Addr; | 236 | struct vals32 Addr; |
236 | __u32 Len; | 237 | u32 Len; |
237 | }; | 238 | }; |
238 | 239 | ||
239 | struct SGDescriptor { | 240 | struct SGDescriptor { |
240 | struct vals32 Addr; | 241 | struct vals32 Addr; |
241 | __u32 Len; | 242 | u32 Len; |
242 | __u32 Ext; | 243 | u32 Ext; |
243 | }; | 244 | }; |
244 | 245 | ||
245 | union MoreErrInfo { | 246 | union MoreErrInfo { |
246 | struct { | 247 | struct { |
247 | __u8 Reserved[3]; | 248 | u8 Reserved[3]; |
248 | __u8 Type; | 249 | u8 Type; |
249 | __u32 ErrorInfo; | 250 | u32 ErrorInfo; |
250 | } Common_Info; | 251 | } Common_Info; |
251 | struct { | 252 | struct { |
252 | __u8 Reserved[2]; | 253 | u8 Reserved[2]; |
253 | __u8 offense_size; /* size of offending entry */ | 254 | u8 offense_size; /* size of offending entry */ |
254 | __u8 offense_num; /* byte # of offense 0-base */ | 255 | u8 offense_num; /* byte # of offense 0-base */ |
255 | __u32 offense_value; | 256 | u32 offense_value; |
256 | } Invalid_Cmd; | 257 | } Invalid_Cmd; |
257 | }; | 258 | }; |
258 | struct ErrorInfo { | 259 | struct ErrorInfo { |
259 | __u8 ScsiStatus; | 260 | u8 ScsiStatus; |
260 | __u8 SenseLen; | 261 | u8 SenseLen; |
261 | __u16 CommandStatus; | 262 | u16 CommandStatus; |
262 | __u32 ResidualCnt; | 263 | u32 ResidualCnt; |
263 | union MoreErrInfo MoreErrInfo; | 264 | union MoreErrInfo MoreErrInfo; |
264 | __u8 SenseInfo[SENSEINFOBYTES]; | 265 | u8 SenseInfo[SENSEINFOBYTES]; |
265 | }; | 266 | }; |
266 | /* Command types */ | 267 | /* Command types */ |
267 | #define CMD_IOCTL_PEND 0x01 | 268 | #define CMD_IOCTL_PEND 0x01 |
268 | #define CMD_SCSI 0x03 | 269 | #define CMD_SCSI 0x03 |
269 | 270 | ||
271 | /* This structure needs to be divisible by 32 for new | ||
272 | * indexing method and performant mode. | ||
273 | */ | ||
274 | #define PAD32 32 | ||
275 | #define PAD64DIFF 0 | ||
276 | #define USEEXTRA ((sizeof(void *) - 4)/4) | ||
277 | #define PADSIZE (PAD32 + PAD64DIFF * USEEXTRA) | ||
278 | |||
279 | #define DIRECT_LOOKUP_SHIFT 5 | ||
280 | #define DIRECT_LOOKUP_BIT 0x10 | ||
281 | |||
282 | #define HPSA_ERROR_BIT 0x02 | ||
270 | struct ctlr_info; /* defined in hpsa.h */ | 283 | struct ctlr_info; /* defined in hpsa.h */ |
271 | /* The size of this structure needs to be divisible by 8 | 284 | /* The size of this structure needs to be divisible by 32 |
272 | * od on all architectures, because the controller uses 2 | 285 | * on all architectures because low 5 bits of the addresses |
273 | * lower bits of the address, and the driver uses 1 lower | 286 | * are used as follows: |
274 | * bit (3 bits total.) | 287 | * |
288 | * bit 0: to device, used to indicate "performant mode" command | ||
289 | * from device, indidcates error status. | ||
290 | * bit 1-3: to device, indicates block fetch table entry for | ||
291 | * reducing DMA in fetching commands from host memory. | ||
292 | * bit 4: used to indicate whether tag is "direct lookup" (index), | ||
293 | * or a bus address. | ||
275 | */ | 294 | */ |
295 | |||
276 | struct CommandList { | 296 | struct CommandList { |
277 | struct CommandListHeader Header; | 297 | struct CommandListHeader Header; |
278 | struct RequestBlock Request; | 298 | struct RequestBlock Request; |
279 | struct ErrDescriptor ErrDesc; | 299 | struct ErrDescriptor ErrDesc; |
280 | struct SGDescriptor SG[MAXSGENTRIES]; | 300 | struct SGDescriptor SG[MAXSGENTRIES]; |
281 | /* information associated with the command */ | 301 | /* information associated with the command */ |
282 | __u32 busaddr; /* physical addr of this record */ | 302 | u32 busaddr; /* physical addr of this record */ |
283 | struct ErrorInfo *err_info; /* pointer to the allocated mem */ | 303 | struct ErrorInfo *err_info; /* pointer to the allocated mem */ |
284 | struct ctlr_info *h; | 304 | struct ctlr_info *h; |
285 | int cmd_type; | 305 | int cmd_type; |
@@ -291,35 +311,63 @@ struct CommandList { | |||
291 | struct completion *waiting; | 311 | struct completion *waiting; |
292 | int retry_count; | 312 | int retry_count; |
293 | void *scsi_cmd; | 313 | void *scsi_cmd; |
314 | |||
315 | /* on 64 bit architectures, to get this to be 32-byte-aligned | ||
316 | * it so happens we need no padding, on 32 bit systems, | ||
317 | * we need 8 bytes of padding. This does that. | ||
318 | */ | ||
319 | #define COMMANDLIST_PAD ((8 - sizeof(long))/4 * 8) | ||
320 | u8 pad[COMMANDLIST_PAD]; | ||
321 | |||
294 | }; | 322 | }; |
295 | 323 | ||
296 | /* Configuration Table Structure */ | 324 | /* Configuration Table Structure */ |
297 | struct HostWrite { | 325 | struct HostWrite { |
298 | __u32 TransportRequest; | 326 | u32 TransportRequest; |
299 | __u32 Reserved; | 327 | u32 Reserved; |
300 | __u32 CoalIntDelay; | 328 | u32 CoalIntDelay; |
301 | __u32 CoalIntCount; | 329 | u32 CoalIntCount; |
302 | }; | 330 | }; |
303 | 331 | ||
332 | #define SIMPLE_MODE 0x02 | ||
333 | #define PERFORMANT_MODE 0x04 | ||
334 | #define MEMQ_MODE 0x08 | ||
335 | |||
304 | struct CfgTable { | 336 | struct CfgTable { |
305 | __u8 Signature[4]; | 337 | u8 Signature[4]; |
306 | __u32 SpecValence; | 338 | u32 SpecValence; |
307 | __u32 TransportSupport; | 339 | u32 TransportSupport; |
308 | __u32 TransportActive; | 340 | u32 TransportActive; |
309 | struct HostWrite HostWrite; | 341 | struct HostWrite HostWrite; |
310 | __u32 CmdsOutMax; | 342 | u32 CmdsOutMax; |
311 | __u32 BusTypes; | 343 | u32 BusTypes; |
312 | __u32 Reserved; | 344 | u32 TransMethodOffset; |
313 | __u8 ServerName[16]; | 345 | u8 ServerName[16]; |
314 | __u32 HeartBeat; | 346 | u32 HeartBeat; |
315 | __u32 SCSI_Prefetch; | 347 | u32 SCSI_Prefetch; |
348 | u32 MaxScatterGatherElements; | ||
349 | u32 MaxLogicalUnits; | ||
350 | u32 MaxPhysicalDevices; | ||
351 | u32 MaxPhysicalDrivesPerLogicalUnit; | ||
352 | u32 MaxPerformantModeCommands; | ||
353 | }; | ||
354 | |||
355 | #define NUM_BLOCKFETCH_ENTRIES 8 | ||
356 | struct TransTable_struct { | ||
357 | u32 BlockFetch[NUM_BLOCKFETCH_ENTRIES]; | ||
358 | u32 RepQSize; | ||
359 | u32 RepQCount; | ||
360 | u32 RepQCtrAddrLow32; | ||
361 | u32 RepQCtrAddrHigh32; | ||
362 | u32 RepQAddr0Low32; | ||
363 | u32 RepQAddr0High32; | ||
316 | }; | 364 | }; |
317 | 365 | ||
318 | struct hpsa_pci_info { | 366 | struct hpsa_pci_info { |
319 | unsigned char bus; | 367 | unsigned char bus; |
320 | unsigned char dev_fn; | 368 | unsigned char dev_fn; |
321 | unsigned short domain; | 369 | unsigned short domain; |
322 | __u32 board_id; | 370 | u32 board_id; |
323 | }; | 371 | }; |
324 | 372 | ||
325 | #pragma pack() | 373 | #pragma pack() |