4040#define FAILURE 0xFFFFFFFFL
4141
4242
43- typedef unsigned short USHORT ;
4443typedef unsigned int UINT ;
4544typedef unsigned long ULONG ;
4645
@@ -59,7 +58,7 @@ typedef unsigned short * ushort_ptr;
5958
6059
6160#define BIT (x ) ((unsigned char)(1<<(x))) /* single-bit mask in bit position x */
62- #define BITW (x ) ((USHORT )(1<<(x))) /* single-bit mask in bit position x */
61+ #define BITW (x ) ((unsigned short )(1<<(x))) /* single-bit mask in bit position x */
6362
6463
6564
@@ -74,13 +73,13 @@ typedef struct SCCBMgr_info {
7473 unsigned char si_intvect ;
7574 unsigned char si_id ;
7675 unsigned char si_lun ;
77- USHORT si_fw_revision ;
78- USHORT si_per_targ_init_sync ;
79- USHORT si_per_targ_fast_nego ;
80- USHORT si_per_targ_ultra_nego ;
81- USHORT si_per_targ_no_disc ;
82- USHORT si_per_targ_wide_nego ;
83- USHORT si_flags ;
76+ unsigned short si_fw_revision ;
77+ unsigned short si_per_targ_init_sync ;
78+ unsigned short si_per_targ_fast_nego ;
79+ unsigned short si_per_targ_ultra_nego ;
80+ unsigned short si_per_targ_no_disc ;
81+ unsigned short si_per_targ_wide_nego ;
82+ unsigned short si_flags ;
8483 unsigned char si_card_family ;
8584 unsigned char si_bustype ;
8685 unsigned char si_card_model [3 ];
@@ -143,15 +142,15 @@ typedef struct _SCCB {
143142 ULONG SccbIOPort ; /* Identifies board base port */
144143 unsigned char SccbStatus ;
145144 unsigned char SCCBRes2 ;
146- USHORT SccbOSFlags ;
145+ unsigned short SccbOSFlags ;
147146
148147
149148 ULONG Sccb_XferCnt ; /* actual transfer count */
150149 ULONG Sccb_ATC ;
151150 ULONG SccbVirtDataPtr ; /* virtual addr for OS/2 */
152151 ULONG Sccb_res1 ;
153- USHORT Sccb_MGRFlags ;
154- USHORT Sccb_sgseg ;
152+ unsigned short Sccb_MGRFlags ;
153+ unsigned short Sccb_sgseg ;
155154 unsigned char Sccb_scsimsg ; /* identify msg for selection */
156155 unsigned char Sccb_tag ;
157156 unsigned char Sccb_scsistat ;
@@ -324,7 +323,7 @@ typedef struct SCCBcard {
324323
325324 ULONG ioPort ;
326325
327- USHORT cmdCounter ;
326+ unsigned short cmdCounter ;
328327 unsigned char discQCount ;
329328 unsigned char tagQ_Lst ;
330329 unsigned char cardIndex ;
@@ -943,13 +942,13 @@ typedef struct SCCBscam_info {
943942#define GET_XFER_CNT (port , xfercnt ) {RD_HARP32(port,hp_xfercnt_0,xfercnt); xfercnt &= 0xFFFFFF;}
944943/* #define GET_XFER_CNT(port, xfercnt) (xfercnt = RD_HARPOON(port+hp_xfercnt_2), \
945944 xfercnt <<= 16,\
946- xfercnt |= RDW_HARPOON((USHORT )(port+hp_xfercnt_0)))
945+ xfercnt |= RDW_HARPOON((unsigned short )(port+hp_xfercnt_0)))
947946 */
948- #define HP_SETUP_ADDR_CNT (port ,addr ,count ) (WRW_HARPOON((port+hp_host_addr_lo), (USHORT )(addr & 0x0000FFFFL)),\
947+ #define HP_SETUP_ADDR_CNT (port ,addr ,count ) (WRW_HARPOON((port+hp_host_addr_lo), (unsigned short )(addr & 0x0000FFFFL)),\
949948 addr >>= 16,\
950- WRW_HARPOON((port+hp_host_addr_hmi), (USHORT )(addr & 0x0000FFFFL)),\
949+ WRW_HARPOON((port+hp_host_addr_hmi), (unsigned short )(addr & 0x0000FFFFL)),\
951950 WR_HARP32(port,hp_xfercnt_0,count),\
952- WRW_HARPOON((port+hp_xfer_cnt_lo), (USHORT )(count & 0x0000FFFFL)),\
951+ WRW_HARPOON((port+hp_xfer_cnt_lo), (unsigned short )(count & 0x0000FFFFL)),\
953952 count >>= 16,\
954953 WR_HARPOON(port+hp_xfer_cnt_hi, (count & 0xFF)))
955954
@@ -1016,17 +1015,17 @@ static void FPT_queueFlushSccb(unsigned char p_card, unsigned char error_code);
10161015static void FPT_queueAddSccb (PSCCB p_SCCB , unsigned char card );
10171016static unsigned char FPT_queueFindSccb (PSCCB p_SCCB , unsigned char p_card );
10181017static void FPT_utilUpdateResidual (PSCCB p_SCCB );
1019- static USHORT FPT_CalcCrc16 (unsigned char buffer []);
1018+ static unsigned short FPT_CalcCrc16 (unsigned char buffer []);
10201019static unsigned char FPT_CalcLrc (unsigned char buffer []);
10211020
10221021
10231022static void FPT_Wait1Second (ULONG p_port );
10241023static void FPT_Wait (ULONG p_port , unsigned char p_delay );
10251024static void FPT_utilEEWriteOnOff (ULONG p_port ,unsigned char p_mode );
1026- static void FPT_utilEEWrite (ULONG p_port , USHORT ee_data , USHORT ee_addr );
1027- static USHORT FPT_utilEERead (ULONG p_port , USHORT ee_addr );
1028- static USHORT FPT_utilEEReadOrg (ULONG p_port , USHORT ee_addr );
1029- static void FPT_utilEESendCmdAddr (ULONG p_port , unsigned char ee_cmd , USHORT ee_addr );
1025+ static void FPT_utilEEWrite (ULONG p_port , unsigned short ee_data , unsigned short ee_addr );
1026+ static unsigned short FPT_utilEERead (ULONG p_port , unsigned short ee_addr );
1027+ static unsigned short FPT_utilEEReadOrg (ULONG p_port , unsigned short ee_addr );
1028+ static void FPT_utilEESendCmdAddr (ULONG p_port , unsigned char ee_cmd , unsigned short ee_addr );
10301029
10311030
10321031
@@ -1060,7 +1059,7 @@ static void FPT_hostDataXferRestart(PSCCB currSCCB);
10601059
10611060
10621061static unsigned char FPT_SccbMgr_bad_isr (ULONG p_port , unsigned char p_card ,
1063- PSCCBcard pCurrCard , USHORT p_int );
1062+ PSCCBcard pCurrCard , unsigned short p_int );
10641063
10651064static void FPT_SccbMgrTableInitAll (void );
10661065static void FPT_SccbMgrTableInitCard (PSCCBcard pCurrCard , unsigned char p_card );
@@ -1105,7 +1104,7 @@ static unsigned char FPT_scamHAString[] = {0x63, 0x07, 'B', 'U', 'S', 'L', 'O',
11051104 0x20 , 0x20 , 0x20 , 0x20 , 0x20 , 0x20 , 0x20 , 0x20 , \
11061105 0x20 , 0x20 , 0x20 , 0x20 , 0x20 , 0x20 , 0x20 , 0x20 };
11071106
1108- static USHORT FPT_default_intena = 0 ;
1107+ static unsigned short FPT_default_intena = 0 ;
11091108
11101109
11111110static void (* FPT_s_PhaseTbl [8 ]) (ULONG , unsigned char )= { 0 };
@@ -1124,7 +1123,7 @@ static int FlashPoint_ProbeHostAdapter(PSCCBMGR_INFO pCardInfo)
11241123 static unsigned char first_time = 1 ;
11251124
11261125 unsigned char i ,j ,id ,ScamFlg ;
1127- USHORT temp ,temp2 ,temp3 ,temp4 ,temp5 ,temp6 ;
1126+ unsigned short temp ,temp2 ,temp3 ,temp4 ,temp5 ,temp6 ;
11281127 ULONG ioport ;
11291128 PNVRamInfo pCurrNvRam ;
11301129
@@ -1203,11 +1202,11 @@ static int FlashPoint_ProbeHostAdapter(PSCCBMGR_INFO pCardInfo)
12031202 for (id = 0 ; id < (16 /2 ); id ++ ) {
12041203
12051204 if (pCurrNvRam ){
1206- temp = (USHORT ) pCurrNvRam -> niSyncTbl [id ];
1205+ temp = (unsigned short ) pCurrNvRam -> niSyncTbl [id ];
12071206 temp = ((temp & 0x03 ) + ((temp << 4 ) & 0xc0 )) +
12081207 (((temp << 4 ) & 0x0300 ) + ((temp << 8 ) & 0xc000 ));
12091208 }else
1210- temp = FPT_utilEERead (ioport , (USHORT )((SYNC_RATE_TBL /2 )+ id ));
1209+ temp = FPT_utilEERead (ioport , (unsigned short )((SYNC_RATE_TBL /2 )+ id ));
12111210
12121211 for (i = 0 ; i < 2 ; temp >>=8 ,i ++ ) {
12131212
@@ -1402,7 +1401,7 @@ static ULONG FlashPoint_HardwareResetHostAdapter(PSCCBMGR_INFO pCardInfo)
14021401 PSCCBcard CurrCard = NULL ;
14031402 PNVRamInfo pCurrNvRam ;
14041403 unsigned char i ,j ,thisCard , ScamFlg ;
1405- USHORT temp ,sync_bit_map ,id ;
1404+ unsigned short temp ,sync_bit_map ,id ;
14061405 ULONG ioport ;
14071406
14081407 ioport = pCardInfo -> si_baseaddr ;
@@ -1532,11 +1531,11 @@ static ULONG FlashPoint_HardwareResetHostAdapter(PSCCBMGR_INFO pCardInfo)
15321531 for (id = 0 ; id < (MAX_SCSI_TAR /2 ); id ++ ) {
15331532
15341533 if (pCurrNvRam ){
1535- temp = (USHORT ) pCurrNvRam -> niSyncTbl [id ];
1534+ temp = (unsigned short ) pCurrNvRam -> niSyncTbl [id ];
15361535 temp = ((temp & 0x03 ) + ((temp << 4 ) & 0xc0 )) +
15371536 (((temp << 4 ) & 0x0300 ) + ((temp << 8 ) & 0xc000 ));
15381537 }else
1539- temp = FPT_utilEERead (ioport , (USHORT )((SYNC_RATE_TBL /2 )+ id ));
1538+ temp = FPT_utilEERead (ioport , (unsigned short )((SYNC_RATE_TBL /2 )+ id ));
15401539
15411540 for (i = 0 ; i < 2 ; temp >>=8 ,i ++ ) {
15421541
@@ -1928,7 +1927,7 @@ static int FlashPoint_HandleInterrupt(ULONG pCurrCard)
19281927{
19291928 PSCCB currSCCB ;
19301929 unsigned char thisCard ,result ,bm_status , bm_int_st ;
1931- USHORT hp_int ;
1930+ unsigned short hp_int ;
19321931 unsigned char i , target ;
19331932 ULONG ioport ;
19341933
@@ -2170,7 +2169,7 @@ static int FlashPoint_HandleInterrupt(ULONG pCurrCard)
21702169 *
21712170 *---------------------------------------------------------------------*/
21722171static unsigned char FPT_SccbMgr_bad_isr (ULONG p_port , unsigned char p_card ,
2173- PSCCBcard pCurrCard , USHORT p_int )
2172+ PSCCBcard pCurrCard , unsigned short p_int )
21742173{
21752174 unsigned char temp , ScamFlg ;
21762175 PSCCBMgr_tar_info currTar_Info ;
@@ -2430,7 +2429,7 @@ static void FPT_SccbMgrTableInitTarget(unsigned char p_card, unsigned char targe
24302429static unsigned char FPT_sfm (ULONG port , PSCCB pCurrSCCB )
24312430{
24322431 unsigned char message ;
2433- USHORT TimeOutLoop ;
2432+ unsigned short TimeOutLoop ;
24342433
24352434 TimeOutLoop = 0 ;
24362435 while ( (!(RD_HARPOON (port + hp_scsisig ) & SCSI_REQ )) &&
@@ -2775,7 +2774,7 @@ static void FPT_ssel(ULONG port, unsigned char p_card)
27752774
27762775 } /* auto_loaded */
27772776
2778- WRW_HARPOON ((port + hp_fiforead ), (USHORT ) 0x00 );
2777+ WRW_HARPOON ((port + hp_fiforead ), (unsigned short ) 0x00 );
27792778 WR_HARPOON (port + hp_xferstat , 0x00 );
27802779
27812780 WRW_HARPOON ((port + hp_intstat ), (PROG_HLT | TIMEOUT | SEL | BUS_FREE ));
@@ -2877,7 +2876,7 @@ static void FPT_sres(ULONG port, unsigned char p_card, PSCCBcard pCurrCard)
28772876 FPT_queueSelectFail (& FPT_BL_Card [p_card ],p_card );
28782877 }
28792878
2880- WRW_HARPOON ((port + hp_fiforead ), (USHORT ) 0x00 );
2879+ WRW_HARPOON ((port + hp_fiforead ), (unsigned short ) 0x00 );
28812880
28822881
28832882 our_target = (unsigned char )(RD_HARPOON (port + hp_select_id ) >> 4 );
@@ -4056,7 +4055,7 @@ static void FPT_sxfrp(ULONG p_port, unsigned char p_card)
40564055
40574056static void FPT_schkdd (ULONG port , unsigned char p_card )
40584057{
4059- USHORT TimeOutLoop ;
4058+ unsigned short TimeOutLoop ;
40604059 unsigned char sPhase ;
40614060
40624061 PSCCB currSCCB ;
@@ -4079,7 +4078,7 @@ static void FPT_schkdd(ULONG port, unsigned char p_card)
40794078 currSCCB -> Sccb_XferCnt = 1 ;
40804079
40814080 currSCCB -> Sccb_XferState &= ~F_ODD_BALL_CNT ;
4082- WRW_HARPOON ((port + hp_fiforead ), (USHORT ) 0x00 );
4081+ WRW_HARPOON ((port + hp_fiforead ), (unsigned short ) 0x00 );
40834082 WR_HARPOON (port + hp_xferstat , 0x00 );
40844083 }
40854084
@@ -5486,7 +5485,7 @@ static void FPT_hostDataXferAbort(ULONG port, unsigned char p_card, PSCCB pCurrS
54865485
54875486 pCurrSCCB -> Sccb_SGoffset = remain_cnt ;
54885487
5489- pCurrSCCB -> Sccb_sgseg = (USHORT )sg_ptr ;
5488+ pCurrSCCB -> Sccb_sgseg = (unsigned short )sg_ptr ;
54905489
54915490
54925491 if ((ULONG )(sg_ptr * SG_ELEMENT_SIZE ) == pCurrSCCB -> DataLength
@@ -5631,7 +5630,7 @@ static void FPT_hostDataXferAbort(ULONG port, unsigned char p_card, PSCCB pCurrS
56315630
56325631 pCurrSCCB -> Sccb_XferState |= F_ALL_XFERRED ;
56335632
5634- pCurrSCCB -> Sccb_sgseg = (USHORT )(pCurrSCCB -> DataLength / SG_ELEMENT_SIZE );
5633+ pCurrSCCB -> Sccb_sgseg = (unsigned short )(pCurrSCCB -> DataLength / SG_ELEMENT_SIZE );
56355634
56365635 }
56375636 }
@@ -5688,7 +5687,7 @@ static void FPT_hostDataXferRestart(PSCCB currSCCB)
56885687 currSCCB -> Sccb_SGoffset = data_count - currSCCB -> Sccb_ATC ;
56895688 }
56905689
5691- currSCCB -> Sccb_sgseg = (USHORT )sg_index ;
5690+ currSCCB -> Sccb_sgseg = (unsigned short )sg_index ;
56925691 }
56935692
56945693 else {
@@ -6465,7 +6464,7 @@ static void FPT_scwtsel(ULONG p_port)
64656464static void FPT_inisci (unsigned char p_card , ULONG p_port , unsigned char p_our_id )
64666465{
64676466 unsigned char i ,k ,max_id ;
6468- USHORT ee_data ;
6467+ unsigned short ee_data ;
64696468 PNVRamInfo pCurrNvRam ;
64706469
64716470 pCurrNvRam = FPT_BL_Card [p_card ].pNvRamInfo ;
@@ -6495,8 +6494,8 @@ static void FPT_inisci(unsigned char p_card, ULONG p_port, unsigned char p_our_i
64956494 {
64966495 for (k = 0 ; k < ID_STRING_LENGTH ; k += 2 )
64976496 {
6498- ee_data = FPT_utilEERead (p_port , (USHORT )((EE_SCAMBASE /2 ) +
6499- (USHORT ) (i * ((USHORT )ID_STRING_LENGTH /2 )) + (USHORT )(k /2 )));
6497+ ee_data = FPT_utilEERead (p_port , (unsigned short )((EE_SCAMBASE /2 ) +
6498+ (unsigned short ) (i * ((unsigned short )ID_STRING_LENGTH /2 )) + (unsigned short )(k /2 )));
65006499 FPT_scamInfo [i ].id_string [k ] = (unsigned char ) ee_data ;
65016500 ee_data >>= 8 ;
65026501 FPT_scamInfo [i ].id_string [k + 1 ] = (unsigned char ) ee_data ;
@@ -6658,7 +6657,7 @@ static unsigned char FPT_scmachid(unsigned char p_card, unsigned char p_id_strin
66586657static void FPT_scsavdi (unsigned char p_card , ULONG p_port )
66596658{
66606659 unsigned char i ,k ,max_id ;
6661- USHORT ee_data ,sum_data ;
6660+ unsigned short ee_data ,sum_data ;
66626661
66636662
66646663 sum_data = 0x0000 ;
@@ -6686,8 +6685,8 @@ static void FPT_scsavdi(unsigned char p_card, ULONG p_port)
66866685 ee_data <<= 8 ;
66876686 ee_data |= FPT_scamInfo [i ].id_string [k ];
66886687 sum_data += ee_data ;
6689- FPT_utilEEWrite (p_port , ee_data , (USHORT )((EE_SCAMBASE /2 ) +
6690- (USHORT )(i * ((USHORT )ID_STRING_LENGTH /2 )) + (USHORT )(k /2 )));
6688+ FPT_utilEEWrite (p_port , ee_data , (unsigned short )((EE_SCAMBASE /2 ) +
6689+ (unsigned short )(i * ((unsigned short )ID_STRING_LENGTH /2 )) + (unsigned short )(k /2 )));
66916690 }
66926691 }
66936692
@@ -6787,7 +6786,7 @@ static void FPT_BusMasterInit(ULONG p_port)
67876786
67886787static void FPT_DiagEEPROM (ULONG p_port )
67896788{
6790- USHORT index ,temp ,max_wd_cnt ;
6789+ unsigned short index ,temp ,max_wd_cnt ;
67916790
67926791 if (RD_HARPOON (p_port + hp_page_ctrl ) & NARROW_SCSI_CARD )
67936792 max_wd_cnt = EEPROM_WD_CNT ;
@@ -7568,11 +7567,11 @@ static void FPT_utilEEWriteOnOff(ULONG p_port,unsigned char p_mode)
75687567 *
75697568 *---------------------------------------------------------------------*/
75707569
7571- static void FPT_utilEEWrite (ULONG p_port , USHORT ee_data , USHORT ee_addr )
7570+ static void FPT_utilEEWrite (ULONG p_port , unsigned short ee_data , unsigned short ee_addr )
75727571{
75737572
75747573 unsigned char ee_value ;
7575- USHORT i ;
7574+ unsigned short i ;
75767575
75777576 ee_value = (unsigned char )((RD_HARPOON (p_port + hp_ee_ctrl ) & (EXT_ARB_ACK | SCSI_TERM_ENA_H ))|
75787577 (SEE_MS | SEE_CS ));
@@ -7619,9 +7618,9 @@ static void FPT_utilEEWrite(ULONG p_port, USHORT ee_data, USHORT ee_addr)
76197618 *
76207619 *---------------------------------------------------------------------*/
76217620
7622- static USHORT FPT_utilEERead (ULONG p_port , USHORT ee_addr )
7621+ static unsigned short FPT_utilEERead (ULONG p_port , unsigned short ee_addr )
76237622{
7624- USHORT i , ee_data1 , ee_data2 ;
7623+ unsigned short i , ee_data1 , ee_data2 ;
76257624
76267625 i = 0 ;
76277626 ee_data1 = FPT_utilEEReadOrg (p_port , ee_addr );
@@ -7649,11 +7648,11 @@ static USHORT FPT_utilEERead(ULONG p_port, USHORT ee_addr)
76497648 *
76507649 *---------------------------------------------------------------------*/
76517650
7652- static USHORT FPT_utilEEReadOrg (ULONG p_port , USHORT ee_addr )
7651+ static unsigned short FPT_utilEEReadOrg (ULONG p_port , unsigned short ee_addr )
76537652{
76547653
76557654 unsigned char ee_value ;
7656- USHORT i , ee_data ;
7655+ unsigned short i , ee_data ;
76577656
76587657 ee_value = (unsigned char )((RD_HARPOON (p_port + hp_ee_ctrl ) & (EXT_ARB_ACK | SCSI_TERM_ENA_H ))|
76597658 (SEE_MS | SEE_CS ));
@@ -7697,12 +7696,12 @@ static USHORT FPT_utilEEReadOrg(ULONG p_port, USHORT ee_addr)
76977696 *
76987697 *---------------------------------------------------------------------*/
76997698
7700- static void FPT_utilEESendCmdAddr (ULONG p_port , unsigned char ee_cmd , USHORT ee_addr )
7699+ static void FPT_utilEESendCmdAddr (ULONG p_port , unsigned char ee_cmd , unsigned short ee_addr )
77017700{
77027701 unsigned char ee_value ;
77037702 unsigned char narrow_flg ;
77047703
7705- USHORT i ;
7704+ unsigned short i ;
77067705
77077706
77087707 narrow_flg = (unsigned char )(RD_HARPOON (p_port + hp_page_ctrl ) & NARROW_SCSI_CARD );
@@ -7760,14 +7759,14 @@ static void FPT_utilEESendCmdAddr(ULONG p_port, unsigned char ee_cmd, USHORT ee_
77607759 }
77617760}
77627761
7763- static USHORT FPT_CalcCrc16 (unsigned char buffer [])
7762+ static unsigned short FPT_CalcCrc16 (unsigned char buffer [])
77647763{
7765- USHORT crc = 0 ;
7764+ unsigned short crc = 0 ;
77667765 int i ,j ;
7767- USHORT ch ;
7766+ unsigned short ch ;
77687767 for (i = 0 ; i < ID_STRING_LENGTH ; i ++ )
77697768 {
7770- ch = (USHORT ) buffer [i ];
7769+ ch = (unsigned short ) buffer [i ];
77717770 for (j = 0 ; j < 8 ; j ++ )
77727771 {
77737772 if ((crc ^ ch ) & 1 )
0 commit comments