• Home
  • Raw
  • Download

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()
915 list_for_each_entry(interface, &if_list, list) { in bnx2fc_indicate_netevent()
917 if (interface->hba != hba) in bnx2fc_indicate_netevent()
920 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_indicate_netevent()
923 interface->netdev->name, event); in bnx2fc_indicate_netevent()
932 pr_info("Link up while interface is disabled.\n"); in bnx2fc_indicate_netevent()
943 if (interface->enabled) in bnx2fc_indicate_netevent()
949 pr_info("Link down while interface is disabled.\n"); in bnx2fc_indicate_netevent()
1059 struct bnx2fc_interface *interface; in bnx2fc_fip_recv() local
1061 interface = container_of(ptype, struct bnx2fc_interface, in bnx2fc_fip_recv()
1063 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_fip_recv()
1128 struct bnx2fc_interface *interface = port->priv; in bnx2fc_vport_create() local
1129 struct net_device *netdev = interface->netdev; in bnx2fc_vport_create()
1143 if (!test_bit(BNX2FC_FLAG_FW_INIT_DONE, &interface->hba->flags)) { in bnx2fc_vport_create()
1145 "this interface\n"); in bnx2fc_vport_create()
1150 vn_port = bnx2fc_if_create(interface, &vport->dev, 1); in bnx2fc_vport_create()
1194 struct bnx2fc_interface *interface = port->priv; in bnx2fc_vport_destroy() local
1211 bnx2fc_free_vport(interface->hba, port->lport); in bnx2fc_vport_destroy()
1214 bnx2fc_interface_put(interface); in bnx2fc_vport_destroy()
1234 static int bnx2fc_interface_setup(struct bnx2fc_interface *interface) in bnx2fc_interface_setup() argument
1236 struct net_device *netdev = interface->netdev; in bnx2fc_interface_setup()
1237 struct net_device *physdev = interface->hba->phys_dev; in bnx2fc_interface_setup()
1238 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_interface_setup()
1264 interface->fip_packet_type.func = bnx2fc_fip_recv; in bnx2fc_interface_setup()
1265 interface->fip_packet_type.type = htons(ETH_P_FIP); in bnx2fc_interface_setup()
1266 interface->fip_packet_type.dev = netdev; in bnx2fc_interface_setup()
1267 dev_add_pack(&interface->fip_packet_type); in bnx2fc_interface_setup()
1269 interface->fcoe_packet_type.func = bnx2fc_rcv; in bnx2fc_interface_setup()
1270 interface->fcoe_packet_type.type = __constant_htons(ETH_P_FCOE); in bnx2fc_interface_setup()
1271 interface->fcoe_packet_type.dev = netdev; in bnx2fc_interface_setup()
1272 dev_add_pack(&interface->fcoe_packet_type); in bnx2fc_interface_setup()
1309 struct bnx2fc_interface *interface; in bnx2fc_interface_release() local
1313 interface = container_of(kref, struct bnx2fc_interface, kref); in bnx2fc_interface_release()
1314 BNX2FC_MISC_DBG("Interface is being released\n"); in bnx2fc_interface_release()
1316 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_interface_release()
1318 netdev = interface->netdev; in bnx2fc_interface_release()
1321 if (test_and_clear_bit(BNX2FC_CTLR_INIT_DONE, &interface->if_flags)) in bnx2fc_interface_release()
1330 static inline void bnx2fc_interface_get(struct bnx2fc_interface *interface) in bnx2fc_interface_get() argument
1332 kref_get(&interface->kref); in bnx2fc_interface_get()
1335 static inline void bnx2fc_interface_put(struct bnx2fc_interface *interface) in bnx2fc_interface_put() argument
1337 kref_put(&interface->kref, bnx2fc_interface_release); in bnx2fc_interface_put()
1441 struct bnx2fc_interface *interface; in bnx2fc_interface_create() local
1446 size = (sizeof(*interface) + sizeof(struct fcoe_ctlr)); in bnx2fc_interface_create()
1450 printk(KERN_ERR PFX "Unable to allocate interface structure\n"); in bnx2fc_interface_create()
1455 interface = fcoe_ctlr_priv(ctlr); in bnx2fc_interface_create()
1457 kref_init(&interface->kref); in bnx2fc_interface_create()
1458 interface->hba = hba; in bnx2fc_interface_create()
1459 interface->netdev = netdev; in bnx2fc_interface_create()
1466 set_bit(BNX2FC_CTLR_INIT_DONE, &interface->if_flags); in bnx2fc_interface_create()
1468 rc = bnx2fc_interface_setup(interface); in bnx2fc_interface_create()
1470 return interface; in bnx2fc_interface_create()
1479 * bnx2fc_if_create - Create FCoE instance on a given interface
1481 * @interface: FCoE interface to create a local port on
1489 static struct fc_lport *bnx2fc_if_create(struct bnx2fc_interface *interface, in bnx2fc_if_create() argument
1492 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_if_create()
1498 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_if_create()
1521 port->priv = interface; in bnx2fc_if_create()
1536 rc = bnx2fc_net_config(lport, interface->netdev); in bnx2fc_if_create()
1545 interface->netdev->name); in bnx2fc_if_create()
1574 bnx2fc_interface_get(interface); in bnx2fc_if_create()
1592 static void bnx2fc_net_cleanup(struct bnx2fc_interface *interface) in bnx2fc_net_cleanup() argument
1595 __dev_remove_pack(&interface->fcoe_packet_type); in bnx2fc_net_cleanup()
1596 __dev_remove_pack(&interface->fip_packet_type); in bnx2fc_net_cleanup()
1600 static void bnx2fc_interface_cleanup(struct bnx2fc_interface *interface) in bnx2fc_interface_cleanup() argument
1602 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_interface_cleanup()
1605 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_interface_cleanup()
1613 bnx2fc_net_cleanup(interface); in bnx2fc_interface_cleanup()
1641 static void __bnx2fc_destroy(struct bnx2fc_interface *interface) in __bnx2fc_destroy() argument
1643 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in __bnx2fc_destroy()
1647 bnx2fc_interface_cleanup(interface); in __bnx2fc_destroy()
1648 bnx2fc_stop(interface); in __bnx2fc_destroy()
1649 list_del(&interface->list); in __bnx2fc_destroy()
1651 bnx2fc_interface_put(interface); in __bnx2fc_destroy()
1655 * bnx2fc_destroy - Destroy a bnx2fc FCoE interface
1657 * @netdev: The net device that the FCoE interface is on
1665 struct bnx2fc_interface *interface = NULL; in bnx2fc_destroy() local
1673 interface = bnx2fc_interface_lookup(netdev); in bnx2fc_destroy()
1674 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_destroy()
1675 if (!interface || !ctlr->lp) { in bnx2fc_destroy()
1677 printk(KERN_ERR PFX "bnx2fc_destroy: interface or lport not found\n"); in bnx2fc_destroy()
1681 timer_work_queue = interface->timer_work_queue; in bnx2fc_destroy()
1682 __bnx2fc_destroy(interface); in bnx2fc_destroy()
1822 * This bnx2fc - cnic interface api callback is used after following
1824 * a) underlying network interface is up (marked by event NETDEV_UP
1831 struct bnx2fc_interface *interface; in bnx2fc_ulp_start() local
1842 list_for_each_entry(interface, &if_list, list) { in bnx2fc_ulp_start()
1843 if (interface->hba == hba) { in bnx2fc_ulp_start()
1844 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_ulp_start()
1849 bnx2fc_start_disc(interface); in bnx2fc_ulp_start()
1863 static void bnx2fc_stop(struct bnx2fc_interface *interface) in bnx2fc_stop() argument
1865 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_stop()
1869 if (!test_bit(BNX2FC_FLAG_FW_INIT_DONE, &interface->hba->flags)) in bnx2fc_stop()
1964 struct bnx2fc_interface *interface; in bnx2fc_ulp_stop() local
1971 list_for_each_entry(interface, &if_list, list) { in bnx2fc_ulp_stop()
1972 if (interface->hba == hba) in bnx2fc_ulp_stop()
1973 bnx2fc_stop(interface); in bnx2fc_ulp_stop()
1990 static void bnx2fc_start_disc(struct bnx2fc_interface *interface) in bnx2fc_start_disc() argument
1992 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_start_disc()
1998 if (!test_bit(BNX2FC_FLAG_FW_INIT_DONE, &interface->hba->flags)) { in bnx2fc_start_disc()
2006 if (!bnx2fc_link_ok(lport) && interface->enabled) { in bnx2fc_start_disc()
2010 set_bit(ADAPTER_STATE_READY, &interface->hba->adapter_state); in bnx2fc_start_disc()
2080 struct bnx2fc_interface *interface = fcoe_ctlr_priv(ctlr); in __bnx2fc_disable() local
2082 if (interface->enabled == true) { in __bnx2fc_disable()
2087 interface->enabled = false; in __bnx2fc_disable()
2100 struct bnx2fc_interface *interface; in bnx2fc_disable() local
2107 interface = bnx2fc_interface_lookup(netdev); in bnx2fc_disable()
2108 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_disable()
2110 if (!interface) { in bnx2fc_disable()
2112 pr_err(PFX "bnx2fc_disable: interface not found\n"); in bnx2fc_disable()
2175 struct bnx2fc_interface *interface = fcoe_ctlr_priv(ctlr); in __bnx2fc_enable() local
2180 if (interface->enabled == false) { in __bnx2fc_enable()
2186 interface->enabled = true; in __bnx2fc_enable()
2191 hba = interface->hba; in __bnx2fc_enable()
2228 struct bnx2fc_interface *interface; in bnx2fc_enable() local
2235 interface = bnx2fc_interface_lookup(netdev); in bnx2fc_enable()
2236 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_enable()
2237 if (!interface) { in bnx2fc_enable()
2239 pr_err(PFX "bnx2fc_enable: interface not found\n"); in bnx2fc_enable()
2280 * _bnx2fc_create() - Create bnx2fc FCoE interface
2281 * @netdev : The net_device object the Ethernet interface to create on
2289 * consolidation of code can be done when that interface is
2300 struct bnx2fc_interface *interface; in _bnx2fc_create() local
2342 /* obtain interface and initialize rest of the structure */ in _bnx2fc_create()
2355 interface = bnx2fc_interface_create(hba, netdev, fip_mode); in _bnx2fc_create()
2356 if (!interface) { in _bnx2fc_create()
2364 interface->vlan_enabled = 1; in _bnx2fc_create()
2367 ctlr = bnx2fc_to_ctlr(interface); in _bnx2fc_create()
2369 interface->vlan_id = vlan_id; in _bnx2fc_create()
2370 interface->tm_timeout = BNX2FC_TM_TIMEOUT; in _bnx2fc_create()
2372 interface->timer_work_queue = in _bnx2fc_create()
2374 if (!interface->timer_work_queue) { in _bnx2fc_create()
2380 lport = bnx2fc_if_create(interface, &cdev->dev, 0); in _bnx2fc_create()
2382 printk(KERN_ERR PFX "Failed to create interface (%s)\n", in _bnx2fc_create()
2388 /* Add interface to if_list */ in _bnx2fc_create()
2389 list_add_tail(&interface->list, &if_list); in _bnx2fc_create()
2405 set_bit(ADAPTER_STATE_READY, &interface->hba->adapter_state); in _bnx2fc_create()
2409 bnx2fc_start_disc(interface); in _bnx2fc_create()
2412 interface->enabled = true; in _bnx2fc_create()
2418 bnx2fc_interface_put(interface); in _bnx2fc_create()
2425 destroy_workqueue(interface->timer_work_queue); in _bnx2fc_create()
2427 bnx2fc_net_cleanup(interface); in _bnx2fc_create()
2428 bnx2fc_interface_put(interface); in _bnx2fc_create()
2439 * bnx2fc_create() - Create a bnx2fc interface
2440 * @netdev : The net_device object the Ethernet interface to create on
2453 * bnx2fc_ctlr_alloc() - Allocate a bnx2fc interface from fcoe_sysfs
2490 struct bnx2fc_interface *interface; in bnx2fc_interface_lookup() local
2493 list_for_each_entry(interface, &if_list, list) { in bnx2fc_interface_lookup()
2494 if (interface->netdev == netdev) in bnx2fc_interface_lookup()
2495 return interface; in bnx2fc_interface_lookup()
2522 struct bnx2fc_interface *interface, *tmp; in bnx2fc_ulp_exit() local
2544 list_for_each_entry_safe(interface, tmp, &if_list, list) in bnx2fc_ulp_exit()
2546 if (interface->hba == hba) in bnx2fc_ulp_exit()
2547 __bnx2fc_destroy(interface); in bnx2fc_ulp_exit()
2913 struct bnx2fc_interface *interface = port->priv; in bnx2fc_tm_timeout_show() local
2915 sprintf(buf, "%u\n", interface->tm_timeout); in bnx2fc_tm_timeout_show()
2926 struct bnx2fc_interface *interface = port->priv; in bnx2fc_tm_timeout_store() local
2935 interface->tm_timeout = (u8)val; in bnx2fc_tm_timeout_store()
2981 * bnx2fc_cnic_cb - global template of bnx2fc - cnic driver interface