Re: [lwlan-devel] Linux-wlan-ng and xen

Richard Kennedy <[email protected]> Sat, 17 Jun 2006 10:47:26 +0100
Newsgroups gmane.linux.linux-wlan.user
Message-ID <[email protected]>
On Fri, 2006-06-16 at 13:16 +0100, Gee, David wrote:
> Richard,
> 
> Thanks for your thoughts. Where can I get hold of this patch from? Is
> there an SVN or CVS repo with all the patches in - I'm already running
> the FC5 udev patch, now there's this reference counting one too - it
> would be nice if I could download a 'clean' copy from somewhere. I
> haven't had time to do much in-depth diagnosis  of the problem yet.
> Unloading and reloading it didn't work, even if I stopped the xen
> service, something somewhere was getting well and truly broken. Since
> you mention resume I'll bring up something else odd I've noticed - for
> some reason after a resume, my card (a Netgear MA111 USB thingy)
> doesnn't pick up and IP address and I have to do an ifdown and ifup to
> get it to pick up an address. Any ideas?
> 
> Regards
> David
> 
David,

Here's the patch. I posted it to to wlan-dev list some time ago, but it
didn't generate much interest. So, I don't think anyone else has tried
it -- you may want to proceed with caution  :).
I'll be very interested to know if you try this and what effect ( if
any) it has.

Patches just get posted to the wlan-dev list, and Solomon includes them
in his SVN repos -- if he likes them!

I don't know what's happening with suspend/resume, it doesn't work for
me at all. Without the attached patch my laptop hangs on resume -- with
it the wlan card doesn't start up again but everything else is OK.

However, I had the same thing with dhcp-ing a ip address on boot - so I
added a delay into the wlan-udev script and that solved it. I'm guessing
that it's just a sequence/ timing issue somewhere. I'm not sure where
you could put a delay into the resume cycle -- but if you can find
somewhere it may help.

My card is built in to the laptop so never gets removed -- and I find
that if the module get unloaded without being disabled first, it hangs
and will never accept usb commands (messages in the log), until it's had
a full power cycle. Maybe your seeing something similar ?

I would like to get the driver to send the disable message to the card
on module unload and see if that helps. but I haven't 1) found the right
place in the code to put it and 2) found the time to do much with it :)

Cheers
Richard

_______________________________________________
Linux-wlan-user mailing list
[email protected]
http://lists.linux-wlan.com/mailman/listinfo/linux-wlan-user
usb_refcount.patch (text/x-patch, 815 B)
Index: src/prism2/driver/hfa384x_usb.c
===================================================================
--- src/prism2/driver/hfa384x_usb.c	(revision 1772)
+++ src/prism2/driver/hfa384x_usb.c	(working copy)
@@ -686,7 +686,13 @@
 	DBFENTER;
 
 	memset(hw, 0, sizeof(hfa384x_t));
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16))
+	// ref count the usb device
+	hw->usb = usb_get_dev(usb);
+#else
 	hw->usb = usb;
+#endif
 
 	/* set up the endpoints */
 	hw->endp_in = usb_rcvbulkpipe(usb, 1);
@@ -784,7 +790,12 @@
 	/* Now to clean out the auth queue */
         while ( (skb = skb_dequeue(&hw->authq)) ) {
                 dev_kfree_skb(skb);
-        }		
+        }
+	
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16))
+	// release ref count on  usb device
+	usb_put_dev(hw->usb);
+#endif
 
 	DBFEXIT;
 }