netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 0/4] s390: net drivers convert to net_device_ops
@ 2009-01-09  9:01 frank.blaschka
  2009-01-09  9:01 ` [patch 1/4] lcs: " frank.blaschka
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: frank.blaschka @ 2009-01-09  9:01 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-s390, ursula.braun

Hi Dave,

here are the remaining net_device_ops patches for s390 net drivers

lcs: convert to net_device_ops
ctcm: convert to net_device_ops
netiucv: convert to net_device_ops
claw: convert to net_device_ops

Thanks,
        Frank

-- 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [patch 1/4] lcs: convert to net_device_ops
  2009-01-09  9:01 [patch 0/4] s390: net drivers convert to net_device_ops frank.blaschka
@ 2009-01-09  9:01 ` frank.blaschka
  2009-01-09 10:54   ` Bastian Blank
  2009-01-09 16:36   ` Stephen Hemminger
  2009-01-09  9:01 ` [patch 2/4] ctcm: " frank.blaschka
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 8+ messages in thread
From: frank.blaschka @ 2009-01-09  9:01 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-s390, ursula.braun

[-- Attachment #1: lcs_devops.diff --]
[-- Type: text/plain, Size: 1474 bytes --]

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 = {
+	.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);

-- 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [patch 2/4] ctcm: convert to net_device_ops
  2009-01-09  9:01 [patch 0/4] s390: net drivers convert to net_device_ops frank.blaschka
  2009-01-09  9:01 ` [patch 1/4] lcs: " frank.blaschka
@ 2009-01-09  9:01 ` frank.blaschka
  2009-01-09  9:01 ` [patch 3/4] netiucv: " frank.blaschka
  2009-01-09  9:02 ` [patch 4/4] claw: " frank.blaschka
  3 siblings, 0 replies; 8+ messages in thread
From: frank.blaschka @ 2009-01-09  9:01 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-s390, ursula.braun

[-- Attachment #1: ctcm_devops.diff --]
[-- Type: text/plain, Size: 1638 bytes --]

From: Frank Blaschka <frank.blaschka@de.ibm.com>

ctcm convert to net_device_ops.

Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
---
 drivers/s390/net/ctcm_main.c |   16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

Index: git_linus/drivers/s390/net/ctcm_main.c
===================================================================
--- git_linus.orig/drivers/s390/net/ctcm_main.c
+++ git_linus/drivers/s390/net/ctcm_main.c
@@ -1099,15 +1099,19 @@ static void ctcm_free_netdevice(struct n
 
 struct mpc_group *ctcmpc_init_mpc_group(struct ctcm_priv *priv);
 
+static struct net_device_ops ctcm_netdev_ops = {
+	.ndo_open		= ctcm_open,
+	.ndo_stop		= ctcm_close,
+	.ndo_get_stats		= ctcm_stats,
+	.ndo_change_mtu	   	= ctcm_change_mtu,
+};
+
 void static ctcm_dev_setup(struct net_device *dev)
 {
-	dev->open = ctcm_open;
-	dev->stop = ctcm_close;
-	dev->get_stats = ctcm_stats;
-	dev->change_mtu = ctcm_change_mtu;
 	dev->type = ARPHRD_SLIP;
 	dev->tx_queue_len = 100;
 	dev->flags = IFF_POINTOPOINT | IFF_NOARP;
+	dev->netdev_ops = &ctcm_netdev_ops;
 }
 
 /*
@@ -1157,12 +1161,12 @@ static struct net_device *ctcm_init_netd
 		dev->mtu = MPC_BUFSIZE_DEFAULT -
 				TH_HEADER_LENGTH - PDU_HEADER_LENGTH;
 
-		dev->hard_start_xmit = ctcmpc_tx;
+		ctcm_netdev_ops.ndo_start_xmit = ctcmpc_tx;
 		dev->hard_header_len = TH_HEADER_LENGTH + PDU_HEADER_LENGTH;
 		priv->buffer_size = MPC_BUFSIZE_DEFAULT;
 	} else {
 		dev->mtu = CTCM_BUFSIZE_DEFAULT - LL_HEADER_LENGTH - 2;
-		dev->hard_start_xmit = ctcm_tx;
+		ctcm_netdev_ops.ndo_start_xmit = ctcm_tx;
 		dev->hard_header_len = LL_HEADER_LENGTH + 2;
 	}
 

-- 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [patch 3/4] netiucv: convert to net_device_ops
  2009-01-09  9:01 [patch 0/4] s390: net drivers convert to net_device_ops frank.blaschka
  2009-01-09  9:01 ` [patch 1/4] lcs: " frank.blaschka
  2009-01-09  9:01 ` [patch 2/4] ctcm: " frank.blaschka
@ 2009-01-09  9:01 ` frank.blaschka
  2009-01-09  9:02 ` [patch 4/4] claw: " frank.blaschka
  3 siblings, 0 replies; 8+ messages in thread
From: frank.blaschka @ 2009-01-09  9:01 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-s390, ursula.braun

[-- Attachment #1: netiucv_devops.diff --]
[-- Type: text/plain, Size: 1473 bytes --]

From: Frank Blaschka <frank.blaschka@de.ibm.com>

netiucv convert to net_device_ops.

Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
---
 drivers/s390/net/netiucv.c |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

Index: git_linus/drivers/s390/net/netiucv.c
===================================================================
--- git_linus.orig/drivers/s390/net/netiucv.c
+++ git_linus/drivers/s390/net/netiucv.c
@@ -1876,20 +1876,24 @@ static void netiucv_free_netdevice(struc
 /**
  * Initialize a net device. (Called from kernel in alloc_netdev())
  */
+static struct net_device_ops netiucv_netdev_ops = {
+	.ndo_open		= netiucv_open,
+	.ndo_stop		= netiucv_close,
+	.ndo_get_stats		= netiucv_stats,
+	.ndo_start_xmit		= netiucv_tx,
+	.ndo_change_mtu	   	= netiucv_change_mtu,
+};
+
 static void netiucv_setup_netdevice(struct net_device *dev)
 {
 	dev->mtu	         = NETIUCV_MTU_DEFAULT;
-	dev->hard_start_xmit     = netiucv_tx;
-	dev->open	         = netiucv_open;
-	dev->stop	         = netiucv_close;
-	dev->get_stats	         = netiucv_stats;
-	dev->change_mtu          = netiucv_change_mtu;
 	dev->destructor          = netiucv_free_netdevice;
 	dev->hard_header_len     = NETIUCV_HDRLEN;
 	dev->addr_len            = 0;
 	dev->type                = ARPHRD_SLIP;
 	dev->tx_queue_len        = NETIUCV_QUEUELEN_DEFAULT;
 	dev->flags	         = IFF_POINTOPOINT | IFF_NOARP;
+	dev->netdev_ops		 = &netiucv_netdev_ops;
 }
 
 /**

-- 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [patch 4/4] claw: convert to net_device_ops
  2009-01-09  9:01 [patch 0/4] s390: net drivers convert to net_device_ops frank.blaschka
                   ` (2 preceding siblings ...)
  2009-01-09  9:01 ` [patch 3/4] netiucv: " frank.blaschka
@ 2009-01-09  9:02 ` frank.blaschka
  3 siblings, 0 replies; 8+ messages in thread
