summaryrefslogtreecommitdiff
path: root/package/hostapd/patches/730-nl80211_enable_qosdata.patch
blob: 08bebe1a6121eefb06511af8ba3d11ec8c6300ad (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -4263,7 +4263,7 @@ static const u8 rfc1042_header[6] = { 0x
 
 static int wpa_driver_nl80211_hapd_send_eapol(
 	void *priv, const u8 *addr, const u8 *data,
-	size_t data_len, int encrypt, const u8 *own_addr)
+	size_t data_len, int encrypt, const u8 *own_addr, u32 flags)
 {
 	struct i802_bss *bss = priv;
 	struct wpa_driver_nl80211_data *drv = bss->drv;
@@ -4271,11 +4271,7 @@ static int wpa_driver_nl80211_hapd_send_
 	size_t len;
 	u8 *pos;
 	int res;
-#if 0 /* FIX */
-	int qos = sta->flags & WPA_STA_WMM;
-#else
-	int qos = 0;
-#endif
+	int qos = flags & WPA_STA_WMM;
 
 	len = sizeof(*hdr) + (qos ? 2 : 0) + sizeof(rfc1042_header) + 2 +
 		data_len;
@@ -4291,26 +4287,22 @@ static int wpa_driver_nl80211_hapd_send_
 	hdr->frame_control |= host_to_le16(WLAN_FC_FROMDS);
 	if (encrypt)
 		hdr->frame_control |= host_to_le16(WLAN_FC_ISWEP);
-#if 0 /* To be enabled if qos determination is added above */
 	if (qos) {
 		hdr->frame_control |=
 			host_to_le16(WLAN_FC_STYPE_QOS_DATA << 4);
 	}
-#endif
 
 	memcpy(hdr->IEEE80211_DA_FROMDS, addr, ETH_ALEN);
 	memcpy(hdr->IEEE80211_BSSID_FROMDS, own_addr, ETH_ALEN);
 	memcpy(hdr->IEEE80211_SA_FROMDS, own_addr, ETH_ALEN);
 	pos = (u8 *) (hdr + 1);
 
-#if 0 /* To be enabled if qos determination is added above */
 	if (qos) {
 		/* add an empty QoS header if needed */
 		pos[0] = 0;
 		pos[1] = 0;
 		pos += 2;
 	}
-#endif
 
 	memcpy(pos, rfc1042_header, sizeof(rfc1042_header));
 	pos += sizeof(rfc1042_header);
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -1396,7 +1396,7 @@ struct wpa_driver_ops {
 	 */
 	int (*hapd_send_eapol)(void *priv, const u8 *addr, const u8 *data,
 			       size_t data_len, int encrypt,
-			       const u8 *own_addr);
+			       const u8 *own_addr, u32 flags);
 
 	/**
 	 * sta_deauth - Deauthenticate a station (AP only)
--- a/src/drivers/driver_madwifi.c
+++ b/src/drivers/driver_madwifi.c
@@ -1097,7 +1097,7 @@ madwifi_wireless_event_init(struct madwi
 
 static int
 madwifi_send_eapol(void *priv, const u8 *addr, const u8 *data, size_t data_len,
-		   int encrypt, const u8 *own_addr)
+		   int encrypt, const u8 *own_addr, u32 flags)
 {
 	struct madwifi_driver_data *drv = priv;
 	unsigned char buf[3000];
--- a/src/drivers/driver_test.c
+++ b/src/drivers/driver_test.c
@@ -175,7 +175,7 @@ test_driver_get_cli(struct wpa_driver_te
 
 static int test_driver_send_eapol(void *priv, const u8 *addr, const u8 *data,
 				  size_t data_len, int encrypt,
-				  const u8 *own_addr)
+				  const u8 *own_addr, u32 flags)
 {
 	struct test_driver_bss *dbss = priv;
 	struct wpa_driver_test_data *drv = dbss->drv;
--- a/src/drivers/driver_hostap.c
+++ b/src/drivers/driver_hostap.c
@@ -294,7 +294,8 @@ static int hostap_send_mlme(void *priv, 
 
 
 static int hostap_send_eapol(void *priv, const u8 *addr, const u8 *data,
-			     size_t data_len, int encrypt, const u8 *own_addr)
+			     size_t data_len, int encrypt, const u8 *own_addr,
+			     u32 flags)
 {
 	struct hostap_driver_data *drv = priv;
 	struct ieee80211_hdr *hdr;
--- a/src/drivers/driver_atheros.c
+++ b/src/drivers/driver_atheros.c
@@ -1132,7 +1132,7 @@ atheros_wireless_event_init(struct ather
 
 static int
 atheros_send_eapol(void *priv, const u8 *addr, const u8 *data, size_t data_len,
-		   int encrypt, const u8 *own_addr)
+		   int encrypt, const u8 *own_addr, u32 flags)
 {
 	struct atheros_driver_data *drv = priv;
 	unsigned char buf[3000];
--- a/src/drivers/driver_bsd.c
+++ b/src/drivers/driver_bsd.c
@@ -516,7 +516,7 @@ no_ie:
 
 static int
 bsd_send_eapol(void *priv, const u8 *addr, const u8 *data, size_t data_len,
-	       int encrypt, const u8 *own_addr)
+	       int encrypt, const u8 *own_addr, u32 flags)
 {
 	struct bsd_driver_data *drv = priv;
 
--- a/src/ap/ap_drv_ops.h
+++ b/src/ap/ap_drv_ops.h
@@ -135,13 +135,14 @@ static inline int hostapd_drv_sta_remove
 
 static inline int hostapd_drv_hapd_send_eapol(struct hostapd_data *hapd,
 					      const u8 *addr, const u8 *data,
-					      size_t data_len, int encrypt)
+					      size_t data_len, int encrypt,
+					      u32 flags)
 {
 	if (hapd->driver == NULL || hapd->driver->hapd_send_eapol == NULL)
 		return 0;
 	return hapd->driver->hapd_send_eapol(hapd->drv_priv, addr, data,
 					     data_len, encrypt,
-					     hapd->own_addr);
+					     hapd->own_addr, flags);
 }
 
 static inline int hostapd_drv_read_sta_data(
--- a/src/ap/ieee802_1x.c
+++ b/src/ap/ieee802_1x.c
@@ -73,7 +73,7 @@ static void ieee802_1x_send(struct hosta
 		rsn_preauth_send(hapd, sta, buf, len);
 	} else {
 		hostapd_drv_hapd_send_eapol(hapd, sta->addr, buf, len,
-					    encrypt);
+					    encrypt, sta->flags);
 	}
 
 	os_free(buf);
--- a/src/ap/wpa_auth_glue.c
+++ b/src/ap/wpa_auth_glue.c
@@ -243,8 +243,15 @@ static int hostapd_wpa_auth_send_eapol(v
 				       int encrypt)
 {
 	struct hostapd_data *hapd = ctx;
+	struct sta_info *sta;
+	u32 flags = 0;
+
+	sta = ap_get_sta(hapd, addr);
+	if (sta)
+		flags = sta->flags;
+
 	return hostapd_drv_hapd_send_eapol(hapd, addr, data, data_len,
-					   encrypt);
+					   encrypt, flags);
 }
 
 
--- a/wpa_supplicant/driver_i.h
+++ b/wpa_supplicant/driver_i.h
@@ -351,12 +351,12 @@ static inline int wpa_drv_sta_remove(str
 static inline int wpa_drv_hapd_send_eapol(struct wpa_supplicant *wpa_s,
 					  const u8 *addr, const u8 *data,
 					  size_t data_len, int encrypt,
-					  const u8 *own_addr)
+					  const u8 *own_addr, u32 flags)
 {
 	if (wpa_s->driver->hapd_send_eapol)
 		return wpa_s->driver->hapd_send_eapol(wpa_s->drv_priv, addr,
 						      data, data_len, encrypt,
-						      own_addr);
+						      own_addr, flags);
 	return -1;
 }
 
--- a/src/drivers/driver_wired.c
+++ b/src/drivers/driver_wired.c
@@ -314,7 +314,7 @@ static int wired_init_sockets(struct wpa
 
 static int wired_send_eapol(void *priv, const u8 *addr,
 			    const u8 *data, size_t data_len, int encrypt,
-			    const u8 *own_addr)
+			    const u8 *own_addr, u32 flags)
 {
 	struct wpa_driver_wired_data *drv = priv;
 	struct ieee8023_hdr *hdr;