Deleted Added
full compact
ieee80211_action.c (199186) ieee80211_action.c (232479)
1/*-
2 * Copyright (c) 2009 Sam Leffler, Errno Consulting
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#include <sys/cdefs.h>
27#ifdef __FreeBSD__
1/*-
2 * Copyright (c) 2009 Sam Leffler, Errno Consulting
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#include <sys/cdefs.h>
27#ifdef __FreeBSD__
28__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_action.c 199186 2009-11-11 14:58:48Z antoine $");
28__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_action.c 232479 2012-03-04 05:49:39Z adrian $");
29#endif
30
31/*
32 * IEEE 802.11 send/recv action frame support.
33 */
34
35#include "opt_inet.h"
36#include "opt_wlan.h"

--- 57 unchanged lines hidden (view full) ---

94 break;
95 ht_send_action[act] = f;
96 return 0;
97 case IEEE80211_ACTION_CAT_MESHPEERING:
98 if (act >= N(meshpl_send_action))
99 break;
100 meshpl_send_action[act] = f;
101 return 0;
29#endif
30
31/*
32 * IEEE 802.11 send/recv action frame support.
33 */
34
35#include "opt_inet.h"
36#include "opt_wlan.h"

--- 57 unchanged lines hidden (view full) ---

94 break;
95 ht_send_action[act] = f;
96 return 0;
97 case IEEE80211_ACTION_CAT_MESHPEERING:
98 if (act >= N(meshpl_send_action))
99 break;
100 meshpl_send_action[act] = f;
101 return 0;
102 case IEEE80211_ACTION_CAT_MESHLMETRIC:
103 if (act >= N(meshlm_send_action))
104 break;
105 meshlm_send_action[act] = f;
106 return 0;
107 case IEEE80211_ACTION_CAT_MESHPATH:
108 if (act >= N(hwmp_send_action))
109 break;
110 hwmp_send_action[act] = f;
111 return 0;
102 case IEEE80211_ACTION_CAT_MESH:
103 switch (act) {
104 case IEEE80211_ACTION_MESH_LMETRIC:
105 if (act >= N(meshlm_send_action))
106 break;
107 meshlm_send_action[act] = f;
108 return 0;
109 case IEEE80211_ACTION_MESH_HWMP:
110 if (act >= N(hwmp_send_action))
111 break;
112 hwmp_send_action[act] = f;
113 return 0;
114 }
115 break;
112 case IEEE80211_ACTION_CAT_VENDOR:
113 if (act >= N(vendor_send_action))
114 break;
115 vendor_send_action[act] = f;
116 return 0;
117 }
118 return EINVAL;
119#undef N

--- 19 unchanged lines hidden (view full) ---

139 case IEEE80211_ACTION_CAT_HT:
140 if (act < N(ht_send_action))
141 f = ht_send_action[act];
142 break;
143 case IEEE80211_ACTION_CAT_MESHPEERING:
144 if (act < N(meshpl_send_action))
145 f = meshpl_send_action[act];
146 break;
116 case IEEE80211_ACTION_CAT_VENDOR:
117 if (act >= N(vendor_send_action))
118 break;
119 vendor_send_action[act] = f;
120 return 0;
121 }
122 return EINVAL;
123#undef N

--- 19 unchanged lines hidden (view full) ---

143 case IEEE80211_ACTION_CAT_HT:
144 if (act < N(ht_send_action))
145 f = ht_send_action[act];
146 break;
147 case IEEE80211_ACTION_CAT_MESHPEERING:
148 if (act < N(meshpl_send_action))
149 f = meshpl_send_action[act];
150 break;
147 case IEEE80211_ACTION_CAT_MESHLMETRIC:
148 if (act < N(meshlm_send_action))
149 f = meshlm_send_action[act];
151 case IEEE80211_ACTION_CAT_MESH:
152 switch (act) {
153 case IEEE80211_ACTION_MESH_LMETRIC:
154 if (act < N(meshlm_send_action))
155 f = meshlm_send_action[act];
156 break;
157 case IEEE80211_ACTION_MESH_HWMP:
158 if (act < N(hwmp_send_action))
159 f = hwmp_send_action[act];
160 break;
161 }
150 break;
162 break;
151 case IEEE80211_ACTION_CAT_MESHPATH:
152 if (act < N(hwmp_send_action))
153 f = hwmp_send_action[act];
154 break;
155 case IEEE80211_ACTION_CAT_VENDOR:
156 if (act < N(vendor_send_action))
157 f = vendor_send_action[act];
158 break;
159 }
160 return f(ni, cat, act, sa);
161#undef N
162}

