2 * Copyright (c) 2000 Michael Smith
3 * Copyright (c) 2000-2001 Scott Long
4 * Copyright (c) 2000 BSDi
5 * Copyright (c) 2001-2010 Adaptec, Inc.
6 * Copyright (c) 2010-2012 PMC-Sierra, Inc.
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * Data structures defining the interface between the driver and the Adaptec
35 * 'FSA' adapters. Note that many field names and comments here are taken
36 * verbatim from the Adaptec driver source in order to make comparing the
37 * two slightly easier.
41 * Misc. magic numbers.
43 #define AAC_MAX_CONTAINERS 64
44 #define AAC_BLOCK_SIZE 512
47 * Communications interface.
49 * Where datastructure layouts are closely parallel to the Adaptec sample code,
50 * retain their naming conventions (for now) to aid in cross-referencing.
53 /* transport FIB header (PMC) */
54 struct aac_fib_xporthdr {
55 u_int64_t HostAddress; /* FIB host address w/o xport header */
56 u_int32_t Size; /* FIB size excluding xport header */
57 u_int32_t Handle; /* driver handle to reference the FIB */
58 u_int64_t Reserved[2];
62 * List structure used to chain FIBs (used by the adapter - we hang FIBs off
63 * our private command structure and don't touch these)
65 struct aac_fib_list_entry {
71 * FIB (FSA Interface Block?); this is the datastructure passed between the host
74 struct aac_fib_header {
81 u_int32_t SenderFibAddress;
83 u_int32_t ReceiverFibAddress;
84 u_int32_t SenderFibAddressHigh;
92 #define AAC_FIB_DATASIZE (512 - sizeof(struct aac_fib_header))
95 struct aac_fib_header Header;
96 u_int8_t data[AAC_FIB_DATASIZE];
103 TestCommandResponse = 1,
104 TestAdapterCommand = 2,
106 /* lowlevel and comm commands */
107 LastTestCommand = 100,
108 ReinitHostNormCommandQueue = 101,
109 ReinitHostHighCommandQueue = 102,
110 ReinitHostHighRespQueue = 103,
111 ReinitHostNormRespQueue = 104,
112 ReinitAdapNormCommandQueue = 105,
113 ReinitAdapHighCommandQueue = 107,
114 ReinitAdapHighRespQueue = 108,
115 ReinitAdapNormRespQueue = 109,
116 InterfaceShutdown = 110,
122 RequestPerfData = 125,
123 SetInterruptDefTimer= 126,
124 SetInterruptDefCount= 127,
125 GetInterruptDefStatus= 128,
126 LastCommCommand = 129,
128 /* filesystem commands */
131 HostFileSystem = 302,
132 LastFileSystemCommand = 303,
134 /* Container Commands */
135 ContainerCommand = 500,
136 ContainerCommand64 = 501,
140 /* Cluster Commands */
141 ClusterCommand = 550,
143 /* Scsi Port commands (scsi passthrough) */
144 ScsiPortCommand = 600,
145 ScsiPortCommandU64 = 601,
146 SataPortCommandU64 = 602,
147 SasSmpPassThrough = 603,
148 SasRequestPhyInfo = 612,
150 /* misc house keeping and generic adapter initiated commands */
153 FsaHostShutdown = 702,
154 RequestAdapterInfo = 703,
155 IsAdapterPaused = 704,
157 RequestSupplementAdapterInfo = 706, /* Supp. Info for set in UCC
158 * use only if supported
159 * (RequestAdapterInfo first) */
160 LastMiscCommand = 707,
162 OnLineDiagnostic = 800,
163 FduAdapterTest = 801,
164 RequestCompatibilityId = 802,
165 AdapterEnvironmentInfo = 803, /* temp. sensors */
166 NvsramEventLog = 900,
167 ResetNvsramEventLogPointers = 901,
168 EnableEventLog = 902,
169 DisableEventLog = 903,
170 EncryptedKeyTransportFIB= 904,
171 KeyableFeaturesFIB= 905
177 #define AAC_FIBTYPE_TFIB 1
178 #define AAC_FIBTYPE_TQE 2
179 #define AAC_FIBTYPE_TCTPERF 3
180 #define AAC_FIBTYPE_TFIB2 4
181 #define AAC_FIBTYPE_TFIB2_64 5
186 #define AAC_FIBSTATE_HOSTOWNED (1<<0) /* owned by the host */
187 #define AAC_FIBSTATE_ADAPTEROWNED (1<<1) /* owned by the adapter */
188 #define AAC_FIBSTATE_INITIALISED (1<<2) /* initialised */
189 #define AAC_FIBSTATE_EMPTY (1<<3) /* empty */
190 #define AAC_FIBSTATE_FROMPOOL (1<<4) /* allocated from pool */
191 #define AAC_FIBSTATE_FROMHOST (1<<5) /* sent from the host */
192 #define AAC_FIBSTATE_FROMADAP (1<<6) /* sent from the adapter */
193 #define AAC_FIBSTATE_REXPECTED (1<<7) /* response is expected */
194 #define AAC_FIBSTATE_RNOTEXPECTED (1<<8) /* response is not expected */
195 #define AAC_FIBSTATE_DONEADAP (1<<9) /* processed by the adapter */
196 #define AAC_FIBSTATE_DONEHOST (1<<10) /* processed by the host */
197 #define AAC_FIBSTATE_HIGH (1<<11) /* high priority */
198 #define AAC_FIBSTATE_NORM (1<<12) /* normal priority */
199 #define AAC_FIBSTATE_ASYNC (1<<13)
200 #define AAC_FIBSTATE_ASYNCIO (1<<13) /* to be removed */
201 #define AAC_FIBSTATE_PAGEFILEIO (1<<14) /* to be removed */
202 #define AAC_FIBSTATE_SHUTDOWN (1<<15)
203 #define AAC_FIBSTATE_LAZYWRITE (1<<16) /* to be removed */
204 #define AAC_FIBSTATE_ADAPMICROFIB (1<<17)
205 #define AAC_FIBSTATE_BIOSFIB (1<<18)
206 #define AAC_FIBSTATE_FAST_RESPONSE (1<<19) /* fast response capable */
207 #define AAC_FIBSTATE_APIFIB (1<<20)
208 #define AAC_FIBSTATE_NOMOREAIF (1<<21)
213 #define AAC_ERROR_NORMAL 0x00
214 #define AAC_ERROR_PENDING 0x01
215 #define AAC_ERROR_FATAL 0x02
216 #define AAC_ERROR_INVALID_QUEUE 0x03
217 #define AAC_ERROR_NOENTRIES 0x04
218 #define AAC_ERROR_SENDFAILED 0x05
219 #define AAC_ERROR_INVALID_QUEUE_PRIORITY 0x06
220 #define AAC_ERROR_FIB_ALLOCATION_FAILED 0x07
221 #define AAC_ERROR_FIB_DEALLOCATION_FAILED 0x08
224 * Adapter Init Structure: this is passed to the adapter with the
225 * AAC_MONKER_INITSTRUCT command to point it at our control structures.
227 struct aac_adapter_init {
228 u_int32_t InitStructRevision;
229 #define AAC_INIT_STRUCT_REVISION 3
230 #define AAC_INIT_STRUCT_REVISION_4 4
231 #define AAC_INIT_STRUCT_REVISION_6 6
232 #define AAC_INIT_STRUCT_REVISION_7 7
233 u_int32_t MiniPortRevision;
234 #define AAC_INIT_STRUCT_MINIPORT_REVISION 1
235 u_int32_t FilesystemRevision;
236 u_int32_t CommHeaderAddress;
237 u_int32_t FastIoCommAreaAddress;
238 u_int32_t AdapterFibsPhysicalAddress;
239 u_int32_t AdapterFibsVirtualAddress;
240 u_int32_t AdapterFibsSize;
241 u_int32_t AdapterFibAlign;
242 u_int32_t PrintfBufferAddress;
243 u_int32_t PrintfBufferSize;
244 #define AAC_PAGE_SIZE 4096
245 u_int32_t HostPhysMemPages;
246 u_int32_t HostElapsedSeconds;
247 /* ADAPTER_INIT_STRUCT_REVISION_4 begins here */
248 u_int32_t InitFlags; /* flags for supported features */
249 #define AAC_INITFLAGS_NEW_COMM_SUPPORTED 1
250 #define AAC_INITFLAGS_DRIVER_USES_UTC_TIME 0x10
251 #define AAC_INITFLAGS_DRIVER_SUPPORTS_PM 0x20
252 #define AAC_INITFLAGS_NEW_COMM_TYPE1_SUPPORTED 0x40
253 #define AAC_INITFLAGS_FAST_JBOD_SUPPORTED 0x80
254 #define AAC_INITFLAGS_NEW_COMM_TYPE2_SUPPORTED 0x100
255 u_int32_t MaxIoCommands; /* max outstanding commands */
256 u_int32_t MaxIoSize; /* largest I/O command */
257 u_int32_t MaxFibSize; /* largest FIB to adapter */
258 /* ADAPTER_INIT_STRUCT_REVISION_5 begins here */
259 u_int32_t MaxNumAif; /* max number of aif */
260 /* ADAPTER_INIT_STRUCT_REVISION_6 begins here */
261 u_int32_t HostRRQ_AddrLow;
262 u_int32_t HostRRQ_AddrHigh; /* Host RRQ (response queue) for SRC */
282 CT_RAID10, /* stripe of mirror */
283 CT_RAID00, /* stripe of stripe */
284 CT_VOLUME_OF_MIRRORS, /* volume of mirror */
285 CT_PSEUDO_RAID3, /* really raid4 */
286 CT_RAID50, /* stripe of raid5 */
287 CT_RAID5D, /* raid5 distributed hot-sparing */
289 CT_RAID1E, /* extended raid1 mirroring */
295 * Host-addressable object types
298 FT_REG = 1, /* regular file */
299 FT_DIR, /* directory */
300 FT_BLK, /* "block" device - reserved */
301 FT_CHR, /* "character special" device - reserved */
302 FT_LNK, /* symbolic link */
303 FT_SOCK, /* socket */
305 FT_FILESYS, /* ADAPTEC's "FSA"(tm) filesystem */
306 FT_DRIVE, /* physical disk - addressable in scsi by b/t/l */
307 FT_SLICE, /* virtual disk - raw volume - slice */
308 FT_PARTITION, /* FSA partition - carved out of a slice - building
309 * block for containers */
310 FT_VOLUME, /* Container - Volume Set */
311 FT_STRIPE, /* Container - Stripe Set */
312 FT_MIRROR, /* Container - Mirror Set */
313 FT_RAID5, /* Container - Raid 5 Set */
314 FT_DATABASE /* Storage object with "foreign" content manager */
318 * Host-side scatter/gather list for 32-bit commands.
320 struct aac_sg_entry {
322 u_int32_t SgByteCount;
325 struct aac_sg_entry64 {
327 u_int32_t SgByteCount;
330 struct aac_sg_entryraw {
331 u_int32_t Next; /* reserved for FW use */
332 u_int32_t Prev; /* reserved for FW use */
334 u_int32_t SgByteCount;
335 u_int32_t Flags; /* reserved for FW use */
338 struct aac_sg_table {
340 struct aac_sg_entry SgEntry[0];
344 * Host-side scatter/gather list for 64-bit commands.
346 struct aac_sg_table64 {
348 struct aac_sg_entry64 SgEntry64[0];
352 * s/g list for raw commands
354 struct aac_sg_tableraw {
356 struct aac_sg_entryraw SgEntryRaw[0];
360 * new ieee1212 s/g element
362 struct aac_sge_ieee1212 {
366 u_int32_t flags; /* always 0 from host side */
370 * Container creation data
372 struct aac_container_creation {
373 u_int8_t ViaBuildNumber;
374 u_int8_t MicroSecond;
375 u_int8_t Via; /* 1 = FSU, 2 = API, etc. */
376 u_int8_t YearsSince1900;
377 u_int32_t Month:4; /* 1-12 */
378 u_int32_t Day:6; /* 1-32 */
379 u_int32_t Hour:6; /* 0-23 */
380 u_int32_t Minute:6; /* 0-59 */
381 u_int32_t Second:6; /* 0-59 */
382 u_int64_t ViaAdapterSerialNumber;
386 * Revision number handling
411 u_int32_t buildNumber;
415 * Adapter Information
487 OEM_FLAVOR_ADAPTEC = 1,
504 * XXX the aac-2622 with no battery present reports PLATFORM_BAT_OPT_PRESENT
508 PLATFORM_BAT_REQ_PRESENT = 1, /* BATTERY REQUIRED AND PRESENT */
509 PLATFORM_BAT_REQ_NOTPRESENT, /* BATTERY REQUIRED AND NOT PRESENT */
510 PLATFORM_BAT_OPT_PRESENT, /* BATTERY OPTIONAL AND PRESENT */
511 PLATFORM_BAT_OPT_NOTPRESENT, /* BATTERY OPTIONAL AND NOT PRESENT */
512 PLATFORM_BAT_NOT_SUPPORTED /* BATTERY NOT SUPPORTED */
513 } AAC_BatteryPlatform;
516 * options supported by this board
517 * there has to be a one to one mapping of these defines and the ones in
518 * fsaapi.h, search for FSA_SUPPORT_SNAPSHOT
520 #define AAC_SUPPORTED_SNAPSHOT 0x01
521 #define AAC_SUPPORTED_CLUSTERS 0x02
522 #define AAC_SUPPORTED_WRITE_CACHE 0x04
523 #define AAC_SUPPORTED_64BIT_DATA 0x08
524 #define AAC_SUPPORTED_HOST_TIME_FIB 0x10
525 #define AAC_SUPPORTED_RAID50 0x20
526 #define AAC_SUPPORTED_4GB_WINDOW 0x40
527 #define AAC_SUPPORTED_SCSI_UPGRADEABLE 0x80
528 #define AAC_SUPPORTED_SOFT_ERR_REPORT 0x100
529 #define AAC_SUPPORTED_NOT_RECONDITION 0x200
530 #define AAC_SUPPORTED_SGMAP_HOST64 0x400
531 #define AAC_SUPPORTED_ALARM 0x800
532 #define AAC_SUPPORTED_NONDASD 0x1000
533 #define AAC_SUPPORTED_SCSI_MANAGED 0x2000
534 #define AAC_SUPPORTED_RAID_SCSI_MODE 0x4000
535 #define AAC_SUPPORTED_SUPPLEMENT_ADAPTER_INFO 0x10000
536 #define AAC_SUPPORTED_NEW_COMM 0x20000
537 #define AAC_SUPPORTED_64BIT_ARRAYSIZE 0x40000
538 #define AAC_SUPPORTED_HEAT_SENSOR 0x80000
539 #define AAC_SUPPORTED_NEW_COMM_TYPE1 0x10000000 /* Tupelo new comm */
540 #define AAC_SUPPORTED_NEW_COMM_TYPE2 0x20000000 /* Denali new comm */
541 #define AAC_SUPPORTED_NEW_COMM_TYPE3 0x40000000 /* Series 8 new comm */
542 #define AAC_SUPPORTED_NEW_COMM_TYPE4 0x80000000 /* Series 9 new comm */
545 * Structure used to respond to a RequestAdapterInfo fib.
547 struct aac_adapter_info {
548 AAC_Platform PlatformBase; /* adapter type */
549 AAC_CpuType CpuArchitecture; /* adapter CPU type */
550 AAC_CpuSubType CpuVariant; /* adapter CPU subtype */
551 u_int32_t ClockSpeed; /* adapter CPU clockspeed */
552 u_int32_t ExecutionMem; /* adapter Execution Memory
554 u_int32_t BufferMem; /* adapter Data Memory */
555 u_int32_t TotalMem; /* adapter Total Memory */
556 struct FsaRevision KernelRevision; /* adapter Kernel Software
558 struct FsaRevision MonitorRevision; /* adapter Monitor/Diagnostic
559 * Software Revision */
560 struct FsaRevision HardwareRevision;/* TBD */
561 struct FsaRevision BIOSRevision; /* adapter BIOS Revision */
562 u_int32_t ClusteringEnabled;
563 u_int32_t ClusterChannelMask;
564 u_int64_t SerialNumber;
565 AAC_BatteryPlatform batteryPlatform;
566 u_int32_t SupportedOptions; /* supported features of this
568 AAC_OemFlavor OemVariant;
572 * More options from supplement info - SupportedOptions2
574 #define AAC_SUPPORTED_MU_RESET 0x01
575 #define AAC_SUPPORTED_IGNORE_RESET 0x02
576 #define AAC_SUPPORTED_POWER_MANAGEMENT 0x04
577 #define AAC_SUPPORTED_ARCIO_PHYDEV 0x08
578 #define AAC_SUPPORTED_DOORBELL_RESET 0x4000
579 #define AAC_SUPPORTED_VARIABLE_BLOCK_SIZE 0x40000 /* 4KB sector size */
582 * FeatureBits of RequestSupplementAdapterInfo used in the driver
584 #define AAC_SUPPL_SUPPORTED_JBOD 0x08000000
587 * Structure used to respond to a RequestSupplementAdapterInfo fib.
590 u_int8_t AssemblyPn[8];
592 u_int8_t BatteryFruPn[8];
593 u_int8_t EcVersionString[8];
597 #define MFG_PCBA_SERIAL_NUMBER_WIDTH 12
598 #define MFG_WWN_WIDTH 8
600 struct aac_supplement_adapter_info {
601 /* The assigned Adapter Type Text, extra byte for null termination */
602 int8_t AdapterTypeText[17+1];
603 /* Pad for the text above */
605 /* Size in bytes of the memory that is flashed */
606 u_int32_t FlashMemoryByteSize;
607 /* The assigned IMAGEID_xxx for this adapter */
608 u_int32_t FlashImageId;
610 * The maximum number of Phys available on a SATA/SAS
611 * Controller, 0 otherwise
613 u_int32_t MaxNumberPorts;
614 /* Version of expansion area */
616 u_int32_t FeatureBits;
618 u_int8_t ReservedPad0[3];
619 u_int8_t BuildDate[12];
620 /* The current number of Ports on a SAS controller, 0 otherwise */
621 u_int32_t CurrentNumberPorts;
623 struct vpd_info VpdInfo;
625 /* Firmware Revision (Vmaj.min-dash.) */
626 struct FsaRevision FlashFirmwareRevision;
627 u_int32_t RaidTypeMorphOptions;
628 /* Firmware's boot code Revision (Vmaj.min-dash.) */
629 struct FsaRevision FlashFirmwareBootRevision;
630 /* PCBA serial no. from th MFG sector */
631 u_int8_t MfgPcbaSerialNo[MFG_PCBA_SERIAL_NUMBER_WIDTH];
632 /* WWN from the MFG sector */
633 u_int8_t MfgWWNName[MFG_WWN_WIDTH];
634 u_int32_t SupportedOptions2; /* more supported features */
635 u_int32_t ExpansionFlag; /* 1 - following fields are valid */
636 u_int32_t FeatureBits3;
637 u_int32_t SupportedPerformanceMode;
638 /* Growth Area for future expansion */
639 u_int32_t ReservedGrowth[80];
643 * Monitor/Kernel interface.
647 * Synchronous commands to the monitor/kernel.
649 #define AAC_MONKER_BREAKPOINT 0x04
650 #define AAC_MONKER_INITSTRUCT 0x05
651 #define AAC_MONKER_SYNCFIB 0x0c
652 #define AAC_MONKER_GETKERNVER 0x11
653 #define AAC_MONKER_POSTRESULTS 0x14
654 #define AAC_MONKER_GETINFO 0x19
655 #define AAC_MONKER_GETDRVPROP 0x23
656 #define AAC_MONKER_RCVTEMP 0x25
657 #define AAC_MONKER_GETCOMMPREF 0x26
658 #define AAC_MONKER_REINIT 0xee
659 #define AAC_IOP_RESET 0x1000
660 #define AAC_IOP_RESET_ALWAYS 0x1001
663 * Adapter Status Register
665 * Phase Staus mailbox is 32bits:
666 * <31:16> = Phase Status
669 * The adapter reports its present state through the phase. Only
670 * a single phase should be ever be set. Each phase can have multiple
671 * phase status bits to provide more detailed information about the
672 * state of the adapter.
674 #define AAC_SELF_TEST_FAILED 0x00000004
675 #define AAC_MONITOR_PANIC 0x00000020
676 #define AAC_UP_AND_RUNNING 0x00000080
677 #define AAC_KERNEL_PANIC 0x00000100
680 * Data types relating to control and monitoring of the NVRAM/WriteCache
684 #define AAC_NFILESYS 24 /* maximum number of filesystems */
687 * NVRAM/Write Cache subsystem states
690 NVSTATUS_DISABLED = 0, /* present, clean, not being used */
691 NVSTATUS_ENABLED, /* present, possibly dirty, ready for use */
692 NVSTATUS_ERROR, /* present, dirty, contains dirty data */
693 NVSTATUS_BATTERY, /* present, bad or low battery, may contain
695 NVSTATUS_UNKNOWN /* for bad/missing device */
699 * NVRAM/Write Cache subsystem battery component states
703 NVBATTSTATUS_NONE = 0, /* battery has no power or is not present */
704 NVBATTSTATUS_LOW, /* battery is low on power */
705 NVBATTSTATUS_OK, /* battery is okay - normal operation possible
706 * only in this state */
707 NVBATTSTATUS_RECONDITIONING /* no battery present - reconditioning
712 * Battery transition type
715 NVBATT_TRANSITION_NONE = 0, /* battery now has no power or is not
717 NVBATT_TRANSITION_LOW, /* battery is now low on power */
718 NVBATT_TRANSITION_OK /* battery is now okay - normal
719 * operation possible only in this
721 } AAC_NVBATT_TRANSITION;
724 * NVRAM Info structure returned for NVRAM_GetInfo call
726 struct aac_nvramdevinfo {
727 u_int32_t NV_Enabled; /* write caching enabled */
728 u_int32_t NV_Error; /* device in error state */
729 u_int32_t NV_NDirty; /* count of dirty NVRAM buffers */
730 u_int32_t NV_NActive; /* count of NVRAM buffers being
734 struct aac_nvraminfo {
735 AAC_NVSTATUS NV_Status; /* nvram subsystem status */
736 AAC_NVBATTSTATUS NV_BattStatus; /* battery status */
737 u_int32_t NV_Size; /* size of WriteCache NVRAM in
739 u_int32_t NV_BufSize; /* size of NVRAM buffers in
741 u_int32_t NV_NBufs; /* number of NVRAM buffers */
742 u_int32_t NV_NDirty; /* Num dirty NVRAM buffers */
743 u_int32_t NV_NClean; /* Num clean NVRAM buffers */
744 u_int32_t NV_NActive; /* Num NVRAM buffers being
746 u_int32_t NV_NBrokered; /* Num brokered NVRAM buffers */
747 struct aac_nvramdevinfo NV_DevInfo[AAC_NFILESYS]; /* per device
749 u_int32_t NV_BattNeedsReconditioning; /* boolean */
750 u_int32_t NV_TotalSize; /* size of all non-volatile
751 * memories in bytes */
755 * Data types relating to adapter-initiated FIBs
757 * Based on types and structures in <aifstruc.h>
764 AifJobStsSuccess = 1,
768 AifJobStsLastReportMarker = 100, /* All prior mean last report */
774 AifJobScsiMin = 1, /* Minimum value for Scsi operation */
775 AifJobScsiZero, /* SCSI device clear operation */
776 AifJobScsiVerify, /* SCSI device Verify operation NO
778 AifJobScsiExercise, /* SCSI device Exercise operation */
779 AifJobScsiVerifyRepair, /* SCSI device Verify operation WITH
781 AifJobScsiWritePattern, /* write pattern */
782 AifJobScsiMax = 99, /* Max Scsi value */
783 AifJobCtrMin, /* Min Ctr op value */
784 AifJobCtrZero, /* Container clear operation */
785 AifJobCtrCopy, /* Container copy operation */
786 AifJobCtrCreateMirror, /* Container Create Mirror operation */
787 AifJobCtrMergeMirror, /* Container Merge Mirror operation */
788 AifJobCtrScrubMirror, /* Container Scrub Mirror operation */
789 AifJobCtrRebuildRaid5, /* Container Rebuild Raid5 operation */
790 AifJobCtrScrubRaid5, /* Container Scrub Raid5 operation */
791 AifJobCtrMorph, /* Container morph operation */
792 AifJobCtrPartCopy, /* Container Partition copy operation */
793 AifJobCtrRebuildMirror, /* Container Rebuild Mirror operation */
794 AifJobCtrCrazyCache, /* crazy cache */
795 AifJobCtrCopyback, /* Container Copyback operation */
796 AifJobCtrCompactRaid5D, /* Container Compaction operation */
797 AifJobCtrExpandRaid5D, /* Container Expansion operation */
798 AifJobCtrRebuildRaid6, /* Container Rebuild Raid6 operation */
799 AifJobCtrScrubRaid6, /* Container Scrub Raid6 operation */
800 AifJobCtrSSBackup, /* Container snapshot backup task */
801 AifJobCtrMax = 199, /* Max Ctr type operation */
802 AifJobFsMin, /* Min Fs type operation */
803 AifJobFsCreate, /* File System Create operation */
804 AifJobFsVerify, /* File System Verify operation */
805 AifJobFsExtend, /* File System Extend operation */
806 AifJobFsMax = 299, /* Max Fs type operation */
807 AifJobApiFormatNTFS, /* Format a drive to NTFS */
808 AifJobApiFormatFAT, /* Format a drive to FAT */
809 AifJobApiUpdateSnapshot, /* update the read/write half of a
811 AifJobApiFormatFAT32, /* Format a drive to FAT32 */
812 AifJobApiMax = 399, /* Max API type operation */
813 AifJobCtlContinuousCtrVerify, /* Adapter operation */
814 AifJobCtlMax = 499 /* Max Adapter type operation */
817 struct aac_AifContainers {
818 u_int32_t src; /* from/master */
819 u_int32_t dst; /* to/slave */
822 union aac_AifJobClient {
823 struct aac_AifContainers container; /* For Container and
824 * filesystem progress
826 int32_t scsi_dh; /* For SCSI progress
830 struct aac_AifJobDesc {
831 u_int32_t jobID; /* DO NOT FILL IN! Will be
832 * filled in by AIF */
833 AAC_AifJobType type; /* Operation that is being
835 union aac_AifJobClient client; /* Details */
838 struct aac_AifJobProgressReport {
839 struct aac_AifJobDesc jd;
840 AAC_AifJobStatus status;
842 u_int32_t currentTick;
843 u_int32_t jobSpecificData1;
844 u_int32_t jobSpecificData2;
851 /* General application notifies start here */
852 AifEnGeneric = 1, /* Generic notification */
853 AifEnTaskComplete, /* Task has completed */
854 AifEnConfigChange, /* Adapter config change occurred */
855 AifEnContainerChange, /* Adapter specific container
856 * configuration change */
857 AifEnDeviceFailure, /* SCSI device failed */
858 AifEnMirrorFailover, /* Mirror failover started */
859 AifEnContainerEvent, /* Significant container event */
860 AifEnFileSystemChange, /* File system changed */
861 AifEnConfigPause, /* Container pause event */
862 AifEnConfigResume, /* Container resume event */
863 AifEnFailoverChange, /* Failover space assignment changed */
864 AifEnRAID5RebuildDone, /* RAID5 rebuild finished */
865 AifEnEnclosureManagement, /* Enclosure management event */
866 AifEnBatteryEvent, /* Significant NV battery event */
867 AifEnAddContainer, /* A new container was created. */
868 AifEnDeleteContainer, /* A container was deleted. */
869 AifEnSMARTEvent, /* SMART Event */
870 AifEnBatteryNeedsRecond, /* The battery needs reconditioning */
871 AifEnClusterEvent, /* Some cluster event */
872 AifEnDiskSetEvent, /* A disk set event occured. */
873 AifEnContainerScsiEvent, /* a container event with no. and scsi id */
874 AifEnPicBatteryEvent, /* An event gen. by pic_battery.c for an ABM */
875 AifEnExpEvent, /* Exp. Event Type to replace CTPopUp messages */
876 AifEnRAID6RebuildDone, /* RAID6 rebuild finished */
877 AifEnSensorOverHeat, /* Heat Sensor indicate overheat */
878 AifEnSensorCoolDown, /* Heat Sensor ind. cooled down after overheat */
879 AifFeatureKeysModified, /* notif. of updated feature keys */
880 AifApplicationExpirationEvent, /* notif. on app. expiration status */
881 AifEnBackgroundConsistencyCheck,/* BCC notif. for NEC - DDTS 94700 */
882 AifEnAddJBOD, /* A new JBOD type drive was created (30) */
883 AifEnDeleteJBOD, /* A JBOD type drive was deleted (31) */
884 AifDriverNotifyStart=199, /* Notifies for host driver go here */
885 /* Host driver notifications start here */
886 AifDenMorphComplete, /* A morph operation completed */
887 AifDenVolumeExtendComplete, /* Volume expand operation completed */
888 AifDriverNotifyDelay,
889 AifRawDeviceRemove /* Raw device Failure event */
890 } AAC_AifEventNotifyType;
892 struct aac_AifEnsGeneric {
893 char text[132]; /* Generic text */
896 struct aac_AifEnsDeviceFailure {
897 u_int32_t deviceHandle; /* SCSI device handle */
900 struct aac_AifEnsMirrorFailover {
901 u_int32_t container; /* Container with failed element */
902 u_int32_t failedSlice; /* Old slice which failed */
903 u_int32_t creatingSlice; /* New slice used for auto-create */
906 struct aac_AifEnsContainerChange {
907 u_int32_t container[2]; /* container that changed, -1 if no
911 struct aac_AifEnsContainerEvent {
912 u_int32_t container; /* container number */
913 u_int32_t eventType; /* event type */
916 struct aac_AifEnsEnclosureEvent {
917 u_int32_t empID; /* enclosure management proc number */
918 u_int32_t unitID; /* unitId, fan id, power supply id,
919 * slot id, tempsensor id. */
920 u_int32_t eventType; /* event type */
924 AIF_EM_DRIVE_INSERTION=31,
926 } aac_AifEMEventType;
928 struct aac_AifEnsBatteryEvent {
929 AAC_NVBATT_TRANSITION transition_type; /* eg from low to ok */
930 AAC_NVBATTSTATUS current_state; /* current batt state */
931 AAC_NVBATTSTATUS prior_state; /* prev batt state */
934 struct aac_AifEnsDiskSetEvent {
941 CLUSTER_NULL_EVENT = 0,
942 CLUSTER_PARTNER_NAME_EVENT, /* change in partner hostname or
943 * adaptername from NULL to non-NULL */
944 /* (partner's agent may be up) */
945 CLUSTER_PARTNER_NULL_NAME_EVENT /* change in partner hostname or
946 * adaptername from non-null to NULL */
947 /* (partner has rebooted) */
948 } AAC_ClusterAifEvent;
950 struct aac_AifEnsClusterEvent {
951 AAC_ClusterAifEvent eventType;
954 struct aac_AifEventNotify {
955 AAC_AifEventNotifyType type;
957 struct aac_AifEnsGeneric EG;
958 struct aac_AifEnsDeviceFailure EDF;
959 struct aac_AifEnsMirrorFailover EMF;
960 struct aac_AifEnsContainerChange ECC;
961 struct aac_AifEnsContainerEvent ECE;
962 struct aac_AifEnsEnclosureEvent EEE;
963 struct aac_AifEnsBatteryEvent EBE;
964 struct aac_AifEnsDiskSetEvent EDS;
965 /* struct aac_AifEnsSMARTEvent ES;*/
966 struct aac_AifEnsClusterEvent ECLE;
971 * Adapter Initiated FIB command structures. Start with the adapter
972 * initiated FIBs that really come from the adapter, and get responded
975 #define AAC_AIF_REPORT_MAX_SIZE 64
978 AifCmdEventNotify = 1, /* Notify of event */
979 AifCmdJobProgress, /* Progress report */
980 AifCmdAPIReport, /* Report from other user of API */
981 AifCmdDriverNotify, /* Notify host driver of event */
982 AifReqJobList = 100, /* Gets back complete job list */
983 AifReqJobsForCtr, /* Gets back jobs for specific container */
984 AifReqJobsForScsi, /* Gets back jobs for specific SCSI device */
985 AifReqJobReport, /* Gets back a specific job report or list */
986 AifReqTerminateJob, /* Terminates job */
987 AifReqSuspendJob, /* Suspends a job */
988 AifReqResumeJob, /* Resumes a job */
989 AifReqSendAPIReport, /* API generic report requests */
990 AifReqAPIJobStart, /* Start a job from the API */
991 AifReqAPIJobUpdate, /* Update a job report from the API */
992 AifReqAPIJobFinish, /* Finish a job from the API */
993 AifReqEvent = 200 /* PMC NEW COMM: Request the event data */
996 struct aac_aif_command {
997 AAC_AifCommand command; /* Tell host what type of
999 u_int32_t seqNumber; /* To allow ordering of
1000 * reports (if necessary) */
1002 struct aac_AifEventNotify EN; /* Event notify */
1003 struct aac_AifJobProgressReport PR[1]; /* Progress report */
1004 u_int8_t AR[AAC_AIF_REPORT_MAX_SIZE];
1005 u_int8_t data[AAC_FIB_DATASIZE - 8];
1010 * Filesystem commands/data
1012 * The adapter has a very complex filesystem interface, most of which we ignore.
1013 * (And which seems not to be implemented, anyway.)
1048 SetFileSystemStatus,
1062 * Command status values
1083 ST_NAMETOOLONG = 63,
1089 ST_BADHANDLE = 10001,
1090 ST_NOT_SYNC = 10002,
1091 ST_BAD_COOKIE = 10003,
1093 ST_TOOSMALL = 10005,
1094 ST_SERVERFAULT = 10006,
1097 ST_NOTMOUNTED = 10009,
1098 ST_MAINTMODE = 10010,
1099 ST_STALEACL = 10011,
1100 ST_BUS_RESET = 20001
1104 * Volume manager commands
1106 typedef enum _VM_COMMANDS {
1108 VM_NameServe, /* query for mountable objects (containers) */
1115 VM_SliceBlockRead, /* raw access to configured "storage objects" */
1117 VM_DriveBlockRead, /* raw access to physical devices */
1119 VM_EnclosureMgt, /* enclosure management */
1120 VM_Unused, /* used to be diskset management */
1122 VM_CtPerf, /* performance test */
1128 VM_DrvErrTblLog, /* drive error table/log type of command */
1129 VM_NameServe64, /* query also for containers >2TB */
1130 VM_SasNvsramAccess, /* for sas nvsram layout function */
1131 VM_HandleExpiration, /* handles application expiration, internal use! */
1132 VM_GetDynAdapProps, /* retrieves dynamic adapter properties */
1133 VM_SetDynAdapProps, /* sets a dynamic adapter property */
1134 VM_UpdateSSDODM, /* updates the on-disk metadata for SSD caching */
1135 VM_GetSPMParameters, /* get SPM parameters for one of the perf. modes */
1136 VM_SetSPMParameters, /* set SPM parameters for user defined perf. mode */
1137 VM_NameServeAllBlk, /* query also for containers with 4KB sector size */
1138 MAX_VMCOMMAND_NUM /* used for sizing stats array - leave last */
1141 /* Container Configuration Sub-Commands */
1142 #define CT_GET_SCSI_METHOD 64
1143 #define CT_PAUSE_IO 65
1144 #define CT_RELEASE_IO 66
1145 #define CT_GET_CONFIG_STATUS 147
1146 #define CT_COMMIT_CONFIG 152
1147 #define CT_CID_TO_32BITS_UID 165
1148 #define CT_PM_DRIVER_SUPPORT 245
1150 /* CT_PM_DRIVER_SUPPORT parameter */
1152 AAC_PM_DRIVERSUP_GET_STATUS = 1,
1153 AAC_PM_DRIVERSUP_START_UNIT,
1154 AAC_PM_DRIVERSUP_STOP_UNIT
1155 } AAC_CT_PM_DRIVER_SUPPORT_SUB_COM;
1158 * CT_PAUSE_IO is immediate minimal runtime command that is used
1159 * to restart the applications and cache.
1161 struct aac_pause_command {
1172 /* Flag values for ContentState */
1173 #define AAC_FSCS_NOTCLEAN 0x1 /* fscheck is necessary before mounting */
1174 #define AAC_FSCS_READONLY 0x2 /* possible result of broken mirror */
1175 #define AAC_FSCS_HIDDEN 0x4 /* container should be ignored by driver */
1176 #define AAC_FSCS_NOT_READY 0x8 /* cnt is in spinn. state, not rdy for IO's */
1179 * "mountable object"
1183 char FileSystemName[16];
1184 struct aac_container_creation CreateInfo;
1188 u_int32_t ContentState;
1191 u_int32_t BlockSize;
1193 u_int32_t AlterEgoId;
1194 u_int32_t CapacityHigh;
1197 struct aac_mntinfo {
1203 struct aac_mntinforesp {
1206 u_int32_t MntRespCount;
1207 struct aac_mntobj MntTable[1];
1211 * Container shutdown command.
1213 struct aac_closecommand {
1215 u_int32_t ContainerId;
1219 * Container Config Command
1227 struct aac_ctcfg_resp {
1236 #define AAC_SCSI_MAX_PORTS 10
1237 #define AAC_BUS_NO_EXIST 0
1238 #define AAC_BUS_VALID 1
1239 #define AAC_BUS_FAULTED 2
1240 #define AAC_BUS_DISABLED 3
1241 #define GetBusInfo 0x9
1243 struct aac_getbusinf {
1244 u_int32_t ProbeComplete;
1246 u_int32_t TargetsPerBus;
1247 u_int8_t InitiatorBusId[AAC_SCSI_MAX_PORTS];
1248 u_int8_t BusValid[AAC_SCSI_MAX_PORTS];
1251 struct aac_vmioctl {
1257 u_int32_t IoctlBuf[1]; /* Placeholder? */
1260 struct aac_vmi_businf_resp {
1266 struct aac_getbusinf BusInf;
1269 struct aac_vmi_devinfo_resp {
1275 u_int8_t VendorId[8];
1276 u_int8_t ProductId[16];
1277 u_int8_t ProductRev[4];
1284 u_int32_t reserved[2];
1285 u_int8_t VendorSpecific[20];
1287 u_int32_t AAC_Managed:1;
1289 u_int32_t reserved2:6;
1293 u_int32_t ultraEnable:1,
1305 }; /* Do not pack */
1307 #define ResetBus 0x16
1308 struct aac_resetbus {
1309 u_int32_t BusNumber;
1313 * Write 'stability' options.
1321 * Commit level response for a write request.
1324 CMFILE_SYNC_NVRAM = 1,
1332 #define CT_FIB_PARAMS 6
1333 #define MAX_FIB_PARAMS 10
1334 #define CT_PACKET_SIZE \
1335 (AAC_FIB_DATASIZE - sizeof (u_int32_t) - \
1336 ((sizeof (u_int32_t)) * (MAX_FIB_PARAMS + 1)))
1338 struct aac_fsa_ctm {
1340 u_int32_t param[CT_FIB_PARAMS];
1341 int8_t data[CT_PACKET_SIZE];
1344 struct aac_cnt_config {
1346 struct aac_fsa_ctm CTCommand;
1350 * Block read/write operations.
1351 * These structures are packed into the 'data' area in the FIB.
1354 struct aac_blockread {
1355 u_int32_t Command; /* not FSACommand! */
1356 u_int32_t ContainerId;
1357 u_int32_t BlockNumber;
1358 u_int32_t ByteCount;
1359 struct aac_sg_table SgMap; /* variable size */
1362 struct aac_blockread64 {
1364 u_int16_t ContainerId;
1365 u_int16_t SectorCount;
1366 u_int32_t BlockNumber;
1369 struct aac_sg_table64 SgMap64;
1372 struct aac_blockread_response {
1374 u_int32_t ByteCount;
1377 struct aac_blockwrite {
1378 u_int32_t Command; /* not FSACommand! */
1379 u_int32_t ContainerId;
1380 u_int32_t BlockNumber;
1381 u_int32_t ByteCount;
1383 struct aac_sg_table SgMap; /* variable size */
1386 struct aac_blockwrite64 {
1387 u_int32_t Command; /* not FSACommand! */
1388 u_int16_t ContainerId;
1389 u_int16_t SectorCount;
1390 u_int32_t BlockNumber;
1393 struct aac_sg_table64 SgMap64; /* variable size */
1396 struct aac_blockwrite_response {
1398 u_int32_t ByteCount;
1399 u_int32_t Committed;
1403 u_int64_t BlockNumber;
1404 u_int32_t ByteCount;
1405 u_int16_t ContainerId;
1406 u_int16_t Flags; /* 0: W, 1: R */
1407 u_int16_t BpTotal; /* reserved for FW use */
1408 u_int16_t BpComplete; /* reserved for FW use */
1409 struct aac_sg_tableraw SgMapRaw; /* variable size */
1412 #define RIO2_IO_TYPE 0x0003
1413 #define RIO2_IO_TYPE_WRITE 0x0000
1414 #define RIO2_IO_TYPE_READ 0x0001
1415 #define RIO2_IO_TYPE_VERIFY 0x0002
1416 #define RIO2_IO_ERROR 0x0004
1417 #define RIO2_IO_SUREWRITE 0x0008
1418 #define RIO2_SGL_CONFORMANT 0x0010
1419 #define RIO2_SG_FORMAT 0xF000
1420 #define RIO2_SG_FORMAT_ARC 0x0000
1421 #define RIO2_SG_FORMAT_SRL 0x1000
1422 #define RIO2_SG_FORMAT_IEEE1212 0x2000
1423 struct aac_raw_io2 {
1424 u_int32_t strtBlkLow;
1425 u_int32_t strtBlkHigh;
1428 u_int16_t flags; /* RIO2_xxx */
1429 u_int32_t sgeFirstSize; /* size of first SG element */
1430 u_int32_t sgeNominalSize; /* size of 2nd SG element */
1432 u_int8_t bpTotal; /* reserved for FW use */
1433 u_int8_t bpComplete; /* reserved for FW use */
1434 u_int8_t sgeFirstIndex; /* reserved for FW use */
1436 struct aac_sge_ieee1212 sge[0]; /* variable size */
1440 * Container shutdown command.
1442 struct aac_close_command {
1444 u_int32_t ContainerId;
1448 * SCSI Passthrough structures
1458 u_int32_t retry_limit;
1461 struct aac_sg_table sg_map;
1465 AAC_SRB_FUNC_EXECUTE_SCSI = 0x00,
1466 AAC_SRB_FUNC_CLAIM_DEVICE,
1467 AAC_SRB_FUNC_IO_CONTROL,
1468 AAC_SRB_FUNC_RECEIVE_EVENT,
1469 AAC_SRB_FUNC_RELEASE_QUEUE,
1470 AAC_SRB_FUNC_ATTACH_DEVICE,
1471 AAC_SRB_FUNC_RELEASE_DEVICE,
1472 AAC_SRB_FUNC_SHUTDOWN,
1474 AAC_SRB_FUNC_ABORT_COMMAND = 0x10,
1475 AAC_SRB_FUNC_RELEASE_RECOVERY,
1476 AAC_SRB_FUNC_RESET_BUS,
1477 AAC_SRB_FUNC_RESET_DEVICE,
1478 AAC_SRB_FUNC_TERMINATE_IO,
1479 AAC_SRB_FUNC_FLUSH_QUEUE,
1480 AAC_SRB_FUNC_REMOVE_DEVICE,
1481 AAC_SRB_FUNC_DOMAIN_VALIDATION
1484 #define AAC_SRB_FLAGS_NO_DATA_XFER 0x0000
1485 #define AAC_SRB_FLAGS_DISABLE_DISCONNECT 0x0004
1486 #define AAC_SRB_FLAGS_DISABLE_SYNC_TRANSFER 0x0008
1487 #define AAC_SRB_FLAGS_BYPASS_FROZEN_QUEUE 0x0010
1488 #define AAC_SRB_FLAGS_DISABLE_AUTOSENSE 0x0020
1489 #define AAC_SRB_FLAGS_DATA_IN 0x0040
1490 #define AAC_SRB_FLAGS_DATA_OUT 0x0080
1491 #define AAC_SRB_FLAGS_UNSPECIFIED_DIRECTION \
1492 (AAC_SRB_FLAGS_DATA_IN | AAC_SRB_FLAGS_DATA_OUT)
1494 #define AAC_HOST_SENSE_DATA_MAX 30
1496 struct aac_srb_response {
1497 u_int32_t fib_status;
1498 u_int32_t srb_status;
1499 u_int32_t scsi_status;
1501 u_int32_t sense_len;
1502 u_int8_t sense[AAC_HOST_SENSE_DATA_MAX];
1506 * Status codes for SCSI passthrough commands. Since they are based on ASPI,
1507 * they also exactly match CAM status codes in both enumeration and meaning.
1508 * They seem to also be used as status codes for synchronous FIBs.
1511 AAC_SRB_STS_PENDING = 0x00,
1512 AAC_SRB_STS_SUCCESS,
1513 AAC_SRB_STS_ABORTED,
1514 AAC_SRB_STS_ABORT_FAILED,
1517 AAC_SRB_STS_INVALID_REQUEST,
1518 AAC_SRB_STS_INVALID_PATH_ID,
1519 AAC_SRB_STS_NO_DEVICE,
1520 AAC_SRB_STS_TIMEOUT,
1521 AAC_SRB_STS_SELECTION_TIMEOUT,
1522 AAC_SRB_STS_COMMAND_TIMEOUT,
1523 AAC_SRB_STS_MESSAGE_REJECTED = 0x0D,
1524 AAC_SRB_STS_BUS_RESET,
1525 AAC_SRB_STS_PARITY_ERROR,
1526 AAC_SRB_STS_REQUEST_SENSE_FAILED,
1528 AAC_SRB_STS_DATA_OVERRUN,
1529 AAC_SRB_STS_UNEXPECTED_BUS_FREE,
1530 AAC_SRB_STS_PHASE_SEQUENCE_FAILURE,
1531 AAC_SRB_STS_BAD_SRB_BLOCK_LENGTH,
1532 AAC_SRB_STS_REQUEST_FLUSHED,
1533 AAC_SRB_STS_INVALID_LUN = 0x20,
1534 AAC_SRB_STS_INVALID_TARGET_ID,
1535 AAC_SRB_STS_BAD_FUNCTION,
1536 AAC_SRB_STS_ERROR_RECOVERY
1540 * Register definitions for the Adaptec PMC SRC/SRCv adapters.
1542 /* accessible via BAR0 */
1543 #define AAC_SRC_OMR 0xbc /* outbound message register */
1544 #define AAC_SRC_IDBR 0x20 /* inbound doorbell register */
1545 #define AAC_SRC_IISR 0x24 /* inbound interrupt status register */
1546 #define AAC_SRC_ODBR_R 0x9c /* outbound doorbell register read */
1547 #define AAC_SRC_ODBR_C 0xa0 /* outbound doorbell register clear */
1548 #define AAC_SRC_OIMR 0x34 /* outbound interrupt mask register */
1549 #define AAC_SRC_IQUE32 0x40 /* inbound queue address 32-bit */
1550 #define AAC_SRC_IQUE64_L 0xc0 /* inbound queue address 64-bit (low) */
1551 #define AAC_SRC_IQUE64_H 0xc4 /* inbound queue address 64-bit (high) */
1553 #define AAC_SRC_MAILBOX 0x7fc60 /* mailbox (20 bytes) */
1554 #define AAC_SRCV_MAILBOX 0x1000 /* mailbox (20 bytes) */
1556 #define AAC_SRC_ODR_SHIFT 12 /* outbound doorbell shift */
1557 #define AAC_SRC_IDR_SHIFT 9 /* inbound doorbell shift */
1559 /* Sunrise Lake dual core reset */
1560 #define AAC_IRCSR 0x38 /* inbound dual cores reset */
1561 #define AAC_IRCSR_CORES_RST 3
1565 * Common bit definitions for the doorbell registers.
1569 * Status bits in the doorbell registers.
1571 #define AAC_DB_SYNC_COMMAND (1<<0) /* send/completed synchronous FIB */
1572 #define AAC_DB_COMMAND_READY (1<<1) /* posted one or more commands */
1573 #define AAC_DB_RESPONSE_READY (1<<2) /* one or more commands complete */
1574 #define AAC_DB_COMMAND_NOT_FULL (1<<3) /* command queue not full */
1575 #define AAC_DB_RESPONSE_NOT_FULL (1<<4) /* response queue not full */
1576 #define AAC_DB_AIF_PENDING (1<<6) /* pending AIF (new comm. type1) */
1577 /* PMC specific outbound doorbell bits */
1578 #define AAC_DB_RESPONSE_SENT_NS (1<<1) /* response sent (not shifted) */
1581 * The adapter can request the host print a message by setting the
1582 * DB_PRINTF flag in DOORBELL0. The driver responds by collecting the
1583 * message from the printf buffer, clearing the DB_PRINTF flag in
1584 * DOORBELL0 and setting it in DOORBELL1.
1585 * (ODBR and IDBR respectively for the i960Rx adapters)
1587 #define AAC_DB_PRINTF (1<<5) /* adapter requests host printf */
1588 #define AAC_PRINTF_DONE (1<<5) /* Host completed printf processing */
1591 * Mask containing the interrupt bits we care about. We don't anticipate (or
1592 * want) interrupts not in this mask.
1594 #define AAC_DB_INTERRUPTS (AAC_DB_COMMAND_READY | \
1595 AAC_DB_RESPONSE_READY | \
1597 #define AAC_DB_INT_NEW_COMM 0x08
1598 #define AAC_DB_INT_NEW_COMM_TYPE1 0x04