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()
1331 struct fc_frame *fp; in fc_lport_enter_ns() local
1378 fp = fc_frame_alloc(lport, size); in fc_lport_enter_ns()
1379 if (!fp) { in fc_lport_enter_ns()
1380 fc_lport_error(lport, fp); in fc_lport_enter_ns()
1384 if (!lport->tt.elsct_send(lport, FC_FID_DIR_SERV, fp, cmd, in fc_lport_enter_ns()
1387 fc_lport_error(lport, fp); in fc_lport_enter_ns()
1429 struct fc_frame *fp; in fc_lport_enter_ms() local
1497 fp = fc_frame_alloc(lport, size); in fc_lport_enter_ms()
1498 if (!fp) { in fc_lport_enter_ms()
1499 fc_lport_error(lport, fp); in fc_lport_enter_ms()
1503 if (!lport->tt.elsct_send(lport, FC_FID_MGMT_SERV, fp, cmd, in fc_lport_enter_ms()
1506 fc_lport_error(lport, fp); in fc_lport_enter_ms()
1601 void fc_lport_logo_resp(struct fc_seq *sp, struct fc_frame *fp, in fc_lport_logo_resp() argument
1607 FC_LPORT_DBG(lport, "Received a LOGO %s\n", fc_els_resp_type(fp)); in fc_lport_logo_resp()
1609 if (fp == ERR_PTR(-FC_EX_CLOSED)) in fc_lport_logo_resp()
1617 if (IS_ERR(fp)) in fc_lport_logo_resp()
1622 if (IS_ERR(fp)) { in fc_lport_logo_resp()
1623 fc_lport_error(lport, fp); in fc_lport_logo_resp()
1627 op = fc_frame_payload_op(fp); in fc_lport_logo_resp()
1631 fc_lport_error(lport, fp); in fc_lport_logo_resp()
1634 fc_frame_free(fp); in fc_lport_logo_resp()
1646 struct fc_frame *fp; in fc_lport_enter_logo() local
1657 fp = fc_frame_alloc(lport, sizeof(*logo)); in fc_lport_enter_logo()
1658 if (!fp) { in fc_lport_enter_logo()
1659 fc_lport_error(lport, fp); in fc_lport_enter_logo()
1663 if (!lport->tt.elsct_send(lport, FC_FID_FLOGI, fp, ELS_LOGO, in fc_lport_enter_logo()
1679 void fc_lport_flogi_resp(struct fc_seq *sp, struct fc_frame *fp, in fc_lport_flogi_resp() argument
1691 FC_LPORT_DBG(lport, "Received a FLOGI %s\n", fc_els_resp_type(fp)); in fc_lport_flogi_resp()
1693 if (fp == ERR_PTR(-FC_EX_CLOSED)) in fc_lport_flogi_resp()
1701 if (IS_ERR(fp)) in fc_lport_flogi_resp()
1706 if (IS_ERR(fp)) { in fc_lport_flogi_resp()
1707 fc_lport_error(lport, fp); in fc_lport_flogi_resp()
1711 fh = fc_frame_header_get(fp); in fc_lport_flogi_resp()
1712 did = fc_frame_did(fp); in fc_lport_flogi_resp()
1714 fc_frame_payload_op(fp) != ELS_LS_ACC) { in fc_lport_flogi_resp()
1716 fc_lport_error(lport, fp); in fc_lport_flogi_resp()
1720 flp = fc_frame_payload_get(fp, sizeof(*flp)); in fc_lport_flogi_resp()
1723 fc_lport_error(lport, fp); in fc_lport_flogi_resp()
1733 fc_lport_error(lport, fp); in fc_lport_flogi_resp()
1754 fc_lport_set_port_id(lport, did, fp); in fc_lport_flogi_resp()
1759 fc_lport_ptp_setup(lport, fc_frame_sid(fp), in fc_lport_flogi_resp()
1771 fc_lport_set_port_id(lport, did, fp); in fc_lport_flogi_resp()
1776 fc_frame_free(fp); in fc_lport_flogi_resp()
1788 struct fc_frame *fp; in fc_lport_enter_flogi() local
1803 fp = fc_frame_alloc(lport, sizeof(struct fc_els_flogi)); in fc_lport_enter_flogi()
1804 if (!fp) in fc_lport_enter_flogi()
1805 return fc_lport_error(lport, fp); in fc_lport_enter_flogi()
1807 if (!lport->tt.elsct_send(lport, FC_FID_FLOGI, fp, in fc_lport_enter_flogi()
1872 static void fc_lport_bsg_resp(struct fc_seq *sp, struct fc_frame *fp, in fc_lport_bsg_resp() argument
1883 if (IS_ERR(fp)) { in fc_lport_bsg_resp()
1884 bsg_reply->result = (PTR_ERR(fp) == -FC_EX_CLOSED) ? in fc_lport_bsg_resp()
1894 fh = fc_frame_header_get(fp); in fc_lport_bsg_resp()
1895 len = fr_len(fp) - sizeof(*fh); in fc_lport_bsg_resp()
1896 buf = fc_frame_payload_get(fp, 0); in fc_lport_bsg_resp()
1898 if (fr_sof(fp) == FC_SOF_I3 && !ntohs(fh->fh_seq_cnt)) { in fc_lport_bsg_resp()
1902 (unsigned short)fc_frame_payload_op(fp); in fc_lport_bsg_resp()
1914 if (fr_eof(fp) == FC_EOF_T && in fc_lport_bsg_resp()
1926 fc_frame_free(fp); in fc_lport_bsg_resp()
1941 struct fc_frame *fp; in fc_lport_els_request() local
1948 fp = fc_frame_alloc(lport, job->request_payload.payload_len); in fc_lport_els_request()
1949 if (!fp) in fc_lport_els_request()
1953 pp = fc_frame_payload_get(fp, len); in fc_lport_els_request()
1959 fh = fc_frame_header_get(fp); in fc_lport_els_request()
1971 fc_frame_free(fp); in fc_lport_els_request()
1981 if (!fc_exch_seq_send(lport, fp, fc_lport_bsg_resp, in fc_lport_els_request()
2000 struct fc_frame *fp; in fc_lport_ct_request() local
2007 fp = fc_frame_alloc(lport, sizeof(struct fc_ct_hdr) + in fc_lport_ct_request()
2009 if (!fp) in fc_lport_ct_request()
2013 ct = fc_frame_payload_get(fp, len); in fc_lport_ct_request()
2019 fh = fc_frame_header_get(fp); in fc_lport_ct_request()
2031 fc_frame_free(fp); in fc_lport_ct_request()
2041 if (!fc_exch_seq_send(lport, fp, fc_lport_bsg_resp, in fc_lport_ct_request()