summaryrefslogtreecommitdiffstats
path: root/drivers/net/loopback.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2008-11-20 06:46:18 +0100
committerDavid S. Miller <davem@davemloft.net>2008-11-20 07:42:37 +0100
commitc02373bf2759dd210dc8c72c9c9b4a8f1c279cac (patch)
tree7cf270d2d9fc6d31320b56ddee9b05d2abf1b727 /drivers/net/loopback.c
parentnetdev: expose ethernet address primitives (diff)
downloadlinux-c02373bf2759dd210dc8c72c9c9b4a8f1c279cac.tar.xz
linux-c02373bf2759dd210dc8c72c9c9b4a8f1c279cac.zip
netdev: convert loopback to net_device_ops
First device to convert over is the loopback device. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/loopback.c')
-rw-r--r--drivers/net/loopback.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
index c4516b580ba5..958450124dec 100644
--- a/drivers/net/loopback.c
+++ b/drivers/net/loopback.c
@@ -87,7 +87,7 @@ static int loopback_xmit(struct sk_buff *skb, struct net_device *dev)
return 0;
}
-static struct net_device_stats *get_stats(struct net_device *dev)
+static struct net_device_stats *loopback_get_stats(struct net_device *dev)
{
const struct pcpu_lstats *pcpu_lstats;
struct net_device_stats *stats = &dev->stats;
@@ -143,13 +143,17 @@ static void loopback_dev_free(struct net_device *dev)
free_netdev(dev);
}
+static const struct net_device_ops loopback_ops = {
+ .ndo_init = loopback_dev_init,
+ .ndo_get_stats = loopback_get_stats,
+};
+
/*
* The loopback device is special. There is only one instance
* per network namespace.
*/
static void loopback_setup(struct net_device *dev)
{
- dev->get_stats = &get_stats;
dev->mtu = (16 * 1024) + 20 + 20 + 12;
dev->hard_start_xmit = loopback_xmit;
dev->hard_header_len = ETH_HLEN; /* 14 */
@@ -165,8 +169,8 @@ static void loopback_setup(struct net_device *dev)
| NETIF_F_NETNS_LOCAL;
dev->ethtool_ops = &loopback_ethtool_ops;
dev->header_ops = &eth_header_ops;
- dev->init = loopback_dev_init;
- dev->destructor = loopback_dev_free;
+ dev->netdev_ops = &loopback_ops;
+ dev->destructor = loopback_dev_free;
}
/* Setup and register the loopback device. */