]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Define helper function set_disable_ht40()
authorMasashi Honma <masashi.honma@gmail.com>
Fri, 27 Jan 2017 04:43:19 +0000 (13:43 +0900)
committerJouni Malinen <j@w1.fi>
Sun, 29 Jan 2017 16:04:21 +0000 (18:04 +0200)
This functionality can be used outside wpa_set_disable_ht40(), so move
the generic part to a helper function.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
src/common/hw_features_common.c
src/common/hw_features_common.h
wpa_supplicant/wpa_supplicant.c

index 9c37ea63ca87825cce8312cc3535460508c69ffe..ef4b59df3406eb2ac4b45d36b1d9d81f6a25d29b 100644 (file)
@@ -453,3 +453,17 @@ int hostapd_set_freq_params(struct hostapd_freq_params *data,
 
        return 0;
 }
+
+
+void set_disable_ht40(struct ieee80211_ht_capabilities *htcaps,
+                     int disabled)
+{
+       /* Masking these out disables HT40 */
+       le16 msk = host_to_le16(HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET |
+                               HT_CAP_INFO_SHORT_GI40MHZ);
+
+       if (disabled)
+               htcaps->ht_capabilities_info &= ~msk;
+       else
+               htcaps->ht_capabilities_info |= msk;
+}
index 7360b4e3efede5721ff9fcaf453277efd713e8e4..234b7bf4d4ae569cd7c14b30206501bc17d2c7d2 100644 (file)
@@ -35,5 +35,7 @@ int hostapd_set_freq_params(struct hostapd_freq_params *data,
                            int vht_enabled, int sec_channel_offset,
                            int vht_oper_chwidth, int center_segment0,
                            int center_segment1, u32 vht_caps);
+void set_disable_ht40(struct ieee80211_ht_capabilities *htcaps,
+                     int disabled);
 
 #endif /* HW_FEATURES_COMMON_H */
index 75e58eef3b1c0e8dc48c59b6138413297b255ca3..1c02020ad5e7be4f42c53bbb013f757042b40b4c 100644 (file)
@@ -3873,18 +3873,10 @@ static int wpa_set_disable_ht40(struct wpa_supplicant *wpa_s,
                                struct ieee80211_ht_capabilities *htcaps_mask,
                                int disabled)
 {
-       /* Masking these out disables HT40 */
-       le16 msk = host_to_le16(HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET |
-                               HT_CAP_INFO_SHORT_GI40MHZ);
-
        wpa_msg(wpa_s, MSG_DEBUG, "set_disable_ht40: %d", disabled);
 
-       if (disabled)
-               htcaps->ht_capabilities_info &= ~msk;
-       else
-               htcaps->ht_capabilities_info |= msk;
-
-       htcaps_mask->ht_capabilities_info |= msk;
+       set_disable_ht40(htcaps, disabled);
+       set_disable_ht40(htcaps_mask, 0);
 
        return 0;
 }