Lines Matching refs:interface
62 static void __bnx2fc_destroy(struct bnx2fc_interface *interface);
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()
682 struct bnx2fc_interface *interface = port->priv; in bnx2fc_get_host_stats() local
683 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_get_host_stats()
732 struct bnx2fc_interface *interface = port->priv; in bnx2fc_shost_config() local
733 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_shost_config()
757 interface->netdev->name); in bnx2fc_shost_config()
765 struct bnx2fc_interface *interface = port->priv; in bnx2fc_link_ok() local
766 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_link_ok()
797 struct bnx2fc_interface *interface; in bnx2fc_net_config() local
803 interface = port->priv; in bnx2fc_net_config()
804 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_net_config()
805 hba = interface->hba; in bnx2fc_net_config()
866 struct bnx2fc_interface *interface, *tmp; in bnx2fc_indicate_netevent() local
899 list_for_each_entry_safe(interface, tmp, &if_list, list) { in bnx2fc_indicate_netevent()
900 if (interface->hba == hba && in bnx2fc_indicate_netevent()
901 interface->vlan_id == (vlan_id & VLAN_VID_MASK)) in bnx2fc_indicate_netevent()
902 __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()
943 if (interface->enabled) 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()
1129 struct bnx2fc_interface *interface = port->priv; in bnx2fc_vport_create() local
1130 struct net_device *netdev = interface->netdev; in bnx2fc_vport_create()
1144 if (!test_bit(BNX2FC_FLAG_FW_INIT_DONE, &interface->hba->flags)) { in bnx2fc_vport_create()
1151 vn_port = bnx2fc_if_create(interface, &vport->dev, 1); in bnx2fc_vport_create()
1195 struct bnx2fc_interface *interface = port->priv; in bnx2fc_vport_destroy() local
1212 bnx2fc_free_vport(interface->hba, port->lport); in bnx2fc_vport_destroy()
1214 bnx2fc_interface_put(interface); in bnx2fc_vport_destroy()
1235 static int bnx2fc_interface_setup(struct bnx2fc_interface *interface) in bnx2fc_interface_setup() argument
1237 struct net_device *netdev = interface->netdev; in bnx2fc_interface_setup()
1238 struct net_device *physdev = interface->hba->phys_dev; in bnx2fc_interface_setup()
1239 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_interface_setup()
1265 interface->fip_packet_type.func = bnx2fc_fip_recv; in bnx2fc_interface_setup()
1266 interface->fip_packet_type.type = htons(ETH_P_FIP); in bnx2fc_interface_setup()
1267 interface->fip_packet_type.dev = netdev; in bnx2fc_interface_setup()
1268 dev_add_pack(&interface->fip_packet_type); in bnx2fc_interface_setup()
1270 interface->fcoe_packet_type.func = bnx2fc_rcv; in bnx2fc_interface_setup()
1271 interface->fcoe_packet_type.type = __constant_htons(ETH_P_FCOE); in bnx2fc_interface_setup()
1272 interface->fcoe_packet_type.dev = netdev; in bnx2fc_interface_setup()
1273 dev_add_pack(&interface->fcoe_packet_type); in bnx2fc_interface_setup()
1310 struct bnx2fc_interface *interface; in bnx2fc_interface_release() local
1314 interface = container_of(kref, struct bnx2fc_interface, kref); in bnx2fc_interface_release()
1317 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_interface_release()
1319 netdev = interface->netdev; in bnx2fc_interface_release()
1322 if (test_and_clear_bit(BNX2FC_CTLR_INIT_DONE, &interface->if_flags)) in bnx2fc_interface_release()
1331 static inline void bnx2fc_interface_get(struct bnx2fc_interface *interface) in bnx2fc_interface_get() argument
1333 kref_get(&interface->kref); in bnx2fc_interface_get()
1336 static inline void bnx2fc_interface_put(struct bnx2fc_interface *interface) in bnx2fc_interface_put() argument
1338 kref_put(&interface->kref, bnx2fc_interface_release); in bnx2fc_interface_put()
1442 struct bnx2fc_interface *interface; in bnx2fc_interface_create() local
1447 size = (sizeof(*interface) + sizeof(struct fcoe_ctlr)); in bnx2fc_interface_create()
1456 interface = fcoe_ctlr_priv(ctlr); in bnx2fc_interface_create()
1458 kref_init(&interface->kref); in bnx2fc_interface_create()
1459 interface->hba = hba; in bnx2fc_interface_create()
1460 interface->netdev = netdev; in bnx2fc_interface_create()
1467 set_bit(BNX2FC_CTLR_INIT_DONE, &interface->if_flags); in bnx2fc_interface_create()
1469 rc = bnx2fc_interface_setup(interface); in bnx2fc_interface_create()
1471 return interface; in bnx2fc_interface_create()
1490 static struct fc_lport *bnx2fc_if_create(struct bnx2fc_interface *interface, in bnx2fc_if_create() argument
1493 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_if_create()
1499 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_if_create()
1522 port->priv = interface; in bnx2fc_if_create()
1538 rc = bnx2fc_net_config(lport, interface->netdev); in bnx2fc_if_create()
1547 interface->netdev->name); in bnx2fc_if_create()
1576 bnx2fc_interface_get(interface); in bnx2fc_if_create()
1594 static void bnx2fc_net_cleanup(struct bnx2fc_interface *interface) in bnx2fc_net_cleanup() argument
1597 __dev_remove_pack(&interface->fcoe_packet_type); in bnx2fc_net_cleanup()
1598 __dev_remove_pack(&interface->fip_packet_type); in bnx2fc_net_cleanup()
1602 static void bnx2fc_interface_cleanup(struct bnx2fc_interface *interface) in bnx2fc_interface_cleanup() argument
1604 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_interface_cleanup()
1607 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_interface_cleanup()
1615 bnx2fc_net_cleanup(interface); in bnx2fc_interface_cleanup()
1643 static void __bnx2fc_destroy(struct bnx2fc_interface *interface) in __bnx2fc_destroy() argument
1645 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in __bnx2fc_destroy()
1649 bnx2fc_interface_cleanup(interface); in __bnx2fc_destroy()
1650 bnx2fc_stop(interface); in __bnx2fc_destroy()
1651 list_del(&interface->list); in __bnx2fc_destroy()
1652 bnx2fc_interface_put(interface); in __bnx2fc_destroy()
1668 struct bnx2fc_interface *interface = NULL; in bnx2fc_destroy() local
1676 interface = bnx2fc_interface_lookup(netdev); in bnx2fc_destroy()
1677 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_destroy()
1678 if (!interface || !ctlr->lp) { in bnx2fc_destroy()
1684 timer_work_queue = interface->timer_work_queue; in bnx2fc_destroy()
1685 __bnx2fc_destroy(interface); in bnx2fc_destroy()
1837 struct bnx2fc_interface *interface; in bnx2fc_ulp_start() local
1848 list_for_each_entry(interface, &if_list, list) { in bnx2fc_ulp_start()
1849 if (interface->hba == hba) { in bnx2fc_ulp_start()
1850 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_ulp_start()
1855 bnx2fc_start_disc(interface); in bnx2fc_ulp_start()
1869 static void bnx2fc_stop(struct bnx2fc_interface *interface) in bnx2fc_stop() argument
1871 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_stop()
1875 if (!test_bit(BNX2FC_FLAG_FW_INIT_DONE, &interface->hba->flags)) in bnx2fc_stop()
1970 struct bnx2fc_interface *interface; in bnx2fc_ulp_stop() local
1977 list_for_each_entry(interface, &if_list, list) { in bnx2fc_ulp_stop()
1978 if (interface->hba == hba) in bnx2fc_ulp_stop()
1979 bnx2fc_stop(interface); in bnx2fc_ulp_stop()
1996 static void bnx2fc_start_disc(struct bnx2fc_interface *interface) in bnx2fc_start_disc() argument
1998 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_start_disc()
2004 if (!test_bit(BNX2FC_FLAG_FW_INIT_DONE, &interface->hba->flags)) { in bnx2fc_start_disc()
2012 if (!bnx2fc_link_ok(lport) && interface->enabled) { in bnx2fc_start_disc()
2016 set_bit(ADAPTER_STATE_READY, &interface->hba->adapter_state); in bnx2fc_start_disc()
2086 struct bnx2fc_interface *interface = fcoe_ctlr_priv(ctlr); in __bnx2fc_disable() local
2088 if (interface->enabled == true) { in __bnx2fc_disable()
2093 interface->enabled = false; in __bnx2fc_disable()
2106 struct bnx2fc_interface *interface; in bnx2fc_disable() local
2113 interface = bnx2fc_interface_lookup(netdev); in bnx2fc_disable()
2114 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_disable()
2116 if (!interface) { in bnx2fc_disable()
2181 struct bnx2fc_interface *interface = fcoe_ctlr_priv(ctlr); in __bnx2fc_enable() local
2186 if (interface->enabled == false) { in __bnx2fc_enable()
2192 interface->enabled = true; in __bnx2fc_enable()
2197 hba = interface->hba; in __bnx2fc_enable()
2234 struct bnx2fc_interface *interface; in bnx2fc_enable() local
2241 interface = bnx2fc_interface_lookup(netdev); in bnx2fc_enable()
2242 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_enable()
2243 if (!interface) { in bnx2fc_enable()
2306 struct bnx2fc_interface *interface; in _bnx2fc_create() local
2361 interface = bnx2fc_interface_create(hba, netdev, fip_mode); in _bnx2fc_create()
2362 if (!interface) { in _bnx2fc_create()
2370 interface->vlan_enabled = 1; in _bnx2fc_create()
2373 ctlr = bnx2fc_to_ctlr(interface); in _bnx2fc_create()
2375 interface->vlan_id = vlan_id; in _bnx2fc_create()
2376 interface->tm_timeout = BNX2FC_TM_TIMEOUT; in _bnx2fc_create()
2378 interface->timer_work_queue = in _bnx2fc_create()
2380 if (!interface->timer_work_queue) { in _bnx2fc_create()
2386 lport = bnx2fc_if_create(interface, &cdev->dev, 0); in _bnx2fc_create()
2395 list_add_tail(&interface->list, &if_list); in _bnx2fc_create()
2411 set_bit(ADAPTER_STATE_READY, &interface->hba->adapter_state); in _bnx2fc_create()
2415 bnx2fc_start_disc(interface); in _bnx2fc_create()
2418 interface->enabled = true; in _bnx2fc_create()
2424 bnx2fc_interface_put(interface); in _bnx2fc_create()
2431 destroy_workqueue(interface->timer_work_queue); in _bnx2fc_create()
2433 bnx2fc_net_cleanup(interface); in _bnx2fc_create()
2434 bnx2fc_interface_put(interface); in _bnx2fc_create()
2496 struct bnx2fc_interface *interface; in bnx2fc_interface_lookup() local
2499 list_for_each_entry(interface, &if_list, list) { in bnx2fc_interface_lookup()
2500 if (interface->netdev == netdev) in bnx2fc_interface_lookup()
2501 return interface; in bnx2fc_interface_lookup()
2528 struct bnx2fc_interface *interface, *tmp; in bnx2fc_ulp_exit() local
2550 list_for_each_entry_safe(interface, tmp, &if_list, list) in bnx2fc_ulp_exit()
2552 if (interface->hba == hba) in bnx2fc_ulp_exit()
2553 __bnx2fc_destroy(interface); in bnx2fc_ulp_exit()
2921 struct bnx2fc_interface *interface = port->priv; in bnx2fc_tm_timeout_show() local
2923 sprintf(buf, "%u\n", interface->tm_timeout); in bnx2fc_tm_timeout_show()
2934 struct bnx2fc_interface *interface = port->priv; in bnx2fc_tm_timeout_store() local
2943 interface->tm_timeout = (u8)val; in bnx2fc_tm_timeout_store()