diff mbox

[24/42] tulip: convert devices to new API

Message ID 20090107003348.110775064@vyatta.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

stephen hemminger Jan. 7, 2009, 12:33 a.m. UTC
Convert to net_device_ops and internal net_device_stats

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

---
 drivers/net/tulip/tulip_core.c |   27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)

Comments

Grant Grundler Jan. 7, 2009, 7:49 a.m. UTC | #1
On Tue, Jan 06, 2009 at 04:33:40PM -0800, Stephen Hemminger wrote:
> Convert to net_device_ops and internal net_device_stats
> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

Acked-by: Grant Grundler <grundler@parisc-linux.org>

thanks,
grant

> 
> ---
>  drivers/net/tulip/tulip_core.c |   27 +++++++++++++++++----------
>  1 file changed, 17 insertions(+), 10 deletions(-)
> 
> --- a/drivers/net/tulip/tulip_core.c	2009-01-06 16:22:22.016610626 -0800
> +++ b/drivers/net/tulip/tulip_core.c	2009-01-06 16:22:24.210112411 -0800
> @@ -1225,6 +1225,22 @@ static int tulip_uli_dm_quirk(struct pci
>  	return 0;
>  }
>  
> +static const struct net_device_ops tulip_netdev_ops = {
> +	.ndo_open		= tulip_open,
> +	.ndo_start_xmit		= tulip_start_xmit,
> +	.ndo_tx_timeout		= tulip_tx_timeout,
> +	.ndo_stop		= tulip_close,
> +	.ndo_get_stats		= tulip_get_stats,
> +	.ndo_do_ioctl 		= private_ioctl,
> +	.ndo_set_multicast_list = set_rx_mode,
> +	.ndo_change_mtu		= eth_change_mtu,
> +	.ndo_set_mac_address	= eth_mac_addr,
> +	.ndo_validate_addr	= eth_validate_addr,
> +#ifdef CONFIG_NET_POLL_CONTROLLER
> +	.ndo_poll_controller	 = poll_tulip,
> +#endif
> +};
> +
>  static int __devinit tulip_init_one (struct pci_dev *pdev,
>  				     const struct pci_device_id *ent)
>  {
> @@ -1601,20 +1617,11 @@ static int __devinit tulip_init_one (str
>  	}
>  
>  	/* The Tulip-specific entries in the device structure. */
> -	dev->open = tulip_open;
> -	dev->hard_start_xmit = tulip_start_xmit;
> -	dev->tx_timeout = tulip_tx_timeout;
> +	dev->netdev_ops = &tulip_netdev_ops;
>  	dev->watchdog_timeo = TX_TIMEOUT;
>  #ifdef CONFIG_TULIP_NAPI
>  	netif_napi_add(dev, &tp->napi, tulip_poll, 16);
>  #endif
> -	dev->stop = tulip_close;
> -	dev->get_stats = tulip_get_stats;
> -	dev->do_ioctl = private_ioctl;
> -	dev->set_multicast_list = set_rx_mode;
> -#ifdef CONFIG_NET_POLL_CONTROLLER
> -	dev->poll_controller = &poll_tulip;
> -#endif
>  	SET_ETHTOOL_OPS(dev, &ops);
>  
>  	if (register_netdev(dev))
> 
> -- 
--
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 Jan. 8, 2009, 1:59 a.m. UTC | #2
From: Grant Grundler <grundler@parisc-linux.org>
Date: Wed, 7 Jan 2009 00:49:49 -0700

> On Tue, Jan 06, 2009 at 04:33:40PM -0800, Stephen Hemminger wrote:
> > Convert to net_device_ops and internal net_device_stats
> > 
> > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> 
> Acked-by: Grant Grundler <grundler@parisc-linux.org>

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
diff mbox

Patch

--- a/drivers/net/tulip/tulip_core.c	2009-01-06 16:22:22.016610626 -0800
+++ b/drivers/net/tulip/tulip_core.c	2009-01-06 16:22:24.210112411 -0800
@@ -1225,6 +1225,22 @@  static int tulip_uli_dm_quirk(struct pci
 	return 0;
 }
 
+static const struct net_device_ops tulip_netdev_ops = {
+	.ndo_open		= tulip_open,
+	.ndo_start_xmit		= tulip_start_xmit,
+	.ndo_tx_timeout		= tulip_tx_timeout,
+	.ndo_stop		= tulip_close,
+	.ndo_get_stats		= tulip_get_stats,
+	.ndo_do_ioctl 		= private_ioctl,
+	.ndo_set_multicast_list = set_rx_mode,
+	.ndo_change_mtu		= eth_change_mtu,
+	.ndo_set_mac_address	= eth_mac_addr,
+	.ndo_validate_addr	= eth_validate_addr,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	.ndo_poll_controller	 = poll_tulip,
+#endif
+};
+
 static int __devinit tulip_init_one (struct pci_dev *pdev,
 				     const struct pci_device_id *ent)
 {
@@ -1601,20 +1617,11 @@  static int __devinit tulip_init_one (str
 	}
 
 	/* The Tulip-specific entries in the device structure. */
-	dev->open = tulip_open;
-	dev->hard_start_xmit = tulip_start_xmit;
-	dev->tx_timeout = tulip_tx_timeout;
+	dev->netdev_ops = &tulip_netdev_ops;
 	dev->watchdog_timeo = TX_TIMEOUT;
 #ifdef CONFIG_TULIP_NAPI
 	netif_napi_add(dev, &tp->napi, tulip_poll, 16);
 #endif
-	dev->stop = tulip_close;
-	dev->get_stats = tulip_get_stats;
-	dev->do_ioctl = private_ioctl;
-	dev->set_multicast_list = set_rx_mode;
-#ifdef CONFIG_NET_POLL_CONTROLLER
-	dev->poll_controller = &poll_tulip;
-#endif
 	SET_ETHTOOL_OPS(dev, &ops);
 
 	if (register_netdev(dev))