summaryrefslogblamecommitdiffstats
path: root/src/include/ipxe/net80211_err.h
blob: 32ccc257f7b058f685e69958a2c1dad705bfa655 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555











                                                       
                                       





























































































































































































































































































































































































































































































































































                                                                           







































                                                                         


                                                                         


































                                                                         

                                 
#ifndef _IPXE_NET80211_ERR_H
#define _IPXE_NET80211_ERR_H

#include <errno.h>
#include <ipxe/ieee80211.h>

/*
 * The iPXE 802.11 MAC layer.
 *
 * Copyright (c) 2009 Joshua Oreman <oremanj@rwcr.net>.
 */

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );

/** @file
 *
 * The iPXE 802.11 MAC layer errors.
 */

/* Disambiguate the EINVAL's a bit */
#define EINVAL_PKT_TOO_SHORT __einfo_error ( EINFO_EINVAL_PKT_TOO_SHORT )
#define EINFO_EINVAL_PKT_TOO_SHORT __einfo_uniqify \
	( EINFO_EINVAL, 0x01, "Packet too short" )
#define EINVAL_PKT_VERSION __einfo_error ( EINFO_EINVAL_PKT_VERSION )
#define EINFO_EINVAL_PKT_VERSION __einfo_uniqify \
	( EINFO_EINVAL, 0x02, "Packet 802.11 version not supported" )
#define EINVAL_PKT_NOT_DATA __einfo_error ( EINFO_EINVAL_PKT_NOT_DATA )
#define EINFO_EINVAL_PKT_NOT_DATA __einfo_uniqify \
	( EINFO_EINVAL, 0x03, "Packet not a data packet" )
#define EINVAL_PKT_NOT_FROMDS __einfo_error ( EINFO_EINVAL_PKT_NOT_FROMDS )
#define EINFO_EINVAL_PKT_NOT_FROMDS __einfo_uniqify \
	( EINFO_EINVAL, 0x04, "Packet not from an Access Point" )
#define EINVAL_PKT_LLC_HEADER __einfo_error ( EINFO_EINVAL_PKT_LLC_HEADER )
#define EINFO_EINVAL_PKT_LLC_HEADER __einfo_uniqify \
	( EINFO_EINVAL, 0x05, "Packet has invalid LLC header" )
#define EINVAL_CRYPTO_REQUEST __einfo_error ( EINFO_EINVAL_CRYPTO_REQUEST )
#define EINFO_EINVAL_CRYPTO_REQUEST __einfo_uniqify \
	( EINFO_EINVAL, 0x06, "Packet decryption error" )
#define EINVAL_ACTIVE_SCAN __einfo_error ( EINFO_EINVAL_ACTIVE_SCAN )
#define EINFO_EINVAL_ACTIVE_SCAN __einfo_uniqify \
	( EINFO_EINVAL, 0x07, "Invalid active scan requested" )

/*
 * 802.11 error codes: The AP can give us a status code explaining why
 * authentication failed, or a reason code explaining why we were
 * deauthenticated/disassociated. These codes range from 0-63 (the
 * field is 16 bits wide, but only up to 45 or so are defined yet; we
 * allow up to 63 for extensibility). This is encoded into an error
 * code as such:
 *
 *                                      status & 0x1f goes here --vv--
 *   Status code 0-31:  ECONNREFUSED | EUNIQ_(status & 0x1f) (0e1a6038)
 *   Status code 32-63: EHOSTUNREACH | EUNIQ_(status & 0x1f) (171a6011)
 *   Reason code 0-31:  ECONNRESET | EUNIQ_(reason & 0x1f)   (0f1a6039)
 *   Reason code 32-63: ENETRESET | EUNIQ_(reason & 0x1f)    (271a6001)
 *
 * The POSIX error codes more or less convey the appropriate message
 * (status codes occur when we can't associate at all, reason codes
 * when we lose association unexpectedly) and let us extract the
 * complete 802.11 error code from the rc value.
 *
 * The error messages follow the 802.11 standard as much as is
 * feasible, but most have been abbreviated to fit the 50-character
 * limit imposed by strerror().
 */

/* 802.11 status codes (IEEE Std 802.11-2007, Table 7-23) */

#define ECONNREFUSED_FAILURE __einfo_error				\
	( EINFO_ECONNREFUSED_FAILURE )
#define EINFO_ECONNREFUSED_FAILURE __einfo_uniqify			\
	( EINFO_ECONNREFUSED,						\
	  ( IEEE80211_STATUS_FAILURE & 0x1f ),				\
	  "Unspecified failure" )

#define ECONNREFUSED_CAPAB_UNSUPP __einfo_error				\
	( EINFO_ECONNREFUSED_CAPAB_UNSUPP )
#define EINFO_ECONNREFUSED_CAPAB_UNSUPP __einfo_uniqify			\
	( EINFO_ECONNREFUSED,						\
	  ( IEEE80211_STATUS_CAPAB_UNSUPP & 0x1f ),			\
	  "Cannot support all requested capabilities" )

#define ECONNREFUSED_REASSOC_INVALID __einfo_error			\
	( EINFO_ECONNREFUSED_REASSOC_INVALID )
