2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
4 * Copyright (c) 2000 Michael Smith
5 * Copyright (c) 2000-2001 Scott Long
6 * Copyright (c) 2000 BSDi
7 * Copyright (c) 2001-2010 Adaptec, Inc.
8 * Copyright (c) 2010-2012 PMC-Sierra, Inc.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
20 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * Data structures defining the interface between the driver and the Adaptec
37 * 'FSA' adapters. Note that many field names and comments here are taken
38 * verbatim from the Adaptec driver source in order to make comparing the
39 * two slightly easier.
43 * Misc. magic numbers.
45 #define AAC_MAX_CONTAINERS 240
46 #define AAC_BLOCK_SIZE 512
49 * Communications interface.
51 * Where datastructure layouts are closely parallel to the Adaptec sample code,
52 * retain their naming conventions (for now) to aid in cross-referencing.
55 /* transport FIB header (PMC) */
56 struct aac_fib_xporthdr {
57 u_int64_t HostAddress; /* FIB host address w/o xport header */
58 u_int32_t Size; /* FIB size excluding xport header */
59 u_int32_t Handle; /* driver handle to reference the FIB */
60 u_int64_t Reserved[2];
64 * List structure used to chain FIBs (used by the adapter - we hang FIBs off
65 * our private command structure and don't touch these)
67 struct aac_fib_list_entry {
73 * FIB (FSA Interface Block?); this is the datastructure passed between the host
76 struct aac_fib_header {
83 u_int32_t SenderFibAddress;
85 u_int32_t ReceiverFibAddress;
86 u_int32_t SenderFibAddressHigh;
94 #define AAC_FIB_DATASIZE (512 - sizeof(struct aac_fib_header))
97 struct aac_fib_header Header;
98 u_int8_t data[AAC_FIB_DATASIZE];
105 TestCommandResponse = 1,
106 TestAdapterCommand = 2,
108 /* lowlevel and comm commands */
109 LastTestCommand = 100,
110 ReinitHostNormCommandQueue = 101,
111 ReinitHostHighCommandQueue = 102,
112 ReinitHostHighRespQueue = 103,
113 ReinitHostNormRespQueue = 104,
114 ReinitAdapNormCommandQueue = 105,
115 ReinitAdapHighCommandQueue = 107,
116 ReinitAdapHighRespQueue = 108,
117 ReinitAdapNormRespQueue = 109,
118 InterfaceShutdown = 110,
124 RequestPerfData = 125,
125 SetInterruptDefTimer= 126,
126 SetInterruptDefCount= 127,
127 GetInterruptDefStatus= 128,
128 LastCommCommand = 129,
130 /* filesystem commands */
133 HostFileSystem = 302,
134 LastFileSystemCommand = 303,
136 /* Container Commands */
137 ContainerCommand = 500,
138 ContainerCommand64 = 501,
142 /* Cluster Commands */
143 ClusterCommand = 550,
145 /* Scsi Port commands (scsi passthrough) */
146 ScsiPortCommand = 600,
147 ScsiPortCommandU64 = 601,
148 SataPortCommandU64 = 602,
149 SasSmpPassThrough = 603,
150 SasRequestPhyInfo = 612,
152 /* misc house keeping and generic adapter initiated commands */
155 FsaHostShutdown = 702,
156 RequestAdapterInfo = 703,
157 IsAdapterPaused = 704,
159 RequestSupplementAdapterInfo = 706, /* Supp. Info for set in UCC
160 * use only if supported
161 * (RequestAdapterInfo first) */
162 LastMiscCommand = 707,
164 OnLineDiagnostic = 800,
165 FduAdapterTest = 801,
166 RequestCompatibilityId = 802,
167 AdapterEnvironmentInfo = 803, /* temp. sensors */
168 NvsramEventLog = 900,
169 ResetNvsramEventLogPointers = 901,
170 EnableEventLog = 902,
171 DisableEventLog = 903,
172 EncryptedKeyTransportFIB= 904,
173 KeyableFeaturesFIB= 905
179 #define AAC_FIBTYPE_TFIB 1
180 #define AAC_FIBTYPE_TQE 2
181 #define AAC_FIBTYPE_TCTPERF 3
182 #define AAC_FIBTYPE_TFIB2 4
183 #define AAC_FIBTYPE_TFIB2_64 5
188 #define AAC_FIBSTATE_HOSTOWNED (1<<0) /* owned by the host */
189 #define AAC_FIBSTATE_ADAPTEROWNED (1<<1) /* owned by the adapter */
190 #define AAC_FIBSTATE_INITIALISED (1<<2) /* initialised */
191 #define AAC_FIBSTATE_EMPTY (1<<3) /* empty */
192 #define AAC_FIBSTATE_FROMPOOL (1<<4) /* allocated from pool */
193 #define AAC_FIBSTATE_FROMHOST (1<<5) /* sent from the host */
194 #define AAC_FIBSTATE_FROMADAP (1<<6) /* sent from the adapter */
195 #define AAC_FIBSTATE_REXPECTED (1<<7) /* response is expected */
196 #define AAC_FIBSTATE_RNOTEXPECTED (1<<8) /* response is not expected */
197 #define AAC_FIBSTATE_DONEADAP (1<<9) /* processed by the adapter */
198 #define AAC_FIBSTATE_DONEHOST (1<<10) /* processed by the host */
199 #define AAC_FIBSTATE_HIGH (1<<11) /* high priority */
200 #define AAC_FIBSTATE_NORM (1<<12) /* normal priority */
201 #define AAC_FIBSTATE_ASYNC (1<<13)
202 #define AAC_FIBSTATE_ASYNCIO (1<<13) /* to be removed */
203 #define AAC_FIBSTATE_PAGEFILEIO (1<<14) /* to be removed */
204 #define AAC_FIBSTATE_SHUTDOWN (1<<15)
205 #define AAC_FIBSTATE_LAZYWRITE (1<<16) /* to be removed */
206 #define AAC_FIBSTATE_ADAPMICROFIB (1<<17)
207 #define AAC_FIBSTATE_BIOSFIB (1<<18)
208 #define AAC_FIBSTATE_FAST_RESPONSE (1<<19) /* fast response capable */
209 #define AAC_FIBSTATE_APIFIB (1<<20)
210 #define AAC_FIBSTATE_NOMOREAIF (1<<21)
215 #define AAC_ERROR_NORMAL 0x00
216 #define AAC_ERROR_PENDING 0x01
217 #define AAC_ERROR_FATAL 0x02
218 #define AAC_ERROR_INVALID_QUEUE 0x03
219 #define AAC_ERROR_NOENTRIES 0x04
220 #define AAC_ERROR_SENDFAILED 0x05
221 #define AAC_ERROR_INVALID_QUEUE_PRIORITY 0x06
222 #define AAC_ERROR_FIB_ALLOCATION_FAILED 0x07
223 #define AAC_ERROR_FIB_DEALLOCATION_FAILED 0x08
226 * Adapter Init Structure: this is passed to the adapter with the
227 * AAC_MONKER_INITSTRUCT command to point it at our control structures.
229 struct aac_adapter_init {
230 u_int32_t InitStructRevision;
231 #define AAC_INIT_STRUCT_REVISION 3
232 #define AAC_INIT_STRUCT_REVISION_4 4
233 #define AAC_INIT_STRUCT_REVISION_6 6
234 #define AAC_INIT_STRUCT_REVISION_7 7
235 u_int32_t NoOfMSIXVectors;
236 u_int32_t FilesystemRevision;
237 u_int32_t CommHeaderAddress;
238 u_int32_t FastIoCommAreaAddress;
239 u_int32_t AdapterFibsPhysicalAddress;
240 u_int32_t AdapterFibsVirtualAddress;
241 u_int32_t AdapterFibsSize;
242 u_int32_t AdapterFibAlign;
243 u_int32_t PrintfBufferAddress;
244 u_int32_t PrintfBufferSize;
245 #define AAC_PAGE_SIZE 4096
246 u_int32_t HostPhysMemPages;
247 u_int32_t HostElapsedSeconds;
248 /* ADAPTER_INIT_STRUCT_REVISION_4 begins here */
249 u_int32_t InitFlags; /* flags for supported features */
250 #define AAC_INITFLAGS_NEW_COMM_SUPPORTED 1
251 #define AAC_INITFLAGS_DRIVER_USES_UTC_TIME 0x10
252 #define AAC_INITFLAGS_DRIVER_SUPPORTS_PM 0x20
253 #define AAC_INITFLAGS_NEW_COMM_TYPE1_SUPPORTED 0x40
254 #define AAC_INITFLAGS_FAST_JBOD_SUPPORTED 0x80
255 #define AAC_INITFLAGS_NEW_COMM_TYPE2_SUPPORTED 0x100
256 u_int32_t MaxIoCommands; /* max outstanding commands */
257 u_int32_t MaxIoSize; /* largest I/O command */
258 u_int32_t MaxFibSize; /* largest FIB to adapter */
259 /* ADAPTER_INIT_STRUCT_REVISION_5 begins here */
260 u_int32_t MaxNumAif; /* max number of aif */
261 /* ADAPTER_INIT_STRUCT_REVISION_6 begins here */
262 u_int32_t HostRRQ_AddrLow;
263 u_int32_t HostRRQ_AddrHigh; /* Host RRQ (response queue) for SRC */
283 CT_RAID10, /* stripe of mirror */
284 CT_RAID00, /* stripe of stripe */
285 CT_VOLUME_OF_MIRRORS, /* volume of mirror */
286 CT_PSEUDO_RAID3, /* really raid4 */
287 CT_RAID50, /* stripe of raid5 */
288 CT_RAID5D, /* raid5 distributed hot-sparing */
290 CT_RAID1E, /* extended raid1 mirroring */
296 * Host-addressable object types
299 FT_REG = 1, /* regular file */
300 FT_DIR, /* directory */
301 FT_BLK, /* "block" device - reserved */
302 FT_CHR, /* "character special" device - reserved */
303 FT_LNK, /* symbolic link */
304 FT_SOCK, /* socket */
306 FT_FILESYS, /* ADAPTEC's "FSA"(tm) filesystem */
307 FT_DRIVE, /* physical disk - addressable in scsi by b/t/l */
308 FT_SLICE, /* virtual disk - raw volume - slice */
309 FT_PARTITION, /* FSA partition - carved out of a slice - building
310 * block for containers */
311 FT_VOLUME, /* Container - Volume Set */
312 FT_STRIPE, /* Container - Stripe Set */
313 FT_MIRROR, /* Container - Mirror Set */
314 FT_RAID5, /* Container - Raid 5 Set */
315 FT_DATABASE /* Storage object with "foreign" content manager */
319 * Host-side scatter/gather list for 32-bit commands.
321 struct aac_sg_entry {
323 u_int32_t SgByteCount;
326 struct aac_sg_entry64 {
328 u_int32_t SgByteCount;
331 struct aac_sg_entryraw {
332 u_int32_t Next; /* reserved for FW use */
333 u_int32_t Prev; /* reserved for FW use */
335 u_int32_t SgByteCount;
336 u_int32_t Flags; /* reserved for FW use */
339 struct aac_sg_table {
341 struct aac_sg_entry SgEntry[0];
345 * Host-side scatter/gather list for 64-bit commands.
347 struct aac_sg_table64 {
349 struct aac_sg_entry64 SgEntry64[0];
353 * s/g list for raw commands
355 struct aac_sg_tableraw {
357 struct aac_sg_entryraw SgEntryRaw[0];
361 * new ieee1212 s/g element
363 struct aac_sge_ieee1212 {
367 u_int32_t flags; /* always 0 from host side */
371 * Container creation data
373 struct aac_container_creation {
374 u_int8_t ViaBuildNumber;
375 u_int8_t MicroSecond;
376 u_int8_t Via; /* 1 = FSU, 2 = API, etc. */
377 u_int8_t YearsSince1900;
378 u_int32_t Month:4; /* 1-12 */
379 u_int32_t Day:6; /* 1-32 */
380 u_int32_t Hour:6; /* 0-23 */
381 u_int32_t Minute:6; /* 0-59 */
382 u_int32_t Second:6; /* 0-59 */
383 u_int64_t ViaAdapterSerialNumber;
387 * Revision number handling
412 u_int32_t buildNumber;
416 * Adapter Information
488 OEM_FLAVOR_ADAPTEC = 1,
505 * XXX the aac-2622 with no battery present reports PLATFORM_BAT_OPT_PRESENT
509 PLATFORM_BAT_REQ_PRESENT = 1, /* BATTERY REQUIRED AND PRESENT */
510 PLATFORM_BAT_REQ_NOTPRESENT, /* BATTERY REQUIRED AND NOT PRESENT */
511 PLATFORM_BAT_OPT_PRESENT, /* BATTERY OPTIONAL AND PRESENT */
512 PLATFORM_BAT_OPT_NOTPRESENT, /* BATTERY OPTIONAL AND NOT PRESENT */
513 PLATFORM_BAT_NOT_SUPPORTED /* BATTERY NOT SUPPORTED */
514 } AAC_BatteryPlatform;
517 * options supported by this board
518 * there has to be a one to one mapping of these defines and the ones in
519 * fsaapi.h, search for FSA_SUPPORT_SNAPSHOT
521 #define AAC_SUPPORTED_SNAPSHOT 0x01
522 #define AAC_SUPPORTED_CLUSTERS 0x02
523 #define AAC_SUPPORTED_WRITE_CACHE 0x04
524 #define AAC_SUPPORTED_64BIT_DATA 0x08
525 #define AAC_SUPPORTED_HOST_TIME_FIB 0x10
526 #define AAC_SUPPORTED_RAID50 0x20
527 #define AAC_SUPPORTED_4GB_WINDOW 0x40
528 #define AAC_SUPPORTED_SCSI_UPGRADEABLE 0x80
529 #define AAC_SUPPORTED_SOFT_ERR_REPORT 0x100
530 #define AAC_SUPPORTED_NOT_RECONDITION 0x200
531 #define AAC_SUPPORTED_SGMAP_HOST64 0x400
532 #define AAC_SUPPORTED_ALARM 0x800
533 #define AAC_SUPPORTED_NONDASD 0x1000
534 #define AAC_SUPPORTED_SCSI_MANAGED 0x2000
535 #define AAC_SUPPORTED_RAID_SCSI_MODE 0x4000
536 #define AAC_SUPPORTED_SUPPLEMENT_ADAPTER_INFO 0x10000
537 #define AAC_SUPPORTED_NEW_COMM 0x20000
538 #define AAC_SUPPORTED_64BIT_ARRAYSIZE 0x40000
539 #define AAC_SUPPORTED_HEAT_SENSOR 0x80000
540 #define AAC_SUPPORTED_NEW_COMM_TYPE1 0x10000000 /* Tupelo new comm */
541 #define AAC_SUPPORTED_NEW_COMM_TYPE2 0x20000000 /* Denali new comm */
542 #define AAC_SUPPORTED_NEW_COMM_TYPE3 0x40000000 /* Series 8 new comm */
543 #define AAC_SUPPORTED_NEW_COMM_TYPE4 0x80000000 /* Series 9 new comm */
546 * Structure used to respond to a RequestAdapterInfo fib.
548 struct aac_adapter_info {
549 AAC_Platform PlatformBase; /* adapter type */
550 AAC_CpuType CpuArchitecture; /* adapter CPU type */
551 AAC_CpuSubType CpuVariant; /* adapter CPU subtype */
552 u_int32_t ClockSpeed; /* adapter CPU clockspeed */
553 u_int32_t ExecutionMem; /* adapter Execution Memory
555 u_int32_t BufferMem; /* adapter Data Memory */
556 u_int32_t TotalMem; /* adapter Total Memory */
557 struct FsaRevision KernelRevision; /* adapter Kernel Software
559 struct FsaRevision MonitorRevision; /* adapter Monitor/Diagnostic
560 * Software Revision */
561 struct FsaRevision HardwareRevision;/* TBD */
562 struct FsaRevision BIOSRevision; /* adapter BIOS Revision */
563 u_int32_t ClusteringEnabled;
564 u_int32_t ClusterChannelMask;
565 u_int64_t SerialNumber;
566 AAC_BatteryPlatform batteryPlatform;
567 u_int32_t SupportedOptions; /* supported features of this
569 AAC_OemFlavor OemVariant;
573 * More options from supplement info - SupportedOptions2
575 #define AAC_SUPPORTED_MU_RESET 0x01
576 #define AAC_SUPPORTED_IGNORE_RESET 0x02
577 #define AAC_SUPPORTED_POWER_MANAGEMENT 0x04
578 #define AAC_SUPPORTED_ARCIO_PHYDEV 0x08
579 #define AAC_SUPPORTED_DOORBELL_RESET 0x4000
580 #define AAC_SUPPORTED_VARIABLE_BLOCK_SIZE 0x40000 /* 4KB sector size */
583 * FeatureBits of RequestSupplementAdapterInfo used in the driver
585 #define AAC_SUPPL_SUPPORTED_JBOD 0x08000000
588 * Structure used to respond to a RequestSupplementAdapterInfo fib.
591 u_int8_t AssemblyPn[8];
593 u_int8_t BatteryFruPn[8];
594 u_int8_t EcVersionString[8];
598 #define MFG_PCBA_SERIAL_NUMBER_WIDTH 12
599 #define MFG_WWN_WIDTH 8
601 struct aac_supplement_adapter_info {
602 /* The assigned Adapter Type Text, extra byte for null termination */
603 int8_t AdapterTypeText[17+1];
604 /* Pad for the text above */
606 /* Size in bytes of the memory that is flashed */
607 u_int32_t FlashMemoryByteSize;
608 /* The assigned IMAGEID_xxx for this adapter */
609 u_int32_t FlashImageId;
611 * The maximum number of Phys available on a SATA/SAS
612 * Controller, 0 otherwise
614 u_int32_t MaxNumberPorts;
615 /* Version of expansion area */
617 u_int32_t FeatureBits;
619 u_int8_t ReservedPad0[3];
620 u_int8_t BuildDate[12];
621 /* The current number of Ports on a SAS controller, 0 otherwise */
622 u_int32_t CurrentNumberPorts;
624 struct vpd_info VpdInfo;
626 /* Firmware Revision (Vmaj.min-dash.) */
627 struct FsaRevision FlashFirmwareRevision;
628 u_int32_t RaidTypeMorphOptions;
629 /* Firmware's boot code Revision (Vmaj.min-dash.) */
630 struct FsaRevision FlashFirmwareBootRevision;
631 /* PCBA serial no. from th MFG sector */
632 u_int8_t MfgPcbaSerialNo[MFG_PCBA_SERIAL_NUMBER_WIDTH];
633 /* WWN from the MFG sector */
634 u_int8_t MfgWWNName[MFG_WWN_WIDTH];
635 u_int32_t SupportedOptions2; /* more supported features */
636 u_int32_t ExpansionFlag; /* 1 - following fields are valid */
637 u_int32_t FeatureBits3;
638 u_int32_t SupportedPerformanceMode;
639 /* Growth Area for future expansion */
640 u_int32_t ReservedGrowth[80];
644 * Monitor/Kernel interface.
648 * Synchronous commands to the monitor/kernel.
650 #define AAC_MONKER_BREAKPOINT 0x04
651 #define AAC_MONKER_INITSTRUCT 0x05
652 #define AAC_MONKER_SYNCFIB 0x0c
653 #define AAC_MONKER_GETKERNVER 0x11
654 #define AAC_MONKER_POSTRESULTS 0x14
655 #define AAC_MONKER_GETINFO 0x19
656 #define AAC_MONKER_GETDRVPROP 0x23
657 #define AAC_MONKER_RCVTEMP 0x25
658 #define AAC_MONKER_GETCOMMPREF 0x26
659 #define AAC_MONKER_REINIT 0xee
660 #define AAC_IOP_RESET 0x1000
661 #define AAC_IOP_RESET_ALWAYS 0x1001
664 * Adapter Status Register
666 * Phase Staus mailbox is 32bits:
667 * <31:16> = Phase Status
670 * The adapter reports its present state through the phase. Only
671 * a single phase should be ever be set. Each phase can have multiple
672 * phase status bits to provide more detailed information about the
673 * state of the adapter.
675 #define AAC_SELF_TEST_FAILED 0x00000004
676 #define AAC_MONITOR_PANIC 0x00000020
677 #define AAC_UP_AND_RUNNING 0x00000080
678 #define AAC_KERNEL_PANIC 0x00000100
681 * for dual FW image support
683 #define AAC_FLASH_UPD_PENDING 0x00002000
684 #define AAC_FLASH_UPD_SUCCESS 0x00004000
685 #define AAC_FLASH_UPD_FAILED 0x00008000
688 * Data types relating to control and monitoring of the NVRAM/WriteCache
692 #define AAC_NFILESYS 24 /* maximum number of filesystems */
695 * NVRAM/Write Cache subsystem states
698 NVSTATUS_DISABLED = 0, /* present, clean, not being used */
699 NVSTATUS_ENABLED, /* present, possibly dirty, ready for use */
700 NVSTATUS_ERROR, /* present, dirty, contains dirty data */
701 NVSTATUS_BATTERY, /* present, bad or low battery, may contain
703 NVSTATUS_UNKNOWN /* for bad/missing device */
707 * NVRAM/Write Cache subsystem battery component states
711 NVBATTSTATUS_NONE = 0, /* battery has no power or is not present */
712 NVBATTSTATUS_LOW, /* battery is low on power */
713 NVBATTSTATUS_OK, /* battery is okay - normal operation possible
714 * only in this state */
715 NVBATTSTATUS_RECONDITIONING /* no battery present - reconditioning
720 * Battery transition type
723 NVBATT_TRANSITION_NONE = 0, /* battery now has no power or is not
725 NVBATT_TRANSITION_LOW, /* battery is now low on power */
726 NVBATT_TRANSITION_OK /* battery is now okay - normal
727 * operation possible only in this
729 } AAC_NVBATT_TRANSITION;
732 * NVRAM Info structure returned for NVRAM_GetInfo call
734 struct aac_nvramdevinfo {
735 u_int32_t NV_Enabled; /* write caching enabled */
736 u_int32_t NV_Error; /* device in error state */
737 u_int32_t NV_NDirty; /* count of dirty NVRAM buffers */
738 u_int32_t NV_NActive; /* count of NVRAM buffers being
742 struct aac_nvraminfo {
743 AAC_NVSTATUS NV_Status; /* nvram subsystem status */
744 AAC_NVBATTSTATUS NV_BattStatus; /* battery status */
745 u_int32_t NV_Size; /* size of WriteCache NVRAM in
747 u_int32_t NV_BufSize; /* size of NVRAM buffers in
749 u_int32_t NV_NBufs; /* number of NVRAM buffers */
750 u_int32_t NV_NDirty; /* Num dirty NVRAM buffers */
751 u_int32_t NV_NClean; /* Num clean NVRAM buffers */
752 u_int32_t NV_NActive; /* Num NVRAM buffers being
754 u_int32_t NV_NBrokered; /* Num brokered NVRAM buffers */
755 struct aac_nvramdevinfo NV_DevInfo[AAC_NFILESYS]; /* per device
757 u_int32_t NV_BattNeedsReconditioning; /* boolean */
758 u_int32_t NV_TotalSize; /* size of all non-volatile
759 * memories in bytes */
763 * Data types relating to adapter-initiated FIBs
765 * Based on types and structures in <aifstruc.h>
772 AifJobStsSuccess = 1,
776 AifJobStsLastReportMarker = 100, /* All prior mean last report */
782 AifJobScsiMin = 1, /* Minimum value for Scsi operation */
783 AifJobScsiZero, /* SCSI device clear operation */
784 AifJobScsiVerify, /* SCSI device Verify operation NO
786 AifJobScsiExercise, /* SCSI device Exercise operation */
787 AifJobScsiVerifyRepair, /* SCSI device Verify operation WITH
789 AifJobScsiWritePattern, /* write pattern */
790 AifJobScsiMax = 99, /* Max Scsi value */
791 AifJobCtrMin, /* Min Ctr op value */
792 AifJobCtrZero, /* Container clear operation */
793 AifJobCtrCopy, /* Container copy operation */
794 AifJobCtrCreateMirror, /* Container Create Mirror operation */
795 AifJobCtrMergeMirror, /* Container Merge Mirror operation */
796 AifJobCtrScrubMirror, /* Container Scrub Mirror operation */
797 AifJobCtrRebuildRaid5, /* Container Rebuild Raid5 operation */
798 AifJobCtrScrubRaid5, /* Container Scrub Raid5 operation */
799 AifJobCtrMorph, /* Container morph operation */
800 AifJobCtrPartCopy, /* Container Partition copy operation */
801 AifJobCtrRebuildMirror, /* Container Rebuild Mirror operation */
802 AifJobCtrCrazyCache, /* crazy cache */
803 AifJobCtrCopyback, /* Container Copyback operation */
804 AifJobCtrCompactRaid5D, /* Container Compaction operation */
805 AifJobCtrExpandRaid5D, /* Container Expansion operation */
806 AifJobCtrRebuildRaid6, /* Container Rebuild Raid6 operation */
807 AifJobCtrScrubRaid6, /* Container Scrub Raid6 operation */
808 AifJobCtrSSBackup, /* Container snapshot backup task */
809 AifJobCtrMax = 199, /* Max Ctr type operation */
810 AifJobFsMin, /* Min Fs type operation */
811 AifJobFsCreate, /* File System Create operation */
812 AifJobFsVerify, /* File System Verify operation */
813 AifJobFsExtend, /* File System Extend operation */
814 AifJobFsMax = 299, /* Max Fs type operation */
815 AifJobApiFormatNTFS, /* Format a drive to NTFS */
816 AifJobApiFormatFAT, /* Format a drive to FAT */
817 AifJobApiUpdateSnapshot, /* update the read/write half of a
819 AifJobApiFormatFAT32, /* Format a drive to FAT32 */
820 AifJobApiMax = 399, /* Max API type operation */
821 AifJobCtlContinuousCtrVerify, /* Adapter operation */
822 AifJobCtlMax = 499 /* Max Adapter type operation */
825 struct aac_AifContainers {
826 u_int32_t src; /* from/master */
827 u_int32_t dst; /* to/slave */
830 union aac_AifJobClient {
831 struct aac_AifContainers container; /* For Container and
832 * filesystem progress
834 int32_t scsi_dh; /* For SCSI progress
838 struct aac_AifJobDesc {
839 u_int32_t jobID; /* DO NOT FILL IN! Will be
840 * filled in by AIF */
841 AAC_AifJobType type; /* Operation that is being
843 union aac_AifJobClient client; /* Details */
846 struct aac_AifJobProgressReport {
847 struct aac_AifJobDesc jd;
848 AAC_AifJobStatus status;
850 u_int32_t currentTick;
851 u_int32_t jobSpecificData1;
852 u_int32_t jobSpecificData2;
859 /* General application notifies start here */
860 AifEnGeneric = 1, /* Generic notification */
861 AifEnTaskComplete, /* Task has completed */
862 AifEnConfigChange, /* Adapter config change occurred */
863 AifEnContainerChange, /* Adapter specific container
864 * configuration change */
865 AifEnDeviceFailure, /* SCSI device failed */
866 AifEnMirrorFailover, /* Mirror failover started */
867 AifEnContainerEvent, /* Significant container event */
868 AifEnFileSystemChange, /* File system changed */
869 AifEnConfigPause, /* Container pause event */
870 AifEnConfigResume, /* Container resume event */
871 AifEnFailoverChange, /* Failover space assignment changed */
872 AifEnRAID5RebuildDone, /* RAID5 rebuild finished */
873 AifEnEnclosureManagement, /* Enclosure management event */
874 AifEnBatteryEvent, /* Significant NV battery event */
875 AifEnAddContainer, /* A new container was created. */
876 AifEnDeleteContainer, /* A container was deleted. */
877 AifEnSMARTEvent, /* SMART Event */
878 AifEnBatteryNeedsRecond, /* The battery needs reconditioning */
879 AifEnClusterEvent, /* Some cluster event */
880 AifEnDiskSetEvent, /* A disk set event occurred. */
881 AifEnContainerScsiEvent, /* a container event with no. and scsi id */
882 AifEnPicBatteryEvent, /* An event gen. by pic_battery.c for an ABM */
883 AifEnExpEvent, /* Exp. Event Type to replace CTPopUp messages */
884 AifEnRAID6RebuildDone, /* RAID6 rebuild finished */
885 AifEnSensorOverHeat, /* Heat Sensor indicate overheat */
886 AifEnSensorCoolDown, /* Heat Sensor ind. cooled down after overheat */
887 AifFeatureKeysModified, /* notif. of updated feature keys */
888 AifApplicationExpirationEvent, /* notif. on app. expiration status */
889 AifEnBackgroundConsistencyCheck,/* BCC notif. for NEC - DDTS 94700 */
890 AifEnAddJBOD, /* A new JBOD type drive was created (30) */
891 AifEnDeleteJBOD, /* A JBOD type drive was deleted (31) */
892 AifDriverNotifyStart=199, /* Notifies for host driver go here */
893 /* Host driver notifications start here */
894 AifDenMorphComplete, /* A morph operation completed */
895 AifDenVolumeExtendComplete, /* Volume expand operation completed */
896 AifDriverNotifyDelay,
897 AifRawDeviceRemove /* Raw device Failure event */
898 } AAC_AifEventNotifyType;
900 struct aac_AifEnsGeneric {
901 char text[132]; /* Generic text */
904 struct aac_AifEnsDeviceFailure {
905 u_int32_t deviceHandle; /* SCSI device handle */
908 struct aac_AifEnsMirrorFailover {
909 u_int32_t container; /* Container with failed element */
910 u_int32_t failedSlice; /* Old slice which failed */
911 u_int32_t creatingSlice; /* New slice used for auto-create */
914 struct aac_AifEnsContainerChange {
915 u_int32_t container[2]; /* container that changed, -1 if no
919 struct aac_AifEnsContainerEvent {
920 u_int32_t container; /* container number */
921 u_int32_t eventType; /* event type */
924 struct aac_AifEnsEnclosureEvent {
925 u_int32_t empID; /* enclosure management proc number */
926 u_int32_t unitID; /* unitId, fan id, power supply id,
927 * slot id, tempsensor id. */
928 u_int32_t eventType; /* event type */
932 AIF_EM_DRIVE_INSERTION=31,
934 } aac_AifEMEventType;
936 struct aac_AifEnsBatteryEvent {
937 AAC_NVBATT_TRANSITION transition_type; /* eg from low to ok */
938 AAC_NVBATTSTATUS current_state; /* current batt state */
939 AAC_NVBATTSTATUS prior_state; /* prev batt state */
942 struct aac_AifEnsDiskSetEvent {
949 CLUSTER_NULL_EVENT = 0,
950 CLUSTER_PARTNER_NAME_EVENT, /* change in partner hostname or
951 * adaptername from NULL to non-NULL */
952 /* (partner's agent may be up) */
953 CLUSTER_PARTNER_NULL_NAME_EVENT /* change in partner hostname or
954 * adaptername from non-null to NULL */
955 /* (partner has rebooted) */
956 } AAC_ClusterAifEvent;
958 struct aac_AifEnsClusterEvent {
959 AAC_ClusterAifEvent eventType;
962 struct aac_AifEventNotify {
963 AAC_AifEventNotifyType type;
965 struct aac_AifEnsGeneric EG;
966 struct aac_AifEnsDeviceFailure EDF;
967 struct aac_AifEnsMirrorFailover EMF;
968 struct aac_AifEnsContainerChange ECC;
969 struct aac_AifEnsContainerEvent ECE;
970 struct aac_AifEnsEnclosureEvent EEE;
971 struct aac_AifEnsBatteryEvent EBE;
972 struct aac_AifEnsDiskSetEvent EDS;
973 /* struct aac_AifEnsSMARTEvent ES;*/
974 struct aac_AifEnsClusterEvent ECLE;
979 * Adapter Initiated FIB command structures. Start with the adapter
980 * initiated FIBs that really come from the adapter, and get responded
983 #define AAC_AIF_REPORT_MAX_SIZE 64
986 AifCmdEventNotify = 1, /* Notify of event */
987 AifCmdJobProgress, /* Progress report */
988 AifCmdAPIReport, /* Report from other user of API */
989 AifCmdDriverNotify, /* Notify host driver of event */
990 AifReqJobList = 100, /* Gets back complete job list */
991 AifReqJobsForCtr, /* Gets back jobs for specific container */
992 AifReqJobsForScsi, /* Gets back jobs for specific SCSI device */
993 AifReqJobReport, /* Gets back a specific job report or list */
994 AifReqTerminateJob, /* Terminates job */
995 AifReqSuspendJob, /* Suspends a job */
996 AifReqResumeJob, /* Resumes a job */
997 AifReqSendAPIReport, /* API generic report requests */
998 AifReqAPIJobStart, /* Start a job from the API */
999 AifReqAPIJobUpdate, /* Update a job report from the API */
1000 AifReqAPIJobFinish, /* Finish a job from the API */
1001 AifReqEvent = 200 /* PMC NEW COMM: Request the event data */
1004 struct aac_aif_command {
1005 AAC_AifCommand command; /* Tell host what type of
1007 u_int32_t seqNumber; /* To allow ordering of
1008 * reports (if necessary) */
1010 struct aac_AifEventNotify EN; /* Event notify */
1011 struct aac_AifJobProgressReport PR[1]; /* Progress report */
1012 u_int8_t AR[AAC_AIF_REPORT_MAX_SIZE];
1013 u_int8_t data[AAC_FIB_DATASIZE - 8];
1018 * Filesystem commands/data
1020 * The adapter has a very complex filesystem interface, most of which we ignore.
1021 * (And which seems not to be implemented, anyway.)
1056 SetFileSystemStatus,
1070 * Command status values
1091 ST_NAMETOOLONG = 63,
1097 ST_BADHANDLE = 10001,
1098 ST_NOT_SYNC = 10002,
1099 ST_BAD_COOKIE = 10003,
1101 ST_TOOSMALL = 10005,
1102 ST_SERVERFAULT = 10006,
1105 ST_NOTMOUNTED = 10009,
1106 ST_MAINTMODE = 10010,
1107 ST_STALEACL = 10011,
1108 ST_BUS_RESET = 20001
1112 * Volume manager commands
1114 typedef enum _VM_COMMANDS {
1116 VM_NameServe, /* query for mountable objects (containers) */
1123 VM_SliceBlockRead, /* raw access to configured "storage objects" */
1125 VM_DriveBlockRead, /* raw access to physical devices */
1127 VM_EnclosureMgt, /* enclosure management */
1128 VM_Unused, /* used to be diskset management */
1130 VM_CtPerf, /* performance test */
1136 VM_DrvErrTblLog, /* drive error table/log type of command */
1137 VM_NameServe64, /* query also for containers >2TB */
1138 VM_SasNvsramAccess, /* for sas nvsram layout function */
1139 VM_HandleExpiration, /* handles application expiration, internal use! */
1140 VM_GetDynAdapProps, /* retrieves dynamic adapter properties */
1141 VM_SetDynAdapProps, /* sets a dynamic adapter property */
1142 VM_UpdateSSDODM, /* updates the on-disk metadata for SSD caching */
1143 VM_GetSPMParameters, /* get SPM parameters for one of the perf. modes */
1144 VM_SetSPMParameters, /* set SPM parameters for user defined perf. mode */
1145 VM_NameServeAllBlk, /* query also for containers with 4KB sector size */
1146 MAX_VMCOMMAND_NUM /* used for sizing stats array - leave last */
1149 /* Container Configuration Sub-Commands */
1150 #define CT_GET_SCSI_METHOD 64
1151 #define CT_PAUSE_IO 65
1152 #define CT_RELEASE_IO 66
1153 #define CT_GET_CONFIG_STATUS 147
1154 #define CT_COMMIT_CONFIG 152
1155 #define CT_CID_TO_32BITS_UID 165
1156 #define CT_PM_DRIVER_SUPPORT 245
1158 /* General CT_xxx return status */
1161 /* CT_PM_DRIVER_SUPPORT parameter */
1163 AAC_PM_DRIVERSUP_GET_STATUS = 1,
1164 AAC_PM_DRIVERSUP_START_UNIT,
1165 AAC_PM_DRIVERSUP_STOP_UNIT
1166 } AAC_CT_PM_DRIVER_SUPPORT_SUB_COM;
1169 * CT_PAUSE_IO is immediate minimal runtime command that is used
1170 * to restart the applications and cache.
1172 struct aac_pause_command {
1183 /* Flag values for ContentState */
1184 #define AAC_FSCS_NOTCLEAN 0x1 /* fscheck is necessary before mounting */
1185 #define AAC_FSCS_READONLY 0x2 /* possible result of broken mirror */
1186 #define AAC_FSCS_HIDDEN 0x4 /* container should be ignored by driver */
1187 #define AAC_FSCS_NOT_READY 0x8 /* cnt is in spinn. state, not rdy for IO's */
1190 * "mountable object"
1194 char FileSystemName[16];
1195 struct aac_container_creation CreateInfo;
1199 u_int32_t ContentState;
1203 u_int32_t BlockSize;
1204 u_int32_t bdLgclPhysMap;
1207 u_int32_t AlterEgoId;
1208 u_int32_t CapacityHigh;
1211 struct aac_mntinfo {
1217 struct aac_mntinforesp {
1220 u_int32_t MntRespCount;
1221 struct aac_mntobj MntTable[1];
1225 * Container shutdown command.
1227 struct aac_closecommand {
1229 u_int32_t ContainerId;
1233 * Container Config Command
1241 struct aac_ctcfg_resp {
1250 #define AAC_SCSI_MAX_PORTS 10
1251 #define AAC_BUS_NO_EXIST 0
1252 #define AAC_BUS_VALID 1
1253 #define AAC_BUS_FAULTED 2
1254 #define AAC_BUS_DISABLED 3
1255 #define GetBusInfo 0x9
1257 struct aac_getbusinf {
1258 u_int32_t ProbeComplete;
1260 u_int32_t TargetsPerBus;
1261 u_int8_t InitiatorBusId[AAC_SCSI_MAX_PORTS];
1262 u_int8_t BusValid[AAC_SCSI_MAX_PORTS];
1265 struct aac_vmioctl {
1271 u_int32_t IoctlBuf[1]; /* Placeholder? */
1274 struct aac_vmi_businf_resp {
1280 struct aac_getbusinf BusInf;
1283 struct aac_vmi_devinfo_resp {
1289 u_int8_t VendorId[8];
1290 u_int8_t ProductId[16];
1291 u_int8_t ProductRev[4];
1298 u_int32_t reserved[2];
1299 u_int8_t VendorSpecific[20];
1301 u_int32_t AAC_Managed:1;
1303 u_int32_t reserved2:6;
1307 u_int32_t ultraEnable:1,
1319 }; /* Do not pack */
1321 #define ResetBus 0x16
1322 struct aac_resetbus {
1323 u_int32_t BusNumber;
1327 * Write 'stability' options.
1335 * Commit level response for a write request.
1338 CMFILE_SYNC_NVRAM = 1,
1346 #define CT_FIB_PARAMS 6
1347 #define MAX_FIB_PARAMS 10
1348 #define CT_PACKET_SIZE \
1349 (AAC_FIB_DATASIZE - sizeof (u_int32_t) - \
1350 ((sizeof (u_int32_t)) * (MAX_FIB_PARAMS + 1)))
1353 struct aac_fsa_ctm {
1355 u_int32_t param[CT_FIB_PARAMS];
1356 int8_t data[CT_PACKET_SIZE];
1359 struct aac_cnt_config {
1361 struct aac_fsa_ctm CTCommand;
1366 CFACT_CONTINUE = 0, /* continue without pause */
1367 CFACT_PAUSE, /* pause, then continue */
1368 CFACT_ABORT /* abort */
1371 struct aac_cf_status_hdr {
1374 u_int32_t recordcount;
1378 * Block read/write operations.
1379 * These structures are packed into the 'data' area in the FIB.
1382 struct aac_blockread {
1383 u_int32_t Command; /* not FSACommand! */
1384 u_int32_t ContainerId;
1385 u_int32_t BlockNumber;
1386 u_int32_t ByteCount;
1387 struct aac_sg_table SgMap; /* variable size */
1390 struct aac_blockread64 {
1392 u_int16_t ContainerId;
1393 u_int16_t SectorCount;
1394 u_int32_t BlockNumber;
1397 struct aac_sg_table64 SgMap64;
1400 struct aac_blockread_response {
1402 u_int32_t ByteCount;
1405 struct aac_blockwrite {
1406 u_int32_t Command; /* not FSACommand! */
1407 u_int32_t ContainerId;
1408 u_int32_t BlockNumber;
1409 u_int32_t ByteCount;
1411 struct aac_sg_table SgMap; /* variable size */
1414 struct aac_blockwrite64 {
1415 u_int32_t Command; /* not FSACommand! */
1416 u_int16_t ContainerId;
1417 u_int16_t SectorCount;
1418 u_int32_t BlockNumber;
1421 struct aac_sg_table64 SgMap64; /* variable size */
1424 struct aac_blockwrite_response {
1426 u_int32_t ByteCount;
1427 u_int32_t Committed;
1431 u_int64_t BlockNumber;
1432 u_int32_t ByteCount;
1433 u_int16_t ContainerId;
1434 u_int16_t Flags; /* 0: W, 1: R */
1435 u_int16_t BpTotal; /* reserved for FW use */
1436 u_int16_t BpComplete; /* reserved for FW use */
1437 struct aac_sg_tableraw SgMapRaw; /* variable size */
1440 #define RIO2_IO_TYPE 0x0003
1441 #define RIO2_IO_TYPE_WRITE 0x0000
1442 #define RIO2_IO_TYPE_READ 0x0001
1443 #define RIO2_IO_TYPE_VERIFY 0x0002
1444 #define RIO2_IO_ERROR 0x0004
1445 #define RIO2_IO_SUREWRITE 0x0008
1446 #define RIO2_SGL_CONFORMANT 0x0010
1447 #define RIO2_SG_FORMAT 0xF000
1448 #define RIO2_SG_FORMAT_ARC 0x0000
1449 #define RIO2_SG_FORMAT_SRL 0x1000
1450 #define RIO2_SG_FORMAT_IEEE1212 0x2000
1451 struct aac_raw_io2 {
1452 u_int32_t strtBlkLow;
1453 u_int32_t strtBlkHigh;
1456 u_int16_t flags; /* RIO2_xxx */
1457 u_int32_t sgeFirstSize; /* size of first SG element */
1458 u_int32_t sgeNominalSize; /* size of 2nd SG element */
1460 u_int8_t bpTotal; /* reserved for FW use */
1461 u_int8_t bpComplete; /* reserved for FW use */
1462 u_int8_t sgeFirstIndex; /* reserved for FW use */
1464 struct aac_sge_ieee1212 sge[0]; /* variable size */
1468 * Container shutdown command.
1470 struct aac_close_command {
1472 u_int32_t ContainerId;
1476 * SCSI Passthrough structures
1486 u_int32_t retry_limit;
1489 struct aac_sg_table sg_map;
1493 AAC_SRB_FUNC_EXECUTE_SCSI = 0x00,
1494 AAC_SRB_FUNC_CLAIM_DEVICE,
1495 AAC_SRB_FUNC_IO_CONTROL,
1496 AAC_SRB_FUNC_RECEIVE_EVENT,
1497 AAC_SRB_FUNC_RELEASE_QUEUE,
1498 AAC_SRB_FUNC_ATTACH_DEVICE,
1499 AAC_SRB_FUNC_RELEASE_DEVICE,
1500 AAC_SRB_FUNC_SHUTDOWN,
1502 AAC_SRB_FUNC_ABORT_COMMAND = 0x10,
1503 AAC_SRB_FUNC_RELEASE_RECOVERY,
1504 AAC_SRB_FUNC_RESET_BUS,
1505 AAC_SRB_FUNC_RESET_DEVICE,
1506 AAC_SRB_FUNC_TERMINATE_IO,
1507 AAC_SRB_FUNC_FLUSH_QUEUE,
1508 AAC_SRB_FUNC_REMOVE_DEVICE,
1509 AAC_SRB_FUNC_DOMAIN_VALIDATION
1512 #define AAC_SRB_FLAGS_NO_DATA_XFER 0x0000
1513 #define AAC_SRB_FLAGS_DISABLE_DISCONNECT 0x0004
1514 #define AAC_SRB_FLAGS_DISABLE_SYNC_TRANSFER 0x0008
1515 #define AAC_SRB_FLAGS_BYPASS_FROZEN_QUEUE 0x0010
1516 #define AAC_SRB_FLAGS_DISABLE_AUTOSENSE 0x0020
1517 #define AAC_SRB_FLAGS_DATA_IN 0x0040
1518 #define AAC_SRB_FLAGS_DATA_OUT 0x0080
1519 #define AAC_SRB_FLAGS_UNSPECIFIED_DIRECTION \
1520 (AAC_SRB_FLAGS_DATA_IN | AAC_SRB_FLAGS_DATA_OUT)
1522 #define AAC_HOST_SENSE_DATA_MAX 30
1524 struct aac_srb_response {
1525 u_int32_t fib_status;
1526 u_int32_t srb_status;
1527 u_int32_t scsi_status;
1529 u_int32_t sense_len;
1530 u_int8_t sense[AAC_HOST_SENSE_DATA_MAX];
1534 * Status codes for SCSI passthrough commands. Since they are based on ASPI,
1535 * they also exactly match CAM status codes in both enumeration and meaning.
1536 * They seem to also be used as status codes for synchronous FIBs.
1539 AAC_SRB_STS_PENDING = 0x00,
1540 AAC_SRB_STS_SUCCESS,
1541 AAC_SRB_STS_ABORTED,
1542 AAC_SRB_STS_ABORT_FAILED,
1545 AAC_SRB_STS_INVALID_REQUEST,
1546 AAC_SRB_STS_INVALID_PATH_ID,
1547 AAC_SRB_STS_NO_DEVICE,
1548 AAC_SRB_STS_TIMEOUT,
1549 AAC_SRB_STS_SELECTION_TIMEOUT,
1550 AAC_SRB_STS_COMMAND_TIMEOUT,
1551 AAC_SRB_STS_MESSAGE_REJECTED = 0x0D,
1552 AAC_SRB_STS_BUS_RESET,
1553 AAC_SRB_STS_PARITY_ERROR,
1554 AAC_SRB_STS_REQUEST_SENSE_FAILED,
1556 AAC_SRB_STS_DATA_OVERRUN,
1557 AAC_SRB_STS_UNEXPECTED_BUS_FREE,
1558 AAC_SRB_STS_PHASE_SEQUENCE_FAILURE,
1559 AAC_SRB_STS_BAD_SRB_BLOCK_LENGTH,
1560 AAC_SRB_STS_REQUEST_FLUSHED,
1561 AAC_SRB_STS_INVALID_LUN = 0x20,
1562 AAC_SRB_STS_INVALID_TARGET_ID,
1563 AAC_SRB_STS_BAD_FUNCTION,
1564 AAC_SRB_STS_ERROR_RECOVERY
1568 * Register definitions for the Adaptec PMC SRC/SRCv adapters.
1570 /* accessible via BAR0 */
1571 #define AAC_SRC_OMR 0xbc /* outbound message register */
1572 #define AAC_SRC_IOAR 0x18 /* IOA->host interrupt register */
1573 #define AAC_SRC_IDBR 0x20 /* inbound doorbell register */
1574 #define AAC_SRC_IISR 0x24 /* inbound interrupt status register */
1575 #define AAC_SRC_ODBR_R 0x9c /* outbound doorbell register read */
1576 #define AAC_SRC_ODBR_C 0xa0 /* outbound doorbell register clear */
1577 #define AAC_SRC_OIMR 0x34 /* outbound interrupt mask register */
1578 #define AAC_SRC_IQUE32 0x40 /* inbound queue address 32-bit */
1579 #define AAC_SRC_IQUE64_L 0xc0 /* inbound queue address 64-bit (low) */
1580 #define AAC_SRC_IQUE64_H 0xc4 /* inbound queue address 64-bit (high)*/
1581 #define AAC_SRC_ODBR_MSI 0xc8 /* MSI register for sync./AIF */
1583 #define AAC_SRC_MAILBOX 0x7fc60 /* mailbox (20 bytes) */
1584 #define AAC_SRCV_MAILBOX 0x1000 /* mailbox (20 bytes) */
1586 #define AAC_SRC_ODR_SHIFT 12 /* outbound doorbell shift */
1587 #define AAC_SRC_IDR_SHIFT 9 /* inbound doorbell shift */
1589 /* Sunrise Lake dual core reset */
1590 #define AAC_IRCSR 0x38 /* inbound dual cores reset */
1591 #define AAC_IRCSR_CORES_RST 3
1595 * Common bit definitions for the doorbell registers.
1599 * Status bits in the doorbell registers.
1601 #define AAC_DB_SYNC_COMMAND (1<<0) /* send/completed synchronous FIB */
1602 #define AAC_DB_AIF_PENDING (1<<6) /* pending AIF (new comm. type1) */
1603 /* PMC specific outbound doorbell bits */
1604 #define AAC_DB_RESPONSE_SENT_NS (1<<1) /* response sent (not shifted)*/
1607 * The adapter can request the host print a message by setting the
1608 * DB_PRINTF flag in DOORBELL0. The driver responds by collecting the
1609 * message from the printf buffer, clearing the DB_PRINTF flag in
1610 * DOORBELL0 and setting it in DOORBELL1.
1611 * (ODBR and IDBR respectively for the i960Rx adapters)
1613 #define AAC_DB_PRINTF (1<<5) /* adapter requests host printf */
1614 #define AAC_PRINTF_DONE (1<<5) /* Host completed printf processing */
1619 #define AAC_MAX_MSIX 32 /* vectors */
1620 #define AAC_PCI_MSI_ENABLE 0x8000
1621 #define AAC_MSI_SYNC_STATUS 0x1000
1624 AAC_ENABLE_INTERRUPT = 0x0,
1625 AAC_DISABLE_INTERRUPT,
1633 #define AAC_INT_MODE_INTX (1<<0)
1634 #define AAC_INT_MODE_MSI (1<<1)
1635 #define AAC_INT_MODE_AIF (1<<2)
1636 #define AAC_INT_MODE_SYNC (1<<3)
1638 #define AAC_INT_ENABLE_TYPE1_INTX 0xfffffffb
1639 #define AAC_INT_ENABLE_TYPE1_MSIX 0xfffffffa
1640 #define AAC_INT_DISABLE_ALL 0xffffffff
1642 /* Bit definitions in IOA->Host Interrupt Register */
1643 #define PMC_TRANSITION_TO_OPERATIONAL (0x80000000 >> 0)
1644 #define PMC_IOARCB_TRANSFER_FAILED (0x80000000 >> 3)
1645 #define PMC_IOA_UNIT_CHECK (0x80000000 >> 4)
1646 #define PMC_NO_HOST_RRQ_FOR_CMD_RESPONSE (0x80000000 >> 5)
1647 #define PMC_CRITICAL_IOA_OP_IN_PROGRESS (0x80000000 >> 6)
1648 #define PMC_IOARRIN_LOST (0x80000000 >> 27)
1649 #define PMC_SYSTEM_BUS_MMIO_ERROR (0x80000000 >> 28)
1650 #define PMC_IOA_PROCESSOR_IN_ERROR_STATE (0x80000000 >> 29)
1651 #define PMC_HOST_RRQ_VALID (0x80000000 >> 30)
1652 #define PMC_OPERATIONAL_STATUS (0x80000000 >> 0)
1653 #define PMC_ALLOW_MSIX_VECTOR0 (0x80000000 >> 31)
1655 #define PMC_IOA_ERROR_INTERRUPTS (PMC_IOARCB_TRANSFER_FAILED | \
1656 PMC_IOA_UNIT_CHECK | \
1657 PMC_NO_HOST_RRQ_FOR_CMD_RESPONSE | \
1658 PMC_IOARRIN_LOST | \
1659 PMC_SYSTEM_BUS_MMIO_ERROR | \
1660 PMC_IOA_PROCESSOR_IN_ERROR_STATE)
1662 #define PMC_ALL_INTERRUPT_BITS (PMC_IOA_ERROR_INTERRUPTS | \
1663 PMC_HOST_RRQ_VALID | \
1664 PMC_TRANSITION_TO_OPERATIONAL | \
1665 PMC_ALLOW_MSIX_VECTOR0)
1667 #define PMC_GLOBAL_INT_BIT2 0x00000004
1668 #define PMC_GLOBAL_INT_BIT0 0x00000001