Lines Matching refs:lport

466 static int fc_seq_send_locked(struct fc_lport *lport, struct fc_seq *sp,  in fc_seq_send_locked()  argument
502 error = lport->tt.frame_send(lport, fp); in fc_seq_send_locked()
528 static int fc_seq_send(struct fc_lport *lport, struct fc_seq *sp, in fc_seq_send() argument
535 error = fc_seq_send_locked(lport, sp, fp); in fc_seq_send()
801 static struct fc_exch *fc_exch_em_alloc(struct fc_lport *lport, in fc_exch_em_alloc() argument
864 ep->lp = lport; in fc_exch_em_alloc()
891 static inline struct fc_exch *fc_exch_alloc(struct fc_lport *lport, in fc_exch_alloc() argument
896 list_for_each_entry(ema, &lport->ema_list, ema_list) in fc_exch_alloc()
898 return fc_exch_em_alloc(lport, ema->mp); in fc_exch_alloc()
955 static struct fc_exch *fc_exch_resp(struct fc_lport *lport, in fc_exch_resp() argument
962 ep = fc_exch_alloc(lport, fp); in fc_exch_resp()
1003 static enum fc_pf_rjt_reason fc_seq_lookup_recip(struct fc_lport *lport, in fc_seq_lookup_recip() argument
1058 ep = fc_exch_resp(lport, mp, fp); in fc_seq_lookup_recip()
1245 struct fc_lport *lport = ep->lp; in fc_seq_send_ack() local
1252 fp = fc_frame_alloc(lport, 0); in fc_seq_send_ack()
1287 lport->tt.frame_send(lport, fp); in fc_seq_send_ack()
1307 struct fc_lport *lport; in fc_exch_send_ba_rjt() local
1310 lport = fr_dev(rx_fp); in fc_exch_send_ba_rjt()
1311 fp = fc_frame_alloc(lport, sizeof(*rp)); in fc_exch_send_ba_rjt()
1356 lport->tt.frame_send(lport, fp); in fc_exch_send_ba_rjt()
1428 static struct fc_seq *fc_seq_assign(struct fc_lport *lport, struct fc_frame *fp) in fc_seq_assign() argument
1432 WARN_ON(lport != fr_dev(fp)); in fc_seq_assign()
1436 list_for_each_entry(ema, &lport->ema_list, ema_list) in fc_seq_assign()
1438 fc_seq_lookup_recip(lport, ema->mp, fp) == FC_RJT_NONE) in fc_seq_assign()
1461 static void fc_exch_recv_req(struct fc_lport *lport, struct fc_exch_mgr *mp, in fc_exch_recv_req() argument
1472 lport = fc_vport_id_lookup(lport, ntoh24(fh->fh_d_id)); in fc_exch_recv_req()
1473 if (!lport) { in fc_exch_recv_req()
1477 fr_dev(fp) = lport; in fc_exch_recv_req()
1486 return lport->tt.lport_recv(lport, fp); in fc_exch_recv_req()
1488 reject = fc_seq_lookup_recip(lport, mp, fp); in fc_exch_recv_req()
1507 lport->tt.lport_recv(lport, fp); in fc_exch_recv_req()
1510 FC_LPORT_DBG(lport, "exch/seq lookup failed: reject %x\n", in fc_exch_recv_req()
1776 struct fc_lport *lport; in fc_seq_ls_acc() local
1780 lport = fr_dev(rx_fp); in fc_seq_ls_acc()
1781 fp = fc_frame_alloc(lport, sizeof(*acc)); in fc_seq_ls_acc()
1788 lport->tt.frame_send(lport, fp); in fc_seq_ls_acc()
1803 struct fc_lport *lport; in fc_seq_ls_rjt() local
1807 lport = fr_dev(rx_fp); in fc_seq_ls_rjt()
1808 fp = fc_frame_alloc(lport, sizeof(*rjt)); in fc_seq_ls_rjt()
1817 lport->tt.frame_send(lport, fp); in fc_seq_ls_rjt()
1864 static void fc_exch_pool_reset(struct fc_lport *lport, in fc_exch_pool_reset() argument
1874 if ((lport == ep->lp) && in fc_exch_pool_reset()
1909 void fc_exch_mgr_reset(struct fc_lport *lport, u32 sid, u32 did) in fc_exch_mgr_reset() argument
1914 list_for_each_entry(ema, &lport->ema_list, ema_list) { in fc_exch_mgr_reset()
1916 fc_exch_pool_reset(lport, in fc_exch_mgr_reset()
1930 static struct fc_exch *fc_exch_lookup(struct fc_lport *lport, u32 xid) in fc_exch_lookup() argument
1934 list_for_each_entry(ema, &lport->ema_list, ema_list) in fc_exch_lookup()
1948 struct fc_lport *lport; in fc_exch_els_rec() local
1959 lport = fr_dev(rfp); in fc_exch_els_rec()
1968 ep = fc_exch_lookup(lport, in fc_exch_els_rec()
1969 sid == fc_host_port_id(lport->host) ? oxid : rxid); in fc_exch_els_rec()
1977 fp = fc_frame_alloc(lport, sizeof(*acc)); in fc_exch_els_rec()
1996 lport->tt.frame_send(lport, fp); in fc_exch_els_rec()
2071 static struct fc_seq *fc_exch_seq_send(struct fc_lport *lport, in fc_exch_seq_send() argument
2086 ep = fc_exch_alloc(lport, fp); in fc_exch_seq_send()
2098 ep->lp = lport; in fc_exch_seq_send()
2106 if (ep->xid <= lport->lro_xid && fh->fh_r_ctl == FC_RCTL_DD_UNSOL_CMD) { in fc_exch_seq_send()
2111 if (unlikely(lport->tt.frame_send(lport, fp))) in fc_exch_seq_send()
2141 struct fc_lport *lport; in fc_exch_rrq() local
2146 lport = ep->lp; in fc_exch_rrq()
2148 fp = fc_frame_alloc(lport, sizeof(*rrq)); in fc_exch_rrq()
2164 lport->port_id, FC_TYPE_ELS, in fc_exch_rrq()
2167 if (fc_exch_seq_send(lport, fp, fc_exch_rrq_resp, NULL, ep, in fc_exch_rrq()
2168 lport->e_d_tov)) in fc_exch_rrq()
2190 struct fc_lport *lport; in fc_exch_els_rrq() local
2197 lport = fr_dev(fp); in fc_exch_els_rrq()
2207 xid = fc_host_port_id(lport->host) == sid ? in fc_exch_els_rrq()
2209 ep = fc_exch_lookup(lport, xid); in fc_exch_els_rrq()
2254 void fc_exch_update_stats(struct fc_lport *lport) in fc_exch_update_stats() argument
2260 st = &lport->host_stats; in fc_exch_update_stats()
2262 list_for_each_entry(ema, &lport->ema_list, ema_list) { in fc_exch_update_stats()
2281 struct fc_exch_mgr_anchor *fc_exch_mgr_add(struct fc_lport *lport, in fc_exch_mgr_add() argument
2294 list_add_tail(&ema->ema_list, &lport->ema_list); in fc_exch_mgr_add()
2355 struct fc_exch_mgr *fc_exch_mgr_alloc(struct fc_lport *lport, in fc_exch_mgr_alloc() argument
2368 FC_LPORT_DBG(lport, "Invalid min_xid 0x:%x and max_xid 0x:%x\n", in fc_exch_mgr_alloc()
2424 if (!fc_exch_mgr_add(lport, mp, match)) { in fc_exch_mgr_alloc()
2449 void fc_exch_mgr_free(struct fc_lport *lport) in fc_exch_mgr_free() argument
2454 list_for_each_entry_safe(ema, next, &lport->ema_list, ema_list) in fc_exch_mgr_free()
2467 struct fc_lport *lport, in fc_find_ema() argument
2478 return list_entry(lport->ema_list.prev, in fc_find_ema()
2482 list_for_each_entry(ema, &lport->ema_list, ema_list) { in fc_find_ema()
2494 void fc_exch_recv(struct fc_lport *lport, struct fc_frame *fp) in fc_exch_recv() argument
2501 if (!lport || lport->state == LPORT_ST_DISABLED) { in fc_exch_recv()
2502 FC_LPORT_DBG(lport, "Receiving frames for an lport that " in fc_exch_recv()
2509 ema = fc_find_ema(f_ctl, lport, fh); in fc_exch_recv()
2511 FC_LPORT_DBG(lport, "Unable to find Exchange Manager Anchor," in fc_exch_recv()
2538 fc_exch_recv_req(lport, ema->mp, fp); in fc_exch_recv()
2541 FC_LPORT_DBG(lport, "dropping invalid frame (eof %x)", in fc_exch_recv()
2552 int fc_exch_init(struct fc_lport *lport) in fc_exch_init() argument
2554 if (!lport->tt.seq_start_next) in fc_exch_init()
2555 lport->tt.seq_start_next = fc_seq_start_next; in fc_exch_init()
2557 if (!lport->tt.seq_set_resp) in fc_exch_init()
2558 lport->tt.seq_set_resp = fc_seq_set_resp; in fc_exch_init()
2560 if (!lport->tt.exch_seq_send) in fc_exch_init()
2561 lport->tt.exch_seq_send = fc_exch_seq_send; in fc_exch_init()
2563 if (!lport->tt.seq_send) in fc_exch_init()
2564 lport->tt.seq_send = fc_seq_send; in fc_exch_init()
2566 if (!lport->tt.seq_els_rsp_send) in fc_exch_init()
2567 lport->tt.seq_els_rsp_send = fc_seq_els_rsp_send; in fc_exch_init()
2569 if (!lport->tt.exch_done) in fc_exch_init()
2570 lport->tt.exch_done = fc_exch_done; in fc_exch_init()
2572 if (!lport->tt.exch_mgr_reset) in fc_exch_init()
2573 lport->tt.exch_mgr_reset = fc_exch_mgr_reset; in fc_exch_init()
2575 if (!lport->tt.seq_exch_abort) in fc_exch_init()
2576 lport->tt.seq_exch_abort = fc_seq_exch_abort; in fc_exch_init()
2578 if (!lport->tt.seq_assign) in fc_exch_init()
2579 lport->tt.seq_assign = fc_seq_assign; in fc_exch_init()
2581 if (!lport->tt.seq_release) in fc_exch_init()
2582 lport->tt.seq_release = fc_seq_release; in fc_exch_init()