--- 44 unchanged lines hidden (view full) ---

207 break;
208 ht_recv_action[act] = f;
209 return 0;
210 case IEEE80211_ACTION_CAT_MESHPEERING:
211 if (act >= N(meshpl_recv_action))
212 break;
213 meshpl_recv_action[act] = f;
214 return 0;
163 case IEEE80211_ACTION_CAT_VENDOR:
164 if (act < N(vendor_send_action))
165 f = vendor_send_action[act];
166 break;
167 }
168 return f(ni, cat, act, sa);
169#undef N
170}

--- 44 unchanged lines hidden (view full) ---

215 break;
216 ht_recv_action[act] = f;
217 return 0;
218 case IEEE80211_ACTION_CAT_MESHPEERING:
219 if (act >= N(meshpl_recv_action))
220 break;
221 meshpl_recv_action[act] = f;
222 return 0;
215 case IEEE80211_ACTION_CAT_MESHLMETRIC:
216 if (act >= N(meshlm_recv_action))
217 break;
218 meshlm_recv_action[act] = f;
219 return 0;
220 case IEEE80211_ACTION_CAT_MESHPATH:
221 if (act >= N(hwmp_recv_action))
222 break;
223 hwmp_recv_action[act] = f;
224 return 0;
223 case IEEE80211_ACTION_CAT_MESH:
224 switch (act) {
225 case IEEE80211_ACTION_MESH_LMETRIC:
226 if (act >= N(meshlm_recv_action))
227 break;
228 meshlm_recv_action[act] = f;
229 return 0;
230 case IEEE80211_ACTION_MESH_HWMP:
231 if (act >= N(hwmp_recv_action))
232 break;
233 hwmp_recv_action[act] = f;
234 return 0;
235 }
236 break;
225 case IEEE80211_ACTION_CAT_VENDOR:
226 if (act >= N(vendor_recv_action))
227 break;
228 vendor_recv_action[act] = f;
229 return 0;
230 }
231 return EINVAL;
232#undef N

--- 23 unchanged lines hidden (view full) ---

256 case IEEE80211_ACTION_CAT_HT:
257 if (ia->ia_action < N(ht_recv_action))
258 f = ht_recv_action[ia->ia_action];
259 break;
260 case IEEE80211_ACTION_CAT_MESHPEERING:
261 if (ia->ia_action < N(meshpl_recv_action))
262 f = meshpl_recv_action[ia->ia_action];
263 break;
237 case IEEE80211_ACTION_CAT_VENDOR:
238 if (act >= N(vendor_recv_action))
239 break;
240 vendor_recv_action[act] = f;
241 return 0;
242 }
243 return EINVAL;
244#undef N

--- 23 unchanged lines hidden (view full) ---

268 case IEEE80211_ACTION_CAT_HT:
269 if (ia->ia_action < N(ht_recv_action))
270 f = ht_recv_action[ia->ia_action];
271 break;
272 case IEEE80211_ACTION_CAT_MESHPEERING:
273 if (ia->ia_action < N(meshpl_recv_action))
274 f = meshpl_recv_action[ia->ia_action];
275 break;
264 case IEEE80211_ACTION_CAT_MESHLMETRIC:
265 if (ia->ia_action < N(meshlm_recv_action))
266 f = meshlm_recv_action[ia->ia_action];
276 case IEEE80211_ACTION_CAT_MESH:
277 switch (ia->ia_action) {
278 case IEEE80211_ACTION_MESH_LMETRIC:
279 if (ia->ia_action < N(meshlm_recv_action))
280 f = meshlm_recv_action[ia->ia_action];
281 break;
282 case IEEE80211_ACTION_MESH_HWMP:
283 if (ia->ia_action < N(hwmp_recv_action))
284 f = hwmp_recv_action[ia->ia_action];
285 break;
286 }
267 break;
287 break;
268 case IEEE80211_ACTION_CAT_MESHPATH:
269 if (ia->ia_action < N(hwmp_recv_action))
270 f = hwmp_recv_action[ia->ia_action];
271 break;
272 case IEEE80211_ACTION_CAT_VENDOR:
273 if (ia->ia_action < N(vendor_recv_action))
274 f = vendor_recv_action[ia->ia_action];
275 break;
276 }
277 return f(ni, wh, frm, efrm);
278#undef N
279}
288 case IEEE80211_ACTION_CAT_VENDOR:
289 if (ia->ia_action < N(vendor_recv_action))
290 f = vendor_recv_action[ia->ia_action];
291 break;
292 }
293 return f(ni, wh, frm, efrm);
294#undef N
295}