[PATCH] AR6k: don't make a fuss if SIOCGIWSCAN returns no nodes

Werner Almesberger werner at openmoko.org
Mon Jan 12 02:48:30 CET 2009


SIOCGIWSCAN can return an empty node list if there are indeed no
nodes but also if we wait too long (more than about 20 seconds)
between initiating the scan and retrieving the list of nodes.
There's nothing suspicious per se about either condition, yet the
AR6k driver returns an error code and printk's a complaint.

This is a bit excessive and can mislead user space into believing
a real error has occurred. This patch make this sort of failure
silent, like in other WLAN drivers, e.g.,
ieee80211_wx.c:ieee80211_wx_get_scan

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

---

diff --git a/drivers/ar6000/ar6000/wireless_ext.c b/drivers/ar6000/ar6000/wireless_ext.c
index 0aa4bdc..da82ad0 100644
--- a/drivers/ar6000/ar6000/wireless_ext.c
+++ b/drivers/ar6000/ar6000/wireless_ext.c
@@ -245,10 +245,7 @@ ar6000_ioctl_giwscan(struct net_device *dev,
         }
     }
 
-    if(!(data->length = param.current_ev - extra)) {
-	    printk("%s(): data length %d\n", __FUNCTION__, data->length);
-	    return -EAGAIN;
-    }
+    data->length = param.current_ev - extra;
     return 0;
 }
 



More information about the openmoko-kernel mailing list