#define EINFO_ECONNREFUSED_REASSOC_INVALID __einfo_uniqify		\
	( EINFO_ECONNREFUSED,						\
	  ( IEEE80211_STATUS_REASSOC_INVALID & 0x1f ),			\
	  "Reassociation denied due to lack of association" )

#define ECONNREFUSED_ASSOC_DENIED __einfo_error				\
	( EINFO_ECONNREFUSED_ASSOC_DENIED )
#define EINFO_ECONNREFUSED_ASSOC_DENIED __einfo_uniqify			\
	( EINFO_ECONNREFUSED,						\
	  ( IEEE80211_STATUS_ASSOC_DENIED & 0x1f ),			\
	  "Association denied for another reason" )

#define ECONNREFUSED_AUTH_ALGO_UNSUPP __einfo_error			\
	( EINFO_ECONNREFUSED_AUTH_ALGO_UNSUPP )
#define EINFO_ECONNREFUSED_AUTH_ALGO_UNSUPP __einfo_uniqify		\
	( EINFO_ECONNREFUSED,						\
	  ( IEEE80211_STATUS_AUTH_ALGO_UNSUPP & 0x1f ),			\
	  "Authentication algorithm unsupported" )

#define ECONNREFUSED_AUTH_SEQ_INVALID __einfo_error			\
	( EINFO_ECONNREFUSED_AUTH_SEQ_INVALID )
#define EINFO_ECONNREFUSED_AUTH_SEQ_INVALID __einfo_uniqify		\
	( EINFO_ECONNREFUSED,						\
	  ( IEEE80211_STATUS_AUTH_SEQ_INVALID & 0x1f ),			\
	  "Authentication sequence number unexpected" )

#define ECONNREFUSED_AUTH_CHALL_INVALID __einfo_error			\
	( EINFO_ECONNREFUSED_AUTH_CHALL_INVALID )
#define EINFO_ECONNREFUSED_AUTH_CHALL_INVALID __einfo_uniqify		\
	( EINFO_ECONNREFUSED,					\
	  ( IEEE80211_STATUS_AUTH_CHALL_INVALID & 0x1f ),		\
	  "Authentication rejected due to challenge failure" )

#define ECONNREFUSED_AUTH_TIMEOUT __einfo_error				\
	( EINFO_ECONNREFUSED_AUTH_TIMEOUT )
#define EINFO_ECONNREFUSED_AUTH_TIMEOUT __einfo_uniqify			\
	( EINFO_ECONNREFUSED,						\
	  ( IEEE80211_STATUS_AUTH_TIMEOUT & 0x1f ),			\
	  "Authentication rejected due to timeout" )

#define ECONNREFUSED_ASSOC_NO_ROOM __einfo_error			\
	( EINFO_ECONNREFUSED_ASSOC_NO_ROOM )
#define EINFO_ECONNREFUSED_ASSOC_NO_ROOM __einfo_uniqify		\
	( EINFO_ECONNREFUSED,						\
	  ( IEEE80211_STATUS_ASSOC_NO_ROOM & 0x1f ),			\
	  "Association denied because AP is out of resources" )

#define ECONNREFUSED_ASSOC_NEED_RATE __einfo_error			\
	( EINFO_ECONNREFUSED_ASSOC_NEED_RATE )
#define EINFO_ECONNREFUSED_ASSOC_NEED_RATE __einfo_uniqify		\
	( EINFO_ECONNREFUSED,						\
	  ( IEEE80211_STATUS_ASSOC_NEED_RATE & 0x1f ),			\
	  "Association denied; basic rate support required" )

#define ECONNREFUSED_ASSOC_NEED_SHORT_PMBL __einfo_error		\
	( EINFO_ECONNREFUSED_ASSOC_NEED_SHORT_PMBL )
#define EINFO_ECONNREFUSED_ASSOC_NEED_SHORT_PMBL __einfo_uniqify	\
	( EINFO_ECONNREFUSED,						\
	  ( IEEE80211_STATUS_ASSOC_NEED_SHORT_PMBL & 0x1f ),		\
	  "Association denied; short preamble support req'd" )

#define ECONNREFUSED_ASSOC_NEED_PBCC __einfo_error			\
	( EINFO_ECONNREFUSED_ASSOC_NEED_PBCC )
#define EINFO_ECONNREFUSED_ASSOC_NEED_PBCC __einfo_uniqify		\
	( EINFO_ECONNREFUSED,						\
	  ( IEEE80211_STATUS_ASSOC_NEED_PBCC & 0x1f ),			\
	  "Association denied; PBCC modulation support req'd" )

#define ECONNREFUSED_ASSOC_NEED_CHAN_AGILITY __einfo_error		\
	( EINFO_ECONNREFUSED_ASSOC_NEED_CHAN_AGILITY )
#define EINFO_ECONNREFUSED_ASSOC_NEED_CHAN_AGILITY __einfo_uniqify	\
	( EINFO_ECONNREFUSED,						\
	  ( IEEE80211_STATUS_ASSOC_NEED_CHAN_AGILITY & 0x1f ),		\
	  "Association denied; Channel Agility support req'd" )

