Patchwork [18/22] hamachi: convert to net_device_ops

login
register
mail settings
Submitter stephen hemminger
Date Nov. 21, 2008, 11:21 p.m.
Message ID <20081121232240.417398289@vyatta.com>
Download mbox | patch
Permalink /patch/10151/
State Accepted
Delegated to: David Miller
Headers show

Comments

stephen hemminger - Nov. 21, 2008, 11:21 p.m.
Convert driver to new net_device_ops. Compile tested only.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
David Miller - Nov. 22, 2008, 1:36 a.m.
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Fri, 21 Nov 2008 15:21:56 -0800

> Convert driver to new net_device_ops. Compile tested only.
> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

--- a/drivers/net/hamachi.c	2008-11-21 14:34:32.000000000 -0800
+++ b/drivers/net/hamachi.c	2008-11-21 14:37:20.000000000 -0800
@@ -568,6 +568,19 @@  static void set_rx_mode(struct net_devic
 static const struct ethtool_ops ethtool_ops;
 static const struct ethtool_ops ethtool_ops_no_mii;
 
+static const struct net_device_ops hamachi_netdev_ops = {
+	.ndo_open		= hamachi_open,
+	.ndo_stop		= hamachi_close,
+	.ndo_start_xmit		= hamachi_start_xmit,
+	.ndo_get_stats		= hamachi_get_stats,
+	.ndo_set_multicast_list	= set_rx_mode,
+	.ndo_change_mtu		= eth_change_mtu,
+	.ndo_validate_addr	= eth_validate_addr,
+	.ndo_tx_timeout		= hamachi_tx_timeout,
+	.ndo_do_ioctl		= netdev_ioctl,
+};
+
+
 static int __devinit hamachi_init_one (struct pci_dev *pdev,
 				    const struct pci_device_id *ent)
 {
@@ -722,17 +735,11 @@  static int __devinit hamachi_init_one (s
 
 
 	/* The Hamachi-specific entries in the device structure. */
-	dev->open = &hamachi_open;
-	dev->hard_start_xmit = &hamachi_start_xmit;
-	dev->stop = &hamachi_close;
-	dev->get_stats = &hamachi_get_stats;
-	dev->set_multicast_list = &set_rx_mode;
-	dev->do_ioctl = &netdev_ioctl;
+	dev->netdev_ops = &hamachi_netdev_ops;
 	if (chip_tbl[hmp->chip_id].flags & CanHaveMII)
 		SET_ETHTOOL_OPS(dev, &ethtool_ops);
 	else
 		SET_ETHTOOL_OPS(dev, &ethtool_ops_no_mii);
-	dev->tx_timeout = &hamachi_tx_timeout;
 	dev->watchdog_timeo = TX_TIMEOUT;
 	if (mtu)
 		dev->mtu = mtu;