aacraid.h
来自「linux 内核源代码」· C头文件 代码 · 共 1,875 行 · 第 1/4 页
H
1,875 行
int (*adapter_bounds)(struct aac_dev * dev, struct scsi_cmnd * cmd, u64 lba); int (*adapter_read)(struct fib * fib, struct scsi_cmnd * cmd, u64 lba, u32 count); int (*adapter_write)(struct fib * fib, struct scsi_cmnd * cmd, u64 lba, u32 count, int fua); int (*adapter_scsi)(struct fib * fib, struct scsi_cmnd * cmd); /* Administrative operations */ int (*adapter_comm)(struct aac_dev * dev, int comm);};/* * Define which interrupt handler needs to be installed */struct aac_driver_ident{ int (*init)(struct aac_dev *dev); char * name; char * vname; char * model; u16 channels; int quirks;};/* * Some adapter firmware needs communication memory * below 2gig. This tells the init function to set the * dma mask such that fib memory will be allocated where the * adapter firmware can get to it. */#define AAC_QUIRK_31BIT 0x0001/* * Some adapter firmware, when the raid card's cache is turned off, can not * split up scatter gathers in order to deal with the limits of the * underlying CHIM. This limit is 34 scatter gather elements. */#define AAC_QUIRK_34SG 0x0002/* * This adapter is a slave (no Firmware) */#define AAC_QUIRK_SLAVE 0x0004/* * This adapter is a master. */#define AAC_QUIRK_MASTER 0x0008/* * Some adapter firmware perform poorly when it must split up scatter gathers * in order to deal with the limits of the underlying CHIM. This limit in this * class of adapters is 17 scatter gather elements. */#define AAC_QUIRK_17SG 0x0010/* * The adapter interface specs all queues to be located in the same * physically contigous block. The host structure that defines the * commuication queues will assume they are each a separate physically * contigous memory region that will support them all being one big * contigous block. * There is a command and response queue for each level and direction of * commuication. These regions are accessed by both the host and adapter. */ struct aac_queue { u64 logical; /*address we give the adapter */ struct aac_entry *base; /*system virtual address */ struct aac_qhdr headers; /*producer,consumer q headers*/ u32 entries; /*Number of queue entries */ wait_queue_head_t qfull; /*Event to wait on if q full */ wait_queue_head_t cmdready; /*Cmd ready from the adapter */ /* This is only valid for adapter to host command queues. */ spinlock_t *lock; /* Spinlock for this queue must take this lock before accessing the lock */ spinlock_t lockdata; /* Actual lock (used only on one side of the lock) */ struct list_head cmdq; /* A queue of FIBs which need to be prcessed by the FS thread. This is */ /* only valid for command queues which receive entries from the adapter. */ u32 numpending; /* Number of entries on outstanding queue. */ struct aac_dev * dev; /* Back pointer to adapter structure */};/* * Message queues. The order here is important, see also the * queue type ordering */struct aac_queue_block{ struct aac_queue queue[8];};/* * SaP1 Message Unit Registers */ struct sa_drawbridge_CSR { /* Offset | Name */ __le32 reserved[10]; /* 00h-27h | Reserved */ u8 LUT_Offset; /* 28h | Lookup Table Offset */ u8 reserved1[3]; /* 29h-2bh | Reserved */ __le32 LUT_Data; /* 2ch | Looup Table Data */ __le32 reserved2[26]; /* 30h-97h | Reserved */ __le16 PRICLEARIRQ; /* 98h | Primary Clear Irq */ __le16 SECCLEARIRQ; /* 9ah | Secondary Clear Irq */ __le16 PRISETIRQ; /* 9ch | Primary Set Irq */ __le16 SECSETIRQ; /* 9eh | Secondary Set Irq */ __le16 PRICLEARIRQMASK;/* a0h | Primary Clear Irq Mask */ __le16 SECCLEARIRQMASK;/* a2h | Secondary Clear Irq Mask */ __le16 PRISETIRQMASK; /* a4h | Primary Set Irq Mask */ __le16 SECSETIRQMASK; /* a6h | Secondary Set Irq Mask */ __le32 MAILBOX0; /* a8h | Scratchpad 0 */ __le32 MAILBOX1; /* ach | Scratchpad 1 */ __le32 MAILBOX2; /* b0h | Scratchpad 2 */ __le32 MAILBOX3; /* b4h | Scratchpad 3 */ __le32 MAILBOX4; /* b8h | Scratchpad 4 */ __le32 MAILBOX5; /* bch | Scratchpad 5 */ __le32 MAILBOX6; /* c0h | Scratchpad 6 */ __le32 MAILBOX7; /* c4h | Scratchpad 7 */ __le32 ROM_Setup_Data; /* c8h | Rom Setup and Data */ __le32 ROM_Control_Addr;/* cch | Rom Control and Address */ __le32 reserved3[12]; /* d0h-ffh | reserved */ __le32 LUT[64]; /* 100h-1ffh | Lookup Table Entries */};#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 Mailbox6 SaDbCSR.MAILBOX6#define Mailbox7 SaDbCSR.MAILBOX7 #define DoorbellReg_p SaDbCSR.PRISETIRQ#define DoorbellReg_s SaDbCSR.SECSETIRQ#define DoorbellClrReg_p SaDbCSR.PRICLEARIRQ#define DOORBELL_0 0x0001#define DOORBELL_1 0x0002#define DOORBELL_2 0x0004#define DOORBELL_3 0x0008#define DOORBELL_4 0x0010#define DOORBELL_5 0x0020#define DOORBELL_6 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 */ __le32 ARSR; /* 1300h | 00h | APIC Register Select Register */ __le32 reserved0; /* 1304h | 04h | Reserved */ __le32 AWR; /* 1308h | 08h | APIC Window Register */ __le32 reserved1; /* 130Ch | 0Ch | Reserved */ __le32 IMRx[2]; /* 1310h | 10h | Inbound Message Registers */ __le32 OMRx[2]; /* 1318h | 18h | Outbound Message Registers */ __le32 IDR; /* 1320h | 20h | Inbound Doorbell Register */ __le32 IISR; /* 1324h | 24h | Inbound Interrupt Status Register */ __le32 IIMR; /* 1328h | 28h | Inbound Interrupt Mask Register */ __le32 ODR; /* 132Ch | 2Ch | Outbound Doorbell Register */ __le32 OISR; /* 1330h | 30h | Outbound Interrupt Status Register */ __le32 OIMR; /* 1334h | 34h | Outbound Interrupt Mask Register */ __le32 reserved2; /* 1338h | 38h | Reserved */ __le32 reserved3; /* 133Ch | 3Ch | Reserved */ __le32 InboundQueue;/* 1340h | 40h | Inbound Queue Port relative to firmware */ __le32 OutboundQueue;/*1344h | 44h | Outbound Queue Port relative to firmware */ /* * Must access through ATU Inbound Translation Window */};struct rx_inbound { __le32 Mailbox[8];};#define INBOUNDDOORBELL_0 0x00000001#define INBOUNDDOORBELL_1 0x00000002#define INBOUNDDOORBELL_2 0x00000004#define INBOUNDDOORBELL_3 0x00000008#define INBOUNDDOORBELL_4 0x00000010#define INBOUNDDOORBELL_5 0x00000020#define INBOUNDDOORBELL_6 0x00000040#define OUTBOUNDDOORBELL_0 0x00000001#define OUTBOUNDDOORBELL_1 0x00000002#define OUTBOUNDDOORBELL_2 0x00000004#define OUTBOUNDDOORBELL_3 0x00000008#define OUTBOUNDDOORBELL_4 0x00000010#define InboundDoorbellReg MUnit.IDR#define OutboundDoorbellReg MUnit.ODRstruct rx_registers { struct rx_mu_registers MUnit; /* 1300h - 1344h */ __le32 reserved1[2]; /* 1348h - 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 - 1344h */ __le32 reserved1[1006]; /* 1348h - 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))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 sense_data { u8 error_code; /* 70h (current errors), 71h(deferred errors) */ u8 valid:1; /* A valid bit of one indicates that the information */ /* field contains valid information as defined in the * SCSI-2 Standard. */ u8 segment_number; /* Only used for COPY, COMPARE, or COPY AND VERIFY Commands */ u8 sense_key:4; /* Sense Key */ u8 reserved:1; u8 ILI:1; /* Incorrect Length Indicator */ u8 EOM:1; /* End Of Medium - reserved for random access devices */ u8 filemark:1; /* Filemark - reserved for random access devices */ u8 information[4]; /* for direct-access devices, contains the unsigned * logical block address or residue associated with * the sense key */ u8 add_sense_len; /* number of additional sense bytes to follow this field */ u8 cmnd_info[4]; /* not used */ u8 ASC; /* Additional Sense Code */ u8 ASCQ; /* Additional Sense Code Qualifier */ u8 FRUC; /* Field Replaceable Unit Code - not used */ u8 bit_ptr:3; /* indicates which byte of the CDB or parameter data * was in error */ u8 BPV:1; /* bit pointer valid (BPV): 1- indicates that * the bit_ptr field has valid value */ u8 reserved2:2; u8 CD:1; /* command data bit: 1- illegal parameter in CDB. * 0- illegal parameter in data. */ u8 SKSV:1; u8 field_ptr[2]; /* byte of the CDB or parameter data in error */};struct fsa_dev_info { u64 last; u64 size; u32 type; u32 config_waiting_on; unsigned long config_waiting_stamp; u16 queue_depth; u8 config_needed; u8 valid; u8 ro; u8 locked; u8 deleted; char devname[8]; struct sense_data sense_data;};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 /* * 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_va; /* 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{ __le32 platform; __le32 cpu; __le32 subcpu; __le32 clock; __le32 execmem; __le32 buffermem; __le32 totalmem; __le32 kernelrev; __le32 kernelbuild; __le32 monitorrev; __le32 monitorbuild; __le32 hwrev; __le32 hwbuild; __le32 biosrev; __le32 biosbuild; __le32 cluster; __le32 clusterchannelmask; __le32 serial[2]; __le32 battery; __le32 options; __le32 OEM;};struct aac_supplement_adapter_info{ u8 AdapterTypeText[17+1]; u8 Pad[2]; __le32 FlashMemoryByteSize; __le32 FlashImageId; __le32 MaxNumberPorts; __le32 Version; __le32 FeatureBits; u8 SlotNumber; u8 ReservedPad0[3]; u8 BuildDate[12]; __le32 CurrentNumberPorts; struct { u8 AssemblyPn[8]; u8 FruPn[8]; u8 BatteryFruPn[8]; u8 EcVersionString[8]; u8 Tsid[12]; } VpdInfo; __le32 FlashFirmwareRevision; __le32 FlashFirmwareBuild; __le32 RaidTypeMorphOptions; __le32 FlashFirmwareBootRevision; __le32 FlashFirmwareBootBuild; u8 MfgPcbaSerialNo[12]; u8 MfgWWNName[8]; __le32 SupportedOptions2; __le32 ReservedGrowth[1];};#define AAC_FEATURE_FALCON 0x00000010#define AAC_OPTION_MU_RESET 0x00000001#define AAC_OPTION_IGNORE_RESET 0x00000002#define AAC_SIS_VERSION_V3 3#define AAC_SIS_SLOT_UNKNOWN 0xFF#define GetBusInfo 0x00000009struct aac_bus_info { __le32 Command; /* VM_Ioctl */ __le32 ObjType; /* FT_DRIVE */ __le32 MethodId; /* 1 = SCSI Layer */ __le32 ObjectId; /* Handle */ __le32 CtlCmd; /* GetBusInfo */};struct aac_bus_info_response { __le32 Status; /* ST_OK */ __le32 ObjType; __le32 MethodId; /* unused */ __le32 ObjectId; /* unused */ __le32 CtlCmd; /* unused */ __le32 ProbeComplete; __le32 BusCount; __le32 TargetsPerBus; u8 InitiatorBusId[10]; u8 BusValid[10];};/* * 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)#define AAC_OPT_SCSI_MANAGED cpu_to_le32(1<<13)#define AAC_OPT_RAID_SCSI_MODE cpu_to_le32(1<<14)#define AAC_OPT_SUPPLEMENT_ADAPTER_INFO cpu_to_le32(1<<16)#define AAC_OPT_NEW_COMM cpu_to_le32(1<<17)#define AAC_OPT_NEW_COMM_64 cpu_to_le32(1<<18)struct aac_dev{ struct list_head entry; const char *name; int id; /* * negotiated FIB settings
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?