lkml.org 
[lkml]   [2004]   [Feb]   [14]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patches in this message
/
DateSat, 14 Feb 2004 13:56:09 +0100
FromFrancois Romieu <>
SubjectRe: [PATCH 2.6 IrDA] new driver : stir4200
Jean Tourrilhes <jt@bougret.hpl.hp.com> :
[...]
> 	After a long maturation, this is time to send you the latest
> version of the stir4200 USB driver. Initially started by Paul Stewart,
> modified by Martin Diehl and me, and later partially rewriten by
> Stephen Hemminger.

Fix + minor change attached.

--
Ueimor

If stir_reset() succeeds, stir_net_open() must not return a success status
code for every failure until irlap_open().


 drivers/net/irda/stir4200.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)
diff -puN drivers/net/irda/stir4200.c~stir4200-bad-return-status drivers/net/irda/stir4200.c
--- linux-2.6.3-rc1-mm1/drivers/net/irda/stir4200.c~stir4200-bad-return-status	2004-02-14 13:35:21.000000000 +0100
+++ linux-2.6.3-rc1-mm1-fr/drivers/net/irda/stir4200.c	2004-02-14 13:48:57.000000000 +0100
@@ -913,6 +913,8 @@ static int stir_net_open(struct net_devi
 	if (err)
 		goto err_out1;
 
+	err = -ENOMEM;
+
 	/* Note: Max SIR frame possible is 4273 */
 	stir->tx_data = kmalloc(STIR_FIFO_SIZE, GFP_KERNEL);
 	if (!stir->tx_data) {
@@ -956,7 +958,6 @@ static int stir_net_open(struct net_devi
 	 * Note : will send immediately a speed change...
 	 */
 	sprintf(hwname, "usb#%d", stir->usbdev->devnum);
-	err = -ENOMEM;
 	stir->irlap = irlap_open(netdev, &stir->qos, hwname);
 	if (!stir->irlap) {
 		ERROR("%s(): irlap_open failed\n", __FUNCTION__);
_

Defer netif_start_queue() until device opening succeeds.


 drivers/net/irda/stir4200.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff -puN drivers/net/irda/stir4200.c~stir4200-late-netif-start-queue drivers/net/irda/stir4200.c
--- linux-2.6.3-rc1-mm1/drivers/net/irda/stir4200.c~stir4200-late-netif-start-queue	2004-02-14 13:35:47.000000000 +0100
+++ linux-2.6.3-rc1-mm1-fr/drivers/net/irda/stir4200.c	2004-02-14 13:36:33.000000000 +0100
@@ -950,8 +950,6 @@ static int stir_net_open(struct net_devi
 		}
 	}
 
-	netif_start_queue(netdev);
-
 	/*
 	 * Now that everything should be initialized properly,
 	 * Open new IrLAP layer instance to take care of us...
@@ -974,6 +972,8 @@ static int stir_net_open(struct net_devi
 		goto err_out4;
 	}
 
+	netif_start_queue(netdev);
+
 	return 0;
 
  err_out4:
_
\
 
 \ /
  Last update: 2005-03-22 13:00    [from the cache]
©2003-2008