#define ECONNREFUSED_ASSOC_NEED_SPECTRUM_MGMT __einfo_error		\
	( EINFO_ECONNREFUSED_ASSOC_NEED_SPECTRUM_MGMT )
#define EINFO_ECONNREFUSED_ASSOC_NEED_SPECTRUM_MGMT __einfo_uniqify	\
	( EINFO_ECONNREFUSED,						\
	  ( IEEE80211_STATUS_ASSOC_NEED_SPECTRUM_MGMT & 0x1f ),		\
	  "Association denied; Spectrum Management required" )

#define ECONNREFUSED_ASSOC_BAD_POWER __einfo_error			\
	( EINFO_ECONNREFUSED_ASSOC_BAD_POWER )
#define EINFO_ECONNREFUSED_ASSOC_BAD_POWER __einfo_uniqify		\
	( EINFO_ECONNREFUSED,						\
	  ( IEEE80211_STATUS_ASSOC_BAD_POWER & 0x1f ),			\
	  "Association denied; Power Capability unacceptable" )

#define ECONNREFUSED_ASSOC_BAD_CHANNELS __einfo_error			\
	( EINFO_ECONNREFUSED_ASSOC_BAD_CHANNELS )
#define EINFO_ECONNREFUSED_ASSOC_BAD_CHANNELS __einfo_uniqify		\
	( EINFO_ECONNREFUSED,						\
	  ( IEEE80211_STATUS_ASSOC_BAD_CHANNELS & 0x1f ),		\
	  "Association denied; Supported Channels unacceptable" )

#define ECONNREFUSED_ASSOC_NEED_SHORT_SLOT __einfo_error		\
	( EINFO_ECONNREFUSED_ASSOC_NEED_SHORT_SLOT )
#define EINFO_ECONNREFUSED_ASSOC_NEED_SHORT_SLOT __einfo_uniqify	\
	( EINFO_ECONNREFUSED,						\
	  ( IEEE80211_STATUS_ASSOC_NEED_SHORT_SLOT & 0x1f ),		\
	  "Association denied; Short Slot Tume support req'd" )

#define ECONNREFUSED_ASSOC_NEED_DSSS_OFDM __einfo_error			\
	( EINFO_ECONNREFUSED_ASSOC_NEED_DSSS_OFDM )
#define EINFO_ECONNREFUSED_ASSOC_NEED_DSSS_OFDM __einfo_uniqify		\
	( EINFO_ECONNREFUSED,						\
	  ( IEEE80211_STATUS_ASSOC_NEED_DSSS_OFDM & 0x1f ),		\
	  "Association denied; DSSS-OFDM support required" )

#define EHOSTUNREACH_QOS_FAILURE __einfo_error				\
	( EINFO_EHOSTUNREACH_QOS_FAILURE )
#define EINFO_EHOSTUNREACH_QOS_FAILURE __einfo_uniqify			\
	( EINFO_EHOSTUNREACH,						\
	  ( IEEE80211_STATUS_QOS_FAILURE & 0x1f ),			\
	  "Unspecified, QoS-related failure" )

#define EHOSTUNREACH_QOS_NO_ROOM __einfo_error				\
	( EINFO_EHOSTUNREACH_QOS_NO_ROOM )
#define EINFO_EHOSTUNREACH_QOS_NO_ROOM __einfo_uniqify			\
	( EINFO_EHOSTUNREACH,						\
	  ( IEEE80211_STATUS_QOS_NO_ROOM & 0x1f ),			\
	  "Association denied; QoS AP out of QoS resources" )

#define EHOSTUNREACH_LINK_IS_HORRIBLE __einfo_error			\
	( EINFO_EHOSTUNREACH_LINK_IS_HORRIBLE )
#define EINFO_EHOSTUNREACH_LINK_IS_HORRIBLE __einfo_uniqify		\
	( EINFO_EHOSTUNREACH,						\
	  ( IEEE80211_STATUS_LINK_IS_HORRIBLE & 0x1f ),			\
	  "Association denied due to excessively poor link" )

#define EHOSTUNREACH_ASSOC_NEED_QOS __einfo_error			\
	( EINFO_EHOSTUNREACH_ASSOC_NEED_QOS )
#define EINFO_EHOSTUNREACH_ASSOC_NEED_QOS __einfo_uniqify		\
	( EINFO_EHOSTUNREACH,						\
	  ( IEEE80211_STATUS_ASSOC_NEED_QOS & 0x1f ),			\
	  "Association denied; QoS support required" )

#define EHOSTUNREACH_REQUEST_DECLINED __einfo_error			\
	( EINFO_EHOSTUNREACH_REQUEST_DECLINED )
#define EINFO_EHOSTUNREACH_REQUEST_DECLINED __einfo_uniqify		\
	( EINFO_EHOSTUNREACH,						\
	  ( IEEE80211_STATUS_REQUEST_DECLINED & 0x1f ),			\
	  "The request has been declined" )

#define EHOSTUNREACH_REQUEST_INVALID __einfo_error			\
	( EINFO_EHOSTUNREACH_REQUEST_INVALID )
