aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormallum <mallum@b067294f-1dea-0310-9683-c47a78595994>2006-01-24 20:13:20 +0000
committermallum <mallum@b067294f-1dea-0310-9683-c47a78595994>2006-01-24 20:13:20 +0000
commitf7625c5861478a2b76d3fc8726dda090e9c78ff8 (patch)
tree4b07214c1ca81e8ef8b3e3fa364fc40c9770926f
parent14f45effb5d8c6bc878c23e09c878433c3aff0d0 (diff)
downloadmatchbox-panel-f7625c5861478a2b76d3fc8726dda090e9c78ff8.tar.gz
matchbox-panel-f7625c5861478a2b76d3fc8726dda090e9c78ff8.tar.bz2
matchbox-panel-f7625c5861478a2b76d3fc8726dda090e9c78ff8.zip
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. git-svn-id: https://svn.o-hand.com/repos/matchbox/trunk/matchbox-panel@1298 b067294f-1dea-0310-9683-c47a78595994
-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;
}