Lines Matching full:interface
59 static void __bnx2fc_destroy(struct bnx2fc_interface *interface);
66 static void bnx2fc_start_disc(struct bnx2fc_interface *interface);
74 static struct fc_lport *bnx2fc_if_create(struct bnx2fc_interface *interface,
81 static inline void bnx2fc_interface_put(struct bnx2fc_interface *interface);
88 static void bnx2fc_stop(struct bnx2fc_interface *interface);
168 struct bnx2fc_interface *interface = port->priv; in bnx2fc_cleanup() local
169 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_cleanup()
246 struct bnx2fc_interface *interface; in bnx2fc_xmit() local
258 interface = port->priv; in bnx2fc_xmit()
259 hba = interface->hba; in bnx2fc_xmit()
271 if (!interface->ctlr.sel_fcf) { in bnx2fc_xmit()
276 if (fcoe_ctlr_els_send(&interface->ctlr, lport, skb)) in bnx2fc_xmit()
345 skb->dev = interface->netdev; in bnx2fc_xmit()
350 if (interface->ctlr.map_dest) in bnx2fc_xmit()
354 memcpy(eh->h_dest, interface->ctlr.dest_addr, ETH_ALEN); in bnx2fc_xmit()
356 if (unlikely(interface->ctlr.flogi_oxid != FC_XID_UNKNOWN)) in bnx2fc_xmit()
357 memcpy(eh->h_source, interface->ctlr.ctl_src_addr, ETH_ALEN); in bnx2fc_xmit()
406 struct bnx2fc_interface *interface; in bnx2fc_rcv() local
412 interface = container_of(ptype, struct bnx2fc_interface, in bnx2fc_rcv()
414 lport = interface->ctlr.lp; in bnx2fc_rcv()
631 struct bnx2fc_interface *interface = port->priv; in bnx2fc_get_host_stats() local
632 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_get_host_stats()
669 struct bnx2fc_interface *interface = port->priv; in bnx2fc_shost_config() local
692 interface->netdev->name); in bnx2fc_shost_config()
700 struct bnx2fc_interface *interface = port->priv; in bnx2fc_link_speed_update() local
701 struct net_device *netdev = interface->netdev; in bnx2fc_link_speed_update()
729 struct bnx2fc_interface *interface = port->priv; in bnx2fc_link_ok() local
730 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_link_ok()
761 struct bnx2fc_interface *interface; in bnx2fc_net_config() local
766 interface = port->priv; in bnx2fc_net_config()
767 hba = interface->hba; in bnx2fc_net_config()
785 wwnn = fcoe_wwn_from_mac(interface->ctlr.ctl_src_addr, in bnx2fc_net_config()
791 wwpn = fcoe_wwn_from_mac(interface->ctlr.ctl_src_addr, in bnx2fc_net_config()
827 struct bnx2fc_interface *interface, *tmp; in bnx2fc_indicate_netevent() local
859 list_for_each_entry_safe(interface, tmp, &if_list, list) { in bnx2fc_indicate_netevent()
860 if (interface->hba == hba && in bnx2fc_indicate_netevent()
861 interface->vlan_id == (vlan_id & VLAN_VID_MASK)) in bnx2fc_indicate_netevent()
862 __bnx2fc_destroy(interface); in bnx2fc_indicate_netevent()
873 list_for_each_entry(interface, &if_list, list) { in bnx2fc_indicate_netevent()
875 if (interface->hba != hba) in bnx2fc_indicate_netevent()
878 lport = interface->ctlr.lp; in bnx2fc_indicate_netevent()
880 interface->netdev->name, event); in bnx2fc_indicate_netevent()
892 if (interface->enabled) in bnx2fc_indicate_netevent()
893 fcoe_ctlr_link_up(&interface->ctlr); in bnx2fc_indicate_netevent()
894 } else if (fcoe_ctlr_link_down(&interface->ctlr)) { in bnx2fc_indicate_netevent()
992 struct bnx2fc_interface *interface; in bnx2fc_fip_recv() local
993 interface = container_of(ptype, struct bnx2fc_interface, in bnx2fc_fip_recv()
995 fcoe_ctlr_recv(&interface->ctlr, skb); in bnx2fc_fip_recv()
1046 struct bnx2fc_interface *interface = port->priv; in bnx2fc_vport_create() local
1047 struct net_device *netdev = interface->netdev; in bnx2fc_vport_create()
1061 if (!test_bit(BNX2FC_FLAG_FW_INIT_DONE, &interface->hba->flags)) { in bnx2fc_vport_create()
1063 "this interface\n"); in bnx2fc_vport_create()
1068 vn_port = bnx2fc_if_create(interface, &vport->dev, 1); in bnx2fc_vport_create()
1109 struct bnx2fc_interface *interface = port->priv; in bnx2fc_vport_destroy() local
1126 bnx2fc_free_vport(interface->hba, port->lport); in bnx2fc_vport_destroy()
1128 bnx2fc_interface_put(interface); in bnx2fc_vport_destroy()
1149 static int bnx2fc_interface_setup(struct bnx2fc_interface *interface) in bnx2fc_interface_setup() argument
1151 struct net_device *netdev = interface->netdev; in bnx2fc_interface_setup()
1152 struct net_device *physdev = interface->hba->phys_dev; in bnx2fc_interface_setup()
1167 memcpy(interface->ctlr.ctl_src_addr, ha->addr, in bnx2fc_interface_setup()
1178 interface->fip_packet_type.func = bnx2fc_fip_recv; in bnx2fc_interface_setup()
1179 interface->fip_packet_type.type = htons(ETH_P_FIP); in bnx2fc_interface_setup()
1180 interface->fip_packet_type.dev = netdev; in bnx2fc_interface_setup()
1181 dev_add_pack(&interface->fip_packet_type); in bnx2fc_interface_setup()
1183 interface->fcoe_packet_type.func = bnx2fc_rcv; in bnx2fc_interface_setup()
1184 interface->fcoe_packet_type.type = __constant_htons(ETH_P_FCOE); in bnx2fc_interface_setup()
1185 interface->fcoe_packet_type.dev = netdev; in bnx2fc_interface_setup()
1186 dev_add_pack(&interface->fcoe_packet_type); in bnx2fc_interface_setup()
1222 struct bnx2fc_interface *interface; in bnx2fc_interface_release() local
1225 interface = container_of(kref, struct bnx2fc_interface, kref); in bnx2fc_interface_release()
1226 BNX2FC_MISC_DBG("Interface is being released\n"); in bnx2fc_interface_release()
1228 netdev = interface->netdev; in bnx2fc_interface_release()
1231 if (test_and_clear_bit(BNX2FC_CTLR_INIT_DONE, &interface->if_flags)) in bnx2fc_interface_release()
1232 fcoe_ctlr_destroy(&interface->ctlr); in bnx2fc_interface_release()
1234 kfree(interface); in bnx2fc_interface_release()
1240 static inline void bnx2fc_interface_get(struct bnx2fc_interface *interface) in bnx2fc_interface_get() argument
1242 kref_get(&interface->kref); in bnx2fc_interface_get()
1245 static inline void bnx2fc_interface_put(struct bnx2fc_interface *interface) in bnx2fc_interface_put() argument
1247 kref_put(&interface->kref, bnx2fc_interface_release); in bnx2fc_interface_put()
1327 struct bnx2fc_interface *interface; in bnx2fc_interface_create() local
1330 interface = kzalloc(sizeof(*interface), GFP_KERNEL); in bnx2fc_interface_create()
1331 if (!interface) { in bnx2fc_interface_create()
1332 printk(KERN_ERR PFX "Unable to allocate interface structure\n"); in bnx2fc_interface_create()
1336 kref_init(&interface->kref); in bnx2fc_interface_create()
1337 interface->hba = hba; in bnx2fc_interface_create()
1338 interface->netdev = netdev; in bnx2fc_interface_create()
1341 fcoe_ctlr_init(&interface->ctlr, fip_mode); in bnx2fc_interface_create()
1342 interface->ctlr.send = bnx2fc_fip_send; in bnx2fc_interface_create()
1343 interface->ctlr.update_mac = bnx2fc_update_src_mac; in bnx2fc_interface_create()
1344 interface->ctlr.get_src_addr = bnx2fc_get_src_mac; in bnx2fc_interface_create()
1345 set_bit(BNX2FC_CTLR_INIT_DONE, &interface->if_flags); in bnx2fc_interface_create()
1347 rc = bnx2fc_interface_setup(interface); in bnx2fc_interface_create()
1349 return interface; in bnx2fc_interface_create()
1351 fcoe_ctlr_destroy(&interface->ctlr); in bnx2fc_interface_create()
1353 kfree(interface); in bnx2fc_interface_create()
1358 * bnx2fc_if_create - Create FCoE instance on a given interface
1360 * @interface: FCoE interface to create a local port on
1368 static struct fc_lport *bnx2fc_if_create(struct bnx2fc_interface *interface, in bnx2fc_if_create() argument
1381 BNX2FC_HBA_DBG(interface->ctlr.lp, "Unable to alloc blport\n"); in bnx2fc_if_create()
1398 port->priv = interface; in bnx2fc_if_create()
1413 rc = bnx2fc_net_config(lport, interface->netdev); in bnx2fc_if_create()
1422 interface->netdev->name); in bnx2fc_if_create()
1448 bnx2fc_interface_get(interface); in bnx2fc_if_create()
1450 hba = interface->hba; in bnx2fc_if_create()
1467 static void bnx2fc_net_cleanup(struct bnx2fc_interface *interface) in bnx2fc_net_cleanup() argument
1470 __dev_remove_pack(&interface->fcoe_packet_type); in bnx2fc_net_cleanup()
1471 __dev_remove_pack(&interface->fip_packet_type); in bnx2fc_net_cleanup()
1475 static void bnx2fc_interface_cleanup(struct bnx2fc_interface *interface) in bnx2fc_interface_cleanup() argument
1477 struct fc_lport *lport = interface->ctlr.lp; in bnx2fc_interface_cleanup()
1479 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_interface_cleanup()
1487 bnx2fc_net_cleanup(interface); in bnx2fc_interface_cleanup()
1515 static void __bnx2fc_destroy(struct bnx2fc_interface *interface) in __bnx2fc_destroy() argument
1517 struct fc_lport *lport = interface->ctlr.lp; in __bnx2fc_destroy()
1520 bnx2fc_interface_cleanup(interface); in __bnx2fc_destroy()
1521 bnx2fc_stop(interface); in __bnx2fc_destroy()
1522 list_del(&interface->list); in __bnx2fc_destroy()
1523 bnx2fc_interface_put(interface); in __bnx2fc_destroy()
1528 * bnx2fc_destroy - Destroy a bnx2fc FCoE interface
1530 * @buffer: The name of the Ethernet interface to be destroyed
1539 struct bnx2fc_interface *interface = NULL; in bnx2fc_destroy() local
1545 interface = bnx2fc_interface_lookup(netdev); in bnx2fc_destroy()
1546 if (!interface || !interface->ctlr.lp) { in bnx2fc_destroy()
1548 printk(KERN_ERR PFX "bnx2fc_destroy: interface or lport not found\n"); in bnx2fc_destroy()
1553 destroy_workqueue(interface->timer_work_queue); in bnx2fc_destroy()
1554 __bnx2fc_destroy(interface); in bnx2fc_destroy()
1633 * This bnx2fc - cnic interface api callback is used after following
1635 * a) underlying network interface is up (marked by event NETDEV_UP
1642 struct bnx2fc_interface *interface; in bnx2fc_ulp_start() local
1652 list_for_each_entry(interface, &if_list, list) { in bnx2fc_ulp_start()
1653 if (interface->hba == hba) { in bnx2fc_ulp_start()
1654 lport = interface->ctlr.lp; in bnx2fc_ulp_start()
1658 bnx2fc_start_disc(interface); in bnx2fc_ulp_start()
1672 static void bnx2fc_stop(struct bnx2fc_interface *interface) in bnx2fc_stop() argument
1677 if (!test_bit(BNX2FC_FLAG_FW_INIT_DONE, &interface->hba->flags)) in bnx2fc_stop()
1680 lport = interface->ctlr.lp; in bnx2fc_stop()
1689 fcoe_ctlr_link_down(&interface->ctlr); in bnx2fc_stop()
1773 struct bnx2fc_interface *interface; in bnx2fc_ulp_stop() local
1780 list_for_each_entry(interface, &if_list, list) { in bnx2fc_ulp_stop()
1781 if (interface->hba == hba) in bnx2fc_ulp_stop()
1782 bnx2fc_stop(interface); in bnx2fc_ulp_stop()
1799 static void bnx2fc_start_disc(struct bnx2fc_interface *interface) in bnx2fc_start_disc() argument
1806 if (!test_bit(BNX2FC_FLAG_FW_INIT_DONE, &interface->hba->flags)) { in bnx2fc_start_disc()
1811 lport = interface->ctlr.lp; in bnx2fc_start_disc()
1814 if (!bnx2fc_link_ok(lport) && interface->enabled) { in bnx2fc_start_disc()
1816 fcoe_ctlr_link_up(&interface->ctlr); in bnx2fc_start_disc()
1818 set_bit(ADAPTER_STATE_READY, &interface->hba->adapter_state); in bnx2fc_start_disc()
1822 while (!interface->ctlr.sel_fcf) { in bnx2fc_start_disc()
1885 struct bnx2fc_interface *interface; in bnx2fc_disable() local
1891 interface = bnx2fc_interface_lookup(netdev); in bnx2fc_disable()
1892 if (!interface || !interface->ctlr.lp) { in bnx2fc_disable()
1894 printk(KERN_ERR PFX "bnx2fc_disable: interface or lport not found\n"); in bnx2fc_disable()
1896 interface->enabled = false; in bnx2fc_disable()
1897 fcoe_ctlr_link_down(&interface->ctlr); in bnx2fc_disable()
1898 fcoe_clean_pending_queue(interface->ctlr.lp); in bnx2fc_disable()
1909 struct bnx2fc_interface *interface; in bnx2fc_enable() local
1915 interface = bnx2fc_interface_lookup(netdev); in bnx2fc_enable()
1916 if (!interface || !interface->ctlr.lp) { in bnx2fc_enable()
1918 printk(KERN_ERR PFX "bnx2fc_enable: interface or lport not found\n"); in bnx2fc_enable()
1919 } else if (!bnx2fc_link_ok(interface->ctlr.lp)) { in bnx2fc_enable()
1920 fcoe_ctlr_link_up(&interface->ctlr); in bnx2fc_enable()
1921 interface->enabled = true; in bnx2fc_enable()
1930 * bnx2fc_create - Create bnx2fc FCoE interface
1932 * @buffer: The name of Ethernet interface to create on
1941 struct bnx2fc_interface *interface; in bnx2fc_create() local
1988 /* obtain interface and initialize rest of the structure */ in bnx2fc_create()
2001 interface = bnx2fc_interface_create(hba, netdev, fip_mode); in bnx2fc_create()
2002 if (!interface) { in bnx2fc_create()
2007 interface->vlan_id = vlan_id; in bnx2fc_create()
2008 interface->vlan_enabled = 1; in bnx2fc_create()
2010 interface->timer_work_queue = in bnx2fc_create()
2012 if (!interface->timer_work_queue) { in bnx2fc_create()
2018 lport = bnx2fc_if_create(interface, &interface->hba->pcidev->dev, 0); in bnx2fc_create()
2020 printk(KERN_ERR PFX "Failed to create interface (%s)\n", in bnx2fc_create()
2026 /* Add interface to if_list */ in bnx2fc_create()
2027 list_add_tail(&interface->list, &if_list); in bnx2fc_create()
2032 interface->ctlr.lp = lport; in bnx2fc_create()
2035 fcoe_ctlr_link_up(&interface->ctlr); in bnx2fc_create()
2037 set_bit(ADAPTER_STATE_READY, &interface->hba->adapter_state); in bnx2fc_create()
2041 bnx2fc_start_disc(interface); in bnx2fc_create()
2042 interface->enabled = true; in bnx2fc_create()
2047 bnx2fc_interface_put(interface); in bnx2fc_create()
2054 destroy_workqueue(interface->timer_work_queue); in bnx2fc_create()
2056 bnx2fc_net_cleanup(interface); in bnx2fc_create()
2057 bnx2fc_interface_put(interface); in bnx2fc_create()
2090 struct bnx2fc_interface *interface; in bnx2fc_interface_lookup() local
2093 list_for_each_entry(interface, &if_list, list) { in bnx2fc_interface_lookup()
2094 if (interface->netdev == netdev) in bnx2fc_interface_lookup()
2095 return interface; in bnx2fc_interface_lookup()
2122 struct bnx2fc_interface *interface, *tmp; in bnx2fc_ulp_exit() local
2144 list_for_each_entry_safe(interface, tmp, &if_list, list) in bnx2fc_ulp_exit()
2146 if (interface->hba == hba) in bnx2fc_ulp_exit()
2147 __bnx2fc_destroy(interface); in bnx2fc_ulp_exit()
2541 * bnx2fc_cnic_cb - global template of bnx2fc - cnic driver interface