#define EINFO_EHOSTUNREACH_REQUEST_INVALID __einfo_uniqify		\
	( EINFO_EHOSTUNREACH,						\
	  ( IEEE80211_STATUS_REQUEST_INVALID & 0x1f ),			\
	  "Request unsuccessful due to invalid parameters" )

#define EHOSTUNREACH_TS_NOT_CREATED_AGAIN __einfo_error			\
	( EINFO_EHOSTUNREACH_TS_NOT_CREATED_AGAIN )
#define EINFO_EHOSTUNREACH_TS_NOT_CREATED_AGAIN __einfo_uniqify		\
	( EINFO_EHOSTUNREACH,						\
	  ( IEEE80211_STATUS_TS_NOT_CREATED_AGAIN & 0x1f ),		\
	  "TS not created due to bad specification" )

#define EHOSTUNREACH_INVALID_IE __einfo_error				\
	( EINFO_EHOSTUNREACH_INVALID_IE )
#define EINFO_EHOSTUNREACH_INVALID_IE __einfo_uniqify			\
	( EINFO_EHOSTUNREACH,						\
	  ( IEEE80211_STATUS_INVALID_IE & 0x1f ),			\
	  "Invalid information element" )

#define EHOSTUNREACH_GROUP_CIPHER_INVALID __einfo_error			\
	( EINFO_EHOSTUNREACH_GROUP_CIPHER_INVALID )
#define EINFO_EHOSTUNREACH_GROUP_CIPHER_INVALID __einfo_uniqify		\
	( EINFO_EHOSTUNREACH,						\
	  ( IEEE80211_STATUS_GROUP_CIPHER_INVALID & 0x1f ),		\
	  "Invalid group cipher" )

#define EHOSTUNREACH_PAIR_CIPHER_INVALID __einfo_error			\
	( EINFO_EHOSTUNREACH_PAIR_CIPHER_INVALID )
#define EINFO_EHOSTUNREACH_PAIR_CIPHER_INVALID __einfo_uniqify		\
	( EINFO_EHOSTUNREACH,						\
	  ( IEEE80211_STATUS_PAIR_CIPHER_INVALID & 0x1f ),		\
	  "Invalid pairwise cipher" )

#define EHOSTUNREACH_AKMP_INVALID __einfo_error				\
	( EINFO_EHOSTUNREACH_AKMP_INVALID )
#define EINFO_EHOSTUNREACH_AKMP_INVALID __einfo_uniqify			\
	( EINFO_EHOSTUNREACH,						\
	  ( IEEE80211_STATUS_AKMP_INVALID & 0x1f ),			\
	  "Invalid AKMP" )

#define EHOSTUNREACH_RSN_VERSION_UNSUPP __einfo_error			\
	( EINFO_EHOSTUNREACH_RSN_VERSION_UNSUPP )
#define EINFO_EHOSTUNREACH_RSN_VERSION_UNSUPP __einfo_uniqify		\
	( EINFO_EHOSTUNREACH,						\
	  ( IEEE80211_STATUS_RSN_VERSION_UNSUPP & 0x1f ),		\
	  "Unsupported RSN information element version" )

#define EHOSTUNREACH_RSN_CAPAB_INVALID __einfo_error			\
	( EINFO_EHOSTUNREACH_RSN_CAPAB_INVALID )
#define EINFO_EHOSTUNREACH_RSN_CAPAB_INVALID __einfo_uniqify		\
	( EINFO_EHOSTUNREACH,						\
	  ( IEEE80211_STATUS_RSN_CAPAB_INVALID & 0x1f ),		\
	  "Invalid RSN information element capabilities" )

#define EHOSTUNREACH_CIPHER_REJECTED __einfo_error			\
	( EINFO_EHOSTUNREACH_CIPHER_REJECTED )
#define EINFO_EHOSTUNREACH_CIPHER_REJECTED __einfo_uniqify		\
	( EINFO_EHOSTUNREACH,						\
	  ( IEEE80211_STATUS_CIPHER_REJECTED & 0x1f ),			\
	  "Cipher suite rejected because of security policy" )

#define EHOSTUNREACH_TS_NOT_CREATED_WAIT __einfo_error			\
	( EINFO_EHOSTUNREACH_TS_NOT_CREATED_WAIT )
#define EINFO_EHOSTUNREACH_TS_NOT_CREATED_WAIT __einfo_uniqify		\
	( EINFO_EHOSTUNREACH,						\
	  ( IEEE80211_STATUS_TS_NOT_CREATED_WAIT & 0x1f ),		\
	  "TS not created due to insufficient delay" )

#define EHOSTUNREACH_DIRECT_LINK_FORBIDDEN __einfo_error		\
	( EINFO_EHOSTUNREACH_DIRECT_LINK_FORBIDDEN )
#define EINFO_EHOSTUNREACH_DIRECT_LINK_FORBIDDEN __einfo_uniqify	\
	( EINFO_EHOSTUNREACH,						\
	  ( IEEE80211_STATUS_DIRECT_LINK_FORBIDDEN & 0x1f ),		\
	  "Direct link is not allowed in the BSS by policy" )

#define EHOSTUNREACH_DEST_NOT_PRESENT __einfo_error			\
	( EINFO_EHOSTUNREACH_DEST_NOT_PRESENT )
