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);
194 struct bnx2fc_interface *interface = port->priv; in bnx2fc_cleanup() local
195 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_cleanup()
272 struct bnx2fc_interface *interface; in bnx2fc_xmit() local
285 interface = port->priv; in bnx2fc_xmit()
286 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_xmit()
287 hba = interface->hba; in bnx2fc_xmit()
372 skb->dev = interface->netdev; in bnx2fc_xmit()
433 struct bnx2fc_interface *interface; in bnx2fc_rcv() local
441 interface = container_of(ptype, struct bnx2fc_interface, in bnx2fc_rcv()
443 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_rcv()
530 struct bnx2fc_interface *interface; in bnx2fc_recv_frame() local
568 interface = phys_port->priv; in bnx2fc_recv_frame()
569 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_recv_frame()
691 struct bnx2fc_interface *interface = port->priv; in bnx2fc_get_host_stats() local
692 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_get_host_stats()
741 struct bnx2fc_interface *interface = port->priv; in bnx2fc_shost_config() local
742 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_shost_config()
766 interface->netdev->name); in bnx2fc_shost_config()
774 struct bnx2fc_interface *interface = port->priv; in bnx2fc_link_ok() local
775 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_link_ok()
806 struct bnx2fc_interface *interface; in bnx2fc_net_config() local
812 interface = port->priv; in bnx2fc_net_config()
813 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_net_config()
814 hba = interface->hba; in bnx2fc_net_config()
875 struct bnx2fc_interface *interface, *tmp; in bnx2fc_indicate_netevent() local
908 list_for_each_entry_safe(interface, tmp, &if_list, list) { in bnx2fc_indicate_netevent()
909 if (interface->hba == hba && in bnx2fc_indicate_netevent()
910 interface->vlan_id == (vlan_id & VLAN_VID_MASK)) in bnx2fc_indicate_netevent()
911 __bnx2fc_destroy(interface); in bnx2fc_indicate_netevent()
924 list_for_each_entry(interface, &if_list, list) { in bnx2fc_indicate_netevent()
926 if (interface->hba != hba) in bnx2fc_indicate_netevent()
929 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_indicate_netevent()
932 interface->netdev->name, event); in bnx2fc_indicate_netevent()
952 if (interface->enabled) in bnx2fc_indicate_netevent()
1068 struct bnx2fc_interface *interface; in bnx2fc_fip_recv() local
1070 interface = container_of(ptype, struct bnx2fc_interface, in bnx2fc_fip_recv()
1072 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_fip_recv()
1138 struct bnx2fc_interface *interface = port->priv; in bnx2fc_vport_create() local
1139 struct net_device *netdev = interface->netdev; in bnx2fc_vport_create()
1153 if (!test_bit(BNX2FC_FLAG_FW_INIT_DONE, &interface->hba->flags)) { in bnx2fc_vport_create()
1160 vn_port = bnx2fc_if_create(interface, &vport->dev, 1); in bnx2fc_vport_create()
1204 struct bnx2fc_interface *interface = port->priv; in bnx2fc_vport_destroy() local
1221 bnx2fc_free_vport(interface->hba, port->lport); in bnx2fc_vport_destroy()
1223 bnx2fc_interface_put(interface); in bnx2fc_vport_destroy()
1244 static int bnx2fc_interface_setup(struct bnx2fc_interface *interface) in bnx2fc_interface_setup() argument
1246 struct net_device *netdev = interface->netdev; in bnx2fc_interface_setup()
1247 struct net_device *physdev = interface->hba->phys_dev; in bnx2fc_interface_setup()
1248 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_interface_setup()
1274 interface->fip_packet_type.func = bnx2fc_fip_recv; in bnx2fc_interface_setup()
1275 interface->fip_packet_type.type = htons(ETH_P_FIP); in bnx2fc_interface_setup()
1276 interface->fip_packet_type.dev = netdev; in bnx2fc_interface_setup()
1277 dev_add_pack(&interface->fip_packet_type); in bnx2fc_interface_setup()
1279 interface->fcoe_packet_type.func = bnx2fc_rcv; in bnx2fc_interface_setup()
1280 interface->fcoe_packet_type.type = __constant_htons(ETH_P_FCOE); in bnx2fc_interface_setup()
1281 interface->fcoe_packet_type.dev = netdev; in bnx2fc_interface_setup()
1282 dev_add_pack(&interface->fcoe_packet_type); in bnx2fc_interface_setup()
1319 struct bnx2fc_interface *interface; in bnx2fc_interface_release() local
1323 interface = container_of(kref, struct bnx2fc_interface, kref); in bnx2fc_interface_release()
1326 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_interface_release()
1328 netdev = interface->netdev; in bnx2fc_interface_release()
1331 if (test_and_clear_bit(BNX2FC_CTLR_INIT_DONE, &interface->if_flags)) in bnx2fc_interface_release()
1340 static inline void bnx2fc_interface_get(struct bnx2fc_interface *interface) in bnx2fc_interface_get() argument
1342 kref_get(&interface->kref); in bnx2fc_interface_get()
1345 static inline void bnx2fc_interface_put(struct bnx2fc_interface *interface) in bnx2fc_interface_put() argument
1347 kref_put(&interface->kref, bnx2fc_interface_release); in bnx2fc_interface_put()
1451 struct bnx2fc_interface *interface; in bnx2fc_interface_create() local
1456 size = (sizeof(*interface) + sizeof(struct fcoe_ctlr)); in bnx2fc_interface_create()
1465 interface = fcoe_ctlr_priv(ctlr); in bnx2fc_interface_create()
1467 kref_init(&interface->kref); in bnx2fc_interface_create()
1468 interface->hba = hba; in bnx2fc_interface_create()
1469 interface->netdev = netdev; in bnx2fc_interface_create()
1476 set_bit(BNX2FC_CTLR_INIT_DONE, &interface->if_flags); in bnx2fc_interface_create()
1478 rc = bnx2fc_interface_setup(interface); in bnx2fc_interface_create()
1480 return interface; in bnx2fc_interface_create()
1499 static struct fc_lport *bnx2fc_if_create(struct bnx2fc_interface *interface, in bnx2fc_if_create() argument
1502 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_if_create()
1508 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_if_create()
1531 port->priv = interface; in bnx2fc_if_create()
1547 rc = bnx2fc_net_config(lport, interface->netdev); in bnx2fc_if_create()
1556 interface->netdev->name); in bnx2fc_if_create()
1585 bnx2fc_interface_get(interface); in bnx2fc_if_create()
1603 static void bnx2fc_net_cleanup(struct bnx2fc_interface *interface) in bnx2fc_net_cleanup() argument
1606 __dev_remove_pack(&interface->fcoe_packet_type); in bnx2fc_net_cleanup()
1607 __dev_remove_pack(&interface->fip_packet_type); in bnx2fc_net_cleanup()
1611 static void bnx2fc_interface_cleanup(struct bnx2fc_interface *interface) in bnx2fc_interface_cleanup() argument
1613 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_interface_cleanup()
1616 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_interface_cleanup()
1624 bnx2fc_net_cleanup(interface); in bnx2fc_interface_cleanup()
1652 static void __bnx2fc_destroy(struct bnx2fc_interface *interface) in __bnx2fc_destroy() argument
1654 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in __bnx2fc_destroy()
1658 bnx2fc_interface_cleanup(interface); in __bnx2fc_destroy()
1659 bnx2fc_stop(interface); in __bnx2fc_destroy()
1660 list_del(&interface->list); in __bnx2fc_destroy()
1661 bnx2fc_interface_put(interface); in __bnx2fc_destroy()
1677 struct bnx2fc_interface *interface = NULL; in bnx2fc_destroy() local
1685 interface = bnx2fc_interface_lookup(netdev); in bnx2fc_destroy()
1686 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_destroy()
1687 if (!interface || !ctlr->lp) { in bnx2fc_destroy()
1693 timer_work_queue = interface->timer_work_queue; in bnx2fc_destroy()
1694 __bnx2fc_destroy(interface); in bnx2fc_destroy()
1846 struct bnx2fc_interface *interface; in bnx2fc_ulp_start() local
1857 list_for_each_entry(interface, &if_list, list) { in bnx2fc_ulp_start()
1858 if (interface->hba == hba) { in bnx2fc_ulp_start()
1859 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_ulp_start()
1864 bnx2fc_start_disc(interface); in bnx2fc_ulp_start()
1878 static void bnx2fc_stop(struct bnx2fc_interface *interface) in bnx2fc_stop() argument
1880 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_stop()
1884 if (!test_bit(BNX2FC_FLAG_FW_INIT_DONE, &interface->hba->flags)) in bnx2fc_stop()
1979 struct bnx2fc_interface *interface; in bnx2fc_ulp_stop() local
1986 list_for_each_entry(interface, &if_list, list) { in bnx2fc_ulp_stop()
1987 if (interface->hba == hba) in bnx2fc_ulp_stop()
1988 bnx2fc_stop(interface); in bnx2fc_ulp_stop()
2005 static void bnx2fc_start_disc(struct bnx2fc_interface *interface) in bnx2fc_start_disc() argument
2007 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_start_disc()
2013 if (!test_bit(BNX2FC_FLAG_FW_INIT_DONE, &interface->hba->flags)) { in bnx2fc_start_disc()
2021 if (!bnx2fc_link_ok(lport) && interface->enabled) { in bnx2fc_start_disc()
2025 set_bit(ADAPTER_STATE_READY, &interface->hba->adapter_state); in bnx2fc_start_disc()
2095 struct bnx2fc_interface *interface = fcoe_ctlr_priv(ctlr); in __bnx2fc_disable() local
2097 if (interface->enabled == true) { in __bnx2fc_disable()
2102 interface->enabled = false; in __bnx2fc_disable()
2115 struct bnx2fc_interface *interface; in bnx2fc_disable() local
2122 interface = bnx2fc_interface_lookup(netdev); in bnx2fc_disable()
2123 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_disable()
2125 if (!interface) { in bnx2fc_disable()
2190 struct bnx2fc_interface *interface = fcoe_ctlr_priv(ctlr); in __bnx2fc_enable() local
2195 if (interface->enabled == false) { in __bnx2fc_enable()
2201 interface->enabled = true; in __bnx2fc_enable()
2206 hba = interface->hba; in __bnx2fc_enable()
2243 struct bnx2fc_interface *interface; in bnx2fc_enable() local
2250 interface = bnx2fc_interface_lookup(netdev); in bnx2fc_enable()
2251 ctlr = bnx2fc_to_ctlr(interface); in bnx2fc_enable()
2252 if (!interface) { in bnx2fc_enable()
2315 struct bnx2fc_interface *interface; in _bnx2fc_create() local
2370 interface = bnx2fc_interface_create(hba, netdev, fip_mode); in _bnx2fc_create()
2371 if (!interface) { in _bnx2fc_create()
2379 interface->vlan_enabled = 1; in _bnx2fc_create()
2382 ctlr = bnx2fc_to_ctlr(interface); in _bnx2fc_create()
2384 interface->vlan_id = vlan_id; in _bnx2fc_create()
2385 interface->tm_timeout = BNX2FC_TM_TIMEOUT; in _bnx2fc_create()
2387 interface->timer_work_queue = in _bnx2fc_create()
2389 if (!interface->timer_work_queue) { in _bnx2fc_create()
2395 lport = bnx2fc_if_create(interface, &cdev->dev, 0); in _bnx2fc_create()
2404 list_add_tail(&interface->list, &if_list); in _bnx2fc_create()
2420 set_bit(ADAPTER_STATE_READY, &interface->hba->adapter_state); in _bnx2fc_create()
2424 bnx2fc_start_disc(interface); in _bnx2fc_create()
2427 interface->enabled = true; in _bnx2fc_create()
2433 bnx2fc_interface_put(interface); in _bnx2fc_create()
2440 destroy_workqueue(interface->timer_work_queue); in _bnx2fc_create()
2442 bnx2fc_net_cleanup(interface); in _bnx2fc_create()
2443 bnx2fc_interface_put(interface); in _bnx2fc_create()
2505 struct bnx2fc_interface *interface; in bnx2fc_interface_lookup() local
2508 list_for_each_entry(interface, &if_list, list) { in bnx2fc_interface_lookup()
2509 if (interface->netdev == netdev) in bnx2fc_interface_lookup()
2510 return interface; in bnx2fc_interface_lookup()
2537 struct bnx2fc_interface *interface, *tmp; in bnx2fc_ulp_exit() local
2559 list_for_each_entry_safe(interface, tmp, &if_list, list) in bnx2fc_ulp_exit()
2561 if (interface->hba == hba) in bnx2fc_ulp_exit()
2562 __bnx2fc_destroy(interface); in bnx2fc_ulp_exit()
2930 struct bnx2fc_interface *interface = port->priv; in bnx2fc_tm_timeout_show() local
2932 sprintf(buf, "%u\n", interface->tm_timeout); in bnx2fc_tm_timeout_show()
2943 struct bnx2fc_interface *interface = port->priv; in bnx2fc_tm_timeout_store() local
2952 interface->tm_timeout = (u8)val; in bnx2fc_tm_timeout_store()