1 1.15 andvar /* $NetBSD: aacreg.h,v 1.15 2024/02/02 22:19:13 andvar Exp $ */ 2 1.1 ad 3 1.1 ad /*- 4 1.6 briggs * Copyright (c) 2002, 2007 The NetBSD Foundation, Inc. 5 1.1 ad * All rights reserved. 6 1.1 ad * 7 1.1 ad * This code is derived from software contributed to The NetBSD Foundation 8 1.1 ad * by Andrew Doran. 9 1.1 ad * 10 1.1 ad * Redistribution and use in source and binary forms, with or without 11 1.1 ad * modification, are permitted provided that the following conditions 12 1.1 ad * are met: 13 1.1 ad * 1. Redistributions of source code must retain the above copyright 14 1.1 ad * notice, this list of conditions and the following disclaimer. 15 1.1 ad * 2. Redistributions in binary form must reproduce the above copyright 16 1.1 ad * notice, this list of conditions and the following disclaimer in the 17 1.1 ad * documentation and/or other materials provided with the distribution. 18 1.1 ad * 19 1.1 ad * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20 1.1 ad * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21 1.1 ad * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 1.1 ad * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 1.1 ad * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 1.1 ad * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 1.1 ad * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 1.1 ad * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 1.1 ad * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 1.1 ad * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 1.1 ad * POSSIBILITY OF SUCH DAMAGE. 30 1.1 ad */ 31 1.1 ad 32 1.1 ad /*- 33 1.1 ad * Copyright (c) 2000 Michael Smith 34 1.6 briggs * Copyright (c) 2000-2001 Scott Long 35 1.1 ad * Copyright (c) 2000 BSDi 36 1.1 ad * Copyright (c) 2000 Niklas Hallqvist 37 1.1 ad * All rights reserved. 38 1.1 ad * 39 1.1 ad * Redistribution and use in source and binary forms, with or without 40 1.1 ad * modification, are permitted provided that the following conditions 41 1.1 ad * are met: 42 1.1 ad * 1. Redistributions of source code must retain the above copyright 43 1.1 ad * notice, this list of conditions and the following disclaimer. 44 1.1 ad * 2. Redistributions in binary form must reproduce the above copyright 45 1.1 ad * notice, this list of conditions and the following disclaimer in the 46 1.1 ad * documentation and/or other materials provided with the distribution. 47 1.1 ad * 48 1.1 ad * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 49 1.1 ad * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 50 1.1 ad * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 51 1.1 ad * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 52 1.1 ad * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 53 1.1 ad * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 54 1.1 ad * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 55 1.1 ad * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 56 1.1 ad * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 57 1.1 ad * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 58 1.1 ad * SUCH DAMAGE. 59 1.1 ad * 60 1.1 ad * from FreeBSD: aacreg.h,v 1.1 2000/09/13 03:20:34 msmith Exp 61 1.1 ad * via OpenBSD: aacreg.h,v 1.3 2001/06/12 15:40:29 niklas Exp 62 1.6 briggs * incorporating some of: aacreg.h,v 1.23 2005/10/14 16:22:45 scottl Exp 63 1.1 ad */ 64 1.1 ad 65 1.1 ad /* 66 1.1 ad * Data structures defining the interface between the driver and the Adaptec 67 1.1 ad * 'FSA' adapters. Note that many field names and comments here are taken 68 1.1 ad * verbatim from the Adaptec driver source in order to make comparing the 69 1.1 ad * two slightly easier. 70 1.1 ad */ 71 1.1 ad 72 1.1 ad #ifndef _PCI_AACREG_H_ 73 1.1 ad #define _PCI_AACREG_H_ 74 1.1 ad 75 1.1 ad /* 76 1.1 ad * Misc. magic numbers. 77 1.1 ad */ 78 1.1 ad #define AAC_MAX_CONTAINERS 64 79 1.1 ad #define AAC_BLOCK_SIZE 512 80 1.1 ad 81 1.1 ad /* 82 1.1 ad * Communications interface. 83 1.1 ad * 84 1.1 ad * Where datastructure layouts are closely parallel to the Adaptec sample code, 85 1.1 ad * retain their naming conventions (for now) to aid in cross-referencing. 86 1.1 ad */ 87 1.1 ad 88 1.1 ad /* 89 1.1 ad * We establish 4 command queues and matching response queues. Queues must 90 1.1 ad * be 16-byte aligned, and are sized as follows: 91 1.1 ad */ 92 1.1 ad #define AAC_HOST_NORM_CMD_ENTRIES 8 /* cmd adapter->host, normal pri */ 93 1.1 ad #define AAC_HOST_HIGH_CMD_ENTRIES 4 /* cmd adapter->host, high pri */ 94 1.1 ad #define AAC_ADAP_NORM_CMD_ENTRIES 512 /* cmd host->adapter, normal pri */ 95 1.1 ad #define AAC_ADAP_HIGH_CMD_ENTRIES 4 /* cmd host->adapter, high pri */ 96 1.1 ad #define AAC_HOST_NORM_RESP_ENTRIES 512 /* resp, adapter->host, normal pri */ 97 1.1 ad #define AAC_HOST_HIGH_RESP_ENTRIES 4 /* resp, adapter->host, high pri */ 98 1.1 ad #define AAC_ADAP_NORM_RESP_ENTRIES 8 /* resp, host->adapter, normal pri */ 99 1.1 ad #define AAC_ADAP_HIGH_RESP_ENTRIES 4 /* resp, host->adapter, high pri */ 100 1.1 ad 101 1.1 ad #define AAC_TOTALQ_LENGTH \ 102 1.1 ad (AAC_HOST_HIGH_CMD_ENTRIES + AAC_HOST_NORM_CMD_ENTRIES + \ 103 1.1 ad AAC_ADAP_HIGH_CMD_ENTRIES + AAC_ADAP_NORM_CMD_ENTRIES + \ 104 1.1 ad AAC_HOST_HIGH_RESP_ENTRIES + AAC_HOST_NORM_RESP_ENTRIES + \ 105 1.1 ad AAC_ADAP_HIGH_RESP_ENTRIES + AAC_ADAP_NORM_RESP_ENTRIES) 106 1.1 ad 107 1.1 ad #define AAC_QUEUE_COUNT 8 108 1.1 ad #define AAC_QUEUE_ALIGN 16 109 1.1 ad 110 1.1 ad struct aac_queue_entry { 111 1.1 ad u_int32_t aq_fib_size; /* FIB size in bytes */ 112 1.1 ad u_int32_t aq_fib_addr; /* receiver-space address of the FIB */ 113 1.12 gmcgarry } __packed; 114 1.1 ad 115 1.1 ad #define AAC_PRODUCER_INDEX 0 116 1.1 ad #define AAC_CONSUMER_INDEX 1 117 1.1 ad 118 1.1 ad /* 119 1.1 ad * Table of queue indices and queues used to communicate with the 120 1.1 ad * controller. This structure must be aligned to AAC_QUEUE_ALIGN 121 1.1 ad */ 122 1.1 ad struct aac_queue_table { 123 1.1 ad /* queue consumer/producer indexes (layout mandated by adapter) */ 124 1.1 ad u_int32_t qt_qindex[AAC_QUEUE_COUNT][2]; 125 1.1 ad 126 1.1 ad /* queue entry structures (layout mandated by adapter) */ 127 1.1 ad struct aac_queue_entry qt_HostNormCmdQueue[AAC_HOST_NORM_CMD_ENTRIES]; 128 1.1 ad struct aac_queue_entry qt_HostHighCmdQueue[AAC_HOST_HIGH_CMD_ENTRIES]; 129 1.1 ad struct aac_queue_entry qt_AdapNormCmdQueue[AAC_ADAP_NORM_CMD_ENTRIES]; 130 1.1 ad struct aac_queue_entry qt_AdapHighCmdQueue[AAC_ADAP_HIGH_CMD_ENTRIES]; 131 1.1 ad struct aac_queue_entry 132 1.1 ad qt_HostNormRespQueue[AAC_HOST_NORM_RESP_ENTRIES]; 133 1.1 ad struct aac_queue_entry 134 1.1 ad qt_HostHighRespQueue[AAC_HOST_HIGH_RESP_ENTRIES]; 135 1.1 ad struct aac_queue_entry 136 1.1 ad qt_AdapNormRespQueue[AAC_ADAP_NORM_RESP_ENTRIES]; 137 1.1 ad struct aac_queue_entry 138 1.1 ad qt_AdapHighRespQueue[AAC_ADAP_HIGH_RESP_ENTRIES]; 139 1.12 gmcgarry } __packed; 140 1.1 ad 141 1.1 ad /* 142 1.3 perry * Adapter Init Structure: this is passed to the adapter with the 143 1.1 ad * AAC_MONKER_INITSTRUCT command to point it at our control structures. 144 1.1 ad */ 145 1.1 ad struct aac_adapter_init { 146 1.1 ad u_int32_t InitStructRevision; 147 1.1 ad u_int32_t MiniPortRevision; 148 1.1 ad u_int32_t FilesystemRevision; 149 1.1 ad u_int32_t CommHeaderAddress; 150 1.1 ad u_int32_t FastIoCommAreaAddress; 151 1.1 ad u_int32_t AdapterFibsPhysicalAddress; 152 1.7 briggs u_int32_t AdapterFibsVirtualAddress; 153 1.1 ad u_int32_t AdapterFibsSize; 154 1.1 ad u_int32_t AdapterFibAlign; 155 1.1 ad u_int32_t PrintfBufferAddress; 156 1.1 ad u_int32_t PrintfBufferSize; 157 1.1 ad u_int32_t HostPhysMemPages; 158 1.1 ad u_int32_t HostElapsedSeconds; 159 1.7 briggs /* ADAPTER_INIT_STRUCT_REVISION_4 begins here */ 160 1.7 briggs u_int32_t InitFlags; /* flags for supported features */ 161 1.7 briggs u_int32_t MaxIoCommands; /* max outstanding commands */ 162 1.7 briggs u_int32_t MaxIoSize; /* largest I/O command */ 163 1.7 briggs u_int32_t MaxFibSize; /* largest FIB to adapter */ 164 1.10 perry } __packed; 165 1.1 ad 166 1.8 briggs #define AAC_INIT_STRUCT_REVISION 3 167 1.8 briggs #define AAC_INIT_STRUCT_REVISION_4 4 168 1.8 briggs #define AAC_INIT_STRUCT_MINIPORT_REVISION 1 169 1.8 briggs #define AAC_INITFLAGS_NEW_COMM_SUPPORTED 1 170 1.8 briggs #define AAC_PAGE_SIZE 4096 /* Used to set HostPhysMemPages */ 171 1.8 briggs 172 1.1 ad /* 173 1.1 ad * Shared data types 174 1.1 ad */ 175 1.1 ad 176 1.1 ad /* 177 1.1 ad * Container types 178 1.1 ad */ 179 1.1 ad #define CT_NONE 0 180 1.1 ad #define CT_VOLUME 1 181 1.1 ad #define CT_MIRROR 2 182 1.1 ad #define CT_STRIPE 3 183 1.1 ad #define CT_RAID5 4 184 1.1 ad #define CT_SSRW 5 185 1.1 ad #define CT_SSRO 6 186 1.1 ad #define CT_MORPH 7 187 1.1 ad #define CT_PASSTHRU 8 188 1.1 ad #define CT_RAID4 9 189 1.1 ad #define CT_RAID10 10 /* stripe of mirror */ 190 1.1 ad #define CT_RAID00 11 /* stripe of stripe */ 191 1.1 ad #define CT_VOLUME_OF_MIRRORS 12 /* volume of mirror */ 192 1.1 ad #define CT_PSEUDO_RAID3 13 /* really raid4 */ 193 1.9 briggs #define CT_RAID50 14 /* stripe of raid5 */ 194 1.9 briggs #define CT_RAID5D 15 /* raid5 distributed hot-sparing */ 195 1.9 briggs #define CT_RAID5D0 16 196 1.9 briggs #define CT_RAID1E 17 /* extended raid1 mirroring */ 197 1.9 briggs #define CT_RAID6 18 198 1.9 briggs #define CT_RAID60 19 199 1.1 ad 200 1.1 ad /* 201 1.1 ad * Host-addressable object types 202 1.1 ad */ 203 1.1 ad #define FT_REG 1 /* regular file */ 204 1.1 ad #define FT_DIR 2 /* directory */ 205 1.1 ad #define FT_BLK 3 /* "block" device - reserved */ 206 1.1 ad #define FT_CHR 4 /* "character special" device - reserved */ 207 1.1 ad #define FT_LNK 5 /* symbolic link */ 208 1.1 ad #define FT_SOCK 6 /* socket */ 209 1.1 ad #define FT_FIFO 7 /* fifo */ 210 1.1 ad #define FT_FILESYS 8 /* ADAPTEC's "FSA"(tm) filesystem */ 211 1.1 ad #define FT_DRIVE 9 /* phys disk - addressable in scsi by bus/target/lun */ 212 1.1 ad #define FT_SLICE 10 /* virtual disk - raw volume - slice */ 213 1.1 ad #define FT_PARTITION 11 /* FSA part, inside slice, container building block */ 214 1.1 ad #define FT_VOLUME 12 /* Container - Volume Set */ 215 1.1 ad #define FT_STRIPE 13 /* Container - Stripe Set */ 216 1.1 ad #define FT_MIRROR 14 /* Container - Mirror Set */ 217 1.1 ad #define FT_RAID5 15 /* Container - Raid 5 Set */ 218 1.1 ad #define FT_DATABASE 16 /* Storage object with "foreign" content manager */ 219 1.1 ad 220 1.1 ad /* 221 1.9 briggs * Host-side scatter/gather list for raw commands. 222 1.9 briggs */ 223 1.9 briggs struct aac_sg_entryraw { 224 1.9 briggs u_int32_t Next; /* reserved for FW use */ 225 1.9 briggs u_int32_t Prev; /* reserved for FW use */ 226 1.9 briggs u_int64_t SgAddress; 227 1.9 briggs u_int32_t SgByteCount; 228 1.9 briggs u_int32_t Flags; /* reserved for FW use */ 229 1.12 gmcgarry } __packed; 230 1.9 briggs 231 1.9 briggs struct aac_sg_tableraw { 232 1.9 briggs u_int32_t SgCount; 233 1.9 briggs struct aac_sg_entryraw SgEntryRaw[0]; 234 1.12 gmcgarry } __packed; 235 1.9 briggs 236 1.9 briggs /* 237 1.1 ad * Host-side scatter/gather list for 32-bit commands. 238 1.1 ad */ 239 1.1 ad struct aac_sg_entry { 240 1.1 ad u_int32_t SgAddress; 241 1.1 ad u_int32_t SgByteCount; 242 1.12 gmcgarry } __packed; 243 1.1 ad 244 1.1 ad struct aac_sg_table { 245 1.1 ad u_int32_t SgCount; 246 1.9 briggs struct aac_sg_entry SgEntry[0]; 247 1.12 gmcgarry } __packed; 248 1.1 ad 249 1.1 ad /* 250 1.1 ad * Host-side scatter/gather list for 64-bit commands. 251 1.1 ad */ 252 1.9 briggs struct aac_sg_entry64 { 253 1.9 briggs u_int64_t SgAddress; 254 1.9 briggs u_int32_t SgByteCount; 255 1.12 gmcgarry } __packed; 256 1.9 briggs 257 1.1 ad struct aac_sg_table64 { 258 1.9 briggs u_int32_t SgCount; 259 1.9 briggs struct aac_sg_entry64 SgEntry64[0]; 260 1.12 gmcgarry } __packed; 261 1.1 ad 262 1.1 ad /* 263 1.1 ad * Container creation data 264 1.1 ad */ 265 1.1 ad struct aac_container_creation { 266 1.1 ad u_int8_t ViaBuildNumber; 267 1.1 ad u_int8_t MicroSecond; 268 1.1 ad u_int8_t Via; /* 1 = FSU, 2 = API, etc. */ 269 1.1 ad u_int8_t YearsSince1900; 270 1.1 ad u_int32_t Month:4; /* 1-12 */ 271 1.1 ad u_int32_t Day:6; /* 1-32 */ 272 1.1 ad u_int32_t Hour:6; /* 0-23 */ 273 1.1 ad u_int32_t Minute:6; /* 0-59 */ 274 1.1 ad u_int32_t Second:6; /* 0-59 */ 275 1.1 ad u_int64_t ViaAdapterSerialNumber; 276 1.12 gmcgarry } __packed; 277 1.1 ad 278 1.9 briggs typedef enum { 279 1.9 briggs RevApplication = 1, 280 1.9 briggs RevDkiCli, 281 1.9 briggs RevNetService, 282 1.9 briggs RevApi, 283 1.9 briggs RevFileSysDriver, 284 1.9 briggs RevMiniportDriver, 285 1.9 briggs RevAdapterSW, 286 1.9 briggs RevMonitor, 287 1.9 briggs RevRemoteApi, 288 1.9 briggs } RevComponent; 289 1.9 briggs 290 1.1 ad struct FsaRevision { 291 1.1 ad union { 292 1.1 ad struct { 293 1.1 ad u_int8_t dash; 294 1.1 ad u_int8_t type; 295 1.1 ad u_int8_t minor; 296 1.1 ad u_int8_t major; 297 1.1 ad } comp; 298 1.1 ad u_int32_t ul; 299 1.1 ad } external; 300 1.1 ad u_int32_t buildNumber; 301 1.10 perry } __packed; 302 1.1 ad 303 1.1 ad /* 304 1.1 ad * Adapter Information 305 1.1 ad */ 306 1.1 ad 307 1.1 ad #define CPU_NTSIM 1 308 1.1 ad #define CPU_I960 2 309 1.1 ad #define CPU_ARM 3 310 1.1 ad #define CPU_SPARC 4 311 1.1 ad #define CPU_POWERPC 5 312 1.1 ad #define CPU_ALPHA 6 313 1.1 ad #define CPU_P7 7 314 1.1 ad #define CPU_I960_RX 8 315 1.1 ad #define CPU__last 9 316 1.1 ad 317 1.1 ad #define CPUI960_JX 1 318 1.1 ad #define CPUI960_CX 2 319 1.1 ad #define CPUI960_HX 3 320 1.1 ad #define CPUI960_RX 4 321 1.1 ad #define CPUARM_SA110 5 322 1.1 ad #define CPUARM_xxx 6 323 1.1 ad #define CPUPPC_603e 7 324 1.1 ad #define CPUPPC_xxx 8 325 1.2 briggs #define CPUI80303 9 326 1.9 briggs #define CPU_XSCALE_80321 10 327 1.9 briggs #define CPU_MIPS_4KC 11 328 1.9 briggs #define CPU_MIPS_5KC 12 329 1.9 briggs #define CPUSUBTYPE__last 13 330 1.1 ad 331 1.1 ad #define PLAT_NTSIM 1 332 1.1 ad #define PLAT_V3ADU 2 333 1.1 ad #define PLAT_CYCLONE 3 334 1.1 ad #define PLAT_CYCLONE_HD 4 335 1.1 ad #define PLAT_BATBOARD 5 336 1.1 ad #define PLAT_BATBOARD_HD 6 337 1.1 ad #define PLAT_YOLO 7 338 1.1 ad #define PLAT_COBRA 8 339 1.1 ad #define PLAT_ANAHEIM 9 340 1.1 ad #define PLAT_JALAPENO 10 341 1.1 ad #define PLAT_QUEENS 11 342 1.1 ad #define PLAT_JALAPENO_DELL 12 343 1.1 ad #define PLAT_POBLANO 13 344 1.1 ad #define PLAT_POBLANO_OPAL 14 345 1.1 ad #define PLAT_POBLANO_SL0 15 346 1.1 ad #define PLAT_POBLANO_SL1 16 347 1.1 ad #define PLAT_POBLANO_SL2 17 348 1.1 ad #define PLAT_POBLANO_XXX 18 349 1.1 ad #define PLAT_JALAPENO_P2 19 350 1.1 ad #define PLAT_HABANERO 20 351 1.9 briggs #define PLAT_VULCAN 21 352 1.9 briggs #define PLAT_CRUSADER 22 353 1.9 briggs #define PLAT_LANCER 23 354 1.9 briggs #define PLAT_HARRIER 24 355 1.9 briggs #define PLAT_TERMINATOR 25 356 1.9 briggs #define PLAT_SKYHAWK 26 357 1.9 briggs #define PLAT_CORSAIR 27 358 1.9 briggs #define PLAT_JAGUAR 28 359 1.9 briggs #define PLAT_SATAHAWK 29 360 1.9 briggs #define PLAT_SATANATOR 30 361 1.9 briggs #define PLAT_PROWLER 31 362 1.9 briggs #define PLAT_BLACKBIRD 32 363 1.9 briggs #define PLAT_SABREEXPRESS 33 364 1.9 briggs #define PLAT_INTRUDER 34 365 1.9 briggs #define PLAT__last 35 366 1.1 ad 367 1.1 ad #define OEM_FLAVOR_ADAPTEC 1 368 1.1 ad #define OEM_FLAVOR_DELL 2 369 1.1 ad #define OEM_FLAVOR_HP 3 370 1.1 ad #define OEM_FLAVOR_IBM 4 371 1.1 ad #define OEM_FLAVOR_CPQ 5 372 1.9 briggs #define OEM_FLAVOR_FSC 6 373 1.9 briggs #define OEM_FLAVOR_DWS 7 374 1.1 ad #define OEM_FLAVOR_BRAND_Z 8 375 1.9 briggs #define OEM_FLAVOR_LEGEND 9 376 1.9 briggs #define OEM_FLAVOR_HITACHI 10 377 1.9 briggs #define OEM_FLAVOR_ESG 11 378 1.9 briggs #define OEM_FLAVOR_ICP 12 379 1.9 briggs #define OEM_FLAVOR_SCM 13 380 1.9 briggs #define OEM_FLAVOR__last 14 381 1.1 ad 382 1.1 ad /* 383 1.1 ad * XXX the aac-2622 with no battery present reports PLATFORM_BAT_OPT_PRESENT 384 1.1 ad */ 385 1.1 ad #define PLATFORM_BAT_REQ_PRESENT 1 /* BATTERY REQUIRED AND PRESENT */ 386 1.1 ad #define PLATFORM_BAT_REQ_NOTPRESENT 2 /* BATTERY REQUIRED AND NOT PRESENT */ 387 1.1 ad #define PLATFORM_BAT_OPT_PRESENT 3 /* BATTERY OPTIONAL AND PRESENT */ 388 1.1 ad #define PLATFORM_BAT_OPT_NOTPRESENT 4 /* BATTERY OPTIONAL AND NOT PRESENT */ 389 1.1 ad #define PLATFORM_BAT_NOT_SUPPORTED 5 /* BATTERY NOT SUPPORTED */ 390 1.1 ad 391 1.9 briggs /* 392 1.9 briggs * options supported by this board 393 1.9 briggs * there has to be a one to one mapping of these defines and the ones in 394 1.9 briggs * fsaapi.h, search for FSA_SUPPORT_SNAPSHOT 395 1.9 briggs */ 396 1.9 briggs #define AAC_SUPPORTED_SNAPSHOT 0x01 397 1.9 briggs #define AAC_SUPPORTED_CLUSTERS 0x02 398 1.9 briggs #define AAC_SUPPORTED_WRITE_CACHE 0x04 399 1.9 briggs #define AAC_SUPPORTED_64BIT_DATA 0x08 400 1.9 briggs #define AAC_SUPPORTED_HOST_TIME_FIB 0x10 401 1.9 briggs #define AAC_SUPPORTED_RAID50 0x20 402 1.9 briggs #define AAC_SUPPORTED_4GB_WINDOW 0x40 403 1.9 briggs #define AAC_SUPPORTED_SCSI_UPGRADEABLE 0x80 404 1.9 briggs #define AAC_SUPPORTED_SOFT_ERR_REPORT 0x100 405 1.9 briggs #define AAC_SUPPORTED_NOT_RECONDITION 0x200 406 1.9 briggs #define AAC_SUPPORTED_SGMAP_HOST64 0x400 407 1.9 briggs #define AAC_SUPPORTED_ALARM 0x800 408 1.9 briggs #define AAC_SUPPORTED_NONDASD 0x1000 409 1.9 briggs #define AAC_SUPPORTED_SCSI_MANAGED 0x2000 410 1.9 briggs #define AAC_SUPPORTED_RAID_SCSI_MODE 0x4000 411 1.9 briggs #define AAC_SUPPORTED_SUPPLEMENT_ADAPTER_INFO 0x10000 412 1.9 briggs #define AAC_SUPPORTED_NEW_COMM 0x20000 413 1.9 briggs #define AAC_SUPPORTED_64BIT_ARRAYSIZE 0x40000 414 1.9 briggs #define AAC_SUPPORTED_HEAT_SENSOR 0x80000 415 1.9 briggs 416 1.3 perry /* 417 1.1 ad * Structure used to respond to a RequestAdapterInfo fib. 418 1.1 ad */ 419 1.1 ad struct aac_adapter_info { 420 1.1 ad u_int32_t PlatformBase; /* adapter type */ 421 1.1 ad u_int32_t CpuArchitecture; /* adapter CPU type */ 422 1.1 ad u_int32_t CpuVariant; /* adapter CPU subtype */ 423 1.1 ad u_int32_t ClockSpeed; /* adapter CPU clockspeed */ 424 1.1 ad u_int32_t ExecutionMem; /* adapter Execution Memory size */ 425 1.1 ad u_int32_t BufferMem; /* adapter Data Memory */ 426 1.1 ad u_int32_t TotalMem; /* adapter Total Memory */ 427 1.1 ad struct FsaRevision KernelRevision; /* adapter Kernel SW Revision */ 428 1.1 ad struct FsaRevision MonitorRevision; /* adapter Monitor/Diag SW Rev */ 429 1.1 ad struct FsaRevision HardwareRevision; /* TDB */ 430 1.1 ad struct FsaRevision BIOSRevision; /* adapter BIOS Revision */ 431 1.1 ad u_int32_t ClusteringEnabled; 432 1.1 ad u_int32_t ClusterChannelMask; 433 1.1 ad u_int64_t SerialNumber; 434 1.1 ad u_int32_t batteryPlatform; 435 1.1 ad u_int32_t SupportedOptions; /* supported features of this ctrlr */ 436 1.1 ad u_int32_t OemVariant; 437 1.10 perry } __packed; 438 1.1 ad 439 1.1 ad /* 440 1.1 ad * Monitor/Kernel interface. 441 1.1 ad */ 442 1.1 ad 443 1.1 ad /* 444 1.1 ad * Synchronous commands to the monitor/kernel. 445 1.1 ad */ 446 1.9 briggs #define AAC_MONKER_BREAKPOINT 0x04 447 1.1 ad #define AAC_MONKER_INITSTRUCT 0x05 448 1.1 ad #define AAC_MONKER_SYNCFIB 0x0c 449 1.1 ad #define AAC_MONKER_GETKERNVER 0x11 450 1.9 briggs #define AAC_MONKER_POSTRESULTS 0x14 451 1.4 briggs #define AAC_MONKER_GETINFO 0x19 452 1.9 briggs #define AAC_MONKER_GETDRVPROP 0x23 453 1.9 briggs #define AAC_MONKER_RCVTEMP 0x25 454 1.9 briggs #define AAC_MONKER_GETCOMMPREF 0x26 455 1.9 briggs #define AAC_MONKER_REINIT 0xee 456 1.1 ad 457 1.1 ad /* 458 1.1 ad * Command status values 459 1.1 ad */ 460 1.1 ad #define ST_OK 0 461 1.1 ad #define ST_PERM 1 462 1.1 ad #define ST_NOENT 2 463 1.1 ad #define ST_IO 5 464 1.1 ad #define ST_NXIO 6 465 1.1 ad #define ST_E2BIG 7 466 1.1 ad #define ST_ACCES 13 467 1.1 ad #define ST_EXIST 17 468 1.1 ad #define ST_XDEV 18 469 1.1 ad #define ST_NODEV 19 470 1.1 ad #define ST_NOTDIR 20 471 1.1 ad #define ST_ISDIR 21 472 1.1 ad #define ST_INVAL 22 473 1.1 ad #define ST_FBIG 27 474 1.1 ad #define ST_NOSPC 28 475 1.1 ad #define ST_ROFS 30 476 1.1 ad #define ST_MLINK 31 477 1.1 ad #define ST_WOULDBLOCK 35 478 1.1 ad #define ST_NAMETOOLONG 63 479 1.1 ad #define ST_NOTEMPTY 66 480 1.1 ad #define ST_DQUOT 69 481 1.1 ad #define ST_STALE 70 482 1.1 ad #define ST_REMOTE 71 483 1.1 ad #define ST_BADHANDLE 10001 484 1.1 ad #define ST_NOT_SYNC 10002 485 1.1 ad #define ST_BAD_COOKIE 10003 486 1.1 ad #define ST_NOTSUPP 10004 487 1.1 ad #define ST_TOOSMALL 10005 488 1.1 ad #define ST_SERVERFAULT 10006 489 1.1 ad #define ST_BADTYPE 10007 490 1.1 ad #define ST_JUKEBOX 10008 491 1.1 ad #define ST_NOTMOUNTED 10009 492 1.1 ad #define ST_MAINTMODE 10010 493 1.1 ad #define ST_STALEACL 10011 494 1.1 ad 495 1.1 ad /* 496 1.1 ad * Volume manager commands 497 1.1 ad */ 498 1.1 ad #define VM_Null 0 499 1.1 ad #define VM_NameServe 1 500 1.1 ad #define VM_ContainerConfig 2 501 1.1 ad #define VM_Ioctl 3 502 1.1 ad #define VM_FilesystemIoctl 4 503 1.1 ad #define VM_CloseAll 5 504 1.1 ad #define VM_CtBlockRead 6 505 1.1 ad #define VM_CtBlockWrite 7 506 1.1 ad #define VM_SliceBlockRead 8 /* raw access to configured "storage objects" */ 507 1.1 ad #define VM_SliceBlockWrite 9 508 1.1 ad #define VM_DriveBlockRead 10 /* raw access to physical devices */ 509 1.1 ad #define VM_DriveBlockWrite 11 510 1.1 ad #define VM_EnclosureMgt 12 /* enclosure management */ 511 1.1 ad #define VM_Unused 13 /* used to be diskset management */ 512 1.1 ad #define VM_CtBlockVerify 14 513 1.1 ad #define VM_CtPerf 15 /* performance test */ 514 1.1 ad #define VM_CtBlockRead64 16 515 1.1 ad #define VM_CtBlockWrite64 17 516 1.1 ad #define VM_CtBlockVerify64 18 517 1.9 briggs #define VM_CtHostRead64 19 518 1.9 briggs #define VM_CtHostWrite64 20 519 1.9 briggs #define VM_DrvErrTblLog 21 /* drive error table/log type of command */ 520 1.9 briggs #define VM_NameServe64 22 521 1.1 ad 522 1.1 ad /* 523 1.1 ad * "Mountable object" 524 1.1 ad */ 525 1.1 ad struct aac_mntobj { 526 1.1 ad u_int32_t ObjectId; 527 1.1 ad char FileSystemName[16]; 528 1.1 ad struct aac_container_creation CreateInfo; 529 1.1 ad u_int32_t Capacity; 530 1.1 ad u_int32_t VolType; 531 1.1 ad u_int32_t ObjType; 532 1.1 ad u_int32_t ContentState; 533 1.1 ad #define AAC_FSCS_READONLY 0x0002 /* XXX need more information than this */ 534 1.1 ad union { 535 1.1 ad u_int32_t pad[8]; 536 1.1 ad } ObjExtension; 537 1.1 ad u_int32_t AlterEgoId; 538 1.13 sborrill u_int32_t CapacityHigh; /* Only if VM_NameServe64 */ 539 1.12 gmcgarry } __packed; 540 1.1 ad 541 1.1 ad struct aac_mntinfo { 542 1.1 ad u_int32_t Command; 543 1.1 ad u_int32_t MntType; 544 1.1 ad u_int32_t MntCount; 545 1.12 gmcgarry } __packed; 546 1.1 ad 547 1.1 ad struct aac_mntinforesponse { 548 1.1 ad u_int32_t Status; 549 1.1 ad u_int32_t MntType; 550 1.1 ad u_int32_t MntRespCount; 551 1.1 ad struct aac_mntobj MntTable[1]; 552 1.12 gmcgarry } __packed; 553 1.1 ad 554 1.1 ad /* 555 1.9 briggs * Container shutdown command. 556 1.9 briggs */ 557 1.9 briggs struct aac_closecommand { 558 1.9 briggs u_int32_t Command; 559 1.9 briggs u_int32_t ContainerId; 560 1.12 gmcgarry } __packed; 561 1.9 briggs 562 1.9 briggs /* 563 1.9 briggs * Container Config Command 564 1.9 briggs */ 565 1.9 briggs #define CT_GET_SCSI_METHOD 64 566 1.9 briggs struct aac_ctcfg { 567 1.9 briggs u_int32_t Command; 568 1.9 briggs u_int32_t cmd; 569 1.9 briggs u_int32_t param; 570 1.12 gmcgarry } __packed; 571 1.9 briggs 572 1.9 briggs struct aac_ctcfg_resp { 573 1.9 briggs u_int32_t Status; 574 1.9 briggs u_int32_t resp; 575 1.9 briggs u_int32_t param; 576 1.12 gmcgarry } __packed; 577 1.9 briggs 578 1.9 briggs /* 579 1.15 andvar * 'Ioctl' commands 580 1.9 briggs */ 581 1.9 briggs #define AAC_SCSI_MAX_PORTS 10 582 1.9 briggs #define AAC_BUS_NO_EXIST 0 583 1.9 briggs #define AAC_BUS_VALID 1 584 1.9 briggs #define AAC_BUS_FAULTED 2 585 1.9 briggs #define AAC_BUS_DISABLED 3 586 1.9 briggs #define GetBusInfo 0x9 587 1.9 briggs 588 1.9 briggs struct aac_getbusinf { 589 1.9 briggs u_int32_t ProbeComplete; 590 1.9 briggs u_int32_t BusCount; 591 1.9 briggs u_int32_t TargetsPerBus; 592 1.9 briggs u_int8_t InitiatorBusId[AAC_SCSI_MAX_PORTS]; 593 1.9 briggs u_int8_t BusValid[AAC_SCSI_MAX_PORTS]; 594 1.12 gmcgarry } __packed; 595 1.9 briggs 596 1.9 briggs struct aac_vmioctl { 597 1.9 briggs u_int32_t Command; 598 1.9 briggs u_int32_t ObjType; 599 1.9 briggs u_int32_t MethId; 600 1.9 briggs u_int32_t ObjId; 601 1.9 briggs u_int32_t IoctlCmd; 602 1.9 briggs u_int32_t IoctlBuf[1]; /* Placeholder? */ 603 1.12 gmcgarry } __packed; 604 1.9 briggs 605 1.9 briggs struct aac_vmi_businf_resp { 606 1.9 briggs u_int32_t Status; 607 1.9 briggs u_int32_t ObjType; 608 1.9 briggs u_int32_t MethId; 609 1.9 briggs u_int32_t ObjId; 610 1.9 briggs u_int32_t IoctlCmd; 611 1.9 briggs struct aac_getbusinf BusInf; 612 1.12 gmcgarry } __packed; 613 1.9 briggs 614 1.9 briggs #if 0 615 1.9 briggs #define AAC_BTL_TO_HANDLE(b, t, l) \ 616 1.9 briggs (((b & 0x3f) << 7) | ((l & 0x7) << 4) | (t & 0xf)) 617 1.9 briggs #else 618 1.9 briggs #define AAC_BTL_TO_HANDLE(b, t, l) \ 619 1.9 briggs ((((u_int32_t)b & 0x0f) << 24) | \ 620 1.9 briggs (((u_int32_t)l & 0xff) << 16) | \ 621 1.9 briggs ((u_int32_t)t & 0xffff)) 622 1.9 briggs #endif 623 1.9 briggs #define GetDeviceProbeInfo 0x5 624 1.9 briggs 625 1.9 briggs struct aac_vmi_devinfo_resp { 626 1.9 briggs u_int32_t Status; 627 1.9 briggs u_int32_t ObjType; 628 1.9 briggs u_int32_t MethId; 629 1.9 briggs u_int32_t ObjId; 630 1.9 briggs u_int32_t IoctlCmd; 631 1.9 briggs u_int8_t VendorId[8]; 632 1.9 briggs u_int8_t ProductId[16]; 633 1.9 briggs u_int8_t ProductRev[4]; 634 1.9 briggs u_int32_t Inquiry7; 635 1.9 briggs u_int32_t align1; 636 1.9 briggs u_int32_t Inquiry0; 637 1.9 briggs u_int32_t align2; 638 1.9 briggs u_int32_t Inquiry1; 639 1.9 briggs u_int32_t align3; 640 1.9 briggs u_int32_t reserved[2]; 641 1.9 briggs u_int8_t VendorSpecific[20]; 642 1.9 briggs u_int32_t Smart:1; 643 1.9 briggs u_int32_t AAC_Managed:1; 644 1.9 briggs u_int32_t align4; 645 1.9 briggs u_int32_t reserved2:6; 646 1.9 briggs u_int32_t Bus; 647 1.9 briggs u_int32_t Target; 648 1.9 briggs u_int32_t Lun; 649 1.9 briggs u_int32_t ultraEnable:1, 650 1.9 briggs disconnectEnable:1, 651 1.9 briggs fast20EnabledW:1, 652 1.9 briggs scamDevice:1, 653 1.9 briggs scamTolerant:1, 654 1.9 briggs setForSync:1, 655 1.9 briggs setForWide:1, 656 1.9 briggs syncDevice:1, 657 1.9 briggs wideDevice:1, 658 1.9 briggs reserved1:7, 659 1.9 briggs ScsiRate:8, 660 1.9 briggs ScsiOffset:8; 661 1.9 briggs }; /* Do not pack */ 662 1.9 briggs 663 1.9 briggs #define ResetBus 0x16 664 1.9 briggs struct aac_resetbus { 665 1.9 briggs u_int32_t BusNumber; 666 1.9 briggs }; 667 1.9 briggs 668 1.9 briggs /* 669 1.1 ad * Write 'stability' options. 670 1.1 ad */ 671 1.1 ad #define CSTABLE 1 672 1.1 ad #define CUNSTABLE 2 673 1.1 ad 674 1.1 ad /* 675 1.1 ad * Commit level response for a write request. 676 1.1 ad */ 677 1.1 ad #define CMFILE_SYNC_NVRAM 1 678 1.1 ad #define CMDATA_SYNC_NVRAM 2 679 1.1 ad #define CMFILE_SYNC 3 680 1.1 ad #define CMDATA_SYNC 4 681 1.1 ad #define CMUNSTABLE 5 682 1.1 ad 683 1.1 ad /* 684 1.1 ad * Block read/write operations. These structures are packed into the 'data' 685 1.1 ad * area in the FIB. 686 1.1 ad */ 687 1.1 ad struct aac_blockread { 688 1.1 ad u_int32_t Command; /* not FSACommand! */ 689 1.1 ad u_int32_t ContainerId; 690 1.1 ad u_int32_t BlockNumber; 691 1.1 ad u_int32_t ByteCount; 692 1.1 ad struct aac_sg_table SgMap; /* variable size */ 693 1.12 gmcgarry } __packed; 694 1.1 ad 695 1.9 briggs struct aac_blockread64 { 696 1.9 briggs u_int32_t Command; /* not FSACommand! */ 697 1.9 briggs u_int16_t ContainerId; 698 1.9 briggs u_int16_t SectorCount; 699 1.9 briggs u_int32_t BlockNumber; 700 1.9 briggs u_int16_t Pad; 701 1.9 briggs u_int16_t Flags; 702 1.9 briggs struct aac_sg_table64 SgMap64; /* variable size */ 703 1.12 gmcgarry } __packed; 704 1.9 briggs 705 1.1 ad struct aac_blockread_response { 706 1.1 ad u_int32_t Status; 707 1.1 ad u_int32_t ByteCount; 708 1.12 gmcgarry } __packed; 709 1.1 ad 710 1.1 ad struct aac_blockwrite { 711 1.1 ad u_int32_t Command; /* not FSACommand! */ 712 1.1 ad u_int32_t ContainerId; 713 1.1 ad u_int32_t BlockNumber; 714 1.1 ad u_int32_t ByteCount; 715 1.1 ad u_int32_t Stable; 716 1.1 ad struct aac_sg_table SgMap; /* variable size */ 717 1.12 gmcgarry } __packed; 718 1.1 ad 719 1.9 briggs struct aac_blockwrite64 { 720 1.9 briggs u_int32_t Command; /* not FSACommand! */ 721 1.9 briggs u_int16_t ContainerId; 722 1.9 briggs u_int16_t SectorCount; 723 1.9 briggs u_int32_t BlockNumber; 724 1.9 briggs u_int16_t Pad; 725 1.9 briggs u_int16_t Flags; 726 1.9 briggs struct aac_sg_table64 SgMap64; /* variable size */ 727 1.12 gmcgarry } __packed; 728 1.9 briggs 729 1.1 ad struct aac_blockwrite_response { 730 1.1 ad u_int32_t Status; 731 1.1 ad u_int32_t ByteCount; 732 1.1 ad u_int32_t Committed; 733 1.12 gmcgarry } __packed; 734 1.1 ad 735 1.9 briggs struct aac_raw_io { 736 1.9 briggs u_int64_t BlockNumber; 737 1.9 briggs u_int32_t ByteCount; 738 1.9 briggs u_int16_t ContainerId; 739 1.9 briggs u_int16_t Flags; /* 0: W, 1: R */ 740 1.9 briggs u_int16_t BpTotal; /* reserved for FW use */ 741 1.9 briggs u_int16_t BpComplete; /* reserved for FW use */ 742 1.9 briggs struct aac_sg_tableraw SgMapRaw; /* variable size */ 743 1.12 gmcgarry } __packed; 744 1.9 briggs 745 1.1 ad struct aac_close_command { 746 1.1 ad u_int32_t Command; 747 1.1 ad u_int32_t ContainerId; 748 1.12 gmcgarry } __packed; 749 1.1 ad 750 1.1 ad /* 751 1.9 briggs * SCSI Passthrough structures 752 1.9 briggs */ 753 1.9 briggs struct aac_srb32 { 754 1.9 briggs u_int32_t function; 755 1.9 briggs u_int32_t bus; 756 1.9 briggs u_int32_t target; 757 1.9 briggs u_int32_t lun; 758 1.9 briggs u_int32_t timeout; 759 1.9 briggs u_int32_t flags; 760 1.9 briggs u_int32_t data_len; 761 1.9 briggs u_int32_t retry_limit; 762 1.9 briggs u_int32_t cdb_len; 763 1.9 briggs u_int8_t cdb[16]; 764 1.9 briggs struct aac_sg_table sg_map32; 765 1.9 briggs }; 766 1.9 briggs 767 1.9 briggs #define AAC_SRB_FUNC_EXECUTE_SCSI 0x00 768 1.9 briggs #define AAC_SRB_FUNC_CLAIM_DEVICE 0x01 769 1.9 briggs #define AAC_SRB_FUNC_IO_CONTROL 0x02 770 1.9 briggs #define AAC_SRB_FUNC_RECEIVE_EVENT 0x03 771 1.9 briggs #define AAC_SRB_FUNC_RELEASE_QUEUE 0x04 772 1.9 briggs #define AAC_SRB_FUNC_ATTACH_DEVICE 0x05 773 1.9 briggs #define AAC_SRB_FUNC_RELEASE_DEVICE 0x06 774 1.9 briggs #define AAC_SRB_FUNC_SHUTDOWN 0x07 775 1.9 briggs #define AAC_SRB_FUNC_FLUSH 0x08 776 1.9 briggs #define AAC_SRB_FUNC_ABORT_COMMAND 0x10 777 1.9 briggs #define AAC_SRB_FUNC_RELEASE_RECOVERY 0x11 778 1.9 briggs #define AAC_SRB_FUNC_RESET_BUS 0x12 779 1.9 briggs #define AAC_SRB_FUNC_RESET_DEVICE 0x13 780 1.9 briggs #define AAC_SRB_FUNC_TERMINATE_IO 0x14 781 1.9 briggs #define AAC_SRB_FUNC_FLUSH_QUEUE 0x15 782 1.9 briggs #define AAC_SRB_FUNC_REMOVE_DEVICE 0x16 783 1.9 briggs #define AAC_SRB_FUNC_DOMAIN_VALIDATION 0x17 784 1.9 briggs 785 1.9 briggs #define AAC_SRB_FLAGS_NO_DATA_XFER 0x0000 786 1.9 briggs #define AAC_SRB_FLAGS_DISABLE_DISCONNECT 0x0004 787 1.9 briggs #define AAC_SRB_FLAGS_DISABLE_SYNC_TRANSFER 0x0008 788 1.9 briggs #define AAC_SRB_FLAGS_BYPASS_FROZEN_QUEUE 0x0010 789 1.9 briggs #define AAC_SRB_FLAGS_DISABLE_AUTOSENSE 0x0020 790 1.9 briggs #define AAC_SRB_FLAGS_DATA_IN 0x0040 791 1.9 briggs #define AAC_SRB_FLAGS_DATA_OUT 0x0080 792 1.9 briggs #define AAC_SRB_FLAGS_UNSPECIFIED_DIRECTION \ 793 1.9 briggs (AAC_SRB_FLAGS_DATA_IN | AAC_SRB_FLAGS_DATA_OUT) 794 1.9 briggs 795 1.9 briggs #define AAC_HOST_SENSE_DATA_MAX 30 796 1.9 briggs 797 1.9 briggs struct aac_srb_response { 798 1.9 briggs u_int32_t fib_status; 799 1.9 briggs u_int32_t srb_status; 800 1.9 briggs u_int32_t scsi_status; 801 1.9 briggs u_int32_t data_len; 802 1.9 briggs u_int32_t sense_len; 803 1.9 briggs u_int8_t sense[AAC_HOST_SENSE_DATA_MAX]; 804 1.9 briggs }; 805 1.9 briggs 806 1.9 briggs /* 807 1.9 briggs * Status codes for SCSI passthrough commands. Since they are based on ASPI, 808 1.9 briggs * they also exactly match CAM status codes in both enumeration and meaning. 809 1.9 briggs * They seem to also be used as status codes for synchronous FIBs. 810 1.9 briggs */ 811 1.9 briggs #define AAC_SRB_STS_PENDING 0x00 812 1.9 briggs #define AAC_SRB_STS_SUCCESS 0x01 813 1.9 briggs #define AAC_SRB_STS_ABORTED 0x02 814 1.9 briggs #define AAC_SRB_STS_ABORT_FAILED 0x03 815 1.9 briggs #define AAC_SRB_STS_ERROR 0x04 816 1.9 briggs #define AAC_SRB_STS_BUSY 0x05 817 1.9 briggs #define AAC_SRB_STS_INVALID_REQUEST 0x06 818 1.9 briggs #define AAC_SRB_STS_INVALID_PATH_ID 0x07 819 1.9 briggs #define AAC_SRB_STS_NO_DEVICE 0x08 820 1.9 briggs #define AAC_SRB_STS_TIMEOUT 0x09 821 1.9 briggs #define AAC_SRB_STS_SELECTION_TIMEOUT 0x0a 822 1.9 briggs #define AAC_SRB_STS_COMMAND_TIMEOUT 0x0b 823 1.9 briggs #define AAC_SRB_STS_MESSAGE_REJECTED 0x0d 824 1.9 briggs #define AAC_SRB_STS_BUS_RESET 0x0e 825 1.9 briggs #define AAC_SRB_STS_PARITY_ERROR 0x0f 826 1.9 briggs #define AAC_SRB_STS_REQUEST_SENSE_FAILED 0x10 827 1.9 briggs #define AAC_SRB_STS_NO_HBA 0x11 828 1.9 briggs #define AAC_SRB_STS_DATA_OVERRUN 0x12 829 1.9 briggs #define AAC_SRB_STS_UNEXPECTED_BUS_FREE 0x13 830 1.9 briggs #define AAC_SRB_STS_PHASE_SEQUENCE_FAILURE 0x14 831 1.9 briggs #define AAC_SRB_STS_BAD_SRB_BLOCK_LENGTH 0x15 832 1.9 briggs #define AAC_SRB_STS_REQUEST_FLUSHED 0x16 833 1.9 briggs #define AAC_SRB_STS_INVALID_LUN 0x20 834 1.9 briggs #define AAC_SRB_STS_INVALID_TARGET_ID 0x21 835 1.9 briggs #define AAC_SRB_STS_BAD_FUNCTION 0x22 836 1.9 briggs #define AAC_SRB_STS_ERROR_RECOVER 0x23 837 1.9 briggs 838 1.9 briggs /* 839 1.9 briggs * Register set for adapters based on the Falcon bridge and PPC core 840 1.9 briggs */ 841 1.9 briggs 842 1.9 briggs #define AAC_FA_DOORBELL0_CLEAR 0x00 843 1.9 briggs #define AAC_FA_DOORBELL1_CLEAR 0x02 844 1.9 briggs #define AAC_FA_DOORBELL0 0x04 845 1.9 briggs #define AAC_FA_DOORBELL1 0x06 846 1.9 briggs #define AAC_FA_MASK0_CLEAR 0x08 847 1.9 briggs #define AAC_FA_MASK1_CLEAR 0x0a 848 1.9 briggs #define AAC_FA_MASK0 0x0c 849 1.9 briggs #define AAC_FA_MASK1 0x0e 850 1.9 briggs #define AAC_FA_MAILBOX 0x10 851 1.9 briggs #define AAC_FA_FWSTATUS 0x2c /* Mailbox 7 */ 852 1.9 briggs #define AAC_FA_INTSRC 0x900 853 1.9 briggs 854 1.9 briggs #define AAC_FA_HACK(sc) (void)AAC_GETREG4(sc, AAC_FA_INTSRC) 855 1.9 briggs 856 1.9 briggs /* 857 1.1 ad * Register definitions for the Adaptec AAC-364 'Jalapeno I/II' adapters, based 858 1.1 ad * on the SA110 'StrongArm'. 859 1.1 ad */ 860 1.1 ad 861 1.1 ad #define AAC_REGSIZE 0x100 862 1.1 ad 863 1.1 ad /* doorbell 0 (adapter->host) */ 864 1.1 ad #define AAC_SA_DOORBELL0_CLEAR 0x98 865 1.1 ad #define AAC_SA_DOORBELL0_SET 0x9c 866 1.1 ad #define AAC_SA_DOORBELL0 0x9c 867 1.1 ad #define AAC_SA_MASK0_CLEAR 0xa0 868 1.1 ad #define AAC_SA_MASK0_SET 0xa4 869 1.1 ad 870 1.1 ad /* doorbell 1 (host->adapter) */ 871 1.1 ad #define AAC_SA_DOORBELL1_CLEAR 0x9a 872 1.1 ad #define AAC_SA_DOORBELL1_SET 0x9e 873 1.1 ad #define AAC_SA_MASK1_CLEAR 0xa2 874 1.1 ad #define AAC_SA_MASK1_SET 0xa6 875 1.1 ad 876 1.1 ad /* mailbox (20 bytes) */ 877 1.1 ad #define AAC_SA_MAILBOX 0xa8 878 1.1 ad #define AAC_SA_FWSTATUS 0xc4 879 1.1 ad 880 1.1 ad /* 881 1.1 ad * Register definitions for the Adaptec 'Pablano' adapters, based on the 882 1.1 ad * i960Rx, and other related adapters. 883 1.1 ad */ 884 1.1 ad 885 1.1 ad #define AAC_RX_IDBR 0x20 /* inbound doorbell */ 886 1.1 ad #define AAC_RX_IISR 0x24 /* inbound interrupt status */ 887 1.1 ad #define AAC_RX_IIMR 0x28 /* inbound interrupt mask */ 888 1.1 ad #define AAC_RX_ODBR 0x2c /* outbound doorbell */ 889 1.1 ad #define AAC_RX_OISR 0x30 /* outbound interrupt status */ 890 1.1 ad #define AAC_RX_OIMR 0x34 /* outbound interrupt mask */ 891 1.9 briggs #define AAC_RX_IQUE 0x40 /* inbound queue */ 892 1.9 briggs #define AAC_RX_OQUE 0x44 /* outbound queue */ 893 1.1 ad 894 1.1 ad #define AAC_RX_MAILBOX 0x50 /* mailbox (20 bytes) */ 895 1.1 ad #define AAC_RX_FWSTATUS 0x6c 896 1.1 ad 897 1.1 ad /* 898 1.9 briggs * Register definitions for the Adaptec 'Rocket' RAID-On-Chip adapters. 899 1.9 briggs * Unsurprisingly, it's quite similar to the i960! 900 1.9 briggs */ 901 1.9 briggs 902 1.9 briggs #define AAC_RKT_IDBR 0x20 /* inbound doorbell register */ 903 1.9 briggs #define AAC_RKT_IISR 0x24 /* inbound interrupt status register */ 904 1.9 briggs #define AAC_RKT_IIMR 0x28 /* inbound interrupt mask register */ 905 1.9 briggs #define AAC_RKT_ODBR 0x2c /* outbound doorbell register */ 906 1.9 briggs #define AAC_RKT_OISR 0x30 /* outbound interrupt status register */ 907 1.9 briggs #define AAC_RKT_OIMR 0x34 /* outbound interrupt mask register */ 908 1.9 briggs #define AAC_RKT_IQUE 0x40 /* inbound queue */ 909 1.9 briggs #define AAC_RKT_OQUE 0x44 /* outbound queue */ 910 1.9 briggs 911 1.9 briggs #define AAC_RKT_MAILBOX 0x1000 /* mailbox */ 912 1.9 briggs #define AAC_RKT_FWSTATUS 0x101c /* Firmware Status (mailbox 7) */ 913 1.9 briggs 914 1.9 briggs /* 915 1.1 ad * Common bit definitions for the doorbell registers. 916 1.1 ad */ 917 1.1 ad 918 1.1 ad /* 919 1.1 ad * Status bits in the doorbell registers. 920 1.1 ad */ 921 1.1 ad #define AAC_DB_SYNC_COMMAND (1<<0) /* send/completed synchronous FIB */ 922 1.1 ad #define AAC_DB_COMMAND_READY (1<<1) /* posted one or more commands */ 923 1.1 ad #define AAC_DB_RESPONSE_READY (1<<2) /* one or more commands complete */ 924 1.1 ad #define AAC_DB_COMMAND_NOT_FULL (1<<3) /* command queue not full */ 925 1.1 ad #define AAC_DB_RESPONSE_NOT_FULL (1<<4) /* response queue not full */ 926 1.1 ad 927 1.1 ad /* 928 1.1 ad * The adapter can request the host print a message by setting the 929 1.1 ad * DB_PRINTF flag in DOORBELL0. The driver responds by collecting the 930 1.3 perry * message from the printf buffer, clearing the DB_PRINTF flag in 931 1.1 ad * DOORBELL0 and setting it in DOORBELL1. 932 1.1 ad * (ODBR and IDBR respectively for the i960Rx adapters) 933 1.1 ad */ 934 1.9 briggs #define AAC_DB_PRINTF (1<<5) /* adapter requests host printf */ 935 1.9 briggs #define AAC_PRINTF_DONE (1<<5) /* host completed printf processing */ 936 1.1 ad 937 1.1 ad /* 938 1.1 ad * Mask containing the interrupt bits we care about. We don't anticipate 939 1.1 ad * (or want) interrupts not in this mask. 940 1.1 ad */ 941 1.1 ad #define AAC_DB_INTERRUPTS \ 942 1.1 ad (AAC_DB_COMMAND_READY | AAC_DB_RESPONSE_READY | AAC_DB_PRINTF) 943 1.9 briggs #define AAC_DB_INT_NEW_COMM 0x08 944 1.1 ad 945 1.1 ad /* 946 1.1 ad * Queue names 947 1.1 ad * 948 1.1 ad * Note that we base these at 0 in order to use them as array indices. Adaptec 949 1.1 ad * used base 1 for some unknown reason, and sorted them in a different order. 950 1.1 ad */ 951 1.1 ad #define AAC_HOST_NORM_CMD_QUEUE 0 952 1.1 ad #define AAC_HOST_HIGH_CMD_QUEUE 1 953 1.1 ad #define AAC_ADAP_NORM_CMD_QUEUE 2 954 1.1 ad #define AAC_ADAP_HIGH_CMD_QUEUE 3 955 1.1 ad #define AAC_HOST_NORM_RESP_QUEUE 4 956 1.1 ad #define AAC_HOST_HIGH_RESP_QUEUE 5 957 1.1 ad #define AAC_ADAP_NORM_RESP_QUEUE 6 958 1.1 ad #define AAC_ADAP_HIGH_RESP_QUEUE 7 959 1.1 ad 960 1.1 ad /* 961 1.1 ad * List structure used to chain FIBs (used by the adapter - we hang FIBs off 962 1.1 ad * our private command structure and don't touch these) 963 1.1 ad */ 964 1.1 ad struct aac_fib_list_entry { 965 1.7 briggs u_int32_t Flink; 966 1.7 briggs u_int32_t Blink; 967 1.10 perry } __packed; 968 1.1 ad 969 1.1 ad /* 970 1.1 ad * FIB (FSA Interface Block?); this is the datastructure passed between the 971 1.1 ad * host and adapter. 972 1.1 ad */ 973 1.1 ad struct aac_fib_header { 974 1.1 ad u_int32_t XferState; 975 1.1 ad u_int16_t Command; 976 1.1 ad u_int8_t StructType; 977 1.1 ad u_int8_t Flags; 978 1.1 ad u_int16_t Size; 979 1.1 ad u_int16_t SenderSize; 980 1.1 ad u_int32_t SenderFibAddress; 981 1.1 ad u_int32_t ReceiverFibAddress; 982 1.1 ad u_int32_t SenderData; 983 1.1 ad union { 984 1.1 ad struct { 985 1.1 ad u_int32_t ReceiverTimeStart; 986 1.1 ad u_int32_t ReceiverTimeDone; 987 1.1 ad } _s; 988 1.1 ad struct aac_fib_list_entry FibLinks; 989 1.1 ad } _u; 990 1.10 perry } __packed; 991 1.1 ad 992 1.1 ad #define AAC_FIB_DATASIZE (512 - sizeof(struct aac_fib_header)) 993 1.1 ad 994 1.1 ad struct aac_fib { 995 1.1 ad struct aac_fib_header Header; 996 1.1 ad u_int8_t data[AAC_FIB_DATASIZE]; 997 1.10 perry } __packed; 998 1.1 ad 999 1.1 ad /* 1000 1.1 ad * FIB commands 1001 1.1 ad */ 1002 1.1 ad #define TestCommandResponse 1 1003 1.1 ad #define TestAdapterCommand 2 1004 1.1 ad 1005 1.1 ad /* Lowlevel and comm commands */ 1006 1.1 ad #define LastTestCommand 100 1007 1.1 ad #define ReinitHostNormCommandQueue 101 1008 1.1 ad #define ReinitHostHighCommandQueue 102 1009 1.1 ad #define ReinitHostHighRespQueue 103 1010 1.1 ad #define ReinitHostNormRespQueue 104 1011 1.1 ad #define ReinitAdapNormCommandQueue 105 1012 1.1 ad #define ReinitAdapHighCommandQueue 107 1013 1.1 ad #define ReinitAdapHighRespQueue 108 1014 1.1 ad #define ReinitAdapNormRespQueue 109 1015 1.1 ad #define InterfaceShutdown 110 1016 1.1 ad #define DmaCommandFib 120 1017 1.1 ad #define StartProfile 121 1018 1.1 ad #define TermProfile 122 1019 1.1 ad #define SpeedTest 123 1020 1.1 ad #define TakeABreakPt 124 1021 1.1 ad #define RequestPerfData 125 1022 1.1 ad #define SetInterruptDefTimer 126 1023 1.1 ad #define SetInterruptDefCount 127 1024 1.1 ad #define GetInterruptDefStatus 128 1025 1.1 ad #define LastCommCommand 129 1026 1.1 ad 1027 1.1 ad /* filesystem commands */ 1028 1.1 ad #define NuFileSystem 300 1029 1.1 ad #define UFS 301 1030 1.1 ad #define HostFileSystem 302 1031 1.1 ad #define LastFileSystemCommand 303 1032 1.1 ad 1033 1.1 ad /* Container Commands */ 1034 1.1 ad #define ContainerCommand 500 1035 1.1 ad #define ContainerCommand64 501 1036 1.9 briggs #define RawIo 502 1037 1.1 ad 1038 1.1 ad /* Cluster Commands */ 1039 1.1 ad #define ClusterCommand 550 1040 1.1 ad 1041 1.1 ad /* Scsi Port commands (scsi passthrough) */ 1042 1.1 ad #define ScsiPortCommand 600 1043 1.9 briggs #define ScsiPortCommandU64 601 1044 1.9 briggs #define SataPortCommandU64 602 1045 1.9 briggs #define SasSmpPassThrough 603 1046 1.9 briggs #define SasRequestPhyInfo 612 1047 1.1 ad 1048 1.1 ad /* Misc house keeping and generic adapter initiated commands */ 1049 1.1 ad #define AifRequest 700 1050 1.1 ad #define CheckRevision 701 1051 1.1 ad #define FsaHostShutdown 702 1052 1.1 ad #define RequestAdapterInfo 703 1053 1.1 ad #define IsAdapterPaused 704 1054 1.1 ad #define SendHostTime 705 1055 1.9 briggs #define RequestSupplementAdapterInfo 706 /* Supp. Info for set in UCC 1056 1.9 briggs * use only if supported 1057 1.9 briggs * (RequestAdapterInfo first) */ 1058 1.9 briggs #define LastMiscCommand 707 1059 1.9 briggs 1060 1.9 briggs #define OnLineDiagnostic 800 1061 1.9 briggs #define FduAdapterTest 801 1062 1.9 briggs #define RequestCompatibilityId 802 1063 1.9 briggs #define AdapterEnvironmentInfo 803 /* temp. sensors */ 1064 1.9 briggs 1065 1.9 briggs #define NvsramEventLog 900 1066 1.9 briggs #define ResetNvsramEventLogPointers 901 1067 1.9 briggs #define EnableEventLog 902 1068 1.9 briggs #define DisableEventLog 903 1069 1.9 briggs #define EncryptedKeyTransportFIB 904 1070 1.9 briggs #define KeyableFeaturesFIB 905 1071 1.1 ad 1072 1.1 ad /* 1073 1.1 ad * FIB types 1074 1.1 ad */ 1075 1.1 ad #define AAC_FIBTYPE_TFIB 1 1076 1.1 ad #define AAC_FIBTYPE_TQE 2 1077 1.1 ad #define AAC_FIBTYPE_TCTPERF 3 1078 1.1 ad 1079 1.1 ad /* 1080 1.1 ad * FIB transfer state 1081 1.1 ad */ 1082 1.1 ad #define AAC_FIBSTATE_HOSTOWNED (1<<0) /* owned by the host */ 1083 1.1 ad #define AAC_FIBSTATE_ADAPTEROWNED (1<<1) /* owned by the adapter */ 1084 1.1 ad #define AAC_FIBSTATE_INITIALISED (1<<2) /* initialised */ 1085 1.1 ad #define AAC_FIBSTATE_EMPTY (1<<3) /* empty */ 1086 1.1 ad #define AAC_FIBSTATE_FROMPOOL (1<<4) /* allocated from pool */ 1087 1.1 ad #define AAC_FIBSTATE_FROMHOST (1<<5) /* sent from the host */ 1088 1.1 ad #define AAC_FIBSTATE_FROMADAP (1<<6) /* sent from the adapter */ 1089 1.1 ad #define AAC_FIBSTATE_REXPECTED (1<<7) /* response is expected */ 1090 1.1 ad #define AAC_FIBSTATE_RNOTEXPECTED (1<<8) /* response is not expected */ 1091 1.1 ad #define AAC_FIBSTATE_DONEADAP (1<<9) /* processed by the adapter */ 1092 1.1 ad #define AAC_FIBSTATE_DONEHOST (1<<10) /* processed by the host */ 1093 1.1 ad #define AAC_FIBSTATE_HIGH (1<<11) /* high priority */ 1094 1.1 ad #define AAC_FIBSTATE_NORM (1<<12) /* normal priority */ 1095 1.1 ad #define AAC_FIBSTATE_ASYNC (1<<13) 1096 1.1 ad #define AAC_FIBSTATE_ASYNCIO (1<<13) /* to be removed */ 1097 1.1 ad #define AAC_FIBSTATE_PAGEFILEIO (1<<14) /* to be removed */ 1098 1.1 ad #define AAC_FIBSTATE_SHUTDOWN (1<<15) 1099 1.1 ad #define AAC_FIBSTATE_LAZYWRITE (1<<16) /* to be removed */ 1100 1.1 ad #define AAC_FIBSTATE_ADAPMICROFIB (1<<17) 1101 1.1 ad #define AAC_FIBSTATE_BIOSFIB (1<<18) 1102 1.1 ad #define AAC_FIBSTATE_FAST_RESPONSE (1<<19) /* fast response capable */ 1103 1.1 ad #define AAC_FIBSTATE_APIFIB (1<<20) 1104 1.1 ad 1105 1.1 ad /* 1106 1.1 ad * FIB error values 1107 1.1 ad */ 1108 1.1 ad #define AAC_ERROR_NORMAL 0x00 1109 1.1 ad #define AAC_ERROR_PENDING 0x01 1110 1.1 ad #define AAC_ERROR_FATAL 0x02 1111 1.1 ad #define AAC_ERROR_INVALID_QUEUE 0x03 1112 1.1 ad #define AAC_ERROR_NOENTRIES 0x04 1113 1.1 ad #define AAC_ERROR_SENDFAILED 0x05 1114 1.1 ad #define AAC_ERROR_INVALID_QUEUE_PRIORITY 0x06 1115 1.1 ad #define AAC_ERROR_FIB_ALLOCATION_FAILED 0x07 1116 1.1 ad #define AAC_ERROR_FIB_DEALLOCATION_FAILED 0x08 1117 1.1 ad 1118 1.1 ad /* 1119 1.1 ad * Adapter Status Register 1120 1.1 ad * 1121 1.15 andvar * Phase Status mailbox is 32bits: 1122 1.1 ad * <31:16> = Phase Status 1123 1.1 ad * <15:0> = Phase 1124 1.1 ad * 1125 1.1 ad * The adapter reports its present state through the phase. Only 1126 1.1 ad * a single phase should be ever be set. Each phase can have multiple 1127 1.1 ad * phase status bits to provide more detailed information about the 1128 1.1 ad * state of the adapter. 1129 1.1 ad */ 1130 1.1 ad #define AAC_SELF_TEST_FAILED 0x00000004 1131 1.9 briggs #define AAC_MONITOR_PANIC 0x00000020 1132 1.1 ad #define AAC_UP_AND_RUNNING 0x00000080 1133 1.1 ad #define AAC_KERNEL_PANIC 0x00000100 1134 1.1 ad 1135 1.6 briggs /* 1136 1.6 briggs * Data types relating to control and monitoring of the NVRAM/WriteCache 1137 1.6 briggs * subsystem. 1138 1.6 briggs */ 1139 1.6 briggs 1140 1.6 briggs #define AAC_NFILESYS 24 /* maximum number of filesystems */ 1141 1.6 briggs 1142 1.6 briggs /* 1143 1.6 briggs * NVRAM/Write Cache subsystem states 1144 1.6 briggs */ 1145 1.6 briggs typedef enum { 1146 1.6 briggs NVSTATUS_DISABLED = 0, /* present, clean, not being used */ 1147 1.6 briggs NVSTATUS_ENABLED, /* present, possibly dirty, ready for use */ 1148 1.6 briggs NVSTATUS_ERROR, /* present, dirty, contains dirty data */ 1149 1.6 briggs NVSTATUS_BATTERY, /* present, bad or low battery, may contain 1150 1.6 briggs * dirty data */ 1151 1.6 briggs NVSTATUS_UNKNOWN /* for bad/missing device */ 1152 1.6 briggs } AAC_NVSTATUS; 1153 1.6 briggs 1154 1.6 briggs /* 1155 1.6 briggs * NVRAM/Write Cache subsystem battery component states 1156 1.6 briggs * 1157 1.6 briggs */ 1158 1.6 briggs typedef enum { 1159 1.6 briggs NVBATTSTATUS_NONE = 0, /* battery has no power or is not present */ 1160 1.6 briggs NVBATTSTATUS_LOW, /* battery is low on power */ 1161 1.6 briggs NVBATTSTATUS_OK, /* battery is okay - normal operation possible 1162 1.6 briggs * only in this state */ 1163 1.6 briggs NVBATTSTATUS_RECONDITIONING /* no battery present - reconditioning 1164 1.6 briggs * in process */ 1165 1.6 briggs } AAC_NVBATTSTATUS; 1166 1.6 briggs 1167 1.6 briggs /* 1168 1.6 briggs * Battery transition type 1169 1.6 briggs */ 1170 1.6 briggs typedef enum { 1171 1.6 briggs NVBATT_TRANSITION_NONE = 0, /* battery now has no power or is not 1172 1.6 briggs * present */ 1173 1.6 briggs NVBATT_TRANSITION_LOW, /* battery is now low on power */ 1174 1.6 briggs NVBATT_TRANSITION_OK /* battery is now okay - normal 1175 1.6 briggs * operation possible only in this 1176 1.6 briggs * state */ 1177 1.6 briggs } AAC_NVBATT_TRANSITION; 1178 1.6 briggs 1179 1.6 briggs /* 1180 1.6 briggs * NVRAM Info structure returned for NVRAM_GetInfo call 1181 1.6 briggs */ 1182 1.6 briggs struct aac_nvramdevinfo { 1183 1.6 briggs u_int32_t NV_Enabled; /* write caching enabled */ 1184 1.6 briggs u_int32_t NV_Error; /* device in error state */ 1185 1.6 briggs u_int32_t NV_NDirty; /* count of dirty NVRAM buffers */ 1186 1.6 briggs u_int32_t NV_NActive; /* count of NVRAM buffers being 1187 1.6 briggs * written */ 1188 1.12 gmcgarry } __packed; 1189 1.6 briggs 1190 1.6 briggs struct aac_nvraminfo { 1191 1.6 briggs AAC_NVSTATUS NV_Status; /* nvram subsystem status */ 1192 1.6 briggs AAC_NVBATTSTATUS NV_BattStatus; /* battery status */ 1193 1.6 briggs u_int32_t NV_Size; /* size of WriteCache NVRAM in 1194 1.6 briggs * bytes */ 1195 1.6 briggs u_int32_t NV_BufSize; /* size of NVRAM buffers in 1196 1.6 briggs * bytes */ 1197 1.6 briggs u_int32_t NV_NBufs; /* number of NVRAM buffers */ 1198 1.6 briggs u_int32_t NV_NDirty; /* Num dirty NVRAM buffers */ 1199 1.6 briggs u_int32_t NV_NClean; /* Num clean NVRAM buffers */ 1200 1.6 briggs u_int32_t NV_NActive; /* Num NVRAM buffers being 1201 1.6 briggs * written */ 1202 1.6 briggs u_int32_t NV_NBrokered; /* Num brokered NVRAM buffers */ 1203 1.6 briggs struct aac_nvramdevinfo NV_DevInfo[AAC_NFILESYS]; /* per device 1204 1.6 briggs * info */ 1205 1.6 briggs u_int32_t NV_BattNeedsReconditioning; /* boolean */ 1206 1.6 briggs u_int32_t NV_TotalSize; /* size of all non-volatile 1207 1.6 briggs * memories in bytes */ 1208 1.12 gmcgarry } __packed; 1209 1.6 briggs 1210 1.6 briggs /* 1211 1.6 briggs * Data types relating to adapter-initiated FIBs 1212 1.6 briggs * 1213 1.6 briggs * Based on types and structures in <aifstruc.h> 1214 1.6 briggs */ 1215 1.6 briggs 1216 1.6 briggs /* 1217 1.6 briggs * Progress Reports 1218 1.6 briggs */ 1219 1.6 briggs typedef enum { 1220 1.6 briggs AifJobStsSuccess = 1, 1221 1.6 briggs AifJobStsFinished, 1222 1.6 briggs AifJobStsAborted, 1223 1.6 briggs AifJobStsFailed, 1224 1.6 briggs AifJobStsLastReportMarker = 100, /* All prior mean last report */ 1225 1.6 briggs AifJobStsSuspended, 1226 1.6 briggs AifJobStsRunning 1227 1.6 briggs } AAC_AifJobStatus; 1228 1.6 briggs 1229 1.6 briggs typedef enum { 1230 1.6 briggs AifJobScsiMin = 1, /* Minimum value for Scsi operation */ 1231 1.6 briggs AifJobScsiZero, /* SCSI device clear operation */ 1232 1.6 briggs AifJobScsiVerify, /* SCSI device Verify operation NO 1233 1.6 briggs * REPAIR */ 1234 1.6 briggs AifJobScsiExercise, /* SCSI device Exercise operation */ 1235 1.6 briggs AifJobScsiVerifyRepair, /* SCSI device Verify operation WITH 1236 1.6 briggs * repair */ 1237 1.6 briggs AifJobScsiWritePattern, /* write pattern */ 1238 1.6 briggs AifJobScsiMax = 99, /* Max Scsi value */ 1239 1.6 briggs AifJobCtrMin, /* Min Ctr op value */ 1240 1.6 briggs AifJobCtrZero, /* Container clear operation */ 1241 1.6 briggs AifJobCtrCopy, /* Container copy operation */ 1242 1.6 briggs AifJobCtrCreateMirror, /* Container Create Mirror operation */ 1243 1.6 briggs AifJobCtrMergeMirror, /* Container Merge Mirror operation */ 1244 1.6 briggs AifJobCtrScrubMirror, /* Container Scrub Mirror operation */ 1245 1.6 briggs AifJobCtrRebuildRaid5, /* Container Rebuild Raid5 operation */ 1246 1.6 briggs AifJobCtrScrubRaid5, /* Container Scrub Raid5 operation */ 1247 1.6 briggs AifJobCtrMorph, /* Container morph operation */ 1248 1.6 briggs AifJobCtrPartCopy, /* Container Partition copy operation */ 1249 1.6 briggs AifJobCtrRebuildMirror, /* Container Rebuild Mirror operation */ 1250 1.6 briggs AifJobCtrCrazyCache, /* crazy cache */ 1251 1.6 briggs AifJobCtrCopyback, /* Container Copyback operation */ 1252 1.6 briggs AifJobCtrCompactRaid5D, /* Container Compaction operation */ 1253 1.6 briggs AifJobCtrExpandRaid5D, /* Container Expansion operation */ 1254 1.6 briggs AifJobCtrRebuildRaid6, /* Container Rebuild Raid6 operation */ 1255 1.6 briggs AifJobCtrScrubRaid6, /* Container Scrub Raid6 operation */ 1256 1.6 briggs AifJobCtrSSBackup, /* Container snapshot backup task */ 1257 1.6 briggs AifJobCtrMax = 199, /* Max Ctr type operation */ 1258 1.6 briggs AifJobFsMin, /* Min Fs type operation */ 1259 1.6 briggs AifJobFsCreate, /* File System Create operation */ 1260 1.6 briggs AifJobFsVerify, /* File System Verify operation */ 1261 1.6 briggs AifJobFsExtend, /* File System Extend operation */ 1262 1.6 briggs AifJobFsMax = 299, /* Max Fs type operation */ 1263 1.6 briggs AifJobApiFormatNTFS, /* Format a drive to NTFS */ 1264 1.6 briggs AifJobApiFormatFAT, /* Format a drive to FAT */ 1265 1.6 briggs AifJobApiUpdateSnapshot, /* update the read/write half of a 1266 1.6 briggs * snapshot */ 1267 1.6 briggs AifJobApiFormatFAT32, /* Format a drive to FAT32 */ 1268 1.6 briggs AifJobApiMax = 399, /* Max API type operation */ 1269 1.6 briggs AifJobCtlContinuousCtrVerify, /* Adapter operation */ 1270 1.6 briggs AifJobCtlMax = 499 /* Max Adapter type operation */ 1271 1.6 briggs } AAC_AifJobType; 1272 1.6 briggs 1273 1.6 briggs struct aac_AifContainers { 1274 1.6 briggs u_int32_t src; /* from/master */ 1275 1.6 briggs u_int32_t dst; /* to/slave */ 1276 1.12 gmcgarry } __packed; 1277 1.6 briggs 1278 1.6 briggs union aac_AifJobClient { 1279 1.6 briggs struct aac_AifContainers container; /* For Container and 1280 1.6 briggs * filesystem progress 1281 1.6 briggs * ops; */ 1282 1.6 briggs int32_t scsi_dh; /* For SCSI progress 1283 1.6 briggs * ops */ 1284 1.6 briggs }; 1285 1.6 briggs 1286 1.6 briggs struct aac_AifJobDesc { 1287 1.6 briggs u_int32_t jobID; /* DO NOT FILL IN! Will be 1288 1.6 briggs * filled in by AIF */ 1289 1.6 briggs AAC_AifJobType type; /* Operation that is being 1290 1.6 briggs * performed */ 1291 1.6 briggs union aac_AifJobClient client; /* Details */ 1292 1.12 gmcgarry } __packed; 1293 1.6 briggs 1294 1.6 briggs struct aac_AifJobProgressReport { 1295 1.6 briggs struct aac_AifJobDesc jd; 1296 1.6 briggs AAC_AifJobStatus status; 1297 1.6 briggs u_int32_t finalTick; 1298 1.6 briggs u_int32_t currentTick; 1299 1.6 briggs u_int32_t jobSpecificData1; 1300 1.6 briggs u_int32_t jobSpecificData2; 1301 1.12 gmcgarry } __packed; 1302 1.6 briggs 1303 1.6 briggs /* 1304 1.6 briggs * Event Notification 1305 1.6 briggs */ 1306 1.6 briggs typedef enum { 1307 1.6 briggs /* General application notifies start here */ 1308 1.6 briggs AifEnGeneric = 1, /* Generic notification */ 1309 1.6 briggs AifEnTaskComplete, /* Task has completed */ 1310 1.6 briggs AifEnConfigChange, /* Adapter config change occurred */ 1311 1.6 briggs AifEnContainerChange, /* Adapter specific container 1312 1.6 briggs * configuration change */ 1313 1.6 briggs AifEnDeviceFailure, /* SCSI device failed */ 1314 1.6 briggs AifEnMirrorFailover, /* Mirror failover started */ 1315 1.6 briggs AifEnContainerEvent, /* Significant container event */ 1316 1.6 briggs AifEnFileSystemChange, /* File system changed */ 1317 1.6 briggs AifEnConfigPause, /* Container pause event */ 1318 1.6 briggs AifEnConfigResume, /* Container resume event */ 1319 1.6 briggs AifEnFailoverChange, /* Failover space assignment changed */ 1320 1.6 briggs AifEnRAID5RebuildDone, /* RAID5 rebuild finished */ 1321 1.6 briggs AifEnEnclosureManagement, /* Enclosure management event */ 1322 1.6 briggs AifEnBatteryEvent, /* Significant NV battery event */ 1323 1.6 briggs AifEnAddContainer, /* A new container was created. */ 1324 1.6 briggs AifEnDeleteContainer, /* A container was deleted. */ 1325 1.6 briggs AifEnSMARTEvent, /* SMART Event */ 1326 1.6 briggs AifEnBatteryNeedsRecond, /* The battery needs reconditioning */ 1327 1.6 briggs AifEnClusterEvent, /* Some cluster event */ 1328 1.14 andvar AifEnDiskSetEvent, /* A disk set event occurred. */ 1329 1.6 briggs AifDriverNotifyStart=199, /* Notifies for host driver go here */ 1330 1.6 briggs /* Host driver notifications start here */ 1331 1.6 briggs AifDenMorphComplete, /* A morph operation completed */ 1332 1.6 briggs AifDenVolumeExtendComplete /* Volume expand operation completed */ 1333 1.6 briggs } AAC_AifEventNotifyType; 1334 1.6 briggs 1335 1.6 briggs struct aac_AifEnsGeneric { 1336 1.6 briggs char text[132]; /* Generic text */ 1337 1.12 gmcgarry } __packed; 1338 1.6 briggs 1339 1.6 briggs struct aac_AifEnsDeviceFailure { 1340 1.6 briggs u_int32_t deviceHandle; /* SCSI device handle */ 1341 1.12 gmcgarry } __packed; 1342 1.6 briggs 1343 1.6 briggs struct aac_AifEnsMirrorFailover { 1344 1.6 briggs u_int32_t container; /* Container with failed element */ 1345 1.6 briggs u_int32_t failedSlice; /* Old slice which failed */ 1346 1.6 briggs u_int32_t creatingSlice; /* New slice used for auto-create */ 1347 1.12 gmcgarry } __packed; 1348 1.6 briggs 1349 1.6 briggs struct aac_AifEnsContainerChange { 1350 1.6 briggs u_int32_t container[2]; /* container that changed, -1 if no 1351 1.6 briggs * container */ 1352 1.12 gmcgarry } __packed; 1353 1.6 briggs 1354 1.6 briggs struct aac_AifEnsContainerEvent { 1355 1.6 briggs u_int32_t container; /* container number */ 1356 1.6 briggs u_int32_t eventType; /* event type */ 1357 1.12 gmcgarry } __packed; 1358 1.6 briggs 1359 1.6 briggs struct aac_AifEnsEnclosureEvent { 1360 1.6 briggs u_int32_t empID; /* enclosure management proc number */ 1361 1.6 briggs u_int32_t unitID; /* unitId, fan id, power supply id, 1362 1.6 briggs * slot id, tempsensor id. */ 1363 1.6 briggs u_int32_t eventType; /* event type */ 1364 1.12 gmcgarry } __packed; 1365 1.6 briggs 1366 1.6 briggs struct aac_AifEnsBatteryEvent { 1367 1.6 briggs AAC_NVBATT_TRANSITION transition_type; /* eg from low to ok */ 1368 1.6 briggs AAC_NVBATTSTATUS current_state; /* current batt state */ 1369 1.6 briggs AAC_NVBATTSTATUS prior_state; /* prev batt state */ 1370 1.12 gmcgarry } __packed; 1371 1.6 briggs 1372 1.6 briggs struct aac_AifEnsDiskSetEvent { 1373 1.6 briggs u_int32_t eventType; 1374 1.6 briggs u_int64_t DsNum; 1375 1.6 briggs u_int64_t CreatorId; 1376 1.12 gmcgarry } __packed; 1377 1.6 briggs 1378 1.6 briggs typedef enum { 1379 1.6 briggs CLUSTER_NULL_EVENT = 0, 1380 1.6 briggs CLUSTER_PARTNER_NAME_EVENT, /* change in partner hostname or 1381 1.6 briggs * adaptername from NULL to non-NULL */ 1382 1.6 briggs /* (partner's agent may be up) */ 1383 1.6 briggs CLUSTER_PARTNER_NULL_NAME_EVENT /* change in partner hostname or 1384 1.6 briggs * adaptername from non-null to NULL */ 1385 1.6 briggs /* (partner has rebooted) */ 1386 1.6 briggs } AAC_ClusterAifEvent; 1387 1.6 briggs 1388 1.6 briggs struct aac_AifEnsClusterEvent { 1389 1.6 briggs AAC_ClusterAifEvent eventType; 1390 1.12 gmcgarry } __packed; 1391 1.6 briggs 1392 1.6 briggs struct aac_AifEventNotify { 1393 1.6 briggs AAC_AifEventNotifyType type; 1394 1.6 briggs union { 1395 1.6 briggs struct aac_AifEnsGeneric EG; 1396 1.6 briggs struct aac_AifEnsDeviceFailure EDF; 1397 1.6 briggs struct aac_AifEnsMirrorFailover EMF; 1398 1.6 briggs struct aac_AifEnsContainerChange ECC; 1399 1.6 briggs struct aac_AifEnsContainerEvent ECE; 1400 1.6 briggs struct aac_AifEnsEnclosureEvent EEE; 1401 1.6 briggs struct aac_AifEnsBatteryEvent EBE; 1402 1.6 briggs struct aac_AifEnsDiskSetEvent EDS; 1403 1.6 briggs /* struct aac_AifEnsSMARTEvent ES;*/ 1404 1.6 briggs struct aac_AifEnsClusterEvent ECLE; 1405 1.6 briggs } data; 1406 1.12 gmcgarry } __packed; 1407 1.6 briggs 1408 1.6 briggs /* 1409 1.6 briggs * Adapter Initiated FIB command structures. Start with the adapter 1410 1.6 briggs * initiated FIBs that really come from the adapter, and get responded 1411 1.6 briggs * to by the host. 1412 1.6 briggs */ 1413 1.6 briggs #define AAC_AIF_REPORT_MAX_SIZE 64 1414 1.6 briggs 1415 1.6 briggs typedef enum { 1416 1.6 briggs AifCmdEventNotify = 1, /* Notify of event */ 1417 1.6 briggs AifCmdJobProgress, /* Progress report */ 1418 1.6 briggs AifCmdAPIReport, /* Report from other user of API */ 1419 1.6 briggs AifCmdDriverNotify, /* Notify host driver of event */ 1420 1.6 briggs AifReqJobList = 100, /* Gets back complete job list */ 1421 1.6 briggs AifReqJobsForCtr, /* Gets back jobs for specific container */ 1422 1.6 briggs AifReqJobsForScsi, /* Gets back jobs for specific SCSI device */ 1423 1.6 briggs AifReqJobReport, /* Gets back a specific job report or list */ 1424 1.6 briggs AifReqTerminateJob, /* Terminates job */ 1425 1.6 briggs AifReqSuspendJob, /* Suspends a job */ 1426 1.6 briggs AifReqResumeJob, /* Resumes a job */ 1427 1.6 briggs AifReqSendAPIReport, /* API generic report requests */ 1428 1.6 briggs AifReqAPIJobStart, /* Start a job from the API */ 1429 1.6 briggs AifReqAPIJobUpdate, /* Update a job report from the API */ 1430 1.6 briggs AifReqAPIJobFinish /* Finish a job from the API */ 1431 1.6 briggs } AAC_AifCommand; 1432 1.6 briggs 1433 1.6 briggs struct aac_aif_command { 1434 1.6 briggs AAC_AifCommand command; /* Tell host what type of 1435 1.6 briggs * notify this is */ 1436 1.6 briggs u_int32_t seqNumber; /* To allow ordering of 1437 1.6 briggs * reports (if necessary) */ 1438 1.6 briggs union { 1439 1.6 briggs struct aac_AifEventNotify EN; /* Event notify */ 1440 1.6 briggs struct aac_AifJobProgressReport PR[1]; /* Progress report */ 1441 1.6 briggs u_int8_t AR[AAC_AIF_REPORT_MAX_SIZE]; 1442 1.6 briggs u_int8_t data[AAC_FIB_DATASIZE - 8]; 1443 1.6 briggs } data; 1444 1.12 gmcgarry } __packed; 1445 1.6 briggs 1446 1.1 ad #endif /* !_PCI_AACREG_H_ */ 1447