#define EINFO_EHOSTUNREACH_DEST_NOT_PRESENT __einfo_uniqify		\
	( EINFO_EHOSTUNREACH,						\
	  ( IEEE80211_STATUS_DEST_NOT_PRESENT & 0x1f ),			\
	  "The Destination STA is not present within the BSS" )

#define EHOSTUNREACH_DEST_NOT_QOS __einfo_error				\
	( EINFO_EHOSTUNREACH_DEST_NOT_QOS )
#define EINFO_EHOSTUNREACH_DEST_NOT_QOS __einfo_uniqify			\
	( EINFO_EHOSTUNREACH,						\
	  ( IEEE80211_STATUS_DEST_NOT_QOS & 0x1f ),			\
	  "The Destination STA is not a QoS STA" )

#define EHOSTUNREACH_ASSOC_LISTEN_TOO_HIGH __einfo_error		\
	( EINFO_EHOSTUNREACH_ASSOC_LISTEN_TOO_HIGH )
#define EINFO_EHOSTUNREACH_ASSOC_LISTEN_TOO_HIGH __einfo_uniqify	\
	( EINFO_EHOSTUNREACH,						\
	  ( IEEE80211_STATUS_ASSOC_LISTEN_TOO_HIGH & 0x1f ),		\
	  "Association denied; Listen Interval is too large" )

/* 802.11 reason codes (IEEE Std 802.11-2007, Table 7-22) */

#define ECONNRESET_UNSPECIFIED __einfo_error				\
	( EINFO_ECONNRESET_UNSPECIFIED )
#define EINFO_ECONNRESET_UNSPECIFIED __einfo_uniqify			\
	( EINFO_ECONNRESET,						\
	  ( IEEE80211_REASON_UNSPECIFIED & 0x1f ),			\
	  "Unspecified reason" )

#define ECONNRESET_AUTH_NO_LONGER_VALID __einfo_error			\
	( EINFO_ECONNRESET_AUTH_NO_LONGER_VALID )
#define EINFO_ECONNRESET_AUTH_NO_LONGER_VALID __einfo_uniqify		\
	( EINFO_ECONNRESET,						\
	  ( IEEE80211_REASON_AUTH_NO_LONGER_VALID & 0x1f ),		\
	  "Previous authentication no longer valid" )

#define ECONNRESET_LEAVING __einfo_error				\
	( EINFO_ECONNRESET_LEAVING )
#define EINFO_ECONNRESET_LEAVING __einfo_uniqify			\
	( EINFO_ECONNRESET,						\
	  ( IEEE80211_REASON_LEAVING & 0x1f ),				\
	  "Deauthenticated due to leaving network" )

#define ECONNRESET_INACTIVITY __einfo_error				\
	( EINFO_ECONNRESET_INACTIVITY )
#define EINFO_ECONNRESET_INACTIVITY __einfo_uniqify			\
	( EINFO_ECONNRESET,						\
	  ( IEEE80211_REASON_INACTIVITY & 0x1f ),			\
	  "Disassociated due to inactivity" )

#define ECONNRESET_OUT_OF_RESOURCES __einfo_error			\
	( EINFO_ECONNRESET_OUT_OF_RESOURCES )
#define EINFO_ECONNRESET_OUT_OF_RESOURCES __einfo_uniqify		\
	( EINFO_ECONNRESET,						\
	  ( IEEE80211_REASON_OUT_OF_RESOURCES & 0x1f ),			\
	  "Disassociated because AP is out of resources" )

#define ECONNRESET_NEED_AUTH __einfo_error				\
	( EINFO_ECONNRESET_NEED_AUTH )
#define EINFO_ECONNRESET_NEED_AUTH __einfo_uniqify			\
	( EINFO_ECONNRESET,						\
	  ( IEEE80211_REASON_NEED_AUTH & 0x1f ),			\
	  "Class 2 frame received from nonauthenticated STA" )

#define ECONNRESET_NEED_ASSOC __einfo_error				\
	( EINFO_ECONNRESET_NEED_ASSOC )
#define EINFO_ECONNRESET_NEED_ASSOC __einfo_uniqify			\
	( EINFO_ECONNRESET,						\
	  ( IEEE80211_REASON_NEED_ASSOC & 0x1f ),			\
	  "Class 3 frame received from nonassociated STA" )

#define ECONNRESET_LEAVING_TO_ROAM __einfo_error			\
	( EINFO_ECONNRESET_LEAVING_TO_ROAM )
#define EINFO_ECONNRESET_LEAVING_TO_ROAM __einfo_uniqify		\
	( EINFO_ECONNRESET,						\
	  ( IEEE80211_REASON_LEAVING_TO_ROAM & 0x1f ),			\
	  "Disassociated due to roaming" )

#define ECONNRESET_REASSOC_INVALID __einfo_error			\
	( EINFO_ECONNRESET_REASSOC_INVALID )
#define EINFO_ECONNRESET_REASSOC_INVALID __einfo_uniqify		\
	( EINFO_ECONNRESET,						\
	  ( IEEE80211_REASON_REASSOC_INVALID & 0x1f ),			\
	  "STA requesting (re)association not authenticated" )

