diff --git a/package/crda/Makefile b/package/crda/Makefile index b479090c4..95a184c21 100644 --- a/package/crda/Makefile +++ b/package/crda/Makefile @@ -9,19 +9,18 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=crda -PKG_RELEASE:=2 -PKG_VERSION:=1.1.0 +PKG_RELEASE:=1 +PKG_VERSION:=1.1.1 PKG_SOURCE_URL:=http://wireless.kernel.org/download/crda PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_MD5SUM:=6004584d2e39e899f7642b141dd72028 +PKG_MD5SUM:=5fc77af68b3e21736b8ef2f8b061c810 PKG_BUILD_DEPENDS:=mac80211 PKG_REGULATORY_NAME:=regulatory -PKG_REGULATORY_VERSION:=2010.11.17 -PKG_REGULATORY_SOURCE_URL:=http://mirror2.openwrt.org/sources -#PKG_REGULATORY_SOURCE_URL:=http://wireless.kernel.org/download/wireless-regdb/regulatory.bins +PKG_REGULATORY_VERSION:=2010.11.24 +PKG_REGULATORY_SOURCE_URL:=http://wireless.kernel.org/download/wireless-regdb/regulatory.bins PKG_REGULATORY_SOURCE:=$(PKG_REGULATORY_VERSION)-$(PKG_REGULATORY_NAME).bin -PKG_REGULATORY_MD5SUM:=4a497f045d93a8d5b135f4d2816faa83 +PKG_REGULATORY_MD5SUM:=001b69bba19486439031377e09229f9c include $(INCLUDE_DIR)/package.mk @@ -29,7 +28,7 @@ define Package/crda SECTION:=net CATEGORY:=Network TITLE:=Central Regulatory Domain Agent (CRDA) - DEPENDS:=@LINUX_2_6 +hotplug2 +libnl-tiny + DEPENDS:=+libnl-tiny URL:=http://wireless.kernel.org/en/developers/Regulatory/CRDA endef diff --git a/package/hostapd/Config.in b/package/hostapd/Config.in index a74cbae96..a88f977c1 100644 --- a/package/hostapd/Config.in +++ b/package/hostapd/Config.in @@ -25,3 +25,12 @@ config WPA_RFKILL_SUPPORT bool "Add rfkill support" depends PACKAGE_wpa-supplicant || PACKAGE_wpa-supplicant-mini || PACKAGE_wpad || PACKAGE_wpad-mini default n + + +config DRIVER_WEXT_SUPPORT + bool + default n + +config DRIVER_11N_SUPPORT + bool + default n diff --git a/package/hostapd/Makefile b/package/hostapd/Makefile index 6f3c639e6..b232b311b 100644 --- a/package/hostapd/Makefile +++ b/package/hostapd/Makefile @@ -8,15 +8,16 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hostapd -PKG_VERSION:=20100705 -PKG_RELEASE:=2 -PKG_REV:=2f1ce78bf78cecd7021385b04a4f55f22e76ab97 +PKG_VERSION:=20110221 +PKG_RELEASE:=1 +PKG_REV:=cd9fc7869aa1e3935c028d4032d15c75e9946410 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=git://w1.fi/srv/git/hostap.git PKG_SOURCE_SUBDIR:=hostapd-$(PKG_VERSION) PKG_SOURCE_VERSION:=$(PKG_REV) PKG_SOURCE_PROTO:=git +PKG_MIRROR_MD5SUM:=f5f1462884d6e6808413e185b19ea3e3 PKG_BUILD_DEPENDS:= \ PACKAGE_kmod-madwifi:madwifi \ @@ -25,13 +26,14 @@ PKG_BUILD_DEPENDS:= \ PKG_CONFIG_DEPENDS:= \ CONFIG_WPA_SUPPLICANT_NO_TIMESTAMP_CHECK \ CONFIG_PACKAGE_kmod-ath9k \ - CONFIG_PACKAGE_kmod-rt2800-lib \ CONFIG_PACKAGE_kmod-mac80211 \ CONFIG_PACKAGE_kmod-madwifi \ CONFIG_PACKAGE_hostapd \ CONFIG_PACKAGE_hostapd-mini \ CONFIG_PACKAGE_kmod-hostap \ - CONFIG_WPA_RFKILL_SUPPORT + CONFIG_WPA_RFKILL_SUPPORT \ + CONFIG_DRIVER_WEXT_SUPPORT \ + CONFIG_DRIVER_11N_SUPPORT LOCAL_TYPE=$(strip \ $(if $(findstring wpad,$(BUILD_VARIANT)),wpad, \ @@ -52,11 +54,7 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSI include $(INCLUDE_DIR)/package.mk -ifneq ($(CONFIG_PACKAGE_kmod-rt2800-lib),) - HOSTAPD_IEEE80211N:=y -endif - -ifneq ($(CONFIG_PACKAGE_kmod-ath9k),) +ifneq ($(CONFIG_DRIVER_11N_SUPPORT),) HOSTAPD_IEEE80211N:=y endif @@ -66,6 +64,7 @@ DRIVER_MAKEOPTS= \ CONFIG_DRIVER_HOSTAP=$(CONFIG_PACKAGE_kmod-hostap) \ CONFIG_IEEE80211N=$(HOSTAPD_IEEE80211N) \ CONFIG_IEEE80211W=$(CONFIG_PACKAGE_kmod-ath9k) \ + CONFIG_DRIVER_WEXT=$(CONFIG_DRIVER_WEXT_SUPPORT) \ $(if $(CONFIG_WPA_RFKILL_SUPPORT),NEED_RFKILL=y) ifneq ($(LOCAL_TYPE),hostapd) @@ -223,6 +222,9 @@ TARGET_CPPFLAGS := \ -DCONFIG_LIBNL20 \ -D_GNU_SOURCE +TARGET_CFLAGS += -ffunction-sections -fdata-sections +TARGET_LDFLAGS += -Wl,--gc-sections + ifdef CONFIG_PACKAGE_kmod-mac80211 TARGET_LDFLAGS += -lm -lnl-tiny endif diff --git a/package/hostapd/files/hostapd-full.config b/package/hostapd/files/hostapd-full.config index cf7993c34..33de7e0df 100644 --- a/package/hostapd/files/hostapd-full.config +++ b/package/hostapd/files/hostapd-full.config @@ -158,3 +158,5 @@ CONFIG_INTERNAL_AES=y NEED_AES_DEC=y CONFIG_WPS=y +CONFIG_FULL_DYNAMIC_VLAN=y + diff --git a/package/hostapd/files/hostapd.sh b/package/hostapd/files/hostapd.sh index 98c3f61e5..5b69ecd62 100644 --- a/package/hostapd/files/hostapd.sh +++ b/package/hostapd/files/hostapd.sh @@ -9,6 +9,9 @@ hostapd_set_bss_options() { config_get device "$vif" device config_get hwmode "$device" hwmode + config_get phy "$device" phy + + append "$var" "ctrl_interface=/var/run/hostapd-$phy" "$N" if [ "$ap_isolate" -gt 0 ]; then append "$var" "ap_isolate=$ap_isolate" "$N" @@ -127,32 +130,56 @@ hostapd_set_bss_options() { config_get iapp_interface "$vif" iapp_interface config_get_bool wps_pbc "$vif" wps_pushbutton 0 - [ -n "$wps_possible" -a "$wps_pbc" -gt 0 ] && { + config_get_bool wps_label "$vif" wps_label 0 + + config_get config_methods "$vif" wps_config + [ "$wps_pbc" -gt 0 ] && append config_methods push_button + + [ -n "$wps_possible" -a -n "$config_methods" ] && { + config_get device_type "$vif" wps_device_type "6-0050F204-1" + config_get device_name "$vif" wps_device_name "OpenWrt AP" + config_get manufacturer "$vif" wps_manufacturer "openwrt.org" + append "$var" "eap_server=1" "$N" append "$var" "wps_state=2" "$N" append "$var" "ap_setup_locked=1" "$N" - append "$var" "config_methods=push_button" "$N" + append "$var" "device_type=$device_type" "$N" + append "$var" "device_name=$device_name" "$N" + append "$var" "manufacturer=$manufacturer" "$N" + append "$var" "config_methods=$config_methods" "$N" } append "$var" "ssid=$ssid" "$N" [ -n "$bridge" ] && append "$var" "bridge=$bridge" "$N" [ -n "$ieee80211d" ] && append "$var" "ieee80211d=$ieee80211d" "$N" - [ -n "$iapp_interface" ] && append "$var" $(uci_get_state network "$iapp_interface" ifname "$iapp_interface") "$N" + [ -n "$iapp_interface" ] && append "$var" iapp_interface=$(uci_get_state network "$iapp_interface" ifname "$iapp_interface") "$N" - [ "$wpa" -ge "2" ] && config_get ieee80211w "$vif" ieee80211w - case "$ieee80211w" in - [012]) - append "$var" "ieee80211w=$ieee80211w" "$N" - [ "$ieee80211w" -gt "0" ] && { - config_get ieee80211w_max_timeout "$vif" ieee80211w_max_timeout - config_get ieee80211w_retry_timeout "$vif" ieee80211w_retry_timeout - [ -n "$ieee80211w_max_timeout" ] && \ - append "$var" "assoc_sa_query_max_timeout=$ieee80211w_max_timeout" "$N" - [ -n "$ieee80211w_retry_timeout" ] && \ - append "$var" "assoc_sa_query_retry_timeout=$ieee80211w_retry_timeout" "$N" - } - ;; - esac + if [ "$wpa" -ge "2" ] + then + # RSN -> allow preauthentication + config_get rsn_preauth "$vif" rsn_preauth + if [ -n "$bridge" -a "$rsn_preauth" = 1 ] + then + append "$var" "rsn_preauth=1" "$N" + append "$var" "rsn_preauth_interfaces=$bridge" "$N" + fi + + # RSN -> allow management frame protection + config_get ieee80211w "$vif" ieee80211w + case "$ieee80211w" in + [012]) + append "$var" "ieee80211w=$ieee80211w" "$N" + [ "$ieee80211w" -gt "0" ] && { + config_get ieee80211w_max_timeout "$vif" ieee80211w_max_timeout + config_get ieee80211w_retry_timeout "$vif" ieee80211w_retry_timeout + [ -n "$ieee80211w_max_timeout" ] && \ + append "$var" "assoc_sa_query_max_timeout=$ieee80211w_max_timeout" "$N" + [ -n "$ieee80211w_retry_timeout" ] && \ + append "$var" "assoc_sa_query_retry_timeout=$ieee80211w_retry_timeout" "$N" + } + ;; + esac + fi } hostapd_setup_vif() { @@ -172,7 +199,6 @@ hostapd_setup_vif() { [ "$channel" = auto ] && channel= [ -n "$channel" -a -z "$hwmode" ] && wifi_fixup_hwmode "$device" cat > /var/run/hostapd-$ifname.conf <ioctl_sock, drv->iface, 0); - madwifi_set_privacy(drv, 0); /* default to no privacy */ - - madwifi_receive_probe_req(drv); -@@ -1268,8 +1266,7 @@ madwifi_set_countermeasures(void *priv, - static int - madwifi_commit(void *priv) - { -- struct madwifi_driver_data *drv = priv; -- return linux_set_iface_flags(drv->ioctl_sock, drv->iface, 1); -+ return 0; - } - - #else /* HOSTAPD */ diff --git a/package/hostapd/patches/110-countrycode.patch b/package/hostapd/patches/110-countrycode.patch deleted file mode 100644 index 11cf06e84..000000000 --- a/package/hostapd/patches/110-countrycode.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/src/ap/hostapd.c -+++ b/src/ap/hostapd.c -@@ -660,7 +660,6 @@ static int setup_interface(struct hostap - country[3] = '\0'; - if (hostapd_set_country(hapd, country) < 0) { - wpa_printf(MSG_ERROR, "Failed to set country code"); -- return -1; - } - } - diff --git a/package/hostapd/patches/120-compile_fix.patch b/package/hostapd/patches/120-compile_fix.patch deleted file mode 100644 index 89480c184..000000000 --- a/package/hostapd/patches/120-compile_fix.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -22,6 +22,7 @@ - #include - #include - #include -+#include - #include - #include - #include "nl80211_copy.h" ---- a/src/drivers/driver_madwifi.c -+++ b/src/drivers/driver_madwifi.c -@@ -69,6 +69,7 @@ - #define MADWIFI_NG - #endif /* IEEE80211_IOCTL_SETWMMPARAMS */ - -+#define WPA_KEY_RSC_LEN 8 - - #ifdef HOSTAPD - -@@ -1506,7 +1507,6 @@ wpa_driver_madwifi_set_key(const char *i - wk.ik_keyix = key_idx; - wk.ik_keylen = key_len; - #ifdef WORDS_BIGENDIAN --#define WPA_KEY_RSC_LEN 8 - { - size_t i; - u8 tmp[WPA_KEY_RSC_LEN]; diff --git a/package/hostapd/patches/310-scan_ssid.patch b/package/hostapd/patches/300-scan_ssid.patch similarity index 82% rename from package/hostapd/patches/310-scan_ssid.patch rename to package/hostapd/patches/300-scan_ssid.patch index 884459ce6..47528f8b6 100644 --- a/package/hostapd/patches/310-scan_ssid.patch +++ b/package/hostapd/patches/300-scan_ssid.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c -@@ -248,6 +248,7 @@ static void wpa_supplicant_scan(void *el +@@ -251,6 +251,7 @@ static void wpa_supplicant_scan(void *el enum wps_request_type req_type = WPS_REQ_ENROLLEE_INFO; #endif /* CONFIG_WPS */ struct wpa_driver_scan_params params; @@ -8,7 +8,7 @@ size_t max_ssids; enum wpa_states prev_state; -@@ -316,6 +317,16 @@ static void wpa_supplicant_scan(void *el +@@ -307,6 +308,16 @@ static void wpa_supplicant_scan(void *el wpa_s->wpa_state == WPA_INACTIVE) wpa_supplicant_set_state(wpa_s, WPA_SCANNING); @@ -25,7 +25,7 @@ /* Find the starting point from which to continue scanning */ ssid = wpa_s->conf->ssid; if (wpa_s->prev_scan_ssid != WILDCARD_SSID_SCAN) { -@@ -379,6 +390,9 @@ static void wpa_supplicant_scan(void *el +@@ -370,6 +381,9 @@ static void wpa_supplicant_scan(void *el int_array_sort_unique(params.freqs); } diff --git a/package/hostapd/patches/330-madwifi_merge.patch b/package/hostapd/patches/310-madwifi_merge.patch similarity index 88% rename from package/hostapd/patches/330-madwifi_merge.patch rename to package/hostapd/patches/310-madwifi_merge.patch index cddffe4b9..f0888f073 100644 --- a/package/hostapd/patches/330-madwifi_merge.patch +++ b/package/hostapd/patches/310-madwifi_merge.patch @@ -104,12 +104,7 @@ { struct madwifi_driver_data *drv = priv; struct ieee80211req_key wk; -@@ -462,10 +459,14 @@ wpa_driver_madwifi_set_key(const char *i - memset(&wk, 0, sizeof(wk)); - wk.ik_type = cipher; - wk.ik_flags = IEEE80211_KEY_RECV | IEEE80211_KEY_XMIT; -+ - if (addr == NULL) { +@@ -466,6 +463,9 @@ wpa_driver_madwifi_set_key(const char *i memset(wk.ik_macaddr, 0xff, IEEE80211_ADDR_LEN); wk.ik_keyix = key_idx; wk.ik_flags |= IEEE80211_KEY_DEFAULT; @@ -119,7 +114,7 @@ } else { memcpy(wk.ik_macaddr, addr, IEEE80211_ADDR_LEN); wk.ik_keyix = IEEE80211_KEYIX_NONE; -@@ -485,6 +486,7 @@ wpa_driver_madwifi_set_key(const char *i +@@ -485,6 +485,7 @@ wpa_driver_madwifi_set_key(const char *i } @@ -127,7 +122,7 @@ static int madwifi_get_seqnum(const char *ifname, void *priv, const u8 *addr, int idx, u8 *seq) -@@ -591,7 +593,7 @@ madwifi_read_sta_driver_data(void *priv, +@@ -591,7 +592,7 @@ madwifi_read_sta_driver_data(void *priv, memset(data, 0, sizeof(*data)); snprintf(buf, sizeof(buf), "/proc/net/madwifi/%s/" MACSTR, @@ -136,7 +131,7 @@ f = fopen(buf, "r"); if (!f) { -@@ -757,7 +759,7 @@ static int madwifi_receive_probe_req(str +@@ -757,7 +758,7 @@ static int madwifi_receive_probe_req(str if (ret) return ret; @@ -145,7 +140,7 @@ madwifi_raw_receive, drv, 1); if (drv->sock_raw == NULL) return -1; -@@ -1016,7 +1018,7 @@ madwifi_get_we_version(struct madwifi_dr +@@ -1017,7 +1018,7 @@ madwifi_get_we_version(struct madwifi_dr return -1; memset(&iwr, 0, sizeof(iwr)); @@ -154,7 +149,7 @@ iwr.u.data.pointer = (caddr_t) range; iwr.u.data.length = buflen; -@@ -1133,17 +1135,17 @@ madwifi_init(struct hostapd_data *hapd, +@@ -1134,17 +1135,17 @@ madwifi_init(struct hostapd_data *hapd, perror("socket[PF_INET,SOCK_DGRAM]"); goto bad; } @@ -175,7 +170,7 @@ handle_read, drv, 1); if (drv->sock_xmit == NULL) goto bad; -@@ -1157,7 +1159,7 @@ madwifi_init(struct hostapd_data *hapd, +@@ -1158,7 +1159,7 @@ madwifi_init(struct hostapd_data *hapd, 1); if (drv->sock_recv == NULL) goto bad; @@ -184,7 +179,7 @@ wpa_printf(MSG_DEBUG, "Interface in bridge %s; configure for " "EAPOL receive", brname); drv->sock_recv = l2_packet_init(brname, NULL, ETH_P_EAPOL, -@@ -1168,7 +1170,7 @@ madwifi_init(struct hostapd_data *hapd, +@@ -1169,7 +1170,7 @@ madwifi_init(struct hostapd_data *hapd, drv->sock_recv = drv->sock_xmit; memset(&iwr, 0, sizeof(iwr)); @@ -193,7 +188,16 @@ iwr.u.mode = IW_MODE_MASTER; -@@ -1203,7 +1205,7 @@ madwifi_deinit(void *priv) +@@ -1180,7 +1181,7 @@ madwifi_init(struct hostapd_data *hapd, + } + + /* mark down during setup */ +- linux_set_iface_flags(drv->ioctl_sock, drv->iface, 0); ++ linux_set_iface_flags(drv->ioctl_sock, drv->ifname, 0); + madwifi_set_privacy(drv, 0); /* default to no privacy */ + + madwifi_receive_probe_req(drv); +@@ -1206,7 +1207,7 @@ madwifi_deinit(void *priv) struct madwifi_driver_data *drv = priv; netlink_deinit(drv->netlink); @@ -202,7 +206,7 @@ if (drv->ioctl_sock >= 0) close(drv->ioctl_sock); if (drv->sock_recv != NULL && drv->sock_recv != drv->sock_xmit) -@@ -1222,7 +1224,7 @@ madwifi_set_ssid(void *priv, const u8 *b +@@ -1225,7 +1226,7 @@ madwifi_set_ssid(void *priv, const u8 *b struct iwreq iwr; memset(&iwr, 0, sizeof(iwr)); @@ -211,7 +215,7 @@ iwr.u.essid.flags = 1; /* SSID active */ iwr.u.essid.pointer = (caddr_t) buf; iwr.u.essid.length = len + 1; -@@ -1243,7 +1245,7 @@ madwifi_get_ssid(void *priv, u8 *buf, in +@@ -1246,7 +1247,7 @@ madwifi_get_ssid(void *priv, u8 *buf, in int ret = 0; memset(&iwr, 0, sizeof(iwr)); @@ -220,8 +224,12 @@ iwr.u.essid.pointer = (caddr_t) buf; iwr.u.essid.length = len; -@@ -1270,137 +1272,16 @@ madwifi_commit(void *priv) - return 0; +@@ -1271,140 +1272,19 @@ static int + madwifi_commit(void *priv) + { + struct madwifi_driver_data *drv = priv; +- return linux_set_iface_flags(drv->ioctl_sock, drv->iface, 1); ++ return linux_set_iface_flags(drv->ioctl_sock, drv->ifname, 1); } -#else /* HOSTAPD */ @@ -361,7 +369,7 @@ const u8 *wpa_ie, size_t wpa_ie_len) { struct iwreq iwr; -@@ -1411,7 +1292,7 @@ wpa_driver_madwifi_set_wpa_ie(struct wpa +@@ -1415,7 +1295,7 @@ wpa_driver_madwifi_set_wpa_ie(struct wpa iwr.u.data.pointer = (void *) wpa_ie; iwr.u.data.length = wpa_ie_len; @@ -370,7 +378,7 @@ perror("ioctl[IEEE80211_IOCTL_SETOPTIE]"); return -1; } -@@ -1419,156 +1300,51 @@ wpa_driver_madwifi_set_wpa_ie(struct wpa +@@ -1423,157 +1303,51 @@ wpa_driver_madwifi_set_wpa_ie(struct wpa } static int @@ -462,7 +470,7 @@ - wk.ik_keyix = key_idx; - wk.ik_keylen = key_len; -#ifdef WORDS_BIGENDIAN -- { +- if (seq) { - size_t i; - u8 tmp[WPA_KEY_RSC_LEN]; - os_memset(tmp, 0, sizeof(tmp)); @@ -471,7 +479,8 @@ - os_memcpy(&wk.ik_keyrsc, tmp, WPA_KEY_RSC_LEN); - } -#else /* WORDS_BIGENDIAN */ -- os_memcpy(&wk.ik_keyrsc, seq, seq_len); +- if (seq) +- os_memcpy(&wk.ik_keyrsc, seq, seq_len); -#endif /* WORDS_BIGENDIAN */ - os_memcpy(wk.ik_keydata, key, key_len); - @@ -535,7 +544,7 @@ ret = -1; if (wpa_driver_madwifi_set_auth_alg(drv, params->auth_alg) < 0) ret = -1; -@@ -1591,12 +1367,12 @@ wpa_driver_madwifi_associate(void *priv, +@@ -1596,12 +1370,12 @@ wpa_driver_madwifi_associate(void *priv, params->wpa_ie_len == 0) privacy = 0; @@ -550,7 +559,7 @@ ret = -1; if (params->bssid == NULL) { -@@ -1604,14 +1380,14 @@ wpa_driver_madwifi_associate(void *priv, +@@ -1609,14 +1383,14 @@ wpa_driver_madwifi_associate(void *priv, * roaming */ /* FIX: this does not seem to work; would probably need to * change something in the driver */ @@ -567,7 +576,7 @@ ret = -1; if (wpa_driver_wext_set_ssid(drv->wext, params->ssid, params->ssid_len) < 0) -@@ -1620,7 +1396,7 @@ wpa_driver_madwifi_associate(void *priv, +@@ -1625,7 +1399,7 @@ wpa_driver_madwifi_associate(void *priv, mlme.im_op = IEEE80211_MLME_ASSOC; os_memcpy(mlme.im_macaddr, params->bssid, IEEE80211_ADDR_LEN); if (set80211priv(drv, IEEE80211_IOCTL_SETMLME, &mlme, @@ -576,7 +585,7 @@ wpa_printf(MSG_DEBUG, "%s: SETMLME[ASSOC] failed", __func__); ret = -1; -@@ -1633,7 +1409,7 @@ wpa_driver_madwifi_associate(void *priv, +@@ -1638,7 +1412,7 @@ wpa_driver_madwifi_associate(void *priv, static int wpa_driver_madwifi_set_auth_alg(void *priv, int auth_alg) { @@ -585,7 +594,7 @@ int authmode; if ((auth_alg & WPA_AUTH_ALG_OPEN) && -@@ -1644,13 +1420,13 @@ wpa_driver_madwifi_set_auth_alg(void *pr +@@ -1649,13 +1423,13 @@ wpa_driver_madwifi_set_auth_alg(void *pr else authmode = IEEE80211_AUTH_OPEN; @@ -601,7 +610,7 @@ struct iwreq iwr; int ret = 0; const u8 *ssid = params->ssids[0].ssid; -@@ -1668,7 +1444,7 @@ wpa_driver_madwifi_scan(void *priv, stru +@@ -1673,7 +1447,7 @@ wpa_driver_madwifi_scan(void *priv, stru if (wpa_driver_wext_set_ssid(drv->wext, ssid, ssid_len) < 0) ret = -1; @@ -610,7 +619,7 @@ perror("ioctl[SIOCSIWSCAN]"); ret = -1; } -@@ -1690,14 +1466,14 @@ wpa_driver_madwifi_scan(void *priv, stru +@@ -1695,14 +1469,14 @@ wpa_driver_madwifi_scan(void *priv, stru static int wpa_driver_madwifi_get_bssid(void *priv, u8 *bssid) { @@ -627,7 +636,7 @@ return wpa_driver_wext_get_ssid(drv->wext, ssid); } -@@ -1705,14 +1481,16 @@ static int wpa_driver_madwifi_get_ssid(v +@@ -1710,14 +1484,16 @@ static int wpa_driver_madwifi_get_ssid(v static struct wpa_scan_results * wpa_driver_madwifi_get_scan_results(void *priv) { @@ -646,7 +655,7 @@ return wpa_driver_wext_set_operstate(drv->wext, state); } -@@ -1733,7 +1511,7 @@ static int wpa_driver_madwifi_set_probe_ +@@ -1738,7 +1514,7 @@ static int wpa_driver_madwifi_set_probe_ ret = set80211priv(priv, IEEE80211_IOCTL_SET_APPIEBUF, probe_req_ie, sizeof(struct ieee80211req_getset_appiebuf) + @@ -655,7 +664,7 @@ os_free(probe_req_ie); -@@ -1743,7 +1521,7 @@ static int wpa_driver_madwifi_set_probe_ +@@ -1748,7 +1524,7 @@ static int wpa_driver_madwifi_set_probe_ static void * wpa_driver_madwifi_init(void *ctx, const char *ifname) { @@ -664,7 +673,7 @@ drv = os_zalloc(sizeof(*drv)); if (drv == NULL) -@@ -1754,17 +1532,17 @@ static void * wpa_driver_madwifi_init(vo +@@ -1759,17 +1535,17 @@ static void * wpa_driver_madwifi_init(vo drv->ctx = ctx; os_strlcpy(drv->ifname, ifname, sizeof(drv->ifname)); @@ -686,7 +695,7 @@ wpa_printf(MSG_DEBUG, "%s: failed to enable WPA support", __FUNCTION__); goto fail3; -@@ -1773,7 +1551,7 @@ static void * wpa_driver_madwifi_init(vo +@@ -1778,7 +1554,7 @@ static void * wpa_driver_madwifi_init(vo return drv; fail3: @@ -695,7 +704,7 @@ fail2: wpa_driver_wext_deinit(drv->wext); fail: -@@ -1784,38 +1562,37 @@ fail: +@@ -1789,38 +1565,37 @@ fail: static void wpa_driver_madwifi_deinit(void *priv) { @@ -741,7 +750,7 @@ #ifdef HOSTAPD .hapd_init = madwifi_init, .hapd_deinit = madwifi_deinit, -@@ -1835,7 +1612,8 @@ const struct wpa_driver_ops wpa_driver_m +@@ -1840,7 +1615,8 @@ const struct wpa_driver_ops wpa_driver_m .sta_clear_stats = madwifi_sta_clear_stats, .commit = madwifi_commit, .set_ap_wps_ie = madwifi_set_ap_wps_ie, @@ -751,10 +760,23 @@ .get_bssid = wpa_driver_madwifi_get_bssid, .get_ssid = wpa_driver_madwifi_get_ssid, .init = wpa_driver_madwifi_init, -@@ -1847,5 +1625,5 @@ const struct wpa_driver_ops wpa_driver_m +@@ -1852,5 +1628,5 @@ const struct wpa_driver_ops wpa_driver_m .disassociate = wpa_driver_madwifi_disassociate, .associate = wpa_driver_madwifi_associate, .set_operstate = wpa_driver_madwifi_set_operstate, -#endif /* HOSTAPD */ +#endif }; +--- a/src/drivers/drivers.mak ++++ b/src/drivers/drivers.mak +@@ -144,8 +144,8 @@ DRV_WPA_OBJS += ../src/drivers/driver_ro + endif + + ifdef CONFIG_WIRELESS_EXTENSION +-DRV_WPA_CFLAGS += -DCONFIG_WIRELESS_EXTENSION +-DRV_WPA_OBJS += ../src/drivers/driver_wext.o ++DRV_CFLAGS += -DCONFIG_WIRELESS_EXTENSION ++DRV_OBJS += ../src/drivers/driver_wext.o + NEED_RFKILL=y + endif + diff --git a/package/hostapd/patches/390-nl80211_fixes.patch b/package/hostapd/patches/320-nl80211_multicall_fixes.patch similarity index 68% rename from package/hostapd/patches/390-nl80211_fixes.patch rename to package/hostapd/patches/320-nl80211_multicall_fixes.patch index 20c603252..9bd736970 100644 --- a/package/hostapd/patches/390-nl80211_fixes.patch +++ b/package/hostapd/patches/320-nl80211_multicall_fixes.patch @@ -1,6 +1,6 @@ --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -1135,7 +1135,6 @@ nla_put_failure: +@@ -1468,7 +1468,6 @@ nla_put_failure: } @@ -8,23 +8,23 @@ struct wiphy_info_data { int max_scan_ssids; int ap_supported; -@@ -1247,7 +1246,6 @@ static int wpa_driver_nl80211_capa(struc +@@ -1613,7 +1612,6 @@ static int wpa_driver_nl80211_capa(struc return 0; } -#endif /* HOSTAPD */ - static int wpa_driver_nl80211_init_nl(struct wpa_driver_nl80211_data *drv, -@@ -1411,6 +1409,7 @@ static void * wpa_driver_nl80211_init(vo + static int wpa_driver_nl80211_init_nl(struct wpa_driver_nl80211_data *drv) +@@ -1825,6 +1823,7 @@ static void * wpa_driver_nl80211_init(vo drv->monitor_ifidx = -1; drv->monitor_sock = -1; drv->ioctl_sock = -1; + drv->nlmode = NL80211_IFTYPE_STATION; - if (wpa_driver_nl80211_init_nl(drv, ctx)) { + if (wpa_driver_nl80211_init_nl(drv)) { os_free(drv); -@@ -1530,32 +1529,32 @@ wpa_driver_nl80211_finish_drv_init(struc +@@ -1988,32 +1987,32 @@ wpa_driver_nl80211_finish_drv_init(struc drv->ifindex = if_nametoindex(bss->ifname); drv->first_bss.ifindex = drv->ifindex; @@ -33,12 +33,7 @@ - wpa_printf(MSG_DEBUG, "nl80211: Could not configure driver to " - "use managed mode"); - } -+ if (drv->nlmode == NL80211_IFTYPE_STATION) { -+ if (wpa_driver_nl80211_set_mode(bss, IEEE80211_MODE_INFRA) < 0) { -+ wpa_printf(MSG_DEBUG, "nl80211: Could not configure driver to " -+ "use managed mode"); -+ } - +- - if (linux_set_iface_flags(drv->ioctl_sock, bss->ifname, 1)) { - if (rfkill_is_blocked(drv->rfkill)) { - wpa_printf(MSG_DEBUG, "nl80211: Could not yet enable " @@ -50,6 +45,12 @@ - wpa_printf(MSG_ERROR, "nl80211: Could not set " - "interface '%s' UP", bss->ifname); - return -1; ++ if (drv->nlmode == NL80211_IFTYPE_STATION) { ++ if (wpa_driver_nl80211_set_mode(bss, IEEE80211_MODE_INFRA) < 0) { ++ wpa_printf(MSG_DEBUG, "nl80211: Could not configure driver to " ++ "use managed mode"); ++ } ++ + if (linux_set_iface_flags(drv->ioctl_sock, bss->ifname, 1)) { + if (rfkill_is_blocked(drv->rfkill)) { + wpa_printf(MSG_DEBUG, "nl80211: Could not yet enable " @@ -77,24 +78,9 @@ + 1, IF_OPER_DORMANT); + } - if (nl80211_register_action_frames(drv) < 0) { - wpa_printf(MSG_DEBUG, "nl80211: Failed to register Action " -@@ -2219,13 +2218,9 @@ static int wpa_driver_nl80211_set_key(co - */ - if (ret || !set_tx || alg == WPA_ALG_NONE) - return ret; --#ifdef HOSTAPD -- if (addr) -- return ret; --#else /* HOSTAPD */ -+ - if (drv->nlmode == NL80211_IFTYPE_AP && addr) - return ret; --#endif /* HOSTAPD */ - - msg = nlmsg_alloc(); - if (!msg) -@@ -3066,7 +3061,8 @@ static void nl80211_remove_iface(struct + if (linux_get_ifhwaddr(drv->ioctl_sock, bss->ifname, drv->addr)) + return -1; +@@ -3738,7 +3737,8 @@ static void nl80211_remove_iface(struct #ifdef HOSTAPD /* stop listening for EAPOL on this interface */ @@ -104,7 +90,7 @@ #endif /* HOSTAPD */ msg = nlmsg_alloc(); -@@ -3139,7 +3135,8 @@ static int nl80211_create_iface_once(str +@@ -3811,7 +3811,8 @@ static int nl80211_create_iface_once(str #ifdef HOSTAPD /* start listening for EAPOL on this interface */ @@ -114,11 +100,3 @@ #endif /* HOSTAPD */ if (addr && iftype != NL80211_IFTYPE_MONITOR && -@@ -4842,6 +4839,7 @@ static void *i802_init(struct hostapd_da - return NULL; - - drv = bss->drv; -+ drv->nlmode = NL80211_IFTYPE_AP; - if (linux_br_get(brname, params->ifname) == 0) { - wpa_printf(MSG_DEBUG, "nl80211: Interface %s is in bridge %s", - params->ifname, brname); diff --git a/package/hostapd/patches/430-supplicant_bridge_fix.patch b/package/hostapd/patches/330-multicall_bridge_fix.patch similarity index 72% rename from package/hostapd/patches/430-supplicant_bridge_fix.patch rename to package/hostapd/patches/330-multicall_bridge_fix.patch index feddf6fed..96456ea72 100644 --- a/package/hostapd/patches/430-supplicant_bridge_fix.patch +++ b/package/hostapd/patches/330-multicall_bridge_fix.patch @@ -1,6 +1,6 @@ --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -410,6 +410,10 @@ static void wpa_driver_nl80211_event_rtm +@@ -464,6 +464,10 @@ static void wpa_driver_nl80211_event_rtm return; } @@ -11,7 +11,7 @@ wpa_printf(MSG_DEBUG, "RTM_NEWLINK: operstate=%d ifi_flags=0x%x " "(%s%s%s%s)", drv->operstate, ifi->ifi_flags, -@@ -481,6 +485,10 @@ static void wpa_driver_nl80211_event_rtm +@@ -535,6 +539,10 @@ static void wpa_driver_nl80211_event_rtm attrlen = len; attr = (struct rtattr *) buf; @@ -22,9 +22,9 @@ rta_len = RTA_ALIGN(sizeof(struct rtattr)); while (RTA_OK(attr, attrlen)) { if (attr->rta_type == IFLA_IFNAME) { -@@ -1347,6 +1355,11 @@ static int wpa_driver_nl80211_init_nl(st - eloop_register_read_sock(nl_socket_get_fd(drv->nl_handle_event), - wpa_driver_nl80211_event_receive, drv, ctx); +@@ -1610,6 +1618,11 @@ static int wpa_driver_nl80211_capa(struc + drv->capa.flags |= WPA_DRIVER_FLAGS_P2P_CAPABLE; + drv->capa.max_remain_on_chan = info.max_remain_on_chan; +#ifdef HOSTAPD + drv->num_if_indices = sizeof(drv->default_if_indices) / sizeof(int); @@ -32,9 +32,9 @@ +#endif + return 0; + } - err4: -@@ -4867,8 +4880,6 @@ static void *i802_init(struct hostapd_da +@@ -5602,8 +5615,6 @@ static void *i802_init(struct hostapd_da br_ifindex = 0; } diff --git a/package/hostapd/patches/340-madwifi_key_fixes.patch b/package/hostapd/patches/340-madwifi_key_fixes.patch new file mode 100644 index 000000000..ab4d0575e --- /dev/null +++ b/package/hostapd/patches/340-madwifi_key_fixes.patch @@ -0,0 +1,69 @@ +--- a/src/drivers/driver_madwifi.c ++++ b/src/drivers/driver_madwifi.c +@@ -439,7 +439,11 @@ madwifi_set_key(const char *ifname, void + __func__, alg, ether_sprintf(addr), key_idx); + + if (alg == WPA_ALG_WEP) ++ { + cipher = IEEE80211_CIPHER_WEP; ++ if ((!addr || !memcmp(addr, "\xff\xff\xff\xff\xff\xff", ETH_ALEN)) && drv->wext) ++ return wpa_driver_wext_set_key(ifname, drv->wext, alg, addr, key_idx, set_tx, seq, seq_len, key, key_len); ++ } + else if (alg == WPA_ALG_TKIP) + cipher = IEEE80211_CIPHER_TKIP; + else if (alg == WPA_ALG_CCMP) +@@ -458,20 +462,45 @@ madwifi_set_key(const char *ifname, void + + memset(&wk, 0, sizeof(wk)); + wk.ik_type = cipher; +- wk.ik_flags = IEEE80211_KEY_RECV | IEEE80211_KEY_XMIT; +- if (addr == NULL || is_broadcast_ether_addr(addr)) { +- memset(wk.ik_macaddr, 0xff, IEEE80211_ADDR_LEN); ++ wk.ik_flags = IEEE80211_KEY_RECV; ++ if (set_tx) ++ wk.ik_flags |= IEEE80211_KEY_XMIT; ++ if (addr == NULL) { ++ os_memset(wk.ik_macaddr, 0xff, IEEE80211_ADDR_LEN); + wk.ik_keyix = key_idx; +- wk.ik_flags |= IEEE80211_KEY_DEFAULT; +- } else if (!memcmp(addr, "\xff\xff\xff\xff\xff\xff", ETH_ALEN)) { +- wk.ik_flags |= IEEE80211_KEY_GROUP; +- memcpy(wk.ik_macaddr, addr, IEEE80211_ADDR_LEN); + } else { +- memcpy(wk.ik_macaddr, addr, IEEE80211_ADDR_LEN); +- wk.ik_keyix = IEEE80211_KEYIX_NONE; ++ os_memcpy(wk.ik_macaddr, addr, IEEE80211_ADDR_LEN); ++ /* ++ * Deduce whether group/global or unicast key by checking ++ * the address (yech). Note also that we can only mark global ++ * keys default; doing this for a unicast key is an error. ++ */ ++ if (os_memcmp(addr, "\xff\xff\xff\xff\xff\xff", ++ IEEE80211_ADDR_LEN) == 0) { ++ wk.ik_flags |= IEEE80211_KEY_GROUP; ++ wk.ik_keyix = key_idx; ++ } else { ++ wk.ik_keyix = key_idx == 0 ? IEEE80211_KEYIX_NONE : ++ key_idx; ++ } + } ++ if (wk.ik_keyix != IEEE80211_KEYIX_NONE && set_tx) ++ wk.ik_flags |= IEEE80211_KEY_DEFAULT; + wk.ik_keylen = key_len; + memcpy(wk.ik_keydata, key, key_len); ++#ifdef WORDS_BIGENDIAN ++#define WPA_KEY_RSC_LEN 8 ++ { ++ size_t i; ++ u8 tmp[WPA_KEY_RSC_LEN]; ++ os_memset(tmp, 0, sizeof(tmp)); ++ for (i = 0; i < seq_len; i++) ++ tmp[WPA_KEY_RSC_LEN - i - 1] = seq[i]; ++ os_memcpy(&wk.ik_keyrsc, tmp, WPA_KEY_RSC_LEN); ++ } ++#else /* WORDS_BIGENDIAN */ ++ os_memcpy(&wk.ik_keyrsc, seq, seq_len); ++#endif /* WORDS_BIGENDIAN */ + + ret = set80211priv(drv, IEEE80211_IOCTL_SETKEY, &wk, sizeof(wk)); + if (ret < 0) { diff --git a/package/hostapd/patches/340-roboswitch_fix.patch b/package/hostapd/patches/340-roboswitch_fix.patch deleted file mode 100644 index 50dca64f1..000000000 --- a/package/hostapd/patches/340-roboswitch_fix.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/src/drivers/driver_roboswitch.c -+++ b/src/drivers/driver_roboswitch.c -@@ -14,10 +14,10 @@ - - #include "includes.h" - #include --#include - #include - #include - #include -+#include - - #include "common.h" - #include "driver.h" diff --git a/package/hostapd/patches/350-hostap_multicall_fix.patch b/package/hostapd/patches/350-hostap_multicall_fix.patch new file mode 100644 index 000000000..a4b6cc665 --- /dev/null +++ b/package/hostapd/patches/350-hostap_multicall_fix.patch @@ -0,0 +1,554 @@ +--- a/src/drivers/driver_hostap.c ++++ b/src/drivers/driver_hostap.c +@@ -22,9 +22,6 @@ + #include "eloop.h" + #include "driver_hostap.h" + +- +-#ifdef HOSTAPD +- + #include + #include + +@@ -42,10 +39,16 @@ + static const u8 rfc1042_header[6] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 }; + + struct hostap_driver_data { ++ void *wext; /* private data for driver_wext */ ++ void *ctx; ++ char ifname[IFNAMSIZ + 1]; ++ int sock; ++ int current_mode; /* infra/adhoc */ ++ ++#ifdef HOSTAPD + struct hostapd_data *hapd; + + char iface[IFNAMSIZ + 1]; +- int sock; /* raw packet socket for driver access */ + int ioctl_sock; /* socket for ioctl() use */ + struct netlink_data *netlink; + +@@ -55,9 +58,11 @@ struct hostap_driver_data { + size_t generic_ie_len; + u8 *wps_ie; + size_t wps_ie_len; ++#endif + }; + + ++#ifdef HOSTAPD + static int hostapd_ioctl(void *priv, struct prism2_hostapd_param *param, + int len); + static int hostap_set_iface_flags(void *priv, int dev_up); +@@ -399,65 +404,6 @@ static int hostapd_ioctl(void *priv, str + } + + +-static int wpa_driver_hostap_set_key(const char *ifname, void *priv, +- enum wpa_alg alg, const u8 *addr, +- int key_idx, int set_tx, +- const u8 *seq, size_t seq_len, +- const u8 *key, size_t key_len) +-{ +- struct hostap_driver_data *drv = priv; +- struct prism2_hostapd_param *param; +- u8 *buf; +- size_t blen; +- int ret = 0; +- +- blen = sizeof(*param) + key_len; +- buf = os_zalloc(blen); +- if (buf == NULL) +- return -1; +- +- param = (struct prism2_hostapd_param *) buf; +- param->cmd = PRISM2_SET_ENCRYPTION; +- if (addr == NULL) +- memset(param->sta_addr, 0xff, ETH_ALEN); +- else +- memcpy(param->sta_addr, addr, ETH_ALEN); +- switch (alg) { +- case WPA_ALG_NONE: +- os_strlcpy((char *) param->u.crypt.alg, "NONE", +- HOSTAP_CRYPT_ALG_NAME_LEN); +- break; +- case WPA_ALG_WEP: +- os_strlcpy((char *) param->u.crypt.alg, "WEP", +- HOSTAP_CRYPT_ALG_NAME_LEN); +- break; +- case WPA_ALG_TKIP: +- os_strlcpy((char *) param->u.crypt.alg, "TKIP", +- HOSTAP_CRYPT_ALG_NAME_LEN); +- break; +- case WPA_ALG_CCMP: +- os_strlcpy((char *) param->u.crypt.alg, "CCMP", +- HOSTAP_CRYPT_ALG_NAME_LEN); +- break; +- default: +- os_free(buf); +- return -1; +- } +- param->u.crypt.flags = set_tx ? HOSTAP_CRYPT_FLAG_SET_TX_KEY : 0; +- param->u.crypt.idx = key_idx; +- param->u.crypt.key_len = key_len; +- memcpy((u8 *) (param + 1), key, key_len); +- +- if (hostapd_ioctl(drv, param, blen)) { +- printf("Failed to set encryption.\n"); +- ret = -1; +- } +- free(buf); +- +- return ret; +-} +- +- + static int hostap_get_seqnum(const char *ifname, void *priv, const u8 *addr, + int idx, u8 *seq) + { +@@ -1125,21 +1071,9 @@ static struct hostapd_hw_modes * hostap_ + return mode; + } + +-#else /* HOSTAPD */ +- +-struct wpa_driver_hostap_data { +- void *wext; /* private data for driver_wext */ +- void *ctx; +- char ifname[IFNAMSIZ + 1]; +- int sock; +- int current_mode; /* infra/adhoc */ +-}; +- +- +-static int wpa_driver_hostap_set_auth_alg(void *priv, int auth_alg); +- ++#endif /* HOSTAPD */ + +-static int hostapd_ioctl(struct wpa_driver_hostap_data *drv, ++static int wpa_hostapd_ioctl(struct hostap_driver_data *drv, + struct prism2_hostapd_param *param, + int len, int show_err) + { +@@ -1161,7 +1095,12 @@ static int hostapd_ioctl(struct wpa_driv + } + + +-static int wpa_driver_hostap_set_wpa_ie(struct wpa_driver_hostap_data *drv, ++#if !defined(NO_SUPPLICANT) ++ ++static int wpa_driver_hostap_set_auth_alg(void *priv, int auth_alg); ++ ++ ++static int wpa_driver_hostap_set_wpa_ie(struct hostap_driver_data *drv, + const u8 *wpa_ie, size_t wpa_ie_len) + { + struct prism2_hostapd_param *param; +@@ -1177,7 +1116,7 @@ static int wpa_driver_hostap_set_wpa_ie( + param->cmd = PRISM2_HOSTAPD_SET_GENERIC_ELEMENT; + param->u.generic_elem.len = wpa_ie_len; + os_memcpy(param->u.generic_elem.data, wpa_ie, wpa_ie_len); +- res = hostapd_ioctl(drv, param, blen, 1); ++ res = wpa_hostapd_ioctl(drv, param, blen, 1); + + os_free(param); + +@@ -1185,7 +1124,7 @@ static int wpa_driver_hostap_set_wpa_ie( + } + + +-static int prism2param(struct wpa_driver_hostap_data *drv, int param, ++static int prism2param(struct hostap_driver_data *drv, int param, + int value) + { + struct iwreq iwr; +@@ -1207,7 +1146,7 @@ static int prism2param(struct wpa_driver + + static int wpa_driver_hostap_set_wpa(void *priv, int enabled) + { +- struct wpa_driver_hostap_data *drv = priv; ++ struct hostap_driver_data *drv = priv; + int ret = 0; + + wpa_printf(MSG_DEBUG, "%s: enabled=%d", __FUNCTION__, enabled); +@@ -1223,125 +1162,15 @@ static int wpa_driver_hostap_set_wpa(voi + } + + +-static void show_set_key_error(struct prism2_hostapd_param *param) +-{ +- switch (param->u.crypt.err) { +- case HOSTAP_CRYPT_ERR_UNKNOWN_ALG: +- wpa_printf(MSG_INFO, "Unknown algorithm '%s'.", +- param->u.crypt.alg); +- wpa_printf(MSG_INFO, "You may need to load kernel module to " +- "register that algorithm."); +- wpa_printf(MSG_INFO, "E.g., 'modprobe hostap_crypt_wep' for " +- "WEP."); +- break; +- case HOSTAP_CRYPT_ERR_UNKNOWN_ADDR: +- wpa_printf(MSG_INFO, "Unknown address " MACSTR ".", +- MAC2STR(param->sta_addr)); +- break; +- case HOSTAP_CRYPT_ERR_CRYPT_INIT_FAILED: +- wpa_printf(MSG_INFO, "Crypt algorithm initialization failed."); +- break; +- case HOSTAP_CRYPT_ERR_KEY_SET_FAILED: +- wpa_printf(MSG_INFO, "Key setting failed."); +- break; +- case HOSTAP_CRYPT_ERR_TX_KEY_SET_FAILED: +- wpa_printf(MSG_INFO, "TX key index setting failed."); +- break; +- case HOSTAP_CRYPT_ERR_CARD_CONF_FAILED: +- wpa_printf(MSG_INFO, "Card configuration failed."); +- break; +- } +-} +- +- +-static int wpa_driver_hostap_set_key(const char *ifname, void *priv, +- enum wpa_alg alg, const u8 *addr, +- int key_idx, int set_tx, +- const u8 *seq, size_t seq_len, +- const u8 *key, size_t key_len) +-{ +- struct wpa_driver_hostap_data *drv = priv; +- struct prism2_hostapd_param *param; +- u8 *buf; +- size_t blen; +- int ret = 0; +- char *alg_name; +- +- switch (alg) { +- case WPA_ALG_NONE: +- alg_name = "none"; +- break; +- case WPA_ALG_WEP: +- alg_name = "WEP"; +- break; +- case WPA_ALG_TKIP: +- alg_name = "TKIP"; +- break; +- case WPA_ALG_CCMP: +- alg_name = "CCMP"; +- break; +- default: +- return -1; +- } +- +- wpa_printf(MSG_DEBUG, "%s: alg=%s key_idx=%d set_tx=%d seq_len=%lu " +- "key_len=%lu", __FUNCTION__, alg_name, key_idx, set_tx, +- (unsigned long) seq_len, (unsigned long) key_len); +- +- if (seq_len > 8) +- return -2; +- +- blen = sizeof(*param) + key_len; +- buf = os_zalloc(blen); +- if (buf == NULL) +- return -1; +- +- param = (struct prism2_hostapd_param *) buf; +- param->cmd = PRISM2_SET_ENCRYPTION; +- /* TODO: In theory, STA in client mode can use five keys; four default +- * keys for receiving (with keyidx 0..3) and one individual key for +- * both transmitting and receiving (keyidx 0) _unicast_ packets. Now, +- * keyidx 0 is reserved for this unicast use and default keys can only +- * use keyidx 1..3 (i.e., default key with keyidx 0 is not supported). +- * This should be fine for more or less all cases, but for completeness +- * sake, the driver could be enhanced to support the missing key. */ +-#if 0 +- if (addr == NULL) +- os_memset(param->sta_addr, 0xff, ETH_ALEN); +- else +- os_memcpy(param->sta_addr, addr, ETH_ALEN); +-#else +- os_memset(param->sta_addr, 0xff, ETH_ALEN); +-#endif +- os_strlcpy((char *) param->u.crypt.alg, alg_name, +- HOSTAP_CRYPT_ALG_NAME_LEN); +- param->u.crypt.flags = set_tx ? HOSTAP_CRYPT_FLAG_SET_TX_KEY : 0; +- param->u.crypt.idx = key_idx; +- if (seq) +- os_memcpy(param->u.crypt.seq, seq, seq_len); +- param->u.crypt.key_len = key_len; +- os_memcpy((u8 *) (param + 1), key, key_len); +- +- if (hostapd_ioctl(drv, param, blen, 1)) { +- wpa_printf(MSG_WARNING, "Failed to set encryption."); +- show_set_key_error(param); +- ret = -1; +- } +- os_free(buf); +- +- return ret; +-} +- +- + static int wpa_driver_hostap_set_countermeasures(void *priv, int enabled) + { +- struct wpa_driver_hostap_data *drv = priv; ++ struct hostap_driver_data *drv = priv; + wpa_printf(MSG_DEBUG, "%s: enabled=%d", __FUNCTION__, enabled); + return prism2param(drv, PRISM2_PARAM_TKIP_COUNTERMEASURES, enabled); + } + + +-static int wpa_driver_hostap_reset(struct wpa_driver_hostap_data *drv, ++static int wpa_driver_hostap_reset(struct hostap_driver_data *drv, + int type) + { + struct iwreq iwr; +@@ -1362,7 +1191,7 @@ static int wpa_driver_hostap_reset(struc + } + + +-static int wpa_driver_hostap_mlme(struct wpa_driver_hostap_data *drv, ++static int wpa_driver_hostap_mlme(struct hostap_driver_data *drv, + const u8 *addr, int cmd, int reason_code) + { + struct prism2_hostapd_param param; +@@ -1377,7 +1206,7 @@ static int wpa_driver_hostap_mlme(struct + os_memcpy(param.sta_addr, addr, ETH_ALEN); + param.u.mlme.cmd = cmd; + param.u.mlme.reason_code = reason_code; +- ret = hostapd_ioctl(drv, ¶m, sizeof(param), 1); ++ ret = wpa_hostapd_ioctl(drv, ¶m, sizeof(param), 1); + if (ret == 0) { + os_sleep(0, 100000); + ret = wpa_driver_hostap_reset(drv, 2); +@@ -1389,7 +1218,7 @@ static int wpa_driver_hostap_mlme(struct + static int wpa_driver_hostap_deauthenticate(void *priv, const u8 *addr, + int reason_code) + { +- struct wpa_driver_hostap_data *drv = priv; ++ struct hostap_driver_data *drv = priv; + wpa_printf(MSG_DEBUG, "%s", __FUNCTION__); + return wpa_driver_hostap_mlme(drv, addr, MLME_STA_DEAUTH, + reason_code); +@@ -1399,7 +1228,7 @@ static int wpa_driver_hostap_deauthentic + static int wpa_driver_hostap_disassociate(void *priv, const u8 *addr, + int reason_code) + { +- struct wpa_driver_hostap_data *drv = priv; ++ struct hostap_driver_data *drv = priv; + wpa_printf(MSG_DEBUG, "%s", __FUNCTION__); + return wpa_driver_hostap_mlme(drv, addr, MLME_STA_DISASSOC, + reason_code); +@@ -1410,7 +1239,7 @@ static int + wpa_driver_hostap_associate(void *priv, + struct wpa_driver_associate_params *params) + { +- struct wpa_driver_hostap_data *drv = priv; ++ struct hostap_driver_data *drv = priv; + int ret = 0; + int allow_unencrypted_eapol; + +@@ -1474,7 +1303,7 @@ wpa_driver_hostap_associate(void *priv, + static int wpa_driver_hostap_scan(void *priv, + struct wpa_driver_scan_params *params) + { +- struct wpa_driver_hostap_data *drv = priv; ++ struct hostap_driver_data *drv = priv; + struct prism2_hostapd_param param; + int ret; + const u8 *ssid = params->ssids[0].ssid; +@@ -1495,7 +1324,7 @@ static int wpa_driver_hostap_scan(void * + param.cmd = PRISM2_HOSTAPD_SCAN_REQ; + param.u.scan_req.ssid_len = ssid_len; + os_memcpy(param.u.scan_req.ssid, ssid, ssid_len); +- ret = hostapd_ioctl(drv, ¶m, sizeof(param), 1); ++ ret = wpa_hostapd_ioctl(drv, ¶m, sizeof(param), 1); + + /* Not all drivers generate "scan completed" wireless event, so try to + * read results after a timeout. */ +@@ -1510,7 +1339,7 @@ static int wpa_driver_hostap_scan(void * + + static int wpa_driver_hostap_set_auth_alg(void *priv, int auth_alg) + { +- struct wpa_driver_hostap_data *drv = priv; ++ struct hostap_driver_data *drv = priv; + int algs = 0; + + if (auth_alg & WPA_AUTH_ALG_OPEN) +@@ -1528,35 +1357,35 @@ static int wpa_driver_hostap_set_auth_al + + static int wpa_driver_hostap_get_bssid(void *priv, u8 *bssid) + { +- struct wpa_driver_hostap_data *drv = priv; ++ struct hostap_driver_data *drv = priv; + return wpa_driver_wext_get_bssid(drv->wext, bssid); + } + + + static int wpa_driver_hostap_get_ssid(void *priv, u8 *ssid) + { +- struct wpa_driver_hostap_data *drv = priv; ++ struct hostap_driver_data *drv = priv; + return wpa_driver_wext_get_ssid(drv->wext, ssid); + } + + + static struct wpa_scan_results * wpa_driver_hostap_get_scan_results(void *priv) + { +- struct wpa_driver_hostap_data *drv = priv; ++ struct hostap_driver_data *drv = priv; + return wpa_driver_wext_get_scan_results(drv->wext); + } + + + static int wpa_driver_hostap_set_operstate(void *priv, int state) + { +- struct wpa_driver_hostap_data *drv = priv; ++ struct hostap_driver_data *drv = priv; + return wpa_driver_wext_set_operstate(drv->wext, state); + } + + + static void * wpa_driver_hostap_init(void *ctx, const char *ifname) + { +- struct wpa_driver_hostap_data *drv; ++ struct hostap_driver_data *drv; + + drv = os_zalloc(sizeof(*drv)); + if (drv == NULL) +@@ -1596,14 +1425,120 @@ static void * wpa_driver_hostap_init(voi + + static void wpa_driver_hostap_deinit(void *priv) + { +- struct wpa_driver_hostap_data *drv = priv; ++ struct hostap_driver_data *drv = priv; + wpa_driver_hostap_set_wpa(drv, 0); + wpa_driver_wext_deinit(drv->wext); + close(drv->sock); + os_free(drv); + } + +-#endif /* HOSTAPD */ ++#endif ++ ++ ++static void show_set_key_error(struct prism2_hostapd_param *param) ++{ ++ switch (param->u.crypt.err) { ++ case HOSTAP_CRYPT_ERR_UNKNOWN_ALG: ++ wpa_printf(MSG_INFO, "Unknown algorithm '%s'.", ++ param->u.crypt.alg); ++ wpa_printf(MSG_INFO, "You may need to load kernel module to " ++ "register that algorithm."); ++ wpa_printf(MSG_INFO, "E.g., 'modprobe hostap_crypt_wep' for " ++ "WEP."); ++ break; ++ case HOSTAP_CRYPT_ERR_UNKNOWN_ADDR: ++ wpa_printf(MSG_INFO, "Unknown address " MACSTR ".", ++ MAC2STR(param->sta_addr)); ++ break; ++ case HOSTAP_CRYPT_ERR_CRYPT_INIT_FAILED: ++ wpa_printf(MSG_INFO, "Crypt algorithm initialization failed."); ++ break; ++ case HOSTAP_CRYPT_ERR_KEY_SET_FAILED: ++ wpa_printf(MSG_INFO, "Key setting failed."); ++ break; ++ case HOSTAP_CRYPT_ERR_TX_KEY_SET_FAILED: ++ wpa_printf(MSG_INFO, "TX key index setting failed."); ++ break; ++ case HOSTAP_CRYPT_ERR_CARD_CONF_FAILED: ++ wpa_printf(MSG_INFO, "Card configuration failed."); ++ break; ++ } ++} ++ ++ ++static int wpa_driver_hostap_set_key(const char *ifname, void *priv, ++ enum wpa_alg alg, const u8 *addr, ++ int key_idx, int set_tx, ++ const u8 *seq, size_t seq_len, ++ const u8 *key, size_t key_len) ++{ ++ struct hostap_driver_data *drv = priv; ++ struct prism2_hostapd_param *param; ++ u8 *buf; ++ size_t blen; ++ int ret = 0; ++ char *alg_name; ++ ++ switch (alg) { ++ case WPA_ALG_NONE: ++ alg_name = "none"; ++ break; ++ case WPA_ALG_WEP: ++ alg_name = "WEP"; ++ break; ++ case WPA_ALG_TKIP: ++ alg_name = "TKIP"; ++ break; ++ case WPA_ALG_CCMP: ++ alg_name = "CCMP"; ++ break; ++ default: ++ return -1; ++ } ++ ++ wpa_printf(MSG_DEBUG, "%s: alg=%s key_idx=%d set_tx=%d seq_len=%lu " ++ "key_len=%lu", __FUNCTION__, alg_name, key_idx, set_tx, ++ (unsigned long) seq_len, (unsigned long) key_len); ++ ++ if (seq_len > 8) ++ return -2; ++ ++ blen = sizeof(*param) + key_len; ++ buf = os_zalloc(blen); ++ if (buf == NULL) ++ return -1; ++ ++ param = (struct prism2_hostapd_param *) buf; ++ param->cmd = PRISM2_SET_ENCRYPTION; ++ /* TODO: In theory, STA in client mode can use five keys; four default ++ * keys for receiving (with keyidx 0..3) and one individual key for ++ * both transmitting and receiving (keyidx 0) _unicast_ packets. Now, ++ * keyidx 0 is reserved for this unicast use and default keys can only ++ * use keyidx 1..3 (i.e., default key with keyidx 0 is not supported). ++ * This should be fine for more or less all cases, but for completeness ++ * sake, the driver could be enhanced to support the missing key. */ ++ if (addr == NULL) ++ os_memset(param->sta_addr, 0xff, ETH_ALEN); ++ else ++ os_memcpy(param->sta_addr, addr, ETH_ALEN); ++ os_strlcpy((char *) param->u.crypt.alg, alg_name, ++ HOSTAP_CRYPT_ALG_NAME_LEN); ++ param->u.crypt.flags = set_tx ? HOSTAP_CRYPT_FLAG_SET_TX_KEY : 0; ++ param->u.crypt.idx = key_idx; ++ if (seq) ++ os_memcpy(param->u.crypt.seq, seq, seq_len); ++ param->u.crypt.key_len = key_len; ++ os_memcpy((u8 *) (param + 1), key, key_len); ++ ++ if (wpa_hostapd_ioctl(drv, param, blen, 1)) { ++ wpa_printf(MSG_WARNING, "Failed to set encryption."); ++ show_set_key_error(param); ++ ret = -1; ++ } ++ os_free(buf); ++ ++ return ret; ++} + + + const struct wpa_driver_ops wpa_driver_hostap_ops = { +@@ -1631,7 +1566,8 @@ const struct wpa_driver_ops wpa_driver_h + .sta_clear_stats = hostap_sta_clear_stats, + .get_hw_feature_data = hostap_get_hw_feature_data, + .set_ap_wps_ie = hostap_set_ap_wps_ie, +-#else /* HOSTAPD */ ++#endif /* HOSTAPD */ ++#if !defined(NO_SUPPLICANT) + .get_bssid = wpa_driver_hostap_get_bssid, + .get_ssid = wpa_driver_hostap_get_ssid, + .set_countermeasures = wpa_driver_hostap_set_countermeasures, +@@ -1643,5 +1579,5 @@ const struct wpa_driver_ops wpa_driver_h + .init = wpa_driver_hostap_init, + .deinit = wpa_driver_hostap_deinit, + .set_operstate = wpa_driver_hostap_set_operstate, +-#endif /* HOSTAPD */ ++#endif + }; diff --git a/package/hostapd/patches/350-wds_fix.patch b/package/hostapd/patches/350-wds_fix.patch deleted file mode 100644 index 3a3ee000a..000000000 --- a/package/hostapd/patches/350-wds_fix.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -4652,9 +4652,11 @@ static int i802_set_wds_sta(void *priv, - wpa_printf(MSG_DEBUG, "nl80211: Set WDS STA addr=" MACSTR - " aid=%d val=%d name=%s", MAC2STR(addr), aid, val, name); - if (val) { -- if (nl80211_create_iface(drv, name, NL80211_IFTYPE_AP_VLAN, -+ if (!if_nametoindex(name)) { -+ if (nl80211_create_iface(drv, name, NL80211_IFTYPE_AP_VLAN, - NULL, 1) < 0) -- return -1; -+ return -1; -+ } - linux_set_iface_flags(drv->ioctl_sock, name, 1); - return i802_set_sta_vlan(priv, addr, name, 0); - } else { ---- a/src/ap/ieee802_11.c -+++ b/src/ap/ieee802_11.c -@@ -1627,6 +1627,9 @@ static void handle_assoc_cb(struct hosta - "Could not add STA to kernel driver"); - } - -+ if (sta->flags & WLAN_STA_WDS) -+ hapd->drv.set_wds_sta(hapd, sta->addr, sta->aid, 1); -+ - if (sta->eapol_sm == NULL) { - /* - * This STA does not use RADIUS server for EAP authentication, diff --git a/package/hostapd/patches/360-wds_bridge.patch b/package/hostapd/patches/360-wds_bridge.patch deleted file mode 100644 index 4cc60de06..000000000 --- a/package/hostapd/patches/360-wds_bridge.patch +++ /dev/null @@ -1,75 +0,0 @@ ---- a/src/ap/ap_config.h -+++ b/src/ap/ap_config.h -@@ -148,6 +148,7 @@ struct hostapd_wmm_ac_params { - struct hostapd_bss_config { - char iface[IFNAMSIZ + 1]; - char bridge[IFNAMSIZ + 1]; -+ char wds_bridge[IFNAMSIZ + 1]; - - enum hostapd_logger_level logger_syslog_level, logger_stdout_level; - ---- a/hostapd/config_file.c -+++ b/hostapd/config_file.c -@@ -1193,6 +1193,8 @@ struct hostapd_config * hostapd_config_r - sizeof(conf->bss[0].iface)); - } else if (os_strcmp(buf, "bridge") == 0) { - os_strlcpy(bss->bridge, pos, sizeof(bss->bridge)); -+ } else if (os_strcmp(buf, "wds_bridge") == 0) { -+ os_strlcpy(bss->wds_bridge, pos, sizeof(bss->wds_bridge)); - } else if (os_strcmp(buf, "driver") == 0) { - int j; - /* clear to get error below if setting is invalid */ ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -4642,7 +4642,8 @@ static int i802_set_sta_vlan(void *priv, - } - - --static int i802_set_wds_sta(void *priv, const u8 *addr, int aid, int val) -+static int i802_set_wds_sta(void *priv, const u8 *addr, int aid, int val, -+ const char *bridge_ifname) - { - struct i802_bss *bss = priv; - struct wpa_driver_nl80211_data *drv = bss->drv; -@@ -4656,6 +4657,10 @@ static int i802_set_wds_sta(void *priv, - if (nl80211_create_iface(drv, name, NL80211_IFTYPE_AP_VLAN, - NULL, 1) < 0) - return -1; -+ if (bridge_ifname) { -+ if (linux_br_add_if(drv->ioctl_sock, bridge_ifname, name) < 0) -+ return -1; -+ } - } - linux_set_iface_flags(drv->ioctl_sock, name, 1); - return i802_set_sta_vlan(priv, addr, name, 0); ---- a/src/ap/ap_drv_ops.c -+++ b/src/ap/ap_drv_ops.c -@@ -265,9 +265,15 @@ static int hostapd_vlan_if_remove(struct - static int hostapd_set_wds_sta(struct hostapd_data *hapd, const u8 *addr, - int aid, int val) - { -+ const char *bridge = NULL; -+ - if (hapd->driver == NULL || hapd->driver->set_wds_sta == NULL) - return 0; -- return hapd->driver->set_wds_sta(hapd->drv_priv, addr, aid, val); -+ if (hapd->conf->wds_bridge[0]) -+ bridge = hapd->conf->wds_bridge; -+ else if (hapd->conf->bridge[0]) -+ bridge = hapd->conf->bridge; -+ return hapd->driver->set_wds_sta(hapd->drv_priv, addr, aid, val, bridge); - } - - ---- a/src/drivers/driver.h -+++ b/src/drivers/driver.h -@@ -1622,7 +1622,8 @@ struct wpa_driver_ops { - * @val: 1 = bind to 4-address WDS; 0 = unbind - * Returns: 0 on success, -1 on failure - */ -- int (*set_wds_sta)(void *priv, const u8 *addr, int aid, int val); -+ int (*set_wds_sta)(void *priv, const u8 *addr, int aid, int val, -+ const char *bridge_ifname); - - /** - * send_action - Transmit an Action frame diff --git a/package/hostapd/patches/370-basic_rates.patch b/package/hostapd/patches/370-basic_rates.patch deleted file mode 100644 index 6c3fafe83..000000000 --- a/package/hostapd/patches/370-basic_rates.patch +++ /dev/null @@ -1,70 +0,0 @@ ---- a/src/ap/hostapd.c -+++ b/src/ap/hostapd.c -@@ -716,6 +716,16 @@ int hostapd_setup_interface_complete(str - } - } - -+ if (iface->current_mode) { -+ if (hostapd_prepare_rates(hapd, iface->current_mode)) { -+ wpa_printf(MSG_ERROR, "Failed to prepare rates table."); -+ hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211, -+ HOSTAPD_LEVEL_WARNING, -+ "Failed to prepare rates table."); -+ return -1; -+ } -+ } -+ - if (hapd->iconf->rts_threshold > -1 && - hostapd_set_rts(hapd, hapd->iconf->rts_threshold)) { - wpa_printf(MSG_ERROR, "Could not set RTS threshold for " ---- a/src/ap/hw_features.c -+++ b/src/ap/hw_features.c -@@ -101,8 +101,8 @@ int hostapd_get_hw_features(struct hosta - } - - --static int hostapd_prepare_rates(struct hostapd_data *hapd, -- struct hostapd_hw_modes *mode) -+int hostapd_prepare_rates(struct hostapd_data *hapd, -+ struct hostapd_hw_modes *mode) - { - int i, num_basic_rates = 0; - int basic_rates_a[] = { 60, 120, 240, -1 }; -@@ -668,14 +668,6 @@ int hostapd_select_hw_mode(struct hostap - return -1; - } - -- if (hostapd_prepare_rates(iface->bss[0], iface->current_mode)) { -- wpa_printf(MSG_ERROR, "Failed to prepare rates table."); -- hostapd_logger(iface->bss[0], NULL, HOSTAPD_MODULE_IEEE80211, -- HOSTAPD_LEVEL_WARNING, -- "Failed to prepare rates table."); -- return -1; -- } -- - return 0; - } - ---- a/src/ap/hw_features.h -+++ b/src/ap/hw_features.h -@@ -25,6 +25,8 @@ const char * hostapd_hw_mode_txt(int mod - int hostapd_hw_get_freq(struct hostapd_data *hapd, int chan); - int hostapd_hw_get_channel(struct hostapd_data *hapd, int freq); - int hostapd_check_ht_capab(struct hostapd_iface *iface); -+int hostapd_prepare_rates(struct hostapd_data *hapd, -+ struct hostapd_hw_modes *mode); - #else /* NEED_AP_MLME */ - static inline void - hostapd_free_hw_features(struct hostapd_hw_modes *hw_features, -@@ -56,6 +58,11 @@ static inline int hostapd_check_ht_capab - { - return 0; - } -+static inline int hostapd_prepare_rates(struct hostapd_data *hapd, -+ struct hostapd_hw_modes *mode) -+{ -+ return 0; -+} - - #endif /* NEED_AP_MLME */ - diff --git a/package/hostapd/patches/380-ap_isolate.patch b/package/hostapd/patches/380-ap_isolate.patch deleted file mode 100644 index 12fbdc86b..000000000 --- a/package/hostapd/patches/380-ap_isolate.patch +++ /dev/null @@ -1,108 +0,0 @@ ---- a/hostapd/config_file.c -+++ b/hostapd/config_file.c -@@ -1266,6 +1266,8 @@ struct hostapd_config * hostapd_config_r - } - } else if (os_strcmp(buf, "wds_sta") == 0) { - bss->wds_sta = atoi(pos); -+ } else if (os_strcmp(buf, "ap_isolate") == 0) { -+ bss->isolate = atoi(pos); - } else if (os_strcmp(buf, "ap_max_inactivity") == 0) { - bss->ap_max_inactivity = atoi(pos); - } else if (os_strcmp(buf, "country_code") == 0) { ---- a/src/ap/ap_config.h -+++ b/src/ap/ap_config.h -@@ -199,6 +199,7 @@ struct hostapd_bss_config { - struct mac_acl_entry *deny_mac; - int num_deny_mac; - int wds_sta; -+ int isolate; - - int auth_algs; /* bitfield of allowed IEEE 802.11 authentication - * algorithms, WPA_AUTH_ALG_{OPEN,SHARED,LEAP} */ ---- a/src/drivers/driver.h -+++ b/src/drivers/driver.h -@@ -1626,6 +1626,14 @@ struct wpa_driver_ops { - const char *bridge_ifname); - - /** -+ * set_ap_isolate - Enable/disable AP isolation -+ * @priv: private driver interface data -+ * @val: 1 = enabled; 0 = disabled -+ * Returns: 0 on success, -1 on failure -+ */ -+ int (*set_ap_isolate)(void *priv, int val); -+ -+ /** - * send_action - Transmit an Action frame - * @priv: Private driver interface data - * @freq: Frequency (in MHz) of the channel ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -4339,6 +4339,29 @@ static int i802_set_rate_sets(void *priv - return -ENOBUFS; - } - -+static int i802_set_ap_isolate(void *priv, int val) -+{ -+ struct i802_bss *bss = priv; -+ struct wpa_driver_nl80211_data *drv = bss->drv; -+ struct nl_msg *msg; -+ int i; -+ -+ msg = nlmsg_alloc(); -+ if (!msg) -+ return -ENOMEM; -+ -+ genlmsg_put(msg, 0, 0, genl_family_get_id(drv->nl80211), 0, 0, -+ NL80211_CMD_SET_BSS, 0); -+ -+ NLA_PUT_U8(msg, NL80211_ATTR_AP_ISOLATE, !!val); -+ -+ NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, if_nametoindex(bss->ifname)); -+ -+ return send_and_recv_msgs(drv, msg, NULL, NULL); -+ nla_put_failure: -+ return -ENOBUFS; -+} -+ - #endif /* HOSTAPD */ - - -@@ -5448,6 +5471,7 @@ const struct wpa_driver_ops wpa_driver_n - .set_tx_queue_params = i802_set_tx_queue_params, - .set_sta_vlan = i802_set_sta_vlan, - .set_wds_sta = i802_set_wds_sta, -+ .set_ap_isolate = i802_set_ap_isolate, - #endif /* HOSTAPD */ - .set_freq = i802_set_freq, - .send_action = wpa_driver_nl80211_send_action, ---- a/src/ap/ap_drv_ops.c -+++ b/src/ap/ap_drv_ops.c -@@ -180,6 +180,14 @@ static int hostapd_set_radius_acl_expire - } - - -+static int hostapd_set_ap_isolate(struct hostapd_data *hapd, int value) -+{ -+ if (hapd->driver == NULL || hapd->driver->set_ap_isolate == NULL) -+ return 0; -+ hapd->driver->set_ap_isolate(hapd->drv_priv, value); -+} -+ -+ - static int hostapd_set_bss_params(struct hostapd_data *hapd, - int use_protection) - { -@@ -229,6 +237,12 @@ static int hostapd_set_bss_params(struct - "driver"); - ret = -1; - } -+ if (hostapd_set_ap_isolate(hapd, hapd->conf->isolate) && -+ !hapd->conf->isolate) { -+ wpa_printf(MSG_ERROR, "Could not enable AP isolation in " -+ "kernel driver"); -+ ret = -1; -+ } - - return ret; - } diff --git a/package/hostapd/patches/400-nl80211_sta_auth.patch b/package/hostapd/patches/400-nl80211_sta_auth.patch deleted file mode 100644 index 41c68c093..000000000 --- a/package/hostapd/patches/400-nl80211_sta_auth.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- a/wpa_supplicant/wpa_supplicant.c -+++ b/wpa_supplicant/wpa_supplicant.c -@@ -545,10 +545,16 @@ void wpa_supplicant_set_state(struct wpa - wpa_s->reassociated_connection = 1; - wpa_drv_set_operstate(wpa_s, 1); - wpa_s->after_wps = 0; -+#ifndef IEEE8021X_EAPOL -+ wpa_drv_set_supp_port(wpa_s, 1); -+#endif - } else if (state == WPA_DISCONNECTED || state == WPA_ASSOCIATING || - state == WPA_ASSOCIATED) { - wpa_s->new_connection = 1; - wpa_drv_set_operstate(wpa_s, 0); -+#ifndef IEEE8021X_EAPOL -+ wpa_drv_set_supp_port(wpa_s, 0); -+#endif - } - wpa_s->wpa_state = state; - diff --git a/package/hostapd/patches/420-stbc_fix_backport.patch b/package/hostapd/patches/420-stbc_fix_backport.patch deleted file mode 100644 index 89998d9fc..000000000 --- a/package/hostapd/patches/420-stbc_fix_backport.patch +++ /dev/null @@ -1,39 +0,0 @@ -From: Helmut Schaa -Date: Sat, 28 Aug 2010 09:25:44 +0000 (+0300) -Subject: hostapd: enable STBC only for STBC capable STAs -X-Git-Url: http://hostap.epitest.fi/gitweb/gitweb.cgi?p=hostap.git;a=commitdiff_plain;h=36af1c7d31bdc5ba4dacacbf32d3c7585665ae2b - -hostapd: enable STBC only for STBC capable STAs - -hostapd simply used its own STBC configuration in the STA's HT caps. This -resulted in TX STBC being used for STAs not supporting RX STBC, which in -turn resulted in the STA not receiving anything. - -Fix this by handling the STBC flags in the same way mac80211 does. Mask -out RX STBC if we don't support TX STBC and vice versa. - -Tested only with the nl80211 driver and a STBC incapable STA. - -Signed-off-by: Helmut Schaa ---- - ---- a/src/ap/ieee802_11_ht.c -+++ b/src/ap/ieee802_11_ht.c -@@ -256,7 +256,15 @@ void hostapd_get_ht_capab(struct hostapd - cap &= hapd->iconf->ht_capab; - cap |= (hapd->iconf->ht_capab & HT_CAP_INFO_SMPS_DISABLED); - -- /* FIXME: Rx STBC needs to be handled specially */ -- cap |= (hapd->iconf->ht_capab & HT_CAP_INFO_RX_STBC_MASK); -+ /* -+ * STBC needs to be handled specially -+ * if we don't support RX STBC, mask out TX STBC in the STA's HT caps -+ * if we don't support TX STBC, mask out RX STBC in the STA's HT caps -+ */ -+ if (!(hapd->iconf->ht_capab & HT_CAP_INFO_RX_STBC_MASK)) -+ cap &= ~HT_CAP_INFO_TX_STBC; -+ if (!(hapd->iconf->ht_capab & HT_CAP_INFO_TX_STBC)) -+ cap &= ~HT_CAP_INFO_RX_STBC_MASK; -+ - neg_ht_cap->ht_capabilities_info = host_to_le16(cap); - } diff --git a/package/hostapd/patches/440-mbss_reload_fix.patch b/package/hostapd/patches/440-mbss_reload_fix.patch deleted file mode 100644 index ed513b1f1..000000000 --- a/package/hostapd/patches/440-mbss_reload_fix.patch +++ /dev/null @@ -1,89 +0,0 @@ ---- a/src/ap/hostapd.c -+++ b/src/ap/hostapd.c -@@ -42,37 +42,8 @@ static int hostapd_setup_encryption(char - - extern int wpa_debug_level; - -- --int hostapd_reload_config(struct hostapd_iface *iface) -+static int hostapd_reload_bss(struct hostapd_data *hapd) - { -- struct hostapd_data *hapd = iface->bss[0]; -- struct hostapd_config *newconf, *oldconf; -- size_t j; -- -- if (iface->config_read_cb == NULL) -- return -1; -- newconf = iface->config_read_cb(iface->config_fname); -- if (newconf == NULL) -- return -1; -- -- /* -- * Deauthenticate all stations since the new configuration may not -- * allow them to use the BSS anymore. -- */ -- for (j = 0; j < iface->num_bss; j++) -- hostapd_flush_old_stations(iface->bss[j]); -- --#ifndef CONFIG_NO_RADIUS -- /* TODO: update dynamic data based on changed configuration -- * items (e.g., open/close sockets, etc.) */ -- radius_client_flush(hapd->radius, 0); --#endif /* CONFIG_NO_RADIUS */ -- -- oldconf = hapd->iconf; -- hapd->iconf = newconf; -- hapd->conf = &newconf->bss[0]; -- iface->conf = newconf; -- - if (hostapd_setup_wpa_psk(hapd->conf)) { - wpa_printf(MSG_ERROR, "Failed to re-configure WPA PSK " - "after reloading configuration"); -@@ -110,10 +81,46 @@ int hostapd_reload_config(struct hostapd - wpa_printf(MSG_ERROR, "Could not set SSID for kernel driver"); - /* try to continue */ - } -+ wpa_printf(MSG_DEBUG, "Reconfigured interface %s", hapd->conf->iface); -+} -+ -+int hostapd_reload_config(struct hostapd_iface *iface) -+{ -+ struct hostapd_data *hapd = iface->bss[0]; -+ struct hostapd_config *newconf, *oldconf; -+ size_t j; -+ -+ if (iface->config_read_cb == NULL) -+ return -1; -+ newconf = iface->config_read_cb(iface->config_fname); -+ if (newconf == NULL) -+ return -1; -+ -+ /* -+ * Deauthenticate all stations since the new configuration may not -+ * allow them to use the BSS anymore. -+ */ -+ for (j = 0; j < iface->num_bss; j++) -+ hostapd_flush_old_stations(iface->bss[j]); -+ -+#ifndef CONFIG_NO_RADIUS -+ /* TODO: update dynamic data based on changed configuration -+ * items (e.g., open/close sockets, etc.) */ -+ radius_client_flush(hapd->radius, 0); -+#endif /* CONFIG_NO_RADIUS */ -+ -+ oldconf = hapd->iconf; -+ iface->conf = newconf; -+ -+ for (j = 0; j < iface->num_bss; j++) { -+ hapd = iface->bss[j]; -+ hapd->iconf = newconf; -+ hapd->conf = &newconf->bss[j]; -+ hostapd_reload_bss(hapd); -+ } - - hostapd_config_free(oldconf); - -- wpa_printf(MSG_DEBUG, "Reconfigured interface %s", hapd->conf->iface); - - return 0; - } diff --git a/package/hostapd/patches/460-oper_state_fix.patch b/package/hostapd/patches/460-oper_state_fix.patch deleted file mode 100644 index 5a685a23e..000000000 --- a/package/hostapd/patches/460-oper_state_fix.patch +++ /dev/null @@ -1,25 +0,0 @@ -From: Jouni Malinen -Date: Tue, 26 Oct 2010 13:30:28 +0000 (+0300) -Subject: hostapd: Set operstate UP when initializing AP mode -X-Git-Url: http://w1.fi/gitweb/gitweb.cgi?p=hostap.git;a=commitdiff_plain;h=e11f5a2cbc333113a3a1cc1aeea7f698c3936ca3 - -hostapd: Set operstate UP when initializing AP mode - -This is needed to avoid problems with other applications setting and -leaving the interface to IF_OPER_DORMANT state. In AP mode, the interface -is ready immediately after the keys are set, so we better make sure the -DORMANT state does not prevent normal operations after that. ---- - ---- a/src/ap/hostapd.c -+++ b/src/ap/hostapd.c -@@ -622,6 +622,9 @@ static int hostapd_setup_bss(struct host - - ieee802_11_set_beacon(hapd); - -+ if (hapd->driver && hapd->driver->set_operstate) -+ hapd->driver->set_operstate(hapd->drv_priv, 1); -+ - return 0; - } - diff --git a/package/hostapd/patches/130-scan_wait.patch b/package/hostapd/patches/500-scan_wait.patch similarity index 87% rename from package/hostapd/patches/130-scan_wait.patch rename to package/hostapd/patches/500-scan_wait.patch index 1f249533f..14dccc326 100644 --- a/package/hostapd/patches/130-scan_wait.patch +++ b/package/hostapd/patches/500-scan_wait.patch @@ -1,6 +1,6 @@ --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h -@@ -245,6 +245,7 @@ struct hostapd_iface { +@@ -228,6 +228,7 @@ struct hostapd_iface { int (*for_each_interface)(struct hapd_interfaces *interfaces, int (*cb)(struct hostapd_iface *iface, void *ctx), void *ctx); @@ -10,7 +10,7 @@ /* hostapd.c */ --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -755,6 +755,9 @@ int hostapd_setup_interface_complete(str +@@ -790,6 +790,9 @@ int hostapd_setup_interface_complete(str wpa_printf(MSG_DEBUG, "%s: Setup of interface done.", iface->bss[0]->conf->iface); @@ -86,17 +86,17 @@ eloop_run(); return 0; -@@ -479,8 +485,7 @@ int main(int argc, char *argv[]) +@@ -491,8 +497,7 @@ int main(int argc, char *argv[]) struct hapd_interfaces interfaces; int ret = 1; size_t i; - int c, debug = 0, daemonize = 0; - char *pid_file = NULL; + int c, debug = 0; + const char *log_file = NULL; if (os_program_init()) - return -1; -@@ -545,7 +550,7 @@ int main(int argc, char *argv[]) +@@ -566,7 +571,7 @@ int main(int argc, char *argv[]) goto out; } @@ -105,7 +105,7 @@ goto out; ret = 0; -@@ -556,7 +561,7 @@ int main(int argc, char *argv[]) +@@ -577,7 +582,7 @@ int main(int argc, char *argv[]) hostapd_interface_deinit_free(interfaces.iface[i]); os_free(interfaces.iface); @@ -113,10 +113,10 @@ + hostapd_global_deinit(); os_free(pid_file); - os_program_deinit(); + if (log_file) --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -1857,6 +1857,8 @@ struct hostapd_config * hostapd_config_r +@@ -1891,6 +1891,8 @@ struct hostapd_config * hostapd_config_r } #endif /* CONFIG_IEEE80211W */ #ifdef CONFIG_IEEE80211N @@ -127,17 +127,17 @@ } else if (os_strcmp(buf, "ht_capab") == 0) { --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -369,6 +369,7 @@ struct hostapd_config { +@@ -389,6 +389,7 @@ struct hostapd_config { int ht_op_mode_fixed; u16 ht_capab; + int noscan; int ieee80211n; int secondary_channel; - }; + int require_ht; --- a/src/ap/hw_features.c +++ b/src/ap/hw_features.c -@@ -460,7 +460,7 @@ static int ieee80211n_check_40mhz(struct +@@ -463,7 +463,7 @@ static int ieee80211n_check_40mhz(struct { struct wpa_driver_scan_params params; diff --git a/package/hostapd/patches/200-multicall.patch b/package/hostapd/patches/510-multicall.patch similarity index 72% rename from package/hostapd/patches/200-multicall.patch rename to package/hostapd/patches/510-multicall.patch index a35b5c8d3..e705792cd 100644 --- a/package/hostapd/patches/200-multicall.patch +++ b/package/hostapd/patches/510-multicall.patch @@ -8,7 +8,7 @@ ifndef CONFIG_OS ifdef CONFIG_NATIVE_WINDOWS -@@ -157,10 +158,14 @@ ifdef CONFIG_IEEE80211N +@@ -159,10 +160,14 @@ ifdef CONFIG_IEEE80211N CFLAGS += -DCONFIG_IEEE80211N endif @@ -26,7 +26,7 @@ LIBS += $(DRV_AP_LIBS) ifdef CONFIG_L2_PACKET -@@ -739,6 +744,12 @@ install: all +@@ -780,6 +785,12 @@ install: all BCHECK=../src/drivers/build.hostapd @@ -37,9 +37,9 @@ + @$(AR) cr $@ hostapd_multi.o $(OBJS) + hostapd: $(BCHECK) $(OBJS) - $(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS) - -@@ -777,6 +788,12 @@ HOBJS += ../src/crypto/aes-internal.o + $(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS) + @$(E) " LD " $@ +@@ -820,6 +831,12 @@ HOBJS += ../src/crypto/aes-internal.o HOBJS += ../src/crypto/aes-internal-enc.o endif @@ -50,19 +50,19 @@ + @echo -n $(LDFLAGS) $(LIBS) $(EXTRALIBS) " " + nt_password_hash: $(NOBJS) - $(CC) $(LDFLAGS) -o nt_password_hash $(NOBJS) $(LIBS_n) - + $(Q)$(CC) $(LDFLAGS) -o nt_password_hash $(NOBJS) $(LIBS_n) + @$(E) " LD " $@ --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile -@@ -52,6 +52,7 @@ OBJS_p += ../src/utils/wpabuf.o - OBJS_c = wpa_cli.o ../src/common/wpa_ctrl.o +@@ -53,6 +53,7 @@ OBJS_c = wpa_cli.o ../src/common/wpa_ctr + OBJS_c += ../src/utils/wpa_debug.o -include .config +-include $(if $(MULTICALL),../hostapd/.config) ifndef CONFIG_OS ifdef CONFIG_NATIVE_WINDOWS -@@ -581,6 +582,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS +@@ -634,6 +635,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS LIBS += -ldl -rdynamic endif @@ -73,7 +73,19 @@ endif ifdef CONFIG_AP -@@ -635,6 +640,12 @@ CFLAGS += -DEAP_SERVER_WSC +@@ -642,9 +647,11 @@ NEED_EAP_COMMON=y + NEED_RSN_AUTHENTICATOR=y + CFLAGS += -DCONFIG_AP + OBJS += ap.o ++ifndef MULTICALL + CFLAGS += -DCONFIG_NO_RADIUS + CFLAGS += -DCONFIG_NO_ACCOUNTING + CFLAGS += -DCONFIG_NO_VLAN ++endif + OBJS += ../src/ap/hostapd.o + OBJS += ../src/ap/wpa_auth_glue.o + OBJS += ../src/ap/utils.o +@@ -688,10 +695,18 @@ CFLAGS += -DEAP_SERVER_WSC OBJS += ../src/ap/wps_hostapd.o OBJS += ../src/eap_server/eap_server_wsc.o endif @@ -86,9 +98,15 @@ endif ifdef NEED_RSN_AUTHENTICATOR -@@ -1270,6 +1281,12 @@ BCHECK=../src/drivers/build.wpa_supplica - wpa_priv: $(BCHECK) $(OBJS_priv) - $(LDO) $(LDFLAGS) -o wpa_priv $(OBJS_priv) $(LIBS) ++ifndef MULTICALL + CFLAGS += -DCONFIG_NO_RADIUS ++endif + NEED_AES_WRAP=y + OBJS += ../src/ap/wpa_auth.o + OBJS += ../src/ap/wpa_auth_ie.o +@@ -1352,6 +1367,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv) + $(Q)$(LDO) $(LDFLAGS) -o wpa_priv $(OBJS_priv) $(LIBS) + @$(E) " LD " $@ +wpa_supplicant_multi.a: .config $(BCHECK) $(OBJS) $(EXTRA_progs) + $(Q)$(CC) -c -o wpa_supplicant_multi.o -Dmain=wpa_supplicant_main $(CFLAGS) main.c @@ -97,9 +115,9 @@ + @$(AR) cr $@ wpa_supplicant_multi.o $(OBJS) + wpa_supplicant: .config $(BCHECK) $(OBJS) $(EXTRA_progs) - $(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS) - -@@ -1329,6 +1346,12 @@ endif + $(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS) + @$(E) " LD " $@ +@@ -1412,6 +1433,12 @@ eap_ikev2.so: ../src/eap_peer/eap_ikev2. $(Q)$(CC) -c -o $@ $(CFLAGS) $< @$(E) " CC " $< @@ -114,7 +132,7 @@ wpa_cli.exe: wpa_cli --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -2465,8 +2465,8 @@ union wpa_event_data { +@@ -3169,8 +3169,8 @@ union wpa_event_data { * Driver wrapper code should call this function whenever an event is received * from the driver. */ @@ -127,7 +145,7 @@ /* --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c -@@ -375,8 +375,8 @@ static void hostapd_event_eapol_rx(struc +@@ -443,8 +443,8 @@ static void hostapd_event_eapol_rx(struc } @@ -138,14 +156,6 @@ { struct hostapd_data *hapd = ctx; -@@ -453,5 +453,6 @@ void wpa_supplicant_event(void *ctx, enu - break; - } - } -- - #endif /* HOSTAPD */ -+ -+ --- a/wpa_supplicant/wpa_priv.c +++ b/wpa_supplicant/wpa_priv.c @@ -825,8 +825,8 @@ static void wpa_priv_send_ft_response(st @@ -169,8 +179,8 @@ for (;;) { --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c -@@ -1582,8 +1582,8 @@ static void ft_rx_action(struct wpa_supp - #endif /* CONFIG_IEEE80211R */ +@@ -1718,8 +1718,8 @@ static void wpa_supplicant_event_unprot_ + } -void wpa_supplicant_event(void *ctx, enum wpa_event_type event, @@ -182,8 +192,8 @@ u16 reason_code = 0; --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2228,6 +2228,9 @@ struct wpa_supplicant * wpa_supplicant_g - return NULL; +@@ -2313,6 +2313,9 @@ static void wpa_supplicant_deinit_iface( + wpa_drv_deinit(wpa_s); } +extern void supplicant_event(void *ctx, enum wpa_event_type event, @@ -191,10 +201,10 @@ + /** - * wpa_supplicant_init - Initialize %wpa_supplicant -@@ -2246,6 +2249,7 @@ struct wpa_global * wpa_supplicant_init( - if (params == NULL) - return NULL; + * wpa_supplicant_add_iface - Add a new network interface +@@ -2496,6 +2499,7 @@ struct wpa_global * wpa_supplicant_init( + wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb); + #endif /* CONFIG_NO_WPA_MSG */ + wpa_supplicant_event = supplicant_event; wpa_debug_open_file(params->wpa_debug_file_path); @@ -202,8 +212,8 @@ wpa_debug_open_syslog(); --- a/hostapd/main.c +++ b/hostapd/main.c -@@ -479,6 +479,9 @@ static void usage(void) - exit(1); +@@ -491,6 +491,9 @@ static const char * hostapd_msg_ifname_c + return NULL; } +void hostapd_wpa_event(void *ctx, enum wpa_event_type event, @@ -212,13 +222,13 @@ int main(int argc, char *argv[]) { -@@ -490,6 +493,7 @@ int main(int argc, char *argv[]) +@@ -503,6 +506,7 @@ int main(int argc, char *argv[]) if (os_program_init()) return -1; + wpa_supplicant_event = hostapd_wpa_event; for (;;) { - c = getopt(argc, argv, "BdhKP:tv"); + c = getopt(argc, argv, "Bdf:hKP:tv"); if (c < 0) --- a/src/drivers/drivers.c +++ b/src/drivers/drivers.c diff --git a/package/hostapd/patches/300-timestamp_check.patch b/package/hostapd/patches/520-timestamp_check.patch similarity index 100% rename from package/hostapd/patches/300-timestamp_check.patch rename to package/hostapd/patches/520-timestamp_check.patch diff --git a/package/hostapd/patches/320-rescan_immediately.patch b/package/hostapd/patches/530-rescan_immediately.patch similarity index 51% rename from package/hostapd/patches/320-rescan_immediately.patch rename to package/hostapd/patches/530-rescan_immediately.patch index 19183040a..b6efbb8d0 100644 --- a/package/hostapd/patches/320-rescan_immediately.patch +++ b/package/hostapd/patches/530-rescan_immediately.patch @@ -1,11 +1,11 @@ --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c -@@ -963,7 +963,7 @@ static void wpa_supplicant_event_scan_re - wpa_printf(MSG_DEBUG, "Setup a new network"); +@@ -953,7 +953,7 @@ static int _wpa_supplicant_event_scan_re + wpa_dbg(wpa_s, MSG_DEBUG, "Setup a new network"); wpa_supplicant_associate(wpa_s, NULL, ssid); } else { - int timeout_sec = 5; + int timeout_sec = 0; int timeout_usec = 0; - wpa_supplicant_req_new_scan(wpa_s, timeout_sec, - timeout_usec); + #ifdef CONFIG_P2P + if (wpa_s->p2p_in_provisioning) { diff --git a/package/hostapd/patches/410-no_rfkill.patch b/package/hostapd/patches/540-optional_rfkill.patch similarity index 70% rename from package/hostapd/patches/410-no_rfkill.patch rename to package/hostapd/patches/540-optional_rfkill.patch index f7e8bc057..dd460835c 100644 --- a/package/hostapd/patches/410-no_rfkill.patch +++ b/package/hostapd/patches/540-optional_rfkill.patch @@ -1,6 +1,6 @@ --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -75,7 +75,9 @@ struct wpa_driver_nl80211_data { +@@ -129,7 +129,9 @@ struct wpa_driver_nl80211_data { int ifindex; int if_removed; int if_disabled; @@ -10,7 +10,7 @@ struct wpa_driver_capa capa; int has_capability; -@@ -1361,7 +1363,7 @@ err1: +@@ -1750,7 +1752,7 @@ err1: return -1; } @@ -19,15 +19,15 @@ static void wpa_driver_nl80211_rfkill_blocked(void *ctx) { wpa_printf(MSG_DEBUG, "nl80211: RFKILL blocked"); -@@ -1383,6 +1385,7 @@ static void wpa_driver_nl80211_rfkill_un +@@ -1772,6 +1774,7 @@ static void wpa_driver_nl80211_rfkill_un } /* rtnetlink ifup handler will report interface as enabled */ } +#endif /* CONFIG_RFKILL */ - /** -@@ -1396,7 +1399,9 @@ static void * wpa_driver_nl80211_init(vo + static void nl80211_get_phy_name(struct wpa_driver_nl80211_data *drv) +@@ -1820,7 +1823,9 @@ static void * wpa_driver_nl80211_init(vo { struct wpa_driver_nl80211_data *drv; struct netlink_config *cfg; @@ -37,7 +37,7 @@ struct i802_bss *bss; drv = os_zalloc(sizeof(*drv)); -@@ -1434,6 +1439,7 @@ static void * wpa_driver_nl80211_init(vo +@@ -1863,6 +1868,7 @@ static void * wpa_driver_nl80211_init(vo goto failed; } @@ -45,7 +45,7 @@ rcfg = os_zalloc(sizeof(*rcfg)); if (rcfg == NULL) goto failed; -@@ -1446,6 +1452,7 @@ static void * wpa_driver_nl80211_init(vo +@@ -1875,6 +1881,7 @@ static void * wpa_driver_nl80211_init(vo wpa_printf(MSG_DEBUG, "nl80211: RFKILL status not available"); os_free(rcfg); } @@ -53,7 +53,7 @@ if (wpa_driver_nl80211_finish_drv_init(drv)) goto failed; -@@ -1453,7 +1460,9 @@ static void * wpa_driver_nl80211_init(vo +@@ -1882,7 +1889,9 @@ static void * wpa_driver_nl80211_init(vo return bss; failed: @@ -63,7 +63,7 @@ netlink_deinit(drv->netlink); if (drv->ioctl_sock >= 0) close(drv->ioctl_sock); -@@ -1514,10 +1523,12 @@ static int nl80211_register_action_frame +@@ -1985,10 +1994,12 @@ static int nl80211_register_action_frame } @@ -76,7 +76,7 @@ static int -@@ -1536,13 +1547,16 @@ wpa_driver_nl80211_finish_drv_init(struc +@@ -2007,13 +2018,16 @@ wpa_driver_nl80211_finish_drv_init(struc } if (linux_set_iface_flags(drv->ioctl_sock, bss->ifname, 1)) { @@ -94,7 +94,7 @@ wpa_printf(MSG_ERROR, "nl80211: Could not set " "interface '%s' UP", bss->ifname); return -1; -@@ -1567,8 +1581,10 @@ wpa_driver_nl80211_finish_drv_init(struc +@@ -2041,8 +2055,10 @@ wpa_driver_nl80211_finish_drv_init(struc } if (send_rfkill_event) { @@ -105,7 +105,7 @@ } return 0; -@@ -1647,7 +1663,9 @@ static void wpa_driver_nl80211_deinit(vo +@@ -2123,7 +2139,9 @@ static void wpa_driver_nl80211_deinit(vo netlink_send_oper_ifla(drv->netlink, drv->ifindex, 0, IF_OPER_UP); netlink_deinit(drv->netlink); @@ -115,9 +115,19 @@ eloop_cancel_timeout(wpa_driver_nl80211_scan_timeout, drv, drv->ctx); +@@ -5672,7 +5690,9 @@ static void *i802_init(struct hostapd_da + + failed: + nl80211_remove_monitor_interface(drv); ++#ifdef CONFIG_RFKILL + rfkill_deinit(drv->rfkill); ++#endif + netlink_deinit(drv->netlink); + if (drv->ioctl_sock >= 0) + close(drv->ioctl_sock); --- a/src/drivers/driver_wext.c +++ b/src/drivers/driver_wext.c -@@ -700,7 +700,7 @@ static void wpa_driver_wext_event_rtm_de +@@ -702,7 +702,7 @@ static void wpa_driver_wext_event_rtm_de } } @@ -126,16 +136,16 @@ static void wpa_driver_wext_rfkill_blocked(void *ctx) { wpa_printf(MSG_DEBUG, "WEXT: RFKILL blocked"); -@@ -722,7 +722,7 @@ static void wpa_driver_wext_rfkill_unblo +@@ -724,7 +724,7 @@ static void wpa_driver_wext_rfkill_unblo } /* rtnetlink ifup handler will report interface as enabled */ } - +#endif /* CONFIG_RFKILL */ - /** - * wpa_driver_wext_init - Initialize WE driver interface -@@ -735,7 +735,9 @@ void * wpa_driver_wext_init(void *ctx, c + static void wext_get_phy_name(struct wpa_driver_wext_data *drv) + { +@@ -770,7 +770,9 @@ void * wpa_driver_wext_init(void *ctx, c { struct wpa_driver_wext_data *drv; struct netlink_config *cfg; @@ -145,7 +155,7 @@ char path[128]; struct stat buf; -@@ -769,6 +771,7 @@ void * wpa_driver_wext_init(void *ctx, c +@@ -805,6 +807,7 @@ void * wpa_driver_wext_init(void *ctx, c goto err2; } @@ -153,7 +163,7 @@ rcfg = os_zalloc(sizeof(*rcfg)); if (rcfg == NULL) goto err3; -@@ -781,6 +784,7 @@ void * wpa_driver_wext_init(void *ctx, c +@@ -817,6 +820,7 @@ void * wpa_driver_wext_init(void *ctx, c wpa_printf(MSG_DEBUG, "WEXT: RFKILL status not available"); os_free(rcfg); } @@ -161,7 +171,7 @@ drv->mlme_sock = -1; -@@ -792,7 +796,9 @@ void * wpa_driver_wext_init(void *ctx, c +@@ -828,7 +832,9 @@ void * wpa_driver_wext_init(void *ctx, c return drv; err3: @@ -171,7 +181,7 @@ netlink_deinit(drv->netlink); err2: close(drv->ioctl_sock); -@@ -802,10 +808,12 @@ err1: +@@ -838,10 +844,12 @@ err1: } @@ -184,7 +194,7 @@ static int wpa_driver_wext_finish_drv_init(struct wpa_driver_wext_data *drv) -@@ -813,13 +821,16 @@ static int wpa_driver_wext_finish_drv_in +@@ -849,13 +857,16 @@ static int wpa_driver_wext_finish_drv_in int send_rfkill_event = 0; if (linux_set_iface_flags(drv->ioctl_sock, drv->ifname, 1) < 0) { @@ -202,7 +212,7 @@ wpa_printf(MSG_ERROR, "WEXT: Could not set " "interface '%s' UP", drv->ifname); return -1; -@@ -867,8 +878,10 @@ static int wpa_driver_wext_finish_drv_in +@@ -903,8 +914,10 @@ static int wpa_driver_wext_finish_drv_in 1, IF_OPER_DORMANT); if (send_rfkill_event) { @@ -213,7 +223,7 @@ } return 0; -@@ -898,7 +911,9 @@ void wpa_driver_wext_deinit(void *priv) +@@ -934,7 +947,9 @@ void wpa_driver_wext_deinit(void *priv) netlink_send_oper_ifla(drv->netlink, drv->ifindex, 0, IF_OPER_UP); netlink_deinit(drv->netlink); @@ -225,23 +235,31 @@ eloop_unregister_read_sock(drv->mlme_sock); --- a/src/drivers/drivers.mak +++ b/src/drivers/drivers.mak -@@ -31,7 +31,6 @@ NEED_SME=y +@@ -43,7 +43,6 @@ NEED_SME=y NEED_AP_MLME=y NEED_NETLINK=y NEED_LINUX_IOCTL=y -NEED_RFKILL=y - DRV_LIBS += -lnl - - ifdef CONFIG_LIBNL20 -@@ -78,7 +77,6 @@ DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT + ifdef CONFIG_LIBNL_TINY + DRV_LIBS += -lnl-tiny + else +@@ -94,7 +93,6 @@ DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT CONFIG_WIRELESS_EXTENSION=y NEED_NETLINK=y NEED_LINUX_IOCTL=y -NEED_RFKILL=y endif - ifdef CONFIG_DRIVER_HERMES -@@ -166,6 +164,7 @@ endif + ifdef CONFIG_DRIVER_RALINK +@@ -146,7 +144,6 @@ endif + ifdef CONFIG_WIRELESS_EXTENSION + DRV_CFLAGS += -DCONFIG_WIRELESS_EXTENSION + DRV_OBJS += ../src/drivers/driver_wext.o +-NEED_RFKILL=y + endif + + ifdef NEED_NETLINK +@@ -159,6 +156,7 @@ endif ifdef NEED_RFKILL DRV_OBJS += ../src/drivers/rfkill.o @@ -251,7 +269,7 @@ --- a/src/drivers/driver_wext.h +++ b/src/drivers/driver_wext.h -@@ -27,7 +27,9 @@ struct wpa_driver_wext_data { +@@ -28,7 +28,9 @@ struct wpa_driver_wext_data { int ifindex2; int if_removed; int if_disabled; diff --git a/package/hostapd/patches/450-reload_settings.patch b/package/hostapd/patches/550-reload_freq_change.patch similarity index 84% rename from package/hostapd/patches/450-reload_settings.patch rename to package/hostapd/patches/550-reload_freq_change.patch index 5f226124c..ce9c1bf01 100644 --- a/package/hostapd/patches/450-reload_settings.patch +++ b/package/hostapd/patches/550-reload_freq_change.patch @@ -1,6 +1,6 @@ --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -112,6 +112,10 @@ int hostapd_reload_config(struct hostapd +@@ -120,6 +120,10 @@ int hostapd_reload_config(struct hostapd oldconf = hapd->iconf; iface->conf = newconf; diff --git a/package/hostapd/patches/451-nl80211_del_beacon_bss.patch b/package/hostapd/patches/551-nl80211_del_beacon_bss.patch similarity index 75% rename from package/hostapd/patches/451-nl80211_del_beacon_bss.patch rename to package/hostapd/patches/551-nl80211_del_beacon_bss.patch index b23acc6f0..bd71a7baf 100644 --- a/package/hostapd/patches/451-nl80211_del_beacon_bss.patch +++ b/package/hostapd/patches/551-nl80211_del_beacon_bss.patch @@ -1,6 +1,6 @@ --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -1604,23 +1604,41 @@ wpa_driver_nl80211_finish_drv_init(struc +@@ -2065,23 +2065,41 @@ wpa_driver_nl80211_finish_drv_init(struc } @@ -44,18 +44,18 @@ /** * wpa_driver_nl80211_deinit - Deinitialize nl80211 driver interface -@@ -5512,4 +5530,5 @@ const struct wpa_driver_ops wpa_driver_n - .send_ft_action = nl80211_send_ft_action, - .signal_monitor = nl80211_signal_monitor, - .send_frame = nl80211_send_frame, +@@ -6529,4 +6547,5 @@ const struct wpa_driver_ops wpa_driver_n + .set_intra_bss = nl80211_set_intra_bss, + .set_param = nl80211_set_param, + .get_radio_name = nl80211_get_radio_name, + .stop_ap = wpa_driver_nl80211_stop_ap, }; --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -1774,6 +1774,8 @@ struct wpa_driver_ops { - */ - int (*send_frame)(void *priv, const u8 *data, size_t data_len, - int encrypt); +@@ -2217,6 +2217,8 @@ struct wpa_driver_ops { + const u8 *buf, size_t len); + + int (*tdls_oper)(void *priv, enum tdls_oper oper, const u8 *peer); + + int (*stop_ap)(void *priv); }; diff --git a/package/hostapd/patches/452-ctrl_iface_reload.patch b/package/hostapd/patches/552-ctrl_iface_reload.patch similarity index 84% rename from package/hostapd/patches/452-ctrl_iface_reload.patch rename to package/hostapd/patches/552-ctrl_iface_reload.patch index e07ab6d44..a780f7dca 100644 --- a/package/hostapd/patches/452-ctrl_iface_reload.patch +++ b/package/hostapd/patches/552-ctrl_iface_reload.patch @@ -1,14 +1,14 @@ --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -35,6 +35,7 @@ - #include "ap/wps_hostapd.h" - #include "ap/ctrl_iface_ap.h" +@@ -39,6 +39,7 @@ + #include "wps/wps_defs.h" + #include "wps/wps.h" #include "ctrl_iface.h" +#include "config_file.h" struct wpa_ctrl_dst { -@@ -45,6 +46,7 @@ struct wpa_ctrl_dst { +@@ -49,6 +50,7 @@ struct wpa_ctrl_dst { int errors; }; @@ -16,9 +16,9 @@ static void hostapd_ctrl_iface_send(struct hostapd_data *hapd, int level, const char *buf, size_t len); -@@ -315,6 +317,66 @@ static int hostapd_ctrl_iface_wps_oob(st - #endif /* CONFIG_WPS_OOB */ - #endif /* CONFIG_WPS */ +@@ -323,6 +325,66 @@ static int hostapd_ctrl_iface_disassocia + return 0; + } +static int hostapd_ctrl_iface_set_down(struct hostapd_data *hapd) +{ @@ -81,9 +81,9 @@ + iface->config_read_cb = hostapd_config_read; +} - static void hostapd_ctrl_iface_receive(int sock, void *eloop_ctx, - void *sock_ctx) -@@ -379,6 +441,10 @@ static void hostapd_ctrl_iface_receive(i + #ifdef CONFIG_IEEE80211W + #ifdef NEED_AP_MLME +@@ -822,6 +884,10 @@ static void hostapd_ctrl_iface_receive(i reply_len += res; } #endif /* CONFIG_NO_RADIUS */ diff --git a/package/hostapd/patches/453-ap_sta_support.patch b/package/hostapd/patches/553-ap_sta_support.patch similarity index 91% rename from package/hostapd/patches/453-ap_sta_support.patch rename to package/hostapd/patches/553-ap_sta_support.patch index 930981dd3..d94808e87 100644 --- a/package/hostapd/patches/453-ap_sta_support.patch +++ b/package/hostapd/patches/553-ap_sta_support.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/wpa_supplicant_i.h +++ b/wpa_supplicant/wpa_supplicant_i.h -@@ -98,6 +98,8 @@ struct wpa_interface { +@@ -99,6 +99,8 @@ struct wpa_interface { * receiving of EAPOL frames from an additional interface. */ const char *bridge_ifname; @@ -9,7 +9,7 @@ }; /** -@@ -316,6 +318,8 @@ struct wpa_supplicant { +@@ -337,6 +339,8 @@ struct wpa_supplicant { #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */ char bridge_ifname[16]; @@ -20,9 +20,9 @@ int countermeasures; --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile -@@ -51,6 +51,11 @@ OBJS_p += ../src/utils/wpa_debug.o - OBJS_p += ../src/utils/wpabuf.o +@@ -52,6 +52,11 @@ OBJS_p += ../src/utils/wpabuf.o OBJS_c = wpa_cli.o ../src/common/wpa_ctrl.o + OBJS_c += ../src/utils/wpa_debug.o +ifdef MULTICALL +OBJS += ../src/common/wpa_ctrl.o @@ -34,7 +34,7 @@ --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -120,6 +120,55 @@ extern int wpa_debug_show_keys; +@@ -122,6 +122,55 @@ extern int wpa_debug_show_keys; extern int wpa_debug_timestamp; extern struct wpa_driver_ops *wpa_drivers[]; @@ -90,10 +90,10 @@ /* Configure default/group WEP keys for static WEP */ int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid) { -@@ -548,8 +597,16 @@ void wpa_supplicant_set_state(struct wpa - #ifndef IEEE8021X_EAPOL - wpa_drv_set_supp_port(wpa_s, 1); - #endif +@@ -597,8 +646,16 @@ void wpa_supplicant_set_state(struct wpa + #ifdef CONFIG_P2P + wpas_p2p_completed(wpa_s); + #endif /* CONFIG_P2P */ +#ifdef MULTICALL + if (wpa_s->hostapd) + hostapd_reload(wpa_s, wpa_s->current_bss); @@ -107,7 +107,7 @@ wpa_s->new_connection = 1; wpa_drv_set_operstate(wpa_s, 0); #ifndef IEEE8021X_EAPOL -@@ -1957,6 +2014,21 @@ static int wpa_supplicant_init_iface(str +@@ -2148,6 +2205,21 @@ static int wpa_supplicant_init_iface(str os_strlcpy(wpa_s->bridge_ifname, iface->bridge_ifname, sizeof(wpa_s->bridge_ifname)); } @@ -139,7 +139,7 @@ #include "drivers/driver.h" #include "wpa_supplicant_i.h" #include "config.h" -@@ -89,6 +90,8 @@ struct wpa_bss * wpa_bss_get(struct wpa_ +@@ -70,6 +71,8 @@ struct wpa_bss * wpa_bss_get(struct wpa_ static void wpa_bss_copy_res(struct wpa_bss *dst, struct wpa_scan_res *src) { @@ -148,7 +148,7 @@ os_time_t usec; dst->flags = src->flags; -@@ -101,6 +104,12 @@ static void wpa_bss_copy_res(struct wpa_ +@@ -82,6 +85,12 @@ static void wpa_bss_copy_res(struct wpa_ dst->level = src->level; dst->tsf = src->tsf; diff --git a/package/hostapd/patches/560-disable_ctrl_iface_mib.patch b/package/hostapd/patches/560-disable_ctrl_iface_mib.patch new file mode 100644 index 000000000..f186235cb --- /dev/null +++ b/package/hostapd/patches/560-disable_ctrl_iface_mib.patch @@ -0,0 +1,161 @@ +--- a/hostapd/Makefile ++++ b/hostapd/Makefile +@@ -119,6 +119,9 @@ endif + ifdef CONFIG_NO_CTRL_IFACE + CFLAGS += -DCONFIG_NO_CTRL_IFACE + else ++ifdef CONFIG_CTRL_IFACE_MIB ++CFLAGS += -DCONFIG_CTRL_IFACE_MIB ++endif + OBJS += ctrl_iface.o + OBJS += ../src/ap/ctrl_iface_ap.o + endif +--- a/hostapd/ctrl_iface.c ++++ b/hostapd/ctrl_iface.c +@@ -855,6 +855,7 @@ static void hostapd_ctrl_iface_receive(i + } else if (os_strncmp(buf, "RELOG", 5) == 0) { + if (wpa_debug_reopen_file() < 0) + reply_len = -1; ++#ifdef CONFIG_CTRL_IFACE_MIB + } else if (os_strcmp(buf, "MIB") == 0) { + reply_len = ieee802_11_get_mib(hapd, reply, reply_size); + if (reply_len >= 0) { +@@ -884,10 +885,12 @@ static void hostapd_ctrl_iface_receive(i + reply_len += res; + } + #endif /* CONFIG_NO_RADIUS */ ++#endif + } else if (os_strcmp(buf, "DOWN") == 0) { + hostapd_ctrl_iface_set_down(hapd); + } else if (os_strncmp(buf, "RELOAD ", 7) == 0) { + hostapd_ctrl_iface_reload(hapd, buf + 7); ++#ifdef CONFIG_CTRL_IFACE_MIB + } else if (os_strcmp(buf, "STA-FIRST") == 0) { + reply_len = hostapd_ctrl_iface_sta_first(hapd, reply, + reply_size); +@@ -897,6 +900,7 @@ static void hostapd_ctrl_iface_receive(i + } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) { + reply_len = hostapd_ctrl_iface_sta_next(hapd, buf + 9, reply, + reply_size); ++#endif + } else if (os_strcmp(buf, "ATTACH") == 0) { + if (hostapd_ctrl_iface_attach(hapd, &from, fromlen)) + reply_len = -1; +--- a/wpa_supplicant/Makefile ++++ b/wpa_supplicant/Makefile +@@ -675,6 +675,9 @@ ifdef CONFIG_IEEE80211N + OBJS += ../src/ap/ieee802_11_ht.o + endif + ifdef CONFIG_CTRL_IFACE ++ifdef CONFIG_CTRL_IFACE_MIB ++CFLAGS += -DCONFIG_CTRL_IFACE_MIB ++endif + OBJS += ../src/ap/ctrl_iface_ap.o + endif + +--- a/wpa_supplicant/ctrl_iface.c ++++ b/wpa_supplicant/ctrl_iface.c +@@ -2885,6 +2885,7 @@ char * wpa_supplicant_ctrl_iface_process + reply_len = -1; + } else if (os_strncmp(buf, "NOTE ", 5) == 0) { + wpa_printf(MSG_INFO, "NOTE: %s", buf + 5); ++#ifdef CONFIG_CTRL_IFACE_MIB + } else if (os_strcmp(buf, "MIB") == 0) { + reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size); + if (reply_len >= 0) { +@@ -2896,6 +2897,7 @@ char * wpa_supplicant_ctrl_iface_process + else + reply_len += res; + } ++#endif + } else if (os_strncmp(buf, "STATUS", 6) == 0) { + reply_len = wpa_supplicant_ctrl_iface_status( + wpa_s, buf + 6, reply, reply_size); +@@ -3189,6 +3191,7 @@ char * wpa_supplicant_ctrl_iface_process + reply_len = wpa_supplicant_ctrl_iface_bss( + wpa_s, buf + 4, reply, reply_size); + #ifdef CONFIG_AP ++#ifdef CONFIG_CTRL_IFACE_MIB + } else if (os_strcmp(buf, "STA-FIRST") == 0) { + reply_len = ap_ctrl_iface_sta_first(wpa_s, reply, reply_size); + } else if (os_strncmp(buf, "STA ", 4) == 0) { +@@ -3197,6 +3200,7 @@ char * wpa_supplicant_ctrl_iface_process + } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) { + reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply, + reply_size); ++#endif + #endif /* CONFIG_AP */ + } else if (os_strcmp(buf, "SUSPEND") == 0) { + wpas_notify_suspend(wpa_s->global); +--- a/src/ap/ctrl_iface_ap.c ++++ b/src/ap/ctrl_iface_ap.c +@@ -24,6 +24,7 @@ + #include "p2p_hostapd.h" + #include "ctrl_iface_ap.h" + ++#ifdef CONFIG_CTRL_IFACE_MIB + + static int hostapd_ctrl_iface_sta_mib(struct hostapd_data *hapd, + struct sta_info *sta, +@@ -106,3 +107,5 @@ int hostapd_ctrl_iface_sta_next(struct h + } + return hostapd_ctrl_iface_sta_mib(hapd, sta->next, buf, buflen); + } ++ ++#endif +--- a/src/ap/ieee802_1x.c ++++ b/src/ap/ieee802_1x.c +@@ -1866,6 +1866,7 @@ static const char * bool_txt(Boolean boo + return bool ? "TRUE" : "FALSE"; + } + ++#ifdef CONFIG_CTRL_IFACE_MIB + + int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen) + { +@@ -2017,6 +2018,7 @@ int ieee802_1x_get_mib_sta(struct hostap + return len; + } + ++#endif + + static void ieee802_1x_finished(struct hostapd_data *hapd, + struct sta_info *sta, int success) +--- a/src/ap/wpa_auth.c ++++ b/src/ap/wpa_auth.c +@@ -2470,6 +2470,7 @@ static int wpa_cipher_bits(int cipher) + } + } + ++#ifdef CONFIG_CTRL_IFACE_MIB + + #define RSN_SUITE "%02x-%02x-%02x-%d" + #define RSN_SUITE_ARG(s) \ +@@ -2633,7 +2634,7 @@ int wpa_get_mib_sta(struct wpa_state_mac + + return len; + } +- ++#endif + + void wpa_auth_countermeasures_start(struct wpa_authenticator *wpa_auth) + { +--- a/src/rsn_supp/wpa.c ++++ b/src/rsn_supp/wpa.c +@@ -1913,6 +1913,8 @@ static u32 wpa_cipher_suite(struct wpa_s + } + + ++#ifdef CONFIG_CTRL_IFACE_MIB ++ + #define RSN_SUITE "%02x-%02x-%02x-%d" + #define RSN_SUITE_ARG(s) \ + ((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff +@@ -1992,6 +1994,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch + + return (int) len; + } ++#endif + #endif /* CONFIG_CTRL_IFACE */ + + diff --git a/package/hostapd/patches/600-terminate_on_setup_failure.patch b/package/hostapd/patches/600-terminate_on_setup_failure.patch index 9385413e5..63d3ec501 100644 --- a/package/hostapd/patches/600-terminate_on_setup_failure.patch +++ b/package/hostapd/patches/600-terminate_on_setup_failure.patch @@ -1,6 +1,6 @@ --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -706,11 +706,8 @@ int hostapd_setup_interface_complete(str +@@ -717,11 +717,8 @@ int hostapd_setup_interface_complete(str size_t j; u8 *prev_addr; @@ -14,7 +14,7 @@ wpa_printf(MSG_DEBUG, "Completing interface initialization"); if (hapd->iconf->channel) { -@@ -726,7 +723,7 @@ int hostapd_setup_interface_complete(str +@@ -737,7 +734,7 @@ int hostapd_setup_interface_complete(str hapd->iconf->secondary_channel)) { wpa_printf(MSG_ERROR, "Could not set channel for " "kernel driver"); @@ -23,16 +23,16 @@ } } -@@ -736,7 +733,7 @@ int hostapd_setup_interface_complete(str +@@ -748,7 +745,7 @@ int hostapd_setup_interface_complete(str hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211, - HOSTAPD_LEVEL_WARNING, - "Failed to prepare rates table."); + HOSTAPD_LEVEL_WARNING, + "Failed to prepare rates table."); - return -1; + goto error; } } -@@ -744,14 +741,14 @@ int hostapd_setup_interface_complete(str +@@ -756,14 +753,14 @@ int hostapd_setup_interface_complete(str hostapd_set_rts(hapd, hapd->iconf->rts_threshold)) { wpa_printf(MSG_ERROR, "Could not set RTS threshold for " "kernel driver"); @@ -49,7 +49,7 @@ } prev_addr = hapd->own_addr; -@@ -761,7 +758,7 @@ int hostapd_setup_interface_complete(str +@@ -773,7 +770,7 @@ int hostapd_setup_interface_complete(str if (j) os_memcpy(hapd->own_addr, prev_addr, ETH_ALEN); if (hostapd_setup_bss(hapd, j == 0)) @@ -58,7 +58,7 @@ if (hostapd_mac_comp_empty(hapd->conf->bssid) == 0) prev_addr = hapd->own_addr; } -@@ -773,7 +770,7 @@ int hostapd_setup_interface_complete(str +@@ -785,7 +782,7 @@ int hostapd_setup_interface_complete(str if (hostapd_driver_commit(hapd) < 0) { wpa_printf(MSG_ERROR, "%s: Failed to commit driver " "configuration", __func__); @@ -66,8 +66,8 @@ + goto error; } - wpa_printf(MSG_DEBUG, "%s: Setup of interface done.", -@@ -783,6 +780,11 @@ int hostapd_setup_interface_complete(str + if (hapd->setup_complete_cb) +@@ -798,6 +795,11 @@ int hostapd_setup_interface_complete(str iface->init_complete(iface); return 0; diff --git a/package/hostapd/patches/700-random_pool_add_kernel.patch b/package/hostapd/patches/700-random_pool_add_kernel.patch new file mode 100644 index 000000000..1edaff9e7 --- /dev/null +++ b/package/hostapd/patches/700-random_pool_add_kernel.patch @@ -0,0 +1,120 @@ +--- a/src/crypto/random.c ++++ b/src/crypto/random.c +@@ -47,6 +47,8 @@ + #define EXTRACT_LEN 16 + #define MIN_READY_MARK 2 + ++#ifndef CONFIG_NO_RANDOM_POOL ++ + static u32 pool[POOL_WORDS]; + static unsigned int input_rotate = 0; + static unsigned int pool_pos = 0; +@@ -120,7 +122,7 @@ static void random_extract(u8 *out) + } + + +-void random_add_randomness(const void *buf, size_t len) ++static void random_pool_add_randomness(const void *buf, size_t len) + { + struct os_time t; + static unsigned int count = 0; +@@ -260,3 +262,22 @@ void random_mark_pool_ready(void) + wpa_printf(MSG_DEBUG, "random: Mark internal entropy pool to be " + "ready (count=%u/%u)", own_pool_ready, MIN_READY_MARK); + } ++ ++#endif /* CONFIG_NO_RANDOM_POOL */ ++ ++ ++void random_add_randomness(const void *buf, size_t len) ++{ ++#ifdef __linux__ ++ int fd; ++ ++ fd = open("/dev/random", O_RDWR); ++ if (fd >= 0) { ++ write(fd, buf, len); ++ close(fd); ++ } ++#endif ++#ifndef CONFIG_NO_RANDOM_POOL ++ random_pool_add_randomness(buf, len); ++#endif ++} +--- a/hostapd/Makefile ++++ b/hostapd/Makefile +@@ -698,11 +698,11 @@ endif + ifdef CONFIG_NO_RANDOM_POOL + CFLAGS += -DCONFIG_NO_RANDOM_POOL + else +-OBJS += ../src/crypto/random.o +-HOBJS += ../src/crypto/random.o + HOBJS += $(SHA1OBJS) + HOBJS += ../src/crypto/md5.o + endif ++OBJS += ../src/crypto/random.o ++HOBJS += ../src/crypto/random.o + + ifdef CONFIG_RADIUS_SERVER + CFLAGS += -DRADIUS_SERVER +--- a/wpa_supplicant/Makefile ++++ b/wpa_supplicant/Makefile +@@ -1101,9 +1101,8 @@ endif + + ifdef CONFIG_NO_RANDOM_POOL + CFLAGS += -DCONFIG_NO_RANDOM_POOL +-else +-OBJS += ../src/crypto/random.o + endif ++OBJS += ../src/crypto/random.o + + ifdef CONFIG_CTRL_IFACE + ifeq ($(CONFIG_CTRL_IFACE), y) +--- a/wpa_supplicant/Android.mk ++++ b/wpa_supplicant/Android.mk +@@ -1102,9 +1102,8 @@ endif + + ifdef CONFIG_NO_RANDOM_POOL + L_CFLAGS += -DCONFIG_NO_RANDOM_POOL +-else +-OBJS += src/crypto/random.c + endif ++OBJS += src/crypto/random.c + + ifdef CONFIG_CTRL_IFACE + ifeq ($(CONFIG_CTRL_IFACE), y) +--- a/hostapd/Android.mk ++++ b/hostapd/Android.mk +@@ -717,11 +717,11 @@ endif + ifdef CONFIG_NO_RANDOM_POOL + L_CFLAGS += -DCONFIG_NO_RANDOM_POOL + else +-OBJS += src/crypto/random.c +-HOBJS += src/crypto/random.c + HOBJS += $(SHA1OBJS) + HOBJS += src/crypto/md5.c + endif ++OBJS += src/crypto/random.c ++HOBJS += src/crypto/random.c + + ifdef CONFIG_RADIUS_SERVER + L_CFLAGS += -DRADIUS_SERVER +--- a/src/crypto/random.h ++++ b/src/crypto/random.h +@@ -16,15 +16,14 @@ + #define RANDOM_H + + #ifdef CONFIG_NO_RANDOM_POOL +-#define random_add_randomness(b, l) do { } while (0) + #define random_get_bytes(b, l) os_get_random((b), (l)) + #define random_pool_ready() 1 + #define random_mark_pool_ready() do { } while (0) + #else /* CONFIG_NO_RANDOM_POOL */ +-void random_add_randomness(const void *buf, size_t len); + int random_get_bytes(void *buf, size_t len); + int random_pool_ready(void); + void random_mark_pool_ready(void); + #endif /* CONFIG_NO_RANDOM_POOL */ ++void random_add_randomness(const void *buf, size_t len); + + #endif /* RANDOM_H */ diff --git a/package/hostapd/patches/710-bring_down_interface.patch b/package/hostapd/patches/710-bring_down_interface.patch new file mode 100644 index 000000000..bfd5ef626 --- /dev/null +++ b/package/hostapd/patches/710-bring_down_interface.patch @@ -0,0 +1,21 @@ +--- a/src/drivers/driver_nl80211.c ++++ b/src/drivers/driver_nl80211.c +@@ -4883,9 +4883,6 @@ static int wpa_driver_nl80211_set_mode(v + /* Try to set the mode again while the interface is + * down */ + ret = nl80211_set_mode(drv, drv->ifindex, nlmode); +- if (linux_set_iface_flags(drv->ioctl_sock, bss->ifname, +- 1)) +- ret = -1; + if (!ret) + break; + } else +@@ -4898,6 +4895,8 @@ static int wpa_driver_nl80211_set_mode(v + wpa_printf(MSG_DEBUG, "nl80211: Mode change succeeded while " + "interface is down"); + drv->nlmode = nlmode; ++ if (linux_set_iface_flags(drv->ioctl_sock, bss->ifname, 1)) ++ ret = -1; + } + + done: diff --git a/package/hostapd/patches/720-fix_wps_pin_crash.patch b/package/hostapd/patches/720-fix_wps_pin_crash.patch new file mode 100644 index 000000000..e1a3184d6 --- /dev/null +++ b/package/hostapd/patches/720-fix_wps_pin_crash.patch @@ -0,0 +1,12 @@ +--- a/hostapd/ctrl_iface.c ++++ b/hostapd/ctrl_iface.c +@@ -514,6 +514,9 @@ static int hostapd_ctrl_iface_wps_ap_pin + char *pos; + const char *pin_txt; + ++ if (!hapd->wps) ++ return -1; ++ + pos = os_strchr(txt, ' '); + if (pos) + *pos++ = '\0'; diff --git a/package/hostapd/patches/730-nl80211_enable_qosdata.patch b/package/hostapd/patches/730-nl80211_enable_qosdata.patch new file mode 100644 index 000000000..08bebe1a6 --- /dev/null +++ b/package/hostapd/patches/730-nl80211_enable_qosdata.patch @@ -0,0 +1,195 @@ +--- a/src/drivers/driver_nl80211.c ++++ b/src/drivers/driver_nl80211.c +@@ -4263,7 +4263,7 @@ static const u8 rfc1042_header[6] = { 0x + + static int wpa_driver_nl80211_hapd_send_eapol( + void *priv, const u8 *addr, const u8 *data, +- size_t data_len, int encrypt, const u8 *own_addr) ++ size_t data_len, int encrypt, const u8 *own_addr, u32 flags) + { + struct i802_bss *bss = priv; + struct wpa_driver_nl80211_data *drv = bss->drv; +@@ -4271,11 +4271,7 @@ static int wpa_driver_nl80211_hapd_send_ + size_t len; + u8 *pos; + int res; +-#if 0 /* FIX */ +- int qos = sta->flags & WPA_STA_WMM; +-#else +- int qos = 0; +-#endif ++ int qos = flags & WPA_STA_WMM; + + len = sizeof(*hdr) + (qos ? 2 : 0) + sizeof(rfc1042_header) + 2 + + data_len; +@@ -4291,26 +4287,22 @@ static int wpa_driver_nl80211_hapd_send_ + hdr->frame_control |= host_to_le16(WLAN_FC_FROMDS); + if (encrypt) + hdr->frame_control |= host_to_le16(WLAN_FC_ISWEP); +-#if 0 /* To be enabled if qos determination is added above */ + if (qos) { + hdr->frame_control |= + host_to_le16(WLAN_FC_STYPE_QOS_DATA << 4); + } +-#endif + + memcpy(hdr->IEEE80211_DA_FROMDS, addr, ETH_ALEN); + memcpy(hdr->IEEE80211_BSSID_FROMDS, own_addr, ETH_ALEN); + memcpy(hdr->IEEE80211_SA_FROMDS, own_addr, ETH_ALEN); + pos = (u8 *) (hdr + 1); + +-#if 0 /* To be enabled if qos determination is added above */ + if (qos) { + /* add an empty QoS header if needed */ + pos[0] = 0; + pos[1] = 0; + pos += 2; + } +-#endif + + memcpy(pos, rfc1042_header, sizeof(rfc1042_header)); + pos += sizeof(rfc1042_header); +--- a/src/drivers/driver.h ++++ b/src/drivers/driver.h +@@ -1396,7 +1396,7 @@ struct wpa_driver_ops { + */ + int (*hapd_send_eapol)(void *priv, const u8 *addr, const u8 *data, + size_t data_len, int encrypt, +- const u8 *own_addr); ++ const u8 *own_addr, u32 flags); + + /** + * sta_deauth - Deauthenticate a station (AP only) +--- a/src/drivers/driver_madwifi.c ++++ b/src/drivers/driver_madwifi.c +@@ -1097,7 +1097,7 @@ madwifi_wireless_event_init(struct madwi + + static int + madwifi_send_eapol(void *priv, const u8 *addr, const u8 *data, size_t data_len, +- int encrypt, const u8 *own_addr) ++ int encrypt, const u8 *own_addr, u32 flags) + { + struct madwifi_driver_data *drv = priv; + unsigned char buf[3000]; +--- a/src/drivers/driver_test.c ++++ b/src/drivers/driver_test.c +@@ -175,7 +175,7 @@ test_driver_get_cli(struct wpa_driver_te + + static int test_driver_send_eapol(void *priv, const u8 *addr, const u8 *data, + size_t data_len, int encrypt, +- const u8 *own_addr) ++ const u8 *own_addr, u32 flags) + { + struct test_driver_bss *dbss = priv; + struct wpa_driver_test_data *drv = dbss->drv; +--- a/src/drivers/driver_hostap.c ++++ b/src/drivers/driver_hostap.c +@@ -294,7 +294,8 @@ static int hostap_send_mlme(void *priv, + + + static int hostap_send_eapol(void *priv, const u8 *addr, const u8 *data, +- size_t data_len, int encrypt, const u8 *own_addr) ++ size_t data_len, int encrypt, const u8 *own_addr, ++ u32 flags) + { + struct hostap_driver_data *drv = priv; + struct ieee80211_hdr *hdr; +--- a/src/drivers/driver_atheros.c ++++ b/src/drivers/driver_atheros.c +@@ -1132,7 +1132,7 @@ atheros_wireless_event_init(struct ather + + static int + atheros_send_eapol(void *priv, const u8 *addr, const u8 *data, size_t data_len, +- int encrypt, const u8 *own_addr) ++ int encrypt, const u8 *own_addr, u32 flags) + { + struct atheros_driver_data *drv = priv; + unsigned char buf[3000]; +--- a/src/drivers/driver_bsd.c ++++ b/src/drivers/driver_bsd.c +@@ -516,7 +516,7 @@ no_ie: + + static int + bsd_send_eapol(void *priv, const u8 *addr, const u8 *data, size_t data_len, +- int encrypt, const u8 *own_addr) ++ int encrypt, const u8 *own_addr, u32 flags) + { + struct bsd_driver_data *drv = priv; + +--- a/src/ap/ap_drv_ops.h ++++ b/src/ap/ap_drv_ops.h +@@ -135,13 +135,14 @@ static inline int hostapd_drv_sta_remove + + static inline int hostapd_drv_hapd_send_eapol(struct hostapd_data *hapd, + const u8 *addr, const u8 *data, +- size_t data_len, int encrypt) ++ size_t data_len, int encrypt, ++ u32 flags) + { + if (hapd->driver == NULL || hapd->driver->hapd_send_eapol == NULL) + return 0; + return hapd->driver->hapd_send_eapol(hapd->drv_priv, addr, data, + data_len, encrypt, +- hapd->own_addr); ++ hapd->own_addr, flags); + } + + static inline int hostapd_drv_read_sta_data( +--- a/src/ap/ieee802_1x.c ++++ b/src/ap/ieee802_1x.c +@@ -73,7 +73,7 @@ static void ieee802_1x_send(struct hosta + rsn_preauth_send(hapd, sta, buf, len); + } else { + hostapd_drv_hapd_send_eapol(hapd, sta->addr, buf, len, +- encrypt); ++ encrypt, sta->flags); + } + + os_free(buf); +--- a/src/ap/wpa_auth_glue.c ++++ b/src/ap/wpa_auth_glue.c +@@ -243,8 +243,15 @@ static int hostapd_wpa_auth_send_eapol(v + int encrypt) + { + struct hostapd_data *hapd = ctx; ++ struct sta_info *sta; ++ u32 flags = 0; ++ ++ sta = ap_get_sta(hapd, addr); ++ if (sta) ++ flags = sta->flags; ++ + return hostapd_drv_hapd_send_eapol(hapd, addr, data, data_len, +- encrypt); ++ encrypt, flags); + } + + +--- a/wpa_supplicant/driver_i.h ++++ b/wpa_supplicant/driver_i.h +@@ -351,12 +351,12 @@ static inline int wpa_drv_sta_remove(str + static inline int wpa_drv_hapd_send_eapol(struct wpa_supplicant *wpa_s, + const u8 *addr, const u8 *data, + size_t data_len, int encrypt, +- const u8 *own_addr) ++ const u8 *own_addr, u32 flags) + { + if (wpa_s->driver->hapd_send_eapol) + return wpa_s->driver->hapd_send_eapol(wpa_s->drv_priv, addr, + data, data_len, encrypt, +- own_addr); ++ own_addr, flags); + return -1; + } + +--- a/src/drivers/driver_wired.c ++++ b/src/drivers/driver_wired.c +@@ -314,7 +314,7 @@ static int wired_init_sockets(struct wpa + + static int wired_send_eapol(void *priv, const u8 *addr, + const u8 *data, size_t data_len, int encrypt, +- const u8 *own_addr) ++ const u8 *own_addr, u32 flags) + { + struct wpa_driver_wired_data *drv = priv; + struct ieee8023_hdr *hdr; diff --git a/package/iw/Makefile b/package/iw/Makefile index d1d60c1c6..625e17921 100644 --- a/package/iw/Makefile +++ b/package/iw/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iw -PKG_VERSION:=0.9.21 +PKG_VERSION:=0.9.22 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=http://wireless.kernel.org/download/iw/ -PKG_MD5SUM:=726db5f1fd6bc316434414770513ef81 +PKG_MD5SUM:=561c2602c5ce7c65a590118286c0892a PKG_BUILD_DEPENDS:=mac80211 include $(INCLUDE_DIR)/package.mk diff --git a/package/iw/patches/001-nl80211_sync.patch b/package/iw/patches/001-nl80211_sync.patch index 3f01fbf0d..a385897b7 100644 --- a/package/iw/patches/001-nl80211_sync.patch +++ b/package/iw/patches/001-nl80211_sync.patch @@ -1,221 +1,81 @@ --- a/nl80211.h +++ b/nl80211.h -@@ -295,7 +295,9 @@ - * auth and assoc steps. For this, you need to specify the SSID in a - * %NL80211_ATTR_SSID attribute, and can optionally specify the association - * IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_MAC, -- * %NL80211_ATTR_WIPHY_FREQ and %NL80211_ATTR_CONTROL_PORT. -+ * %NL80211_ATTR_WIPHY_FREQ, %NL80211_ATTR_CONTROL_PORT, -+ * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE and -+ * %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT. - * It is also sent as an event, with the BSSID and response IEs when the - * connection is established or failed to be established. This can be - * determined by the STATUS_CODE attribute. -@@ -313,8 +315,8 @@ - * channel for the specified amount of time. This can be used to do - * off-channel operations like transmit a Public Action frame and wait for - * a response while being associated to an AP on another channel. -- * %NL80211_ATTR_WIPHY or %NL80211_ATTR_IFINDEX is used to specify which -- * radio is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the -+ * %NL80211_ATTR_IFINDEX is used to specify which interface (and thus -+ * radio) is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the - * frequency for the operation and %NL80211_ATTR_WIPHY_CHANNEL_TYPE may be - * optionally used to specify additional channel parameters. - * %NL80211_ATTR_DURATION is used to specify the duration in milliseconds -@@ -385,6 +387,8 @@ - * of any other interfaces, and other interfaces will again take - * precedence when they are used. +@@ -148,6 +148,10 @@ + * @NL80211_CMD_SET_MPATH: Set mesh path attributes for mesh path to + * destination %NL80211_ATTR_MAC on the interface identified by + * %NL80211_ATTR_IFINDEX. ++ * @NL80211_CMD_NEW_MPATH: Create a new mesh path for the destination given by ++ * %NL80211_ATTR_MAC via %NL80211_ATTR_MPATH_NEXT_HOP. ++ * @NL80211_CMD_DEL_MPATH: Delete a mesh path to the destination given by ++ * %NL80211_ATTR_MAC. + * @NL80211_CMD_NEW_PATH: Add a mesh path with given attributes to the + * the interface identified by %NL80211_ATTR_IFINDEX. + * @NL80211_CMD_DEL_PATH: Remove a mesh path identified by %NL80211_ATTR_MAC +@@ -612,7 +616,7 @@ enum nl80211_commands { + * consisting of a nested array. * -+ * @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS interface. -+ * - * @NL80211_CMD_MAX: highest used command number - * @__NL80211_CMD_AFTER_LAST: internal use - */ -@@ -487,6 +491,7 @@ enum nl80211_commands { - NL80211_CMD_NOTIFY_CQM, - - NL80211_CMD_SET_CHANNEL, -+ NL80211_CMD_SET_WDS_PEER, - - /* add new commands above here */ - -@@ -686,6 +691,15 @@ enum nl80211_commands { - * request, the driver will assume that the port is unauthorized until - * authorized by user space. Otherwise, port is marked authorized by - * default in station mode. -+ * @NL80211_ATTR_CONTROL_PORT_ETHERTYPE: A 16-bit value indicating the -+ * ethertype that will be used for key negotiation. It can be -+ * specified with the associate and connect commands. If it is not -+ * specified, the value defaults to 0x888E (PAE, 802.1X). This -+ * attribute is also used as a flag in the wiphy information to -+ * indicate that protocols other than PAE are supported. -+ * @NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT: When included along with -+ * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE, indicates that the custom -+ * ethertype frames used for key negotiation must not be encrypted. + * @NL80211_ATTR_MESH_ID: mesh id (1-32 bytes). +- * @NL80211_ATTR_PLINK_ACTION: action to perform on the mesh peer link. ++ * @NL80211_ATTR_STA_PLINK_ACTION: action to perform on the mesh peer link. + * @NL80211_ATTR_MPATH_NEXT_HOP: MAC address of the next hop for a mesh path. + * @NL80211_ATTR_MPATH_INFO: information about a mesh_path, part of mesh path + * info given for %NL80211_CMD_GET_MPATH, nested attribute described at +@@ -879,7 +883,9 @@ enum nl80211_commands { + * See &enum nl80211_key_default_types. * - * @NL80211_ATTR_TESTDATA: Testmode data blob, passed through to the driver. - * We recommend using nested, driver-specific attributes within this. -@@ -787,6 +801,33 @@ enum nl80211_commands { - * This is used in association with @NL80211_ATTR_WIPHY_TX_POWER_SETTING - * for non-automatic settings. + * @NL80211_ATTR_MESH_SETUP: Optional mesh setup parameters. These cannot be +- * changed once the mesh is active. ++ * changed once the mesh is active. ++ * @NL80211_ATTR_MESH_CONFIG: Mesh configuration parameters, a nested attribute ++ * containing attributes from &enum nl80211_meshconf_params. * -+ * @NL80211_ATTR_SUPPORT_IBSS_RSN: The device supports IBSS RSN, which mostly -+ * means support for per-station GTKs. -+ * -+ * @NL80211_ATTR_WIPHY_ANTENNA_TX: Bitmap of allowed antennas for transmitting. -+ * This can be used to mask out antennas which are not attached or should -+ * not be used for transmitting. If an antenna is not selected in this -+ * bitmap the hardware is not allowed to transmit on this antenna. -+ * -+ * Each bit represents one antenna, starting with antenna 1 at the first -+ * bit. Depending on which antennas are selected in the bitmap, 802.11n -+ * drivers can derive which chainmasks to use (if all antennas belonging to -+ * a particular chain are disabled this chain should be disabled) and if -+ * a chain has diversity antennas wether diversity should be used or not. -+ * HT capabilities (STBC, TX Beamforming, Antenna selection) can be -+ * derived from the available chains after applying the antenna mask. -+ * Non-802.11n drivers can derive wether to use diversity or not. -+ * Drivers may reject configurations or RX/TX mask combinations they cannot -+ * support by returning -EINVAL. -+ * -+ * @NL80211_ATTR_WIPHY_ANTENNA_RX: Bitmap of allowed antennas for receiving. -+ * This can be used to mask out antennas which are not attached or should -+ * not be used for receiving. If an antenna is not selected in this bitmap -+ * the hardware should not be configured to receive on this antenna. -+ * For a more detailed descripton see @NL80211_ATTR_WIPHY_ANTENNA_TX. -+ * -+ * @NL80211_ATTR_MCAST_RATE: Multicast tx rate (in 100 kbps) for IBSS -+ * * @NL80211_ATTR_MAX: highest attribute number currently defined * @__NL80211_ATTR_AFTER_LAST: internal use - */ -@@ -951,6 +992,16 @@ enum nl80211_attrs { - NL80211_ATTR_RX_FRAME_TYPES, - NL80211_ATTR_FRAME_TYPE, - -+ NL80211_ATTR_CONTROL_PORT_ETHERTYPE, -+ NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT, -+ -+ NL80211_ATTR_SUPPORT_IBSS_RSN, -+ -+ NL80211_ATTR_WIPHY_ANTENNA_TX, -+ NL80211_ATTR_WIPHY_ANTENNA_RX, -+ -+ NL80211_ATTR_MCAST_RATE, -+ - /* add attributes here, update the policy in nl80211.c */ - - __NL80211_ATTR_AFTER_LAST, -@@ -1006,6 +1057,8 @@ enum nl80211_attrs { - * @NL80211_IFTYPE_WDS: wireless distribution interface - * @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames - * @NL80211_IFTYPE_MESH_POINT: mesh point -+ * @NL80211_IFTYPE_P2P_CLIENT: P2P client -+ * @NL80211_IFTYPE_P2P_GO: P2P group owner - * @NL80211_IFTYPE_MAX: highest interface type number currently defined - * @NUM_NL80211_IFTYPES: number of defined interface types - * -@@ -1022,6 +1075,8 @@ enum nl80211_iftype { - NL80211_IFTYPE_WDS, - NL80211_IFTYPE_MONITOR, - NL80211_IFTYPE_MESH_POINT, -+ NL80211_IFTYPE_P2P_CLIENT, -+ NL80211_IFTYPE_P2P_GO, - - /* keep last */ - NUM_NL80211_IFTYPES, -@@ -1111,6 +1166,8 @@ enum nl80211_rate_info { - * @NL80211_STA_INFO_RX_PACKETS: total received packet (u32, from this station) - * @NL80211_STA_INFO_TX_PACKETS: total transmitted packets (u32, to this - * station) -+ * @NL80211_STA_INFO_TX_RETRIES: total retries (u32, to this station) -+ * @NL80211_STA_INFO_TX_FAILED: total failed packets (u32, to this station) +@@ -1225,8 +1231,6 @@ enum nl80211_rate_info { + * @NL80211_STA_INFO_INACTIVE_TIME: time since last activity (u32, msecs) + * @NL80211_STA_INFO_RX_BYTES: total received bytes (u32, from this station) + * @NL80211_STA_INFO_TX_BYTES: total transmitted bytes (u32, to this station) +- * @__NL80211_STA_INFO_AFTER_LAST: internal +- * @NL80211_STA_INFO_MAX: highest possible station info attribute + * @NL80211_STA_INFO_SIGNAL: signal strength of last received PPDU (u8, dBm) + * @NL80211_STA_INFO_TX_BITRATE: current unicast tx rate, nested attribute + * containing info as possible, see &enum nl80211_sta_info_txrate. +@@ -1236,6 +1240,13 @@ enum nl80211_rate_info { + * @NL80211_STA_INFO_TX_RETRIES: total retries (u32, to this station) + * @NL80211_STA_INFO_TX_FAILED: total failed packets (u32, to this station) + * @NL80211_STA_INFO_SIGNAL_AVG: signal strength average (u8, dBm) ++ * @NL80211_STA_INFO_LLID: the station's mesh LLID ++ * @NL80211_STA_INFO_PLID: the station's mesh PLID ++ * @NL80211_STA_INFO_PLINK_STATE: peer link state for the station ++ * @NL80211_STA_INFO_RX_BITRATE: last unicast rx rate, nested attribute ++ * containing info as possible, see &enum nl80211_sta_info_txrate. ++ * @__NL80211_STA_INFO_AFTER_LAST: internal ++ * @NL80211_STA_INFO_MAX: highest possible station info attribute */ enum nl80211_sta_info { __NL80211_STA_INFO_INVALID, -@@ -1124,6 +1181,8 @@ enum nl80211_sta_info { - NL80211_STA_INFO_TX_BITRATE, - NL80211_STA_INFO_RX_PACKETS, - NL80211_STA_INFO_TX_PACKETS, -+ NL80211_STA_INFO_TX_RETRIES, -+ NL80211_STA_INFO_TX_FAILED, +@@ -1252,6 +1263,7 @@ enum nl80211_sta_info { + NL80211_STA_INFO_TX_RETRIES, + NL80211_STA_INFO_TX_FAILED, + NL80211_STA_INFO_SIGNAL_AVG, ++ NL80211_STA_INFO_RX_BITRATE, /* keep last */ __NL80211_STA_INFO_AFTER_LAST, -@@ -1277,7 +1336,11 @@ enum nl80211_bitrate_attr { - * wireless core it thinks its knows the regulatory domain we should be in. - * @NL80211_REGDOM_SET_BY_COUNTRY_IE: the wireless core has received an - * 802.11 country information element with regulatory information it -- * thinks we should consider. -+ * thinks we should consider. cfg80211 only processes the country -+ * code from the IE, and relies on the regulatory domain information -+ * structure pased by userspace (CRDA) from our wireless-regdb. -+ * If a channel is enabled but the country code indicates it should -+ * be disabled we disable the channel and re-enable it upon disassociation. +@@ -1626,7 +1638,7 @@ enum nl80211_mntr_flags { + * @NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME: The interval of time (in TUs) + * that it takes for an HWMP information element to propagate across the mesh + * +- * @NL80211_MESHCONF_ROOTMODE: whether root mode is enabled or not ++ * @NL80211_MESHCONF_HWMP_ROOTMODE: whether root mode is enabled or not + * + * @NL80211_MESHCONF_ELEMENT_TTL: specifies the value of TTL field set at a + * source mesh point for path selection elements. +@@ -1678,6 +1690,7 @@ enum nl80211_meshconf_params { + * element that vendors will use to identify the path selection methods and + * metrics in use. + * ++ * @NL80211_MESH_SETUP_ATTR_MAX: highest possible mesh setup attribute number + * @__NL80211_MESH_SETUP_ATTR_AFTER_LAST: Internal use */ - enum nl80211_reg_initiator { - NL80211_REGDOM_SET_BY_CORE, -@@ -1382,6 +1445,17 @@ enum nl80211_reg_rule_flags { - * @__NL80211_SURVEY_INFO_INVALID: attribute number 0 is reserved - * @NL80211_SURVEY_INFO_FREQUENCY: center frequency of channel - * @NL80211_SURVEY_INFO_NOISE: noise level of channel (u8, dBm) -+ * @NL80211_SURVEY_INFO_IN_USE: channel is currently being used -+ * @NL80211_SURVEY_INFO_CHANNEL_TIME: amount of time (in ms) that the radio -+ * spent on this channel -+ * @NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY: amount of the time the primary -+ * channel was sensed busy (either due to activity or energy detect) -+ * @NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY: amount of time the extension -+ * channel was sensed busy -+ * @NL80211_SURVEY_INFO_CHANNEL_TIME_RX: amount of time the radio spent -+ * receiving data -+ * @NL80211_SURVEY_INFO_CHANNEL_TIME_TX: amount of time the radio spent -+ * transmitting data - * @NL80211_SURVEY_INFO_MAX: highest survey info attribute number - * currently defined - * @__NL80211_SURVEY_INFO_AFTER_LAST: internal use -@@ -1390,6 +1464,12 @@ enum nl80211_survey_info { - __NL80211_SURVEY_INFO_INVALID, - NL80211_SURVEY_INFO_FREQUENCY, - NL80211_SURVEY_INFO_NOISE, -+ NL80211_SURVEY_INFO_IN_USE, -+ NL80211_SURVEY_INFO_CHANNEL_TIME, -+ NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY, -+ NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY, -+ NL80211_SURVEY_INFO_CHANNEL_TIME_RX, -+ NL80211_SURVEY_INFO_CHANNEL_TIME_TX, - - /* keep last */ - __NL80211_SURVEY_INFO_AFTER_LAST, -@@ -1636,11 +1716,14 @@ enum nl80211_auth_type { - * @NL80211_KEYTYPE_GROUP: Group (broadcast/multicast) key - * @NL80211_KEYTYPE_PAIRWISE: Pairwise (unicast/individual) key - * @NL80211_KEYTYPE_PEERKEY: PeerKey (DLS) -+ * @NUM_NL80211_KEYTYPES: number of defined key types - */ - enum nl80211_key_type { - NL80211_KEYTYPE_GROUP, - NL80211_KEYTYPE_PAIRWISE, - NL80211_KEYTYPE_PEERKEY, -+ -+ NUM_NL80211_KEYTYPES - }; - - /** -@@ -1671,6 +1754,9 @@ enum nl80211_wpa_versions { - * CCMP keys, each six bytes in little endian - * @NL80211_KEY_DEFAULT: flag indicating default key - * @NL80211_KEY_DEFAULT_MGMT: flag indicating default management key -+ * @NL80211_KEY_TYPE: the key type from enum nl80211_key_type, if not -+ * specified the default depends on whether a MAC address was -+ * given with the command using the key or not (u32) - * @__NL80211_KEY_AFTER_LAST: internal - * @NL80211_KEY_MAX: highest key attribute - */ -@@ -1682,6 +1768,7 @@ enum nl80211_key_attributes { - NL80211_KEY_SEQ, - NL80211_KEY_DEFAULT, - NL80211_KEY_DEFAULT_MGMT, -+ NL80211_KEY_TYPE, - - /* keep last */ - __NL80211_KEY_AFTER_LAST, + enum nl80211_mesh_setup_params { diff --git a/package/iw/patches/100-rx_rate.patch b/package/iw/patches/100-rx_rate.patch new file mode 100644 index 000000000..e3df6ca09 --- /dev/null +++ b/package/iw/patches/100-rx_rate.patch @@ -0,0 +1,97 @@ +--- a/station.c ++++ b/station.c +@@ -29,13 +29,43 @@ enum plink_actions { + PLINK_ACTION_BLOCK, + }; + ++static void print_sta_bitrate(struct nlattr *nla, const char *name) ++{ ++ struct nlattr *rinfo[NL80211_RATE_INFO_MAX + 1]; ++ ++ static struct nla_policy rate_policy[NL80211_RATE_INFO_MAX + 1] = { ++ [NL80211_RATE_INFO_BITRATE] = { .type = NLA_U16 }, ++ [NL80211_RATE_INFO_MCS] = { .type = NLA_U8 }, ++ [NL80211_RATE_INFO_40_MHZ_WIDTH] = { .type = NLA_FLAG }, ++ [NL80211_RATE_INFO_SHORT_GI] = { .type = NLA_FLAG }, ++ }; ++ ++ if (!nla) ++ return; ++ ++ if (nla_parse_nested(rinfo, NL80211_RATE_INFO_MAX, nla, rate_policy)) { ++ fprintf(stderr, "failed to parse nested rate attributes!\n"); ++ } else { ++ printf("\n\t%s:\t", name); ++ if (rinfo[NL80211_RATE_INFO_BITRATE]) { ++ int rate = nla_get_u16(rinfo[NL80211_RATE_INFO_BITRATE]); ++ printf("%d.%d MBit/s", rate / 10, rate % 10); ++ } ++ ++ if (rinfo[NL80211_RATE_INFO_MCS]) ++ printf(" MCS %d", nla_get_u8(rinfo[NL80211_RATE_INFO_MCS])); ++ if (rinfo[NL80211_RATE_INFO_40_MHZ_WIDTH]) ++ printf(" 40Mhz"); ++ if (rinfo[NL80211_RATE_INFO_SHORT_GI]) ++ printf(" short GI"); ++ } ++} + + static int print_sta_handler(struct nl_msg *msg, void *arg) + { + struct nlattr *tb[NL80211_ATTR_MAX + 1]; + struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg)); + struct nlattr *sinfo[NL80211_STA_INFO_MAX + 1]; +- struct nlattr *rinfo[NL80211_RATE_INFO_MAX + 1]; + char mac_addr[20], state_name[10], dev[20]; + static struct nla_policy stats_policy[NL80211_STA_INFO_MAX + 1] = { + [NL80211_STA_INFO_INACTIVE_TIME] = { .type = NLA_U32 }, +@@ -45,6 +75,7 @@ static int print_sta_handler(struct nl_m + [NL80211_STA_INFO_TX_PACKETS] = { .type = NLA_U32 }, + [NL80211_STA_INFO_SIGNAL] = { .type = NLA_U8 }, + [NL80211_STA_INFO_TX_BITRATE] = { .type = NLA_NESTED }, ++ [NL80211_STA_INFO_RX_BITRATE] = { .type = NLA_NESTED }, + [NL80211_STA_INFO_LLID] = { .type = NLA_U16 }, + [NL80211_STA_INFO_PLID] = { .type = NLA_U16 }, + [NL80211_STA_INFO_PLINK_STATE] = { .type = NLA_U8 }, +@@ -52,13 +83,6 @@ static int print_sta_handler(struct nl_m + [NL80211_STA_INFO_TX_FAILED] = { .type = NLA_U32 }, + }; + +- static struct nla_policy rate_policy[NL80211_RATE_INFO_MAX + 1] = { +- [NL80211_RATE_INFO_BITRATE] = { .type = NLA_U16 }, +- [NL80211_RATE_INFO_MCS] = { .type = NLA_U8 }, +- [NL80211_RATE_INFO_40_MHZ_WIDTH] = { .type = NLA_FLAG }, +- [NL80211_RATE_INFO_SHORT_GI] = { .type = NLA_FLAG }, +- }; +- + nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0), + genlmsg_attrlen(gnlh, 0), NULL); + +@@ -111,25 +135,8 @@ static int print_sta_handler(struct nl_m + printf("\n\tsignal avg:\t%d dBm", + (int8_t)nla_get_u8(sinfo[NL80211_STA_INFO_SIGNAL_AVG])); + +- if (sinfo[NL80211_STA_INFO_TX_BITRATE]) { +- if (nla_parse_nested(rinfo, NL80211_RATE_INFO_MAX, +- sinfo[NL80211_STA_INFO_TX_BITRATE], rate_policy)) { +- fprintf(stderr, "failed to parse nested rate attributes!\n"); +- } else { +- printf("\n\ttx bitrate:\t"); +- if (rinfo[NL80211_RATE_INFO_BITRATE]) { +- int rate = nla_get_u16(rinfo[NL80211_RATE_INFO_BITRATE]); +- printf("%d.%d MBit/s", rate / 10, rate % 10); +- } +- +- if (rinfo[NL80211_RATE_INFO_MCS]) +- printf(" MCS %d", nla_get_u8(rinfo[NL80211_RATE_INFO_MCS])); +- if (rinfo[NL80211_RATE_INFO_40_MHZ_WIDTH]) +- printf(" 40Mhz"); +- if (rinfo[NL80211_RATE_INFO_SHORT_GI]) +- printf(" short GI"); +- } +- } ++ print_sta_bitrate(sinfo[NL80211_STA_INFO_TX_BITRATE], "tx bitrate"); ++ print_sta_bitrate(sinfo[NL80211_STA_INFO_RX_BITRATE], "rx bitrate"); + + if (sinfo[NL80211_STA_INFO_LLID]) + printf("\n\tmesh llid:\t%d", diff --git a/package/iw/patches/100-survey_freq_in_use.patch b/package/iw/patches/100-survey_freq_in_use.patch deleted file mode 100644 index 3933ae379..000000000 --- a/package/iw/patches/100-survey_freq_in_use.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/survey.c -+++ b/survey.c -@@ -44,8 +44,9 @@ static int print_survey_handler(struct n - } - - if (sinfo[NL80211_SURVEY_INFO_FREQUENCY]) -- printf("\tfrequency:\t%u MHz\n", -- nla_get_u32(sinfo[NL80211_SURVEY_INFO_FREQUENCY])); -+ printf("\tfrequency:\t%u MHz%s\n", -+ nla_get_u32(sinfo[NL80211_SURVEY_INFO_FREQUENCY]), -+ sinfo[NL80211_SURVEY_INFO_IN_USE] ? " [in use]" : ""); - if (sinfo[NL80211_SURVEY_INFO_NOISE]) - printf("\tnoise:\t\t%d dBm\n", - (int8_t)nla_get_u8(sinfo[NL80211_SURVEY_INFO_NOISE])); diff --git a/package/iw/patches/110-survey_phy_stats.patch b/package/iw/patches/110-survey_phy_stats.patch deleted file mode 100644 index cdd5c2e48..000000000 --- a/package/iw/patches/110-survey_phy_stats.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- a/survey.c -+++ b/survey.c -@@ -44,12 +44,27 @@ static int print_survey_handler(struct n - } - - if (sinfo[NL80211_SURVEY_INFO_FREQUENCY]) -- printf("\tfrequency:\t%u MHz%s\n", -+ printf("\tfrequency:\t\t\t%u MHz%s\n", - nla_get_u32(sinfo[NL80211_SURVEY_INFO_FREQUENCY]), - sinfo[NL80211_SURVEY_INFO_IN_USE] ? " [in use]" : ""); - if (sinfo[NL80211_SURVEY_INFO_NOISE]) -- printf("\tnoise:\t\t%d dBm\n", -+ printf("\tnoise:\t\t\t\t%d dBm\n", - (int8_t)nla_get_u8(sinfo[NL80211_SURVEY_INFO_NOISE])); -+ if (sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME]) -+ printf("\tchannel active time:\t\t%lld ms\n", -+ (int64_t)nla_get_u64(sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME])); -+ if (sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY]) -+ printf("\tchannel busy time:\t\t%lld ms\n", -+ (int64_t)nla_get_u64(sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY])); -+ if (sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY]) -+ printf("\textension channel busy time:\t%lld ms\n", -+ (int64_t)nla_get_u64(sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY])); -+ if (sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_RX]) -+ printf("\tchannel receive time:\t\t%lld ms\n", -+ (int64_t)nla_get_u64(sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_RX])); -+ if (sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_TX]) -+ printf("\tchannel transmit time:\t\t%lld ms\n", -+ (int64_t)nla_get_u64(sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_TX])); - return NL_SKIP; - } - diff --git a/package/iw/patches/120-ibss_mcast_rate.patch b/package/iw/patches/120-ibss_mcast_rate.patch deleted file mode 100644 index acbd3e89a..000000000 --- a/package/iw/patches/120-ibss_mcast_rate.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- a/ibss.c -+++ b/ibss.c -@@ -83,6 +83,20 @@ static int join_ibss(struct nl80211_stat - argc--; - } - -+ /* multicast rate */ -+ if (argc > 1 && strcmp(argv[0], "mcast-rate") == 0) { -+ argv++; -+ argc--; -+ -+ rate = strtod(argv[0], &end); -+ if (*end != '\0') -+ return 1; -+ -+ NLA_PUT_U32(msg, NL80211_ATTR_MCAST_RATE, (int) rate * 10); -+ argv++; -+ argc--; -+ } -+ - if (!argc) - return 0; - -@@ -109,7 +123,7 @@ COMMAND(ibss, leave, NULL, - "Leave the current IBSS cell."); - COMMAND(ibss, join, - " [fixed-freq] [] " -- "[basic-rates ] [key d:0:abcde]", -+ "[basic-rates ] [mcast-rate ] [key d:0:abcde]", - NL80211_CMD_JOIN_IBSS, 0, CIB_NETDEV, join_ibss, - "Join the IBSS cell with the given SSID, if it doesn't exist create\n" - "it on the given frequency. When fixed frequency is requested, don't\n" diff --git a/package/kernel/modules/wireless.mk b/package/kernel/modules/wireless.mk index 41a05ff59..ff0cdc514 100644 --- a/package/kernel/modules/wireless.mk +++ b/package/kernel/modules/wireless.mk @@ -43,7 +43,7 @@ $(eval $(call KernelPackage,lib80211)) define KernelPackage/net-airo SUBMENU:=$(WIRELESS_MENU) TITLE:=Cisco Aironet driver - DEPENDS:=@PCI_SUPPORT + DEPENDS:=@PCI_SUPPORT +@DRIVER_WEXT_SUPPORT KCONFIG:=CONFIG_AIRO FILES:=$(LINUX_DIR)/drivers/net/wireless/airo.$(LINUX_KMOD_SUFFIX) AUTOLOAD:=$(call AutoLoad,50,airo) @@ -59,7 +59,7 @@ $(eval $(call KernelPackage,net-airo)) define KernelPackage/net-hermes SUBMENU:=$(WIRELESS_MENU) TITLE:=Hermes 802.11b chipset support - DEPENDS:=@LINUX_2_6 @PCI_SUPPORT||PCMCIA_SUPPORT + DEPENDS:=@LINUX_2_6 @PCI_SUPPORT||PCMCIA_SUPPORT +@DRIVER_WEXT_SUPPORT KCONFIG:=CONFIG_HERMES \ CONFIG_HERMES_CACHE_FW_ON_INIT=n FILES:= \ @@ -125,7 +125,7 @@ $(eval $(call KernelPackage,net-hermes-pcmcia)) define KernelPackage/net-prism54 SUBMENU:=$(WIRELESS_MENU) TITLE:=Intersil Prism54 support - DEPENDS:=@PCI_SUPPORT + DEPENDS:=@PCI_SUPPORT +@DRIVER_WEXT_SUPPORT KCONFIG:=CONFIG_PRISM54 FILES:=$(LINUX_DIR)/drivers/net/wireless/prism54/prism54.$(LINUX_KMOD_SUFFIX) AUTOLOAD:=$(call AutoLoad,60,prism54) diff --git a/package/mac80211/Makefile b/package/mac80211/Makefile index 5e49c810b..ea07fff7a 100644 --- a/package/mac80211/Makefile +++ b/package/mac80211/Makefile @@ -10,17 +10,26 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=mac80211 -PKG_VERSION:=2011-02-25 +PKG_VERSION:=2011-03-24 PKG_RELEASE:=1 PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources -PKG_MD5SUM:=c0242cc152a157902ff60fe05d1773b2 +PKG_MD5SUM:=f5713fb3ab59bdd3d0ce931b813ef960 PKG_SOURCE:=compat-wireless-$(PKG_VERSION).tar.bz2 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/compat-wireless-$(PKG_VERSION) PKG_BUILD_PARALLEL:=1 +PKG_DRIVERS = \ + ath5k libertas-usb libertas-sd p54-common p54-pci p54-usb p54-spi \ + rt2x00-lib rt2x00-pci rt2x00-usb rt2x00-soc rt2800-lib rt2400-pci \ + rt2500-pci rt2500-usb rt61-pci rt73-usb rt2800-pci rt2800-usb \ + rtl8180 rtl8187 zd1211rw mac80211-hwsim carl9170 b43 b43legacy \ + ath9k-common ath9k ath9k-htc ath net-libipw net-ipw2100 net-ipw2200 \ + mwl8k net-hermes net-hermes-pci net-hermes-plx net-hermes-pcmcia + PKG_CONFIG_DEPENDS:= \ CONFIG_PACKAGE_kmod-mac80211 \ + $(patsubst %,CONFIG_PACKAGE_kmod-%,$(PKG_DRIVERS)) \ CONFIG_PACKAGE_MAC80211_DEBUGFS \ CONFIG_PACKAGE_ATH_DEBUG \ CONFIG_ATH_USER_REGD \ @@ -274,7 +283,7 @@ endef define KernelPackage/rt2800-lib $(call KernelPackage/rt2x00/Default) - DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT||TARGET_ramips) +kmod-rt2x00-lib +USB_SUPPORT:kmod-rt2x00-usb +TARGET_ramips:kmod-rt2x00-soc + DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT||TARGET_ramips) +kmod-rt2x00-lib +USB_SUPPORT:kmod-rt2x00-usb +TARGET_ramips:kmod-rt2x00-soc +@DRIVER_11N_SUPPORT TITLE+= (rt2800 LIB) FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800lib.ko AUTOLOAD:=$(call AutoLoad,27,rt2800lib) @@ -427,16 +436,25 @@ define KernelPackage/ath5k/description Atheros 5xxx chipset. endef -define KernelPackage/ath9k +define KernelPackage/ath9k-common $(call KernelPackage/mac80211/Default) - TITLE:=Atheros 802.11n wireless cards support + TITLE:=Atheros 802.11n wireless devices (common code for ath9k and ath9k_htc) URL:=http://linuxwireless.org/en/users/Drivers/ath9k - DEPENDS+= @PCI_SUPPORT +kmod-ath + DEPENDS+= @PCI_SUPPORT +kmod-ath +@DRIVER_11N_SUPPORT FILES:= \ $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_common.ko \ - $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_hw.ko \ + $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_hw.ko + AUTOLOAD:=$(call AutoLoad,27,ath9k_hw ath9k_common) +endef + +define KernelPackage/ath9k + $(call KernelPackage/mac80211/Default) + TITLE:=Atheros 802.11n PCI wireless cards support + URL:=http://linuxwireless.org/en/users/Drivers/ath9k + DEPENDS+= @PCI_SUPPORT +kmod-ath9k-common + FILES:= \ $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k.ko - AUTOLOAD:=$(call AutoLoad,27,ath9k_hw ath9k_common ath9k) + AUTOLOAD:=$(call AutoLoad,28,ath9k) endef define KernelPackage/ath9k/description @@ -444,10 +462,50 @@ This module adds support for wireless adapters based on Atheros IEEE 802.11n AR5008 and AR9001 family of chipsets. endef +AR7010FW:=ar7010.fw +AR7010_1_1_FW:=ar7010_1_1.fw +AR9271FW:=ar9271.fw + +define Download/ar9271 + FILE:=$(AR9271FW) + URL:=http://git.kernel.org/?p=linux/kernel/git/dwmw2/linux-firmware.git;a=blob_plain;f=ar9271.fw;h=d0ee74a1c8dccb7cc21f5be90f1d4048fa9dbf9e;hb=HEAD;? + MD5SUM:=2e6f5045ec4c5a42bb93ced242bad0ba +endef +$(eval $(call Download,ar9271)) + +define Download/ar7010 + FILE:=$(AR7010FW) + URL:=http://git.kernel.org/?p=linux/kernel/git/dwmw2/linux-firmware.git;a=blob_plain;f=ar7010.fw;h=840005d0f0c81838c581b8cd5d76c8dd3843731c;hb=HEAD;? + MD5SUM:=59823b82b1f72bed9b044e8cc78ad65c +endef +$(eval $(call Download,ar7010)) + +define Download/ar7010_1_1 + FILE:=$(AR7010_1_1_FW) + URL:=http://git.kernel.org/?p=linux/kernel/git/dwmw2/linux-firmware.git;a=blob_plain;f=ar7010_1_1.fw;h=684d4cd1a8cac4f58305589e31f9d856d03a8ef0;hb=HEAD;? + MD5SUM:=544fcbe5a93cfa53c7e6d3ded2b05347 +endef +$(eval $(call Download,ar7010_1_1)) + +define KernelPackage/ath9k-htc + $(call KernelPackage/mac80211/Default) + TITLE:=Atheros 802.11n USB device support + URL:=http://linuxwireless.org/en/users/Drivers/ath9k + DEPENDS+= @USB_SUPPORT +kmod-ath9k-common +kmod-usb-core + FILES:= \ + $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_htc.ko + AUTOLOAD:=$(call AutoLoad,28,ath9k_htc) +endef + +define KernelPackage/ath9k-htc/description +This module adds support for wireless adapters based on +Atheros USB AR9271 and AR7010 family of chipsets. +endef + define KernelPackage/carl9170 $(call KernelPackage/mac80211/Default) TITLE:=Driver for Atheros AR9170 USB sticks - DEPENDS:=@USB_SUPPORT +kmod-mac80211 +kmod-ath +kmod-usb-core + DEPENDS:=@USB_SUPPORT +kmod-mac80211 +kmod-ath +kmod-usb-core +@DRIVER_11N_SUPPORT FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/carl9170/carl9170.ko AUTOLOAD:=$(call AutoLoad,60,carl9170) endef @@ -499,7 +557,7 @@ endef define KernelPackage/libertas-sd $(call KernelPackage/mac80211/Default) - DEPENDS+= +kmod-mac80211 +kmod-lib80211 + DEPENDS+= +kmod-mac80211 +kmod-lib80211 +@DRIVER_WEXT_SUPPORT TITLE:=Marvell 88W8686 Wireless Driver FILES:= \ $(PKG_BUILD_DIR)/drivers/net/wireless/libertas/libertas.ko \ @@ -579,7 +637,7 @@ endef define KernelPackage/net-hermes $(call KernelPackage/mac80211/Default) TITLE:=Hermes 802.11b chipset support - DEPENDS:=@PCI_SUPPORT||PCMCIA_SUPPORT +kmod-cfg80211 + DEPENDS:=@PCI_SUPPORT||PCMCIA_SUPPORT +kmod-cfg80211 +@DRIVER_WEXT_SUPPORT FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco.ko AUTOLOAD:=$(call AutoLoad,50,orinoco) endef @@ -910,12 +968,13 @@ MAKE_OPTS:= \ CONFIG_ATH5K_PCI=$(if $(CONFIG_TARGET_atheros),,y) \ CONFIG_ATH5K_AHB=$(if $(CONFIG_TARGET_atheros),y) \ CONFIG_ATH9K=$(if $(CONFIG_PACKAGE_kmod-ath9k),m) \ - CONFIG_ATH9K_HW=$(if $(CONFIG_PACKAGE_kmod-ath9k),m) \ - CONFIG_ATH9K_COMMON=$(if $(CONFIG_PACKAGE_kmod-ath9k),m) \ + CONFIG_ATH9K_HTC=$(if $(CONFIG_PACKAGE_kmod-ath9k-htc),m) \ + CONFIG_ATH9K_HW=$(if $(CONFIG_PACKAGE_kmod-ath9k-common),m) \ + CONFIG_ATH9K_COMMON=$(if $(CONFIG_PACKAGE_kmod-ath9k-common),m) \ CONFIG_ATH9K_DEBUGFS=$(if $(CONFIG_PACKAGE_MAC80211_DEBUGFS),y) \ CONFIG_CARL9170=$(if $(CONFIG_PACKAGE_kmod-carl9170),m) \ CONFIG_CARL9170_DEBUGFS=$(if $(CONFIG_PACKAGE_MAC80211_DEBUGFS),y) \ - CONFIG_ZD1211RW=$(if $(CONFIG_PACKAGE_kmod-zd1211rw),m) \ + CONFIG_COMPAT_ZD1211RW=$(if $(CONFIG_PACKAGE_kmod-zd1211rw),m) \ CONFIG_P54_COMMON=$(if $(CONFIG_PACKAGE_kmod-p54-common),m) \ CONFIG_P54_PCI=$(if $(CONFIG_PACKAGE_kmod-p54-pci),m) \ CONFIG_P54_USB=$(if $(CONFIG_PACKAGE_kmod-p54-usb),m) \ @@ -987,7 +1046,6 @@ MAKE_OPTS:= \ CONFIG_AR9170_USB=$(if $(CONFIG_PACKAGE_kmod-ar9170),m) \ CONFIG_AR9170_LEDS=$(CONFIG_LEDS_TRIGGERS) \ CONFIG_IWM= \ - CONFIG_ATH9K_HTC= \ CONFIG_MAC80211_RC_MINSTREL_HT=y \ MADWIFI= \ OLD_IWL= \ @@ -1101,6 +1159,15 @@ define KernelPackage/ar9170/install $(INSTALL_DATA) $(DL_DIR)/$(AR9170FW) $(1)/lib/firmware/ endef +define KernelPackage/ath9k-htc/install + $(INSTALL_DIR) $(1)/lib/firmware + $(INSTALL_DATA) \ + $(DL_DIR)/$(AR9271FW) \ + $(DL_DIR)/$(AR7010FW) \ + $(DL_DIR)/$(AR7010_1_1_FW) \ + $(1)/lib/firmware/ +endef + define KernelPackage/net-ipw2100/install $(INSTALL_DIR) $(1)/lib/firmware $(INSTALL_DATA) $(PKG_BUILD_DIR)/ipw2100-$(IPW2100_VERSION)*.fw $(1)/lib/firmware @@ -1184,7 +1251,9 @@ $(eval $(call KernelPackage,rtl8180)) $(eval $(call KernelPackage,rtl8187)) $(eval $(call KernelPackage,zd1211rw)) $(eval $(call KernelPackage,mac80211-hwsim)) +$(eval $(call KernelPackage,ath9k-common)) $(eval $(call KernelPackage,ath9k)) +$(eval $(call KernelPackage,ath9k-htc)) $(eval $(call KernelPackage,ath)) $(eval $(call KernelPackage,carl9170)) $(eval $(call KernelPackage,b43)) diff --git a/package/mac80211/files/lib/wifi/mac80211.sh b/package/mac80211/files/lib/wifi/mac80211.sh index 2f4abd085..d395db11d 100644 --- a/package/mac80211/files/lib/wifi/mac80211.sh +++ b/package/mac80211/files/lib/wifi/mac80211.sh @@ -6,10 +6,15 @@ mac80211_hostapd_setup_base() { local ifname="$2" cfgfile="/var/run/hostapd-$phy.conf" + macfile="/var/run/hostapd-$phy.maclist" + [ -e "$macfile" ] && rm -f "$macfile" + config_get device "$vif" device config_get country "$device" country config_get hwmode "$device" hwmode config_get channel "$device" channel + config_get beacon_int "$device" beacon_int + config_get basic_rate_list "$device" basic_rate config_get_bool noscan "$device" noscan [ -n "$channel" -a -z "$hwmode" ] && wifi_fixup_hwmode "$device" [ "$channel" = auto ] && channel= @@ -30,7 +35,35 @@ mac80211_hostapd_setup_base() { [ -n "$ht_capab" ] && append base_cfg "ht_capab=$ht_capab" "$N" } } - cat > "$cfgfile" <> $macfile + done + } + + local br brval brstr + [ -n "$basic_rate_list" ] && { + for br in $basic_rate_list; do + brval="$(($br / 100))" + [ -n "$brstr" ] && brstr="$brstr " + brstr="$brstr$brval" + done + } + + cat >> "$cfgfile" <