#ifndef _VIAPRVDEF_H #define _VIAPRVDEF_H #define VENDOR_ID 0x1106 //Maximum adapters the program support //adapters is equal to channel here. #define MAXADAPTERS 4 #define DISKPERADAPTER 2 #define MAXDISKS DISKPERADAPTER*MAXADAPTERS // max number of device extension #define MAXCONTROLLER 4 #ifndef MULTIPLE_CARD_SUPPORT #if defined VT_3149 #define PROC_DIR_NAME "viasraid" #define DEVICE_ID 0x3149 #elif defined VT_3164 #define PROC_DIR_NAME "viaraid" #define DEVICE_ID 0x3164 #elif defined VT_3249 #define PROC_DIR_NAME "viasprid" #define DEVICE_ID 0x3249 #endif #else //MULTIPLE_CARD_SUPPORT #define PROC_DIR_NAME "viamraid" #define MAX_CARD_TYPE 3 #endif //MULTIPLE_CARD_SUPPORT #define VIA_MAX_CMDS 0x10 #define SCSI_STATUS_SUCCESS 0x01 #define SCSI_STATUS_SELECTION_TIMEOUT 0x0A #define MAXDATABUFFER 0x20000 #define _VERSIONINFO "Linux driver Version 1.00 \n" //max sub SCSI command to be send in one RAID SCSI command //#define MAXSUBCOMMAND 80 // Max descriptor number in PRD table #define MAX_DESCRIPTOR_NUMBER 20 extern void viaraid_intrrupt(int irq,void *dev_id,struct pt_regs *regs); extern int process_Abort (Scsi_Cmnd *SCpnt); extern int Driver_Free(); extern int Release_Fun (void* index); extern unsigned char get_head_number(ULONG capacity); extern int get_busy_state(); extern void set_busy_state(int state); typedef struct _CMDINFO { void * index; unsigned long target; unsigned long lun; unsigned char cmd_len; unsigned long request_bufflen; unsigned char sc_data_direction; void* request_buffer; void* sense_buffer; unsigned char cmnd[16]; } CmdInfo; typedef struct _PCIINFO { unsigned char busnumber; unsigned char devnumber; unsigned char funnumber; int baseioaddr1[2]; int baseioaddr2[2]; int irq; int dmaaddr[2]; //#ifdef VT3149 int sata_base_addr; //#endif }PCIINFO; typedef struct _MEMALLOCINFO { void* psyncveryfybuf[2]; void* pdiskinfo; void* pallignbuf; void* pdiskraidcfg; void* padapterinfo; void* pdrbuf[2]; PCIINFO PciInfo; }mem_alloc_info; // function prototypes int viaraid_Detect (Scsi_Host_Template *tpnt); int viaraid_Command (Scsi_Cmnd *SCpnt); int viaraid_QueueCommand (Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)); //int viaraid_Abort (Scsi_Cmnd *SCpnt); //int viaraid_Reset (Scsi_Cmnd *SCpnt, unsigned int flags); int viaraid_Release (struct Scsi_Host *pshost); int viaraid_BiosParam (Disk *disk, kdev_t dev, int geom[]); int viaraid_ProcInfo (char *buffer, char **start, off_t offset, int length, int hostno, int inout); #define VIACTRL {\ proc_name: PROC_DIR_NAME,\ proc_info: viaraid_ProcInfo,\ name: PROC_DIR_NAME,\ detect: viaraid_Detect, \ release: viaraid_Release, \ command: viaraid_Command, \ queuecommand: viaraid_QueueCommand,\ bios_param: viaraid_BiosParam, \ can_queue: VIA_MAX_CMDS, \ this_id: -1, \ sg_tablesize: SG_NONE, \ cmd_per_lun: 1, \ present: 0, \ unchecked_isa_dma: 0, \ use_clustering: DISABLE_CLUSTERING, \ use_new_eh_code: 1 \ } extern int Init_Func( struct pci_dev *pPciDev,void * de); extern unsigned int GlobalAdapterIndex; //#define VIARAID_DEBUG #define DbgPrint DEBUG_PRINT #define _Debug_Printf_Service DEBUG_PRINT #define MyDbgPrint DEBUG_PRINT #ifdef VIARAID_DEBUG #define DEBUG_PRINT printk #else #define DEBUG_PRINT(...) #endif #undef MyDbgPrint #define MyDbgPrint(...) #endif