#define ECONNRESET_BAD_POWER __einfo_error				\
	( EINFO_ECONNRESET_BAD_POWER )
#define EINFO_ECONNRESET_BAD_POWER __einfo_uniqify			\
	( EINFO_ECONNRESET,						\
	  ( IEEE80211_REASON_BAD_POWER & 0x1f ),			\
	  "Disassociated; Power Capability unacceptable" )

#define ECONNRESET_BAD_CHANNELS __einfo_error				\
	( EINFO_ECONNRESET_BAD_CHANNELS )
#define EINFO_ECONNRESET_BAD_CHANNELS __einfo_uniqify			\
	( EINFO_ECONNRESET,						\
	  ( IEEE80211_REASON_BAD_CHANNELS & 0x1f ),			\
	  "Disassociated; Supported Channels unacceptable" )

#define ECONNRESET_INVALID_IE __einfo_error				\
	( EINFO_ECONNRESET_INVALID_IE )
#define EINFO_ECONNRESET_INVALID_IE __einfo_uniqify			\
	( EINFO_ECONNRESET,						\
	  ( IEEE80211_REASON_INVALID_IE & 0x1f ),			\
	  "Invalid information element" )

#define ECONNRESET_MIC_FAILURE __einfo_error				\
	( EINFO_ECONNRESET_MIC_FAILURE )
#define EINFO_ECONNRESET_MIC_FAILURE __einfo_uniqify			\
	( EINFO_ECONNRESET,						\
	  ( IEEE80211_REASON_MIC_FAILURE & 0x1f ),			\
	  "Message integrity code (MIC) failure" )

#define ECONNRESET_4WAY_TIMEOUT __einfo_error				\
	( EINFO_ECONNRESET_4WAY_TIMEOUT )
#define EINFO_ECONNRESET_4WAY_TIMEOUT __einfo_uniqify			\
	( EINFO_ECONNRESET,						\
	  ( IEEE80211_REASON_4WAY_TIMEOUT & 0x1f ),			\
	  "4-Way Handshake timeout" )

#define ECONNRESET_GROUPKEY_TIMEOUT __einfo_error			\
	( EINFO_ECONNRESET_GROUPKEY_TIMEOUT )
#define EINFO_ECONNRESET_GROUPKEY_TIMEOUT __einfo_uniqify		\
	( EINFO_ECONNRESET,						\
	  ( IEEE80211_REASON_GROUPKEY_TIMEOUT & 0x1f ),			\
	  "Group Key Handshake timeout" )

#define ECONNRESET_4WAY_INVALID __einfo_error				\
	( EINFO_ECONNRESET_4WAY_INVALID )
#define EINFO_ECONNRESET_4WAY_INVALID __einfo_uniqify			\
	( EINFO_ECONNRESET,						\
	  ( IEEE80211_REASON_4WAY_INVALID & 0x1f ),			\
	  "4-Way Handshake information element changed unduly" )

#define ECONNRESET_GROUP_CIPHER_INVALID __einfo_error			\
	( EINFO_ECONNRESET_GROUP_CIPHER_INVALID )
#define EINFO_ECONNRESET_GROUP_CIPHER_INVALID __einfo_uniqify		\
	( EINFO_ECONNRESET,						\
	  ( IEEE80211_REASON_GROUP_CIPHER_INVALID & 0x1f ),		\
	  "Invalid group cipher" )

#define ECONNRESET_PAIR_CIPHER_INVALID __einfo_error			\
	( EINFO_ECONNRESET_PAIR_CIPHER_INVALID )
#define EINFO_ECONNRESET_PAIR_CIPHER_INVALID __einfo_uniqify		\
	( EINFO_ECONNRESET,						\
	  ( IEEE80211_REASON_PAIR_CIPHER_INVALID & 0x1f ),		\
	  "Invalid pairwise cipher" )

#define ECONNRESET_AKMP_INVALID __einfo_error				\
	( EINFO_ECONNRESET_AKMP_INVALID )
#define EINFO_ECONNRESET_AKMP_INVALID __einfo_uniqify			\
	( EINFO_ECONNRESET,						\
	  ( IEEE80211_REASON_AKMP_INVALID & 0x1f ),			\
	  "Invalid AKMP" )

#define ECONNRESET_RSN_VERSION_INVALID __einfo_error			\
	( EINFO_ECONNRESET_RSN_VERSION_INVALID )
#define EINFO_ECONNRESET_RSN_VERSION_INVALID __einfo_uniqify		\
	( EINFO_ECONNRESET,						\
	  ( IEEE80211_REASON_RSN_VERSION_INVALID & 0x1f ),		\
	  "Unsupported RSN information element version" )

#define ECONNRESET_RSN_CAPAB_INVALID __einfo_error			\
	( EINFO_ECONNRESET_RSN_CAPAB_INVALID )
#define EINFO_ECONNRESET_RSN_CAPAB_INVALID __einfo_uniqify		\
	( EINFO_ECONNRESET,						\
	  ( IEEE80211_REASON_RSN_CAPAB_INVALID & 0x1f ),		\
	  "Invalid RSN information element capabilities" )

#define ECONNRESET_8021X_FAILURE __einfo_error				\
	( EINFO_ECONNRESET_8021X_FAILURE )
