]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
HT: Remove unneeded struct ht_cap_ie wrapper
authorJouni Malinen <j@w1.fi>
Sun, 29 Nov 2009 11:04:21 +0000 (13:04 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 29 Nov 2009 11:04:21 +0000 (13:04 +0200)
It is simpler to just use the HT Capabilities IE payload structure
as-is.

hostapd/driver_i.h
hostapd/ieee802_11.c
hostapd/sta_info.h
src/common/ieee802_11_defs.h
src/drivers/driver.h
src/drivers/driver_nl80211.c

index a60e089aab533c762a0f33d6b2aa1c0a6c67d06e..c9c044cc879fb27db08ae3c0dbe23acdb68f2eea 100644 (file)
@@ -217,7 +217,7 @@ static inline int
 hostapd_sta_add(const char *ifname, struct hostapd_data *hapd, const u8 *addr,
                u16 aid, u16 capability, const u8 *supp_rates,
                size_t supp_rates_len, int flags, u16 listen_interval,
-               const struct ht_cap_ie *ht_capabilities)
+               const struct ieee80211_ht_capabilities *ht_capabilities)
 {
        struct hostapd_sta_add_params params;
 
index eec5e65ad44d55ef4744cbca33ff84d853c37fe4..be9a3a1907e50fe4c026876d14bb3e3c93934ee2 100644 (file)
@@ -858,11 +858,7 @@ static void handle_assoc(struct hostapd_data *hapd,
            elems.ht_capabilities_len >=
            sizeof(struct ieee80211_ht_capabilities)) {
                sta->flags |= WLAN_STA_HT;
-               sta->ht_capabilities.id = WLAN_EID_HT_CAP;
-               sta->ht_capabilities.length =
-                       sizeof(struct ieee80211_ht_capabilities);
-               os_memcpy(&sta->ht_capabilities.data,
-                         elems.ht_capabilities,
+               os_memcpy(&sta->ht_capabilities, elems.ht_capabilities,
                          sizeof(struct ieee80211_ht_capabilities));
        } else
                sta->flags &= ~WLAN_STA_HT;
@@ -1037,7 +1033,7 @@ static void handle_assoc(struct hostapd_data *hapd,
 #ifdef CONFIG_IEEE80211N
        if (sta->flags & WLAN_STA_HT) {
                u16 ht_capab = le_to_host16(
-                       sta->ht_capabilities.data.ht_capabilities_info);
+                       sta->ht_capabilities.ht_capabilities_info);
                wpa_printf(MSG_DEBUG, "HT: STA " MACSTR " HT Capabilities "
                           "Info: 0x%04x", MAC2STR(sta->addr), ht_capab);
                if ((ht_capab & HT_CAP_INFO_GREEN_FIELD) == 0) {
@@ -1583,19 +1579,19 @@ static void handle_auth_cb(struct hostapd_data *hapd,
 #ifdef CONFIG_IEEE80211N
 static void
 hostapd_get_ht_capab(struct hostapd_data *hapd,
-                    struct ht_cap_ie *ht_cap_ie,
-                    struct ht_cap_ie *neg_ht_cap_ie)
+                    struct ieee80211_ht_capabilities *ht_cap,
+                    struct ieee80211_ht_capabilities *neg_ht_cap)
 {
        u16 cap;
 
-       os_memcpy(neg_ht_cap_ie, ht_cap_ie, sizeof(struct ht_cap_ie));
-       cap = le_to_host16(neg_ht_cap_ie->data.ht_capabilities_info);
+       os_memcpy(neg_ht_cap, ht_cap, sizeof(*neg_ht_cap));
+       cap = le_to_host16(neg_ht_cap->ht_capabilities_info);
        cap &= hapd->iconf->ht_capab;
        cap |= (hapd->iconf->ht_capab & HT_CAP_INFO_SMPS_DISABLED);
 
        /* FIXME: Rx STBC needs to be handled specially */
        cap |= (hapd->iconf->ht_capab & HT_CAP_INFO_RX_STBC_MASK);
-       neg_ht_cap_ie->data.ht_capabilities_info = host_to_le16(cap);
+       neg_ht_cap->ht_capabilities_info = host_to_le16(cap);
 }
 #endif /* CONFIG_IEEE80211N */
 
@@ -1608,9 +1604,9 @@ static void handle_assoc_cb(struct hostapd_data *hapd,
        struct sta_info *sta;
        int new_assoc = 1;
 #ifdef CONFIG_IEEE80211N
-       struct ht_cap_ie ht_cap;
+       struct ieee80211_ht_capabilities ht_cap;
 #endif /* CONFIG_IEEE80211N */
-       struct ht_cap_ie *ht_cap_ptr = NULL;
+       struct ieee80211_ht_capabilities *ht_cap_ptr = NULL;
        int set_flags, flags_and, flags_or;
 
        if (!ok) {
index 993f0877ab789a80b296c79639c22ab1fdd26072..a3f94c574d14083141aceee44c5ccbec5532ec50 100644 (file)
@@ -80,7 +80,7 @@ struct sta_info {
        int vlan_id;
 
 #ifdef CONFIG_IEEE80211N
-       struct ht_cap_ie ht_capabilities; /* IEEE 802.11n capabilities */
+       struct ieee80211_ht_capabilities ht_capabilities;
 #endif /* CONFIG_IEEE80211N */
 
 #ifdef CONFIG_IEEE80211W
index 93360b500d0853a999c9c5cabef1849dd19bf049..5efd55e128f269beab9c0ded0c0ce334e1f7003a 100644 (file)
@@ -379,12 +379,6 @@ struct ieee80211_ht_operation {
        u8 basic_set[16];
 } STRUCT_PACKED;
 
-struct ht_cap_ie {
-       u8 id;
-       u8 length;
-       struct ieee80211_ht_capabilities data;
-} STRUCT_PACKED;
-
 #ifdef _MSC_VER
 #pragma pack(pop)
 #endif /* _MSC_VER */
index 3fd8145bbcdbd83c6a77b3787dc1622cb9415bd3..14095762f1757f2ae5691e60f091ffeee172fb0d 100644 (file)
@@ -443,7 +443,7 @@ struct hostapd_sta_add_params {
        size_t supp_rates_len;
        int flags;
        u16 listen_interval;
-       const struct ht_cap_ie *ht_capabilities;
+       const struct ieee80211_ht_capabilities *ht_capabilities;
 };
 
 struct hostapd_freq_params {
index 466e460a8a87ad9d0a5f1a0a3b6819c83ab01413..ab47a673859ade4e1f4a17564541b3ceb5d2a702 100644 (file)
@@ -2600,14 +2600,11 @@ static int wpa_driver_nl80211_sta_add(const char *ifname, void *priv,
                params->supp_rates);
        NLA_PUT_U16(msg, NL80211_ATTR_STA_LISTEN_INTERVAL,
                    params->listen_interval);
-
-#ifdef CONFIG_IEEE80211N
        if (params->ht_capabilities) {
                NLA_PUT(msg, NL80211_ATTR_HT_CAPABILITY,
-                       params->ht_capabilities->length,
-                       &params->ht_capabilities->data);
+                       sizeof(*params->ht_capabilities),
+                       params->ht_capabilities);
        }
-#endif /* CONFIG_IEEE80211N */
 
        ret = send_and_recv_msgs(drv, msg, NULL, NULL);
        if (ret)