idareg.h (124471) | idareg.h (124539) |
---|---|
1/*- 2 * Copyright (c) 1999,2000 Jonathan Lemon 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 1999,2000 Jonathan Lemon 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/sys/dev/ida/idareg.h 124471 2004-01-13 11:28:21Z mdodd $ | 26 * $FreeBSD: head/sys/dev/ida/idareg.h 124539 2004-01-15 04:05:47Z mdodd $ |
27 */ 28 29/* 30 * #defines and software structures for the Compaq RAID card 31 */ 32 33/* 34 * defines for older EISA controllers (IDA, IDA-2, IAES, SMART) --- 40 unchanged lines hidden (view full) --- 75 */ 76#define INT_ENABLE_42XX 0x00 77#define INT_DISABLE_42XX 0x08 78#define STATUS_42XX_INT_PENDING 0x08 79 80/* 81 * return status codes 82 */ | 27 */ 28 29/* 30 * #defines and software structures for the Compaq RAID card 31 */ 32 33/* 34 * defines for older EISA controllers (IDA, IDA-2, IAES, SMART) --- 40 unchanged lines hidden (view full) --- 75 */ 76#define INT_ENABLE_42XX 0x00 77#define INT_DISABLE_42XX 0x08 78#define STATUS_42XX_INT_PENDING 0x08 79 80/* 81 * return status codes 82 */ |
83#define SOFT_ERROR 0x02 84#define HARD_ERROR 0x04 | 83#define SOFT_ERROR 0x02 /* Non-fatal error. */ 84#define HARD_ERROR 0x04 /* Fatal error. */ 85#define INVALID_ERROR 0x10 /* Invalid Request Block. */ |
85#define CMD_REJECTED 0x14 86 87/* 88 * command types 89 */ | 86#define CMD_REJECTED 0x14 87 88/* 89 * command types 90 */ |
90#define CMD_GET_LOG_DRV_INFO 0x10 91#define CMD_GET_CTRL_INFO 0x11 92#define CMD_SENSE_DRV_STATUS 0x12 93#define CMD_START_RECOVERY 0x13 94#define CMD_GET_PHYS_DRV_INFO 0x15 95#define CMD_BLINK_DRV_LEDS 0x16 96#define CMD_SENSE_DRV_LEDS 0x17 97#define CMD_GET_LOG_DRV_EXT 0x18 98#define CMD_GET_CTRL_INFO 0x11 99#define CMD_READ 0x20 100#define CMD_WRITE 0x30 101#define CMD_WRITE_MEDIA 0x31 102#define CMD_GET_CONFIG 0x50 103#define CMD_SET_CONFIG 0x51 104#define CMD_START_FIRMWARE 0x99 /* for integrated RAID */ 105#define CMD_FLUSH_CACHE 0xc2 | 91#define CMD_GET_LOG_DRV_INFO 0x10 /* Identify controller */ 92#define CMD_GET_CTRL_INFO 0x11 /* Identify logical driver */ 93#define CMD_SENSE_DRV_STATUS 0x12 /* Sense logical drive status */ 94#define CMD_START_RECOVERY 0x13 /* Start recover */ 95#define CMD_GET_PHYS_DRV_INFO 0x15 /* Identify physical drive */ 96#define CMD_BLINK_DRV_LEDS 0x16 /* Blink drive tray LEDs */ 97#define CMD_SENSE_DRV_LEDS 0x17 /* Sense Blinking drive tray LEDs */ 98#define CMD_GET_LOG_DRV_EXT 0x18 /* Identify logical drive, Extended */ 99#define CMD_READ 0x20 /* Read */ 100#define CMD_WRITE 0x30 /* Write */ 101#define CMD_WRITE_MEDIA 0x31 /* Write media */ 102#define CMD_RESET_CTRL 0x40 /* Reset controller */ 103#define CMD_GET_CONFIG 0x50 /* Sense configuration */ 104#define CMD_SET_CONFIG 0x51 /* Set configuration */ 105#define CMD_LABEL_LOG_DRV 0x57 /* Label logical drive */ 106#define CMD_SET_SURFACE_DELAY 0x60 /* Set surface delay */ 107#define CMD_SENSE_BUS_PARAMS 0x65 /* Sense bus parameters */ 108#define CMD_SENSE_SUBSYS_INFO 0x66 /* Sense Subsystem Information */ 109#define CMD_SENSE_SURFACE_ATS 0x70 /* Sense surface analysis task status */ 110#define CMD_PASSTHROUGH 0x90 /* Pass-through operation */ 111#define CMD_RESET_SCSI_DEV 0x94 /* Reset SCSI device */ 112#define CMD_PAUSE_BG_ACT 0x98 /* Pause Background Activity */ 113#define CMD_RESUME_BG_ACT 0x99 /* Resume Background Activity */ 114#define CMD_START_FIRMWARE 0x99 /* for integrated RAID */ 115#define CMD_SENSE_DRV_ERR_LOG 0xa6 /* Sense drive error log */ 116#define CMD_START_CPM 0xa7 /* Start controller performance monitoring */ 117#define CMD_SENSE_CP 0xa8 /* Sense controller performance */ 118#define CMD_STOP_CPM 0xa9 /* Stop controller performance monitoring */ 119#define CMD_FLUSH_CACHE 0xc2 /* Flush/disable write cache */ 120#define CMD_ACCEPT_MEDIA_EXCH 0xe0 /* Accept Media Exchange */ |
106 | 121 |
107/* 108 * command structures 109 */ 110struct ida_drive_info { 111 u_int16_t secsize; 112 u_int32_t secperunit; | 122/* logical drive parameter table */ 123struct ida_drive_param { |
113 u_int16_t ncylinders; 114 u_int8_t nheads; 115 u_int8_t signature; 116 u_int8_t psectors; 117 u_int16_t wprecomp; 118 u_int8_t max_acc; 119 u_int8_t control; 120 u_int16_t pcylinders; 121 u_int8_t ptracks; 122 u_int16_t landing_zone; 123 u_int8_t nsectors; 124 u_int8_t checksum; | 124 u_int16_t ncylinders; 125 u_int8_t nheads; 126 u_int8_t signature; 127 u_int8_t psectors; 128 u_int16_t wprecomp; 129 u_int8_t max_acc; 130 u_int8_t control; 131 u_int16_t pcylinders; 132 u_int8_t ptracks; 133 u_int16_t landing_zone; 134 u_int8_t nsectors; 135 u_int8_t checksum; |
125 u_int8_t mirror; | |
126} __packed; 127 | 136} __packed; 137 |
128struct ida_controller_info { 129 u_int8_t num_drvs; 130 u_int32_t signature; 131 u_int8_t firm_rev[4]; | 138#define IDA_RAID0 0 /* No fault tolerance. */ 139#define IDA_RAID4 1 /* Data Guard */ 140#define IDA_RAID1 2 /* Mirroring */ 141#define IDA_RAID5 3 /* Distributed Data Guard */ 142 143/* 144 * CMD_GET_LOG_DRV_INFO (0x10) 145 * Identify Logical Drive 146 */ 147struct ida_drive_info { 148 u_int16_t secsize; /* block size in bytes */ 149 u_int32_t secperunit; /* blocks available */ 150 struct ida_drive_param dp; /* logical drive parameter table */ 151 u_int8_t mirror; /* fault tolerance */ 152 u_int8_t reserved; 153 u_int8_t bios_disable; |
132} __packed; 133 | 154} __packed; 155 |
156/* 157 * CMD_GET_LOG_DRV_EXT (0x18) 158 * Identify Logical Drive, Extended 159 */ 160struct ida_drive_info_ext { 161 u_int16_t secsize; /* block size in bytes */ 162 u_int32_t secperunit; /* blocks available */ 163 struct ida_drive_param dp; /* logical drive parameter table */ 164 u_int8_t mirror; /* fault tolerance */ 165 u_int8_t reserved; 166 u_int8_t bios_disable; 167 u_int32_t ld_id; /* Logical drive identifier */ 168 u_int8_t ld_label[64]; /* Logical drive label */ 169} __packed; |
|
134 | 170 |
171/* 172 * CMD_GET_CTRL_INFO (0x11) 173 * Identify Controller 174 */ 175struct ida_controller_info { 176 u_int8_t num_drvs; /* Number of configured logical drives */ 177 u_int32_t signature; /* Configuration signature */ 178 u_int8_t firm_rev[4]; /* ASCII firmware revision */ 179 u_int8_t rom_rev[4]; /* ROM firmware revision */ 180 u_int8_t hw_rev; /* Revision level of the hardware */ 181 u_int32_t bb_rev; 182 u_int32_t dp_map; /* Drive present bit map */ 183 u_int32_t ed_map; /* External drive bit map */ 184 u_int32_t board_id; 185 u_int8_t cfg_error; 186 u_int32_t nd_map; /* Non-disk map */ 187 u_int8_t bad_ram_addr; 188 u_int8_t cpu_rev; 189 u_int8_t pdpi_rev; 190 u_int8_t epic_rev; 191 u_int8_t wcxc_rev; 192 u_int8_t mkt_rev; /* Marketing revision */ 193 u_int8_t cflag; /* Controller flags */ 194#define IDA_CI_CFLAG_7DPB (1<<3) 195#define IDA_CI_CFLAG_BIGMAP (1<<7) 196 u_int8_t hflag; 197 u_int8_t expand_dis; 198 u_int8_t scsi_cc; /* SCSI chip count */ 199 u_int32_t max_req_blocks; 200 u_int32_t cclock; /* Controller Clock */ 201 u_int8_t dp_scsi; /* Drives per SCSI bus */ 202 u_int16_t big_dp_map[8]; /* Big drive present bit map */ 203 u_int16_t big_ed_map[8]; /* Big external drive bit map */ 204 u_int16_t big_nd_map[8]; /* Big non-disk map */ 205 u_int16_t task_flags; 206 u_int8_t icl_bus; 207 u_int8_t red_modes; 208 u_int8_t cur_red_mode; 209 u_int8_t red_ctlr_stat; 210 u_int8_t red_fail_reason; 211 u_int8_t reserved[403]; 212} __packed; 213 214/* 215 * CMD_SENSE_DRV_STATUS (0x12) 216 * Sense logical drive status 217 */ |
|
135struct ida_drive_status { 136 u_int8_t status; 137 u_int32_t failure_map; | 218struct ida_drive_status { 219 u_int8_t status; 220 u_int32_t failure_map; |
138 u_int8_t reserved[416]; | 221 u_int16_t read_err[32]; 222 u_int16_t write_error[32]; 223 u_int8_t reserved0[288]; |
139 u_int32_t secrecover; 140 u_int8_t rebuilding; | 224 u_int32_t secrecover; 225 u_int8_t rebuilding; |
141 u_int16_t remap_cnt[8]; | 226 u_int16_t remap_cnt[32]; |
142 u_int32_t repl_map; 143 u_int32_t spare_map; 144 u_int8_t spare_status; 145 u_int8_t spare_repl_map[32]; 146 u_int32_t repl_ok_map; 147 u_int8_t media_exchange; 148 u_int8_t cache_failure; 149 u_int8_t expand_failure; 150 u_int8_t unit_flags; 151 u_int16_t big_failure_map[8]; 152 u_int16_t big_remap_cnt[128]; 153 u_int16_t big_repl_map[8]; 154 u_int16_t big_act_spare_map[8]; 155 u_int8_t big_spare_repl_map[128]; 156 u_int16_t big_repl_ok_map[8]; 157 u_int8_t big_rebuilding; | 227 u_int32_t repl_map; 228 u_int32_t spare_map; 229 u_int8_t spare_status; 230 u_int8_t spare_repl_map[32]; 231 u_int32_t repl_ok_map; 232 u_int8_t media_exchange; 233 u_int8_t cache_failure; 234 u_int8_t expand_failure; 235 u_int8_t unit_flags; 236 u_int16_t big_failure_map[8]; 237 u_int16_t big_remap_cnt[128]; 238 u_int16_t big_repl_map[8]; 239 u_int16_t big_act_spare_map[8]; 240 u_int8_t big_spare_repl_map[128]; 241 u_int16_t big_repl_ok_map[8]; 242 u_int8_t big_rebuilding; |
243 u_int8_t reserved1[36]; |
|
158} __packed; | 244} __packed; |
245 246/* 247 * CMD_GET_PHYS_DRV_INFO (0x15) 248 * Identify Physical Drive 249 */ 250struct ida_phys_drv_info { 251 u_int8_t scsi_bus; /* SCSI Bus */ 252 u_int8_t scsi_id; /* SCSI ID */ 253 u_int16_t blksize; /* block size in bytes */ 254 u_int32_t blkcount; /* total blocks */ 255 u_int32_t blkreserved; /* reserved blocks */ 256 u_int8_t drv_model[40]; /* drive model */ 257 u_int8_t drv_serial[40]; /* drive serial number */ 258 u_int8_t drv_fwrev[8]; /* drive firmware revision */ 259 u_int8_t scsi_inq; /* SCSI inquiry bits */ 260 u_int8_t cpq_drv_stmp; 261 u_int8_t last_fail; 262 u_int8_t pd_flags; /* physical drive flags */ 263#define PDF_DISK_PRESENT 0x01 264#define PDF_NONDISK_PRESENT 0x02 265#define PDF_WIDE_ENABLED 0x04 266#define PDF_SYNC 0x08 267#define PDF_NARROW_TRAY 0x10 268#define PDF_WIDEFAIL 0x20 269#define PDF_ULTRA 0x40 270#define PDF_ULTRA2 0x80 271 u_int8_t mpd_flags; /* more physical drive flags */ 272#define MPDF_SMART_SUPPORT 0x01 /* S.M.A.R.T supported */ 273#define MPDF_SMART_ERRORS 0x02 /* S.M.A.R.T errors recorded */ 274#define MPDF_SMART_ENABLED 0x04 /* S.M.A.R.T predictive failure is enabled */ 275#define MPDF_SMART_ERR_RESET 0x08 /* S.M.A.R.T errors recorded since last reset */ 276#define MPDF_DRIVE_EXTERNAL 0x10 /* Connected to external connector. */ 277#define MPDF_DRIVE_CONF_LVOL 0x20 /* Configured as part of a logical volume */ 278#define MPDF_DRIVE_CONF_SPARE 0x40 /* Configured as a spare */ 279#define MPDF_DRIVE_WCE 0x80 /* Drive WCE set on spinup */ 280 u_int8_t scsi_lun; 281 u_int8_t ympd_flags; /* yet more physical drive flags */ 282#define YMPDF_DRIVE_WCE_SET 0x40 /* WCE currently set */ 283#define YMPDF_DRIVE_WCE_CHNG 0x80 /* WCE changable */ 284 u_int8_t reserved; 285 u_int32_t spi_speed_rules; 286 u_int8_t phys_con[2]; /* Physical Connector */ 287 u_int8_t phys_box; /* Physical Box on Bus */ 288 u_int8_t phys_bay; /* Physical Bay in Box */ 289} __packed; 290 291/* 292 * CMD_BLINK_DRV_LEDS (0x16) 293 * Blink Drive Tray LEDs 294 * 295 * CMD_SENSE_DRV_LEDS (0x17) 296 * Sense Blinking Drive Tray LEDs 297 */ 298struct ida_blink_drv_leds { 299 u_int32_t bd; /* Blink duration (in 10ths sec) */ 300 u_int32_t bte; /* Blink time elapsed (sense only) */ 301 u_int8_t bse[256]; /* Blink/seek enable */ 302 u_int8_t reserved1[248]; 303} __packed; 304 305/* 306 * CMD_LABEL_LOG_DRV (0x57) 307 * Label Logical Drive 308 */ 309struct ida_label_logical { 310 u_int32_t ld_id; /* Logical drive identifier */ 311 u_int8_t ld_label[64]; /* Logical drive label */ 312} __packed; |
|