#define EINFO_ECONNRESET_8021X_FAILURE __einfo_uniqify			\
	( EINFO_ECONNRESET,						\
	  ( IEEE80211_REASON_8021X_FAILURE & 0x1f ),			\
	  "IEEE 802.1X authentication failed" )

#define ECONNRESET_CIPHER_REJECTED __einfo_error			\
	( EINFO_ECONNRESET_CIPHER_REJECTED )
#define EINFO_ECONNRESET_CIPHER_REJECTED __einfo_uniqify		\
	( EINFO_ECONNRESET,						\
	  ( IEEE80211_REASON_CIPHER_REJECTED & 0x1f ),			\
	  "Cipher suite rejected because of security policy" )

#define ENETRESET_QOS_UNSPECIFIED __einfo_error				\
	( EINFO_ENETRESET_QOS_UNSPECIFIED )
#define EINFO_ENETRESET_QOS_UNSPECIFIED __einfo_uniqify			\
	( EINFO_ENETRESET,						\
	  ( IEEE80211_REASON_QOS_UNSPECIFIED & 0x1f ),			\
	  "Disassociated for unspecified, QoS-related reason" )

#define ENETRESET_QOS_OUT_OF_RESOURCES __einfo_error			\
	( EINFO_ENETRESET_QOS_OUT_OF_RESOURCES )
#define EINFO_ENETRESET_QOS_OUT_OF_RESOURCES __einfo_uniqify		\
	( EINFO_ENETRESET,						\
	  ( IEEE80211_REASON_QOS_OUT_OF_RESOURCES & 0x1f ),		\
	  "Disassociated; QoS AP is out of QoS resources" )

#define ENETRESET_LINK_IS_HORRIBLE __einfo_error			\
	( EINFO_ENETRESET_LINK_IS_HORRIBLE )
#define EINFO_ENETRESET_LINK_IS_HORRIBLE __einfo_uniqify		\
	( EINFO_ENETRESET,						\
	  ( IEEE80211_REASON_LINK_IS_HORRIBLE & 0x1f ),			\
	  "Disassociated due to excessively poor link" )

#define ENETRESET_INVALID_TXOP __einfo_error				\
	( EINFO_ENETRESET_INVALID_TXOP )
#define EINFO_ENETRESET_INVALID_TXOP __einfo_uniqify			\
	( EINFO_ENETRESET,						\
	  ( IEEE80211_REASON_INVALID_TXOP & 0x1f ),			\
	  "Disassociated due to TXOP limit violation" )

#define ENETRESET_REQUESTED_LEAVING __einfo_error			\
	( EINFO_ENETRESET_REQUESTED_LEAVING )
#define EINFO_ENETRESET_REQUESTED_LEAVING __einfo_uniqify		\
	( EINFO_ENETRESET,						\
	  ( IEEE80211_REASON_REQUESTED_LEAVING & 0x1f ),		\
	  "Requested; STA is leaving the BSS (or resetting)" )

#define ENETRESET_REQUESTED_NO_USE __einfo_error			\
	( EINFO_ENETRESET_REQUESTED_NO_USE )
#define EINFO_ENETRESET_REQUESTED_NO_USE __einfo_uniqify		\
	( EINFO_ENETRESET,						\
	  ( IEEE80211_REASON_REQUESTED_NO_USE & 0x1f ),			\
	  "Requested; does not want to use the mechanism" )

#define ENETRESET_REQUESTED_NEED_SETUP __einfo_error			\
	( EINFO_ENETRESET_REQUESTED_NEED_SETUP )
#define EINFO_ENETRESET_REQUESTED_NEED_SETUP __einfo_uniqify		\
	( EINFO_ENETRESET,						\
	  ( IEEE80211_REASON_REQUESTED_NEED_SETUP & 0x1f ),		\
	  "Requested; setup is required" )

#define ENETRESET_REQUESTED_TIMEOUT __einfo_error			\
	( EINFO_ENETRESET_REQUESTED_TIMEOUT )
#define EINFO_ENETRESET_REQUESTED_TIMEOUT __einfo_uniqify		\
	( EINFO_ENETRESET,						\
	  ( IEEE80211_REASON_REQUESTED_TIMEOUT & 0x1f ),		\
	  "Requested from peer STA due to timeout" )

#define ENETRESET_CIPHER_UNSUPPORTED __einfo_error			\
	( EINFO_ENETRESET_CIPHER_UNSUPPORTED )
#define EINFO_ENETRESET_CIPHER_UNSUPPORTED __einfo_uniqify		\
	( EINFO_ENETRESET,						\
	  ( IEEE80211_REASON_CIPHER_UNSUPPORTED & 0x1f ),		\
	  "Peer STA does not support requested cipher suite" )

