Skip to contentSkip to conversation

: sunlance: Convert to net_device_ops.

PATCH In review David Miller 2 participants 3 messages Mar 23, 2009

Subsystems (2)
lore
Share & tools
lore

David Miller

author maintainer
#0 lore raw

PATCH 3/4 : sunlance: Convert to net_device_ops.

---
 drivers/net/sunlance.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)
drivers/net/sunlance.c +9 -5
index 16c528d..3a2bb96 100644
@@ -1311,6 +1311,14 @@ static const struct ethtool_ops sparc_lance_ethtool_ops = {
 	.get_link		= sparc_lance_get_link,
 };
 
+static const struct net_device_ops sparc_lance_ops = {
+	.ndo_open		= lance_open,
+	.ndo_stop		= lance_close,
+	.ndo_start_xmit		= lance_start_xmit,
+	.ndo_set_multicast_list	= lance_set_multicast,
+	.ndo_tx_timeout		= lance_tx_timeout,
+};
+
 static int __devinit sparc_lance_probe_one(struct of_device *op,
 					   struct of_device *ledma,
 					   struct of_device *lebuffer)
@@ -1462,13 +1470,9 @@ no_link_test:
 
 	lp->dev = dev;
 	SET_NETDEV_DEV(dev, &op->dev);
-	dev->open = &lance_open;
-	dev->stop = &lance_close;
-	dev->hard_start_xmit = &lance_start_xmit;
-	dev->tx_timeout = &lance_tx_timeout;
 	dev->watchdog_timeo = 5*HZ;
-	dev->set_multicast_list = &lance_set_multicast;
 	dev->ethtool_ops = &sparc_lance_ethtool_ops;
+	dev->netdev_ops = &sparc_lance_ops;
 
 	dev->irq = op->irqs[0];
 
Signature · 1 line
1.6.2.1.222.g570cc
#1 lore raw
Quoted 11 lines · On Mon, 23 Mar 2009 13:47:19 -0700 (PDT) David Miller <[email protected]>…
---
 drivers/net/sunlance.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)
drivers/net/sunlance.c +0 -0
index 16c528d..3a2bb96 100644

drivers/net/sunlance.c static const struct ethtool_ops sparc_lance_ethtool_ops = { · line 1319

Quoted 9 lines
drivers/net/sunlance.c +6 -0
@@ -1311,6 +1311,14 @@ static const struct ethtool_ops sparc_lance_ethtool_ops = {
 	.get_link		= sparc_lance_get_link,
 };
 
+static const struct net_device_ops sparc_lance_ops = {
+	.ndo_open		= lance_open,
+	.ndo_stop		= lance_close,
+	.ndo_start_xmit		= lance_start_xmit,
+	.ndo_set_multicast_list	= lance_set_multicast,
+	.ndo_tx_timeout		= lance_tx_timeout,

You need to add the three entries that ether_setup() was doing in the old code:
.ndo_change_mtu = eth_change_mtu,
.ndo_set_mac_address = eth_mac_addr,
.ndo_validate_addr = eth_validate_addr,

Quoted 20 lines
drivers/net/sunlance.c +3 -5
+};
+
 static int __devinit sparc_lance_probe_one(struct of_device *op,
 					   struct of_device *ledma,
 					   struct of_device *lebuffer)
@@ -1462,13 +1470,9 @@ no_link_test:
 
 	lp->dev = dev;
 	SET_NETDEV_DEV(dev, &op->dev);
-	dev->open = &lance_open;
-	dev->stop = &lance_close;
-	dev->hard_start_xmit = &lance_start_xmit;
-	dev->tx_timeout = &lance_tx_timeout;
 	dev->watchdog_timeo = 5*HZ;
-	dev->set_multicast_list = &lance_set_multicast;
 	dev->ethtool_ops = &sparc_lance_ethtool_ops;
+	dev->netdev_ops = &sparc_lance_ops;
 
 	dev->irq = op->irqs[0];
 
author maintainer
#2 lore raw

From: Stephen Hemminger <[email protected]>
Date: Mon, 23 Mar 2009 14:03:03 -0700

Quoted 5 lines

You need to add the three entries that ether_setup() was doing in the old code:
.ndo_change_mtu = eth_change_mtu,
.ndo_set_mac_address = eth_mac_addr,
.ndo_validate_addr = eth_validate_addr,

Thanks for catching that, I've fixed them all up.

myri_sbus/sunbmac/sunlance/sunqe: Add missing net_device_ops entries.

Noticed by Stephen Hemminger.

---
 drivers/net/myri_sbus.c |    2 ++
 drivers/net/sunbmac.c   |    3 +++
 drivers/net/sunlance.c  |    3 +++
 drivers/net/sunqe.c     |    3 +++
 4 files changed, 11 insertions(+), 0 deletions(-)
drivers/net/myri_sbus.c +2 -0
index 4ced27f..08534c0 100644
@@ -903,6 +903,8 @@ static const struct net_device_ops myri_ops = {
 	.ndo_set_multicast_list	= myri_set_multicast,
 	.ndo_tx_timeout		= myri_tx_timeout,
 	.ndo_change_mtu		= myri_change_mtu,
+	.ndo_set_mac_address	= eth_mac_addr,
+	.ndo_validate_addr	= eth_validate_addr,
 };
 
 static int __devinit myri_sbus_probe(struct of_device *op, const struct of_device_id *match)
drivers/net/sunbmac.c +3 -0
index 70d96b7..5017d7f 100644
@@ -1081,6 +1081,9 @@ static const struct net_device_ops bigmac_ops = {
 	.ndo_get_stats		= bigmac_get_stats,
 	.ndo_set_multicast_list	= bigmac_set_multicast,
 	.ndo_tx_timeout		= bigmac_tx_timeout,
+	.ndo_change_mtu		= eth_change_mtu,
+	.ndo_set_mac_address	= eth_mac_addr,
+	.ndo_validate_addr	= eth_validate_addr,
 };
 
 static int __devinit bigmac_ether_init(struct of_device *op,
drivers/net/sunlance.c +3 -0
index 3a2bb96..afc7b35 100644
@@ -1317,6 +1317,9 @@ static const struct net_device_ops sparc_lance_ops = {
 	.ndo_start_xmit		= lance_start_xmit,
 	.ndo_set_multicast_list	= lance_set_multicast,
 	.ndo_tx_timeout		= lance_tx_timeout,
+	.ndo_change_mtu		= eth_change_mtu,
+	.ndo_set_mac_address	= eth_mac_addr,
+	.ndo_validate_addr	= eth_validate_addr,
 };
 
 static int __devinit sparc_lance_probe_one(struct of_device *op,
drivers/net/sunqe.c +3 -0
index dd4757d..c6ec61e 100644
@@ -835,6 +835,9 @@ static const struct net_device_ops qec_ops = {
 	.ndo_start_xmit		= qe_start_xmit,
 	.ndo_set_multicast_list	= qe_set_multicast,
 	.ndo_tx_timeout		= qe_tx_timeout,
+	.ndo_change_mtu		= eth_change_mtu,
+	.ndo_set_mac_address	= eth_mac_addr,
+	.ndo_validate_addr	= eth_validate_addr,
 };
 
 static int __devinit qec_ether_init(struct of_device *op)
Signature · 1 line
1.6.2.1.222.g570cc