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()
522 struct bnx2fc_interface *interface; in bnx2fc_recv_frame() local
565 interface = phys_port->priv; in bnx2fc_recv_frame()
566 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_recv_frame()
690 struct bnx2fc_interface *interface = port->priv; in bnx2fc_get_host_stats() local
691 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_get_host_stats()
740 struct bnx2fc_interface *interface = port->priv; in bnx2fc_shost_config() local
741 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_shost_config()
765 interface->netdev->name); in bnx2fc_shost_config()
773 struct bnx2fc_interface *interface = port->priv; in bnx2fc_link_ok() local
774 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_link_ok()
805 struct bnx2fc_interface *interface; in bnx2fc_net_config() local
811 interface = port->priv; in bnx2fc_net_config()
812 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_net_config()
813 hba = interface->hba; in bnx2fc_net_config()
874 struct bnx2fc_interface *interface, *tmp; in bnx2fc_indicate_netevent() local
907 list_for_each_entry_safe(interface, tmp, &if_list, list) { in bnx2fc_indicate_netevent()
908 if (interface->hba == hba && in bnx2fc_indicate_netevent()
909 interface->vlan_id == (vlan_id & VLAN_VID_MASK)) in bnx2fc_indicate_netevent()
910 __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()
1219 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()
1541 rc = bnx2fc_net_config(lport, interface->netdev); in bnx2fc_if_create()
1550 interface->netdev->name); in bnx2fc_if_create()
1579 bnx2fc_interface_get(interface); in bnx2fc_if_create()
1597 static void bnx2fc_net_cleanup(struct bnx2fc_interface *interface) in bnx2fc_net_cleanup() argument
1600 __dev_remove_pack(&interface->fcoe_packet_type); in bnx2fc_net_cleanup()
1601 __dev_remove_pack(&interface->fip_packet_type); in bnx2fc_net_cleanup()
1605 static void bnx2fc_interface_cleanup(struct bnx2fc_interface *interface) in bnx2fc_interface_cleanup() argument
1607 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_interface_cleanup()
1610 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_interface_cleanup()
1618 bnx2fc_net_cleanup(interface); in bnx2fc_interface_cleanup()
1646 static void __bnx2fc_destroy(struct bnx2fc_interface *interface) in __bnx2fc_destroy() argument
1648 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in __bnx2fc_destroy()
1652 bnx2fc_interface_cleanup(interface); in __bnx2fc_destroy()
1653 bnx2fc_stop(interface); in __bnx2fc_destroy()
1654 list_del(&interface->list); in __bnx2fc_destroy()
1656 bnx2fc_interface_put(interface); in __bnx2fc_destroy()
1660 * bnx2fc_destroy - Destroy a bnx2fc FCoE interface
1662 * @netdev: The net device that the FCoE interface is on
1670 struct bnx2fc_interface *interface = NULL; in bnx2fc_destroy() local
1678 interface = bnx2fc_interface_lookup(netdev); in bnx2fc_destroy()
1679 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_destroy()
1680 if (!interface || !ctlr->lp) { in bnx2fc_destroy()
1682 printk(KERN_ERR PFX "bnx2fc_destroy: interface or lport not found\n"); in bnx2fc_destroy()
1686 timer_work_queue = interface->timer_work_queue; in bnx2fc_destroy()
1687 __bnx2fc_destroy(interface); in bnx2fc_destroy()
1827 * This bnx2fc - cnic interface api callback is used after following
1829 * a) underlying network interface is up (marked by event NETDEV_UP
1836 struct bnx2fc_interface *interface; in bnx2fc_ulp_start() local
1847 list_for_each_entry(interface, &if_list, list) { in bnx2fc_ulp_start()
1848 if (interface->hba == hba) { in bnx2fc_ulp_start()
1849 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_ulp_start()
1854 bnx2fc_start_disc(interface); in bnx2fc_ulp_start()
1868 static void bnx2fc_stop(struct bnx2fc_interface *interface) in bnx2fc_stop() argument
1870 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_stop()
1874 if (!test_bit(BNX2FC_FLAG_FW_INIT_DONE, &interface->hba->flags)) in bnx2fc_stop()
1969 struct bnx2fc_interface *interface; in bnx2fc_ulp_stop() local
1976 list_for_each_entry(interface, &if_list, list) { in bnx2fc_ulp_stop()
1977 if (interface->hba == hba) in bnx2fc_ulp_stop()
1978 bnx2fc_stop(interface); in bnx2fc_ulp_stop()
1995 static void bnx2fc_start_disc(struct bnx2fc_interface *interface) in bnx2fc_start_disc() argument
1997 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_start_disc()
2003 if (!test_bit(BNX2FC_FLAG_FW_INIT_DONE, &interface->hba->flags)) { in bnx2fc_start_disc()
2011 if (!bnx2fc_link_ok(lport) && interface->enabled) { in bnx2fc_start_disc()
2015 set_bit(ADAPTER_STATE_READY, &interface->hba->adapter_state); in bnx2fc_start_disc()
2085 struct bnx2fc_interface *interface = fcoe_ctlr_priv(ctlr); in __bnx2fc_disable() local
2087 if (interface->enabled == true) { in __bnx2fc_disable()
2092 interface->enabled = false; in __bnx2fc_disable()
2105 struct bnx2fc_interface *interface; in bnx2fc_disable() local
2112 interface = bnx2fc_interface_lookup(netdev); in bnx2fc_disable()
2113 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_disable()
2115 if (!interface) { in bnx2fc_disable()
2117 pr_err(PFX "bnx2fc_disable: interface not found\n"); in bnx2fc_disable()
2180 struct bnx2fc_interface *interface = fcoe_ctlr_priv(ctlr); in __bnx2fc_enable() local
2185 if (interface->enabled == false) { in __bnx2fc_enable()
2191 interface->enabled = true; in __bnx2fc_enable()
2196 hba = interface->hba; in __bnx2fc_enable()
2233 struct bnx2fc_interface *interface; in bnx2fc_enable() local
2240 interface = bnx2fc_interface_lookup(netdev); in bnx2fc_enable()
2241 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_enable()
2242 if (!interface) { in bnx2fc_enable()
2244 pr_err(PFX "bnx2fc_enable: interface not found\n"); in bnx2fc_enable()
2285 * _bnx2fc_create() - Create bnx2fc FCoE interface
2286 * @netdev : The net_device object the Ethernet interface to create on
2294 * consolidation of code can be done when that interface is
2305 struct bnx2fc_interface *interface; in _bnx2fc_create() local
2347 /* obtain interface and initialize rest of the structure */ in _bnx2fc_create()
2360 interface = bnx2fc_interface_create(hba, netdev, fip_mode); in _bnx2fc_create()
2361 if (!interface) { in _bnx2fc_create()
2369 interface->vlan_enabled = 1; in _bnx2fc_create()
2372 ctlr = bnx2fc_to_ctlr(interface); in _bnx2fc_create()
2374 interface->vlan_id = vlan_id; in _bnx2fc_create()
2375 interface->tm_timeout = BNX2FC_TM_TIMEOUT; in _bnx2fc_create()
2377 interface->timer_work_queue = in _bnx2fc_create()
2379 if (!interface->timer_work_queue) { in _bnx2fc_create()
2385 lport = bnx2fc_if_create(interface, &cdev->dev, 0); in _bnx2fc_create()
2387 printk(KERN_ERR PFX "Failed to create interface (%s)\n", in _bnx2fc_create()
2393 /* Add interface to if_list */ in _bnx2fc_create()
2394 list_add_tail(&interface->list, &if_list); in _bnx2fc_create()
2410 set_bit(ADAPTER_STATE_READY, &interface->hba->adapter_state); in _bnx2fc_create()
2414 bnx2fc_start_disc(interface); in _bnx2fc_create()
2417 interface->enabled = true; in _bnx2fc_create()
2423 bnx2fc_interface_put(interface); in _bnx2fc_create()
2430 destroy_workqueue(interface->timer_work_queue); in _bnx2fc_create()
2432 bnx2fc_net_cleanup(interface); in _bnx2fc_create()
2433 bnx2fc_interface_put(interface); in _bnx2fc_create()
2444 * bnx2fc_create() - Create a bnx2fc interface
2445 * @netdev : The net_device object the Ethernet interface to create on
2458 * bnx2fc_ctlr_alloc() - Allocate a bnx2fc interface from fcoe_sysfs
2495 struct bnx2fc_interface *interface; in bnx2fc_interface_lookup() local
2498 list_for_each_entry(interface, &if_list, list) { in bnx2fc_interface_lookup()
2499 if (interface->netdev == netdev) in bnx2fc_interface_lookup()
2500 return interface; in bnx2fc_interface_lookup()
2527 struct bnx2fc_interface *interface, *tmp; in bnx2fc_ulp_exit() local
2549 list_for_each_entry_safe(interface, tmp, &if_list, list) in bnx2fc_ulp_exit()
2551 if (interface->hba == hba) in bnx2fc_ulp_exit()
2552 __bnx2fc_destroy(interface); in bnx2fc_ulp_exit()
2918 struct bnx2fc_interface *interface = port->priv; in bnx2fc_tm_timeout_show() local
2920 sprintf(buf, "%u\n", interface->tm_timeout); in bnx2fc_tm_timeout_show()
2931 struct bnx2fc_interface *interface = port->priv; in bnx2fc_tm_timeout_store() local
2940 interface->tm_timeout = (u8)val; in bnx2fc_tm_timeout_store()
2986 * bnx2fc_cnic_cb - global template of bnx2fc - cnic driver interface