From 37ac71b816b395e4ed9a16b02fa04eafea81a6a9 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sat, 27 Nov 2010 16:32:12 +0000 Subject: contrib: remove hard dependency on libiwinfo, madwifi scan fixes --- contrib/package/iwinfo/src/iwinfo_madwifi.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'contrib/package/iwinfo/src') 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); -- cgit v1.2.3