📄 aacraid.h
字号:
u32 command; u32 cid; u32 block; u32 count; struct sgmap sg; // Must be last in struct because it is variable};struct aac_read64{ u32 command; u16 cid; u16 sector_count; u32 block; u16 pad; u16 flags; struct sgmap64 sg; // Must be last in struct because it is variable};struct aac_read_reply{ u32 status; u32 count;};struct aac_write{ u32 command; u32 cid; u32 block; u32 count; u32 stable; // Not used struct sgmap sg; // Must be last in struct because it is variable};struct aac_write64{ u32 command; u16 cid; u16 sector_count; u32 block; u16 pad; u16 flags; struct sgmap64 sg; // Must be last in struct because it is variable};struct aac_write_reply{ u32 status; u32 count; u32 committed;};struct aac_srb{ u32 function; u32 channel; u32 id; u32 lun; u32 timeout; u32 flags; u32 count; // Data xfer size u32 retry_limit; u32 cdb_size; u8 cdb[16]; struct sgmap sg;};#define AAC_SENSE_BUFFERSIZE 30struct aac_srb_reply{ u32 status; u32 srb_status; u32 scsi_status; u32 data_xfer_length; u32 sense_data_size; u8 sense_data[AAC_SENSE_BUFFERSIZE]; // Can this be SCSI_SENSE_BUFFERSIZE};/* * SRB Flags */#define SRB_NoDataXfer 0x0000#define SRB_DisableDisconnect 0x0004#define SRB_DisableSynchTransfer 0x0008#define SRB_BypassFrozenQueue 0x0010#define SRB_DisableAutosense 0x0020#define SRB_DataIn 0x0040#define SRB_DataOut 0x0080/* * SRB Functions - set in aac_srb->function */#define SRBF_ExecuteScsi 0x0000#define SRBF_ClaimDevice 0x0001#define SRBF_IO_Control 0x0002#define SRBF_ReceiveEvent 0x0003#define SRBF_ReleaseQueue 0x0004#define SRBF_AttachDevice 0x0005#define SRBF_ReleaseDevice 0x0006#define SRBF_Shutdown 0x0007#define SRBF_Flush 0x0008#define SRBF_AbortCommand 0x0010#define SRBF_ReleaseRecovery 0x0011#define SRBF_ResetBus 0x0012#define SRBF_ResetDevice 0x0013#define SRBF_TerminateIO 0x0014#define SRBF_FlushQueue 0x0015#define SRBF_RemoveDevice 0x0016#define SRBF_DomainValidation 0x0017/* * SRB SCSI Status - set in aac_srb->scsi_status */#define SRB_STATUS_PENDING 0x00#define SRB_STATUS_SUCCESS 0x01#define SRB_STATUS_ABORTED 0x02#define SRB_STATUS_ABORT_FAILED 0x03#define SRB_STATUS_ERROR 0x04#define SRB_STATUS_BUSY 0x05#define SRB_STATUS_INVALID_REQUEST 0x06#define SRB_STATUS_INVALID_PATH_ID 0x07#define SRB_STATUS_NO_DEVICE 0x08#define SRB_STATUS_TIMEOUT 0x09#define SRB_STATUS_SELECTION_TIMEOUT 0x0A#define SRB_STATUS_COMMAND_TIMEOUT 0x0B#define SRB_STATUS_MESSAGE_REJECTED 0x0D#define SRB_STATUS_BUS_RESET 0x0E#define SRB_STATUS_PARITY_ERROR 0x0F#define SRB_STATUS_REQUEST_SENSE_FAILED 0x10#define SRB_STATUS_NO_HBA 0x11#define SRB_STATUS_DATA_OVERRUN 0x12#define SRB_STATUS_UNEXPECTED_BUS_FREE 0x13#define SRB_STATUS_PHASE_SEQUENCE_FAILURE 0x14#define SRB_STATUS_BAD_SRB_BLOCK_LENGTH 0x15#define SRB_STATUS_REQUEST_FLUSHED 0x16#define SRB_STATUS_DELAYED_RETRY 0x17#define SRB_STATUS_INVALID_LUN 0x20#define SRB_STATUS_INVALID_TARGET_ID 0x21#define SRB_STATUS_BAD_FUNCTION 0x22#define SRB_STATUS_ERROR_RECOVERY 0x23#define SRB_STATUS_NOT_STARTED 0x24#define SRB_STATUS_NOT_IN_USE 0x30#define SRB_STATUS_FORCE_ABORT 0x31#define SRB_STATUS_DOMAIN_VALIDATION_FAIL 0x32/* * Object-Server / Volume-Manager Dispatch Classes */#define VM_Null 0#define VM_NameServe 1#define VM_ContainerConfig 2#define VM_Ioctl 3#define VM_FilesystemIoctl 4#define VM_CloseAll 5#define VM_CtBlockRead 6#define VM_CtBlockWrite 7#define VM_SliceBlockRead 8 /* raw access to configured "storage objects" */#define VM_SliceBlockWrite 9#define VM_DriveBlockRead 10 /* raw access to physical devices */#define VM_DriveBlockWrite 11#define VM_EnclosureMgt 12 /* enclosure management */#define VM_Unused 13 /* used to be diskset management */#define VM_CtBlockVerify 14#define VM_CtPerf 15 /* performance test */#define VM_CtBlockRead64 16#define VM_CtBlockWrite64 17#define VM_CtBlockVerify64 18#define VM_CtHostRead64 19#define VM_CtHostWrite64 20#define MAX_VMCOMMAND_NUM 21 /* used for sizing stats array - leave last *//* * Descriptive information (eg, vital stats) * that a content manager might report. The * FileArray filesystem component is one example * of a content manager. Raw mode might be * another. */struct aac_fsinfo { u32 fsTotalSize; /* Consumed by fs, incl. metadata */ u32 fsBlockSize; u32 fsFragSize; u32 fsMaxExtendSize; u32 fsSpaceUnits; u32 fsMaxNumFiles; u32 fsNumFreeFiles; u32 fsInodeDensity;}; /* valid iff ObjType == FT_FILESYS && !(ContentState & FSCS_NOTCLEAN) */union aac_contentinfo { struct aac_fsinfo filesys; /* valid iff ObjType == FT_FILESYS && !(ContentState & FSCS_NOTCLEAN) */};/* * Query for "mountable" objects, ie, objects that are typically * associated with a drive letter on the client (host) side. */struct aac_mntent { u32 oid; u8 name[16]; // if applicable struct creation_info create_info; // if applicable u32 capacity; u32 vol; // substrate structure u32 obj; // FT_FILESYS, FT_DATABASE, etc. u32 state; // unready for mounting, readonly, etc. union aac_contentinfo fileinfo; // Info specific to content manager (eg, filesystem) u32 altoid; // != oid <==> snapshot or broken mirror exists};#define FSCS_NOTCLEAN 0x0001 /* fsck is neccessary before mounting */#define FSCS_READONLY 0x0002 /* possible result of broken mirror */#define FSCS_HIDDEN 0x0004 /* should be ignored - set during a clear */struct aac_query_mount { u32 command; u32 type; u32 count;};struct aac_mount { u32 status; u32 type; /* should be same as that requested */ u32 count; struct aac_mntent mnt[1];};/* * The following command is sent to shut down each container. */struct aac_close { u32 command; u32 cid;};struct aac_query_disk{ s32 cnum; s32 bus; s32 id; s32 lun; u32 valid; u32 locked; u32 deleted; s32 instance; s8 name[10]; u32 unmapped;};struct aac_delete_disk { u32 disknum; u32 cnum;}; struct fib_ioctl{ u32 fibctx; s32 wait; char __user *fib;};struct revision{ u32 compat; u32 version; u32 build;}; /* * Ugly - non Linux like ioctl coding for back compat. */#define CTL_CODE(function, method) ( \ (4<< 16) | ((function) << 2) | (method) \)/* * Define the method codes for how buffers are passed for I/O and FS * controls */#define METHOD_BUFFERED 0#define METHOD_NEITHER 3/* * Filesystem ioctls */#define FSACTL_SENDFIB CTL_CODE(2050, METHOD_BUFFERED)#define FSACTL_SEND_RAW_SRB CTL_CODE(2067, METHOD_BUFFERED)#define FSACTL_DELETE_DISK 0x163#define FSACTL_QUERY_DISK 0x173#define FSACTL_OPEN_GET_ADAPTER_FIB CTL_CODE(2100, METHOD_BUFFERED)#define FSACTL_GET_NEXT_ADAPTER_FIB CTL_CODE(2101, METHOD_BUFFERED)#define FSACTL_CLOSE_GET_ADAPTER_FIB CTL_CODE(2102, METHOD_BUFFERED)#define FSACTL_MINIPORT_REV_CHECK CTL_CODE(2107, METHOD_BUFFERED)#define FSACTL_GET_PCI_INFO CTL_CODE(2119, METHOD_BUFFERED)#define FSACTL_FORCE_DELETE_DISK CTL_CODE(2120, METHOD_NEITHER)#define FSACTL_GET_CONTAINERS 2131struct aac_common{ /* * If this value is set to 1 then interrupt moderation will occur * in the base commuication support. */ u32 irq_mod; u32 peak_fibs; u32 zero_fibs; u32 fib_timeouts; /* * Statistical counters in debug mode */#ifdef DBG u32 FibsSent; u32 FibRecved; u32 NoResponseSent; u32 NoResponseRecved; u32 AsyncSent; u32 AsyncRecved; u32 NormalSent; u32 NormalRecved;#endif};extern struct aac_common aac_config;/* * The following macro is used when sending and receiving FIBs. It is * only used for debugging. */ #ifdef DBG#define FIB_COUNTER_INCREMENT(counter) (counter)++#else#define FIB_COUNTER_INCREMENT(counter) #endif/* * Adapter direct commands * Monitor/Kernel API */#define BREAKPOINT_REQUEST cpu_to_le32(0x00000004)#define INIT_STRUCT_BASE_ADDRESS cpu_to_le32(0x00000005)#define READ_PERMANENT_PARAMETERS cpu_to_le32(0x0000000a)#define WRITE_PERMANENT_PARAMETERS cpu_to_le32(0x0000000b)#define HOST_CRASHING cpu_to_le32(0x0000000d)#define SEND_SYNCHRONOUS_FIB cpu_to_le32(0x0000000c)#define COMMAND_POST_RESULTS cpu_to_le32(0x00000014)#define GET_ADAPTER_PROPERTIES cpu_to_le32(0x00000019)#define RE_INIT_ADAPTER cpu_to_le32(0x000000ee)/* * Adapter Status Register * * Phase Staus mailbox is 32bits: * <31:16> = Phase Status * <15:0> = Phase * * The adapter reports is present state through the phase. Only * a single phase should be ever be set. Each phase can have multiple * phase status bits to provide more detailed information about the * state of the board. Care should be taken to ensure that any phase * status bits that are set when changing the phase are also valid * for the new phase or be cleared out. Adapter software (monitor, * iflash, kernel) is responsible for properly maintining the phase * status mailbox when it is running. * * MONKER_API Phases * * Phases are bit oriented. It is NOT valid to have multiple bits set */ #define SELF_TEST_FAILED (cpu_to_le32(0x00000004))#define MONITOR_PANIC (cpu_to_le32(0x00000020))#define KERNEL_UP_AND_RUNNING (cpu_to_le32(0x00000080))#define KERNEL_PANIC (cpu_to_le32(0x00000100))/* * Doorbell bit defines */#define DoorBellSyncCmdAvailable cpu_to_le32(1<<0) // Host -> Adapter#define DoorBellPrintfDone cpu_to_le32(1<<5) // Host -> Adapter#define DoorBellAdapterNormCmdReady cpu_to_le32(1<<1) // Adapter -> Host#define DoorBellAdapterNormRespReady cpu_to_le32(1<<2) // Adapter -> Host#define DoorBellAdapterNormCmdNotFull cpu_to_le32(1<<3) // Adapter -> Host#define DoorBellAdapterNormRespNotFull cpu_to_le32(1<<4) // Adapter -> Host#define DoorBellPrintfReady cpu_to_le32(1<<5) // Adapter -> Host/* * For FIB communication, we need all of the following things * to send back to the user. */ #define AifCmdEventNotify 1 /* Notify of event */#define AifEnConfigChange 3 /* Adapter configuration change */#define AifEnContainerChange 4 /* Container configuration change */#define AifEnDeviceFailure 5 /* SCSI device failed */#define AifEnAddContainer 15 /* A new array was created */#define AifEnDeleteContainer 16 /* A container was deleted */#define AifEnExpEvent 23 /* Firmware Event Log */#define AifExeFirmwarePanic 3 /* Firmware Event Panic */#define AifHighPriority 3 /* Highest Priority Event */#define AifCmdJobProgress 2 /* Progress report */#define AifJobCtrZero 101 /* Array Zero progress */#define AifJobStsSuccess 1 /* Job completes */#define AifCmdAPIReport 3 /* Report from other user of API */#define AifCmdDriverNotify 4 /* Notify host driver of event */#define AifDenMorphComplete 200 /* A morph operation completed */#define AifDenVolumeExtendComplete 201 /* A volume extend completed */#define AifReqJobList 100 /* Gets back complete job list */#define AifReqJobsForCtr 101 /* Gets back jobs for specific container */#define AifReqJobsForScsi 102 /* Gets back jobs for specific SCSI device */ #define AifReqJobReport 103 /* Gets back a specific job report or list of them */ #define AifReqTerminateJob 104 /* Terminates job */#define AifReqSuspendJob 105 /* Suspends a job */#define AifReqResumeJob 106 /* Resumes a job */ #define AifReqSendAPIReport 107 /* API generic report requests */#define AifReqAPIJobStart 108 /* Start a job from the API */#define AifReqAPIJobUpdate 109 /* Update a job report from the API */#define AifReqAPIJobFinish 110 /* Finish a job from the API *//* * Adapter Initiated FIB command structures. Start with the adapter * initiated FIBs that really come from the adapter, and get responded * to by the host. */struct aac_aifcmd { u32 command; /* Tell host what type of notify this is */ u32 seqnum; /* To allow ordering of reports (if necessary) */ u8 data[1]; /* Undefined length (from kernel viewpoint) */};/** * Convert capacity to cylinders * accounting for the fact capacity could be a 64 bit value * */static inline u32 cap_to_cyls(sector_t capacity, u32 divisor){ sector_div(capacity, divisor); return (u32)capacity;}struct scsi_cmnd;const char *aac_driverinfo(struct Scsi_Host *);struct fib *fib_alloc(struct aac_dev *dev);int fib_setup(struct aac_dev *dev);void fib_map_free(struct aac_dev *dev);void fib_free(struct fib * context);void fib_init(struct fib * context);void fib_dealloc(struct fib * context);void aac_printf(struct aac_dev *dev, u32 val);int fib_send(u16 command, struct fib * context, unsigned long size, int priority, int wait, int reply, fib_callback callback, void *ctxt);int aac_consumer_get(struct aac_dev * dev, struct aac_queue * q, struct aac_entry **entry);int aac_consumer_avail(struct aac_dev * dev, struct aac_queue * q);void aac_consumer_free(struct aac_dev * dev, struct aac_queue * q, u32 qnum);int fib_complete(struct fib * context);#define fib_data(fibctx) ((void *)(fibctx)->hw_fib->data)struct aac_dev *aac_init_adapter(struct aac_dev *dev);int aac_get_containers(struct aac_dev *dev);int aac_scsi_cmd(struct scsi_cmnd *cmd);int aac_dev_ioctl(struct aac_dev *dev, int cmd, void __user *arg);int aac_do_ioctl(struct aac_dev * dev, int cmd, void __user *arg);int aac_rx_init(struct aac_dev *dev);int aac_rkt_init(struct aac_dev *dev);int aac_sa_init(struct aac_dev *dev);unsigned int aac_response_normal(struct aac_queue * q);unsigned int aac_command_normal(struct aac_queue * q);int aac_command_thread(struct aac_dev * dev);int aac_close_fib_context(struct aac_dev * dev, struct aac_fib_context *fibctx);int fib_adapter_complete(struct fib * fibptr, unsigned short size);struct aac_driver_ident* aac_get_driver_ident(int devtype);int aac_get_adapter_info(struct aac_dev* dev);int aac_send_shutdown(struct aac_dev *dev);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -