mly_tables.h (64987) | mly_tables.h (79695) |
---|---|
1/*- 2 * Copyright (c) 2000 Michael Smith 3 * Copyright (c) 2000 BSDi 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 10 unchanged lines hidden (view full) --- 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * | 1/*- 2 * Copyright (c) 2000 Michael Smith 3 * Copyright (c) 2000 BSDi 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 10 unchanged lines hidden (view full) --- 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * |
27 * $FreeBSD: head/sys/dev/mly/mly_tables.h 64987 2000-08-23 03:22:41Z msmith $ | 27 * $FreeBSD: head/sys/dev/mly/mly_tables.h 79695 2001-07-14 00:12:23Z msmith $ |
28 */ 29 30/* 31 * Lookup table for code-to-text translations. 32 */ 33struct mly_code_lookup { 34 char *string; 35 u_int32_t code; 36}; 37 | 28 */ 29 30/* 31 * Lookup table for code-to-text translations. 32 */ 33struct mly_code_lookup { 34 char *string; 35 u_int32_t code; 36}; 37 |
38extern char *mly_describe_code(struct mly_code_lookup *table, u_int32_t code); | 38static char *mly_describe_code(struct mly_code_lookup *table, u_int32_t code); |
39 | 39 |
40#ifndef MLY_DEFINE_TABLES 41extern struct mly_code_lookup mly_table_bustype[]; 42extern struct mly_code_lookup mly_table_controllertype[]; 43extern struct mly_code_lookup mly_table_oemname[]; 44extern struct mly_code_lookup mly_table_memorytype[]; 45extern struct mly_code_lookup mly_table_cputype[]; 46extern struct mly_code_lookup mly_table_event[]; 47extern struct mly_code_lookup mly_table_device_state[]; 48extern struct mly_code_lookup mly_table_device_type[]; 49extern struct mly_code_lookup mly_table_stripe_size[]; 50extern struct mly_code_lookup mly_table_cacheline_size[]; 51 52#else /* MLY_DEFINE_TABLES */ 53 | |
54/******************************************************************************** 55 * Look up a text description of a numeric code and return a pointer to same. 56 */ | 40/******************************************************************************** 41 * Look up a text description of a numeric code and return a pointer to same. 42 */ |
57char * | 43static char * |
58mly_describe_code(struct mly_code_lookup *table, u_int32_t code) 59{ 60 int i; 61 62 for (i = 0; table[i].string != NULL; i++) 63 if (table[i].code == code) 64 return(table[i].string); 65 return(table[i+1].string); 66} 67 | 44mly_describe_code(struct mly_code_lookup *table, u_int32_t code) 45{ 46 int i; 47 48 for (i = 0; table[i].string != NULL; i++) 49 if (table[i].code == code) 50 return(table[i].string); 51 return(table[i+1].string); 52} 53 |
68struct mly_code_lookup mly_table_bustype[] = { | 54static struct mly_code_lookup mly_table_bustype[] = { |
69 {"SCSI", 0x00}, 70 {"FC-AL", 0x01}, 71 {"PCI", 0x03}, 72 {NULL, 0}, 73 {"unknown bus", 0} 74}; 75 | 55 {"SCSI", 0x00}, 56 {"FC-AL", 0x01}, 57 {"PCI", 0x03}, 58 {NULL, 0}, 59 {"unknown bus", 0} 60}; 61 |
76struct mly_code_lookup mly_table_controllertype[] = { | 62static struct mly_code_lookup mly_table_controllertype[] = { |
77#if 0 /* not supported by this driver */ 78 {"DAC960E", 0x01}, /* EISA */ 79 {"DAC960M", 0x08}, /* MCA */ 80 {"DAC960PD", 0x10}, /* PCI Dual */ 81 {"DAC960PL", 0x11}, /* PCU low-cost */ 82 {"DAC960PDU", 0x12}, /* PD Ultra */ 83 {"DAC960PE", 0x13}, /* Peregrine low-cost */ 84 {"DAC960PG", 0x14}, /* Peregrine high-performance */ --- 9 unchanged lines hidden (view full) --- 94 {"EXR3000P", 0x1d}, /* Fibre Apple */ 95 {"AcceleRAID 352", 0x1e}, /* Leopard */ 96 {"AcceleRAID 170", 0x1f}, /* Lynx */ 97 {"AcceleRAID 160", 0x20}, /* Bobcat */ 98 {NULL, 0}, 99 {"unknown adapter", 0} 100}; 101 | 63#if 0 /* not supported by this driver */ 64 {"DAC960E", 0x01}, /* EISA */ 65 {"DAC960M", 0x08}, /* MCA */ 66 {"DAC960PD", 0x10}, /* PCI Dual */ 67 {"DAC960PL", 0x11}, /* PCU low-cost */ 68 {"DAC960PDU", 0x12}, /* PD Ultra */ 69 {"DAC960PE", 0x13}, /* Peregrine low-cost */ 70 {"DAC960PG", 0x14}, /* Peregrine high-performance */ --- 9 unchanged lines hidden (view full) --- 80 {"EXR3000P", 0x1d}, /* Fibre Apple */ 81 {"AcceleRAID 352", 0x1e}, /* Leopard */ 82 {"AcceleRAID 170", 0x1f}, /* Lynx */ 83 {"AcceleRAID 160", 0x20}, /* Bobcat */ 84 {NULL, 0}, 85 {"unknown adapter", 0} 86}; 87 |
102struct mly_code_lookup mly_table_oemname[] = { | 88static struct mly_code_lookup mly_table_oemname[] = { |
103 {"Mylex", MLY_OEM_MYLEX}, 104 {"IBM", MLY_OEM_IBM}, 105 {"Hewlett-Packard", MLY_OEM_HP}, 106 {"DEC/Compaq", MLY_OEM_DEC}, 107 {"Siemens", MLY_OEM_SIEMENS}, 108 {"Intel", MLY_OEM_INTEL}, 109 {NULL, 0}, 110 {"unknown OEM", 0} 111}; 112 | 89 {"Mylex", MLY_OEM_MYLEX}, 90 {"IBM", MLY_OEM_IBM}, 91 {"Hewlett-Packard", MLY_OEM_HP}, 92 {"DEC/Compaq", MLY_OEM_DEC}, 93 {"Siemens", MLY_OEM_SIEMENS}, 94 {"Intel", MLY_OEM_INTEL}, 95 {NULL, 0}, 96 {"unknown OEM", 0} 97}; 98 |
113struct mly_code_lookup mly_table_memorytype[] = { | 99static struct mly_code_lookup mly_table_memorytype[] = { |
114 {"DRAM", 0x01}, 115 {"EDRAM", 0x02}, 116 {"EDO RAM", 0x03}, 117 {"SDRAM", 0x04}, 118 {NULL, 0}, 119 {"unknown memory", 0} 120}; 121 | 100 {"DRAM", 0x01}, 101 {"EDRAM", 0x02}, 102 {"EDO RAM", 0x03}, 103 {"SDRAM", 0x04}, 104 {NULL, 0}, 105 {"unknown memory", 0} 106}; 107 |
122struct mly_code_lookup mly_table_cputype[] = { | 108static struct mly_code_lookup mly_table_cputype[] = { |
123 {"i960CA", 0x01}, 124 {"i960RD", 0x02}, 125 {"i960RN", 0x03}, 126 {"i960RP", 0x04}, 127 {"NorthBay(?)", 0x05}, 128 {"StrongArm", 0x06}, 129 {"i960RM", 0x07}, 130 {NULL, 0}, --- 17 unchanged lines hidden (view full) --- 148 * These messages will only be printed if bootverbose is set. 149 * 150 * The second character in the string indicates an action to be taken as a 151 * result of the event. 152 * 153 * r rescan the device for possible state change 154 * 155 */ | 109 {"i960CA", 0x01}, 110 {"i960RD", 0x02}, 111 {"i960RN", 0x03}, 112 {"i960RP", 0x04}, 113 {"NorthBay(?)", 0x05}, 114 {"StrongArm", 0x06}, 115 {"i960RM", 0x07}, 116 {NULL, 0}, --- 17 unchanged lines hidden (view full) --- 134 * These messages will only be printed if bootverbose is set. 135 * 136 * The second character in the string indicates an action to be taken as a 137 * result of the event. 138 * 139 * r rescan the device for possible state change 140 * 141 */ |
156struct mly_code_lookup mly_table_event[] = { | 142static struct mly_code_lookup mly_table_event[] = { |
157 /* physical device events (0x0000 - 0x007f) */ 158 {"pr online", 0x0001}, 159 {"pr standby", 0x0002}, 160 {"p automatic rebuild started", 0x0005}, 161 {"p manual rebuild started", 0x0006}, 162 {"pr rebuild completed", 0x0007}, 163 {"pr rebuild cancelled", 0x0008}, 164 {"pr rebuild failed for unknown reasons", 0x0009}, --- 96 unchanged lines hidden (view full) --- 261 {NULL, 0}, 262 {"? unknown event code", 0} 263}; 264 265/* 266 * Values here must be 16 characters or less, as they are packed into 267 * the 'product' field in the SCSI inquiry data. 268 */ | 143 /* physical device events (0x0000 - 0x007f) */ 144 {"pr online", 0x0001}, 145 {"pr standby", 0x0002}, 146 {"p automatic rebuild started", 0x0005}, 147 {"p manual rebuild started", 0x0006}, 148 {"pr rebuild completed", 0x0007}, 149 {"pr rebuild cancelled", 0x0008}, 150 {"pr rebuild failed for unknown reasons", 0x0009}, --- 96 unchanged lines hidden (view full) --- 247 {NULL, 0}, 248 {"? unknown event code", 0} 249}; 250 251/* 252 * Values here must be 16 characters or less, as they are packed into 253 * the 'product' field in the SCSI inquiry data. 254 */ |
269struct mly_code_lookup mly_table_device_state[] = { | 255static struct mly_code_lookup mly_table_device_state[] = { |
270 {"offline", MLY_DEVICE_STATE_OFFLINE}, 271 {"unconfigured", MLY_DEVICE_STATE_UNCONFIGURED}, 272 {"online", MLY_DEVICE_STATE_ONLINE}, 273 {"critical", MLY_DEVICE_STATE_CRITICAL}, 274 {"writeonly", MLY_DEVICE_STATE_WRITEONLY}, 275 {"standby", MLY_DEVICE_STATE_STANDBY}, 276 {"missing", MLY_DEVICE_STATE_MISSING}, 277 {NULL, 0}, 278 {"unknown state", 0} 279}; 280 281/* 282 * Values here must be 8 characters or less, as they are packed into 283 * the 'vendor' field in the SCSI inquiry data. 284 */ | 256 {"offline", MLY_DEVICE_STATE_OFFLINE}, 257 {"unconfigured", MLY_DEVICE_STATE_UNCONFIGURED}, 258 {"online", MLY_DEVICE_STATE_ONLINE}, 259 {"critical", MLY_DEVICE_STATE_CRITICAL}, 260 {"writeonly", MLY_DEVICE_STATE_WRITEONLY}, 261 {"standby", MLY_DEVICE_STATE_STANDBY}, 262 {"missing", MLY_DEVICE_STATE_MISSING}, 263 {NULL, 0}, 264 {"unknown state", 0} 265}; 266 267/* 268 * Values here must be 8 characters or less, as they are packed into 269 * the 'vendor' field in the SCSI inquiry data. 270 */ |
285struct mly_code_lookup mly_table_device_type[] = { | 271static struct mly_code_lookup mly_table_device_type[] = { |
286 {"RAID 0", MLY_DEVICE_TYPE_RAID0}, 287 {"RAID 1", MLY_DEVICE_TYPE_RAID1}, 288 {"RAID 3", MLY_DEVICE_TYPE_RAID3}, /* right asymmetric parity */ 289 {"RAID 5", MLY_DEVICE_TYPE_RAID5}, /* right asymmetric parity */ 290 {"RAID 6", MLY_DEVICE_TYPE_RAID6}, /* Mylex RAID 6 */ 291 {"RAID 7", MLY_DEVICE_TYPE_RAID7}, /* JBOD */ 292 {"SPAN", MLY_DEVICE_TYPE_NEWSPAN}, /* New Mylex SPAN */ 293 {"RAID 3", MLY_DEVICE_TYPE_RAID3F}, /* fixed parity */ 294 {"RAID 3", MLY_DEVICE_TYPE_RAID3L}, /* left symmetric parity */ 295 {"SPAN", MLY_DEVICE_TYPE_SPAN}, /* current spanning implementation */ 296 {"RAID 5", MLY_DEVICE_TYPE_RAID5L}, /* left symmetric parity */ 297 {"RAID E", MLY_DEVICE_TYPE_RAIDE}, /* concatenation */ 298 {"PHYSICAL", MLY_DEVICE_TYPE_PHYSICAL}, /* physical device */ 299 {NULL, 0}, 300 {"UNKNOWN", 0} 301}; 302 | 272 {"RAID 0", MLY_DEVICE_TYPE_RAID0}, 273 {"RAID 1", MLY_DEVICE_TYPE_RAID1}, 274 {"RAID 3", MLY_DEVICE_TYPE_RAID3}, /* right asymmetric parity */ 275 {"RAID 5", MLY_DEVICE_TYPE_RAID5}, /* right asymmetric parity */ 276 {"RAID 6", MLY_DEVICE_TYPE_RAID6}, /* Mylex RAID 6 */ 277 {"RAID 7", MLY_DEVICE_TYPE_RAID7}, /* JBOD */ 278 {"SPAN", MLY_DEVICE_TYPE_NEWSPAN}, /* New Mylex SPAN */ 279 {"RAID 3", MLY_DEVICE_TYPE_RAID3F}, /* fixed parity */ 280 {"RAID 3", MLY_DEVICE_TYPE_RAID3L}, /* left symmetric parity */ 281 {"SPAN", MLY_DEVICE_TYPE_SPAN}, /* current spanning implementation */ 282 {"RAID 5", MLY_DEVICE_TYPE_RAID5L}, /* left symmetric parity */ 283 {"RAID E", MLY_DEVICE_TYPE_RAIDE}, /* concatenation */ 284 {"PHYSICAL", MLY_DEVICE_TYPE_PHYSICAL}, /* physical device */ 285 {NULL, 0}, 286 {"UNKNOWN", 0} 287}; 288 |
303struct mly_code_lookup mly_table_stripe_size[] = { | 289static struct mly_code_lookup mly_table_stripe_size[] = { |
304 {"NONE", MLY_STRIPE_ZERO}, 305 {"512B", MLY_STRIPE_512b}, 306 {"1k", MLY_STRIPE_1k}, 307 {"2k", MLY_STRIPE_2k}, 308 {"4k", MLY_STRIPE_4k}, 309 {"8k", MLY_STRIPE_8k}, 310 {"16k", MLY_STRIPE_16k}, 311 {"32k", MLY_STRIPE_32k}, 312 {"64k", MLY_STRIPE_64k}, 313 {"128k", MLY_STRIPE_128k}, 314 {"256k", MLY_STRIPE_256k}, 315 {"512k", MLY_STRIPE_512k}, 316 {"1M", MLY_STRIPE_1m}, 317 {NULL, 0}, 318 {"unknown", 0} 319}; 320 | 290 {"NONE", MLY_STRIPE_ZERO}, 291 {"512B", MLY_STRIPE_512b}, 292 {"1k", MLY_STRIPE_1k}, 293 {"2k", MLY_STRIPE_2k}, 294 {"4k", MLY_STRIPE_4k}, 295 {"8k", MLY_STRIPE_8k}, 296 {"16k", MLY_STRIPE_16k}, 297 {"32k", MLY_STRIPE_32k}, 298 {"64k", MLY_STRIPE_64k}, 299 {"128k", MLY_STRIPE_128k}, 300 {"256k", MLY_STRIPE_256k}, 301 {"512k", MLY_STRIPE_512k}, 302 {"1M", MLY_STRIPE_1m}, 303 {NULL, 0}, 304 {"unknown", 0} 305}; 306 |
321struct mly_code_lookup mly_table_cacheline_size[] = { | 307static struct mly_code_lookup mly_table_cacheline_size[] = { |
322 {"NONE", MLY_CACHELINE_ZERO}, 323 {"512B", MLY_CACHELINE_512b}, 324 {"1k", MLY_CACHELINE_1k}, 325 {"2k", MLY_CACHELINE_2k}, 326 {"4k", MLY_CACHELINE_4k}, 327 {"8k", MLY_CACHELINE_8k}, 328 {"16k", MLY_CACHELINE_16k}, 329 {"32k", MLY_CACHELINE_32k}, 330 {"64k", MLY_CACHELINE_64k}, 331 {NULL, 0}, 332 {"unknown", 0} 333}; | 308 {"NONE", MLY_CACHELINE_ZERO}, 309 {"512B", MLY_CACHELINE_512b}, 310 {"1k", MLY_CACHELINE_1k}, 311 {"2k", MLY_CACHELINE_2k}, 312 {"4k", MLY_CACHELINE_4k}, 313 {"8k", MLY_CACHELINE_8k}, 314 {"16k", MLY_CACHELINE_16k}, 315 {"32k", MLY_CACHELINE_32k}, 316 {"64k", MLY_CACHELINE_64k}, 317 {NULL, 0}, 318 {"unknown", 0} 319}; |
334 335#endif /* MLY_DEFINE_TABLES */ | |