Lines Matching refs:fp
423 struct fc_frame *fp; in fc_fcp_frame_alloc() local
425 fp = fc_frame_alloc(lport, len); in fc_fcp_frame_alloc()
426 if (likely(fp)) in fc_fcp_frame_alloc()
427 return fp; in fc_fcp_frame_alloc()
441 static void fc_fcp_recv_data(struct fc_fcp_pkt *fsp, struct fc_frame *fp) in fc_fcp_recv_data() argument
457 fh = fc_frame_header_get(fp); in fc_fcp_recv_data()
460 len = fr_len(fp) - sizeof(*fh); in fc_fcp_recv_data()
461 buf = fc_frame_payload_get(fp, 0); in fc_fcp_recv_data()
478 if ((fr_flags(fp) & FCPHF_CRC_UNCHECKED) && in fc_fcp_recv_data()
479 fc_frame_crc_check(fp)) in fc_fcp_recv_data()
494 if (!(fr_flags(fp) & FCPHF_CRC_UNCHECKED)) { in fc_fcp_recv_data()
501 buf = fc_frame_payload_get(fp, 0); in fc_fcp_recv_data()
505 if (~crc != le32_to_cpu(fr_crc(fp))) { in fc_fcp_recv_data()
565 struct fc_frame *fp = NULL; in fc_fcp_send_data() local
624 if (!fp) { in fc_fcp_send_data()
634 fp = fc_frame_alloc(lport, using_sg ? 0 : tlen); in fc_fcp_send_data()
635 if (!fp) in fc_fcp_send_data()
638 data = fc_frame_header_get(fp) + 1; in fc_fcp_send_data()
640 fr_max_payload(fp) = fsp->max_payload; in fc_fcp_send_data()
650 skb_fill_page_desc(fp_skb(fp), in fc_fcp_send_data()
651 skb_shinfo(fp_skb(fp))->nr_frags, in fc_fcp_send_data()
653 fp_skb(fp)->data_len += sg_bytes; in fc_fcp_send_data()
654 fr_len(fp) += sg_bytes; in fc_fcp_send_data()
655 fp_skb(fp)->truesize += PAGE_SIZE; in fc_fcp_send_data()
672 if ((skb_shinfo(fp_skb(fp))->nr_frags < FC_FRAME_SG_LEN) && in fc_fcp_send_data()
684 fc_fill_fc_hdr(fp, FC_RCTL_DD_SOL_DATA, ep->did, ep->sid, in fc_fcp_send_data()
690 error = lport->tt.seq_send(lport, seq, fp); in fc_fcp_send_data()
695 fp = NULL; in fc_fcp_send_data()
706 static void fc_fcp_abts_resp(struct fc_fcp_pkt *fsp, struct fc_frame *fp) in fc_fcp_abts_resp() argument
712 fh = fc_frame_header_get(fp); in fc_fcp_abts_resp()
717 brp = fc_frame_payload_get(fp, sizeof(*brp)); in fc_fcp_abts_resp()
750 static void fc_fcp_recv(struct fc_seq *seq, struct fc_frame *fp, void *arg) in fc_fcp_recv() argument
759 if (IS_ERR(fp)) { in fc_fcp_recv()
760 fc_fcp_error(fsp, fp); in fc_fcp_recv()
764 fh = fc_frame_header_get(fp); in fc_fcp_recv()
773 fc_fcp_abts_resp(fsp, fp); in fc_fcp_recv()
785 WARN_ON(fr_flags(fp) & FCPHF_CRC_UNCHECKED); in fc_fcp_recv()
786 dd = fc_frame_payload_get(fp, sizeof(*dd)); in fc_fcp_recv()
799 WARN_ON(fr_len(fp) < sizeof(*fh)); /* len may be 0 */ in fc_fcp_recv()
800 fc_fcp_recv_data(fsp, fp); in fc_fcp_recv()
803 WARN_ON(fr_flags(fp) & FCPHF_CRC_UNCHECKED); in fc_fcp_recv()
805 fc_fcp_resp(fsp, fp); in fc_fcp_recv()
812 fc_frame_free(fp); in fc_fcp_recv()
820 static void fc_fcp_resp(struct fc_fcp_pkt *fsp, struct fc_frame *fp) in fc_fcp_resp() argument
832 plen = fr_len(fp); in fc_fcp_resp()
833 fh = (struct fc_frame_header *)fr_hdr(fp); in fc_fcp_resp()
927 "snsl %u\n", flags, fr_len(fp), respl, snsl); in fc_fcp_resp()
1139 struct fc_frame *fp, in fc_fcp_cmd_send() argument
1142 struct fc_frame *fp; in fc_fcp_cmd_send() local
1152 fp = fc_fcp_frame_alloc(lport, sizeof(fsp->cdb_cmd)); in fc_fcp_cmd_send()
1153 if (!fp) { in fc_fcp_cmd_send()
1158 memcpy(fc_frame_payload_get(fp, len), &fsp->cdb_cmd, len); in fc_fcp_cmd_send()
1159 fr_fsp(fp) = fsp; in fc_fcp_cmd_send()
1164 fc_fill_fc_hdr(fp, FC_RCTL_DD_UNSOL_CMD, rport->port_id, in fc_fcp_cmd_send()
1168 seq = lport->tt.exch_seq_send(lport, fp, resp, fc_fcp_pkt_destroy, in fc_fcp_cmd_send()
1191 static void fc_fcp_error(struct fc_fcp_pkt *fsp, struct fc_frame *fp) in fc_fcp_error() argument
1193 int error = PTR_ERR(fp); in fc_fcp_error()
1330 static void fc_tm_done(struct fc_seq *seq, struct fc_frame *fp, void *arg) in fc_tm_done() argument
1335 if (IS_ERR(fp)) { in fc_tm_done()
1354 fh = fc_frame_header_get(fp); in fc_tm_done()
1356 fc_fcp_resp(fsp, fp); in fc_tm_done()
1362 fc_frame_free(fp); in fc_tm_done()
1417 struct fc_frame *fp; in fc_fcp_rec() local
1431 fp = fc_fcp_frame_alloc(lport, sizeof(struct fc_els_rec)); in fc_fcp_rec()
1432 if (!fp) in fc_fcp_rec()
1435 fr_seq(fp) = fsp->seq_ptr; in fc_fcp_rec()
1436 fc_fill_fc_hdr(fp, FC_RCTL_ELS_REQ, rport->port_id, in fc_fcp_rec()
1439 if (lport->tt.elsct_send(lport, rport->port_id, fp, ELS_REC, in fc_fcp_rec()
1463 static void fc_fcp_rec_resp(struct fc_seq *seq, struct fc_frame *fp, void *arg) in fc_fcp_rec_resp() argument
1475 if (IS_ERR(fp)) { in fc_fcp_rec_resp()
1476 fc_fcp_rec_error(fsp, fp); in fc_fcp_rec_resp()
1484 opcode = fc_frame_payload_op(fp); in fc_fcp_rec_resp()
1486 rjt = fc_frame_payload_get(fp, sizeof(*rjt)); in fc_fcp_rec_resp()
1525 recp = fc_frame_payload_get(fp, sizeof(*recp)); in fc_fcp_rec_resp()
1594 fc_frame_free(fp); in fc_fcp_rec_resp()
1602 static void fc_fcp_rec_error(struct fc_fcp_pkt *fsp, struct fc_frame *fp) in fc_fcp_rec_error() argument
1604 int error = PTR_ERR(fp); in fc_fcp_rec_error()
1670 struct fc_frame *fp; in fc_fcp_srr() local
1679 fp = fc_fcp_frame_alloc(lport, sizeof(*srr)); in fc_fcp_srr()
1680 if (!fp) in fc_fcp_srr()
1683 srr = fc_frame_payload_get(fp, sizeof(*srr)); in fc_fcp_srr()
1691 fc_fill_fc_hdr(fp, FC_RCTL_ELS4_REQ, rport->port_id, in fc_fcp_srr()
1696 seq = lport->tt.exch_seq_send(lport, fp, fc_fcp_srr_resp, in fc_fcp_srr()
1718 static void fc_fcp_srr_resp(struct fc_seq *seq, struct fc_frame *fp, void *arg) in fc_fcp_srr_resp() argument
1723 if (IS_ERR(fp)) { in fc_fcp_srr_resp()
1724 fc_fcp_srr_error(fsp, fp); in fc_fcp_srr_resp()
1731 fh = fc_frame_header_get(fp); in fc_fcp_srr_resp()
1744 switch (fc_frame_payload_op(fp)) { in fc_fcp_srr_resp()
1757 fc_frame_free(fp); in fc_fcp_srr_resp()
1765 static void fc_fcp_srr_error(struct fc_fcp_pkt *fsp, struct fc_frame *fp) in fc_fcp_srr_error() argument
1769 switch (PTR_ERR(fp)) { in fc_fcp_srr_error()