Lines Matching refs:lport

73 static int bnx2fc_shost_config(struct fc_lport *lport, struct device *dev);
74 static int bnx2fc_lport_config(struct fc_lport *lport);
75 static int bnx2fc_em_config(struct fc_lport *lport, struct bnx2fc_hba *hba);
93 static void bnx2fc_port_shutdown(struct fc_lport *lport);
108 static inline struct net_device *bnx2fc_netdev(const struct fc_lport *lport) in bnx2fc_netdev() argument
111 ((struct fcoe_port *)lport_priv(lport))->priv)->netdev; in bnx2fc_netdev()
158 static void bnx2fc_abort_io(struct fc_lport *lport) in bnx2fc_abort_io() argument
168 static void bnx2fc_cleanup(struct fc_lport *lport) in bnx2fc_cleanup() argument
170 struct fcoe_port *port = lport_priv(lport); in bnx2fc_cleanup()
243 static int bnx2fc_xmit(struct fc_lport *lport, struct fc_frame *fp) in bnx2fc_xmit() argument
261 port = (struct fcoe_port *)lport_priv(lport); in bnx2fc_xmit()
269 if (!lport->link_up) { in bnx2fc_xmit()
270 BNX2FC_HBA_DBG(lport, "bnx2fc_xmit link down\n"); in bnx2fc_xmit()
277 BNX2FC_HBA_DBG(lport, "FCF not selected yet!\n"); in bnx2fc_xmit()
281 if (fcoe_ctlr_els_send(ctlr, lport, skb)) in bnx2fc_xmit()
302 BNX2FC_HBA_DBG(lport, "xmit: Frame is for offloaded session " in bnx2fc_xmit()
372 if (lport->seq_offload && fr_max_payload(fp)) { in bnx2fc_xmit()
381 stats = per_cpu_ptr(lport->stats, get_cpu()); in bnx2fc_xmit()
387 fr_dev(fp) = lport; in bnx2fc_xmit()
389 fcoe_check_wait_queue(lport, skb); in bnx2fc_xmit()
391 fcoe_check_wait_queue(lport, skb); in bnx2fc_xmit()
409 struct fc_lport *lport; in bnx2fc_rcv() local
421 lport = ctlr->lp; in bnx2fc_rcv()
423 if (unlikely(lport == NULL)) { in bnx2fc_rcv()
453 fr->fr_dev = lport; in bnx2fc_rcv()
496 struct fc_lport *lport; in bnx2fc_recv_frame() local
509 lport = fr->fr_dev; in bnx2fc_recv_frame()
510 if (unlikely(lport == NULL)) { in bnx2fc_recv_frame()
529 fr_dev(fp) = lport; in bnx2fc_recv_frame()
544 vn_port = fc_vport_id_lookup(lport, ntoh24(fh->fh_d_id)); in bnx2fc_recv_frame()
548 BNX2FC_HBA_DBG(lport, "fpma mismatch\n"); in bnx2fc_recv_frame()
578 stats = per_cpu_ptr(lport->stats, smp_processor_id()); in bnx2fc_recv_frame()
591 fc_exch_recv(lport, fp); in bnx2fc_recv_frame()
633 struct fc_lport *lport = shost_priv(shost); in bnx2fc_get_host_stats() local
634 struct fcoe_port *port = lport_priv(lport); in bnx2fc_get_host_stats()
651 BNX2FC_HBA_DBG(lport, "FW stat req timed out\n"); in bnx2fc_get_host_stats()
677 static int bnx2fc_shost_config(struct fc_lport *lport, struct device *dev) in bnx2fc_shost_config() argument
679 struct fcoe_port *port = lport_priv(lport); in bnx2fc_shost_config()
682 struct Scsi_Host *shost = lport->host; in bnx2fc_shost_config()
689 if (lport->vport) in bnx2fc_shost_config()
695 rc = scsi_add_host(lport->host, dev); in bnx2fc_shost_config()
700 if (!lport->vport) in bnx2fc_shost_config()
701 fc_host_max_npiv_vports(lport->host) = USHRT_MAX; in bnx2fc_shost_config()
702 snprintf(fc_host_symbolic_name(lport->host), 256, in bnx2fc_shost_config()
710 static int bnx2fc_link_ok(struct fc_lport *lport) in bnx2fc_link_ok() argument
712 struct fcoe_port *port = lport_priv(lport); in bnx2fc_link_ok()
742 static int bnx2fc_net_config(struct fc_lport *lport, struct net_device *netdev) in bnx2fc_net_config() argument
750 port = lport_priv(lport); in bnx2fc_net_config()
760 if (fc_set_mfs(lport, BNX2FC_MFS)) in bnx2fc_net_config()
765 setup_timer(&port->timer, fcoe_queue_timer, (unsigned long) lport); in bnx2fc_net_config()
767 fcoe_link_speed_update(lport); in bnx2fc_net_config()
769 if (!lport->vport) { in bnx2fc_net_config()
773 BNX2FC_HBA_DBG(lport, "WWNN = 0x%llx\n", wwnn); in bnx2fc_net_config()
774 fc_set_wwnn(lport, wwnn); in bnx2fc_net_config()
780 BNX2FC_HBA_DBG(lport, "WWPN = 0x%llx\n", wwpn); in bnx2fc_net_config()
781 fc_set_wwpn(lport, wwpn); in bnx2fc_net_config()
812 struct fc_lport *lport; in bnx2fc_indicate_netevent() local
870 lport = ctlr->lp; in bnx2fc_indicate_netevent()
871 BNX2FC_HBA_DBG(lport, "netevent handler - event=%s %ld\n", in bnx2fc_indicate_netevent()
874 fcoe_link_speed_update(lport); in bnx2fc_indicate_netevent()
878 if (link_possible && !bnx2fc_link_ok(lport)) { in bnx2fc_indicate_netevent()
886 fc_set_mfs(lport, BNX2FC_MFS); in bnx2fc_indicate_netevent()
902 mutex_lock(&lport->lp_mutex); in bnx2fc_indicate_netevent()
903 list_for_each_entry(vport, &lport->vports, list) in bnx2fc_indicate_netevent()
906 mutex_unlock(&lport->lp_mutex); in bnx2fc_indicate_netevent()
907 fc_host_port_type(lport->host) = in bnx2fc_indicate_netevent()
909 per_cpu_ptr(lport->stats, in bnx2fc_indicate_netevent()
912 fcoe_clean_pending_queue(lport); in bnx2fc_indicate_netevent()
937 static int bnx2fc_libfc_config(struct fc_lport *lport) in bnx2fc_libfc_config() argument
941 memcpy(&lport->tt, &bnx2fc_libfc_fcn_templ, in bnx2fc_libfc_config()
943 fc_elsct_init(lport); in bnx2fc_libfc_config()
944 fc_exch_init(lport); in bnx2fc_libfc_config()
945 fc_rport_init(lport); in bnx2fc_libfc_config()
946 fc_disc_init(lport); in bnx2fc_libfc_config()
947 fc_disc_config(lport, lport); in bnx2fc_libfc_config()
951 static int bnx2fc_em_config(struct fc_lport *lport, struct bnx2fc_hba *hba) in bnx2fc_em_config() argument
960 if (!fc_exch_mgr_alloc(lport, FC_CLASS_3, fcoe_min_xid, in bnx2fc_em_config()
969 static int bnx2fc_lport_config(struct fc_lport *lport) in bnx2fc_lport_config() argument
971 lport->link_up = 0; in bnx2fc_lport_config()
972 lport->qfull = 0; in bnx2fc_lport_config()
973 lport->max_retry_count = BNX2FC_MAX_RETRY_CNT; in bnx2fc_lport_config()
974 lport->max_rport_retry_count = BNX2FC_MAX_RPORT_RETRY_CNT; in bnx2fc_lport_config()
975 lport->e_d_tov = 2 * 1000; in bnx2fc_lport_config()
976 lport->r_a_tov = 10 * 1000; in bnx2fc_lport_config()
978 lport->service_params = (FCP_SPPF_INIT_FCN | FCP_SPPF_RD_XRDY_DIS | in bnx2fc_lport_config()
980 lport->does_npiv = 1; in bnx2fc_lport_config()
982 memset(&lport->rnid_gen, 0, sizeof(struct fc_els_rnid_gen)); in bnx2fc_lport_config()
983 lport->rnid_gen.rnid_atype = BNX2FC_RNID_HBA; in bnx2fc_lport_config()
986 if (fc_lport_init_stats(lport)) in bnx2fc_lport_config()
990 fc_lport_config(lport); in bnx2fc_lport_config()
1028 static void bnx2fc_update_src_mac(struct fc_lport *lport, u8 *addr) in bnx2fc_update_src_mac() argument
1030 struct fcoe_port *port = lport_priv(lport); in bnx2fc_update_src_mac()
1040 static u8 *bnx2fc_get_src_mac(struct fc_lport *lport) in bnx2fc_get_src_mac() argument
1044 port = (struct fcoe_port *)lport_priv(lport); in bnx2fc_get_src_mac()
1108 static void bnx2fc_free_vport(struct bnx2fc_hba *hba, struct fc_lport *lport) in bnx2fc_free_vport() argument
1114 if (blport->lport == lport) { in bnx2fc_free_vport()
1145 bnx2fc_free_vport(interface->hba, port->lport); in bnx2fc_vport_destroy()
1146 bnx2fc_port_shutdown(port->lport); in bnx2fc_vport_destroy()
1154 struct fc_lport *lport = vport->dd_data; in bnx2fc_vport_disable() local
1158 fc_fabric_logoff(lport); in bnx2fc_vport_disable()
1160 lport->boot_time = jiffies; in bnx2fc_vport_disable()
1161 fc_fabric_login(lport); in bnx2fc_vport_disable()
1162 fc_vport_setlink(lport); in bnx2fc_vport_disable()
1425 struct fc_lport *lport, *n_port; in bnx2fc_if_create() local
1442 lport = libfc_host_alloc(&bnx2fc_shost_template, sizeof(*port)); in bnx2fc_if_create()
1444 lport = libfc_vport_create(vport, sizeof(*port)); in bnx2fc_if_create()
1446 if (!lport) { in bnx2fc_if_create()
1450 shost = lport->host; in bnx2fc_if_create()
1451 port = lport_priv(lport); in bnx2fc_if_create()
1452 port->lport = lport; in bnx2fc_if_create()
1458 rc = bnx2fc_lport_config(lport); in bnx2fc_if_create()
1465 fc_set_wwnn(lport, vport->node_name); in bnx2fc_if_create()
1466 fc_set_wwpn(lport, vport->port_name); in bnx2fc_if_create()
1469 rc = bnx2fc_net_config(lport, interface->netdev); in bnx2fc_if_create()
1475 rc = bnx2fc_shost_config(lport, parent); in bnx2fc_if_create()
1483 rc = bnx2fc_libfc_config(lport); in bnx2fc_if_create()
1488 fc_host_port_type(lport->host) = FC_PORTTYPE_UNKNOWN; in bnx2fc_if_create()
1492 rc = bnx2fc_em_config(lport, hba); in bnx2fc_if_create()
1496 rc = fc_exch_mgr_list_clone(n_port, lport); in bnx2fc_if_create()
1507 blport->lport = lport; in bnx2fc_if_create()
1511 return lport; in bnx2fc_if_create()
1516 scsi_host_put(lport->host); in bnx2fc_if_create()
1533 struct fc_lport *lport = ctlr->lp; in bnx2fc_interface_cleanup() local
1534 struct fcoe_port *port = lport_priv(lport); in bnx2fc_interface_cleanup()
1541 fcoe_clean_pending_queue(lport); in bnx2fc_interface_cleanup()
1545 bnx2fc_free_vport(hba, lport); in bnx2fc_interface_cleanup()
1548 static void bnx2fc_if_destroy(struct fc_lport *lport) in bnx2fc_if_destroy() argument
1552 bnx2fc_clean_rx_queue(lport); in bnx2fc_if_destroy()
1555 fc_remove_host(lport->host); in bnx2fc_if_destroy()
1556 scsi_remove_host(lport->host); in bnx2fc_if_destroy()
1562 fc_exch_mgr_free(lport); in bnx2fc_if_destroy()
1565 fc_lport_free_stats(lport); in bnx2fc_if_destroy()
1568 scsi_host_put(lport->host); in bnx2fc_if_destroy()
1574 struct fc_lport *lport = ctlr->lp; in __bnx2fc_destroy() local
1575 struct fcoe_port *port = lport_priv(lport); in __bnx2fc_destroy()
1625 struct fc_lport *lport; in bnx2fc_destroy_work() local
1628 lport = port->lport; in bnx2fc_destroy_work()
1630 BNX2FC_HBA_DBG(lport, "Entered bnx2fc_destroy_work\n"); in bnx2fc_destroy_work()
1632 bnx2fc_if_destroy(lport); in bnx2fc_destroy_work()
1767 struct fc_lport *lport; in bnx2fc_ulp_start() local
1779 lport = ctlr->lp; in bnx2fc_ulp_start()
1782 lport->tt.frame_send = bnx2fc_xmit; in bnx2fc_ulp_start()
1790 static void bnx2fc_port_shutdown(struct fc_lport *lport) in bnx2fc_port_shutdown() argument
1793 fc_fabric_logoff(lport); in bnx2fc_port_shutdown()
1794 fc_lport_destroy(lport); in bnx2fc_port_shutdown()
1800 struct fc_lport *lport; in bnx2fc_stop() local
1806 lport = ctlr->lp; in bnx2fc_stop()
1807 bnx2fc_port_shutdown(lport); in bnx2fc_stop()
1809 mutex_lock(&lport->lp_mutex); in bnx2fc_stop()
1810 list_for_each_entry(vport, &lport->vports, list) in bnx2fc_stop()
1813 mutex_unlock(&lport->lp_mutex); in bnx2fc_stop()
1814 fc_host_port_type(lport->host) = FC_PORTTYPE_UNKNOWN; in bnx2fc_stop()
1816 fcoe_clean_pending_queue(lport); in bnx2fc_stop()
1928 struct fc_lport *lport; in bnx2fc_start_disc() local
1938 lport = ctlr->lp; in bnx2fc_start_disc()
1939 BNX2FC_HBA_DBG(lport, "calling fc_fabric_login\n"); in bnx2fc_start_disc()
1941 if (!bnx2fc_link_ok(lport) && interface->enabled) { in bnx2fc_start_disc()
1942 BNX2FC_HBA_DBG(lport, "ctlr_link_up\n"); in bnx2fc_start_disc()
1944 fc_host_port_type(lport->host) = FC_PORTTYPE_NPORT; in bnx2fc_start_disc()
1957 if (fc_set_mfs(lport, BNX2FC_MFS)) in bnx2fc_start_disc()
1960 fc_lport_init(lport); in bnx2fc_start_disc()
1961 fc_fabric_login(lport); in bnx2fc_start_disc()
2150 struct fc_lport *lport; in _bnx2fc_create() local
2226 lport = bnx2fc_if_create(interface, &cdev->dev, 0); in _bnx2fc_create()
2227 if (!lport) { in _bnx2fc_create()
2237 lport->boot_time = jiffies; in _bnx2fc_create()
2240 ctlr->lp = lport; in _bnx2fc_create()
2248 !bnx2fc_link_ok(lport)) { in _bnx2fc_create()
2250 fc_host_port_type(lport->host) = FC_PORTTYPE_NPORT; in _bnx2fc_create()
2254 BNX2FC_HBA_DBG(lport, "create: START DISC\n"); in _bnx2fc_create()
2415 struct fc_lport *lport = shost_priv(shost); in bnx2fc_fcoe_reset() local
2416 fc_lport_reset(lport); in bnx2fc_fcoe_reset()