typedef u32 UINT; /* 32 bits */
typedef unsigned long ULONG; /* 32/64 bits */
+typedef UCHAR *PUCHAR;
+typedef USHORT *PUSHORT;
+typedef UINT *PUINT;
+typedef ULONG *PULONG;
+typedef Scsi_Host_Template *PSHT;
+typedef struct Scsi_Host *PSH;
+typedef Scsi_Device *PSCSIDEV;
+typedef Scsi_Cmnd *PSCSICMD;
+typedef void *PVOID;
+typedef struct scatterlist *PSGL, SGL;
+
+
+/*;-----------------------------------------------------------------------*/
+typedef struct _SyncMsg
+{
+UCHAR ExtendMsg;
+UCHAR ExtMsgLen;
+UCHAR SyncXferReq;
+UCHAR Period;
+UCHAR ReqOffset;
+} SyncMsg;
+/*;-----------------------------------------------------------------------*/
+typedef struct _Capacity
+{
+ULONG BlockCount;
+ULONG BlockLength;
+} Capacity;
+/*;-----------------------------------------------------------------------*/
+typedef struct _SGentry
+{
+ULONG SGXferDataPtr;
+ULONG SGXferDataLen;
+} SGentry;
+
+typedef struct _SGentry1
+{
+ULONG SGXLen;
+ULONG SGXPtr;
+} SGentry1, *PSGE;
+
/*
;-----------------------------------------------------------------------
; SCSI Request Block
;-----------------------------------------------------------------------
*/
-struct dc390_srb
+struct _SRB
{
-//u8 CmdBlock[12];
+//UCHAR CmdBlock[12];
-struct dc390_srb *pNextSRB;
-struct dc390_dcb *pSRBDCB;
-struct scsi_cmnd *pcmd;
-struct scatterlist *pSegmentList;
+struct _SRB *pNextSRB;
+struct _DCB *pSRBDCB;
+PSCSICMD pcmd;
+PSGL pSegmentList;
/* 0x10: */
-struct scatterlist Segmentx; /* make a one entry of S/G list table */
+SGL Segmentx; /* make a one entry of S/G list table */
/* 0x1c: */
-unsigned long SGBusAddr; /*;a segment starting address as seen by AM53C974A*/
-unsigned long SGToBeXferLen; /*; to be xfer length */
-unsigned long TotalXferredLen;
-unsigned long SavedTotXLen;
-u32 SRBState;
+ULONG SGBusAddr; /*;a segment starting address as seen by AM53C974A*/
+ULONG SGToBeXferLen; /*; to be xfer length */
+ULONG TotalXferredLen;
+ULONG SavedTotXLen;
+UINT SRBState;
/* 0x30: */
-u8 SRBStatus;
-u8 SRBFlag; /*; b0-AutoReqSense,b6-Read,b7-write */
+UCHAR SRBStatus;
+UCHAR SRBFlag; /*; b0-AutoReqSense,b6-Read,b7-write */
/*; b4-settimeout,b5-Residual valid */
-u8 AdaptStatus;
-u8 TargetStatus;
+UCHAR AdaptStatus;
+UCHAR TargetStatus;
-u8 ScsiPhase;
-u8 TagNumber;
-u8 SGIndex;
-u8 SGcount;
+UCHAR ScsiPhase;
+UCHAR TagNumber;
+UCHAR SGIndex;
+UCHAR SGcount;
/* 0x38: */
-u8 MsgCnt;
-u8 EndMessage;
-u8 RetryCnt;
-u8 SavedSGCount;
+UCHAR MsgCnt;
+UCHAR EndMessage;
+UCHAR RetryCnt;
+UCHAR SavedSGCount;
-unsigned long Saved_Ptr;
+ULONG Saved_Ptr;
/* 0x40: */
-u8 MsgInBuf[6];
-u8 MsgOutBuf[6];
+UCHAR MsgInBuf[6];
+UCHAR MsgOutBuf[6];
-//u8 IORBFlag; /*;81h-Reset, 2-retry */
+//UCHAR IORBFlag; /*;81h-Reset, 2-retry */
/* 0x4c: */
};
+typedef struct _SRB DC390_SRB, *PSRB;
+
/*
;-----------------------------------------------------------------------
; Device Control Block
;-----------------------------------------------------------------------
*/
-struct dc390_dcb
+struct _DCB
{
-struct dc390_dcb *pNextDCB;
-struct dc390_acb *pDCBACB;
+struct _DCB *pNextDCB;
+struct _ACB *pDCBACB;
+
+/* Aborted Commands */
+//PSCSICMD AboIORBhead;
+//PSCSICMD AboIORBtail;
+//ULONG AboIORBcnt;
/* 0x08: */
/* Queued SRBs */
-struct dc390_srb *pWaitingSRB;
-struct dc390_srb *pWaitLast;
-struct dc390_srb *pGoingSRB;
-struct dc390_srb *pGoingLast;
-struct dc390_srb *pActiveSRB;
-u8 WaitSRBCnt; /* Not used */
-u8 GoingSRBCnt;
+PSRB pWaitingSRB;
+PSRB pWaitLast;
+PSRB pGoingSRB;
+PSRB pGoingLast;
+PSRB pActiveSRB;
+UCHAR WaitSRBCnt; /* Not used */
+UCHAR GoingSRBCnt;
-u8 DevType;
-u8 MaxCommand;
+UCHAR DevType;
+UCHAR MaxCommand;
/* 0x20: */
-u32 TagMask;
+UINT TagMask;
-u8 TargetID; /*; SCSI Target ID (SCSI Only) */
-u8 TargetLUN; /*; SCSI Log. Unit (SCSI Only) */
-u8 DevMode;
-u8 DCBFlag;
+UCHAR TargetID; /*; SCSI Target ID (SCSI Only) */
+UCHAR TargetLUN; /*; SCSI Log. Unit (SCSI Only) */
+UCHAR DevMode;
+UCHAR DCBFlag;
-u8 CtrlR1;
-u8 CtrlR3;
-u8 CtrlR4;
-u8 Inquiry7;
+UCHAR CtrlR1;
+UCHAR CtrlR3;
+UCHAR CtrlR4;
+UCHAR Inquiry7;
/* 0x2c: */
-u8 SyncMode; /*; 0:async mode */
-u8 NegoPeriod; /*;for nego. */
-u8 SyncPeriod; /*;for reg. */
-u8 SyncOffset; /*;for reg. and nego.(low nibble) */
+UCHAR SyncMode; /*; 0:async mode */
+UCHAR NegoPeriod; /*;for nego. */
+UCHAR SyncPeriod; /*;for reg. */
+UCHAR SyncOffset; /*;for reg. and nego.(low nibble) */
/* 0x30:*/
-//u8 InqDataBuf[8];
-//u8 CapacityBuf[8];
+//UCHAR InqDataBuf[8];
+//UCHAR CapacityBuf[8];
///* 0x40: */
};
-
+typedef struct _DCB DC390_DCB, *PDCB;
/*
;-----------------------------------------------------------------------
; Adapter Control Block
;-----------------------------------------------------------------------
*/
-struct dc390_acb
+struct _ACB
{
-struct Scsi_Host *pScsiHost;
-struct dc390_acb *pNextACB;
-u16 IOPortBase;
-u8 IRQLevel;
-u8 status;
-
-u8 SRBCount;
-u8 AdapterIndex; /*; nth Adapter this driver */
-u8 DCBCnt;
-
-u8 TagMaxNum;
-u8 ACBFlag;
-u8 Gmode2;
-u8 scan_devices;
-
-struct dc390_dcb *pLinkDCB;
-struct dc390_dcb *pLastDCB;
-struct dc390_dcb *pDCBRunRobin;
-
-struct dc390_dcb *pActiveDCB;
-struct dc390_srb *pFreeSRB;
-struct dc390_srb *pTmpSRB;
-
-u8 msgin123[4];
-u8 DCBmap[MAX_SCSI_ID];
-u8 Connected;
-u8 pad;
+PSH pScsiHost;
+struct _ACB *pNextACB;
+USHORT IOPortBase;
+UCHAR IRQLevel;
+UCHAR status;
+
+UCHAR SRBCount;
+UCHAR AdapterIndex; /*; nth Adapter this driver */
+UCHAR DCBCnt;
+
+UCHAR TagMaxNum;
+UCHAR ACBFlag;
+UCHAR Gmode2;
+UCHAR scan_devices;
+
+PDCB pLinkDCB;
+PDCB pLastDCB;
+PDCB pDCBRunRobin;
+
+PDCB pActiveDCB;
+PSRB pFreeSRB;
+PSRB pTmpSRB;
+
+UCHAR msgin123[4];
+UCHAR DCBmap[MAX_SCSI_ID];
+UCHAR Connected;
+UCHAR pad;
#if defined(USE_SPINLOCKS) && USE_SPINLOCKS > 1 && (defined(CONFIG_SMP) || DEBUG_SPINLOCKS > 0)
spinlock_t lock;
#endif
-u8 sel_timeout;
-u8 glitch_cfg;
+UCHAR sel_timeout;
+UCHAR glitch_cfg;
-u8 MsgLen;
-u8 Ignore_IRQ; /* Not used */
+UCHAR MsgLen;
+UCHAR Ignore_IRQ; /* Not used */
-struct pci_dev *pdev;
+PDEVDECL1; /* Pointer to PCI cfg. space */
-unsigned long Cmds;
-u32 SelLost;
-u32 SelConn;
-u32 CmdInQ;
-u32 CmdOutOfSRB;
+ULONG Cmds;
+UINT SelLost;
+UINT SelConn;
+UINT CmdInQ;
+UINT CmdOutOfSRB;
struct timer_list Waiting_Timer;
-struct dc390_srb TmpSRB;
-struct dc390_srb SRB_array[MAX_SRB_CNT]; /* 50 SRBs */
+DC390_SRB TmpSRB;
+DC390_SRB SRB_array[MAX_SRB_CNT]; /* 50 SRBs */
};
+typedef struct _ACB DC390_ACB, *PACB;
/*;-----------------------------------------------------------------------*/
typedef struct _SCSIInqData { /* INQUIRY */
- u8 DevType; /* Periph Qualifier & Periph Dev Type*/
- u8 RMB_TypeMod; /* rem media bit & Dev Type Modifier */
- u8 Vers; /* ISO, ECMA, & ANSI versions */
- u8 RDF; /* AEN, TRMIOP, & response data format*/
- u8 AddLen; /* length of additional data */
- u8 Res1; /* reserved */
- u8 Res2; /* reserved */
- u8 Flags; /* RelADr,Wbus32,Wbus16,Sync,etc. */
- u8 VendorID[8]; /* Vendor Identification */
- u8 ProductID[16]; /* Product Identification */
- u8 ProductRev[4]; /* Product Revision */
+ UCHAR DevType; /* Periph Qualifier & Periph Dev Type*/
+ UCHAR RMB_TypeMod; /* rem media bit & Dev Type Modifier */
+ UCHAR Vers; /* ISO, ECMA, & ANSI versions */
+ UCHAR RDF; /* AEN, TRMIOP, & response data format*/
+ UCHAR AddLen; /* length of additional data */
+ UCHAR Res1; /* reserved */
+ UCHAR Res2; /* reserved */
+ UCHAR Flags; /* RelADr,Wbus32,Wbus16,Sync,etc. */
+ UCHAR VendorID[8]; /* Vendor Identification */
+ UCHAR ProductID[16]; /* Product Identification */
+ UCHAR ProductRev[4]; /* Product Revision */
} SCSI_INQDATA, *PSCSI_INQDATA;
*/
typedef struct _EEprom
{
-u8 EE_MODE1;
-u8 EE_SPEED;
-u8 xx1;
-u8 xx2;
+UCHAR EE_MODE1;
+UCHAR EE_SPEED;
+UCHAR xx1;
+UCHAR xx2;
} EEprom, *PEEprom;
#define REAL_EE_ADAPT_SCSI_ID 64
(inb (pACB->IOPortBase + (address)))
#define DC390_read8_(address, base) \
- (inb ((u16)(base) + (address)))
+ (inb ((USHORT)(base) + (address)))
#define DC390_read16(address) \
(inw (pACB->IOPortBase + (address)))
outb ((value), pACB->IOPortBase + (address))
#define DC390_write8_(address,value,base) \
- outb ((value), (u16)(base) + (address))
+ outb ((value), (USHORT)(base) + (address))
#define DC390_write16(address,value) \
outw ((value), pACB->IOPortBase + (address))