Lines Matching refs:lport

466 static int fc_seq_send(struct fc_lport *lport, struct fc_seq *sp,  in fc_seq_send()  argument
496 error = lport->tt.frame_send(lport, fp); in fc_seq_send()
711 static struct fc_exch *fc_exch_em_alloc(struct fc_lport *lport, in fc_exch_em_alloc() argument
774 ep->lp = lport; in fc_exch_em_alloc()
799 static inline struct fc_exch *fc_exch_alloc(struct fc_lport *lport, in fc_exch_alloc() argument
804 list_for_each_entry(ema, &lport->ema_list, ema_list) in fc_exch_alloc()
806 return fc_exch_em_alloc(lport, ema->mp); in fc_exch_alloc()
857 static struct fc_exch *fc_exch_resp(struct fc_lport *lport, in fc_exch_resp() argument
864 ep = fc_exch_alloc(lport, fp); in fc_exch_resp()
905 static enum fc_pf_rjt_reason fc_seq_lookup_recip(struct fc_lport *lport, in fc_seq_lookup_recip() argument
960 ep = fc_exch_resp(lport, mp, fp); in fc_seq_lookup_recip()
1145 struct fc_lport *lport = ep->lp; in fc_seq_send_ack() local
1152 fp = fc_frame_alloc(lport, 0); in fc_seq_send_ack()
1187 lport->tt.frame_send(lport, fp); in fc_seq_send_ack()
1207 struct fc_lport *lport; in fc_exch_send_ba_rjt() local
1210 lport = fr_dev(rx_fp); in fc_exch_send_ba_rjt()
1211 fp = fc_frame_alloc(lport, sizeof(*rp)); in fc_exch_send_ba_rjt()
1256 lport->tt.frame_send(lport, fp); in fc_exch_send_ba_rjt()
1324 static struct fc_seq *fc_seq_assign(struct fc_lport *lport, struct fc_frame *fp) in fc_seq_assign() argument
1328 WARN_ON(lport != fr_dev(fp)); in fc_seq_assign()
1332 list_for_each_entry(ema, &lport->ema_list, ema_list) in fc_seq_assign()
1334 fc_seq_lookup_recip(lport, ema->mp, fp) == FC_RJT_NONE) in fc_seq_assign()
1357 static void fc_exch_recv_req(struct fc_lport *lport, struct fc_exch_mgr *mp, in fc_exch_recv_req() argument
1368 lport = fc_vport_id_lookup(lport, ntoh24(fh->fh_d_id)); in fc_exch_recv_req()
1369 if (!lport) { in fc_exch_recv_req()
1373 fr_dev(fp) = lport; in fc_exch_recv_req()
1382 return lport->tt.lport_recv(lport, fp); in fc_exch_recv_req()
1384 reject = fc_seq_lookup_recip(lport, mp, fp); in fc_exch_recv_req()
1405 lport->tt.lport_recv(lport, fp); in fc_exch_recv_req()
1408 FC_LPORT_DBG(lport, "exch/seq lookup failed: reject %x\n", in fc_exch_recv_req()
1682 struct fc_lport *lport; in fc_seq_ls_acc() local
1686 lport = fr_dev(rx_fp); in fc_seq_ls_acc()
1687 fp = fc_frame_alloc(lport, sizeof(*acc)); in fc_seq_ls_acc()
1694 lport->tt.frame_send(lport, fp); in fc_seq_ls_acc()
1709 struct fc_lport *lport; in fc_seq_ls_rjt() local
1713 lport = fr_dev(rx_fp); in fc_seq_ls_rjt()
1714 fp = fc_frame_alloc(lport, sizeof(*rjt)); in fc_seq_ls_rjt()
1723 lport->tt.frame_send(lport, fp); in fc_seq_ls_rjt()
1770 static void fc_exch_pool_reset(struct fc_lport *lport, in fc_exch_pool_reset() argument
1780 if ((lport == ep->lp) && in fc_exch_pool_reset()
1815 void fc_exch_mgr_reset(struct fc_lport *lport, u32 sid, u32 did) in fc_exch_mgr_reset() argument
1820 list_for_each_entry(ema, &lport->ema_list, ema_list) { in fc_exch_mgr_reset()
1822 fc_exch_pool_reset(lport, in fc_exch_mgr_reset()
1836 static struct fc_exch *fc_exch_lookup(struct fc_lport *lport, u32 xid) in fc_exch_lookup() argument
1840 list_for_each_entry(ema, &lport->ema_list, ema_list) in fc_exch_lookup()
1854 struct fc_lport *lport; in fc_exch_els_rec() local
1865 lport = fr_dev(rfp); in fc_exch_els_rec()
1874 ep = fc_exch_lookup(lport, in fc_exch_els_rec()
1875 sid == fc_host_port_id(lport->host) ? oxid : rxid); in fc_exch_els_rec()
1883 fp = fc_frame_alloc(lport, sizeof(*acc)); in fc_exch_els_rec()
1902 lport->tt.frame_send(lport, fp); in fc_exch_els_rec()
1977 static struct fc_seq *fc_exch_seq_send(struct fc_lport *lport, in fc_exch_seq_send() argument
1992 ep = fc_exch_alloc(lport, fp); in fc_exch_seq_send()
2004 ep->lp = lport; in fc_exch_seq_send()
2012 if (ep->xid <= lport->lro_xid && fh->fh_r_ctl == FC_RCTL_DD_UNSOL_CMD) { in fc_exch_seq_send()
2017 if (unlikely(lport->tt.frame_send(lport, fp))) in fc_exch_seq_send()
2047 struct fc_lport *lport; in fc_exch_rrq() local
2052 lport = ep->lp; in fc_exch_rrq()
2054 fp = fc_frame_alloc(lport, sizeof(*rrq)); in fc_exch_rrq()
2070 lport->port_id, FC_TYPE_ELS, in fc_exch_rrq()
2073 if (fc_exch_seq_send(lport, fp, fc_exch_rrq_resp, NULL, ep, in fc_exch_rrq()
2074 lport->e_d_tov)) in fc_exch_rrq()
2096 struct fc_lport *lport; in fc_exch_els_rrq() local
2103 lport = fr_dev(fp); in fc_exch_els_rrq()
2113 xid = fc_host_port_id(lport->host) == sid ? in fc_exch_els_rrq()
2115 ep = fc_exch_lookup(lport, xid); in fc_exch_els_rrq()
2164 struct fc_exch_mgr_anchor *fc_exch_mgr_add(struct fc_lport *lport, in fc_exch_mgr_add() argument
2177 list_add_tail(&ema->ema_list, &lport->ema_list); in fc_exch_mgr_add()
2238 struct fc_exch_mgr *fc_exch_mgr_alloc(struct fc_lport *lport, in fc_exch_mgr_alloc() argument
2251 FC_LPORT_DBG(lport, "Invalid min_xid 0x:%x and max_xid 0x:%x\n", in fc_exch_mgr_alloc()
2307 if (!fc_exch_mgr_add(lport, mp, match)) { in fc_exch_mgr_alloc()
2332 void fc_exch_mgr_free(struct fc_lport *lport) in fc_exch_mgr_free() argument
2337 list_for_each_entry_safe(ema, next, &lport->ema_list, ema_list) in fc_exch_mgr_free()
2350 struct fc_lport *lport, in fc_find_ema() argument
2361 return list_entry(lport->ema_list.prev, in fc_find_ema()
2365 list_for_each_entry(ema, &lport->ema_list, ema_list) { in fc_find_ema()
2377 void fc_exch_recv(struct fc_lport *lport, struct fc_frame *fp) in fc_exch_recv() argument
2384 if (!lport || lport->state == LPORT_ST_DISABLED) { in fc_exch_recv()
2385 FC_LPORT_DBG(lport, "Receiving frames for an lport that " in fc_exch_recv()
2392 ema = fc_find_ema(f_ctl, lport, fh); in fc_exch_recv()
2394 FC_LPORT_DBG(lport, "Unable to find Exchange Manager Anchor," in fc_exch_recv()
2421 fc_exch_recv_req(lport, ema->mp, fp); in fc_exch_recv()
2424 FC_LPORT_DBG(lport, "dropping invalid frame (eof %x)", in fc_exch_recv()
2435 int fc_exch_init(struct fc_lport *lport) in fc_exch_init() argument
2437 if (!lport->tt.seq_start_next) in fc_exch_init()
2438 lport->tt.seq_start_next = fc_seq_start_next; in fc_exch_init()
2440 if (!lport->tt.seq_set_resp) in fc_exch_init()
2441 lport->tt.seq_set_resp = fc_seq_set_resp; in fc_exch_init()
2443 if (!lport->tt.exch_seq_send) in fc_exch_init()
2444 lport->tt.exch_seq_send = fc_exch_seq_send; in fc_exch_init()
2446 if (!lport->tt.seq_send) in fc_exch_init()
2447 lport->tt.seq_send = fc_seq_send; in fc_exch_init()
2449 if (!lport->tt.seq_els_rsp_send) in fc_exch_init()
2450 lport->tt.seq_els_rsp_send = fc_seq_els_rsp_send; in fc_exch_init()
2452 if (!lport->tt.exch_done) in fc_exch_init()
2453 lport->tt.exch_done = fc_exch_done; in fc_exch_init()
2455 if (!lport->tt.exch_mgr_reset) in fc_exch_init()
2456 lport->tt.exch_mgr_reset = fc_exch_mgr_reset; in fc_exch_init()
2458 if (!lport->tt.seq_exch_abort) in fc_exch_init()
2459 lport->tt.seq_exch_abort = fc_seq_exch_abort; in fc_exch_init()
2461 if (!lport->tt.seq_assign) in fc_exch_init()
2462 lport->tt.seq_assign = fc_seq_assign; in fc_exch_init()
2464 if (!lport->tt.seq_release) in fc_exch_init()
2465 lport->tt.seq_release = fc_seq_release; in fc_exch_init()