ia64/xen-unstable

annotate xen/drivers/scsi/aacraid/aacraid.h @ 677:3946af49a538

bitkeeper revision 1.392 (3f3244ecABjhViAc-zlxaKkbsstr4Q)

Many files:
Upgraded our aacraid driver to latest Linux-ac version (Linux 2.4.21-ac4 with aacraid v1.1.2).
author kaf24@scramble.cl.cam.ac.uk
date Thu Aug 07 12:24:12 2003 +0000 (2003-08-07)
parents 9888f92572ba
children db2e1ea917df 7a554cbf0f58
rev   line source
kaf24@677 1 //#define dprintk(x) printk x
kaf24@677 2 #if (!defined(dprintk))
kaf24@677 3 # define dprintk(x)
kaf24@677 4 #endif
iap10@236 5
kaf24@677 6 /* Start of Xen additions XXX */
iap10@236 7 #include <asm/byteorder.h>
kaf24@677 8 #include <xeno/interrupt.h>
iap10@236 9 #define TRY_TASKLET
kaf24@677 10 /* End of Xen additions XXX */
iap10@236 11
iap10@236 12 /*------------------------------------------------------------------------------
iap10@236 13 * D E F I N E S
iap10@236 14 *----------------------------------------------------------------------------*/
iap10@236 15
iap10@236 16 #define MAXIMUM_NUM_CONTAINERS 31
iap10@236 17 #define MAXIMUM_NUM_ADAPTERS 8
iap10@236 18
kaf24@677 19 #define AAC_NUM_FIB 578
kaf24@677 20 //#define AAC_NUM_IO_FIB 512
kaf24@677 21 #define AAC_NUM_IO_FIB 100
iap10@236 22
kaf24@677 23 #define AAC_MAX_TARGET (MAXIMUM_NUM_CONTAINERS+1)
iap10@236 24 //#define AAC_MAX_TARGET (16)
kaf24@677 25 #define AAC_MAX_LUN (8)
iap10@236 26
iap10@236 27 /*
iap10@236 28 * These macros convert from physical channels to virtual channels
iap10@236 29 */
iap10@236 30 #define CONTAINER_CHANNEL (0)
iap10@236 31 #define aac_phys_to_logical(x) (x+1)
iap10@236 32 #define aac_logical_to_phys(x) (x?x-1:0)
iap10@236 33
iap10@236 34 #define AAC_DETAILED_STATUS_INFO
iap10@236 35
iap10@236 36 struct diskparm
iap10@236 37 {
iap10@236 38 int heads;
iap10@236 39 int sectors;
iap10@236 40 int cylinders;
iap10@236 41 };
iap10@236 42
iap10@236 43
iap10@236 44 /*
iap10@236 45 * DON'T CHANGE THE ORDER, this is set by the firmware
iap10@236 46 */
iap10@236 47
iap10@236 48 #define CT_NONE 0
iap10@236 49 #define CT_VOLUME 1
iap10@236 50 #define CT_MIRROR 2
iap10@236 51 #define CT_STRIPE 3
iap10@236 52 #define CT_RAID5 4
iap10@236 53 #define CT_SSRW 5
iap10@236 54 #define CT_SSRO 6
iap10@236 55 #define CT_MORPH 7
iap10@236 56 #define CT_PASSTHRU 8
iap10@236 57 #define CT_RAID4 9
iap10@236 58 #define CT_RAID10 10 /* stripe of mirror */
iap10@236 59 #define CT_RAID00 11 /* stripe of stripe */
iap10@236 60 #define CT_VOLUME_OF_MIRRORS 12 /* volume of mirror */
iap10@236 61 #define CT_PSEUDO_RAID 13 /* really raid4 */
iap10@236 62 #define CT_LAST_VOLUME_TYPE 14
iap10@236 63
iap10@236 64 /*
iap10@236 65 * Types of objects addressable in some fashion by the client.
iap10@236 66 * This is a superset of those objects handled just by the filesystem
iap10@236 67 * and includes "raw" objects that an administrator would use to
iap10@236 68 * configure containers and filesystems.
iap10@236 69 */
iap10@236 70
iap10@236 71 #define FT_REG 1 /* regular file */
iap10@236 72 #define FT_DIR 2 /* directory */
iap10@236 73 #define FT_BLK 3 /* "block" device - reserved */
iap10@236 74 #define FT_CHR 4 /* "character special" device - reserved */
iap10@236 75 #define FT_LNK 5 /* symbolic link */
iap10@236 76 #define FT_SOCK 6 /* socket */
iap10@236 77 #define FT_FIFO 7 /* fifo */
iap10@236 78 #define FT_FILESYS 8 /* ADAPTEC's "FSA"(tm) filesystem */
iap10@236 79 #define FT_DRIVE 9 /* physical disk - addressable in scsi by bus/target/lun */
iap10@236 80 #define FT_SLICE 10 /* virtual disk - raw volume - slice */
iap10@236 81 #define FT_PARTITION 11 /* FSA partition - carved out of a slice - building block for containers */
iap10@236 82 #define FT_VOLUME 12 /* Container - Volume Set */
iap10@236 83 #define FT_STRIPE 13 /* Container - Stripe Set */
iap10@236 84 #define FT_MIRROR 14 /* Container - Mirror Set */
iap10@236 85 #define FT_RAID5 15 /* Container - Raid 5 Set */
iap10@236 86 #define FT_DATABASE 16 /* Storage object with "foreign" content manager */
iap10@236 87
iap10@236 88 /*
iap10@236 89 * Host side memory scatter gather list
iap10@236 90 * Used by the adapter for read, write, and readdirplus operations
iap10@236 91 * We have seperate 32 and 64 bit version because even
iap10@236 92 * on 64 bit systems not all cards support the 64 bit version
iap10@236 93 */
iap10@236 94 struct sgentry {
iap10@236 95 u32 addr; /* 32-bit address. */
iap10@236 96 u32 count; /* Length. */
iap10@236 97 };
iap10@236 98
iap10@236 99 struct sgentry64 {
iap10@236 100 u32 addr[2]; /* 64-bit addr. 2 pieces for data alignment */
iap10@236 101 u32 count; /* Length. */
iap10@236 102 };
iap10@236 103
iap10@236 104 /*
iap10@236 105 * SGMAP
iap10@236 106 *
iap10@236 107 * This is the SGMAP structure for all commands that use
iap10@236 108 * 32-bit addressing.
iap10@236 109 */
iap10@236 110
iap10@236 111 struct sgmap {
iap10@236 112 u32 count;
iap10@236 113 struct sgentry sg[1];
iap10@236 114 };
iap10@236 115
iap10@236 116 struct sgmap64 {
iap10@236 117 u32 count;
iap10@236 118 struct sgentry64 sg[1];
iap10@236 119 };
iap10@236 120
iap10@236 121 struct creation_info
iap10@236 122 {
iap10@236 123 u8 buildnum; /* e.g., 588 */
iap10@236 124 u8 usec; /* e.g., 588 */
iap10@236 125 u8 via; /* e.g., 1 = FSU,
iap10@236 126 * 2 = API
iap10@236 127 */
iap10@236 128 u8 year; /* e.g., 1997 = 97 */
iap10@236 129 u32 date; /*
iap10@236 130 * unsigned Month :4; // 1 - 12
iap10@236 131 * unsigned Day :6; // 1 - 32
iap10@236 132 * unsigned Hour :6; // 0 - 23
iap10@236 133 * unsigned Minute :6; // 0 - 60
iap10@236 134 * unsigned Second :6; // 0 - 60
iap10@236 135 */
iap10@236 136 u32 serial[2]; /* e.g., 0x1DEADB0BFAFAF001 */
iap10@236 137 };
iap10@236 138
iap10@236 139
iap10@236 140 /*
iap10@236 141 * Define all the constants needed for the communication interface
iap10@236 142 */
iap10@236 143
iap10@236 144 /*
iap10@236 145 * Define how many queue entries each queue will have and the total
iap10@236 146 * number of entries for the entire communication interface. Also define
iap10@236 147 * how many queues we support.
iap10@236 148 *
iap10@236 149 * This has to match the controller
iap10@236 150 */
iap10@236 151
iap10@236 152 #define NUMBER_OF_COMM_QUEUES 8 // 4 command; 4 response
iap10@236 153 #define HOST_HIGH_CMD_ENTRIES 4
iap10@236 154 #define HOST_NORM_CMD_ENTRIES 8
iap10@236 155 #define ADAP_HIGH_CMD_ENTRIES 4
iap10@236 156 #define ADAP_NORM_CMD_ENTRIES 512
iap10@236 157 #define HOST_HIGH_RESP_ENTRIES 4
iap10@236 158 #define HOST_NORM_RESP_ENTRIES 512
iap10@236 159 #define ADAP_HIGH_RESP_ENTRIES 4
iap10@236 160 #define ADAP_NORM_RESP_ENTRIES 8
iap10@236 161
iap10@236 162 #define TOTAL_QUEUE_ENTRIES \
iap10@236 163 (HOST_NORM_CMD_ENTRIES + HOST_HIGH_CMD_ENTRIES + ADAP_NORM_CMD_ENTRIES + ADAP_HIGH_CMD_ENTRIES + \
iap10@236 164 HOST_NORM_RESP_ENTRIES + HOST_HIGH_RESP_ENTRIES + ADAP_NORM_RESP_ENTRIES + ADAP_HIGH_RESP_ENTRIES)
iap10@236 165
iap10@236 166
iap10@236 167 /*
iap10@236 168 * Set the queues on a 16 byte alignment
iap10@236 169 */
iap10@236 170
iap10@236 171 #define QUEUE_ALIGNMENT 16
iap10@236 172
iap10@236 173 /*
iap10@236 174 * The queue headers define the Communication Region queues. These
iap10@236 175 * are physically contiguous and accessible by both the adapter and the
iap10@236 176 * host. Even though all queue headers are in the same contiguous block
iap10@236 177 * they will be represented as individual units in the data structures.
iap10@236 178 */
iap10@236 179
iap10@236 180 struct aac_entry {
iap10@236 181 u32 size; /* Size in bytes of Fib which this QE points to */
iap10@236 182 u32 addr; /* Receiver address of the FIB */
iap10@236 183 };
iap10@236 184
iap10@236 185 /*
iap10@236 186 * The adapter assumes the ProducerIndex and ConsumerIndex are grouped
iap10@236 187 * adjacently and in that order.
iap10@236 188 */
iap10@236 189
iap10@236 190 struct aac_qhdr {
iap10@236 191 u64 header_addr; /* Address to hand the adapter to access to this queue head */
iap10@236 192 u32 *producer; /* The producer index for this queue (host address) */
iap10@236 193 u32 *consumer; /* The consumer index for this queue (host address) */
iap10@236 194 };
iap10@236 195
iap10@236 196 /*
iap10@236 197 * Define all the events which the adapter would like to notify
iap10@236 198 * the host of.
iap10@236 199 */
iap10@236 200
iap10@236 201 #define HostNormCmdQue 1 /* Change in host normal priority command queue */
iap10@236 202 #define HostHighCmdQue 2 /* Change in host high priority command queue */
iap10@236 203 #define HostNormRespQue 3 /* Change in host normal priority response queue */
iap10@236 204 #define HostHighRespQue 4 /* Change in host high priority response queue */
iap10@236 205 #define AdapNormRespNotFull 5
iap10@236 206 #define AdapHighRespNotFull 6
iap10@236 207 #define AdapNormCmdNotFull 7
iap10@236 208 #define AdapHighCmdNotFull 8
iap10@236 209 #define SynchCommandComplete 9
iap10@236 210 #define AdapInternalError 0xfe /* The adapter detected an internal error shutting down */
iap10@236 211
iap10@236 212 /*
iap10@236 213 * Define all the events the host wishes to notify the
iap10@236 214 * adapter of. The first four values much match the Qid the
iap10@236 215 * corresponding queue.
iap10@236 216 */
iap10@236 217
iap10@236 218 #define AdapNormCmdQue 2
iap10@236 219 #define AdapHighCmdQue 3
iap10@236 220 #define AdapNormRespQue 6
iap10@236 221 #define AdapHighRespQue 7
iap10@236 222 #define HostShutdown 8
iap10@236 223 #define HostPowerFail 9
iap10@236 224 #define FatalCommError 10
iap10@236 225 #define HostNormRespNotFull 11
iap10@236 226 #define HostHighRespNotFull 12
iap10@236 227 #define HostNormCmdNotFull 13
iap10@236 228 #define HostHighCmdNotFull 14
iap10@236 229 #define FastIo 15
iap10@236 230 #define AdapPrintfDone 16
iap10@236 231
iap10@236 232 /*
iap10@236 233 * Define all the queues that the adapter and host use to communicate
iap10@236 234 * Number them to match the physical queue layout.
iap10@236 235 */
iap10@236 236
iap10@236 237 enum aac_queue_types {
iap10@236 238 HostNormCmdQueue = 0, /* Adapter to host normal priority command traffic */
iap10@236 239 HostHighCmdQueue, /* Adapter to host high priority command traffic */
iap10@236 240 AdapNormCmdQueue, /* Host to adapter normal priority command traffic */
iap10@236 241 AdapHighCmdQueue, /* Host to adapter high priority command traffic */
iap10@236 242 HostNormRespQueue, /* Adapter to host normal priority response traffic */
iap10@236 243 HostHighRespQueue, /* Adapter to host high priority response traffic */
iap10@236 244 AdapNormRespQueue, /* Host to adapter normal priority response traffic */
iap10@236 245 AdapHighRespQueue /* Host to adapter high priority response traffic */
iap10@236 246 };
iap10@236 247
iap10@236 248 /*
iap10@236 249 * Assign type values to the FSA communication data structures
iap10@236 250 */
iap10@236 251
iap10@236 252 #define FIB_MAGIC 0x0001
iap10@236 253
iap10@236 254 /*
iap10@236 255 * Define the priority levels the FSA communication routines support.
iap10@236 256 */
iap10@236 257
iap10@236 258 #define FsaNormal 1
iap10@236 259 #define FsaHigh 2
iap10@236 260
iap10@236 261 /*
iap10@236 262 * Define the FIB. The FIB is the where all the requested data and
iap10@236 263 * command information are put to the application on the FSA adapter.
iap10@236 264 */
iap10@236 265
iap10@236 266 struct aac_fibhdr {
kaf24@677 267 u32 XferState; // Current transfer state for this CCB
kaf24@677 268 u16 Command; // Routing information for the destination
kaf24@677 269 u8 StructType; // Type FIB
kaf24@677 270 u8 Flags; // Flags for FIB
kaf24@677 271 u16 Size; // Size of this FIB in bytes
kaf24@677 272 u16 SenderSize; // Size of the FIB in the sender (for response sizing)
kaf24@677 273 u32 SenderFibAddress; // Host defined data in the FIB
kaf24@677 274 u32 ReceiverFibAddress; // Logical address of this FIB for the adapter
kaf24@677 275 u32 SenderData; // Place holder for the sender to store data
kaf24@677 276 union {
kaf24@677 277 struct {
kaf24@677 278 u32 _ReceiverTimeStart; // Timestamp for receipt of fib
kaf24@677 279 u32 _ReceiverTimeDone; // Timestamp for completion of fib
kaf24@677 280 } _s;
kaf24@677 281 // struct aac_list_head _FibLinks; // Used to link Adapter Initiated Fibs on the host
kaf24@677 282 } _u;
iap10@236 283 };
iap10@236 284
kaf24@677 285 //#define FibLinks _u._FibLinks
iap10@236 286
iap10@236 287 #define FIB_DATA_SIZE_IN_BYTES (512 - sizeof(struct aac_fibhdr))
iap10@236 288
iap10@236 289
iap10@236 290 struct hw_fib {
iap10@236 291 struct aac_fibhdr header;
iap10@236 292 u8 data[FIB_DATA_SIZE_IN_BYTES]; // Command specific data
iap10@236 293 };
iap10@236 294
iap10@236 295 /*
iap10@236 296 * FIB commands
iap10@236 297 */
iap10@236 298
iap10@236 299 #define TestCommandResponse 1
iap10@236 300 #define TestAdapterCommand 2
iap10@236 301 /*
iap10@236 302 * Lowlevel and comm commands
iap10@236 303 */
iap10@236 304 #define LastTestCommand 100
iap10@236 305 #define ReinitHostNormCommandQueue 101
iap10@236 306 #define ReinitHostHighCommandQueue 102
iap10@236 307 #define ReinitHostHighRespQueue 103
iap10@236 308 #define ReinitHostNormRespQueue 104
iap10@236 309 #define ReinitAdapNormCommandQueue 105
iap10@236 310 #define ReinitAdapHighCommandQueue 107
iap10@236 311 #define ReinitAdapHighRespQueue 108
iap10@236 312 #define ReinitAdapNormRespQueue 109
iap10@236 313 #define InterfaceShutdown 110
iap10@236 314 #define DmaCommandFib 120
iap10@236 315 #define StartProfile 121
iap10@236 316 #define TermProfile 122
iap10@236 317 #define SpeedTest 123
iap10@236 318 #define TakeABreakPt 124
iap10@236 319 #define RequestPerfData 125
iap10@236 320 #define SetInterruptDefTimer 126
iap10@236 321 #define SetInterruptDefCount 127
iap10@236 322 #define GetInterruptDefStatus 128
iap10@236 323 #define LastCommCommand 129
iap10@236 324 /*
iap10@236 325 * Filesystem commands
iap10@236 326 */
iap10@236 327 #define NuFileSystem 300
iap10@236 328 #define UFS 301
iap10@236 329 #define HostFileSystem 302
iap10@236 330 #define LastFileSystemCommand 303
iap10@236 331 /*
iap10@236 332 * Container Commands
iap10@236 333 */
iap10@236 334 #define ContainerCommand 500
iap10@236 335 #define ContainerCommand64 501
iap10@236 336 /*
iap10@236 337 * Cluster Commands
iap10@236 338 */
iap10@236 339 #define ClusterCommand 550
iap10@236 340 /*
iap10@236 341 * Scsi Port commands (scsi passthrough)
iap10@236 342 */
iap10@236 343 #define ScsiPortCommand 600
iap10@236 344 #define ScsiPortCommand64 601
iap10@236 345 /*
iap10@236 346 * Misc house keeping and generic adapter initiated commands
iap10@236 347 */
iap10@236 348 #define AifRequest 700
iap10@236 349 #define CheckRevision 701
iap10@236 350 #define FsaHostShutdown 702
iap10@236 351 #define RequestAdapterInfo 703
iap10@236 352 #define IsAdapterPaused 704
iap10@236 353 #define SendHostTime 705
iap10@236 354 #define LastMiscCommand 706
iap10@236 355
iap10@236 356 //
iap10@236 357 // Commands that will target the failover level on the FSA adapter
iap10@236 358 //
iap10@236 359
iap10@236 360 enum fib_xfer_state {
iap10@236 361 HostOwned = (1<<0),
iap10@236 362 AdapterOwned = (1<<1),
iap10@236 363 FibInitialized = (1<<2),
iap10@236 364 FibEmpty = (1<<3),
iap10@236 365 AllocatedFromPool = (1<<4),
iap10@236 366 SentFromHost = (1<<5),
iap10@236 367 SentFromAdapter = (1<<6),
iap10@236 368 ResponseExpected = (1<<7),
iap10@236 369 NoResponseExpected = (1<<8),
iap10@236 370 AdapterProcessed = (1<<9),
iap10@236 371 HostProcessed = (1<<10),
iap10@236 372 HighPriority = (1<<11),
iap10@236 373 NormalPriority = (1<<12),
iap10@236 374 Async = (1<<13),
iap10@236 375 AsyncIo = (1<<13), // rpbfix: remove with new regime
iap10@236 376 PageFileIo = (1<<14), // rpbfix: remove with new regime
iap10@236 377 ShutdownRequest = (1<<15),
iap10@236 378 LazyWrite = (1<<16), // rpbfix: remove with new regime
iap10@236 379 AdapterMicroFib = (1<<17),
iap10@236 380 BIOSFibPath = (1<<18),
iap10@236 381 FastResponseCapable = (1<<19),
iap10@236 382 ApiFib = (1<<20) // Its an API Fib.
iap10@236 383 };
iap10@236 384
iap10@236 385 /*
iap10@236 386 * The following defines needs to be updated any time there is an
iap10@236 387 * incompatible change made to the aac_init structure.
iap10@236 388 */
iap10@236 389
iap10@236 390 #define ADAPTER_INIT_STRUCT_REVISION 3
iap10@236 391
iap10@236 392 struct aac_init
iap10@236 393 {
iap10@236 394 u32 InitStructRevision;
iap10@236 395 u32 MiniPortRevision;
iap10@236 396 u32 fsrev;
iap10@236 397 u32 CommHeaderAddress;
iap10@236 398 u32 FastIoCommAreaAddress;
iap10@236 399 u32 AdapterFibsPhysicalAddress;
iap10@236 400 u32 AdapterFibsVirtualAddress;
iap10@236 401 u32 AdapterFibsSize;
iap10@236 402 u32 AdapterFibAlign;
iap10@236 403 u32 printfbuf;
iap10@236 404 u32 printfbufsiz;
iap10@236 405 u32 HostPhysMemPages; // number of 4k pages of host physical memory
iap10@236 406 u32 HostElapsedSeconds; // number of seconds since 1970.
iap10@236 407 };
iap10@236 408
iap10@236 409 enum aac_log_level {
iap10@236 410 LOG_INIT = 10,
iap10@236 411 LOG_INFORMATIONAL = 20,
iap10@236 412 LOG_WARNING = 30,
iap10@236 413 LOG_LOW_ERROR = 40,
iap10@236 414 LOG_MEDIUM_ERROR = 50,
iap10@236 415 LOG_HIGH_ERROR = 60,
iap10@236 416 LOG_PANIC = 70,
iap10@236 417 LOG_DEBUG = 80,
iap10@236 418 LOG_WINDBG_PRINT = 90
iap10@236 419 };
iap10@236 420
iap10@236 421 #define FSAFS_NTC_GET_ADAPTER_FIB_CONTEXT 0x030b
iap10@236 422 #define FSAFS_NTC_FIB_CONTEXT 0x030c
iap10@236 423
iap10@236 424 struct aac_dev;
iap10@236 425
iap10@236 426 struct adapter_ops
iap10@236 427 {
iap10@236 428 void (*adapter_interrupt)(struct aac_dev *dev);
iap10@236 429 void (*adapter_notify)(struct aac_dev *dev, u32 event);
iap10@236 430 void (*adapter_enable_int)(struct aac_dev *dev, u32 event);
iap10@236 431 void (*adapter_disable_int)(struct aac_dev *dev, u32 event);
iap10@236 432 int (*adapter_sync_cmd)(struct aac_dev *dev, u32 command, u32 p1, u32 *status);
iap10@236 433 };
iap10@236 434
iap10@236 435 /*
iap10@236 436 * Define which interrupt handler needs to be installed
iap10@236 437 */
iap10@236 438
iap10@236 439 struct aac_driver_ident
iap10@236 440 {
iap10@236 441 u16 vendor;
iap10@236 442 u16 device;
iap10@236 443 u16 subsystem_vendor;
iap10@236 444 u16 subsystem_device;
iap10@236 445 int (*init)(struct aac_dev *dev, unsigned long num);
iap10@236 446 char * name;
iap10@236 447 char * vname;
iap10@236 448 char * model;
iap10@236 449 u16 channels;
kaf24@677 450 int quirks;
kaf24@677 451 #define AAC_QUIRK_31BIT 1
iap10@236 452 };
iap10@236 453
iap10@236 454 /*
iap10@236 455 * The adapter interface specs all queues to be located in the same
iap10@236 456 * physically contigous block. The host structure that defines the
iap10@236 457 * commuication queues will assume they are each a seperate physically
iap10@236 458 * contigous memory region that will support them all being one big
iap10@236 459 * contigous block.
iap10@236 460 * There is a command and response queue for each level and direction of
iap10@236 461 * commuication. These regions are accessed by both the host and adapter.
iap10@236 462 */
iap10@236 463
iap10@236 464 struct aac_queue {
iap10@236 465 u64 logical; /* This is the address we give the adapter */
iap10@236 466 struct aac_entry *base; /* This is the system virtual address */
iap10@236 467 struct aac_qhdr headers; /* A pointer to the producer and consumer queue headers for this queue */
iap10@236 468 u32 entries; /* Number of queue entries on this queue */
iap10@236 469 #if 0
iap10@236 470 wait_queue_head_t qfull; /* Event to wait on if the queue is full */
iap10@236 471 wait_queue_head_t cmdready; /* Indicates there is a Command ready from the adapter on this queue. */
kaf24@677 472 #endif /* This is only valid for adapter to host command queues. */
iap10@236 473 spinlock_t *lock; /* Spinlock for this queue must take this lock before accessing the lock */
iap10@236 474 spinlock_t lockdata; /* Actual lock (used only on one side of the lock) */
iap10@236 475 unsigned long SavedIrql; /* Previous IRQL when the spin lock is taken */
iap10@236 476 u32 padding; /* Padding - FIXME - can remove I believe */
iap10@236 477 struct list_head cmdq; /* A queue of FIBs which need to be prcessed by the FS thread. This is */
iap10@236 478 /* only valid for command queues which receive entries from the adapter. */
iap10@236 479 struct list_head pendingq; /* A queue of outstanding fib's to the adapter. */
iap10@236 480 unsigned long numpending; /* Number of entries on outstanding queue. */
iap10@236 481 struct aac_dev * dev; /* Back pointer to adapter structure */
iap10@236 482 };
iap10@236 483
iap10@236 484 /*
iap10@236 485 * Message queues. The order here is important, see also the
iap10@236 486 * queue type ordering
iap10@236 487 */
iap10@236 488
iap10@236 489 struct aac_queue_block
iap10@236 490 {
iap10@236 491 struct aac_queue queue[8];
iap10@236 492 };
iap10@236 493
iap10@236 494 /*
iap10@236 495 * SaP1 Message Unit Registers
iap10@236 496 */
iap10@236 497
iap10@236 498 struct sa_drawbridge_CSR {
iap10@236 499 // Offset | Name
iap10@236 500 u32 reserved[10]; // 00h-27h | Reserved
iap10@236 501 u8 LUT_Offset; // 28h | Looup Table Offset
iap10@236 502 u8 reserved1[3]; // 29h-2bh | Reserved
iap10@236 503 u32 LUT_Data; // 2ch | Looup Table Data
iap10@236 504 u32 reserved2[26]; // 30h-97h | Reserved
iap10@236 505 u16 PRICLEARIRQ; // 98h | Primary Clear Irq
iap10@236 506 u16 SECCLEARIRQ; // 9ah | Secondary Clear Irq
iap10@236 507 u16 PRISETIRQ; // 9ch | Primary Set Irq
iap10@236 508 u16 SECSETIRQ; // 9eh | Secondary Set Irq
iap10@236 509 u16 PRICLEARIRQMASK; // a0h | Primary Clear Irq Mask
iap10@236 510 u16 SECCLEARIRQMASK; // a2h | Secondary Clear Irq Mask
iap10@236 511 u16 PRISETIRQMASK; // a4h | Primary Set Irq Mask
iap10@236 512 u16 SECSETIRQMASK; // a6h | Secondary Set Irq Mask
iap10@236 513 u32 MAILBOX0; // a8h | Scratchpad 0
iap10@236 514 u32 MAILBOX1; // ach | Scratchpad 1
iap10@236 515 u32 MAILBOX2; // b0h | Scratchpad 2
iap10@236 516 u32 MAILBOX3; // b4h | Scratchpad 3
iap10@236 517 u32 MAILBOX4; // b8h | Scratchpad 4
iap10@236 518 u32 MAILBOX5; // bch | Scratchpad 5
iap10@236 519 u32 MAILBOX6; // c0h | Scratchpad 6
iap10@236 520 u32 MAILBOX7; // c4h | Scratchpad 7
iap10@236 521
iap10@236 522 u32 ROM_Setup_Data; // c8h | Rom Setup and Data
iap10@236 523 u32 ROM_Control_Addr; // cch | Rom Control and Address
iap10@236 524
iap10@236 525 u32 reserved3[12]; // d0h-ffh | reserved
iap10@236 526 u32 LUT[64]; // 100h-1ffh| Lookup Table Entries
iap10@236 527
iap10@236 528 //
iap10@236 529 // TO DO
iap10@236 530 // need to add DMA, I2O, UART, etc registers form 80h to 364h
iap10@236 531 //
iap10@236 532
iap10@236 533 };
iap10@236 534
iap10@236 535 #define Mailbox0 SaDbCSR.MAILBOX0
iap10@236 536 #define Mailbox1 SaDbCSR.MAILBOX1
iap10@236 537 #define Mailbox2 SaDbCSR.MAILBOX2
iap10@236 538 #define Mailbox3 SaDbCSR.MAILBOX3
iap10@236 539 #define Mailbox4 SaDbCSR.MAILBOX4
iap10@236 540 #define Mailbox5 SaDbCSR.MAILBOX5
iap10@236 541 #define Mailbox7 SaDbCSR.MAILBOX7
iap10@236 542
iap10@236 543 #define DoorbellReg_p SaDbCSR.PRISETIRQ
iap10@236 544 #define DoorbellReg_s SaDbCSR.SECSETIRQ
iap10@236 545 #define DoorbellClrReg_p SaDbCSR.PRICLEARIRQ
iap10@236 546
iap10@236 547
iap10@236 548 #define DOORBELL_0 cpu_to_le16(0x0001)
iap10@236 549 #define DOORBELL_1 cpu_to_le16(0x0002)
iap10@236 550 #define DOORBELL_2 cpu_to_le16(0x0004)
iap10@236 551 #define DOORBELL_3 cpu_to_le16(0x0008)
iap10@236 552 #define DOORBELL_4 cpu_to_le16(0x0010)
iap10@236 553 #define DOORBELL_5 cpu_to_le16(0x0020)
iap10@236 554 #define DOORBELL_6 cpu_to_le16(0x0040)
iap10@236 555
iap10@236 556
iap10@236 557 #define PrintfReady DOORBELL_5
iap10@236 558 #define PrintfDone DOORBELL_5
iap10@236 559
iap10@236 560 struct sa_registers {
iap10@236 561 struct sa_drawbridge_CSR SaDbCSR; /* 98h - c4h */
iap10@236 562 };
iap10@236 563
iap10@236 564
iap10@236 565 #define Sa_MINIPORT_REVISION 1
iap10@236 566
iap10@236 567 #define sa_readw(AEP, CSR) readl(&((AEP)->regs.sa->CSR))
iap10@236 568 #define sa_readl(AEP, CSR) readl(&((AEP)->regs.sa->CSR))
iap10@236 569 #define sa_writew(AEP, CSR, value) writew(value, &((AEP)->regs.sa->CSR))
iap10@236 570 #define sa_writel(AEP, CSR, value) writel(value, &((AEP)->regs.sa->CSR))
iap10@236 571
iap10@236 572 /*
iap10@236 573 * Rx Message Unit Registers
iap10@236 574 */
iap10@236 575
iap10@236 576 struct rx_mu_registers {
iap10@236 577 // Local | PCI* | Name
iap10@236 578 // | |
iap10@236 579 u32 ARSR; // 1300h | 00h | APIC Register Select Register
iap10@236 580 u32 reserved0; // 1304h | 04h | Reserved
iap10@236 581 u32 AWR; // 1308h | 08h | APIC Window Register
iap10@236 582 u32 reserved1; // 130Ch | 0Ch | Reserved
iap10@236 583 u32 IMRx[2]; // 1310h | 10h | Inbound Message Registers
iap10@236 584 u32 OMRx[2]; // 1318h | 18h | Outbound Message Registers
iap10@236 585 u32 IDR; // 1320h | 20h | Inbound Doorbell Register
iap10@236 586 u32 IISR; // 1324h | 24h | Inbound Interrupt Status Register
iap10@236 587 u32 IIMR; // 1328h | 28h | Inbound Interrupt Mask Register
iap10@236 588 u32 ODR; // 132Ch | 2Ch | Outbound Doorbell Register
iap10@236 589 u32 OISR; // 1330h | 30h | Outbound Interrupt Status Register
iap10@236 590 u32 OIMR; // 1334h | 34h | Outbound Interrupt Mask Register
iap10@236 591 // * Must access through ATU Inbound Translation Window
iap10@236 592 };
iap10@236 593
iap10@236 594 struct rx_inbound {
iap10@236 595 u32 Mailbox[8];
iap10@236 596 };
iap10@236 597
iap10@236 598 #define InboundMailbox0 IndexRegs.Mailbox[0]
iap10@236 599 #define InboundMailbox1 IndexRegs.Mailbox[1]
iap10@236 600 #define InboundMailbox2 IndexRegs.Mailbox[2]
iap10@236 601 #define InboundMailbox3 IndexRegs.Mailbox[3]
iap10@236 602 #define InboundMailbox4 IndexRegs.Mailbox[4]
iap10@236 603
iap10@236 604 #define INBOUNDDOORBELL_0 cpu_to_le32(0x00000001)
iap10@236 605 #define INBOUNDDOORBELL_1 cpu_to_le32(0x00000002)
iap10@236 606 #define INBOUNDDOORBELL_2 cpu_to_le32(0x00000004)
iap10@236 607 #define INBOUNDDOORBELL_3 cpu_to_le32(0x00000008)
iap10@236 608 #define INBOUNDDOORBELL_4 cpu_to_le32(0x00000010)
iap10@236 609 #define INBOUNDDOORBELL_5 cpu_to_le32(0x00000020)
iap10@236 610 #define INBOUNDDOORBELL_6 cpu_to_le32(0x00000040)
iap10@236 611
iap10@236 612 #define OUTBOUNDDOORBELL_0 cpu_to_le32(0x00000001)
iap10@236 613 #define OUTBOUNDDOORBELL_1 cpu_to_le32(0x00000002)
iap10@236 614 #define OUTBOUNDDOORBELL_2 cpu_to_le32(0x00000004)
iap10@236 615 #define OUTBOUNDDOORBELL_3 cpu_to_le32(0x00000008)
iap10@236 616 #define OUTBOUNDDOORBELL_4 cpu_to_le32(0x00000010)
iap10@236 617
iap10@236 618 #define InboundDoorbellReg MUnit.IDR
iap10@236 619 #define OutboundDoorbellReg MUnit.ODR
iap10@236 620
iap10@236 621 struct rx_registers {
iap10@236 622 struct rx_mu_registers MUnit; // 1300h - 1334h
iap10@236 623 u32 reserved1[6]; // 1338h - 134ch
iap10@236 624 struct rx_inbound IndexRegs;
iap10@236 625 };
iap10@236 626
iap10@236 627 #define rx_readb(AEP, CSR) readb(&((AEP)->regs.rx->CSR))
iap10@236 628 #define rx_readl(AEP, CSR) readl(&((AEP)->regs.rx->CSR))
iap10@236 629 #define rx_writeb(AEP, CSR, value) writeb(value, &((AEP)->regs.rx->CSR))
iap10@236 630 #define rx_writel(AEP, CSR, value) writel(value, &((AEP)->regs.rx->CSR))
iap10@236 631
iap10@236 632 struct fib;
iap10@236 633
iap10@236 634 typedef void (*fib_callback)(void *ctxt, struct fib *fibctx);
iap10@236 635
iap10@236 636 struct aac_fib_context {
iap10@236 637 s16 type; // used for verification of structure
iap10@236 638 s16 size;
iap10@236 639 ulong jiffies; // used for cleanup - dmb changed to ulong
iap10@236 640 struct list_head next; // used to link context's into a linked list
iap10@236 641 #if 0
iap10@236 642 struct semaphore wait_sem; // this is used to wait for the next fib to arrive.
iap10@236 643 #endif
iap10@236 644 int wait; // Set to true when thread is in WaitForSingleObject
iap10@236 645 unsigned long count; // total number of FIBs on FibList
kaf24@677 646 struct list_head fib_list; // this holds fibs which should be 32 bit addresses
iap10@236 647 };
iap10@236 648
iap10@236 649 struct fsa_scsi_hba {
iap10@236 650 u32 size[MAXIMUM_NUM_CONTAINERS];
iap10@236 651 u32 type[MAXIMUM_NUM_CONTAINERS];
iap10@236 652 u8 valid[MAXIMUM_NUM_CONTAINERS];
iap10@236 653 u8 ro[MAXIMUM_NUM_CONTAINERS];
iap10@236 654 u8 locked[MAXIMUM_NUM_CONTAINERS];
iap10@236 655 u8 deleted[MAXIMUM_NUM_CONTAINERS];
kaf24@677 656 s32 devno[MAXIMUM_NUM_CONTAINERS];
iap10@236 657 };
iap10@236 658
iap10@236 659 struct fib {
iap10@236 660 void *next; /* this is used by the allocator */
iap10@236 661 s16 type;
iap10@236 662 s16 size;
iap10@236 663 /*
iap10@236 664 * The Adapter that this I/O is destined for.
iap10@236 665 */
iap10@236 666 struct aac_dev *dev;
iap10@236 667 #if 0
iap10@236 668 /*
iap10@236 669 * This is the event the sendfib routine will wait on if the
iap10@236 670 * caller did not pass one and this is synch io.
iap10@236 671 */
iap10@236 672 struct semaphore event_wait;
iap10@236 673 #endif
iap10@236 674 spinlock_t event_lock;
iap10@236 675
iap10@236 676 u32 done; /* gets set to 1 when fib is complete */
iap10@236 677 fib_callback callback;
iap10@236 678 void *callback_data;
iap10@236 679 u32 flags; // u32 dmb was ulong
iap10@236 680 /*
iap10@236 681 * The following is used to put this fib context onto the
iap10@236 682 * Outstanding I/O queue.
iap10@236 683 */
iap10@236 684 struct list_head queue;
kaf24@677 685 /*
kaf24@677 686 * And for the internal issue/reply queues (we may be able
kaf24@677 687 * to merge these two)
kaf24@677 688 */
kaf24@677 689 struct list_head fiblink;
iap10@236 690 void *data;
kaf24@677 691 struct hw_fib *hw_fib; /* Actual shared object */
kaf24@677 692 dma_addr_t hw_fib_pa; /* physical address of hw_fib*/
iap10@236 693 };
iap10@236 694
iap10@236 695 /*
iap10@236 696 * Adapter Information Block
iap10@236 697 *
iap10@236 698 * This is returned by the RequestAdapterInfo block
iap10@236 699 */
iap10@236 700
iap10@236 701 struct aac_adapter_info
iap10@236 702 {
iap10@236 703 u32 platform;
iap10@236 704 u32 cpu;
iap10@236 705 u32 subcpu;
iap10@236 706 u32 clock;
iap10@236 707 u32 execmem;
iap10@236 708 u32 buffermem;
iap10@236 709 u32 totalmem;
iap10@236 710 u32 kernelrev;
iap10@236 711 u32 kernelbuild;
iap10@236 712 u32 monitorrev;
iap10@236 713 u32 monitorbuild;
iap10@236 714 u32 hwrev;
iap10@236 715 u32 hwbuild;
iap10@236 716 u32 biosrev;
iap10@236 717 u32 biosbuild;
iap10@236 718 u32 cluster;
kaf24@677 719 u32 clusterchannelmask;
iap10@236 720 u32 serial[2];
iap10@236 721 u32 battery;
iap10@236 722 u32 options;
iap10@236 723 u32 OEM;
iap10@236 724 };
iap10@236 725
iap10@236 726 /*
iap10@236 727 * Battery platforms
iap10@236 728 */
iap10@236 729 #define AAC_BAT_REQ_PRESENT (1)
iap10@236 730 #define AAC_BAT_REQ_NOTPRESENT (2)
iap10@236 731 #define AAC_BAT_OPT_PRESENT (3)
iap10@236 732 #define AAC_BAT_OPT_NOTPRESENT (4)
iap10@236 733 #define AAC_BAT_NOT_SUPPORTED (5)
iap10@236 734 /*
iap10@236 735 * cpu types
iap10@236 736 */
iap10@236 737 #define AAC_CPU_SIMULATOR (1)
iap10@236 738 #define AAC_CPU_I960 (2)
iap10@236 739 #define AAC_CPU_STRONGARM (3)
iap10@236 740
iap10@236 741 /*
iap10@236 742 * Supported Options
iap10@236 743 */
kaf24@677 744 #define AAC_OPT_SNAPSHOT cpu_to_le32(1)
kaf24@677 745 #define AAC_OPT_CLUSTERS cpu_to_le32(1<<1)
kaf24@677 746 #define AAC_OPT_WRITE_CACHE cpu_to_le32(1<<2)
kaf24@677 747 #define AAC_OPT_64BIT_DATA cpu_to_le32(1<<3)
kaf24@677 748 #define AAC_OPT_HOST_TIME_FIB cpu_to_le32(1<<4)
kaf24@677 749 #define AAC_OPT_RAID50 cpu_to_le32(1<<5)
kaf24@677 750 #define AAC_OPT_4GB_WINDOW cpu_to_le32(1<<6)
kaf24@677 751 #define AAC_OPT_SCSI_UPGRADEABLE cpu_to_le32(1<<7)
kaf24@677 752 #define AAC_OPT_SOFT_ERR_REPORT cpu_to_le32(1<<8)
kaf24@677 753 #define AAC_OPT_SUPPORTED_RECONDITION cpu_to_le32(1<<9)
kaf24@677 754 #define AAC_OPT_SGMAP_HOST64 cpu_to_le32(1<<10)
kaf24@677 755 #define AAC_OPT_ALARM cpu_to_le32(1<<11)
kaf24@677 756 #define AAC_OPT_NONDASD cpu_to_le32(1<<12)
kaf24@677 757 #define AAC_OPT_SCSI_MANAGED cpu_to_le32(1<<13)
kaf24@677 758 #define AAC_OPT_RAID_SCSI_MODE cpu_to_le32(1<<14)
kaf24@677 759 #define AAC_OPT_SUPPLEMENT_ADAPTER_INFO cpu_to_le32(1<<15)
iap10@236 760
iap10@236 761 struct aac_dev
iap10@236 762 {
iap10@236 763 struct aac_dev *next;
iap10@236 764 const char *name;
iap10@236 765 int id;
iap10@236 766
iap10@236 767 u16 irq_mask;
iap10@236 768 /*
iap10@236 769 * Map for 128 fib objects (64k)
iap10@236 770 */
iap10@236 771 dma_addr_t hw_fib_pa;
iap10@236 772 struct hw_fib *hw_fib_va;
iap10@236 773 ulong fib_base_va;
iap10@236 774 /*
iap10@236 775 * Fib Headers
iap10@236 776 */
kaf24@677 777 struct fib *fibs;
kaf24@677 778
iap10@236 779 struct fib *free_fib;
iap10@236 780 struct fib *timeout_fib;
iap10@236 781 spinlock_t fib_lock;
iap10@236 782
iap10@236 783 struct aac_queue_block *queues;
iap10@236 784 /*
iap10@236 785 * The user API will use an IOCTL to register itself to receive
iap10@236 786 * FIBs from the adapter. The following list is used to keep
iap10@236 787 * track of all the threads that have requested these FIBs. The
iap10@236 788 * mutex is used to synchronize access to all data associated
iap10@236 789 * with the adapter fibs.
iap10@236 790 */
iap10@236 791 struct list_head fib_list;
iap10@236 792
iap10@236 793 struct adapter_ops a_ops;
iap10@236 794 unsigned long fsrev; /* Main driver's revision number */
iap10@236 795
iap10@236 796 struct aac_init *init; /* Holds initialization info to communicate with adapter */
iap10@236 797 dma_addr_t init_pa; /* Holds physical address of the init struct */
iap10@236 798
iap10@236 799 struct pci_dev *pdev; /* Our PCI interface */
iap10@236 800 void * printfbuf; /* pointer to buffer used for printf's from the adapter */
iap10@236 801 void * comm_addr; /* Base address of Comm area */
iap10@236 802 dma_addr_t comm_phys; /* Physical Address of Comm area */
iap10@236 803 size_t comm_size;
iap10@236 804
iap10@236 805 struct Scsi_Host *scsi_host_ptr;
iap10@236 806 struct fsa_scsi_hba fsa_dev;
kaf24@677 807 #if 0
kaf24@677 808 pid_t thread_pid;
kaf24@677 809 #endif
iap10@236 810 int cardtype;
iap10@236 811
iap10@236 812 /*
iap10@236 813 * The following is the device specific extension.
iap10@236 814 */
iap10@236 815 union
iap10@236 816 {
iap10@236 817 struct sa_registers *sa;
iap10@236 818 struct rx_registers *rx;
iap10@236 819 } regs;
iap10@236 820 /*
iap10@236 821 * The following is the number of the individual adapter
iap10@236 822 */
iap10@236 823 u32 devnum;
iap10@236 824 u32 aif_thread;
iap10@236 825 #if 0
iap10@236 826 struct completion aif_completion;
iap10@236 827 #endif
iap10@236 828 struct aac_adapter_info adapter_info;
iap10@236 829 /* These are in adapter info but they are in the io flow so
iap10@236 830 * lets break them out so we don't have to do an AND to check them
iap10@236 831 */
iap10@236 832 u8 nondasd_support;
iap10@236 833 u8 pae_support;
kaf24@677 834 u8 raid_scsi_mode;
iap10@236 835 };
iap10@236 836
kaf24@677 837 #define AllocateAndMapFibSpace(dev, MapFibContext) \
kaf24@677 838 dev->a_ops.AllocateAndMapFibSpace(dev, MapFibContext)
kaf24@677 839
kaf24@677 840 #define UnmapAndFreeFibSpace(dev, MapFibContext) \
kaf24@677 841 dev->a_ops.UnmapAndFreeFibSpace(dev, MapFibContext)
kaf24@677 842
iap10@236 843 #define aac_adapter_interrupt(dev) \
iap10@236 844 dev->a_ops.adapter_interrupt(dev)
iap10@236 845
iap10@236 846 #define aac_adapter_notify(dev, event) \
iap10@236 847 dev->a_ops.adapter_notify(dev, event)
iap10@236 848
iap10@236 849 #define aac_adapter_enable_int(dev, event) \
iap10@236 850 dev->a_ops.adapter_enable_int(dev, event)
iap10@236 851
iap10@236 852 #define aac_adapter_disable_int(dev, event) \
iap10@236 853 dev->a_ops.adapter_disable_int(dev, event)
iap10@236 854
iap10@236 855
iap10@236 856
iap10@236 857 #define FIB_CONTEXT_FLAG_TIMED_OUT (0x00000001)
iap10@236 858
iap10@236 859 /*
iap10@236 860 * Define the command values
iap10@236 861 */
iap10@236 862
iap10@236 863 #define Null 0
iap10@236 864 #define GetAttributes 1
iap10@236 865 #define SetAttributes 2
iap10@236 866 #define Lookup 3
iap10@236 867 #define ReadLink 4
iap10@236 868 #define Read 5
iap10@236 869 #define Write 6
iap10@236 870 #define Create 7
iap10@236 871 #define MakeDirectory 8
iap10@236 872 #define SymbolicLink 9
iap10@236 873 #define MakeNode 10
iap10@236 874 #define Removex 11
iap10@236 875 #define RemoveDirectoryx 12
iap10@236 876 #define Rename 13
iap10@236 877 #define Link 14
iap10@236 878 #define ReadDirectory 15
iap10@236 879 #define ReadDirectoryPlus 16
iap10@236 880 #define FileSystemStatus 17
iap10@236 881 #define FileSystemInfo 18
iap10@236 882 #define PathConfigure 19
iap10@236 883 #define Commit 20
iap10@236 884 #define Mount 21
iap10@236 885 #define UnMount 22
iap10@236 886 #define Newfs 23
iap10@236 887 #define FsCheck 24
iap10@236 888 #define FsSync 25
iap10@236 889 #define SimReadWrite 26
iap10@236 890 #define SetFileSystemStatus 27
iap10@236 891 #define BlockRead 28
iap10@236 892 #define BlockWrite 29
iap10@236 893 #define NvramIoctl 30
iap10@236 894 #define FsSyncWait 31
iap10@236 895 #define ClearArchiveBit 32
iap10@236 896 #define SetAcl 33
iap10@236 897 #define GetAcl 34
iap10@236 898 #define AssignAcl 35
iap10@236 899 #define FaultInsertion 36 /* Fault Insertion Command */
iap10@236 900 #define CrazyCache 37 /* Crazycache */
iap10@236 901
iap10@236 902 #define MAX_FSACOMMAND_NUM 38
iap10@236 903
iap10@236 904
iap10@236 905 /*
iap10@236 906 * Define the status returns. These are very unixlike although
iap10@236 907 * most are not in fact used
iap10@236 908 */
iap10@236 909
iap10@236 910 #define ST_OK 0
iap10@236 911 #define ST_PERM 1
iap10@236 912 #define ST_NOENT 2
iap10@236 913 #define ST_IO 5
iap10@236 914 #define ST_NXIO 6
iap10@236 915 #define ST_E2BIG 7
iap10@236 916 #define ST_ACCES 13
iap10@236 917 #define ST_EXIST 17
iap10@236 918 #define ST_XDEV 18
iap10@236 919 #define ST_NODEV 19
iap10@236 920 #define ST_NOTDIR 20
iap10@236 921 #define ST_ISDIR 21
iap10@236 922 #define ST_INVAL 22
iap10@236 923 #define ST_FBIG 27
iap10@236 924 #define ST_NOSPC 28
iap10@236 925 #define ST_ROFS 30
iap10@236 926 #define ST_MLINK 31
iap10@236 927 #define ST_WOULDBLOCK 35
iap10@236 928 #define ST_NAMETOOLONG 63
iap10@236 929 #define ST_NOTEMPTY 66
iap10@236 930 #define ST_DQUOT 69
iap10@236 931 #define ST_STALE 70
iap10@236 932 #define ST_REMOTE 71
iap10@236 933 #define ST_BADHANDLE 10001
iap10@236 934 #define ST_NOT_SYNC 10002
iap10@236 935 #define ST_BAD_COOKIE 10003
iap10@236 936 #define ST_NOTSUPP 10004
iap10@236 937 #define ST_TOOSMALL 10005
iap10@236 938 #define ST_SERVERFAULT 10006
iap10@236 939 #define ST_BADTYPE 10007
iap10@236 940 #define ST_JUKEBOX 10008
iap10@236 941 #define ST_NOTMOUNTED 10009
iap10@236 942 #define ST_MAINTMODE 10010
iap10@236 943 #define ST_STALEACL 10011
iap10@236 944
iap10@236 945 /*
iap10@236 946 * On writes how does the client want the data written.
iap10@236 947 */
iap10@236 948
iap10@236 949 #define CACHE_CSTABLE 1
iap10@236 950 #define CACHE_UNSTABLE 2
iap10@236 951
iap10@236 952 /*
iap10@236 953 * Lets the client know at which level the data was commited on
iap10@236 954 * a write request
iap10@236 955 */
iap10@236 956
iap10@236 957 #define CMFILE_SYNCH_NVRAM 1
iap10@236 958 #define CMDATA_SYNCH_NVRAM 2
iap10@236 959 #define CMFILE_SYNCH 3
iap10@236 960 #define CMDATA_SYNCH 4
iap10@236 961 #define CMUNSTABLE 5
iap10@236 962
iap10@236 963 struct aac_read
iap10@236 964 {
iap10@236 965 u32 command;
iap10@236 966 u32 cid;
iap10@236 967 u32 block;
iap10@236 968 u32 count;
iap10@236 969 struct sgmap sg; // Must be last in struct because it is variable
iap10@236 970 };
iap10@236 971
iap10@236 972 struct aac_read64
iap10@236 973 {
iap10@236 974 u32 command;
iap10@236 975 u16 cid;
iap10@236 976 u16 sector_count;
iap10@236 977 u32 block;
iap10@236 978 u16 pad;
iap10@236 979 u16 flags;
iap10@236 980 struct sgmap64 sg; // Must be last in struct because it is variable
iap10@236 981 };
iap10@236 982
iap10@236 983 struct aac_read_reply
iap10@236 984 {
iap10@236 985 u32 status;
iap10@236 986 u32 count;
iap10@236 987 };
iap10@236 988
iap10@236 989 struct aac_write
iap10@236 990 {
iap10@236 991 u32 command;
iap10@236 992 u32 cid;
iap10@236 993 u32 block;
iap10@236 994 u32 count;
iap10@236 995 u32 stable; // Not used
iap10@236 996 struct sgmap sg; // Must be last in struct because it is variable
iap10@236 997 };
iap10@236 998
iap10@236 999 struct aac_write64
iap10@236 1000 {
iap10@236 1001 u32 command;
iap10@236 1002 u16 cid;
iap10@236 1003 u16 sector_count;
iap10@236 1004 u32 block;
iap10@236 1005 u16 pad;
iap10@236 1006 u16 flags;
iap10@236 1007 struct sgmap64 sg; // Must be last in struct because it is variable
iap10@236 1008 };
iap10@236 1009 struct aac_write_reply
iap10@236 1010 {
iap10@236 1011 u32 status;
iap10@236 1012 u32 count;
iap10@236 1013 u32 committed;
iap10@236 1014 };
iap10@236 1015
iap10@236 1016 struct aac_srb
iap10@236 1017 {
iap10@236 1018 u32 function;
iap10@236 1019 u32 channel;
iap10@236 1020 u32 target;
iap10@236 1021 u32 lun;
iap10@236 1022 u32 timeout;
iap10@236 1023 u32 flags;
iap10@236 1024 u32 count; // Data xfer size
iap10@236 1025 u32 retry_limit;
iap10@236 1026 u32 cdb_size;
iap10@236 1027 u8 cdb[16];
iap10@236 1028 struct sgmap sg;
iap10@236 1029 };
iap10@236 1030
iap10@236 1031
iap10@236 1032
iap10@236 1033 #define AAC_SENSE_BUFFERSIZE 30
iap10@236 1034
iap10@236 1035 struct aac_srb_reply
iap10@236 1036 {
iap10@236 1037 u32 status;
iap10@236 1038 u32 srb_status;
iap10@236 1039 u32 scsi_status;
iap10@236 1040 u32 data_xfer_length;
iap10@236 1041 u32 sense_data_size;
iap10@236 1042 u8 sense_data[AAC_SENSE_BUFFERSIZE]; // Can this be SCSI_SENSE_BUFFERSIZE
iap10@236 1043 };
iap10@236 1044 /*
iap10@236 1045 * SRB Flags
iap10@236 1046 */
iap10@236 1047 #define SRB_NoDataXfer 0x0000
iap10@236 1048 #define SRB_DisableDisconnect 0x0004
iap10@236 1049 #define SRB_DisableSynchTransfer 0x0008
iap10@236 1050 #define SRB_BypassFrozenQueue 0x0010
iap10@236 1051 #define SRB_DisableAutosense 0x0020
iap10@236 1052 #define SRB_DataIn 0x0040
iap10@236 1053 #define SRB_DataOut 0x0080
iap10@236 1054
iap10@236 1055 /*
iap10@236 1056 * SRB Functions - set in aac_srb->function
iap10@236 1057 */
iap10@236 1058 #define SRBF_ExecuteScsi 0x0000
iap10@236 1059 #define SRBF_ClaimDevice 0x0001
iap10@236 1060 #define SRBF_IO_Control 0x0002
iap10@236 1061 #define SRBF_ReceiveEvent 0x0003
iap10@236 1062 #define SRBF_ReleaseQueue 0x0004
iap10@236 1063 #define SRBF_AttachDevice 0x0005
iap10@236 1064 #define SRBF_ReleaseDevice 0x0006
iap10@236 1065 #define SRBF_Shutdown 0x0007
iap10@236 1066 #define SRBF_Flush 0x0008
iap10@236 1067 #define SRBF_AbortCommand 0x0010
iap10@236 1068 #define SRBF_ReleaseRecovery 0x0011
iap10@236 1069 #define SRBF_ResetBus 0x0012
iap10@236 1070 #define SRBF_ResetDevice 0x0013
iap10@236 1071 #define SRBF_TerminateIO 0x0014
iap10@236 1072 #define SRBF_FlushQueue 0x0015
iap10@236 1073 #define SRBF_RemoveDevice 0x0016
iap10@236 1074 #define SRBF_DomainValidation 0x0017
iap10@236 1075
iap10@236 1076 /*
iap10@236 1077 * SRB SCSI Status - set in aac_srb->scsi_status
iap10@236 1078 */
iap10@236 1079 #define SRB_STATUS_PENDING 0x00
iap10@236 1080 #define SRB_STATUS_SUCCESS 0x01
iap10@236 1081 #define SRB_STATUS_ABORTED 0x02
iap10@236 1082 #define SRB_STATUS_ABORT_FAILED 0x03
iap10@236 1083 #define SRB_STATUS_ERROR 0x04
iap10@236 1084 #define SRB_STATUS_BUSY 0x05
iap10@236 1085 #define SRB_STATUS_INVALID_REQUEST 0x06
iap10@236 1086 #define SRB_STATUS_INVALID_PATH_ID 0x07
iap10@236 1087 #define SRB_STATUS_NO_DEVICE 0x08
iap10@236 1088 #define SRB_STATUS_TIMEOUT 0x09
iap10@236 1089 #define SRB_STATUS_SELECTION_TIMEOUT 0x0A
iap10@236 1090 #define SRB_STATUS_COMMAND_TIMEOUT 0x0B
iap10@236 1091 #define SRB_STATUS_MESSAGE_REJECTED 0x0D
iap10@236 1092 #define SRB_STATUS_BUS_RESET 0x0E
iap10@236 1093 #define SRB_STATUS_PARITY_ERROR 0x0F
iap10@236 1094 #define SRB_STATUS_REQUEST_SENSE_FAILED 0x10
iap10@236 1095 #define SRB_STATUS_NO_HBA 0x11
iap10@236 1096 #define SRB_STATUS_DATA_OVERRUN 0x12
iap10@236 1097 #define SRB_STATUS_UNEXPECTED_BUS_FREE 0x13
iap10@236 1098 #define SRB_STATUS_PHASE_SEQUENCE_FAILURE 0x14
iap10@236 1099 #define SRB_STATUS_BAD_SRB_BLOCK_LENGTH 0x15
iap10@236 1100 #define SRB_STATUS_REQUEST_FLUSHED 0x16
iap10@236 1101 #define SRB_STATUS_DELAYED_RETRY 0x17
iap10@236 1102 #define SRB_STATUS_INVALID_LUN 0x20
iap10@236 1103 #define SRB_STATUS_INVALID_TARGET_ID 0x21
iap10@236 1104 #define SRB_STATUS_BAD_FUNCTION 0x22
iap10@236 1105 #define SRB_STATUS_ERROR_RECOVERY 0x23
iap10@236 1106 #define SRB_STATUS_NOT_STARTED 0x24
iap10@236 1107 #define SRB_STATUS_NOT_IN_USE 0x30
iap10@236 1108 #define SRB_STATUS_FORCE_ABORT 0x31
iap10@236 1109 #define SRB_STATUS_DOMAIN_VALIDATION_FAIL 0x32
iap10@236 1110
iap10@236 1111 /*
iap10@236 1112 * Object-Server / Volume-Manager Dispatch Classes
iap10@236 1113 */
iap10@236 1114
iap10@236 1115 #define VM_Null 0
iap10@236 1116 #define VM_NameServe 1
iap10@236 1117 #define VM_ContainerConfig 2
iap10@236 1118 #define VM_Ioctl 3
iap10@236 1119 #define VM_FilesystemIoctl 4
iap10@236 1120 #define VM_CloseAll 5
iap10@236 1121 #define VM_CtBlockRead 6
iap10@236 1122 #define VM_CtBlockWrite 7
iap10@236 1123 #define VM_SliceBlockRead 8 /* raw access to configured "storage objects" */
iap10@236 1124 #define VM_SliceBlockWrite 9
iap10@236 1125 #define VM_DriveBlockRead 10 /* raw access to physical devices */
iap10@236 1126 #define VM_DriveBlockWrite 11
iap10@236 1127 #define VM_EnclosureMgt 12 /* enclosure management */
iap10@236 1128 #define VM_Unused 13 /* used to be diskset management */
iap10@236 1129 #define VM_CtBlockVerify 14
iap10@236 1130 #define VM_CtPerf 15 /* performance test */
iap10@236 1131 #define VM_CtBlockRead64 16
iap10@236 1132 #define VM_CtBlockWrite64 17
iap10@236 1133 #define VM_CtBlockVerify64 18
iap10@236 1134 #define VM_CtHostRead64 19
iap10@236 1135 #define VM_CtHostWrite64 20
iap10@236 1136
iap10@236 1137 #define MAX_VMCOMMAND_NUM 21 /* used for sizing stats array - leave last */
iap10@236 1138
iap10@236 1139 /*
iap10@236 1140 * Descriptive information (eg, vital stats)
iap10@236 1141 * that a content manager might report. The
iap10@236 1142 * FileArray filesystem component is one example
iap10@236 1143 * of a content manager. Raw mode might be
iap10@236 1144 * another.
iap10@236 1145 */
iap10@236 1146
iap10@236 1147 struct aac_fsinfo {
iap10@236 1148 u32 fsTotalSize; /* Consumed by fs, incl. metadata */
iap10@236 1149 u32 fsBlockSize;
iap10@236 1150 u32 fsFragSize;
iap10@236 1151 u32 fsMaxExtendSize;
iap10@236 1152 u32 fsSpaceUnits;
iap10@236 1153 u32 fsMaxNumFiles;
iap10@236 1154 u32 fsNumFreeFiles;
iap10@236 1155 u32 fsInodeDensity;
iap10@236 1156 }; /* valid iff ObjType == FT_FILESYS && !(ContentState & FSCS_NOTCLEAN) */
iap10@236 1157
iap10@236 1158 union aac_contentinfo {
iap10@236 1159 struct aac_fsinfo filesys; /* valid iff ObjType == FT_FILESYS && !(ContentState & FSCS_NOTCLEAN) */
iap10@236 1160 };
iap10@236 1161
iap10@236 1162 /*
iap10@236 1163 * Query for "mountable" objects, ie, objects that are typically
iap10@236 1164 * associated with a drive letter on the client (host) side.
iap10@236 1165 */
iap10@236 1166
iap10@236 1167 struct aac_mntent {
iap10@236 1168 u32 oid;
iap10@236 1169 u8 name[16]; // if applicable
iap10@236 1170 struct creation_info create_info; // if applicable
iap10@236 1171 u32 capacity;
iap10@236 1172 u32 vol; // substrate structure
iap10@236 1173 u32 obj; // FT_FILESYS, FT_DATABASE, etc.
iap10@236 1174 u32 state; // unready for mounting, readonly, etc.
iap10@236 1175 union aac_contentinfo fileinfo; // Info specific to content manager (eg, filesystem)
iap10@236 1176 u32 altoid; // != oid <==> snapshot or broken mirror exists
iap10@236 1177 };
iap10@236 1178
kaf24@677 1179 #define FSCS_NOTCLEAN 0x0001 /* fsck is neccessary before mounting */
kaf24@677 1180 #define FSCS_READONLY 0x0002 /* possible result of broken mirror */
kaf24@677 1181 #define FSCS_HIDDEN 0x0004 /* should be ignored - set during a clear */
iap10@236 1182
iap10@236 1183 struct aac_query_mount {
iap10@236 1184 u32 command;
iap10@236 1185 u32 type;
iap10@236 1186 u32 count;
iap10@236 1187 };
iap10@236 1188
iap10@236 1189 struct aac_mount {
iap10@236 1190 u32 status;
iap10@236 1191 u32 type; /* should be same as that requested */
iap10@236 1192 u32 count;
iap10@236 1193 struct aac_mntent mnt[1];
iap10@236 1194 };
iap10@236 1195
iap10@236 1196 /*
iap10@236 1197 * The following command is sent to shut down each container.
iap10@236 1198 */
iap10@236 1199
iap10@236 1200 struct aac_close {
iap10@236 1201 u32 command;
iap10@236 1202 u32 cid;
iap10@236 1203 };
iap10@236 1204
iap10@236 1205 struct aac_query_disk
iap10@236 1206 {
iap10@236 1207 s32 cnum;
iap10@236 1208 s32 bus;
iap10@236 1209 s32 target;
iap10@236 1210 s32 lun;
iap10@236 1211 u32 valid;
iap10@236 1212 u32 locked;
iap10@236 1213 u32 deleted;
iap10@236 1214 s32 instance;
iap10@236 1215 s8 name[10];
iap10@236 1216 u32 unmapped;
iap10@236 1217 };
iap10@236 1218
iap10@236 1219 struct aac_delete_disk {
iap10@236 1220 u32 disknum;
iap10@236 1221 u32 cnum;
iap10@236 1222 };
iap10@236 1223
iap10@236 1224 struct fib_ioctl
iap10@236 1225 {
iap10@236 1226 char *fibctx;
iap10@236 1227 int wait;
iap10@236 1228 char *fib;
iap10@236 1229 };
iap10@236 1230
iap10@236 1231 struct revision
iap10@236 1232 {
iap10@236 1233 u32 compat;
iap10@236 1234 u32 version;
iap10@236 1235 u32 build;
iap10@236 1236 };
iap10@236 1237
iap10@236 1238 /*
iap10@236 1239 * Ugly - non Linux like ioctl coding for back compat.
iap10@236 1240 */
iap10@236 1241
iap10@236 1242 #define CTL_CODE(function, method) ( \
iap10@236 1243 (4<< 16) | ((function) << 2) | (method) \
iap10@236 1244 )
iap10@236 1245
iap10@236 1246 /*
iap10@236 1247 * Define the method codes for how buffers are passed for I/O and FS
iap10@236 1248 * controls
iap10@236 1249 */
iap10@236 1250
iap10@236 1251 #define METHOD_BUFFERED 0
iap10@236 1252 #define METHOD_NEITHER 3
iap10@236 1253
iap10@236 1254 /*
iap10@236 1255 * Filesystem ioctls
iap10@236 1256 */
iap10@236 1257
iap10@236 1258 #define FSACTL_SENDFIB CTL_CODE(2050, METHOD_BUFFERED)
iap10@236 1259 #define FSACTL_SEND_RAW_SRB CTL_CODE(2067, METHOD_BUFFERED)
iap10@236 1260 #define FSACTL_DELETE_DISK 0x163
iap10@236 1261 #define FSACTL_QUERY_DISK 0x173
iap10@236 1262 #define FSACTL_OPEN_GET_ADAPTER_FIB CTL_CODE(2100, METHOD_BUFFERED)
iap10@236 1263 #define FSACTL_GET_NEXT_ADAPTER_FIB CTL_CODE(2101, METHOD_BUFFERED)
iap10@236 1264 #define FSACTL_CLOSE_GET_ADAPTER_FIB CTL_CODE(2102, METHOD_BUFFERED)
iap10@236 1265 #define FSACTL_MINIPORT_REV_CHECK CTL_CODE(2107, METHOD_BUFFERED)
iap10@236 1266 #define FSACTL_GET_PCI_INFO CTL_CODE(2119, METHOD_BUFFERED)
iap10@236 1267 #define FSACTL_FORCE_DELETE_DISK CTL_CODE(2120, METHOD_NEITHER)
iap10@236 1268
iap10@236 1269
iap10@236 1270 struct aac_common
iap10@236 1271 {
iap10@236 1272 /*
iap10@236 1273 * If this value is set to 1 then interrupt moderation will occur
iap10@236 1274 * in the base commuication support.
iap10@236 1275 */
iap10@236 1276 u32 irq_mod;
iap10@236 1277 u32 peak_fibs;
iap10@236 1278 u32 zero_fibs;
iap10@236 1279 u32 fib_timeouts;
iap10@236 1280 /*
iap10@236 1281 * Statistical counters in debug mode
iap10@236 1282 */
iap10@236 1283 #ifdef DBG
iap10@236 1284 u32 FibsSent;
iap10@236 1285 u32 FibRecved;
iap10@236 1286 u32 NoResponseSent;
iap10@236 1287 u32 NoResponseRecved;
iap10@236 1288 u32 AsyncSent;
iap10@236 1289 u32 AsyncRecved;
iap10@236 1290 u32 NormalSent;
iap10@236 1291 u32 NormalRecved;
iap10@236 1292 #endif
iap10@236 1293 };
iap10@236 1294
iap10@236 1295 extern struct aac_common aac_config;
iap10@236 1296
iap10@236 1297
iap10@236 1298 /*
iap10@236 1299 * The following macro is used when sending and receiving FIBs. It is
iap10@236 1300 * only used for debugging.
iap10@236 1301 */
iap10@236 1302
iap10@236 1303 #if DBG
iap10@236 1304 #define FIB_COUNTER_INCREMENT(counter) (counter)++
iap10@236 1305 #else
iap10@236 1306 #define FIB_COUNTER_INCREMENT(counter)
iap10@236 1307 #endif
iap10@236 1308
iap10@236 1309 /*
iap10@236 1310 * Adapter direct commands
iap10@236 1311 * Monitor/Kernel API
iap10@236 1312 */
iap10@236 1313
iap10@236 1314 #define BREAKPOINT_REQUEST cpu_to_le32(0x00000004)
iap10@236 1315 #define INIT_STRUCT_BASE_ADDRESS cpu_to_le32(0x00000005)
iap10@236 1316 #define READ_PERMANENT_PARAMETERS cpu_to_le32(0x0000000a)
iap10@236 1317 #define WRITE_PERMANENT_PARAMETERS cpu_to_le32(0x0000000b)
iap10@236 1318 #define HOST_CRASHING cpu_to_le32(0x0000000d)
iap10@236 1319 #define SEND_SYNCHRONOUS_FIB cpu_to_le32(0x0000000c)
iap10@236 1320 #define GET_ADAPTER_PROPERTIES cpu_to_le32(0x00000019)
iap10@236 1321 #define RE_INIT_ADAPTER cpu_to_le32(0x000000ee)
iap10@236 1322
iap10@236 1323 /*
iap10@236 1324 * Adapter Status Register
iap10@236 1325 *
iap10@236 1326 * Phase Staus mailbox is 32bits:
iap10@236 1327 * <31:16> = Phase Status
iap10@236 1328 * <15:0> = Phase
iap10@236 1329 *
iap10@236 1330 * The adapter reports is present state through the phase. Only
iap10@236 1331 * a single phase should be ever be set. Each phase can have multiple
iap10@236 1332 * phase status bits to provide more detailed information about the
iap10@236 1333 * state of the board. Care should be taken to ensure that any phase
iap10@236 1334 * status bits that are set when changing the phase are also valid
iap10@236 1335 * for the new phase or be cleared out. Adapter software (monitor,
iap10@236 1336 * iflash, kernel) is responsible for properly maintining the phase
iap10@236 1337 * status mailbox when it is running.
iap10@236 1338 *
iap10@236 1339 * MONKER_API Phases
iap10@236 1340 *
iap10@236 1341 * Phases are bit oriented. It is NOT valid to have multiple bits set
iap10@236 1342 */
iap10@236 1343
iap10@236 1344 #define SELF_TEST_FAILED cpu_to_le32(0x00000004)
iap10@236 1345 #define KERNEL_UP_AND_RUNNING cpu_to_le32(0x00000080)
iap10@236 1346 #define KERNEL_PANIC cpu_to_le32(0x00000100)
iap10@236 1347
iap10@236 1348 /*
iap10@236 1349 * Doorbell bit defines
iap10@236 1350 */
iap10@236 1351
iap10@236 1352 #define DoorBellPrintfDone cpu_to_le32(1<<5) // Host -> Adapter
iap10@236 1353 #define DoorBellAdapterNormCmdReady cpu_to_le32(1<<1) // Adapter -> Host
iap10@236 1354 #define DoorBellAdapterNormRespReady cpu_to_le32(1<<2) // Adapter -> Host
iap10@236 1355 #define DoorBellAdapterNormCmdNotFull cpu_to_le32(1<<3) // Adapter -> Host
iap10@236 1356 #define DoorBellAdapterNormRespNotFull cpu_to_le32(1<<4) // Adapter -> Host
iap10@236 1357 #define DoorBellPrintfReady cpu_to_le32(1<<5) // Adapter -> Host
iap10@236 1358
iap10@236 1359 /*
iap10@236 1360 * For FIB communication, we need all of the following things
iap10@236 1361 * to send back to the user.
iap10@236 1362 */
iap10@236 1363
iap10@236 1364 #define AifCmdEventNotify 1 /* Notify of event */
kaf24@677 1365 #define AifEnContainerChange 4 /* Container configuration change */
iap10@236 1366 #define AifCmdJobProgress 2 /* Progress report */
iap10@236 1367 #define AifCmdAPIReport 3 /* Report from other user of API */
iap10@236 1368 #define AifCmdDriverNotify 4 /* Notify host driver of event */
kaf24@677 1369 #define AifDenMorphComplete 200 /* A morph operation completed */
kaf24@677 1370 #define AifDenVolumeExtendComplete 201 /* A volume expand operation completed */
iap10@236 1371 #define AifReqJobList 100 /* Gets back complete job list */
iap10@236 1372 #define AifReqJobsForCtr 101 /* Gets back jobs for specific container */
iap10@236 1373 #define AifReqJobsForScsi 102 /* Gets back jobs for specific SCSI device */
iap10@236 1374 #define AifReqJobReport 103 /* Gets back a specific job report or list of them */
iap10@236 1375 #define AifReqTerminateJob 104 /* Terminates job */
iap10@236 1376 #define AifReqSuspendJob 105 /* Suspends a job */
iap10@236 1377 #define AifReqResumeJob 106 /* Resumes a job */
iap10@236 1378 #define AifReqSendAPIReport 107 /* API generic report requests */
iap10@236 1379 #define AifReqAPIJobStart 108 /* Start a job from the API */
iap10@236 1380 #define AifReqAPIJobUpdate 109 /* Update a job report from the API */
iap10@236 1381 #define AifReqAPIJobFinish 110 /* Finish a job from the API */
iap10@236 1382
iap10@236 1383 /*
iap10@236 1384 * Adapter Initiated FIB command structures. Start with the adapter
iap10@236 1385 * initiated FIBs that really come from the adapter, and get responded
iap10@236 1386 * to by the host.
iap10@236 1387 */
iap10@236 1388
iap10@236 1389 struct aac_aifcmd {
iap10@236 1390 u32 command; /* Tell host what type of notify this is */
iap10@236 1391 u32 seqnum; /* To allow ordering of reports (if necessary) */
iap10@236 1392 u8 data[1]; /* Undefined length (from kernel viewpoint) */
iap10@236 1393 };
iap10@236 1394
iap10@236 1395 const char *aac_driverinfo(struct Scsi_Host *);
iap10@236 1396 struct fib *fib_alloc(struct aac_dev *dev);
iap10@236 1397 int fib_setup(struct aac_dev *dev);
iap10@236 1398 void fib_map_free(struct aac_dev *dev);
iap10@236 1399 void fib_free(struct fib * context);
iap10@236 1400 void fib_init(struct fib * context);
iap10@236 1401 void fib_dealloc(struct fib * context);
iap10@236 1402 void aac_printf(struct aac_dev *dev, u32 val);
iap10@236 1403 int fib_send(u16 command, struct fib * context, unsigned long size, int priority, int wait, int reply, fib_callback callback, void *ctxt);
iap10@236 1404 int aac_consumer_get(struct aac_dev * dev, struct aac_queue * q, struct aac_entry **entry);
iap10@236 1405 int aac_consumer_avail(struct aac_dev * dev, struct aac_queue * q);
iap10@236 1406 void aac_consumer_free(struct aac_dev * dev, struct aac_queue * q, u32 qnum);
iap10@236 1407 int fib_complete(struct fib * context);
kaf24@677 1408 #define fib_data(fibctx) ((void *)(fibctx)->hw_fib->data)
iap10@236 1409 int aac_detach(struct aac_dev *dev);
iap10@236 1410 struct aac_dev *aac_init_adapter(struct aac_dev *dev);
iap10@236 1411 int aac_get_containers(struct aac_dev *dev);
iap10@236 1412 int aac_scsi_cmd(Scsi_Cmnd *scsi_cmnd_ptr);
iap10@236 1413 int aac_dev_ioctl(struct aac_dev *dev, int cmd, void *arg);
iap10@236 1414 int aac_do_ioctl(struct aac_dev * dev, int cmd, void *arg);
iap10@236 1415 int aac_rx_init(struct aac_dev *dev, unsigned long devNumber);
iap10@236 1416 int aac_sa_init(struct aac_dev *dev, unsigned long devNumber);
iap10@236 1417 unsigned int aac_response_normal(struct aac_queue * q);
iap10@236 1418 unsigned int aac_command_normal(struct aac_queue * q);
iap10@236 1419 #ifdef TRY_TASKLET
iap10@236 1420 extern struct tasklet_struct aac_command_tasklet;
kaf24@262 1421 void aac_command_thread(unsigned long data);
iap10@236 1422 #else
iap10@236 1423 int aac_command_thread(struct aac_dev * dev);
iap10@236 1424 #endif
iap10@236 1425 int aac_close_fib_context(struct aac_dev * dev, struct aac_fib_context *fibctx);
iap10@236 1426 int fib_adapter_complete(struct fib * fibptr, unsigned short size);
iap10@236 1427 struct aac_driver_ident* aac_get_driver_ident(int devtype);
iap10@236 1428 int aac_get_adapter_info(struct aac_dev* dev);