ipsreg.h (152919) | ipsreg.h (154005) |
---|---|
1/*- 2 * Copyright (c) 2002 Adaptec Inc. 3 * All rights reserved. 4 * 5 * Written by: David Jeffery 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * | 1/*- 2 * Copyright (c) 2002 Adaptec Inc. 3 * All rights reserved. 4 * 5 * Written by: David Jeffery 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * |
28 * $FreeBSD: head/sys/dev/ips/ipsreg.h 152919 2005-11-29 09:39:41Z scottl $ | 28 * $FreeBSD: head/sys/dev/ips/ipsreg.h 154005 2006-01-03 23:03:15Z scottl $ |
29 */ 30 31#include <sys/param.h> 32 33/* 34 * IPS CONSTANTS 35 */ 36#define IPS_VENDOR_ID 0x1014 --- 20 unchanged lines hidden (view full) --- 57#define IPS_STATIC_BUSY 0x08 58 59/* max number of commands set to something low for now */ 60#define IPS_MAX_CMD_NUM 128 61#define IPS_MAX_NUM_DRIVES 8 62#define IPS_MAX_SG_ELEMENTS 32 63#define IPS_MAX_IOBUF_SIZE (64 * 1024) 64#define IPS_BLKSIZE 512 | 29 */ 30 31#include <sys/param.h> 32 33/* 34 * IPS CONSTANTS 35 */ 36#define IPS_VENDOR_ID 0x1014 --- 20 unchanged lines hidden (view full) --- 57#define IPS_STATIC_BUSY 0x08 58 59/* max number of commands set to something low for now */ 60#define IPS_MAX_CMD_NUM 128 61#define IPS_MAX_NUM_DRIVES 8 62#define IPS_MAX_SG_ELEMENTS 32 63#define IPS_MAX_IOBUF_SIZE (64 * 1024) 64#define IPS_BLKSIZE 512 |
65#define IPS_MAX_LD 8 66#define IPS_MAX_CHANNELS 4 67#define IPS_MAX_TARGETS 15 68#define IPS_MAX_CHUNKS 16 |
|
65 66/* logical drive states */ 67 68#define IPS_LD_OFFLINE 0x02 69#define IPS_LD_OKAY 0x03 70#define IPS_LD_DEGRADED 0x04 71#define IPS_LD_FREE 0x00 72#define IPS_LD_SYS 0x06 --- 43 unchanged lines hidden (view full) --- 116/* command op codes */ 117#define IPS_READ_CMD 0x02 118#define IPS_WRITE_CMD 0x03 119#define IPS_ADAPTER_INFO_CMD 0x05 120#define IPS_CACHE_FLUSH_CMD 0x0A 121#define IPS_REBUILD_STATUS_CMD 0x0C 122#define IPS_ERROR_TABLE_CMD 0x17 123#define IPS_DRIVE_INFO_CMD 0x19 | 69 70/* logical drive states */ 71 72#define IPS_LD_OFFLINE 0x02 73#define IPS_LD_OKAY 0x03 74#define IPS_LD_DEGRADED 0x04 75#define IPS_LD_FREE 0x00 76#define IPS_LD_SYS 0x06 --- 43 unchanged lines hidden (view full) --- 120/* command op codes */ 121#define IPS_READ_CMD 0x02 122#define IPS_WRITE_CMD 0x03 123#define IPS_ADAPTER_INFO_CMD 0x05 124#define IPS_CACHE_FLUSH_CMD 0x0A 125#define IPS_REBUILD_STATUS_CMD 0x0C 126#define IPS_ERROR_TABLE_CMD 0x17 127#define IPS_DRIVE_INFO_CMD 0x19 |
128#define IPS_CMD_READ_CONF 0x38 |
|
124#define IPS_SUBSYS_PARAM_CMD 0x40 125#define IPS_CONFIG_SYNC_CMD 0x58 126#define IPS_SG_READ_CMD 0x82 127#define IPS_SG_WRITE_CMD 0x83 128#define IPS_RW_NVRAM_CMD 0xBC 129#define IPS_FFDC_CMD 0xD7 130 131/* basic_status information returned by the adapter */ --- 185 unchanged lines hidden (view full) --- 317 u_int16_t flash_prog_count; 318 u_int8_t defunct_disks; 319 u_int8_t rebuildflags; 320 u_int8_t offline_drivecount; 321 u_int8_t critical_drivecount; 322 u_int16_t config_update_count; 323 u_int8_t blockedflags; 324 u_int8_t psdn_error; | 129#define IPS_SUBSYS_PARAM_CMD 0x40 130#define IPS_CONFIG_SYNC_CMD 0x58 131#define IPS_SG_READ_CMD 0x82 132#define IPS_SG_WRITE_CMD 0x83 133#define IPS_RW_NVRAM_CMD 0xBC 134#define IPS_FFDC_CMD 0xD7 135 136/* basic_status information returned by the adapter */ --- 185 unchanged lines hidden (view full) --- 322 u_int16_t flash_prog_count; 323 u_int8_t defunct_disks; 324 u_int8_t rebuildflags; 325 u_int8_t offline_drivecount; 326 u_int8_t critical_drivecount; 327 u_int16_t config_update_count; 328 u_int8_t blockedflags; 329 u_int8_t psdn_error; |
325 u_int16_t addr_dead_disk[4*16];/* ugly, max # channels * max # scsi devices per channel */ | 330 u_int16_t addr_dead_disk[IPS_MAX_CHANNELS][IPS_MAX_TARGETS]; |
326}__attribute__((packed)) ips_adapter_info_t; 327 | 331}__attribute__((packed)) ips_adapter_info_t; 332 |
333typedef struct { 334 u_int8_t initiator; 335 u_int8_t parameters; 336 u_int8_t miscflag; 337 u_int8_t state; 338 u_int32_t blkcount; 339 u_int8_t deviceid[28]; 340} __attribute__((packed)) ips_devstate_t; 341 342/* 343 * The states that a physical drive can be in. The 'present' value can be 344 * OR'd with the other values. 345 */ 346#define IPS_DEVSTATE_PRESENT 0x81 347#define IPS_DEVSTATE_REBUILD 0x02 348#define IPS_DEVSTATE_SPARE 0x04 349#define IPS_DEVSTATE_MEMBER 0x08 350 351typedef struct { 352 u_int8_t channel; 353 u_int8_t target; 354 u_int16_t reserved; 355 u_int32_t startsectors; 356 u_int32_t numsectors; 357} __attribute__((packed)) ips_chunk_t; 358 359typedef struct { 360 u_int16_t userfield; 361 u_int8_t state; 362 u_int8_t raidcacheparam; 363 u_int8_t numchunkunits; 364 u_int8_t stripesize; 365 u_int8_t params; 366 u_int8_t reserved; 367 u_int32_t ldsize; 368 ips_chunk_t chunk[IPS_MAX_CHUNKS]; 369} __attribute__((packed)) ips_ld_t; 370 371typedef struct { 372 u_int8_t boarddisc[8]; 373 u_int8_t processor[8]; 374 u_int8_t numchantype; 375 u_int8_t numhostinttype; 376 u_int8_t compression; 377 u_int8_t nvramtype; 378 u_int32_t nvramsize; 379} __attribute__((packed)) ips_hardware_t; 380 381typedef struct { 382 u_int8_t ldcount; 383 u_int8_t day; 384 u_int8_t month; 385 u_int8_t year; 386 u_int8_t initiatorid[4]; 387 u_int8_t hostid[12]; 388 u_int8_t timesign[8]; 389 u_int32_t useropt; 390 u_int16_t userfield; 391 u_int8_t rebuildrate; 392 u_int8_t reserve; 393 ips_hardware_t hardwaredisc; 394 ips_ld_t ld[IPS_MAX_LD]; 395 ips_devstate_t dev[IPS_MAX_CHANNELS][IPS_MAX_TARGETS+1]; 396 u_int8_t reserved[512]; 397} __attribute__((packed)) ips_conf_t; 398 |
|
328typedef union { 329 struct { 330 u_int8_t reserved; 331 u_int8_t command_id; 332 u_int8_t basic_status; 333 u_int8_t extended_status; 334 } fields; 335 volatile u_int32_t value; 336} ips_cmd_status_t; 337 | 399typedef union { 400 struct { 401 u_int8_t reserved; 402 u_int8_t command_id; 403 u_int8_t basic_status; 404 u_int8_t extended_status; 405 } fields; 406 volatile u_int32_t value; 407} ips_cmd_status_t; 408 |