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()
863 list_for_each_entry(interface, &if_list, list) { in bnx2fc_indicate_netevent()
865 if (interface->hba != hba) in bnx2fc_indicate_netevent()
868 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_indicate_netevent()
871 interface->netdev->name, event); in bnx2fc_indicate_netevent()
891 if (interface->enabled) in bnx2fc_indicate_netevent()
1008 struct bnx2fc_interface *interface; in bnx2fc_fip_recv() local
1010 interface = container_of(ptype, struct bnx2fc_interface, in bnx2fc_fip_recv()
1012 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_fip_recv()
1064 struct bnx2fc_interface *interface = port->priv; in bnx2fc_vport_create() local
1065 struct net_device *netdev = interface->netdev; in bnx2fc_vport_create()
1079 if (!test_bit(BNX2FC_FLAG_FW_INIT_DONE, &interface->hba->flags)) { in bnx2fc_vport_create()
1086 vn_port = bnx2fc_if_create(interface, &vport->dev, 1); in bnx2fc_vport_create()
1127 struct bnx2fc_interface *interface = port->priv; in bnx2fc_vport_destroy() local
1144 bnx2fc_free_vport(interface->hba, port->lport); in bnx2fc_vport_destroy()
1146 bnx2fc_interface_put(interface); in bnx2fc_vport_destroy()
1167 static int bnx2fc_interface_setup(struct bnx2fc_interface *interface) in bnx2fc_interface_setup() argument
1169 struct net_device *netdev = interface->netdev; in bnx2fc_interface_setup()
1170 struct net_device *physdev = interface->hba->phys_dev; in bnx2fc_interface_setup()
1171 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_interface_setup()
1197 interface->fip_packet_type.func = bnx2fc_fip_recv; in bnx2fc_interface_setup()
1198 interface->fip_packet_type.type = htons(ETH_P_FIP); in bnx2fc_interface_setup()
1199 interface->fip_packet_type.dev = netdev; in bnx2fc_interface_setup()
1200 dev_add_pack(&interface->fip_packet_type); in bnx2fc_interface_setup()
1202 interface->fcoe_packet_type.func = bnx2fc_rcv; in bnx2fc_interface_setup()
1203 interface->fcoe_packet_type.type = __constant_htons(ETH_P_FCOE); in bnx2fc_interface_setup()
1204 interface->fcoe_packet_type.dev = netdev; in bnx2fc_interface_setup()
1205 dev_add_pack(&interface->fcoe_packet_type); in bnx2fc_interface_setup()
1242 struct bnx2fc_interface *interface; in bnx2fc_interface_release() local
1246 interface = container_of(kref, struct bnx2fc_interface, kref); in bnx2fc_interface_release()
1249 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_interface_release()
1251 netdev = interface->netdev; in bnx2fc_interface_release()
1254 if (test_and_clear_bit(BNX2FC_CTLR_INIT_DONE, &interface->if_flags)) in bnx2fc_interface_release()
1263 static inline void bnx2fc_interface_get(struct bnx2fc_interface *interface) in bnx2fc_interface_get() argument
1265 kref_get(&interface->kref); in bnx2fc_interface_get()
1268 static inline void bnx2fc_interface_put(struct bnx2fc_interface *interface) in bnx2fc_interface_put() argument
1270 kref_put(&interface->kref, bnx2fc_interface_release); in bnx2fc_interface_put()
1372 struct bnx2fc_interface *interface; in bnx2fc_interface_create() local
1377 size = (sizeof(*interface) + sizeof(struct fcoe_ctlr)); in bnx2fc_interface_create()
1386 interface = fcoe_ctlr_priv(ctlr); in bnx2fc_interface_create()
1388 kref_init(&interface->kref); in bnx2fc_interface_create()
1389 interface->hba = hba; in bnx2fc_interface_create()
1390 interface->netdev = netdev; in bnx2fc_interface_create()
1397 set_bit(BNX2FC_CTLR_INIT_DONE, &interface->if_flags); in bnx2fc_interface_create()
1399 rc = bnx2fc_interface_setup(interface); in bnx2fc_interface_create()
1401 return interface; in bnx2fc_interface_create()
1420 static struct fc_lport *bnx2fc_if_create(struct bnx2fc_interface *interface, in bnx2fc_if_create() argument
1423 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_if_create()
1429 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_if_create()
1452 port->priv = interface; in bnx2fc_if_create()
1468 rc = bnx2fc_net_config(lport, interface->netdev); in bnx2fc_if_create()
1477 interface->netdev->name); in bnx2fc_if_create()
1503 bnx2fc_interface_get(interface); in bnx2fc_if_create()
1521 static void bnx2fc_net_cleanup(struct bnx2fc_interface *interface) in bnx2fc_net_cleanup() argument
1524 __dev_remove_pack(&interface->fcoe_packet_type); in bnx2fc_net_cleanup()
1525 __dev_remove_pack(&interface->fip_packet_type); in bnx2fc_net_cleanup()
1529 static void bnx2fc_interface_cleanup(struct bnx2fc_interface *interface) in bnx2fc_interface_cleanup() argument
1531 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_interface_cleanup()
1534 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_interface_cleanup()
1542 bnx2fc_net_cleanup(interface); in bnx2fc_interface_cleanup()
1570 static void __bnx2fc_destroy(struct bnx2fc_interface *interface) in __bnx2fc_destroy() argument
1572 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in __bnx2fc_destroy()
1576 bnx2fc_interface_cleanup(interface); in __bnx2fc_destroy()
1577 bnx2fc_stop(interface); in __bnx2fc_destroy()
1578 list_del(&interface->list); in __bnx2fc_destroy()
1579 bnx2fc_interface_put(interface); in __bnx2fc_destroy()
1595 struct bnx2fc_interface *interface = NULL; in bnx2fc_destroy() local
1603 interface = bnx2fc_interface_lookup(netdev); in bnx2fc_destroy()
1604 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_destroy()
1605 if (!interface || !ctlr->lp) { in bnx2fc_destroy()
1611 timer_work_queue = interface->timer_work_queue; in bnx2fc_destroy()
1612 __bnx2fc_destroy(interface); in bnx2fc_destroy()
1764 struct bnx2fc_interface *interface; in bnx2fc_ulp_start() local
1775 list_for_each_entry(interface, &if_list, list) { in bnx2fc_ulp_start()
1776 if (interface->hba == hba) { in bnx2fc_ulp_start()
1777 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_ulp_start()
1782 bnx2fc_start_disc(interface); in bnx2fc_ulp_start()
1796 static void bnx2fc_stop(struct bnx2fc_interface *interface) in bnx2fc_stop() argument
1798 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_stop()
1802 if (!test_bit(BNX2FC_FLAG_FW_INIT_DONE, &interface->hba->flags)) in bnx2fc_stop()
1898 struct bnx2fc_interface *interface; in bnx2fc_ulp_stop() local
1905 list_for_each_entry(interface, &if_list, list) { in bnx2fc_ulp_stop()
1906 if (interface->hba == hba) in bnx2fc_ulp_stop()
1907 bnx2fc_stop(interface); in bnx2fc_ulp_stop()
1924 static void bnx2fc_start_disc(struct bnx2fc_interface *interface) in bnx2fc_start_disc() argument
1926 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_start_disc()
1932 if (!test_bit(BNX2FC_FLAG_FW_INIT_DONE, &interface->hba->flags)) { in bnx2fc_start_disc()
1940 if (!bnx2fc_link_ok(lport) && interface->enabled) { in bnx2fc_start_disc()
1944 set_bit(ADAPTER_STATE_READY, &interface->hba->adapter_state); in bnx2fc_start_disc()
2012 struct bnx2fc_interface *interface = fcoe_ctlr_priv(ctlr); in __bnx2fc_disable() local
2014 if (interface->enabled == true) { in __bnx2fc_disable()
2019 interface->enabled = false; in __bnx2fc_disable()
2032 struct bnx2fc_interface *interface; in bnx2fc_disable() local
2039 interface = bnx2fc_interface_lookup(netdev); in bnx2fc_disable()
2040 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_disable()
2042 if (!interface) { in bnx2fc_disable()
2092 struct bnx2fc_interface *interface = fcoe_ctlr_priv(ctlr); in __bnx2fc_enable() local
2097 if (interface->enabled == false) { in __bnx2fc_enable()
2103 interface->enabled = true; in __bnx2fc_enable()
2108 hba = interface->hba; in __bnx2fc_enable()
2145 struct bnx2fc_interface *interface; in bnx2fc_enable() local
2152 interface = bnx2fc_interface_lookup(netdev); in bnx2fc_enable()
2153 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_enable()
2154 if (!interface) { in bnx2fc_enable()
2217 struct bnx2fc_interface *interface; in _bnx2fc_create() local
2272 interface = bnx2fc_interface_create(hba, netdev, fip_mode); in _bnx2fc_create()
2273 if (!interface) { in _bnx2fc_create()
2281 interface->vlan_enabled = 1; in _bnx2fc_create()
2284 ctlr = bnx2fc_to_ctlr(interface); in _bnx2fc_create()
2286 interface->vlan_id = vlan_id; in _bnx2fc_create()
2288 interface->timer_work_queue = in _bnx2fc_create()
2290 if (!interface->timer_work_queue) { in _bnx2fc_create()
2296 lport = bnx2fc_if_create(interface, &cdev->dev, 0); in _bnx2fc_create()
2305 list_add_tail(&interface->list, &if_list); in _bnx2fc_create()
2321 set_bit(ADAPTER_STATE_READY, &interface->hba->adapter_state); in _bnx2fc_create()
2325 bnx2fc_start_disc(interface); in _bnx2fc_create()
2328 interface->enabled = true; in _bnx2fc_create()
2334 bnx2fc_interface_put(interface); in _bnx2fc_create()
2341 destroy_workqueue(interface->timer_work_queue); in _bnx2fc_create()
2343 bnx2fc_net_cleanup(interface); in _bnx2fc_create()
2344 bnx2fc_interface_put(interface); in _bnx2fc_create()
2406 struct bnx2fc_interface *interface; in bnx2fc_interface_lookup() local
2409 list_for_each_entry(interface, &if_list, list) { in bnx2fc_interface_lookup()
2410 if (interface->netdev == netdev) in bnx2fc_interface_lookup()
2411 return interface; in bnx2fc_interface_lookup()
2438 struct bnx2fc_interface *interface, *tmp; in bnx2fc_ulp_exit() local
2460 list_for_each_entry_safe(interface, tmp, &if_list, list) in bnx2fc_ulp_exit()
2462 if (interface->hba == hba) in bnx2fc_ulp_exit()
2463 __bnx2fc_destroy(interface); in bnx2fc_ulp_exit()