Lines Matching refs:fp
165 static int fc_frame_drop(struct fc_lport *lport, struct fc_frame *fp) in fc_frame_drop() argument
167 fc_frame_free(fp); in fc_frame_drop()
407 static void fc_lport_recv_rlir_req(struct fc_lport *lport, struct fc_frame *fp) in fc_lport_recv_rlir_req() argument
412 lport->tt.seq_els_rsp_send(fp, ELS_LS_ACC, NULL); in fc_lport_recv_rlir_req()
413 fc_frame_free(fp); in fc_lport_recv_rlir_req()
427 struct fc_frame *fp; in fc_lport_recv_echo_req() local
441 fp = fc_frame_alloc(lport, len); in fc_lport_recv_echo_req()
442 if (fp) { in fc_lport_recv_echo_req()
443 dp = fc_frame_payload_get(fp, len); in fc_lport_recv_echo_req()
446 fc_fill_reply_hdr(fp, in_fp, FC_RCTL_ELS_REP, 0); in fc_lport_recv_echo_req()
447 lport->tt.frame_send(lport, fp); in fc_lport_recv_echo_req()
463 struct fc_frame *fp; in fc_lport_recv_rnid_req() local
490 fp = fc_frame_alloc(lport, len); in fc_lport_recv_rnid_req()
491 if (fp) { in fc_lport_recv_rnid_req()
492 rp = fc_frame_payload_get(fp, len); in fc_lport_recv_rnid_req()
504 fc_fill_reply_hdr(fp, in_fp, FC_RCTL_ELS_REP, 0); in fc_lport_recv_rnid_req()
505 lport->tt.frame_send(lport, fp); in fc_lport_recv_rnid_req()
519 static void fc_lport_recv_logo_req(struct fc_lport *lport, struct fc_frame *fp) in fc_lport_recv_logo_req() argument
521 lport->tt.seq_els_rsp_send(fp, ELS_LS_ACC, NULL); in fc_lport_recv_logo_req()
523 fc_frame_free(fp); in fc_lport_recv_logo_req()
750 struct fc_frame *fp) in fc_lport_set_port_id() argument
762 lport->tt.lport_set_port_id(lport, port_id, fp); in fc_lport_set_port_id()
808 struct fc_frame *fp; in fc_lport_recv_flogi_req() local
848 fp = fc_frame_alloc(lport, sizeof(*flp)); in fc_lport_recv_flogi_req()
849 if (fp) { in fc_lport_recv_flogi_req()
850 new_flp = fc_frame_payload_get(fp, sizeof(*flp)); in fc_lport_recv_flogi_req()
858 fc_fill_reply_hdr(fp, rx_fp, FC_RCTL_ELS_REP, 0); in fc_lport_recv_flogi_req()
859 fh = fc_frame_header_get(fp); in fc_lport_recv_flogi_req()
862 lport->tt.frame_send(lport, fp); in fc_lport_recv_flogi_req()
865 fc_lport_error(lport, fp); in fc_lport_recv_flogi_req()
885 struct fc_frame *fp) in fc_lport_recv_els_req() argument
897 fc_frame_free(fp); in fc_lport_recv_els_req()
903 switch (fc_frame_payload_op(fp)) { in fc_lport_recv_els_req()
909 if (fc_frame_sid(fp) == FC_FID_FLOGI) in fc_lport_recv_els_req()
926 recv(lport, fp); in fc_lport_recv_els_req()
952 struct fc_frame *fp) in fc_lport_recv_req() argument
954 struct fc_frame_header *fh = fc_frame_header_get(fp); in fc_lport_recv_req()
955 struct fc_seq *sp = fr_seq(fp); in fc_lport_recv_req()
973 prov->recv(lport, fp); in fc_lport_recv_req()
979 fc_frame_free(fp); in fc_lport_recv_req()
1084 static void fc_lport_error(struct fc_lport *lport, struct fc_frame *fp) in fc_lport_error() argument
1088 IS_ERR(fp) ? -PTR_ERR(fp) : 0, fc_lport_state(lport), in fc_lport_error()
1091 if (PTR_ERR(fp) == -FC_EX_CLOSED) in fc_lport_error()
1101 if (!fp) in fc_lport_error()
1122 static void fc_lport_ns_resp(struct fc_seq *sp, struct fc_frame *fp, in fc_lport_ns_resp() argument
1129 FC_LPORT_DBG(lport, "Received a ns %s\n", fc_els_resp_type(fp)); in fc_lport_ns_resp()
1131 if (fp == ERR_PTR(-FC_EX_CLOSED)) in fc_lport_ns_resp()
1139 if (IS_ERR(fp)) in fc_lport_ns_resp()
1144 if (IS_ERR(fp)) { in fc_lport_ns_resp()
1145 fc_lport_error(lport, fp); in fc_lport_ns_resp()
1149 fh = fc_frame_header_get(fp); in fc_lport_ns_resp()
1150 ct = fc_frame_payload_get(fp, sizeof(*ct)); in fc_lport_ns_resp()
1180 fc_lport_error(lport, fp); in fc_lport_ns_resp()
1182 fc_frame_free(fp); in fc_lport_ns_resp()
1198 static void fc_lport_ms_resp(struct fc_seq *sp, struct fc_frame *fp, in fc_lport_ms_resp() argument
1205 FC_LPORT_DBG(lport, "Received a ms %s\n", fc_els_resp_type(fp)); in fc_lport_ms_resp()
1207 if (fp == ERR_PTR(-FC_EX_CLOSED)) in fc_lport_ms_resp()
1215 if (IS_ERR(fp)) in fc_lport_ms_resp()
1220 if (IS_ERR(fp)) { in fc_lport_ms_resp()
1221 fc_lport_error(lport, fp); in fc_lport_ms_resp()
1225 fh = fc_frame_header_get(fp); in fc_lport_ms_resp()
1226 ct = fc_frame_payload_get(fp, sizeof(*ct)); in fc_lport_ms_resp()
1258 fc_lport_error(lport, fp); in fc_lport_ms_resp()
1261 fc_frame_free(fp); in fc_lport_ms_resp()
1276 static void fc_lport_scr_resp(struct fc_seq *sp, struct fc_frame *fp, in fc_lport_scr_resp() argument
1282 FC_LPORT_DBG(lport, "Received a SCR %s\n", fc_els_resp_type(fp)); in fc_lport_scr_resp()
1284 if (fp == ERR_PTR(-FC_EX_CLOSED)) in fc_lport_scr_resp()
1292 if (IS_ERR(fp)) in fc_lport_scr_resp()
1297 if (IS_ERR(fp)) { in fc_lport_scr_resp()
1298 fc_lport_error(lport, fp); in fc_lport_scr_resp()
1302 op = fc_frame_payload_op(fp); in fc_lport_scr_resp()
1306 fc_lport_error(lport, fp); in fc_lport_scr_resp()
1309 fc_frame_free(fp); in fc_lport_scr_resp()
1323 struct fc_frame *fp; in fc_lport_enter_scr() local
1330 fp = fc_frame_alloc(lport, sizeof(struct fc_els_scr)); in fc_lport_enter_scr()
1331 if (!fp) { in fc_lport_enter_scr()
1332 fc_lport_error(lport, fp); in fc_lport_enter_scr()
1336 if (!lport->tt.elsct_send(lport, FC_FID_FCTRL, fp, ELS_SCR, in fc_lport_enter_scr()
1351 struct fc_frame *fp; in fc_lport_enter_ns() local
1396 fp = fc_frame_alloc(lport, size); in fc_lport_enter_ns()
1397 if (!fp) { in fc_lport_enter_ns()
1398 fc_lport_error(lport, fp); in fc_lport_enter_ns()
1402 if (!lport->tt.elsct_send(lport, FC_FID_DIR_SERV, fp, cmd, in fc_lport_enter_ns()
1405 fc_lport_error(lport, fp); in fc_lport_enter_ns()
1451 struct fc_frame *fp; in fc_lport_enter_ms() local
1517 fp = fc_frame_alloc(lport, size); in fc_lport_enter_ms()
1518 if (!fp) { in fc_lport_enter_ms()
1519 fc_lport_error(lport, fp); in fc_lport_enter_ms()
1523 if (!lport->tt.elsct_send(lport, FC_FID_MGMT_SERV, fp, cmd, in fc_lport_enter_ms()
1526 fc_lport_error(lport, fp); in fc_lport_enter_ms()
1622 void fc_lport_logo_resp(struct fc_seq *sp, struct fc_frame *fp, in fc_lport_logo_resp() argument
1628 FC_LPORT_DBG(lport, "Received a LOGO %s\n", fc_els_resp_type(fp)); in fc_lport_logo_resp()
1630 if (fp == ERR_PTR(-FC_EX_CLOSED)) in fc_lport_logo_resp()
1638 if (IS_ERR(fp)) in fc_lport_logo_resp()
1643 if (IS_ERR(fp)) { in fc_lport_logo_resp()
1644 fc_lport_error(lport, fp); in fc_lport_logo_resp()
1648 op = fc_frame_payload_op(fp); in fc_lport_logo_resp()
1652 fc_lport_error(lport, fp); in fc_lport_logo_resp()
1655 fc_frame_free(fp); in fc_lport_logo_resp()
1670 struct fc_frame *fp; in fc_lport_enter_logo() local
1679 fp = fc_frame_alloc(lport, sizeof(*logo)); in fc_lport_enter_logo()
1680 if (!fp) { in fc_lport_enter_logo()
1681 fc_lport_error(lport, fp); in fc_lport_enter_logo()
1685 if (!lport->tt.elsct_send(lport, FC_FID_FLOGI, fp, ELS_LOGO, in fc_lport_enter_logo()
1701 void fc_lport_flogi_resp(struct fc_seq *sp, struct fc_frame *fp, in fc_lport_flogi_resp() argument
1713 FC_LPORT_DBG(lport, "Received a FLOGI %s\n", fc_els_resp_type(fp)); in fc_lport_flogi_resp()
1715 if (fp == ERR_PTR(-FC_EX_CLOSED)) in fc_lport_flogi_resp()
1723 if (IS_ERR(fp)) in fc_lport_flogi_resp()
1728 if (IS_ERR(fp)) { in fc_lport_flogi_resp()
1729 fc_lport_error(lport, fp); in fc_lport_flogi_resp()
1733 fh = fc_frame_header_get(fp); in fc_lport_flogi_resp()
1734 did = fc_frame_did(fp); in fc_lport_flogi_resp()
1736 fc_frame_payload_op(fp) != ELS_LS_ACC) { in fc_lport_flogi_resp()
1738 fc_lport_error(lport, fp); in fc_lport_flogi_resp()
1742 flp = fc_frame_payload_get(fp, sizeof(*flp)); in fc_lport_flogi_resp()
1745 fc_lport_error(lport, fp); in fc_lport_flogi_resp()
1755 fc_lport_error(lport, fp); in fc_lport_flogi_resp()
1776 fc_lport_set_port_id(lport, did, fp); in fc_lport_flogi_resp()
1781 fc_lport_ptp_setup(lport, fc_frame_sid(fp), in fc_lport_flogi_resp()
1791 fc_lport_set_port_id(lport, did, fp); in fc_lport_flogi_resp()
1796 fc_frame_free(fp); in fc_lport_flogi_resp()
1811 struct fc_frame *fp; in fc_lport_enter_flogi() local
1824 fp = fc_frame_alloc(lport, sizeof(struct fc_els_flogi)); in fc_lport_enter_flogi()
1825 if (!fp) in fc_lport_enter_flogi()
1826 return fc_lport_error(lport, fp); in fc_lport_enter_flogi()
1828 if (!lport->tt.elsct_send(lport, FC_FID_FLOGI, fp, in fc_lport_enter_flogi()
1899 static void fc_lport_bsg_resp(struct fc_seq *sp, struct fc_frame *fp, in fc_lport_bsg_resp() argument
1909 if (IS_ERR(fp)) { in fc_lport_bsg_resp()
1910 job->reply->result = (PTR_ERR(fp) == -FC_EX_CLOSED) ? in fc_lport_bsg_resp()
1920 fh = fc_frame_header_get(fp); in fc_lport_bsg_resp()
1921 len = fr_len(fp) - sizeof(*fh); in fc_lport_bsg_resp()
1922 buf = fc_frame_payload_get(fp, 0); in fc_lport_bsg_resp()
1924 if (fr_sof(fp) == FC_SOF_I3 && !ntohs(fh->fh_seq_cnt)) { in fc_lport_bsg_resp()
1928 (unsigned short)fc_frame_payload_op(fp); in fc_lport_bsg_resp()
1940 if (fr_eof(fp) == FC_EOF_T && in fc_lport_bsg_resp()
1952 fc_frame_free(fp); in fc_lport_bsg_resp()
1970 struct fc_frame *fp; in fc_lport_els_request() local
1975 fp = fc_frame_alloc(lport, job->request_payload.payload_len); in fc_lport_els_request()
1976 if (!fp) in fc_lport_els_request()
1980 pp = fc_frame_payload_get(fp, len); in fc_lport_els_request()
1986 fh = fc_frame_header_get(fp); in fc_lport_els_request()
1998 fc_frame_free(fp); in fc_lport_els_request()
2008 if (!lport->tt.exch_seq_send(lport, fp, fc_lport_bsg_resp, in fc_lport_els_request()
2030 struct fc_frame *fp; in fc_lport_ct_request() local
2035 fp = fc_frame_alloc(lport, sizeof(struct fc_ct_hdr) + in fc_lport_ct_request()
2037 if (!fp) in fc_lport_ct_request()
2041 ct = fc_frame_payload_get(fp, len); in fc_lport_ct_request()
2047 fh = fc_frame_header_get(fp); in fc_lport_ct_request()
2059 fc_frame_free(fp); in fc_lport_ct_request()
2069 if (!lport->tt.exch_seq_send(lport, fp, fc_lport_bsg_resp, in fc_lport_ct_request()