[PATCH] ar6k-disconnect-more-often.patch

Werner Almesberger werner at openmoko.org
Wed Nov 26 05:58:35 CET 2008


When changing wireless settings, the WMI is often not updated, because
we send a connect but no prior disconnect. The firmware seems to ignore
the connect if already associated.

The disconnect is omitted because the SIOCSIWESSID logic in the
Atheros driver seems to try to prevent multiple disconnects to be sent
to the WMI, which doesn't really seem to be necessary.

This patch makes sure we disconnect when a parameter change has happened.

Signed-off-by: Werner Almesberger <werner at openmoko.org>

---

Index: ktrack/drivers/ar6000/ar6000/wireless_ext.c
===================================================================
--- ktrack.orig/drivers/ar6000/ar6000/wireless_ext.c	2008-11-26 02:15:46.000000000 -0200
+++ ktrack/drivers/ar6000/ar6000/wireless_ext.c	2008-11-26 02:50:16.000000000 -0200
@@ -317,7 +317,19 @@
         ar->arNetworkType = arNetworkType;
     }
 
-    if ((ar->arSsidLen) || (!data->flags))
+    /*
+     * The original logic here prevented a disconnect if issuing an "essid off"
+     * if no ESSID was set, presumably to prevent sending multiple disconnects
+     * to the WMI.
+     *
+     * Unfortunately, this also meant that no disconnect was sent when we were
+     * already connected, but the profile has been changed since (which also
+     * clears the ESSID as a reminder that the WMI needs updating.)
+     *
+     * The "1 ||" makes sure we always disconnect or reconnect. The WMI doesn't
+     * seem to mind being sent multiple disconnects.
+     */
+    if (1 || (ar->arSsidLen) || (!data->flags))
     {
         if ((!data->flags) ||
             (A_MEMCMP(ar->arSsid, ssid, ar->arSsidLen) != 0) ||



More information about the openmoko-kernel mailing list