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
433 interface = container_of(ptype, struct bnx2fc_interface, in bnx2fc_rcv()
435 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_rcv()
517 struct bnx2fc_interface *interface; in bnx2fc_recv_frame() local
558 interface = phys_port->priv; in bnx2fc_recv_frame()
559 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_recv_frame()
681 struct bnx2fc_interface *interface = port->priv; in bnx2fc_get_host_stats() local
682 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_get_host_stats()
731 struct bnx2fc_interface *interface = port->priv; in bnx2fc_shost_config() local
732 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_shost_config()
756 interface->netdev->name); in bnx2fc_shost_config()
764 struct bnx2fc_interface *interface = port->priv; in bnx2fc_link_ok() local
765 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_link_ok()
796 struct bnx2fc_interface *interface; in bnx2fc_net_config() local
802 interface = port->priv; in bnx2fc_net_config()
803 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_net_config()
804 hba = interface->hba; in bnx2fc_net_config()
865 struct bnx2fc_interface *interface, *tmp; in bnx2fc_indicate_netevent() local
898 list_for_each_entry_safe(interface, tmp, &if_list, list) { in bnx2fc_indicate_netevent()
899 if (interface->hba == hba && in bnx2fc_indicate_netevent()
900 interface->vlan_id == (vlan_id & VLAN_VID_MASK)) in bnx2fc_indicate_netevent()
901 __bnx2fc_destroy(interface); in bnx2fc_indicate_netevent()
911 list_for_each_entry(interface, &if_list, list) { in bnx2fc_indicate_netevent()
913 if (interface->hba != hba) in bnx2fc_indicate_netevent()
916 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_indicate_netevent()
919 interface->netdev->name, event); in bnx2fc_indicate_netevent()
928 pr_info("Link up while interface is disabled.\n"); in bnx2fc_indicate_netevent()
939 if (interface->enabled) in bnx2fc_indicate_netevent()
945 pr_info("Link down while interface is disabled.\n"); in bnx2fc_indicate_netevent()
1053 struct bnx2fc_interface *interface; in bnx2fc_fip_recv() local
1055 interface = container_of(ptype, struct bnx2fc_interface, in bnx2fc_fip_recv()
1057 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_fip_recv()
1122 struct bnx2fc_interface *interface = port->priv; in bnx2fc_vport_create() local
1123 struct net_device *netdev = interface->netdev; in bnx2fc_vport_create()
1137 if (!test_bit(BNX2FC_FLAG_FW_INIT_DONE, &interface->hba->flags)) { in bnx2fc_vport_create()
1139 "this interface\n"); in bnx2fc_vport_create()
1144 vn_port = bnx2fc_if_create(interface, &vport->dev, 1); in bnx2fc_vport_create()
1188 struct bnx2fc_interface *interface = port->priv; in bnx2fc_vport_destroy() local
1205 bnx2fc_free_vport(interface->hba, port->lport); in bnx2fc_vport_destroy()
1208 bnx2fc_interface_put(interface); in bnx2fc_vport_destroy()
1228 static int bnx2fc_interface_setup(struct bnx2fc_interface *interface) in bnx2fc_interface_setup() argument
1230 struct net_device *netdev = interface->netdev; in bnx2fc_interface_setup()
1231 struct net_device *physdev = interface->hba->phys_dev; in bnx2fc_interface_setup()
1232 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_interface_setup()
1258 interface->fip_packet_type.func = bnx2fc_fip_recv; in bnx2fc_interface_setup()
1259 interface->fip_packet_type.type = htons(ETH_P_FIP); in bnx2fc_interface_setup()
1260 interface->fip_packet_type.dev = netdev; in bnx2fc_interface_setup()
1261 dev_add_pack(&interface->fip_packet_type); in bnx2fc_interface_setup()
1263 interface->fcoe_packet_type.func = bnx2fc_rcv; in bnx2fc_interface_setup()
1264 interface->fcoe_packet_type.type = __constant_htons(ETH_P_FCOE); in bnx2fc_interface_setup()
1265 interface->fcoe_packet_type.dev = netdev; in bnx2fc_interface_setup()
1266 dev_add_pack(&interface->fcoe_packet_type); in bnx2fc_interface_setup()
1303 struct bnx2fc_interface *interface; in bnx2fc_interface_release() local
1307 interface = container_of(kref, struct bnx2fc_interface, kref); in bnx2fc_interface_release()
1308 BNX2FC_MISC_DBG("Interface is being released\n"); in bnx2fc_interface_release()
1310 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_interface_release()
1312 netdev = interface->netdev; in bnx2fc_interface_release()
1315 if (test_and_clear_bit(BNX2FC_CTLR_INIT_DONE, &interface->if_flags)) in bnx2fc_interface_release()
1324 static inline void bnx2fc_interface_get(struct bnx2fc_interface *interface) in bnx2fc_interface_get() argument
1326 kref_get(&interface->kref); in bnx2fc_interface_get()
1329 static inline void bnx2fc_interface_put(struct bnx2fc_interface *interface) in bnx2fc_interface_put() argument
1331 kref_put(&interface->kref, bnx2fc_interface_release); in bnx2fc_interface_put()
1435 struct bnx2fc_interface *interface; in bnx2fc_interface_create() local
1440 size = (sizeof(*interface) + sizeof(struct fcoe_ctlr)); in bnx2fc_interface_create()
1444 printk(KERN_ERR PFX "Unable to allocate interface structure\n"); in bnx2fc_interface_create()
1449 interface = fcoe_ctlr_priv(ctlr); in bnx2fc_interface_create()
1451 kref_init(&interface->kref); in bnx2fc_interface_create()
1452 interface->hba = hba; in bnx2fc_interface_create()
1453 interface->netdev = netdev; in bnx2fc_interface_create()
1460 set_bit(BNX2FC_CTLR_INIT_DONE, &interface->if_flags); in bnx2fc_interface_create()
1462 rc = bnx2fc_interface_setup(interface); in bnx2fc_interface_create()
1464 return interface; in bnx2fc_interface_create()
1473 * bnx2fc_if_create - Create FCoE instance on a given interface
1475 * @interface: FCoE interface to create a local port on
1483 static struct fc_lport *bnx2fc_if_create(struct bnx2fc_interface *interface, in bnx2fc_if_create() argument
1486 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_if_create()
1492 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_if_create()
1515 port->priv = interface; in bnx2fc_if_create()
1530 rc = bnx2fc_net_config(lport, interface->netdev); in bnx2fc_if_create()
1539 interface->netdev->name); in bnx2fc_if_create()
1568 bnx2fc_interface_get(interface); in bnx2fc_if_create()
1586 static void bnx2fc_net_cleanup(struct bnx2fc_interface *interface) in bnx2fc_net_cleanup() argument
1589 __dev_remove_pack(&interface->fcoe_packet_type); in bnx2fc_net_cleanup()
1590 __dev_remove_pack(&interface->fip_packet_type); in bnx2fc_net_cleanup()
1594 static void bnx2fc_interface_cleanup(struct bnx2fc_interface *interface) in bnx2fc_interface_cleanup() argument
1596 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_interface_cleanup()
1599 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_interface_cleanup()
1607 bnx2fc_net_cleanup(interface); in bnx2fc_interface_cleanup()
1635 static void __bnx2fc_destroy(struct bnx2fc_interface *interface) in __bnx2fc_destroy() argument
1637 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in __bnx2fc_destroy()
1641 bnx2fc_interface_cleanup(interface); in __bnx2fc_destroy()
1642 bnx2fc_stop(interface); in __bnx2fc_destroy()
1643 list_del(&interface->list); in __bnx2fc_destroy()
1645 bnx2fc_interface_put(interface); in __bnx2fc_destroy()
1649 * bnx2fc_destroy - Destroy a bnx2fc FCoE interface
1651 * @netdev: The net device that the FCoE interface is on
1659 struct bnx2fc_interface *interface = NULL; in bnx2fc_destroy() local
1667 interface = bnx2fc_interface_lookup(netdev); in bnx2fc_destroy()
1668 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_destroy()
1669 if (!interface || !ctlr->lp) { in bnx2fc_destroy()
1671 printk(KERN_ERR PFX "bnx2fc_destroy: interface or lport not found\n"); in bnx2fc_destroy()
1675 timer_work_queue = interface->timer_work_queue; in bnx2fc_destroy()
1676 __bnx2fc_destroy(interface); in bnx2fc_destroy()
1816 * This bnx2fc - cnic interface api callback is used after following
1818 * a) underlying network interface is up (marked by event NETDEV_UP
1825 struct bnx2fc_interface *interface; in bnx2fc_ulp_start() local
1836 list_for_each_entry(interface, &if_list, list) { in bnx2fc_ulp_start()
1837 if (interface->hba == hba) { in bnx2fc_ulp_start()
1838 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_ulp_start()
1843 bnx2fc_start_disc(interface); in bnx2fc_ulp_start()
1857 static void bnx2fc_stop(struct bnx2fc_interface *interface) in bnx2fc_stop() argument
1859 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_stop()
1863 if (!test_bit(BNX2FC_FLAG_FW_INIT_DONE, &interface->hba->flags)) in bnx2fc_stop()
1958 struct bnx2fc_interface *interface; in bnx2fc_ulp_stop() local
1965 list_for_each_entry(interface, &if_list, list) { in bnx2fc_ulp_stop()
1966 if (interface->hba == hba) in bnx2fc_ulp_stop()
1967 bnx2fc_stop(interface); in bnx2fc_ulp_stop()
1984 static void bnx2fc_start_disc(struct bnx2fc_interface *interface) in bnx2fc_start_disc() argument
1986 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_start_disc()
1992 if (!test_bit(BNX2FC_FLAG_FW_INIT_DONE, &interface->hba->flags)) { in bnx2fc_start_disc()
2000 if (!bnx2fc_link_ok(lport) && interface->enabled) { in bnx2fc_start_disc()
2004 set_bit(ADAPTER_STATE_READY, &interface->hba->adapter_state); in bnx2fc_start_disc()
2074 struct bnx2fc_interface *interface = fcoe_ctlr_priv(ctlr); in __bnx2fc_disable() local
2076 if (interface->enabled) { in __bnx2fc_disable()
2081 interface->enabled = false; in __bnx2fc_disable()
2094 struct bnx2fc_interface *interface; in bnx2fc_disable() local
2101 interface = bnx2fc_interface_lookup(netdev); in bnx2fc_disable()
2102 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_disable()
2104 if (!interface) { in bnx2fc_disable()
2106 pr_err(PFX "bnx2fc_disable: interface not found\n"); in bnx2fc_disable()
2169 struct bnx2fc_interface *interface = fcoe_ctlr_priv(ctlr); in __bnx2fc_enable() local
2174 if (!interface->enabled) { in __bnx2fc_enable()
2180 interface->enabled = true; in __bnx2fc_enable()
2185 hba = interface->hba; in __bnx2fc_enable()
2222 struct bnx2fc_interface *interface; in bnx2fc_enable() local
2229 interface = bnx2fc_interface_lookup(netdev); in bnx2fc_enable()
2230 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_enable()
2231 if (!interface) { in bnx2fc_enable()
2233 pr_err(PFX "bnx2fc_enable: interface not found\n"); in bnx2fc_enable()
2274 * _bnx2fc_create() - Create bnx2fc FCoE interface
2275 * @netdev : The net_device object the Ethernet interface to create on
2283 * consolidation of code can be done when that interface is
2294 struct bnx2fc_interface *interface; in _bnx2fc_create() local
2336 /* obtain interface and initialize rest of the structure */ in _bnx2fc_create()
2349 interface = bnx2fc_interface_create(hba, netdev, fip_mode); in _bnx2fc_create()
2350 if (!interface) { in _bnx2fc_create()
2358 interface->vlan_enabled = 1; in _bnx2fc_create()
2361 ctlr = bnx2fc_to_ctlr(interface); in _bnx2fc_create()
2363 interface->vlan_id = vlan_id; in _bnx2fc_create()
2364 interface->tm_timeout = BNX2FC_TM_TIMEOUT; in _bnx2fc_create()
2366 interface->timer_work_queue = alloc_ordered_workqueue( in _bnx2fc_create()
2368 if (!interface->timer_work_queue) { in _bnx2fc_create()
2374 lport = bnx2fc_if_create(interface, &cdev->dev, 0); in _bnx2fc_create()
2376 printk(KERN_ERR PFX "Failed to create interface (%s)\n", in _bnx2fc_create()
2382 /* Add interface to if_list */ in _bnx2fc_create()
2383 list_add_tail(&interface->list, &if_list); in _bnx2fc_create()
2399 set_bit(ADAPTER_STATE_READY, &interface->hba->adapter_state); in _bnx2fc_create()
2403 bnx2fc_start_disc(interface); in _bnx2fc_create()
2406 interface->enabled = true; in _bnx2fc_create()
2412 bnx2fc_interface_put(interface); in _bnx2fc_create()
2419 destroy_workqueue(interface->timer_work_queue); in _bnx2fc_create()
2421 bnx2fc_net_cleanup(interface); in _bnx2fc_create()
2422 bnx2fc_interface_put(interface); in _bnx2fc_create()
2433 * bnx2fc_create() - Create a bnx2fc interface
2434 * @netdev : The net_device object the Ethernet interface to create on
2447 * bnx2fc_ctlr_alloc() - Allocate a bnx2fc interface from fcoe_sysfs
2484 struct bnx2fc_interface *interface; in bnx2fc_interface_lookup() local
2487 list_for_each_entry(interface, &if_list, list) { in bnx2fc_interface_lookup()
2488 if (interface->netdev == netdev) in bnx2fc_interface_lookup()
2489 return interface; in bnx2fc_interface_lookup()
2516 struct bnx2fc_interface *interface, *tmp; in bnx2fc_ulp_exit() local
2538 list_for_each_entry_safe(interface, tmp, &if_list, list) in bnx2fc_ulp_exit()
2540 if (interface->hba == hba) in bnx2fc_ulp_exit()
2541 __bnx2fc_destroy(interface); in bnx2fc_ulp_exit()
2906 struct bnx2fc_interface *interface = port->priv; in bnx2fc_tm_timeout_show() local
2908 sprintf(buf, "%u\n", interface->tm_timeout); in bnx2fc_tm_timeout_show()
2919 struct bnx2fc_interface *interface = port->priv; in bnx2fc_tm_timeout_store() local
2928 interface->tm_timeout = (u8)val; in bnx2fc_tm_timeout_store()
2977 * bnx2fc_cnic_cb - global template of bnx2fc - cnic driver interface