Lines Matching refs:fp

153 static int fc_frame_drop(struct fc_lport *lport, struct fc_frame *fp)  in fc_frame_drop()  argument
155 fc_frame_free(fp); in fc_frame_drop()
394 static void fc_lport_recv_rlir_req(struct fc_lport *lport, struct fc_frame *fp) in fc_lport_recv_rlir_req() argument
401 fc_seq_els_rsp_send(fp, ELS_LS_ACC, NULL); in fc_lport_recv_rlir_req()
402 fc_frame_free(fp); in fc_lport_recv_rlir_req()
413 struct fc_frame *fp; in fc_lport_recv_echo_req() local
429 fp = fc_frame_alloc(lport, len); in fc_lport_recv_echo_req()
430 if (fp) { in fc_lport_recv_echo_req()
431 dp = fc_frame_payload_get(fp, len); in fc_lport_recv_echo_req()
434 fc_fill_reply_hdr(fp, in_fp, FC_RCTL_ELS_REP, 0); in fc_lport_recv_echo_req()
435 lport->tt.frame_send(lport, fp); in fc_lport_recv_echo_req()
448 struct fc_frame *fp; in fc_lport_recv_rnid_req() local
477 fp = fc_frame_alloc(lport, len); in fc_lport_recv_rnid_req()
478 if (fp) { in fc_lport_recv_rnid_req()
479 rp = fc_frame_payload_get(fp, len); in fc_lport_recv_rnid_req()
491 fc_fill_reply_hdr(fp, in_fp, FC_RCTL_ELS_REP, 0); in fc_lport_recv_rnid_req()
492 lport->tt.frame_send(lport, fp); in fc_lport_recv_rnid_req()
503 static void fc_lport_recv_logo_req(struct fc_lport *lport, struct fc_frame *fp) in fc_lport_recv_logo_req() argument
507 fc_seq_els_rsp_send(fp, ELS_LS_ACC, NULL); in fc_lport_recv_logo_req()
509 fc_frame_free(fp); in fc_lport_recv_logo_req()
732 struct fc_frame *fp) in fc_lport_set_port_id() argument
746 lport->tt.lport_set_port_id(lport, port_id, fp); in fc_lport_set_port_id()
789 struct fc_frame *fp; in fc_lport_recv_flogi_req() local
831 fp = fc_frame_alloc(lport, sizeof(*flp)); in fc_lport_recv_flogi_req()
832 if (fp) { in fc_lport_recv_flogi_req()
833 new_flp = fc_frame_payload_get(fp, sizeof(*flp)); in fc_lport_recv_flogi_req()
841 fc_fill_reply_hdr(fp, rx_fp, FC_RCTL_ELS_REP, 0); in fc_lport_recv_flogi_req()
842 fh = fc_frame_header_get(fp); in fc_lport_recv_flogi_req()
845 lport->tt.frame_send(lport, fp); in fc_lport_recv_flogi_req()
848 fc_lport_error(lport, fp); in fc_lport_recv_flogi_req()
868 struct fc_frame *fp) in fc_lport_recv_els_req() argument
878 fc_frame_free(fp); in fc_lport_recv_els_req()
883 switch (fc_frame_payload_op(fp)) { in fc_lport_recv_els_req()
886 fc_lport_recv_flogi_req(lport, fp); in fc_lport_recv_els_req()
888 fc_rport_recv_req(lport, fp); in fc_lport_recv_els_req()
891 if (fc_frame_sid(fp) == FC_FID_FLOGI) in fc_lport_recv_els_req()
892 fc_lport_recv_logo_req(lport, fp); in fc_lport_recv_els_req()
894 fc_rport_recv_req(lport, fp); in fc_lport_recv_els_req()
897 lport->tt.disc_recv_req(lport, fp); in fc_lport_recv_els_req()
900 fc_lport_recv_echo_req(lport, fp); in fc_lport_recv_els_req()
903 fc_lport_recv_rlir_req(lport, fp); in fc_lport_recv_els_req()
906 fc_lport_recv_rnid_req(lport, fp); in fc_lport_recv_els_req()
909 fc_rport_recv_req(lport, fp); in fc_lport_recv_els_req()
936 void fc_lport_recv(struct fc_lport *lport, struct fc_frame *fp) in fc_lport_recv() argument
938 struct fc_frame_header *fh = fc_frame_header_get(fp); in fc_lport_recv()
939 struct fc_seq *sp = fr_seq(fp); in fc_lport_recv()
957 prov->recv(lport, fp); in fc_lport_recv()
963 fc_frame_free(fp); in fc_lport_recv()
1068 static void fc_lport_error(struct fc_lport *lport, struct fc_frame *fp) in fc_lport_error() argument
1072 IS_ERR(fp) ? -PTR_ERR(fp) : 0, fc_lport_state(lport), in fc_lport_error()
1075 if (PTR_ERR(fp) == -FC_EX_CLOSED) in fc_lport_error()
1085 if (!fp) in fc_lport_error()
1106 static void fc_lport_ns_resp(struct fc_seq *sp, struct fc_frame *fp, in fc_lport_ns_resp() argument
1113 FC_LPORT_DBG(lport, "Received a ns %s\n", fc_els_resp_type(fp)); in fc_lport_ns_resp()
1115 if (fp == ERR_PTR(-FC_EX_CLOSED)) in fc_lport_ns_resp()
1123 if (IS_ERR(fp)) in fc_lport_ns_resp()
1128 if (IS_ERR(fp)) { in fc_lport_ns_resp()
1129 fc_lport_error(lport, fp); in fc_lport_ns_resp()
1133 fh = fc_frame_header_get(fp); in fc_lport_ns_resp()
1134 ct = fc_frame_payload_get(fp, sizeof(*ct)); in fc_lport_ns_resp()
1164 fc_lport_error(lport, fp); in fc_lport_ns_resp()
1166 fc_frame_free(fp); in fc_lport_ns_resp()
1182 static void fc_lport_ms_resp(struct fc_seq *sp, struct fc_frame *fp, in fc_lport_ms_resp() argument
1189 FC_LPORT_DBG(lport, "Received a ms %s\n", fc_els_resp_type(fp)); in fc_lport_ms_resp()
1191 if (fp == ERR_PTR(-FC_EX_CLOSED)) in fc_lport_ms_resp()
1199 if (IS_ERR(fp)) in fc_lport_ms_resp()
1204 if (IS_ERR(fp)) { in fc_lport_ms_resp()
1205 fc_lport_error(lport, fp); in fc_lport_ms_resp()
1209 fh = fc_frame_header_get(fp); in fc_lport_ms_resp()
1210 ct = fc_frame_payload_get(fp, sizeof(*ct)); in fc_lport_ms_resp()
1242 fc_lport_error(lport, fp); in fc_lport_ms_resp()
1245 fc_frame_free(fp); in fc_lport_ms_resp()
1260 static void fc_lport_scr_resp(struct fc_seq *sp, struct fc_frame *fp, in fc_lport_scr_resp() argument
1266 FC_LPORT_DBG(lport, "Received a SCR %s\n", fc_els_resp_type(fp)); in fc_lport_scr_resp()
1268 if (fp == ERR_PTR(-FC_EX_CLOSED)) in fc_lport_scr_resp()
1276 if (IS_ERR(fp)) in fc_lport_scr_resp()
1281 if (IS_ERR(fp)) { in fc_lport_scr_resp()
1282 fc_lport_error(lport, fp); in fc_lport_scr_resp()
1286 op = fc_frame_payload_op(fp); in fc_lport_scr_resp()
1290 fc_lport_error(lport, fp); in fc_lport_scr_resp()
1293 fc_frame_free(fp); in fc_lport_scr_resp()
1304 struct fc_frame *fp; in fc_lport_enter_scr() local
1313 fp = fc_frame_alloc(lport, sizeof(struct fc_els_scr)); in fc_lport_enter_scr()
1314 if (!fp) { in fc_lport_enter_scr()
1315 fc_lport_error(lport, fp); in fc_lport_enter_scr()
1319 if (!lport->tt.elsct_send(lport, FC_FID_FCTRL, fp, ELS_SCR, in fc_lport_enter_scr()
1332 struct fc_frame *fp; in fc_lport_enter_ns() local
1379 fp = fc_frame_alloc(lport, size); in fc_lport_enter_ns()
1380 if (!fp) { in fc_lport_enter_ns()
1381 fc_lport_error(lport, fp); in fc_lport_enter_ns()
1385 if (!lport->tt.elsct_send(lport, FC_FID_DIR_SERV, fp, cmd, in fc_lport_enter_ns()
1388 fc_lport_error(lport, fp); in fc_lport_enter_ns()
1431 struct fc_frame *fp; in fc_lport_enter_ms() local
1499 fp = fc_frame_alloc(lport, size); in fc_lport_enter_ms()
1500 if (!fp) { in fc_lport_enter_ms()
1501 fc_lport_error(lport, fp); in fc_lport_enter_ms()
1505 if (!lport->tt.elsct_send(lport, FC_FID_MGMT_SERV, fp, cmd, in fc_lport_enter_ms()
1508 fc_lport_error(lport, fp); in fc_lport_enter_ms()
1603 void fc_lport_logo_resp(struct fc_seq *sp, struct fc_frame *fp, in fc_lport_logo_resp() argument
1609 FC_LPORT_DBG(lport, "Received a LOGO %s\n", fc_els_resp_type(fp)); in fc_lport_logo_resp()
1611 if (fp == ERR_PTR(-FC_EX_CLOSED)) in fc_lport_logo_resp()
1619 if (IS_ERR(fp)) in fc_lport_logo_resp()
1624 if (IS_ERR(fp)) { in fc_lport_logo_resp()
1625 fc_lport_error(lport, fp); in fc_lport_logo_resp()
1629 op = fc_frame_payload_op(fp); in fc_lport_logo_resp()
1633 fc_lport_error(lport, fp); in fc_lport_logo_resp()
1636 fc_frame_free(fp); in fc_lport_logo_resp()
1648 struct fc_frame *fp; in fc_lport_enter_logo() local
1659 fp = fc_frame_alloc(lport, sizeof(*logo)); in fc_lport_enter_logo()
1660 if (!fp) { in fc_lport_enter_logo()
1661 fc_lport_error(lport, fp); in fc_lport_enter_logo()
1665 if (!lport->tt.elsct_send(lport, FC_FID_FLOGI, fp, ELS_LOGO, in fc_lport_enter_logo()
1681 void fc_lport_flogi_resp(struct fc_seq *sp, struct fc_frame *fp, in fc_lport_flogi_resp() argument
1693 FC_LPORT_DBG(lport, "Received a FLOGI %s\n", fc_els_resp_type(fp)); in fc_lport_flogi_resp()
1695 if (fp == ERR_PTR(-FC_EX_CLOSED)) in fc_lport_flogi_resp()
1703 if (IS_ERR(fp)) in fc_lport_flogi_resp()
1708 if (IS_ERR(fp)) { in fc_lport_flogi_resp()
1709 fc_lport_error(lport, fp); in fc_lport_flogi_resp()
1713 fh = fc_frame_header_get(fp); in fc_lport_flogi_resp()
1714 did = fc_frame_did(fp); in fc_lport_flogi_resp()
1716 fc_frame_payload_op(fp) != ELS_LS_ACC) { in fc_lport_flogi_resp()
1718 fc_lport_error(lport, fp); in fc_lport_flogi_resp()
1722 flp = fc_frame_payload_get(fp, sizeof(*flp)); in fc_lport_flogi_resp()
1725 fc_lport_error(lport, fp); in fc_lport_flogi_resp()
1735 fc_lport_error(lport, fp); in fc_lport_flogi_resp()
1756 fc_lport_set_port_id(lport, did, fp); in fc_lport_flogi_resp()
1761 fc_lport_ptp_setup(lport, fc_frame_sid(fp), in fc_lport_flogi_resp()
1773 fc_lport_set_port_id(lport, did, fp); in fc_lport_flogi_resp()
1778 fc_frame_free(fp); in fc_lport_flogi_resp()
1790 struct fc_frame *fp; in fc_lport_enter_flogi() local
1805 fp = fc_frame_alloc(lport, sizeof(struct fc_els_flogi)); in fc_lport_enter_flogi()
1806 if (!fp) in fc_lport_enter_flogi()
1807 return fc_lport_error(lport, fp); in fc_lport_enter_flogi()
1809 if (!lport->tt.elsct_send(lport, FC_FID_FLOGI, fp, in fc_lport_enter_flogi()
1874 static void fc_lport_bsg_resp(struct fc_seq *sp, struct fc_frame *fp, in fc_lport_bsg_resp() argument
1885 if (IS_ERR(fp)) { in fc_lport_bsg_resp()
1886 bsg_reply->result = (PTR_ERR(fp) == -FC_EX_CLOSED) ? in fc_lport_bsg_resp()
1896 fh = fc_frame_header_get(fp); in fc_lport_bsg_resp()
1897 len = fr_len(fp) - sizeof(*fh); in fc_lport_bsg_resp()
1898 buf = fc_frame_payload_get(fp, 0); in fc_lport_bsg_resp()
1900 if (fr_sof(fp) == FC_SOF_I3 && !ntohs(fh->fh_seq_cnt)) { in fc_lport_bsg_resp()
1904 (unsigned short)fc_frame_payload_op(fp); in fc_lport_bsg_resp()
1916 if (fr_eof(fp) == FC_EOF_T && in fc_lport_bsg_resp()
1928 fc_frame_free(fp); in fc_lport_bsg_resp()
1944 struct fc_frame *fp; in fc_lport_els_request() local
1951 fp = fc_frame_alloc(lport, job->request_payload.payload_len); in fc_lport_els_request()
1952 if (!fp) in fc_lport_els_request()
1956 pp = fc_frame_payload_get(fp, len); in fc_lport_els_request()
1962 fh = fc_frame_header_get(fp); in fc_lport_els_request()
1974 fc_frame_free(fp); in fc_lport_els_request()
1984 if (!fc_exch_seq_send(lport, fp, fc_lport_bsg_resp, in fc_lport_els_request()
2003 struct fc_frame *fp; in fc_lport_ct_request() local
2010 fp = fc_frame_alloc(lport, sizeof(struct fc_ct_hdr) + in fc_lport_ct_request()
2012 if (!fp) in fc_lport_ct_request()
2016 ct = fc_frame_payload_get(fp, len); in fc_lport_ct_request()
2022 fh = fc_frame_header_get(fp); in fc_lport_ct_request()
2034 fc_frame_free(fp); in fc_lport_ct_request()
2044 if (!fc_exch_seq_send(lport, fp, fc_lport_bsg_resp, in fc_lport_ct_request()