aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--applets/mb-applet-wireless.c25
2 files changed, 26 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 7beca8c..6e856b1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-01-24 Matthew Allum <mallum@openedhand.com>
+
+ * applets/mb-applet-wireless.c: (find_iwface):
+ Workaround for issues with Z hostap driver that
+ presents multiple wireless interfaces. The first
+ of which does not give stat info.
+
2006-01-20 Matthew Allum <mallum@openedhand.com>
* applets/mb-applet-system-monitor.c: (system_cpu):
diff --git a/applets/mb-applet-wireless.c b/applets/mb-applet-wireless.c
index ecd4f5b..45a852a 100644
--- a/applets/mb-applet-wireless.c
+++ b/applets/mb-applet-wireless.c
@@ -350,14 +350,27 @@ find_iwface(int Wfd, char *ifname, char *args[], int count)
if (iw_get_basic_config(Wfd, ifname, &WInfo.b) < 0)
return 0;
- /* already found first one */
- if (Mwd.iface != NULL)
- return 0;
+ /* dont stop check interfaces till we find one that supports stats
+ * works round odd issues on Z with host AP.
+ */
+ if (Mwd.iface != NULL && WInfo.has_stats == 1)
+ return 0;
+
+ if(iw_get_range_info(Wfd, Mwd.iface, &(WInfo.range)) >= 0)
+ WInfo.has_range = 1;
+
+ if (iw_get_stats(Wfd, Mwd.iface,
+ &(WInfo.stats),
+ &(WInfo.range), WInfo.has_range) >= 0)
+ WInfo.has_stats = 1;
- /* mark first found as one to monitor */
- Mwd.iface = strdup(ifname);
+ /* mark first found as one to monitor */
+ if (Mwd.iface)
+ free(Mwd.iface);
- return 0;
+ Mwd.iface = strdup(ifname);
+
+ return 0;
}