Patchwork [07/77] irlan: convert to net_device_ops

login
register
mail settings
Submitter stephen hemminger
Date March 21, 2009, 5:35 a.m.
Message ID <20090321053713.084967137@vyatta.com>
Download mbox | patch
Permalink /patch/24854/
State Accepted
Delegated to: David Miller
Headers show

Comments

stephen hemminger - March 21, 2009, 5:35 a.m.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

---
 net/irda/irlan/irlan_eth.c |   19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)
David Miller - March 22, 2009, 2:34 a.m.
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Fri, 20 Mar 2009 22:35:34 -0700

> 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
Samuel Ortiz - March 23, 2009, 11:33 a.m.
On Fri, Mar 20, 2009 at 10:35:34PM -0700, Stephen Hemminger wrote:
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Samuel Ortiz <samuel@sortiz.org>

> 
> ---
>  net/irda/irlan/irlan_eth.c |   19 +++++++++++++------
>  1 file changed, 13 insertions(+), 6 deletions(-)
> 
> --- a/net/irda/irlan/irlan_eth.c	2009-03-19 22:40:30.449963919 -0700
> +++ b/net/irda/irlan/irlan_eth.c	2009-03-19 22:42:45.749902310 -0700
> @@ -45,6 +45,16 @@ static int  irlan_eth_xmit(struct sk_buf
>  static void irlan_eth_set_multicast_list( struct net_device *dev);
>  static struct net_device_stats *irlan_eth_get_stats(struct net_device *dev);
>  
> +static const struct net_device_ops irlan_eth_netdev_ops = {
> +	.ndo_open               = irlan_eth_open,
> +	.ndo_stop               = irlan_eth_close,
> +	.ndo_start_xmit    	= irlan_eth_xmit,
> +	.ndo_get_stats	        = irlan_eth_get_stats,
> +	.ndo_set_multicast_list = irlan_eth_set_multicast_list,
> +	.ndo_change_mtu		= eth_change_mtu,
> +	.ndo_validate_addr	= eth_validate_addr,
> +};
> +
>  /*
>   * Function irlan_eth_setup (dev)
>   *
> @@ -53,14 +63,11 @@ static struct net_device_stats *irlan_et
>   */
>  static void irlan_eth_setup(struct net_device *dev)
>  {
> -	dev->open               = irlan_eth_open;
> -	dev->stop               = irlan_eth_close;
> -	dev->hard_start_xmit    = irlan_eth_xmit;
> -	dev->get_stats	        = irlan_eth_get_stats;
> -	dev->set_multicast_list = irlan_eth_set_multicast_list;
> +	ether_setup(dev);
> +
> +	dev->netdev_ops		= &irlan_eth_netdev_ops;
>  	dev->destructor		= free_netdev;
>  
> -	ether_setup(dev);
>  
>  	/*
>  	 * Lets do all queueing in IrTTP instead of this device driver.
> 
> --

Patch

--- a/net/irda/irlan/irlan_eth.c	2009-03-19 22:40:30.449963919 -0700
+++ b/net/irda/irlan/irlan_eth.c	2009-03-19 22:42:45.749902310 -0700
@@ -45,6 +45,16 @@  static int  irlan_eth_xmit(struct sk_buf
 static void irlan_eth_set_multicast_list( struct net_device *dev);
 static struct net_device_stats *irlan_eth_get_stats(struct net_device *dev);
 
+static const struct net_device_ops irlan_eth_netdev_ops = {
+	.ndo_open               = irlan_eth_open,
+	.ndo_stop               = irlan_eth_close,
+	.ndo_start_xmit    	= irlan_eth_xmit,
+	.ndo_get_stats	        = irlan_eth_get_stats,
+	.ndo_set_multicast_list = irlan_eth_set_multicast_list,
+	.ndo_change_mtu		= eth_change_mtu,
+	.ndo_validate_addr	= eth_validate_addr,
+};
+
 /*
  * Function irlan_eth_setup (dev)
  *
@@ -53,14 +63,11 @@  static struct net_device_stats *irlan_et
  */
 static void irlan_eth_setup(struct net_device *dev)
 {
-	dev->open               = irlan_eth_open;
-	dev->stop               = irlan_eth_close;
-	dev->hard_start_xmit    = irlan_eth_xmit;
-	dev->get_stats	        = irlan_eth_get_stats;
-	dev->set_multicast_list = irlan_eth_set_multicast_list;
+	ether_setup(dev);
+
+	dev->netdev_ops		= &irlan_eth_netdev_ops;
 	dev->destructor		= free_netdev;
 
-	ether_setup(dev);
 
 	/*
 	 * Lets do all queueing in IrTTP instead of this device driver.