hostapd: add HT40 patch
authorGustavo Zacarias <gustavo@zacarias.com.ar>
Sat, 15 Oct 2011 03:07:37 +0000 (00:07 -0300)
committerPeter Korsgaard <jacmet@sunsite.dk>
Sat, 15 Oct 2011 21:23:34 +0000 (23:23 +0200)
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
package/hostapd/hostapd-0.7.3-ht40-secondary.patch [new file with mode: 0644]
package/hostapd/hostapd.mk

diff --git a/package/hostapd/hostapd-0.7.3-ht40-secondary.patch b/package/hostapd/hostapd-0.7.3-ht40-secondary.patch
new file mode 100644 (file)
index 0000000..7664f03
--- /dev/null
@@ -0,0 +1,52 @@
+From dea50507861b79f522c70500fe978072f143af8f Mon Sep 17 00:00:00 2001
+From: Jouni Malinen <jouni.malinen@atheros.com>
+Date: Fri, 12 Nov 2010 18:31:56 +0200
+Subject: [PATCH] AP: Verify that HT40 secondary channel is supported
+
+Refuse to enable HT40 mode AP unless both the primary and secondary
+channels are enabled for AP use.
+(cherry picked from commit 8ea3dd21d2e8b760612af0c7b6a3bb5b89ba7304)
+---
+ src/ap/hw_features.c |   26 ++++++++++++++++++++++++++
+ 1 files changed, 26 insertions(+), 0 deletions(-)
+
+diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c
+index 0159c72..7fc5b83 100644
+--- a/src/ap/hw_features.c
++++ b/src/ap/hw_features.c
+@@ -642,6 +642,32 @@ int hostapd_select_hw_mode(struct hostapd_iface *iface)
+                       break;
+               }
+       }
++      if (ok && iface->conf->secondary_channel) {
++              int sec_ok = 0;
++              int sec_chan = iface->conf->channel +
++                      iface->conf->secondary_channel * 4;
++              for (j = 0; j < iface->current_mode->num_channels; j++) {
++                      struct hostapd_channel_data *chan =
++                              &iface->current_mode->channels[j];
++                      if (!(chan->flag & HOSTAPD_CHAN_DISABLED) &&
++                          (chan->chan == sec_chan)) {
++                              sec_ok = 1;
++                              break;
++                      }
++              }
++              if (!sec_ok) {
++                      hostapd_logger(iface->bss[0], NULL,
++                                     HOSTAPD_MODULE_IEEE80211,
++                                     HOSTAPD_LEVEL_WARNING,
++                                     "Configured HT40 secondary channel "
++                                     "(%d) not found from the channel list "
++                                     "of current mode (%d) %s",
++                                     sec_chan, iface->current_mode->mode,
++                                     hostapd_hw_mode_txt(
++                                             iface->current_mode->mode));
++                      ok = 0;
++              }
++      }
+       if (iface->conf->channel == 0) {
+               /* TODO: could request a scan of neighboring BSSes and select
+                * the channel automatically */
+-- 
+1.7.4-rc1
+
index 6ffca0a45c1b9e9fd661adcaa73f3130242c489f..0d6c2c53a54f00c00f7b80b227e5b7a243675b69 100644 (file)
@@ -9,7 +9,6 @@ HOSTAPD_SITE = http://hostap.epitest.fi/releases
 HOSTAPD_SUBDIR = hostapd
 HOSTAPD_CONFIG = $(HOSTAPD_DIR)/$(HOSTAPD_SUBDIR)/.config
 HOSTAPD_DEPENDENCIES = libnl
-
 HOSTAPD_LDFLAGS = $(TARGET_LDFLAGS)
 
 # libnl needs -lm (for rint) if linking statically