diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2006-03-08 00:14:24 -0800 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-03-12 09:13:00 -0600 |
commit | db038cf86fc63d336fc9d8e57712dee1d726e2e9 (patch) | |
tree | 08a313c0efbb13969e403ccf2777370378cd86ae /drivers/scsi/FlashPoint.c | |
parent | d8b6b8bd8a99ee91843381d51e8e619463721aed (diff) |
[SCSI] drivers/scsi/FlashPoint.c: remove UCHAR
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/FlashPoint.c')
-rw-r--r-- | drivers/scsi/FlashPoint.c | 677 |
1 files changed, 338 insertions, 339 deletions
diff --git a/drivers/scsi/FlashPoint.c b/drivers/scsi/FlashPoint.c index 1d1e4413c8d..e98bbef485b 100644 --- a/drivers/scsi/FlashPoint.c +++ b/drivers/scsi/FlashPoint.c @@ -40,7 +40,6 @@ #define FAILURE 0xFFFFFFFFL -typedef unsigned char UCHAR; typedef unsigned short USHORT; typedef unsigned int UINT; typedef unsigned long ULONG; @@ -59,7 +58,7 @@ typedef unsigned short * ushort_ptr; -#define BIT(x) ((UCHAR)(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) ((USHORT)(1<<(x))) /* single-bit mask in bit position x */ @@ -71,10 +70,10 @@ 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; + unsigned char si_present; + unsigned char si_intvect; + unsigned char si_id; + unsigned char si_lun; USHORT si_fw_revision; USHORT si_per_targ_init_sync; USHORT si_per_targ_fast_nego; @@ -82,13 +81,13 @@ typedef struct SCCBMgr_info { 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_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; @@ -122,28 +121,28 @@ typedef SCCBMGR_INFO * PSCCBMGR_INFO; #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; + unsigned char SccbStatus; + unsigned char SCCBRes2; USHORT SccbOSFlags; @@ -153,16 +152,16 @@ typedef struct _SCCB { 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 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; @@ -288,27 +287,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; @@ -326,12 +325,12 @@ typedef struct SCCBcard { ULONG ioPort; USHORT cmdCounter; - UCHAR discQCount; - UCHAR tagQ_Lst; - UCHAR cardIndex; - UCHAR scanIndex; - UCHAR globalFlags; - UCHAR ourId; + 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]; @@ -379,7 +378,7 @@ 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; @@ -981,72 +980,72 @@ typedef struct SCCBscam_info { -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 USHORT 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_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, 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_utilEESendCmdAddr(ULONG p_port, unsigned char ee_cmd, USHORT 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); @@ -1056,39 +1055,39 @@ static void FPT_DiagEEPROM(ULONG p_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, +static unsigned char FPT_SccbMgr_bad_isr(ULONG p_port, unsigned char p_card, PSCCBcard pCurrCard, USHORT 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); @@ -1100,8 +1099,8 @@ 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}; @@ -1109,7 +1108,7 @@ static UCHAR FPT_scamHAString[] = {0x63, 0x07, 'B', 'U', 'S', 'L', 'O', 'G', 'I' static USHORT FPT_default_intena = 0; -static void (*FPT_s_PhaseTbl[8]) (ULONG, UCHAR)= { 0 }; +static void (*FPT_s_PhaseTbl[8]) (ULONG, unsigned char)= { 0 }; /*--------------------------------------------------------------------- @@ -1122,9 +1121,9 @@ static void (*FPT_s_PhaseTbl[8]) (ULONG, UCHAR)= { 0 }; static int FlashPoint_ProbeHostAdapter(PSCCBMGR_INFO pCardInfo) { - static UCHAR first_time = 1; + static unsigned char first_time = 1; - UCHAR i,j,id,ScamFlg; + unsigned char i,j,id,ScamFlg; USHORT temp,temp2,temp3,temp4,temp5,temp6; ULONG ioport; PNVRamInfo pCurrNvRam; @@ -1190,8 +1189,8 @@ static int FlashPoint_ProbeHostAdapter(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; @@ -1247,12 +1246,12 @@ static int FlashPoint_ProbeHostAdapter(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; @@ -1312,11 +1311,11 @@ static int FlashPoint_ProbeHostAdapter(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') @@ -1371,7 +1370,7 @@ static int FlashPoint_ProbeHostAdapter(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); @@ -1402,7 +1401,7 @@ static ULONG FlashPoint_HardwareResetHostAdapter(PSCCBMGR_INFO pCardInfo) { PSCCBcard CurrCard = NULL; PNVRamInfo pCurrNvRam; - UCHAR i,j,thisCard, ScamFlg; + unsigned char i,j,thisCard, ScamFlg; USHORT temp,sync_bit_map,id; ULONG ioport; @@ -1446,7 +1445,7 @@ static ULONG FlashPoint_HardwareResetHostAdapter(PSCCBMGR_INFO pCardInfo) ScamFlg = pCurrNvRam->niScamConf; } else{ - ScamFlg = (UCHAR) FPT_utilEERead(ioport, SCAM_CONFIG/2); + ScamFlg = (unsigned char) FPT_utilEERead(ioport, SCAM_CONFIG/2); } @@ -1463,7 +1462,7 @@ static ULONG FlashPoint_HardwareResetHostAdapter(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)); @@ -1543,13 +1542,13 @@ static ULONG FlashPoint_HardwareResetHostAdapter(PSCCBMGR_INFO pCardInfo) 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) || @@ -1574,14 +1573,14 @@ static ULONG FlashPoint_HardwareResetHostAdapter(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 FlashPoint_ReleaseHostAdapter(ULONG pCurrCard) { - UCHAR i; + unsigned char i; ULONG portBase; ULONG regOffset; ULONG scamData; @@ -1598,7 +1597,7 @@ static void FlashPoint_ReleaseHostAdapter(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; @@ -1617,7 +1616,7 @@ static void FlashPoint_ReleaseHostAdapter(ULONG pCurrCard) static void FPT_RNVRamData(PNVRamInfo pNvRamInfo) { - UCHAR i; + unsigned char i; ULONG portBase; ULONG regOffset; ULONG scamData; @@ -1630,7 +1629,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; @@ -1643,20 +1642,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); @@ -1681,7 +1680,7 @@ static UCHAR FPT_ChkIfChipInitialized(ULONG ioPort) static void FlashPoint_StartCCB(ULONG pCurrCard, PSCCB p_Sccb) { ULONG ioport; - UCHAR thisCard, lun; + unsigned char thisCard, lun; PSCCB pSaveSccb; CALL_BK_FN callback; @@ -1802,9 +1801,9 @@ 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; @@ -1823,7 +1822,7 @@ static int FlashPoint_AbortCCB(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; @@ -1898,7 +1897,7 @@ static int FlashPoint_AbortCCB(ULONG pCurrCard, PSCCB p_Sccb) * interrupt for this card and disable the IRQ Pin if so. * *---------------------------------------------------------------------*/ -static UCHAR FlashPoint_InterruptPending(ULONG pCurrCard) +static unsigned char FlashPoint_InterruptPending(ULONG pCurrCard) { ULONG ioport; @@ -1928,9 +1927,9 @@ static UCHAR FlashPoint_InterruptPending(ULONG pCurrCard) static int FlashPoint_HandleInterrupt(ULONG pCurrCard) { PSCCB currSCCB; - UCHAR thisCard,result,bm_status, bm_int_st; + unsigned char thisCard,result,bm_status, bm_int_st; USHORT hp_int; - UCHAR i, target; + unsigned char i, target; ULONG ioport; thisCard = ((PSCCBcard)pCurrCard)->cardIndex; @@ -1939,7 +1938,7 @@ static int FlashPoint_HandleInterrupt(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; @@ -2080,7 +2079,7 @@ static int FlashPoint_HandleInterrupt(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); } @@ -2093,11 +2092,11 @@ static int FlashPoint_HandleInterrupt(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)); } @@ -2170,10 +2169,10 @@ static int FlashPoint_HandleInterrupt(ULONG pCurrCard) * processing time. * *---------------------------------------------------------------------*/ -static UCHAR FPT_SccbMgr_bad_isr(ULONG p_port, UCHAR p_card, +static unsigned char FPT_SccbMgr_bad_isr(ULONG p_port, unsigned char p_card, PSCCBcard pCurrCard, USHORT p_int) { - UCHAR temp, ScamFlg; + unsigned char temp, ScamFlg; PSCCBMgr_tar_info currTar_Info; PNVRamInfo pCurrNvRam; @@ -2206,9 +2205,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))) @@ -2243,7 +2242,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); @@ -2324,7 +2323,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++) { @@ -2347,9 +2346,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++) { @@ -2382,10 +2381,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]; @@ -2428,9 +2427,9 @@ 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; + unsigned char message; USHORT TimeOutLoop; TimeOutLoop = 0; @@ -2501,16 +2500,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; @@ -2656,8 +2655,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 )); @@ -2713,8 +2712,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++) { @@ -2760,7 +2759,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; @@ -2791,7 +2790,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; @@ -2812,10 +2811,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; @@ -2881,7 +2880,7 @@ static void FPT_sres(ULONG port, UCHAR p_card, PSCCBcard pCurrCard) WRW_HARPOON((port+hp_fiforead), (USHORT) 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]; @@ -2913,7 +2912,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) { @@ -3073,7 +3072,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)) { @@ -3122,7 +3121,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; @@ -3152,8 +3151,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); @@ -3190,7 +3189,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; } @@ -3209,7 +3208,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; @@ -3241,7 +3240,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)); @@ -3301,9 +3300,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) @@ -3380,7 +3379,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; @@ -3392,7 +3391,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); @@ -3426,7 +3425,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 { @@ -3439,7 +3438,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); } @@ -3455,9 +3454,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; @@ -3562,7 +3561,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 |