Lines Matching refs:asc_dvc

1944 #define AscSynIndexToPeriod(index)        (uchar)(asc_dvc->sdtr_period_tbl[ (index) ])
3262 STATIC int AdvResetSB(ADV_DVC_VAR *asc_dvc);
3382 #define AdvAbortQueue(asc_dvc, scsiq) \ argument
3383 AdvSendIdleCmd((asc_dvc), (ushort) IDLE_CMD_ABORT, \
3397 #define AdvResetDevice(asc_dvc, target_id) \ argument
3398 AdvSendIdleCmd((asc_dvc), (ushort) IDLE_CMD_DEVICE_RESET, \
9105 ASC_DVC_VAR *asc_dvc, in ASC_INITFUNC()
9111 pcibios_read_config_byte(ASC_PCI_ID2BUS(asc_dvc->cfg->pci_slot_info), in ASC_INITFUNC()
9112 PCI_DEVFN(ASC_PCI_ID2DEV(asc_dvc->cfg->pci_slot_info), in ASC_INITFUNC()
9113 ASC_PCI_ID2FUNC(asc_dvc->cfg->pci_slot_info)), in ASC_INITFUNC()
9127 ASC_DVC_VAR *asc_dvc, in ASC_INITFUNC()
9133 pcibios_write_config_byte(ASC_PCI_ID2BUS(asc_dvc->cfg->pci_slot_info), in ASC_INITFUNC()
9134 PCI_DEVFN(ASC_PCI_ID2DEV(asc_dvc->cfg->pci_slot_info), in ASC_INITFUNC()
9135 ASC_PCI_ID2FUNC(asc_dvc->cfg->pci_slot_info)), in ASC_INITFUNC()
9208 DvcGetPhyAddr(ADV_DVC_VAR *asc_dvc, ADV_SCSI_REQ_Q *scsiq, in DvcGetPhyAddr() argument
9228 ADV_DVC_VAR *asc_dvc, in ASC_INITFUNC()
9234 pcibios_read_config_byte(ASC_PCI_ID2BUS(asc_dvc->cfg->pci_slot_info), in ASC_INITFUNC()
9235 PCI_DEVFN(ASC_PCI_ID2DEV(asc_dvc->cfg->pci_slot_info), in ASC_INITFUNC()
9236 ASC_PCI_ID2FUNC(asc_dvc->cfg->pci_slot_info)), in ASC_INITFUNC()
9250 ADV_DVC_VAR *asc_dvc, in ASC_INITFUNC()
9256 pcibios_write_config_byte(ASC_PCI_ID2BUS(asc_dvc->cfg->pci_slot_info), in ASC_INITFUNC()
9257 PCI_DEVFN(ASC_PCI_ID2DEV(asc_dvc->cfg->pci_slot_info), in ASC_INITFUNC()
9258 ASC_PCI_ID2FUNC(asc_dvc->cfg->pci_slot_info)), in ASC_INITFUNC()
10250 ASC_DVC_VAR *asc_dvc in AscIsrChipHalted() argument
10272 ASC_ASSERT(asc_dvc->drv_ptr != NULL); in AscIsrChipHalted()
10273 boardp = asc_dvc->drv_ptr; in AscIsrChipHalted()
10275 iop_base = asc_dvc->iop_base; in AscIsrChipHalted()
10286 if (asc_dvc->pci_fix_asyn_xfer & target_id) { in AscIsrChipHalted()
10292 if (asc_dvc->pci_fix_asyn_xfer & target_id) { in AscIsrChipHalted()
10299 if (asc_dvc->pci_fix_asyn_xfer & target_id) { in AscIsrChipHalted()
10322 asc_dvc->sdtr_period_tbl[asc_dvc->host_init_sdtr_index]) || in AscIsrChipHalted()
10324 asc_dvc->sdtr_period_tbl[asc_dvc->max_sdtr_index])) { in AscIsrChipHalted()
10327 asc_dvc->sdtr_period_tbl[asc_dvc->host_init_sdtr_index]; in AscIsrChipHalted()
10330 sdtr_data = AscCalSDTRData(asc_dvc, ext_msg.xfer_period, in AscIsrChipHalted()
10335 asc_dvc->init_sdtr &= ~target_id; in AscIsrChipHalted()
10336 asc_dvc->sdtr_done &= ~target_id; in AscIsrChipHalted()
10344 asc_dvc->init_sdtr &= ~target_id; in AscIsrChipHalted()
10345 asc_dvc->sdtr_done &= ~target_id; in AscIsrChipHalted()
10351 asc_dvc->sdtr_done |= target_id; in AscIsrChipHalted()
10352 asc_dvc->init_sdtr |= target_id; in AscIsrChipHalted()
10353 asc_dvc->pci_fix_asyn_xfer &= ~target_id; in AscIsrChipHalted()
10354 sdtr_data = AscCalSDTRData(asc_dvc, ext_msg.xfer_period, in AscIsrChipHalted()
10361 AscMsgOutSDTR(asc_dvc, in AscIsrChipHalted()
10364 asc_dvc->pci_fix_asyn_xfer &= ~target_id; in AscIsrChipHalted()
10365 sdtr_data = AscCalSDTRData(asc_dvc, ext_msg.xfer_period, in AscIsrChipHalted()
10369 asc_dvc->sdtr_done |= target_id; in AscIsrChipHalted()
10370 asc_dvc->init_sdtr |= target_id; in AscIsrChipHalted()
10412 if ((asc_dvc->init_sdtr & target_id) != 0) { in AscIsrChipHalted()
10414 asc_dvc->sdtr_done &= ~target_id; in AscIsrChipHalted()
10418 AscMsgOutSDTR(asc_dvc, in AscIsrChipHalted()
10419 asc_dvc->sdtr_period_tbl[(sdtr_data >> 4) & in AscIsrChipHalted()
10420 (uchar) (asc_dvc->max_sdtr_index - 1)], in AscIsrChipHalted()
10432 (asc_dvc->pci_fix_asyn_xfer & target_id) in AscIsrChipHalted()
10433 && !(asc_dvc->pci_fix_asyn_xfer_always & target_id) in AscIsrChipHalted()
10469 asc_dvc->init_sdtr &= ~target_id; in AscIsrChipHalted()
10470 asc_dvc->sdtr_done &= ~target_id; in AscIsrChipHalted()
10487 (asc_dvc->cur_dvc_qng[tid_no] > 0)) { in AscIsrChipHalted()
10494 asc_dvc->queue_full_or_busy |= target_id; in AscIsrChipHalted()
10499 asc_dvc->max_dvc_qng[tid_no] = cur_dvc_qng; in AscIsrChipHalted()
10728 ASC_DVC_VAR *asc_dvc in AscIsrQDone() argument
10749 iop_base = asc_dvc->iop_base; in AscIsrQDone()
10750 asc_isr_callback = asc_dvc->isr_callback; in AscIsrQDone()
10761 asc_dvc->max_dma_count); in AscIsrQDone()
10775 AscSetLibErrorCode(asc_dvc, ASCQ_ERR_SG_Q_LINKS); in AscIsrQDone()
10787 if (asc_dvc->queue_full_or_busy & target_id) { in AscIsrQDone()
10790 if (cur_target_qng < asc_dvc->max_dvc_qng[tid_no]) { in AscIsrQDone()
10796 asc_dvc->queue_full_or_busy &= ~target_id; in AscIsrQDone()
10799 if (asc_dvc->cur_total_qng >= n_q_used) { in AscIsrQDone()
10800 asc_dvc->cur_total_qng -= n_q_used; in AscIsrQDone()
10801 if (asc_dvc->cur_dvc_qng[tid_no] != 0) { in AscIsrQDone()
10802 asc_dvc->cur_dvc_qng[tid_no]--; in AscIsrQDone()
10805 AscSetLibErrorCode(asc_dvc, ASCQ_ERR_CUR_QNG); in AscIsrQDone()
10831 DvcDelayNanoSecond(asc_dvc, 60000); in AscIsrQDone()
10839 (*asc_isr_callback) (asc_dvc, scsiq); in AscIsrQDone()
10844 asc_dvc->unit_not_ready &= ~target_id; in AscIsrQDone()
10846 asc_dvc->start_motor &= ~target_id; in AscIsrQDone()
10852 AscSetLibErrorCode(asc_dvc, ASCQ_ERR_Q_STATUS); in AscIsrQDone()
10855 (*asc_isr_callback) (asc_dvc, scsiq); in AscIsrQDone()
10865 ASC_DVC_VAR *asc_dvc in AscISR() argument
10877 iop_base = asc_dvc->iop_base; in AscISR()
10885 if (((asc_dvc->init_state & ASC_INIT_STATE_END_LOAD_MC) == 0) in AscISR()
10886 || (asc_dvc->isr_callback == 0) in AscISR()
10890 if (asc_dvc->in_critical_cnt != 0) { in AscISR()
10891 AscSetLibErrorCode(asc_dvc, ASCQ_ERR_ISR_ON_CRITICAL); in AscISR()
10894 if (asc_dvc->is_in_int) { in AscISR()
10895 AscSetLibErrorCode(asc_dvc, ASCQ_ERR_ISR_RE_ENTRY); in AscISR()
10898 asc_dvc->is_in_int = TRUE; in AscISR()
10904 if (!(asc_dvc->bus_type & (ASC_IS_VL | ASC_IS_EISA))) { in AscISR()
10907 asc_dvc->sdtr_done = 0; in AscISR()
10933 if (AscIsrChipHalted(asc_dvc) == ERR) { in AscISR()
10940 if ((asc_dvc->dvc_cntl & ASC_CNTL_INT_MULTI_Q) != 0) { in AscISR()
10941 while (((status = AscIsrQDone(asc_dvc)) & 0x01) != 0) { in AscISR()
10945 if ((status = AscIsrQDone(asc_dvc)) == 1) { in AscISR()
10957 asc_dvc->is_in_int = FALSE; in AscISR()
11136 ASC_DVC_VAR *asc_dvc, in AscExeScsiQueue() argument
11159 iop_base = asc_dvc->iop_base; in AscExeScsiQueue()
11161 asc_exe_callback = asc_dvc->exe_callback; in AscExeScsiQueue()
11162 if (asc_dvc->err_code != 0) in AscExeScsiQueue()
11165 AscSetLibErrorCode(asc_dvc, ASCQ_ERR_SCSIQ_NULL_PTR); in AscExeScsiQueue()
11177 if ((asc_dvc->init_sdtr & scsiq->q1.target_id) != 0) { in AscExeScsiQueue()
11178 asc_dvc->sdtr_done &= ~scsiq->q1.target_id; in AscExeScsiQueue()
11180 AscMsgOutSDTR(asc_dvc, in AscExeScsiQueue()
11181 asc_dvc->sdtr_period_tbl[(sdtr_data >> 4) & in AscExeScsiQueue()
11182 (uchar) (asc_dvc->max_sdtr_index - 1)], in AscExeScsiQueue()
11188 if (asc_dvc->in_critical_cnt != 0) { in AscExeScsiQueue()
11190 AscSetLibErrorCode(asc_dvc, ASCQ_ERR_CRITICAL_RE_ENTRY); in AscExeScsiQueue()
11193 asc_dvc->in_critical_cnt++; in AscExeScsiQueue()
11196 asc_dvc->in_critical_cnt--; in AscExeScsiQueue()
11203 asc_dvc->in_critical_cnt--; in AscExeScsiQueue()
11217 if ((asc_dvc->pci_fix_asyn_xfer & scsiq->q1.target_id) && in AscExeScsiQueue()
11218 !(asc_dvc->pci_fix_asyn_xfer_always & scsiq->q1.target_id)) { in AscExeScsiQueue()
11252 if (asc_dvc->bug_fix_cntl) { in AscExeScsiQueue()
11253 if (asc_dvc->bug_fix_cntl & ASC_BUG_FIX_IF_NOT_DWB) { in AscExeScsiQueue()
11289 if ((AscGetNumOfFreeQueue(asc_dvc, target_ix, n_q_required) >= in AscExeScsiQueue()
11291 if ((sta = AscSendScsiQueue(asc_dvc, scsiq, in AscExeScsiQueue()
11293 asc_dvc->in_critical_cnt--; in AscExeScsiQueue()
11295 (*asc_exe_callback) (asc_dvc, scsiq); in AscExeScsiQueue()
11302 if (asc_dvc->bug_fix_cntl) { in AscExeScsiQueue()
11303 if (asc_dvc->bug_fix_cntl & ASC_BUG_FIX_IF_NOT_DWB) { in AscExeScsiQueue()
11324 if ((AscGetNumOfFreeQueue(asc_dvc, target_ix, 1) >= 1) || in AscExeScsiQueue()
11326 if ((sta = AscSendScsiQueue(asc_dvc, scsiq, in AscExeScsiQueue()
11328 asc_dvc->in_critical_cnt--; in AscExeScsiQueue()
11330 (*asc_exe_callback) (asc_dvc, scsiq); in AscExeScsiQueue()
11337 asc_dvc->in_critical_cnt--; in AscExeScsiQueue()
11344 ASC_DVC_VAR *asc_dvc, in AscSendScsiQueue() argument
11356 iop_base = asc_dvc->iop_base; in AscSendScsiQueue()
11365 asc_dvc->last_q_shortage = 0; in AscSendScsiQueue()
11368 if ((sta = AscPutReadySgListQueue(asc_dvc, scsiq, in AscSendScsiQueue()
11371 asc_dvc->cur_total_qng += (uchar) (n_q_required); in AscSendScsiQueue()
11372 asc_dvc->cur_dvc_qng[tid_no]++; in AscSendScsiQueue()
11380 if ((sta = AscPutReadyQueue(asc_dvc, scsiq, in AscSendScsiQueue()
11383 asc_dvc->cur_total_qng++; in AscSendScsiQueue()
11384 asc_dvc->cur_dvc_qng[tid_no]++; in AscSendScsiQueue()
11408 ASC_DVC_VAR *asc_dvc, in AscGetNumOfFreeQueue() argument
11420 if ((asc_dvc->unit_not_ready & target_id) || in AscGetNumOfFreeQueue()
11421 (asc_dvc->queue_full_or_busy & target_id)) { in AscGetNumOfFreeQueue()
11425 cur_used_qs = (uint) asc_dvc->cur_total_qng + in AscGetNumOfFreeQueue()
11426 (uint) asc_dvc->last_q_shortage + in AscGetNumOfFreeQueue()
11429 cur_used_qs = (uint) asc_dvc->cur_total_qng + in AscGetNumOfFreeQueue()
11432 if ((uint) (cur_used_qs + n_qs) <= (uint) asc_dvc->max_total_qng) { in AscGetNumOfFreeQueue()
11433 cur_free_qs = (uint) asc_dvc->max_total_qng - cur_used_qs; in AscGetNumOfFreeQueue()
11434 if (asc_dvc->cur_dvc_qng[tid_no] >= in AscGetNumOfFreeQueue()
11435 asc_dvc->max_dvc_qng[tid_no]) { in AscGetNumOfFreeQueue()
11441 … if ((n_qs > asc_dvc->last_q_shortage) && (n_qs <= (asc_dvc->max_total_qng - ASC_MIN_FREE_Q))) { in AscGetNumOfFreeQueue()
11442 asc_dvc->last_q_shortage = n_qs; in AscGetNumOfFreeQueue()
11450 ASC_DVC_VAR *asc_dvc, in AscPutReadyQueue() argument
11462 iop_base = asc_dvc->iop_base; in AscPutReadyQueue()
11463 if (((asc_dvc->init_sdtr & scsiq->q1.target_id) != 0) && in AscPutReadyQueue()
11464 ((asc_dvc->sdtr_done & scsiq->q1.target_id) == 0)) { in AscPutReadyQueue()
11467 syn_period_ix = (sdtr_data >> 4) & (asc_dvc->max_sdtr_index - 1); in AscPutReadyQueue()
11469 AscMsgOutSDTR(asc_dvc, in AscPutReadyQueue()
11470 asc_dvc->sdtr_period_tbl[syn_period_ix], in AscPutReadyQueue()
11475 if ((scsiq->q1.target_id & asc_dvc->use_tagged_qng) == 0) { in AscPutReadyQueue()
11496 ASC_DVC_VAR *asc_dvc, in AscPutReadySgListQueue() argument
11514 iop_base = asc_dvc->iop_base; in AscPutReadySgListQueue()
11620 sta = AscPutReadyQueue(asc_dvc, scsiq, q_no); in AscPutReadySgListQueue()
11679 ASC_DVC_VAR *asc_dvc in AscInitLram() argument
11687 iop_base = asc_dvc->iop_base; in AscInitLram()
11690 (ushort) (((int) (asc_dvc->max_total_qng + 2 + 1) * 64) >> 1) in AscInitLram()
11697 (uchar) (asc_dvc->max_total_qng)); in AscInitLram()
11702 for (; i < asc_dvc->max_total_qng; i++, s_addr += ASC_QBLK_SIZE) { in AscInitLram()
11713 (uchar) (asc_dvc->max_total_qng - 1)); in AscInitLram()
11715 (uchar) asc_dvc->max_total_qng); in AscInitLram()
11718 for (; i <= (uchar) (asc_dvc->max_total_qng + 3); in AscInitLram()
11732 ASC_DVC_VAR *asc_dvc in AscInitQLinkVar() argument
11739 iop_base = asc_dvc->iop_base; in AscInitQLinkVar()
11741 AscPutRiscVarDoneQTail(iop_base, asc_dvc->max_total_qng); in AscInitQLinkVar()
11743 AscPutVarDoneQTail(iop_base, asc_dvc->max_total_qng); in AscInitQLinkVar()
11745 (uchar) ((int) asc_dvc->max_total_qng + 1)); in AscInitQLinkVar()
11747 (uchar) ((int) asc_dvc->max_total_qng + 2)); in AscInitQLinkVar()
11749 asc_dvc->max_total_qng); in AscInitQLinkVar()
11765 ASC_DVC_VAR *asc_dvc, in AscSetLibErrorCode() argument
11769 if (asc_dvc->err_code == 0) { in AscSetLibErrorCode()
11770 asc_dvc->err_code = err_code; in AscSetLibErrorCode()
11771 AscWriteLramWord(asc_dvc->iop_base, ASCV_ASCDVC_ERR_CODE_W, in AscSetLibErrorCode()
11780 ASC_DVC_VAR *asc_dvc, in AscMsgOutSDTR() argument
11789 iop_base = asc_dvc->iop_base; in AscMsgOutSDTR()
11797 AscGetSynPeriodIndex(asc_dvc, sdtr_period)) <= in AscMsgOutSDTR()
11798 asc_dvc->max_sdtr_index) { in AscMsgOutSDTR()
11817 ASC_DVC_VAR *asc_dvc, in AscCalSDTRData() argument
11825 sdtr_period_ix = AscGetSynPeriodIndex(asc_dvc, sdtr_period); in AscCalSDTRData()
11827 (sdtr_period_ix > asc_dvc->max_sdtr_index) in AscCalSDTRData()
11849 ASC_DVC_VAR *asc_dvc, in AscGetSynPeriodIndex() argument
11858 period_table = asc_dvc->sdtr_period_tbl; in AscGetSynPeriodIndex()
11859 max_index = (int) asc_dvc->max_sdtr_index; in AscGetSynPeriodIndex()
11860 min_index = (int)asc_dvc->host_init_sdtr_index; in AscGetSynPeriodIndex()
11961 DvcDelayMicroSecond(ADV_DVC_VAR *asc_dvc, ushort micro_sec) in DvcDelayMicroSecond() argument
11967 DvcDelayNanoSecond(ASC_DVC_VAR *asc_dvc, ASC_DCNT nano_sec) in DvcDelayNanoSecond() argument
12167 ASC_DVC_VAR *asc_dvc in AscResetChipAndScsiBus() argument
12173 iop_base = asc_dvc->iop_base; in AscResetChipAndScsiBus()
12180 DvcDelayNanoSecond(asc_dvc, 60000); in AscResetChipAndScsiBus()
12282 ASC_DVC_VAR *asc_dvc, in ASC_INITFUNC()
12288 lsb = DvcReadPCIConfigByte(asc_dvc, pci_config_offset); in ASC_INITFUNC()
12289 msb = DvcReadPCIConfigByte(asc_dvc, pci_config_offset + 1); in ASC_INITFUNC()
12296 ASC_DVC_VAR *asc_dvc in ASC_INITFUNC()
12308 iop_base = asc_dvc->iop_base; in ASC_INITFUNC()
12309 asc_dvc->init_state = ASC_INIT_STATE_BEG_GET_CFG; in ASC_INITFUNC()
12310 if (asc_dvc->err_code != 0) { in ASC_INITFUNC()
12313 if (asc_dvc->bus_type == ASC_IS_PCI) { in ASC_INITFUNC()
12314 PCIVendorID = AscReadPCIConfigWord(asc_dvc, in ASC_INITFUNC()
12317 PCIDeviceID = AscReadPCIConfigWord(asc_dvc, in ASC_INITFUNC()
12320 PCIRevisionID = DvcReadPCIConfigByte(asc_dvc, in ASC_INITFUNC()
12326 prevCmdRegBits = DvcReadPCIConfigByte(asc_dvc, in ASC_INITFUNC()
12331 DvcWritePCIConfigByte(asc_dvc, in ASC_INITFUNC()
12336 if ((DvcReadPCIConfigByte(asc_dvc, in ASC_INITFUNC()
12345 DvcWritePCIConfigByte(asc_dvc, in ASC_INITFUNC()
12347 if (DvcReadPCIConfigByte(asc_dvc, AscPCIConfigLatencyTimer) in ASC_INITFUNC()
12352 if (DvcReadPCIConfigByte(asc_dvc, in ASC_INITFUNC()
12354 DvcWritePCIConfigByte(asc_dvc, in ASC_INITFUNC()
12357 if (DvcReadPCIConfigByte(asc_dvc, in ASC_INITFUNC()
12366 warn_code |= AscInitAscDvcVar(asc_dvc); in ASC_INITFUNC()
12367 warn_code |= AscInitFromEEP(asc_dvc); in ASC_INITFUNC()
12368 asc_dvc->init_state |= ASC_INIT_STATE_END_GET_CFG; in ASC_INITFUNC()
12369 if (asc_dvc->scsi_reset_wait > ASC_MAX_SCSI_RESET_WAIT) { in ASC_INITFUNC()
12370 asc_dvc->scsi_reset_wait = ASC_MAX_SCSI_RESET_WAIT; in ASC_INITFUNC()
12373 asc_dvc->err_code = ASC_IERR_BAD_SIGNATURE; in ASC_INITFUNC()
12381 ASC_DVC_VAR *asc_dvc in ASC_INITFUNC()
12387 asc_dvc->init_state |= ASC_INIT_STATE_BEG_SET_CFG; in ASC_INITFUNC()
12388 if (asc_dvc->err_code != 0) in ASC_INITFUNC()
12390 if (AscFindSignature(asc_dvc->iop_base)) { in ASC_INITFUNC()
12391 warn_code |= AscInitFromAscDvcVar(asc_dvc); in ASC_INITFUNC()
12392 asc_dvc->init_state |= ASC_INIT_STATE_END_SET_CFG; in ASC_INITFUNC()
12394 asc_dvc->err_code = ASC_IERR_BAD_SIGNATURE; in ASC_INITFUNC()
12402 ASC_DVC_VAR *asc_dvc in ASC_INITFUNC()
12411 iop_base = asc_dvc->iop_base; in ASC_INITFUNC()
12412 pci_device_id = asc_dvc->cfg->pci_device_id; in ASC_INITFUNC()
12420 if ((asc_dvc->cfg->cmd_qng_enabled & asc_dvc->cfg->disc_enable) != in ASC_INITFUNC()
12421 asc_dvc->cfg->cmd_qng_enabled) { in ASC_INITFUNC()
12422 asc_dvc->cfg->disc_enable = asc_dvc->cfg->cmd_qng_enabled; in ASC_INITFUNC()
12428 if ((asc_dvc->bus_type & (ASC_IS_ISA | ASC_IS_VL)) != 0) { in ASC_INITFUNC()
12429 if (AscSetChipIRQ(iop_base, asc_dvc->irq_no, asc_dvc->bus_type) in ASC_INITFUNC()
12430 != asc_dvc->irq_no) { in ASC_INITFUNC()
12431 asc_dvc->err_code |= ASC_IERR_SET_IRQ_NO; in ASC_INITFUNC()
12434 if (asc_dvc->bus_type & ASC_IS_PCI) { in ASC_INITFUNC()
12437 if ((asc_dvc->bus_type & ASC_IS_PCI_ULTRA) == ASC_IS_PCI_ULTRA) { in ASC_INITFUNC()
12441 asc_dvc->bug_fix_cntl |= ASC_BUG_FIX_IF_NOT_DWB; in ASC_INITFUNC()
12442 asc_dvc->bug_fix_cntl |= ASC_BUG_FIX_ASYN_USE_SYN; in ASC_INITFUNC()
12445 } else if (asc_dvc->bus_type == ASC_IS_ISAPNP) { in ASC_INITFUNC()
12446 if (AscGetChipVersion(iop_base, asc_dvc->bus_type) in ASC_INITFUNC()
12448 asc_dvc->bug_fix_cntl |= ASC_BUG_FIX_ASYN_USE_SYN; in ASC_INITFUNC()
12451 if (AscSetChipScsiID(iop_base, asc_dvc->cfg->chip_scsi_id) != in ASC_INITFUNC()
12452 asc_dvc->cfg->chip_scsi_id) { in ASC_INITFUNC()
12453 asc_dvc->err_code |= ASC_IERR_SET_SCSI_ID; in ASC_INITFUNC()
12456 if (asc_dvc->bus_type & ASC_IS_ISA) { in ASC_INITFUNC()
12457 AscSetIsaDmaChannel(iop_base, asc_dvc->cfg->isa_dma_channel); in ASC_INITFUNC()
12458 AscSetIsaDmaSpeed(iop_base, asc_dvc->cfg->isa_dma_speed); in ASC_INITFUNC()
12466 ASC_DVC_VAR *asc_dvc in AscInitAsc1000Driver() argument
12472 iop_base = asc_dvc->iop_base; in AscInitAsc1000Driver()
12474 if ((asc_dvc->dvc_cntl & ASC_CNTL_RESET_SCSI) && in AscInitAsc1000Driver()
12475 !(asc_dvc->init_state & ASC_INIT_RESET_SCSI_DONE)) { in AscInitAsc1000Driver()
12476 AscResetChipAndScsiBus(asc_dvc); in AscInitAsc1000Driver()
12478 ((ushort) asc_dvc->scsi_reset_wait * 1000)); in AscInitAsc1000Driver()
12480 asc_dvc->init_state |= ASC_INIT_STATE_BEG_LOAD_MC; in AscInitAsc1000Driver()
12481 if (asc_dvc->err_code != 0) in AscInitAsc1000Driver()
12483 if (!AscFindSignature(asc_dvc->iop_base)) { in AscInitAsc1000Driver()
12484 asc_dvc->err_code = ASC_IERR_BAD_SIGNATURE; in AscInitAsc1000Driver()
12488 warn_code |= AscInitLram(asc_dvc); in AscInitAsc1000Driver()
12489 if (asc_dvc->err_code != 0) in AscInitAsc1000Driver()
12495 asc_dvc->err_code |= ASC_IERR_MCODE_CHKSUM; in AscInitAsc1000Driver()
12498 warn_code |= AscInitMicroCodeVar(asc_dvc); in AscInitAsc1000Driver()
12499 asc_dvc->init_state |= ASC_INIT_STATE_END_LOAD_MC; in AscInitAsc1000Driver()
12507 ASC_DVC_VAR *asc_dvc in ASC_INITFUNC()
12516 iop_base = asc_dvc->iop_base; in ASC_INITFUNC()
12518 asc_dvc->err_code = 0; in ASC_INITFUNC()
12519 if ((asc_dvc->bus_type & in ASC_INITFUNC()
12521 asc_dvc->err_code |= ASC_IERR_NO_BUS_TYPE; in ASC_INITFUNC()
12525 asc_dvc->bug_fix_cntl = 0; in ASC_INITFUNC()
12526 asc_dvc->pci_fix_asyn_xfer = 0; in ASC_INITFUNC()
12527 asc_dvc->pci_fix_asyn_xfer_always = 0; in ASC_INITFUNC()
12529 asc_dvc->sdtr_done = 0; in ASC_INITFUNC()
12530 asc_dvc->cur_total_qng = 0; in ASC_INITFUNC()
12531 asc_dvc->is_in_int = 0; in ASC_INITFUNC()
12532 asc_dvc->in_critical_cnt = 0; in ASC_INITFUNC()
12533 asc_dvc->last_q_shortage = 0; in ASC_INITFUNC()
12534 asc_dvc->use_tagged_qng = 0; in ASC_INITFUNC()
12535 asc_dvc->no_scam = 0; in ASC_INITFUNC()
12536 asc_dvc->unit_not_ready = 0; in ASC_INITFUNC()
12537 asc_dvc->queue_full_or_busy = 0; in ASC_INITFUNC()
12538 asc_dvc->redo_scam = 0; in ASC_INITFUNC()
12539 asc_dvc->res2 = 0; in ASC_INITFUNC()
12540 asc_dvc->host_init_sdtr_index = 0; in ASC_INITFUNC()
12541 asc_dvc->cfg->can_tagged_qng = 0; in ASC_INITFUNC()
12542 asc_dvc->cfg->cmd_qng_enabled = 0; in ASC_INITFUNC()
12543 asc_dvc->dvc_cntl = ASC_DEF_DVC_CNTL; in ASC_INITFUNC()
12544 asc_dvc->init_sdtr = 0; in ASC_INITFUNC()
12545 asc_dvc->max_total_qng = ASC_DEF_MAX_TOTAL_QNG; in ASC_INITFUNC()
12546 asc_dvc->scsi_reset_wait = 3; in ASC_INITFUNC()
12547 asc_dvc->start_motor = ASC_SCSI_WIDTH_BIT_SET; in ASC_INITFUNC()
12548 asc_dvc->max_dma_count = AscGetMaxDmaCount(asc_dvc->bus_type); in ASC_INITFUNC()
12549 asc_dvc->cfg->sdtr_enable = ASC_SCSI_WIDTH_BIT_SET; in ASC_INITFUNC()
12550 asc_dvc->cfg->disc_enable = ASC_SCSI_WIDTH_BIT_SET; in ASC_INITFUNC()
12551 asc_dvc->cfg->chip_scsi_id = ASC_DEF_CHIP_SCSI_ID; in ASC_INITFUNC()
12552 asc_dvc->cfg->lib_serial_no = ASC_LIB_SERIAL_NUMBER; in ASC_INITFUNC()
12553 asc_dvc->cfg->lib_version = (ASC_LIB_VERSION_MAJOR << 8) | in ASC_INITFUNC()
12555 chip_version = AscGetChipVersion(iop_base, asc_dvc->bus_type); in ASC_INITFUNC()
12556 asc_dvc->cfg->chip_version = chip_version; in ASC_INITFUNC()
12557 asc_dvc->sdtr_period_tbl[0] = SYN_XFER_NS_0; in ASC_INITFUNC()
12558 asc_dvc->sdtr_period_tbl[1] = SYN_XFER_NS_1; in ASC_INITFUNC()
12559 asc_dvc->sdtr_period_tbl[2] = SYN_XFER_NS_2; in ASC_INITFUNC()
12560 asc_dvc->sdtr_period_tbl[3] = SYN_XFER_NS_3; in ASC_INITFUNC()
12561 asc_dvc->sdtr_period_tbl[4] = SYN_XFER_NS_4; in ASC_INITFUNC()
12562 asc_dvc->sdtr_period_tbl[5] = SYN_XFER_NS_5; in ASC_INITFUNC()
12563 asc_dvc->sdtr_period_tbl[6] = SYN_XFER_NS_6; in ASC_INITFUNC()
12564 asc_dvc->sdtr_period_tbl[7] = SYN_XFER_NS_7; in ASC_INITFUNC()
12565 asc_dvc->max_sdtr_index = 7; in ASC_INITFUNC()
12566 if ((asc_dvc->bus_type & ASC_IS_PCI) && in ASC_INITFUNC()
12568 asc_dvc->bus_type = ASC_IS_PCI_ULTRA; in ASC_INITFUNC()
12569 asc_dvc->sdtr_period_tbl[0] = SYN_ULTRA_XFER_NS_0; in ASC_INITFUNC()
12570 asc_dvc->sdtr_period_tbl[1] = SYN_ULTRA_XFER_NS_1; in ASC_INITFUNC()
12571 asc_dvc->sdtr_period_tbl[2] = SYN_ULTRA_XFER_NS_2; in ASC_INITFUNC()
12572 asc_dvc->sdtr_period_tbl[3] = SYN_ULTRA_XFER_NS_3; in ASC_INITFUNC()
12573 asc_dvc->sdtr_period_tbl[4] = SYN_ULTRA_XFER_NS_4; in ASC_INITFUNC()
12574 asc_dvc->sdtr_period_tbl[5] = SYN_ULTRA_XFER_NS_5; in ASC_INITFUNC()
12575 asc_dvc->sdtr_period_tbl[6] = SYN_ULTRA_XFER_NS_6; in ASC_INITFUNC()
12576 asc_dvc->sdtr_period_tbl[7] = SYN_ULTRA_XFER_NS_7; in ASC_INITFUNC()
12577 asc_dvc->sdtr_period_tbl[8] = SYN_ULTRA_XFER_NS_8; in ASC_INITFUNC()
12578 asc_dvc->sdtr_period_tbl[9] = SYN_ULTRA_XFER_NS_9; in ASC_INITFUNC()
12579 asc_dvc->sdtr_period_tbl[10] = SYN_ULTRA_XFER_NS_10; in ASC_INITFUNC()
12580 asc_dvc->sdtr_period_tbl[11] = SYN_ULTRA_XFER_NS_11; in ASC_INITFUNC()
12581 asc_dvc->sdtr_period_tbl[12] = SYN_ULTRA_XFER_NS_12; in ASC_INITFUNC()
12582 asc_dvc->sdtr_period_tbl[13] = SYN_ULTRA_XFER_NS_13; in ASC_INITFUNC()
12583 asc_dvc->sdtr_period_tbl[14] = SYN_ULTRA_XFER_NS_14; in ASC_INITFUNC()
12584 asc_dvc->sdtr_period_tbl[15] = SYN_ULTRA_XFER_NS_15; in ASC_INITFUNC()
12585 asc_dvc->max_sdtr_index = 15; in ASC_INITFUNC()
12595 if (asc_dvc->bus_type == ASC_IS_PCI) { in ASC_INITFUNC()
12599 asc_dvc->cfg->isa_dma_speed = ASC_DEF_ISA_DMA_SPEED; in ASC_INITFUNC()
12602 asc_dvc->bus_type = ASC_IS_ISAPNP; in ASC_INITFUNC()
12605 if ((asc_dvc->bus_type & ASC_IS_ISA) != 0) { in ASC_INITFUNC()
12606 asc_dvc->cfg->isa_dma_channel = (uchar) AscGetIsaDmaChannel(iop_base); in ASC_INITFUNC()
12610 asc_dvc->cur_dvc_qng[i] = 0; in ASC_INITFUNC()
12611 asc_dvc->max_dvc_qng[i] = ASC_MAX_SCSI1_QNG; in ASC_INITFUNC()
12612 asc_dvc->scsiq_busy_head[i] = (ASC_SCSI_Q *) 0L; in ASC_INITFUNC()
12613 asc_dvc->scsiq_busy_tail[i] = (ASC_SCSI_Q *) 0L; in ASC_INITFUNC()
12614 asc_dvc->cfg->max_tag_qng[i] = ASC_MAX_INRAM_TAG_QNG; in ASC_INITFUNC()
12622 ASC_DVC_VAR *asc_dvc in ASC_INITFUNC()
12635 iop_base = asc_dvc->iop_base; in ASC_INITFUNC()
12641 asc_dvc->init_state |= ASC_INIT_RESET_SCSI_DONE; in ASC_INITFUNC()
12642 AscResetChipAndScsiBus(asc_dvc); in ASC_INITFUNC()
12644 ((ushort) asc_dvc->scsi_reset_wait * 1000)); in ASC_INITFUNC()
12647 asc_dvc->err_code |= ASC_IERR_START_STOP_CHIP; in ASC_INITFUNC()
12652 asc_dvc->err_code |= ASC_IERR_SET_PC_ADDR; in ASC_INITFUNC()
12663 chksum = AscGetEEPConfig(iop_base, eep_config, asc_dvc->bus_type); in ASC_INITFUNC()
12670 if (asc_dvc->cfg->chip_version == 3) { in ASC_INITFUNC()
12686 if (AscGetChipVersion(iop_base, asc_dvc->bus_type) == in ASC_INITFUNC()
12714 asc_dvc->cfg->sdtr_enable = eep_config->init_sdtr; in ASC_INITFUNC()
12715 asc_dvc->cfg->disc_enable = eep_config->disc_enable; in ASC_INITFUNC()
12716 asc_dvc->cfg->cmd_qng_enabled = eep_config->use_cmd_qng; in ASC_INITFUNC()
12717 asc_dvc->cfg->isa_dma_speed = ASC_EEP_GET_DMA_SPD(eep_config); in ASC_INITFUNC()
12718 asc_dvc->start_motor = eep_config->start_motor; in ASC_INITFUNC()
12719 asc_dvc->dvc_cntl = eep_config->cntl; in ASC_INITFUNC()
12720 asc_dvc->no_scam = eep_config->no_scam; in ASC_INITFUNC()
12721 asc_dvc->cfg->adapter_info[0] = eep_config->adapter_info[0]; in ASC_INITFUNC()
12722 asc_dvc->cfg->adapter_info[1] = eep_config->adapter_info[1]; in ASC_INITFUNC()
12723 asc_dvc->cfg->adapter_info[2] = eep_config->adapter_info[2]; in ASC_INITFUNC()
12724 asc_dvc->cfg->adapter_info[3] = eep_config->adapter_info[3]; in ASC_INITFUNC()
12725 asc_dvc->cfg->adapter_info[4] = eep_config->adapter_info[4]; in ASC_INITFUNC()
12726 asc_dvc->cfg->adapter_info[5] = eep_config->adapter_info[5]; in ASC_INITFUNC()
12727 if (!AscTestExternalLram(asc_dvc)) { in ASC_INITFUNC()
12728 if (((asc_dvc->bus_type & ASC_IS_PCI_ULTRA) == ASC_IS_PCI_ULTRA)) { in ASC_INITFUNC()
12752 asc_dvc->max_total_qng = eep_config->max_total_qng; in ASC_INITFUNC()
12758 if (asc_dvc->bus_type & (ASC_IS_ISA | ASC_IS_VL | ASC_IS_EISA)) { in ASC_INITFUNC()
12759 asc_dvc->irq_no = AscGetChipIRQ(iop_base, asc_dvc->bus_type); in ASC_INITFUNC()
12762 asc_dvc->cfg->chip_scsi_id = ASC_EEP_GET_CHIP_ID(eep_config); in ASC_INITFUNC()
12763 if (((asc_dvc->bus_type & ASC_IS_PCI_ULTRA) == ASC_IS_PCI_ULTRA) && in ASC_INITFUNC()
12764 !(asc_dvc->dvc_cntl & ASC_CNTL_SDTR_ENABLE_ULTRA)) { in ASC_INITFUNC()
12765 asc_dvc->host_init_sdtr_index = ASC_SDTR_ULTRA_PCI_10MB_INDEX; in ASC_INITFUNC()
12769 asc_dvc->dos_int13_table[i] = eep_config->dos_int13_table[i]; in ASC_INITFUNC()
12770 asc_dvc->cfg->max_tag_qng[i] = eep_config->max_tag_qng; in ASC_INITFUNC()
12771 asc_dvc->cfg->sdtr_period_offset[i] = in ASC_INITFUNC()
12773 (asc_dvc->host_init_sdtr_index << 4)); in ASC_INITFUNC()
12777 if ((i = AscSetEEPConfig(iop_base, eep_config, asc_dvc->bus_type)) != in ASC_INITFUNC()
12790 ASC_DVC_VAR *asc_dvc in AscInitMicroCodeVar() argument
12799 iop_base = asc_dvc->iop_base; in AscInitMicroCodeVar()
12803 asc_dvc->cfg->sdtr_period_offset[i] in AscInitMicroCodeVar()
12807 AscInitQLinkVar(asc_dvc); in AscInitMicroCodeVar()
12809 asc_dvc->cfg->disc_enable); in AscInitMicroCodeVar()
12811 ASC_TID_TO_TARGET_ID(asc_dvc->cfg->chip_scsi_id)); in AscInitMicroCodeVar()
12814 phy_addr = virt_to_bus(asc_dvc->cfg->overrun_buf); in AscInitMicroCodeVar()
12822 asc_dvc->cfg->mcode_date = in AscInitMicroCodeVar()
12824 asc_dvc->cfg->mcode_version = in AscInitMicroCodeVar()
12829 asc_dvc->err_code |= ASC_IERR_SET_PC_ADDR; in AscInitMicroCodeVar()
12833 asc_dvc->err_code |= ASC_IERR_START_STOP_CHIP; in AscInitMicroCodeVar()
12843 ASC_DVC_VAR *asc_dvc in ASC_INITFUNC()
12852 iop_base = asc_dvc->iop_base; in ASC_INITFUNC()
13163 ASC_DVC_VAR *asc_dvc, in AscAsyncFix() argument
13173 if (asc_dvc->bug_fix_cntl & ASC_BUG_FIX_ASYN_USE_SYN) in AscAsyncFix()
13175 if (!(asc_dvc->init_sdtr & tid_bits)) in AscAsyncFix()
13181 asc_dvc->pci_fix_asyn_xfer_always |= tid_bits; in AscAsyncFix()
13183 asc_dvc->pci_fix_asyn_xfer |= tid_bits; in AscAsyncFix()
13189 asc_dvc->pci_fix_asyn_xfer &= ~tid_bits; in AscAsyncFix()
13192 if (asc_dvc->pci_fix_asyn_xfer & tid_bits) in AscAsyncFix()
13194 AscSetRunChipSynRegAtID(asc_dvc->iop_base, tid_no, in AscAsyncFix()
13217 AscInquiryHandling(ASC_DVC_VAR *asc_dvc, in AscInquiryHandling() argument
13223 orig_init_sdtr = asc_dvc->init_sdtr; in AscInquiryHandling()
13224 orig_use_tagged_qng = asc_dvc->use_tagged_qng; in AscInquiryHandling()
13226 asc_dvc->init_sdtr &= ~tid_bit; in AscInquiryHandling()
13227 asc_dvc->cfg->can_tagged_qng &= ~tid_bit; in AscInquiryHandling()
13228 asc_dvc->use_tagged_qng &= ~tid_bit; in AscInquiryHandling()
13231 if ((asc_dvc->cfg->sdtr_enable & tid_bit) && ASC_INQ_SYNC(inq)) { in AscInquiryHandling()
13232 asc_dvc->init_sdtr |= tid_bit; in AscInquiryHandling()
13234 if ((asc_dvc->cfg->cmd_qng_enabled & tid_bit) && in AscInquiryHandling()
13237 asc_dvc->use_tagged_qng |= tid_bit; in AscInquiryHandling()
13238 asc_dvc->cfg->can_tagged_qng |= tid_bit; in AscInquiryHandling()
13242 if (orig_use_tagged_qng != asc_dvc->use_tagged_qng) { in AscInquiryHandling()
13243 AscWriteLramByte(asc_dvc->iop_base, ASCV_DISC_ENABLE_B, in AscInquiryHandling()
13244 asc_dvc->cfg->disc_enable); in AscInquiryHandling()
13245 AscWriteLramByte(asc_dvc->iop_base, ASCV_USE_TAGGED_QNG_B, in AscInquiryHandling()
13246 asc_dvc->use_tagged_qng); in AscInquiryHandling()
13247 AscWriteLramByte(asc_dvc->iop_base, ASCV_CAN_TAGGED_QNG_B, in AscInquiryHandling()
13248 asc_dvc->cfg->can_tagged_qng); in AscInquiryHandling()
13250 asc_dvc->max_dvc_qng[tid_no] = in AscInquiryHandling()
13251 asc_dvc->cfg->max_tag_qng[tid_no]; in AscInquiryHandling()
13252 AscWriteLramByte(asc_dvc->iop_base, in AscInquiryHandling()
13254 asc_dvc->max_dvc_qng[tid_no]); in AscInquiryHandling()
13256 if (orig_init_sdtr != asc_dvc->init_sdtr) { in AscInquiryHandling()
13257 AscAsyncFix(asc_dvc, tid_no, inq); in AscInquiryHandling()
14926 AdvInitGetConfig(ADV_DVC_VAR *asc_dvc) in ASC_INITFUNC() argument
14935 asc_dvc->err_code = 0; in ASC_INITFUNC()
14936 iop_base = asc_dvc->iop_base; in ASC_INITFUNC()
14945 if (((pci_cmd_reg = DvcAdvReadPCIConfigByte(asc_dvc, in ASC_INITFUNC()
14952 DvcAdvWritePCIConfigByte(asc_dvc, in ASC_INITFUNC()
14955 if (((DvcAdvReadPCIConfigByte(asc_dvc, AscPCIConfigCommandRegister)) in ASC_INITFUNC()
14970 if (DvcAdvReadPCIConfigByte(asc_dvc, AscPCIConfigLatencyTimer) < 0x20) { in ASC_INITFUNC()
14971 DvcAdvWritePCIConfigByte(asc_dvc, AscPCIConfigLatencyTimer, 0x20); in ASC_INITFUNC()
14972 if (DvcAdvReadPCIConfigByte(asc_dvc, AscPCIConfigLatencyTimer) < 0x20) in ASC_INITFUNC()
14984 asc_dvc->cfg->control_flag = 0; in ASC_INITFUNC()
14985 if (((DvcAdvReadPCIConfigByte(asc_dvc, AscPCIConfigCommandRegister) in ASC_INITFUNC()
14988 asc_dvc->cfg->control_flag |= CONTROL_FLAG_IGNORE_PERR; in ASC_INITFUNC()
14991 asc_dvc->cfg->lib_version = (ADV_LIB_VERSION_MAJOR << 8) | in ASC_INITFUNC()
14993 asc_dvc->cfg->chip_version = in ASC_INITFUNC()
14994 AdvGetChipVersion(iop_base, asc_dvc->bus_type); in ASC_INITFUNC()
15009 asc_dvc->err_code = ASC_IERR_BAD_SIGNATURE; in ASC_INITFUNC()
15016 if (asc_dvc->chip_type != ADV_CHIP_ASC3550 && in ASC_INITFUNC()
15017 asc_dvc->chip_type != ADV_CHIP_ASC38C0800 && in ASC_INITFUNC()
15018 asc_dvc->chip_type != ADV_CHIP_ASC38C1600) in ASC_INITFUNC()
15020 asc_dvc->err_code |= ASC_IERR_BAD_CHIPTYPE; in ASC_INITFUNC()
15033 if (asc_dvc->chip_type == ADV_CHIP_ASC38C1600) in ASC_INITFUNC()
15035 if ((status = AdvInitFrom38C1600EEP(asc_dvc)) == ADV_ERROR) in ASC_INITFUNC()
15039 } else if (asc_dvc->chip_type == ADV_CHIP_ASC38C0800) in ASC_INITFUNC()
15041 if ((status = AdvInitFrom38C0800EEP(asc_dvc)) == ADV_ERROR) in ASC_INITFUNC()
15047 if ((status = AdvInitFrom3550EEP(asc_dvc)) == ADV_ERROR) in ASC_INITFUNC()
15069 AdvInitAsc3550Driver(ADV_DVC_VAR *asc_dvc) in AdvInitAsc3550Driver() argument
15092 if (asc_dvc->err_code != 0) in AdvInitAsc3550Driver()
15100 if (asc_dvc->chip_type != ADV_CHIP_ASC3550) in AdvInitAsc3550Driver()
15102 asc_dvc->err_code |= ASC_IERR_BAD_CHIPTYPE; in AdvInitAsc3550Driver()
15107 iop_base = asc_dvc->iop_base; in AdvInitAsc3550Driver()
15227 asc_dvc->err_code |= ASC_IERR_MCODE_CHKSUM; in AdvInitAsc3550Driver()
15256 AdvReadWordLram(iop_base, ASC_MC_VERSION_DATE, asc_dvc->cfg->mcode_date); in AdvInitAsc3550Driver()
15257 AdvReadWordLram(iop_base, ASC_MC_VERSION_NUM, asc_dvc->cfg->mcode_version); in AdvInitAsc3550Driver()
15270 if (asc_dvc->cfg->control_flag & CONTROL_FLAG_IGNORE_PERR) in AdvInitAsc3550Driver()
15296 if ((asc_dvc->bios_ctrl & BIOS_CTRL_RESET_SCSI_BUS) == 0) in AdvInitAsc3550Driver()
15298 AdvWriteWordLram(iop_base, ASC_MC_WDTR_ABLE, asc_dvc->wdtr_able); in AdvInitAsc3550Driver()
15299 AdvWriteWordLram(iop_base, ASC_MC_SDTR_ABLE, asc_dvc->sdtr_able); in AdvInitAsc3550Driver()
15327 if (ADV_TID_TO_TIDMASK(tid) & asc_dvc->ultra_able) in AdvInitAsc3550Driver()
15358 AdvWriteWordLram(iop_base, ASC_MC_DISC_ENABLE, asc_dvc->cfg->disc_enable); in AdvInitAsc3550Driver()
15368 asc_dvc->chip_scsi_id); in AdvInitAsc3550Driver()
15386 asc_dvc->err_code |= ASC_IERR_ILLEGAL_CONNECTION; in AdvInitAsc3550Driver()
15397 asc_dvc->err_code |= ASC_IERR_REVERSED_CABLE; in AdvInitAsc3550Driver()
15407 asc_dvc->err_code |= ASC_IERR_SINGLE_END_DEVICE; in AdvInitAsc3550Driver()
15419 if (asc_dvc->cfg->termination == 0) in AdvInitAsc3550Driver()
15425 asc_dvc->cfg->termination |= TERM_CTL_SEL; in AdvInitAsc3550Driver()
15431 asc_dvc->cfg->termination |= (TERM_CTL_H | TERM_CTL_L); in AdvInitAsc3550Driver()
15436 asc_dvc->cfg->termination |= TERM_CTL_H; in AdvInitAsc3550Driver()
15456 scsi_cfg1 |= (TERM_CTL_SEL | (~asc_dvc->cfg->termination & TERM_CTL)); in AdvInitAsc3550Driver()
15491 ADV_TID_TO_TIDMASK(asc_dvc->chip_scsi_id)); in AdvInitAsc3550Driver()
15498 ASC_ASSERT(asc_dvc->carrier_buf != NULL); in AdvInitAsc3550Driver()
15500 carrp = (ADV_CARR_T *) ADV_16BALIGN(asc_dvc->carrier_buf); in AdvInitAsc3550Driver()
15501 asc_dvc->carr_freelist = NULL; in AdvInitAsc3550Driver()
15502 if (carrp == (ADV_CARR_T *) asc_dvc->carrier_buf) in AdvInitAsc3550Driver()
15515 carr_paddr = cpu_to_le32(DvcGetPhyAddr(asc_dvc, NULL, (uchar *) carrp, in AdvInitAsc3550Driver()
15537 carrp->next_vpa = cpu_to_le32(ADV_VADDR_TO_U32(asc_dvc->carr_freelist)); in AdvInitAsc3550Driver()
15538 asc_dvc->carr_freelist = carrp; in AdvInitAsc3550Driver()
15548 if ((asc_dvc->icq_sp = asc_dvc->carr_freelist) == NULL) in AdvInitAsc3550Driver()
15550 asc_dvc->err_code |= ASC_IERR_NO_CARRIER; in AdvInitAsc3550Driver()
15553 asc_dvc->carr_freelist = (ADV_CARR_T *) in AdvInitAsc3550Driver()
15554 ADV_U32_TO_VADDR(le32_to_cpu(asc_dvc->icq_sp->next_vpa)); in AdvInitAsc3550Driver()
15559 asc_dvc->icq_sp->next_vpa = cpu_to_le32(ASC_CQ_STOPPER); in AdvInitAsc3550Driver()
15564 AdvWriteDWordLramNoSwap(iop_base, ASC_MC_ICQ, asc_dvc->icq_sp->carr_pa); in AdvInitAsc3550Driver()
15569 if ((asc_dvc->irq_sp = asc_dvc->carr_freelist) == NULL) in AdvInitAsc3550Driver()
15571 asc_dvc->err_code |= ASC_IERR_NO_CARRIER; in AdvInitAsc3550Driver()
15574 asc_dvc->carr_freelist = (ADV_CARR_T *) in AdvInitAsc3550Driver()
15575 ADV_U32_TO_VADDR(le32_to_cpu(asc_dvc->irq_sp->next_vpa)); in AdvInitAsc3550Driver()
15584 asc_dvc->irq_sp->next_vpa = cpu_to_le32(ASC_CQ_STOPPER); in AdvInitAsc3550Driver()
15589 AdvWriteDWordLramNoSwap(iop_base, ASC_MC_IRQ, asc_dvc->irq_sp->carr_pa); in AdvInitAsc3550Driver()
15590 asc_dvc->carr_pending_cnt = 0; in AdvInitAsc3550Driver()
15606 if (asc_dvc->bios_ctrl & BIOS_CTRL_RESET_SCSI_BUS) in AdvInitAsc3550Driver()
15628 if (AdvResetSB(asc_dvc) != ADV_TRUE) in AdvInitAsc3550Driver()
15649 AdvInitAsc38C0800Driver(ADV_DVC_VAR *asc_dvc) in AdvInitAsc38C0800Driver() argument
15673 if (asc_dvc->err_code != 0) in AdvInitAsc38C0800Driver()
15681 if (asc_dvc->chip_type != ADV_CHIP_ASC38C0800) in AdvInitAsc38C0800Driver()
15683 asc_dvc->err_code = ASC_IERR_BAD_CHIPTYPE; in AdvInitAsc38C0800Driver()
15688 iop_base = asc_dvc->iop_base; in AdvInitAsc38C0800Driver()
15751 asc_dvc->err_code |= ASC_IERR_BIST_PRE_TEST; in AdvInitAsc38C0800Driver()
15760 asc_dvc->err_code |= ASC_IERR_BIST_PRE_TEST; in AdvInitAsc38C0800Driver()
15779 asc_dvc->bist_err_code = byte; /* for BIOS display message */ in AdvInitAsc38C0800Driver()
15780 asc_dvc->err_code |= ASC_IERR_BIST_RAM_TEST; in AdvInitAsc38C0800Driver()
15872 asc_dvc->err_code |= ASC_IERR_MCODE_CHKSUM; in AdvInitAsc38C0800Driver()
15901 AdvReadWordLram(iop_base, ASC_MC_VERSION_DATE, asc_dvc->cfg->mcode_date); in AdvInitAsc38C0800Driver()
15902 AdvReadWordLram(iop_base, ASC_MC_VERSION_NUM, asc_dvc->cfg->mcode_version); in AdvInitAsc38C0800Driver()
15926 if (asc_dvc->cfg->control_flag & CONTROL_FLAG_IGNORE_PERR) in AdvInitAsc38C0800Driver()
15956 if ((asc_dvc->bios_ctrl & BIOS_CTRL_RESET_SCSI_BUS) == 0) in AdvInitAsc38C0800Driver()
15958 AdvWriteWordLram(iop_base, ASC_MC_WDTR_ABLE, asc_dvc->wdtr_able); in AdvInitAsc38C0800Driver()
15959 AdvWriteWordLram(iop_base, ASC_MC_SDTR_ABLE, asc_dvc->sdtr_able); in AdvInitAsc38C0800Driver()
15971 AdvWriteWordLram(iop_base, ASC_MC_DISC_ENABLE, asc_dvc->cfg->disc_enable); in AdvInitAsc38C0800Driver()
15972 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED1, asc_dvc->sdtr_speed1); in AdvInitAsc38C0800Driver()
15973 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED2, asc_dvc->sdtr_speed2); in AdvInitAsc38C0800Driver()
15974 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED3, asc_dvc->sdtr_speed3); in AdvInitAsc38C0800Driver()
15975 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED4, asc_dvc->sdtr_speed4); in AdvInitAsc38C0800Driver()
15985 asc_dvc->chip_scsi_id); in AdvInitAsc38C0800Driver()
16004 asc_dvc->err_code |= ASC_IERR_REVERSED_CABLE; in AdvInitAsc38C0800Driver()
16019 asc_dvc->err_code |= ASC_IERR_HVD_DEVICE; in AdvInitAsc38C0800Driver()
16031 if ((asc_dvc->cfg->termination & TERM_SE) == 0) in AdvInitAsc38C0800Driver()
16038 asc_dvc->cfg->termination |= TERM_SE; in AdvInitAsc38C0800Driver()
16043 asc_dvc->cfg->termination |= TERM_SE_HI; in AdvInitAsc38C0800Driver()
16048 if ((asc_dvc->cfg->termination & TERM_LVD) == 0) in AdvInitAsc38C0800Driver()
16055 asc_dvc->cfg->termination |= TERM_LVD; in AdvInitAsc38C0800Driver()
16072 scsi_cfg1 |= (~asc_dvc->cfg->termination & 0xF0); in AdvInitAsc38C0800Driver()
16113 ADV_TID_TO_TIDMASK(asc_dvc->chip_scsi_id)); in AdvInitAsc38C0800Driver()
16120 ASC_ASSERT(asc_dvc->carrier_buf != NULL); in AdvInitAsc38C0800Driver()
16122 carrp = (ADV_CARR_T *) ADV_16BALIGN(asc_dvc->carrier_buf); in AdvInitAsc38C0800Driver()
16123 asc_dvc->carr_freelist = NULL; in AdvInitAsc38C0800Driver()
16124 if (carrp == (ADV_CARR_T *) asc_dvc->carrier_buf) in AdvInitAsc38C0800Driver()
16137 carr_paddr = cpu_to_le32(DvcGetPhyAddr(asc_dvc, NULL, (uchar *) carrp, in AdvInitAsc38C0800Driver()
16159 carrp->next_vpa = cpu_to_le32(ADV_VADDR_TO_U32(asc_dvc->carr_freelist)); in AdvInitAsc38C0800Driver()
16160 asc_dvc->carr_freelist = carrp; in AdvInitAsc38C0800Driver()
16170 if ((asc_dvc->icq_sp = asc_dvc->carr_freelist) == NULL) in AdvInitAsc38C0800Driver()
16172 asc_dvc->err_code |= ASC_IERR_NO_CARRIER; in AdvInitAsc38C0800Driver()
16175 asc_dvc->carr_freelist = (ADV_CARR_T *) in AdvInitAsc38C0800Driver()
16176 ADV_U32_TO_VADDR(le32_to_cpu(asc_dvc->icq_sp->next_vpa)); in AdvInitAsc38C0800Driver()
16181 asc_dvc->icq_sp->next_vpa = cpu_to_le32(ASC_CQ_STOPPER); in AdvInitAsc38C0800Driver()
16187 AdvWriteDWordLramNoSwap(iop_base, ASC_MC_ICQ, asc_dvc->icq_sp->carr_pa); in AdvInitAsc38C0800Driver()
16192 if ((asc_dvc->irq_sp = asc_dvc->carr_freelist) == NULL) in AdvInitAsc38C0800Driver()
16194 asc_dvc->err_code |= ASC_IERR_NO_CARRIER; in AdvInitAsc38C0800Driver()
16197 asc_dvc->carr_freelist = (ADV_CARR_T *) in AdvInitAsc38C0800Driver()
16198 ADV_U32_TO_VADDR(le32_to_cpu(asc_dvc->irq_sp->next_vpa)); in AdvInitAsc38C0800Driver()
16207 asc_dvc->irq_sp->next_vpa = cpu_to_le32(ASC_CQ_STOPPER); in AdvInitAsc38C0800Driver()
16214 AdvWriteDWordLramNoSwap(iop_base, ASC_MC_IRQ, asc_dvc->irq_sp->carr_pa); in AdvInitAsc38C0800Driver()
16215 asc_dvc->carr_pending_cnt = 0; in AdvInitAsc38C0800Driver()
16231 if (asc_dvc->bios_ctrl & BIOS_CTRL_RESET_SCSI_BUS) in AdvInitAsc38C0800Driver()
16253 if (AdvResetSB(asc_dvc) != ADV_TRUE) in AdvInitAsc38C0800Driver()
16274 AdvInitAsc38C1600Driver(ADV_DVC_VAR *asc_dvc) in AdvInitAsc38C1600Driver() argument
16298 if (asc_dvc->err_code != 0) in AdvInitAsc38C1600Driver()
16306 if (asc_dvc->chip_type != ADV_CHIP_ASC38C1600) in AdvInitAsc38C1600Driver()
16308 asc_dvc->err_code = ASC_IERR_BAD_CHIPTYPE; in AdvInitAsc38C1600Driver()
16313 iop_base = asc_dvc->iop_base; in AdvInitAsc38C1600Driver()
16377 asc_dvc->err_code |= ASC_IERR_BIST_PRE_TEST; in AdvInitAsc38C1600Driver()
16386 asc_dvc->err_code |= ASC_IERR_BIST_PRE_TEST; in AdvInitAsc38C1600Driver()
16405 asc_dvc->bist_err_code = byte; /* for BIOS display message */ in AdvInitAsc38C1600Driver()
16406 asc_dvc->err_code |= ASC_IERR_BIST_RAM_TEST; in AdvInitAsc38C1600Driver()
16494 asc_dvc->err_code |= ASC_IERR_MCODE_CHKSUM; in AdvInitAsc38C1600Driver()
16523 AdvReadWordLram(iop_base, ASC_MC_VERSION_DATE, asc_dvc->cfg->mcode_date); in AdvInitAsc38C1600Driver()
16524 AdvReadWordLram(iop_base, ASC_MC_VERSION_NUM, asc_dvc->cfg->mcode_version); in AdvInitAsc38C1600Driver()
16548 if (asc_dvc->cfg->control_flag & CONTROL_FLAG_IGNORE_PERR) in AdvInitAsc38C1600Driver()
16561 if ((asc_dvc->bios_ctrl & BIOS_CTRL_AIPP_DIS) == 0) in AdvInitAsc38C1600Driver()
16587 if ((asc_dvc->bios_ctrl & BIOS_CTRL_RESET_SCSI_BUS) == 0) in AdvInitAsc38C1600Driver()
16589 AdvWriteWordLram(iop_base, ASC_MC_WDTR_ABLE, asc_dvc->wdtr_able); in AdvInitAsc38C1600Driver()
16590 AdvWriteWordLram(iop_base, ASC_MC_SDTR_ABLE, asc_dvc->sdtr_able); in AdvInitAsc38C1600Driver()
16602 AdvWriteWordLram(iop_base, ASC_MC_DISC_ENABLE, asc_dvc->cfg->disc_enable); in AdvInitAsc38C1600Driver()
16603 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED1, asc_dvc->sdtr_speed1); in AdvInitAsc38C1600Driver()
16604 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED2, asc_dvc->sdtr_speed2); in AdvInitAsc38C1600Driver()
16605 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED3, asc_dvc->sdtr_speed3); in AdvInitAsc38C1600Driver()
16606 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED4, asc_dvc->sdtr_speed4); in AdvInitAsc38C1600Driver()
16616 asc_dvc->chip_scsi_id); in AdvInitAsc38C1600Driver()
16636 asc_dvc->err_code |= ASC_IERR_REVERSED_CABLE; in AdvInitAsc38C1600Driver()
16650 asc_dvc->err_code |= ASC_IERR_HVD_DEVICE; in AdvInitAsc38C1600Driver()
16667 if ((asc_dvc->cfg->termination & TERM_SE) == 0) in AdvInitAsc38C1600Driver()
16674 asc_dvc->cfg->termination |= TERM_SE; in AdvInitAsc38C1600Driver()
16678 if (ASC_PCI_ID2FUNC(asc_dvc->cfg->pci_slot_info) == 0) in AdvInitAsc38C1600Driver()
16685 asc_dvc->cfg->termination |= TERM_SE_HI; in AdvInitAsc38C1600Driver()
16699 scsi_cfg1 |= (~asc_dvc->cfg->termination & TERM_SE); in AdvInitAsc38C1600Driver()
16749 ADV_TID_TO_TIDMASK(asc_dvc->chip_scsi_id)); in AdvInitAsc38C1600Driver()
16757 ASC_ASSERT(asc_dvc->carrier_buf != NULL); in AdvInitAsc38C1600Driver()
16759 carrp = (ADV_CARR_T *) ADV_16BALIGN(asc_dvc->carrier_buf); in AdvInitAsc38C1600Driver()
16760 asc_dvc->carr_freelist = NULL; in AdvInitAsc38C1600Driver()
16761 if (carrp == (ADV_CARR_T *) asc_dvc->carrier_buf) in AdvInitAsc38C1600Driver()
16774 carr_paddr = cpu_to_le32(DvcGetPhyAddr(asc_dvc, NULL, (uchar *) carrp, in AdvInitAsc38C1600Driver()
16796 carrp->next_vpa = cpu_to_le32(ADV_VADDR_TO_U32(asc_dvc->carr_freelist)); in AdvInitAsc38C1600Driver()
16797 asc_dvc->carr_freelist = carrp; in AdvInitAsc38C1600Driver()
16806 if ((asc_dvc->icq_sp = asc_dvc->carr_freelist) == NULL) in AdvInitAsc38C1600Driver()
16808 asc_dvc->err_code |= ASC_IERR_NO_CARRIER; in AdvInitAsc38C1600Driver()
16811 asc_dvc->carr_freelist = (ADV_CARR_T *) in AdvInitAsc38C1600Driver()
16812 ADV_U32_TO_VADDR(le32_to_cpu(asc_dvc->icq_sp->next_vpa)); in AdvInitAsc38C1600Driver()
16817 asc_dvc->icq_sp->next_vpa = cpu_to_le32(ASC_CQ_STOPPER); in AdvInitAsc38C1600Driver()
16824 AdvWriteDWordLramNoSwap(iop_base, ASC_MC_ICQ, asc_dvc->icq_sp->carr_pa); in AdvInitAsc38C1600Driver()
16826 le32_to_cpu(asc_dvc->icq_sp->carr_pa)); in AdvInitAsc38C1600Driver()
16831 if ((asc_dvc->irq_sp = asc_dvc->carr_freelist) == NULL) in AdvInitAsc38C1600Driver()
16833 asc_dvc->err_code |= ASC_IERR_NO_CARRIER; in AdvInitAsc38C1600Driver()
16836 asc_dvc->carr_freelist = (ADV_CARR_T *) in AdvInitAsc38C1600Driver()
16837 ADV_U32_TO_VADDR(le32_to_cpu(asc_dvc->irq_sp->next_vpa)); in AdvInitAsc38C1600Driver()
16846 asc_dvc->irq_sp->next_vpa = cpu_to_le32(ASC_CQ_STOPPER); in AdvInitAsc38C1600Driver()
16851 AdvWriteDWordLramNoSwap(iop_base, ASC_MC_IRQ, asc_dvc->irq_sp->carr_pa); in AdvInitAsc38C1600Driver()
16852 asc_dvc->carr_pending_cnt = 0; in AdvInitAsc38C1600Driver()
16867 if (asc_dvc->bios_ctrl & BIOS_CTRL_RESET_SCSI_BUS) in AdvInitAsc38C1600Driver()
16889 if (AdvResetSB(asc_dvc) != ADV_TRUE) in AdvInitAsc38C1600Driver()
16913 AdvInitFrom3550EEP(ADV_DVC_VAR *asc_dvc) in ASC_INITFUNC() argument
16921 iop_base = asc_dvc->iop_base; in ASC_INITFUNC()
16965 asc_dvc->wdtr_able = eep_config.wdtr_able; in ASC_INITFUNC()
16966 asc_dvc->sdtr_able = eep_config.sdtr_able; in ASC_INITFUNC()
16967 asc_dvc->ultra_able = eep_config.ultra_able; in ASC_INITFUNC()
16968 asc_dvc->tagqng_able = eep_config.tagqng_able; in ASC_INITFUNC()
16969 asc_dvc->cfg->disc_enable = eep_config.disc_enable; in ASC_INITFUNC()
16970 asc_dvc->max_host_qng = eep_config.max_host_qng; in ASC_INITFUNC()
16971 asc_dvc->max_dvc_qng = eep_config.max_dvc_qng; in ASC_INITFUNC()
16972 asc_dvc->chip_scsi_id = (eep_config.adapter_scsi_id & ADV_MAX_TID); in ASC_INITFUNC()
16973 asc_dvc->start_motor = eep_config.start_motor; in ASC_INITFUNC()
16974 asc_dvc->scsi_reset_wait = eep_config.scsi_reset_delay; in ASC_INITFUNC()
16975 asc_dvc->bios_ctrl = eep_config.bios_ctrl; in ASC_INITFUNC()
16976 asc_dvc->no_scam = eep_config.scam_tolerant; in ASC_INITFUNC()
16977 asc_dvc->cfg->serial1 = eep_config.serial_number_word1; in ASC_INITFUNC()
16978 asc_dvc->cfg->serial2 = eep_config.serial_number_word2; in ASC_INITFUNC()
16979 asc_dvc->cfg->serial3 = eep_config.serial_number_word3; in ASC_INITFUNC()
17028 asc_dvc->max_host_qng = eep_config.max_host_qng; in ASC_INITFUNC()
17029 asc_dvc->max_dvc_qng = eep_config.max_dvc_qng; in ASC_INITFUNC()
17042 asc_dvc->cfg->termination = 0; /* auto termination */ in ASC_INITFUNC()
17048 asc_dvc->cfg->termination = TERM_CTL_SEL; in ASC_INITFUNC()
17053 asc_dvc->cfg->termination = TERM_CTL_SEL | TERM_CTL_H; in ASC_INITFUNC()
17058 asc_dvc->cfg->termination = TERM_CTL_SEL | TERM_CTL_H | TERM_CTL_L; in ASC_INITFUNC()
17065 asc_dvc->cfg->termination = 0; in ASC_INITFUNC()
17087 AdvInitFrom38C0800EEP(ADV_DVC_VAR *asc_dvc) in ASC_INITFUNC() argument
17097 iop_base = asc_dvc->iop_base; in ASC_INITFUNC()
17141 asc_dvc->wdtr_able = eep_config.wdtr_able; in ASC_INITFUNC()
17142 asc_dvc->sdtr_speed1 = eep_config.sdtr_speed1; in ASC_INITFUNC()
17143 asc_dvc->sdtr_speed2 = eep_config.sdtr_speed2; in ASC_INITFUNC()
17144 asc_dvc->sdtr_speed3 = eep_config.sdtr_speed3; in ASC_INITFUNC()
17145 asc_dvc->sdtr_speed4 = eep_config.sdtr_speed4; in ASC_INITFUNC()
17146 asc_dvc->tagqng_able = eep_config.tagqng_able; in ASC_INITFUNC()
17147 asc_dvc->cfg->disc_enable = eep_config.disc_enable; in ASC_INITFUNC()
17148 asc_dvc->max_host_qng = eep_config.max_host_qng; in ASC_INITFUNC()
17149 asc_dvc->max_dvc_qng = eep_config.max_dvc_qng; in ASC_INITFUNC()
17150 asc_dvc->chip_scsi_id = (eep_config.adapter_scsi_id & ADV_MAX_TID); in ASC_INITFUNC()
17151 asc_dvc->start_motor = eep_config.start_motor; in ASC_INITFUNC()
17152 asc_dvc->scsi_reset_wait = eep_config.scsi_reset_delay; in ASC_INITFUNC()
17153 asc_dvc->bios_ctrl = eep_config.bios_ctrl; in ASC_INITFUNC()
17154 asc_dvc->no_scam = eep_config.scam_tolerant; in ASC_INITFUNC()
17155 asc_dvc->cfg->serial1 = eep_config.serial_number_word1; in ASC_INITFUNC()
17156 asc_dvc->cfg->serial2 = eep_config.serial_number_word2; in ASC_INITFUNC()
17157 asc_dvc->cfg->serial3 = eep_config.serial_number_word3; in ASC_INITFUNC()
17163 asc_dvc->sdtr_able = 0; in ASC_INITFUNC()
17168 sdtr_speed = asc_dvc->sdtr_speed1; in ASC_INITFUNC()
17171 sdtr_speed = asc_dvc->sdtr_speed2; in ASC_INITFUNC()
17174 sdtr_speed = asc_dvc->sdtr_speed3; in ASC_INITFUNC()
17177 sdtr_speed = asc_dvc->sdtr_speed4; in ASC_INITFUNC()
17181 asc_dvc->sdtr_able |= (1 << tid); in ASC_INITFUNC()
17233 asc_dvc->max_host_qng = eep_config.max_host_qng; in ASC_INITFUNC()
17234 asc_dvc->max_dvc_qng = eep_config.max_dvc_qng; in ASC_INITFUNC()
17276 asc_dvc->cfg->termination = termination; /* auto termination for LVD */ in ASC_INITFUNC()
17282 asc_dvc->cfg->termination = termination; in ASC_INITFUNC()
17287 asc_dvc->cfg->termination = termination | TERM_LVD_HI; in ASC_INITFUNC()
17292 asc_dvc->cfg->termination = in ASC_INITFUNC()
17300 asc_dvc->cfg->termination = termination; in ASC_INITFUNC()
17322 AdvInitFrom38C1600EEP(ADV_DVC_VAR *asc_dvc) in ASC_INITFUNC() argument
17332 iop_base = asc_dvc->iop_base; in ASC_INITFUNC()
17350 if (i == 1 && ASC_PCI_ID2FUNC(asc_dvc->cfg->pci_slot_info) != 0) in ASC_INITFUNC()
17418 asc_dvc->wdtr_able = eep_config.wdtr_able; in ASC_INITFUNC()
17419 asc_dvc->sdtr_speed1 = eep_config.sdtr_speed1; in ASC_INITFUNC()
17420 asc_dvc->sdtr_speed2 = eep_config.sdtr_speed2; in ASC_INITFUNC()
17421 asc_dvc->sdtr_speed3 = eep_config.sdtr_speed3; in ASC_INITFUNC()
17422 asc_dvc->sdtr_speed4 = eep_config.sdtr_speed4; in ASC_INITFUNC()
17423 asc_dvc->ppr_able = 0; in ASC_INITFUNC()
17424 asc_dvc->tagqng_able = eep_config.tagqng_able; in ASC_INITFUNC()
17425 asc_dvc->cfg->disc_enable = eep_config.disc_enable; in ASC_INITFUNC()
17426 asc_dvc->max_host_qng = eep_config.max_host_qng; in ASC_INITFUNC()
17427 asc_dvc->max_dvc_qng = eep_config.max_dvc_qng; in ASC_INITFUNC()
17428 asc_dvc->chip_scsi_id = (eep_config.adapter_scsi_id & ASC_MAX_TID); in ASC_INITFUNC()
17429 asc_dvc->start_motor = eep_config.start_motor; in ASC_INITFUNC()
17430 asc_dvc->scsi_reset_wait = eep_config.scsi_reset_delay; in ASC_INITFUNC()
17431 asc_dvc->bios_ctrl = eep_config.bios_ctrl; in ASC_INITFUNC()
17432 asc_dvc->no_scam = eep_config.scam_tolerant; in ASC_INITFUNC()
17438 asc_dvc->sdtr_able = 0; in ASC_INITFUNC()
17443 sdtr_speed = asc_dvc->sdtr_speed1; in ASC_INITFUNC()
17446 sdtr_speed = asc_dvc->sdtr_speed2; in ASC_INITFUNC()
17449 sdtr_speed = asc_dvc->sdtr_speed3; in ASC_INITFUNC()
17452 sdtr_speed = asc_dvc->sdtr_speed4; in ASC_INITFUNC()
17456 asc_dvc->sdtr_able |= (1 << tid); in ASC_INITFUNC()
17508 asc_dvc->max_host_qng = eep_config.max_host_qng; in ASC_INITFUNC()
17509 asc_dvc->max_dvc_qng = eep_config.max_dvc_qng; in ASC_INITFUNC()
17551 asc_dvc->cfg->termination = termination; /* auto termination for LVD */ in ASC_INITFUNC()
17557 asc_dvc->cfg->termination = termination; in ASC_INITFUNC()
17562 asc_dvc->cfg->termination = termination | TERM_LVD_HI; in ASC_INITFUNC()
17567 asc_dvc->cfg->termination = in ASC_INITFUNC()
17575 asc_dvc->cfg->termination = termination; in ASC_INITFUNC()
17994 AdvExeScsiQueue(ADV_DVC_VAR *asc_dvc, in AdvExeScsiQueue() argument
18015 iop_base = asc_dvc->iop_base; in AdvExeScsiQueue()
18023 if ((new_carrp = asc_dvc->carr_freelist) == NULL) in AdvExeScsiQueue()
18028 asc_dvc->carr_freelist = (ADV_CARR_T *) in AdvExeScsiQueue()
18030 asc_dvc->carr_pending_cnt++; in AdvExeScsiQueue()
18045 req_paddr = DvcGetPhyAddr(asc_dvc, scsiq, (uchar *) scsiq, in AdvExeScsiQueue()
18058 scsiq->carr_va = cpu_to_le32(ADV_VADDR_TO_U32(asc_dvc->icq_sp)); in AdvExeScsiQueue()
18063 scsiq->carr_pa = asc_dvc->icq_sp->carr_pa; in AdvExeScsiQueue()
18070 asc_dvc->icq_sp->areq_vpa = req_paddr; in AdvExeScsiQueue()
18077 asc_dvc->icq_sp->next_vpa = new_carrp->carr_pa; in AdvExeScsiQueue()
18082 asc_dvc->icq_sp = new_carrp; in AdvExeScsiQueue()
18084 if (asc_dvc->chip_type == ADV_CHIP_ASC3550 || in AdvExeScsiQueue()
18085 asc_dvc->chip_type == ADV_CHIP_ASC38C0800) in AdvExeScsiQueue()
18091 if (asc_dvc->chip_type == ADV_CHIP_ASC3550) in AdvExeScsiQueue()
18100 } else if (asc_dvc->chip_type == ADV_CHIP_ASC38C1600) in AdvExeScsiQueue()
18125 AdvResetSB(ADV_DVC_VAR *asc_dvc) in AdvResetSB() argument
18133 status = AdvSendIdleCmd(asc_dvc, (ushort) IDLE_CMD_SCSI_RESET_START, 0L); in AdvResetSB()
18145 DvcDelayMicroSecond(asc_dvc, (ushort) ASC_SCSI_RESET_HOLD_TIME_US); in AdvResetSB()
18151 status = AdvSendIdleCmd(asc_dvc, (ushort) IDLE_CMD_SCSI_RESET_END, 0L); in AdvResetSB()
18157 DvcSleepMilliSecond((ADV_DCNT) asc_dvc->scsi_reset_wait * 1000); in AdvResetSB()
18170 AdvResetChipAndSB(ADV_DVC_VAR *asc_dvc) in AdvResetChipAndSB() argument
18179 iop_base = asc_dvc->iop_base; in AdvResetChipAndSB()
18186 if (asc_dvc->chip_type == ADV_CHIP_ASC38C1600) in AdvResetChipAndSB()
18218 asc_dvc->err_code = 0; in AdvResetChipAndSB()
18219 if (asc_dvc->chip_type == ADV_CHIP_ASC38C1600) in AdvResetChipAndSB()
18221 status = AdvInitAsc38C1600Driver(asc_dvc); in AdvResetChipAndSB()
18223 else if (asc_dvc->chip_type == ADV_CHIP_ASC38C0800) in AdvResetChipAndSB()
18225 status = AdvInitAsc38C0800Driver(asc_dvc); in AdvResetChipAndSB()
18228 status = AdvInitAsc3550Driver(asc_dvc); in AdvResetChipAndSB()
18250 if (asc_dvc->chip_type == ADV_CHIP_ASC38C1600) in AdvResetChipAndSB()
18284 AdvISR(ADV_DVC_VAR *asc_dvc) in AdvISR() argument
18296 iop_base = asc_dvc->iop_base; in AdvISR()
18319 if (asc_dvc->chip_type == ADV_CHIP_ASC3550 || in AdvISR()
18320 asc_dvc->chip_type == ADV_CHIP_ASC38C0800) in AdvISR()
18323 asc_dvc->carr_pending_cnt != 0) in AdvISR()
18326 if (asc_dvc->chip_type == ADV_CHIP_ASC3550) in AdvISR()
18333 if (asc_dvc->async_callback != 0) in AdvISR()
18335 (*asc_dvc->async_callback)(asc_dvc, intrb_code); in AdvISR()
18343 le32_to_cpu(asc_dvc->irq_sp->next_vpa)) & ASC_RQ_DONE) != 0) in AdvISR()
18355 ADV_U32_TO_VADDR(le32_to_cpu(asc_dvc->irq_sp->areq_vpa)); in AdvISR()
18374 free_carrp = asc_dvc->irq_sp; in AdvISR()
18375 asc_dvc->irq_sp = (ADV_CARR_T *) in AdvISR()
18379 cpu_to_le32(ADV_VADDR_TO_U32(asc_dvc->carr_freelist)); in AdvISR()
18380 asc_dvc->carr_freelist = free_carrp; in AdvISR()
18381 asc_dvc->carr_pending_cnt--; in AdvISR()
18406 AdvInquiryHandling(asc_dvc, scsiq); in AdvISR()
18414 (*asc_dvc->isr_callback)(asc_dvc, scsiq); in AdvISR()
18452 AdvSendIdleCmd(ADV_DVC_VAR *asc_dvc, in AdvSendIdleCmd() argument
18463 iop_base = asc_dvc->iop_base; in AdvSendIdleCmd()
18487 if (asc_dvc->chip_type == ADV_CHIP_ASC3550) in AdvSendIdleCmd()
18509 DvcDelayMicroSecond(asc_dvc, (ushort) 1); in AdvSendIdleCmd()
18527 ADV_DVC_VAR *asc_dvc, in AdvInquiryHandling() argument
18552 iop_base = asc_dvc->iop_base; in AdvInquiryHandling()
18584 if ((asc_dvc->wdtr_able & tidmask) && ADV_INQ_WIDE16(inq)) in AdvInquiryHandling()
18615 if ((asc_dvc->sdtr_able & tidmask) && ADV_INQ_SYNC(inq)) in AdvInquiryHandling()
18637 if (asc_dvc->chip_type == ADV_CHIP_ASC38C1600 && in AdvInquiryHandling()
18651 AdvReadWordLram(iop_base, ASC_MC_PPR_ABLE, asc_dvc->ppr_able); in AdvInquiryHandling()
18652 asc_dvc->ppr_able |= tidmask; in AdvInquiryHandling()
18653 AdvWriteWordLram(iop_base, ASC_MC_PPR_ABLE, asc_dvc->ppr_able); in AdvInquiryHandling()
18669 if ((asc_dvc->tagqng_able & tidmask) && ADV_INQ_CMD_QUEUE(inq)) in AdvInquiryHandling()
18676 asc_dvc->max_dvc_qng); in AdvInquiryHandling()