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
282 interface = port->priv; in bnx2fc_xmit()
283 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_xmit()
284 hba = interface->hba; in bnx2fc_xmit()
369 skb->dev = interface->netdev; in bnx2fc_xmit()
428 struct bnx2fc_interface *interface; in bnx2fc_rcv() local
434 interface = container_of(ptype, struct bnx2fc_interface, in bnx2fc_rcv()
436 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_rcv()
520 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()
684 struct bnx2fc_interface *interface = port->priv; in bnx2fc_get_host_stats() local
685 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_get_host_stats()
734 struct bnx2fc_interface *interface = port->priv; in bnx2fc_shost_config() local
735 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_shost_config()
759 interface->netdev->name); in bnx2fc_shost_config()
767 struct bnx2fc_interface *interface = port->priv; in bnx2fc_link_ok() local
768 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_link_ok()
799 struct bnx2fc_interface *interface; in bnx2fc_net_config() local
805 interface = port->priv; in bnx2fc_net_config()
806 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_net_config()
807 hba = interface->hba; in bnx2fc_net_config()
868 struct bnx2fc_interface *interface, *tmp; in bnx2fc_indicate_netevent() local
901 list_for_each_entry_safe(interface, tmp, &if_list, list) { in bnx2fc_indicate_netevent()
902 if (interface->hba == hba && in bnx2fc_indicate_netevent()
903 interface->vlan_id == (vlan_id & VLAN_VID_MASK)) in bnx2fc_indicate_netevent()
904 __bnx2fc_destroy(interface); in bnx2fc_indicate_netevent()
914 list_for_each_entry(interface, &if_list, list) { in bnx2fc_indicate_netevent()
916 if (interface->hba != hba) in bnx2fc_indicate_netevent()
919 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_indicate_netevent()
922 interface->netdev->name, event); in bnx2fc_indicate_netevent()
931 pr_info("Link up while interface is disabled.\n"); in bnx2fc_indicate_netevent()
942 if (interface->enabled) in bnx2fc_indicate_netevent()
948 pr_info("Link down while interface is disabled.\n"); in bnx2fc_indicate_netevent()
1056 struct bnx2fc_interface *interface; in bnx2fc_fip_recv() local
1058 interface = container_of(ptype, struct bnx2fc_interface, in bnx2fc_fip_recv()
1060 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_fip_recv()
1125 struct bnx2fc_interface *interface = port->priv; in bnx2fc_vport_create() local
1126 struct net_device *netdev = interface->netdev; in bnx2fc_vport_create()
1140 if (!test_bit(BNX2FC_FLAG_FW_INIT_DONE, &interface->hba->flags)) { in bnx2fc_vport_create()
1142 "this interface\n"); in bnx2fc_vport_create()
1147 vn_port = bnx2fc_if_create(interface, &vport->dev, 1); in bnx2fc_vport_create()
1191 struct bnx2fc_interface *interface = port->priv; in bnx2fc_vport_destroy() local
1208 bnx2fc_free_vport(interface->hba, port->lport); in bnx2fc_vport_destroy()
1211 bnx2fc_interface_put(interface); in bnx2fc_vport_destroy()
1231 static int bnx2fc_interface_setup(struct bnx2fc_interface *interface) in bnx2fc_interface_setup() argument
1233 struct net_device *netdev = interface->netdev; in bnx2fc_interface_setup()
1234 struct net_device *physdev = interface->hba->phys_dev; in bnx2fc_interface_setup()
1235 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_interface_setup()
1261 interface->fip_packet_type.func = bnx2fc_fip_recv; in bnx2fc_interface_setup()
1262 interface->fip_packet_type.type = htons(ETH_P_FIP); in bnx2fc_interface_setup()
1263 interface->fip_packet_type.dev = netdev; in bnx2fc_interface_setup()
1264 dev_add_pack(&interface->fip_packet_type); in bnx2fc_interface_setup()
1266 interface->fcoe_packet_type.func = bnx2fc_rcv; in bnx2fc_interface_setup()
1267 interface->fcoe_packet_type.type = __constant_htons(ETH_P_FCOE); in bnx2fc_interface_setup()
1268 interface->fcoe_packet_type.dev = netdev; in bnx2fc_interface_setup()
1269 dev_add_pack(&interface->fcoe_packet_type); in bnx2fc_interface_setup()
1306 struct bnx2fc_interface *interface; in bnx2fc_interface_release() local
1310 interface = container_of(kref, struct bnx2fc_interface, kref); in bnx2fc_interface_release()
1311 BNX2FC_MISC_DBG("Interface is being released\n"); in bnx2fc_interface_release()
1313 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_interface_release()
1315 netdev = interface->netdev; in bnx2fc_interface_release()
1318 if (test_and_clear_bit(BNX2FC_CTLR_INIT_DONE, &interface->if_flags)) in bnx2fc_interface_release()
1327 static inline void bnx2fc_interface_get(struct bnx2fc_interface *interface) in bnx2fc_interface_get() argument
1329 kref_get(&interface->kref); in bnx2fc_interface_get()
1332 static inline void bnx2fc_interface_put(struct bnx2fc_interface *interface) in bnx2fc_interface_put() argument
1334 kref_put(&interface->kref, bnx2fc_interface_release); in bnx2fc_interface_put()
1438 struct bnx2fc_interface *interface; in bnx2fc_interface_create() local
1443 size = (sizeof(*interface) + sizeof(struct fcoe_ctlr)); in bnx2fc_interface_create()
1447 printk(KERN_ERR PFX "Unable to allocate interface structure\n"); in bnx2fc_interface_create()
1452 interface = fcoe_ctlr_priv(ctlr); in bnx2fc_interface_create()
1454 kref_init(&interface->kref); in bnx2fc_interface_create()
1455 interface->hba = hba; in bnx2fc_interface_create()
1456 interface->netdev = netdev; in bnx2fc_interface_create()
1463 set_bit(BNX2FC_CTLR_INIT_DONE, &interface->if_flags); in bnx2fc_interface_create()
1465 rc = bnx2fc_interface_setup(interface); in bnx2fc_interface_create()
1467 return interface; in bnx2fc_interface_create()
1476 * bnx2fc_if_create - Create FCoE instance on a given interface
1478 * @interface: FCoE interface to create a local port on
1486 static struct fc_lport *bnx2fc_if_create(struct bnx2fc_interface *interface, in bnx2fc_if_create() argument
1489 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_if_create()
1495 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_if_create()
1518 port->priv = interface; in bnx2fc_if_create()
1533 rc = bnx2fc_net_config(lport, interface->netdev); in bnx2fc_if_create()
1542 interface->netdev->name); in bnx2fc_if_create()
1571 bnx2fc_interface_get(interface); in bnx2fc_if_create()
1589 static void bnx2fc_net_cleanup(struct bnx2fc_interface *interface) in bnx2fc_net_cleanup() argument
1592 __dev_remove_pack(&interface->fcoe_packet_type); in bnx2fc_net_cleanup()
1593 __dev_remove_pack(&interface->fip_packet_type); in bnx2fc_net_cleanup()
1597 static void bnx2fc_interface_cleanup(struct bnx2fc_interface *interface) in bnx2fc_interface_cleanup() argument
1599 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_interface_cleanup()
1602 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_interface_cleanup()
1610 bnx2fc_net_cleanup(interface); in bnx2fc_interface_cleanup()
1638 static void __bnx2fc_destroy(struct bnx2fc_interface *interface) in __bnx2fc_destroy() argument
1640 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in __bnx2fc_destroy()
1644 bnx2fc_interface_cleanup(interface); in __bnx2fc_destroy()
1645 bnx2fc_stop(interface); in __bnx2fc_destroy()
1646 list_del(&interface->list); in __bnx2fc_destroy()
1648 bnx2fc_interface_put(interface); in __bnx2fc_destroy()
1652 * bnx2fc_destroy - Destroy a bnx2fc FCoE interface
1654 * @netdev: The net device that the FCoE interface is on
1662 struct bnx2fc_interface *interface = NULL; in bnx2fc_destroy() local
1670 interface = bnx2fc_interface_lookup(netdev); in bnx2fc_destroy()
1671 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_destroy()
1672 if (!interface || !ctlr->lp) { in bnx2fc_destroy()
1674 printk(KERN_ERR PFX "bnx2fc_destroy: interface or lport not found\n"); in bnx2fc_destroy()
1678 timer_work_queue = interface->timer_work_queue; in bnx2fc_destroy()
1679 __bnx2fc_destroy(interface); in bnx2fc_destroy()
1819 * This bnx2fc - cnic interface api callback is used after following
1821 * a) underlying network interface is up (marked by event NETDEV_UP
1828 struct bnx2fc_interface *interface; in bnx2fc_ulp_start() local
1839 list_for_each_entry(interface, &if_list, list) { in bnx2fc_ulp_start()
1840 if (interface->hba == hba) { in bnx2fc_ulp_start()
1841 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_ulp_start()
1846 bnx2fc_start_disc(interface); in bnx2fc_ulp_start()
1860 static void bnx2fc_stop(struct bnx2fc_interface *interface) in bnx2fc_stop() argument
1862 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_stop()
1866 if (!test_bit(BNX2FC_FLAG_FW_INIT_DONE, &interface->hba->flags)) in bnx2fc_stop()
1961 struct bnx2fc_interface *interface; in bnx2fc_ulp_stop() local
1968 list_for_each_entry(interface, &if_list, list) { in bnx2fc_ulp_stop()
1969 if (interface->hba == hba) in bnx2fc_ulp_stop()
1970 bnx2fc_stop(interface); in bnx2fc_ulp_stop()
1987 static void bnx2fc_start_disc(struct bnx2fc_interface *interface) in bnx2fc_start_disc() argument
1989 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_start_disc()
1995 if (!test_bit(BNX2FC_FLAG_FW_INIT_DONE, &interface->hba->flags)) { in bnx2fc_start_disc()
2003 if (!bnx2fc_link_ok(lport) && interface->enabled) { in bnx2fc_start_disc()
2007 set_bit(ADAPTER_STATE_READY, &interface->hba->adapter_state); in bnx2fc_start_disc()
2077 struct bnx2fc_interface *interface = fcoe_ctlr_priv(ctlr); in __bnx2fc_disable() local
2079 if (interface->enabled) { in __bnx2fc_disable()
2084 interface->enabled = false; in __bnx2fc_disable()
2097 struct bnx2fc_interface *interface; in bnx2fc_disable() local
2104 interface = bnx2fc_interface_lookup(netdev); in bnx2fc_disable()
2105 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_disable()
2107 if (!interface) { in bnx2fc_disable()
2109 pr_err(PFX "bnx2fc_disable: interface not found\n"); in bnx2fc_disable()
2172 struct bnx2fc_interface *interface = fcoe_ctlr_priv(ctlr); in __bnx2fc_enable() local
2177 if (!interface->enabled) { in __bnx2fc_enable()
2183 interface->enabled = true; in __bnx2fc_enable()
2188 hba = interface->hba; in __bnx2fc_enable()
2225 struct bnx2fc_interface *interface; in bnx2fc_enable() local
2232 interface = bnx2fc_interface_lookup(netdev); in bnx2fc_enable()
2233 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_enable()
2234 if (!interface) { in bnx2fc_enable()
2236 pr_err(PFX "bnx2fc_enable: interface not found\n"); in bnx2fc_enable()
2277 * _bnx2fc_create() - Create bnx2fc FCoE interface
2278 * @netdev : The net_device object the Ethernet interface to create on
2286 * consolidation of code can be done when that interface is
2297 struct bnx2fc_interface *interface; in _bnx2fc_create() local
2339 /* obtain interface and initialize rest of the structure */ in _bnx2fc_create()
2352 interface = bnx2fc_interface_create(hba, netdev, fip_mode); in _bnx2fc_create()
2353 if (!interface) { in _bnx2fc_create()
2361 interface->vlan_enabled = 1; in _bnx2fc_create()
2364 ctlr = bnx2fc_to_ctlr(interface); in _bnx2fc_create()
2366 interface->vlan_id = vlan_id; in _bnx2fc_create()
2367 interface->tm_timeout = BNX2FC_TM_TIMEOUT; in _bnx2fc_create()
2369 interface->timer_work_queue = in _bnx2fc_create()
2371 if (!interface->timer_work_queue) { in _bnx2fc_create()
2377 lport = bnx2fc_if_create(interface, &cdev->dev, 0); in _bnx2fc_create()
2379 printk(KERN_ERR PFX "Failed to create interface (%s)\n", in _bnx2fc_create()
2385 /* Add interface to if_list */ in _bnx2fc_create()
2386 list_add_tail(&interface->list, &if_list); in _bnx2fc_create()
2402 set_bit(ADAPTER_STATE_READY, &interface->hba->adapter_state); in _bnx2fc_create()
2406 bnx2fc_start_disc(interface); in _bnx2fc_create()
2409 interface->enabled = true; in _bnx2fc_create()
2415 bnx2fc_interface_put(interface); in _bnx2fc_create()
2422 destroy_workqueue(interface->timer_work_queue); in _bnx2fc_create()
2424 bnx2fc_net_cleanup(interface); in _bnx2fc_create()
2425 bnx2fc_interface_put(interface); in _bnx2fc_create()
2436 * bnx2fc_create() - Create a bnx2fc interface
2437 * @netdev : The net_device object the Ethernet interface to create on
2450 * bnx2fc_ctlr_alloc() - Allocate a bnx2fc interface from fcoe_sysfs
2487 struct bnx2fc_interface *interface; in bnx2fc_interface_lookup() local
2490 list_for_each_entry(interface, &if_list, list) { in bnx2fc_interface_lookup()
2491 if (interface->netdev == netdev) in bnx2fc_interface_lookup()
2492 return interface; in bnx2fc_interface_lookup()
2519 struct bnx2fc_interface *interface, *tmp; in bnx2fc_ulp_exit() local
2541 list_for_each_entry_safe(interface, tmp, &if_list, list) in bnx2fc_ulp_exit()
2543 if (interface->hba == hba) in bnx2fc_ulp_exit()
2544 __bnx2fc_destroy(interface); in bnx2fc_ulp_exit()
2909 struct bnx2fc_interface *interface = port->priv; in bnx2fc_tm_timeout_show() local
2911 sprintf(buf, "%u\n", interface->tm_timeout); in bnx2fc_tm_timeout_show()
2922 struct bnx2fc_interface *interface = port->priv; in bnx2fc_tm_timeout_store() local
2931 interface->tm_timeout = (u8)val; in bnx2fc_tm_timeout_store()
2980 * bnx2fc_cnic_cb - global template of bnx2fc - cnic driver interface