Lines Matching full:interface
64 static void __bnx2fc_destroy(struct bnx2fc_interface *interface);
69 /* fcoe_syfs control interface handlers */
75 static void bnx2fc_start_disc(struct bnx2fc_interface *interface);
83 static struct fc_lport *bnx2fc_if_create(struct bnx2fc_interface *interface,
90 static inline void bnx2fc_interface_put(struct bnx2fc_interface *interface);
97 static void bnx2fc_stop(struct bnx2fc_interface *interface);
192 struct bnx2fc_interface *interface = port->priv; in bnx2fc_cleanup() local
193 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_cleanup()
270 struct bnx2fc_interface *interface; in bnx2fc_xmit() local
283 interface = port->priv; in bnx2fc_xmit()
284 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_xmit()
285 hba = interface->hba; in bnx2fc_xmit()
370 skb->dev = interface->netdev; in bnx2fc_xmit()
431 struct bnx2fc_interface *interface; in bnx2fc_rcv() local
437 interface = container_of(ptype, struct bnx2fc_interface, in bnx2fc_rcv()
439 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_rcv()
523 struct bnx2fc_interface *interface; in bnx2fc_recv_frame() local
561 interface = phys_port->priv; in bnx2fc_recv_frame()
562 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_recv_frame()
687 struct bnx2fc_interface *interface = port->priv; in bnx2fc_get_host_stats() local
688 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_get_host_stats()
737 struct bnx2fc_interface *interface = port->priv; in bnx2fc_shost_config() local
738 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_shost_config()
762 interface->netdev->name); in bnx2fc_shost_config()
770 struct bnx2fc_interface *interface = port->priv; in bnx2fc_link_ok() local
771 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_link_ok()
802 struct bnx2fc_interface *interface; in bnx2fc_net_config() local
808 interface = port->priv; in bnx2fc_net_config()
809 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_net_config()
810 hba = interface->hba; in bnx2fc_net_config()
871 struct bnx2fc_interface *interface, *tmp; in bnx2fc_indicate_netevent() local
904 list_for_each_entry_safe(interface, tmp, &if_list, list) { in bnx2fc_indicate_netevent()
905 if (interface->hba == hba && in bnx2fc_indicate_netevent()
906 interface->vlan_id == (vlan_id & VLAN_VID_MASK)) in bnx2fc_indicate_netevent()
907 __bnx2fc_destroy(interface); in bnx2fc_indicate_netevent()
920 list_for_each_entry(interface, &if_list, list) { in bnx2fc_indicate_netevent()
922 if (interface->hba != hba) in bnx2fc_indicate_netevent()
925 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_indicate_netevent()
928 interface->netdev->name, event); in bnx2fc_indicate_netevent()
937 pr_info("Link up while interface is disabled.\n"); in bnx2fc_indicate_netevent()
948 if (interface->enabled) in bnx2fc_indicate_netevent()
954 pr_info("Link down while interface is disabled.\n"); in bnx2fc_indicate_netevent()
1064 struct bnx2fc_interface *interface; in bnx2fc_fip_recv() local
1066 interface = container_of(ptype, struct bnx2fc_interface, in bnx2fc_fip_recv()
1068 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_fip_recv()
1133 struct bnx2fc_interface *interface = port->priv; in bnx2fc_vport_create() local
1134 struct net_device *netdev = interface->netdev; in bnx2fc_vport_create()
1148 if (!test_bit(BNX2FC_FLAG_FW_INIT_DONE, &interface->hba->flags)) { in bnx2fc_vport_create()
1150 "this interface\n"); in bnx2fc_vport_create()
1155 vn_port = bnx2fc_if_create(interface, &vport->dev, 1); in bnx2fc_vport_create()
1199 struct bnx2fc_interface *interface = port->priv; in bnx2fc_vport_destroy() local
1216 bnx2fc_free_vport(interface->hba, port->lport); in bnx2fc_vport_destroy()
1218 bnx2fc_interface_put(interface); in bnx2fc_vport_destroy()
1239 static int bnx2fc_interface_setup(struct bnx2fc_interface *interface) in bnx2fc_interface_setup() argument
1241 struct net_device *netdev = interface->netdev; in bnx2fc_interface_setup()
1242 struct net_device *physdev = interface->hba->phys_dev; in bnx2fc_interface_setup()
1243 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_interface_setup()
1269 interface->fip_packet_type.func = bnx2fc_fip_recv; in bnx2fc_interface_setup()
1270 interface->fip_packet_type.type = htons(ETH_P_FIP); in bnx2fc_interface_setup()
1271 interface->fip_packet_type.dev = netdev; in bnx2fc_interface_setup()
1272 dev_add_pack(&interface->fip_packet_type); in bnx2fc_interface_setup()
1274 interface->fcoe_packet_type.func = bnx2fc_rcv; in bnx2fc_interface_setup()
1275 interface->fcoe_packet_type.type = __constant_htons(ETH_P_FCOE); in bnx2fc_interface_setup()
1276 interface->fcoe_packet_type.dev = netdev; in bnx2fc_interface_setup()
1277 dev_add_pack(&interface->fcoe_packet_type); in bnx2fc_interface_setup()
1314 struct bnx2fc_interface *interface; in bnx2fc_interface_release() local
1318 interface = container_of(kref, struct bnx2fc_interface, kref); in bnx2fc_interface_release()
1319 BNX2FC_MISC_DBG("Interface is being released\n"); in bnx2fc_interface_release()
1321 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_interface_release()
1323 netdev = interface->netdev; in bnx2fc_interface_release()
1326 if (test_and_clear_bit(BNX2FC_CTLR_INIT_DONE, &interface->if_flags)) in bnx2fc_interface_release()
1335 static inline void bnx2fc_interface_get(struct bnx2fc_interface *interface) in bnx2fc_interface_get() argument
1337 kref_get(&interface->kref); in bnx2fc_interface_get()
1340 static inline void bnx2fc_interface_put(struct bnx2fc_interface *interface) in bnx2fc_interface_put() argument
1342 kref_put(&interface->kref, bnx2fc_interface_release); in bnx2fc_interface_put()
1446 struct bnx2fc_interface *interface; in bnx2fc_interface_create() local
1451 size = (sizeof(*interface) + sizeof(struct fcoe_ctlr)); in bnx2fc_interface_create()
1455 printk(KERN_ERR PFX "Unable to allocate interface structure\n"); in bnx2fc_interface_create()
1460 interface = fcoe_ctlr_priv(ctlr); in bnx2fc_interface_create()
1462 kref_init(&interface->kref); in bnx2fc_interface_create()
1463 interface->hba = hba; in bnx2fc_interface_create()
1464 interface->netdev = netdev; in bnx2fc_interface_create()
1471 set_bit(BNX2FC_CTLR_INIT_DONE, &interface->if_flags); in bnx2fc_interface_create()
1473 rc = bnx2fc_interface_setup(interface); in bnx2fc_interface_create()
1475 return interface; in bnx2fc_interface_create()
1484 * bnx2fc_if_create - Create FCoE instance on a given interface
1486 * @interface: FCoE interface to create a local port on
1494 static struct fc_lport *bnx2fc_if_create(struct bnx2fc_interface *interface, in bnx2fc_if_create() argument
1497 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_if_create()
1503 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_if_create()
1526 port->priv = interface; in bnx2fc_if_create()
1542 rc = bnx2fc_net_config(lport, interface->netdev); in bnx2fc_if_create()
1551 interface->netdev->name); in bnx2fc_if_create()
1580 bnx2fc_interface_get(interface); in bnx2fc_if_create()
1598 static void bnx2fc_net_cleanup(struct bnx2fc_interface *interface) in bnx2fc_net_cleanup() argument
1601 __dev_remove_pack(&interface->fcoe_packet_type); in bnx2fc_net_cleanup()
1602 __dev_remove_pack(&interface->fip_packet_type); in bnx2fc_net_cleanup()
1606 static void bnx2fc_interface_cleanup(struct bnx2fc_interface *interface) in bnx2fc_interface_cleanup() argument
1608 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_interface_cleanup()
1611 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_interface_cleanup()
1619 bnx2fc_net_cleanup(interface); in bnx2fc_interface_cleanup()
1647 static void __bnx2fc_destroy(struct bnx2fc_interface *interface) in __bnx2fc_destroy() argument
1649 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in __bnx2fc_destroy()
1653 bnx2fc_interface_cleanup(interface); in __bnx2fc_destroy()
1654 bnx2fc_stop(interface); in __bnx2fc_destroy()
1655 list_del(&interface->list); in __bnx2fc_destroy()
1656 bnx2fc_interface_put(interface); in __bnx2fc_destroy()
1661 * bnx2fc_destroy - Destroy a bnx2fc FCoE interface
1663 * @netdev: The net device that the FCoE interface is on
1671 struct bnx2fc_interface *interface = NULL; in bnx2fc_destroy() local
1679 interface = bnx2fc_interface_lookup(netdev); in bnx2fc_destroy()
1680 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_destroy()
1681 if (!interface || !ctlr->lp) { in bnx2fc_destroy()
1683 printk(KERN_ERR PFX "bnx2fc_destroy: interface or lport not found\n"); in bnx2fc_destroy()
1687 timer_work_queue = interface->timer_work_queue; in bnx2fc_destroy()
1688 __bnx2fc_destroy(interface); in bnx2fc_destroy()
1831 * This bnx2fc - cnic interface api callback is used after following
1833 * a) underlying network interface is up (marked by event NETDEV_UP
1840 struct bnx2fc_interface *interface; in bnx2fc_ulp_start() local
1851 list_for_each_entry(interface, &if_list, list) { in bnx2fc_ulp_start()
1852 if (interface->hba == hba) { in bnx2fc_ulp_start()
1853 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_ulp_start()
1858 bnx2fc_start_disc(interface); in bnx2fc_ulp_start()
1872 static void bnx2fc_stop(struct bnx2fc_interface *interface) in bnx2fc_stop() argument
1874 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_stop()
1878 if (!test_bit(BNX2FC_FLAG_FW_INIT_DONE, &interface->hba->flags)) in bnx2fc_stop()
1973 struct bnx2fc_interface *interface; in bnx2fc_ulp_stop() local
1980 list_for_each_entry(interface, &if_list, list) { in bnx2fc_ulp_stop()
1981 if (interface->hba == hba) in bnx2fc_ulp_stop()
1982 bnx2fc_stop(interface); in bnx2fc_ulp_stop()
1999 static void bnx2fc_start_disc(struct bnx2fc_interface *interface) in bnx2fc_start_disc() argument
2001 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_start_disc()
2007 if (!test_bit(BNX2FC_FLAG_FW_INIT_DONE, &interface->hba->flags)) { in bnx2fc_start_disc()
2015 if (!bnx2fc_link_ok(lport) && interface->enabled) { in bnx2fc_start_disc()
2019 set_bit(ADAPTER_STATE_READY, &interface->hba->adapter_state); in bnx2fc_start_disc()
2089 struct bnx2fc_interface *interface = fcoe_ctlr_priv(ctlr); in __bnx2fc_disable() local
2091 if (interface->enabled) { in __bnx2fc_disable()
2096 interface->enabled = false; in __bnx2fc_disable()
2109 struct bnx2fc_interface *interface; in bnx2fc_disable() local
2116 interface = bnx2fc_interface_lookup(netdev); in bnx2fc_disable()
2117 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_disable()
2119 if (!interface) { in bnx2fc_disable()
2121 pr_err(PFX "bnx2fc_disable: interface not found\n"); in bnx2fc_disable()
2184 struct bnx2fc_interface *interface = fcoe_ctlr_priv(ctlr); in __bnx2fc_enable() local
2189 if (!interface->enabled) { in __bnx2fc_enable()
2195 interface->enabled = true; in __bnx2fc_enable()
2200 hba = interface->hba; in __bnx2fc_enable()
2237 struct bnx2fc_interface *interface; in bnx2fc_enable() local
2244 interface = bnx2fc_interface_lookup(netdev); in bnx2fc_enable()
2245 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_enable()
2246 if (!interface) { in bnx2fc_enable()
2248 pr_err(PFX "bnx2fc_enable: interface not found\n"); in bnx2fc_enable()
2289 * _bnx2fc_create() - Create bnx2fc FCoE interface
2290 * @netdev : The net_device object the Ethernet interface to create on
2298 * consolidation of code can be done when that interface is
2309 struct bnx2fc_interface *interface; in _bnx2fc_create() local
2351 /* obtain interface and initialize rest of the structure */ in _bnx2fc_create()
2364 interface = bnx2fc_interface_create(hba, netdev, fip_mode); in _bnx2fc_create()
2365 if (!interface) { in _bnx2fc_create()
2373 interface->vlan_enabled = 1; in _bnx2fc_create()
2376 ctlr = bnx2fc_to_ctlr(interface); in _bnx2fc_create()
2378 interface->vlan_id = vlan_id; in _bnx2fc_create()
2379 interface->tm_timeout = BNX2FC_TM_TIMEOUT; in _bnx2fc_create()
2381 interface->timer_work_queue = in _bnx2fc_create()
2383 if (!interface->timer_work_queue) { in _bnx2fc_create()
2389 lport = bnx2fc_if_create(interface, &cdev->dev, 0); in _bnx2fc_create()
2391 printk(KERN_ERR PFX "Failed to create interface (%s)\n", in _bnx2fc_create()
2397 /* Add interface to if_list */ in _bnx2fc_create()
2398 list_add_tail(&interface->list, &if_list); in _bnx2fc_create()
2414 set_bit(ADAPTER_STATE_READY, &interface->hba->adapter_state); in _bnx2fc_create()
2418 bnx2fc_start_disc(interface); in _bnx2fc_create()
2421 interface->enabled = true; in _bnx2fc_create()
2427 bnx2fc_interface_put(interface); in _bnx2fc_create()
2434 destroy_workqueue(interface->timer_work_queue); in _bnx2fc_create()
2436 bnx2fc_net_cleanup(interface); in _bnx2fc_create()
2437 bnx2fc_interface_put(interface); in _bnx2fc_create()
2448 * bnx2fc_create() - Create a bnx2fc interface
2449 * @netdev : The net_device object the Ethernet interface to create on
2462 * bnx2fc_ctlr_alloc() - Allocate a bnx2fc interface from fcoe_sysfs
2499 struct bnx2fc_interface *interface; in bnx2fc_interface_lookup() local
2502 list_for_each_entry(interface, &if_list, list) { in bnx2fc_interface_lookup()
2503 if (interface->netdev == netdev) in bnx2fc_interface_lookup()
2504 return interface; in bnx2fc_interface_lookup()
2531 struct bnx2fc_interface *interface, *tmp; in bnx2fc_ulp_exit() local
2553 list_for_each_entry_safe(interface, tmp, &if_list, list) in bnx2fc_ulp_exit()
2555 if (interface->hba == hba) in bnx2fc_ulp_exit()
2556 __bnx2fc_destroy(interface); in bnx2fc_ulp_exit()
2925 struct bnx2fc_interface *interface = port->priv; in bnx2fc_tm_timeout_show() local
2927 sprintf(buf, "%u\n", interface->tm_timeout); in bnx2fc_tm_timeout_show()
2938 struct bnx2fc_interface *interface = port->priv; in bnx2fc_tm_timeout_store() local
2947 interface->tm_timeout = (u8)val; in bnx2fc_tm_timeout_store()
2993 * bnx2fc_cnic_cb - global template of bnx2fc - cnic driver interface