Patchwork [06/11] macsonic: convert to net_device_ops

login
register
mail settings
Submitter Alexander Beregalov
Date April 11, 2009, 5:41 p.m.
Message ID <20090411174128.GF16999@orion>
Download mbox | patch
Permalink /patch/25860/
State Accepted
Delegated to: David Miller
Headers show

Comments

Alexander Beregalov - April 11, 2009, 5:41 p.m.
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
---

 drivers/net/macsonic.c |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

--
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
David Miller - April 13, 2009, 10:19 p.m.
From: Alexander Beregalov <a.beregalov@gmail.com>
Date: Sat, 11 Apr 2009 21:41:28 +0400

> Signed-off-by: Alexander Beregalov <a.beregalov@gmail.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

diff --git a/drivers/net/macsonic.c b/drivers/net/macsonic.c
index 527166e..acd143d 100644
--- a/drivers/net/macsonic.c
+++ b/drivers/net/macsonic.c
@@ -167,6 +167,18 @@  static int macsonic_close(struct net_device* dev)
 	return err;
 }
 
+static const struct net_device_ops macsonic_netdev_ops = {
+	.ndo_open		= macsonic_open,
+	.ndo_stop		= macsonic_close,
+	.ndo_start_xmit		= sonic_send_packet,
+	.ndo_set_multicast_list	= sonic_multicast_list,
+	.ndo_tx_timeout		= sonic_tx_timeout,
+	.ndo_get_stats		= sonic_get_stats,
+	.ndo_validate_addr	= eth_validate_addr,
+	.ndo_change_mtu		= eth_change_mtu,
+	.ndo_set_mac_address	= eth_mac_addr,
+};
+
 static int __init macsonic_init(struct net_device *dev)
 {
 	struct sonic_local* lp = netdev_priv(dev);
@@ -198,12 +210,7 @@  static int __init macsonic_init(struct net_device *dev)
 	lp->rra_laddr = lp->rda_laddr + (SIZEOF_SONIC_RD * SONIC_NUM_RDS
 	                     * SONIC_BUS_SCALE(lp->dma_bitmode));
 
-	dev->open = macsonic_open;
-	dev->stop = macsonic_close;
-	dev->hard_start_xmit = sonic_send_packet;
-	dev->get_stats = sonic_get_stats;
-	dev->set_multicast_list = &sonic_multicast_list;
-	dev->tx_timeout = sonic_tx_timeout;
+	dev->netdev_ops = &macsonic_netdev_ops;
 	dev->watchdog_timeo = TX_TIMEOUT;
 
 	/*