summaryrefslogtreecommitdiff
path: root/package/hostapd/patches/005-pass-full-flags-to-sta-function.patch
blob: 11c8c5fd460ddf6c901f6e7800ab167bc11f3b1c (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
---
 hostapd/driver.h             |    8 ++++----
 hostapd/driver_bsd.c         |    3 ++-
 hostapd/driver_devicescape.c |    6 +++---
 hostapd/driver_hostap.c      |    4 ++--
 hostapd/driver_madwifi.c     |    3 ++-
 hostapd/driver_prism54.c     |    3 ++-
 hostapd/ieee802_11.c         |    4 ++--
 hostapd/ieee802_1x.c         |    4 ++--
 hostapd/wme.c                |    6 ++++--
 9 files changed, 23 insertions(+), 18 deletions(-)

--- hostap.orig/hostapd/driver.h	2007-11-09 13:41:07.000000000 +0100
+++ hostap/hostapd/driver.h	2007-11-09 13:41:15.000000000 +0100
@@ -92,7 +92,7 @@ struct wpa_driver_ops {
 	int (*get_retry)(void *priv, int *short_retry, int *long_retry);
 
 	int (*sta_set_flags)(void *priv, const u8 *addr,
-			     int flags_or, int flags_and);
+			     int total_flags, int flags_or, int flags_and);
 	int (*set_rate_sets)(void *priv, int *supp_rates, int *basic_rates,
 			     int mode);
 	int (*set_channel_flag)(void *priv, int mode, int chan, int flag,
@@ -427,12 +427,12 @@ hostapd_get_retry(struct hostapd_data *h
 
 static inline int
 hostapd_sta_set_flags(struct hostapd_data *hapd, u8 *addr,
-		      int flags_or, int flags_and)
+		      int total_flags, int flags_or, int flags_and)
 {
 	if (hapd->driver == NULL || hapd->driver->sta_set_flags == NULL)
 		return 0;
-	return hapd->driver->sta_set_flags(hapd->drv_priv, addr, flags_or,
-					   flags_and);
+	return hapd->driver->sta_set_flags(hapd->drv_priv, addr, total_flags,
+					   flags_or, flags_and);
 }
 
 static inline int
--- hostap.orig/hostapd/driver_bsd.c	2007-11-09 13:41:07.000000000 +0100
+++ hostap/hostapd/driver_bsd.c	2007-11-09 13:41:15.000000000 +0100
@@ -322,7 +322,8 @@ bsd_set_sta_authorized(void *priv, const
 }
 
 static int
-bsd_sta_set_flags(void *priv, const u8 *addr, int flags_or, int flags_and)
+bsd_sta_set_flags(void *priv, const u8 *addr, int total_flags, int flags_or,
+		  int flags_and)
 {
 	/* For now, only support setting Authorized flag */
 	if (flags_or & WLAN_STA_AUTHORIZED)
--- hostap.orig/hostapd/driver_devicescape.c	2007-11-09 13:41:14.000000000 +0100
+++ hostap/hostapd/driver_devicescape.c	2007-11-09 13:41:15.000000000 +0100
@@ -76,7 +76,7 @@ struct i802_driver_data {
 #define HAPD_DECL	struct hostapd_data *hapd = iface->bss[0]
 
 static int i802_sta_set_flags(void *priv, const u8 *addr,
-			      int flags_or, int flags_and);
+			      int total_flags, int flags_or, int flags_and);
 
 
 static int hostapd_set_iface_flags(struct i802_driver_data *drv, int dev_up)
@@ -765,7 +765,7 @@ static int i802_sta_remove(void *priv, c
 	struct i802_driver_data *drv = priv;
 	struct prism2_hostapd_param param;
 
-	i802_sta_set_flags(drv, addr, 0, ~WLAN_STA_AUTHORIZED);
+	i802_sta_set_flags(drv, addr, 0, 0, ~WLAN_STA_AUTHORIZED);
 
 	memset(&param, 0, sizeof(param));
 	param.cmd = PRISM2_HOSTAPD_REMOVE_STA;
@@ -777,7 +777,7 @@ static int i802_sta_remove(void *priv, c
 
 
 static int i802_sta_set_flags(void *priv, const u8 *addr,
-			      int flags_or, int flags_and)
+			      int total_flags, int flags_or, int flags_and)
 {
 	struct i802_driver_data *drv = priv;
 	struct prism2_hostapd_param param;
--- hostap.orig/hostapd/driver_hostap.c	2007-11-09 13:41:07.000000000 +0100
+++ hostap/hostapd/driver_hostap.c	2007-11-09 13:41:15.000000000 +0100
@@ -374,7 +374,7 @@ static int hostap_send_eapol(void *priv,
 
 
 static int hostap_sta_set_flags(void *priv, const u8 *addr,
-				int flags_or, int flags_and)
+				int total_flags, int flags_or, int flags_and)
 {
 	struct hostap_driver_data *drv = priv;
 	struct prism2_hostapd_param param;
@@ -694,7 +694,7 @@ static int hostap_sta_remove(void *priv,
 	struct hostap_driver_data *drv = priv;
 	struct prism2_hostapd_param param;
 
-	hostap_sta_set_flags(drv, addr, 0, ~WLAN_STA_AUTHORIZED);
+	hostap_sta_set_flags(drv, addr, 0, 0, ~WLAN_STA_AUTHORIZED);
 
 	memset(&param, 0, sizeof(param));
 	param.cmd = PRISM2_HOSTAPD_REMOVE_STA;
--- hostap.orig/hostapd/driver_madwifi.c	2007-11-09 13:41:07.000000000 +0100
+++ hostap/hostapd/driver_madwifi.c	2007-11-09 13:41:15.000000000 +0100
@@ -410,7 +410,8 @@ madwifi_set_sta_authorized(void *priv, c
 }
 
 static int
-madwifi_sta_set_flags(void *priv, const u8 *addr, int flags_or, int flags_and)
+madwifi_sta_set_flags(void *priv, const u8 *addr, int total_flags,
+		      int flags_or, int flags_and)
 {
 	/* For now, only support setting Authorized flag */
 	if (flags_or & WLAN_STA_AUTHORIZED)
--- hostap.orig/hostapd/driver_prism54.c	2007-11-09 13:41:07.000000000 +0100
+++ hostap/hostapd/driver_prism54.c	2007-11-09 13:41:15.000000000 +0100
@@ -187,7 +187,8 @@ static int prism54_set_sta_authorized(vo
 
 
 static int
-prism54_sta_set_flags(void *priv, const u8 *addr, int flags_or, int flags_and)
+prism54_sta_set_flags(void *priv, const u8 *addr, int total_flags,
+		      int flags_or, int flags_and)
 {
 	/* For now, only support setting Authorized flag */
 	if (flags_or & WLAN_STA_AUTHORIZED)
--- hostap.orig/hostapd/ieee802_11.c	2007-11-09 13:41:07.000000000 +0100
+++ hostap/hostapd/ieee802_11.c	2007-11-09 13:41:15.000000000 +0100
@@ -1625,10 +1625,10 @@ static void handle_assoc_cb(struct hosta
 		ap_sta_bind_vlan(hapd, sta, 0);
 	}
 	if (sta->flags & WLAN_STA_SHORT_PREAMBLE) {
-		hostapd_sta_set_flags(hapd, sta->addr,
+		hostapd_sta_set_flags(hapd, sta->addr, sta->flags,
 				      WLAN_STA_SHORT_PREAMBLE, ~0);
 	} else {
-		hostapd_sta_set_flags(hapd, sta->addr,
+		hostapd_sta_set_flags(hapd, sta->addr, sta->flags,
 				      0, ~WLAN_STA_SHORT_PREAMBLE);
 	}
 
--- hostap.orig/hostapd/ieee802_1x.c	2007-11-09 13:41:07.000000000 +0100
+++ hostap/hostapd/ieee802_1x.c	2007-11-09 13:41:15.000000000 +0100
@@ -94,13 +94,13 @@ void ieee802_1x_set_sta_authorized(struc
 
 	if (authorized) {
 		sta->flags |= WLAN_STA_AUTHORIZED;
-		res = hostapd_sta_set_flags(hapd, sta->addr,
+		res = hostapd_sta_set_flags(hapd, sta->addr, sta->flags,
 					    WLAN_STA_AUTHORIZED, ~0);
 		hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X,
 			       HOSTAPD_LEVEL_DEBUG, "authorizing port");
 	} else {
 		sta->flags &= ~WLAN_STA_AUTHORIZED;
-		res = hostapd_sta_set_flags(hapd, sta->addr,
+		res = hostapd_sta_set_flags(hapd, sta->addr, sta->flags,
 					    0, ~WLAN_STA_AUTHORIZED);
 		hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X,
 			       HOSTAPD_LEVEL_DEBUG, "unauthorizing port");
--- hostap.orig/hostapd/wme.c	2007-11-09 13:41:07.000000000 +0100
+++ hostap/hostapd/wme.c	2007-11-09 13:41:15.000000000 +0100
@@ -110,9 +110,11 @@ int hostapd_wme_sta_config(struct hostap
 {
 	/* update kernel STA data for WME related items (WLAN_STA_WPA flag) */
 	if (sta->flags & WLAN_STA_WME)
-		hostapd_sta_set_flags(hapd, sta->addr, WLAN_STA_WME, ~0);
+		hostapd_sta_set_flags(hapd, sta->addr, sta->flags,
+				      WLAN_STA_WME, ~0);
 	else
-		hostapd_sta_set_flags(hapd, sta->addr, 0, ~WLAN_STA_WME);
+		hostapd_sta_set_flags(hapd, sta->addr, sta->flags,
+				      0, ~WLAN_STA_WME);
 
 	return 0;
 }