]> git.ipfire.org Git - thirdparty/hostap.git/blobdiff - hostapd/beacon.c
Add preliminary IEEE 802.11n support into hostapd
[thirdparty/hostap.git] / hostapd / beacon.c
index d005559800e959010e28d133507a0de630b08b09..1a221d73099b4252d00aa8a762331f4b893b1b53 100644 (file)
@@ -285,6 +285,13 @@ void handle_probe_req(struct hostapd_data *hapd, struct ieee80211_mgmt *mgmt,
        if (hapd->conf->wme_enabled)
                pos = hostapd_eid_wme(hapd, pos);
 
+#ifdef CONFIG_IEEE80211N
+       if (hapd->conf->ieee80211n) {
+               pos = hostapd_eid_ht_capabilities_info(hapd, pos);
+               pos = hostapd_eid_ht_operation(hapd, pos);
+       }
+#endif /* CONFIG_IEEE80211N */
+
        if (hostapd_send_mgmt_frame(hapd, resp, pos - (u8 *) resp, 0) < 0)
                perror("handle_probe_req: send");
 
@@ -376,6 +383,25 @@ void ieee802_11_set_beacon(struct hostapd_data *hapd)
        if (hapd->conf->wme_enabled)
                tailpos = hostapd_eid_wme(hapd, tailpos);
 
+#ifdef CONFIG_IEEE80211N
+       if (hapd->conf->ieee80211n) {
+               tailpos = hostapd_eid_ht_capabilities_info(hapd, tailpos);
+               tailpos = hostapd_eid_ht_operation(hapd, tailpos);
+
+               if (hostapd_set_ht_capability(
+                           hapd->conf->iface, hapd,
+                           &hapd->conf->ht_capabilities.data)) {
+                       wpa_printf(MSG_ERROR, "Could not set HT capabilities "
+                                  "for kernel driver");
+               }
+               if (hostapd_set_ht_operation(
+                           hapd->conf->iface, hapd,
+                           &hapd->conf->ht_operation.data))
+                       wpa_printf(MSG_ERROR, "Could not set HT operation for "
+                                  "kernel driver");
+       }
+#endif /* CONFIG_IEEE80211N */
+
        tail_len = tailpos > tail ? tailpos - tail : 0;
 
        if (hostapd_set_beacon(hapd->conf->iface, hapd, (u8 *) head, head_len,