Lines Matching refs:lp

1540 void sym_start_next_ccbs(struct sym_hcb *np, struct sym_lcb *lp, int maxn)  argument
1548 assert(!lp->started_tags || !lp->started_no_tag);
1556 qp = sym_remque_head(&lp->waiting_ccbq);
1561 if (lp->started_no_tag ||
1562 lp->started_tags >= lp->started_max) {
1563 sym_insque_head(qp, &lp->waiting_ccbq);
1566 lp->itlq_tbl[cp->tag] = cpu_to_scr(cp->ccb_ba);
1567 lp->head.resel_sa =
1569 ++lp->started_tags;
1571 if (lp->started_no_tag || lp->started_tags) {
1572 sym_insque_head(qp, &lp->waiting_ccbq);
1575 lp->head.itl_task_sa = cpu_to_scr(cp->ccb_ba);
1576 lp->head.resel_sa =
1578 ++lp->started_no_tag;
1581 sym_insque_tail(qp, &lp->started_ccbq);
1659 struct sym_lcb *lp = sym_lp(tp, cp->lun); local
1660 if (lp) {
1663 &lp->waiting_ccbq);
1666 --lp->started_tags;
1668 --lp->started_no_tag;
3458 struct sym_lcb *lp = sym_lp(tp, lun); local
3459 lp->to_clear = 0; /* We don't expect to fail here */
4655 struct sym_lcb *lp = sym_lp(tp, ln); local
4679 if (lp->busy_itl != 0)
4685 if (!lp->cb_tags) {
4687 if (!lp->cb_tags)
4696 if (lp->busy_itlq < SYM_CONF_MAX_TASK) {
4697 tag = lp->cb_tags[lp->ia_tag];
4698 if (++lp->ia_tag == SYM_CONF_MAX_TASK)
4699 lp->ia_tag = 0;
4700 ++lp->busy_itlq;
4702 lp->itlq_tbl[tag] = cpu_to_scr(cp->ccb_ba);
4703 lp->head.resel_sa =
4707 cp->tags_si = lp->tags_si;
4708 ++lp->tags_sum[cp->tags_si];
4709 ++lp->tags_since;
4725 if (lp->busy_itl != 0 || lp->busy_itlq != 0)
4733 ++lp->busy_itl;
4735 if (lp->busy_itl == 1) {
4736 lp->head.itl_task_sa = cpu_to_scr(cp->ccb_ba);
4737 lp->head.resel_sa =
4750 if (lp) {
4752 sym_insque_tail(&cp->link2_ccbq, &lp->waiting_ccbq);
4780 struct sym_lcb *lp = sym_lp(tp, cp->lun); local
4790 if (lp) {
4796 --lp->tags_sum[cp->tags_si];
4801 lp->cb_tags[lp->if_tag] = cp->tag;
4802 if (++lp->if_tag == SYM_CONF_MAX_TASK)
4803 lp->if_tag = 0;
4808 lp->itlq_tbl[cp->tag] = cpu_to_scr(np->bad_itlq_ba);
4809 --lp->busy_itlq;
4815 lp->head.itl_task_sa = cpu_to_scr(np->bad_itl_ba);
4816 --lp->busy_itl;
4821 if (lp->busy_itlq == 0 && lp->busy_itl == 0)
4822 lp->head.resel_sa =
4852 if (lp) {
4857 --lp->started_tags;
4859 --lp->started_no_tag;
4976 struct sym_lcb *lp = NULL; local
5012 lp = sym_calloc_dma(sizeof(struct sym_lcb), "LCB");
5013 if (!lp)
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));
5028 lp->head.itl_task_sa = cpu_to_scr(np->bad_itl_ba);
5033 lp->head.resel_sa = cpu_to_scr(SCRIPTB_BA(np, resel_bad_lun));
5038 lp->user_flags = tp->usrflags & (SYM_DISC_ENABLED | SYM_TAGS_ENABLED);
5044 sym_que_init(&lp->waiting_ccbq);
5045 sym_que_init(&lp->started_ccbq);
5046 lp->started_max = SYM_CONF_MAX_TASK;
5047 lp->started_limit = SYM_CONF_MAX_TASK;
5051 return lp;
5060 struct sym_lcb *lp = sym_lp(tp, ln); local
5067 lp->itlq_tbl = sym_calloc_dma(SYM_CONF_MAX_TASK*4, "ITLQ_TBL");
5068 if (!lp->itlq_tbl)
5070 lp->cb_tags = kcalloc(SYM_CONF_MAX_TASK, 1, GFP_ATOMIC);
5071 if (!lp->cb_tags) {
5072 sym_mfree_dma(lp->itlq_tbl, SYM_CONF_MAX_TASK*4, "ITLQ_TBL");
5073 lp->itlq_tbl = NULL;
5081 lp->itlq_tbl[i] = cpu_to_scr(np->notask_ba);
5087 lp->cb_tags[i] = i;
5093 lp->head.itlq_tbl_sa = cpu_to_scr(vtobus(lp->itlq_tbl));
5107 struct sym_lcb *lp = sym_lp(tp, ln); local
5127 if (lp->itlq_tbl) {
5128 sym_mfree_dma(lp->itlq_tbl, SYM_CONF_MAX_TASK*4, "ITLQ_TBL");
5129 kfree(lp->cb_tags);
5132 sym_mfree_dma(lp, sizeof(*lp), "LCB");
5144 struct sym_lcb *lp; local
5162 lp = sym_lp(tp, sdev->lun);
5165 (lp && (lp->curr_flags & SYM_DISC_ENABLED));
5192 if (lp && lp->tags_since > 3*SYM_CONF_MAX_TAG) {
5193 lp->tags_si = !(lp->tags_si);
5194 if (lp->tags_sum[lp->tags_si]) {
5201 lp->tags_since = 0;
5230 !tp->nego_cp && lp) {
5365 struct sym_lcb *lp; local
5386 lp = sym_lp(tp, sdev->lun);
5427 if (!lp || lp->started_tags - i < 2)
5432 lp->started_max = lp->started_tags - i - 1;
5433 lp->num_sgood = 0;
5437 lp->started_max);
5478 sym_start_next_ccbs(np, lp, 1);
5494 struct sym_lcb *lp; local
5514 lp = sym_lp(tp, cp->lun);
5546 if (lp && lp->started_max < lp->started_limit) {
5547 ++lp->num_sgood;
5548 if (lp->num_sgood >= 200) {
5549 lp->num_sgood = 0;
5550 ++lp->started_max;
5553 lp->started_max);
5568 if (!sym_que_empty(&lp->waiting_ccbq))
5569 sym_start_next_ccbs(np, lp, 2);