[PATCH] libertas: fix oops on module unload

Marcelo Tosatti marcelo at kvack.org
Fri Aug 3 20:10:20 EDT 2007


Dan,

Can you please apply this to libertas-2.6 and push it upstream? 

------------

Resetting the wireless device via EC GPIO causes a USB reconnect event,
which confuses the USB stack while we're running the ->disconnect
method.

Its not necessary to do it in the module exit path since thats done at
probe time in case firmware init fails.

Signed-off-by: Marcelo Tosatti <mtosatti at redhat.com>


diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
index 80aca9f..73d444f 100644
--- a/drivers/net/wireless/libertas/if_usb.c
+++ b/drivers/net/wireless/libertas/if_usb.c
@@ -1138,7 +1138,8 @@ static void if_usb_exit_module(void)
 	lbs_deb_enter(LBS_DEB_MAIN);
 
 	list_for_each_entry_safe(cardp, cardp_temp, &usb_devices, list)
-		libertas_reset_device((wlan_private *) cardp->priv);
+		libertas_prepare_and_send_command(cardp->priv, CMD_802_11_RESET,
+			CMD_ACT_HALT, 0, 0, NULL);
 
 	/* API unregisters the driver from USB subsystem */
 	usb_deregister(&if_usb_driver);



More information about the libertas-dev mailing list