hostapd: backport mesh/ibss HT20/HT40 related fix
authorFelix Fietkau <nbd@nbd.name>
Tue, 26 Jul 2016 11:47:00 +0000 (13:47 +0200)
committerFelix Fietkau <nbd@nbd.name>
Wed, 27 Jul 2016 15:22:39 +0000 (17:22 +0200)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
package/network/services/hostapd/patches/002-mesh-Set-correct-secondary-channel-offset-if-HT40-is.patch [new file with mode: 0644]
package/network/services/hostapd/patches/200-multicall.patch
package/network/services/hostapd/patches/310-rescan_immediately.patch
package/network/services/hostapd/patches/370-ap_sta_support.patch
package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch
package/network/services/hostapd/patches/462-wpa_s-support-htmode-param.patch

diff --git a/package/network/services/hostapd/patches/002-mesh-Set-correct-secondary-channel-offset-if-HT40-is.patch b/package/network/services/hostapd/patches/002-mesh-Set-correct-secondary-channel-offset-if-HT40-is.patch
new file mode 100644 (file)
index 0000000..2439220
--- /dev/null
@@ -0,0 +1,61 @@
+From: Masashi Honma <masashi.honma@gmail.com>
+Date: Tue, 26 Jul 2016 11:45:40 +0900
+Subject: [PATCH] mesh: Set correct secondary channel offset if HT40 is
+ disabled
+
+Previously, secondary channel offset could be non zero even though
+disable_ht40=1. This patch fixes it.
+
+Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
+---
+
+--- a/wpa_supplicant/wpa_supplicant.c
++++ b/wpa_supplicant/wpa_supplicant.c
+@@ -1901,20 +1901,27 @@ void ibss_mesh_setup_freq(struct wpa_sup
+                       break;
+               }
+       }
++#ifdef CONFIG_HT_OVERRIDES
++      if (ssid->disable_ht40)
++              ht40 = 0;
++#endif /* CONFIG_HT_OVERRIDES */
+-      /* Find secondary channel */
+-      for (i = 0; i < mode->num_channels; i++) {
+-              sec_chan = &mode->channels[i];
+-              if (sec_chan->chan == channel + ht40 * 4)
+-                      break;
+-              sec_chan = NULL;
+-      }
+-      if (!sec_chan)
+-              return;
++      if (ht40) {
++              /* Find secondary channel */
++              for (i = 0; i < mode->num_channels; i++) {
++                      sec_chan = &mode->channels[i];
++                      if (sec_chan->chan == channel + ht40 * 4)
++                              break;
++                      sec_chan = NULL;
++              }
++              if (!sec_chan)
++                      return;
+-      /* Check secondary channel flags */
+-      if (sec_chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
+-              return;
++              /* Check secondary channel flags */
++              if (sec_chan->flag &
++                  (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
++                      return;
++      }
+       freq->channel = pri_chan->chan;
+@@ -1930,6 +1937,7 @@ void ibss_mesh_setup_freq(struct wpa_sup
+               freq->sec_channel_offset = 1;
+               break;
+       default:
++              freq->sec_channel_offset = 0;
+               break;
+       }
index 7d83ee812194257934fad436c3d101db807d9d22..8b260c2383e0eb3200e98359e1be7e504e2df024 100644 (file)
        struct wpa_supplicant *wpa_s;
 --- a/wpa_supplicant/wpa_supplicant.c
 +++ b/wpa_supplicant/wpa_supplicant.c
-@@ -4982,7 +4982,6 @@ struct wpa_interface * wpa_supplicant_ma
+@@ -4990,7 +4990,6 @@ struct wpa_interface * wpa_supplicant_ma
        return NULL;
  }
  
  /**
   * wpa_supplicant_match_existing - Match existing interfaces
   * @global: Pointer to global data from wpa_supplicant_init()
-@@ -5019,6 +5018,11 @@ static int wpa_supplicant_match_existing
+@@ -5027,6 +5026,11 @@ static int wpa_supplicant_match_existing
  
  #endif /* CONFIG_MATCH_IFACE */
  
  
  /**
   * wpa_supplicant_add_iface - Add a new network interface
-@@ -5274,6 +5278,8 @@ struct wpa_global * wpa_supplicant_init(
+@@ -5282,6 +5286,8 @@ struct wpa_global * wpa_supplicant_init(
  #ifndef CONFIG_NO_WPA_MSG
        wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb);
  #endif /* CONFIG_NO_WPA_MSG */
index d9486ed4051bd8e77e91219488ba01f8ebfc0f81..3f46cc4ac1d2ea3a3450b1c70375bc7c37a1ec41 100644 (file)
@@ -1,6 +1,6 @@
 --- a/wpa_supplicant/wpa_supplicant.c
 +++ b/wpa_supplicant/wpa_supplicant.c
-@@ -3548,7 +3548,7 @@ wpa_supplicant_alloc(struct wpa_supplica
+@@ -3556,7 +3556,7 @@ wpa_supplicant_alloc(struct wpa_supplica
        if (wpa_s == NULL)
                return NULL;
        wpa_s->scan_req = INITIAL_SCAN_REQ;
index 6b70215c437251c54889382191167490ffc9e377..7a4ba0ba7a4ab7259eade56f202b961ae097d7a9 100644 (file)
                wpa_s->new_connection = 1;
                wpa_drv_set_operstate(wpa_s, 0);
  #ifndef IEEE8021X_EAPOL
-@@ -4638,6 +4691,20 @@ static int wpa_supplicant_init_iface(str
+@@ -4646,6 +4699,20 @@ static int wpa_supplicant_init_iface(str
                           sizeof(wpa_s->bridge_ifname));
        }
  
        /* RSNA Supplicant Key Management - INITIALIZE */
        eapol_sm_notify_portEnabled(wpa_s->eapol, FALSE);
        eapol_sm_notify_portValid(wpa_s->eapol, FALSE);
-@@ -4929,6 +4996,11 @@ static void wpa_supplicant_deinit_iface(
+@@ -4937,6 +5004,11 @@ static void wpa_supplicant_deinit_iface(
        if (terminate)
                wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_TERMINATING);
  
index 169b17100d5cd763889d7046b1f36b9e8460c16e..6a5866e17c0305e92c9ca20f7b09768d60dfafab 100644 (file)
@@ -175,7 +175,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
         * macsec_policy - Determines the policy for MACsec secure session
 --- a/wpa_supplicant/wpa_supplicant.c
 +++ b/wpa_supplicant/wpa_supplicant.c
-@@ -2510,6 +2510,13 @@ static void wpas_start_assoc_cb(struct w
+@@ -2518,6 +2518,13 @@ static void wpas_start_assoc_cb(struct w
                        params.beacon_int = ssid->beacon_int;
                else
                        params.beacon_int = wpa_s->conf->beacon_int;
index a81465c56f17c7060eeaa6a3c99a3c4a38e0e6e2..80fe49ccb20f0e9caf5e690fe18f3c31fe351a8e 100644 (file)
@@ -145,7 +145,7 @@ Signed-off-by: Antonio Quartulli <ordex@autistici.org>
        /**
 --- a/wpa_supplicant/wpa_supplicant.c
 +++ b/wpa_supplicant/wpa_supplicant.c
-@@ -2517,6 +2517,8 @@ static void wpas_start_assoc_cb(struct w
+@@ -2525,6 +2525,8 @@ static void wpas_start_assoc_cb(struct w
                        i++;
                }
                params.mcast_rate = ssid->mcast_rate;