Lines Matching full:interface
62 static void __bnx2fc_destroy(struct bnx2fc_interface *interface);
67 /* fcoe_syfs control interface handlers */
73 static void bnx2fc_start_disc(struct bnx2fc_interface *interface);
81 static struct fc_lport *bnx2fc_if_create(struct bnx2fc_interface *interface,
88 static inline void bnx2fc_interface_put(struct bnx2fc_interface *interface);
95 static void bnx2fc_stop(struct bnx2fc_interface *interface);
190 struct bnx2fc_interface *interface = port->priv; in bnx2fc_cleanup() local
191 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_cleanup()
268 struct bnx2fc_interface *interface; in bnx2fc_xmit() local
281 interface = port->priv; in bnx2fc_xmit()
282 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_xmit()
283 hba = interface->hba; in bnx2fc_xmit()
368 skb->dev = interface->netdev; in bnx2fc_xmit()
429 struct bnx2fc_interface *interface; in bnx2fc_rcv() local
435 interface = container_of(ptype, struct bnx2fc_interface, in bnx2fc_rcv()
437 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_rcv()
521 struct bnx2fc_interface *interface; in bnx2fc_recv_frame() local
559 interface = phys_port->priv; in bnx2fc_recv_frame()
560 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_recv_frame()
685 struct bnx2fc_interface *interface = port->priv; in bnx2fc_get_host_stats() local
686 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_get_host_stats()
735 struct bnx2fc_interface *interface = port->priv; in bnx2fc_shost_config() local
736 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_shost_config()
760 interface->netdev->name); in bnx2fc_shost_config()
768 struct bnx2fc_interface *interface = port->priv; in bnx2fc_link_ok() local
769 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_link_ok()
800 struct bnx2fc_interface *interface; in bnx2fc_net_config() local
806 interface = port->priv; in bnx2fc_net_config()
807 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_net_config()
808 hba = interface->hba; in bnx2fc_net_config()
869 struct bnx2fc_interface *interface, *tmp; in bnx2fc_indicate_netevent() local
902 list_for_each_entry_safe(interface, tmp, &if_list, list) { in bnx2fc_indicate_netevent()
903 if (interface->hba == hba && in bnx2fc_indicate_netevent()
904 interface->vlan_id == (vlan_id & VLAN_VID_MASK)) in bnx2fc_indicate_netevent()
905 __bnx2fc_destroy(interface); in bnx2fc_indicate_netevent()
918 list_for_each_entry(interface, &if_list, list) { in bnx2fc_indicate_netevent()
920 if (interface->hba != hba) in bnx2fc_indicate_netevent()
923 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_indicate_netevent()
926 interface->netdev->name, event); in bnx2fc_indicate_netevent()
935 pr_info("Link up while interface is disabled.\n"); in bnx2fc_indicate_netevent()
946 if (interface->enabled) in bnx2fc_indicate_netevent()
952 pr_info("Link down while interface is disabled.\n"); in bnx2fc_indicate_netevent()
1062 struct bnx2fc_interface *interface; in bnx2fc_fip_recv() local
1064 interface = container_of(ptype, struct bnx2fc_interface, in bnx2fc_fip_recv()
1066 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_fip_recv()
1131 struct bnx2fc_interface *interface = port->priv; in bnx2fc_vport_create() local
1132 struct net_device *netdev = interface->netdev; in bnx2fc_vport_create()
1146 if (!test_bit(BNX2FC_FLAG_FW_INIT_DONE, &interface->hba->flags)) { in bnx2fc_vport_create()
1148 "this interface\n"); in bnx2fc_vport_create()
1153 vn_port = bnx2fc_if_create(interface, &vport->dev, 1); in bnx2fc_vport_create()
1197 struct bnx2fc_interface *interface = port->priv; in bnx2fc_vport_destroy() local
1214 bnx2fc_free_vport(interface->hba, port->lport); in bnx2fc_vport_destroy()
1216 bnx2fc_interface_put(interface); in bnx2fc_vport_destroy()
1237 static int bnx2fc_interface_setup(struct bnx2fc_interface *interface) in bnx2fc_interface_setup() argument
1239 struct net_device *netdev = interface->netdev; in bnx2fc_interface_setup()
1240 struct net_device *physdev = interface->hba->phys_dev; in bnx2fc_interface_setup()
1241 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_interface_setup()
1267 interface->fip_packet_type.func = bnx2fc_fip_recv; in bnx2fc_interface_setup()
1268 interface->fip_packet_type.type = htons(ETH_P_FIP); in bnx2fc_interface_setup()
1269 interface->fip_packet_type.dev = netdev; in bnx2fc_interface_setup()
1270 dev_add_pack(&interface->fip_packet_type); in bnx2fc_interface_setup()
1272 interface->fcoe_packet_type.func = bnx2fc_rcv; in bnx2fc_interface_setup()
1273 interface->fcoe_packet_type.type = __constant_htons(ETH_P_FCOE); in bnx2fc_interface_setup()
1274 interface->fcoe_packet_type.dev = netdev; in bnx2fc_interface_setup()
1275 dev_add_pack(&interface->fcoe_packet_type); in bnx2fc_interface_setup()
1312 struct bnx2fc_interface *interface; in bnx2fc_interface_release() local
1316 interface = container_of(kref, struct bnx2fc_interface, kref); in bnx2fc_interface_release()
1317 BNX2FC_MISC_DBG("Interface is being released\n"); in bnx2fc_interface_release()
1319 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_interface_release()
1321 netdev = interface->netdev; in bnx2fc_interface_release()
1324 if (test_and_clear_bit(BNX2FC_CTLR_INIT_DONE, &interface->if_flags)) in bnx2fc_interface_release()
1333 static inline void bnx2fc_interface_get(struct bnx2fc_interface *interface) in bnx2fc_interface_get() argument
1335 kref_get(&interface->kref); in bnx2fc_interface_get()
1338 static inline void bnx2fc_interface_put(struct bnx2fc_interface *interface) in bnx2fc_interface_put() argument
1340 kref_put(&interface->kref, bnx2fc_interface_release); in bnx2fc_interface_put()
1444 struct bnx2fc_interface *interface; in bnx2fc_interface_create() local
1449 size = (sizeof(*interface) + sizeof(struct fcoe_ctlr)); in bnx2fc_interface_create()
1453 printk(KERN_ERR PFX "Unable to allocate interface structure\n"); in bnx2fc_interface_create()
1458 interface = fcoe_ctlr_priv(ctlr); in bnx2fc_interface_create()
1460 kref_init(&interface->kref); in bnx2fc_interface_create()
1461 interface->hba = hba; in bnx2fc_interface_create()
1462 interface->netdev = netdev; in bnx2fc_interface_create()
1469 set_bit(BNX2FC_CTLR_INIT_DONE, &interface->if_flags); in bnx2fc_interface_create()
1471 rc = bnx2fc_interface_setup(interface); in bnx2fc_interface_create()
1473 return interface; in bnx2fc_interface_create()
1482 * bnx2fc_if_create - Create FCoE instance on a given interface
1484 * @interface: FCoE interface to create a local port on
1492 static struct fc_lport *bnx2fc_if_create(struct bnx2fc_interface *interface, in bnx2fc_if_create() argument
1495 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_if_create()
1501 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_if_create()
1524 port->priv = interface; in bnx2fc_if_create()
1540 rc = bnx2fc_net_config(lport, interface->netdev); in bnx2fc_if_create()
1549 interface->netdev->name); in bnx2fc_if_create()
1578 bnx2fc_interface_get(interface); in bnx2fc_if_create()
1596 static void bnx2fc_net_cleanup(struct bnx2fc_interface *interface) in bnx2fc_net_cleanup() argument
1599 __dev_remove_pack(&interface->fcoe_packet_type); in bnx2fc_net_cleanup()
1600 __dev_remove_pack(&interface->fip_packet_type); in bnx2fc_net_cleanup()
1604 static void bnx2fc_interface_cleanup(struct bnx2fc_interface *interface) in bnx2fc_interface_cleanup() argument
1606 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_interface_cleanup()
1609 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_interface_cleanup()
1617 bnx2fc_net_cleanup(interface); in bnx2fc_interface_cleanup()
1645 static void __bnx2fc_destroy(struct bnx2fc_interface *interface) in __bnx2fc_destroy() argument
1647 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in __bnx2fc_destroy()
1651 bnx2fc_interface_cleanup(interface); in __bnx2fc_destroy()
1652 bnx2fc_stop(interface); in __bnx2fc_destroy()
1653 list_del(&interface->list); in __bnx2fc_destroy()
1654 bnx2fc_interface_put(interface); in __bnx2fc_destroy()
1659 * bnx2fc_destroy - Destroy a bnx2fc FCoE interface
1661 * @netdev: The net device that the FCoE interface is on
1669 struct bnx2fc_interface *interface = NULL; in bnx2fc_destroy() local
1677 interface = bnx2fc_interface_lookup(netdev); in bnx2fc_destroy()
1678 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_destroy()
1679 if (!interface || !ctlr->lp) { in bnx2fc_destroy()
1681 printk(KERN_ERR PFX "bnx2fc_destroy: interface or lport not found\n"); in bnx2fc_destroy()
1685 timer_work_queue = interface->timer_work_queue; in bnx2fc_destroy()
1686 __bnx2fc_destroy(interface); in bnx2fc_destroy()
1829 * This bnx2fc - cnic interface api callback is used after following
1831 * a) underlying network interface is up (marked by event NETDEV_UP
1838 struct bnx2fc_interface *interface; in bnx2fc_ulp_start() local
1849 list_for_each_entry(interface, &if_list, list) { in bnx2fc_ulp_start()
1850 if (interface->hba == hba) { in bnx2fc_ulp_start()
1851 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_ulp_start()
1856 bnx2fc_start_disc(interface); in bnx2fc_ulp_start()
1870 static void bnx2fc_stop(struct bnx2fc_interface *interface) in bnx2fc_stop() argument
1872 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_stop()
1876 if (!test_bit(BNX2FC_FLAG_FW_INIT_DONE, &interface->hba->flags)) in bnx2fc_stop()
1971 struct bnx2fc_interface *interface; in bnx2fc_ulp_stop() local
1978 list_for_each_entry(interface, &if_list, list) { in bnx2fc_ulp_stop()
1979 if (interface->hba == hba) in bnx2fc_ulp_stop()
1980 bnx2fc_stop(interface); in bnx2fc_ulp_stop()
1997 static void bnx2fc_start_disc(struct bnx2fc_interface *interface) in bnx2fc_start_disc() argument
1999 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_start_disc()
2005 if (!test_bit(BNX2FC_FLAG_FW_INIT_DONE, &interface->hba->flags)) { in bnx2fc_start_disc()
2013 if (!bnx2fc_link_ok(lport) && interface->enabled) { in bnx2fc_start_disc()
2017 set_bit(ADAPTER_STATE_READY, &interface->hba->adapter_state); in bnx2fc_start_disc()
2087 struct bnx2fc_interface *interface = fcoe_ctlr_priv(ctlr); in __bnx2fc_disable() local
2089 if (interface->enabled == true) { in __bnx2fc_disable()
2094 interface->enabled = false; in __bnx2fc_disable()
2107 struct bnx2fc_interface *interface; in bnx2fc_disable() local
2114 interface = bnx2fc_interface_lookup(netdev); in bnx2fc_disable()
2115 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_disable()
2117 if (!interface) { in bnx2fc_disable()
2119 pr_err(PFX "bnx2fc_disable: interface not found\n"); in bnx2fc_disable()
2182 struct bnx2fc_interface *interface = fcoe_ctlr_priv(ctlr); in __bnx2fc_enable() local
2187 if (interface->enabled == false) { in __bnx2fc_enable()
2193 interface->enabled = true; in __bnx2fc_enable()
2198 hba = interface->hba; in __bnx2fc_enable()
2235 struct bnx2fc_interface *interface; in bnx2fc_enable() local
2242 interface = bnx2fc_interface_lookup(netdev); in bnx2fc_enable()
2243 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_enable()
2244 if (!interface) { in bnx2fc_enable()
2246 pr_err(PFX "bnx2fc_enable: interface not found\n"); in bnx2fc_enable()
2287 * _bnx2fc_create() - Create bnx2fc FCoE interface
2288 * @netdev : The net_device object the Ethernet interface to create on
2296 * consolidation of code can be done when that interface is
2307 struct bnx2fc_interface *interface; in _bnx2fc_create() local
2349 /* obtain interface and initialize rest of the structure */ in _bnx2fc_create()
2362 interface = bnx2fc_interface_create(hba, netdev, fip_mode); in _bnx2fc_create()
2363 if (!interface) { in _bnx2fc_create()
2371 interface->vlan_enabled = 1; in _bnx2fc_create()
2374 ctlr = bnx2fc_to_ctlr(interface); in _bnx2fc_create()
2376 interface->vlan_id = vlan_id; in _bnx2fc_create()
2377 interface->tm_timeout = BNX2FC_TM_TIMEOUT; in _bnx2fc_create()
2379 interface->timer_work_queue = in _bnx2fc_create()
2381 if (!interface->timer_work_queue) { in _bnx2fc_create()
2387 lport = bnx2fc_if_create(interface, &cdev->dev, 0); in _bnx2fc_create()
2389 printk(KERN_ERR PFX "Failed to create interface (%s)\n", in _bnx2fc_create()
2395 /* Add interface to if_list */ in _bnx2fc_create()
2396 list_add_tail(&interface->list, &if_list); in _bnx2fc_create()
2412 set_bit(ADAPTER_STATE_READY, &interface->hba->adapter_state); in _bnx2fc_create()
2416 bnx2fc_start_disc(interface); in _bnx2fc_create()
2419 interface->enabled = true; in _bnx2fc_create()
2425 bnx2fc_interface_put(interface); in _bnx2fc_create()
2432 destroy_workqueue(interface->timer_work_queue); in _bnx2fc_create()
2434 bnx2fc_net_cleanup(interface); in _bnx2fc_create()
2435 bnx2fc_interface_put(interface); in _bnx2fc_create()
2446 * bnx2fc_create() - Create a bnx2fc interface
2447 * @netdev : The net_device object the Ethernet interface to create on
2460 * bnx2fc_ctlr_alloc() - Allocate a bnx2fc interface from fcoe_sysfs
2497 struct bnx2fc_interface *interface; in bnx2fc_interface_lookup() local
2500 list_for_each_entry(interface, &if_list, list) { in bnx2fc_interface_lookup()
2501 if (interface->netdev == netdev) in bnx2fc_interface_lookup()
2502 return interface; in bnx2fc_interface_lookup()
2529 struct bnx2fc_interface *interface, *tmp; in bnx2fc_ulp_exit() local
2551 list_for_each_entry_safe(interface, tmp, &if_list, list) in bnx2fc_ulp_exit()
2553 if (interface->hba == hba) in bnx2fc_ulp_exit()
2554 __bnx2fc_destroy(interface); in bnx2fc_ulp_exit()
2923 struct bnx2fc_interface *interface = port->priv; in bnx2fc_tm_timeout_show() local
2925 sprintf(buf, "%u\n", interface->tm_timeout); in bnx2fc_tm_timeout_show()
2936 struct bnx2fc_interface *interface = port->priv; in bnx2fc_tm_timeout_store() local
2945 interface->tm_timeout = (u8)val; in bnx2fc_tm_timeout_store()
2991 * bnx2fc_cnic_cb - global template of bnx2fc - cnic driver interface