📄 aacraid.h
字号:
{ struct aac_queue queue[8];};/* * SaP1 Message Unit Registers */ struct sa_drawbridge_CSR { // Offset | Name u32 reserved[10]; // 00h-27h | Reserved u8 LUT_Offset; // 28h | Looup Table Offset u8 reserved1[3]; // 29h-2bh | Reserved u32 LUT_Data; // 2ch | Looup Table Data u32 reserved2[26]; // 30h-97h | Reserved u16 PRICLEARIRQ; // 98h | Primary Clear Irq u16 SECCLEARIRQ; // 9ah | Secondary Clear Irq u16 PRISETIRQ; // 9ch | Primary Set Irq u16 SECSETIRQ; // 9eh | Secondary Set Irq u16 PRICLEARIRQMASK; // a0h | Primary Clear Irq Mask u16 SECCLEARIRQMASK; // a2h | Secondary Clear Irq Mask u16 PRISETIRQMASK; // a4h | Primary Set Irq Mask u16 SECSETIRQMASK; // a6h | Secondary Set Irq Mask u32 MAILBOX0; // a8h | Scratchpad 0 u32 MAILBOX1; // ach | Scratchpad 1 u32 MAILBOX2; // b0h | Scratchpad 2 u32 MAILBOX3; // b4h | Scratchpad 3 u32 MAILBOX4; // b8h | Scratchpad 4 u32 MAILBOX5; // bch | Scratchpad 5 u32 MAILBOX6; // c0h | Scratchpad 6 u32 MAILBOX7; // c4h | Scratchpad 7 u32 ROM_Setup_Data; // c8h | Rom Setup and Data u32 ROM_Control_Addr; // cch | Rom Control and Address u32 reserved3[12]; // d0h-ffh | reserved u32 LUT[64]; // 100h-1ffh| Lookup Table Entries // // TO DO // need to add DMA, I2O, UART, etc registers form 80h to 364h //};#define Mailbox0 SaDbCSR.MAILBOX0#define Mailbox1 SaDbCSR.MAILBOX1#define Mailbox2 SaDbCSR.MAILBOX2#define Mailbox3 SaDbCSR.MAILBOX3#define Mailbox4 SaDbCSR.MAILBOX4#define Mailbox5 SaDbCSR.MAILBOX5#define Mailbox7 SaDbCSR.MAILBOX7 #define DoorbellReg_p SaDbCSR.PRISETIRQ#define DoorbellReg_s SaDbCSR.SECSETIRQ#define DoorbellClrReg_p SaDbCSR.PRICLEARIRQ#define DOORBELL_0 cpu_to_le16(0x0001)#define DOORBELL_1 cpu_to_le16(0x0002)#define DOORBELL_2 cpu_to_le16(0x0004)#define DOORBELL_3 cpu_to_le16(0x0008)#define DOORBELL_4 cpu_to_le16(0x0010)#define DOORBELL_5 cpu_to_le16(0x0020)#define DOORBELL_6 cpu_to_le16(0x0040) #define PrintfReady DOORBELL_5#define PrintfDone DOORBELL_5 struct sa_registers { struct sa_drawbridge_CSR SaDbCSR; /* 98h - c4h */}; #define Sa_MINIPORT_REVISION 1#define sa_readw(AEP, CSR) readl(&((AEP)->regs.sa->CSR))#define sa_readl(AEP, CSR) readl(&((AEP)->regs.sa->CSR))#define sa_writew(AEP, CSR, value) writew(value, &((AEP)->regs.sa->CSR))#define sa_writel(AEP, CSR, value) writel(value, &((AEP)->regs.sa->CSR))/* * Rx Message Unit Registers */struct rx_mu_registers { // Local | PCI* | Name // | | u32 ARSR; // 1300h | 00h | APIC Register Select Register u32 reserved0; // 1304h | 04h | Reserved u32 AWR; // 1308h | 08h | APIC Window Register u32 reserved1; // 130Ch | 0Ch | Reserved u32 IMRx[2]; // 1310h | 10h | Inbound Message Registers u32 OMRx[2]; // 1318h | 18h | Outbound Message Registers u32 IDR; // 1320h | 20h | Inbound Doorbell Register u32 IISR; // 1324h | 24h | Inbound Interrupt Status Register u32 IIMR; // 1328h | 28h | Inbound Interrupt Mask Register u32 ODR; // 132Ch | 2Ch | Outbound Doorbell Register u32 OISR; // 1330h | 30h | Outbound Interrupt Status Register u32 OIMR; // 1334h | 34h | Outbound Interrupt Mask Register // * Must access through ATU Inbound Translation Window};struct rx_inbound { u32 Mailbox[8];};#define InboundMailbox0 IndexRegs.Mailbox[0]#define InboundMailbox1 IndexRegs.Mailbox[1]#define InboundMailbox2 IndexRegs.Mailbox[2]#define InboundMailbox3 IndexRegs.Mailbox[3]#define InboundMailbox4 IndexRegs.Mailbox[4]#define InboundMailbox5 IndexRegs.Mailbox[5]#define InboundMailbox6 IndexRegs.Mailbox[6]#define InboundMailbox7 IndexRegs.Mailbox[7]#define INBOUNDDOORBELL_0 cpu_to_le32(0x00000001)#define INBOUNDDOORBELL_1 cpu_to_le32(0x00000002)#define INBOUNDDOORBELL_2 cpu_to_le32(0x00000004)#define INBOUNDDOORBELL_3 cpu_to_le32(0x00000008)#define INBOUNDDOORBELL_4 cpu_to_le32(0x00000010)#define INBOUNDDOORBELL_5 cpu_to_le32(0x00000020)#define INBOUNDDOORBELL_6 cpu_to_le32(0x00000040)#define OUTBOUNDDOORBELL_0 cpu_to_le32(0x00000001)#define OUTBOUNDDOORBELL_1 cpu_to_le32(0x00000002)#define OUTBOUNDDOORBELL_2 cpu_to_le32(0x00000004)#define OUTBOUNDDOORBELL_3 cpu_to_le32(0x00000008)#define OUTBOUNDDOORBELL_4 cpu_to_le32(0x00000010)#define InboundDoorbellReg MUnit.IDR#define OutboundDoorbellReg MUnit.ODRstruct rx_registers { struct rx_mu_registers MUnit; // 1300h - 1334h u32 reserved1[6]; // 1338h - 134ch struct rx_inbound IndexRegs;};#define rx_readb(AEP, CSR) readb(&((AEP)->regs.rx->CSR))#define rx_readl(AEP, CSR) readl(&((AEP)->regs.rx->CSR))#define rx_writeb(AEP, CSR, value) writeb(value, &((AEP)->regs.rx->CSR))#define rx_writel(AEP, CSR, value) writel(value, &((AEP)->regs.rx->CSR))/* * Rkt Message Unit Registers (same as Rx, except a larger reserve region) */#define rkt_mu_registers rx_mu_registers#define rkt_inbound rx_inboundstruct rkt_registers { struct rkt_mu_registers MUnit; /* 1300h - 1334h */ u32 reserved1[1010]; /* 1338h - 22fch */ struct rkt_inbound IndexRegs; /* 2300h - */};#define rkt_readb(AEP, CSR) readb(&((AEP)->regs.rkt->CSR))#define rkt_readl(AEP, CSR) readl(&((AEP)->regs.rkt->CSR))#define rkt_writeb(AEP, CSR, value) writeb(value, &((AEP)->regs.rkt->CSR))#define rkt_writel(AEP, CSR, value) writel(value, &((AEP)->regs.rkt->CSR))struct fib;typedef void (*fib_callback)(void *ctxt, struct fib *fibctx);struct aac_fib_context { s16 type; // used for verification of structure s16 size; u32 unique; // unique value representing this context ulong jiffies; // used for cleanup - dmb changed to ulong struct list_head next; // used to link context's into a linked list struct semaphore wait_sem; // this is used to wait for the next fib to arrive. int wait; // Set to true when thread is in WaitForSingleObject unsigned long count; // total number of FIBs on FibList struct list_head fib_list; // this holds fibs and their attachd hw_fibs};struct fsa_scsi_hba { u32 size[MAXIMUM_NUM_CONTAINERS]; u32 type[MAXIMUM_NUM_CONTAINERS]; u8 valid[MAXIMUM_NUM_CONTAINERS]; u8 ro[MAXIMUM_NUM_CONTAINERS]; u8 locked[MAXIMUM_NUM_CONTAINERS]; u8 deleted[MAXIMUM_NUM_CONTAINERS]; char devname[MAXIMUM_NUM_CONTAINERS][8];};struct fib { void *next; /* this is used by the allocator */ s16 type; s16 size; /* * The Adapter that this I/O is destined for. */ struct aac_dev *dev; /* * This is the event the sendfib routine will wait on if the * caller did not pass one and this is synch io. */ struct semaphore event_wait; spinlock_t event_lock; u32 done; /* gets set to 1 when fib is complete */ fib_callback callback; void *callback_data; u32 flags; // u32 dmb was ulong /* * The following is used to put this fib context onto the * Outstanding I/O queue. */ struct list_head queue; /* * And for the internal issue/reply queues (we may be able * to merge these two) */ struct list_head fiblink; void *data; struct hw_fib *hw_fib; /* Actual shared object */ dma_addr_t hw_fib_pa; /* physical address of hw_fib*/};/* * Adapter Information Block * * This is returned by the RequestAdapterInfo block */ struct aac_adapter_info{ u32 platform; u32 cpu; u32 subcpu; u32 clock; u32 execmem; u32 buffermem; u32 totalmem; u32 kernelrev; u32 kernelbuild; u32 monitorrev; u32 monitorbuild; u32 hwrev; u32 hwbuild; u32 biosrev; u32 biosbuild; u32 cluster; u32 clusterchannelmask; u32 serial[2]; u32 battery; u32 options; u32 OEM;};/* * Battery platforms */#define AAC_BAT_REQ_PRESENT (1)#define AAC_BAT_REQ_NOTPRESENT (2)#define AAC_BAT_OPT_PRESENT (3)#define AAC_BAT_OPT_NOTPRESENT (4)#define AAC_BAT_NOT_SUPPORTED (5)/* * cpu types */#define AAC_CPU_SIMULATOR (1)#define AAC_CPU_I960 (2)#define AAC_CPU_STRONGARM (3)/* * Supported Options */#define AAC_OPT_SNAPSHOT cpu_to_le32(1)#define AAC_OPT_CLUSTERS cpu_to_le32(1<<1)#define AAC_OPT_WRITE_CACHE cpu_to_le32(1<<2)#define AAC_OPT_64BIT_DATA cpu_to_le32(1<<3)#define AAC_OPT_HOST_TIME_FIB cpu_to_le32(1<<4)#define AAC_OPT_RAID50 cpu_to_le32(1<<5)#define AAC_OPT_4GB_WINDOW cpu_to_le32(1<<6)#define AAC_OPT_SCSI_UPGRADEABLE cpu_to_le32(1<<7)#define AAC_OPT_SOFT_ERR_REPORT cpu_to_le32(1<<8)#define AAC_OPT_SUPPORTED_RECONDITION cpu_to_le32(1<<9)#define AAC_OPT_SGMAP_HOST64 cpu_to_le32(1<<10)#define AAC_OPT_ALARM cpu_to_le32(1<<11)#define AAC_OPT_NONDASD cpu_to_le32(1<<12)struct aac_dev{ struct aac_dev *next; const char *name; int id; u16 irq_mask; /* * Map for 128 fib objects (64k) */ dma_addr_t hw_fib_pa; struct hw_fib *hw_fib_va; struct hw_fib *aif_base_va; /* * Fib Headers */ struct fib *fibs; struct fib *free_fib; struct fib *timeout_fib; spinlock_t fib_lock; struct aac_queue_block *queues; /* * The user API will use an IOCTL to register itself to receive * FIBs from the adapter. The following list is used to keep * track of all the threads that have requested these FIBs. The * mutex is used to synchronize access to all data associated * with the adapter fibs. */ struct list_head fib_list; struct adapter_ops a_ops; unsigned long fsrev; /* Main driver's revision number */ struct aac_init *init; /* Holds initialization info to communicate with adapter */ dma_addr_t init_pa; /* Holds physical address of the init struct */ struct pci_dev *pdev; /* Our PCI interface */ void * printfbuf; /* pointer to buffer used for printf's from the adapter */ void * comm_addr; /* Base address of Comm area */ dma_addr_t comm_phys; /* Physical Address of Comm area */ size_t comm_size; struct Scsi_Host *scsi_host_ptr; struct fsa_scsi_hba fsa_dev; pid_t thread_pid; int cardtype; /* * The following is the device specific extension. */ union { struct sa_registers *sa; struct rx_registers *rx; struct rkt_registers *rkt; } regs; u32 OIMR; /* Mask Register Cache */ /* * AIF thread states */ u32 aif_thread; struct completion aif_completion; struct aac_adapter_info adapter_info; /* These are in adapter info but they are in the io flow so * lets break them out so we don't have to do an AND to check them */ u8 nondasd_support; u8 pae_support;};#define AllocateAndMapFibSpace(dev, MapFibContext) \ (dev)->a_ops.AllocateAndMapFibSpace(dev, MapFibContext)#define UnmapAndFreeFibSpace(dev, MapFibContext) \ (dev)->a_ops.UnmapAndFreeFibSpace(dev, MapFibContext)#define aac_adapter_interrupt(dev) \ (dev)->a_ops.adapter_interrupt(dev)#define aac_adapter_notify(dev, event) \ (dev)->a_ops.adapter_notify(dev, event)#define aac_adapter_enable_int(dev, event) \ (dev)->a_ops.adapter_enable_int(dev, event)#define aac_adapter_disable_int(dev, event) \ dev->a_ops.adapter_disable_int(dev, event)#define aac_adapter_check_health(dev) \ (dev)->a_ops.adapter_check_health(dev)#define FIB_CONTEXT_FLAG_TIMED_OUT (0x00000001)/* * Define the command values */ #define Null 0#define GetAttributes 1#define SetAttributes 2#define Lookup 3#define ReadLink 4#define Read 5#define Write 6#define Create 7#define MakeDirectory 8#define SymbolicLink 9#define MakeNode 10#define Removex 11#define RemoveDirectoryx 12#define Rename 13#define Link 14#define ReadDirectory 15#define ReadDirectoryPlus 16#define FileSystemStatus 17#define FileSystemInfo 18#define PathConfigure 19#define Commit 20#define Mount 21#define UnMount 22#define Newfs 23#define FsCheck 24#define FsSync 25#define SimReadWrite 26#define SetFileSystemStatus 27#define BlockRead 28#define BlockWrite 29#define NvramIoctl 30#define FsSyncWait 31#define ClearArchiveBit 32#define SetAcl 33#define GetAcl 34#define AssignAcl 35#define FaultInsertion 36 /* Fault Insertion Command */#define CrazyCache 37 /* Crazycache */#define MAX_FSACOMMAND_NUM 38/* * Define the status returns. These are very unixlike although * most are not in fact used */#define ST_OK 0#define ST_PERM 1#define ST_NOENT 2#define ST_IO 5#define ST_NXIO 6#define ST_E2BIG 7#define ST_ACCES 13#define ST_EXIST 17#define ST_XDEV 18#define ST_NODEV 19#define ST_NOTDIR 20#define ST_ISDIR 21#define ST_INVAL 22#define ST_FBIG 27#define ST_NOSPC 28#define ST_ROFS 30#define ST_MLINK 31#define ST_WOULDBLOCK 35#define ST_NAMETOOLONG 63#define ST_NOTEMPTY 66#define ST_DQUOT 69#define ST_STALE 70#define ST_REMOTE 71#define ST_BADHANDLE 10001#define ST_NOT_SYNC 10002#define ST_BAD_COOKIE 10003#define ST_NOTSUPP 10004#define ST_TOOSMALL 10005#define ST_SERVERFAULT 10006#define ST_BADTYPE 10007#define ST_JUKEBOX 10008#define ST_NOTMOUNTED 10009#define ST_MAINTMODE 10010#define ST_STALEACL 10011/* * On writes how does the client want the data written. */#define CACHE_CSTABLE 1#define CACHE_UNSTABLE 2/* * Lets the client know at which level the data was commited on * a write request */#define CMFILE_SYNCH_NVRAM 1#define CMDATA_SYNCH_NVRAM 2#define CMFILE_SYNCH 3#define CMDATA_SYNCH 4#define CMUNSTABLE 5struct aac_read{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -