Lines Matching refs:fp
156 static int fc_frame_drop(struct fc_lport *lport, struct fc_frame *fp) in fc_frame_drop() argument
158 fc_frame_free(fp); in fc_frame_drop()
397 static void fc_lport_recv_rlir_req(struct fc_lport *lport, struct fc_frame *fp) in fc_lport_recv_rlir_req() argument
404 fc_seq_els_rsp_send(fp, ELS_LS_ACC, NULL); in fc_lport_recv_rlir_req()
405 fc_frame_free(fp); in fc_lport_recv_rlir_req()
416 struct fc_frame *fp; in fc_lport_recv_echo_req() local
432 fp = fc_frame_alloc(lport, len); in fc_lport_recv_echo_req()
433 if (fp) { in fc_lport_recv_echo_req()
434 dp = fc_frame_payload_get(fp, len); in fc_lport_recv_echo_req()
437 fc_fill_reply_hdr(fp, in_fp, FC_RCTL_ELS_REP, 0); in fc_lport_recv_echo_req()
438 lport->tt.frame_send(lport, fp); in fc_lport_recv_echo_req()
451 struct fc_frame *fp; in fc_lport_recv_rnid_req() local
480 fp = fc_frame_alloc(lport, len); in fc_lport_recv_rnid_req()
481 if (fp) { in fc_lport_recv_rnid_req()
482 rp = fc_frame_payload_get(fp, len); in fc_lport_recv_rnid_req()
494 fc_fill_reply_hdr(fp, in_fp, FC_RCTL_ELS_REP, 0); in fc_lport_recv_rnid_req()
495 lport->tt.frame_send(lport, fp); in fc_lport_recv_rnid_req()
506 static void fc_lport_recv_logo_req(struct fc_lport *lport, struct fc_frame *fp) in fc_lport_recv_logo_req() argument
510 fc_seq_els_rsp_send(fp, ELS_LS_ACC, NULL); in fc_lport_recv_logo_req()
512 fc_frame_free(fp); in fc_lport_recv_logo_req()
735 struct fc_frame *fp) in fc_lport_set_port_id() argument
749 lport->tt.lport_set_port_id(lport, port_id, fp); in fc_lport_set_port_id()
792 struct fc_frame *fp; in fc_lport_recv_flogi_req() local
834 fp = fc_frame_alloc(lport, sizeof(*flp)); in fc_lport_recv_flogi_req()
835 if (fp) { in fc_lport_recv_flogi_req()
836 new_flp = fc_frame_payload_get(fp, sizeof(*flp)); in fc_lport_recv_flogi_req()
844 fc_fill_reply_hdr(fp, rx_fp, FC_RCTL_ELS_REP, 0); in fc_lport_recv_flogi_req()
845 fh = fc_frame_header_get(fp); in fc_lport_recv_flogi_req()
848 lport->tt.frame_send(lport, fp); in fc_lport_recv_flogi_req()
851 fc_lport_error(lport, fp); in fc_lport_recv_flogi_req()
871 struct fc_frame *fp) in fc_lport_recv_els_req() argument
881 fc_frame_free(fp); in fc_lport_recv_els_req()
886 switch (fc_frame_payload_op(fp)) { in fc_lport_recv_els_req()
889 fc_lport_recv_flogi_req(lport, fp); in fc_lport_recv_els_req()
891 fc_rport_recv_req(lport, fp); in fc_lport_recv_els_req()
894 if (fc_frame_sid(fp) == FC_FID_FLOGI) in fc_lport_recv_els_req()
895 fc_lport_recv_logo_req(lport, fp); in fc_lport_recv_els_req()
897 fc_rport_recv_req(lport, fp); in fc_lport_recv_els_req()
900 lport->tt.disc_recv_req(lport, fp); in fc_lport_recv_els_req()
903 fc_lport_recv_echo_req(lport, fp); in fc_lport_recv_els_req()
906 fc_lport_recv_rlir_req(lport, fp); in fc_lport_recv_els_req()
909 fc_lport_recv_rnid_req(lport, fp); in fc_lport_recv_els_req()
912 fc_rport_recv_req(lport, fp); in fc_lport_recv_els_req()
939 void fc_lport_recv(struct fc_lport *lport, struct fc_frame *fp) in fc_lport_recv() argument
941 struct fc_frame_header *fh = fc_frame_header_get(fp); in fc_lport_recv()
942 struct fc_seq *sp = fr_seq(fp); in fc_lport_recv()
960 prov->recv(lport, fp); in fc_lport_recv()
966 fc_frame_free(fp); in fc_lport_recv()
1071 static void fc_lport_error(struct fc_lport *lport, struct fc_frame *fp) in fc_lport_error() argument
1075 IS_ERR(fp) ? -PTR_ERR(fp) : 0, fc_lport_state(lport), in fc_lport_error()
1078 if (PTR_ERR(fp) == -FC_EX_CLOSED) in fc_lport_error()
1088 if (!fp) in fc_lport_error()
1109 static void fc_lport_ns_resp(struct fc_seq *sp, struct fc_frame *fp, in fc_lport_ns_resp() argument
1116 FC_LPORT_DBG(lport, "Received a ns %s\n", fc_els_resp_type(fp)); in fc_lport_ns_resp()
1118 if (fp == ERR_PTR(-FC_EX_CLOSED)) in fc_lport_ns_resp()
1126 if (IS_ERR(fp)) in fc_lport_ns_resp()
1131 if (IS_ERR(fp)) { in fc_lport_ns_resp()
1132 fc_lport_error(lport, fp); in fc_lport_ns_resp()
1136 fh = fc_frame_header_get(fp); in fc_lport_ns_resp()
1137 ct = fc_frame_payload_get(fp, sizeof(*ct)); in fc_lport_ns_resp()
1167 fc_lport_error(lport, fp); in fc_lport_ns_resp()
1169 fc_frame_free(fp); in fc_lport_ns_resp()
1185 static void fc_lport_ms_resp(struct fc_seq *sp, struct fc_frame *fp, in fc_lport_ms_resp() argument
1192 FC_LPORT_DBG(lport, "Received a ms %s\n", fc_els_resp_type(fp)); in fc_lport_ms_resp()
1194 if (fp == ERR_PTR(-FC_EX_CLOSED)) in fc_lport_ms_resp()
1202 if (IS_ERR(fp)) in fc_lport_ms_resp()
1207 if (IS_ERR(fp)) { in fc_lport_ms_resp()
1208 fc_lport_error(lport, fp); in fc_lport_ms_resp()
1212 fh = fc_frame_header_get(fp); in fc_lport_ms_resp()
1213 ct = fc_frame_payload_get(fp, sizeof(*ct)); in fc_lport_ms_resp()
1251 fc_lport_error(lport, fp); in fc_lport_ms_resp()
1254 fc_frame_free(fp); in fc_lport_ms_resp()
1269 static void fc_lport_scr_resp(struct fc_seq *sp, struct fc_frame *fp, in fc_lport_scr_resp() argument
1275 FC_LPORT_DBG(lport, "Received a SCR %s\n", fc_els_resp_type(fp)); in fc_lport_scr_resp()
1277 if (fp == ERR_PTR(-FC_EX_CLOSED)) in fc_lport_scr_resp()
1285 if (IS_ERR(fp)) in fc_lport_scr_resp()
1290 if (IS_ERR(fp)) { in fc_lport_scr_resp()
1291 fc_lport_error(lport, fp); in fc_lport_scr_resp()
1295 op = fc_frame_payload_op(fp); in fc_lport_scr_resp()
1299 fc_lport_error(lport, fp); in fc_lport_scr_resp()
1302 fc_frame_free(fp); in fc_lport_scr_resp()
1313 struct fc_frame *fp; in fc_lport_enter_scr() local
1322 fp = fc_frame_alloc(lport, sizeof(struct fc_els_scr)); in fc_lport_enter_scr()
1323 if (!fp) { in fc_lport_enter_scr()
1324 fc_lport_error(lport, fp); in fc_lport_enter_scr()
1328 if (!lport->tt.elsct_send(lport, FC_FID_FCTRL, fp, ELS_SCR, in fc_lport_enter_scr()
1341 struct fc_frame *fp; in fc_lport_enter_ns() local
1388 fp = fc_frame_alloc(lport, size); in fc_lport_enter_ns()
1389 if (!fp) { in fc_lport_enter_ns()
1390 fc_lport_error(lport, fp); in fc_lport_enter_ns()
1394 if (!lport->tt.elsct_send(lport, FC_FID_DIR_SERV, fp, cmd, in fc_lport_enter_ns()
1397 fc_lport_error(lport, fp); in fc_lport_enter_ns()
1440 struct fc_frame *fp; in fc_lport_enter_ms() local
1538 fp = fc_frame_alloc(lport, size); in fc_lport_enter_ms()
1539 if (!fp) { in fc_lport_enter_ms()
1540 fc_lport_error(lport, fp); in fc_lport_enter_ms()
1544 if (!lport->tt.elsct_send(lport, FC_FID_MGMT_SERV, fp, cmd, in fc_lport_enter_ms()
1547 fc_lport_error(lport, fp); in fc_lport_enter_ms()
1650 void fc_lport_logo_resp(struct fc_seq *sp, struct fc_frame *fp, in fc_lport_logo_resp() argument
1656 FC_LPORT_DBG(lport, "Received a LOGO %s\n", fc_els_resp_type(fp)); in fc_lport_logo_resp()
1658 if (fp == ERR_PTR(-FC_EX_CLOSED)) in fc_lport_logo_resp()
1666 if (IS_ERR(fp)) in fc_lport_logo_resp()
1671 if (IS_ERR(fp)) { in fc_lport_logo_resp()
1672 fc_lport_error(lport, fp); in fc_lport_logo_resp()
1676 op = fc_frame_payload_op(fp); in fc_lport_logo_resp()
1680 fc_lport_error(lport, fp); in fc_lport_logo_resp()
1683 fc_frame_free(fp); in fc_lport_logo_resp()
1695 struct fc_frame *fp; in fc_lport_enter_logo() local
1706 fp = fc_frame_alloc(lport, sizeof(*logo)); in fc_lport_enter_logo()
1707 if (!fp) { in fc_lport_enter_logo()
1708 fc_lport_error(lport, fp); in fc_lport_enter_logo()
1712 if (!lport->tt.elsct_send(lport, FC_FID_FLOGI, fp, ELS_LOGO, in fc_lport_enter_logo()
1728 void fc_lport_flogi_resp(struct fc_seq *sp, struct fc_frame *fp, in fc_lport_flogi_resp() argument
1740 FC_LPORT_DBG(lport, "Received a FLOGI %s\n", fc_els_resp_type(fp)); in fc_lport_flogi_resp()
1742 if (fp == ERR_PTR(-FC_EX_CLOSED)) in fc_lport_flogi_resp()
1750 if (IS_ERR(fp)) in fc_lport_flogi_resp()
1755 if (IS_ERR(fp)) { in fc_lport_flogi_resp()
1756 fc_lport_error(lport, fp); in fc_lport_flogi_resp()
1760 fh = fc_frame_header_get(fp); in fc_lport_flogi_resp()
1761 did = fc_frame_did(fp); in fc_lport_flogi_resp()
1763 fc_frame_payload_op(fp) != ELS_LS_ACC) { in fc_lport_flogi_resp()
1765 fc_lport_error(lport, fp); in fc_lport_flogi_resp()
1769 flp = fc_frame_payload_get(fp, sizeof(*flp)); in fc_lport_flogi_resp()
1772 fc_lport_error(lport, fp); in fc_lport_flogi_resp()
1782 fc_lport_error(lport, fp); in fc_lport_flogi_resp()
1803 fc_lport_set_port_id(lport, did, fp); in fc_lport_flogi_resp()
1808 fc_lport_ptp_setup(lport, fc_frame_sid(fp), in fc_lport_flogi_resp()
1820 fc_lport_set_port_id(lport, did, fp); in fc_lport_flogi_resp()
1825 fc_frame_free(fp); in fc_lport_flogi_resp()
1837 struct fc_frame *fp; in fc_lport_enter_flogi() local
1852 fp = fc_frame_alloc(lport, sizeof(struct fc_els_flogi)); in fc_lport_enter_flogi()
1853 if (!fp) in fc_lport_enter_flogi()
1854 return fc_lport_error(lport, fp); in fc_lport_enter_flogi()
1856 if (!lport->tt.elsct_send(lport, FC_FID_FLOGI, fp, in fc_lport_enter_flogi()
1948 static void fc_lport_bsg_resp(struct fc_seq *sp, struct fc_frame *fp, in fc_lport_bsg_resp() argument
1959 if (IS_ERR(fp)) { in fc_lport_bsg_resp()
1960 bsg_reply->result = (PTR_ERR(fp) == -FC_EX_CLOSED) ? in fc_lport_bsg_resp()
1970 fh = fc_frame_header_get(fp); in fc_lport_bsg_resp()
1971 len = fr_len(fp) - sizeof(*fh); in fc_lport_bsg_resp()
1972 buf = fc_frame_payload_get(fp, 0); in fc_lport_bsg_resp()
1974 if (fr_sof(fp) == FC_SOF_I3 && !ntohs(fh->fh_seq_cnt)) { in fc_lport_bsg_resp()
1978 (unsigned short)fc_frame_payload_op(fp); in fc_lport_bsg_resp()
1990 if (fr_eof(fp) == FC_EOF_T && in fc_lport_bsg_resp()
2002 fc_frame_free(fp); in fc_lport_bsg_resp()
2018 struct fc_frame *fp; in fc_lport_els_request() local
2025 fp = fc_frame_alloc(lport, job->request_payload.payload_len); in fc_lport_els_request()
2026 if (!fp) in fc_lport_els_request()
2030 pp = fc_frame_payload_get(fp, len); in fc_lport_els_request()
2036 fh = fc_frame_header_get(fp); in fc_lport_els_request()
2048 fc_frame_free(fp); in fc_lport_els_request()
2058 if (!fc_exch_seq_send(lport, fp, fc_lport_bsg_resp, in fc_lport_els_request()
2077 struct fc_frame *fp; in fc_lport_ct_request() local
2084 fp = fc_frame_alloc(lport, sizeof(struct fc_ct_hdr) + in fc_lport_ct_request()
2086 if (!fp) in fc_lport_ct_request()
2090 ct = fc_frame_payload_get(fp, len); in fc_lport_ct_request()
2096 fh = fc_frame_header_get(fp); in fc_lport_ct_request()
2108 fc_frame_free(fp); in fc_lport_ct_request()
2118 if (!fc_exch_seq_send(lport, fp, fc_lport_bsg_resp, in fc_lport_ct_request()