Lines Matching refs:fcoe
290 static int fcoe_interface_setup(struct fcoe_interface *fcoe, in fcoe_interface_setup() argument
293 struct fcoe_ctlr *fip = fcoe_to_ctlr(fcoe); in fcoe_interface_setup()
299 fcoe->netdev = netdev; in fcoe_interface_setup()
318 fcoe->realdev = real_dev; in fcoe_interface_setup()
352 fcoe->fcoe_packet_type.func = fcoe_rcv; in fcoe_interface_setup()
353 fcoe->fcoe_packet_type.type = htons(ETH_P_FCOE); in fcoe_interface_setup()
354 fcoe->fcoe_packet_type.dev = netdev; in fcoe_interface_setup()
355 dev_add_pack(&fcoe->fcoe_packet_type); in fcoe_interface_setup()
357 fcoe->fip_packet_type.func = fcoe_fip_recv; in fcoe_interface_setup()
358 fcoe->fip_packet_type.type = htons(ETH_P_FIP); in fcoe_interface_setup()
359 fcoe->fip_packet_type.dev = netdev; in fcoe_interface_setup()
360 dev_add_pack(&fcoe->fip_packet_type); in fcoe_interface_setup()
363 fcoe->fip_vlan_packet_type.func = fcoe_fip_vlan_recv; in fcoe_interface_setup()
364 fcoe->fip_vlan_packet_type.type = htons(ETH_P_FIP); in fcoe_interface_setup()
365 fcoe->fip_vlan_packet_type.dev = real_dev; in fcoe_interface_setup()
366 dev_add_pack(&fcoe->fip_vlan_packet_type); in fcoe_interface_setup()
383 struct fcoe_interface *fcoe; in fcoe_interface_create() local
390 fcoe = ERR_PTR(-EBUSY); in fcoe_interface_create()
399 fcoe = ERR_PTR(-ENOMEM); in fcoe_interface_create()
405 fcoe = fcoe_ctlr_priv(ctlr); in fcoe_interface_create()
417 err = fcoe_interface_setup(fcoe, netdev); in fcoe_interface_create()
422 fcoe = ERR_PTR(err); in fcoe_interface_create()
431 return fcoe; in fcoe_interface_create()
440 static void fcoe_interface_remove(struct fcoe_interface *fcoe) in fcoe_interface_remove() argument
442 struct net_device *netdev = fcoe->netdev; in fcoe_interface_remove()
443 struct fcoe_ctlr *fip = fcoe_to_ctlr(fcoe); in fcoe_interface_remove()
453 __dev_remove_pack(&fcoe->fcoe_packet_type); in fcoe_interface_remove()
454 __dev_remove_pack(&fcoe->fip_packet_type); in fcoe_interface_remove()
455 if (netdev != fcoe->realdev) in fcoe_interface_remove()
456 __dev_remove_pack(&fcoe->fip_vlan_packet_type); in fcoe_interface_remove()
476 fcoe->removed = 1; in fcoe_interface_remove()
484 static void fcoe_interface_cleanup(struct fcoe_interface *fcoe) in fcoe_interface_cleanup() argument
486 struct net_device *netdev = fcoe->netdev; in fcoe_interface_cleanup()
487 struct fcoe_ctlr *fip = fcoe_to_ctlr(fcoe); in fcoe_interface_cleanup()
511 struct fcoe_interface *fcoe; in fcoe_fip_recv() local
514 fcoe = container_of(ptype, struct fcoe_interface, fip_packet_type); in fcoe_fip_recv()
515 ctlr = fcoe_to_ctlr(fcoe); in fcoe_fip_recv()
534 struct fcoe_interface *fcoe; in fcoe_fip_vlan_recv() local
537 fcoe = container_of(ptype, struct fcoe_interface, fip_vlan_packet_type); in fcoe_fip_vlan_recv()
538 ctlr = fcoe_to_ctlr(fcoe); in fcoe_fip_vlan_recv()
563 struct fcoe_interface *fcoe = fcoe_from_ctlr(fip); in fcoe_fip_send() local
575 fcoe->realdev != fcoe->netdev) in fcoe_fip_send()
576 skb->dev = fcoe->realdev; in fcoe_fip_send()
578 skb->dev = fcoe->netdev; in fcoe_fip_send()
593 struct fcoe_interface *fcoe = port->priv; in fcoe_update_src_mac() local
596 dev_uc_del(fcoe->netdev, port->data_src_addr); in fcoe_update_src_mac()
598 dev_uc_add(fcoe->netdev, addr); in fcoe_update_src_mac()
703 struct fcoe_interface *fcoe; in fcoe_netdev_config() local
709 fcoe = port->priv; in fcoe_netdev_config()
710 ctlr = fcoe_to_ctlr(fcoe); in fcoe_netdev_config()
807 struct fcoe_interface *fcoe; in fcoe_fdmi_info() local
813 fcoe = port->priv; in fcoe_fdmi_info()
814 realdev = fcoe->realdev; in fcoe_fdmi_info()
922 struct fcoe_interface *fcoe = port->priv; in fcoe_em_config() local
942 if (is_vlan_dev(fcoe->netdev)) in fcoe_em_config()
943 cur_real_dev = vlan_dev_real_dev(fcoe->netdev); in fcoe_em_config()
945 cur_real_dev = fcoe->netdev; in fcoe_em_config()
954 fcoe->oem = oldfcoe->oem; in fcoe_em_config()
959 if (fcoe->oem) { in fcoe_em_config()
960 if (!fc_exch_mgr_add(lport, fcoe->oem, fcoe_oem_match)) { in fcoe_em_config()
963 fcoe->oem, fcoe->netdev->name); in fcoe_em_config()
967 fcoe->oem = fc_exch_mgr_alloc(lport, FC_CLASS_3, in fcoe_em_config()
970 if (!fcoe->oem) { in fcoe_em_config()
973 fcoe->netdev->name); in fcoe_em_config()
986 "allocate em on interface %s\n", fcoe->netdev->name); in fcoe_em_config()
1003 struct fcoe_interface *fcoe = port->priv; in fcoe_if_destroy() local
1004 struct net_device *netdev = fcoe->netdev; in fcoe_if_destroy()
1025 fcoe_interface_remove(fcoe); in fcoe_if_destroy()
1121 static struct fc_lport *fcoe_if_create(struct fcoe_interface *fcoe, in fcoe_if_create() argument
1124 struct fcoe_ctlr *ctlr = fcoe_to_ctlr(fcoe); in fcoe_if_create()
1125 struct net_device *netdev = fcoe->netdev; in fcoe_if_create()
1150 port->priv = fcoe; in fcoe_if_create()
1339 struct fcoe_interface *fcoe; in fcoe_rcv() local
1345 fcoe = container_of(ptype, struct fcoe_interface, fcoe_packet_type); in fcoe_rcv()
1346 ctlr = fcoe_to_ctlr(fcoe); in fcoe_rcv()
1482 struct fcoe_interface *fcoe = port->priv; in fcoe_xmit() local
1483 struct fcoe_ctlr *ctlr = fcoe_to_ctlr(fcoe); in fcoe_xmit()
1549 skb->priority = fcoe->priority; in fcoe_xmit()
1551 if (is_vlan_dev(fcoe->netdev) && in fcoe_xmit()
1552 fcoe->realdev->features & NETIF_F_HW_VLAN_CTAG_TX) { in fcoe_xmit()
1554 skb->dev = fcoe->realdev; in fcoe_xmit()
1556 vlan_dev_vlan_id(fcoe->netdev)); in fcoe_xmit()
1558 skb->dev = fcoe->netdev; in fcoe_xmit()
1609 struct fcoe_interface *fcoe; in fcoe_filter_frames() local
1628 fcoe = ((struct fcoe_port *)lport_priv(lport))->priv; in fcoe_filter_frames()
1629 ctlr = fcoe_to_ctlr(fcoe); in fcoe_filter_frames()
1775 struct fcoe_interface *fcoe; in fcoe_hostlist_lookup_realdev_port() local
1778 list_for_each_entry(fcoe, &fcoe_hostlist, list) { in fcoe_hostlist_lookup_realdev_port()
1779 if (is_vlan_dev(fcoe->netdev)) in fcoe_hostlist_lookup_realdev_port()
1780 real_dev = vlan_dev_real_dev(fcoe->netdev); in fcoe_hostlist_lookup_realdev_port()
1782 real_dev = fcoe->netdev; in fcoe_hostlist_lookup_realdev_port()
1785 return fcoe; in fcoe_hostlist_lookup_realdev_port()
1795 struct fcoe_interface *fcoe; in fcoe_dcb_app_notification() local
1806 fcoe = fcoe_hostlist_lookup_realdev_port(netdev); in fcoe_dcb_app_notification()
1808 if (!fcoe) in fcoe_dcb_app_notification()
1811 ctlr = fcoe_to_ctlr(fcoe); in fcoe_dcb_app_notification()
1826 fcoe->priority = prio; in fcoe_dcb_app_notification()
1848 struct fcoe_interface *fcoe; in fcoe_device_notification() local
1854 list_for_each_entry(fcoe, &fcoe_hostlist, list) { in fcoe_device_notification()
1855 if (fcoe->netdev == netdev) { in fcoe_device_notification()
1856 ctlr = fcoe_to_ctlr(fcoe); in fcoe_device_notification()
1885 list_del(&fcoe->list); in fcoe_device_notification()
1889 if (!fcoe->removed) in fcoe_device_notification()
1890 fcoe_interface_remove(fcoe); in fcoe_device_notification()
1891 fcoe_interface_cleanup(fcoe); in fcoe_device_notification()
1946 struct fcoe_interface *fcoe; in fcoe_disable() local
1952 fcoe = fcoe_hostlist_lookup_port(netdev); in fcoe_disable()
1955 if (fcoe) { in fcoe_disable()
1956 ctlr = fcoe_to_ctlr(fcoe); in fcoe_disable()
1977 struct fcoe_interface *fcoe; in fcoe_enable() local
1982 fcoe = fcoe_hostlist_lookup_port(netdev); in fcoe_enable()
1985 if (!fcoe) { in fcoe_enable()
1990 ctlr = fcoe_to_ctlr(fcoe); in fcoe_enable()
2038 struct fcoe_interface *fcoe = fcoe_ctlr_priv(ctlr); in fcoe_ctlr_mode() local
2042 dev_mc_del(fcoe->netdev, FIP_ALL_ENODE_MACS); in fcoe_ctlr_mode()
2043 dev_mc_add(fcoe->netdev, FIP_ALL_VN2VN_MACS); in fcoe_ctlr_mode()
2044 dev_mc_add(fcoe->netdev, FIP_ALL_P2P_MACS); in fcoe_ctlr_mode()
2046 dev_mc_del(fcoe->netdev, FIP_ALL_VN2VN_MACS); in fcoe_ctlr_mode()
2047 dev_mc_del(fcoe->netdev, FIP_ALL_P2P_MACS); in fcoe_ctlr_mode()
2048 dev_mc_add(fcoe->netdev, FIP_ALL_ENODE_MACS); in fcoe_ctlr_mode()
2064 struct fcoe_interface *fcoe; in fcoe_destroy() local
2071 fcoe = fcoe_hostlist_lookup_port(netdev); in fcoe_destroy()
2072 if (!fcoe) { in fcoe_destroy()
2076 ctlr = fcoe_to_ctlr(fcoe); in fcoe_destroy()
2079 list_del(&fcoe->list); in fcoe_destroy()
2096 struct fcoe_interface *fcoe; in fcoe_destroy_work() local
2104 fcoe = port->priv; in fcoe_destroy_work()
2105 ctlr = fcoe_to_ctlr(fcoe); in fcoe_destroy_work()
2110 if (!fcoe->removed) in fcoe_destroy_work()
2111 fcoe_interface_remove(fcoe); in fcoe_destroy_work()
2113 fcoe_interface_cleanup(fcoe); in fcoe_destroy_work()
2138 static void fcoe_dcb_create(struct fcoe_interface *fcoe) in fcoe_dcb_create() argument
2142 struct fcoe_ctlr *ctlr = fcoe_to_ctlr(fcoe); in fcoe_dcb_create()
2146 struct net_device *netdev = fcoe->realdev; in fcoe_dcb_create()
2172 fcoe->priority = fcoe_prio; in fcoe_dcb_create()
2200 struct fcoe_interface *fcoe; in _fcoe_create() local
2212 fcoe = fcoe_interface_create(netdev, fip_mode); in _fcoe_create()
2213 if (IS_ERR(fcoe)) { in _fcoe_create()
2214 rc = PTR_ERR(fcoe); in _fcoe_create()
2218 ctlr = fcoe_to_ctlr(fcoe); in _fcoe_create()
2220 lport = fcoe_if_create(fcoe, &ctlr_dev->dev, 0); in _fcoe_create()
2225 if (!fcoe->removed) in _fcoe_create()
2226 fcoe_interface_remove(fcoe); in _fcoe_create()
2228 fcoe_interface_cleanup(fcoe); in _fcoe_create()
2238 fcoe_dcb_create(fcoe); in _fcoe_create()
2355 struct fcoe_interface *fcoe = port->priv; in fcoe_reset() local
2356 struct fcoe_ctlr *ctlr = fcoe_to_ctlr(fcoe); in fcoe_reset()
2379 struct fcoe_interface *fcoe; in fcoe_hostlist_lookup_port() local
2381 list_for_each_entry(fcoe, &fcoe_hostlist, list) { in fcoe_hostlist_lookup_port()
2382 if (fcoe->netdev == netdev) in fcoe_hostlist_lookup_port()
2383 return fcoe; in fcoe_hostlist_lookup_port()
2400 struct fcoe_interface *fcoe; in fcoe_hostlist_lookup() local
2402 fcoe = fcoe_hostlist_lookup_port(netdev); in fcoe_hostlist_lookup()
2403 ctlr = fcoe_to_ctlr(fcoe); in fcoe_hostlist_lookup()
2404 return (fcoe) ? ctlr->lp : NULL; in fcoe_hostlist_lookup()
2418 struct fcoe_interface *fcoe; in fcoe_hostlist_add() local
2421 fcoe = fcoe_hostlist_lookup_port(fcoe_netdev(lport)); in fcoe_hostlist_add()
2422 if (!fcoe) { in fcoe_hostlist_add()
2424 fcoe = port->priv; in fcoe_hostlist_add()
2425 list_add_tail(&fcoe->list, &fcoe_hostlist); in fcoe_hostlist_add()
2440 struct fcoe_interface *fcoe; in fcoe_hostlist_del() local
2444 fcoe = port->priv; in fcoe_hostlist_del()
2445 list_del(&fcoe->list); in fcoe_hostlist_del()
2517 struct fcoe_interface *fcoe, *tmp; in fcoe_exit() local
2528 list_for_each_entry_safe(fcoe, tmp, &fcoe_hostlist, list) { in fcoe_exit()
2529 ctlr = fcoe_to_ctlr(fcoe); in fcoe_exit()
2624 struct fcoe_interface *fcoe = port->priv; in fcoe_elsct_send() local
2625 struct fcoe_ctlr *fip = fcoe_to_ctlr(fcoe); in fcoe_elsct_send()
2657 struct fcoe_interface *fcoe = port->priv; in fcoe_vport_create() local
2658 struct net_device *netdev = fcoe->netdev; in fcoe_vport_create()
2674 vn_port = fcoe_if_create(fcoe, &vport->dev, 1); in fcoe_vport_create()
2807 struct fcoe_interface *fcoe = fcoe_ctlr_priv(ctlr); in fcoe_fcf_get_vlan_id() local
2809 fcf_dev->vlan_id = vlan_dev_vlan_id(fcoe->netdev); in fcoe_fcf_get_vlan_id()
2828 struct fcoe_interface *fcoe = port->priv; in fcoe_set_port_id() local
2829 struct fcoe_ctlr *ctlr = fcoe_to_ctlr(fcoe); in fcoe_set_port_id()