Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 327997
b: refs/heads/master
c: 2c60db0
h: refs/heads/master
i:
  327995: 1fb2e69
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Sep 19, 2012
1 parent 5694125 commit 7632da6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 828de4f6bf6e785f7b5497f8f7cfd4d4fbcfdb7e
refs/heads/master: 2c60db037034d27f8c636403355d52872da92f81
4 changes: 4 additions & 0 deletions trunk/net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -5974,6 +5974,8 @@ struct netdev_queue *dev_ingress_queue_create(struct net_device *dev)
return queue;
}

static const struct ethtool_ops default_ethtool_ops;

/**
* alloc_netdev_mqs - allocate network device
* @sizeof_priv: size of private data to allocate space for
Expand Down Expand Up @@ -6061,6 +6063,8 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,

strcpy(dev->name, name);
dev->group = INIT_NETDEV_GROUP;
if (!dev->ethtool_ops)
dev->ethtool_ops = &default_ethtool_ops;
return dev;

free_all:
Expand Down
12 changes: 0 additions & 12 deletions trunk/net/core/ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -1426,18 +1426,6 @@ int dev_ethtool(struct net *net, struct ifreq *ifr)
if (copy_from_user(&ethcmd, useraddr, sizeof(ethcmd)))
return -EFAULT;

if (!dev->ethtool_ops) {
/* A few commands do not require any driver support,
* are unprivileged, and do not change anything, so we
* can take a shortcut to them. */
if (ethcmd == ETHTOOL_GDRVINFO)
return ethtool_get_drvinfo(dev, useraddr);
else if (ethcmd == ETHTOOL_GET_TS_INFO)
return ethtool_get_ts_info(dev, useraddr);
else
return -EOPNOTSUPP;
}

/* Allow some commands to be done by anyone */
switch (ethcmd) {
case ETHTOOL_GSET:
Expand Down

0 comments on commit 7632da6

Please sign in to comment.