Lines Matching refs:tp
1937 static void ncr_negotiate (struct ncb* np, struct tcb* tp);
3972 struct tcb *tp = &np->target[i]; in ncr_prepare_setting() local
3974 tp->usrsync = driver_setup.default_sync; in ncr_prepare_setting()
3975 tp->usrwide = driver_setup.max_wide; in ncr_prepare_setting()
3976 tp->usrtags = MAX_TAGS; in ncr_prepare_setting()
3977 tp->period = 0xffff; in ncr_prepare_setting()
4062 struct tcb *tp = &np->target[cp->target]; in ncr_prepare_nego() local
4065 struct scsi_target *starget = tp->starget; in ncr_prepare_nego()
4068 if (!tp->widedone) { in ncr_prepare_nego()
4072 tp->widedone=1; in ncr_prepare_nego()
4076 if (!nego && !tp->period) { in ncr_prepare_nego()
4080 tp->period =0xffff; in ncr_prepare_nego()
4088 tp->maxoffs ? tp->minsync : 0, tp->maxoffs); in ncr_prepare_nego()
4091 msglen += spi_populate_width_msg(msgptr + msglen, tp->usrwide); in ncr_prepare_nego()
4098 tp->nego_cp = cp; in ncr_prepare_nego()
4122 struct tcb *tp = &np->target[sdev->id]; in ncr_queue_command() local
4123 struct lcb *lp = tp->lp[sdev->lun]; in ncr_queue_command()
4154 (tp->usrflag & UF_NOSCAN)) { in ncr_queue_command()
4155 tp->usrflag &= ~UF_NOSCAN; in ncr_queue_command()
4195 (cp != np->ccb && np->disc && !(tp->usrflag & UF_NODISC))) in ncr_queue_command()
4275 if ((!tp->widedone || !tp->period) && !tp->nego_cp && lp) { in ncr_queue_command()
4363 cp->phys.select.sel_scntl3 = tp->wval; in ncr_queue_command()
4364 cp->phys.select.sel_sxfer = tp->sval; in ncr_queue_command()
4388 cp->sync_status = tp->sval; in ncr_queue_command()
4389 cp->wide_status = tp->wval; in ncr_queue_command()
4707 struct tcb *tp; in ncr_detach() local
4781 tp=&np->target[target]; in ncr_detach()
4783 lp = tp->lp[lun]; in ncr_detach()
4819 struct tcb *tp; in ncr_complete() local
4843 tp = &np->target[cmd->device->id]; in ncr_complete()
4844 lp = tp->lp[cmd->device->lun]; in ncr_complete()
4852 if (cp == tp->nego_cp) in ncr_complete()
4853 tp->nego_cp = NULL; in ncr_complete()
4940 tp->bytes += cp->data_len; in ncr_complete()
4941 tp->transfers ++; in ncr_complete()
5029 if (tp->usrflag & UF_TRACE) { in ncr_complete()
5094 struct tcb *tp = &np->target[cp->target]; in ncr_ccb_skipped() local
5095 struct lcb *lp = tp->lp[cp->lun]; in ncr_ccb_skipped()
5326 struct tcb *tp = &np->target[i]; in ncr_init() local
5328 tp->sval = 0; in ncr_init()
5329 tp->wval = np->rv_scntl3; in ncr_init()
5331 if (tp->usrsync != 255) { in ncr_init()
5332 if (tp->usrsync <= np->maxsync) { in ncr_init()
5333 if (tp->usrsync < np->minsync) { in ncr_init()
5334 tp->usrsync = np->minsync; in ncr_init()
5338 tp->usrsync = 255; in ncr_init()
5341 if (tp->usrwide > np->maxwide) in ncr_init()
5342 tp->usrwide = np->maxwide; in ncr_init()
5368 static void ncr_negotiate (struct ncb* np, struct tcb* tp) in ncr_negotiate() argument
5374 u_long minsync = tp->usrsync; in ncr_negotiate()
5398 if (tp->maxoffs > np->maxoffs) in ncr_negotiate()
5399 tp->maxoffs = np->maxoffs; in ncr_negotiate()
5401 tp->minsync = minsync; in ncr_negotiate()
5402 tp->maxoffs = (minsync<255 ? tp->maxoffs : 0); in ncr_negotiate()
5408 tp->period=0; in ncr_negotiate()
5413 tp->widedone=0; in ncr_negotiate()
5498 struct tcb *tp = &np->target[target]; in ncr_set_sync_wide_status() local
5503 OUTB (nc_sxfer, tp->sval); in ncr_set_sync_wide_status()
5504 np->sync_st = tp->sval; in ncr_set_sync_wide_status()
5505 OUTB (nc_scntl3, tp->wval); in ncr_set_sync_wide_status()
5506 np->wide_st = tp->wval; in ncr_set_sync_wide_status()
5515 cp->sync_status = tp->sval; in ncr_set_sync_wide_status()
5516 cp->wide_status = tp->wval; in ncr_set_sync_wide_status()
5518 cp->phys.select.sel_scntl3 = tp->wval; in ncr_set_sync_wide_status()
5519 cp->phys.select.sel_sxfer = tp->sval; in ncr_set_sync_wide_status()
5533 struct tcb *tp; in ncr_setsync() local
5539 tp = &np->target[target]; in ncr_setsync()
5543 scntl3 = (scntl3 & 0xf0) | (tp->wval & EWS) | (np->rv_scntl3 & 0x07); in ncr_setsync()
5552 tp->period = (((sxfer>>5)+4)*div_10M[idiv-1])/np->clock_khz; in ncr_setsync()
5554 tp->period = 0xffff; in ncr_setsync()
5557 if (tp->sval == sxfer && tp->wval == scntl3) in ncr_setsync()
5559 tp->sval = sxfer; in ncr_setsync()
5560 tp->wval = scntl3; in ncr_setsync()
5564 if (tp->period <= 2000) in ncr_setsync()
5568 spi_display_xfer_agreement(tp->starget); in ncr_setsync()
5591 struct tcb *tp; in ncr_setwide() local
5597 tp = &np->target[target]; in ncr_setwide()
5598 tp->widedone = wide+1; in ncr_setwide()
5599 scntl3 = (tp->wval & (~EWS)) | (wide ? EWS : 0); in ncr_setwide()
5601 sxfer = ack ? 0 : tp->sval; in ncr_setwide()
5606 if (tp->sval == sxfer && tp->wval == scntl3) return; in ncr_setwide()
5607 tp->sval = sxfer; in ncr_setwide()
5608 tp->wval = scntl3; in ncr_setwide()
5635 struct tcb *tp = &np->target[tn]; in ncr_setup_tags() local
5636 struct lcb *lp = tp->lp[ln]; in ncr_setup_tags()
5642 if ((!tp) || (!lp) || !sdev) in ncr_setup_tags()
6544 struct tcb *tp = &np->target[cmd->device->id]; in ncr_sir_to_redo() local
6545 struct lcb *lp = tp->lp[cmd->device->lun]; in ncr_sir_to_redo()
6700 struct tcb *tp = &np->target[target]; in ncr_int_sir() local
6701 struct scsi_target *starget = tp->starget; in ncr_int_sir()
6725 if (tp->lp[0]) { in ncr_int_sir()
6726 OUTL_DSP (scr_to_cpu(tp->lp[0]->jump_ccb[0])); in ncr_int_sir()
6899 if (per < tp->minsync) in ncr_int_sir()
6900 {chg = 1; per = tp->minsync;} in ncr_int_sir()
6901 if (ofs > tp->maxoffs) in ncr_int_sir()
6902 {chg = 1; ofs = tp->maxoffs;} in ncr_int_sir()
6920 tp->minsync = 0; in ncr_int_sir()
7007 if (wide > tp->usrwide) in ncr_int_sir()
7008 {chg = 1; wide = tp->usrwide;} in ncr_int_sir()
7147 struct tcb *tp = &np->target[tn]; in ncr_get_ccb() local
7148 struct lcb *lp = tp->lp[ln]; in ncr_get_ccb()
7256 struct tcb *tp = &np->target[cp->target]; in ncr_free_ccb() local
7257 struct lcb *lp = tp->lp[cp->lun]; in ncr_free_ccb()
7357 struct tcb *tp = &np->target[tn]; in ncr_alloc_ccb() local
7358 struct lcb *lp = tp->lp[ln]; in ncr_alloc_ccb()
7406 struct tcb *tp = &np->target[tn]; in ncr_init_tcb() local
7415 tp->jump_tcb.l_cmd = in ncr_init_tcb()
7417 tp->jump_tcb.l_paddr = np->jump_tcb[th].l_paddr; in ncr_init_tcb()
7423 tp->getscr[0] = cpu_to_scr(copy_1); in ncr_init_tcb()
7424 tp->getscr[1] = cpu_to_scr(vtobus (&tp->sval)); in ncr_init_tcb()
7426 tp->getscr[2] = cpu_to_scr(ncr_reg_bus_addr(nc_sxfer) ^ 3); in ncr_init_tcb()
7428 tp->getscr[2] = cpu_to_scr(ncr_reg_bus_addr(nc_sxfer)); in ncr_init_tcb()
7435 tp->getscr[3] = cpu_to_scr(copy_1); in ncr_init_tcb()
7436 tp->getscr[4] = cpu_to_scr(vtobus (&tp->wval)); in ncr_init_tcb()
7438 tp->getscr[5] = cpu_to_scr(ncr_reg_bus_addr(nc_scntl3) ^ 3); in ncr_init_tcb()
7440 tp->getscr[5] = cpu_to_scr(ncr_reg_bus_addr(nc_scntl3)); in ncr_init_tcb()
7447 tp->call_lun.l_cmd = cpu_to_scr(SCR_CALL); in ncr_init_tcb()
7448 tp->call_lun.l_paddr = cpu_to_scr(NCB_SCRIPT_PHYS (np, resel_lun)); in ncr_init_tcb()
7456 tp->jump_lcb[i].l_cmd = in ncr_init_tcb()
7458 tp->jump_lcb[i].l_paddr = in ncr_init_tcb()
7465 np->jump_tcb[th].l_paddr = cpu_to_scr(vtobus (&tp->jump_tcb)); in ncr_init_tcb()
7493 struct tcb *tp = &np->target[tn]; in ncr_alloc_lcb() local
7494 struct lcb *lp = tp->lp[ln]; in ncr_alloc_lcb()
7511 tp->lp[ln] = lp; in ncr_alloc_lcb()
7516 if (!tp->jump_tcb.l_cmd) in ncr_alloc_lcb()
7548 lp->jump_lcb.l_paddr = tp->jump_lcb[lh].l_paddr; in ncr_alloc_lcb()
7560 tp->jump_lcb[lh].l_paddr = cpu_to_scr(vtobus (&lp->jump_lcb)); in ncr_alloc_lcb()
7584 struct tcb *tp = &np->target[tn]; in ncr_setup_lcb() local
7585 struct lcb *lp = tp->lp[ln]; in ncr_setup_lcb()
7967 struct tcb *tp = &np->target[device->id]; local
7968 tp->starget = device->sdev_target;
7977 struct tcb *tp = &np->target[device->id]; local
7978 struct lcb *lp = tp->lp[device->lun];
7990 if (numtags > tp->usrtags)
7991 numtags = tp->usrtags;
8542 struct tcb *tp = &np->target[starget->id]; local
8549 tp->usrsync = period;
8551 ncr_negotiate(np, tp);
8558 struct tcb *tp = &np->target[starget->id]; local
8565 tp->maxoffs = offset;
8567 ncr_negotiate(np, tp);
8574 struct tcb *tp = &np->target[starget->id]; local
8581 tp->usrwide = width;
8583 ncr_negotiate(np, tp);