backport mac80211, hostapd, iw, crda from trunk as of r26369
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 30 Mar 2011 12:37:36 +0000 (12:37 +0000)
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 30 Mar 2011 12:37:36 +0000 (12:37 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/branches/backfire@26370 3c298f89-4303-0410-b956-a3cf2f4a3e73

89 files changed:
package/crda/Makefile
package/hostapd/Config.in
package/hostapd/Makefile
package/hostapd/files/hostapd-full.config
package/hostapd/files/hostapd.sh
package/hostapd/files/wpa_supplicant.sh
package/hostapd/patches/001-nl80211_sync.patch [deleted file]
package/hostapd/patches/100-madwifi_fix.patch [deleted file]
package/hostapd/patches/110-countrycode.patch [deleted file]
package/hostapd/patches/120-compile_fix.patch [deleted file]
package/hostapd/patches/300-scan_ssid.patch [moved from package/hostapd/patches/310-scan_ssid.patch with 82% similarity]
package/hostapd/patches/310-madwifi_merge.patch [moved from package/hostapd/patches/330-madwifi_merge.patch with 88% similarity]
package/hostapd/patches/320-nl80211_multicall_fixes.patch [moved from package/hostapd/patches/390-nl80211_fixes.patch with 68% similarity]
package/hostapd/patches/330-multicall_bridge_fix.patch [moved from package/hostapd/patches/430-supplicant_bridge_fix.patch with 72% similarity]
package/hostapd/patches/340-madwifi_key_fixes.patch [new file with mode: 0644]
package/hostapd/patches/340-roboswitch_fix.patch [deleted file]
package/hostapd/patches/350-hostap_multicall_fix.patch [new file with mode: 0644]
package/hostapd/patches/350-wds_fix.patch [deleted file]
package/hostapd/patches/360-wds_bridge.patch [deleted file]
package/hostapd/patches/370-basic_rates.patch [deleted file]
package/hostapd/patches/380-ap_isolate.patch [deleted file]
package/hostapd/patches/400-nl80211_sta_auth.patch [deleted file]
package/hostapd/patches/420-stbc_fix_backport.patch [deleted file]
package/hostapd/patches/440-mbss_reload_fix.patch [deleted file]
package/hostapd/patches/460-oper_state_fix.patch [deleted file]
package/hostapd/patches/500-scan_wait.patch [moved from package/hostapd/patches/130-scan_wait.patch with 87% similarity]
package/hostapd/patches/510-multicall.patch [moved from package/hostapd/patches/200-multicall.patch with 72% similarity]
package/hostapd/patches/520-timestamp_check.patch [moved from package/hostapd/patches/300-timestamp_check.patch with 100% similarity]
package/hostapd/patches/530-rescan_immediately.patch [moved from package/hostapd/patches/320-rescan_immediately.patch with 51% similarity]
package/hostapd/patches/540-optional_rfkill.patch [moved from package/hostapd/patches/410-no_rfkill.patch with 70% similarity]
package/hostapd/patches/550-reload_freq_change.patch [moved from package/hostapd/patches/450-reload_settings.patch with 84% similarity]
package/hostapd/patches/551-nl80211_del_beacon_bss.patch [moved from package/hostapd/patches/451-nl80211_del_beacon_bss.patch with 75% similarity]
package/hostapd/patches/552-ctrl_iface_reload.patch [moved from package/hostapd/patches/452-ctrl_iface_reload.patch with 84% similarity]
package/hostapd/patches/553-ap_sta_support.patch [moved from package/hostapd/patches/453-ap_sta_support.patch with 91% similarity]
package/hostapd/patches/560-disable_ctrl_iface_mib.patch [new file with mode: 0644]
package/hostapd/patches/600-terminate_on_setup_failure.patch
package/hostapd/patches/700-random_pool_add_kernel.patch [new file with mode: 0644]
package/hostapd/patches/710-bring_down_interface.patch [new file with mode: 0644]
package/hostapd/patches/720-fix_wps_pin_crash.patch [new file with mode: 0644]
package/hostapd/patches/730-nl80211_enable_qosdata.patch [new file with mode: 0644]
package/iw/Makefile
package/iw/patches/001-nl80211_sync.patch
package/iw/patches/100-rx_rate.patch [new file with mode: 0644]
package/iw/patches/100-survey_freq_in_use.patch [deleted file]
package/iw/patches/110-survey_phy_stats.patch [deleted file]
package/iw/patches/120-ibss_mcast_rate.patch [deleted file]
package/kernel/modules/wireless.mk
package/mac80211/Makefile
package/mac80211/files/lib/wifi/mac80211.sh
package/mac80211/patches/030-backport_93c86_eeprom.patch [deleted file]
package/mac80211/patches/030-disable_tty_set_termios.patch [new file with mode: 0644]
package/mac80211/patches/050-fix_missing_include.patch [deleted file]
package/mac80211/patches/300-ath9k_gpio_settings.patch [deleted file]
package/mac80211/patches/300-pending_work.patch [new file with mode: 0644]
package/mac80211/patches/401-ath9k-dont-register-leds-on-ar9100.patch
package/mac80211/patches/402-ath9k_blink_default.patch
package/mac80211/patches/403-ath9k-fix-invalid-mac-address-handling.patch
package/mac80211/patches/407-ath9k-override-mac-address-from-platform-data.patch [deleted file]
package/mac80211/patches/409-ath9k_platform_settings.patch [deleted file]
package/mac80211/patches/500-ath9k_eeprom_debugfs.patch
package/mac80211/patches/510-ath9k_intr_mitigation_tweak.patch [moved from package/mac80211/patches/520-ath9k_intr_mitigation_tweak.patch with 86% similarity]
package/mac80211/patches/510-ath9k_led_cleanup.patch [deleted file]
package/mac80211/patches/520-mac80211_drv_tim_override.patch [moved from package/mac80211/patches/530-mac80211_drv_tim_override.patch with 89% similarity]
package/mac80211/patches/521-ath9k_fix_ap_ps_buffering.patch [moved from package/mac80211/patches/531-ath9k_fix_ap_ps_buffering.patch with 95% similarity]
package/mac80211/patches/522-ath9k_fix_pspoll_recv.patch [moved from package/mac80211/patches/532-ath9k_fix_pspoll_recv.patch with 100% similarity]
package/mac80211/patches/530-mac80211_redirect_vlan_eap_frames.patch [moved from package/mac80211/patches/580-mac80211_redirect_vlan_eap_frames.patch with 84% similarity]
package/mac80211/patches/532-ath9k_remove_pending_frames_workaround.patch [deleted file]
package/mac80211/patches/540-mac80211_add_rx_rate.patch [deleted file]
package/mac80211/patches/540-mac80211_fix_rx_reorder_timeout.patch [moved from package/mac80211/patches/561-mac80211_fix_rx_reorder_timeout.patch with 100% similarity]
package/mac80211/patches/550-ath9k_increase_bcbuf.patch [new file with mode: 0644]
package/mac80211/patches/550-ath9k_no_vif_promisc_handling.patch [deleted file]
package/mac80211/patches/560-ath9k_fix_reported_signal_strength.patch [new file with mode: 0644]
package/mac80211/patches/560-mac80211_minstrel_ht_sampling_fix.patch [deleted file]
package/mac80211/patches/562-mac80211_initialize_last_rx.patch [deleted file]
package/mac80211/patches/570-ath9k_fix_reg_bit_macros.patch [deleted file]
package/mac80211/patches/571-ath9k_fix_dma_stop.patch [deleted file]
package/mac80211/patches/572-ath9k_fix_tx_flush.patch [deleted file]
package/mac80211/patches/573-ath9k_beacon_stop.patch [deleted file]
package/mac80211/patches/574-ath9k_ar9100_blockack_fix.patch [deleted file]
package/mac80211/patches/575-ath9k_ar9100_rx_chainmask_fix.patch [deleted file]
package/mac80211/patches/576-ath9k_fix_start_wakeup.patch [deleted file]
package/mac80211/patches/581-mac80211_chantype_change_fix.patch [deleted file]
package/mac80211/patches/582-mac80211_fix_ibss_probereq_handling.patch [deleted file]
package/mac80211/patches/583-mac80211_fix_minstrel_ht_crash.patch [deleted file]
package/mac80211/patches/590-ath9k_tid_cleanup_send_bar.patch [deleted file]
package/mac80211/patches/700-mwl8k-missing-pci-id-for-WNR854T.patch
package/mac80211/patches/710-p54_rssi_crash_fix.patch [deleted file]
package/mac80211/patches/720-mac80211-print-restart-warning.patch [deleted file]
package/mac80211/patches/721-mac80211-fix-scan-race.patch [deleted file]

index b479090c427aecff73d3f9b6d1b546920f07c488..95a184c219d631d1c298780b4db965c7e729d7b1 100644 (file)
@@ -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
 
index a74cbae966f1d9ac5c26d1e9935d9c6eb1d823c3..a88f977c19861aa0ad6da0c52fed6b0a170448ca 100644 (file)
@@ -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
index 6f3c639e69ca1db4981efb200b8160079afe93a8..b232b311b20fa19bef4752a4f5ba332c3584e51b 100644 (file)
@@ -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
index cf7993c3465c567cc9901c5f574df3e93227f534..33de7e0df3839c041e1ccd1664b5a3ac5d0e8d0c 100644 (file)
@@ -158,3 +158,5 @@ CONFIG_INTERNAL_AES=y
 NEED_AES_DEC=y
 
 CONFIG_WPS=y
+CONFIG_FULL_DYNAMIC_VLAN=y
+
index 98c3f61e5889e212248e4ce7e0d6671cee5e3e69..5b69ecd622c3274c63f167fa151c6e761508bf55 100644 (file)
@@ -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"
-
-       [ "$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
+       [ -n "$iapp_interface" ] && append "$var" iapp_interface=$(uci_get_state network "$iapp_interface" ifname "$iapp_interface") "$N"
+
+       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 <<EOF
-ctrl_interface=/var/run/hostapd-$ifname
 driver=$driver
 interface=$ifname
 ${hwmode:+hw_mode=${hwmode#11}}
index 515fa6c0da3d8d645cd5ef234d1cfa93c3838144..6112517f37cb31b862368c78a40684c03b9c708a 100644 (file)
@@ -77,8 +77,10 @@ wpa_supplicant_setup_vif() {
                                tls)
                                        pairwise='pairwise=CCMP'
                                        group='group=CCMP'
+                                       config_get identity "$vif" identity
                                        config_get priv_key "$vif" priv_key
                                        config_get priv_key_pwd "$vif" priv_key_pwd
+                                       identity="identity=\"$identity\""
                                        priv_key="private_key=\"$priv_key\""
                                        priv_key_pwd="private_key_passwd=\"$priv_key_pwd\""
                                ;;
diff --git a/package/hostapd/patches/001-nl80211_sync.patch b/package/hostapd/patches/001-nl80211_sync.patch
deleted file mode 100644 (file)
index a9310c7..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
---- a/src/drivers/nl80211_copy.h
-+++ b/src/drivers/nl80211_copy.h
-@@ -709,6 +709,9 @@ enum nl80211_commands {
-  *    NL80211_CMD_AUTHENTICATE, NL80211_CMD_DEAUTHENTICATE,
-  *    NL80211_CMD_DISASSOCIATE.
-  *
-+ * @NL80211_ATTR_AP_ISOLATE: (AP mode) Do not forward traffic between stations
-+ *    connected to this BSS.
-+ *
-  * @NL80211_ATTR_MAX: highest attribute number currently defined
-  * @__NL80211_ATTR_AFTER_LAST: internal use
-  */
-@@ -864,6 +867,8 @@ enum nl80211_attrs {
-       NL80211_ATTR_LOCAL_STATE_CHANGE,
-+      NL80211_ATTR_AP_ISOLATE,
-+
-       /* add attributes here, update the policy in nl80211.c */
-       __NL80211_ATTR_AFTER_LAST,
diff --git a/package/hostapd/patches/100-madwifi_fix.patch b/package/hostapd/patches/100-madwifi_fix.patch
deleted file mode 100644 (file)
index 736b295..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
---- a/src/drivers/driver_madwifi.c
-+++ b/src/drivers/driver_madwifi.c
-@@ -1177,8 +1177,6 @@ madwifi_init(struct hostapd_data *hapd, 
-               goto bad;
-       }
--      /* mark down during setup */
--      linux_set_iface_flags(drv->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 (file)
index 11cf06e..0000000
+++ /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 (file)
index 89480c1..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
---- a/src/drivers/driver_nl80211.c
-+++ b/src/drivers/driver_nl80211.c
-@@ -22,6 +22,7 @@
- #include <netlink/genl/genl.h>
- #include <netlink/genl/family.h>
- #include <netlink/genl/ctrl.h>
-+#include <linux/rtnetlink.h>
- #include <netpacket/packet.h>
- #include <linux/filter.h>
- #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];
similarity index 82%
rename from package/hostapd/patches/310-scan_ssid.patch
rename to package/hostapd/patches/300-scan_ssid.patch
index 884459ce6651163a8a859ff084a90799a7a96928..47528f8b6b56bf79c60450dde0ba96b6541d075a 100644 (file)
@@ -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);
        }
  
similarity index 88%
rename from package/hostapd/patches/330-madwifi_merge.patch
rename to package/hostapd/patches/310-madwifi_merge.patch
index cddffe4b919ac1ef7ff479ad8266091cc33170e7..f0888f073ba899ec068bfffc997800e45f6342be 100644 (file)
  {
        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;
        } 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
  }
  
  
  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,
  
        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;
  
                                       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));
        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;
        }
                                        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;
                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));
  
        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);
        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));
        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));
        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 */
                              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;
  
                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
 -      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));
 -              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);
 -
                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;
  
                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 */
                        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,
                        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)
  {
        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;
  
        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;
  
                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)
  {
        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)
  {
        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) +
  
        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)
  {
  
        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));
                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:
  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)
  {
  #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,
        .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
similarity index 68%
rename from package/hostapd/patches/390-nl80211_fixes.patch
rename to package/hostapd/patches/320-nl80211_multicall_fixes.patch
index 20c603252c49ce1a0eb5caa6838ff4c1c8bb4273..9bd73697007b7f28a05c0ecc790166a57c5a7837 100644 (file)
@@ -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;
  
 -              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 "
 -                      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 "
 +                                     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 */
  #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 */
  #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);
similarity index 72%
rename from package/hostapd/patches/430-supplicant_bridge_fix.patch
rename to package/hostapd/patches/330-multicall_bridge_fix.patch
index feddf6fed0883df5ca0737ef9a4b8a0ab4b42663..96456ea728b5356d1a51075e330364510da3c369 100644 (file)
@@ -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 (file)
index 0000000..ab4d057
--- /dev/null
@@ -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 (file)
index 50dca64..0000000
+++ /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 <sys/ioctl.h>
--#include <linux/if.h>
- #include <linux/sockios.h>
- #include <linux/if_ether.h>
- #include <linux/mii.h>
-+#include <net/if.h>
- #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 (file)
index 0000000..a4b6cc6
--- /dev/null
@@ -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 <net/if_arp.h>
+ #include <netpacket/packet.h>
+@@ -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, &param, sizeof(param), 1);
++      ret = wpa_hostapd_ioctl(drv, &param, 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, &param, sizeof(param), 1);
++      ret = wpa_hostapd_ioctl(drv, &param, 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 (file)
index 3a3ee00..0000000
+++ /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 (file)
index 4cc60de..0000000
+++ /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 (file)
index 6c3fafe..0000000
+++ /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 (file)
index 12fbdc8..0000000
+++ /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 (file)
index 41c68c0..0000000
+++ /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 (file)
index 89998d9..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-From: Helmut Schaa <helmut.schaa@googlemail.com>
-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 <helmut.schaa@googlemail.com>
----
-
---- 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 (file)
index ed513b1..0000000
+++ /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 (file)
index 5a685a2..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-From: Jouni Malinen <jouni.malinen@atheros.com>
-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;
- }
similarity index 87%
rename from package/hostapd/patches/130-scan_wait.patch
rename to package/hostapd/patches/500-scan_wait.patch
index 1f249533f0addca5d077dafa9fa72b4614183cea..14dccc326b7cadeaaf90d05c6f4ed3aa7489233f 100644 (file)
@@ -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);
  
        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;
        }
  
                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);
  
 +      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
                } 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;
  
