Lines Matching refs:interface
61 static void __bnx2fc_destroy(struct bnx2fc_interface *interface);
72 static void bnx2fc_start_disc(struct bnx2fc_interface *interface);
80 static struct fc_lport *bnx2fc_if_create(struct bnx2fc_interface *interface,
87 static inline void bnx2fc_interface_put(struct bnx2fc_interface *interface);
94 static void bnx2fc_stop(struct bnx2fc_interface *interface);
171 struct bnx2fc_interface *interface = port->priv; in bnx2fc_cleanup() local
172 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_cleanup()
249 struct bnx2fc_interface *interface; in bnx2fc_xmit() local
262 interface = port->priv; in bnx2fc_xmit()
263 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_xmit()
264 hba = interface->hba; in bnx2fc_xmit()
349 skb->dev = interface->netdev; in bnx2fc_xmit()
410 struct bnx2fc_interface *interface; in bnx2fc_rcv() local
418 interface = container_of(ptype, struct bnx2fc_interface, in bnx2fc_rcv()
420 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_rcv()
635 struct bnx2fc_interface *interface = port->priv; in bnx2fc_get_host_stats() local
636 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_get_host_stats()
680 struct bnx2fc_interface *interface = port->priv; in bnx2fc_shost_config() local
681 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_shost_config()
705 interface->netdev->name); in bnx2fc_shost_config()
713 struct bnx2fc_interface *interface = port->priv; in bnx2fc_link_ok() local
714 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_link_ok()
745 struct bnx2fc_interface *interface; in bnx2fc_net_config() local
751 interface = port->priv; in bnx2fc_net_config()
752 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_net_config()
753 hba = interface->hba; in bnx2fc_net_config()
814 struct bnx2fc_interface *interface, *tmp; in bnx2fc_indicate_netevent() local
847 list_for_each_entry_safe(interface, tmp, &if_list, list) { in bnx2fc_indicate_netevent()
848 if (interface->hba == hba && in bnx2fc_indicate_netevent()
849 interface->vlan_id == (vlan_id & VLAN_VID_MASK)) in bnx2fc_indicate_netevent()
850 __bnx2fc_destroy(interface); in bnx2fc_indicate_netevent()
864 list_for_each_entry(interface, &if_list, list) { in bnx2fc_indicate_netevent()
866 if (interface->hba != hba) in bnx2fc_indicate_netevent()
869 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_indicate_netevent()
872 interface->netdev->name, event); in bnx2fc_indicate_netevent()
892 if (interface->enabled) in bnx2fc_indicate_netevent()
1009 struct bnx2fc_interface *interface; in bnx2fc_fip_recv() local
1011 interface = container_of(ptype, struct bnx2fc_interface, in bnx2fc_fip_recv()
1013 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_fip_recv()
1065 struct bnx2fc_interface *interface = port->priv; in bnx2fc_vport_create() local
1066 struct net_device *netdev = interface->netdev; in bnx2fc_vport_create()
1080 if (!test_bit(BNX2FC_FLAG_FW_INIT_DONE, &interface->hba->flags)) { in bnx2fc_vport_create()
1087 vn_port = bnx2fc_if_create(interface, &vport->dev, 1); in bnx2fc_vport_create()
1128 struct bnx2fc_interface *interface = port->priv; in bnx2fc_vport_destroy() local
1145 bnx2fc_free_vport(interface->hba, port->lport); in bnx2fc_vport_destroy()
1147 bnx2fc_interface_put(interface); in bnx2fc_vport_destroy()
1168 static int bnx2fc_interface_setup(struct bnx2fc_interface *interface) in bnx2fc_interface_setup() argument
1170 struct net_device *netdev = interface->netdev; in bnx2fc_interface_setup()
1171 struct net_device *physdev = interface->hba->phys_dev; in bnx2fc_interface_setup()
1172 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_interface_setup()
1198 interface->fip_packet_type.func = bnx2fc_fip_recv; in bnx2fc_interface_setup()
1199 interface->fip_packet_type.type = htons(ETH_P_FIP); in bnx2fc_interface_setup()
1200 interface->fip_packet_type.dev = netdev; in bnx2fc_interface_setup()
1201 dev_add_pack(&interface->fip_packet_type); in bnx2fc_interface_setup()
1203 interface->fcoe_packet_type.func = bnx2fc_rcv; in bnx2fc_interface_setup()
1204 interface->fcoe_packet_type.type = __constant_htons(ETH_P_FCOE); in bnx2fc_interface_setup()
1205 interface->fcoe_packet_type.dev = netdev; in bnx2fc_interface_setup()
1206 dev_add_pack(&interface->fcoe_packet_type); in bnx2fc_interface_setup()
1243 struct bnx2fc_interface *interface; in bnx2fc_interface_release() local
1247 interface = container_of(kref, struct bnx2fc_interface, kref); in bnx2fc_interface_release()
1250 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_interface_release()
1252 netdev = interface->netdev; in bnx2fc_interface_release()
1255 if (test_and_clear_bit(BNX2FC_CTLR_INIT_DONE, &interface->if_flags)) in bnx2fc_interface_release()
1264 static inline void bnx2fc_interface_get(struct bnx2fc_interface *interface) in bnx2fc_interface_get() argument
1266 kref_get(&interface->kref); in bnx2fc_interface_get()
1269 static inline void bnx2fc_interface_put(struct bnx2fc_interface *interface) in bnx2fc_interface_put() argument
1271 kref_put(&interface->kref, bnx2fc_interface_release); in bnx2fc_interface_put()
1373 struct bnx2fc_interface *interface; in bnx2fc_interface_create() local
1378 size = (sizeof(*interface) + sizeof(struct fcoe_ctlr)); in bnx2fc_interface_create()
1387 interface = fcoe_ctlr_priv(ctlr); in bnx2fc_interface_create()
1389 kref_init(&interface->kref); in bnx2fc_interface_create()
1390 interface->hba = hba; in bnx2fc_interface_create()
1391 interface->netdev = netdev; in bnx2fc_interface_create()
1398 set_bit(BNX2FC_CTLR_INIT_DONE, &interface->if_flags); in bnx2fc_interface_create()
1400 rc = bnx2fc_interface_setup(interface); in bnx2fc_interface_create()
1402 return interface; in bnx2fc_interface_create()
1421 static struct fc_lport *bnx2fc_if_create(struct bnx2fc_interface *interface, in bnx2fc_if_create() argument
1424 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_if_create()
1430 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_if_create()
1453 port->priv = interface; in bnx2fc_if_create()
1469 rc = bnx2fc_net_config(lport, interface->netdev); in bnx2fc_if_create()
1478 interface->netdev->name); in bnx2fc_if_create()
1504 bnx2fc_interface_get(interface); in bnx2fc_if_create()
1522 static void bnx2fc_net_cleanup(struct bnx2fc_interface *interface) in bnx2fc_net_cleanup() argument
1525 __dev_remove_pack(&interface->fcoe_packet_type); in bnx2fc_net_cleanup()
1526 __dev_remove_pack(&interface->fip_packet_type); in bnx2fc_net_cleanup()
1530 static void bnx2fc_interface_cleanup(struct bnx2fc_interface *interface) in bnx2fc_interface_cleanup() argument
1532 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_interface_cleanup()
1535 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_interface_cleanup()
1543 bnx2fc_net_cleanup(interface); in bnx2fc_interface_cleanup()
1571 static void __bnx2fc_destroy(struct bnx2fc_interface *interface) in __bnx2fc_destroy() argument
1573 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in __bnx2fc_destroy()
1577 bnx2fc_interface_cleanup(interface); in __bnx2fc_destroy()
1578 bnx2fc_stop(interface); in __bnx2fc_destroy()
1579 list_del(&interface->list); in __bnx2fc_destroy()
1580 bnx2fc_interface_put(interface); in __bnx2fc_destroy()
1596 struct bnx2fc_interface *interface = NULL; in bnx2fc_destroy() local
1604 interface = bnx2fc_interface_lookup(netdev); in bnx2fc_destroy()
1605 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_destroy()
1606 if (!interface || !ctlr->lp) { in bnx2fc_destroy()
1612 timer_work_queue = interface->timer_work_queue; in bnx2fc_destroy()
1613 __bnx2fc_destroy(interface); in bnx2fc_destroy()
1765 struct bnx2fc_interface *interface; in bnx2fc_ulp_start() local
1776 list_for_each_entry(interface, &if_list, list) { in bnx2fc_ulp_start()
1777 if (interface->hba == hba) { in bnx2fc_ulp_start()
1778 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_ulp_start()
1783 bnx2fc_start_disc(interface); in bnx2fc_ulp_start()
1797 static void bnx2fc_stop(struct bnx2fc_interface *interface) in bnx2fc_stop() argument
1799 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_stop()
1803 if (!test_bit(BNX2FC_FLAG_FW_INIT_DONE, &interface->hba->flags)) in bnx2fc_stop()
1899 struct bnx2fc_interface *interface; in bnx2fc_ulp_stop() local
1906 list_for_each_entry(interface, &if_list, list) { in bnx2fc_ulp_stop()
1907 if (interface->hba == hba) in bnx2fc_ulp_stop()
1908 bnx2fc_stop(interface); in bnx2fc_ulp_stop()
1925 static void bnx2fc_start_disc(struct bnx2fc_interface *interface) in bnx2fc_start_disc() argument
1927 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_start_disc()
1933 if (!test_bit(BNX2FC_FLAG_FW_INIT_DONE, &interface->hba->flags)) { in bnx2fc_start_disc()
1941 if (!bnx2fc_link_ok(lport) && interface->enabled) { in bnx2fc_start_disc()
1945 set_bit(ADAPTER_STATE_READY, &interface->hba->adapter_state); in bnx2fc_start_disc()
2013 struct bnx2fc_interface *interface = fcoe_ctlr_priv(ctlr); in __bnx2fc_disable() local
2015 if (interface->enabled == true) { in __bnx2fc_disable()
2020 interface->enabled = false; in __bnx2fc_disable()
2033 struct bnx2fc_interface *interface; in bnx2fc_disable() local
2040 interface = bnx2fc_interface_lookup(netdev); in bnx2fc_disable()
2041 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_disable()
2043 if (!interface) { in bnx2fc_disable()
2056 struct bnx2fc_interface *interface = fcoe_ctlr_priv(ctlr); in __bnx2fc_enable() local
2058 if (interface->enabled == false) { in __bnx2fc_enable()
2064 interface->enabled = true; in __bnx2fc_enable()
2075 struct bnx2fc_interface *interface; in bnx2fc_enable() local
2082 interface = bnx2fc_interface_lookup(netdev); in bnx2fc_enable()
2083 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_enable()
2084 if (!interface) { in bnx2fc_enable()
2147 struct bnx2fc_interface *interface; in _bnx2fc_create() local
2202 interface = bnx2fc_interface_create(hba, netdev, fip_mode); in _bnx2fc_create()
2203 if (!interface) { in _bnx2fc_create()
2211 interface->vlan_enabled = 1; in _bnx2fc_create()
2214 ctlr = bnx2fc_to_ctlr(interface); in _bnx2fc_create()
2216 interface->vlan_id = vlan_id; in _bnx2fc_create()
2218 interface->timer_work_queue = in _bnx2fc_create()
2220 if (!interface->timer_work_queue) { in _bnx2fc_create()
2226 lport = bnx2fc_if_create(interface, &cdev->dev, 0); in _bnx2fc_create()
2235 list_add_tail(&interface->list, &if_list); in _bnx2fc_create()
2251 set_bit(ADAPTER_STATE_READY, &interface->hba->adapter_state); in _bnx2fc_create()
2255 bnx2fc_start_disc(interface); in _bnx2fc_create()
2258 interface->enabled = true; in _bnx2fc_create()
2264 bnx2fc_interface_put(interface); in _bnx2fc_create()
2271 destroy_workqueue(interface->timer_work_queue); in _bnx2fc_create()
2273 bnx2fc_net_cleanup(interface); in _bnx2fc_create()
2274 bnx2fc_interface_put(interface); in _bnx2fc_create()
2336 struct bnx2fc_interface *interface; in bnx2fc_interface_lookup() local
2339 list_for_each_entry(interface, &if_list, list) { in bnx2fc_interface_lookup()
2340 if (interface->netdev == netdev) in bnx2fc_interface_lookup()
2341 return interface; in bnx2fc_interface_lookup()
2368 struct bnx2fc_interface *interface, *tmp; in bnx2fc_ulp_exit() local
2390 list_for_each_entry_safe(interface, tmp, &if_list, list) in bnx2fc_ulp_exit()
2392 if (interface->hba == hba) in bnx2fc_ulp_exit()
2393 __bnx2fc_destroy(interface); in bnx2fc_ulp_exit()