Added option to distinguish non-HT and HT20 in set_freq
authorJouni Malinen <jouni.malinen@atheros.com>
Wed, 26 Nov 2008 08:44:04 +0000 (10:44 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 26 Nov 2008 08:44:04 +0000 (10:44 +0200)
hostapd/driver.h
hostapd/driver_nl80211.c
hostapd/hostapd.c

index 4331e1b..a7a96e4 100644 (file)
@@ -30,6 +30,7 @@ struct hostapd_sta_add_params {
 struct hostapd_freq_params {
        int mode;
        int freq;
+       int ht_enabled;
        int sec_channel_offset; /* 0 = HT40 disabled, -1 = HT40 enabled,
                                 * secondary channel below primary, 1 = HT40
                                 * enabled, secondary channel above primary */
@@ -431,7 +432,7 @@ hostapd_get_inact_sec(struct hostapd_data *hapd, const u8 *addr)
 }
 
 static inline int
-hostapd_set_freq(struct hostapd_data *hapd, int mode, int freq,
+hostapd_set_freq(struct hostapd_data *hapd, int mode, int freq, int ht_enabled,
                 int sec_channel_offset)
 {
        if (hapd->driver == NULL)
@@ -441,6 +442,7 @@ hostapd_set_freq(struct hostapd_data *hapd, int mode, int freq,
                os_memset(&data, 0, sizeof(data));
                data.mode = mode;
                data.freq = freq;
+               data.ht_enabled = ht_enabled;
                data.sec_channel_offset = sec_channel_offset;
                return hapd->driver->set_freq2(hapd->drv_priv, &data);
        }
index b2529b1..faadbe5 100644 (file)
@@ -485,6 +485,10 @@ static int i802_set_freq2(void *priv, struct hostapd_freq_params *freq)
                NLA_PUT_U8(msg, NL80211_ATTR_WIPHY_SEC_CHAN_OFFSET,
                           NL80211_SEC_CHAN_ABOVE);
                break;
+       default:
+               NLA_PUT_U8(msg, NL80211_ATTR_WIPHY_SEC_CHAN_OFFSET,
+                          NL80211_SEC_CHAN_DISABLED);
+               break;
        }
 
        if (send_and_recv_msgs(drv, msg, NULL, NULL) == 0)
index 681ebbf..6efe13f 100644 (file)
@@ -1554,6 +1554,7 @@ static int setup_interface(struct hostapd_iface *iface)
                       hapd->iconf->channel, freq);
 
                if (hostapd_set_freq(hapd, hapd->iconf->hw_mode, freq,
+                                    hapd->iconf->ieee80211n,
                                     hapd->iconf->secondary_channel)) {
                        printf("Could not set channel for kernel driver\n");
                        return -1;