diff options
Diffstat (limited to 'drivers/scsi/initio.c')
-rw-r--r-- | drivers/scsi/initio.c | 87 |
1 files changed, 37 insertions, 50 deletions
diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c index f7ddc9f1ba41..ea6f3c0e05d9 100644 --- a/drivers/scsi/initio.c +++ b/drivers/scsi/initio.c | |||
@@ -223,7 +223,7 @@ static void tul_select_atn(HCS * pCurHcb, SCB * pCurScb); | |||
223 | static void tul_select_atn3(HCS * pCurHcb, SCB * pCurScb); | 223 | static void tul_select_atn3(HCS * pCurHcb, SCB * pCurScb); |
224 | static void tul_select_atn_stop(HCS * pCurHcb, SCB * pCurScb); | 224 | static void tul_select_atn_stop(HCS * pCurHcb, SCB * pCurScb); |
225 | static int int_tul_busfree(HCS * pCurHcb); | 225 | static int int_tul_busfree(HCS * pCurHcb); |
226 | int int_tul_scsi_rst(HCS * pCurHcb); | 226 | static int int_tul_scsi_rst(HCS * pCurHcb); |
227 | static int int_tul_bad_seq(HCS * pCurHcb); | 227 | static int int_tul_bad_seq(HCS * pCurHcb); |
228 | static int int_tul_resel(HCS * pCurHcb); | 228 | static int int_tul_resel(HCS * pCurHcb); |
229 | static int tul_sync_done(HCS * pCurHcb); | 229 | static int tul_sync_done(HCS * pCurHcb); |
@@ -240,9 +240,8 @@ static int tul_se2_rd_all(WORD CurBase); | |||
240 | static void tul_se2_update_all(WORD CurBase); /* setup default pattern */ | 240 | static void tul_se2_update_all(WORD CurBase); /* setup default pattern */ |
241 | static void tul_read_eeprom(WORD CurBase); | 241 | static void tul_read_eeprom(WORD CurBase); |
242 | 242 | ||
243 | /* ---- EXTERNAL VARIABLES ---- */ | ||
244 | HCS tul_hcs[MAX_SUPPORTED_ADAPTERS]; | ||
245 | /* ---- INTERNAL VARIABLES ---- */ | 243 | /* ---- INTERNAL VARIABLES ---- */ |
244 | static HCS tul_hcs[MAX_SUPPORTED_ADAPTERS]; | ||
246 | static INI_ADPT_STRUCT i91u_adpt[MAX_SUPPORTED_ADAPTERS]; | 245 | static INI_ADPT_STRUCT i91u_adpt[MAX_SUPPORTED_ADAPTERS]; |
247 | 246 | ||
248 | /*NVRAM nvram, *nvramp = &nvram; */ | 247 | /*NVRAM nvram, *nvramp = &nvram; */ |
@@ -381,7 +380,7 @@ void tul_se2_wait(void) | |||
381 | 380 | ||
382 | 381 | ||
383 | ******************************************************************/ | 382 | ******************************************************************/ |
384 | void tul_se2_instr(WORD CurBase, UCHAR instr) | 383 | static void tul_se2_instr(WORD CurBase, UCHAR instr) |
385 | { | 384 | { |
386 | int i; | 385 | int i; |
387 | UCHAR b; | 386 | UCHAR b; |
@@ -437,7 +436,7 @@ void tul_se2_ew_ds(WORD CurBase) | |||
437 | Input :address of Serial E2PROM | 436 | Input :address of Serial E2PROM |
438 | Output :value stored in Serial E2PROM | 437 | Output :value stored in Serial E2PROM |
439 | *******************************************************************/ | 438 | *******************************************************************/ |
440 | USHORT tul_se2_rd(WORD CurBase, ULONG adr) | 439 | static USHORT tul_se2_rd(WORD CurBase, ULONG adr) |
441 | { | 440 | { |
442 | UCHAR instr, readByte; | 441 | UCHAR instr, readByte; |
443 | USHORT readWord; | 442 | USHORT readWord; |
@@ -468,7 +467,7 @@ USHORT tul_se2_rd(WORD CurBase, ULONG adr) | |||
468 | /****************************************************************** | 467 | /****************************************************************** |
469 | Input: new value in Serial E2PROM, address of Serial E2PROM | 468 | Input: new value in Serial E2PROM, address of Serial E2PROM |
470 | *******************************************************************/ | 469 | *******************************************************************/ |
471 | void tul_se2_wr(WORD CurBase, UCHAR adr, USHORT writeWord) | 470 | static void tul_se2_wr(WORD CurBase, UCHAR adr, USHORT writeWord) |
472 | { | 471 | { |
473 | UCHAR readByte; | 472 | UCHAR readByte; |
474 | UCHAR instr; | 473 | UCHAR instr; |
@@ -584,8 +583,8 @@ void tul_read_eeprom(WORD CurBase) | |||
584 | TUL_WR(CurBase + TUL_GCTRL, gctrl & ~TUL_GCTRL_EEPROM_BIT); | 583 | TUL_WR(CurBase + TUL_GCTRL, gctrl & ~TUL_GCTRL_EEPROM_BIT); |
585 | } /* read_eeprom */ | 584 | } /* read_eeprom */ |
586 | 585 | ||
587 | int Addi91u_into_Adapter_table(WORD wBIOS, WORD wBASE, BYTE bInterrupt, | 586 | static int Addi91u_into_Adapter_table(WORD wBIOS, WORD wBASE, BYTE bInterrupt, |
588 | BYTE bBus, BYTE bDevice) | 587 | BYTE bBus, BYTE bDevice) |
589 | { | 588 | { |
590 | int i, j; | 589 | int i, j; |
591 | 590 | ||
@@ -616,7 +615,7 @@ int Addi91u_into_Adapter_table(WORD wBIOS, WORD wBASE, BYTE bInterrupt, | |||
616 | return 1; | 615 | return 1; |
617 | } | 616 | } |
618 | 617 | ||
619 | void init_i91uAdapter_table(void) | 618 | static void init_i91uAdapter_table(void) |
620 | { | 619 | { |
621 | int i; | 620 | int i; |
622 | 621 | ||
@@ -630,7 +629,7 @@ void init_i91uAdapter_table(void) | |||
630 | return; | 629 | return; |
631 | } | 630 | } |
632 | 631 | ||
633 | void tul_stop_bm(HCS * pCurHcb) | 632 | static void tul_stop_bm(HCS * pCurHcb) |
634 | { | 633 | { |
635 | 634 | ||
636 | if (TUL_RD(pCurHcb->HCS_Base, TUL_XStatus) & XPEND) { /* if DMA xfer is pending, abort DMA xfer */ | 635 | if (TUL_RD(pCurHcb->HCS_Base, TUL_XStatus) & XPEND) { /* if DMA xfer is pending, abort DMA xfer */ |
@@ -642,7 +641,7 @@ void tul_stop_bm(HCS * pCurHcb) | |||
642 | } | 641 | } |
643 | 642 | ||
644 | /***************************************************************************/ | 643 | /***************************************************************************/ |
645 | void get_tulipPCIConfig(HCS * pCurHcb, int ch_idx) | 644 | static void get_tulipPCIConfig(HCS * pCurHcb, int ch_idx) |
646 | { | 645 | { |
647 | pCurHcb->HCS_Base = i91u_adpt[ch_idx].ADPT_BASE; /* Supply base address */ | 646 | pCurHcb->HCS_Base = i91u_adpt[ch_idx].ADPT_BASE; /* Supply base address */ |
648 | pCurHcb->HCS_BIOS = i91u_adpt[ch_idx].ADPT_BIOS; /* Supply BIOS address */ | 647 | pCurHcb->HCS_BIOS = i91u_adpt[ch_idx].ADPT_BIOS; /* Supply BIOS address */ |
@@ -651,7 +650,7 @@ void get_tulipPCIConfig(HCS * pCurHcb, int ch_idx) | |||
651 | } | 650 | } |
652 | 651 | ||
653 | /***************************************************************************/ | 652 | /***************************************************************************/ |
654 | int tul_reset_scsi(HCS * pCurHcb, int seconds) | 653 | static int tul_reset_scsi(HCS * pCurHcb, int seconds) |
655 | { | 654 | { |
656 | TUL_WR(pCurHcb->HCS_Base + TUL_SCtrl0, TSC_RST_BUS); | 655 | TUL_WR(pCurHcb->HCS_Base + TUL_SCtrl0, TSC_RST_BUS); |
657 | 656 | ||
@@ -670,7 +669,8 @@ int tul_reset_scsi(HCS * pCurHcb, int seconds) | |||
670 | } | 669 | } |
671 | 670 | ||
672 | /***************************************************************************/ | 671 | /***************************************************************************/ |
673 | int init_tulip(HCS * pCurHcb, SCB * scbp, int tul_num_scb, BYTE * pbBiosAdr, int seconds) | 672 | static int init_tulip(HCS * pCurHcb, SCB * scbp, int tul_num_scb, |
673 | BYTE * pbBiosAdr, int seconds) | ||
674 | { | 674 | { |
675 | int i; | 675 | int i; |
676 | BYTE *pwFlags; | 676 | BYTE *pwFlags; |
@@ -716,7 +716,7 @@ int init_tulip(HCS * pCurHcb, SCB * scbp, int tul_num_scb, BYTE * pbBiosAdr, int | |||
716 | pCurHcb->HCS_SCSI_ID = i91unvramp->NVM_SCSIInfo[0].NVM_ChSCSIID; | 716 | pCurHcb->HCS_SCSI_ID = i91unvramp->NVM_SCSIInfo[0].NVM_ChSCSIID; |
717 | pCurHcb->HCS_IdMask = ~(1 << pCurHcb->HCS_SCSI_ID); | 717 | pCurHcb->HCS_IdMask = ~(1 << pCurHcb->HCS_SCSI_ID); |
718 | 718 | ||
719 | #if CHK_PARITY | 719 | #ifdef CHK_PARITY |
720 | /* Enable parity error response */ | 720 | /* Enable parity error response */ |
721 | TUL_WR(pCurHcb->HCS_Base + TUL_PCMD, TUL_RD(pCurHcb->HCS_Base, TUL_PCMD) | 0x40); | 721 | TUL_WR(pCurHcb->HCS_Base + TUL_PCMD, TUL_RD(pCurHcb->HCS_Base, TUL_PCMD) | 0x40); |
722 | #endif | 722 | #endif |
@@ -788,7 +788,7 @@ int init_tulip(HCS * pCurHcb, SCB * scbp, int tul_num_scb, BYTE * pbBiosAdr, int | |||
788 | } | 788 | } |
789 | 789 | ||
790 | /***************************************************************************/ | 790 | /***************************************************************************/ |
791 | SCB *tul_alloc_scb(HCS * hcsp) | 791 | static SCB *tul_alloc_scb(HCS * hcsp) |
792 | { | 792 | { |
793 | SCB *pTmpScb; | 793 | SCB *pTmpScb; |
794 | ULONG flags; | 794 | ULONG flags; |
@@ -807,7 +807,7 @@ SCB *tul_alloc_scb(HCS * hcsp) | |||
807 | } | 807 | } |
808 | 808 | ||
809 | /***************************************************************************/ | 809 | /***************************************************************************/ |
810 | void tul_release_scb(HCS * hcsp, SCB * scbp) | 810 | static void tul_release_scb(HCS * hcsp, SCB * scbp) |
811 | { | 811 | { |
812 | ULONG flags; | 812 | ULONG flags; |
813 | 813 | ||
@@ -829,7 +829,7 @@ void tul_release_scb(HCS * hcsp, SCB * scbp) | |||
829 | } | 829 | } |
830 | 830 | ||
831 | /***************************************************************************/ | 831 | /***************************************************************************/ |
832 | void tul_append_pend_scb(HCS * pCurHcb, SCB * scbp) | 832 | static void tul_append_pend_scb(HCS * pCurHcb, SCB * scbp) |
833 | { | 833 | { |
834 | 834 | ||
835 | #if DEBUG_QUEUE | 835 | #if DEBUG_QUEUE |
@@ -847,7 +847,7 @@ void tul_append_pend_scb(HCS * pCurHcb, SCB * scbp) | |||
847 | } | 847 | } |
848 | 848 | ||
849 | /***************************************************************************/ | 849 | /***************************************************************************/ |
850 | void tul_push_pend_scb(HCS * pCurHcb, SCB * scbp) | 850 | static void tul_push_pend_scb(HCS * pCurHcb, SCB * scbp) |
851 | { | 851 | { |
852 | 852 | ||
853 | #if DEBUG_QUEUE | 853 | #if DEBUG_QUEUE |
@@ -863,7 +863,7 @@ void tul_push_pend_scb(HCS * pCurHcb, SCB * scbp) | |||
863 | } | 863 | } |
864 | 864 | ||
865 | /***************************************************************************/ | 865 | /***************************************************************************/ |
866 | SCB *tul_find_first_pend_scb(HCS * pCurHcb) | 866 | static SCB *tul_find_first_pend_scb(HCS * pCurHcb) |
867 | { | 867 | { |
868 | SCB *pFirstPend; | 868 | SCB *pFirstPend; |
869 | 869 | ||
@@ -894,24 +894,7 @@ SCB *tul_find_first_pend_scb(HCS * pCurHcb) | |||
894 | return (pFirstPend); | 894 | return (pFirstPend); |
895 | } | 895 | } |
896 | /***************************************************************************/ | 896 | /***************************************************************************/ |
897 | SCB *tul_pop_pend_scb(HCS * pCurHcb) | 897 | static void tul_unlink_pend_scb(HCS * pCurHcb, SCB * pCurScb) |
898 | { | ||
899 | SCB *pTmpScb; | ||
900 | |||
901 | if ((pTmpScb = pCurHcb->HCS_FirstPend) != NULL) { | ||
902 | if ((pCurHcb->HCS_FirstPend = pTmpScb->SCB_NxtScb) == NULL) | ||
903 | pCurHcb->HCS_LastPend = NULL; | ||
904 | pTmpScb->SCB_NxtScb = NULL; | ||
905 | } | ||
906 | #if DEBUG_QUEUE | ||
907 | printk("Pop pend SCB %lx; ", (ULONG) pTmpScb); | ||
908 | #endif | ||
909 | return (pTmpScb); | ||
910 | } | ||
911 | |||
912 | |||
913 | /***************************************************************************/ | ||
914 | void tul_unlink_pend_scb(HCS * pCurHcb, SCB * pCurScb) | ||
915 | { | 898 | { |
916 | SCB *pTmpScb, *pPrevScb; | 899 | SCB *pTmpScb, *pPrevScb; |
917 | 900 | ||
@@ -939,7 +922,7 @@ void tul_unlink_pend_scb(HCS * pCurHcb, SCB * pCurScb) | |||
939 | return; | 922 | return; |
940 | } | 923 | } |
941 | /***************************************************************************/ | 924 | /***************************************************************************/ |
942 | void tul_append_busy_scb(HCS * pCurHcb, SCB * scbp) | 925 | static void tul_append_busy_scb(HCS * pCurHcb, SCB * scbp) |
943 | { | 926 | { |
944 | 927 | ||
945 | #if DEBUG_QUEUE | 928 | #if DEBUG_QUEUE |
@@ -961,7 +944,7 @@ void tul_append_busy_scb(HCS * pCurHcb, SCB * scbp) | |||
961 | } | 944 | } |
962 | 945 | ||
963 | /***************************************************************************/ | 946 | /***************************************************************************/ |
964 | SCB *tul_pop_busy_scb(HCS * pCurHcb) | 947 | static SCB *tul_pop_busy_scb(HCS * pCurHcb) |
965 | { | 948 | { |
966 | SCB *pTmpScb; | 949 | SCB *pTmpScb; |
967 | 950 | ||
@@ -982,7 +965,7 @@ SCB *tul_pop_busy_scb(HCS * pCurHcb) | |||
982 | } | 965 | } |
983 | 966 | ||
984 | /***************************************************************************/ | 967 | /***************************************************************************/ |
985 | void tul_unlink_busy_scb(HCS * pCurHcb, SCB * pCurScb) | 968 | static void tul_unlink_busy_scb(HCS * pCurHcb, SCB * pCurScb) |
986 | { | 969 | { |
987 | SCB *pTmpScb, *pPrevScb; | 970 | SCB *pTmpScb, *pPrevScb; |
988 | 971 | ||
@@ -1037,7 +1020,7 @@ SCB *tul_find_busy_scb(HCS * pCurHcb, WORD tarlun) | |||
1037 | } | 1020 | } |
1038 | 1021 | ||
1039 | /***************************************************************************/ | 1022 | /***************************************************************************/ |
1040 | void tul_append_done_scb(HCS * pCurHcb, SCB * scbp) | 1023 | static void tul_append_done_scb(HCS * pCurHcb, SCB * scbp) |
1041 | { | 1024 | { |
1042 | 1025 | ||
1043 | #if DEBUG_QUEUE | 1026 | #if DEBUG_QUEUE |
@@ -1073,7 +1056,7 @@ SCB *tul_find_done_scb(HCS * pCurHcb) | |||
1073 | } | 1056 | } |
1074 | 1057 | ||
1075 | /***************************************************************************/ | 1058 | /***************************************************************************/ |
1076 | int tul_abort_srb(HCS * pCurHcb, struct scsi_cmnd *srbp) | 1059 | static int tul_abort_srb(HCS * pCurHcb, struct scsi_cmnd *srbp) |
1077 | { | 1060 | { |
1078 | ULONG flags; | 1061 | ULONG flags; |
1079 | SCB *pTmpScb, *pPrevScb; | 1062 | SCB *pTmpScb, *pPrevScb; |
@@ -1163,7 +1146,7 @@ int tul_abort_srb(HCS * pCurHcb, struct scsi_cmnd *srbp) | |||
1163 | } | 1146 | } |
1164 | 1147 | ||
1165 | /***************************************************************************/ | 1148 | /***************************************************************************/ |
1166 | int tul_bad_seq(HCS * pCurHcb) | 1149 | static int tul_bad_seq(HCS * pCurHcb) |
1167 | { | 1150 | { |
1168 | SCB *pCurScb; | 1151 | SCB *pCurScb; |
1169 | 1152 | ||
@@ -1182,9 +1165,11 @@ int tul_bad_seq(HCS * pCurHcb) | |||
1182 | return (tul_post_scsi_rst(pCurHcb)); | 1165 | return (tul_post_scsi_rst(pCurHcb)); |
1183 | } | 1166 | } |
1184 | 1167 | ||
1168 | #if 0 | ||
1169 | |||
1185 | /************************************************************************/ | 1170 | /************************************************************************/ |
1186 | int tul_device_reset(HCS * pCurHcb, struct scsi_cmnd *pSrb, | 1171 | static int tul_device_reset(HCS * pCurHcb, struct scsi_cmnd *pSrb, |
1187 | unsigned int target, unsigned int ResetFlags) | 1172 | unsigned int target, unsigned int ResetFlags) |
1188 | { | 1173 | { |
1189 | ULONG flags; | 1174 | ULONG flags; |
1190 | SCB *pScb; | 1175 | SCB *pScb; |
@@ -1255,7 +1240,7 @@ int tul_device_reset(HCS * pCurHcb, struct scsi_cmnd *pSrb, | |||
1255 | return SCSI_RESET_PENDING; | 1240 | return SCSI_RESET_PENDING; |
1256 | } | 1241 | } |
1257 | 1242 | ||
1258 | int tul_reset_scsi_bus(HCS * pCurHcb) | 1243 | static int tul_reset_scsi_bus(HCS * pCurHcb) |
1259 | { | 1244 | { |
1260 | ULONG flags; | 1245 | ULONG flags; |
1261 | 1246 | ||
@@ -1284,8 +1269,10 @@ int tul_reset_scsi_bus(HCS * pCurHcb) | |||
1284 | return (SCSI_RESET_SUCCESS | SCSI_RESET_HOST_RESET); | 1269 | return (SCSI_RESET_SUCCESS | SCSI_RESET_HOST_RESET); |
1285 | } | 1270 | } |
1286 | 1271 | ||
1272 | #endif /* 0 */ | ||
1273 | |||
1287 | /************************************************************************/ | 1274 | /************************************************************************/ |
1288 | void tul_exec_scb(HCS * pCurHcb, SCB * pCurScb) | 1275 | static void tul_exec_scb(HCS * pCurHcb, SCB * pCurScb) |
1289 | { | 1276 | { |
1290 | ULONG flags; | 1277 | ULONG flags; |
1291 | 1278 | ||
@@ -1318,7 +1305,7 @@ void tul_exec_scb(HCS * pCurHcb, SCB * pCurScb) | |||
1318 | } | 1305 | } |
1319 | 1306 | ||
1320 | /***************************************************************************/ | 1307 | /***************************************************************************/ |
1321 | int tul_isr(HCS * pCurHcb) | 1308 | static int tul_isr(HCS * pCurHcb) |
1322 | { | 1309 | { |
1323 | /* Enter critical section */ | 1310 | /* Enter critical section */ |
1324 | 1311 | ||
@@ -2108,7 +2095,7 @@ int int_tul_busfree(HCS * pCurHcb) | |||
2108 | 2095 | ||
2109 | /***************************************************************************/ | 2096 | /***************************************************************************/ |
2110 | /* scsi bus reset */ | 2097 | /* scsi bus reset */ |
2111 | int int_tul_scsi_rst(HCS * pCurHcb) | 2098 | static int int_tul_scsi_rst(HCS * pCurHcb) |
2112 | { | 2099 | { |
2113 | SCB *pCurScb; | 2100 | SCB *pCurScb; |
2114 | int i; | 2101 | int i; |
@@ -2214,7 +2201,7 @@ int int_tul_resel(HCS * pCurHcb) | |||
2214 | 2201 | ||
2215 | 2202 | ||
2216 | /***************************************************************************/ | 2203 | /***************************************************************************/ |
2217 | int int_tul_bad_seq(HCS * pCurHcb) | 2204 | static int int_tul_bad_seq(HCS * pCurHcb) |
2218 | { /* target wrong phase */ | 2205 | { /* target wrong phase */ |
2219 | SCB *pCurScb; | 2206 | SCB *pCurScb; |
2220 | int i; | 2207 | int i; |