Lines Matching refs:sp
466 static int fc_seq_send_locked(struct fc_lport *lport, struct fc_seq *sp, in fc_seq_send_locked() argument
475 ep = fc_seq_exch(sp); in fc_seq_send_locked()
494 sp->cnt += DIV_ROUND_UP((fr_len(fp) - sizeof(*fh)), in fc_seq_send_locked()
497 sp->cnt++; in fc_seq_send_locked()
528 static int fc_seq_send(struct fc_lport *lport, struct fc_seq *sp, in fc_seq_send() argument
533 ep = fc_seq_exch(sp); in fc_seq_send()
535 error = fc_seq_send_locked(lport, sp, fp); in fc_seq_send()
551 struct fc_seq *sp; in fc_seq_alloc() local
553 sp = &ep->seq; in fc_seq_alloc()
554 sp->ssb_stat = 0; in fc_seq_alloc()
555 sp->cnt = 0; in fc_seq_alloc()
556 sp->id = seq_id; in fc_seq_alloc()
557 return sp; in fc_seq_alloc()
565 static struct fc_seq *fc_seq_start_next_locked(struct fc_seq *sp) in fc_seq_start_next_locked() argument
567 struct fc_exch *ep = fc_seq_exch(sp); in fc_seq_start_next_locked()
569 sp = fc_seq_alloc(ep, ep->seq_id++); in fc_seq_start_next_locked()
571 ep->f_ctl, sp->id); in fc_seq_start_next_locked()
572 return sp; in fc_seq_start_next_locked()
580 static struct fc_seq *fc_seq_start_next(struct fc_seq *sp) in fc_seq_start_next() argument
582 struct fc_exch *ep = fc_seq_exch(sp); in fc_seq_start_next()
585 sp = fc_seq_start_next_locked(sp); in fc_seq_start_next()
588 return sp; in fc_seq_start_next()
596 static void fc_seq_set_resp(struct fc_seq *sp, in fc_seq_set_resp() argument
601 struct fc_exch *ep = fc_seq_exch(sp); in fc_seq_set_resp()
631 struct fc_seq *sp; in fc_exch_abort_locked() local
642 sp = fc_seq_start_next_locked(&ep->seq); in fc_exch_abort_locked()
643 if (!sp) in fc_exch_abort_locked()
659 error = fc_seq_send_locked(ep->lp, sp, fp); in fc_exch_abort_locked()
718 static bool fc_invoke_resp(struct fc_exch *ep, struct fc_seq *sp, in fc_invoke_resp() argument
734 resp(sp, fp, arg); in fc_invoke_resp()
757 struct fc_seq *sp = &ep->seq; in fc_exch_timeout() local
780 fc_invoke_resp(ep, sp, ERR_PTR(-FC_EX_TIMEOUT)); in fc_exch_timeout()
781 fc_seq_set_resp(sp, NULL, ep->arg); in fc_exch_timeout()
782 fc_seq_exch_abort(sp, 2 * ep->r_a_tov); in fc_exch_timeout()
933 static void fc_exch_done(struct fc_seq *sp) in fc_exch_done() argument
935 struct fc_exch *ep = fc_seq_exch(sp); in fc_exch_done()
942 fc_seq_set_resp(sp, NULL, ep->arg); in fc_exch_done()
1009 struct fc_seq *sp = NULL; in fc_seq_lookup_recip() local
1077 sp = &ep->seq; in fc_seq_lookup_recip()
1078 sp->ssb_stat |= SSB_ST_RESP; in fc_seq_lookup_recip()
1079 sp->id = fh->fh_seq_id; in fc_seq_lookup_recip()
1081 sp = &ep->seq; in fc_seq_lookup_recip()
1082 if (sp->id != fh->fh_seq_id) { in fc_seq_lookup_recip()
1099 sp->ssb_stat |= SSB_ST_RESP; in fc_seq_lookup_recip()
1100 sp->id = fh->fh_seq_id; in fc_seq_lookup_recip()
1110 WARN_ON(ep != fc_seq_exch(sp)); in fc_seq_lookup_recip()
1116 fr_seq(fp) = sp; in fc_seq_lookup_recip()
1138 struct fc_seq *sp = NULL; in fc_seq_lookup_orig() local
1152 sp = &ep->seq; in fc_seq_lookup_orig()
1159 return sp; in fc_seq_lookup_orig()
1220 static void fc_seq_send_last(struct fc_seq *sp, struct fc_frame *fp, in fc_seq_send_last() argument
1224 struct fc_exch *ep = fc_seq_exch(sp); in fc_seq_send_last()
1229 fc_seq_send_locked(ep->lp, sp, fp); in fc_seq_send_last()
1239 static void fc_seq_send_ack(struct fc_seq *sp, const struct fc_frame *rx_fp) in fc_seq_send_ack() argument
1244 struct fc_exch *ep = fc_seq_exch(sp); in fc_seq_send_ack()
1373 struct fc_seq *sp; in fc_exch_recv_abts() local
1397 sp = &ep->seq; in fc_exch_recv_abts()
1399 if (sp->ssb_stat & SSB_ST_RESP) { in fc_exch_recv_abts()
1400 ap->ba_seq_id = sp->id; in fc_exch_recv_abts()
1403 ap->ba_low_seq_cnt = htons(sp->cnt); in fc_exch_recv_abts()
1405 sp = fc_seq_start_next_locked(sp); in fc_exch_recv_abts()
1406 fc_seq_send_last(sp, fp, FC_RCTL_BA_ACC, FC_TYPE_BLS); in fc_exch_recv_abts()
1447 static void fc_seq_release(struct fc_seq *sp) in fc_seq_release() argument
1449 fc_exch_release(fc_seq_exch(sp)); in fc_seq_release()
1465 struct fc_seq *sp = NULL; in fc_exch_recv_req() local
1490 sp = fr_seq(fp); /* sequence will be held */ in fc_exch_recv_req()
1491 ep = fc_seq_exch(sp); in fc_exch_recv_req()
1492 fc_seq_send_ack(sp, fp); in fc_exch_recv_req()
1506 if (!fc_invoke_resp(ep, sp, fp)) in fc_exch_recv_req()
1526 struct fc_seq *sp; in fc_exch_recv_seq_resp() local
1553 sp = &ep->seq; in fc_exch_recv_seq_resp()
1555 sp->ssb_stat |= SSB_ST_RESP; in fc_exch_recv_seq_resp()
1556 sp->id = fh->fh_seq_id; in fc_exch_recv_seq_resp()
1557 } else if (sp->id != fh->fh_seq_id) { in fc_exch_recv_seq_resp()
1563 fr_seq(fp) = sp; in fc_exch_recv_seq_resp()
1571 fc_seq_send_ack(sp, fp); in fc_exch_recv_seq_resp()
1578 WARN_ON(fc_seq_exch(sp) != ep); in fc_exch_recv_seq_resp()
1597 if (!fc_invoke_resp(ep, sp, fp)) in fc_exch_recv_seq_resp()
1616 struct fc_seq *sp; in fc_exch_recv_resp() local
1618 sp = fc_seq_lookup_orig(mp, fp); /* doesn't hold sequence */ in fc_exch_recv_resp()
1620 if (!sp) in fc_exch_recv_resp()
1640 struct fc_seq *sp; in fc_exch_abts_resp() local
1685 sp = &ep->seq; in fc_exch_abts_resp()
1697 if (!fc_invoke_resp(ep, sp, fp)) in fc_exch_abts_resp()
1828 struct fc_seq *sp; in fc_exch_reset() local
1838 sp = &ep->seq; in fc_exch_reset()
1847 fc_invoke_resp(ep, sp, ERR_PTR(-FC_EX_CLOSED)); in fc_exch_reset()
1848 fc_seq_set_resp(sp, NULL, ep->arg); in fc_exch_reset()
2015 static void fc_exch_rrq_resp(struct fc_seq *sp, struct fc_frame *fp, void *arg) in fc_exch_rrq_resp() argument
2081 struct fc_seq *sp = NULL; in fc_exch_seq_send() local
2099 sp = &ep->seq; in fc_exch_seq_send()
2104 sp->cnt++; in fc_exch_seq_send()
2121 return sp; in fc_exch_seq_send()