Patchwork [1/4] lcs: convert to net_device_ops

login
register
mail settings
Submitter frank.blaschka@de.ibm.com
Date Jan. 9, 2009, 9:01 a.m.
Message ID <20090109090220.554541000@de.ibm.com>
Download mbox | patch
Permalink /patch/17479/
State Superseded
Delegated to: David Miller
Headers show

Comments

frank.blaschka@de.ibm.com - Jan. 9, 2009, 9:01 a.m.
From: Frank Blaschka <frank.blaschka@de.ibm.com>

lcs convert to net_device_ops.

Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
---
 drivers/s390/net/lcs.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
Bastian Blank - Jan. 9, 2009, 10:54 a.m.
On Fri, Jan 09, 2009 at 10:01:57AM +0100, frank.blaschka@de.ibm.com wrote:
>  #ifdef CONFIG_IP_MULTICAST
>  	if (!lcs_check_multicast_support(card))
> -		card->dev->set_multicast_list = lcs_set_multicast_list;
> +		lcs_netdev_ops.ndo_set_multicast_list = lcs_set_multicast_list;

This looks wrong. lcs_netdev_ops is static but this code used to set it
up per card.

Bastian
Frank Blaschka - Jan. 9, 2009, 12:18 p.m.
good catch, thanks a lot. I will rework the complete patch set because
there is the same issue with ctcm and qeth_l3.

Frank

> On Fri, Jan 09, 2009 at 10:01:57AM +0100, frank.blaschka@de.ibm.com wrote:
>>  #ifdef CONFIG_IP_MULTICAST
>>  	if (!lcs_check_multicast_support(card))
>> -		card->dev->set_multicast_list = lcs_set_multicast_list;
>> +		lcs_netdev_ops.ndo_set_multicast_list = lcs_set_multicast_list;
> 
> This looks wrong. lcs_netdev_ops is static but this code used to set it
> up per card.
> 
> Bastian
> 


--
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
stephen hemminger - Jan. 9, 2009, 4:36 p.m.
On Fri, 09 Jan 2009 10:01:57 +0100
frank.blaschka@de.ibm.com wrote:

> From: Frank Blaschka <frank.blaschka@de.ibm.com>
> 
> lcs convert to net_device_ops.
> 
> Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
> ---
>  drivers/s390/net/lcs.c |   13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
> 
> Index: git_linus/drivers/s390/net/lcs.c
> ===================================================================
> --- git_linus.orig/drivers/s390/net/lcs.c
> +++ git_linus/drivers/s390/net/lcs.c
> @@ -2097,6 +2097,12 @@ lcs_register_netdev(struct ccwgroup_devi
>  /**
>   * lcs_new_device will be called by setting the group device online.
>   */
> +static struct net_device_ops lcs_netdev_ops = {
should be const (if it was you would catch your other problem

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

Index: git_linus/drivers/s390/net/lcs.c
===================================================================
--- git_linus.orig/drivers/s390/net/lcs.c
+++ git_linus/drivers/s390/net/lcs.c
@@ -2097,6 +2097,12 @@  lcs_register_netdev(struct ccwgroup_devi
 /**
  * lcs_new_device will be called by setting the group device online.
  */
+static struct net_device_ops lcs_netdev_ops = {
+	.ndo_open		= lcs_open_device,
+	.ndo_stop		= lcs_stop_device,
+	.ndo_get_stats		= lcs_getstats,
+	.ndo_start_xmit		= lcs_start_xmit,
+};
 
 static int
 lcs_new_device(struct ccwgroup_device *ccwgdev)
@@ -2164,14 +2170,11 @@  lcs_new_device(struct ccwgroup_device *c
 		goto out;
 	card->dev = dev;
 	card->dev->ml_priv = card;
-	card->dev->open = lcs_open_device;
-	card->dev->stop = lcs_stop_device;
-	card->dev->hard_start_xmit = lcs_start_xmit;
-	card->dev->get_stats = lcs_getstats;
+	card->dev->netdev_ops = &lcs_netdev_ops;
 	memcpy(card->dev->dev_addr, card->mac, LCS_MAC_LENGTH);
 #ifdef CONFIG_IP_MULTICAST
 	if (!lcs_check_multicast_support(card))
-		card->dev->set_multicast_list = lcs_set_multicast_list;
+		lcs_netdev_ops.ndo_set_multicast_list = lcs_set_multicast_list;
 #endif
 netdev_out:
 	lcs_set_allowed_threads(card,0xffffffff);