diff options
Diffstat (limited to 'drivers/scsi/hpsa_cmd.h')
-rw-r--r-- | drivers/scsi/hpsa_cmd.h | 334 |
1 files changed, 240 insertions, 94 deletions
diff --git a/drivers/scsi/hpsa_cmd.h b/drivers/scsi/hpsa_cmd.h index cb988c41cad9..3a621c74b76f 100644 --- a/drivers/scsi/hpsa_cmd.h +++ b/drivers/scsi/hpsa_cmd.h | |||
@@ -206,27 +206,27 @@ struct raid_map_disk_data { | |||
206 | }; | 206 | }; |
207 | 207 | ||
208 | struct raid_map_data { | 208 | struct raid_map_data { |
209 | u32 structure_size; /* Size of entire structure in bytes */ | 209 | __le32 structure_size; /* Size of entire structure in bytes */ |
210 | u32 volume_blk_size; /* bytes / block in the volume */ | 210 | __le32 volume_blk_size; /* bytes / block in the volume */ |
211 | u64 volume_blk_cnt; /* logical blocks on the volume */ | 211 | __le64 volume_blk_cnt; /* logical blocks on the volume */ |
212 | u8 phys_blk_shift; /* Shift factor to convert between | 212 | u8 phys_blk_shift; /* Shift factor to convert between |
213 | * units of logical blocks and physical | 213 | * units of logical blocks and physical |
214 | * disk blocks */ | 214 | * disk blocks */ |
215 | u8 parity_rotation_shift; /* Shift factor to convert between units | 215 | u8 parity_rotation_shift; /* Shift factor to convert between units |
216 | * of logical stripes and physical | 216 | * of logical stripes and physical |
217 | * stripes */ | 217 | * stripes */ |
218 | u16 strip_size; /* blocks used on each disk / stripe */ | 218 | __le16 strip_size; /* blocks used on each disk / stripe */ |
219 | u64 disk_starting_blk; /* First disk block used in volume */ | 219 | __le64 disk_starting_blk; /* First disk block used in volume */ |
220 | u64 disk_blk_cnt; /* disk blocks used by volume / disk */ | 220 | __le64 disk_blk_cnt; /* disk blocks used by volume / disk */ |
221 | u16 data_disks_per_row; /* data disk entries / row in the map */ | 221 | __le16 data_disks_per_row; /* data disk entries / row in the map */ |
222 | u16 metadata_disks_per_row; /* mirror/parity disk entries / row | 222 | __le16 metadata_disks_per_row;/* mirror/parity disk entries / row |
223 | * in the map */ | 223 | * in the map */ |
224 | u16 row_cnt; /* rows in each layout map */ | 224 | __le16 row_cnt; /* rows in each layout map */ |
225 | u16 layout_map_count; /* layout maps (1 map per mirror/parity | 225 | __le16 layout_map_count; /* layout maps (1 map per mirror/parity |
226 | * group) */ | 226 | * group) */ |
227 | u16 flags; /* Bit 0 set if encryption enabled */ | 227 | __le16 flags; /* Bit 0 set if encryption enabled */ |
228 | #define RAID_MAP_FLAG_ENCRYPT_ON 0x01 | 228 | #define RAID_MAP_FLAG_ENCRYPT_ON 0x01 |
229 | u16 dekindex; /* Data encryption key index. */ | 229 | __le16 dekindex; /* Data encryption key index. */ |
230 | u8 reserved[16]; | 230 | u8 reserved[16]; |
231 | struct raid_map_disk_data data[RAID_MAP_MAX_ENTRIES]; | 231 | struct raid_map_disk_data data[RAID_MAP_MAX_ENTRIES]; |
232 | }; | 232 | }; |
@@ -240,6 +240,10 @@ struct ReportLUNdata { | |||
240 | 240 | ||
241 | struct ext_report_lun_entry { | 241 | struct ext_report_lun_entry { |
242 | u8 lunid[8]; | 242 | u8 lunid[8]; |
243 | #define GET_BMIC_BUS(lunid) ((lunid)[7] & 0x3F) | ||
244 | #define GET_BMIC_LEVEL_TWO_TARGET(lunid) ((lunid)[6]) | ||
245 | #define GET_BMIC_DRIVE_NUMBER(lunid) (((GET_BMIC_BUS((lunid)) - 1) << 8) + \ | ||
246 | GET_BMIC_LEVEL_TWO_TARGET((lunid))) | ||
243 | u8 wwid[8]; | 247 | u8 wwid[8]; |
244 | u8 device_type; | 248 | u8 device_type; |
245 | u8 device_flags; | 249 | u8 device_flags; |
@@ -268,6 +272,7 @@ struct SenseSubsystem_info { | |||
268 | #define HPSA_CACHE_FLUSH 0x01 /* C2 was already being used by HPSA */ | 272 | #define HPSA_CACHE_FLUSH 0x01 /* C2 was already being used by HPSA */ |
269 | #define BMIC_FLASH_FIRMWARE 0xF7 | 273 | #define BMIC_FLASH_FIRMWARE 0xF7 |
270 | #define BMIC_SENSE_CONTROLLER_PARAMETERS 0x64 | 274 | #define BMIC_SENSE_CONTROLLER_PARAMETERS 0x64 |
275 | #define BMIC_IDENTIFY_PHYSICAL_DEVICE 0x15 | ||
271 | 276 | ||
272 | /* Command List Structure */ | 277 | /* Command List Structure */ |
273 | union SCSI3Addr { | 278 | union SCSI3Addr { |
@@ -313,8 +318,8 @@ union LUNAddr { | |||
313 | struct CommandListHeader { | 318 | struct CommandListHeader { |
314 | u8 ReplyQueue; | 319 | u8 ReplyQueue; |
315 | u8 SGList; | 320 | u8 SGList; |
316 | u16 SGTotal; | 321 | __le16 SGTotal; |
317 | u64 tag; | 322 | __le64 tag; |
318 | union LUNAddr LUN; | 323 | union LUNAddr LUN; |
319 | }; | 324 | }; |
320 | 325 | ||
@@ -338,14 +343,14 @@ struct RequestBlock { | |||
338 | }; | 343 | }; |
339 | 344 | ||
340 | struct ErrDescriptor { | 345 | struct ErrDescriptor { |
341 | u64 Addr; | 346 | __le64 Addr; |
342 | u32 Len; | 347 | __le32 Len; |
343 | }; | 348 | }; |
344 | 349 | ||
345 | struct SGDescriptor { | 350 | struct SGDescriptor { |
346 | u64 Addr; | 351 | __le64 Addr; |
347 | u32 Len; | 352 | __le32 Len; |
348 | u32 Ext; | 353 | __le32 Ext; |
349 | }; | 354 | }; |
350 | 355 | ||
351 | union MoreErrInfo { | 356 | union MoreErrInfo { |
@@ -375,22 +380,19 @@ struct ErrorInfo { | |||
375 | #define CMD_IOACCEL1 0x04 | 380 | #define CMD_IOACCEL1 0x04 |
376 | #define CMD_IOACCEL2 0x05 | 381 | #define CMD_IOACCEL2 0x05 |
377 | 382 | ||
378 | #define DIRECT_LOOKUP_SHIFT 5 | 383 | #define DIRECT_LOOKUP_SHIFT 4 |
379 | #define DIRECT_LOOKUP_BIT 0x10 | ||
380 | #define DIRECT_LOOKUP_MASK (~((1 << DIRECT_LOOKUP_SHIFT) - 1)) | 384 | #define DIRECT_LOOKUP_MASK (~((1 << DIRECT_LOOKUP_SHIFT) - 1)) |
381 | 385 | ||
382 | #define HPSA_ERROR_BIT 0x02 | 386 | #define HPSA_ERROR_BIT 0x02 |
383 | struct ctlr_info; /* defined in hpsa.h */ | 387 | struct ctlr_info; /* defined in hpsa.h */ |
384 | /* The size of this structure needs to be divisible by 32 | 388 | /* The size of this structure needs to be divisible by 128 |
385 | * on all architectures because low 5 bits of the addresses | 389 | * on all architectures. The low 4 bits of the addresses |
386 | * are used as follows: | 390 | * are used as follows: |
387 | * | 391 | * |
388 | * bit 0: to device, used to indicate "performant mode" command | 392 | * bit 0: to device, used to indicate "performant mode" command |
389 | * from device, indidcates error status. | 393 | * from device, indidcates error status. |
390 | * bit 1-3: to device, indicates block fetch table entry for | 394 | * bit 1-3: to device, indicates block fetch table entry for |
391 | * reducing DMA in fetching commands from host memory. | 395 | * reducing DMA in fetching commands from host memory. |
392 | * bit 4: used to indicate whether tag is "direct lookup" (index), | ||
393 | * or a bus address. | ||
394 | */ | 396 | */ |
395 | 397 | ||
396 | #define COMMANDLIST_ALIGNMENT 128 | 398 | #define COMMANDLIST_ALIGNMENT 128 |
@@ -405,9 +407,21 @@ struct CommandList { | |||
405 | struct ctlr_info *h; | 407 | struct ctlr_info *h; |
406 | int cmd_type; | 408 | int cmd_type; |
407 | long cmdindex; | 409 | long cmdindex; |
408 | struct list_head list; | ||
409 | struct completion *waiting; | 410 | struct completion *waiting; |
410 | void *scsi_cmd; | 411 | struct scsi_cmnd *scsi_cmd; |
412 | struct work_struct work; | ||
413 | |||
414 | /* | ||
415 | * For commands using either of the two "ioaccel" paths to | ||
416 | * bypass the RAID stack and go directly to the physical disk | ||
417 | * phys_disk is a pointer to the hpsa_scsi_dev_t to which the | ||
418 | * i/o is destined. We need to store that here because the command | ||
419 | * may potentially encounter TASK SET FULL and need to be resubmitted | ||
420 | * For "normal" i/o's not using the "ioaccel" paths, phys_disk is | ||
421 | * not used. | ||
422 | */ | ||
423 | struct hpsa_scsi_dev_t *phys_disk; | ||
424 | atomic_t refcount; /* Must be last to avoid memset in cmd_alloc */ | ||
411 | } __aligned(COMMANDLIST_ALIGNMENT); | 425 | } __aligned(COMMANDLIST_ALIGNMENT); |
412 | 426 | ||
413 | /* Max S/G elements in I/O accelerator command */ | 427 | /* Max S/G elements in I/O accelerator command */ |
@@ -420,7 +434,7 @@ struct CommandList { | |||
420 | */ | 434 | */ |
421 | #define IOACCEL1_COMMANDLIST_ALIGNMENT 128 | 435 | #define IOACCEL1_COMMANDLIST_ALIGNMENT 128 |
422 | struct io_accel1_cmd { | 436 | struct io_accel1_cmd { |
423 | u16 dev_handle; /* 0x00 - 0x01 */ | 437 | __le16 dev_handle; /* 0x00 - 0x01 */ |
424 | u8 reserved1; /* 0x02 */ | 438 | u8 reserved1; /* 0x02 */ |
425 | u8 function; /* 0x03 */ | 439 | u8 function; /* 0x03 */ |
426 | u8 reserved2[8]; /* 0x04 - 0x0B */ | 440 | u8 reserved2[8]; /* 0x04 - 0x0B */ |
@@ -430,20 +444,20 @@ struct io_accel1_cmd { | |||
430 | u8 reserved4; /* 0x13 */ | 444 | u8 reserved4; /* 0x13 */ |
431 | u8 sgl_offset; /* 0x14 */ | 445 | u8 sgl_offset; /* 0x14 */ |
432 | u8 reserved5[7]; /* 0x15 - 0x1B */ | 446 | u8 reserved5[7]; /* 0x15 - 0x1B */ |
433 | u32 transfer_len; /* 0x1C - 0x1F */ | 447 | __le32 transfer_len; /* 0x1C - 0x1F */ |
434 | u8 reserved6[4]; /* 0x20 - 0x23 */ | 448 | u8 reserved6[4]; /* 0x20 - 0x23 */ |
435 | u16 io_flags; /* 0x24 - 0x25 */ | 449 | __le16 io_flags; /* 0x24 - 0x25 */ |
436 | u8 reserved7[14]; /* 0x26 - 0x33 */ | 450 | u8 reserved7[14]; /* 0x26 - 0x33 */ |
437 | u8 LUN[8]; /* 0x34 - 0x3B */ | 451 | u8 LUN[8]; /* 0x34 - 0x3B */ |
438 | u32 control; /* 0x3C - 0x3F */ | 452 | __le32 control; /* 0x3C - 0x3F */ |
439 | u8 CDB[16]; /* 0x40 - 0x4F */ | 453 | u8 CDB[16]; /* 0x40 - 0x4F */ |
440 | u8 reserved8[16]; /* 0x50 - 0x5F */ | 454 | u8 reserved8[16]; /* 0x50 - 0x5F */ |
441 | u16 host_context_flags; /* 0x60 - 0x61 */ | 455 | __le16 host_context_flags; /* 0x60 - 0x61 */ |
442 | u16 timeout_sec; /* 0x62 - 0x63 */ | 456 | __le16 timeout_sec; /* 0x62 - 0x63 */ |
443 | u8 ReplyQueue; /* 0x64 */ | 457 | u8 ReplyQueue; /* 0x64 */ |
444 | u8 reserved9[3]; /* 0x65 - 0x67 */ | 458 | u8 reserved9[3]; /* 0x65 - 0x67 */ |
445 | u64 tag; /* 0x68 - 0x6F */ | 459 | __le64 tag; /* 0x68 - 0x6F */ |
446 | u64 host_addr; /* 0x70 - 0x77 */ | 460 | __le64 host_addr; /* 0x70 - 0x77 */ |
447 | u8 CISS_LUN[8]; /* 0x78 - 0x7F */ | 461 | u8 CISS_LUN[8]; /* 0x78 - 0x7F */ |
448 | struct SGDescriptor SG[IOACCEL1_MAXSGENTRIES]; | 462 | struct SGDescriptor SG[IOACCEL1_MAXSGENTRIES]; |
449 | } __aligned(IOACCEL1_COMMANDLIST_ALIGNMENT); | 463 | } __aligned(IOACCEL1_COMMANDLIST_ALIGNMENT); |
@@ -470,8 +484,8 @@ struct io_accel1_cmd { | |||
470 | #define IOACCEL1_BUSADDR_CMDTYPE 0x00000060 | 484 | #define IOACCEL1_BUSADDR_CMDTYPE 0x00000060 |
471 | 485 | ||
472 | struct ioaccel2_sg_element { | 486 | struct ioaccel2_sg_element { |
473 | u64 address; | 487 | __le64 address; |
474 | u32 length; | 488 | __le32 length; |
475 | u8 reserved[3]; | 489 | u8 reserved[3]; |
476 | u8 chain_indicator; | 490 | u8 chain_indicator; |
477 | #define IOACCEL2_CHAIN 0x80 | 491 | #define IOACCEL2_CHAIN 0x80 |
@@ -526,20 +540,20 @@ struct io_accel2_cmd { | |||
526 | /* 0=off, 1=on */ | 540 | /* 0=off, 1=on */ |
527 | u8 reply_queue; /* Reply Queue ID */ | 541 | u8 reply_queue; /* Reply Queue ID */ |
528 | u8 reserved1; /* Reserved */ | 542 | u8 reserved1; /* Reserved */ |
529 | u32 scsi_nexus; /* Device Handle */ | 543 | __le32 scsi_nexus; /* Device Handle */ |
530 | u32 Tag; /* cciss tag, lower 4 bytes only */ | 544 | __le32 Tag; /* cciss tag, lower 4 bytes only */ |
531 | u32 tweak_lower; /* Encryption tweak, lower 4 bytes */ | 545 | __le32 tweak_lower; /* Encryption tweak, lower 4 bytes */ |
532 | u8 cdb[16]; /* SCSI Command Descriptor Block */ | 546 | u8 cdb[16]; /* SCSI Command Descriptor Block */ |
533 | u8 cciss_lun[8]; /* 8 byte SCSI address */ | 547 | u8 cciss_lun[8]; /* 8 byte SCSI address */ |
534 | u32 data_len; /* Total bytes to transfer */ | 548 | __le32 data_len; /* Total bytes to transfer */ |
535 | u8 cmd_priority_task_attr; /* priority and task attrs */ | 549 | u8 cmd_priority_task_attr; /* priority and task attrs */ |
536 | #define IOACCEL2_PRIORITY_MASK 0x78 | 550 | #define IOACCEL2_PRIORITY_MASK 0x78 |
537 | #define IOACCEL2_ATTR_MASK 0x07 | 551 | #define IOACCEL2_ATTR_MASK 0x07 |
538 | u8 sg_count; /* Number of sg elements */ | 552 | u8 sg_count; /* Number of sg elements */ |
539 | u16 dekindex; /* Data encryption key index */ | 553 | __le16 dekindex; /* Data encryption key index */ |
540 | u64 err_ptr; /* Error Pointer */ | 554 | __le64 err_ptr; /* Error Pointer */ |
541 | u32 err_len; /* Error Length*/ | 555 | __le32 err_len; /* Error Length*/ |
542 | u32 tweak_upper; /* Encryption tweak, upper 4 bytes */ | 556 | __le32 tweak_upper; /* Encryption tweak, upper 4 bytes */ |
543 | struct ioaccel2_sg_element sg[IOACCEL2_MAXSGENTRIES]; | 557 | struct ioaccel2_sg_element sg[IOACCEL2_MAXSGENTRIES]; |
544 | struct io_accel2_scsi_response error_data; | 558 | struct io_accel2_scsi_response error_data; |
545 | } __aligned(IOACCEL2_COMMANDLIST_ALIGNMENT); | 559 | } __aligned(IOACCEL2_COMMANDLIST_ALIGNMENT); |
@@ -563,18 +577,18 @@ struct hpsa_tmf_struct { | |||
563 | u8 reserved1; /* byte 3 Reserved */ | 577 | u8 reserved1; /* byte 3 Reserved */ |
564 | u32 it_nexus; /* SCSI I-T Nexus */ | 578 | u32 it_nexus; /* SCSI I-T Nexus */ |
565 | u8 lun_id[8]; /* LUN ID for TMF request */ | 579 | u8 lun_id[8]; /* LUN ID for TMF request */ |
566 | u64 tag; /* cciss tag associated w/ request */ | 580 | __le64 tag; /* cciss tag associated w/ request */ |
567 | u64 abort_tag; /* cciss tag of SCSI cmd or task to abort */ | 581 | __le64 abort_tag; /* cciss tag of SCSI cmd or TMF to abort */ |
568 | u64 error_ptr; /* Error Pointer */ | 582 | __le64 error_ptr; /* Error Pointer */ |
569 | u32 error_len; /* Error Length */ | 583 | __le32 error_len; /* Error Length */ |
570 | }; | 584 | }; |
571 | 585 | ||
572 | /* Configuration Table Structure */ | 586 | /* Configuration Table Structure */ |
573 | struct HostWrite { | 587 | struct HostWrite { |
574 | u32 TransportRequest; | 588 | __le32 TransportRequest; |
575 | u32 command_pool_addr_hi; | 589 | __le32 command_pool_addr_hi; |
576 | u32 CoalIntDelay; | 590 | __le32 CoalIntDelay; |
577 | u32 CoalIntCount; | 591 | __le32 CoalIntCount; |
578 | }; | 592 | }; |
579 | 593 | ||
580 | #define SIMPLE_MODE 0x02 | 594 | #define SIMPLE_MODE 0x02 |
@@ -585,54 +599,54 @@ struct HostWrite { | |||
585 | #define DRIVER_SUPPORT_UA_ENABLE 0x00000001 | 599 | #define DRIVER_SUPPORT_UA_ENABLE 0x00000001 |
586 | 600 | ||
587 | struct CfgTable { | 601 | struct CfgTable { |
588 | u8 Signature[4]; | 602 | u8 Signature[4]; |
589 | u32 SpecValence; | 603 | __le32 SpecValence; |
590 | u32 TransportSupport; | 604 | __le32 TransportSupport; |
591 | u32 TransportActive; | 605 | __le32 TransportActive; |
592 | struct HostWrite HostWrite; | 606 | struct HostWrite HostWrite; |
593 | u32 CmdsOutMax; | 607 | __le32 CmdsOutMax; |
594 | u32 BusTypes; | 608 | __le32 BusTypes; |
595 | u32 TransMethodOffset; | 609 | __le32 TransMethodOffset; |
596 | u8 ServerName[16]; | 610 | u8 ServerName[16]; |
597 | u32 HeartBeat; | 611 | __le32 HeartBeat; |
598 | u32 driver_support; | 612 | __le32 driver_support; |
599 | #define ENABLE_SCSI_PREFETCH 0x100 | 613 | #define ENABLE_SCSI_PREFETCH 0x100 |
600 | #define ENABLE_UNIT_ATTN 0x01 | 614 | #define ENABLE_UNIT_ATTN 0x01 |
601 | u32 MaxScatterGatherElements; | 615 | __le32 MaxScatterGatherElements; |
602 | u32 MaxLogicalUnits; | 616 | __le32 MaxLogicalUnits; |
603 | u32 MaxPhysicalDevices; | 617 | __le32 MaxPhysicalDevices; |
604 | u32 MaxPhysicalDrivesPerLogicalUnit; | 618 | __le32 MaxPhysicalDrivesPerLogicalUnit; |
605 | u32 MaxPerformantModeCommands; | 619 | __le32 MaxPerformantModeCommands; |
606 | u32 MaxBlockFetch; | 620 | __le32 MaxBlockFetch; |
607 | u32 PowerConservationSupport; | 621 | __le32 PowerConservationSupport; |
608 | u32 PowerConservationEnable; | 622 | __le32 PowerConservationEnable; |
609 | u32 TMFSupportFlags; | 623 | __le32 TMFSupportFlags; |
610 | u8 TMFTagMask[8]; | 624 | u8 TMFTagMask[8]; |
611 | u8 reserved[0x78 - 0x70]; | 625 | u8 reserved[0x78 - 0x70]; |
612 | u32 misc_fw_support; /* offset 0x78 */ | 626 | __le32 misc_fw_support; /* offset 0x78 */ |
613 | #define MISC_FW_DOORBELL_RESET (0x02) | 627 | #define MISC_FW_DOORBELL_RESET 0x02 |
614 | #define MISC_FW_DOORBELL_RESET2 (0x010) | 628 | #define MISC_FW_DOORBELL_RESET2 0x010 |
615 | #define MISC_FW_RAID_OFFLOAD_BASIC (0x020) | 629 | #define MISC_FW_RAID_OFFLOAD_BASIC 0x020 |
616 | #define MISC_FW_EVENT_NOTIFY (0x080) | 630 | #define MISC_FW_EVENT_NOTIFY 0x080 |
617 | u8 driver_version[32]; | 631 | u8 driver_version[32]; |
618 | u32 max_cached_write_size; | 632 | __le32 max_cached_write_size; |
619 | u8 driver_scratchpad[16]; | 633 | u8 driver_scratchpad[16]; |
620 | u32 max_error_info_length; | 634 | __le32 max_error_info_length; |
621 | u32 io_accel_max_embedded_sg_count; | 635 | __le32 io_accel_max_embedded_sg_count; |
622 | u32 io_accel_request_size_offset; | 636 | __le32 io_accel_request_size_offset; |
623 | u32 event_notify; | 637 | __le32 event_notify; |
624 | #define HPSA_EVENT_NOTIFY_ACCEL_IO_PATH_STATE_CHANGE (1 << 30) | 638 | #define HPSA_EVENT_NOTIFY_ACCEL_IO_PATH_STATE_CHANGE (1 << 30) |
625 | #define HPSA_EVENT_NOTIFY_ACCEL_IO_PATH_CONFIG_CHANGE (1 << 31) | 639 | #define HPSA_EVENT_NOTIFY_ACCEL_IO_PATH_CONFIG_CHANGE (1 << 31) |
626 | u32 clear_event_notify; | 640 | __le32 clear_event_notify; |
627 | }; | 641 | }; |
628 | 642 | ||
629 | #define NUM_BLOCKFETCH_ENTRIES 8 | 643 | #define NUM_BLOCKFETCH_ENTRIES 8 |
630 | struct TransTable_struct { | 644 | struct TransTable_struct { |
631 | u32 BlockFetch[NUM_BLOCKFETCH_ENTRIES]; | 645 | __le32 BlockFetch[NUM_BLOCKFETCH_ENTRIES]; |
632 | u32 RepQSize; | 646 | __le32 RepQSize; |
633 | u32 RepQCount; | 647 | __le32 RepQCount; |
634 | u32 RepQCtrAddrLow32; | 648 | __le32 RepQCtrAddrLow32; |
635 | u32 RepQCtrAddrHigh32; | 649 | __le32 RepQCtrAddrHigh32; |
636 | #define MAX_REPLY_QUEUES 64 | 650 | #define MAX_REPLY_QUEUES 64 |
637 | struct vals32 RepQAddr[MAX_REPLY_QUEUES]; | 651 | struct vals32 RepQAddr[MAX_REPLY_QUEUES]; |
638 | }; | 652 | }; |
@@ -644,5 +658,137 @@ struct hpsa_pci_info { | |||
644 | u32 board_id; | 658 | u32 board_id; |
645 | }; | 659 | }; |
646 | 660 | ||
661 | struct bmic_identify_physical_device { | ||
662 | u8 scsi_bus; /* SCSI Bus number on controller */ | ||
663 | u8 scsi_id; /* SCSI ID on this bus */ | ||
664 | __le16 block_size; /* sector size in bytes */ | ||
665 | __le32 total_blocks; /* number for sectors on drive */ | ||
666 | __le32 reserved_blocks; /* controller reserved (RIS) */ | ||
667 | u8 model[40]; /* Physical Drive Model */ | ||
668 | u8 serial_number[40]; /* Drive Serial Number */ | ||
669 | u8 firmware_revision[8]; /* drive firmware revision */ | ||
670 | u8 scsi_inquiry_bits; /* inquiry byte 7 bits */ | ||
671 | u8 compaq_drive_stamp; /* 0 means drive not stamped */ | ||
672 | u8 last_failure_reason; | ||
673 | #define BMIC_LAST_FAILURE_TOO_SMALL_IN_LOAD_CONFIG 0x01 | ||
674 | #define BMIC_LAST_FAILURE_ERROR_ERASING_RIS 0x02 | ||
675 | #define BMIC_LAST_FAILURE_ERROR_SAVING_RIS 0x03 | ||
676 | #define BMIC_LAST_FAILURE_FAIL_DRIVE_COMMAND 0x04 | ||
677 | #define BMIC_LAST_FAILURE_MARK_BAD_FAILED 0x05 | ||
678 | #define BMIC_LAST_FAILURE_MARK_BAD_FAILED_IN_FINISH_REMAP 0x06 | ||
679 | #define BMIC_LAST_FAILURE_TIMEOUT 0x07 | ||
680 | #define BMIC_LAST_FAILURE_AUTOSENSE_FAILED 0x08 | ||
681 | #define BMIC_LAST_FAILURE_MEDIUM_ERROR_1 0x09 | ||
682 | #define BMIC_LAST_FAILURE_MEDIUM_ERROR_2 0x0a | ||
683 | #define BMIC_LAST_FAILURE_NOT_READY_BAD_SENSE 0x0b | ||
684 | #define BMIC_LAST_FAILURE_NOT_READY 0x0c | ||
685 | #define BMIC_LAST_FAILURE_HARDWARE_ERROR 0x0d | ||
686 | #define BMIC_LAST_FAILURE_ABORTED_COMMAND 0x0e | ||
687 | #define BMIC_LAST_FAILURE_WRITE_PROTECTED 0x0f | ||
688 | #define BMIC_LAST_FAILURE_SPIN_UP_FAILURE_IN_RECOVER 0x10 | ||
689 | #define BMIC_LAST_FAILURE_REBUILD_WRITE_ERROR 0x11 | ||
690 | #define BMIC_LAST_FAILURE_TOO_SMALL_IN_HOT_PLUG 0x12 | ||
691 | #define BMIC_LAST_FAILURE_BUS_RESET_RECOVERY_ABORTED 0x13 | ||
692 | #define BMIC_LAST_FAILURE_REMOVED_IN_HOT_PLUG 0x14 | ||
693 | #define BMIC_LAST_FAILURE_INIT_REQUEST_SENSE_FAILED 0x15 | ||
694 | #define BMIC_LAST_FAILURE_INIT_START_UNIT_FAILED 0x16 | ||
695 | #define BMIC_LAST_FAILURE_INQUIRY_FAILED 0x17 | ||
696 | #define BMIC_LAST_FAILURE_NON_DISK_DEVICE 0x18 | ||
697 | #define BMIC_LAST_FAILURE_READ_CAPACITY_FAILED 0x19 | ||
698 | #define BMIC_LAST_FAILURE_INVALID_BLOCK_SIZE 0x1a | ||
699 | #define BMIC_LAST_FAILURE_HOT_PLUG_REQUEST_SENSE_FAILED 0x1b | ||
700 | #define BMIC_LAST_FAILURE_HOT_PLUG_START_UNIT_FAILED 0x1c | ||
701 | #define BMIC_LAST_FAILURE_WRITE_ERROR_AFTER_REMAP 0x1d | ||
702 | #define BMIC_LAST_FAILURE_INIT_RESET_RECOVERY_ABORTED 0x1e | ||
703 | #define BMIC_LAST_FAILURE_DEFERRED_WRITE_ERROR 0x1f | ||
704 | #define BMIC_LAST_FAILURE_MISSING_IN_SAVE_RIS 0x20 | ||
705 | #define BMIC_LAST_FAILURE_WRONG_REPLACE 0x21 | ||
706 | #define BMIC_LAST_FAILURE_GDP_VPD_INQUIRY_FAILED 0x22 | ||
707 | #define BMIC_LAST_FAILURE_GDP_MODE_SENSE_FAILED 0x23 | ||
708 | #define BMIC_LAST_FAILURE_DRIVE_NOT_IN_48BIT_MODE 0x24 | ||
709 | #define BMIC_LAST_FAILURE_DRIVE_TYPE_MIX_IN_HOT_PLUG 0x25 | ||
710 | #define BMIC_LAST_FAILURE_DRIVE_TYPE_MIX_IN_LOAD_CFG 0x26 | ||
711 | #define BMIC_LAST_FAILURE_PROTOCOL_ADAPTER_FAILED 0x27 | ||
712 | #define BMIC_LAST_FAILURE_FAULTY_ID_BAY_EMPTY 0x28 | ||
713 | #define BMIC_LAST_FAILURE_FAULTY_ID_BAY_OCCUPIED 0x29 | ||
714 | #define BMIC_LAST_FAILURE_FAULTY_ID_INVALID_BAY 0x2a | ||
715 | #define BMIC_LAST_FAILURE_WRITE_RETRIES_FAILED 0x2b | ||
716 | |||
717 | #define BMIC_LAST_FAILURE_SMART_ERROR_REPORTED 0x37 | ||
718 | #define BMIC_LAST_FAILURE_PHY_RESET_FAILED 0x38 | ||
719 | #define BMIC_LAST_FAILURE_ONLY_ONE_CTLR_CAN_SEE_DRIVE 0x40 | ||
720 | #define BMIC_LAST_FAILURE_KC_VOLUME_FAILED 0x41 | ||
721 | #define BMIC_LAST_FAILURE_UNEXPECTED_REPLACEMENT 0x42 | ||
722 | #define BMIC_LAST_FAILURE_OFFLINE_ERASE 0x80 | ||
723 | #define BMIC_LAST_FAILURE_OFFLINE_TOO_SMALL 0x81 | ||
724 | #define BMIC_LAST_FAILURE_OFFLINE_DRIVE_TYPE_MIX 0x82 | ||
725 | #define BMIC_LAST_FAILURE_OFFLINE_ERASE_COMPLETE 0x83 | ||
726 | |||
727 | u8 flags; | ||
728 | u8 more_flags; | ||
729 | u8 scsi_lun; /* SCSI LUN for phys drive */ | ||
730 | u8 yet_more_flags; | ||
731 | u8 even_more_flags; | ||
732 | __le32 spi_speed_rules;/* SPI Speed data:Ultra disable diagnose */ | ||
733 | u8 phys_connector[2]; /* connector number on controller */ | ||
734 | u8 phys_box_on_bus; /* phys enclosure this drive resides */ | ||
735 | u8 phys_bay_in_box; /* phys drv bay this drive resides */ | ||
736 | __le32 rpm; /* Drive rotational speed in rpm */ | ||
737 | u8 device_type; /* type of drive */ | ||
738 | u8 sata_version; /* only valid when drive_type is SATA */ | ||
739 | __le64 big_total_block_count; | ||
740 | __le64 ris_starting_lba; | ||
741 | __le32 ris_size; | ||
742 | u8 wwid[20]; | ||
743 | u8 controller_phy_map[32]; | ||
744 | __le16 phy_count; | ||
745 | u8 phy_connected_dev_type[256]; | ||
746 | u8 phy_to_drive_bay_num[256]; | ||
747 | __le16 phy_to_attached_dev_index[256]; | ||
748 | u8 box_index; | ||
749 | u8 reserved; | ||
750 | __le16 extra_physical_drive_flags; | ||
751 | #define BMIC_PHYS_DRIVE_SUPPORTS_GAS_GAUGE(idphydrv) \ | ||
752 | (idphydrv->extra_physical_drive_flags & (1 << 10)) | ||
753 | u8 negotiated_link_rate[256]; | ||
754 | u8 phy_to_phy_map[256]; | ||
755 | u8 redundant_path_present_map; | ||
756 | u8 redundant_path_failure_map; | ||
757 | u8 active_path_number; | ||
758 | __le16 alternate_paths_phys_connector[8]; | ||
759 | u8 alternate_paths_phys_box_on_port[8]; | ||
760 | u8 multi_lun_device_lun_count; | ||
761 | u8 minimum_good_fw_revision[8]; | ||
762 | u8 unique_inquiry_bytes[20]; | ||
763 | u8 current_temperature_degreesC; | ||
764 | u8 temperature_threshold_degreesC; | ||
765 | u8 max_temperature_degreesC; | ||
766 | u8 logical_blocks_per_phys_block_exp; /* phyblocksize = 512*2^exp */ | ||
767 | __le16 current_queue_depth_limit; | ||
768 | u8 switch_name[10]; | ||
769 | __le16 switch_port; | ||
770 | u8 alternate_paths_switch_name[40]; | ||
771 | u8 alternate_paths_switch_port[8]; | ||
772 | __le16 power_on_hours; /* valid only if gas gauge supported */ | ||
773 | __le16 percent_endurance_used; /* valid only if gas gauge supported. */ | ||
774 | #define BMIC_PHYS_DRIVE_SSD_WEAROUT(idphydrv) \ | ||
775 | ((idphydrv->percent_endurance_used & 0x80) || \ | ||
776 | (idphydrv->percent_endurance_used > 10000)) | ||
777 | u8 drive_authentication; | ||
778 | #define BMIC_PHYS_DRIVE_AUTHENTICATED(idphydrv) \ | ||
779 | (idphydrv->drive_authentication == 0x80) | ||
780 | u8 smart_carrier_authentication; | ||
781 | #define BMIC_SMART_CARRIER_AUTHENTICATION_SUPPORTED(idphydrv) \ | ||
782 | (idphydrv->smart_carrier_authentication != 0x0) | ||
783 | #define BMIC_SMART_CARRIER_AUTHENTICATED(idphydrv) \ | ||
784 | (idphydrv->smart_carrier_authentication == 0x01) | ||
785 | u8 smart_carrier_app_fw_version; | ||
786 | u8 smart_carrier_bootloader_fw_version; | ||
787 | u8 encryption_key_name[64]; | ||
788 | __le32 misc_drive_flags; | ||
789 | __le16 dek_index; | ||
790 | u8 padding[112]; | ||
791 | }; | ||
792 | |||
647 | #pragma pack() | 793 | #pragma pack() |
648 | #endif /* HPSA_CMD_H */ | 794 | #endif /* HPSA_CMD_H */ |