Lines Matching defs:asc_dvc
1971 #define AdvAbortQueue(asc_dvc, srb_tag) \
1972 AdvSendIdleCmd((asc_dvc), (ushort) IDLE_CMD_ABORT, \
1986 #define AdvResetDevice(asc_dvc, target_id) \
1987 AdvSendIdleCmd((asc_dvc), (ushort) IDLE_CMD_DEVICE_RESET, \
2274 #define asc_dvc_to_board(asc_dvc) container_of(asc_dvc, struct asc_board, \
3667 static bool AscResetChipAndScsiBus(ASC_DVC_VAR *asc_dvc)
3672 iop_base = asc_dvc->iop_base;
3862 static void AscInitLram(ASC_DVC_VAR *asc_dvc)
3868 iop_base = asc_dvc->iop_base;
3870 (ushort)(((int)(asc_dvc->max_total_qng + 2 + 1) *
3877 (uchar)(asc_dvc->max_total_qng));
3882 for (; i < asc_dvc->max_total_qng; i++, s_addr += ASC_QBLK_SIZE) {
3893 (uchar)(asc_dvc->max_total_qng - 1));
3895 (uchar)asc_dvc->max_total_qng);
3898 for (; i <= (uchar)(asc_dvc->max_total_qng + 3);
3936 static void AscInitQLinkVar(ASC_DVC_VAR *asc_dvc)
3942 iop_base = asc_dvc->iop_base;
3944 AscPutRiscVarDoneQTail(iop_base, asc_dvc->max_total_qng);
3946 AscPutVarDoneQTail(iop_base, asc_dvc->max_total_qng);
3948 (uchar)((int)asc_dvc->max_total_qng + 1));
3950 (uchar)((int)asc_dvc->max_total_qng + 2));
3952 asc_dvc->max_total_qng);
3965 static int AscInitMicroCodeVar(ASC_DVC_VAR *asc_dvc)
3972 struct asc_board *board = asc_dvc_to_board(asc_dvc);
3974 iop_base = asc_dvc->iop_base;
3978 asc_dvc->cfg->sdtr_period_offset[i]);
3981 AscInitQLinkVar(asc_dvc);
3983 asc_dvc->cfg->disc_enable);
3985 ASC_TID_TO_TARGET_ID(asc_dvc->cfg->chip_scsi_id));
3988 BUG_ON((unsigned long)asc_dvc->overrun_buf & 7);
3989 asc_dvc->overrun_dma = dma_map_single(board->dev, asc_dvc->overrun_buf,
3991 if (dma_mapping_error(board->dev, asc_dvc->overrun_dma)) {
3995 phy_addr = cpu_to_le32(asc_dvc->overrun_dma);
4002 asc_dvc->cfg->mcode_date =
4004 asc_dvc->cfg->mcode_version =
4009 asc_dvc->err_code |= ASC_IERR_SET_PC_ADDR;
4014 asc_dvc->err_code |= ASC_IERR_START_STOP_CHIP;
4022 dma_unmap_single(board->dev, asc_dvc->overrun_dma,
4025 asc_dvc->overrun_dma = 0;
4029 static int AscInitAsc1000Driver(ASC_DVC_VAR *asc_dvc)
4038 iop_base = asc_dvc->iop_base;
4040 if ((asc_dvc->dvc_cntl & ASC_CNTL_RESET_SCSI) &&
4041 !(asc_dvc->init_state & ASC_INIT_RESET_SCSI_DONE)) {
4042 AscResetChipAndScsiBus(asc_dvc);
4043 mdelay(asc_dvc->scsi_reset_wait * 1000); /* XXX: msleep? */
4045 asc_dvc->init_state |= ASC_INIT_STATE_BEG_LOAD_MC;
4046 if (asc_dvc->err_code != 0)
4048 if (!AscFindSignature(asc_dvc->iop_base)) {
4049 asc_dvc->err_code = ASC_IERR_BAD_SIGNATURE;
4053 AscInitLram(asc_dvc);
4055 err = request_firmware(&fw, fwname, asc_dvc->drv_ptr->dev);
4059 asc_dvc->err_code |= ASC_IERR_MCODE_CHKSUM;
4066 asc_dvc->err_code |= ASC_IERR_MCODE_CHKSUM;
4074 asc_dvc->err_code |= ASC_IERR_MCODE_CHKSUM;
4079 warn_code |= AscInitMicroCodeVar(asc_dvc);
4080 if (!asc_dvc->overrun_dma)
4082 asc_dvc->init_state |= ASC_INIT_STATE_END_LOAD_MC;
4242 AdvSendIdleCmd(ADV_DVC_VAR *asc_dvc,
4248 iop_base = asc_dvc->iop_base;
4271 if (asc_dvc->chip_type == ADV_CHIP_ASC3550) {
4305 static int AdvResetSB(ADV_DVC_VAR *asc_dvc)
4313 status = AdvSendIdleCmd(asc_dvc, (ushort)IDLE_CMD_SCSI_RESET_START, 0L);
4330 status = AdvSendIdleCmd(asc_dvc, (ushort)IDLE_CMD_SCSI_RESET_END, 0L);
4335 mdelay(asc_dvc->scsi_reset_wait * 1000); /* XXX: msleep? */
4350 static int AdvInitAsc3550Driver(ADV_DVC_VAR *asc_dvc)
4370 if (asc_dvc->err_code != 0)
4376 if (asc_dvc->chip_type != ADV_CHIP_ASC3550) {
4377 asc_dvc->err_code = ASC_IERR_BAD_CHIPTYPE;
4382 iop_base = asc_dvc->iop_base;
4421 err = request_firmware(&fw, fwname, asc_dvc->drv_ptr->dev);
4425 asc_dvc->err_code = ASC_IERR_MCODE_CHKSUM;
4432 asc_dvc->err_code = ASC_IERR_MCODE_CHKSUM;
4437 asc_dvc->err_code = AdvLoadMicrocode(iop_base, &fw->data[4],
4441 if (asc_dvc->err_code)
4469 asc_dvc->cfg->mcode_date);
4471 asc_dvc->cfg->mcode_version);
4484 if (asc_dvc->cfg->control_flag & CONTROL_FLAG_IGNORE_PERR) {
4509 if ((asc_dvc->bios_ctrl & BIOS_CTRL_RESET_SCSI_BUS) == 0) {
4511 asc_dvc->wdtr_able);
4513 asc_dvc->sdtr_able);
4540 if (ADV_TID_TO_TIDMASK(tid) & asc_dvc->ultra_able) {
4566 asc_dvc->cfg->disc_enable);
4576 asc_dvc->chip_scsi_id);
4593 asc_dvc->err_code |= ASC_IERR_ILLEGAL_CONNECTION;
4603 asc_dvc->err_code |= ASC_IERR_REVERSED_CABLE;
4612 asc_dvc->err_code |= ASC_IERR_SINGLE_END_DEVICE;
4624 if (asc_dvc->cfg->termination == 0) {
4629 asc_dvc->cfg->termination |= TERM_CTL_SEL;
4639 asc_dvc->cfg->termination |= (TERM_CTL_H | TERM_CTL_L);
4648 asc_dvc->cfg->termination |= TERM_CTL_H;
4669 scsi_cfg1 |= (TERM_CTL_SEL | (~asc_dvc->cfg->termination & TERM_CTL));
4704 ADV_TID_TO_TIDMASK(asc_dvc->chip_scsi_id));
4706 AdvBuildCarrierFreelist(asc_dvc);
4712 asc_dvc->icq_sp = adv_get_next_carrier(asc_dvc);
4713 if (!asc_dvc->icq_sp) {
4714 asc_dvc->err_code |= ASC_IERR_NO_CARRIER;
4721 AdvWriteDWordLramNoSwap(iop_base, ASC_MC_ICQ, asc_dvc->icq_sp->carr_pa);
4726 asc_dvc->irq_sp = adv_get_next_carrier(asc_dvc);
4727 if (!asc_dvc->irq_sp) {
4728 asc_dvc->err_code |= ASC_IERR_NO_CARRIER;
4735 AdvWriteDWordLramNoSwap(iop_base, ASC_MC_IRQ, asc_dvc->irq_sp->carr_pa);
4736 asc_dvc->carr_pending_cnt = 0;
4753 if (asc_dvc->bios_ctrl & BIOS_CTRL_RESET_SCSI_BUS) {
4774 if (AdvResetSB(asc_dvc) != ADV_TRUE) {
4793 static int AdvInitAsc38C0800Driver(ADV_DVC_VAR *asc_dvc)
4814 if (asc_dvc->err_code != 0)
4820 if (asc_dvc->chip_type != ADV_CHIP_ASC38C0800) {
4821 asc_dvc->err_code = ASC_IERR_BAD_CHIPTYPE;
4826 iop_base = asc_dvc->iop_base;
4887 asc_dvc->err_code = ASC_IERR_BIST_PRE_TEST;
4895 asc_dvc->err_code = ASC_IERR_BIST_PRE_TEST;
4913 asc_dvc->bist_err_code = byte; /* for BIOS display message */
4914 asc_dvc->err_code = ASC_IERR_BIST_RAM_TEST;
4921 err = request_firmware(&fw, fwname, asc_dvc->drv_ptr->dev);
4925 asc_dvc->err_code = ASC_IERR_MCODE_CHKSUM;
4932 asc_dvc->err_code = ASC_IERR_MCODE_CHKSUM;
4937 asc_dvc->err_code = AdvLoadMicrocode(iop_base, &fw->data[4],
4941 if (asc_dvc->err_code)
4969 asc_dvc->cfg->mcode_date);
4971 asc_dvc->cfg->mcode_version);
4996 if (asc_dvc->cfg->control_flag & CONTROL_FLAG_IGNORE_PERR) {
5026 if ((asc_dvc->bios_ctrl & BIOS_CTRL_RESET_SCSI_BUS) == 0) {
5028 asc_dvc->wdtr_able);
5030 asc_dvc->sdtr_able);
5043 asc_dvc->cfg->disc_enable);
5044 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED1, asc_dvc->sdtr_speed1);
5045 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED2, asc_dvc->sdtr_speed2);
5046 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED3, asc_dvc->sdtr_speed3);
5047 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED4, asc_dvc->sdtr_speed4);
5057 asc_dvc->chip_scsi_id);
5075 asc_dvc->err_code |= ASC_IERR_REVERSED_CABLE;
5091 asc_dvc->err_code = ASC_IERR_HVD_DEVICE;
5103 if ((asc_dvc->cfg->termination & TERM_SE) == 0) {
5110 asc_dvc->cfg->termination |= TERM_SE;
5115 asc_dvc->cfg->termination |= TERM_SE_HI;
5120 if ((asc_dvc->cfg->termination & TERM_LVD) == 0) {
5127 asc_dvc->cfg->termination |= TERM_LVD;
5144 scsi_cfg1 |= (~asc_dvc->cfg->termination & 0xF0);
5185 ADV_TID_TO_TIDMASK(asc_dvc->chip_scsi_id));
5187 AdvBuildCarrierFreelist(asc_dvc);
5193 asc_dvc->icq_sp = adv_get_next_carrier(asc_dvc);
5194 if (!asc_dvc->icq_sp) {
5196 asc_dvc->err_code |= ASC_IERR_NO_CARRIER;
5204 AdvWriteDWordLramNoSwap(iop_base, ASC_MC_ICQ, asc_dvc->icq_sp->carr_pa);
5209 asc_dvc->irq_sp = adv_get_next_carrier(asc_dvc);
5210 if (!asc_dvc->irq_sp) {
5212 asc_dvc->err_code |= ASC_IERR_NO_CARRIER;
5221 AdvWriteDWordLramNoSwap(iop_base, ASC_MC_IRQ, asc_dvc->irq_sp->carr_pa);
5222 asc_dvc->carr_pending_cnt = 0;
5239 if (asc_dvc->bios_ctrl & BIOS_CTRL_RESET_SCSI_BUS) {
5260 if (AdvResetSB(asc_dvc) != ADV_TRUE) {
5279 static int AdvInitAsc38C1600Driver(ADV_DVC_VAR *asc_dvc)
5300 if (asc_dvc->err_code != 0) {
5307 if (asc_dvc->chip_type != ADV_CHIP_ASC38C1600) {
5308 asc_dvc->err_code = ASC_IERR_BAD_CHIPTYPE;
5313 iop_base = asc_dvc->iop_base;
5375 asc_dvc->err_code = ASC_IERR_BIST_PRE_TEST;
5383 asc_dvc->err_code = ASC_IERR_BIST_PRE_TEST;
5401 asc_dvc->bist_err_code = byte; /* for BIOS display message */
5402 asc_dvc->err_code = ASC_IERR_BIST_RAM_TEST;
5409 err = request_firmware(&fw, fwname, asc_dvc->drv_ptr->dev);
5413 asc_dvc->err_code = ASC_IERR_MCODE_CHKSUM;
5420 asc_dvc->err_code = ASC_IERR_MCODE_CHKSUM;
5425 asc_dvc->err_code = AdvLoadMicrocode(iop_base, &fw->data[4],
5429 if (asc_dvc->err_code)
5457 asc_dvc->cfg->mcode_date);
5459 asc_dvc->cfg->mcode_version);
5484 if (asc_dvc->cfg->control_flag & CONTROL_FLAG_IGNORE_PERR) {
5496 if ((asc_dvc->bios_ctrl & BIOS_CTRL_AIPP_DIS) == 0) {
5521 if ((asc_dvc->bios_ctrl & BIOS_CTRL_RESET_SCSI_BUS) == 0) {
5523 asc_dvc->wdtr_able);
5525 asc_dvc->sdtr_able);
5538 asc_dvc->cfg->disc_enable);
5539 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED1, asc_dvc->sdtr_speed1);
5540 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED2, asc_dvc->sdtr_speed2);
5541 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED3, asc_dvc->sdtr_speed3);
5542 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED4, asc_dvc->sdtr_speed4);
5552 asc_dvc->chip_scsi_id);
5571 asc_dvc->err_code |= ASC_IERR_REVERSED_CABLE;
5584 asc_dvc->err_code |= ASC_IERR_HVD_DEVICE;
5601 if ((asc_dvc->cfg->termination & TERM_SE) == 0) {
5602 struct pci_dev *pdev = adv_dvc_to_pdev(asc_dvc);
5609 asc_dvc->cfg->termination |= TERM_SE;
5617 asc_dvc->cfg->termination |= TERM_SE_HI;
5631 scsi_cfg1 |= (~asc_dvc->cfg->termination & TERM_SE);
5682 ADV_TID_TO_TIDMASK(asc_dvc->chip_scsi_id));
5684 AdvBuildCarrierFreelist(asc_dvc);
5689 asc_dvc->icq_sp = adv_get_next_carrier(asc_dvc);
5690 if (!asc_dvc->icq_sp) {
5691 asc_dvc->err_code |= ASC_IERR_NO_CARRIER;
5700 AdvWriteDWordLramNoSwap(iop_base, ASC_MC_ICQ, asc_dvc->icq_sp->carr_pa);
5702 le32_to_cpu(asc_dvc->icq_sp->carr_pa));
5707 asc_dvc->irq_sp = adv_get_next_carrier(asc_dvc);
5708 if (!asc_dvc->irq_sp) {
5709 asc_dvc->err_code |= ASC_IERR_NO_CARRIER;
5716 AdvWriteDWordLramNoSwap(iop_base, ASC_MC_IRQ, asc_dvc->irq_sp->carr_pa);
5717 asc_dvc->carr_pending_cnt = 0;
5733 if (asc_dvc->bios_ctrl & BIOS_CTRL_RESET_SCSI_BUS) {
5754 if (AdvResetSB(asc_dvc) != ADV_TRUE) {
5770 static int AdvResetChipAndSB(ADV_DVC_VAR *asc_dvc)
5779 iop_base = asc_dvc->iop_base;
5786 if (asc_dvc->chip_type == ADV_CHIP_ASC38C1600) {
5817 asc_dvc->err_code = 0;
5818 if (asc_dvc->chip_type == ADV_CHIP_ASC38C1600) {
5819 status = AdvInitAsc38C1600Driver(asc_dvc);
5820 } else if (asc_dvc->chip_type == ADV_CHIP_ASC38C0800) {
5821 status = AdvInitAsc38C0800Driver(asc_dvc);
5823 status = AdvInitAsc3550Driver(asc_dvc);
5843 if (asc_dvc->chip_type == ADV_CHIP_ASC38C1600) {
6046 static int AdvISR(ADV_DVC_VAR *asc_dvc)
6055 iop_base = asc_dvc->iop_base;
6075 if (asc_dvc->chip_type == ADV_CHIP_ASC3550 ||
6076 asc_dvc->chip_type == ADV_CHIP_ASC38C0800) {
6078 asc_dvc->carr_pending_cnt != 0) {
6081 if (asc_dvc->chip_type == ADV_CHIP_ASC3550) {
6089 adv_async_callback(asc_dvc, intrb_code);
6096 le32_to_cpu(asc_dvc->irq_sp->next_vpa)) & ADV_RQ_DONE) != 0) {
6106 u32 pa_offset = le32_to_cpu(asc_dvc->irq_sp->areq_vpa);
6108 asc_dvc->irq_sp, pa_offset);
6109 reqp = adv_get_reqp(asc_dvc, pa_offset);
6128 free_carrp = asc_dvc->irq_sp;
6129 asc_dvc->irq_sp = adv_get_carrier(asc_dvc,
6132 free_carrp->next_vpa = asc_dvc->carr_freelist->carr_va;
6133 asc_dvc->carr_freelist = free_carrp;
6134 asc_dvc->carr_pending_cnt--;
6145 adv_isr_callback(asc_dvc, scsiq);
6157 static int AscSetLibErrorCode(ASC_DVC_VAR *asc_dvc, ushort err_code)
6159 if (asc_dvc->err_code == 0) {
6160 asc_dvc->err_code = err_code;
6161 AscWriteLramWord(asc_dvc->iop_base, ASCV_ASCDVC_ERR_CODE_W,
6196 static uchar AscGetSynPeriodIndex(ASC_DVC_VAR *asc_dvc, uchar syn_time)
6203 period_table = asc_dvc->sdtr_period_tbl;
6204 max_index = (int)asc_dvc->max_sdtr_index;
6205 min_index = (int)asc_dvc->min_sdtr_index;
6219 AscMsgOutSDTR(ASC_DVC_VAR *asc_dvc, uchar sdtr_period, uchar sdtr_offset)
6221 PortAddr iop_base = asc_dvc->iop_base;
6222 uchar sdtr_period_index = AscGetSynPeriodIndex(asc_dvc, sdtr_period);
6232 if (sdtr_period_index <= asc_dvc->max_sdtr_index) {
6247 AscCalSDTRData(ASC_DVC_VAR *asc_dvc, uchar sdtr_period, uchar syn_offset)
6252 sdtr_period_ix = AscGetSynPeriodIndex(asc_dvc, sdtr_period);
6253 if (sdtr_period_ix > asc_dvc->max_sdtr_index)
6294 static void AscIsrChipHalted(ASC_DVC_VAR *asc_dvc)
6315 BUG_ON(!asc_dvc->drv_ptr);
6316 boardp = asc_dvc->drv_ptr;
6318 iop_base = asc_dvc->iop_base;
6330 if (asc_dvc->pci_fix_asyn_xfer & target_id) {
6336 if (asc_dvc->pci_fix_asyn_xfer & target_id) {
6343 if (asc_dvc->pci_fix_asyn_xfer & target_id) {
6365 asc_dvc->sdtr_period_tbl[asc_dvc->min_sdtr_index])
6367 asc_dvc->sdtr_period_tbl[asc_dvc->
6371 asc_dvc->sdtr_period_tbl[asc_dvc->
6376 AscCalSDTRData(asc_dvc, ext_msg.xfer_period,
6381 asc_dvc->init_sdtr &= ~target_id;
6382 asc_dvc->sdtr_done &= ~target_id;
6391 asc_dvc->init_sdtr &= ~target_id;
6392 asc_dvc->sdtr_done &= ~target_id;
6397 asc_dvc->sdtr_done |= target_id;
6398 asc_dvc->init_sdtr |= target_id;
6399 asc_dvc->pci_fix_asyn_xfer &=
6402 AscCalSDTRData(asc_dvc,
6411 AscMsgOutSDTR(asc_dvc,
6414 asc_dvc->pci_fix_asyn_xfer &=
6417 AscCalSDTRData(asc_dvc,
6424 asc_dvc->sdtr_done |= target_id;
6425 asc_dvc->init_sdtr |= target_id;
6470 if ((asc_dvc->init_sdtr & target_id) != 0) {
6472 asc_dvc->sdtr_done &= ~target_id;
6476 AscMsgOutSDTR(asc_dvc,
6477 asc_dvc->
6479 (uchar)(asc_dvc->
6494 if ((asc_dvc->pci_fix_asyn_xfer & target_id)
6495 && !(asc_dvc->pci_fix_asyn_xfer_always & target_id)
6533 asc_dvc->init_sdtr &= ~target_id;
6534 asc_dvc->sdtr_done &= ~target_id;
6554 if ((cur_dvc_qng > 0) && (asc_dvc->cur_dvc_qng[tid_no] > 0)) {
6561 asc_dvc->queue_full_or_busy |= target_id;
6566 asc_dvc->max_dvc_qng[tid_no] =
6764 static int AscIsrQDone(ASC_DVC_VAR *asc_dvc)
6783 iop_base = asc_dvc->iop_base;
6794 asc_dvc->max_dma_count);
6813 AscSetLibErrorCode(asc_dvc,
6828 if (asc_dvc->queue_full_or_busy & target_id) {
6835 if (cur_target_qng < asc_dvc->max_dvc_qng[tid_no]) {
6842 asc_dvc->queue_full_or_busy &= ~target_id;
6845 if (asc_dvc->cur_total_qng >= n_q_used) {
6846 asc_dvc->cur_total_qng -= n_q_used;
6847 if (asc_dvc->cur_dvc_qng[tid_no] != 0) {
6848 asc_dvc->cur_dvc_qng[tid_no]--;
6851 AscSetLibErrorCode(asc_dvc, ASCQ_ERR_CUR_QNG);
6898 asc_isr_callback(asc_dvc, scsiq);
6904 asc_dvc->unit_not_ready &= ~target_id;
6906 asc_dvc->start_motor &=
6913 AscSetLibErrorCode(asc_dvc, ASCQ_ERR_Q_STATUS);
6916 asc_isr_callback(asc_dvc, scsiq);
6924 static int AscISR(ASC_DVC_VAR *asc_dvc)
6935 iop_base = asc_dvc->iop_base;
6941 if ((asc_dvc->init_state & ASC_INIT_STATE_END_LOAD_MC) == 0) {
6944 if (asc_dvc->in_critical_cnt != 0) {
6945 AscSetLibErrorCode(asc_dvc, ASCQ_ERR_ISR_ON_CRITICAL);
6948 if (asc_dvc->is_in_int) {
6949 AscSetLibErrorCode(asc_dvc, ASCQ_ERR_ISR_RE_ENTRY);
6952 asc_dvc->is_in_int = true;
6958 if (!(asc_dvc->bus_type & (ASC_IS_VL | ASC_IS_EISA))) {
6961 asc_dvc->sdtr_done = 0;
6984 AscIsrChipHalted(asc_dvc);
6987 if ((asc_dvc->dvc_cntl & ASC_CNTL_INT_MULTI_Q) != 0) {
6989 AscIsrQDone(asc_dvc)) & 0x01) != 0) {
6994 AscIsrQDone(asc_dvc)) == 1) {
7006 asc_dvc->is_in_int = false;
7034 ASC_DVC_VAR *asc_dvc = &boardp->dvc_var.asc_dvc_var;
7038 status = AscInitAsc1000Driver(asc_dvc);
7041 if (asc_dvc->err_code || !asc_dvc->overrun_dma) {
7043 "0x%x, status: 0x%x\n", asc_dvc->err_code,
7198 static void AscAsyncFix(ASC_DVC_VAR *asc_dvc, struct scsi_device *sdev)
7203 if (!(asc_dvc->bug_fix_cntl & ASC_BUG_FIX_ASYN_USE_SYN))
7205 if (asc_dvc->init_sdtr & tid_bits)
7209 asc_dvc->pci_fix_asyn_xfer_always |= tid_bits;
7211 asc_dvc->pci_fix_asyn_xfer |= tid_bits;
7214 asc_dvc->pci_fix_asyn_xfer &= ~tid_bits;
7216 if (asc_dvc->pci_fix_asyn_xfer & tid_bits)
7217 AscSetRunChipSynRegAtID(asc_dvc->iop_base, sdev->id,
7222 advansys_narrow_slave_configure(struct scsi_device *sdev, ASC_DVC_VAR *asc_dvc)
7225 ASC_SCSI_BIT_ID_TYPE orig_use_tagged_qng = asc_dvc->use_tagged_qng;
7228 ASC_SCSI_BIT_ID_TYPE orig_init_sdtr = asc_dvc->init_sdtr;
7229 if ((asc_dvc->cfg->sdtr_enable & tid_bit) && sdev->sdtr) {
7230 asc_dvc->init_sdtr |= tid_bit;
7232 asc_dvc->init_sdtr &= ~tid_bit;
7235 if (orig_init_sdtr != asc_dvc->init_sdtr)
7236 AscAsyncFix(asc_dvc, sdev);
7240 if (asc_dvc->cfg->cmd_qng_enabled & tid_bit) {
7242 asc_dvc->cfg->can_tagged_qng |= tid_bit;
7243 asc_dvc->use_tagged_qng |= tid_bit;
7246 asc_dvc->max_dvc_qng[sdev->id]);
7250 asc_dvc->cfg->can_tagged_qng &= ~tid_bit;
7251 asc_dvc->use_tagged_qng &= ~tid_bit;
7256 (orig_use_tagged_qng != asc_dvc->use_tagged_qng)) {
7257 AscWriteLramByte(asc_dvc->iop_base, ASCV_DISC_ENABLE_B,
7258 asc_dvc->cfg->disc_enable);
7259 AscWriteLramByte(asc_dvc->iop_base, ASCV_USE_TAGGED_QNG_B,
7260 asc_dvc->use_tagged_qng);
7261 AscWriteLramByte(asc_dvc->iop_base, ASCV_CAN_TAGGED_QNG_B,
7262 asc_dvc->cfg->can_tagged_qng);
7264 asc_dvc->max_dvc_qng[sdev->id] =
7265 asc_dvc->cfg->max_tag_qng[sdev->id];
7266 AscWriteLramByte(asc_dvc->iop_base,
7268 asc_dvc->max_dvc_qng[sdev->id]);
7425 struct asc_dvc_var *asc_dvc = &boardp->dvc_var.asc_dvc_var;
7463 if ((asc_dvc->cur_dvc_qng[scp->device->id] > 0) &&
7779 AscGetNumOfFreeQueue(ASC_DVC_VAR *asc_dvc, uchar target_ix, uchar n_qs)
7788 if ((asc_dvc->unit_not_ready & target_id) ||
7789 (asc_dvc->queue_full_or_busy & target_id)) {
7793 cur_used_qs = (uint) asc_dvc->cur_total_qng +
7794 (uint) asc_dvc->last_q_shortage + (uint) ASC_MIN_FREE_Q;
7796 cur_used_qs = (uint) asc_dvc->cur_total_qng +
7799 if ((uint) (cur_used_qs + n_qs) <= (uint) asc_dvc->max_total_qng) {
7800 cur_free_qs = (uint) asc_dvc->max_total_qng - cur_used_qs;
7801 if (asc_dvc->cur_dvc_qng[tid_no] >=
7802 asc_dvc->max_dvc_qng[tid_no]) {
7808 if ((n_qs > asc_dvc->last_q_shortage)
7809 && (n_qs <= (asc_dvc->max_total_qng - ASC_MIN_FREE_Q))) {
7810 asc_dvc->last_q_shortage = n_qs;
7871 static int AscPutReadyQueue(ASC_DVC_VAR *asc_dvc, ASC_SCSI_Q *scsiq, uchar q_no)
7880 iop_base = asc_dvc->iop_base;
7881 if (((asc_dvc->init_sdtr & scsiq->q1.target_id) != 0) &&
7882 ((asc_dvc->sdtr_done & scsiq->q1.target_id) == 0)) {
7886 (sdtr_data >> 4) & (asc_dvc->max_sdtr_index - 1);
7888 AscMsgOutSDTR(asc_dvc,
7889 asc_dvc->sdtr_period_tbl[syn_period_ix],
7894 if ((scsiq->q1.target_id & asc_dvc->use_tagged_qng) == 0) {
7914 AscPutReadySgListQueue(ASC_DVC_VAR *asc_dvc, ASC_SCSI_Q *scsiq, uchar q_no)
7929 iop_base = asc_dvc->iop_base;
8000 sta = AscPutReadyQueue(asc_dvc, scsiq, q_no);
8007 AscSendScsiQueue(ASC_DVC_VAR *asc_dvc, ASC_SCSI_Q *scsiq, uchar n_q_required)
8016 iop_base = asc_dvc->iop_base;
8025 asc_dvc->last_q_shortage = 0;
8028 sta = AscPutReadySgListQueue(asc_dvc, scsiq,
8035 sta = AscPutReadyQueue(asc_dvc, scsiq, free_q_head);
8040 asc_dvc->cur_total_qng += n_q_required;
8041 asc_dvc->cur_dvc_qng[tid_no]++;
8066 static int AscExeScsiQueue(ASC_DVC_VAR *asc_dvc, ASC_SCSI_Q *scsiq)
8085 iop_base = asc_dvc->iop_base;
8087 if (asc_dvc->err_code != 0)
8098 if ((asc_dvc->init_sdtr & scsiq->q1.target_id) != 0) {
8099 asc_dvc->sdtr_done &= ~scsiq->q1.target_id;
8101 AscMsgOutSDTR(asc_dvc,
8102 asc_dvc->
8104 (uchar)(asc_dvc->
8112 if (asc_dvc->in_critical_cnt != 0) {
8113 AscSetLibErrorCode(asc_dvc, ASCQ_ERR_CRITICAL_RE_ENTRY);
8116 asc_dvc->in_critical_cnt++;
8119 asc_dvc->in_critical_cnt--;
8123 asc_dvc->in_critical_cnt--;
8135 if ((asc_dvc->pci_fix_asyn_xfer & scsiq->q1.target_id) &&
8136 !(asc_dvc->pci_fix_asyn_xfer_always & scsiq->q1.target_id)) {
8174 if (asc_dvc->bug_fix_cntl) {
8175 if (asc_dvc->bug_fix_cntl & ASC_BUG_FIX_IF_NOT_DWB) {
8215 if ((AscGetNumOfFreeQueue(asc_dvc, target_ix, n_q_required) >=
8219 AscSendScsiQueue(asc_dvc, scsiq,
8221 asc_dvc->in_critical_cnt--;
8226 if (asc_dvc->bug_fix_cntl) {
8227 if (asc_dvc->bug_fix_cntl & ASC_BUG_FIX_IF_NOT_DWB) {
8260 if ((AscGetNumOfFreeQueue(asc_dvc, target_ix, 1) >= 1) ||
8262 if ((sta = AscSendScsiQueue(asc_dvc, scsiq,
8264 asc_dvc->in_critical_cnt--;
8269 asc_dvc->in_critical_cnt--;
8294 static int AdvExeScsiQueue(ADV_DVC_VAR *asc_dvc, adv_req_t *reqp)
8309 iop_base = asc_dvc->iop_base;
8315 new_carrp = adv_get_next_carrier(asc_dvc);
8321 asc_dvc->carr_pending_cnt++;
8327 scsiq->carr_va = asc_dvc->icq_sp->carr_va;
8328 scsiq->carr_pa = asc_dvc->icq_sp->carr_pa;
8335 asc_dvc->icq_sp->areq_vpa = scsiq->scsiq_rptr;
8342 asc_dvc->icq_sp->next_vpa = new_carrp->carr_pa;
8347 asc_dvc->icq_sp = new_carrp;
8349 if (asc_dvc->chip_type == ADV_CHIP_ASC3550 ||
8350 asc_dvc->chip_type == ADV_CHIP_ASC38C0800) {
8355 if (asc_dvc->chip_type == ADV_CHIP_ASC3550) {
8364 } else if (asc_dvc->chip_type == ADV_CHIP_ASC38C1600) {
8387 ASC_DVC_VAR *asc_dvc = &boardp->dvc_var.asc_dvc_var;
8396 ret = AscExeScsiQueue(asc_dvc, &asc_scsi_q);
8398 err_code = asc_dvc->err_code;
8591 static void AscInitAscDvcVar(ASC_DVC_VAR *asc_dvc)
8597 iop_base = asc_dvc->iop_base;
8598 asc_dvc->err_code = 0;
8599 if ((asc_dvc->bus_type &
8601 asc_dvc->err_code |= ASC_IERR_NO_BUS_TYPE;
8605 asc_dvc->bug_fix_cntl = 0;
8606 asc_dvc->pci_fix_asyn_xfer = 0;
8607 asc_dvc->pci_fix_asyn_xfer_always = 0;
8608 /* asc_dvc->init_state initialized in AscInitGetConfig(). */
8609 asc_dvc->sdtr_done = 0;
8610 asc_dvc->cur_total_qng = 0;
8611 asc_dvc->is_in_int = false;
8612 asc_dvc->in_critical_cnt = 0;
8613 asc_dvc->last_q_shortage = 0;
8614 asc_dvc->use_tagged_qng = 0;
8615 asc_dvc->no_scam = 0;
8616 asc_dvc->unit_not_ready = 0;
8617 asc_dvc->queue_full_or_busy = 0;
8618 asc_dvc->redo_scam = 0;
8619 asc_dvc->res2 = 0;
8620 asc_dvc->min_sdtr_index = 0;
8621 asc_dvc->cfg->can_tagged_qng = 0;
8622 asc_dvc->cfg->cmd_qng_enabled = 0;
8623 asc_dvc->dvc_cntl = ASC_DEF_DVC_CNTL;
8624 asc_dvc->init_sdtr = 0;
8625 asc_dvc->max_total_qng = ASC_DEF_MAX_TOTAL_QNG;
8626 asc_dvc->scsi_reset_wait = 3;
8627 asc_dvc->start_motor = ASC_SCSI_WIDTH_BIT_SET;
8628 asc_dvc->max_dma_count = AscGetMaxDmaCount(asc_dvc->bus_type);
8629 asc_dvc->cfg->sdtr_enable = ASC_SCSI_WIDTH_BIT_SET;
8630 asc_dvc->cfg->disc_enable = ASC_SCSI_WIDTH_BIT_SET;
8631 asc_dvc->cfg->chip_scsi_id = ASC_DEF_CHIP_SCSI_ID;
8632 chip_version = AscGetChipVersion(iop_base, asc_dvc->bus_type);
8633 asc_dvc->cfg->chip_version = chip_version;
8634 asc_dvc->sdtr_period_tbl = asc_syn_xfer_period;
8635 asc_dvc->max_sdtr_index = 7;
8636 if ((asc_dvc->bus_type & ASC_IS_PCI) &&
8638 asc_dvc->bus_type = ASC_IS_PCI_ULTRA;
8639 asc_dvc->sdtr_period_tbl = asc_syn_ultra_xfer_period;
8640 asc_dvc->max_sdtr_index = 15;
8650 if (asc_dvc->bus_type == ASC_IS_PCI) {
8656 asc_dvc->cur_dvc_qng[i] = 0;
8657 asc_dvc->max_dvc_qng[i] = ASC_MAX_SCSI1_QNG;
8658 asc_dvc->scsiq_busy_head[i] = (ASC_SCSI_Q *)0L;
8659 asc_dvc->scsiq_busy_tail[i] = (ASC_SCSI_Q *)0L;
8660 asc_dvc->cfg->max_tag_qng[i] = ASC_MAX_INRAM_TAG_QNG;
8746 static int AscTestExternalLram(ASC_DVC_VAR *asc_dvc)
8753 iop_base = asc_dvc->iop_base;
8927 static int AscInitFromEEP(ASC_DVC_VAR *asc_dvc)
8938 iop_base = asc_dvc->iop_base;
8944 asc_dvc->init_state |= ASC_INIT_RESET_SCSI_DONE;
8945 AscResetChipAndScsiBus(asc_dvc);
8946 mdelay(asc_dvc->scsi_reset_wait * 1000); /* XXX: msleep? */
8949 asc_dvc->err_code |= ASC_IERR_START_STOP_CHIP;
8954 asc_dvc->err_code |= ASC_IERR_SET_PC_ADDR;
8965 chksum = AscGetEEPConfig(iop_base, eep_config, asc_dvc->bus_type);
8972 if (asc_dvc->cfg->chip_version == 3) {
8989 if (AscGetChipVersion(iop_base, asc_dvc->bus_type) ==
9015 asc_dvc->cfg->sdtr_enable = eep_config->init_sdtr;
9016 asc_dvc->cfg->disc_enable = eep_config->disc_enable;
9017 asc_dvc->cfg->cmd_qng_enabled = eep_config->use_cmd_qng;
9018 asc_dvc->start_motor = eep_config->start_motor;
9019 asc_dvc->dvc_cntl = eep_config->cntl;
9020 asc_dvc->no_scam = eep_config->no_scam;
9021 asc_dvc->cfg->adapter_info[0] = eep_config->adapter_info[0];
9022 asc_dvc->cfg->adapter_info[1] = eep_config->adapter_info[1];
9023 asc_dvc->cfg->adapter_info[2] = eep_config->adapter_info[2];
9024 asc_dvc->cfg->adapter_info[3] = eep_config->adapter_info[3];
9025 asc_dvc->cfg->adapter_info[4] = eep_config->adapter_info[4];
9026 asc_dvc->cfg->adapter_info[5] = eep_config->adapter_info[5];
9027 if (!AscTestExternalLram(asc_dvc)) {
9028 if (((asc_dvc->bus_type & ASC_IS_PCI_ULTRA) ==
9055 asc_dvc->max_total_qng = eep_config->max_total_qng;
9063 asc_dvc->cfg->chip_scsi_id = ASC_EEP_GET_CHIP_ID(eep_config);
9064 if (((asc_dvc->bus_type & ASC_IS_PCI_ULTRA) == ASC_IS_PCI_ULTRA) &&
9065 !(asc_dvc->dvc_cntl & ASC_CNTL_SDTR_ENABLE_ULTRA)) {
9066 asc_dvc->min_sdtr_index = ASC_SDTR_ULTRA_PCI_10MB_INDEX;
9070 asc_dvc->dos_int13_table[i] = eep_config->dos_int13_table[i];
9071 asc_dvc->cfg->max_tag_qng[i] = eep_config->max_tag_qng;
9072 asc_dvc->cfg->sdtr_period_offset[i] =
9074 (asc_dvc->min_sdtr_index << 4));
9079 asc_dvc->bus_type)) != 0) {
9094 ASC_DVC_VAR *asc_dvc = &board->dvc_var.asc_dvc_var;
9097 asc_dvc->init_state = ASC_INIT_STATE_BEG_GET_CFG;
9098 if (asc_dvc->err_code != 0)
9099 return asc_dvc->err_code;
9101 if (AscFindSignature(asc_dvc->iop_base)) {
9102 AscInitAscDvcVar(asc_dvc);
9103 warn_code = AscInitFromEEP(asc_dvc);
9104 asc_dvc->init_state |= ASC_INIT_STATE_END_GET_CFG;
9105 if (asc_dvc->scsi_reset_wait > ASC_MAX_SCSI_RESET_WAIT)
9106 asc_dvc->scsi_reset_wait = ASC_MAX_SCSI_RESET_WAIT;
9108 asc_dvc->err_code = ASC_IERR_BAD_SIGNATURE;
9138 if (asc_dvc->err_code != 0)
9140 "0x%x\n", asc_dvc->err_code, asc_dvc->init_state);
9142 return asc_dvc->err_code;
9148 ASC_DVC_VAR *asc_dvc = &board->dvc_var.asc_dvc_var;
9149 PortAddr iop_base = asc_dvc->iop_base;
9153 asc_dvc->init_state |= ASC_INIT_STATE_BEG_SET_CFG;
9154 if (asc_dvc->err_code != 0)
9155 return asc_dvc->err_code;
9156 if (!AscFindSignature(asc_dvc->iop_base)) {
9157 asc_dvc->err_code = ASC_IERR_BAD_SIGNATURE;
9158 return asc_dvc->err_code;
9167 if ((asc_dvc->cfg->cmd_qng_enabled & asc_dvc->cfg->disc_enable) !=
9168 asc_dvc->cfg->cmd_qng_enabled) {
9169 asc_dvc->cfg->disc_enable = asc_dvc->cfg->cmd_qng_enabled;
9176 if (asc_dvc->bus_type & ASC_IS_PCI) {
9179 if ((asc_dvc->bus_type & ASC_IS_PCI_ULTRA) == ASC_IS_PCI_ULTRA) {
9183 asc_dvc->bug_fix_cntl |= ASC_BUG_FIX_IF_NOT_DWB;
9184 asc_dvc->bug_fix_cntl |=
9190 if (AscSetChipScsiID(iop_base, asc_dvc->cfg->chip_scsi_id) !=
9191 asc_dvc->cfg->chip_scsi_id) {
9192 asc_dvc->err_code |= ASC_IERR_SET_SCSI_ID;
9195 asc_dvc->init_state |= ASC_INIT_STATE_END_SET_CFG;
9224 if (asc_dvc->err_code != 0)
9226 "0x%x\n", asc_dvc->err_code, asc_dvc->init_state);
9228 return asc_dvc->err_code;
9956 static int AdvInitFrom3550EEP(ADV_DVC_VAR *asc_dvc)
9962 iop_base = asc_dvc->iop_base;
10001 asc_dvc->wdtr_able = eep_config.wdtr_able;
10002 asc_dvc->sdtr_able = eep_config.sdtr_able;
10003 asc_dvc->ultra_able = eep_config.ultra_able;
10004 asc_dvc->tagqng_able = eep_config.tagqng_able;
10005 asc_dvc->cfg->disc_enable = eep_config.disc_enable;
10006 asc_dvc->max_host_qng = eep_config.max_host_qng;
10007 asc_dvc->max_dvc_qng = eep_config.max_dvc_qng;
10008 asc_dvc->chip_scsi_id = (eep_config.adapter_scsi_id & ADV_MAX_TID);
10009 asc_dvc->start_motor = eep_config.start_motor;
10010 asc_dvc->scsi_reset_wait = eep_config.scsi_reset_delay;
10011 asc_dvc->bios_ctrl = eep_config.bios_ctrl;
10012 asc_dvc->no_scam = eep_config.scam_tolerant;
10013 asc_dvc->cfg->serial1 = eep_config.serial_number_word1;
10014 asc_dvc->cfg->serial2 = eep_config.serial_number_word2;
10015 asc_dvc->cfg->serial3 = eep_config.serial_number_word3;
10055 asc_dvc->max_host_qng = eep_config.max_host_qng;
10056 asc_dvc->max_dvc_qng = eep_config.max_dvc_qng;
10067 asc_dvc->cfg->termination = 0; /* auto termination */
10071 asc_dvc->cfg->termination = TERM_CTL_SEL;
10075 asc_dvc->cfg->termination = TERM_CTL_SEL | TERM_CTL_H;
10079 asc_dvc->cfg->termination =
10086 asc_dvc->cfg->termination = 0;
10106 static int AdvInitFrom38C0800EEP(ADV_DVC_VAR *asc_dvc)
10114 iop_base = asc_dvc->iop_base;
10154 asc_dvc->wdtr_able = eep_config.wdtr_able;
10155 asc_dvc->sdtr_speed1 = eep_config.sdtr_speed1;
10156 asc_dvc->sdtr_speed2 = eep_config.sdtr_speed2;
10157 asc_dvc->sdtr_speed3 = eep_config.sdtr_speed3;
10158 asc_dvc->sdtr_speed4 = eep_config.sdtr_speed4;
10159 asc_dvc->tagqng_able = eep_config.tagqng_able;
10160 asc_dvc->cfg->disc_enable = eep_config.disc_enable;
10161 asc_dvc->max_host_qng = eep_config.max_host_qng;
10162 asc_dvc->max_dvc_qng = eep_config.max_dvc_qng;
10163 asc_dvc->chip_scsi_id = (eep_config.adapter_scsi_id & ADV_MAX_TID);
10164 asc_dvc->start_motor = eep_config.start_motor;
10165 asc_dvc->scsi_reset_wait = eep_config.scsi_reset_delay;
10166 asc_dvc->bios_ctrl = eep_config.bios_ctrl;
10167 asc_dvc->no_scam = eep_config.scam_tolerant;
10168 asc_dvc->cfg->serial1 = eep_config.serial_number_word1;
10169 asc_dvc->cfg->serial2 = eep_config.serial_number_word2;
10170 asc_dvc->cfg->serial3 = eep_config.serial_number_word3;
10176 asc_dvc->sdtr_able = 0;
10179 sdtr_speed = asc_dvc->sdtr_speed1;
10181 sdtr_speed = asc_dvc->sdtr_speed2;
10183 sdtr_speed = asc_dvc->sdtr_speed3;
10185 sdtr_speed = asc_dvc->sdtr_speed4;
10188 asc_dvc->sdtr_able |= (1 << tid);
10231 asc_dvc->max_host_qng = eep_config.max_host_qng;
10232 asc_dvc->max_dvc_qng = eep_config.max_dvc_qng;
10267 asc_dvc->cfg->termination = termination; /* auto termination for LVD */
10271 asc_dvc->cfg->termination = termination;
10275 asc_dvc->cfg->termination = termination | TERM_LVD_HI;
10279 asc_dvc->cfg->termination = termination | TERM_LVD;
10285 asc_dvc->cfg->termination = termination;
10305 static int AdvInitFrom38C1600EEP(ADV_DVC_VAR *asc_dvc)
10313 iop_base = asc_dvc->iop_base;
10324 struct pci_dev *pdev = adv_dvc_to_pdev(asc_dvc);
10380 asc_dvc->wdtr_able = eep_config.wdtr_able;
10381 asc_dvc->sdtr_speed1 = eep_config.sdtr_speed1;
10382 asc_dvc->sdtr_speed2 = eep_config.sdtr_speed2;
10383 asc_dvc->sdtr_speed3 = eep_config.sdtr_speed3;
10384 asc_dvc->sdtr_speed4 = eep_config.sdtr_speed4;
10385 asc_dvc->ppr_able = 0;
10386 asc_dvc->tagqng_able = eep_config.tagqng_able;
10387 asc_dvc->cfg->disc_enable = eep_config.disc_enable;
10388 asc_dvc->max_host_qng = eep_config.max_host_qng;
10389 asc_dvc->max_dvc_qng = eep_config.max_dvc_qng;
10390 asc_dvc->chip_scsi_id = (eep_config.adapter_scsi_id & ASC_MAX_TID);
10391 asc_dvc->start_motor = eep_config.start_motor;
10392 asc_dvc->scsi_reset_wait = eep_config.scsi_reset_delay;
10393 asc_dvc->bios_ctrl = eep_config.bios_ctrl;
10394 asc_dvc->no_scam = eep_config.scam_tolerant;
10400 asc_dvc->sdtr_able = 0;
10403 sdtr_speed = asc_dvc->sdtr_speed1;
10405 sdtr_speed = asc_dvc->sdtr_speed2;
10407 sdtr_speed = asc_dvc->sdtr_speed3;
10409 sdtr_speed = asc_dvc->sdtr_speed4;
10412 asc_dvc->sdtr_able |= (1 << tid);
10455 asc_dvc->max_host_qng = eep_config.max_host_qng;
10456 asc_dvc->max_dvc_qng = eep_config.max_dvc_qng;
10491 asc_dvc->cfg->termination = termination; /* auto termination for LVD */
10495 asc_dvc->cfg->termination = termination;
10499 asc_dvc->cfg->termination = termination | TERM_LVD_HI;
10503 asc_dvc->cfg->termination = termination | TERM_LVD;
10509 asc_dvc->cfg->termination = termination;
10528 ADV_DVC_VAR *asc_dvc = &board->dvc_var.adv_dvc_var;
10530 AdvPortAddr iop_base = asc_dvc->iop_base;
10534 asc_dvc->err_code = 0;
10542 asc_dvc->cfg->control_flag = 0;
10545 asc_dvc->cfg->control_flag |= CONTROL_FLAG_IGNORE_PERR;
10547 asc_dvc->cfg->chip_version =
10548 AdvGetChipVersion(iop_base, asc_dvc->bus_type);
10562 asc_dvc->err_code = ASC_IERR_BAD_SIGNATURE;
10568 if (asc_dvc->chip_type != ADV_CHIP_ASC3550 &&
10569 asc_dvc->chip_type != ADV_CHIP_ASC38C0800 &&
10570 asc_dvc->chip_type != ADV_CHIP_ASC38C1600) {
10571 asc_dvc->err_code |= ASC_IERR_BAD_CHIPTYPE;
10584 if (asc_dvc->chip_type == ADV_CHIP_ASC38C1600) {
10585 status = AdvInitFrom38C1600EEP(asc_dvc);
10586 } else if (asc_dvc->chip_type == ADV_CHIP_ASC38C0800) {
10587 status = AdvInitFrom38C0800EEP(asc_dvc);
10589 status = AdvInitFrom3550EEP(asc_dvc);
10597 if (asc_dvc->err_code)
10599 asc_dvc->err_code);
10601 return asc_dvc->err_code;