union ciss_device_address
{
struct
{
u_int32_t target:24;
u_int32_t bus:6;
u_int32_t mode:2;
u_int32_t extra_address;
} physical;
struct
{
u_int32_t lun:30;
u_int32_t mode:2;
u_int32_t :32;
} logical;
struct
{
u_int32_t :30;
u_int32_t mode:2;
u_int32_t :32;
} mode;
};
#define CISS_HDR_ADDRESS_MODE_PERIPHERAL 0x0
#define CISS_HDR_ADDRESS_MODE_LOGICAL 0x1
#define CISS_HDR_ADDRESS_MODE_MASK_PERIPHERAL 0x3
#define CISS_EXTRA_MODE2(extra) ((extra & 0xc0000000) >> 30)
#define CISS_EXTRA_BUS2(extra) ((extra & 0x3f000000) >> 24)
#define CISS_EXTRA_TARGET2(extra) ((extra & 0x00ff0000) >> 16)
#define CISS_EXTRA_MODE3(extra) ((extra & 0x0000c000) >> 14)
#define CISS_EXTRA_BUS3(extra) ((extra & 0x00003f00) >> 8)
#define CISS_EXTRA_TARGET3(extra) ((extra & 0x000000ff))
struct ciss_header
{
u_int8_t :8;
u_int8_t sg_in_list;
u_int16_t sg_total;
u_int32_t host_tag;
#define CISS_HDR_HOST_TAG_ERROR (1<<1)
u_int32_t host_tag_zeroes;
union ciss_device_address address;
} __packed;
struct ciss_cdb
{
u_int8_t cdb_length;
u_int8_t type:3;
#define CISS_CDB_TYPE_COMMAND 0
#define CISS_CDB_TYPE_MESSAGE 1
u_int8_t attribute:3;
#define CISS_CDB_ATTRIBUTE_UNTAGGED 0
#define CISS_CDB_ATTRIBUTE_SIMPLE 4
#define CISS_CDB_ATTRIBUTE_HEAD_OF_QUEUE 5
#define CISS_CDB_ATTRIBUTE_ORDERED 6
#define CISS_CDB_ATTRIBUTE_AUTO_CONTINGENT 7
u_int8_t direction:2;
#define CISS_CDB_DIRECTION_NONE 0
#define CISS_CDB_DIRECTION_WRITE 1
#define CISS_CDB_DIRECTION_READ 2
u_int16_t timeout;
#define CISS_CDB_BUFFER_SIZE 16
u_int8_t cdb[CISS_CDB_BUFFER_SIZE];
} __packed;
struct ciss_error_info_pointer
{
u_int64_t error_info_address;
u_int32_t error_info_length;
} __packed;
struct ciss_error_info
{
u_int8_t scsi_status;
#define CISS_SCSI_STATUS_GOOD 0x00
#define CISS_SCSI_STATUS_CHECK_CONDITION 0x02
#define CISS_SCSI_STATUS_CONDITION_MET 0x04
#define CISS_SCSI_STATUS_BUSY 0x08
#define CISS_SCSI_STATUS_INDETERMINATE 0x10
#define CISS_SCSI_STATUS_INDETERMINATE_CM 0x14
#define CISS_SCSI_STATUS_RESERVATION_CONFLICT 0x18
#define CISS_SCSI_STATUS_COMMAND_TERMINATED 0x22
#define CISS_SCSI_STATUS_QUEUE_FULL 0x28
#define CISS_SCSI_STATUS_ACA_ACTIVE 0x30
u_int8_t sense_length;
u_int16_t command_status;
#define CISS_CMD_STATUS_SUCCESS 0
#define CISS_CMD_STATUS_TARGET_STATUS 1
#define CISS_CMD_STATUS_DATA_UNDERRUN 2
#define CISS_CMD_STATUS_DATA_OVERRUN 3
#define CISS_CMD_STATUS_INVALID_COMMAND 4
#define CISS_CMD_STATUS_PROTOCOL_ERROR 5
#define CISS_CMD_STATUS_HARDWARE_ERROR 6
#define CISS_CMD_STATUS_CONNECTION_LOST 7
#define CISS_CMD_STATUS_ABORTED 8
#define CISS_CMD_STATUS_ABORT_FAILED 9
#define CISS_CMD_STATUS_UNSOLICITED_ABORT 10
#define CISS_CMD_STATUS_TIMEOUT 11
#define CISS_CMD_STATUS_UNABORTABLE 12
u_int32_t residual_count;
union {
struct {
u_int8_t res1[3];
u_int8_t type;
u_int32_t error_info;
} __packed common_info;
struct {
u_int8_t res1[2];
u_int8_t offense_size;
u_int8_t offense_offset;
u_int32_t offense_value;
} __packed invalid_command;
} additional_error_info;
u_int8_t sense_info[0];
} __packed;
struct ciss_sg_entry
{
u_int64_t address;
#define CISS_SG_ADDRESS_BITBUCKET (~(u_int64_t)0)
u_int32_t length;
u_int32_t :31;
u_int32_t extension:1;
} __packed;
struct ciss_command
{
struct ciss_header header;
struct ciss_cdb cdb;
struct ciss_error_info_pointer error_info;
struct ciss_sg_entry sg[0];
} __packed;
#define CISS_OPCODE_REPORT_LOGICAL_LUNS 0xc2
#define CISS_OPCODE_REPORT_PHYSICAL_LUNS 0xc3
struct ciss_lun_report
{
u_int32_t list_size;
u_int32_t :32;
union ciss_device_address lun[0];
} __packed;
#define CISS_VPD_LOGICAL_DRIVE_GEOMETRY 0xc1
struct ciss_ldrive_geometry
{
u_int8_t periph_qualifier:3;
u_int8_t periph_devtype:5;
u_int8_t page_code;
u_int8_t res1;
u_int8_t page_length;
u_int16_t cylinders;
u_int8_t heads;
u_int8_t sectors;
u_int8_t fault_tolerance;
u_int8_t res2[3];
} __attribute__ ((packed));
struct ciss_report_cdb
{
u_int8_t opcode;
u_int8_t reserved[5];
u_int32_t length;
u_int8_t :8;
u_int8_t control;
} __packed;
#define CISS_OPCODE_MESSAGE_ABORT 0x00
#define CISS_MESSAGE_ABORT_TASK 0x00
#define CISS_MESSAGE_ABORT_TASK_SET 0x01
#define CISS_MESSAGE_ABORT_CLEAR_ACA 0x02
#define CISS_MESSAGE_ABORT_CLEAR_TASK_SET 0x03
#define CISS_OPCODE_MESSAGE_RESET 0x01
#define CISS_MESSAGE_RESET_CONTROLLER 0x00
#define CISS_MESSAGE_RESET_BUS 0x01
#define CISS_MESSAGE_RESET_TARGET 0x03
#define CISS_MESSAGE_RESET_LOGICAL_UNIT 0x04
#define CISS_OPCODE_MESSAGE_SCAN 0x02
#define CISS_MESSAGE_SCAN_CONTROLLER 0x00
#define CISS_MESSAGE_SCAN_BUS 0x01
#define CISS_MESSAGE_SCAN_TARGET 0x03
#define CISS_MESSAGE_SCAN_LOGICAL_UNIT 0x04
#define CISS_OPCODE_MESSAGE_NOP 0x03
struct ciss_message_cdb
{
u_int8_t opcode;
u_int8_t type;
u_int16_t :16;
u_int32_t abort_tag;
u_int8_t reserved[8];
} __packed;
#define CISS_OPCODE_READ 0xc0
#define CISS_OPCODE_WRITE 0xc1
#define CISS_COMMAND_NOTIFY_ON_EVENT 0xd0
#define CISS_COMMAND_ABORT_NOTIFY 0xd1
struct ciss_notify_cdb
{
u_int8_t opcode;
u_int8_t command;
u_int8_t res1[2];
u_int16_t timeout;
u_int8_t res2;
u_int8_t synchronous:1;
u_int8_t ordered:1;
u_int8_t seek_to_oldest:1;
u_int8_t new_only:1;
u_int8_t :4;
u_int32_t length;
#define CISS_NOTIFY_DATA_SIZE 512
u_int8_t control;
} __packed;
#define CISS_NOTIFY_NOTIFIER 0
#define CISS_NOTIFY_NOTIFIER_STATUS 0
#define CISS_NOTIFY_NOTIFIER_PROTOCOL 1
#define CISS_NOTIFY_HOTPLUG 1
#define CISS_NOTIFY_HOTPLUG_PHYSICAL 0
#define CISS_NOTIFY_HOTPLUG_POWERSUPPLY 1
#define CISS_NOTIFY_HOTPLUG_FAN 2
#define CISS_NOTIFY_HOTPLUG_POWER 3
#define CISS_NOTIFY_HOTPLUG_REDUNDANT 4
#define CISS_NOTIFY_HOTPLUG_NONDISK 5
#define CISS_NOTIFY_HARDWARE 2
#define CISS_NOTIFY_HARDWARE_CABLES 0
#define CISS_NOTIFY_HARDWARE_MEMORY 1
#define CISS_NOTIFY_HARDWARE_FAN 2
#define CISS_NOTIFY_HARDWARE_VRM 3
#define CISS_NOTIFY_ENVIRONMENT 3
#define CISS_NOTIFY_ENVIRONMENT_TEMPERATURE 0
#define CISS_NOTIFY_ENVIRONMENT_POWERSUPPLY 1
#define CISS_NOTIFY_ENVIRONMENT_CHASSIS 2
#define CISS_NOTIFY_ENVIRONMENT_POWER 3
#define CISS_NOTIFY_PHYSICAL 4
#define CISS_NOTIFY_PHYSICAL_STATE 0
#define CISS_NOTIFY_LOGICAL 5
#define CISS_NOTIFY_LOGICAL_STATUS 0
#define CISS_NOTIFY_LOGICAL_ERROR 1
#define CISS_NOTIFY_LOGICAL_SURFACE 2
#define CISS_NOTIFY_REDUNDANT 6
#define CISS_NOTIFY_REDUNDANT_STATUS 0
#define CISS_NOTIFY_CISS 8
#define CISS_NOTIFY_CISS_REDUNDANT_CHANGE 0
#define CISS_NOTIFY_CISS_PATH_STATUS 1
#define CISS_NOTIFY_CISS_HARDWARE_ERROR 2
#define CISS_NOTIFY_CISS_LOGICAL 3
struct ciss_notify_drive
{
u_int16_t physical_drive_number;
u_int8_t configured_drive_flag;
u_int8_t spare_drive_flag;
u_int8_t big_physical_drive_number;
u_int8_t enclosure_bay_number;
} __packed;
struct ciss_notify_locator
{
u_int16_t port;
u_int16_t id;
u_int16_t box;
} __packed;
struct ciss_notify_redundant_controller
{
u_int16_t slot;
} __packed;
struct ciss_notify_logical_status
{
u_int16_t logical_drive;
u_int8_t previous_state;
u_int8_t new_state;
u_int8_t spare_state;
} __packed;
struct ciss_notify_rebuild_aborted
{
u_int16_t logical_drive;
u_int8_t replacement_drive;
u_int8_t error_drive;
u_int8_t big_replacement_drive;
u_int8_t big_error_drive;
} __packed;
struct ciss_notify_io_error
{
u_int16_t logical_drive;
u_int32_t lba;
u_int16_t block_count;
u_int8_t command;
u_int8_t failure_bus;
u_int8_t failure_drive;
u_int64_t big_lba;
} __packed;
struct ciss_notify_consistency_completed
{
u_int16_t logical_drive;
} __packed;
struct ciss_notify
{
u_int32_t timestamp;
u_int16_t class;
u_int16_t subclass;
u_int16_t detail;
union
{
struct ciss_notify_drive drive;
struct ciss_notify_locator location;
struct ciss_notify_redundant_controller redundant_controller;
struct ciss_notify_logical_status logical_status;
struct ciss_notify_rebuild_aborted rebuild_aborted;
struct ciss_notify_io_error io_error;
struct ciss_notify_consistency_completed consistency_completed;
u_int8_t data[64];
} data;
char message[80];
u_int32_t tag;
u_int16_t date;
u_int16_t year;
u_int32_t time;
u_int16_t pre_power_up_time;
union ciss_device_address device;
} __packed;
struct ciss_config_table
{
char signature[4];
u_int32_t valence;
u_int32_t supported_methods;
#define CISS_TRANSPORT_METHOD_READY (1<<0)
#define CISS_TRANSPORT_METHOD_SIMPLE (1<<1)
#define CISS_TRANSPORT_METHOD_PERF (1<<2)
u_int32_t active_method;
u_int32_t requested_method;
u_int32_t command_physlimit;
u_int32_t interrupt_coalesce_delay;
u_int32_t interrupt_coalesce_count;
u_int32_t max_outstanding_commands;
u_int32_t bus_types;
#define CISS_TRANSPORT_BUS_TYPE_ULTRA2 (1<<0)
#define CISS_TRANSPORT_BUS_TYPE_ULTRA3 (1<<1)
#define CISS_TRANSPORT_BUS_TYPE_FIBRE1 (1<<8)
#define CISS_TRANSPORT_BUS_TYPE_FIBRE2 (1<<9)
u_int32_t transport_offset;
char server_name[16];
u_int32_t heartbeat;
u_int32_t host_driver;
#define CISS_DRIVER_SUPPORT_UNIT_ATTENTION (1<<0)
#define CISS_DRIVER_QUICK_INIT (1<<1)
#define CISS_DRIVER_INTERRUPT_ON_LOCKUP (1<<2)
#define CISS_DRIVER_SUPPORT_MIXED_Q_TAGS (1<<3)
#define CISS_DRIVER_HOST_IS_ALPHA (1<<4)
#define CISS_DRIVER_MULTI_LUN_SUPPORT (1<<5)
#define CISS_DRIVER_MESSAGE_REQUESTS_SUPPORTED (1<<7)
#define CISS_DRIVER_DAUGHTER_ATTACHED (1<<8)
#define CISS_DRIVER_SCSI_PREFETCH (1<<9)
u_int32_t max_sg_length;
u_int32_t max_logical_supported;
u_int32_t max_physical_supported;
u_int32_t max_physical_per_logical;
u_int32_t max_perfomant_mode_cmds;
u_int32_t max_block_fetch_count;
} __packed;
struct ciss_perf_config {
uint32_t fetch_count[8];
#define CISS_SG_FETCH_MAX 0
#define CISS_SG_FETCH_1 1
#define CISS_SG_FETCH_2 2
#define CISS_SG_FETCH_4 3
#define CISS_SG_FETCH_8 4
#define CISS_SG_FETCH_16 5
#define CISS_SG_FETCH_32 6
#define CISS_SG_FETCH_NONE 7
uint32_t rq_size;
uint32_t rq_count;
uint32_t rq_bank_lo;
uint32_t rq_bank_hi;
struct {
uint32_t rq_addr_lo;
uint32_t rq_addr_hi;
} __packed rq[4];
} __packed;
#define CISS_ARRAY_CONTROLLER_READ 0x26
#define CISS_ARRAY_CONTROLLER_WRITE 0x27
#define CISS_BMIC_ID_LDRIVE 0x10
#define CISS_BMIC_ID_CTLR 0x11
#define CISS_BMIC_ID_LSTATUS 0x12
#define CISS_BMIC_ID_PDRIVE 0x15
#define CISS_BMIC_BLINK_PDRIVE 0x16
#define CISS_BMIC_SENSE_BLINK_PDRIVE 0x17
#define CISS_BMIC_SOFT_RESET 0x40
#define CISS_BMIC_FLUSH_CACHE 0xc2
#define CISS_BMIC_ACCEPT_MEDIA 0xe0
#define CISS_BIG_MAP_ID(sc, bus, target) \
(0x80 | \
((sc)->ciss_id->drives_per_scsi_bus * (bus)) | \
(target))
#define CISS_BIG_MAP_BUS(sc, id) \
(((id) & 0x80) ? (((id) & ~0x80) / (sc)->ciss_id->drives_per_scsi_bus) : -1)
#define CISS_BIG_MAP_TARGET(sc, id) \
(((id) & 0x80) ? (((id) & ~0x80) % (sc)->ciss_id->drives_per_scsi_bus) : -1)
#define CISS_BIG_MAP_ENTRIES 128
#define CISS_LUN_TO_BUS(x) (((x) >> 16) & 0xFF)
#define CISS_LUN_TO_TARGET(x) ((x) & 0xFF)
struct ciss_bmic_cdb {
u_int8_t opcode;
u_int8_t log_drive;
u_int8_t phys_drive;
u_int8_t res1[3];
u_int8_t bmic_opcode;
u_int16_t size;
u_int8_t res2;
} __packed;
struct ciss_bmic_id_ldrive {
u_int16_t block_size;
u_int32_t blocks_available;
u_int8_t drive_parameter_table[16];
u_int8_t fault_tolerance;
#define CISS_LDRIVE_RAID0 0
#define CISS_LDRIVE_RAID4 1
#define CISS_LDRIVE_RAID1 2
#define CISS_LDRIVE_RAID5 3
#define CISS_LDRIVE_RAID51 4
#define CISS_LDRIVE_RAIDADG 5
u_int8_t res1;
u_int8_t bios_disable_flag;
u_int8_t res2;
u_int32_t logical_drive_identifier;
char logical_drive_label[64];
u_int64_t big_blocks_available;
u_int8_t res3[410];
} __packed;
struct ciss_bmic_id_lstatus {
u_int8_t status;
#define CISS_LSTATUS_OK 0
#define CISS_LSTATUS_FAILED 1
#define CISS_LSTATUS_NOT_CONFIGURED 2
#define CISS_LSTATUS_INTERIM_RECOVERY 3
#define CISS_LSTATUS_READY_RECOVERY 4
#define CISS_LSTATUS_RECOVERING 5
#define CISS_LSTATUS_WRONG_PDRIVE 6
#define CISS_LSTATUS_MISSING_PDRIVE 7
#define CISS_LSTATUS_EXPANDING 10
#define CISS_LSTATUS_BECOMING_READY 11
#define CISS_LSTATUS_QUEUED_FOR_EXPANSION 12
u_int32_t deprecated_drive_failure_map;
u_int8_t res1[416];
u_int32_t blocks_to_recover;
u_int8_t deprecated_drive_rebuilding;
u_int16_t deprecated_remap_count[32];
u_int32_t deprecated_replacement_map;
u_int32_t deprecated_active_spare_map;
u_int8_t spare_configured:1;
u_int8_t spare_rebuilding:1;
u_int8_t spare_rebuilt:1;
u_int8_t spare_failed:1;
u_int8_t spare_switched:1;
u_int8_t spare_available:1;
u_int8_t res2:2;
u_int8_t deprecated_spare_to_replace_map[32];
u_int32_t deprecated_replaced_marked_ok_map;
u_int8_t media_exchanged;
u_int8_t cache_failure;
u_int8_t expand_failure;
u_int8_t rebuild_read_failure:1;
u_int8_t rebuild_write_failure:1;
u_int8_t res3:6;
u_int8_t drive_failure_map[CISS_BIG_MAP_ENTRIES / 8];
u_int16_t remap_count[CISS_BIG_MAP_ENTRIES];
u_int8_t replacement_map[CISS_BIG_MAP_ENTRIES / 8];
u_int8_t active_spare_map[CISS_BIG_MAP_ENTRIES / 8];
u_int8_t spare_to_replace_map[CISS_BIG_MAP_ENTRIES];
u_int8_t replaced_marked_ok_map[CISS_BIG_MAP_ENTRIES / 8];
u_int8_t drive_rebuilding;
u_int64_t big_blocks_to_recover;
u_int8_t res4[28];
} __packed;
struct ciss_bmic_id_table {
u_int8_t configured_logical_drives;
u_int32_t config_signature;
char running_firmware_revision[4];
char stored_firmware_revision[4];
u_int8_t hardware_revision;
u_int8_t boot_block_revision[4];
u_int32_t deprecated_drive_present_map;
u_int32_t deprecated_external_drive_present_map;
u_int32_t board_id;
u_int8_t swapped_error_cable;
u_int32_t deprecated_non_disk_map;
u_int8_t bad_host_ram_addr;
u_int8_t cpu_revision;
u_int8_t res3[3];
char marketting_revision;
u_int8_t controller_flags;
#define CONTROLLER_FLAGS_FLASH_ROM_INSTALLED 0x01
#define CONTROLLER_FLAGS_DIAGS_MODE_BIT 0x02
#define CONTROLLER_FLAGS_EXPAND_32MB_FX 0x04
#define CONTROLLER_FLAGS_MORE_THAN_7_SUPPORT 0x08
#define CONTROLLER_FLAGS_DAISY_SUPPORT_BIT 0x10
#define CONTROLLER_FLAGS_RES6 0x20
#define CONTROLLER_FLAGS_RES7 0x40
#define CONTROLLER_FLAGS_BIG_MAP_SUPPORT 0x80
u_int8_t host_flags;
#define HOST_FLAGS_SDB_ASIC_WORK_AROUND 0x01
#define HOST_FLAGS_PCI_DATA_BUS_PARITY_SUPPORT 0x02
#define HOST_FLAGS_RES3 0x04
#define HOST_FLAGS_RES4 0x08
#define HOST_FLAGS_RES5 0x10
#define HOST_FLAGS_RES6 0x20
#define HOST_FLAGS_RES7 0x30
#define HOST_FLAGS_RES8 0x40
u_int8_t expand_disable_code;
#define EXPAND_DISABLE_NOT_NEEDED 0x01
#define EXPAND_DISABLE_MISSING_CACHE_BOARD 0x02
#define EXPAND_DISABLE_WCXC_FATAL_CACHE_BITS 0x04
#define EXPAND_DISABLE_CACHE_PERM_DISABLED 0x08
#define EXPAND_DISABLE_RAM_ALLOCATION_FAILED 0x10
#define EXPAND_DISABLE_BATTEREIS_DISCHARGED 0x20
#define EXPAND_DISABLE_RES7 0x40
#define EXPAND_DISABLE_REBUILD_RUNNING 0x80
u_int8_t scsi_chip_count;
u_int32_t maximum_blocks;
u_int32_t controller_clock;
u_int8_t drives_per_scsi_bus;
u_int8_t big_drive_present_map[CISS_BIG_MAP_ENTRIES / 8];
u_int8_t big_external_drive_present_map[CISS_BIG_MAP_ENTRIES / 8];
u_int8_t big_non_disk_map[CISS_BIG_MAP_ENTRIES / 8];
u_int16_t task_flags;
u_int8_t ICL_bus_map;
u_int8_t redund_ctlr_modes_support;
u_int8_t curr_redund_ctlr_mode;
u_int8_t redund_ctlr_status;
u_int8_t redund_op_failure_code;
u_int8_t unsupported_nile_bus;
u_int8_t host_i2c_autorev;
u_int8_t cpld_revision;
u_int8_t fibre_chip_count;
u_int8_t daughterboard_type;
u_int8_t more_swapped_config_cable_error;
u_int8_t license_key_status;
u_int8_t access_module_status;
u_int8_t features_supported[12];
u_int8_t rec_rom_inact_rev[4];
u_int8_t rec_rom_act_status;
u_int8_t pci_to_pci_status;
u_int32_t redundant_server_info;
u_int8_t percent_write_cache;
u_int16_t daughterboard_size_mb;
u_int8_t cache_batter_count;
u_int16_t total_controller_mem_mb;
u_int8_t more_controller_flags;
u_int8_t x_board_host_i2c_rev;
u_int8_t battery_pic_rev;
u_int8_t bDdffVersion[4];
u_int16_t usMaxLogicalUnits;
u_int16_t usExtLogicalUnitCount;
u_int16_t usMaxPhysicalDevices;
u_int16_t usMaxPhyDrvPerLogicalUnit;
u_int8_t bEnclosureCount;
u_int8_t bExpanderCount;
u_int16_t usOffsetToEDPbitmap;
u_int16_t usOffsetToEEDPbitmap;
u_int16_t usOffsetToENDbitmap;
u_int8_t bInternalPortStatus[8];
u_int8_t bExternalPortStatus[8];
u_int32_t uiYetMoreControllerFlags;
#define YMORE_CONTROLLER_FLAGS_JBOD_SUPPORTED \
( 1 << 25 )
u_int8_t bLastLockup;
u_int8_t bSlot;
u_int16_t usBuildNum;
u_int32_t uiMaxSafeFullStripeSize;
u_int32_t uiTotalLength;
u_int8_t bVendorID[8];
u_int8_t bProductID[16];
u_int32_t ExtendedLastLockupCode;
u_int16_t MaxRaid;
u_int16_t MaxParity;
u_int16_t MaxADGStripSize;
u_int16_t YetMoreSwappedCables;
u_int8_t MaxDevicePaths;
u_int8_t PowerUPNvramFlags;
#define PWR_UP_FLAG_JBOD_ENABLED 0x08
u_int16_t ZonedOffset;
u_int32_t FixedFieldsLength;
u_int8_t FWCompileTimeStamp[24];
u_int32_t EvenMoreControllerFlags;
u_int8_t padding[240];
} __packed;
struct ciss_bmic_id_pdrive {
u_int8_t scsi_bus;
u_int8_t scsi_id;
u_int16_t block_size;
u_int32_t total_blocks;
u_int32_t reserved_blocks;
char model[40];
char serial[40];
char revision[8];
u_int8_t inquiry_bits;
u_int8_t res1[2];
u_int8_t drive_present:1;
u_int8_t non_disk:1;
u_int8_t wide:1;
u_int8_t synchronous:1;
u_int8_t narrow:1;
u_int8_t wide_downgraded_to_narrow:1;
u_int8_t ultra:1;
u_int8_t ultra2:1;
u_int8_t SMART:1;
u_int8_t SMART_errors_recorded:1;
u_int8_t SMART_errors_enabled:1;
u_int8_t SMART_errors_detected:1;
u_int8_t external:1;
u_int8_t configured:1;
u_int8_t configured_spare:1;
u_int8_t cache_saved_enabled:1;
u_int8_t res2;
u_int8_t res3:6;
u_int8_t cache_currently_enabled:1;
u_int8_t cache_safe:1;
u_int8_t res4[5];
char connector[2];
u_int8_t res5;
u_int8_t bay;
u_int16_t rpm;
u_int8_t drive_type;
u_int8_t res6[393];
} __packed;
struct ciss_bmic_blink_pdrive {
u_int32_t blink_duration;
u_int32_t duration_elapsed;
u_int8_t blinktab[256];
#define CISS_BMIC_BLINK_ALL 1
#define CISS_BMIC_BLINK_TIMED 2
u_int8_t res2[248];
} __packed;
struct ciss_bmic_flush_cache {
u_int16_t flag;
#define CISS_BMIC_FLUSH_AND_ENABLE 0
#define CISS_BMIC_FLUSH_AND_DISABLE 1
u_int8_t res1[510];
} __packed;
#ifdef _KERNEL
#define CISS_TL_SIMPLE_BAR_REGS 0x10
#define CISS_TL_SIMPLE_BAR_CFG 0x14
#define CISS_TL_SIMPLE_IDBR 0x20
#define CISS_TL_SIMPLE_IDBR_CFG_TABLE (1<<0)
#define CISS_TL_SIMPLE_ISR 0x30
#define CISS_TL_SIMPLE_IMR 0x34
#define CISS_TL_SIMPLE_INTR_OPQ_SA5 (1<<3)
#define CISS_TL_SIMPLE_INTR_OPQ_SA5B (1<<2)
#define CISS_TL_SIMPLE_IPQ 0x40
#define CISS_TL_SIMPLE_OPQ 0x44
#define CISS_TL_SIMPLE_OPQ_EMPTY (~(u_int32_t)0)
#define CISS_TL_SIMPLE_OSR 0x9c
#define CISS_TL_SIMPLE_ODC 0xa0
#define CISS_TL_SIMPLE_ODC_CLEAR (0x1)
#define CISS_TL_SIMPLE_CFG_BAR 0xb4
#define CISS_TL_SIMPLE_CFG_OFF 0xb8
#define CISS_TL_SIMPLE_READ(sc, ofs) \
bus_space_read_4(sc->ciss_regs_btag, sc->ciss_regs_bhandle, ofs)
#define CISS_TL_SIMPLE_WRITE(sc, ofs, val) \
bus_space_write_4(sc->ciss_regs_btag, sc->ciss_regs_bhandle, ofs, val)
#define CISS_TL_SIMPLE_POST_CMD(sc, phys) CISS_TL_SIMPLE_WRITE(sc, CISS_TL_SIMPLE_IPQ, phys)
#define CISS_TL_SIMPLE_FETCH_CMD(sc) CISS_TL_SIMPLE_READ(sc, CISS_TL_SIMPLE_OPQ)
#define CISS_TL_PERF_INTR_OPQ (CISS_TL_SIMPLE_INTR_OPQ_SA5 | CISS_TL_SIMPLE_INTR_OPQ_SA5B)
#define CISS_TL_PERF_INTR_MSI 0x01
#define CISS_TL_PERF_POST_CMD(sc, cr) CISS_TL_SIMPLE_WRITE(sc, CISS_TL_SIMPLE_IPQ, cr->cr_ccphys | (cr)->cr_sg_tag)
#define CISS_TL_PERF_FLUSH_INT(sc) CISS_TL_SIMPLE_READ(sc, CISS_TL_SIMPLE_OSR)
#define CISS_TL_PERF_CLEAR_INT(sc) CISS_TL_SIMPLE_WRITE(sc, CISS_TL_SIMPLE_ODC, CISS_TL_SIMPLE_ODC_CLEAR)
#define CISS_CYCLE_MASK 0x00000001
#define CISS_MSI_COUNT 1
#define CISS_TL_SIMPLE_DISABLE_INTERRUPTS(sc) \
CISS_TL_SIMPLE_WRITE(sc, CISS_TL_SIMPLE_IMR, \
CISS_TL_SIMPLE_READ(sc, CISS_TL_SIMPLE_IMR) | (sc)->ciss_interrupt_mask)
#define CISS_TL_SIMPLE_ENABLE_INTERRUPTS(sc) \
CISS_TL_SIMPLE_WRITE(sc, CISS_TL_SIMPLE_IMR, \
CISS_TL_SIMPLE_READ(sc, CISS_TL_SIMPLE_IMR) & ~(sc)->ciss_interrupt_mask)
#endif