From: frank.blaschka @ 2009-01-09  9:02 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-s390, ursula.braun

[-- Attachment #1: claw_devops.diff --]
[-- Type: text/plain, Size: 1379 bytes --]

From: Frank Blaschka <frank.blaschka@de.ibm.com>

claw convert to net_device_ops.

Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com
---
 drivers/s390/net/claw.c |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

Index: git_linus/drivers/s390/net/claw.c
===================================================================
--- git_linus.orig/drivers/s390/net/claw.c
+++ git_linus/drivers/s390/net/claw.c
@@ -2816,22 +2816,26 @@ claw_free_netdevice(struct net_device * 
  * Initialize everything of the net device except the name and the
  * channel structs.
  */
+static struct net_device_ops claw_netdev_ops = {
+	.ndo_open		= claw_open,
+	.ndo_stop		= claw_release,
+	.ndo_get_stats		= claw_stats,
+	.ndo_start_xmit		= claw_tx,
+	.ndo_change_mtu		= claw_change_mtu,
+};
+
 static void
 claw_init_netdevice(struct net_device * dev)
 {
 	CLAW_DBF_TEXT(2, setup, "init_dev");
 	CLAW_DBF_TEXT_(2, setup, "%s", dev->name);
 	dev->mtu = CLAW_DEFAULT_MTU_SIZE;
-	dev->hard_start_xmit = claw_tx;
-	dev->open = claw_open;
-	dev->stop = claw_release;
-	dev->get_stats = claw_stats;
-	dev->change_mtu = claw_change_mtu;
 	dev->hard_header_len = 0;
 	dev->addr_len = 0;
 	dev->type = ARPHRD_SLIP;
 	dev->tx_queue_len = 1300;
 	dev->flags = IFF_POINTOPOINT | IFF_NOARP;
+	dev->netdev_ops = &claw_netdev_ops;
 	CLAW_DBF_TEXT(2, setup, "initok");
 	return;
 }

-- 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [patch 1/4] lcs: convert to net_device_ops
  2009-01-09  9:01 ` [patch 1/4] lcs: " frank.blaschka
@ 2009-01-09 10:54   ` Bastian Blank
  2009-01-09 12:18     ` Frank Blaschka
  2009-01-09 16:36   ` Stephen Hemminger
  1 sibling, 1 reply; 8+ messages in thread
From: Bastian Blank @ 2009-01-09 10:54 UTC (permalink / raw)
  To: frank.blaschka; +Cc: davem, netdev, linux-s390, ursula.braun

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

-- 
History tends to exaggerate.
		-- Col. Green, "The Savage Curtain", stardate 5906.4

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [patch 1/4] lcs: convert to net_device_ops
  2009-01-09 10:54   ` Bastian Blank
@ 2009-01-09 12:18     ` Frank Blaschka
  0 siblings, 0 replies; 8+ messages in thread
From: Frank Blaschka @ 2009-01-09 12:18 UTC (permalink / raw)
  To: Bastian Blank; +Cc: davem, netdev, linux-s390, ursula.braun

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
> 



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [patch 1/4] lcs: convert to net_device_ops
  2009-01-09  9:01 ` [patch 1/4] lcs: " frank.blaschka
  2009-01-09 10:54   ` Bastian Blank
@ 2009-01-09 16:36   ` Stephen Hemminger
  1 sibling, 0 replies; 8+ messages in thread
From: Stephen Hemminger @ 2009-01-09 16:36 UTC (permalink / raw)
  To: frank.blaschka; +Cc: davem, netdev, linux-s390, ursula.braun

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-01-09 16:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-09  9:01 [patch 0/4] s390: net drivers convert to net_device_ops frank.blaschka
2009-01-09  9:01 ` [patch 1/4] lcs: " frank.blaschka
2009-01-09 10:54   ` Bastian Blank
2009-01-09 12:18     ` Frank Blaschka
2009-01-09 16:36   ` Stephen Hemminger
2009-01-09  9:01 ` [patch 2/4] ctcm: " frank.blaschka
2009-01-09  9:01 ` [patch 3/4] netiucv: " frank.blaschka
2009-01-09  9:02 ` [patch 4/4] claw: " frank.blaschka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).