From 37ac71b816b395e4ed9a16b02fa04eafea81a6a9 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sat, 27 Nov 2010 16:32:12 +0000 Subject: [PATCH] contrib: remove hard dependency on libiwinfo, madwifi scan fixes --- contrib/package/iwinfo/Makefile | 3 ++- contrib/package/iwinfo/src/iwinfo_madwifi.c | 19 ++++++++++++++++++- contrib/package/luci/Makefile | 2 +- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/contrib/package/iwinfo/Makefile b/contrib/package/iwinfo/Makefile index 35ea6192e..be35d3b60 100644 --- a/contrib/package/iwinfo/Makefile +++ b/contrib/package/iwinfo/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libiwinfo -PKG_RELEASE:=10 +PKG_RELEASE:=11 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) @@ -20,6 +20,7 @@ define Package/libiwinfo SUBMENU:=Libraries TITLE:=Generalized Wireless Information Library (iwinfo) DEPENDS:=+PACKAGE_kmod-mac80211:libnl-tiny +liblua +lua + DEFAULT:=PACKAGE_luci-lib-core endef define Package/libiwinfo/description diff --git a/contrib/package/iwinfo/src/iwinfo_madwifi.c b/contrib/package/iwinfo/src/iwinfo_madwifi.c index 3572f0011..a6070132b 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); diff --git a/contrib/package/luci/Makefile b/contrib/package/luci/Makefile index 786a84ad2..cf6e71e63 100644 --- a/contrib/package/luci/Makefile +++ b/contrib/package/luci/Makefile @@ -205,7 +205,7 @@ $(eval $(call library,lucid-http,LuCId HTTP Backend,+luci-lib-lucid)) $(eval $(call library,lucid-rpc,LuCId RPC Backend,+luci-lib-lucid)) $(eval $(call library,nixio,NIXIO POSIX library,+PACKAGE_luci-lib-nixio_openssl:libopenssl +PACKAGE_luci-lib-nixio_cyassl:libcyassl)) $(eval $(call library,px5g,RSA/X.509 Key Generator (required for LuCId SSL support),+luci-lib-nixio)) -$(eval $(call library,sys,LuCI Linux/POSIX system library,+libiwinfo)) +$(eval $(call library,sys,LuCI Linux/POSIX system library)) $(eval $(call library,web,MVC Webframework,+luci-lib-sys +luci-lib-nixio +luci-lib-core +luci-sgi-cgi +luci-lib-lmo)) $(eval $(call library,uvl,UVL - UCI Validation Layer,+luci-lib-sys +luci-lib-core)) -- 2.25.1