/** Make return status code from 802.11 status code */
#define E80211_STATUS( stat )						\
	( ( (stat) & 0x20 ) ?						\
	  EUNIQ ( EINFO_EHOSTUNREACH, ( (stat) & 0x1f ),		\
		  EHOSTUNREACH_QOS_FAILURE,				\
		  EHOSTUNREACH_QOS_NO_ROOM,				\
		  EHOSTUNREACH_LINK_IS_HORRIBLE,			\
		  EHOSTUNREACH_ASSOC_NEED_QOS,				\
		  EHOSTUNREACH_REQUEST_DECLINED,			\
		  EHOSTUNREACH_REQUEST_INVALID,				\
		  EHOSTUNREACH_TS_NOT_CREATED_AGAIN,			\
		  EHOSTUNREACH_INVALID_IE,				\
		  EHOSTUNREACH_GROUP_CIPHER_INVALID,			\
		  EHOSTUNREACH_PAIR_CIPHER_INVALID,			\
		  EHOSTUNREACH_AKMP_INVALID,				\
		  EHOSTUNREACH_RSN_VERSION_UNSUPP,			\
		  EHOSTUNREACH_RSN_CAPAB_INVALID,			\
		  EHOSTUNREACH_CIPHER_REJECTED,				\
		  EHOSTUNREACH_TS_NOT_CREATED_WAIT,			\
		  EHOSTUNREACH_DIRECT_LINK_FORBIDDEN,			\
		  EHOSTUNREACH_DEST_NOT_PRESENT,			\
		  EHOSTUNREACH_DEST_NOT_QOS,				\
		  EHOSTUNREACH_ASSOC_LISTEN_TOO_HIGH ) :		\
	  EUNIQ ( EINFO_ECONNREFUSED, ( (stat) & 0x1f ),		\
		  ECONNREFUSED_FAILURE,					\
		  ECONNREFUSED_CAPAB_UNSUPP,				\
		  ECONNREFUSED_REASSOC_INVALID,				\
		  ECONNREFUSED_ASSOC_DENIED,				\
		  ECONNREFUSED_AUTH_ALGO_UNSUPP,			\
		  ECONNREFUSED_AUTH_SEQ_INVALID,			\
		  ECONNREFUSED_AUTH_CHALL_INVALID,			\
		  ECONNREFUSED_AUTH_TIMEOUT,				\
		  ECONNREFUSED_ASSOC_NO_ROOM,				\
		  ECONNREFUSED_ASSOC_NEED_RATE,				\
		  ECONNREFUSED_ASSOC_NEED_SHORT_PMBL,			\
		  ECONNREFUSED_ASSOC_NEED_PBCC,				\
		  ECONNREFUSED_ASSOC_NEED_CHAN_AGILITY,			\
		  ECONNREFUSED_ASSOC_NEED_SPECTRUM_MGMT,		\
		  ECONNREFUSED_ASSOC_BAD_POWER,				\
		  ECONNREFUSED_ASSOC_BAD_CHANNELS,			\
		  ECONNREFUSED_ASSOC_NEED_SHORT_SLOT,			\
		  ECONNREFUSED_ASSOC_NEED_DSSS_OFDM ) )

/** Make return status code from 802.11 reason code */
#define E80211_REASON( reas )						\
	( ( (reas) & 0x20 ) ?						\
	  EUNIQ ( EINFO_ENETRESET, ( (reas) & 0x1f ),			\
		  ENETRESET_QOS_UNSPECIFIED,				\
		  ENETRESET_QOS_OUT_OF_RESOURCES,			\
		  ENETRESET_LINK_IS_HORRIBLE,				\
		  ENETRESET_INVALID_TXOP,				\
		  ENETRESET_REQUESTED_LEAVING,				\
		  ENETRESET_REQUESTED_NO_USE,				\
		  ENETRESET_REQUESTED_NEED_SETUP,			\
		  ENETRESET_REQUESTED_TIMEOUT,				\
		  ENETRESET_CIPHER_UNSUPPORTED ) :			\
	  EUNIQ ( EINFO_ECONNRESET, ( (reas) & 0x1f ),			\
		  ECONNRESET_UNSPECIFIED,				\
		  ECONNRESET_AUTH_NO_LONGER_VALID,			\
		  ECONNRESET_LEAVING,					\
		  ECONNRESET_INACTIVITY,				\
		  ECONNRESET_OUT_OF_RESOURCES,				\
		  ECONNRESET_NEED_AUTH,					\
		  ECONNRESET_NEED_ASSOC,				\
		  ECONNRESET_LEAVING_TO_ROAM,				\
		  ECONNRESET_REASSOC_INVALID,				\
		  ECONNRESET_BAD_POWER,					\
		  ECONNRESET_BAD_CHANNELS,				\
		  ECONNRESET_INVALID_IE,				\
		  ECONNRESET_MIC_FAILURE,				\
		  ECONNRESET_4WAY_TIMEOUT,				\
		  ECONNRESET_GROUPKEY_TIMEOUT,				\
		  ECONNRESET_4WAY_INVALID,				\
		  ECONNRESET_GROUP_CIPHER_INVALID,			\
		  ECONNRESET_PAIR_CIPHER_INVALID,			\
		  ECONNRESET_AKMP_INVALID,				\
		  ECONNRESET_RSN_VERSION_INVALID,			\
		  ECONNRESET_RSN_CAPAB_INVALID,				\
		  ECONNRESET_8021X_FAILURE,				\
		  ECONNRESET_CIPHER_REJECTED ) )

#endif /* _IPXE_NET80211_ERR_H */