Lines Matching refs:tp
83 struct sym_tcb *tp = &np->target[target]; in sym_print_nego_msg() local
84 dev_info(&tp->starget->dev, "%s: ", label); in sym_print_nego_msg()
915 struct sym_tcb *tp = &np->target[i]; local
917 tp->usrflags |= (SYM_DISC_ENABLED | SYM_TAGS_ENABLED);
918 tp->usrtags = SYM_SETUP_MAX_TAG;
919 tp->usr_width = np->maxwide;
920 tp->usr_period = 9;
922 sym_nvram_setup_target(tp, i, nvram);
924 if (!tp->usrtags)
925 tp->usrflags &= ~SYM_TAGS_ENABLED;
1421 struct sym_tcb *tp = &np->target[cp->target]; local
1422 struct scsi_target *starget = tp->starget;
1423 struct sym_trans *goal = &tp->tgoal;
1465 tp->nego_cp = cp; /* Keep track a nego will be performed */
1658 struct sym_tcb *tp = &np->target[cp->target]; local
1659 struct sym_lcb *lp = sym_lp(tp, cp->lun);
1890 struct sym_tcb *tp = &np->target[i]; local
1892 tp->to_reset = 0;
1893 tp->head.sval = 0;
1894 tp->head.wval = np->rv_scntl3;
1895 tp->head.uval = 0;
1896 if (tp->lun0p)
1897 tp->lun0p->to_clear = 0;
1898 if (tp->lunmp) {
1902 if (tp->lunmp[ln])
1903 tp->lunmp[ln]->to_clear = 0;
1949 struct sym_tcb *tp = &np->target[target]; local
1953 sval = tp->head.sval;
1954 wval = tp->head.wval;
1955 uval = tp->head.uval;
2007 if (tp->head.sval == sval &&
2008 tp->head.wval == wval &&
2009 tp->head.uval == uval)
2011 tp->head.sval = sval;
2012 tp->head.wval = wval;
2013 tp->head.uval = uval;
2025 OUTB(np, nc_sxfer, tp->head.sval);
2026 OUTB(np, nc_scntl3, tp->head.wval);
2029 OUTB(np, nc_scntl4, tp->head.uval);
2040 cp->phys.select.sel_scntl3 = tp->head.wval;
2041 cp->phys.select.sel_sxfer = tp->head.sval;
2043 cp->phys.select.sel_scntl4 = tp->head.uval;
2048 static void sym_announce_transfer_rate(struct sym_tcb *tp) argument
2050 struct scsi_target *starget = tp->starget;
2052 if (tp->tprint.period != spi_period(starget) ||
2053 tp->tprint.offset != spi_offset(starget) ||
2054 tp->tprint.width != spi_width(starget) ||
2055 tp->tprint.iu != spi_iu(starget) ||
2056 tp->tprint.dt != spi_dt(starget) ||
2057 tp->tprint.qas != spi_qas(starget) ||
2058 !tp->tprint.check_nego) {
2059 tp->tprint.period = spi_period(starget);
2060 tp->tprint.offset = spi_offset(starget);
2061 tp->tprint.width = spi_width(starget);
2062 tp->tprint.iu = spi_iu(starget);
2063 tp->tprint.dt = spi_dt(starget);
2064 tp->tprint.qas = spi_qas(starget);
2065 tp->tprint.check_nego = 1;
2077 struct sym_tcb *tp = &np->target[target]; local
2078 struct scsi_target *starget = tp->starget;
2083 tp->tgoal.renego = NS_WIDE;
2085 tp->tgoal.renego = 0;
2086 tp->tgoal.check_nego = 0;
2087 tp->tgoal.width = wide;
2096 sym_announce_transfer_rate(tp);
2107 struct sym_tcb *tp = &np->target[target]; local
2108 struct scsi_target *starget = tp->starget;
2109 u_char wide = (tp->head.wval & EWS) ? BUS_16_BIT : BUS_8_BIT;
2114 tp->tgoal.renego = NS_WIDE;
2116 tp->tgoal.renego = NS_SYNC;
2118 tp->tgoal.renego = 0;
2123 if (!tp->tgoal.dt && !tp->tgoal.iu && !tp->tgoal.qas) {
2124 tp->tgoal.period = per;
2125 tp->tgoal.offset = ofs;
2126 tp->tgoal.check_nego = 0;
2129 sym_announce_transfer_rate(tp);
2140 struct sym_tcb *tp = &np->target[target]; local
2141 struct scsi_target *starget = tp->starget;
2146 tp->tgoal.renego = NS_PPR;
2148 tp->tgoal.renego = 0;
2149 spi_width(starget) = tp->tgoal.width = wide;
2150 spi_period(starget) = tp->tgoal.period = per;
2151 spi_offset(starget) = tp->tgoal.offset = ofs;
2152 spi_iu(starget) = tp->tgoal.iu = !!(opts & PPR_OPT_IU);
2153 spi_dt(starget) = tp->tgoal.dt = !!(opts & PPR_OPT_DT);
2154 spi_qas(starget) = tp->tgoal.qas = !!(opts & PPR_OPT_QAS);
2155 tp->tgoal.check_nego = 0;
2157 sym_announce_transfer_rate(tp);
3285 struct sym_tcb *tp = NULL; /* gcc isn't quite smart enough yet */ local
3301 tp = &np->target[i];
3302 if (tp->to_reset ||
3303 (tp->lun0p && tp->lun0p->to_clear)) {
3307 if (!tp->lunmp)
3310 if (tp->lunmp[k] && tp->lunmp[k]->to_clear) {
3340 tp = &np->target[target];
3342 np->abrt_sel.sel_scntl3 = tp->head.wval;
3343 np->abrt_sel.sel_sxfer = tp->head.sval;
3423 tp = &np->target[target];
3432 if (tp->to_reset) {
3435 tp->to_reset = 0;
3442 if (tp->lun0p && tp->lun0p->to_clear)
3444 else if (tp->lunmp) {
3446 if (tp->lunmp[k] && tp->lunmp[k]->to_clear) {
3458 struct sym_lcb *lp = sym_lp(tp, lun);
3534 tp = &np->target[target];
3535 starget = tp->starget;
3554 tp->head.sval = 0;
3555 tp->head.wval = np->rv_scntl3;
3556 tp->head.uval = 0;
3563 tp->tgoal.check_nego = 1;
3564 tp->tgoal.renego = 0;
3601 dev_info(&tp->starget->dev, "control msgout:");
3757 static void sym_modify_dp(struct sym_hcb *np, struct sym_tcb *tp, struct sym_ccb *cp, int ofs) argument
4036 static void sym_sync_nego(struct sym_hcb *np, struct sym_tcb *tp, struct sym_ccb *cp) argument
4075 struct sym_tcb *tp = &np->target[target]; local
4164 tp->tgoal.period = per;
4165 tp->tgoal.offset = ofs;
4166 tp->tgoal.width = wide;
4167 tp->tgoal.iu = tp->tgoal.dt = tp->tgoal.qas = 0;
4168 tp->tgoal.check_nego = 1;
4173 static void sym_ppr_nego(struct sym_hcb *np, struct sym_tcb *tp, struct sym_ccb *cp) argument
4273 static void sym_wide_nego(struct sym_hcb *np, struct sym_tcb *tp, struct sym_ccb *cp) argument
4303 if (tp->tgoal.offset) {
4304 spi_populate_sync_msg(np->msgout, tp->tgoal.period,
4305 tp->tgoal.offset);
4337 static void sym_nego_default(struct sym_hcb *np, struct sym_tcb *tp, struct sym_ccb *cp) argument
4344 if (tp->tgoal.period < np->minsync)
4345 tp->tgoal.period = np->minsync;
4346 if (tp->tgoal.offset > np->maxoffs)
4347 tp->tgoal.offset = np->maxoffs;
4348 tp->tgoal.iu = tp->tgoal.dt = tp->tgoal.qas = 0;
4349 tp->tgoal.check_nego = 1;
4368 static void sym_nego_rejected(struct sym_hcb *np, struct sym_tcb *tp, struct sym_ccb *cp) argument
4370 sym_nego_default(np, tp, cp);
4383 struct sym_tcb *tp = &np->target[target]; local
4566 sym_modify_dp(np, tp, cp, tmp);
4569 sym_sync_nego(np, tp, cp);
4572 sym_ppr_nego(np, tp, cp);
4575 sym_wide_nego(np, tp, cp);
4594 sym_modify_dp(np, tp, cp, -1);
4598 sym_nego_rejected(np, tp, cp);
4630 sym_nego_default(np, tp, cp);
4654 struct sym_tcb *tp = &np->target[tn]; local
4655 struct sym_lcb *lp = sym_lp(tp, ln);
4779 struct sym_tcb *tp = &np->target[cp->target]; local
4780 struct sym_lcb *lp = sym_lp(tp, cp->lun);
4831 if (cp == tp->nego_cp)
4832 tp->nego_cp = NULL;
4975 struct sym_tcb *tp = &np->target[tn]; local
4987 if (ln && !tp->luntbl) {
4990 tp->luntbl = sym_calloc_dma(256, "LUNTBL");
4991 if (!tp->luntbl)
4994 tp->luntbl[i] = cpu_to_scr(vtobus(&np->badlun_sa));
4995 tp->head.luntbl_sa = cpu_to_scr(vtobus(tp->luntbl));
5001 if (ln && !tp->lunmp) {
5002 tp->lunmp = kcalloc(SYM_CONF_MAX_LUN, sizeof(struct sym_lcb *),
5004 if (!tp->lunmp)
5016 tp->lunmp[ln] = lp;
5017 tp->luntbl[ln] = cpu_to_scr(vtobus(lp));
5020 tp->lun0p = lp;
5021 tp->head.lun0_sa = cpu_to_scr(vtobus(lp));
5023 tp->nlcb++;
5038 lp->user_flags = tp->usrflags & (SYM_DISC_ENABLED | SYM_TAGS_ENABLED);
5059 struct sym_tcb *tp = &np->target[tn]; local
5060 struct sym_lcb *lp = sym_lp(tp, ln);
5106 struct sym_tcb *tp = &np->target[tn]; local
5107 struct sym_lcb *lp = sym_lp(tp, ln);
5109 tp->nlcb--;
5112 if (!tp->nlcb) {
5113 kfree(tp->lunmp);
5114 sym_mfree_dma(tp->luntbl, 256, "LUNTBL");
5115 tp->lunmp = NULL;
5116 tp->luntbl = NULL;
5117 tp->head.luntbl_sa = cpu_to_scr(vtobus(np->badluntbl));
5119 tp->luntbl[ln] = cpu_to_scr(vtobus(&np->badlun_sa));
5120 tp->lunmp[ln] = NULL;
5123 tp->lun0p = NULL;
5124 tp->head.lun0_sa = cpu_to_scr(vtobus(&np->badlun_sa));
5134 return tp->nlcb;
5143 struct sym_tcb *tp; local
5157 tp = &np->target[cp->target];
5162 lp = sym_lp(tp, sdev->lun);
5228 if ((tp->tgoal.check_nego ||
5230 !tp->nego_cp && lp) {
5244 cp->phys.select.sel_scntl3 = tp->head.wval;
5245 cp->phys.select.sel_sxfer = tp->head.sval;
5246 cp->phys.select.sel_scntl4 = tp->head.uval;
5283 struct sym_tcb *tp; local
5288 tp = &np->target[target];
5289 tp->to_reset = 1;
5364 struct sym_tcb *tp; local
5385 tp = &np->target[cp->target];
5386 lp = sym_lp(tp, sdev->lun);
5493 struct sym_tcb *tp; local
5513 tp = &np->target[cp->target];
5514 lp = sym_lp(tp, cp->lun);
5807 struct sym_tcb *tp; local
5833 tp = &np->target[target];
5834 if (tp->luntbl)
5835 sym_mfree_dma(tp->luntbl, 256, "LUNTBL");
5837 kfree(tp->lunmp);