X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=drivers%2Fscsi%2FFlashPoint.c;h=a981dea3bbfb50383c8ca829473dda867904b895;hb=ce793215b428ae7650b39d87702efa3d5b26ba28;hp=5beed4f6d985a7b2bd2c9f007b2e49158989ec31;hpb=8ed693d29b25bbd88471ec043cc01581419d0481;p=karo-tx-linux.git diff --git a/drivers/scsi/FlashPoint.c b/drivers/scsi/FlashPoint.c index 5beed4f6d985..a981dea3bbfb 100644 --- a/drivers/scsi/FlashPoint.c +++ b/drivers/scsi/FlashPoint.c @@ -26,54 +26,24 @@ #undef BUSTYPE_PCI -#define OS_InPortByte(port) inb(port) -#define OS_InPortWord(port) inw(port) -#define OS_InPortLong(port) inl(port) -#define OS_OutPortByte(port, value) outb(value, port) -#define OS_OutPortWord(port, value) outw(value, port) -#define OS_OutPortLong(port, value) outl(value, port) -/* - Define name replacements for compatibility with the Linux BusLogic Driver. -*/ -#define SccbMgr_sense_adapter FlashPoint_ProbeHostAdapter -#define SccbMgr_config_adapter FlashPoint_HardwareResetHostAdapter -#define SccbMgr_unload_card FlashPoint_ReleaseHostAdapter -#define SccbMgr_start_sccb FlashPoint_StartCCB -#define SccbMgr_abort_sccb FlashPoint_AbortCCB -#define SccbMgr_my_int FlashPoint_InterruptPending -#define SccbMgr_isr FlashPoint_HandleInterrupt -#define MAX_CDBLEN 12 -#define SCAM_LEV_2 1 #define CRCMASK 0xA001 -#define BL_VENDOR_ID 0x104B -#define FP_DEVICE_ID 0x8130 -#define MM_DEVICE_ID 0x1040 #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; #define s08bits char @@ -84,13 +54,10 @@ typedef unsigned long * ulong_ptr; #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 */ @@ -101,24 +68,24 @@ typedef void (*CALL_BK_FN)(PSCCB); 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]; + 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]; ULONG si_OS_reserved; - UCHAR si_XlatInfo[4]; + unsigned char si_XlatInfo[4]; ULONG si_reserved2[5]; ULONG si_secondary_range; } SCCBMGR_INFO; @@ -144,70 +111,63 @@ typedef SCCBMGR_INFO * PSCCBMGR_INFO; #define HARPOON_FAMILY 0x02 -#define ISA_BUS_CARD 0x01 -#define EISA_BUS_CARD 0x02 -#define PCI_BUS_CARD 0x03 -#define VESA_BUS_CARD 0x04 -/* SCCB struc used for both SCCB and UCB manager compiles! +/* SCCB struct used for both SCCB and UCB manager compiles! * The UCB Manager treats the SCCB as it's 'native hardware structure' */ #pragma pack(1) typedef struct _SCCB { - UCHAR OperationCode; - UCHAR ControlByte; - UCHAR CdbLength; - UCHAR RequestSenseLength; + unsigned char OperationCode; + unsigned char ControlByte; + unsigned char CdbLength; + unsigned char RequestSenseLength; ULONG DataLength; ULONG DataPointer; - UCHAR CcbRes[2]; - UCHAR HostStatus; - UCHAR TargetStatus; - UCHAR TargID; - UCHAR Lun; - UCHAR Cdb[12]; - UCHAR CcbRes1; - UCHAR Reserved1; + 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; ULONG Reserved2; ULONG SensePointer; CALL_BK_FN SccbCallback; /* VOID (*SccbCallback)(); */ ULONG SccbIOPort; /* Identifies board base port */ - UCHAR SccbStatus; - UCHAR SCCBRes2; - USHORT SccbOSFlags; + unsigned char SccbStatus; + unsigned char SCCBRes2; + unsigned short 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 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; + unsigned char Save_Cdb[6]; + unsigned char Save_CdbLen; + unsigned char Sccb_XferState; ULONG Sccb_SGoffset; } SCCB; -#define SCCB_SIZE sizeof(SCCB) #pragma pack() -#define SCSI_INITIATOR_COMMAND 0x00 -#define TARGET_MODE_COMMAND 0x01 #define SCATTER_GATHER_COMMAND 0x02 #define RESIDUAL_COMMAND 0x03 #define RESIDUAL_SG_COMMAND 0x04 @@ -216,12 +176,10 @@ typedef struct _SCCB { #define F_USE_CMD_Q 0x20 /*Inidcates TAGGED command. */ #define TAG_TYPE_MASK 0xC0 /*Type of tag msg to send. */ -#define TAG_Q_MASK 0xE0 #define SCCB_DATA_XFER_OUT 0x10 /* Write */ #define SCCB_DATA_XFER_IN 0x08 /* Read */ -#define FOURTEEN_BYTES 0x00 /* Request Sense Buffer size */ #define NO_AUTO_REQUEST_SENSE 0x01 /* No Request Sense Buffer */ @@ -235,9 +193,7 @@ typedef struct _SCCB { #define DATA_OUT_ST 7 #define DATA_IN_ST 8 #define DISCONNECT_ST 9 -#define STATUS_ST 10 #define ABORT_ST 11 -#define MESSAGE_ST 12 #define F_HOST_XFER_DIR 0x01 @@ -249,7 +205,6 @@ typedef struct _SCCB { #define F_STATUSLOADED 0x01 -#define F_MSGLOADED 0x02 #define F_DEV_SELECTED 0x04 @@ -257,92 +212,69 @@ typedef struct _SCCB { #define SCCB_DATA_UNDER_RUN 0x0C #define SCCB_SELECTION_TIMEOUT 0x11 /* Set SCSI selection timed out */ #define SCCB_DATA_OVER_RUN 0x12 -#define SCCB_UNEXPECTED_BUS_FREE 0x13 /* Target dropped SCSI BSY */ #define SCCB_PHASE_SEQUENCE_FAIL 0x14 /* Target bus phase sequence failure */ -#define SCCB_INVALID_OP_CODE 0x16 /* SCCB invalid operation code */ -#define SCCB_INVALID_SCCB 0x1A /* Invalid SCCB - bad parameter */ #define SCCB_GROSS_FW_ERR 0x27 /* Major problem! */ #define SCCB_BM_ERR 0x30 /* BusMaster error. */ #define SCCB_PARITY_ERR 0x34 /* SCSI parity error */ -#define SCCB_INVALID_DIRECTION 0x18 /* Invalid target direction */ -#define SCCB_DUPLICATE_SCCB 0x19 /* Duplicate SCCB */ -#define SCCB_SCSI_RST 0x35 /* SCSI RESET detected. */ #define SCCB_IN_PROCESS 0x00 #define SCCB_SUCCESS 0x01 #define SCCB_ABORT 0x02 -#define SCCB_NOT_FOUND 0x03 #define SCCB_ERROR 0x04 -#define SCCB_INVALID 0x05 -#define SCCB_SIZE sizeof(SCCB) #define ORION_FW_REV 3110 -#define HARP_REVD 1 #define QUEUE_DEPTH 254+1 /*1 for Normal disconnect 32 for Q'ing. */ #define MAX_MB_CARDS 4 /* Max. no of cards suppoerted on Mother Board */ -#define WIDE_SCSI 1 #define MAX_SCSI_TAR 16 #define MAX_LUN 32 #define LUN_MASK 0x1f -#if defined(HARP_REVA) -#define SG_BUF_CNT 15 /*Number of prefetched elements. */ -#else #define SG_BUF_CNT 16 /*Number of prefetched elements. */ -#endif #define SG_ELEMENT_SIZE 8 /*Eight byte per element. */ -#define SG_LOCAL_MASK 0x00000000L -#define SG_ELEMENT_MASK 0xFFFFFFFFL -#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) inb((u32bits)ioport) +#define RDW_HARPOON(ioport) inw((u32bits)ioport) +#define RD_HARP32(ioport,offset,data) (data = inl((u32bits)(ioport + offset))) +#define WR_HARPOON(ioport,val) outb((u08bits) val, (u32bits)ioport) +#define WRW_HARPOON(ioport,val) outw((u16bits)val, (u32bits)ioport) +#define WR_HARP32(ioport,offset,data) outl(data, (u32bits)(ioport + offset)) #define TAR_SYNC_MASK (BIT(7)+BIT(6)) -#define SYNC_UNKNOWN 0x00 #define SYNC_TRYING BIT(6) #define SYNC_SUPPORTED (BIT(7)+BIT(6)) #define TAR_WIDE_MASK (BIT(5)+BIT(4)) -#define WIDE_DISABLED 0x00 #define WIDE_ENABLED BIT(4) #define WIDE_NEGOCIATED BIT(5) #define TAR_TAG_Q_MASK (BIT(3)+BIT(2)) -#define TAG_Q_UNKNOWN 0x00 #define TAG_Q_TRYING BIT(2) #define TAG_Q_REJECT BIT(3) -#define TAG_Q_SUPPORTED (BIT(3)+BIT(2)) #define TAR_ALLOW_DISC BIT(0) #define EE_SYNC_MASK (BIT(0)+BIT(1)) -#define EE_SYNC_ASYNC 0x00 #define EE_SYNC_5MB BIT(0) #define EE_SYNC_10MB BIT(1) #define EE_SYNC_20MB (BIT(0)+BIT(1)) -#define EE_ALLOW_DISC BIT(6) #define EE_WIDE_SCSI BIT(7) @@ -353,27 +285,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. */ + unsigned char niModel; /* Model No. of card */ + unsigned char 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 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; @@ -390,13 +322,13 @@ typedef struct SCCBcard { ULONG 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]; @@ -418,7 +350,6 @@ typedef struct SCCBcard *PSCCBcard; #define ID_STRING_LENGTH 32 #define TYPE_CODE0 0x63 /*Level2 Mstr (bits 7-6), */ -#define TYPE_CODE1 00 /*No ID yet */ #define SLV_TYPE_CODE0 0xA3 /*Priority Bit set (bits 7-6), */ @@ -430,16 +361,9 @@ typedef struct SCCBcard *PSCCBcard; #define ID_0_7 0x18 #define ID_8_F 0x11 -#define ID_10_17 0x12 -#define ID_18_1F 0x0B #define MISC_CODE 0x14 #define CLR_P_FLAG 0x18 -#define LOCATE_ON 0x12 -#define LOCATE_OFF 0x0B -#define LVL_1_MST 0x00 -#define LVL_2_MST 0x40 -#define DOM_LVL_2 0xC0 #define INIT_SELTD 0x01 @@ -452,67 +376,27 @@ enum scam_id_st { ID0,ID1,ID2,ID3,ID4,ID5,ID6,ID7,ID8,ID9,ID10,ID11,ID12, 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; +} SCCBSCAM_INFO; -#define SCSI_TEST_UNIT_READY 0x00 -#define SCSI_REZERO_UNIT 0x01 #define SCSI_REQUEST_SENSE 0x03 -#define SCSI_FORMAT_UNIT 0x04 -#define SCSI_REASSIGN 0x07 #define SCSI_READ 0x08 #define SCSI_WRITE 0x0A -#define SCSI_SEEK 0x0B -#define SCSI_INQUIRY 0x12 -#define SCSI_MODE_SELECT 0x15 -#define SCSI_RESERVE_UNIT 0x16 -#define SCSI_RELEASE_UNIT 0x17 -#define SCSI_MODE_SENSE 0x1A #define SCSI_START_STOP_UNIT 0x1B -#define SCSI_SEND_DIAGNOSTIC 0x1D -#define SCSI_READ_CAPACITY 0x25 #define SCSI_READ_EXTENDED 0x28 #define SCSI_WRITE_EXTENDED 0x2A -#define SCSI_SEEK_EXTENDED 0x2B #define SCSI_WRITE_AND_VERIFY 0x2E -#define SCSI_VERIFY 0x2F -#define SCSI_READ_DEFECT_DATA 0x37 -#define SCSI_WRITE_BUFFER 0x3B -#define SCSI_READ_BUFFER 0x3C -#define SCSI_RECV_DIAGNOSTIC 0x1C -#define SCSI_READ_LONG 0x3E -#define SCSI_WRITE_LONG 0x3F -#define SCSI_LAST_SCSI_CMND SCSI_WRITE_LONG -#define SCSI_INVALID_CMND 0xFF #define SSGOOD 0x00 #define SSCHECK 0x02 -#define SSCOND_MET 0x04 -#define SSBUSY 0x08 -#define SSRESERVATION_CONFLICT 0x18 -#define SSCMD_TERM 0x22 #define SSQ_FULL 0x28 -#define SKNO_SEN 0x00 -#define SKRECOV_ERR 0x01 -#define SKNOT_RDY 0x02 -#define SKMED_ERR 0x03 -#define SKHW_ERR 0x04 -#define SKILL_REQ 0x05 -#define SKUNIT_ATTN 0x06 -#define SKDATA_PROTECT 0x07 -#define SKBLNK_CHK 0x08 -#define SKCPY_ABORT 0x0A -#define SKABORT_CMD 0x0B -#define SKEQUAL 0x0C -#define SKVOL_OVF 0x0D -#define SKMIS_CMP 0x0E #define SMCMD_COMP 0x00 @@ -520,7 +404,6 @@ typedef struct SCCBscam_info { #define SMSAVE_DATA_PTR 0x02 #define SMREST_DATA_PTR 0x03 #define SMDISC 0x04 -#define SMINIT_DETEC_ERR 0x05 #define SMABORT 0x06 #define SMREJECT 0x07 #define SMNO_OP 0x08 @@ -535,35 +418,22 @@ typedef struct SCCBscam_info { #define SMSYNC 0x01 -#define SM10MBS 0x19 /* 100ns */ -#define SM5MBS 0x32 /* 200ns */ -#define SMOFFSET 0x0F /* Maxoffset value */ #define SMWDTR 0x03 #define SM8BIT 0x00 #define SM16BIT 0x01 -#define SM32BIT 0x02 #define SMIGNORWR 0x23 /* Ignore Wide Residue */ -#define ARBITRATION_DELAY 0x01 /* 2.4us using a 40Mhz clock */ -#define BUS_SETTLE_DELAY 0x01 /* 400ns */ -#define BUS_CLEAR_DELAY 0x01 /* 800ns */ -#define SPHASE_TO 0x0A /* 10 second timeout waiting for */ -#define SCMD_TO 0x0F /* Overall command timeout */ #define SIX_BYTE_CMD 0x06 -#define TEN_BYTE_CMD 0x0A #define TWELVE_BYTE_CMD 0x0C #define ASYNC 0x00 -#define PERI25NS 0x06 /* 25/4ns to next clock for xbow. */ -#define SYNC10MBS 0x19 -#define SYNC5MBS 0x32 #define MAX_OFFSET 0x0F /* Maxbyteoffset for Sync Xfers */ @@ -572,19 +442,11 @@ typedef struct SCCBscam_info { #define EEPROM_CHECK_SUM 0 #define FW_SIGNATURE 2 #define MODEL_NUMB_0 4 -#define MODEL_NUMB_1 5 #define MODEL_NUMB_2 6 -#define MODEL_NUMB_3 7 #define MODEL_NUMB_4 8 -#define MODEL_NUMB_5 9 -#define IO_BASE_ADDR 10 -#define IRQ_NUMBER 12 -#define PCI_INT_PIN 13 -#define BUS_DELAY 14 /*On time in byte 14 off delay in 15 */ #define SYSTEM_CONFIG 16 #define SCSI_CONFIG 17 #define BIOS_CONFIG 18 -#define SPIN_UP_DELAY 19 #define SCAM_CONFIG 20 #define ADAPTER_SCSI_ID 24 @@ -609,7 +471,6 @@ typedef struct SCCBscam_info { - #define DOM_MASTER (BIT(0) + BIT(1)) #define SCAM_ENABLED BIT(2) #define SCAM_LEVEL2 BIT(3) @@ -644,16 +505,9 @@ typedef struct SCCBscam_info { /* Sub Vendor ID and Sub Device ID only available in Harpoon Version 2 and higher */ - #define hp_sub_vendor_id_0 0x04 /* LSB */ - #define hp_sub_vendor_id_1 0x05 /* MSB */ #define hp_sub_device_id_0 0x06 /* LSB */ - #define hp_sub_device_id_1 0x07 /* MSB */ - #define hp_dual_addr_lo 0x08 - #define hp_dual_addr_lmi 0x09 - #define hp_dual_addr_hmi 0x0A - #define hp_dual_addr_hi 0x0B #define hp_semaphore 0x0C #define SCCB_MGR_ACTIVE BIT(0) @@ -661,9 +515,7 @@ typedef struct SCCBscam_info { #define SCCB_MGR_PRESENT BIT(3) #define BIOS_IN_USE BIT(4) - #define hp_user_defined_D 0x0D - #define hp_reserved_E 0x0E #define hp_sys_ctrl 0x0F @@ -671,95 +523,49 @@ typedef struct SCCBscam_info { #define DRVR_RST BIT(1) /*Firmware Reset to 80C15 chip */ #define HALT_MACH BIT(3) /*Halt State Machine */ #define HARD_ABORT BIT(4) /*Hard Abort */ - #define DIAG_MODE BIT(5) /*Diagnostic Mode */ - #define BM_ABORT_TMOUT 0x50 /*Halt State machine time out */ - #define hp_sys_cfg 0x10 - #define DONT_RST_FIFO BIT(7) /*Don't reset FIFO */ - #define hp_host_ctrl0 0x11 - #define DUAL_ADDR_MODE BIT(0) /*Enable 64-bit addresses */ - #define IO_MEM_SPACE BIT(1) /*I/O Memory Space */ - #define RESOURCE_LOCK BIT(2) /*Enable Resource Lock */ - #define IGNOR_ACCESS_ERR BIT(3) /*Ignore Access Error */ - #define HOST_INT_EDGE BIT(4) /*Host interrupt level/edge mode sel */ - #define SIX_CLOCKS BIT(5) /*6 Clocks between Strobe */ - #define DMA_EVEN_PARITY BIT(6) /*Enable DMA Enen Parity */ -/* - #define BURST_MODE BIT(0) -*/ - #define hp_reserved_12 0x12 #define hp_host_blk_cnt 0x13 - #define XFER_BLK1 0x00 /* 0 0 0 1 byte per block*/ - #define XFER_BLK2 0x01 /* 0 0 1 2 byte per block*/ - #define XFER_BLK4 0x02 /* 0 1 0 4 byte per block*/ - #define XFER_BLK8 0x03 /* 0 1 1 8 byte per block*/ - #define XFER_BLK16 0x04 /* 1 0 0 16 byte per block*/ - #define XFER_BLK32 0x05 /* 1 0 1 32 byte per block*/ #define XFER_BLK64 0x06 /* 1 1 0 64 byte per block*/ #define BM_THRESHOLD 0x40 /* PCI mode can only xfer 16 bytes*/ - #define hp_reserved_14 0x14 - #define hp_reserved_15 0x15 - #define hp_reserved_16 0x16 #define hp_int_mask 0x17 #define INT_CMD_COMPL BIT(0) /* DMA command complete */ #define INT_EXT_STATUS BIT(1) /* Extended Status Set */ - #define INT_SCSI BIT(2) /* Scsi block interrupt */ - #define INT_FIFO_RDY BIT(4) /* FIFO data ready */ #define hp_xfer_cnt_lo 0x18 - #define hp_xfer_cnt_mi 0x19 #define hp_xfer_cnt_hi 0x1A #define hp_xfer_cmd 0x1B #define XFER_HOST_DMA 0x00 /* 0 0 0 Transfer Host -> DMA */ #define XFER_DMA_HOST 0x01 /* 0 0 1 Transfer DMA -> Host */ - #define XFER_HOST_MPU 0x02 /* 0 1 0 Transfer Host -> MPU */ - #define XFER_MPU_HOST 0x03 /* 0 1 1 Transfer MPU -> Host */ - #define XFER_DMA_MPU 0x04 /* 1 0 0 Transfer DMA -> MPU */ - #define XFER_MPU_DMA 0x05 /* 1 0 1 Transfer MPU -> DMA */ - #define SET_SEMAPHORE 0x06 /* 1 1 0 Set Semaphore */ - #define XFER_NOP 0x07 /* 1 1 1 Transfer NOP */ - #define XFER_MB_MPU 0x06 /* 1 1 0 Transfer MB -> MPU */ - #define XFER_MB_DMA 0x07 /* 1 1 1 Transfer MB -> DMA */ #define XFER_HOST_AUTO 0x00 /* 0 0 Auto Transfer Size */ - #define XFER_HOST_8BIT 0x08 /* 0 1 8 BIT Transfer Size */ - #define XFER_HOST_16BIT 0x10 /* 1 0 16 BIT Transfer Size */ - #define XFER_HOST_32BIT 0x18 /* 1 1 32 BIT Transfer Size */ #define XFER_DMA_8BIT 0x20 /* 0 1 8 BIT Transfer Size */ - #define XFER_DMA_16BIT 0x40 /* 1 0 16 BIT Transfer Size */ #define DISABLE_INT BIT(7) /*Do not interrupt at end of cmd. */ #define HOST_WRT_CMD ((DISABLE_INT + XFER_HOST_DMA + XFER_HOST_AUTO + XFER_DMA_8BIT)) #define HOST_RD_CMD ((DISABLE_INT + XFER_DMA_HOST + XFER_HOST_AUTO + XFER_DMA_8BIT)) - #define WIDE_HOST_WRT_CMD ((DISABLE_INT + XFER_HOST_DMA + XFER_HOST_AUTO + XFER_DMA_16BIT)) - #define WIDE_HOST_RD_CMD ((DISABLE_INT + XFER_DMA_HOST + XFER_HOST_AUTO + XFER_DMA_16BIT)) #define hp_host_addr_lo 0x1C - #define hp_host_addr_lmi 0x1D #define hp_host_addr_hmi 0x1E - #define hp_host_addr_hi 0x1F - #define hp_pio_data 0x20 - #define hp_reserved_21 0x21 #define hp_ee_ctrl 0x22 #define EXT_ARB_ACK BIT(7) @@ -777,17 +583,8 @@ typedef struct SCCBscam_info { #define EWDS 0x04 #define EWDS_ADDR 0x0000 - #define hp_brdctl 0x23 - #define DAT_7 BIT(7) - #define DAT_6 BIT(6) - #define DAT_5 BIT(5) - #define BRD_STB BIT(4) - #define BRD_CS BIT(3) - #define BRD_WR BIT(2) - #define hp_reserved_24 0x24 - #define hp_reserved_25 0x25 @@ -796,70 +593,36 @@ typedef struct SCCBscam_info { #define SCSI_TERM_ENA_L BIT(0) /*Enable/Disable external terminators */ #define FLUSH_XFER_CNTR BIT(1) /*Flush transfer counter */ - #define BM_XFER_MIN_8 BIT(2) /*Enable bus master transfer of 9 */ - #define BIOS_ENA BIT(3) /*Enable BIOS/FLASH Enable */ #define FORCE1_XFER BIT(5) /*Always xfer one byte in byte mode */ #define FAST_SINGLE BIT(6) /*?? */ #define BMCTRL_DEFAULT (FORCE1_XFER|FAST_SINGLE|SCSI_TERM_ENA_L) - #define hp_reserved_27 0x27 #define hp_sg_addr 0x28 #define hp_page_ctrl 0x29 #define SCATTER_EN BIT(0) #define SGRAM_ARAM BIT(1) - #define BIOS_SHADOW BIT(2) #define G_INT_DISABLE BIT(3) /* Enable/Disable all Interrupts */ #define NARROW_SCSI_CARD BIT(4) /* NARROW/WIDE SCSI config pin */ - #define hp_reserved_2A 0x2A - #define hp_pci_cmd_cfg 0x2B - #define IO_SPACE_ENA BIT(0) /*enable I/O space */ - #define MEM_SPACE_ENA BIT(1) /*enable memory space */ - #define BUS_MSTR_ENA BIT(2) /*enable bus master operation */ - #define MEM_WI_ENA BIT(4) /*enable Write and Invalidate */ - #define PAR_ERR_RESP BIT(6) /*enable parity error responce. */ - #define hp_reserved_2C 0x2C #define hp_pci_stat_cfg 0x2D - #define DATA_PARITY_ERR BIT(0) - #define REC_TARGET_ABORT BIT(4) /*received Target abort */ #define REC_MASTER_ABORT BIT(5) /*received Master abort */ - #define SIG_SYSTEM_ERR BIT(6) - #define DETECTED_PAR_ERR BIT(7) - #define hp_reserved_2E 0x2E - #define hp_sys_status 0x2F - #define SLV_DATA_RDY BIT(0) /*Slave data ready */ - #define XFER_CNT_ZERO BIT(1) /*Transfer counter = 0 */ - #define BM_FIFO_EMPTY BIT(2) /*FIFO empty */ - #define BM_FIFO_FULL BIT(3) /*FIFO full */ - #define HOST_OP_DONE BIT(4) /*host operation done */ - #define DMA_OP_DONE BIT(5) /*DMA operation done */ - #define SLV_OP_DONE BIT(6) /*Slave operation done */ - #define PWR_ON_FLAG BIT(7) /*Power on flag */ - #define hp_reserved_30 0x30 - #define hp_host_status0 0x31 - #define HOST_TERM BIT(5) /*Host Terminal Count */ - #define HOST_TRSHLD BIT(6) /*Host Threshold */ - #define CONNECTED_2_HOST BIT(7) /*Connected to Host */ - #define hp_reserved_32 0x32 #define hp_rev_num 0x33 - #define REV_A_CONST 0x0E - #define REV_B_CONST 0x0E #define hp_stack_data 0x34 #define hp_stack_addr 0x35 @@ -869,8 +632,6 @@ typedef struct SCCBscam_info { #define BM_FORCE_OFF BIT(0) /*Bus Master is forced to get off */ #define PCI_TGT_ABORT BIT(0) /*PCI bus master transaction aborted */ #define PCI_DEV_TMOUT BIT(1) /*PCI Device Time out */ - #define FIFO_TC_NOT_ZERO BIT(2) /*FIFO or transfer counter not zero */ - #define CHIP_RST_OCCUR BIT(3) /*Chip reset occurs */ #define CMD_ABORTED BIT(4) /*Command aborted */ #define BM_PARITY_ERR BIT(5) /*parity error on data received */ #define PIO_OVERRUN BIT(6) /*Slave data overrun */ @@ -880,24 +641,13 @@ typedef struct SCCBscam_info { #define hp_int_status 0x37 - #define BM_CMD_CMPL BIT(0) /*Bus Master command complete */ #define EXT_STATUS_ON BIT(1) /*Extended status is valid */ #define SCSI_INTERRUPT BIT(2) /*Global indication of a SCSI int. */ - #define BM_FIFO_RDY BIT(4) #define INT_ASSERTED BIT(5) /* */ - #define SRAM_BUSY BIT(6) /*Scatter/Gather RAM busy */ - #define CMD_REG_BUSY BIT(7) #define hp_fifo_cnt 0x38 - #define hp_curr_host_cnt 0x39 - #define hp_reserved_3A 0x3A - #define hp_fifo_in_addr 0x3B - #define hp_fifo_out_addr 0x3C - #define hp_reserved_3D 0x3D - #define hp_reserved_3E 0x3E - #define hp_reserved_3F 0x3F @@ -937,9 +687,7 @@ typedef struct SCCBscam_info { #define SCSI_IOBIT BIT(0) #define S_SCSI_PHZ (BIT(2)+BIT(1)+BIT(0)) - #define S_CMD_PH (BIT(2) ) #define S_MSGO_PH (BIT(2)+BIT(1) ) - #define S_STAT_PH (BIT(2) +BIT(0)) #define S_MSGI_PH (BIT(2)+BIT(1)+BIT(0)) #define S_DATAI_PH ( BIT(0)) #define S_DATAO_PH 0x00 @@ -947,7 +695,6 @@ typedef struct SCCBscam_info { #define hp_scsictrl_0 0x45 - #define NO_ARB BIT(7) #define SEL_TAR BIT(6) #define ENA_ATN BIT(4) #define ENA_RESEL BIT(2) @@ -969,44 +716,33 @@ typedef struct SCCBscam_info { #define hp_scsireset 0x47 - #define SCSI_TAR BIT(7) #define SCSI_INI BIT(6) #define SCAM_EN BIT(5) - #define ACK_HOLD BIT(4) #define DMA_RESET BIT(3) #define HPSCSI_RESET BIT(2) #define PROG_RESET BIT(1) #define FIFO_CLR BIT(0) #define hp_xfercnt_0 0x48 - #define hp_xfercnt_1 0x49 #define hp_xfercnt_2 0x4A - #define hp_xfercnt_3 0x4B #define hp_fifodata_0 0x4C - #define hp_fifodata_1 0x4D #define hp_addstat 0x4E #define SCAM_TIMER BIT(7) - #define AUTO_RUNNING BIT(6) - #define FAST_SYNC BIT(5) #define SCSI_MODE8 BIT(3) #define SCSI_PAR_ERR BIT(0) #define hp_prgmcnt_0 0x4F - #define AUTO_PC_MASK 0x3F #define hp_selfid_0 0x50 #define hp_selfid_1 0x51 #define hp_arb_id 0x52 - #define ARB_ID (BIT(3) + BIT(2) + BIT(1) + BIT(0)) #define hp_select_id 0x53 - #define RESEL_ID (BIT(7) + BIT(6) + BIT(5) + BIT(4)) - #define SELECT_ID (BIT(3) + BIT(2) + BIT(1) + BIT(0)) #define hp_synctarg_base 0x54 #define hp_synctarg_12 0x54 @@ -1029,63 +765,38 @@ typedef struct SCCBscam_info { #define hp_synctarg_2 0x62 #define hp_synctarg_3 0x63 - #define RATE_20MB 0x00 - #define RATE_10MB ( BIT(5)) - #define RATE_6_6MB ( BIT(6) ) - #define RATE_5MB ( BIT(6)+BIT(5)) - #define RATE_4MB (BIT(7) ) - #define RATE_3_33MB (BIT(7) +BIT(5)) - #define RATE_2_85MB (BIT(7)+BIT(6) ) - #define RATE_2_5MB (BIT(7)+BIT(5)+BIT(6)) - #define NEXT_CLK BIT(5) - #define SLOWEST_SYNC (BIT(7)+BIT(6)+BIT(5)) #define NARROW_SCSI BIT(4) - #define SYNC_OFFSET (BIT(3) + BIT(2) + BIT(1) + BIT(0)) - #define DEFAULT_ASYNC 0x00 #define DEFAULT_OFFSET 0x0F #define hp_autostart_0 0x64 #define hp_autostart_1 0x65 - #define hp_autostart_2 0x66 #define hp_autostart_3 0x67 - #define DISABLE 0x00 #define AUTO_IMMED BIT(5) #define SELECT BIT(6) - #define RESELECT (BIT(6)+BIT(5)) - #define BUSFREE BIT(7) - #define XFER_0 (BIT(7)+BIT(5)) #define END_DATA (BIT(7)+BIT(6)) - #define MSG_PHZ (BIT(7)+BIT(6)+BIT(5)) #define hp_gp_reg_0 0x68 #define hp_gp_reg_1 0x69 - #define hp_gp_reg_2 0x6A #define hp_gp_reg_3 0x6B #define hp_seltimeout 0x6C - #define TO_2ms 0x54 /* 2.0503ms */ #define TO_4ms 0x67 /* 3.9959ms */ #define TO_5ms 0x03 /* 4.9152ms */ #define TO_10ms 0x07 /* 11.xxxms */ #define TO_250ms 0x99 /* 250.68ms */ #define TO_290ms 0xB1 /* 289.99ms */ - #define TO_350ms 0xD6 /* 350.62ms */ - #define TO_417ms 0xFF /* 417.79ms */ #define hp_clkctrl_0 0x6D #define PWR_DWN BIT(6) #define ACTdeassert BIT(4) - #define ATNonErr BIT(3) - #define CLK_30MHZ BIT(1) #define CLK_40MHZ (BIT(1) + BIT(0)) - #define CLK_50MHZ BIT(2) #define CLKCTRL_DEFAULT (ACTdeassert | CLK_40MHZ) @@ -1095,38 +806,21 @@ typedef struct SCCBscam_info { #define hp_offsetctr 0x70 #define hp_xferstat 0x71 - #define FIFO_FULL BIT(7) #define FIFO_EMPTY BIT(6) - #define FIFO_MASK 0x3F /* Mask for the FIFO count value. */ - #define FIFO_LEN 0x20 #define hp_portctrl_1 0x72 - #define EVEN_HOST_P BIT(5) - #define INVT_SCSI BIT(4) #define CHK_SCSI_P BIT(3) #define HOST_MODE8 BIT(0) - #define HOST_MODE16 0x00 #define hp_xfer_pad 0x73 #define ID_UNLOCK BIT(3) - #define XFER_PAD BIT(2) #define hp_scsidata_0 0x74 #define hp_scsidata_1 0x75 - #define hp_timer_0 0x76 - #define hp_timer_1 0x77 - #define hp_reserved_78 0x78 - #define hp_reserved_79 0x79 - #define hp_reserved_7A 0x7A - #define hp_reserved_7B 0x7B - #define hp_reserved_7C 0x7C - #define hp_reserved_7D 0x7D - #define hp_reserved_7E 0x7E - #define hp_reserved_7F 0x7F #define hp_aramBase 0x80 #define BIOS_DATA_OFFSET 0x60 @@ -1135,22 +829,15 @@ typedef struct SCCBscam_info { - #define AUTO_LEN 0x80 - #define AR0 0x00 - #define AR1 BITW(8) - #define AR2 BITW(9) #define AR3 (BITW(9) + BITW(8)) #define SDATA BITW(10) - #define NOP_OP 0x00 /* Nop command */ #define CRD_OP BITW(11) /* Cmp Reg. w/ Data */ #define CRR_OP BITW(12) /* Cmp Reg. w. Reg. */ - #define CBE_OP (BITW(14)+BITW(12)+BITW(11)) /* Cmp SCSI cmd class & Branch EQ */ - #define CBN_OP (BITW(14)+BITW(13)) /* Cmp SCSI cmd class & Branch NOT EQ */ #define CPE_OP (BITW(14)+BITW(11)) /* Cmp SCSI phs & Branch EQ */ @@ -1163,7 +850,6 @@ typedef struct SCCBscam_info { #define ASTATUS (BITW(10)+BITW(8)) #define AMSG_OUT (BITW(10)+BITW(9)) #define AMSG_IN (BITW(10)+BITW(9)+BITW(8)) - #define AILLEGAL (BITW(9)+BITW(8)) #define BRH_OP BITW(13) /* Branch */ @@ -1176,17 +862,11 @@ typedef struct SCCBscam_info { #define TCB_OP (BITW(13)+BITW(11)) /* Test condition & branch */ - #define ATN_SET BITW(8) - #define ATN_RESET BITW(9) - #define XFER_CNT (BITW(9)+BITW(8)) #define FIFO_0 BITW(10) - #define FIFO_NOT0 (BITW(10)+BITW(8)) - #define T_USE_SYNC0 (BITW(10)+BITW(9)) #define MPM_OP BITW(15) /* Match phase and move data */ - #define MDR_OP (BITW(12)+BITW(11)) /* Move data to Reg. */ #define MRR_OP BITW(14) /* Move DReg. to Reg. */ @@ -1196,34 +876,14 @@ typedef struct SCCBscam_info { #define D_AR0 0x00 #define D_AR1 BIT(0) - #define D_AR2 BIT(1) - #define D_AR3 (BIT(1) + BIT(0)) - #define D_SDATA BIT(2) #define D_BUCKET (BIT(2) + BIT(1) + BIT(0)) - #define ADR_OP (BITW(13)+BITW(12)) /* Logical AND Reg. w. Data */ - #define ADS_OP (BITW(14)+BITW(13)+BITW(12)) - #define ODR_OP (BITW(13)+BITW(12)+BITW(11)) - #define ODS_OP (BITW(14)+BITW(13)+BITW(12)+BITW(11)) - #define STR_OP (BITW(15)+BITW(14)) /* Store to A_Reg. */ - #define AINT_ENA1 0x00 - #define AINT_STAT1 BITW(8) - #define ASCSI_SIG BITW(9) - #define ASCSI_CNTL (BITW(9)+BITW(8)) - #define APORT_CNTL BITW(10) - #define ARST_CNTL (BITW(10)+BITW(8)) - #define AXFERCNT0 (BITW(10)+BITW(9)) - #define AXFERCNT1 (BITW(10)+BITW(9)+BITW(8)) - #define AXFERCNT2 BITW(11) - #define AFIFO_DATA (BITW(11)+BITW(8)) - #define ASCSISELID (BITW(11)+BITW(9)) - #define ASCSISYNC0 (BITW(11)+BITW(9)+BITW(8)) #define RAT_OP (BITW(14)+BITW(13)+BITW(11)) @@ -1233,7 +893,6 @@ typedef struct SCCBscam_info { #define SSI_ITAR_DISC (ITAR_DISC >> 8) #define SSI_IDO_STRT (IDO_STRT >> 8) - #define SSI_IDI_STRT (IDO_STRT >> 8) #define SSI_ICMD_COMP (ICMD_COMP >> 8) #define SSI_ITICKLE (ITICKLE >> 8) @@ -1248,13 +907,11 @@ typedef struct SCCBscam_info { #define CMDPZ 0x04 /*Command phase */ #define DINT 0x12 /*Data Out/In interrupt */ #define DI 0x13 /*Data Out */ - #define MI 0x14 /*Message In */ #define DC 0x19 /*Disconnect Message */ #define ST 0x1D /*Status Phase */ #define UNKNWN 0x24 /*Unknown bus action */ #define CC 0x25 /*Command Completion failure */ #define TICK 0x26 /*New target reselected us. */ - #define RFAIL 0x27 /*Reselection failed */ #define SELCHK 0x28 /*Select & Check SCSI ID latch reg */ @@ -1268,36 +925,29 @@ typedef struct SCCBscam_info { #define TAG_STRT 0x00 - #define SELECTION_START 0x00 #define DISCONNECT_START 0x10/2 #define END_DATA_START 0x14/2 - #define NONTAG_STRT 0x02/2 #define CMD_ONLY_STRT CMDPZ/2 - #define TICKLE_STRT TICK/2 #define SELCHK_STRT SELCHK/2 -#define mEEPROM_CLK_DELAY(port) (RD_HARPOON(port+hp_intstat_1)) -#define mWAIT_10MS(port) (RD_HARPOON(port+hp_intstat_1)) -#define CLR_XFER_CNT(port) (WR_HARPOON(port+hp_xfercnt_0, 0x00)) -#define SET_XFER_CNT(port, data) (WR_HARP32(port,hp_xfercnt_0,data)) #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))) @@ -1308,11 +958,7 @@ typedef struct SCCBscam_info { #define ACCEPT_MSG_ATN(port) {while(RD_HARPOON(port+hp_scsisig) & SCSI_REQ){}\ WR_HARPOON(port+hp_scsisig, (S_ILL_PH|SCSI_ATN));} -#define ACCEPT_STAT(port) {while(RD_HARPOON(port+hp_scsisig) & SCSI_REQ){}\ - WR_HARPOON(port+hp_scsisig, S_ILL_PH);} -#define ACCEPT_STAT_ATN(port) {while(RD_HARPOON(port+hp_scsisig) & SCSI_REQ){}\ - WR_HARPOON(port+hp_scsisig, (S_ILL_PH|SCSI_ATN));} #define DISABLE_AUTO(port) (WR_HARPOON(port+hp_scsireset, PROG_RESET),\ WR_HARPOON(port+hp_scsireset, 0x00)) @@ -1332,126 +978,118 @@ typedef struct SCCBscam_info { -void scsiStartAuto(ULONG port); -static UCHAR FPT_sisyncn(ULONG port, UCHAR p_card, UCHAR syncFlag); -static void FPT_ssel(ULONG port, UCHAR p_card); -static void FPT_sres(ULONG port, UCHAR p_card, PSCCBcard pCurrCard); -static void FPT_shandem(ULONG port, UCHAR p_card,PSCCB pCurrSCCB); -static void FPT_stsyncn(ULONG port, UCHAR p_card); -static void FPT_sisyncr(ULONG port,UCHAR sync_pulse, UCHAR offset); -static void FPT_sssyncv(ULONG p_port, UCHAR p_id, UCHAR p_sync_value, +static unsigned char FPT_sisyncn(ULONG port, unsigned char p_card, unsigned char syncFlag); +static void FPT_ssel(ULONG port, unsigned char p_card); +static void FPT_sres(ULONG port, unsigned char p_card, PSCCBcard pCurrCard); +static void FPT_shandem(ULONG port, unsigned char p_card,PSCCB pCurrSCCB); +static void FPT_stsyncn(ULONG port, unsigned char p_card); +static void FPT_sisyncr(ULONG port,unsigned char sync_pulse, unsigned char offset); +static void FPT_sssyncv(ULONG p_port, unsigned char p_id, unsigned char p_sync_value, PSCCBMgr_tar_info currTar_Info); -static void FPT_sresb(ULONG port, UCHAR p_card); -static void FPT_sxfrp(ULONG p_port, UCHAR p_card); -static void FPT_schkdd(ULONG port, UCHAR p_card); -static UCHAR FPT_RdStack(ULONG port, UCHAR index); -static void FPT_WrStack(ULONG portBase, UCHAR index, UCHAR data); -static UCHAR FPT_ChkIfChipInitialized(ULONG ioPort); - -static void FPT_SendMsg(ULONG port, UCHAR message); -static void FPT_queueFlushTargSccb(UCHAR p_card, UCHAR thisTarg, - UCHAR error_code); - -static void FPT_sinits(PSCCB p_sccb, UCHAR p_card); +static void FPT_sresb(ULONG port, unsigned char p_card); +static void FPT_sxfrp(ULONG p_port, unsigned char p_card); +static void FPT_schkdd(ULONG port, unsigned char p_card); +static unsigned char FPT_RdStack(ULONG port, unsigned char index); +static void FPT_WrStack(ULONG portBase, unsigned char index, unsigned char data); +static unsigned char FPT_ChkIfChipInitialized(ULONG ioPort); + +static void FPT_SendMsg(ULONG port, unsigned char message); +static void FPT_queueFlushTargSccb(unsigned char p_card, unsigned char thisTarg, + unsigned char error_code); + +static void FPT_sinits(PSCCB p_sccb, unsigned char p_card); static void FPT_RNVRamData(PNVRamInfo pNvRamInfo); -static UCHAR FPT_siwidn(ULONG port, UCHAR p_card); -static void FPT_stwidn(ULONG port, UCHAR p_card); -static void FPT_siwidr(ULONG port, UCHAR width); +static unsigned char FPT_siwidn(ULONG port, unsigned char p_card); +static void FPT_stwidn(ULONG port, unsigned char p_card); +static void FPT_siwidr(ULONG port, unsigned char width); -static void FPT_queueSelectFail(PSCCBcard pCurrCard, UCHAR p_card); -static void FPT_queueDisconnect(PSCCB p_SCCB, UCHAR p_card); +static void FPT_queueSelectFail(PSCCBcard pCurrCard, unsigned char p_card); +static void FPT_queueDisconnect(PSCCB p_SCCB, unsigned char p_card); static void FPT_queueCmdComplete(PSCCBcard pCurrCard, PSCCB p_SCCB, - UCHAR p_card); -static void FPT_queueSearchSelect(PSCCBcard pCurrCard, UCHAR p_card); -static void FPT_queueFlushSccb(UCHAR p_card, UCHAR error_code); -static void FPT_queueAddSccb(PSCCB p_SCCB, UCHAR card); -static UCHAR FPT_queueFindSccb(PSCCB p_SCCB, UCHAR p_card); + unsigned char p_card); +static void FPT_queueSearchSelect(PSCCBcard pCurrCard, unsigned char p_card); +static void FPT_queueFlushSccb(unsigned char p_card, unsigned char error_code); +static void FPT_queueAddSccb(PSCCB p_SCCB, unsigned char card); +static unsigned char FPT_queueFindSccb(PSCCB p_SCCB, unsigned char p_card); static void FPT_utilUpdateResidual(PSCCB p_SCCB); -static USHORT FPT_CalcCrc16(UCHAR buffer[]); -static UCHAR FPT_CalcLrc(UCHAR buffer[]); +static unsigned short FPT_CalcCrc16(unsigned char buffer[]); +static unsigned char FPT_CalcLrc(unsigned char buffer[]); static void FPT_Wait1Second(ULONG p_port); -static void FPT_Wait(ULONG p_port, UCHAR p_delay); -static void FPT_utilEEWriteOnOff(ULONG p_port,UCHAR p_mode); -static void FPT_utilEEWrite(ULONG p_port, USHORT ee_data, USHORT ee_addr); -static USHORT FPT_utilEERead(ULONG p_port, USHORT ee_addr); -static USHORT FPT_utilEEReadOrg(ULONG p_port, USHORT ee_addr); -static void FPT_utilEESendCmdAddr(ULONG p_port, UCHAR ee_cmd, USHORT ee_addr); +static void FPT_Wait(ULONG p_port, unsigned char p_delay); +static void FPT_utilEEWriteOnOff(ULONG p_port,unsigned char p_mode); +static void FPT_utilEEWrite(ULONG p_port, unsigned short ee_data, unsigned short ee_addr); +static unsigned short FPT_utilEERead(ULONG p_port, unsigned short ee_addr); +static unsigned short FPT_utilEEReadOrg(ULONG p_port, unsigned short ee_addr); +static void FPT_utilEESendCmdAddr(ULONG p_port, unsigned char ee_cmd, unsigned short ee_addr); -static void FPT_phaseDataOut(ULONG port, UCHAR p_card); -static void FPT_phaseDataIn(ULONG port, UCHAR p_card); -static void FPT_phaseCommand(ULONG port, UCHAR p_card); -static void FPT_phaseStatus(ULONG port, UCHAR p_card); -static void FPT_phaseMsgOut(ULONG port, UCHAR p_card); -static void FPT_phaseMsgIn(ULONG port, UCHAR p_card); -static void FPT_phaseIllegal(ULONG port, UCHAR p_card); +static void FPT_phaseDataOut(ULONG port, unsigned char p_card); +static void FPT_phaseDataIn(ULONG port, unsigned char p_card); +static void FPT_phaseCommand(ULONG port, unsigned char p_card); +static void FPT_phaseStatus(ULONG port, unsigned char p_card); +static void FPT_phaseMsgOut(ULONG port, unsigned char p_card); +static void FPT_phaseMsgIn(ULONG port, unsigned char p_card); +static void FPT_phaseIllegal(ULONG port, unsigned char p_card); -static void FPT_phaseDecode(ULONG port, UCHAR p_card); -static void FPT_phaseChkFifo(ULONG port, UCHAR p_card); -static void FPT_phaseBusFree(ULONG p_port, UCHAR p_card); +static void FPT_phaseDecode(ULONG port, unsigned char p_card); +static void FPT_phaseChkFifo(ULONG port, unsigned char p_card); +static void FPT_phaseBusFree(ULONG p_port, unsigned char p_card); -static void FPT_XbowInit(ULONG port, UCHAR scamFlg); +static void FPT_XbowInit(ULONG port, unsigned char scamFlg); static void FPT_BusMasterInit(ULONG p_port); static void FPT_DiagEEPROM(ULONG p_port); -void busMstrAbort(ULONG port); static void FPT_dataXferProcessor(ULONG port, PSCCBcard pCurrCard); static void FPT_busMstrSGDataXferStart(ULONG port, PSCCB pCurrSCCB); static void FPT_busMstrDataXferStart(ULONG port, PSCCB pCurrSCCB); -static void FPT_hostDataXferAbort(ULONG port, UCHAR p_card, PSCCB pCurrSCCB); +static void FPT_hostDataXferAbort(ULONG port, unsigned char p_card, PSCCB pCurrSCCB); static void FPT_hostDataXferRestart(PSCCB currSCCB); -static UCHAR FPT_SccbMgr_bad_isr(ULONG p_port, UCHAR p_card, - PSCCBcard pCurrCard, USHORT p_int); +static unsigned char FPT_SccbMgr_bad_isr(ULONG p_port, unsigned char p_card, + PSCCBcard pCurrCard, unsigned short p_int); static void FPT_SccbMgrTableInitAll(void); -static void FPT_SccbMgrTableInitCard(PSCCBcard pCurrCard, UCHAR p_card); -static void FPT_SccbMgrTableInitTarget(UCHAR p_card, UCHAR target); +static void FPT_SccbMgrTableInitCard(PSCCBcard pCurrCard, unsigned char p_card); +static void FPT_SccbMgrTableInitTarget(unsigned char p_card, unsigned char target); -static void FPT_scini(UCHAR p_card, UCHAR p_our_id, UCHAR p_power_up); +static void FPT_scini(unsigned char p_card, unsigned char p_our_id, unsigned char p_power_up); -static int FPT_scarb(ULONG p_port, UCHAR p_sel_type); +static int FPT_scarb(ULONG p_port, unsigned char p_sel_type); static void FPT_scbusf(ULONG p_port); static void FPT_scsel(ULONG p_port); -static void FPT_scasid(UCHAR p_card, ULONG p_port); -static UCHAR FPT_scxferc(ULONG p_port, UCHAR p_data); -static UCHAR FPT_scsendi(ULONG p_port, UCHAR p_id_string[]); -static UCHAR FPT_sciso(ULONG p_port, UCHAR p_id_string[]); -static void FPT_scwirod(ULONG p_port, UCHAR p_data_bit); -static void FPT_scwiros(ULONG p_port, UCHAR p_data_bit); -static UCHAR FPT_scvalq(UCHAR p_quintet); -static UCHAR FPT_scsell(ULONG p_port, UCHAR targ_id); +static void FPT_scasid(unsigned char p_card, ULONG p_port); +static unsigned char FPT_scxferc(ULONG p_port, unsigned char p_data); +static unsigned char FPT_scsendi(ULONG p_port, unsigned char p_id_string[]); +static unsigned char FPT_sciso(ULONG p_port, unsigned char p_id_string[]); +static void FPT_scwirod(ULONG p_port, unsigned char p_data_bit); +static void FPT_scwiros(ULONG p_port, unsigned char p_data_bit); +static unsigned char FPT_scvalq(unsigned char p_quintet); +static unsigned char FPT_scsell(ULONG p_port, unsigned char targ_id); static void FPT_scwtsel(ULONG p_port); -static void FPT_inisci(UCHAR p_card, ULONG p_port, UCHAR p_our_id); -static void FPT_scsavdi(UCHAR p_card, ULONG p_port); -static UCHAR FPT_scmachid(UCHAR p_card, UCHAR p_id_string[]); +static void FPT_inisci(unsigned char p_card, ULONG p_port, unsigned char p_our_id); +static void FPT_scsavdi(unsigned char p_card, ULONG p_port); +static unsigned char FPT_scmachid(unsigned char p_card, unsigned char p_id_string[]); -static void FPT_autoCmdCmplt(ULONG p_port, UCHAR p_card); +static void FPT_autoCmdCmplt(ULONG p_port, unsigned char p_card); static void FPT_autoLoadDefaultMap(ULONG p_port); -void OS_start_timer(unsigned long ioport, unsigned long timeout); -void OS_stop_timer(unsigned long ioport, unsigned long timeout); -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); static SCCBMGR_TAR_INFO FPT_sccbMgrTbl[MAX_CARDS][MAX_SCSI_TAR] = { { { 0 } } }; static SCCBCARD FPT_BL_Card[MAX_CARDS] = { { 0 } }; @@ -1459,32 +1097,32 @@ static SCCBSCAM_INFO FPT_scamInfo[MAX_SCSI_TAR] = { { { 0 } } }; static NVRAMINFO FPT_nvRamInfo[MAX_MB_CARDS] = { { 0 } }; -static UCHAR FPT_mbCards = 0; -static UCHAR FPT_scamHAString[] = {0x63, 0x07, 'B', 'U', 'S', 'L', 'O', 'G', 'I', 'C', \ +static unsigned char FPT_mbCards = 0; +static unsigned char FPT_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}; -static USHORT FPT_default_intena = 0; +static unsigned short FPT_default_intena = 0; -static void (*FPT_s_PhaseTbl[8]) (ULONG, UCHAR)= { 0 }; +static void (*FPT_s_PhaseTbl[8]) (ULONG, unsigned char)= { 0 }; /*--------------------------------------------------------------------- * - * Function: SccbMgr_sense_adapter + * Function: FlashPoint_ProbeHostAdapter * * Description: Setup and/or Search for cards and return info to caller. * *---------------------------------------------------------------------*/ -static int SccbMgr_sense_adapter(PSCCBMGR_INFO pCardInfo) +static int FlashPoint_ProbeHostAdapter(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; + unsigned char i,j,id,ScamFlg; + unsigned short temp,temp2,temp3,temp4,temp5,temp6; ULONG ioport; PNVRamInfo pCurrNvRam; @@ -1549,8 +1187,8 @@ static int SccbMgr_sense_adapter(PSCCBMGR_INFO pCardInfo) if(pCurrNvRam) pCardInfo->si_id = pCurrNvRam->niAdapId; else - pCardInfo->si_id = (UCHAR)(FPT_utilEERead(ioport, (ADAPTER_SCSI_ID/2)) & - (UCHAR)0x0FF); + pCardInfo->si_id = (unsigned char)(FPT_utilEERead(ioport, (ADAPTER_SCSI_ID/2)) & + (unsigned char)0x0FF); pCardInfo->si_lun = 0x00; pCardInfo->si_fw_revision = ORION_FW_REV; @@ -1563,11 +1201,11 @@ static int SccbMgr_sense_adapter(PSCCBMGR_INFO pCardInfo) 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 = FPT_utilEERead(ioport, (USHORT)((SYNC_RATE_TBL/2)+id)); + temp = FPT_utilEERead(ioport, (unsigned short)((SYNC_RATE_TBL/2)+id)); for (i = 0; i < 2; temp >>=8,i++) { @@ -1606,12 +1244,12 @@ static int SccbMgr_sense_adapter(PSCCBMGR_INFO pCardInfo) if(pCurrNvRam) i = pCurrNvRam->niSysConf; else - i = (UCHAR)(FPT_utilEERead(ioport, (SYSTEM_CONFIG/2))); + i = (unsigned char)(FPT_utilEERead(ioport, (SYSTEM_CONFIG/2))); if(pCurrNvRam) ScamFlg = pCurrNvRam->niScamConf; else - ScamFlg = (UCHAR) FPT_utilEERead(ioport, SCAM_CONFIG/2); + ScamFlg = (unsigned char) FPT_utilEERead(ioport, SCAM_CONFIG/2); pCardInfo->si_flags = 0x0000; @@ -1671,11 +1309,11 @@ static int SccbMgr_sense_adapter(PSCCBMGR_INFO pCardInfo) } }else{ temp = FPT_utilEERead(ioport, (MODEL_NUMB_0/2)); - pCardInfo->si_card_model[0] = (UCHAR)(temp >> 8); + pCardInfo->si_card_model[0] = (unsigned char)(temp >> 8); temp = FPT_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') @@ -1730,7 +1368,7 @@ static int SccbMgr_sense_adapter(PSCCBMGR_INFO pCardInfo) 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); @@ -1751,18 +1389,18 @@ static int SccbMgr_sense_adapter(PSCCBMGR_INFO pCardInfo) /*--------------------------------------------------------------------- * - * Function: SccbMgr_config_adapter + * Function: FlashPoint_HardwareResetHostAdapter * * Description: Setup adapter for normal operation (hard reset). * *---------------------------------------------------------------------*/ -static ULONG SccbMgr_config_adapter(PSCCBMGR_INFO pCardInfo) +static ULONG FlashPoint_HardwareResetHostAdapter(PSCCBMGR_INFO pCardInfo) { PSCCBcard CurrCard = NULL; PNVRamInfo pCurrNvRam; - UCHAR i,j,thisCard, ScamFlg; - USHORT temp,sync_bit_map,id; + unsigned char i,j,thisCard, ScamFlg; + unsigned short temp,sync_bit_map,id; ULONG ioport; ioport = pCardInfo->si_baseaddr; @@ -1805,7 +1443,7 @@ static ULONG SccbMgr_config_adapter(PSCCBMGR_INFO pCardInfo) ScamFlg = pCurrNvRam->niScamConf; } else{ - ScamFlg = (UCHAR) FPT_utilEERead(ioport, SCAM_CONFIG/2); + ScamFlg = (unsigned char) FPT_utilEERead(ioport, SCAM_CONFIG/2); } @@ -1822,7 +1460,7 @@ static ULONG SccbMgr_config_adapter(PSCCBMGR_INFO pCardInfo) 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)); @@ -1892,23 +1530,23 @@ static ULONG SccbMgr_config_adapter(PSCCBMGR_INFO pCardInfo) 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 = FPT_utilEERead(ioport, (USHORT)((SYNC_RATE_TBL/2)+id)); + temp = FPT_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) { - FPT_sccbMgrTbl[thisCard][id*2+i].TarEEValue = (UCHAR)temp; + FPT_sccbMgrTbl[thisCard][id*2+i].TarEEValue = (unsigned char)temp; } else { FPT_sccbMgrTbl[thisCard][id*2+i].TarStatus |= SYNC_SUPPORTED; FPT_sccbMgrTbl[thisCard][id*2+i].TarEEValue = - (UCHAR)(temp & ~EE_SYNC_MASK); + (unsigned char)(temp & ~EE_SYNC_MASK); } /* if ((pCardInfo->si_per_targ_wide_nego & sync_bit_map) || @@ -1933,14 +1571,14 @@ static ULONG SccbMgr_config_adapter(PSCCBMGR_INFO pCardInfo) } 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); } -static void SccbMgr_unload_card(ULONG pCurrCard) +static void FlashPoint_ReleaseHostAdapter(ULONG pCurrCard) { - UCHAR i; + unsigned char i; ULONG portBase; ULONG regOffset; ULONG scamData; @@ -1957,7 +1595,7 @@ static void SccbMgr_unload_card(ULONG pCurrCard) FPT_WrStack(pCurrNvRam->niBaseAddr, 4, pCurrNvRam->niAdapId); for(i = 0; i < MAX_SCSI_TAR / 2; i++) - FPT_WrStack(pCurrNvRam->niBaseAddr, (UCHAR)(i+5), pCurrNvRam->niSyncTbl[i]); + FPT_WrStack(pCurrNvRam->niBaseAddr, (unsigned char)(i+5), pCurrNvRam->niSyncTbl[i]); portBase = pCurrNvRam->niBaseAddr; @@ -1976,7 +1614,7 @@ static void SccbMgr_unload_card(ULONG pCurrCard) static void FPT_RNVRamData(PNVRamInfo pNvRamInfo) { - UCHAR i; + unsigned char i; ULONG portBase; ULONG regOffset; ULONG scamData; @@ -1989,7 +1627,7 @@ static void FPT_RNVRamData(PNVRamInfo pNvRamInfo) pNvRamInfo->niAdapId = FPT_RdStack(pNvRamInfo->niBaseAddr, 4); for(i = 0; i < MAX_SCSI_TAR / 2; i++) - pNvRamInfo->niSyncTbl[i] = FPT_RdStack(pNvRamInfo->niBaseAddr, (UCHAR)(i+5)); + pNvRamInfo->niSyncTbl[i] = FPT_RdStack(pNvRamInfo->niBaseAddr, (unsigned char)(i+5)); portBase = pNvRamInfo->niBaseAddr; @@ -2002,20 +1640,20 @@ static void FPT_RNVRamData(PNVRamInfo pNvRamInfo) } -static UCHAR FPT_RdStack(ULONG portBase, UCHAR index) +static unsigned char FPT_RdStack(ULONG portBase, unsigned char index) { WR_HARPOON(portBase + hp_stack_addr, index); return(RD_HARPOON(portBase + hp_stack_data)); } -static void FPT_WrStack(ULONG portBase, UCHAR index, UCHAR data) +static void FPT_WrStack(ULONG portBase, unsigned char index, unsigned char data) { WR_HARPOON(portBase + hp_stack_addr, index); WR_HARPOON(portBase + hp_stack_data, data); } -static UCHAR FPT_ChkIfChipInitialized(ULONG ioPort) +static unsigned char FPT_ChkIfChipInitialized(ULONG ioPort) { if((RD_HARPOON(ioPort + hp_arb_id) & 0x0f) != FPT_RdStack(ioPort, 4)) return(0); @@ -2030,17 +1668,17 @@ static UCHAR FPT_ChkIfChipInitialized(ULONG ioPort) } /*--------------------------------------------------------------------- * - * Function: SccbMgr_start_sccb + * Function: FlashPoint_StartCCB * * Description: Start a command pointed to by p_Sccb. When the * command is completed it will be returned via the * callback function. * *---------------------------------------------------------------------*/ -static void SccbMgr_start_sccb(ULONG pCurrCard, PSCCB p_Sccb) +static void FlashPoint_StartCCB(ULONG pCurrCard, PSCCB p_Sccb) { ULONG ioport; - UCHAR thisCard, lun; + unsigned char thisCard, lun; PSCCB pSaveSccb; CALL_BK_FN callback; @@ -2150,20 +1788,20 @@ static void SccbMgr_start_sccb(ULONG pCurrCard, PSCCB p_Sccb) /*--------------------------------------------------------------------- * - * Function: SccbMgr_abort_sccb + * Function: FlashPoint_AbortCCB * * Description: Abort the command pointed to by p_Sccb. When the * command is completed it will be returned via the * callback function. * *---------------------------------------------------------------------*/ -static int SccbMgr_abort_sccb(ULONG pCurrCard, PSCCB p_Sccb) +static int FlashPoint_AbortCCB(ULONG pCurrCard, PSCCB p_Sccb) { ULONG ioport; - UCHAR thisCard; + unsigned char thisCard; CALL_BK_FN callback; - UCHAR TID; + unsigned char TID; PSCCB pSaveSCCB; PSCCBMgr_tar_info currTar_Info; @@ -2182,7 +1820,7 @@ static int SccbMgr_abort_sccb(ULONG pCurrCard, PSCCB p_Sccb) 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)) )); p_Sccb->SccbStatus = SCCB_ABORT; callback = p_Sccb->SccbCallback; @@ -2251,13 +1889,13 @@ static int SccbMgr_abort_sccb(ULONG pCurrCard, PSCCB p_Sccb) /*--------------------------------------------------------------------- * - * Function: SccbMgr_my_int + * Function: FlashPoint_InterruptPending * * Description: Do a quick check to determine if there is a pending * interrupt for this card and disable the IRQ Pin if so. * *---------------------------------------------------------------------*/ -static UCHAR SccbMgr_my_int(ULONG pCurrCard) +static unsigned char FlashPoint_InterruptPending(ULONG pCurrCard) { ULONG ioport; @@ -2277,19 +1915,19 @@ static UCHAR SccbMgr_my_int(ULONG pCurrCard) /*--------------------------------------------------------------------- * - * Function: SccbMgr_isr + * Function: FlashPoint_HandleInterrupt * * Description: This is our entry point when an interrupt is generated * by the card and the upper level driver passes it on to * us. * *---------------------------------------------------------------------*/ -static int SccbMgr_isr(ULONG pCurrCard) +static int FlashPoint_HandleInterrupt(ULONG pCurrCard) { PSCCB currSCCB; - UCHAR thisCard,result,bm_status, bm_int_st; - USHORT hp_int; - UCHAR i, target; + unsigned char thisCard,result,bm_status, bm_int_st; + unsigned short hp_int; + unsigned char i, target; ULONG ioport; thisCard = ((PSCCBcard)pCurrCard)->cardIndex; @@ -2298,7 +1936,7 @@ static int SccbMgr_isr(ULONG pCurrCard) MDISABLE_INT(ioport); 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; @@ -2439,7 +2077,7 @@ static 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) { FPT_phaseDecode(ioport,thisCard); } @@ -2452,11 +2090,11 @@ static 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)); } @@ -2529,10 +2167,10 @@ static int SccbMgr_isr(ULONG pCurrCard) * processing time. * *---------------------------------------------------------------------*/ -static UCHAR FPT_SccbMgr_bad_isr(ULONG p_port, UCHAR p_card, - PSCCBcard pCurrCard, USHORT p_int) +static unsigned char FPT_SccbMgr_bad_isr(ULONG p_port, unsigned char p_card, + PSCCBcard pCurrCard, unsigned short p_int) { - UCHAR temp, ScamFlg; + unsigned char temp, ScamFlg; PSCCBMgr_tar_info currTar_Info; PNVRamInfo pCurrNvRam; @@ -2565,9 +2203,9 @@ static UCHAR FPT_SccbMgr_bad_isr(ULONG p_port, UCHAR p_card, FPT_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))) @@ -2602,7 +2240,7 @@ static UCHAR FPT_SccbMgr_bad_isr(ULONG p_port, UCHAR p_card, ScamFlg = pCurrNvRam->niScamConf; } else{ - ScamFlg = (UCHAR) FPT_utilEERead(p_port, SCAM_CONFIG/2); + ScamFlg = (unsigned char) FPT_utilEERead(p_port, SCAM_CONFIG/2); } FPT_XbowInit(p_port, ScamFlg); @@ -2683,7 +2321,7 @@ static UCHAR FPT_SccbMgr_bad_isr(ULONG p_port, UCHAR p_card, static void FPT_SccbMgrTableInitAll() { - UCHAR thisCard; + unsigned char thisCard; for (thisCard = 0; thisCard < MAX_CARDS; thisCard++) { @@ -2706,9 +2344,9 @@ static void FPT_SccbMgrTableInitAll() * *---------------------------------------------------------------------*/ -static void FPT_SccbMgrTableInitCard(PSCCBcard pCurrCard, UCHAR p_card) +static void FPT_SccbMgrTableInitCard(PSCCBcard pCurrCard, unsigned char p_card) { - UCHAR scsiID, qtag; + unsigned char scsiID, qtag; for (qtag = 0; qtag < QUEUE_DEPTH; qtag++) { @@ -2741,10 +2379,10 @@ static void FPT_SccbMgrTableInitCard(PSCCBcard pCurrCard, UCHAR p_card) * *---------------------------------------------------------------------*/ -static void FPT_SccbMgrTableInitTarget(UCHAR p_card, UCHAR target) +static void FPT_SccbMgrTableInitTarget(unsigned char p_card, unsigned char target) { - UCHAR lun, qtag; + unsigned char lun, qtag; PSCCBMgr_tar_info currTar_Info; currTar_Info = &FPT_sccbMgrTbl[p_card][target]; @@ -2787,10 +2425,10 @@ static void FPT_SccbMgrTableInitTarget(UCHAR p_card, UCHAR target) * *---------------------------------------------------------------------*/ -static UCHAR FPT_sfm(ULONG port, PSCCB pCurrSCCB) +static unsigned char FPT_sfm(ULONG port, PSCCB pCurrSCCB) { - UCHAR message; - USHORT TimeOutLoop; + unsigned char message; + unsigned short TimeOutLoop; TimeOutLoop = 0; while( (!(RD_HARPOON(port+hp_scsisig) & SCSI_REQ)) && @@ -2860,16 +2498,16 @@ static UCHAR FPT_sfm(ULONG port, PSCCB pCurrSCCB) * *---------------------------------------------------------------------*/ -static void FPT_ssel(ULONG port, UCHAR p_card) +static void FPT_ssel(ULONG port, unsigned char p_card) { - UCHAR auto_loaded, i, target, *theCCB; + unsigned char auto_loaded, i, target, *theCCB; ULONG cdb_reg; PSCCBcard CurrCard; PSCCB currSCCB; PSCCBMgr_tar_info currTar_Info; - UCHAR lastTag, lun; + unsigned char lastTag, lun; CurrCard = &FPT_BL_Card[p_card]; currSCCB = CurrCard->currentSCCB; @@ -3015,8 +2653,8 @@ static void FPT_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 )); @@ -3072,8 +2710,8 @@ static void FPT_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++) { @@ -3119,7 +2757,7 @@ static void FPT_ssel(ULONG port, UCHAR p_card) } - theCCB = (UCHAR *)&currSCCB->Cdb[0]; + theCCB = (unsigned char *)&currSCCB->Cdb[0]; cdb_reg = port + CMD_STRT; @@ -3135,7 +2773,7 @@ static void FPT_ssel(ULONG port, UCHAR p_card) } /* auto_loaded */ - WRW_HARPOON((port+hp_fiforead), (USHORT) 0x00); + WRW_HARPOON((port+hp_fiforead), (unsigned short) 0x00); WR_HARPOON(port+hp_xferstat, 0x00); WRW_HARPOON((port+hp_intstat), (PROG_HLT | TIMEOUT | SEL | BUS_FREE)); @@ -3150,7 +2788,7 @@ static void FPT_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; @@ -3171,10 +2809,10 @@ static void FPT_ssel(ULONG port, UCHAR p_card) * *---------------------------------------------------------------------*/ -static void FPT_sres(ULONG port, UCHAR p_card, PSCCBcard pCurrCard) +static void FPT_sres(ULONG port, unsigned char p_card, PSCCBcard pCurrCard) { - UCHAR our_target, message, lun = 0, tag, msgRetryCount; + unsigned char our_target, message, lun = 0, tag, msgRetryCount; PSCCBMgr_tar_info currTar_Info; @@ -3237,10 +2875,10 @@ static void FPT_sres(ULONG port, UCHAR p_card, PSCCBcard pCurrCard) FPT_queueSelectFail(&FPT_BL_Card[p_card],p_card); } - WRW_HARPOON((port+hp_fiforead), (USHORT) 0x00); + WRW_HARPOON((port+hp_fiforead), (unsigned short) 0x00); - our_target = (UCHAR)(RD_HARPOON(port+hp_select_id) >> 4); + our_target = (unsigned char)(RD_HARPOON(port+hp_select_id) >> 4); currTar_Info = &FPT_sccbMgrTbl[p_card][our_target]; @@ -3272,7 +2910,7 @@ static void FPT_sres(ULONG port, UCHAR p_card, PSCCBcard pCurrCard) 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) { @@ -3432,7 +3070,7 @@ static void FPT_sres(ULONG port, UCHAR p_card, PSCCBcard pCurrCard) (RD_HARPOON(port+hp_scsisig) & SCSI_BSY)) ; } -static void FPT_SendMsg(ULONG port, UCHAR message) +static void FPT_SendMsg(ULONG port, unsigned char message) { while(!(RD_HARPOON(port+hp_scsisig) & SCSI_REQ)) { @@ -3481,7 +3119,7 @@ static void FPT_SendMsg(ULONG port, UCHAR message) * target device. * *---------------------------------------------------------------------*/ -static void FPT_sdecm(UCHAR message, ULONG port, UCHAR p_card) +static void FPT_sdecm(unsigned char message, ULONG port, unsigned char p_card) { PSCCB currSCCB; PSCCBcard CurrCard; @@ -3511,8 +3149,8 @@ static void FPT_sdecm(UCHAR message, ULONG port, UCHAR p_card) 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); @@ -3549,7 +3187,7 @@ static void FPT_sdecm(UCHAR message, ULONG port, UCHAR p_card) 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; } @@ -3568,7 +3206,7 @@ static void FPT_sdecm(UCHAR message, ULONG port, UCHAR p_card) 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; @@ -3600,7 +3238,7 @@ static void FPT_sdecm(UCHAR message, ULONG port, UCHAR p_card) currTar_Info->TarLUNBusy[0] = 1; - 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)); @@ -3660,9 +3298,9 @@ static void FPT_sdecm(UCHAR message, ULONG port, UCHAR p_card) * Description: Decide what to do with the extended message. * *---------------------------------------------------------------------*/ -static void FPT_shandem(ULONG port, UCHAR p_card, PSCCB pCurrSCCB) +static void FPT_shandem(ULONG port, unsigned char p_card, PSCCB pCurrSCCB) { - UCHAR length,message; + unsigned char length,message; length = FPT_sfm(port,pCurrSCCB); if (length) @@ -3739,7 +3377,7 @@ static void FPT_shandem(ULONG port, UCHAR p_card, PSCCB pCurrSCCB) * *---------------------------------------------------------------------*/ -static UCHAR FPT_sisyncn(ULONG port, UCHAR p_card, UCHAR syncFlag) +static unsigned char FPT_sisyncn(ULONG port, unsigned char p_card, unsigned char syncFlag) { PSCCB currSCCB; PSCCBMgr_tar_info currTar_Info; @@ -3751,7 +3389,7 @@ static UCHAR FPT_sisyncn(ULONG port, UCHAR p_card, UCHAR syncFlag) 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); @@ -3785,7 +3423,7 @@ static UCHAR FPT_sisyncn(ULONG port, UCHAR p_card, UCHAR syncFlag) { 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 { @@ -3798,7 +3436,7 @@ static UCHAR FPT_sisyncn(ULONG port, UCHAR p_card, UCHAR syncFlag) else { - currTar_Info->TarStatus |= (UCHAR)SYNC_SUPPORTED; + currTar_Info->TarStatus |= (unsigned char)SYNC_SUPPORTED; currTar_Info->TarEEValue &= ~EE_SYNC_MASK; return(0); } @@ -3814,9 +3452,9 @@ static UCHAR FPT_sisyncn(ULONG port, UCHAR p_card, UCHAR syncFlag) * necessary. * *---------------------------------------------------------------------*/ -static void FPT_stsyncn(ULONG port, UCHAR p_card) +static void FPT_stsyncn(ULONG 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; @@ -3921,7 +3559,7 @@ static void FPT_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)); } @@ -3934,7 +3572,7 @@ static void FPT_stsyncn(ULONG port, UCHAR p_card) FPT_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); } } @@ -3946,7 +3584,7 @@ static void FPT_stsyncn(ULONG port, UCHAR p_card) * Description: Answer the targets sync message. * *---------------------------------------------------------------------*/ -static void FPT_sisyncr(ULONG port,UCHAR sync_pulse, UCHAR offset) +static void FPT_sisyncr(ULONG port,unsigned char sync_pulse, unsigned char offset) { ARAM_ACCESS(port); WRW_HARPOON((port+SYNC_MSGS+0), (MPM_OP+AMSG_OUT+SMEXT )); @@ -3977,7 +3615,7 @@ static void FPT_sisyncr(ULONG port,UCHAR sync_pulse, UCHAR offset) * *---------------------------------------------------------------------*/ -static UCHAR FPT_siwidn(ULONG port, UCHAR p_card) +static unsigned char FPT_siwidn(ULONG port, unsigned char p_card) { PSCCB currSCCB; PSCCBMgr_tar_info currTar_Info; @@ -3989,7 +3627,7 @@ static UCHAR FPT_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); @@ -4004,7 +3642,7 @@ static UCHAR FPT_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(1); } @@ -4012,7 +3650,7 @@ static UCHAR FPT_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(0); @@ -4029,9 +3667,9 @@ static UCHAR FPT_siwidn(ULONG port, UCHAR p_card) * necessary. * *---------------------------------------------------------------------*/ -static void FPT_stwidn(ULONG port, UCHAR p_card) +static void FPT_stwidn(ULONG port, unsigned char p_card) { - UCHAR width; + unsigned char width; PSCCB currSCCB; PSCCBMgr_tar_info currTar_Info; @@ -4109,7 +3747,7 @@ static void FPT_stwidn(ULONG port, UCHAR p_card) * Description: Answer the targets Wide nego message. * *---------------------------------------------------------------------*/ -static void FPT_siwidr(ULONG port, UCHAR width) +static void FPT_siwidr(ULONG port, unsigned char width) { ARAM_ACCESS(port); WRW_HARPOON((port+SYNC_MSGS+0), (MPM_OP+AMSG_OUT+SMEXT )); @@ -4138,10 +3776,10 @@ static void FPT_siwidr(ULONG port, UCHAR width) * ID specified. * *---------------------------------------------------------------------*/ -static void FPT_sssyncv(ULONG p_port, UCHAR p_id, UCHAR p_sync_value, +static void FPT_sssyncv(ULONG p_port, unsigned char p_id, unsigned char p_sync_value, PSCCBMgr_tar_info currTar_Info) { - UCHAR index; + unsigned char index; index = p_id; @@ -4210,9 +3848,9 @@ static void FPT_sssyncv(ULONG p_port, UCHAR p_id, UCHAR p_sync_value, * Description: Reset the desired card's SCSI bus. * *---------------------------------------------------------------------*/ -static void FPT_sresb(ULONG port, UCHAR p_card) +static void FPT_sresb(ULONG port, unsigned char p_card) { - UCHAR scsiID, i; + unsigned char scsiID, i; PSCCBMgr_tar_info currTar_Info; @@ -4285,7 +3923,7 @@ static void FPT_sresb(ULONG port, UCHAR p_card) *---------------------------------------------------------------------*/ static void FPT_ssenss(PSCCBcard pCurrCard) { - UCHAR i; + unsigned char i; PSCCB currSCCB; currSCCB = pCurrCard->currentSCCB; @@ -4300,7 +3938,7 @@ static void FPT_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; @@ -4314,7 +3952,7 @@ static void FPT_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; @@ -4332,9 +3970,9 @@ static void FPT_ssenss(PSCCBcard pCurrCard) * *---------------------------------------------------------------------*/ -static void FPT_sxfrp(ULONG p_port, UCHAR p_card) +static void FPT_sxfrp(ULONG p_port, unsigned char p_card) { - UCHAR curr_phz; + unsigned char curr_phz; DISABLE_AUTO(p_port); @@ -4353,7 +3991,7 @@ static void FPT_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); @@ -4361,9 +3999,9 @@ static void FPT_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)); @@ -4414,10 +4052,10 @@ static void FPT_sxfrp(ULONG p_port, UCHAR p_card) * *---------------------------------------------------------------------*/ -static void FPT_schkdd(ULONG port, UCHAR p_card) +static void FPT_schkdd(ULONG port, unsigned char p_card) { - USHORT TimeOutLoop; - UCHAR sPhase; + unsigned short TimeOutLoop; + unsigned char sPhase; PSCCB currSCCB; @@ -4439,7 +4077,7 @@ static void FPT_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); } @@ -4471,7 +4109,7 @@ static void FPT_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) { @@ -4483,7 +4121,7 @@ static void FPT_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))) { @@ -4527,7 +4165,7 @@ static void FPT_schkdd(ULONG port, UCHAR p_card) * *---------------------------------------------------------------------*/ -static void FPT_sinits(PSCCB p_sccb, UCHAR p_card) +static void FPT_sinits(PSCCB p_sccb, unsigned char p_card) { PSCCBMgr_tar_info currTar_Info; @@ -4572,12 +4210,12 @@ static void FPT_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; @@ -4607,15 +4245,15 @@ static void FPT_sinits(PSCCB p_sccb, UCHAR p_card) * *---------------------------------------------------------------------*/ -static void FPT_phaseDecode(ULONG p_port, UCHAR p_card) +static void FPT_phaseDecode(ULONG p_port, unsigned char p_card) { unsigned char phase_ref; - void (*phase) (ULONG, UCHAR); + void (*phase) (ULONG, 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 = FPT_s_PhaseTbl[phase_ref]; @@ -4632,7 +4270,7 @@ static void FPT_phaseDecode(ULONG p_port, UCHAR p_card) * *---------------------------------------------------------------------*/ -static void FPT_phaseDataOut(ULONG port, UCHAR p_card) +static void FPT_phaseDataOut(ULONG port, unsigned char p_card) { PSCCB currSCCB; @@ -4676,7 +4314,7 @@ static void FPT_phaseDataOut(ULONG port, UCHAR p_card) * *---------------------------------------------------------------------*/ -static void FPT_phaseDataIn(ULONG port, UCHAR p_card) +static void FPT_phaseDataIn(ULONG port, unsigned char p_card) { PSCCB currSCCB; @@ -4723,11 +4361,11 @@ static void FPT_phaseDataIn(ULONG port, UCHAR p_card) * *---------------------------------------------------------------------*/ -static void FPT_phaseCommand(ULONG p_port, UCHAR p_card) +static void FPT_phaseCommand(ULONG p_port, unsigned char p_card) { PSCCB currSCCB; ULONG cdb_reg; - UCHAR i; + unsigned char i; currSCCB = FPT_BL_Card[p_card].currentSCCB; @@ -4775,7 +4413,7 @@ static void FPT_phaseCommand(ULONG p_port, UCHAR p_card) * *---------------------------------------------------------------------*/ -static void FPT_phaseStatus(ULONG port, UCHAR p_card) +static void FPT_phaseStatus(ULONG 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. @@ -4797,9 +4435,9 @@ static void FPT_phaseStatus(ULONG port, UCHAR p_card) * *---------------------------------------------------------------------*/ -static void FPT_phaseMsgOut(ULONG port, UCHAR p_card) +static void FPT_phaseMsgOut(ULONG port, unsigned char p_card) { - UCHAR message,scsiID; + unsigned char message,scsiID; PSCCB currSCCB; PSCCBMgr_tar_info currTar_Info; @@ -4945,9 +4583,9 @@ static void FPT_phaseMsgOut(ULONG port, UCHAR p_card) * *---------------------------------------------------------------------*/ -static void FPT_phaseMsgIn(ULONG port, UCHAR p_card) +static void FPT_phaseMsgIn(ULONG port, unsigned char p_card) { - UCHAR message; + unsigned char message; PSCCB currSCCB; currSCCB = FPT_BL_Card[p_card].currentSCCB; @@ -4998,7 +4636,7 @@ static void FPT_phaseMsgIn(ULONG port, UCHAR p_card) * *---------------------------------------------------------------------*/ -static void FPT_phaseIllegal(ULONG port, UCHAR p_card) +static void FPT_phaseIllegal(ULONG port, unsigned char p_card) { PSCCB currSCCB; @@ -5026,7 +4664,7 @@ static void FPT_phaseIllegal(ULONG port, UCHAR p_card) * *---------------------------------------------------------------------*/ -static void FPT_phaseChkFifo(ULONG port, UCHAR p_card) +static void FPT_phaseChkFifo(ULONG port, unsigned char p_card) { ULONG xfercnt; PSCCB currSCCB; @@ -5104,7 +4742,7 @@ static void FPT_phaseChkFifo(ULONG port, UCHAR p_card) * because of command complete or from a disconnect. * *---------------------------------------------------------------------*/ -static void FPT_phaseBusFree(ULONG port, UCHAR p_card) +static void FPT_phaseBusFree(ULONG port, unsigned char p_card) { PSCCB currSCCB; @@ -5134,7 +4772,7 @@ static void FPT_phaseBusFree(ULONG port, UCHAR p_card) else if(currSCCB->Sccb_scsistat == SELECT_SN_ST) { FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarStatus |= - (UCHAR)SYNC_SUPPORTED; + (unsigned char)SYNC_SUPPORTED; FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarEEValue &= ~EE_SYNC_MASK; } @@ -5310,10 +4948,10 @@ static void FPT_autoLoadDefaultMap(ULONG p_port) * *---------------------------------------------------------------------*/ -static void FPT_autoCmdCmplt(ULONG p_port, UCHAR p_card) +static void FPT_autoCmdCmplt(ULONG p_port, unsigned char p_card) { PSCCB currSCCB; - UCHAR status_byte; + unsigned char status_byte; currSCCB = FPT_BL_Card[p_card].currentSCCB; @@ -5360,7 +4998,7 @@ static void FPT_autoCmdCmplt(ULONG p_port, UCHAR p_card) if(currSCCB->Sccb_scsistat == SELECT_SN_ST) { FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarStatus |= - (UCHAR)SYNC_SUPPORTED; + (unsigned char)SYNC_SUPPORTED; FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarEEValue &= ~EE_SYNC_MASK; FPT_BL_Card[p_card].globalFlags |= F_NEW_SCCB_CMD; @@ -5536,7 +5174,7 @@ static void FPT_dataXferProcessor(ULONG port, PSCCBcard pCurrCard) 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; @@ -5566,8 +5204,8 @@ static void FPT_dataXferProcessor(ULONG port, PSCCBcard pCurrCard) static void FPT_busMstrSGDataXferStart(ULONG p_port, PSCCB pcurrSCCB) { ULONG count,addr,tmpSGCnt; - UINT sg_index; - UCHAR sg_count, i; + unsigned int sg_index; + unsigned char sg_count, i; ULONG reg_offset; @@ -5586,13 +5224,13 @@ static void FPT_busMstrSGDataXferStart(ULONG p_port, PSCCB pcurrSCCB) 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) && + ((ULONG)(sg_index * (unsigned int)SG_ELEMENT_SIZE) < pcurrSCCB->DataLength) ) { tmpSGCnt += *(((ULONG *)pcurrSCCB->DataPointer)+ (sg_index * 2)); @@ -5656,7 +5294,7 @@ static void FPT_busMstrSGDataXferStart(ULONG p_port, PSCCB pcurrSCCB) } - WR_HARPOON(p_port+hp_page_ctrl, (UCHAR) (i | SCATTER_EN)); + WR_HARPOON(p_port+hp_page_ctrl, (unsigned char) (i | SCATTER_EN)); } @@ -5721,7 +5359,7 @@ static void FPT_busMstrDataXferStart(ULONG p_port, PSCCB pcurrSCCB) * command busy is also time out, it'll just give up. * *---------------------------------------------------------------------*/ -static UCHAR FPT_busMstrTimeOut(ULONG p_port) +static unsigned char FPT_busMstrTimeOut(ULONG p_port) { ULONG timeout; @@ -5759,12 +5397,12 @@ static UCHAR FPT_busMstrTimeOut(ULONG p_port) * Description: Abort any in progress transfer. * *---------------------------------------------------------------------*/ -static void FPT_hostDataXferAbort(ULONG port, UCHAR p_card, PSCCB pCurrSCCB) +static void FPT_hostDataXferAbort(ULONG port, unsigned char p_card, PSCCB pCurrSCCB) { ULONG timeout; ULONG remain_cnt; - UINT sg_ptr; + unsigned int sg_ptr; FPT_BL_Card[p_card].globalFlags &= ~F_HOST_XFER_ACT; @@ -5815,9 +5453,9 @@ static void FPT_hostDataXferAbort(ULONG port, UCHAR p_card, PSCCB pCurrSCCB) 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; @@ -5846,7 +5484,7 @@ static void FPT_hostDataXferAbort(ULONG port, UCHAR p_card, PSCCB pCurrSCCB) 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 @@ -5991,7 +5629,7 @@ static void FPT_hostDataXferAbort(ULONG port, UCHAR p_card, PSCCB pCurrSCCB) 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); } } @@ -6020,7 +5658,7 @@ static void FPT_hostDataXferAbort(ULONG port, UCHAR p_card, PSCCB pCurrSCCB) static void FPT_hostDataXferRestart(PSCCB currSCCB) { ULONG data_count; - UINT sg_index; + unsigned int sg_index; ULONG *sg_ptr; if (currSCCB->Sccb_XferState & F_SG_XFER) { @@ -6048,7 +5686,7 @@ static void FPT_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 { @@ -6066,13 +5704,13 @@ static void FPT_hostDataXferRestart(PSCCB currSCCB) * *---------------------------------------------------------------------*/ -static void FPT_scini(UCHAR p_card, UCHAR p_our_id, UCHAR p_power_up) +static void FPT_scini(unsigned char p_card, unsigned char p_our_id, unsigned char p_power_up) { - UCHAR loser,assigned_id; + unsigned char loser,assigned_id; ULONG p_port; - UCHAR i,k,ScamFlg ; + unsigned char i,k,ScamFlg ; PSCCBcard currCard; PNVRamInfo pCurrNvRam; @@ -6086,8 +5724,8 @@ static void FPT_scini(UCHAR p_card, UCHAR p_our_id, UCHAR p_power_up) i = pCurrNvRam->niSysConf; } else{ - ScamFlg = (UCHAR) FPT_utilEERead(p_port, SCAM_CONFIG/2); - i = (UCHAR)(FPT_utilEERead(p_port, (SYSTEM_CONFIG/2))); + ScamFlg = (unsigned char) FPT_utilEERead(p_port, SCAM_CONFIG/2); + i = (unsigned char)(FPT_utilEERead(p_port, (SYSTEM_CONFIG/2))); } if(!(i & 0x02)) /* check if reset bus in AutoSCSI parameter set */ return; @@ -6205,7 +5843,7 @@ static void FPT_scini(UCHAR p_card, UCHAR p_our_id, UCHAR p_power_up) if (FPT_scvalq(k)) { currCard->ourId = - ((UCHAR)(i<<3)+(k & (UCHAR)7)) & (UCHAR) 0x3F; + ((unsigned char)(i<<3)+(k & (unsigned char)7)) & (unsigned char) 0x3F; FPT_inisci(p_card, p_port, p_our_id); FPT_scamInfo[currCard->ourId].state = ID_ASSIGNED; FPT_scamInfo[currCard->ourId].id_string[0] @@ -6262,7 +5900,7 @@ static void FPT_scini(UCHAR p_card, UCHAR p_our_id, UCHAR p_power_up) * *---------------------------------------------------------------------*/ -static int FPT_scarb(ULONG p_port, UCHAR p_sel_type) +static int FPT_scarb(ULONG p_port, unsigned char p_sel_type) { if (p_sel_type == INIT_SELTD) { @@ -6359,12 +5997,12 @@ static void FPT_scbusf(ULONG p_port) * *---------------------------------------------------------------------*/ -static void FPT_scasid(UCHAR p_card, ULONG p_port) +static void FPT_scasid(unsigned char p_card, ULONG 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; @@ -6377,7 +6015,7 @@ static void FPT_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; } FPT_scxferc(p_port,SYNC_PTRN); @@ -6393,7 +6031,7 @@ static void FPT_scasid(UCHAR p_card, ULONG p_port) 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 = FPT_scmachid(p_card,temp_id_string); @@ -6411,7 +6049,7 @@ static void FPT_scasid(UCHAR p_card, ULONG p_port) else FPT_scxferc(p_port,ID_8_F); - scam_id = (i & (UCHAR) 0x07); + scam_id = (i & (unsigned char) 0x07); for (k=1; k < 0x08; k <<= 1) @@ -6457,15 +6095,15 @@ static void FPT_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)); FPT_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))); FPT_scwirod(p_port, BIT(6)); WR_HARPOON(p_port+hp_scsisig, (SCSI_SEL | SCSI_BSY | SCSI_IOBIT | SCSI_CD)); @@ -6481,9 +6119,9 @@ static void FPT_scsel(ULONG p_port) * *---------------------------------------------------------------------*/ -static UCHAR FPT_scxferc(ULONG p_port, UCHAR p_data) +static unsigned char FPT_scxferc(ULONG 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. */ @@ -6496,7 +6134,7 @@ static UCHAR FPT_scxferc(ULONG p_port, UCHAR p_data) FPT_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); @@ -6532,9 +6170,9 @@ static UCHAR FPT_scxferc(ULONG p_port, UCHAR p_data) * *---------------------------------------------------------------------*/ -static UCHAR FPT_scsendi(ULONG p_port, UCHAR p_id_string[]) +static unsigned char FPT_scsendi(ULONG 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 = 0; @@ -6585,9 +6223,9 @@ static UCHAR FPT_scsendi(ULONG p_port, UCHAR p_id_string[]) * *---------------------------------------------------------------------*/ -static UCHAR FPT_sciso(ULONG p_port, UCHAR p_id_string[]) +static unsigned char FPT_sciso(ULONG 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; @@ -6646,9 +6284,9 @@ static UCHAR FPT_sciso(ULONG p_port, UCHAR p_id_string[]) * *---------------------------------------------------------------------*/ -static void FPT_scwirod(ULONG p_port, UCHAR p_data_bit) +static void FPT_scwirod(ULONG p_port, unsigned char p_data_bit) { - UCHAR i; + unsigned char i; i = 0; while ( i < MAX_SCSI_TAR ) { @@ -6675,9 +6313,9 @@ static void FPT_scwirod(ULONG p_port, UCHAR p_data_bit) * *---------------------------------------------------------------------*/ -static void FPT_scwiros(ULONG p_port, UCHAR p_data_bit) +static void FPT_scwiros(ULONG p_port, unsigned char p_data_bit) { - UCHAR i; + unsigned char i; i = 0; while ( i < MAX_SCSI_TAR ) { @@ -6702,9 +6340,9 @@ static void FPT_scwiros(ULONG p_port, UCHAR p_data_bit) * *---------------------------------------------------------------------*/ -static UCHAR FPT_scvalq(UCHAR p_quintet) +static unsigned char FPT_scvalq(unsigned char p_quintet) { - UCHAR count; + unsigned char count; for (count=1; count < 0x08; count<<=1) { if (!(p_quintet & count)) @@ -6729,7 +6367,7 @@ static UCHAR FPT_scvalq(UCHAR p_quintet) * *---------------------------------------------------------------------*/ -static UCHAR FPT_scsell(ULONG p_port, UCHAR targ_id) +static unsigned char FPT_scsell(ULONG p_port, unsigned char targ_id) { ULONG i; @@ -6822,10 +6460,10 @@ static void FPT_scwtsel(ULONG p_port) * *---------------------------------------------------------------------*/ -static void FPT_inisci(UCHAR p_card, ULONG p_port, UCHAR p_our_id) +static void FPT_inisci(unsigned char p_card, ULONG 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 = FPT_BL_Card[p_card].pNvRamInfo; @@ -6842,7 +6480,7 @@ static void FPT_inisci(UCHAR p_card, ULONG p_port, UCHAR p_our_id) for(k = 0; k < 4; k++) FPT_scamInfo[i].id_string[k] = pCurrNvRam->niScamTbl[i][k]; for(k = 4; k < ID_STRING_LENGTH; k++) - FPT_scamInfo[i].id_string[k] = (UCHAR) 0x00; + FPT_scamInfo[i].id_string[k] = (unsigned char) 0x00; if(FPT_scamInfo[i].id_string[0] == 0x00) FPT_scamInfo[i].state = ID_UNUSED; /*Default to unused ID. */ @@ -6855,11 +6493,11 @@ static void FPT_inisci(UCHAR p_card, ULONG p_port, UCHAR p_our_id) { for (k=0; k < ID_STRING_LENGTH; k+=2) { - ee_data = FPT_utilEERead(p_port, (USHORT)((EE_SCAMBASE/2) + - (USHORT) (i*((USHORT)ID_STRING_LENGTH/2)) + (USHORT)(k/2))); - FPT_scamInfo[i].id_string[k] = (UCHAR) ee_data; + ee_data = FPT_utilEERead(p_port, (unsigned short)((EE_SCAMBASE/2) + + (unsigned short) (i*((unsigned short)ID_STRING_LENGTH/2)) + (unsigned short)(k/2))); + FPT_scamInfo[i].id_string[k] = (unsigned char) ee_data; ee_data >>= 8; - FPT_scamInfo[i].id_string[k+1] = (UCHAR) ee_data; + FPT_scamInfo[i].id_string[k+1] = (unsigned char) ee_data; } if ((FPT_scamInfo[i].id_string[0] == 0x00) || @@ -6886,10 +6524,10 @@ static void FPT_inisci(UCHAR p_card, ULONG p_port, UCHAR p_our_id) * *---------------------------------------------------------------------*/ -static UCHAR FPT_scmachid(UCHAR p_card, UCHAR p_id_string[]) +static unsigned char FPT_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++) { @@ -6918,7 +6556,7 @@ static UCHAR FPT_scmachid(UCHAR p_card, UCHAR p_id_string[]) 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; @@ -6967,7 +6605,7 @@ static UCHAR FPT_scmachid(UCHAR p_card, UCHAR p_id_string[]) 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; @@ -7015,10 +6653,10 @@ static UCHAR FPT_scmachid(UCHAR p_card, UCHAR p_id_string[]) * *---------------------------------------------------------------------*/ -static void FPT_scsavdi(UCHAR p_card, ULONG p_port) +static void FPT_scsavdi(unsigned char p_card, ULONG 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; @@ -7046,8 +6684,8 @@ static void FPT_scsavdi(UCHAR p_card, ULONG p_port) ee_data <<= 8; ee_data |= FPT_scamInfo[i].id_string[k]; sum_data += ee_data; - FPT_utilEEWrite(p_port, ee_data, (USHORT)((EE_SCAMBASE/2) + - (USHORT)(i*((USHORT)ID_STRING_LENGTH/2)) + (USHORT)(k/2))); + FPT_utilEEWrite(p_port, ee_data, (unsigned short)((EE_SCAMBASE/2) + + (unsigned short)(i*((unsigned short)ID_STRING_LENGTH/2)) + (unsigned short)(k/2))); } } @@ -7064,12 +6702,12 @@ static void FPT_scsavdi(UCHAR p_card, ULONG p_port) * *---------------------------------------------------------------------*/ -static void FPT_XbowInit(ULONG port, UCHAR ScamFlg) +static void FPT_XbowInit(ULONG 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); @@ -7147,7 +6785,7 @@ static void FPT_BusMasterInit(ULONG p_port) static void FPT_DiagEEPROM(ULONG 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; @@ -7171,7 +6809,7 @@ static void FPT_DiagEEPROM(ULONG p_port) } - FPT_utilEEWriteOnOff(p_port,(UCHAR)1); + FPT_utilEEWriteOnOff(p_port,(unsigned char)1); for (index = 0; index < max_wd_cnt; index++) { @@ -7292,7 +6930,7 @@ static void FPT_DiagEEPROM(ULONG p_port) FPT_utilEEWrite(p_port, temp, EEPROM_CHECK_SUM/2); - FPT_utilEEWriteOnOff(p_port,(UCHAR)0); + FPT_utilEEWriteOnOff(p_port,(unsigned char)0); } @@ -7305,9 +6943,9 @@ static void FPT_DiagEEPROM(ULONG p_port) * *---------------------------------------------------------------------*/ -static void FPT_queueSearchSelect(PSCCBcard pCurrCard, UCHAR p_card) +static void FPT_queueSearchSelect(PSCCBcard pCurrCard, unsigned char p_card) { - UCHAR scan_ptr, lun; + unsigned char scan_ptr, lun; PSCCBMgr_tar_info currTar_Info; PSCCB pOldSccb; @@ -7436,14 +7074,14 @@ static void FPT_queueSearchSelect(PSCCBcard pCurrCard, UCHAR p_card) * *---------------------------------------------------------------------*/ -static void FPT_queueSelectFail(PSCCBcard pCurrCard, UCHAR p_card) +static void FPT_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 = &FPT_sccbMgrTbl[p_card][thisTarg]; pCurrCard->currentSCCB->Sccb_backlink = (PSCCB)NULL; @@ -7476,10 +7114,10 @@ static void FPT_queueSelectFail(PSCCBcard pCurrCard, UCHAR p_card) *---------------------------------------------------------------------*/ static void FPT_queueCmdComplete(PSCCBcard pCurrCard, PSCCB p_sccb, - UCHAR p_card) + unsigned char p_card) { - UCHAR i, SCSIcmd; + unsigned char i, SCSIcmd; CALL_BK_FN callback; PSCCBMgr_tar_info currTar_Info; @@ -7577,7 +7215,7 @@ static void FPT_queueCmdComplete(PSCCBcard pCurrCard, PSCCB p_sccb, * Description: Add SCCB to our disconnect array. * *---------------------------------------------------------------------*/ -static void FPT_queueDisconnect(PSCCB p_sccb, UCHAR p_card) +static void FPT_queueDisconnect(PSCCB p_sccb, unsigned char p_card) { PSCCBMgr_tar_info currTar_Info; @@ -7612,16 +7250,16 @@ static void FPT_queueDisconnect(PSCCB p_sccb, UCHAR p_card) * *---------------------------------------------------------------------*/ -static void FPT_queueFlushSccb(UCHAR p_card, UCHAR error_code) +static void FPT_queueFlushSccb(unsigned char p_card, unsigned char error_code) { - UCHAR qtag,thisTarg; + unsigned char qtag,thisTarg; PSCCB currSCCB; PSCCBMgr_tar_info currTar_Info; currSCCB = FPT_BL_Card[p_card].currentSCCB; if(currSCCB != NULL) { - thisTarg = (UCHAR)currSCCB->TargID; + thisTarg = (unsigned char)currSCCB->TargID; currTar_Info = &FPT_sccbMgrTbl[p_card][thisTarg]; for (qtag=0; qtagTargID == thisTarg)) { - FPT_BL_Card[p_card].discQ_Tbl[qtag]->HostStatus = (UCHAR)error_code; + FPT_BL_Card[p_card].discQ_Tbl[qtag]->HostStatus = (unsigned char)error_code; FPT_queueCmdComplete(&FPT_BL_Card[p_card],FPT_BL_Card[p_card].discQ_Tbl[qtag], p_card); @@ -7651,10 +7289,10 @@ static void FPT_queueFlushSccb(UCHAR p_card, UCHAR error_code) * *---------------------------------------------------------------------*/ -static void FPT_queueFlushTargSccb(UCHAR p_card, UCHAR thisTarg, - UCHAR error_code) +static void FPT_queueFlushTargSccb(unsigned char p_card, unsigned char thisTarg, + unsigned char error_code) { - UCHAR qtag; + unsigned char qtag; PSCCBMgr_tar_info currTar_Info; currTar_Info = &FPT_sccbMgrTbl[p_card][thisTarg]; @@ -7665,7 +7303,7 @@ static void FPT_queueFlushTargSccb(UCHAR p_card, UCHAR thisTarg, (FPT_BL_Card[p_card].discQ_Tbl[qtag]->TargID == thisTarg)) { - FPT_BL_Card[p_card].discQ_Tbl[qtag]->HostStatus = (UCHAR)error_code; + FPT_BL_Card[p_card].discQ_Tbl[qtag]->HostStatus = (unsigned char)error_code; FPT_queueCmdComplete(&FPT_BL_Card[p_card],FPT_BL_Card[p_card].discQ_Tbl[qtag], p_card); @@ -7681,7 +7319,7 @@ static void FPT_queueFlushTargSccb(UCHAR p_card, UCHAR thisTarg, -static void FPT_queueAddSccb(PSCCB p_SCCB, UCHAR p_card) +static void FPT_queueAddSccb(PSCCB p_SCCB, unsigned char p_card) { PSCCBMgr_tar_info currTar_Info; currTar_Info = &FPT_sccbMgrTbl[p_card][p_SCCB->TargID]; @@ -7715,7 +7353,7 @@ static void FPT_queueAddSccb(PSCCB p_SCCB, UCHAR p_card) * *---------------------------------------------------------------------*/ -static UCHAR FPT_queueFindSccb(PSCCB p_SCCB, UCHAR p_card) +static unsigned char FPT_queueFindSccb(PSCCB p_SCCB, unsigned char p_card) { PSCCB q_ptr; PSCCBMgr_tar_info currTar_Info; @@ -7779,7 +7417,7 @@ static UCHAR FPT_queueFindSccb(PSCCB p_SCCB, UCHAR p_card) static void FPT_utilUpdateResidual(PSCCB p_SCCB) { ULONG partial_cnt; - UINT sg_index; + unsigned int sg_index; ULONG *sg_ptr; if (p_SCCB->Sccb_XferState & F_ALL_XFERRED) { @@ -7828,7 +7466,7 @@ static void FPT_utilUpdateResidual(PSCCB p_SCCB) static void FPT_Wait1Second(ULONG p_port) { - UCHAR i; + unsigned char i; for(i=0; i < 4; i++) { @@ -7851,10 +7489,10 @@ static void FPT_Wait1Second(ULONG p_port) * *---------------------------------------------------------------------*/ -static void FPT_Wait(ULONG p_port, UCHAR p_delay) +static void FPT_Wait(ULONG 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); @@ -7899,11 +7537,11 @@ static void FPT_Wait(ULONG p_port, UCHAR p_delay) * *---------------------------------------------------------------------*/ -static void FPT_utilEEWriteOnOff(ULONG p_port,UCHAR p_mode) +static void FPT_utilEEWriteOnOff(ULONG 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) @@ -7928,13 +7566,13 @@ static void FPT_utilEEWriteOnOff(ULONG p_port,UCHAR p_mode) * *---------------------------------------------------------------------*/ -static void FPT_utilEEWrite(ULONG p_port, USHORT ee_data, USHORT ee_addr) +static void FPT_utilEEWrite(ULONG 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)); @@ -7979,9 +7617,9 @@ static void FPT_utilEEWrite(ULONG p_port, USHORT ee_data, USHORT ee_addr) * *---------------------------------------------------------------------*/ -static USHORT FPT_utilEERead(ULONG p_port, USHORT ee_addr) +static unsigned short FPT_utilEERead(ULONG p_port, unsigned short ee_addr) { - USHORT i, ee_data1, ee_data2; + unsigned short i, ee_data1, ee_data2; i = 0; ee_data1 = FPT_utilEEReadOrg(p_port, ee_addr); @@ -8009,13 +7647,13 @@ static USHORT FPT_utilEERead(ULONG p_port, USHORT ee_addr) * *---------------------------------------------------------------------*/ -static USHORT FPT_utilEEReadOrg(ULONG p_port, USHORT ee_addr) +static unsigned short FPT_utilEEReadOrg(ULONG 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)); @@ -8057,15 +7695,15 @@ static USHORT FPT_utilEEReadOrg(ULONG p_port, USHORT ee_addr) * *---------------------------------------------------------------------*/ -static void FPT_utilEESendCmdAddr(ULONG p_port, UCHAR ee_cmd, USHORT ee_addr) +static void FPT_utilEESendCmdAddr(ULONG 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; @@ -8120,14 +7758,14 @@ static void FPT_utilEESendCmdAddr(ULONG p_port, UCHAR ee_cmd, USHORT ee_addr) } } -static USHORT FPT_CalcCrc16(UCHAR buffer[]) +static unsigned short FPT_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) @@ -8140,10 +7778,10 @@ static USHORT FPT_CalcCrc16(UCHAR buffer[]) return(crc); } -static UCHAR FPT_CalcLrc(UCHAR buffer[]) +static unsigned char FPT_CalcLrc(unsigned char buffer[]) { int i; - UCHAR lrc; + unsigned char lrc; lrc = 0; for(i = 0; i < ID_STRING_LENGTH; i++) lrc ^= buffer[i];