From: Alexey Dobriyan <adobriyan@mail.ru>
Subject: [KJ] [PATCH 2/2] FlashPoint: use proper types.

Never underestimate the creativity of typedef'ers.

UCHAR		=> unsigned char
USHORT		=> unsigned short
UINT		=> unsigned int
ULONG		=> unsigned long

PUCHAR		=> unsigned char *
PUSHORT		=> unsigned short *
PULONG		=> unsigned long *
PVOID		=> void *

uchar_ptr	=> unsigned char *
ushort_ptr	=> unsigned short *
ulong_ptr	=> unsigned long *

s08bits		=> s8
s16bits		=> s16
s32bits		=> s32
u08bits		=> u8
u16bits		=> u16
u32bits		=> u32

pu08bits	=> u8 *
pu16bits	=> u16 *
pu32bits	=> u32 *

Signed-off-by: Alexey Dobriyan <adobriyan@mail.ru>

---
 FlashPoint.c | 1313 ++++++++++++++++++++++++++++-------------------------------
 1 files changed, 640 insertions(+), 673 deletions(-)

Index: quilt/drivers/scsi/FlashPoint.c
===================================================================
--- quilt.orig/drivers/scsi/FlashPoint.c
+++ quilt/drivers/scsi/FlashPoint.c
@@ -180,23 +180,6 @@
 
 #define FAILURE         0xFFFFFFFFL
 
-
-typedef unsigned char   UCHAR;
-typedef unsigned short  USHORT;
-typedef unsigned int    UINT;
-typedef unsigned long   ULONG;
-typedef unsigned char * PUCHAR;
-typedef unsigned short* PUSHORT;
-typedef unsigned long * PULONG;
-typedef void *          PVOID;
-
-
-
-typedef unsigned char           * uchar_ptr;
-typedef unsigned short          * ushort_ptr;
-typedef unsigned long           * ulong_ptr;
-
-
 /*	 			NEW TYPE DEFINITIONS (shared with Mylex North)
 
 **  Use following type defines to avoid confusion in 16 and 32-bit
@@ -205,24 +188,8 @@ typedef unsigned long           * ulong_
 
 */
 
-#define s08bits	char
-#define s16bits 	short
-#define s32bits	long
-
-#define u08bits	unsigned s08bits
-#define u16bits	unsigned s16bits
-#define u32bits	unsigned s32bits
-
-
-
-typedef u08bits 	* pu08bits;
-typedef u16bits 	* pu16bits;
-typedef u32bits 	* pu32bits;
-
-
-
-#define BIT(x)          ((UCHAR)(1<<(x)))    /* single-bit mask in bit position x */
-#define BITW(x)          ((USHORT)(1<<(x)))  /* single-bit mask in bit position x */
+#define BIT(x)          ((unsigned char)(1<<(x)))    /* single-bit mask in bit position x */
+#define BITW(x)          ((unsigned short)(1<<(x)))  /* single-bit mask in bit position x */
 
 
 
@@ -230,12 +197,12 @@ typedef u32bits 	* pu32bits;
 
 
 #if !defined(OS_InPortByte)
-	#define OS_InPortByte(ioport)    inb((u16bits)ioport)
-	#define OS_InPortWord(ioport)    inw((u16bits)ioport)
-	#define OS_InPortLong(ioport)    inl((u16bits)ioport)
-	#define OS_OutPortByte(ioport,val)  outb((u16bits)ioport, (u08bits)val)
-	#define OS_OutPortWord(ioport,val)  outw((u16bits)ioport, (u16bits)val)
-	#define OS_OutPortLong(ioport,val)  outl((u16bits)ioport, (u32bits)val)
+	#define OS_InPortByte(ioport)    inb((u16)ioport)
+	#define OS_InPortWord(ioport)    inw((u16)ioport)
+	#define OS_InPortLong(ioport)    inl((u16)ioport)
+	#define OS_OutPortByte(ioport,val)  outb((u16)ioport, (u8)val)
+	#define OS_OutPortWord(ioport,val)  outw((u16)ioport, (u16)val)
+	#define OS_OutPortLong(ioport,val)  outl((u16)ioport, (u32)val)
 
 	#define OS_Lock(x)
 	#define OS_UnLock(x)
@@ -256,27 +223,27 @@ typedef u32bits 	* pu32bits;
 
 
 typedef struct SCCBMgr_info {
-   ULONG    si_baseaddr;
-   UCHAR    si_present;
-   UCHAR    si_intvect;
-   UCHAR    si_id;
-   UCHAR    si_lun;
-   USHORT   si_fw_revision;
-   USHORT   si_per_targ_init_sync;
-   USHORT   si_per_targ_fast_nego;
-   USHORT   si_per_targ_ultra_nego;
-   USHORT   si_per_targ_no_disc;
-   USHORT   si_per_targ_wide_nego;
-   USHORT   si_flags;
-   UCHAR    si_card_family;
-   UCHAR    si_bustype;
-   UCHAR    si_card_model[3];
-   UCHAR    si_relative_cardnum;
-   UCHAR    si_reserved[4];
-   ULONG    si_OS_reserved;
-   UCHAR    si_XlatInfo[4];
-   ULONG    si_reserved2[5];
-   ULONG    si_secondary_range;
+   unsigned long    si_baseaddr;
+   unsigned char    si_present;
+   unsigned char    si_intvect;
+   unsigned char    si_id;
+   unsigned char    si_lun;
+   unsigned short   si_fw_revision;
+   unsigned short   si_per_targ_init_sync;
+   unsigned short   si_per_targ_fast_nego;
+   unsigned short   si_per_targ_ultra_nego;
+   unsigned short   si_per_targ_no_disc;
+   unsigned short   si_per_targ_wide_nego;
+   unsigned short   si_flags;
+   unsigned char    si_card_family;
+   unsigned char    si_bustype;
+   unsigned char    si_card_model[3];
+   unsigned char    si_relative_cardnum;
+   unsigned char    si_reserved[4];
+   unsigned long    si_OS_reserved;
+   unsigned char    si_XlatInfo[4];
+   unsigned long    si_reserved2[5];
+   unsigned long    si_secondary_range;
 } SCCBMGR_INFO;
 
    typedef SCCBMGR_INFO *      PSCCBMGR_INFO;
