Lines Matching full:netdev
107 static bool fcoe_match(struct net_device *netdev);
108 static int fcoe_create(struct net_device *netdev, enum fip_mode fip_mode);
109 static int fcoe_destroy(struct net_device *netdev);
110 static int fcoe_enable(struct net_device *netdev);
111 static int fcoe_disable(struct net_device *netdev);
114 static int fcoe_ctlr_alloc(struct net_device *netdev);
286 * @netdev: The net device that the fcoe interface is on
292 struct net_device *netdev) in fcoe_interface_setup() argument
300 fcoe->netdev = netdev; in fcoe_interface_setup()
303 ops = netdev->netdev_ops; in fcoe_interface_setup()
305 if (ops->ndo_fcoe_enable(netdev)) in fcoe_interface_setup()
306 FCOE_NETDEV_DBG(netdev, "Failed to enable FCoE" in fcoe_interface_setup()
311 if (netif_is_bond_master(netdev)) { in fcoe_interface_setup()
312 FCOE_NETDEV_DBG(netdev, "Bonded interfaces not supported\n"); in fcoe_interface_setup()
318 real_dev = is_vlan_dev(netdev) ? vlan_dev_real_dev(netdev) : netdev; in fcoe_interface_setup()
333 memcpy(fip->ctl_src_addr, netdev->dev_addr, netdev->addr_len); in fcoe_interface_setup()
340 dev_uc_add(netdev, flogi_maddr); in fcoe_interface_setup()
342 dev_uc_add(netdev, fip->ctl_src_addr); in fcoe_interface_setup()
344 dev_mc_add(netdev, FIP_ALL_VN2VN_MACS); in fcoe_interface_setup()
345 dev_mc_add(netdev, FIP_ALL_P2P_MACS); in fcoe_interface_setup()
347 dev_mc_add(netdev, FIP_ALL_ENODE_MACS); in fcoe_interface_setup()
355 fcoe->fcoe_packet_type.dev = netdev; in fcoe_interface_setup()
360 fcoe->fip_packet_type.dev = netdev; in fcoe_interface_setup()
363 if (netdev != real_dev) { in fcoe_interface_setup()
374 * @netdev: The net device to create the FCoE interface on
379 static struct fcoe_interface *fcoe_interface_create(struct net_device *netdev, in fcoe_interface_create() argument
389 FCOE_NETDEV_DBG(netdev, in fcoe_interface_create()
396 ctlr_dev = fcoe_ctlr_device_add(&netdev->dev, &fcoe_sysfs_templ, in fcoe_interface_create()
408 dev_hold(netdev); in fcoe_interface_create()
418 err = fcoe_interface_setup(fcoe, netdev); in fcoe_interface_create()
422 dev_put(netdev); in fcoe_interface_create()
436 * fcoe_interface_remove() - remove FCoE interface from netdev
443 struct net_device *netdev = fcoe->netdev; in fcoe_interface_remove() local
456 if (netdev != fcoe->realdev) in fcoe_interface_remove()
461 dev_uc_del(netdev, flogi_maddr); in fcoe_interface_remove()
463 dev_uc_del(netdev, fip->ctl_src_addr); in fcoe_interface_remove()
465 dev_mc_del(netdev, FIP_ALL_VN2VN_MACS); in fcoe_interface_remove()
466 dev_mc_del(netdev, FIP_ALL_P2P_MACS); in fcoe_interface_remove()
468 dev_mc_del(netdev, FIP_ALL_ENODE_MACS); in fcoe_interface_remove()
471 ops = netdev->netdev_ops; in fcoe_interface_remove()
473 if (ops->ndo_fcoe_disable(netdev)) in fcoe_interface_remove()
474 FCOE_NETDEV_DBG(netdev, "Failed to disable FCoE" in fcoe_interface_remove()
487 struct net_device *netdev = fcoe->netdev; in fcoe_interface_cleanup() local
494 dev_put(netdev); in fcoe_interface_cleanup()
501 * @netdev: The associated net device
508 static int fcoe_fip_recv(struct sk_buff *skb, struct net_device *netdev, in fcoe_fip_recv() argument
524 * @netdev: The associated net device
531 static int fcoe_fip_vlan_recv(struct sk_buff *skb, struct net_device *netdev, in fcoe_fip_vlan_recv() argument
576 fcoe->realdev != fcoe->netdev) in fcoe_fip_send()
579 skb->dev = fcoe->netdev; in fcoe_fip_send()
597 dev_uc_del(fcoe->netdev, port->data_src_addr); in fcoe_update_src_mac()
599 dev_uc_add(fcoe->netdev, addr); in fcoe_update_src_mac()
649 * on the LLD netdev's FCoE feature flags
652 struct net_device *netdev) in fcoe_netdev_features_change() argument
656 if (netdev->features & NETIF_F_SG) in fcoe_netdev_features_change()
661 if (netdev->features & NETIF_F_FCOE_CRC) { in fcoe_netdev_features_change()
663 FCOE_NETDEV_DBG(netdev, "Supports FCCRC offload\n"); in fcoe_netdev_features_change()
668 if (netdev->features & NETIF_F_FSO) { in fcoe_netdev_features_change()
670 lport->lso_max = min(netdev->gso_max_size, GSO_LEGACY_MAX_SIZE); in fcoe_netdev_features_change()
671 FCOE_NETDEV_DBG(netdev, "Supports LSO for max len 0x%x\n", in fcoe_netdev_features_change()
678 if (netdev->fcoe_ddp_xid) { in fcoe_netdev_features_change()
680 lport->lro_xid = netdev->fcoe_ddp_xid; in fcoe_netdev_features_change()
681 FCOE_NETDEV_DBG(netdev, "Supports LRO for max xid 0x%x\n", in fcoe_netdev_features_change()
694 * @netdev: The associated net device
700 static int fcoe_netdev_config(struct fc_lport *lport, struct net_device *netdev) in fcoe_netdev_config() argument
714 if (is_vlan_dev(netdev)) in fcoe_netdev_config()
715 lport->vlan = vlan_dev_vlan_id(netdev); in fcoe_netdev_config()
724 mfs = netdev->mtu; in fcoe_netdev_config()
725 if (netdev->fcoe_mtu) { in fcoe_netdev_config()
727 FCOE_NETDEV_DBG(netdev, "Supports FCOE_MTU of %d bytes\n", mfs); in fcoe_netdev_config()
734 fcoe_netdev_features_change(lport, netdev); in fcoe_netdev_config()
743 if (fcoe_get_wwn(netdev, &wwnn, NETDEV_FCOE_WWNN)) in fcoe_netdev_config()
746 if (fcoe_get_wwn(netdev, &wwpn, NETDEV_FCOE_WWPN)) in fcoe_netdev_config()
801 * @netdev: The associated net device
806 static void fcoe_fdmi_info(struct fc_lport *lport, struct net_device *netdev) in fcoe_fdmi_info() argument
831 "information from netdev.\n"); in fcoe_fdmi_info()
943 if (is_vlan_dev(fcoe->netdev)) in fcoe_em_config()
944 cur_real_dev = vlan_dev_real_dev(fcoe->netdev); in fcoe_em_config()
946 cur_real_dev = fcoe->netdev; in fcoe_em_config()
949 if (is_vlan_dev(oldfcoe->netdev)) in fcoe_em_config()
950 old_real_dev = vlan_dev_real_dev(oldfcoe->netdev); in fcoe_em_config()
952 old_real_dev = oldfcoe->netdev; in fcoe_em_config()
964 fcoe->oem, fcoe->netdev->name); in fcoe_em_config()
974 fcoe->netdev->name); in fcoe_em_config()
987 "allocate em on interface %s\n", fcoe->netdev->name); in fcoe_em_config()
1005 struct net_device *netdev = fcoe->netdev; in fcoe_if_destroy() local
1007 FCOE_NETDEV_DBG(netdev, "Destroying interface\n"); in fcoe_if_destroy()
1022 dev_uc_del(netdev, port->data_src_addr); in fcoe_if_destroy()
1064 struct net_device *netdev = fcoe_netdev(lport); in fcoe_ddp_setup() local
1066 if (netdev->netdev_ops->ndo_fcoe_ddp_setup) in fcoe_ddp_setup()
1067 return netdev->netdev_ops->ndo_fcoe_ddp_setup(netdev, in fcoe_ddp_setup()
1086 struct net_device *netdev = fcoe_netdev(lport); in fcoe_ddp_target() local
1088 if (netdev->netdev_ops->ndo_fcoe_ddp_target) in fcoe_ddp_target()
1089 return netdev->netdev_ops->ndo_fcoe_ddp_target(netdev, xid, in fcoe_ddp_target()
1105 struct net_device *netdev = fcoe_netdev(lport); in fcoe_ddp_done() local
1107 if (netdev->netdev_ops->ndo_fcoe_ddp_done) in fcoe_ddp_done()
1108 return netdev->netdev_ops->ndo_fcoe_ddp_done(netdev, xid); in fcoe_ddp_done()
1126 struct net_device *netdev = fcoe->netdev; in fcoe_if_create() local
1137 FCOE_NETDEV_DBG(netdev, "Create Interface\n"); in fcoe_if_create()
1145 FCOE_NETDEV_DBG(netdev, "Could not allocate host structure\n"); in fcoe_if_create()
1166 FCOE_NETDEV_DBG(netdev, "Could not configure lport for the " in fcoe_if_create()
1172 FCOE_NETDEV_DBG(netdev, "Setting vport names, " in fcoe_if_create()
1180 rc = fcoe_netdev_config(lport, netdev); in fcoe_if_create()
1182 FCOE_NETDEV_DBG(netdev, "Could not configure netdev for the " in fcoe_if_create()
1190 FCOE_NETDEV_DBG(netdev, "Could not configure shost for the " in fcoe_if_create()
1198 FCOE_NETDEV_DBG(netdev, "Could not configure libfc for the " in fcoe_if_create()
1204 fcoe_fdmi_info(lport, netdev); in fcoe_if_create()
1225 FCOE_NETDEV_DBG(netdev, "Could not configure the EM\n"); in fcoe_if_create()
1305 * @netdev: The net device that the packet was received on
1314 static int fcoe_rcv(struct sk_buff *skb, struct net_device *netdev, in fcoe_rcv() argument
1330 FCOE_NETDEV_DBG(netdev, "Cannot find hba structure\n"); in fcoe_rcv()
1336 FCOE_NETDEV_DBG(netdev, in fcoe_rcv()
1352 FCOE_NETDEV_DBG(netdev, "wrong source mac address:%pM\n", in fcoe_rcv()
1369 FCOE_NETDEV_DBG(netdev, "FC frame d_id mismatch with MAC:%pM\n", in fcoe_rcv()
1530 if (is_vlan_dev(fcoe->netdev) && in fcoe_xmit()
1535 vlan_dev_vlan_id(fcoe->netdev)); in fcoe_xmit()
1537 skb->dev = fcoe->netdev; in fcoe_xmit()
1745 fcoe_hostlist_lookup_realdev_port(struct net_device *netdev) in fcoe_hostlist_lookup_realdev_port() argument
1751 if (is_vlan_dev(fcoe->netdev)) in fcoe_hostlist_lookup_realdev_port()
1752 real_dev = vlan_dev_real_dev(fcoe->netdev); in fcoe_hostlist_lookup_realdev_port()
1754 real_dev = fcoe->netdev; in fcoe_hostlist_lookup_realdev_port()
1756 if (netdev == real_dev) in fcoe_hostlist_lookup_realdev_port()
1768 struct net_device *netdev; in fcoe_dcb_app_notification() local
1774 netdev = dev_get_by_index(&init_net, entry->ifindex); in fcoe_dcb_app_notification()
1775 if (!netdev) in fcoe_dcb_app_notification()
1778 fcoe = fcoe_hostlist_lookup_realdev_port(netdev); in fcoe_dcb_app_notification()
1779 dev_put(netdev); in fcoe_dcb_app_notification()
1818 struct net_device *netdev = netdev_notifier_info_to_dev(ptr); in fcoe_device_notification() local
1826 if (fcoe->netdev == netdev) { in fcoe_device_notification()
1846 if (netdev->fcoe_mtu) in fcoe_device_notification()
1848 mfs = netdev->mtu - (sizeof(struct fcoe_hdr) + in fcoe_device_notification()
1867 fcoe_netdev_features_change(lport, netdev); in fcoe_device_notification()
1870 FCOE_NETDEV_DBG(netdev, "Unknown event %ld " in fcoe_device_notification()
1871 "from netdev netlink\n", event); in fcoe_device_notification()
1904 * @netdev : The net_device object the Ethernet interface to create on
1912 static int fcoe_disable(struct net_device *netdev) in fcoe_disable() argument
1921 fcoe = fcoe_hostlist_lookup_port(netdev); in fcoe_disable()
1937 * @netdev : The net_device object the Ethernet interface to create on
1943 static int fcoe_enable(struct net_device *netdev) in fcoe_enable() argument
1951 fcoe = fcoe_hostlist_lookup_port(netdev); in fcoe_enable()
1983 struct net_device *netdev = fcoe_netdev(lport); in fcoe_ctlr_enabled() local
1987 return fcoe_enable(netdev); in fcoe_ctlr_enabled()
1989 return fcoe_disable(netdev); in fcoe_ctlr_enabled()
2011 dev_mc_del(fcoe->netdev, FIP_ALL_ENODE_MACS); in fcoe_ctlr_mode()
2012 dev_mc_add(fcoe->netdev, FIP_ALL_VN2VN_MACS); in fcoe_ctlr_mode()
2013 dev_mc_add(fcoe->netdev, FIP_ALL_P2P_MACS); in fcoe_ctlr_mode()
2015 dev_mc_del(fcoe->netdev, FIP_ALL_VN2VN_MACS); in fcoe_ctlr_mode()
2016 dev_mc_del(fcoe->netdev, FIP_ALL_P2P_MACS); in fcoe_ctlr_mode()
2017 dev_mc_add(fcoe->netdev, FIP_ALL_ENODE_MACS); in fcoe_ctlr_mode()
2024 * @netdev : The net_device object the Ethernet interface to create on
2030 static int fcoe_destroy(struct net_device *netdev) in fcoe_destroy() argument
2040 fcoe = fcoe_hostlist_lookup_port(netdev); in fcoe_destroy()
2091 * @netdev : The net_device object the Ethernet interface to create on
2098 static bool fcoe_match(struct net_device *netdev) in fcoe_match() argument
2115 struct net_device *netdev = fcoe->realdev; in fcoe_dcb_create() local
2122 if (netdev && netdev->dcbnl_ops && netdev->dcbnl_ops->getdcbx) { in fcoe_dcb_create()
2123 dcbx = netdev->dcbnl_ops->getdcbx(netdev); in fcoe_dcb_create()
2127 up = dcb_ieee_getapp_mask(netdev, &app); in fcoe_dcb_create()
2129 fup = dcb_ieee_getapp_mask(netdev, &app); in fcoe_dcb_create()
2132 up = dcb_getapp(netdev, &app); in fcoe_dcb_create()
2134 fup = dcb_getapp(netdev, &app); in fcoe_dcb_create()
2152 * @netdev : The net_device object the Ethernet interface to create on
2163 static int _fcoe_create(struct net_device *netdev, enum fip_mode fip_mode, in _fcoe_create() argument
2176 if (fcoe_hostlist_lookup(netdev)) { in _fcoe_create()
2181 fcoe = fcoe_interface_create(netdev, fip_mode); in _fcoe_create()
2192 netdev->name); in _fcoe_create()
2247 * @netdev : The net_device object the Ethernet interface to create on
2254 static int fcoe_create(struct net_device *netdev, enum fip_mode fip_mode) in fcoe_create() argument
2256 return _fcoe_create(netdev, fip_mode, FCOE_CREATE_LINK_UP); in fcoe_create()
2261 * @netdev: The net_device to be used by the allocated FCoE Controller
2270 static int fcoe_ctlr_alloc(struct net_device *netdev) in fcoe_ctlr_alloc() argument
2272 return _fcoe_create(netdev, FIP_MODE_FABRIC, in fcoe_ctlr_alloc()
2285 struct net_device *netdev = fcoe_netdev(lport); in fcoe_link_ok() local
2287 if (netif_oper_up(netdev)) in fcoe_link_ok()
2339 * @netdev: The net device used as a key
2346 fcoe_hostlist_lookup_port(const struct net_device *netdev) in fcoe_hostlist_lookup_port() argument
2351 if (fcoe->netdev == netdev) in fcoe_hostlist_lookup_port()
2360 * @netdev: The netdevice used as a key
2366 static struct fc_lport *fcoe_hostlist_lookup(const struct net_device *netdev) in fcoe_hostlist_lookup() argument
2371 fcoe = fcoe_hostlist_lookup_port(netdev); in fcoe_hostlist_lookup()
2629 struct net_device *netdev = fcoe->netdev; in fcoe_vport_create() local
2651 netdev->name); in fcoe_vport_create()
2780 fcf_dev->vlan_id = vlan_dev_vlan_id(fcoe->netdev); in fcoe_fcf_get_vlan_id()