ia64/xen-unstable

annotate xen/drivers/scsi/aacraid/aacraid.h @ 945:db2e1ea917df

bitkeeper revision 1.596.1.3 (3fb3b41eWUoRU0H8A0jEX5roXjxKkA)

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