Lines Matching defs:netdev
118 struct net_device *netdev = fcoe_get_netdev(lport);
121 if (!__ethtool_get_link_ksettings(netdev, &ecmd)) {
163 * @netdev: Pointer to the netdev that is associated with the lport
170 struct net_device *netdev)
193 htonl(dev_get_stats(netdev, &temp)->rx_crc_errors);
205 struct net_device *netdev = fcoe_get_netdev(lport);
207 __fcoe_get_lesb(lport, fc_lesb, netdev);
220 struct net_device *netdev = fcoe_get_netdev(fip->lp);
224 __fcoe_get_lesb(fip->lp, fc_lesb, netdev);
284 * @netdev: the associated net device
290 int fcoe_get_wwn(struct net_device *netdev, u64 *wwn, int type)
292 const struct net_device_ops *ops = netdev->netdev_ops;
295 return ops->ndo_fcoe_get_wwn(netdev, wwn, type);
503 * fcoe_transport_lookup - find an fcoe transport that matches a netdev
504 * @netdev: The netdev to look for from all attached transports
506 * Returns : ptr to the fcoe transport that supports this netdev or NULL
511 static struct fcoe_transport *fcoe_transport_lookup(struct net_device *netdev)
516 if (ft->match && ft->match(netdev))
573 /* remove netdev mapping for this transport as it is going away */
578 "remove its netdev mapping for %s\n",
579 ft->name, nm->netdev->name);
635 static int fcoe_add_netdev_mapping(struct net_device *netdev,
646 nm->netdev = netdev;
656 static void fcoe_del_netdev_mapping(struct net_device *netdev)
662 if (nm->netdev == netdev) {
674 * fcoe_netdev_map_lookup - find the fcoe transport that matches the netdev on which
676 * @netdev: The net device that the FCoE interface is on
678 * Returns : ptr to the fcoe transport that supports this netdev or NULL
683 static struct fcoe_transport *fcoe_netdev_map_lookup(struct net_device *netdev)
690 if (netdev == nm->netdev) {
735 struct net_device *netdev = netdev_notifier_info_to_dev(ptr);
740 netdev->name);
741 fcoe_del_netdev_mapping(netdev);
750 struct net_device *netdev = NULL;
757 netdev = fcoe_if_to_netdev(buf);
758 if (!netdev) {
764 ft = fcoe_netdev_map_lookup(netdev);
768 ft->name, netdev->name);
773 ft = fcoe_transport_lookup(netdev);
776 netdev->name);
782 err = ft->alloc ? ft->alloc(netdev) : -ENODEV;
784 fcoe_del_netdev_mapping(netdev);
789 err = fcoe_add_netdev_mapping(netdev, ft);
791 LIBFCOE_TRANSPORT_DBG("failed to add new netdev mapping "
793 ft->name, netdev->name);
799 ft->name, netdev->name);
802 dev_put(netdev);
814 struct net_device *netdev = NULL;
819 netdev = fcoe_if_to_netdev(buf);
820 if (!netdev) {
825 ft = fcoe_netdev_map_lookup(netdev);
828 netdev->name);
833 rc = ft->destroy(netdev);
837 fcoe_del_netdev_mapping(netdev);
840 netdev->name);
843 dev_put(netdev);
863 struct net_device *netdev = NULL;
869 netdev = fcoe_if_to_netdev(buffer);
870 if (!netdev) {
875 ft = fcoe_netdev_map_lookup(netdev);
879 ft->name, netdev->name);
884 ft = fcoe_transport_lookup(netdev);
887 netdev->name);
891 rc = fcoe_add_netdev_mapping(netdev, ft);
893 LIBFCOE_TRANSPORT_DBG("failed to add new netdev mapping "
895 ft->name, netdev->name);
900 rc = ft->create ? ft->create(netdev, fip_mode) : -ENODEV;
902 fcoe_del_netdev_mapping(netdev);
906 netdev->name);
909 dev_put(netdev);
929 struct net_device *netdev = NULL;
934 netdev = fcoe_if_to_netdev(buffer);
935 if (!netdev) {
940 ft = fcoe_netdev_map_lookup(netdev);
943 netdev->name);
948 rc = ft->destroy ? ft->destroy(netdev) : -ENODEV;
949 fcoe_del_netdev_mapping(netdev);
952 netdev->name);
955 dev_put(netdev);
974 struct net_device *netdev = NULL;
979 netdev = fcoe_if_to_netdev(buffer);
980 if (!netdev)
983 ft = fcoe_netdev_map_lookup(netdev);
987 rc = ft->disable ? ft->disable(netdev) : -ENODEV;
990 dev_put(netdev);
1009 struct net_device *netdev = NULL;
1014 netdev = fcoe_if_to_netdev(buffer);
1015 if (!netdev)
1018 ft = fcoe_netdev_map_lookup(netdev);
1022 rc = ft->enable ? ft->enable(netdev) : -ENODEV;
1025 dev_put(netdev);