summaryrefslogtreecommitdiff
path: root/package/hostapd/patches/150-ht_cap_endian.patch
blob: d8f3856eed2dfb6882e1698cc1e4a2972e7b84cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
--- a/hostapd/ieee802_11.c
+++ b/hostapd/ieee802_11.c
@@ -1586,24 +1586,16 @@ hostapd_get_ht_capab(struct hostapd_data
 		     struct ht_cap_ie *ht_cap_ie,
 		     struct ht_cap_ie *neg_ht_cap_ie)
 {
+	u16 cap;
 
 	os_memcpy(neg_ht_cap_ie, ht_cap_ie, sizeof(struct ht_cap_ie));
-	neg_ht_cap_ie->data.capabilities_info =
-		ht_cap_ie->data.capabilities_info & hapd->iconf->ht_capab;
-
-	neg_ht_cap_ie->data.capabilities_info &= ~HT_CAP_INFO_SMPS_DISABLED;
-	if ((ht_cap_ie->data.capabilities_info & HT_CAP_INFO_SMPS_DISABLED) ==
-	    (hapd->iconf->ht_capab & HT_CAP_INFO_SMPS_DISABLED))
-		neg_ht_cap_ie->data.capabilities_info |=
-			hapd->iconf->ht_capab & HT_CAP_INFO_SMPS_DISABLED;
-	else
-		neg_ht_cap_ie->data.capabilities_info |=
-			HT_CAP_INFO_SMPS_DISABLED;
+	cap = le_to_host16(neg_ht_cap_ie->data.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 */
-	neg_ht_cap_ie->data.capabilities_info &= ~HT_CAP_INFO_RX_STBC_MASK;
-	neg_ht_cap_ie->data.capabilities_info |=
-		hapd->iconf->ht_capab & HT_CAP_INFO_RX_STBC_MASK;
+	cap |= (hapd->iconf->ht_capab & HT_CAP_INFO_RX_STBC_MASK);
+	neg_ht_cap_ie->data.capabilities_info = host_to_le16(cap);
 }
 #endif /* CONFIG_IEEE80211N */