summaryrefslogtreecommitdiffhomepage
path: root/contrib/package/iwinfo/src/iwinfo_madwifi.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-11-27 16:32:12 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-11-27 16:32:12 +0000
commit37ac71b816b395e4ed9a16b02fa04eafea81a6a9 (patch)
tree6ef170f0baf34558357f967f8bb981b73bc1c999 /contrib/package/iwinfo/src/iwinfo_madwifi.c
parente8490c385facaca9ceb2b15303f3ebc3a0b3c722 (diff)
contrib: remove hard dependency on libiwinfo, madwifi scan fixes
Diffstat (limited to 'contrib/package/iwinfo/src/iwinfo_madwifi.c')
-rw-r--r--contrib/package/iwinfo/src/iwinfo_madwifi.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/contrib/package/iwinfo/src/iwinfo_madwifi.c b/contrib/package/iwinfo/src/iwinfo_madwifi.c
index 3572f00115..a6070132bc 100644
--- a/contrib/package/iwinfo/src/iwinfo_madwifi.c
+++ b/contrib/package/iwinfo/src/iwinfo_madwifi.c
@@ -292,14 +292,23 @@ static char * madwifi_ifadd(const char *ifname)
snprintf(nif, sizeof(nif), "tmp.%s", ifname);
strncpy(cp.icp_name, nif, IFNAMSIZ);
- cp.icp_opmode = IEEE80211_M_MONITOR;
+ cp.icp_opmode = IEEE80211_M_STA;
cp.icp_flags = IEEE80211_CLONE_BSSID;
strncpy(ifr.ifr_name, wifidev, IFNAMSIZ);
ifr.ifr_data = (void *)&cp;
if( !iwinfo_ioctl(SIOC80211IFCREATE, &ifr) )
+ {
return nif;
+ }
+ else
+ {
+ cp.icp_opmode = IEEE80211_M_MONITOR;
+
+ if( !iwinfo_ioctl(SIOC80211IFCREATE, &ifr) )
+ return nif;
+ }
}
return NULL;
@@ -778,7 +787,15 @@ int madwifi_get_scanlist(const char *ifname, char *buf, int *len)
if( (res = madwifi_ifadd(ifname)) != NULL )
{
if( iwinfo_ifup(res) )
+ {
+ wext_get_scanlist(res, buf, len);
+ sleep(1);
+
+ wext_get_scanlist(res, buf, len);
+ sleep(1);
+
ret = wext_get_scanlist(res, buf, len);
+ }
iwinfo_ifdown(res);
madwifi_ifdel(res);