@@ -316,48 +283,48 @@ typedef struct SCCBMgr_info {
 
 #pragma pack(1)
 typedef struct _SCCB {
-   UCHAR OperationCode;
-   UCHAR ControlByte;
-   UCHAR CdbLength;
-   UCHAR RequestSenseLength;
-   ULONG DataLength;
-   ULONG DataPointer;
-   UCHAR CcbRes[2];
-   UCHAR HostStatus;
-   UCHAR TargetStatus;
-   UCHAR TargID;
-   UCHAR Lun;
-   UCHAR Cdb[12];
-   UCHAR CcbRes1;
-   UCHAR Reserved1;
-   ULONG Reserved2;
-   ULONG SensePointer;
+   unsigned char OperationCode;
+   unsigned char ControlByte;
+   unsigned char CdbLength;
+   unsigned char RequestSenseLength;
+   unsigned long DataLength;
+   unsigned long DataPointer;
+   unsigned char CcbRes[2];
+   unsigned char HostStatus;
+   unsigned char TargetStatus;
+   unsigned char TargID;
+   unsigned char Lun;
+   unsigned char Cdb[12];
+   unsigned char CcbRes1;
+   unsigned char Reserved1;
+   unsigned long Reserved2;
+   unsigned long SensePointer;
 
 
    CALL_BK_FN SccbCallback;                  /* VOID (*SccbCallback)(); */
-   ULONG  SccbIOPort;                        /* Identifies board base port */
-   UCHAR  SccbStatus;
-   UCHAR  SCCBRes2;
-   USHORT SccbOSFlags;
-
-
-   ULONG   Sccb_XferCnt;            /* actual transfer count */
-   ULONG   Sccb_ATC;
-   ULONG   SccbVirtDataPtr;         /* virtual addr for OS/2 */
-   ULONG   Sccb_res1;
-   USHORT  Sccb_MGRFlags;
-   USHORT  Sccb_sgseg;
-   UCHAR   Sccb_scsimsg;            /* identify msg for selection */
-   UCHAR   Sccb_tag;
-   UCHAR   Sccb_scsistat;
-   UCHAR   Sccb_idmsg;              /* image of last msg in */
+   unsigned long  SccbIOPort;                        /* Identifies board base port */
+   unsigned char  SccbStatus;
+   unsigned char  SCCBRes2;
+   unsigned short SccbOSFlags;
+
+
+   unsigned long   Sccb_XferCnt;            /* actual transfer count */
+   unsigned long   Sccb_ATC;
+   unsigned long   SccbVirtDataPtr;         /* virtual addr for OS/2 */
+   unsigned long   Sccb_res1;
+   unsigned short  Sccb_MGRFlags;
+   unsigned short  Sccb_sgseg;
+   unsigned char   Sccb_scsimsg;            /* identify msg for selection */
+   unsigned char   Sccb_tag;
+   unsigned char   Sccb_scsistat;
+   unsigned char   Sccb_idmsg;              /* image of last msg in */
    PSCCB   Sccb_forwardlink;
    PSCCB   Sccb_backlink;
-   ULONG   Sccb_savedATC;
-   UCHAR   Save_Cdb[6];
-   UCHAR   Save_CdbLen;
-   UCHAR   Sccb_XferState;
-   ULONG   Sccb_SGoffset;
+   unsigned long   Sccb_savedATC;
+   unsigned char   Save_Cdb[6];
+   unsigned char   Save_CdbLen;
+   unsigned char   Sccb_XferState;
+   unsigned long   Sccb_SGoffset;
 #if (FW_TYPE == _UCB_MGR_)
    PUCB    Sccb_ucb_ptr;
 #endif
@@ -466,9 +433,9 @@ typedef struct _SCCB {
 
 #if (FW_TYPE == _UCB_MGR_)
 	void SccbMgr_start_sccb(CARD_HANDLE pCurrCard, PUCB p_ucb);
-	s32bits SccbMgr_abort_sccb(CARD_HANDLE pCurrCard, PUCB p_ucb);
-	u08bits SccbMgr_my_int(CARD_HANDLE pCurrCard);
-	s32bits SccbMgr_isr(CARD_HANDLE pCurrCard);
+	s32 SccbMgr_abort_sccb(CARD_HANDLE pCurrCard, PUCB p_ucb);
+	u8 SccbMgr_my_int(CARD_HANDLE pCurrCard);
+	s32 SccbMgr_isr(CARD_HANDLE pCurrCard);
 	void SccbMgr_scsi_reset(CARD_HANDLE pCurrCard);
 	void SccbMgr_timer_expired(CARD_HANDLE pCurrCard);
 	void SccbMgr_unload_card(CARD_HANDLE pCurrCard);
@@ -483,16 +450,16 @@ typedef struct _SCCB {
 
 
 	int   SccbMgr_sense_adapter(PSCCBMGR_INFO pCardInfo);
-	ULONG SccbMgr_config_adapter(PSCCBMGR_INFO pCardInfo);
-	void  SccbMgr_start_sccb(ULONG pCurrCard, PSCCB p_SCCB);
-	int   SccbMgr_abort_sccb(ULONG pCurrCard, PSCCB p_SCCB);
-	UCHAR SccbMgr_my_int(ULONG pCurrCard);
-	int   SccbMgr_isr(ULONG pCurrCard);
-	void  SccbMgr_scsi_reset(ULONG pCurrCard);
-	void  SccbMgr_enable_int(ULONG pCurrCard);
-	void  SccbMgr_disable_int(ULONG pCurrCard);
-	void  SccbMgr_timer_expired(ULONG pCurrCard);
-	void SccbMgr_unload_card(ULONG pCurrCard);
+	unsigned long SccbMgr_config_adapter(PSCCBMGR_INFO pCardInfo);
+	void  SccbMgr_start_sccb(unsigned long pCurrCard, PSCCB p_SCCB);
+	int   SccbMgr_abort_sccb(unsigned long pCurrCard, PSCCB p_SCCB);
+	unsigned char SccbMgr_my_int(unsigned long pCurrCard);
+	int   SccbMgr_isr(unsigned long pCurrCard);
+	void  SccbMgr_scsi_reset(unsigned long pCurrCard);
+	void  SccbMgr_enable_int(unsigned long pCurrCard);
+	void  SccbMgr_disable_int(unsigned long pCurrCard);
+	void  SccbMgr_timer_expired(unsigned long pCurrCard);
+	void SccbMgr_unload_card(unsigned long pCurrCard);
 
 #endif  // (FW_TYPE == _SCCB_MGR_)
 
@@ -543,12 +510,12 @@ typedef struct _SCCB {
 
 
 
-	#define RD_HARPOON(ioport)          OS_InPortByte((u32bits)ioport)
-	#define RDW_HARPOON(ioport)         OS_InPortWord((u32bits)ioport)
-	#define RD_HARP32(ioport,offset,data) (data = OS_InPortLong((u32bits)(ioport + offset)))
-	#define WR_HARPOON(ioport,val)      OS_OutPortByte((u32bits)ioport,(u08bits) val)
-	#define WRW_HARPOON(ioport,val)       OS_OutPortWord((u32bits)ioport,(u16bits)val)
-	#define WR_HARP32(ioport,offset,data)  OS_OutPortLong((u32bits)(ioport + offset), data)
+	#define RD_HARPOON(ioport)          OS_InPortByte((u32)ioport)
+	#define RDW_HARPOON(ioport)         OS_InPortWord((u32)ioport)
+	#define RD_HARP32(ioport,offset,data) (data = OS_InPortLong((u32)(ioport + offset)))
+	#define WR_HARPOON(ioport,val)      OS_OutPortByte((u32)ioport,(u8) val)
+	#define WRW_HARPOON(ioport,val)       OS_OutPortWord((u32)ioport,(u16)val)
+	#define WR_HARP32(ioport,offset,data)  OS_OutPortLong((u32)(ioport + offset), data)
 
 /* Definitions for Target related structures */
 
@@ -589,27 +556,27 @@ typedef struct SCCBMgr_tar_info {
 
    PSCCB    TarSelQ_Head;
    PSCCB    TarSelQ_Tail;
-   UCHAR    TarLUN_CA;        /*Contingent Allgiance */
-   UCHAR    TarTagQ_Cnt;
-   UCHAR    TarSelQ_Cnt;
-   UCHAR    TarStatus;
-   UCHAR    TarEEValue;
-   UCHAR 	TarSyncCtrl;
-   UCHAR 	TarReserved[2];			/* for alignment */ 
-   UCHAR 	LunDiscQ_Idx[MAX_LUN];
-   UCHAR    TarLUNBusy[MAX_LUN];
+   unsigned char    TarLUN_CA;        /*Contingent Allgiance */
+   unsigned char    TarTagQ_Cnt;
+   unsigned char    TarSelQ_Cnt;
+   unsigned char    TarStatus;
+   unsigned char    TarEEValue;
+   unsigned char 	TarSyncCtrl;
+   unsigned char 	TarReserved[2];			/* for alignment */ 
+   unsigned char 	LunDiscQ_Idx[MAX_LUN];
+   unsigned char    TarLUNBusy[MAX_LUN];
 } SCCBMGR_TAR_INFO;
 
 typedef struct NVRAMInfo {
-	UCHAR		niModel;								/* Model No. of card */
-	UCHAR		niCardNo;							/* Card no. */
-	ULONG		niBaseAddr;							/* Port Address of card */
-	UCHAR		niSysConf;							/* Adapter Configuration byte - Byte 16 of eeprom map */
-	UCHAR		niScsiConf;							/* SCSI Configuration byte - Byte 17 of eeprom map */
-	UCHAR		niScamConf;							/* SCAM Configuration byte - Byte 20 of eeprom map */
-	UCHAR		niAdapId;							/* Host Adapter ID - Byte 24 of eerpom map */
-	UCHAR		niSyncTbl[MAX_SCSI_TAR / 2];	/* Sync/Wide byte of targets */
-	UCHAR		niScamTbl[MAX_SCSI_TAR][4];	/* Compressed Scam name string of Targets */
+	unsigned char		niModel;								/* Model No. of card */
+	unsigned char		niCardNo;							/* Card no. */
+	unsigned long		niBaseAddr;							/* Port Address of card */
+	unsigned char		niSysConf;							/* Adapter Configuration byte - Byte 16 of eeprom map */
+	unsigned char		niScsiConf;							/* SCSI Configuration byte - Byte 17 of eeprom map */
+	unsigned char		niScamConf;							/* SCAM Configuration byte - Byte 20 of eeprom map */
+	unsigned char		niAdapId;							/* Host Adapter ID - Byte 24 of eerpom map */
+	unsigned char		niSyncTbl[MAX_SCSI_TAR / 2];	/* Sync/Wide byte of targets */
+	unsigned char		niScamTbl[MAX_SCSI_TAR][4];	/* Compressed Scam name string of Targets */
 }NVRAMINFO;
 
 typedef NVRAMINFO *PNVRamInfo;
@@ -628,15 +595,15 @@ typedef struct SCCBcard {
    PADAPTER_INFO cardInfo;
 #endif
 
-   ULONG ioPort;
+   unsigned long ioPort;
 
-   USHORT cmdCounter;
-   UCHAR  discQCount;
-   UCHAR  tagQ_Lst; 
-   UCHAR cardIndex;
-   UCHAR scanIndex;
-   UCHAR globalFlags;
-   UCHAR ourId;
+   unsigned short cmdCounter;
+   unsigned char  discQCount;
+   unsigned char  tagQ_Lst; 
+   unsigned char cardIndex;
+   unsigned char scanIndex;
+   unsigned char globalFlags;
+   unsigned char ourId;
    PNVRamInfo pNvRamInfo;
    PSCCB discQ_Tbl[QUEUE_DEPTH]; 
       
@@ -692,7 +659,7 @@ enum scam_id_st { ID0,ID1,ID2,ID3,ID4,ID
 
 typedef struct SCCBscam_info {
 
-   UCHAR    id_string[ID_STRING_LENGTH];
+   unsigned char    id_string[ID_STRING_LENGTH];
    enum scam_id_st state;
     
 } SCCBSCAM_INFO, *PSCCBSCAM_INFO;
@@ -1143,7 +1110,7 @@ typedef struct SCCBscam_info {
 
 
 
-   extern USHORT default_intena;
+   extern unsigned short default_intena;
 
    #define  hp_intena		 0x40
 
@@ -1535,13 +1502,13 @@ typedef struct SCCBscam_info {
 #define GET_XFER_CNT(port, xfercnt) {RD_HARP32(port,hp_xfercnt_0,xfercnt); xfercnt &= 0xFFFFFF;}
 /* #define GET_XFER_CNT(port, xfercnt) (xfercnt = RD_HARPOON(port+hp_xfercnt_2), \
                                  xfercnt <<= 16,\
-                                 xfercnt |= RDW_HARPOON((USHORT)(port+hp_xfercnt_0)))
+                                 xfercnt |= RDW_HARPOON((unsigned short)(port+hp_xfercnt_0)))
  */
-#define HP_SETUP_ADDR_CNT(port,addr,count) (WRW_HARPOON((port+hp_host_addr_lo), (USHORT)(addr & 0x0000FFFFL)),\
+#define HP_SETUP_ADDR_CNT(port,addr,count) (WRW_HARPOON((port+hp_host_addr_lo), (unsigned short)(addr & 0x0000FFFFL)),\
          addr >>= 16,\
-         WRW_HARPOON((port+hp_host_addr_hmi), (USHORT)(addr & 0x0000FFFFL)),\
+         WRW_HARPOON((port+hp_host_addr_hmi), (unsigned short)(addr & 0x0000FFFFL)),\
          WR_HARP32(port,hp_xfercnt_0,count),\
-         WRW_HARPOON((port+hp_xfer_cnt_lo), (USHORT)(count & 0x0000FFFFL)),\
+         WRW_HARPOON((port+hp_xfer_cnt_lo), (unsigned short)(count & 0x0000FFFFL)),\
          count >>= 16,\
          WR_HARPOON(port+hp_xfer_cnt_hi, (count & 0xFF)))
 
@@ -1576,129 +1543,129 @@ typedef struct SCCBscam_info {
 #if (FW_TYPE==_UCB_MGR_)
 void ReadNVRam(PSCCBcard pCurrCard,PUCB p_ucb);
 void WriteNVRam(PSCCBcard pCurrCard,PUCB p_ucb);
-void UpdateCheckSum(u32bits baseport);
+void UpdateCheckSum(u32 baseport);
 #endif // (FW_TYPE==_UCB_MGR_)
 
-UCHAR sfm(ULONG port, PSCCB pcurrSCCB);
-void  scsiStartAuto(ULONG port);
-UCHAR sisyncn(ULONG port, UCHAR p_card, UCHAR syncFlag);
-void  ssel(ULONG port, UCHAR p_card);
-void  sres(ULONG port, UCHAR p_card, PSCCBcard pCurrCard);
-void  sdecm(UCHAR message, ULONG port, UCHAR p_card);
-void  shandem(ULONG port, UCHAR p_card,PSCCB pCurrSCCB);
-void  stsyncn(ULONG port, UCHAR p_card);
-void  sisyncr(ULONG port,UCHAR sync_pulse, UCHAR offset);
-void  sssyncv(ULONG p_port, UCHAR p_id, UCHAR p_sync_value, PSCCBMgr_tar_info currTar_Info);
-void  sresb(ULONG port, UCHAR p_card);
-void  sxfrp(ULONG p_port, UCHAR p_card);
-void  schkdd(ULONG port, UCHAR p_card);
-UCHAR RdStack(ULONG port, UCHAR index);
-void  WrStack(ULONG portBase, UCHAR index, UCHAR data);
-UCHAR ChkIfChipInitialized(ULONG ioPort);
+unsigned char sfm(unsigned long port, PSCCB pcurrSCCB);
+void  scsiStartAuto(unsigned long port);
+unsigned char sisyncn(unsigned long port, unsigned char p_card, unsigned char syncFlag);
+void  ssel(unsigned long port, unsigned char p_card);
+void  sres(unsigned long port, unsigned char p_card, PSCCBcard pCurrCard);
+void  sdecm(unsigned char message, unsigned long port, unsigned char p_card);
+void  shandem(unsigned long port, unsigned char p_card,PSCCB pCurrSCCB);
+void  stsyncn(unsigned long port, unsigned char p_card);
+void  sisyncr(unsigned long port,unsigned char sync_pulse, unsigned char offset);
+void  sssyncv(unsigned long p_port, unsigned char p_id, unsigned char p_sync_value, PSCCBMgr_tar_info currTar_Info);
+void  sresb(unsigned long port, unsigned char p_card);
+void  sxfrp(unsigned long p_port, unsigned char p_card);
+void  schkdd(unsigned long port, unsigned char p_card);
+unsigned char RdStack(unsigned long port, unsigned char index);
+void  WrStack(unsigned long portBase, unsigned char index, unsigned char data);
+unsigned char ChkIfChipInitialized(unsigned long ioPort);
 
 #if defined(V302)
-UCHAR GetTarLun(ULONG port, UCHAR p_card, UCHAR our_target, PSCCBcard pCurrCard, PUCHAR tar, PUCHAR lun);
+unsigned char GetTarLun(unsigned long port, unsigned char p_card, unsigned char our_target, PSCCBcard pCurrCard, unsigned char * tar, unsigned char * lun);
 #endif
 
-void SendMsg(ULONG port, UCHAR message);
-void  queueFlushTargSccb(UCHAR p_card, UCHAR thisTarg, UCHAR error_code);
+void SendMsg(unsigned long port, unsigned char message);
+void  queueFlushTargSccb(unsigned char p_card, unsigned char thisTarg, unsigned char error_code);
 
 void  ssenss(PSCCBcard pCurrCard);
-void  sinits(PSCCB p_sccb, UCHAR p_card);
+void  sinits(PSCCB p_sccb, unsigned char p_card);
 void  RNVRamData(PNVRamInfo pNvRamInfo);
 
 #if defined(WIDE_SCSI)
-   UCHAR siwidn(ULONG port, UCHAR p_card);
-   void  stwidn(ULONG port, UCHAR p_card);
-   void  siwidr(ULONG port, UCHAR width);
+   unsigned char siwidn(unsigned long port, unsigned char p_card);
+   void  stwidn(unsigned long port, unsigned char p_card);
+   void  siwidr(unsigned long port, unsigned char width);
 #endif
 
 
-void  queueSelectFail(PSCCBcard pCurrCard, UCHAR p_card);
-void  queueDisconnect(PSCCB p_SCCB, UCHAR p_card);
-void  queueCmdComplete(PSCCBcard pCurrCard, PSCCB p_SCCB, UCHAR p_card);
-void  queueSearchSelect(PSCCBcard pCurrCard, UCHAR p_card);
-void  queueFlushSccb(UCHAR p_card, UCHAR error_code);
-void  queueAddSccb(PSCCB p_SCCB, UCHAR card);
-UCHAR queueFindSccb(PSCCB p_SCCB, UCHAR p_card);
+void  queueSelectFail(PSCCBcard pCurrCard, unsigned char p_card);
+void  queueDisconnect(PSCCB p_SCCB, unsigned char p_card);
+void  queueCmdComplete(PSCCBcard pCurrCard, PSCCB p_SCCB, unsigned char p_card);
+void  queueSearchSelect(PSCCBcard pCurrCard, unsigned char p_card);
+void  queueFlushSccb(unsigned char p_card, unsigned char error_code);
+void  queueAddSccb(PSCCB p_SCCB, unsigned char card);
+unsigned char queueFindSccb(PSCCB p_SCCB, unsigned char p_card);
 void  utilUpdateResidual(PSCCB p_SCCB);
-USHORT CalcCrc16(UCHAR buffer[]);
-UCHAR  CalcLrc(UCHAR buffer[]);
+unsigned short CalcCrc16(unsigned char buffer[]);
+unsigned char  CalcLrc(unsigned char buffer[]);
 
 
-void  Wait1Second(ULONG p_port);
-void  Wait(ULONG p_port, UCHAR p_delay);
-void  utilEEWriteOnOff(ULONG p_port,UCHAR p_mode);
-void  utilEEWrite(ULONG p_port, USHORT ee_data, USHORT ee_addr);
-USHORT utilEERead(ULONG p_port, USHORT ee_addr);
-USHORT utilEEReadOrg(ULONG p_port, USHORT ee_addr);
-void  utilEESendCmdAddr(ULONG p_port, UCHAR ee_cmd, USHORT ee_addr);
+void  Wait1Second(unsigned long p_port);
+void  Wait(unsigned long p_port, unsigned char p_delay);
+void  utilEEWriteOnOff(unsigned long p_port,unsigned char p_mode);
+void  utilEEWrite(unsigned long p_port, unsigned short ee_data, unsigned short ee_addr);
+unsigned short utilEERead(unsigned long p_port, unsigned short ee_addr);
+unsigned short utilEEReadOrg(unsigned long p_port, unsigned short ee_addr);
+void  utilEESendCmdAddr(unsigned long p_port, unsigned char ee_cmd, unsigned short ee_addr);
 
 
 
-      void  phaseDataOut(ULONG port, UCHAR p_card);
-      void  phaseDataIn(ULONG port, UCHAR p_card);
-      void  phaseCommand(ULONG port, UCHAR p_card);
-      void  phaseStatus(ULONG port, UCHAR p_card);
-      void  phaseMsgOut(ULONG port, UCHAR p_card);
-      void  phaseMsgIn(ULONG port, UCHAR p_card);
-      void  phaseIllegal(ULONG port, UCHAR p_card);
+      void  phaseDataOut(unsigned long port, unsigned char p_card);
+      void  phaseDataIn(unsigned long port, unsigned char p_card);
+      void  phaseCommand(unsigned long port, unsigned char p_card);
+      void  phaseStatus(unsigned long port, unsigned char p_card);
+      void  phaseMsgOut(unsigned long port, unsigned char p_card);
+      void  phaseMsgIn(unsigned long port, unsigned char p_card);
+      void  phaseIllegal(unsigned long port, unsigned char p_card);
 
-void  phaseDecode(ULONG port, UCHAR p_card);
-void  phaseChkFifo(ULONG port, UCHAR p_card);
-void  phaseBusFree(ULONG p_port, UCHAR p_card);
+void  phaseDecode(unsigned long port, unsigned char p_card);
+void  phaseChkFifo(unsigned long port, unsigned char p_card);
+void  phaseBusFree(unsigned long p_port, unsigned char p_card);
 
 
 
 
-void  XbowInit(ULONG port, UCHAR scamFlg);
-void  BusMasterInit(ULONG p_port);
-int   DiagXbow(ULONG port);
-int   DiagBusMaster(ULONG port);
-void  DiagEEPROM(ULONG p_port);
+void  XbowInit(unsigned long port, unsigned char scamFlg);
+void  BusMasterInit(unsigned long p_port);
+int   DiagXbow(unsigned long port);
+int   DiagBusMaster(unsigned long port);
+void  DiagEEPROM(unsigned long p_port);
 
 
 
 
-void  busMstrAbort(ULONG port);
-UCHAR busMstrTimeOut(ULONG port);
-void  dataXferProcessor(ULONG port, PSCCBcard pCurrCard);
-void  busMstrSGDataXferStart(ULONG port, PSCCB pCurrSCCB);
-void  busMstrDataXferStart(ULONG port, PSCCB pCurrSCCB);
-void  hostDataXferAbort(ULONG port, UCHAR p_card, PSCCB pCurrSCCB);
+void  busMstrAbort(unsigned long port);
+unsigned char busMstrTimeOut(unsigned long port);
+void  dataXferProcessor(unsigned long port, PSCCBcard pCurrCard);
+void  busMstrSGDataXferStart(unsigned long port, PSCCB pCurrSCCB);
+void  busMstrDataXferStart(unsigned long port, PSCCB pCurrSCCB);
+void  hostDataXferAbort(unsigned long port, unsigned char p_card, PSCCB pCurrSCCB);
 void  hostDataXferRestart(PSCCB currSCCB);
 
 
-UCHAR SccbMgr_bad_isr(ULONG p_port, UCHAR p_card, PSCCBcard pCurrCard, USHORT p_int);
+unsigned char SccbMgr_bad_isr(unsigned long p_port, unsigned char p_card, PSCCBcard pCurrCard, unsigned short p_int);
 
 
 void  SccbMgrTableInitAll(void);
-void  SccbMgrTableInitCard(PSCCBcard pCurrCard, UCHAR p_card);
-void  SccbMgrTableInitTarget(UCHAR p_card, UCHAR target);
+void  SccbMgrTableInitCard(PSCCBcard pCurrCard, unsigned char p_card);
+void  SccbMgrTableInitTarget(unsigned char p_card, unsigned char target);
 
 
 
-void  scini(UCHAR p_card, UCHAR p_our_id, UCHAR p_power_up);
+void  scini(unsigned char p_card, unsigned char p_our_id, unsigned char p_power_up);
 
-int   scarb(ULONG p_port, UCHAR p_sel_type);
-void  scbusf(ULONG p_port);
-void  scsel(ULONG p_port);
-void  scasid(UCHAR p_card, ULONG p_port);
-UCHAR scxferc(ULONG p_port, UCHAR p_data);
-UCHAR scsendi(ULONG p_port, UCHAR p_id_string[]);
-UCHAR sciso(ULONG p_port, UCHAR p_id_string[]);
-void  scwirod(ULONG p_port, UCHAR p_data_bit);
-void  scwiros(ULONG p_port, UCHAR p_data_bit);
-UCHAR scvalq(UCHAR p_quintet);
-UCHAR scsell(ULONG p_port, UCHAR targ_id);
-void  scwtsel(ULONG p_port);
-void  inisci(UCHAR p_card, ULONG p_port, UCHAR p_our_id);
-void  scsavdi(UCHAR p_card, ULONG p_port);
-UCHAR scmachid(UCHAR p_card, UCHAR p_id_string[]);
+int   scarb(unsigned long p_port, unsigned char p_sel_type);
+void  scbusf(unsigned long p_port);
+void  scsel(unsigned long p_port);
+void  scasid(unsigned char p_card, unsigned long p_port);
+unsigned char scxferc(unsigned long p_port, unsigned char p_data);
+unsigned char scsendi(unsigned long p_port, unsigned char p_id_string[]);
+unsigned char sciso(unsigned long p_port, unsigned char p_id_string[]);
+void  scwirod(unsigned long p_port, unsigned char p_data_bit);
+void  scwiros(unsigned long p_port, unsigned char p_data_bit);
+unsigned char scvalq(unsigned char p_quintet);
+unsigned char scsell(unsigned long p_port, unsigned char targ_id);
+void  scwtsel(unsigned long p_port);
+void  inisci(unsigned char p_card, unsigned long p_port, unsigned char p_our_id);
+void  scsavdi(unsigned char p_card, unsigned long p_port);
+unsigned char scmachid(unsigned char p_card, unsigned char p_id_string[]);
 
 
-void  autoCmdCmplt(ULONG p_port, UCHAR p_card);
-void  autoLoadDefaultMap(ULONG p_port);
+void  autoCmdCmplt(unsigned long p_port, unsigned char p_card);
+void  autoLoadDefaultMap(unsigned long p_port);
 
 
 
@@ -1708,7 +1675,7 @@ void  autoLoadDefaultMap(ULONG p_port);
 	void  OS_disable_int(unsigned char intvec);
 	void  OS_enable_int(unsigned char intvec);
 	void  OS_delay(unsigned long count);
-	int   OS_VirtToPhys(u32bits CardHandle, u32bits *physaddr, u32bits *virtaddr);
+	int   OS_VirtToPhys(u32 CardHandle, u32 *physaddr, u32 *virtaddr);
 
 #endif
 
@@ -1716,24 +1683,24 @@ extern SCCBCARD BL_Card[MAX_CARDS];
 extern SCCBMGR_TAR_INFO sccbMgrTbl[MAX_CARDS][MAX_SCSI_TAR];
 
 
-      extern void (*s_PhaseTbl[8]) (ULONG, UCHAR);
+      extern void (*s_PhaseTbl[8]) (unsigned long, unsigned char);
 
 extern SCCBSCAM_INFO scamInfo[MAX_SCSI_TAR];
 extern NVRAMINFO nvRamInfo[MAX_MB_CARDS];
-extern UCHAR scamHAString[];
+extern unsigned char scamHAString[];
 
 
-extern UCHAR mbCards;
+extern unsigned char mbCards;
 #if defined(BUGBUG)
-extern UCHAR debug_int[MAX_CARDS][debug_size];
-extern UCHAR debug_index[MAX_CARDS];
-void Debug_Load(UCHAR p_card, UCHAR p_bug_data);
+extern unsigned char debug_int[MAX_CARDS][debug_size];
+extern unsigned char debug_index[MAX_CARDS];
+void Debug_Load(unsigned char p_card, unsigned char p_bug_data);
 #endif
 
 
 
 #if defined(BUGBUG)
-void Debug_Load(UCHAR p_card, UCHAR p_bug_data);
+void Debug_Load(unsigned char p_card, unsigned char p_bug_data);
 #endif
 
 extern unsigned int SccbGlobalFlags;
@@ -1745,8 +1712,8 @@ extern unsigned int SccbGlobalFlags;
 #define mOS_Lock(card)    OS_Lock((PSCCBMGR_INFO)(((PSCCBcard)card)->cardInfo))
 #define mOS_UnLock(card)  OS_UnLock((PSCCBMGR_INFO)(((PSCCBcard)card)->cardInfo))
 #else /* FW_TYPE==_UCB_MGR_ */
-#define mOS_Lock(card)    OS_Lock((u32bits)(((PSCCBcard)card)->ioPort))
-#define mOS_UnLock(card)  OS_UnLock((u32bits)(((PSCCBcard)card)->ioPort))
+#define mOS_Lock(card)    OS_Lock((u32)(((PSCCBcard)card)->ioPort))
+#define mOS_UnLock(card)  OS_UnLock((u32)(((PSCCBcard)card)->ioPort))
 #endif
 
 
@@ -1755,15 +1722,15 @@ extern SCCBMGR_TAR_INFO sccbMgrTbl[MAX_C
 extern SCCBCARD BL_Card[MAX_CARDS];
 
 extern NVRAMINFO nvRamInfo[MAX_MB_CARDS];
-extern UCHAR mbCards;
+extern unsigned char mbCards;
 
-      extern void (*s_PhaseTbl[8]) (ULONG, UCHAR);
+      extern void (*s_PhaseTbl[8]) (unsigned long, unsigned char);
 
 
 #if defined(BUGBUG)
-extern UCHAR debug_int[MAX_CARDS][debug_size];
-extern UCHAR debug_index[MAX_CARDS];
-void Debug_Load(UCHAR p_card, UCHAR p_bug_data);
+extern unsigned char debug_int[MAX_CARDS][debug_size];
+extern unsigned char debug_index[MAX_CARDS];
+void Debug_Load(unsigned char p_card, unsigned char p_bug_data);
 #endif
 */
 
@@ -1779,11 +1746,11 @@ void Debug_Load(UCHAR p_card, UCHAR p_bu
 
 int SccbMgr_sense_adapter(PSCCBMGR_INFO pCardInfo)
 {
-   static UCHAR first_time = 1;
+   static unsigned char first_time = 1;
 
-   UCHAR i,j,id,ScamFlg;
-   USHORT temp,temp2,temp3,temp4,temp5,temp6;
-   ULONG ioport;
+   unsigned char i,j,id,ScamFlg;
+   unsigned short temp,temp2,temp3,temp4,temp5,temp6;
+   unsigned long ioport;
 	PNVRamInfo pCurrNvRam;
 
    ioport = pCardInfo->si_baseaddr;
@@ -1852,8 +1819,8 @@ int SccbMgr_sense_adapter(PSCCBMGR_INFO 
 	if(pCurrNvRam)
 		pCardInfo->si_id = pCurrNvRam->niAdapId;
 	else
-	   pCardInfo->si_id = (UCHAR)(utilEERead(ioport, (ADAPTER_SCSI_ID/2)) &
-   	   (UCHAR)0x0FF);
+	   pCardInfo->si_id = (unsigned char)(utilEERead(ioport, (ADAPTER_SCSI_ID/2)) &
+   	   (unsigned char)0x0FF);
 
    pCardInfo->si_lun = 0x00;
    pCardInfo->si_fw_revision = ORION_FW_REV;
@@ -1866,11 +1833,11 @@ int SccbMgr_sense_adapter(PSCCBMGR_INFO 
    for (id = 0; id < (16/2); id++) {
 
 		if(pCurrNvRam){
-			temp = (USHORT) pCurrNvRam->niSyncTbl[id];
+			temp = (unsigned short) pCurrNvRam->niSyncTbl[id];
 			temp = ((temp & 0x03) + ((temp << 4) & 0xc0)) +
 					 (((temp << 4) & 0x0300) + ((temp << 8) & 0xc000));
 		}else
-	      temp = utilEERead(ioport, (USHORT)((SYNC_RATE_TBL/2)+id));
+	      temp = utilEERead(ioport, (unsigned short)((SYNC_RATE_TBL/2)+id));
 
       for (i = 0; i < 2; temp >>=8,i++) {
 
@@ -1909,12 +1876,12 @@ int SccbMgr_sense_adapter(PSCCBMGR_INFO 
 	if(pCurrNvRam)
 		i = pCurrNvRam->niSysConf;
 	else
-	   i = (UCHAR)(utilEERead(ioport, (SYSTEM_CONFIG/2)));
+	   i = (unsigned char)(utilEERead(ioport, (SYSTEM_CONFIG/2)));
 
 	if(pCurrNvRam)
 		ScamFlg = pCurrNvRam->niScamConf;
 	else
-	   ScamFlg = (UCHAR) utilEERead(ioport, SCAM_CONFIG/2);
+	   ScamFlg = (unsigned char) utilEERead(ioport, SCAM_CONFIG/2);
 
    pCardInfo->si_flags = 0x0000;
 
@@ -1974,11 +1941,11 @@ int SccbMgr_sense_adapter(PSCCBMGR_INFO 
 		}
 	}else{
 	   temp = utilEERead(ioport, (MODEL_NUMB_0/2));
-   	pCardInfo->si_card_model[0] = (UCHAR)(temp >> 8);
+   	pCardInfo->si_card_model[0] = (unsigned char)(temp >> 8);
 	   temp = utilEERead(ioport, (MODEL_NUMB_2/2));
 
-   	pCardInfo->si_card_model[1] = (UCHAR)(temp & 0x00FF);
-	   pCardInfo->si_card_model[2] = (UCHAR)(temp >> 8);
+   	pCardInfo->si_card_model[1] = (unsigned char)(temp & 0x00FF);
+	   pCardInfo->si_card_model[2] = (unsigned char)(temp >> 8);
 	}
 
    if (pCardInfo->si_card_model[1] == '3')
@@ -2033,7 +2000,7 @@ int SccbMgr_sense_adapter(PSCCBMGR_INFO 
 	   logical card number sorted by BIOS (zero-based) */
 
 	pCardInfo->si_relative_cardnum =
-	(UCHAR)(RD_HARPOON(ioport+hp_aramBase+BIOS_RELATIVE_CARD)-1);
+	(unsigned char)(RD_HARPOON(ioport+hp_aramBase+BIOS_RELATIVE_CARD)-1);
 
    SGRAM_ACCESS(ioport);
 
@@ -2054,7 +2021,7 @@ int SccbMgr_sense_adapter(PSCCBMGR_INFO 
    for (i = 0; i < MAX_CARDS; i++) {
 
       for (id=0; id<debug_size; id++)
-         debug_int[i][id] =  (UCHAR)0x00;
+         debug_int[i][id] =  (unsigned char)0x00;
       debug_index[i] = 0;
       }
 
@@ -2072,13 +2039,13 @@ int SccbMgr_sense_adapter(PSCCBMGR_INFO 
  *
  *---------------------------------------------------------------------*/
 
-ULONG SccbMgr_config_adapter(PSCCBMGR_INFO pCardInfo)
+unsigned long SccbMgr_config_adapter(PSCCBMGR_INFO pCardInfo)
 {
    PSCCBcard CurrCard = NULL;
 	PNVRamInfo pCurrNvRam;
-   UCHAR i,j,thisCard, ScamFlg;
-   USHORT temp,sync_bit_map,id;
-   ULONG ioport;
+   unsigned char i,j,thisCard, ScamFlg;
+   unsigned short temp,sync_bit_map,id;
+   unsigned long ioport;
 
    ioport = pCardInfo->si_baseaddr;
 
@@ -2120,7 +2087,7 @@ ULONG SccbMgr_config_adapter(PSCCBMGR_IN
 		ScamFlg = pCurrNvRam->niScamConf;
 	}
 	else{
-	   ScamFlg = (UCHAR) utilEERead(ioport, SCAM_CONFIG/2);
+	   ScamFlg = (unsigned char) utilEERead(ioport, SCAM_CONFIG/2);
 	}
 
 
@@ -2145,7 +2112,7 @@ ULONG SccbMgr_config_adapter(PSCCBMGR_IN
    WR_HARPOON(ioport+hp_arb_id, pCardInfo->si_id);
    CurrCard->ourId = pCardInfo->si_id;
 
-   i = (UCHAR) pCardInfo->si_flags;
+   i = (unsigned char) pCardInfo->si_flags;
    if (i & SCSI_PARITY_ENA)
        WR_HARPOON(ioport+hp_portctrl_1,(HOST_MODE8 | CHK_SCSI_P));
 
@@ -2215,23 +2182,23 @@ ULONG SccbMgr_config_adapter(PSCCBMGR_IN
    for (id = 0; id < (MAX_SCSI_TAR/2); id++) {
 
 		if(pCurrNvRam){
-			temp = (USHORT) pCurrNvRam->niSyncTbl[id];
+			temp = (unsigned short) pCurrNvRam->niSyncTbl[id];
 			temp = ((temp & 0x03) + ((temp << 4) & 0xc0)) +
 					 (((temp << 4) & 0x0300) + ((temp << 8) & 0xc000));
 		}else
-	      temp = utilEERead(ioport, (USHORT)((SYNC_RATE_TBL/2)+id));
+	      temp = utilEERead(ioport, (unsigned short)((SYNC_RATE_TBL/2)+id));
 
       for (i = 0; i < 2; temp >>=8,i++) {
 
          if (pCardInfo->si_per_targ_init_sync & sync_bit_map) {
 
-            sccbMgrTbl[thisCard][id*2+i].TarEEValue = (UCHAR)temp;
+            sccbMgrTbl[thisCard][id*2+i].TarEEValue = (unsigned char)temp;
             }
 
          else {
 	    sccbMgrTbl[thisCard][id*2+i].TarStatus |= SYNC_SUPPORTED;
             sccbMgrTbl[thisCard][id*2+i].TarEEValue =
-               (UCHAR)(temp & ~EE_SYNC_MASK);
+               (unsigned char)(temp & ~EE_SYNC_MASK);
             }
 
 #if defined(WIDE_SCSI)
@@ -2261,16 +2228,16 @@ ULONG SccbMgr_config_adapter(PSCCBMGR_IN
       }
 
    WR_HARPOON((ioport+hp_semaphore),
-      (UCHAR)(RD_HARPOON((ioport+hp_semaphore)) | SCCB_MGR_PRESENT));
+      (unsigned char)(RD_HARPOON((ioport+hp_semaphore)) | SCCB_MGR_PRESENT));
 
-   return((ULONG)CurrCard);
+   return((unsigned long)CurrCard);
 }
 
 #else  			/* end (FW_TYPE==_SCCB_MGR_)  */
 
 
 
-STATIC s16bits FP_PresenceCheck(PMGR_INFO pMgrInfo)
+STATIC s16 FP_PresenceCheck(PMGR_INFO pMgrInfo)
 {
 	PMGR_ENTRYPNTS	pMgr_EntryPnts = &pMgrInfo->mi_Functions;
 
@@ -2295,7 +2262,7 @@ STATIC s16bits FP_PresenceCheck(PMGR_INF
 
       pMgrInfo->mi_SGListFormat=0x01;
       pMgrInfo->mi_DataPtrFormat=0x01;
-      pMgrInfo->mi_MaxSGElements= (u16bits) 0xffffffff;
+      pMgrInfo->mi_MaxSGElements= (u16) 0xffffffff;
       pMgrInfo->mi_MgrPrivateLen=sizeof(SCCB);
       pMgrInfo->mi_PCIVendorID=BL_VENDOR_ID;
       pMgrInfo->mi_PCIDeviceID=FP_DEVICE_ID;
@@ -2316,12 +2283,12 @@ STATIC s16bits FP_PresenceCheck(PMGR_INF
  * Description: Setup and/or Search for cards and return info to caller.
  *
  *---------------------------------------------------------------------*/
-STATIC s32bits probe_adapter(PADAPTER_INFO pAdapterInfo)
+STATIC s32 probe_adapter(PADAPTER_INFO pAdapterInfo)
 {
-   u16bits temp,temp2,temp3,temp4;
-   u08bits i,j,id;
+   u16 temp,temp2,temp3,temp4;
+   u8 i,j,id;
 
-   static u08bits first_time = 1;
+   static u8 first_time = 1;
    BASE_PORT ioport;
 	PNVRamInfo pCurrNvRam;
 
@@ -2394,8 +2361,8 @@ STATIC s32bits probe_adapter(PADAPTER_IN
 	if(pCurrNvRam)
 		pAdapterInfo->ai_id = pCurrNvRam->niAdapId;
 	else
-   	pAdapterInfo->ai_id = (u08bits)(utilEERead(ioport, (ADAPTER_SCSI_ID/2)) &
-      	(u08bits)0x0FF);
+   	pAdapterInfo->ai_id = (u8)(utilEERead(ioport, (ADAPTER_SCSI_ID/2)) &
+      	(u8)0x0FF);
 
    pAdapterInfo->ai_lun = 0x00;
    pAdapterInfo->ai_fw_revision[0] = '3';
@@ -2411,11 +2378,11 @@ STATIC s32bits probe_adapter(PADAPTER_IN
    for (id = 0; id < (16/2); id++) {
 
 		if(pCurrNvRam){
-			temp = (USHORT) pCurrNvRam->niSyncTbl[id];
+			temp = (unsigned short) pCurrNvRam->niSyncTbl[id];
 			temp = ((temp & 0x03) + ((temp << 4) & 0xc0)) +
 					 (((temp << 4) & 0x0300) + ((temp << 8) & 0xc000));
 		}else
-	      temp = utilEERead(ioport, (u16bits)((SYNC_RATE_TBL/2)+id));
+	      temp = utilEERead(ioport, (u16)((SYNC_RATE_TBL/2)+id));
 
       for (i = 0; i < 2; temp >>=8,i++) {
 
@@ -2458,7 +2425,7 @@ STATIC s32bits probe_adapter(PADAPTER_IN
 	if(pCurrNvRam)
 		i = pCurrNvRam->niSysConf;
 	else
-   	i = (u08bits)(utilEERead(ioport, (SYSTEM_CONFIG/2)));
+   	i = (u8)(utilEERead(ioport, (SYSTEM_CONFIG/2)));
 
    /*
    ** interrupts always level-triggered for FlashPoint
@@ -2476,7 +2443,7 @@ STATIC s32bits probe_adapter(PADAPTER_IN
 		}
 		else
 		{
-		j = (u08bits) utilEERead(ioport, SCAM_CONFIG/2);
+		j = (u8) utilEERead(ioport, SCAM_CONFIG/2);
 		}
 		if(j & SCAM_ENABLED)
 		{
@@ -2564,11 +2531,11 @@ STATIC s32bits probe_adapter(PADAPTER_IN
 		}
 	}else{
 	   temp = utilEERead(ioport, (MODEL_NUMB_0/2));
-		pAdapterInfo->ai_card_model[0] = (u08bits)(temp >> 8);
+		pAdapterInfo->ai_card_model[0] = (u8)(temp >> 8);
 	   temp = utilEERead(ioport, (MODEL_NUMB_2/2));
 
-		pAdapterInfo->ai_card_model[1] = (u08bits)(temp & 0x00FF);
-	   pAdapterInfo->ai_card_model[2] = (u08bits)(temp >> 8);
+		pAdapterInfo->ai_card_model[1] = (u8)(temp & 0x00FF);
+	   pAdapterInfo->ai_card_model[2] = (u8)(temp >> 8);
 	}
 
 
@@ -2623,7 +2590,7 @@ STATIC s32bits probe_adapter(PADAPTER_IN
 
 
 	pAdapterInfo->ai_relative_cardnum = 
-      (u08bits)(RD_HARPOON(ioport+hp_aramBase+BIOS_RELATIVE_CARD)-1); 
+      (u8)(RD_HARPOON(ioport+hp_aramBase+BIOS_RELATIVE_CARD)-1); 
 
    SGRAM_ACCESS(ioport);
 
@@ -2644,7 +2611,7 @@ STATIC s32bits probe_adapter(PADAPTER_IN
    for (i = 0; i < MAX_CARDS; i++) {
 
       for (id=0; id<debug_size; id++)
-         debug_int[i][id] =  (u08bits)0x00;
+         debug_int[i][id] =  (u8)0x00;
       debug_index[i] = 0;
       }
 
@@ -2669,8 +2636,8 @@ STATIC CARD_HANDLE init_adapter(PADAPTER
 {
    PSCCBcard CurrCard;
 	PNVRamInfo pCurrNvRam;
-   u08bits i,j,thisCard, ScamFlg;
-   u16bits temp,sync_bit_map,id;
+   u8 i,j,thisCard, ScamFlg;
+   u16 temp,sync_bit_map,id;
    BASE_PORT ioport;
 
    ioport = (BASE_PORT)pCardInfo->ai_baseaddr;
@@ -2714,7 +2681,7 @@ STATIC CARD_HANDLE init_adapter(PADAPTER
 		ScamFlg = pCurrNvRam->niScamConf;
 	}
 	else{
-	   ScamFlg = (UCHAR) utilEERead(ioport, SCAM_CONFIG/2);
+	   ScamFlg = (unsigned char) utilEERead(ioport, SCAM_CONFIG/2);
 	}
 	
 
@@ -2739,7 +2706,7 @@ STATIC CARD_HANDLE init_adapter(PADAPTER
    WR_HARPOON(ioport+hp_arb_id, pCardInfo->ai_id);
    CurrCard->ourId = (unsigned char) pCardInfo->ai_id;
 
-   i = (u08bits) pCardInfo->ai_stateinfo;
+   i = (u8) pCardInfo->ai_stateinfo;
    if (i & SCSI_PARITY_ENA)
        WR_HARPOON(ioport+hp_portctrl_1,(HOST_MODE8 | CHK_SCSI_P));
 
@@ -2758,7 +2725,7 @@ STATIC CARD_HANDLE init_adapter(PADAPTER
 
       sresb(ioport,thisCard);
 
-         scini(thisCard, (u08bits) pCardInfo->ai_id, 0);
+         scini(thisCard, (u8) pCardInfo->ai_id, 0);
       }
 
 
@@ -2808,23 +2775,23 @@ STATIC CARD_HANDLE init_adapter(PADAPTER
    for (id = 0; id < (MAX_SCSI_TAR/2); id++){
 
 		if(pCurrNvRam){
-			temp = (USHORT) pCurrNvRam->niSyncTbl[id];
+			temp = (unsigned short) pCurrNvRam->niSyncTbl[id];
 			temp = ((temp & 0x03) + ((temp << 4) & 0xc0)) +
 					 (((temp << 4) & 0x0300) + ((temp << 8) & 0xc000));
 		}else
-	      temp = utilEERead(ioport, (u16bits)((SYNC_RATE_TBL/2)+id));
+	      temp = utilEERead(ioport, (u16)((SYNC_RATE_TBL/2)+id));
 
       for (i = 0; i < 2; temp >>=8,i++){
 
          if (pCardInfo->ai_per_targ_init_sync & sync_bit_map){
 
-            sccbMgrTbl[thisCard][id*2+i].TarEEValue = (u08bits)temp;
+            sccbMgrTbl[thisCard][id*2+i].TarEEValue = (u8)temp;
             }
 
          else {
             sccbMgrTbl[thisCard][id*2+i].TarStatus |= SYNC_SUPPORTED;
             sccbMgrTbl[thisCard][id*2+i].TarEEValue =
-               (u08bits)(temp & ~EE_SYNC_MASK);
+               (u8)(temp & ~EE_SYNC_MASK);
             }
 
 #if defined(WIDE_SCSI)
@@ -2856,9 +2823,9 @@ STATIC CARD_HANDLE init_adapter(PADAPTER
    pCardInfo->ai_AEN_mask &= SCSI_RESET_COMPLETE;
 
    WR_HARPOON((ioport+hp_semaphore),
-      (u08bits)(RD_HARPOON((ioport+hp_semaphore)) | SCCB_MGR_PRESENT));
+      (u8)(RD_HARPOON((ioport+hp_semaphore)) | SCCB_MGR_PRESENT));
 
-   return((u32bits)CurrCard);
+   return((u32)CurrCard);
 
 }
 
@@ -2875,8 +2842,8 @@ STATIC CARD_HANDLE init_adapter(PADAPTER
 void build_UCB(CARD_HANDLE pCurrCard, PUCB p_ucb)
 {
 
-   u08bits thisCard;
-   u08bits i,j;
+   u8 thisCard;
+   u8 i,j;
 
    PSCCB p_sccb;
 
@@ -2911,7 +2878,7 @@ void build_UCB(CARD_HANDLE pCurrCard, PU
 
    if (p_ucb->UCB_opcode & OPC_TQ_ENABLE)
    {
-      p_sccb->ControlByte = (u08bits)((p_ucb->UCB_opcode & OPC_TQ_MASK)>>2) | F_USE_CMD_Q;
+      p_sccb->ControlByte = (u8)((p_ucb->UCB_opcode & OPC_TQ_MASK)>>2) | F_USE_CMD_Q;
    }
    else
    {
@@ -2919,7 +2886,7 @@ void build_UCB(CARD_HANDLE pCurrCard, PU
    }
 
 
-   p_sccb->CdbLength = (u08bits)p_ucb->UCB_cdblen;
+   p_sccb->CdbLength = (u8)p_ucb->UCB_cdblen;
 
    if (p_ucb->UCB_opcode & OPC_NO_AUTO_SENSE)
    {
@@ -2934,7 +2901,7 @@ void build_UCB(CARD_HANDLE pCurrCard, PU
    if (p_ucb->UCB_opcode & OPC_XFER_SG)
    {
       p_sccb->DataPointer=p_ucb->UCB_virt_dataptr;
-      p_sccb->DataLength = (((u32bits)p_ucb->UCB_NumSgElements)<<3);
+      p_sccb->DataLength = (((u32)p_ucb->UCB_NumSgElements)<<3);
    }
    else
    {
@@ -2971,7 +2938,7 @@ STATIC  int GetDevSyncRate(PSCCBcard pCu
 	struct _SYNC_RATE_INFO * pSyncStr;
    PSCCBMgr_tar_info currTar_Info;
 	BASE_PORT ioport;
-	u08bits scsiID, j;
+	u8 scsiID, j;
 
 #if (FW_TYPE != _SCCB_MGR_)
 	if( p_ucb->UCB_targid >= pCurrCard->cardInfo->ai_MaxTarg )
@@ -2982,7 +2949,7 @@ STATIC  int GetDevSyncRate(PSCCBcard pCu
 
 	ioport  = pCurrCard->ioPort;
 	pSyncStr	= (struct _SYNC_RATE_INFO *) p_ucb->UCB_virt_dataptr;
-	scsiID = (u08bits) p_ucb->UCB_targid;
+	scsiID = (u8) p_ucb->UCB_targid;
    currTar_Info = &sccbMgrTbl[pCurrCard->cardIndex][scsiID];
 	j = currTar_Info->TarSyncCtrl;
 
@@ -3051,11 +3018,11 @@ STATIC int SetDevSyncRate(PSCCBcard pCur
 	struct _SYNC_RATE_INFO * pSyncStr;
    PSCCBMgr_tar_info currTar_Info;
 	BASE_PORT ioPort;
-	u08bits scsiID, i, j, syncVal;
-	u16bits syncOffset, actualXferRate;
+	u8 scsiID, i, j, syncVal;
+	u16 syncOffset, actualXferRate;
 	union {
-		u08bits tempb[2];
-		u16bits tempw;
+		u8 tempb[2];
+		u16 tempw;
 	}temp2;
 
 #if (FW_TYPE != _SCCB_MGR_)
@@ -3067,7 +3034,7 @@ STATIC int SetDevSyncRate(PSCCBcard pCur
 
 	ioPort  = pCurrCard->ioPort;
 	pSyncStr	= (struct _SYNC_RATE_INFO *) p_ucb->UCB_virt_dataptr;
-	scsiID = (u08bits) p_ucb->UCB_targid;
+	scsiID = (u8) p_ucb->UCB_targid;
    currTar_Info = &sccbMgrTbl[pCurrCard->cardIndex][scsiID];
 	i = RD_HARPOON(ioPort+hp_xfer_pad);		/* Save current value */
 	WR_HARPOON(ioPort+hp_xfer_pad, (i | ID_UNLOCK));
@@ -3124,9 +3091,9 @@ STATIC int SetDevSyncRate(PSCCBcard pCur
  *---------------------------------------------------------------------*/
 int GetDevWideMode(PSCCBcard pCurrCard,PUCB p_ucb)
 {
-	u08bits *pData;
+	u8 *pData;
 
-	pData = (u08bits *)p_ucb->UCB_virt_dataptr;
+	pData = (u8 *)p_ucb->UCB_virt_dataptr;
 	if(sccbMgrTbl[pCurrCard->cardIndex][p_ucb->UCB_targid].TarEEValue
 				& EE_WIDE_SCSI)
 	{
@@ -3147,14 +3114,14 @@ int GetDevWideMode(PSCCBcard pCurrCard,P
  *---------------------------------------------------------------------*/
 int SetDevWideMode(PSCCBcard pCurrCard,PUCB p_ucb)
 {
-	u08bits *pData;
+	u8 *pData;
    PSCCBMgr_tar_info currTar_Info;
 	BASE_PORT ioPort;
-	u08bits scsiID, scsiWideMode;
-	u16bits syncOffset;
+	u8 scsiID, scsiWideMode;
+	u16 syncOffset;
 	union {
-		u08bits tempb[2];
-		u16bits tempw;
+		u8 tempb[2];
+		u16 tempw;
 	}temp2;
 
 #if (FW_TYPE != _SCCB_MGR_)
@@ -3170,8 +3137,8 @@ int SetDevWideMode(PSCCBcard pCurrCard,P
 #endif
 
 	ioPort  = pCurrCard->ioPort;
-	pData = (u08bits *)p_ucb->UCB_virt_dataptr;
-	scsiID = (u08bits) p_ucb->UCB_targid;
+	pData = (u8 *)p_ucb->UCB_virt_dataptr;
+	scsiID = (u8) p_ucb->UCB_targid;
 	currTar_Info = &sccbMgrTbl[pCurrCard->cardIndex][scsiID];
 
 	if(*pData)
@@ -3224,21 +3191,21 @@ int SetDevWideMode(PSCCBcard pCurrCard,P
  *---------------------------------------------------------------------*/
 void ReadNVRam(PSCCBcard pCurrCard,PUCB p_ucb)
 {
-	u08bits *pdata;
-	u16bits i,numwrds,numbytes,offset,temp;
-	u08bits OneMore = FALSE;
-	u32bits ioport;
+	u8 *pdata;
+	u16 i,numwrds,numbytes,offset,temp;
+	u8 OneMore = FALSE;
+	u32 ioport;
 
-	numbytes = (u16bits) p_ucb->UCB_datalen;
+	numbytes = (u16) p_ucb->UCB_datalen;
 	ioport  = pCurrCard->ioPort;
-   pdata   = (u08bits *) p_ucb->UCB_virt_dataptr;
-	offset  = (u16bits) (p_ucb->UCB_IOCTLParams[0]);
+   pdata   = (u8 *) p_ucb->UCB_virt_dataptr;
+	offset  = (u16) (p_ucb->UCB_IOCTLParams[0]);
 
 
 
    if (offset & 0x1)
 	{
-	    *((u16bits*) pdata) = utilEERead(ioport,(u16bits)((offset - 1) / 2)); /* 16 bit read */
+	    *((u16*) pdata) = utilEERead(ioport,(u16)((offset - 1) / 2)); /* 16 bit read */
 		 *pdata = *(pdata + 1);
 		 ++offset;
    	 ++pdata;
@@ -3251,7 +3218,7 @@ void ReadNVRam(PSCCBcard pCurrCard,PUCB 
 
 	for (i = 0; i < numwrds; i++)
 	{
-   	*((u16bits*) pdata) = utilEERead(ioport,(u16bits)(offset / 2));
+   	*((u16*) pdata) = utilEERead(ioport,(u16)(offset / 2));
 		pdata += 2;
 		offset += 2;
    }
@@ -3259,8 +3226,8 @@ void ReadNVRam(PSCCBcard pCurrCard,PUCB 
 	{
 		--pdata;
 		-- offset;
-   	temp = utilEERead(ioport,(u16bits)(offset / 2));
-		*pdata = (u08bits) (temp);
+   	temp = utilEERead(ioport,(u16)(offset / 2));
+		*pdata = (u8) (temp);
 	}
 
 } /* end proc ReadNVRam */
@@ -3273,20 +3240,20 @@ void ReadNVRam(PSCCBcard pCurrCard,PUCB 
  *---------------------------------------------------------------------*/
 void WriteNVRam(PSCCBcard pCurrCard,PUCB p_ucb)
 {
-	u08bits *pdata;
-	u16bits i,numwrds,numbytes,offset, eeprom_end;
-	u08bits OneMore = FALSE;
+	u8 *pdata;
+	u16 i,numwrds,numbytes,offset, eeprom_end;
+	u8 OneMore = FALSE;
 	union {
-		u08bits  tempb[2];
-		u16bits  tempw;
+		u8  tempb[2];
+		u16  tempw;
 	} temp2;
 
-	u32bits ioport;
+	u32 ioport;
 
-	numbytes = (u16bits) p_ucb->UCB_datalen;
+	numbytes = (u16) p_ucb->UCB_datalen;
 	ioport  = pCurrCard->ioPort;
-   pdata   = (u08bits *) p_ucb->UCB_virt_dataptr;
-	offset  = (u16bits) (p_ucb->UCB_IOCTLParams[0]);
+   pdata   = (u8 *) p_ucb->UCB_virt_dataptr;
+	offset  = (u16) (p_ucb->UCB_IOCTLParams[0]);
 
    if (RD_HARPOON(ioport+hp_page_ctrl) & NARROW_SCSI_CARD)
       eeprom_end = 512;
@@ -3305,9 +3272,9 @@ void WriteNVRam(PSCCBcard pCurrCard,PUCB
 
    if (offset & 0x1)
 	{
-	    temp2.tempw = utilEERead(ioport,(u16bits)((offset - 1) / 2)); /* 16 bit read */
+	    temp2.tempw = utilEERead(ioport,(u16)((offset - 1) / 2)); /* 16 bit read */
 		 temp2.tempb[1] = *pdata;
-	    utilEEWrite(ioport, temp2.tempw, (u16bits)((offset -1) / 2));
+	    utilEEWrite(ioport, temp2.tempw, (u16)((offset -1) / 2));
 		 *pdata = *(pdata + 1);
 		 ++offset;
    	 ++pdata;
@@ -3320,19 +3287,19 @@ void WriteNVRam(PSCCBcard pCurrCard,PUCB
 
 	for (i = 0; i < numwrds; i++)
 	{
-   	utilEEWrite(ioport, *((pu16bits)pdata),(u16bits)(offset / 2));
+   	utilEEWrite(ioport, *((u16 *)pdata),(u16)(offset / 2));
 		pdata += 2;
 		offset += 2;
    }
 	if (OneMore)
 	{
 
-   	temp2.tempw = utilEERead(ioport,(u16bits)(offset / 2));
+   	temp2.tempw = utilEERead(ioport,(u16)(offset / 2));
 		temp2.tempb[0] = *pdata;
-   	utilEEWrite(ioport, temp2.tempw, (u16bits)(offset / 2));
+   	utilEEWrite(ioport, temp2.tempw, (u16)(offset / 2));
 	}
    utilEEWriteOnOff(ioport,0);   /* Turn off write access */
-   UpdateCheckSum((u32bits)ioport);
+   UpdateCheckSum((u32)ioport);
 
 } /* end proc WriteNVRam */
 
@@ -3347,9 +3314,9 @@ void WriteNVRam(PSCCBcard pCurrCard,PUCB
  *---------------------------------------------------------------------*/
 
 
-void UpdateCheckSum(u32bits baseport)
+void UpdateCheckSum(u32 baseport)
 {
-	USHORT i,sum_data, eeprom_end;
+	unsigned short i,sum_data, eeprom_end;
 
 	sum_data = 0x0000;
 
@@ -3391,14 +3358,14 @@ void SccbMgr_restore_native_state(CARD_H
 #if (FW_TYPE==_UCB_MGR_)
 void SccbMgr_unload_card(CARD_HANDLE pCurrCard)
 #else
-void SccbMgr_unload_card(ULONG pCurrCard)
+void SccbMgr_unload_card(unsigned long pCurrCard)
 #endif
 {
-	UCHAR i;
-	ULONG portBase;
-	ULONG regOffset;
-	ULONG scamData;
-	ULONG *pScamTbl;
+	unsigned char i;
+	unsigned long portBase;
+	unsigned long regOffset;
+	unsigned long scamData;
+	unsigned long *pScamTbl;
 	PNVRamInfo pCurrNvRam;
 
 	pCurrNvRam = ((PSCCBcard)pCurrCard)->pNvRamInfo;
@@ -3411,13 +3378,13 @@ void SccbMgr_unload_card(ULONG pCurrCard
 		WrStack(pCurrNvRam->niBaseAddr, 4, pCurrNvRam->niAdapId);
 
 		for(i = 0; i < MAX_SCSI_TAR / 2; i++)
-			WrStack(pCurrNvRam->niBaseAddr, (UCHAR)(i+5), pCurrNvRam->niSyncTbl[i]);
+			WrStack(pCurrNvRam->niBaseAddr, (unsigned char)(i+5), pCurrNvRam->niSyncTbl[i]);
 
 		portBase = pCurrNvRam->niBaseAddr;
 
 		for(i = 0; i < MAX_SCSI_TAR; i++){
 			regOffset = hp_aramBase + 64 + i*4;
-			pScamTbl = (ULONG *) &pCurrNvRam->niScamTbl[i];
+			pScamTbl = (unsigned long *) &pCurrNvRam->niScamTbl[i];
 			scamData = *pScamTbl;
 			WR_HARP32(portBase, regOffset, scamData);
 		}
@@ -3431,11 +3398,11 @@ void SccbMgr_unload_card(ULONG pCurrCard
 
 void RNVRamData(PNVRamInfo pNvRamInfo)
 {
-	UCHAR i;
-	ULONG portBase;
-	ULONG regOffset;
-	ULONG scamData;
-	ULONG *pScamTbl;
+	unsigned char i;
+	unsigned long portBase;
+	unsigned long regOffset;
+	unsigned long scamData;
+	unsigned long *pScamTbl;
 
 	pNvRamInfo->niModel    = RdStack(pNvRamInfo->niBaseAddr, 0);
 	pNvRamInfo->niSysConf  = RdStack(pNvRamInfo->niBaseAddr, 1);
@@ -3444,26 +3411,26 @@ void RNVRamData(PNVRamInfo pNvRamInfo)
 	pNvRamInfo->niAdapId   = RdStack(pNvRamInfo->niBaseAddr, 4);
 
 	for(i = 0; i < MAX_SCSI_TAR / 2; i++)
-		pNvRamInfo->niSyncTbl[i] = RdStack(pNvRamInfo->niBaseAddr, (UCHAR)(i+5));
+		pNvRamInfo->niSyncTbl[i] = RdStack(pNvRamInfo->niBaseAddr, (unsigned char)(i+5));
 
 	portBase = pNvRamInfo->niBaseAddr;
 
 	for(i = 0; i < MAX_SCSI_TAR; i++){
 		regOffset = hp_aramBase + 64 + i*4;
 		RD_HARP32(portBase, regOffset, scamData);
-		pScamTbl = (ULONG *) &pNvRamInfo->niScamTbl[i];
+		pScamTbl = (unsigned long *) &pNvRamInfo->niScamTbl[i];
 		*pScamTbl = scamData;
 	}
 
 }
 
-UCHAR RdStack(ULONG portBase, UCHAR index)
+unsigned char RdStack(unsigned long portBase, unsigned char index)
 {
 	WR_HARPOON(portBase + hp_stack_addr, index);
 	return(RD_HARPOON(portBase + hp_stack_data));
 }
 
-void WrStack(ULONG portBase, UCHAR index, UCHAR data)
+void WrStack(unsigned long portBase, unsigned char index, unsigned char data)
 {
 	WR_HARPOON(portBase + hp_stack_addr, index);
 	WR_HARPOON(portBase + hp_stack_data, data);
@@ -3471,9 +3438,9 @@ void WrStack(ULONG portBase, UCHAR index
 
 
 #if (FW_TYPE==_UCB_MGR_)
-u08bits ChkIfChipInitialized(BASE_PORT ioPort)
+u8 ChkIfChipInitialized(BASE_PORT ioPort)
 #else
-UCHAR ChkIfChipInitialized(ULONG ioPort)
+unsigned char ChkIfChipInitialized(unsigned long ioPort)
 #endif
 {
 	if((RD_HARPOON(ioPort + hp_arb_id) & 0x0f) != RdStack(ioPort, 4))
@@ -3499,11 +3466,11 @@ UCHAR ChkIfChipInitialized(ULONG ioPort)
 #if (FW_TYPE==_UCB_MGR_)
 void SccbMgr_start_sccb(CARD_HANDLE pCurrCard, PUCB p_ucb)
 #else
-void SccbMgr_start_sccb(ULONG pCurrCard, PSCCB p_Sccb)
+void SccbMgr_start_sccb(unsigned long pCurrCard, PSCCB p_Sccb)
 #endif
 {
-   ULONG ioport;
-   UCHAR thisCard, lun;
+   unsigned long ioport;
+   unsigned char thisCard, lun;
 	PSCCB pSaveSccb;
    CALL_BK_FN callback;
 
@@ -3768,17 +3735,17 @@ void SccbMgr_start_sccb(ULONG pCurrCard,
  *
  *---------------------------------------------------------------------*/
 #if (FW_TYPE==_UCB_MGR_)
-s32bits SccbMgr_abort_sccb(CARD_HANDLE pCurrCard, PUCB p_ucb)
+s32 SccbMgr_abort_sccb(CARD_HANDLE pCurrCard, PUCB p_ucb)
 #else
-int SccbMgr_abort_sccb(ULONG pCurrCard, PSCCB p_Sccb)
+int SccbMgr_abort_sccb(unsigned long pCurrCard, PSCCB p_Sccb)
 #endif
 
 {
-	ULONG ioport;
+	unsigned long ioport;
 
-	UCHAR thisCard;
+	unsigned char thisCard;
 	CALL_BK_FN callback;
-	UCHAR TID;
+	unsigned char TID;
 	PSCCB pSaveSCCB;
 	PSCCBMgr_tar_info currTar_Info;
 
@@ -3811,7 +3778,7 @@ int SccbMgr_abort_sccb(ULONG pCurrCard, 
 
 			if (!((PSCCBcard)pCurrCard)->cmdCounter)
 				WR_HARPOON(ioport+hp_semaphore,(RD_HARPOON(ioport+hp_semaphore)
-					& (UCHAR)(~(SCCB_MGR_ACTIVE | TICKLE_ME)) ));
+					& (unsigned char)(~(SCCB_MGR_ACTIVE | TICKLE_ME)) ));
 
 #if (FW_TYPE==_SCCB_MGR_)
 			p_Sccb->SccbStatus = SCCB_ABORT;
@@ -3898,12 +3865,12 @@ int SccbMgr_abort_sccb(ULONG pCurrCard, 
  *
  *---------------------------------------------------------------------*/
 #if (FW_TYPE==_UCB_MGR_)
-u08bits SccbMgr_my_int(CARD_HANDLE pCurrCard)
+u8 SccbMgr_my_int(CARD_HANDLE pCurrCard)
 #else
-UCHAR SccbMgr_my_int(ULONG pCurrCard)
+unsigned char SccbMgr_my_int(unsigned long pCurrCard)
 #endif
 {
-   ULONG ioport;
+   unsigned long ioport;
 
    ioport = ((PSCCBcard)pCurrCard)->ioPort;
 
@@ -3931,16 +3898,16 @@ UCHAR SccbMgr_my_int(ULONG pCurrCard)
  *
  *---------------------------------------------------------------------*/
 #if (FW_TYPE==_UCB_MGR_)
-s32bits SccbMgr_isr(CARD_HANDLE pCurrCard)
+s32 SccbMgr_isr(CARD_HANDLE pCurrCard)
 #else
-int SccbMgr_isr(ULONG pCurrCard)
+int SccbMgr_isr(unsigned long pCurrCard)
 #endif
 {
    PSCCB currSCCB;
-   UCHAR thisCard,result,bm_status, bm_int_st;
-   USHORT hp_int;
-   UCHAR i, target;
-   ULONG ioport;
+   unsigned char thisCard,result,bm_status, bm_int_st;
+   unsigned short hp_int;
+   unsigned char i, target;
+   unsigned long ioport;
 
    mOS_Lock((PSCCBcard)pCurrCard);
 
@@ -3954,7 +3921,7 @@ int SccbMgr_isr(ULONG pCurrCard)
 #endif
 
    if ((bm_int_st=RD_HARPOON(ioport+hp_int_status)) & EXT_STATUS_ON)
-		bm_status = RD_HARPOON(ioport+hp_ext_status) & (UCHAR)BAD_EXT_STATUS;
+		bm_status = RD_HARPOON(ioport+hp_ext_status) & (unsigned char)BAD_EXT_STATUS;
    else
       bm_status = 0;
 
@@ -3969,7 +3936,7 @@ int SccbMgr_isr(ULONG pCurrCard)
        currSCCB = ((PSCCBcard)pCurrCard)->currentSCCB;
 
 #if defined(BUGBUG)
-   Debug_Load(thisCard,(UCHAR) 0XFF);
+   Debug_Load(thisCard,(unsigned char) 0XFF);
    Debug_Load(thisCard,bm_int_st);
 
    Debug_Load(thisCard,hp_int_0);
@@ -4110,7 +4077,7 @@ int SccbMgr_isr(ULONG pCurrCard)
       else if ( (hp_int & IUNKWN) || (hp_int & PROG_HLT) )
 		   {
 	 	   WRW_HARPOON((ioport+hp_intstat), (PHASE | IUNKWN | PROG_HLT));
-	 	   if ((RD_HARPOON(ioport+hp_prgmcnt_0) & (UCHAR)0x3f)< (UCHAR)SELCHK)
+	 	   if ((RD_HARPOON(ioport+hp_prgmcnt_0) & (unsigned char)0x3f)< (unsigned char)SELCHK)
 	    		{
 	    		phaseDecode(ioport,thisCard);
 	    		}
@@ -4123,11 +4090,11 @@ int SccbMgr_isr(ULONG pCurrCard)
    reg. (0x53) also increment the FIFO write addr reg (0x6f), thus we
    need to read this reg first then restore it later. After update to 0x53 */
 
-	    		i = (UCHAR)(RD_HARPOON(ioport+hp_fifowrite));
-	    		target = (UCHAR)(RD_HARPOON(ioport+hp_gp_reg_3));
-	    		WR_HARPOON(ioport+hp_xfer_pad, (UCHAR) ID_UNLOCK);
-	    		WR_HARPOON(ioport+hp_select_id, (UCHAR)(target | target<<4));
-	    		WR_HARPOON(ioport+hp_xfer_pad, (UCHAR) 0x00);
+	    		i = (unsigned char)(RD_HARPOON(ioport+hp_fifowrite));
+	    		target = (unsigned char)(RD_HARPOON(ioport+hp_gp_reg_3));
+	    		WR_HARPOON(ioport+hp_xfer_pad, (unsigned char) ID_UNLOCK);
+	    		WR_HARPOON(ioport+hp_select_id, (unsigned char)(target | target<<4));
+	    		WR_HARPOON(ioport+hp_xfer_pad, (unsigned char) 0x00);
 	    		WR_HARPOON(ioport+hp_fifowrite, i);
 	    		WR_HARPOON(ioport+hp_autostart_3, (AUTO_IMMED+TAG_STRT));
 	    		}
@@ -4202,12 +4169,12 @@ int SccbMgr_isr(ULONG pCurrCard)
  *              processing time.
  *
  *---------------------------------------------------------------------*/
-UCHAR SccbMgr_bad_isr(ULONG p_port, UCHAR p_card, PSCCBcard pCurrCard, USHORT p_int)
+unsigned char SccbMgr_bad_isr(unsigned long p_port, unsigned char p_card, PSCCBcard pCurrCard, unsigned short p_int)
 {
 #if defined(HARP_REVX)
-   ULONG timer;
+   unsigned long timer;
 #endif
-UCHAR temp, ScamFlg;
+unsigned char temp, ScamFlg;
 PSCCBMgr_tar_info currTar_Info;
 PNVRamInfo pCurrNvRam;
 
@@ -4240,9 +4207,9 @@ PNVRamInfo pCurrNvRam;
 
          sxfrp(p_port,p_card);
 
-	     temp = (UCHAR)(RD_HARPOON(p_port+hp_ee_ctrl) &
+	     temp = (unsigned char)(RD_HARPOON(p_port+hp_ee_ctrl) &
 							(EXT_ARB_ACK | SCSI_TERM_ENA_H));
-      	WR_HARPOON(p_port+hp_ee_ctrl, ((UCHAR)temp | SEE_MS | SEE_CS));
+      	WR_HARPOON(p_port+hp_ee_ctrl, ((unsigned char)temp | SEE_MS | SEE_CS));
          WR_HARPOON(p_port+hp_ee_ctrl, temp);
 
          if (!(RDW_HARPOON((p_port+hp_intstat)) & (BUS_FREE | RESET)))
@@ -4277,7 +4244,7 @@ PNVRamInfo pCurrNvRam;
 					ScamFlg = pCurrNvRam->niScamConf;
 				}
 				else{
-				   ScamFlg = (UCHAR) utilEERead(p_port, SCAM_CONFIG/2);
+				   ScamFlg = (unsigned char) utilEERead(p_port, SCAM_CONFIG/2);
 				}
 
            XbowInit(p_port, ScamFlg);
@@ -4388,10 +4355,10 @@ PNVRamInfo pCurrNvRam;
 #if (FW_TYPE==_UCB_MGR_)
 void SccbMgr_scsi_reset(CARD_HANDLE pCurrCard)
 #else
-void SccbMgr_scsi_reset(ULONG pCurrCard)
+void SccbMgr_scsi_reset(unsigned long pCurrCard)
 #endif
 {
-   UCHAR thisCard;
+   unsigned char thisCard;
 
    thisCard = ((PSCCBcard)pCurrCard)->cardIndex;
 
@@ -4448,7 +4415,7 @@ void SccbMgr_scsi_reset(ULONG pCurrCard)
 #if (FW_TYPE==_UCB_MGR_)
 void SccbMgr_timer_expired(CARD_HANDLE pCurrCard)
 #else
-void SccbMgr_timer_expired(ULONG pCurrCard)
+void SccbMgr_timer_expired(unsigned long pCurrCard)
 #endif
 {
 }
@@ -4464,7 +4431,7 @@ void SccbMgr_timer_expired(ULONG pCurrCa
 
 void SccbMgrTableInitAll()
 {
-   UCHAR thisCard;
+   unsigned char thisCard;
 
    for (thisCard = 0; thisCard < MAX_CARDS; thisCard++)
       {
@@ -4487,9 +4454,9 @@ void SccbMgrTableInitAll()
  *
  *---------------------------------------------------------------------*/
 
-void SccbMgrTableInitCard(PSCCBcard pCurrCard, UCHAR p_card)
+void SccbMgrTableInitCard(PSCCBcard pCurrCard, unsigned char p_card)
 {
-   UCHAR scsiID, qtag;
+   unsigned char scsiID, qtag;
 
 	for (qtag = 0; qtag < QUEUE_DEPTH; qtag++)
 	{
@@ -4522,10 +4489,10 @@ void SccbMgrTableInitCard(PSCCBcard pCur
  *
  *---------------------------------------------------------------------*/
 
-void SccbMgrTableInitTarget(UCHAR p_card, UCHAR target)
+void SccbMgrTableInitTarget(unsigned char p_card, unsigned char target)
 {
 
-	UCHAR lun, qtag;
+	unsigned char lun, qtag;
 	PSCCBMgr_tar_info currTar_Info;
 
 	currTar_Info = &sccbMgrTbl[p_card][target];
@@ -4565,7 +4532,7 @@ void SccbMgrTableInitTarget(UCHAR p_card
  *****************************************************************/
 
 
-void Debug_Load(UCHAR p_card, UCHAR p_bug_data)
+void Debug_Load(unsigned char p_card, unsigned char p_bug_data)
 {
    debug_int[p_card][debug_index[p_card]] = p_bug_data;
    debug_index[p_card]++;
@@ -4596,24 +4563,24 @@ NVRAMINFO nvRamInfo[MAX_MB_CARDS] = { { 
 
 
 #if defined(__STDC__)
-void (*s_PhaseTbl[8]) (ULONG, UCHAR) = { 0 };
+void (*s_PhaseTbl[8]) (unsigned long, unsigned char) = { 0 };
 #else
 void (*s_PhaseTbl[8]) ();
 #endif
 
 
-UCHAR mbCards = 0;
-UCHAR scamHAString[] = {0x63, 0x07, 'B', 'U', 'S', 'L', 'O', 'G', 'I', 'C', \
+unsigned char mbCards = 0;
+unsigned char scamHAString[] = {0x63, 0x07, 'B', 'U', 'S', 'L', 'O', 'G', 'I', 'C', \
 								' ', 'B', 'T', '-', '9', '3', '0', \
 								0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, \
 								0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20};
 
-USHORT default_intena = 0;
+unsigned short default_intena = 0;
 
 #if defined(BUGBUG)
-UCHAR    debug_int[MAX_CARDS][debug_size] = { 0 };
-UCHAR    debug_index[MAX_CARDS] = { 0 };
-UCHAR    reserved_1[3] = { 0 };
+unsigned char    debug_int[MAX_CARDS][debug_size] = { 0 };
+unsigned char    debug_index[MAX_CARDS] = { 0 };
+unsigned char    reserved_1[3] = { 0 };
 #endif
 
 /* Functions for handling SCSI bus functions such as selection/reselection,
@@ -4623,7 +4590,7 @@ UCHAR    reserved_1[3] = { 0 };
 extern SCCBCARD BL_Card[MAX_CARDS];
 extern SCCBMGR_TAR_INFO sccbMgrTbl[MAX_CARDS][MAX_SCSI_TAR];
 #if defined(BUGBUG)
-void Debug_Load(UCHAR p_card, UCHAR p_bug_data);
+void Debug_Load(unsigned char p_card, unsigned char p_bug_data);
 #endif
 */
 
@@ -4636,10 +4603,10 @@ void Debug_Load(UCHAR p_card, UCHAR p_bu
  *
  *---------------------------------------------------------------------*/
 
-UCHAR sfm(ULONG port, PSCCB pCurrSCCB)
+unsigned char sfm(unsigned long port, PSCCB pCurrSCCB)
 {
-	UCHAR message;
-	USHORT TimeOutLoop;
+	unsigned char message;
+	unsigned short TimeOutLoop;
 
 	TimeOutLoop = 0;
 	while( (!(RD_HARPOON(port+hp_scsisig) & SCSI_REQ)) &&
@@ -4709,16 +4676,16 @@ UCHAR sfm(ULONG port, PSCCB pCurrSCCB)
  *
  *---------------------------------------------------------------------*/
 
-void ssel(ULONG port, UCHAR p_card)
+void ssel(unsigned long port, unsigned char p_card)
 {
 
-   UCHAR auto_loaded, i, target, *theCCB;
+   unsigned char auto_loaded, i, target, *theCCB;
 
-   ULONG cdb_reg;
+   unsigned long cdb_reg;
    PSCCBcard CurrCard;
    PSCCB currSCCB;
    PSCCBMgr_tar_info currTar_Info;
-   UCHAR lastTag, lun;
+   unsigned char lastTag, lun;
 
    CurrCard = &BL_Card[p_card];
    currSCCB = CurrCard->currentSCCB;
@@ -4869,8 +4836,8 @@ void ssel(ULONG port, UCHAR p_card)
       WRW_HARPOON((port+ID_MSG_STRT+2),BRH_OP+ALWAYS+CMDPZ);
 
 			WRW_HARPOON((port+SYNC_MSGS+0), (MPM_OP+AMSG_OUT+
-								(((UCHAR)(currSCCB->ControlByte & TAG_TYPE_MASK)
-								>> 6) | (UCHAR)0x20)));
+								(((unsigned char)(currSCCB->ControlByte & TAG_TYPE_MASK)
+								>> 6) | (unsigned char)0x20)));
 			WRW_HARPOON((port+SYNC_MSGS+2),
 							(MPM_OP+AMSG_OUT+currSCCB->Sccb_tag));
 			WRW_HARPOON((port+SYNC_MSGS+4), (BRH_OP+ALWAYS+NP ));
@@ -4932,8 +4899,8 @@ void ssel(ULONG port, UCHAR p_card)
             WRW_HARPOON((port+ID_MSG_STRT), (MPM_OP+AMSG_OUT+currSCCB->Sccb_idmsg));
 
             WRW_HARPOON((port+ID_MSG_STRT+2), (MPM_OP+AMSG_OUT+
-                        (((UCHAR)(currSCCB->ControlByte & TAG_TYPE_MASK)
-                        >> 6) | (UCHAR)0x20)));
+                        (((unsigned char)(currSCCB->ControlByte & TAG_TYPE_MASK)
+                        >> 6) | (unsigned char)0x20)));
 
 				for (i = 1; i < QUEUE_DEPTH; i++)
 				{
@@ -4979,7 +4946,7 @@ void ssel(ULONG port, UCHAR p_card)
          }
 
 
-      theCCB = (UCHAR *)&currSCCB->Cdb[0];
+      theCCB = (unsigned char *)&currSCCB->Cdb[0];
 
       cdb_reg = port + CMD_STRT;
 
@@ -4996,7 +4963,7 @@ void ssel(ULONG port, UCHAR p_card)
       }  /* auto_loaded */
 
 #if defined(WIDE_SCSI)
-   WRW_HARPOON((port+hp_fiforead), (USHORT) 0x00);
+   WRW_HARPOON((port+hp_fiforead), (unsigned short) 0x00);
    WR_HARPOON(port+hp_xferstat, 0x00);
 #endif
 
@@ -5012,7 +4979,7 @@ void ssel(ULONG port, UCHAR p_card)
    else
       {
 
-/*      auto_loaded =  (RD_HARPOON(port+hp_autostart_3) & (UCHAR)0x1F);
+/*      auto_loaded =  (RD_HARPOON(port+hp_autostart_3) & (unsigned char)0x1F);
       auto_loaded |= AUTO_IMMED; */
       auto_loaded = AUTO_IMMED;
 
@@ -5033,14 +5000,14 @@ void ssel(ULONG port, UCHAR p_card)
  *
  *---------------------------------------------------------------------*/
 
-void sres(ULONG port, UCHAR p_card, PSCCBcard pCurrCard)
+void sres(unsigned long port, unsigned char p_card, PSCCBcard pCurrCard)
 {
 
 #if defined(V302)
-   UCHAR our_target,message,lun,tag, msgRetryCount;
+   unsigned char our_target,message,lun,tag, msgRetryCount;
 
 #else  /* V302 */
-   UCHAR our_target, message, lun = 0, tag, msgRetryCount;
+   unsigned char our_target, message, lun = 0, tag, msgRetryCount;
 #endif /* V302 */
 
 
@@ -5105,11 +5072,11 @@ void sres(ULONG port, UCHAR p_card, PSCC
 	}
 
 #if defined(WIDE_SCSI)
-	WRW_HARPOON((port+hp_fiforead), (USHORT) 0x00);
+	WRW_HARPOON((port+hp_fiforead), (unsigned short) 0x00);
 #endif
 
 
-	our_target = (UCHAR)(RD_HARPOON(port+hp_select_id) >> 4);
+	our_target = (unsigned char)(RD_HARPOON(port+hp_select_id) >> 4);
 	currTar_Info = &sccbMgrTbl[p_card][our_target];
 
 
@@ -5147,7 +5114,7 @@ void sres(ULONG port, UCHAR p_card, PSCC
 
 				if (message <= (0x80 | LUN_MASK))
 				{
-					lun = message & (UCHAR)LUN_MASK;
+					lun = message & (unsigned char)LUN_MASK;
 
 					if ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) == TAG_Q_TRYING)
 					{
@@ -5311,9 +5278,9 @@ void sres(ULONG port, UCHAR p_card, PSCC
 
 #if defined(V302)
 
-UCHAR GetTarLun(ULONG port, UCHAR p_card, UCHAR our_target, PSCCBcard pCurrCard, PUCHAR tag, PUCHAR lun)
+unsigned char GetTarLun(unsigned long port, unsigned char p_card, unsigned char our_target, PSCCBcard pCurrCard, unsigned char * tag, unsigned char * lun)
 {
-   UCHAR message;
+   unsigned char message;
    PSCCBMgr_tar_info currTar_Info;
 
 
@@ -5341,7 +5308,7 @@ UCHAR GetTarLun(ULONG port, UCHAR p_card
 
 			if (message <= (0x80 | LUN_MASK))
 			{
-				*lun = message & (UCHAR)LUN_MASK;
+				*lun = message & (unsigned char)LUN_MASK;
 
 				if ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) == TAG_Q_TRYING)
 				{
@@ -5398,7 +5365,7 @@ UCHAR GetTarLun(ULONG port, UCHAR p_card
 
 #endif /* V302 */
 
-void SendMsg(ULONG port, UCHAR message)
+void SendMsg(unsigned long port, unsigned char message)
 {
 	while(!(RD_HARPOON(port+hp_scsisig) & SCSI_REQ))
 	{
@@ -5447,7 +5414,7 @@ void SendMsg(ULONG port, UCHAR message)
  *              target device.
  *
  *---------------------------------------------------------------------*/
-void sdecm(UCHAR message, ULONG port, UCHAR p_card)
+void sdecm(unsigned char message, unsigned long port, unsigned char p_card)
 {
 	PSCCB currSCCB;
 	PSCCBcard CurrCard;
@@ -5477,8 +5444,8 @@ void sdecm(UCHAR message, ULONG port, UC
 
 		if (currSCCB->Sccb_scsistat == SELECT_Q_ST)
 		{
-			currTar_Info->TarStatus &= ~(UCHAR)TAR_TAG_Q_MASK;
-			currTar_Info->TarStatus |= (UCHAR)TAG_Q_REJECT;
+			currTar_Info->TarStatus &= ~(unsigned char)TAR_TAG_Q_MASK;
+			currTar_Info->TarStatus |= (unsigned char)TAG_Q_REJECT;
 		}
 
 		ACCEPT_MSG(port);
@@ -5515,7 +5482,7 @@ void sdecm(UCHAR message, ULONG port, UC
 				if ((currSCCB->Sccb_scsistat == SELECT_SN_ST))
 				{
 
-					currTar_Info->TarStatus |= (UCHAR)SYNC_SUPPORTED;
+					currTar_Info->TarStatus |= (unsigned char)SYNC_SUPPORTED;
 
 					currTar_Info->TarEEValue &= ~EE_SYNC_MASK;
 				}
@@ -5536,7 +5503,7 @@ void sdecm(UCHAR message, ULONG port, UC
 				else if ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) == TAG_Q_TRYING )
 				{
 					currTar_Info->TarStatus = (currTar_Info->TarStatus &
-													~(UCHAR)TAR_TAG_Q_MASK) | TAG_Q_REJECT;
+													~(unsigned char)TAR_TAG_Q_MASK) | TAG_Q_REJECT;
 
 
 					currSCCB->ControlByte &= ~F_USE_CMD_Q;
@@ -5568,7 +5535,7 @@ void sdecm(UCHAR message, ULONG port, UC
 					currTar_Info->TarLUNBusy[0] = TRUE;
 
 
-				currSCCB->ControlByte &= ~(UCHAR)F_USE_CMD_Q;
+				currSCCB->ControlByte &= ~(unsigned char)F_USE_CMD_Q;
 
 				WR_HARPOON(port+hp_autostart_1, (AUTO_IMMED+DISCONNECT_START));
 
@@ -5628,9 +5595,9 @@ void sdecm(UCHAR message, ULONG port, UC
  * Description: Decide what to do with the extended message.
  *
  *---------------------------------------------------------------------*/
-void shandem(ULONG port, UCHAR p_card, PSCCB pCurrSCCB)
+void shandem(unsigned long port, unsigned char p_card, PSCCB pCurrSCCB)
 {
-	UCHAR length,message;
+	unsigned char length,message;
 
 	length = sfm(port,pCurrSCCB);
 	if (length) 
@@ -5709,7 +5676,7 @@ void shandem(ULONG port, UCHAR p_card, P
  *
  *---------------------------------------------------------------------*/
 
-UCHAR sisyncn(ULONG port, UCHAR p_card, UCHAR syncFlag)
+unsigned char sisyncn(unsigned long port, unsigned char p_card, unsigned char syncFlag)
 {
    PSCCB currSCCB;
    PSCCBMgr_tar_info currTar_Info;
@@ -5721,7 +5688,7 @@ UCHAR sisyncn(ULONG port, UCHAR p_card, 
 
 
       WRW_HARPOON((port+ID_MSG_STRT),
-                 (MPM_OP+AMSG_OUT+(currSCCB->Sccb_idmsg & ~(UCHAR)DISC_PRIV)));
+                 (MPM_OP+AMSG_OUT+(currSCCB->Sccb_idmsg & ~(unsigned char)DISC_PRIV)));
 
       WRW_HARPOON((port+ID_MSG_STRT+2),BRH_OP+ALWAYS+CMDPZ);
 
@@ -5755,7 +5722,7 @@ UCHAR sisyncn(ULONG port, UCHAR p_card, 
 		{
 		   WR_HARPOON(port+hp_autostart_3, (SELECT+SELCHK_STRT));
 	      currTar_Info->TarStatus = ((currTar_Info->TarStatus &
-   	      ~(UCHAR)TAR_SYNC_MASK) | (UCHAR)SYNC_TRYING);
+   	      ~(unsigned char)TAR_SYNC_MASK) | (unsigned char)SYNC_TRYING);
 		}
 		else
 		{
@@ -5768,7 +5735,7 @@ UCHAR sisyncn(ULONG port, UCHAR p_card, 
 
    else {
 
-      currTar_Info->TarStatus |=	 (UCHAR)SYNC_SUPPORTED;
+      currTar_Info->TarStatus |=	 (unsigned char)SYNC_SUPPORTED;
       currTar_Info->TarEEValue &= ~EE_SYNC_MASK;
       return(FALSE);
       }
@@ -5784,9 +5751,9 @@ UCHAR sisyncn(ULONG port, UCHAR p_card, 
  *              necessary.
  *
  *---------------------------------------------------------------------*/
-void stsyncn(ULONG port, UCHAR p_card)
+void stsyncn(unsigned long port, unsigned char p_card)
 {
-   UCHAR sync_msg,offset,sync_reg,our_sync_msg;
+   unsigned char sync_msg,offset,sync_reg,our_sync_msg;
    PSCCB currSCCB;
    PSCCBMgr_tar_info currTar_Info;
 
@@ -5896,7 +5863,7 @@ void stsyncn(ULONG port, UCHAR p_card)
       ACCEPT_MSG(port);
 
       currTar_Info->TarStatus = ((currTar_Info->TarStatus &
-         ~(UCHAR)TAR_SYNC_MASK) | (UCHAR)SYNC_SUPPORTED);
+         ~(unsigned char)TAR_SYNC_MASK) | (unsigned char)SYNC_SUPPORTED);
 
       WR_HARPOON(port+hp_autostart_1, (AUTO_IMMED+DISCONNECT_START));
       }
@@ -5909,7 +5876,7 @@ void stsyncn(ULONG port, UCHAR p_card)
       sisyncr(port,sync_msg,offset);
 
       currTar_Info->TarStatus = ((currTar_Info->TarStatus &
-         ~(UCHAR)TAR_SYNC_MASK) | (UCHAR)SYNC_SUPPORTED);
+         ~(unsigned char)TAR_SYNC_MASK) | (unsigned char)SYNC_SUPPORTED);
       }
 }
 
@@ -5921,7 +5888,7 @@ void stsyncn(ULONG port, UCHAR p_card)
  * Description: Answer the targets sync message.
  *
  *---------------------------------------------------------------------*/
-void sisyncr(ULONG port,UCHAR sync_pulse, UCHAR offset)
+void sisyncr(unsigned long port,unsigned char sync_pulse, unsigned char offset)
 {
    ARAM_ACCESS(port);
    WRW_HARPOON((port+SYNC_MSGS+0), (MPM_OP+AMSG_OUT+SMEXT ));
@@ -5954,7 +5921,7 @@ void sisyncr(ULONG port,UCHAR sync_pulse
  *
  *---------------------------------------------------------------------*/
 
-UCHAR siwidn(ULONG port, UCHAR p_card)
+unsigned char siwidn(unsigned long port, unsigned char p_card)
 {
    PSCCB currSCCB;
    PSCCBMgr_tar_info currTar_Info;
@@ -5966,7 +5933,7 @@ UCHAR siwidn(ULONG port, UCHAR p_card)
 
 
       WRW_HARPOON((port+ID_MSG_STRT),
-	              (MPM_OP+AMSG_OUT+(currSCCB->Sccb_idmsg & ~(UCHAR)DISC_PRIV)));
+	              (MPM_OP+AMSG_OUT+(currSCCB->Sccb_idmsg & ~(unsigned char)DISC_PRIV)));
 
       WRW_HARPOON((port+ID_MSG_STRT+2),BRH_OP+ALWAYS+CMDPZ);
 
@@ -5981,7 +5948,7 @@ UCHAR siwidn(ULONG port, UCHAR p_card)
 
 
       currTar_Info->TarStatus = ((currTar_Info->TarStatus &
-         ~(UCHAR)TAR_WIDE_MASK) | (UCHAR)WIDE_ENABLED);
+         ~(unsigned char)TAR_WIDE_MASK) | (unsigned char)WIDE_ENABLED);
 
       return(TRUE);
       }
@@ -5989,7 +5956,7 @@ UCHAR siwidn(ULONG port, UCHAR p_card)
    else {
 
       currTar_Info->TarStatus = ((currTar_Info->TarStatus &
-               ~(UCHAR)TAR_WIDE_MASK) | WIDE_NEGOCIATED);
+               ~(unsigned char)TAR_WIDE_MASK) | WIDE_NEGOCIATED);
 
       currTar_Info->TarEEValue &= ~EE_WIDE_SCSI;
       return(FALSE);
@@ -6006,9 +5973,9 @@ UCHAR siwidn(ULONG port, UCHAR p_card)
  *              necessary.
  *
  *---------------------------------------------------------------------*/
-void stwidn(ULONG port, UCHAR p_card)
+void stwidn(unsigned long port, unsigned char p_card)
 {
-   UCHAR width;
+   unsigned char width;
    PSCCB currSCCB;
    PSCCBMgr_tar_info currTar_Info;
 
@@ -6086,7 +6053,7 @@ void stwidn(ULONG port, UCHAR p_card)
  * Description: Answer the targets Wide nego message.
  *
  *---------------------------------------------------------------------*/
-void siwidr(ULONG port, UCHAR width)
+void siwidr(unsigned long port, unsigned char width)
 {
    ARAM_ACCESS(port);
    WRW_HARPOON((port+SYNC_MSGS+0), (MPM_OP+AMSG_OUT+SMEXT ));
@@ -6117,9 +6084,9 @@ void siwidr(ULONG port, UCHAR width)
  *              ID specified.
  *
  *---------------------------------------------------------------------*/
-void sssyncv(ULONG p_port, UCHAR p_id, UCHAR p_sync_value,PSCCBMgr_tar_info currTar_Info)
+void sssyncv(unsigned long p_port, unsigned char p_id, unsigned char p_sync_value,PSCCBMgr_tar_info currTar_Info)
 {
-   UCHAR index;
+   unsigned char index;
 
    index = p_id;
 
@@ -6188,9 +6155,9 @@ void sssyncv(ULONG p_port, UCHAR p_id, U
  * Description: Reset the desired card's SCSI bus.
  *
  *---------------------------------------------------------------------*/
-void sresb(ULONG port, UCHAR p_card)
+void sresb(unsigned long port, unsigned char p_card)
 {
-   UCHAR scsiID, i;
+   unsigned char scsiID, i;
 
    PSCCBMgr_tar_info currTar_Info;
 
@@ -6263,7 +6230,7 @@ void sresb(ULONG port, UCHAR p_card)
  *---------------------------------------------------------------------*/
 void ssenss(PSCCBcard pCurrCard)
 {
-   UCHAR i;
+   unsigned char i;
    PSCCB currSCCB;
 
    currSCCB = pCurrCard->currentSCCB;
@@ -6278,7 +6245,7 @@ void ssenss(PSCCBcard pCurrCard)
 
    currSCCB->CdbLength = SIX_BYTE_CMD;
    currSCCB->Cdb[0]    = SCSI_REQUEST_SENSE;
-   currSCCB->Cdb[1]    = currSCCB->Cdb[1] & (UCHAR)0xE0; /*Keep LUN. */
+   currSCCB->Cdb[1]    = currSCCB->Cdb[1] & (unsigned char)0xE0; /*Keep LUN. */
    currSCCB->Cdb[2]    = 0x00;
    currSCCB->Cdb[3]    = 0x00;
    currSCCB->Cdb[4]    = currSCCB->RequestSenseLength;
@@ -6292,7 +6259,7 @@ void ssenss(PSCCBcard pCurrCard)
 
    currSCCB->Sccb_XferState &= ~F_SG_XFER;
 
-   currSCCB->Sccb_idmsg = currSCCB->Sccb_idmsg & ~(UCHAR)DISC_PRIV;
+   currSCCB->Sccb_idmsg = currSCCB->Sccb_idmsg & ~(unsigned char)DISC_PRIV;
 
    currSCCB->ControlByte = 0x00;
 
@@ -6310,9 +6277,9 @@ void ssenss(PSCCBcard pCurrCard)
  *
  *---------------------------------------------------------------------*/
 
-void sxfrp(ULONG p_port, UCHAR p_card)
+void sxfrp(unsigned long p_port, unsigned char p_card)
 {
-   UCHAR curr_phz;
+   unsigned char curr_phz;
 
 
    DISABLE_AUTO(p_port);
@@ -6331,7 +6298,7 @@ void sxfrp(ULONG p_port, UCHAR p_card)
 
    WR_HARPOON(p_port+hp_xfercnt_0, 0x00);
 
-   curr_phz = RD_HARPOON(p_port+hp_scsisig) & (UCHAR)S_SCSI_PHZ;
+   curr_phz = RD_HARPOON(p_port+hp_scsisig) & (unsigned char)S_SCSI_PHZ;
 
    WRW_HARPOON((p_port+hp_intstat), XFER_CNT_0);
 
@@ -6339,9 +6306,9 @@ void sxfrp(ULONG p_port, UCHAR p_card)
    WR_HARPOON(p_port+hp_scsisig, curr_phz);
 
    while ( !(RDW_HARPOON((p_port+hp_intstat)) & (BUS_FREE | RESET)) &&
-      (curr_phz == (RD_HARPOON(p_port+hp_scsisig) & (UCHAR)S_SCSI_PHZ)) )
+      (curr_phz == (RD_HARPOON(p_port+hp_scsisig) & (unsigned char)S_SCSI_PHZ)) )
       {
-      if (curr_phz & (UCHAR)SCSI_IOBIT)
+      if (curr_phz & (unsigned char)SCSI_IOBIT)
          {
       	WR_HARPOON(p_port+hp_portctrl_0, (SCSI_PORT | HOST_PORT | SCSI_INBIT));
 
@@ -6392,10 +6359,10 @@ void sxfrp(ULONG p_port, UCHAR p_card)
  *
  *---------------------------------------------------------------------*/
 
-void schkdd(ULONG port, UCHAR p_card)
+void schkdd(unsigned long port, unsigned char p_card)
 {
-   USHORT TimeOutLoop;
-	UCHAR sPhase;
+   unsigned short TimeOutLoop;
+	unsigned char sPhase;
 
    PSCCB currSCCB;
 
@@ -6417,7 +6384,7 @@ void schkdd(ULONG port, UCHAR p_card)
       currSCCB->Sccb_XferCnt = 1;
 
       currSCCB->Sccb_XferState &= ~F_ODD_BALL_CNT;
-      WRW_HARPOON((port+hp_fiforead), (USHORT) 0x00);
+      WRW_HARPOON((port+hp_fiforead), (unsigned short) 0x00);
       WR_HARPOON(port+hp_xferstat, 0x00);
       }
 
@@ -6449,7 +6416,7 @@ void schkdd(ULONG port, UCHAR p_card)
       if (RDW_HARPOON((port+hp_intstat)) & BUS_FREE) {
 	      return;
    	   }
-      if (RD_HARPOON(port+hp_offsetctr) & (UCHAR)0x1F) {
+      if (RD_HARPOON(port+hp_offsetctr) & (unsigned char)0x1F) {
 	      break;
    	   }
       if (RDW_HARPOON((port+hp_intstat)) & RESET) {
@@ -6461,7 +6428,7 @@ void schkdd(ULONG port, UCHAR p_card)
 
 	sPhase = RD_HARPOON(port+hp_scsisig) & (SCSI_BSY | S_SCSI_PHZ);
    if ((!(RD_HARPOON(port+hp_xferstat) & FIFO_EMPTY))                     ||
-      (RD_HARPOON(port+hp_offsetctr) & (UCHAR)0x1F)                       ||
+      (RD_HARPOON(port+hp_offsetctr) & (unsigned char)0x1F)                       ||
       (sPhase == (SCSI_BSY | S_DATAO_PH)) ||
       (sPhase == (SCSI_BSY | S_DATAI_PH)))
       {
@@ -6505,7 +6472,7 @@ void schkdd(ULONG port, UCHAR p_card)
  *
  *---------------------------------------------------------------------*/
 
-void sinits(PSCCB p_sccb, UCHAR p_card)
+void sinits(PSCCB p_sccb, unsigned char p_card)
 {
    PSCCBMgr_tar_info currTar_Info;
 
@@ -6550,12 +6517,12 @@ void sinits(PSCCB p_sccb, UCHAR p_card)
 */
    if ((currTar_Info->TarStatus & TAR_ALLOW_DISC) ||
       (currTar_Info->TarStatus & TAG_Q_TRYING)) {
-      p_sccb->Sccb_idmsg      = (UCHAR)(SMIDENT | DISC_PRIV) | p_sccb->Lun;
+      p_sccb->Sccb_idmsg      = (unsigned char)(SMIDENT | DISC_PRIV) | p_sccb->Lun;
       }
 
    else {
 
-      p_sccb->Sccb_idmsg      = (UCHAR)SMIDENT | p_sccb->Lun;
+      p_sccb->Sccb_idmsg      = (unsigned char)SMIDENT | p_sccb->Lun;
       }
 
    p_sccb->HostStatus         = 0x00;
@@ -6583,7 +6550,7 @@ void sinits(PSCCB p_sccb, UCHAR p_card)
 extern SCCBCARD BL_Card[MAX_CARDS];
 extern SCCBMGR_TAR_INFO sccbMgrTbl[MAX_CARDS][MAX_SCSI_TAR];
 
-      extern void (*s_PhaseTbl[8]) (ULONG, UCHAR);
+      extern void (*s_PhaseTbl[8]) (unsigned long, unsigned char);
 */
 
 /*---------------------------------------------------------------------
@@ -6594,15 +6561,15 @@ extern SCCBMGR_TAR_INFO sccbMgrTbl[MAX_C
  *
  *---------------------------------------------------------------------*/
 
-void phaseDecode(ULONG p_port, UCHAR p_card)
+void phaseDecode(unsigned long p_port, unsigned char p_card)
 {
    unsigned char phase_ref;
-      void (*phase) (ULONG, UCHAR);
+      void (*phase) (unsigned long, unsigned char);
 
 
    DISABLE_AUTO(p_port);
 
-   phase_ref = (UCHAR) (RD_HARPOON(p_port+hp_scsisig) & S_SCSI_PHZ);
+   phase_ref = (unsigned char) (RD_HARPOON(p_port+hp_scsisig) & S_SCSI_PHZ);
 
    phase = s_PhaseTbl[phase_ref];
 
@@ -6619,7 +6586,7 @@ void phaseDecode(ULONG p_port, UCHAR p_c
  *
  *---------------------------------------------------------------------*/
 
-void phaseDataOut(ULONG port, UCHAR p_card)
+void phaseDataOut(unsigned long port, unsigned char p_card)
 {
 
    PSCCB currSCCB;
@@ -6670,7 +6637,7 @@ void phaseDataOut(ULONG port, UCHAR p_ca
  *
  *---------------------------------------------------------------------*/
 
-void phaseDataIn(ULONG port, UCHAR p_card)
+void phaseDataIn(unsigned long port, unsigned char p_card)
 {
 
    PSCCB currSCCB;
@@ -6717,11 +6684,11 @@ void phaseDataIn(ULONG port, UCHAR p_car
  *
  *---------------------------------------------------------------------*/
 
-void phaseCommand(ULONG p_port, UCHAR p_card)
+void phaseCommand(unsigned long p_port, unsigned char p_card)
 {
    PSCCB currSCCB;
-   ULONG cdb_reg;
-   UCHAR i;
+   unsigned long cdb_reg;
+   unsigned char i;
 
    currSCCB = BL_Card[p_card].currentSCCB;
 
@@ -6769,7 +6736,7 @@ void phaseCommand(ULONG p_port, UCHAR p_
  *
  *---------------------------------------------------------------------*/
 
-void phaseStatus(ULONG port, UCHAR p_card)
+void phaseStatus(unsigned long port, unsigned char p_card)
 {
    /* Start-up the automation to finish off this command and let the
       isr handle the interrupt for command complete when it comes in.
@@ -6791,9 +6758,9 @@ void phaseStatus(ULONG port, UCHAR p_car
  *
  *---------------------------------------------------------------------*/
 
-void phaseMsgOut(ULONG port, UCHAR p_card)
+void phaseMsgOut(unsigned long port, unsigned char p_card)
 {
-	UCHAR message,scsiID;
+	unsigned char message,scsiID;
 	PSCCB currSCCB;
 	PSCCBMgr_tar_info currTar_Info;
 
@@ -6939,9 +6906,9 @@ void phaseMsgOut(ULONG port, UCHAR p_car
  *
  *---------------------------------------------------------------------*/
 
-void phaseMsgIn(ULONG port, UCHAR p_card)
+void phaseMsgIn(unsigned long port, unsigned char p_card)
 {
-	UCHAR message;
+	unsigned char message;
 	PSCCB currSCCB;
 
 	currSCCB = BL_Card[p_card].currentSCCB;
@@ -6992,7 +6959,7 @@ void phaseMsgIn(ULONG port, UCHAR p_card
  *
  *---------------------------------------------------------------------*/
 
-void phaseIllegal(ULONG port, UCHAR p_card)
+void phaseIllegal(unsigned long port, unsigned char p_card)
 {
    PSCCB currSCCB;
 
@@ -7020,9 +6987,9 @@ void phaseIllegal(ULONG port, UCHAR p_ca
  *
  *---------------------------------------------------------------------*/
 
-void phaseChkFifo(ULONG port, UCHAR p_card)
+void phaseChkFifo(unsigned long port, unsigned char p_card)
 {
-   ULONG xfercnt;
+   unsigned long xfercnt;
    PSCCB currSCCB;
 
    currSCCB = BL_Card[p_card].currentSCCB;
@@ -7098,7 +7065,7 @@ void phaseChkFifo(ULONG port, UCHAR p_ca
  *              because of command complete or from a disconnect.
  *
  *---------------------------------------------------------------------*/
-void phaseBusFree(ULONG port, UCHAR p_card)
+void phaseBusFree(unsigned long port, unsigned char p_card)
 {
    PSCCB currSCCB;
 
@@ -7128,7 +7095,7 @@ void phaseBusFree(ULONG port, UCHAR p_ca
       else if(currSCCB->Sccb_scsistat == SELECT_SN_ST)
 	      {
 	      sccbMgrTbl[p_card][currSCCB->TargID].TarStatus |=
-			         (UCHAR)SYNC_SUPPORTED;
+			         (unsigned char)SYNC_SUPPORTED;
 	      sccbMgrTbl[p_card][currSCCB->TargID].TarEEValue &= ~EE_SYNC_MASK;
 	      }
 
@@ -7201,9 +7168,9 @@ extern SCCBCARD BL_Card[MAX_CARDS];
  * Description: Load the Automation RAM with the defualt map values.
  *
  *---------------------------------------------------------------------*/
-void autoLoadDefaultMap(ULONG p_port)
+void autoLoadDefaultMap(unsigned long p_port)
 {
-   ULONG map_addr;
+   unsigned long map_addr;
 
    ARAM_ACCESS(p_port);
    map_addr = p_port + hp_aramBase;
@@ -7309,10 +7276,10 @@ void autoLoadDefaultMap(ULONG p_port)
  *
  *---------------------------------------------------------------------*/
 
-void autoCmdCmplt(ULONG p_port, UCHAR p_card)
+void autoCmdCmplt(unsigned long p_port, unsigned char p_card)
 {
    PSCCB currSCCB;
-   UCHAR status_byte;
+   unsigned char status_byte;
 
    currSCCB = BL_Card[p_card].currentSCCB;
 
@@ -7359,7 +7326,7 @@ void autoCmdCmplt(ULONG p_port, UCHAR p_
       if(currSCCB->Sccb_scsistat == SELECT_SN_ST)
          {
          sccbMgrTbl[p_card][currSCCB->TargID].TarStatus |=
-            (UCHAR)SYNC_SUPPORTED;
+            (unsigned char)SYNC_SUPPORTED;
 
 	      sccbMgrTbl[p_card][currSCCB->TargID].TarEEValue &= ~EE_SYNC_MASK;
          BL_Card[p_card].globalFlags |= F_NEW_SCCB_CMD;
@@ -7548,7 +7515,7 @@ extern SCCBMGR_TAR_INFO sccbMgrTbl[MAX_C
 #define LONG_WAIT    0x0000FFFFL
 
 #if defined(BUGBUG)
-void Debug_Load(UCHAR p_card, UCHAR p_bug_data);
+void Debug_Load(unsigned char p_card, unsigned char p_bug_data);
 #endif
 
 /*---------------------------------------------------------------------
@@ -7569,7 +7536,7 @@ void Debug_Load(UCHAR p_card, UCHAR p_bu
  *              
  *---------------------------------------------------------------------*/
 
-void dataXferProcessor(ULONG port, PSCCBcard pCurrCard)
+void dataXferProcessor(unsigned long port, PSCCBcard pCurrCard)
 {
    PSCCB currSCCB;
 
@@ -7580,7 +7547,7 @@ void dataXferProcessor(ULONG port, PSCCB
 			if (pCurrCard->globalFlags & F_HOST_XFER_ACT)
 
 				{
-		   	currSCCB->Sccb_sgseg += (UCHAR)SG_BUF_CNT;
+		   	currSCCB->Sccb_sgseg += (unsigned char)SG_BUF_CNT;
          	currSCCB->Sccb_SGoffset = 0x00; 
  				}
 			pCurrCard->globalFlags |= F_HOST_XFER_ACT;
@@ -7607,21 +7574,21 @@ void dataXferProcessor(ULONG port, PSCCB
  * Description:
  *
  *---------------------------------------------------------------------*/
-void busMstrSGDataXferStart(ULONG p_port, PSCCB pcurrSCCB)
+void busMstrSGDataXferStart(unsigned long p_port, PSCCB pcurrSCCB)
 {
-   ULONG count,addr,tmpSGCnt;
-   UINT sg_index;
-   UCHAR sg_count, i;
-   ULONG reg_offset;
+   unsigned long count,addr,tmpSGCnt;
+   unsigned int sg_index;
+   unsigned char sg_count, i;
+   unsigned long reg_offset;
 
 
    if (pcurrSCCB->Sccb_XferState & F_HOST_XFER_DIR) {
 
-      count =  ((ULONG) HOST_RD_CMD)<<24;
+      count =  ((unsigned long) HOST_RD_CMD)<<24;
       }
 
    else {
-      count =  ((ULONG) HOST_WRT_CMD)<<24;
+      count =  ((unsigned long) HOST_WRT_CMD)<<24;
       }
 
    sg_count = 0;
@@ -7630,21 +7597,21 @@ void busMstrSGDataXferStart(ULONG p_port
    reg_offset = hp_aramBase;
 
 
-	i = (UCHAR) (RD_HARPOON(p_port+hp_page_ctrl) & ~(SGRAM_ARAM|SCATTER_EN));
+	i = (unsigned char) (RD_HARPOON(p_port+hp_page_ctrl) & ~(SGRAM_ARAM|SCATTER_EN));
 
 
 	WR_HARPOON(p_port+hp_page_ctrl, i);
 
-   while ((sg_count < (UCHAR)SG_BUF_CNT) &&
-      ((ULONG)(sg_index * (UINT)SG_ELEMENT_SIZE) < pcurrSCCB->DataLength) ) {
+   while ((sg_count < (unsigned char)SG_BUF_CNT) &&
+      ((unsigned long)(sg_index * (unsigned int)SG_ELEMENT_SIZE) < pcurrSCCB->DataLength) ) {
 
-      tmpSGCnt += *(((ULONG *)pcurrSCCB->DataPointer)+
+      tmpSGCnt += *(((unsigned long *)pcurrSCCB->DataPointer)+
          (sg_index * 2));
 
-      count |= *(((ULONG *)pcurrSCCB->DataPointer)+
+      count |= *(((unsigned long *)pcurrSCCB->DataPointer)+
          (sg_index * 2));
 
-      addr = *(((ULONG *)pcurrSCCB->DataPointer)+
+      addr = *(((unsigned long *)pcurrSCCB->DataPointer)+
          ((sg_index * 2) + 1));
 
 
@@ -7700,7 +7667,7 @@ void busMstrSGDataXferStart(ULONG p_port
       }
 
 
-   WR_HARPOON(p_port+hp_page_ctrl, (UCHAR) (i | SCATTER_EN));
+   WR_HARPOON(p_port+hp_page_ctrl, (unsigned char) (i | SCATTER_EN));
 
 }
 
@@ -7712,15 +7679,15 @@ void busMstrSGDataXferStart(ULONG p_port
  * Description: 
  *
  *---------------------------------------------------------------------*/
-void busMstrDataXferStart(ULONG p_port, PSCCB pcurrSCCB)
+void busMstrDataXferStart(unsigned long p_port, PSCCB pcurrSCCB)
 {
-   ULONG addr,count;
+   unsigned long addr,count;
 
    if (!(pcurrSCCB->Sccb_XferState & F_AUTO_SENSE)) {
 
       count = pcurrSCCB->Sccb_XferCnt;
 
-      addr = (ULONG) pcurrSCCB->DataPointer + pcurrSCCB->Sccb_ATC;
+      addr = (unsigned long) pcurrSCCB->DataPointer + pcurrSCCB->Sccb_ATC;
       }
 
    else {
@@ -7765,9 +7732,9 @@ void busMstrDataXferStart(ULONG p_port, 
  *               command busy is also time out, it'll just give up.
  *
  *---------------------------------------------------------------------*/
-UCHAR busMstrTimeOut(ULONG p_port)
+unsigned char busMstrTimeOut(unsigned long p_port)
 {
-   ULONG timeout;
+   unsigned long timeout;
 
    timeout = LONG_WAIT;
 
@@ -7803,12 +7770,12 @@ UCHAR busMstrTimeOut(ULONG p_port)
  * Description: Abort any in progress transfer.
  *
  *---------------------------------------------------------------------*/
-void hostDataXferAbort(ULONG port, UCHAR p_card, PSCCB pCurrSCCB)
+void hostDataXferAbort(unsigned long port, unsigned char p_card, PSCCB pCurrSCCB)
 {
 
-   ULONG timeout;
-   ULONG remain_cnt;
-   UINT sg_ptr;
+   unsigned long timeout;
+   unsigned long remain_cnt;
+   unsigned int sg_ptr;
 
    BL_Card[p_card].globalFlags &= ~F_HOST_XFER_ACT;
 
@@ -7863,9 +7830,9 @@ void hostDataXferAbort(ULONG port, UCHAR
 
          sg_ptr = pCurrSCCB->Sccb_sgseg + SG_BUF_CNT;
 
-         if (sg_ptr > (UINT)(pCurrSCCB->DataLength / SG_ELEMENT_SIZE)) {
+         if (sg_ptr > (unsigned int)(pCurrSCCB->DataLength / SG_ELEMENT_SIZE)) {
 
-            sg_ptr = (UINT)(pCurrSCCB->DataLength / SG_ELEMENT_SIZE);
+            sg_ptr = (unsigned int)(pCurrSCCB->DataLength / SG_ELEMENT_SIZE);
             }
 
          remain_cnt = pCurrSCCB->Sccb_XferCnt;
@@ -7874,10 +7841,10 @@ void hostDataXferAbort(ULONG port, UCHAR
 
             sg_ptr--;
 
-            if (remain_cnt > (ULONG)(*(((ULONG *)pCurrSCCB->
+            if (remain_cnt > (unsigned long)(*(((unsigned long *)pCurrSCCB->
                DataPointer) + (sg_ptr * 2)))) {
 
-               remain_cnt -= (ULONG)(*(((ULONG *)pCurrSCCB->
+               remain_cnt -= (unsigned long)(*(((unsigned long *)pCurrSCCB->
                   DataPointer) + (sg_ptr * 2)));
                }
 
@@ -7894,10 +7861,10 @@ void hostDataXferAbort(ULONG port, UCHAR
 
             pCurrSCCB->Sccb_SGoffset = remain_cnt;
 
-            pCurrSCCB->Sccb_sgseg = (USHORT)sg_ptr;
+            pCurrSCCB->Sccb_sgseg = (unsigned short)sg_ptr;
 
 
-            if ((ULONG)(sg_ptr * SG_ELEMENT_SIZE) == pCurrSCCB->DataLength 
+            if ((unsigned long)(sg_ptr * SG_ELEMENT_SIZE) == pCurrSCCB->DataLength 
                 && (remain_cnt == 0))
 
                pCurrSCCB->Sccb_XferState |= F_ALL_XFERRED;
@@ -8046,12 +8013,12 @@ void hostDataXferAbort(ULONG port, UCHAR
          pCurrSCCB->Sccb_SGoffset = 0x00; 
 
 
-         if ((ULONG)(pCurrSCCB->Sccb_sgseg * SG_ELEMENT_SIZE) >=
+         if ((unsigned long)(pCurrSCCB->Sccb_sgseg * SG_ELEMENT_SIZE) >=
             pCurrSCCB->DataLength) {
 
             pCurrSCCB->Sccb_XferState |= F_ALL_XFERRED;
 
-            pCurrSCCB->Sccb_sgseg = (USHORT)(pCurrSCCB->DataLength / SG_ELEMENT_SIZE);
+            pCurrSCCB->Sccb_sgseg = (unsigned short)(pCurrSCCB->DataLength / SG_ELEMENT_SIZE);
 
             }
          }
@@ -8079,9 +8046,9 @@ void hostDataXferAbort(ULONG port, UCHAR
  *---------------------------------------------------------------------*/
 void hostDataXferRestart(PSCCB currSCCB)
 {
-   ULONG data_count;
-   UINT  sg_index;
-   ULONG *sg_ptr;
+   unsigned long data_count;
+   unsigned int  sg_index;
+   unsigned long *sg_ptr;
 
    if (currSCCB->Sccb_XferState & F_SG_XFER) {
 
@@ -8090,7 +8057,7 @@ void hostDataXferRestart(PSCCB currSCCB)
       sg_index = 0xffff;         /*Index by long words into sg list. */
       data_count = 0;            /*Running count of SG xfer counts. */
 
-      sg_ptr = (ULONG *)currSCCB->DataPointer;
+      sg_ptr = (unsigned long *)currSCCB->DataPointer;
 
       while (data_count < currSCCB->Sccb_ATC) {
 
@@ -8108,7 +8075,7 @@ void hostDataXferRestart(PSCCB currSCCB)
          currSCCB->Sccb_SGoffset = data_count - currSCCB->Sccb_ATC;
          }
 
-      currSCCB->Sccb_sgseg = (USHORT)sg_index;
+      currSCCB->Sccb_sgseg = (unsigned short)sg_index;
       }
 
    else {
@@ -8124,7 +8091,7 @@ extern SCCBMGR_TAR_INFO sccbMgrTbl[MAX_C
 extern SCCBCARD BL_Card[MAX_CARDS];
 extern SCCBSCAM_INFO scamInfo[MAX_SCSI_TAR];
 extern NVRAMINFO nvRamInfo[MAX_MB_CARDS];
-extern UCHAR scamHAString[];
+extern unsigned char scamHAString[];
 */
 /*---------------------------------------------------------------------
  *
@@ -8134,15 +8101,15 @@ extern UCHAR scamHAString[];
  *
  *---------------------------------------------------------------------*/
 
-void scini(UCHAR p_card, UCHAR p_our_id, UCHAR p_power_up)
+void scini(unsigned char p_card, unsigned char p_our_id, unsigned char p_power_up)
 {
 
 #if defined(SCAM_LEV_2)
-   UCHAR loser,assigned_id;
+   unsigned char loser,assigned_id;
 #endif
-   ULONG p_port;
+   unsigned long p_port;
 
-   UCHAR i,k,ScamFlg ;
+   unsigned char i,k,ScamFlg ;
    PSCCBcard currCard;
 	PNVRamInfo pCurrNvRam;
 
@@ -8156,8 +8123,8 @@ void scini(UCHAR p_card, UCHAR p_our_id,
 		i = pCurrNvRam->niSysConf;
 	}
 	else{
-	   ScamFlg = (UCHAR) utilEERead(p_port, SCAM_CONFIG/2);
-	   i = (UCHAR)(utilEERead(p_port, (SYSTEM_CONFIG/2)));
+	   ScamFlg = (unsigned char) utilEERead(p_port, SCAM_CONFIG/2);
+	   i = (unsigned char)(utilEERead(p_port, (SYSTEM_CONFIG/2)));
 	}
 	if(!(i & 0x02))	/* check if reset bus in AutoSCSI parameter set */
 		return;
@@ -8281,7 +8248,7 @@ void scini(UCHAR p_card, UCHAR p_our_id,
                      if (scvalq(k))
                         {
                         currCard->ourId =
-                           ((UCHAR)(i<<3)+(k & (UCHAR)7)) & (UCHAR) 0x3F;
+                           ((unsigned char)(i<<3)+(k & (unsigned char)7)) & (unsigned char) 0x3F;
                         inisci(p_card, p_port, p_our_id);
                         scamInfo[currCard->ourId].state = ID_ASSIGNED;
                         scamInfo[currCard->ourId].id_string[0]
@@ -8340,7 +8307,7 @@ void scini(UCHAR p_card, UCHAR p_our_id,
  *
  *---------------------------------------------------------------------*/
 
-int scarb(ULONG p_port, UCHAR p_sel_type)
+int scarb(unsigned long p_port, unsigned char p_sel_type)
 {
    if (p_sel_type == INIT_SELTD)
       {
@@ -8403,7 +8370,7 @@ int scarb(ULONG p_port, UCHAR p_sel_type
  *
  *---------------------------------------------------------------------*/
 
-void scbusf(ULONG p_port)
+void scbusf(unsigned long p_port)
 {
    WR_HARPOON(p_port+hp_page_ctrl,
       (RD_HARPOON(p_port+hp_page_ctrl) | G_INT_DISABLE));
@@ -8443,14 +8410,14 @@ void scbusf(ULONG p_port)
  *
  *---------------------------------------------------------------------*/
 
-void scasid(UCHAR p_card, ULONG p_port)
+void scasid(unsigned char p_card, unsigned long p_port)
 {
-   UCHAR temp_id_string[ID_STRING_LENGTH];
+   unsigned char temp_id_string[ID_STRING_LENGTH];
 
-   UCHAR i,k,scam_id;
-	UCHAR crcBytes[3];
+   unsigned char i,k,scam_id;
+	unsigned char crcBytes[3];
 	PNVRamInfo pCurrNvRam;
-	ushort_ptr pCrcBytes;
+	unsigned short * pCrcBytes;
 
 	pCurrNvRam = BL_Card[p_card].pNvRamInfo;
 
@@ -8461,7 +8428,7 @@ void scasid(UCHAR p_card, ULONG p_port)
 
       for (k=0; k < ID_STRING_LENGTH; k++)
          {
-         temp_id_string[k] = (UCHAR) 0x00;
+         temp_id_string[k] = (unsigned char) 0x00;
          }
 
       scxferc(p_port,SYNC_PTRN);
@@ -8470,14 +8437,14 @@ void scasid(UCHAR p_card, ULONG p_port)
       if (!(sciso(p_port,&temp_id_string[0])))
          {
 			if(pCurrNvRam){
-				pCrcBytes = (ushort_ptr)&crcBytes[0];
+				pCrcBytes = (unsigned short *)&crcBytes[0];
 				*pCrcBytes = CalcCrc16(&temp_id_string[0]);
 				crcBytes[2] = CalcLrc(&temp_id_string[0]);
 				temp_id_string[1] = crcBytes[2];
 				temp_id_string[2] = crcBytes[0];
 				temp_id_string[3] = crcBytes[1];
 				for(k = 4; k < ID_STRING_LENGTH; k++)
-					temp_id_string[k] = (UCHAR) 0x00;
+					temp_id_string[k] = (unsigned char) 0x00;
 			}
          i = scmachid(p_card,temp_id_string);
 
@@ -8495,7 +8462,7 @@ void scasid(UCHAR p_card, ULONG p_port)
             else
                scxferc(p_port,ID_8_F);
 
-            scam_id = (i & (UCHAR) 0x07);
+            scam_id = (i & (unsigned char) 0x07);
 
 
             for (k=1; k < 0x08; k <<= 1)
@@ -8531,7 +8498,7 @@ void scasid(UCHAR p_card, ULONG p_port)
  *
  *---------------------------------------------------------------------*/
 
-void scsel(ULONG p_port)
+void scsel(unsigned long p_port)
 {
 
    WR_HARPOON(p_port+hp_scsisig, SCSI_SEL);
@@ -8541,15 +8508,15 @@ void scsel(ULONG p_port)
 
 
    WR_HARPOON(p_port+hp_scsisig, (SCSI_SEL | SCSI_BSY | SCSI_IOBIT | SCSI_CD));
-   WR_HARPOON(p_port+hp_scsidata_0, (UCHAR)(RD_HARPOON(p_port+hp_scsidata_0) |
-      (UCHAR)(BIT(7)+BIT(6))));
+   WR_HARPOON(p_port+hp_scsidata_0, (unsigned char)(RD_HARPOON(p_port+hp_scsidata_0) |
+      (unsigned char)(BIT(7)+BIT(6))));
 
 
    WR_HARPOON(p_port+hp_scsisig, (SCSI_BSY | SCSI_IOBIT | SCSI_CD));
    scwiros(p_port, SCSI_SEL);
 
-   WR_HARPOON(p_port+hp_scsidata_0, (UCHAR)(RD_HARPOON(p_port+hp_scsidata_0) &
-      ~(UCHAR)BIT(6)));
+   WR_HARPOON(p_port+hp_scsidata_0, (unsigned char)(RD_HARPOON(p_port+hp_scsidata_0) &
+      ~(unsigned char)BIT(6)));
    scwirod(p_port, BIT(6));
 
    WR_HARPOON(p_port+hp_scsisig, (SCSI_SEL | SCSI_BSY | SCSI_IOBIT | SCSI_CD));
@@ -8565,9 +8532,9 @@ void scsel(ULONG p_port)
  *
  *---------------------------------------------------------------------*/
 
-UCHAR scxferc(ULONG p_port, UCHAR p_data)
+unsigned char scxferc(unsigned long p_port, unsigned char p_data)
 {
-   UCHAR curr_data, ret_data;
+   unsigned char curr_data, ret_data;
 
    curr_data = p_data | BIT(7) | BIT(5);   /*Start with DB7 & DB5 asserted. */
 
@@ -8580,7 +8547,7 @@ UCHAR scxferc(ULONG p_port, UCHAR p_data
    scwirod(p_port,BIT(7));              /*Wait for DB7 to be released. */
 	while (!(RD_HARPOON(p_port+hp_scsidata_0) & BIT(5)));
 
-   ret_data = (RD_HARPOON(p_port+hp_scsidata_0) & (UCHAR) 0x1F);
+   ret_data = (RD_HARPOON(p_port+hp_scsidata_0) & (unsigned char) 0x1F);
 
    curr_data |= BIT(6);
 
@@ -8616,9 +8583,9 @@ UCHAR scxferc(ULONG p_port, UCHAR p_data
  *
  *---------------------------------------------------------------------*/
 
-UCHAR scsendi(ULONG p_port, UCHAR p_id_string[])
+unsigned char scsendi(unsigned long p_port, unsigned char p_id_string[])
 {
-   UCHAR ret_data,byte_cnt,bit_cnt,defer;
+   unsigned char ret_data,byte_cnt,bit_cnt,defer;
 
    defer = FALSE;
 
@@ -8669,9 +8636,9 @@ UCHAR scsendi(ULONG p_port, UCHAR p_id_s
  *
  *---------------------------------------------------------------------*/
 
-UCHAR sciso(ULONG p_port, UCHAR p_id_string[])
+unsigned char sciso(unsigned long p_port, unsigned char p_id_string[])
 {
-   UCHAR ret_data,the_data,byte_cnt,bit_cnt;
+   unsigned char ret_data,the_data,byte_cnt,bit_cnt;
 
    the_data = 0;
 
@@ -8730,9 +8697,9 @@ UCHAR sciso(ULONG p_port, UCHAR p_id_str
  *
  *---------------------------------------------------------------------*/
 
-void scwirod(ULONG p_port, UCHAR p_data_bit)
+void scwirod(unsigned long p_port, unsigned char p_data_bit)
 {
-   UCHAR i;
+   unsigned char i;
 
    i = 0;
    while ( i < MAX_SCSI_TAR ) {
@@ -8759,9 +8726,9 @@ void scwirod(ULONG p_port, UCHAR p_data_
  *
  *---------------------------------------------------------------------*/
 
-void scwiros(ULONG p_port, UCHAR p_data_bit)
+void scwiros(unsigned long p_port, unsigned char p_data_bit)
 {
-   UCHAR i;
+   unsigned char i;
 
    i = 0;
    while ( i < MAX_SCSI_TAR ) {
@@ -8786,9 +8753,9 @@ void scwiros(ULONG p_port, UCHAR p_data_
  *
  *---------------------------------------------------------------------*/
 
-UCHAR scvalq(UCHAR p_quintet)
+unsigned char scvalq(unsigned char p_quintet)
 {
-   UCHAR count;
+   unsigned char count;
 
    for (count=1; count < 0x08; count<<=1) {
       if (!(p_quintet & count))
@@ -8813,9 +8780,9 @@ UCHAR scvalq(UCHAR p_quintet)
  *
  *---------------------------------------------------------------------*/
 
-UCHAR scsell(ULONG p_port, UCHAR targ_id)
+unsigned char scsell(unsigned long p_port, unsigned char targ_id)
 {
-   ULONG i;
+   unsigned long i;
 
    WR_HARPOON(p_port+hp_page_ctrl,
       (RD_HARPOON(p_port+hp_page_ctrl) | G_INT_DISABLE));
@@ -8893,7 +8860,7 @@ UCHAR scsell(ULONG p_port, UCHAR targ_id
  *
  *---------------------------------------------------------------------*/
 
-void scwtsel(ULONG p_port)
+void scwtsel(unsigned long p_port)
 {
    while(!(RDW_HARPOON((p_port+hp_intstat)) & SCAM_SEL)) {}
 }
@@ -8907,10 +8874,10 @@ void scwtsel(ULONG p_port)
  *
  *---------------------------------------------------------------------*/
 
-void inisci(UCHAR p_card, ULONG p_port, UCHAR p_our_id)
+void inisci(unsigned char p_card, unsigned long p_port, unsigned char p_our_id)
 {
-   UCHAR i,k,max_id;
-   USHORT ee_data;
+   unsigned char i,k,max_id;
+   unsigned short ee_data;
 	PNVRamInfo pCurrNvRam;
 
 	pCurrNvRam = BL_Card[p_card].pNvRamInfo;
@@ -8927,7 +8894,7 @@ void inisci(UCHAR p_card, ULONG p_port, 
 			for(k = 0; k < 4; k++)
 				scamInfo[i].id_string[k] = pCurrNvRam->niScamTbl[i][k];
 			for(k = 4; k < ID_STRING_LENGTH; k++)
-				scamInfo[i].id_string[k] = (UCHAR) 0x00;
+				scamInfo[i].id_string[k] = (unsigned char) 0x00;
 
 	      if(scamInfo[i].id_string[0] == 0x00)
       	   scamInfo[i].state = ID_UNUSED;  /*Default to unused ID. */
@@ -8940,11 +8907,11 @@ void inisci(UCHAR p_card, ULONG p_port, 
    	   {
       	for (k=0; k < ID_STRING_LENGTH; k+=2)
 	         {
-   	      ee_data = utilEERead(p_port, (USHORT)((EE_SCAMBASE/2) +
-      	     (USHORT) (i*((USHORT)ID_STRING_LENGTH/2)) + (USHORT)(k/2)));
-         	scamInfo[i].id_string[k] = (UCHAR) ee_data;
+   	      ee_data = utilEERead(p_port, (unsigned short)((EE_SCAMBASE/2) +
+      	     (unsigned short) (i*((unsigned short)ID_STRING_LENGTH/2)) + (unsigned short)(k/2)));
+         	scamInfo[i].id_string[k] = (unsigned char) ee_data;
 	         ee_data >>= 8;
-   	      scamInfo[i].id_string[k+1] = (UCHAR) ee_data;
+   	      scamInfo[i].id_string[k+1] = (unsigned char) ee_data;
       	   }
 
 	      if ((scamInfo[i].id_string[0] == 0x00) ||
@@ -8971,10 +8938,10 @@ void inisci(UCHAR p_card, ULONG p_port, 
  *
  *---------------------------------------------------------------------*/
 
-UCHAR scmachid(UCHAR p_card, UCHAR p_id_string[])
+unsigned char scmachid(unsigned char p_card, unsigned char p_id_string[])
 {
 
-   UCHAR i,k,match;
+   unsigned char i,k,match;
 
 
    for (i=0; i < MAX_SCSI_TAR; i++) {
@@ -9011,7 +8978,7 @@ UCHAR scmachid(UCHAR p_card, UCHAR p_id_
       i = MAX_SCSI_TAR;
 
    if (((p_id_string[0] & 0x06) == 0x02) || ((p_id_string[0] & 0x06) == 0x04))
-      match = p_id_string[1] & (UCHAR) 0x1F;
+      match = p_id_string[1] & (unsigned char) 0x1F;
    else
       match = 7;
 
@@ -9060,7 +9027,7 @@ UCHAR scmachid(UCHAR p_card, UCHAR p_id_
       i = MAX_SCSI_TAR;
 
    if (((p_id_string[0] & 0x06) == 0x02) || ((p_id_string[0] & 0x06) == 0x04))
-      match = p_id_string[1] & (UCHAR) 0x1F;
+      match = p_id_string[1] & (unsigned char) 0x1F;
    else
       match = 7;
 
@@ -9108,10 +9075,10 @@ UCHAR scmachid(UCHAR p_card, UCHAR p_id_
  *
  *---------------------------------------------------------------------*/
 
-void scsavdi(UCHAR p_card, ULONG p_port)
+void scsavdi(unsigned char p_card, unsigned long p_port)
 {
-   UCHAR i,k,max_id;
-   USHORT ee_data,sum_data;
+   unsigned char i,k,max_id;
+   unsigned short ee_data,sum_data;
 
 
    sum_data = 0x0000;
@@ -9139,8 +9106,8 @@ void scsavdi(UCHAR p_card, ULONG p_port)
          ee_data <<= 8;
          ee_data |= scamInfo[i].id_string[k];
          sum_data += ee_data;
-         utilEEWrite(p_port, ee_data, (USHORT)((EE_SCAMBASE/2) +
-            (USHORT)(i*((USHORT)ID_STRING_LENGTH/2)) + (USHORT)(k/2)));
+         utilEEWrite(p_port, ee_data, (unsigned short)((EE_SCAMBASE/2) +
+            (unsigned short)(i*((unsigned short)ID_STRING_LENGTH/2)) + (unsigned short)(k/2)));
          }
       }
 
@@ -9159,12 +9126,12 @@ void scsavdi(UCHAR p_card, ULONG p_port)
  *
  *---------------------------------------------------------------------*/
 
-void XbowInit(ULONG port, UCHAR ScamFlg)
+void XbowInit(unsigned long port, unsigned char ScamFlg)
 {
-UCHAR i;
+unsigned char i;
 
 	i = RD_HARPOON(port+hp_page_ctrl);
-	WR_HARPOON(port+hp_page_ctrl, (UCHAR) (i | G_INT_DISABLE));
+	WR_HARPOON(port+hp_page_ctrl, (unsigned char) (i | G_INT_DISABLE));
 
    WR_HARPOON(port+hp_scsireset,0x00);
    WR_HARPOON(port+hp_portctrl_1,HOST_MODE8);
@@ -9234,7 +9201,7 @@ UCHAR i;
  *
  *---------------------------------------------------------------------*/
 
-void BusMasterInit(ULONG p_port)
+void BusMasterInit(unsigned long p_port)
 {
 
 
@@ -9265,7 +9232,7 @@ void BusMasterInit(ULONG p_port)
  *
  *---------------------------------------------------------------------*/
 
-int DiagXbow(ULONG port)
+int DiagXbow(unsigned long port)
 {
    unsigned char fifo_cnt,loop_cnt;
 
@@ -9285,7 +9252,7 @@ int DiagXbow(ULONG port)
    WR_HARPOON(port+hp_portctrl_0,START_TO);
 
 
-   for(fifodata[4] = 0x01; fifodata[4] != (UCHAR) 0; fifodata[4] = fifodata[4] << 1) {
+   for(fifodata[4] = 0x01; fifodata[4] != (unsigned char) 0; fifodata[4] = fifodata[4] << 1) {
 
       WR_HARPOON(port+hp_selfid_0,fifodata[4]);
       WR_HARPOON(port+hp_selfid_1,fifodata[4]);
@@ -9347,11 +9314,11 @@ int DiagXbow(ULONG port)
  *
  *---------------------------------------------------------------------*/
 
-int DiagBusMaster(ULONG port)
+int DiagBusMaster(unsigned long port)
 {
-   UCHAR testdata;
+   unsigned char testdata;
 
-   for(testdata = (UCHAR) 1; testdata != (UCHAR)0; testdata = testdata << 1) {
+   for(testdata = (unsigned char) 1; testdata != (unsigned char)0; testdata = testdata << 1) {
 
       WR_HARPOON(port+hp_xfer_cnt_lo,testdata);
       WR_HARPOON(port+hp_xfer_cnt_mi,testdata);
@@ -9386,10 +9353,10 @@ int DiagBusMaster(ULONG port)
  *
  *---------------------------------------------------------------------*/
 
-void DiagEEPROM(ULONG p_port)
+void DiagEEPROM(unsigned long p_port)
 
 {
-   USHORT index,temp,max_wd_cnt;
+   unsigned short index,temp,max_wd_cnt;
 
    if (RD_HARPOON(p_port+hp_page_ctrl) & NARROW_SCSI_CARD)
       max_wd_cnt = EEPROM_WD_CNT;
@@ -9413,7 +9380,7 @@ void DiagEEPROM(ULONG p_port)
       }
 
 
-   utilEEWriteOnOff(p_port,(UCHAR)1);
+   utilEEWriteOnOff(p_port,(unsigned char)1);
 
    for (index = 0; index < max_wd_cnt; index++) {
 
@@ -9534,7 +9501,7 @@ void DiagEEPROM(ULONG p_port)
 
    utilEEWrite(p_port, temp, EEPROM_CHECK_SUM/2);
 
-   utilEEWriteOnOff(p_port,(UCHAR)0);
+   utilEEWriteOnOff(p_port,(unsigned char)0);
 
 }
 
@@ -9555,9 +9522,9 @@ extern unsigned int SccbGlobalFlags;
  *
  *---------------------------------------------------------------------*/
 
-void queueSearchSelect(PSCCBcard pCurrCard, UCHAR p_card)
+void queueSearchSelect(PSCCBcard pCurrCard, unsigned char p_card)
 {
-   UCHAR scan_ptr, lun;
+   unsigned char scan_ptr, lun;
    PSCCBMgr_tar_info currTar_Info;
 	PSCCB pOldSccb;
 
@@ -9686,14 +9653,14 @@ void queueSearchSelect(PSCCBcard pCurrCa
  *
  *---------------------------------------------------------------------*/
 
-void queueSelectFail(PSCCBcard pCurrCard, UCHAR p_card)
+void queueSelectFail(PSCCBcard pCurrCard, unsigned char p_card)
 {
-   UCHAR thisTarg;
+   unsigned char thisTarg;
    PSCCBMgr_tar_info currTar_Info;
 
    if (pCurrCard->currentSCCB != NULL)
 	  {
-	  thisTarg = (UCHAR)(((PSCCB)(pCurrCard->currentSCCB))->TargID);
+	  thisTarg = (unsigned char)(((PSCCB)(pCurrCard->currentSCCB))->TargID);
       currTar_Info = &sccbMgrTbl[p_card][thisTarg];
 
       pCurrCard->currentSCCB->Sccb_backlink = (PSCCB)NULL;
@@ -9725,12 +9692,12 @@ void queueSelectFail(PSCCBcard pCurrCard
  *
  *---------------------------------------------------------------------*/
 
-void queueCmdComplete(PSCCBcard pCurrCard, PSCCB p_sccb, UCHAR p_card)
+void queueCmdComplete(PSCCBcard pCurrCard, PSCCB p_sccb, unsigned char p_card)
 {
 
 #if (FW_TYPE==_UCB_MGR_)
 
-   u08bits SCSIcmd;
+   u8 SCSIcmd;
    CALL_BK_FN callback;
    PSCCBMgr_tar_info currTar_Info;
 
@@ -9822,7 +9789,7 @@ void queueCmdComplete(PSCCBcard pCurrCar
 
 #else
 
-   UCHAR i, SCSIcmd;
+   unsigned char i, SCSIcmd;
    CALL_BK_FN callback;
    PSCCBMgr_tar_info currTar_Info;
 
@@ -9921,7 +9888,7 @@ void queueCmdComplete(PSCCBcard pCurrCar
  * Description: Add SCCB to our disconnect array.
  *
  *---------------------------------------------------------------------*/
-void queueDisconnect(PSCCB p_sccb, UCHAR p_card)
+void queueDisconnect(PSCCB p_sccb, unsigned char p_card)
 {
    PSCCBMgr_tar_info currTar_Info;
 
@@ -9956,16 +9923,16 @@ void queueDisconnect(PSCCB p_sccb, UCHAR
  *
  *---------------------------------------------------------------------*/
 
-void  queueFlushSccb(UCHAR p_card, UCHAR error_code)
+void  queueFlushSccb(unsigned char p_card, unsigned char error_code)
 {
-   UCHAR qtag,thisTarg;
+   unsigned char qtag,thisTarg;
    PSCCB currSCCB;
    PSCCBMgr_tar_info currTar_Info;
 
    currSCCB = BL_Card[p_card].currentSCCB;
 	if(currSCCB != NULL)
 	{
-	   thisTarg = (UCHAR)currSCCB->TargID;
+	   thisTarg = (unsigned char)currSCCB->TargID;
    	currTar_Info = &sccbMgrTbl[p_card][thisTarg];
 
 	   for (qtag=0; qtag<QUEUE_DEPTH; qtag++) {
@@ -9974,7 +9941,7 @@ void  queueFlushSccb(UCHAR p_card, UCHAR
 					(BL_Card[p_card].discQ_Tbl[qtag]->TargID == thisTarg))
 			 {
 
-			 BL_Card[p_card].discQ_Tbl[qtag]->HostStatus = (UCHAR)error_code;
+			 BL_Card[p_card].discQ_Tbl[qtag]->HostStatus = (unsigned char)error_code;
 			
 			 queueCmdComplete(&BL_Card[p_card],BL_Card[p_card].discQ_Tbl[qtag], p_card);
 
@@ -9995,9 +9962,9 @@ void  queueFlushSccb(UCHAR p_card, UCHAR
  *
  *---------------------------------------------------------------------*/
 
-void  queueFlushTargSccb(UCHAR p_card, UCHAR thisTarg, UCHAR error_code)
+void  queueFlushTargSccb(unsigned char p_card, unsigned char thisTarg, unsigned char error_code)
 {
-   UCHAR qtag;
+   unsigned char qtag;
    PSCCBMgr_tar_info currTar_Info;
 
    currTar_Info = &sccbMgrTbl[p_card][thisTarg];
@@ -10008,7 +9975,7 @@ void  queueFlushTargSccb(UCHAR p_card, U
 				(BL_Card[p_card].discQ_Tbl[qtag]->TargID == thisTarg))
 		 {
 
-		 BL_Card[p_card].discQ_Tbl[qtag]->HostStatus = (UCHAR)error_code;
+		 BL_Card[p_card].discQ_Tbl[qtag]->HostStatus = (unsigned char)error_code;
 
 		 queueCmdComplete(&BL_Card[p_card],BL_Card[p_card].discQ_Tbl[qtag], p_card);
 
@@ -10024,7 +9991,7 @@ void  queueFlushTargSccb(UCHAR p_card, U
 
 
 
-void queueAddSccb(PSCCB p_SCCB, UCHAR p_card)
+void queueAddSccb(PSCCB p_SCCB, unsigned char p_card)
 {
    PSCCBMgr_tar_info currTar_Info;
    currTar_Info = &sccbMgrTbl[p_card][p_SCCB->TargID];
@@ -10058,7 +10025,7 @@ void queueAddSccb(PSCCB p_SCCB, UCHAR p_
  *
  *---------------------------------------------------------------------*/
 
-UCHAR queueFindSccb(PSCCB p_SCCB, UCHAR p_card)
+unsigned char queueFindSccb(PSCCB p_SCCB, unsigned char p_card)
 {
    PSCCB q_ptr;
    PSCCBMgr_tar_info currTar_Info;
@@ -10121,9 +10088,9 @@ UCHAR queueFindSccb(PSCCB p_SCCB, UCHAR 
 
 void  utilUpdateResidual(PSCCB p_SCCB)
 {
-   ULONG partial_cnt;
-   UINT  sg_index;
-   ULONG *sg_ptr;
+   unsigned long partial_cnt;
+   unsigned int  sg_index;
+   unsigned long *sg_ptr;
 
    if (p_SCCB->Sccb_XferState & F_ALL_XFERRED) {
 
@@ -10136,7 +10103,7 @@ void  utilUpdateResidual(PSCCB p_SCCB)
 
 		 sg_index = p_SCCB->Sccb_sgseg;
 
-		 sg_ptr = (ULONG *)p_SCCB->DataPointer;
+		 sg_ptr = (unsigned long *)p_SCCB->DataPointer;
 
 		 if (p_SCCB->Sccb_SGoffset) {
 
@@ -10144,7 +10111,7 @@ void  utilUpdateResidual(PSCCB p_SCCB)
 			sg_index++;
 			}
 
-		 while ( ((ULONG)sg_index * (ULONG)SG_ELEMENT_SIZE) <
+		 while ( ((unsigned long)sg_index * (unsigned long)SG_ELEMENT_SIZE) <
 			p_SCCB->DataLength ) {
 
 			partial_cnt += *(sg_ptr+(sg_index * 2));
@@ -10169,9 +10136,9 @@ void  utilUpdateResidual(PSCCB p_SCCB)
  *
  *---------------------------------------------------------------------*/
 
-void Wait1Second(ULONG p_port)
+void Wait1Second(unsigned long p_port)
 {
-   UCHAR i;
+   unsigned char i;
 
    for(i=0; i < 4; i++) {
 
@@ -10194,10 +10161,10 @@ void Wait1Second(ULONG p_port)
  *
  *---------------------------------------------------------------------*/
 
-void Wait(ULONG p_port, UCHAR p_delay)
+void Wait(unsigned long p_port, unsigned char p_delay)
 {
-   UCHAR old_timer;
-   UCHAR green_flag;
+   unsigned char old_timer;
+   unsigned char green_flag;
 
    old_timer = RD_HARPOON(p_port+hp_seltimeout);
 
@@ -10242,11 +10209,11 @@ void Wait(ULONG p_port, UCHAR p_delay)
  *
  *---------------------------------------------------------------------*/
 
-void utilEEWriteOnOff(ULONG p_port,UCHAR p_mode)
+void utilEEWriteOnOff(unsigned long p_port,unsigned char p_mode)
 {
-   UCHAR ee_value;
+   unsigned char ee_value;
 
-   ee_value = (UCHAR)(RD_HARPOON(p_port+hp_ee_ctrl) & (EXT_ARB_ACK | SCSI_TERM_ENA_H));
+   ee_value = (unsigned char)(RD_HARPOON(p_port+hp_ee_ctrl) & (EXT_ARB_ACK | SCSI_TERM_ENA_H));
 
    if (p_mode)
 
@@ -10271,13 +10238,13 @@ void utilEEWriteOnOff(ULONG p_port,UCHAR
  *
  *---------------------------------------------------------------------*/
 
-void utilEEWrite(ULONG p_port, USHORT ee_data, USHORT ee_addr)
+void utilEEWrite(unsigned long p_port, unsigned short ee_data, unsigned short ee_addr)
 {
 
-   UCHAR ee_value;
-   USHORT i;
+   unsigned char ee_value;
+   unsigned short i;
 
-   ee_value = (UCHAR)((RD_HARPOON(p_port+hp_ee_ctrl) & (EXT_ARB_ACK | SCSI_TERM_ENA_H))|
+   ee_value = (unsigned char)((RD_HARPOON(p_port+hp_ee_ctrl) & (EXT_ARB_ACK | SCSI_TERM_ENA_H))|
 		   (SEE_MS | SEE_CS));
 
 
@@ -10322,9 +10289,9 @@ void utilEEWrite(ULONG p_port, USHORT ee
  *
  *---------------------------------------------------------------------*/
 
-USHORT utilEERead(ULONG p_port, USHORT ee_addr)
+unsigned short utilEERead(unsigned long p_port, unsigned short ee_addr)
 {
-   USHORT i, ee_data1, ee_data2;
+   unsigned short i, ee_data1, ee_data2;
 
 	i = 0;
 	ee_data1 = utilEEReadOrg(p_port, ee_addr);
@@ -10352,13 +10319,13 @@ USHORT utilEERead(ULONG p_port, USHORT e
  *
  *---------------------------------------------------------------------*/
 
-USHORT utilEEReadOrg(ULONG p_port, USHORT ee_addr)
+unsigned short utilEEReadOrg(unsigned long p_port, unsigned short ee_addr)
 {
 
-   UCHAR ee_value;
-   USHORT i, ee_data;
+   unsigned char ee_value;
+   unsigned short i, ee_data;
 
-   ee_value = (UCHAR)((RD_HARPOON(p_port+hp_ee_ctrl) & (EXT_ARB_ACK | SCSI_TERM_ENA_H))|
+   ee_value = (unsigned char)((RD_HARPOON(p_port+hp_ee_ctrl) & (EXT_ARB_ACK | SCSI_TERM_ENA_H))|
 		   (SEE_MS | SEE_CS));
 
 
@@ -10400,15 +10367,15 @@ USHORT utilEEReadOrg(ULONG p_port, USHOR
  *
  *---------------------------------------------------------------------*/
 
-void utilEESendCmdAddr(ULONG p_port, UCHAR ee_cmd, USHORT ee_addr)
+void utilEESendCmdAddr(unsigned long p_port, unsigned char ee_cmd, unsigned short ee_addr)
 {
-   UCHAR ee_value;
-   UCHAR narrow_flg;
+   unsigned char ee_value;
+   unsigned char narrow_flg;
 
-   USHORT i;
+   unsigned short i;
 
 
-   narrow_flg= (UCHAR)(RD_HARPOON(p_port+hp_page_ctrl) & NARROW_SCSI_CARD);
+   narrow_flg= (unsigned char)(RD_HARPOON(p_port+hp_page_ctrl) & NARROW_SCSI_CARD);
 
 
    ee_value = SEE_MS;
@@ -10463,14 +10430,14 @@ void utilEESendCmdAddr(ULONG p_port, UCH
 	  }
 }
 
-USHORT CalcCrc16(UCHAR buffer[])
+unsigned short CalcCrc16(unsigned char buffer[])
 {
-   USHORT crc=0;
+   unsigned short crc=0;
 	int i,j;
-   USHORT ch;
+   unsigned short ch;
    for (i=0; i < ID_STRING_LENGTH; i++)
    {
-      ch = (USHORT) buffer[i];
+      ch = (unsigned short) buffer[i];
 	   for(j=0; j < 8; j++)
 	   {
 		   if ((crc ^ ch) & 1)
@@ -10483,10 +10450,10 @@ USHORT CalcCrc16(UCHAR buffer[])
 	return(crc);
 }
 
-UCHAR CalcLrc(UCHAR buffer[])
+unsigned char CalcLrc(unsigned char buffer[])
 {
 	int i;
-	UCHAR lrc;
+	unsigned char lrc;
 	lrc = 0;
 	for(i = 0; i < ID_STRING_LENGTH; i++)
 		lrc ^= buffer[i];
