Lines Matching refs:tp
70 struct sym_tcb *tp = &np->target[target]; in sym_print_nego_msg() local
71 dev_info(&tp->starget->dev, "%s: ", label); in sym_print_nego_msg()
902 struct sym_tcb *tp = &np->target[i]; local
904 tp->usrflags |= (SYM_DISC_ENABLED | SYM_TAGS_ENABLED);
905 tp->usrtags = SYM_SETUP_MAX_TAG;
906 tp->usr_width = np->maxwide;
907 tp->usr_period = 9;
909 sym_nvram_setup_target(tp, i, nvram);
911 if (!tp->usrtags)
912 tp->usrflags &= ~SYM_TAGS_ENABLED;
1408 struct sym_tcb *tp = &np->target[cp->target]; local
1409 struct scsi_target *starget = tp->starget;
1410 struct sym_trans *goal = &tp->tgoal;
1452 tp->nego_cp = cp; /* Keep track a nego will be performed */
1645 struct sym_tcb *tp = &np->target[cp->target]; local
1646 struct sym_lcb *lp = sym_lp(tp, cp->lun);
1877 struct sym_tcb *tp = &np->target[i]; local
1879 tp->to_reset = 0;
1880 tp->head.sval = 0;
1881 tp->head.wval = np->rv_scntl3;
1882 tp->head.uval = 0;
1883 if (tp->lun0p)
1884 tp->lun0p->to_clear = 0;
1885 if (tp->lunmp) {
1889 if (tp->lunmp[ln])
1890 tp->lunmp[ln]->to_clear = 0;
1936 struct sym_tcb *tp = &np->target[target]; local
1940 sval = tp->head.sval;
1941 wval = tp->head.wval;
1942 uval = tp->head.uval;
1994 if (tp->head.sval == sval &&
1995 tp->head.wval == wval &&
1996 tp->head.uval == uval)
1998 tp->head.sval = sval;
1999 tp->head.wval = wval;
2000 tp->head.uval = uval;
2012 OUTB(np, nc_sxfer, tp->head.sval);
2013 OUTB(np, nc_scntl3, tp->head.wval);
2016 OUTB(np, nc_scntl4, tp->head.uval);
2027 cp->phys.select.sel_scntl3 = tp->head.wval;
2028 cp->phys.select.sel_sxfer = tp->head.sval;
2030 cp->phys.select.sel_scntl4 = tp->head.uval;
2035 static void sym_announce_transfer_rate(struct sym_tcb *tp) argument
2037 struct scsi_target *starget = tp->starget;
2039 if (tp->tprint.period != spi_period(starget) ||
2040 tp->tprint.offset != spi_offset(starget) ||
2041 tp->tprint.width != spi_width(starget) ||
2042 tp->tprint.iu != spi_iu(starget) ||
2043 tp->tprint.dt != spi_dt(starget) ||
2044 tp->tprint.qas != spi_qas(starget) ||
2045 !tp->tprint.check_nego) {
2046 tp->tprint.period = spi_period(starget);
2047 tp->tprint.offset = spi_offset(starget);
2048 tp->tprint.width = spi_width(starget);
2049 tp->tprint.iu = spi_iu(starget);
2050 tp->tprint.dt = spi_dt(starget);
2051 tp->tprint.qas = spi_qas(starget);
2052 tp->tprint.check_nego = 1;
2064 struct sym_tcb *tp = &np->target[target]; local
2065 struct scsi_target *starget = tp->starget;
2070 tp->tgoal.renego = NS_WIDE;
2072 tp->tgoal.renego = 0;
2073 tp->tgoal.check_nego = 0;
2074 tp->tgoal.width = wide;
2083 sym_announce_transfer_rate(tp);
2094 struct sym_tcb *tp = &np->target[target]; local
2095 struct scsi_target *starget = tp->starget;
2096 u_char wide = (tp->head.wval & EWS) ? BUS_16_BIT : BUS_8_BIT;
2101 tp->tgoal.renego = NS_WIDE;
2103 tp->tgoal.renego = NS_SYNC;
2105 tp->tgoal.renego = 0;
2110 if (!tp->tgoal.dt && !tp->tgoal.iu && !tp->tgoal.qas) {
2111 tp->tgoal.period = per;
2112 tp->tgoal.offset = ofs;
2113 tp->tgoal.check_nego = 0;
2116 sym_announce_transfer_rate(tp);
2127 struct sym_tcb *tp = &np->target[target]; local
2128 struct scsi_target *starget = tp->starget;
2133 tp->tgoal.renego = NS_PPR;
2135 tp->tgoal.renego = 0;
2136 spi_width(starget) = tp->tgoal.width = wide;
2137 spi_period(starget) = tp->tgoal.period = per;
2138 spi_offset(starget) = tp->tgoal.offset = ofs;
2139 spi_iu(starget) = tp->tgoal.iu = !!(opts & PPR_OPT_IU);
2140 spi_dt(starget) = tp->tgoal.dt = !!(opts & PPR_OPT_DT);
2141 spi_qas(starget) = tp->tgoal.qas = !!(opts & PPR_OPT_QAS);
2142 tp->tgoal.check_nego = 0;
2144 sym_announce_transfer_rate(tp);
3273 struct sym_tcb *tp = NULL; /* gcc isn't quite smart enough yet */ local
3289 tp = &np->target[i];
3290 if (tp->to_reset ||
3291 (tp->lun0p && tp->lun0p->to_clear)) {
3295 if (!tp->lunmp)
3298 if (tp->lunmp[k] && tp->lunmp[k]->to_clear) {
3328 tp = &np->target[target];
3330 np->abrt_sel.sel_scntl3 = tp->head.wval;
3331 np->abrt_sel.sel_sxfer = tp->head.sval;
3411 tp = &np->target[target];
3420 if (tp->to_reset) {
3423 tp->to_reset = 0;
3430 if (tp->lun0p && tp->lun0p->to_clear)
3432 else if (tp->lunmp) {
3434 if (tp->lunmp[k] && tp->lunmp[k]->to_clear) {
3446 struct sym_lcb *lp = sym_lp(tp, lun);
3522 tp = &np->target[target];
3523 starget = tp->starget;
3542 tp->head.sval = 0;
3543 tp->head.wval = np->rv_scntl3;
3544 tp->head.uval = 0;
3551 tp->tgoal.check_nego = 1;
3552 tp->tgoal.renego = 0;
3589 dev_info(&tp->starget->dev, "control msgout:");
3745 static void sym_modify_dp(struct sym_hcb *np, struct sym_tcb *tp, struct sym_ccb *cp, int ofs) argument
4023 static void sym_sync_nego(struct sym_hcb *np, struct sym_tcb *tp, struct sym_ccb *cp) argument
4062 struct sym_tcb *tp = &np->target[target]; local
4151 tp->tgoal.period = per;
4152 tp->tgoal.offset = ofs;
4153 tp->tgoal.width = wide;
4154 tp->tgoal.iu = tp->tgoal.dt = tp->tgoal.qas = 0;
4155 tp->tgoal.check_nego = 1;
4160 static void sym_ppr_nego(struct sym_hcb *np, struct sym_tcb *tp, struct sym_ccb *cp) argument
4260 static void sym_wide_nego(struct sym_hcb *np, struct sym_tcb *tp, struct sym_ccb *cp) argument
4290 if (tp->tgoal.offset) {
4291 spi_populate_sync_msg(np->msgout, tp->tgoal.period,
4292 tp->tgoal.offset);
4324 static void sym_nego_default(struct sym_hcb *np, struct sym_tcb *tp, struct sym_ccb *cp) argument
4331 if (tp->tgoal.period < np->minsync)
4332 tp->tgoal.period = np->minsync;
4333 if (tp->tgoal.offset > np->maxoffs)
4334 tp->tgoal.offset = np->maxoffs;
4335 tp->tgoal.iu = tp->tgoal.dt = tp->tgoal.qas = 0;
4336 tp->tgoal.check_nego = 1;
4355 static void sym_nego_rejected(struct sym_hcb *np, struct sym_tcb *tp, struct sym_ccb *cp) argument
4357 sym_nego_default(np, tp, cp);
4361 #define sym_printk(lvl, tp, cp, fmt, v...) do { \ argument
4365 starget_printk(lvl, tp->starget, fmt, ##v); \
4377 struct sym_tcb *tp = &np->target[target]; local
4413 sym_printk(KERN_WARNING, tp, cp,
4421 sym_printk(KERN_WARNING, tp, cp,
4429 sym_printk(KERN_WARNING, tp, cp,
4458 sym_printk(KERN_WARNING, tp, cp,
4560 sym_modify_dp(np, tp, cp, tmp);
4563 sym_sync_nego(np, tp, cp);
4566 sym_ppr_nego(np, tp, cp);
4569 sym_wide_nego(np, tp, cp);
4588 sym_modify_dp(np, tp, cp, -1);
4592 sym_nego_rejected(np, tp, cp);
4624 sym_nego_default(np, tp, cp);
4648 struct sym_tcb *tp = &np->target[tn]; local
4649 struct sym_lcb *lp = sym_lp(tp, ln);
4773 struct sym_tcb *tp = &np->target[cp->target]; local
4774 struct sym_lcb *lp = sym_lp(tp, cp->lun);
4825 if (cp == tp->nego_cp)
4826 tp->nego_cp = NULL;
4969 struct sym_tcb *tp = &np->target[tn]; local
4981 if (ln && !tp->luntbl) {
4982 tp->luntbl = sym_calloc_dma(256, "LUNTBL");
4983 if (!tp->luntbl)
4985 memset32(tp->luntbl, cpu_to_scr(vtobus(&np->badlun_sa)), 64);
4986 tp->head.luntbl_sa = cpu_to_scr(vtobus(tp->luntbl));
4992 if (ln && !tp->lunmp) {
4993 tp->lunmp = kcalloc(SYM_CONF_MAX_LUN, sizeof(struct sym_lcb *),
4995 if (!tp->lunmp)
5007 tp->lunmp[ln] = lp;
5008 tp->luntbl[ln] = cpu_to_scr(vtobus(lp));
5011 tp->lun0p = lp;
5012 tp->head.lun0_sa = cpu_to_scr(vtobus(lp));
5014 tp->nlcb++;
5029 lp->user_flags = tp->usrflags & (SYM_DISC_ENABLED | SYM_TAGS_ENABLED);
5050 struct sym_tcb *tp = &np->target[tn]; local
5051 struct sym_lcb *lp = sym_lp(tp, ln);
5096 struct sym_tcb *tp = &np->target[tn]; local
5097 struct sym_lcb *lp = sym_lp(tp, ln);
5099 tp->nlcb--;
5102 if (!tp->nlcb) {
5103 kfree(tp->lunmp);
5104 sym_mfree_dma(tp->luntbl, 256, "LUNTBL");
5105 tp->lunmp = NULL;
5106 tp->luntbl = NULL;
5107 tp->head.luntbl_sa = cpu_to_scr(vtobus(np->badluntbl));
5109 tp->luntbl[ln] = cpu_to_scr(vtobus(&np->badlun_sa));
5110 tp->lunmp[ln] = NULL;
5113 tp->lun0p = NULL;
5114 tp->head.lun0_sa = cpu_to_scr(vtobus(&np->badlun_sa));
5124 return tp->nlcb;
5133 struct sym_tcb *tp; local
5147 tp = &np->target[cp->target];
5152 lp = sym_lp(tp, sdev->lun);
5218 if ((tp->tgoal.check_nego ||
5220 !tp->nego_cp && lp) {
5234 cp->phys.select.sel_scntl3 = tp->head.wval;
5235 cp->phys.select.sel_sxfer = tp->head.sval;
5236 cp->phys.select.sel_scntl4 = tp->head.uval;
5273 struct sym_tcb *tp; local
5278 tp = &np->target[target];
5279 tp->to_reset = 1;
5355 struct sym_tcb *tp; local
5378 tp = &np->target[cp->target];
5379 lp = sym_lp(tp, sdev->lun);
5488 struct sym_tcb *tp; local
5510 tp = &np->target[cp->target];
5511 lp = sym_lp(tp, cp->lun);
5804 struct sym_tcb *tp; local
5830 tp = &np->target[target];
5831 if (tp->luntbl)
5832 sym_mfree_dma(tp->luntbl, 256, "LUNTBL");
5834 kfree(tp->lunmp);