diff options
author | Len Brown <len.brown@intel.com> | 2009-01-09 09:39:43 +0100 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-01-09 09:39:43 +0100 |
commit | b2576e1d4408e134e2188c967b1f28af39cd79d4 (patch) | |
tree | 004f3c82faab760f304ce031d6d2f572e7746a50 /drivers/net/appletalk/ipddp.c | |
parent | Merge branch 'suspend' into release (diff) | |
parent | Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tyt... (diff) | |
download | linux-b2576e1d4408e134e2188c967b1f28af39cd79d4.tar.xz linux-b2576e1d4408e134e2188c967b1f28af39cd79d4.zip |
Merge branch 'linus' into release
Diffstat (limited to 'drivers/net/appletalk/ipddp.c')
-rw-r--r-- | drivers/net/appletalk/ipddp.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/drivers/net/appletalk/ipddp.c b/drivers/net/appletalk/ipddp.c index 1071144edd66..da64ba88d7f8 100644 --- a/drivers/net/appletalk/ipddp.c +++ b/drivers/net/appletalk/ipddp.c @@ -48,12 +48,18 @@ static int ipddp_mode = IPDDP_DECAP; /* Index to functions, as function prototypes. */ static int ipddp_xmit(struct sk_buff *skb, struct net_device *dev); -static struct net_device_stats *ipddp_get_stats(struct net_device *dev); static int ipddp_create(struct ipddp_route *new_rt); static int ipddp_delete(struct ipddp_route *rt); static struct ipddp_route* ipddp_find_route(struct ipddp_route *rt); static int ipddp_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd); +static const struct net_device_ops ipddp_netdev_ops = { + .ndo_start_xmit = ipddp_xmit, + .ndo_do_ioctl = ipddp_ioctl, + .ndo_change_mtu = eth_change_mtu, + .ndo_set_mac_address = eth_mac_addr, + .ndo_validate_addr = eth_validate_addr, +}; static struct net_device * __init ipddp_init(void) { @@ -61,7 +67,7 @@ static struct net_device * __init ipddp_init(void) struct net_device *dev; int err; - dev = alloc_etherdev(sizeof(struct net_device_stats)); + dev = alloc_etherdev(0); if (!dev) return ERR_PTR(-ENOMEM); @@ -71,9 +77,7 @@ static struct net_device * __init ipddp_init(void) printk(version); /* Initalize the device structure. */ - dev->hard_start_xmit = ipddp_xmit; - dev->get_stats = ipddp_get_stats; - dev->do_ioctl = ipddp_ioctl; + dev->netdev_ops = &ipddp_netdev_ops; dev->type = ARPHRD_IPDDP; /* IP over DDP tunnel */ dev->mtu = 585; @@ -103,13 +107,6 @@ static struct net_device * __init ipddp_init(void) return dev; } -/* - * Get the current statistics. This may be called with the card open or closed. - */ -static struct net_device_stats *ipddp_get_stats(struct net_device *dev) -{ - return dev->priv; -} /* * Transmit LLAP/ELAP frame using aarp_send_ddp. @@ -170,8 +167,8 @@ static int ipddp_xmit(struct sk_buff *skb, struct net_device *dev) skb->protocol = htons(ETH_P_ATALK); /* Protocol has changed */ - ((struct net_device_stats *) dev->priv)->tx_packets++; - ((struct net_device_stats *) dev->priv)->tx_bytes+=skb->len; + dev->stats.tx_packets++; + dev->stats.tx_bytes += skb->len; if(aarp_send_ddp(rt->dev, skb, &rt->at, NULL) < 0) dev_kfree_skb(skb); |