• Home
  • Raw
  • Download

Lines Matching refs:fp

271 static void fc_exch_setup_hdr(struct fc_exch *ep, struct fc_frame *fp,  in fc_exch_setup_hdr()  argument
274 struct fc_frame_header *fh = fc_frame_header_get(fp); in fc_exch_setup_hdr()
277 fr_sof(fp) = ep->class; in fc_exch_setup_hdr()
279 fr_sof(fp) = fc_sof_normal(ep->class); in fc_exch_setup_hdr()
282 fr_eof(fp) = FC_EOF_T; in fc_exch_setup_hdr()
284 fr_eof(fp) = FC_EOF_N; in fc_exch_setup_hdr()
294 fill = fr_len(fp) & 3; in fc_exch_setup_hdr()
298 skb_put(fp_skb(fp), fill); in fc_exch_setup_hdr()
302 WARN_ON(fr_len(fp) % 4 != 0); /* no pad to non last frame */ in fc_exch_setup_hdr()
303 fr_eof(fp) = FC_EOF_N; in fc_exch_setup_hdr()
467 struct fc_frame *fp) in fc_seq_send_locked() argument
470 struct fc_frame_header *fh = fc_frame_header_get(fp); in fc_seq_send_locked()
479 fc_exch_setup_hdr(ep, fp, f_ctl); in fc_seq_send_locked()
480 fr_encaps(fp) = ep->encaps; in fc_seq_send_locked()
487 if (fr_max_payload(fp)) in fc_seq_send_locked()
488 sp->cnt += DIV_ROUND_UP((fr_len(fp) - sizeof(*fh)), in fc_seq_send_locked()
489 fr_max_payload(fp)); in fc_seq_send_locked()
496 error = lport->tt.frame_send(lport, fp); in fc_seq_send_locked()
520 struct fc_frame *fp) in fc_seq_send() argument
526 error = fc_seq_send_locked(lport, sp, fp); in fc_seq_send()
611 struct fc_frame *fp; in fc_exch_abort_locked() local
639 fp = fc_frame_alloc(ep->lp, 0); in fc_exch_abort_locked()
640 if (fp) { in fc_exch_abort_locked()
641 fc_fill_fc_hdr(fp, FC_RCTL_BA_ABTS, ep->did, ep->sid, in fc_exch_abort_locked()
643 error = fc_seq_send_locked(ep->lp, sp, fp); in fc_exch_abort_locked()
680 void (*resp)(struct fc_seq *, struct fc_frame *fp, void *arg); in fc_exch_timeout()
817 struct fc_frame *fp) in fc_exch_alloc() argument
822 if (!ema->match || ema->match(fp)) in fc_exch_alloc()
876 struct fc_frame *fp) in fc_exch_resp() argument
881 ep = fc_exch_alloc(lport, fp); in fc_exch_resp()
883 ep->class = fc_frame_class(fp); in fc_exch_resp()
890 fh = fc_frame_header_get(fp); in fc_exch_resp()
924 struct fc_frame *fp) in fc_seq_lookup_recip() argument
926 struct fc_frame_header *fh = fc_frame_header_get(fp); in fc_seq_lookup_recip()
962 fc_frame_payload_op(fp) == ELS_TEST) { in fc_seq_lookup_recip()
971 if ((f_ctl & FC_FC_FIRST_SEQ) && fc_sof_is_init(fr_sof(fp))) { in fc_seq_lookup_recip()
977 ep = fc_exch_resp(lport, mp, fp); in fc_seq_lookup_recip()
994 if (fc_sof_is_init(fr_sof(fp))) { in fc_seq_lookup_recip()
1033 fr_seq(fp) = sp; in fc_seq_lookup_recip()
1051 struct fc_frame *fp) in fc_seq_lookup_orig() argument
1053 struct fc_frame_header *fh = fc_frame_header_get(fp); in fc_seq_lookup_orig()
1109 static void fc_seq_els_rsp_send(struct fc_frame *fp, enum fc_els_cmd els_cmd, in fc_seq_els_rsp_send() argument
1114 fc_seq_ls_rjt(fp, els_data->reason, els_data->explan); in fc_seq_els_rsp_send()
1117 fc_seq_ls_acc(fp); in fc_seq_els_rsp_send()
1120 fc_exch_els_rrq(fp); in fc_seq_els_rsp_send()
1123 fc_exch_els_rec(fp); in fc_seq_els_rsp_send()
1126 FC_LPORT_DBG(fr_dev(fp), "Invalid ELS CMD:%x\n", els_cmd); in fc_seq_els_rsp_send()
1137 static void fc_seq_send_last(struct fc_seq *sp, struct fc_frame *fp, in fc_seq_send_last() argument
1145 fc_fill_fc_hdr(fp, rctl, ep->did, ep->sid, fh_type, f_ctl, 0); in fc_seq_send_last()
1146 fc_seq_send_locked(ep->lp, sp, fp); in fc_seq_send_last()
1158 struct fc_frame *fp; in fc_seq_send_ack() local
1169 fp = fc_frame_alloc(lport, 0); in fc_seq_send_ack()
1170 if (!fp) in fc_seq_send_ack()
1173 fh = fc_frame_header_get(fp); in fc_seq_send_ack()
1193 fc_exch_setup_hdr(ep, fp, f_ctl); in fc_seq_send_ack()
1198 fr_sof(fp) = fr_sof(rx_fp); in fc_seq_send_ack()
1200 fr_eof(fp) = FC_EOF_T; in fc_seq_send_ack()
1202 fr_eof(fp) = FC_EOF_N; in fc_seq_send_ack()
1204 lport->tt.frame_send(lport, fp); in fc_seq_send_ack()
1220 struct fc_frame *fp; in fc_exch_send_ba_rjt() local
1228 fp = fc_frame_alloc(lport, sizeof(*rp)); in fc_exch_send_ba_rjt()
1229 if (!fp) in fc_exch_send_ba_rjt()
1231 fh = fc_frame_header_get(fp); in fc_exch_send_ba_rjt()
1236 rp = fc_frame_payload_get(fp, sizeof(*rp)); in fc_exch_send_ba_rjt()
1268 fr_sof(fp) = fc_sof_class(fr_sof(rx_fp)); in fc_exch_send_ba_rjt()
1269 fr_eof(fp) = FC_EOF_T; in fc_exch_send_ba_rjt()
1270 if (fc_sof_needs_ack(fr_sof(fp))) in fc_exch_send_ba_rjt()
1271 fr_eof(fp) = FC_EOF_N; in fc_exch_send_ba_rjt()
1273 lport->tt.frame_send(lport, fp); in fc_exch_send_ba_rjt()
1287 struct fc_frame *fp; in fc_exch_recv_abts() local
1304 fp = fc_frame_alloc(ep->lp, sizeof(*ap)); in fc_exch_recv_abts()
1305 if (!fp) { in fc_exch_recv_abts()
1309 fh = fc_frame_header_get(fp); in fc_exch_recv_abts()
1310 ap = fc_frame_payload_get(fp, sizeof(*ap)); in fc_exch_recv_abts()
1321 fc_seq_send_last(sp, fp, FC_RCTL_BA_ACC, FC_TYPE_BLS); in fc_exch_recv_abts()
1341 static struct fc_seq *fc_seq_assign(struct fc_lport *lport, struct fc_frame *fp) in fc_seq_assign() argument
1345 WARN_ON(lport != fr_dev(fp)); in fc_seq_assign()
1346 WARN_ON(fr_seq(fp)); in fc_seq_assign()
1347 fr_seq(fp) = NULL; in fc_seq_assign()
1350 if ((!ema->match || ema->match(fp)) && in fc_seq_assign()
1351 fc_seq_lookup_recip(lport, ema->mp, fp) == FC_RJT_NONE) in fc_seq_assign()
1353 return fr_seq(fp); in fc_seq_assign()
1375 struct fc_frame *fp) in fc_exch_recv_req() argument
1377 struct fc_frame_header *fh = fc_frame_header_get(fp); in fc_exch_recv_req()
1387 fc_frame_free(fp); in fc_exch_recv_req()
1390 fr_dev(fp) = lport; in fc_exch_recv_req()
1392 BUG_ON(fr_seq(fp)); /* XXX remove later */ in fc_exch_recv_req()
1399 return lport->tt.lport_recv(lport, fp); in fc_exch_recv_req()
1401 reject = fc_seq_lookup_recip(lport, mp, fp); in fc_exch_recv_req()
1403 sp = fr_seq(fp); /* sequence will be held */ in fc_exch_recv_req()
1405 fc_seq_send_ack(sp, fp); in fc_exch_recv_req()
1406 ep->encaps = fr_encaps(fp); in fc_exch_recv_req()
1420 ep->resp(sp, fp, ep->arg); in fc_exch_recv_req()
1422 lport->tt.lport_recv(lport, fp); in fc_exch_recv_req()
1427 fc_frame_free(fp); in fc_exch_recv_req()
1438 static void fc_exch_recv_seq_resp(struct fc_exch_mgr *mp, struct fc_frame *fp) in fc_exch_recv_seq_resp() argument
1440 struct fc_frame_header *fh = fc_frame_header_get(fp); in fc_exch_recv_seq_resp()
1445 void (*resp)(struct fc_seq *, struct fc_frame *fp, void *arg); in fc_exch_recv_seq_resp()
1469 sof = fr_sof(fp); in fc_exch_recv_seq_resp()
1480 fr_seq(fp) = sp; in fc_exch_recv_seq_resp()
1485 fc_seq_send_ack(sp, fp); in fc_exch_recv_seq_resp()
1489 if (fh->fh_type != FC_TYPE_FCP && fr_eof(fp) == FC_EOF_T && in fc_exch_recv_seq_resp()
1515 resp(sp, fp, ex_resp_arg); in fc_exch_recv_seq_resp()
1517 fc_frame_free(fp); in fc_exch_recv_seq_resp()
1523 fc_frame_free(fp); in fc_exch_recv_seq_resp()
1532 static void fc_exch_recv_resp(struct fc_exch_mgr *mp, struct fc_frame *fp) in fc_exch_recv_resp() argument
1536 sp = fc_seq_lookup_orig(mp, fp); /* doesn't hold sequence */ in fc_exch_recv_resp()
1543 fc_frame_free(fp); in fc_exch_recv_resp()
1554 static void fc_exch_abts_resp(struct fc_exch *ep, struct fc_frame *fp) in fc_exch_abts_resp() argument
1556 void (*resp)(struct fc_seq *, struct fc_frame *fp, void *arg); in fc_exch_abts_resp()
1565 fh = fc_frame_header_get(fp); in fc_exch_abts_resp()
1577 ap = fc_frame_payload_get(fp, sizeof(*ap)); in fc_exch_abts_resp()
1620 resp(sp, fp, ex_resp_arg); in fc_exch_abts_resp()
1622 fc_frame_free(fp); in fc_exch_abts_resp()
1637 static void fc_exch_recv_bls(struct fc_exch_mgr *mp, struct fc_frame *fp) in fc_exch_recv_bls() argument
1643 fh = fc_frame_header_get(fp); in fc_exch_recv_bls()
1645 fr_seq(fp) = NULL; in fc_exch_recv_bls()
1670 fc_frame_free(fp); in fc_exch_recv_bls()
1676 fc_exch_abts_resp(ep, fp); in fc_exch_recv_bls()
1678 fc_frame_free(fp); in fc_exch_recv_bls()
1681 fc_exch_recv_abts(ep, fp); in fc_exch_recv_bls()
1684 fc_frame_free(fp); in fc_exch_recv_bls()
1703 struct fc_frame *fp; in fc_seq_ls_acc() local
1706 fp = fc_frame_alloc(lport, sizeof(*acc)); in fc_seq_ls_acc()
1707 if (!fp) in fc_seq_ls_acc()
1709 acc = fc_frame_payload_get(fp, sizeof(*acc)); in fc_seq_ls_acc()
1712 fc_fill_reply_hdr(fp, rx_fp, FC_RCTL_ELS_REP, 0); in fc_seq_ls_acc()
1713 lport->tt.frame_send(lport, fp); in fc_seq_ls_acc()
1730 struct fc_frame *fp; in fc_seq_ls_rjt() local
1733 fp = fc_frame_alloc(lport, sizeof(*rjt)); in fc_seq_ls_rjt()
1734 if (!fp) in fc_seq_ls_rjt()
1736 rjt = fc_frame_payload_get(fp, sizeof(*rjt)); in fc_seq_ls_rjt()
1741 fc_fill_reply_hdr(fp, rx_fp, FC_RCTL_ELS_REP, 0); in fc_seq_ls_rjt()
1742 lport->tt.frame_send(lport, fp); in fc_seq_ls_rjt()
1873 struct fc_frame *fp; in fc_exch_els_rec() local
1901 fp = fc_frame_alloc(lport, sizeof(*acc)); in fc_exch_els_rec()
1902 if (!fp) in fc_exch_els_rec()
1905 acc = fc_frame_payload_get(fp, sizeof(*acc)); in fc_exch_els_rec()
1919 fc_fill_reply_hdr(fp, rfp, FC_RCTL_ELS_REP, 0); in fc_exch_els_rec()
1920 lport->tt.frame_send(lport, fp); in fc_exch_els_rec()
1939 static void fc_exch_rrq_resp(struct fc_seq *sp, struct fc_frame *fp, void *arg) in fc_exch_rrq_resp() argument
1944 if (IS_ERR(fp)) { in fc_exch_rrq_resp()
1945 int err = PTR_ERR(fp); in fc_exch_rrq_resp()
1954 op = fc_frame_payload_op(fp); in fc_exch_rrq_resp()
1955 fc_frame_free(fp); in fc_exch_rrq_resp()
1996 struct fc_frame *fp, in fc_exch_seq_send() argument
1998 struct fc_frame *fp, in fc_exch_seq_send()
2010 ep = fc_exch_alloc(lport, fp); in fc_exch_seq_send()
2012 fc_frame_free(fp); in fc_exch_seq_send()
2016 fh = fc_frame_header_get(fp); in fc_exch_seq_send()
2027 fc_exch_setup_hdr(ep, fp, ep->f_ctl); in fc_exch_seq_send()
2031 fsp = fr_fsp(fp); in fc_exch_seq_send()
2032 fc_fcp_ddp_setup(fr_fsp(fp), ep->xid); in fc_exch_seq_send()
2035 if (unlikely(lport->tt.frame_send(lport, fp))) in fc_exch_seq_send()
2067 struct fc_frame *fp; in fc_exch_rrq() local
2072 fp = fc_frame_alloc(lport, sizeof(*rrq)); in fc_exch_rrq()
2073 if (!fp) in fc_exch_rrq()
2076 rrq = fc_frame_payload_get(fp, sizeof(*rrq)); in fc_exch_rrq()
2087 fc_fill_fc_hdr(fp, FC_RCTL_ELS_REQ, did, in fc_exch_rrq()
2091 if (fc_exch_seq_send(lport, fp, fc_exch_rrq_resp, NULL, ep, in fc_exch_rrq()
2112 static void fc_exch_els_rrq(struct fc_frame *fp) in fc_exch_els_rrq() argument
2121 lport = fr_dev(fp); in fc_exch_els_rrq()
2122 rp = fc_frame_payload_get(fp, sizeof(*rp)); in fc_exch_els_rrq()
2162 fc_seq_ls_acc(fp); in fc_exch_els_rrq()
2168 fc_seq_ls_rjt(fp, ELS_RJT_LOGIC, explan); in fc_exch_els_rrq()
2418 void fc_exch_recv(struct fc_lport *lport, struct fc_frame *fp) in fc_exch_recv() argument
2420 struct fc_frame_header *fh = fc_frame_header_get(fp); in fc_exch_recv()
2428 fc_frame_free(fp); in fc_exch_recv()
2441 fc_frame_free(fp); in fc_exch_recv()
2448 switch (fr_eof(fp)) { in fc_exch_recv()
2451 skb_trim(fp_skb(fp), fr_len(fp) - FC_FC_FILL(f_ctl)); in fc_exch_recv()
2455 fc_exch_recv_bls(ema->mp, fp); in fc_exch_recv()
2458 fc_exch_recv_seq_resp(ema->mp, fp); in fc_exch_recv()
2460 fc_exch_recv_resp(ema->mp, fp); in fc_exch_recv()
2462 fc_exch_recv_req(lport, ema->mp, fp); in fc_exch_recv()
2466 fr_eof(fp)); in fc_exch_recv()
2467 fc_frame_free(fp); in fc_exch_recv()