Lines Matching refs:lport
104 struct fc_rport_priv *fc_rport_lookup(const struct fc_lport *lport, in fc_rport_lookup() argument
110 list_for_each_entry_rcu(tmp_rdata, &lport->disc.rports, peers) in fc_rport_lookup()
128 struct fc_rport_priv *fc_rport_create(struct fc_lport *lport, u32 port_id) in fc_rport_create() argument
133 lockdep_assert_held(&lport->disc.disc_mutex); in fc_rport_create()
135 rdata = fc_rport_lookup(lport, port_id); in fc_rport_create()
141 if (lport->rport_priv_size > 0) in fc_rport_create()
142 rport_priv_size = lport->rport_priv_size; in fc_rport_create()
154 rdata->local_port = lport; in fc_rport_create()
158 rdata->e_d_tov = lport->e_d_tov; in fc_rport_create()
159 rdata->r_a_tov = lport->r_a_tov; in fc_rport_create()
164 rdata->lld_event_callback = lport->tt.rport_event_callback; in fc_rport_create()
165 list_add_rcu(&rdata->peers, &lport->disc.rports); in fc_rport_create()
265 struct fc_lport *lport = rdata->local_port; in fc_rport_work() local
289 rport = fc_remote_port_add(lport->host, 0, &ids); in fc_rport_work()
305 rpriv->local_port = lport; in fc_rport_work()
314 rport_ops->event_callback(lport, rdata, event); in fc_rport_work()
318 rdata->lld_event_callback(lport, rdata, event); in fc_rport_work()
340 rport_ops->event_callback(lport, rdata, event); in fc_rport_work()
344 rdata->lld_event_callback(lport, rdata, event); in fc_rport_work()
352 lport->tt.exch_mgr_reset(lport, 0, port_id); in fc_rport_work()
353 lport->tt.exch_mgr_reset(lport, port_id, 0); in fc_rport_work()
372 lport->max_rport_retry_count) { in fc_rport_work()
381 mutex_lock(&lport->disc.disc_mutex); in fc_rport_work()
383 mutex_unlock(&lport->disc.disc_mutex); in fc_rport_work()
505 struct fc_lport *lport = rdata->local_port; in fc_rport_logoff() local
523 lport->tt.exch_mgr_reset(lport, 0, port_id); in fc_rport_logoff()
524 lport->tt.exch_mgr_reset(lport, port_id, 0); in fc_rport_logoff()
615 struct fc_lport *lport = rdata->local_port; in fc_rport_error() local
628 if (lport->point_to_multipoint) { in fc_rport_error()
701 struct fc_lport *lport = rdata->local_port; in fc_rport_login_complete() local
728 rdata->maxframe_size = fc_plogi_get_maxframe(flogi, lport->mfs); in fc_rport_login_complete()
742 struct fc_lport *lport = rdata->local_port; in fc_rport_flogi_resp() local
797 if (rdata->ids.port_name < lport->wwpn) in fc_rport_flogi_resp()
822 struct fc_lport *lport = rdata->local_port; in fc_rport_enter_flogi() local
827 if (!lport->point_to_multipoint) in fc_rport_enter_flogi()
835 fp = fc_frame_alloc(lport, sizeof(struct fc_els_flogi)); in fc_rport_enter_flogi()
840 if (!lport->tt.elsct_send(lport, rdata->ids.port_id, fp, ELS_FLOGI, in fc_rport_enter_flogi()
842 2 * lport->r_a_tov)) { in fc_rport_enter_flogi()
855 static void fc_rport_recv_flogi_req(struct fc_lport *lport, in fc_rport_recv_flogi_req() argument
866 FC_RPORT_ID_DBG(lport, sid, "Received FLOGI request\n"); in fc_rport_recv_flogi_req()
868 if (!lport->point_to_multipoint) { in fc_rport_recv_flogi_req()
881 rdata = fc_rport_lookup(lport, sid); in fc_rport_recv_flogi_req()
937 fp = fc_frame_alloc(lport, sizeof(*flp)); in fc_rport_recv_flogi_req()
941 fc_flogi_fill(lport, fp); in fc_rport_recv_flogi_req()
946 lport->tt.frame_send(lport, fp); in fc_rport_recv_flogi_req()
954 if (rdata->ids.port_name < lport->wwpn) in fc_rport_recv_flogi_req()
986 struct fc_lport *lport = rdata->local_port; in fc_rport_plogi_resp() local
1021 if (lport->point_to_multipoint) in fc_rport_plogi_resp()
1028 rdata->maxframe_size = fc_plogi_get_maxframe(plp, lport->mfs); in fc_rport_plogi_resp()
1050 fc_rport_compatible_roles(struct fc_lport *lport, struct fc_rport_priv *rdata) in fc_rport_compatible_roles() argument
1055 (lport->service_params & FCP_SPPF_INIT_FCN)) in fc_rport_compatible_roles()
1058 (lport->service_params & FCP_SPPF_TARG_FCN)) in fc_rport_compatible_roles()
1071 struct fc_lport *lport = rdata->local_port; in fc_rport_enter_plogi() local
1076 if (!fc_rport_compatible_roles(lport, rdata)) { in fc_rport_enter_plogi()
1088 fp = fc_frame_alloc(lport, sizeof(struct fc_els_flogi)); in fc_rport_enter_plogi()
1094 rdata->e_d_tov = lport->e_d_tov; in fc_rport_enter_plogi()
1097 if (!lport->tt.elsct_send(lport, rdata->ids.port_id, fp, ELS_PLOGI, in fc_rport_enter_plogi()
1099 2 * lport->r_a_tov)) { in fc_rport_enter_plogi()
1247 struct fc_lport *lport = rdata->local_port; in fc_rport_enter_prli() local
1270 if (!(lport->service_params & FCP_SPPF_INIT_FCN)) { in fc_rport_enter_prli()
1280 fp = fc_frame_alloc(lport, sizeof(*pp)); in fc_rport_enter_prli()
1286 fc_prli_fill(lport, fp); in fc_rport_enter_prli()
1295 fc_host_port_id(lport->host), FC_TYPE_ELS, in fc_rport_enter_prli()
1299 if (!fc_exch_seq_send(lport, fp, fc_rport_prli_resp, in fc_rport_enter_prli()
1300 NULL, rdata, 2 * lport->r_a_tov)) { in fc_rport_enter_prli()
1387 struct fc_lport *lport = rdata->local_port; in fc_rport_enter_rtv() local
1396 fp = fc_frame_alloc(lport, sizeof(struct fc_els_rtv)); in fc_rport_enter_rtv()
1403 if (!lport->tt.elsct_send(lport, rdata->ids.port_id, fp, ELS_RTV, in fc_rport_enter_rtv()
1405 2 * lport->r_a_tov)) { in fc_rport_enter_rtv()
1419 struct fc_lport *lport = rdata->local_port; in fc_rport_recv_rtv_req() local
1425 lockdep_assert_held(&lport->lp_mutex); in fc_rport_recv_rtv_req()
1429 fp = fc_frame_alloc(lport, sizeof(*rtv)); in fc_rport_recv_rtv_req()
1438 rtv->rtv_r_a_tov = htonl(lport->r_a_tov); in fc_rport_recv_rtv_req()
1439 rtv->rtv_e_d_tov = htonl(lport->e_d_tov); in fc_rport_recv_rtv_req()
1442 lport->tt.frame_send(lport, fp); in fc_rport_recv_rtv_req()
1457 struct fc_lport *lport = rdata->local_port; in fc_rport_logo_resp() local
1459 FC_RPORT_ID_DBG(lport, fc_seq_exch(sp)->did, in fc_rport_logo_resp()
1474 struct fc_lport *lport = rdata->local_port; in fc_rport_enter_logo() local
1482 fp = fc_frame_alloc(lport, sizeof(struct fc_els_logo)); in fc_rport_enter_logo()
1486 if (!lport->tt.elsct_send(lport, rdata->ids.port_id, fp, ELS_LOGO, in fc_rport_enter_logo()
1561 struct fc_lport *lport = rdata->local_port; in fc_rport_enter_adisc() local
1571 fp = fc_frame_alloc(lport, sizeof(struct fc_els_adisc)); in fc_rport_enter_adisc()
1577 if (!lport->tt.elsct_send(lport, rdata->ids.port_id, fp, ELS_ADISC, in fc_rport_enter_adisc()
1579 2 * lport->r_a_tov)) { in fc_rport_enter_adisc()
1593 struct fc_lport *lport = rdata->local_port; in fc_rport_recv_adisc_req() local
1599 lockdep_assert_held(&lport->lp_mutex); in fc_rport_recv_adisc_req()
1611 fp = fc_frame_alloc(lport, sizeof(*adisc)); in fc_rport_recv_adisc_req()
1614 fc_adisc_fill(lport, fp); in fc_rport_recv_adisc_req()
1618 lport->tt.frame_send(lport, fp); in fc_rport_recv_adisc_req()
1632 struct fc_lport *lport = rdata->local_port; in fc_rport_recv_rls_req() local
1652 fp = fc_frame_alloc(lport, sizeof(*rsp)); in fc_rport_recv_rls_req()
1663 if (lport->tt.get_lesb) { in fc_rport_recv_rls_req()
1665 lport->tt.get_lesb(lport, lesb); in fc_rport_recv_rls_req()
1667 fc_get_host_stats(lport->host); in fc_rport_recv_rls_req()
1668 hst = &lport->host_stats; in fc_rport_recv_rls_req()
1678 lport->tt.frame_send(lport, fp); in fc_rport_recv_rls_req()
1697 static void fc_rport_recv_els_req(struct fc_lport *lport, struct fc_frame *fp) in fc_rport_recv_els_req() argument
1702 lockdep_assert_held(&lport->lp_mutex); in fc_rport_recv_els_req()
1704 rdata = fc_rport_lookup(lport, fc_frame_sid(fp)); in fc_rport_recv_els_req()
1706 FC_RPORT_ID_DBG(lport, fc_frame_sid(fp), in fc_rport_recv_els_req()
1794 void fc_rport_recv_req(struct fc_lport *lport, struct fc_frame *fp) in fc_rport_recv_req() argument
1798 lockdep_assert_held(&lport->lp_mutex); in fc_rport_recv_req()
1808 fc_rport_recv_flogi_req(lport, fp); in fc_rport_recv_req()
1811 fc_rport_recv_plogi_req(lport, fp); in fc_rport_recv_req()
1814 fc_rport_recv_logo_req(lport, fp); in fc_rport_recv_req()
1823 fc_rport_recv_els_req(lport, fp); in fc_rport_recv_req()
1842 static void fc_rport_recv_plogi_req(struct fc_lport *lport, in fc_rport_recv_plogi_req() argument
1852 lockdep_assert_held(&lport->lp_mutex); in fc_rport_recv_plogi_req()
1856 FC_RPORT_ID_DBG(lport, sid, "Received PLOGI request\n"); in fc_rport_recv_plogi_req()
1860 FC_RPORT_ID_DBG(lport, sid, "Received PLOGI too short\n"); in fc_rport_recv_plogi_req()
1866 disc = &lport->disc; in fc_rport_recv_plogi_req()
1868 rdata = fc_rport_create(lport, sid); in fc_rport_recv_plogi_req()
1902 if (rdata->ids.port_name < lport->wwpn) { in fc_rport_recv_plogi_req()
1926 if (!fc_rport_compatible_roles(lport, rdata)) { in fc_rport_recv_plogi_req()
1937 rdata->maxframe_size = fc_plogi_get_maxframe(pl, lport->mfs); in fc_rport_recv_plogi_req()
1942 fp = fc_frame_alloc(lport, sizeof(*pl)); in fc_rport_recv_plogi_req()
1946 fc_plogi_fill(lport, fp, ELS_LS_ACC); in fc_rport_recv_plogi_req()
1948 lport->tt.frame_send(lport, fp); in fc_rport_recv_plogi_req()
1968 struct fc_lport *lport = rdata->local_port; in fc_rport_recv_prli_req() local
2002 fp = fc_frame_alloc(lport, len); in fc_rport_recv_prli_req()
2063 lport->tt.frame_send(lport, fp); in fc_rport_recv_prli_req()
2084 struct fc_lport *lport = rdata->local_port; in fc_rport_recv_prlo_req() local
2113 fp = fc_frame_alloc(lport, len); in fc_rport_recv_prlo_req()
2134 lport->tt.frame_send(lport, fp); in fc_rport_recv_prlo_req()
2153 static void fc_rport_recv_logo_req(struct fc_lport *lport, struct fc_frame *fp) in fc_rport_recv_logo_req() argument
2158 lockdep_assert_held(&lport->lp_mutex); in fc_rport_recv_logo_req()
2164 rdata = fc_rport_lookup(lport, sid); in fc_rport_recv_logo_req()
2174 FC_RPORT_ID_DBG(lport, sid, in fc_rport_recv_logo_req()
2202 struct fc_lport *lport = rdata->local_port; in fc_rport_fcp_prli() local
2215 if (!(lport->service_params & FCP_SPPF_INIT_FCN)) in fc_rport_fcp_prli()
2224 spp->spp_params = htonl(fcp_parm | lport->service_params); in fc_rport_fcp_prli()
2287 struct fc_lport *lport = rpriv->local_port; in fc_rport_terminate_io() local
2289 lport->tt.exch_mgr_reset(lport, 0, rport->port_id); in fc_rport_terminate_io()
2290 lport->tt.exch_mgr_reset(lport, rport->port_id, 0); in fc_rport_terminate_io()