]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
bsd: Add support for setting HT values in IFM_MMASK
authorYi Zhu <Yi.Zhu@Atheros.com>
Thu, 14 Apr 2011 19:22:24 +0000 (22:22 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 14 Apr 2011 19:22:24 +0000 (22:22 +0300)
src/drivers/driver_bsd.c

index dc3e264995ad3034c2ddb3b608affdd9a490b723..1b52865eaedb0b35c82a22037547b4aec4e67632 100644 (file)
@@ -536,12 +536,21 @@ bsd_set_freq(void *priv, struct hostapd_freq_params *freq)
        u32 mode;
        int channel = freq->channel;
 
-       if (channel < 14)
-               mode = IFM_IEEE80211_11G;
-       else if (channel == 14)
+       if (channel < 14) {
+               mode =
+#ifdef CONFIG_IEEE80211N
+                       freq->ht_enabled ? IFM_IEEE80211_11NG :
+#endif /* CONFIG_IEEE80211N */
+                       IFM_IEEE80211_11G;
+       } else if (channel == 14) {
                mode = IFM_IEEE80211_11B;
-       else
-               mode = IFM_IEEE80211_11A;
+       } else {
+               mode =
+#ifdef CONFIG_IEEE80211N
+                       freq->ht_enabled ? IFM_IEEE80211_11NA :
+#endif /* CONFIG_IEEE80211N */
+                       IFM_IEEE80211_11A;
+       }
        if (bsd_set_mediaopt(drv, IFM_MMASK, mode) < 0) {
                wpa_printf(MSG_ERROR, "%s: failed to set modulation mode",
                           __func__);