similarity index 72%
rename from package/hostapd/patches/200-multicall.patch
rename to package/hostapd/patches/510-multicall.patch
index a35b5c8d35e896c54450f571627f50585634318d..e705792cd63b6ac08d8072d92d0f791a432caea8 100644 (file)
@@ -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
  
 +      @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
  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
  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
 +      @$(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 " $<
  
  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.
   */
  /*
 --- 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
  }
  
  
  {
        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
        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,
        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,
 +
  
  /**
-  * 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);
                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,
  
  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
similarity index 51%
rename from package/hostapd/patches/320-rescan_immediately.patch
rename to package/hostapd/patches/530-rescan_immediately.patch
index 19183040a9e1da7ed29404d5394e61ed49bc1aa8..b6efbb8d0c3b6dab913e057fbbc77c461dd4f038 100644 (file)
@@ -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) {
similarity index 70%
rename from package/hostapd/patches/410-no_rfkill.patch
rename to package/hostapd/patches/540-optional_rfkill.patch
index f7e8bc057cb58d4b90d354444ae296eee0631669..dd460835c625b9d23bc2f87324c1c2153e0b4c51 100644 (file)
@@ -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;
  }
  
  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) {
        }
  
        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);
  
        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
        }
  }
  
  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;
        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;
        }
  
        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);
        }
  
        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:
        netlink_deinit(drv->netlink);
  err2:
        close(drv->ioctl_sock);
-@@ -802,10 +808,12 @@ err1:
+@@ -838,10 +844,12 @@ err1:
  }
  
  
  
  
  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) {
                        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) {
        }
  
        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);
                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
  
 --- 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;
similarity index 84%
rename from package/hostapd/patches/450-reload_settings.patch
rename to package/hostapd/patches/550-reload_freq_change.patch
index 5f226124c34787d13b18e7d056b7fc81d7e64927..ce9c1bf01929d87bb5c9e3a568e646d62edaa77b 100644 (file)
@@ -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;
  
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 b23acc6f019a7b91be66811dd664acde2c33fb0b..bd71a7bafdc47787db68195848e22a90a429f183 100644 (file)
@@ -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
  }
  
  
  
  /**
   * 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);
  };
similarity index 84%
rename from package/hostapd/patches/452-ctrl_iface_reload.patch
rename to package/hostapd/patches/552-ctrl_iface_reload.patch
index e07ab6d440d7cce6fcfe46bd15189682b43d4bee..a780f7dca9418655a802d2412db040b4ea60b744 100644 (file)
@@ -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 */
similarity index 91%
rename from package/hostapd/patches/453-ap_sta_support.patch
rename to package/hostapd/patches/553-ap_sta_support.patch
index 930981dd3888caf684d57d70af2f837794c44c9a..d94808e87a96529abdc02fda30b177d54c11d527 100644 (file)
@@ -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[];
  
  /* 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);
                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));
        }
  #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)
  {
        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 (file)
index 0000000..f186235
--- /dev/null
@@ -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 */
index 9385413e597a7933e158f8f5df697309df3b7809..63d3ec50155dad0471708b540439dcb5e1521170 100644 (file)
@@ -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");
                }
        }
  
-@@ -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 (file)
index 0000000..1edaff9
--- /dev/null
@@ -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 (file)
index 0000000..bfd5ef6
--- /dev/null
@@ -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 (file)
index 0000000..e1a3184
--- /dev/null
@@ -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 (file)
index 0000000..08bebe1
--- /dev/null
@@ -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&nb