forked from virt2real/uaputl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
uaputl.h
1289 lines (1155 loc) · 33.9 KB
/
uaputl.h
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
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
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/** @file uaputl.h
*
* @brief Header file for uaputl application
*
* Copyright (C) 2008-2009, Marvell International Ltd.
*
* This software file (the "File") is distributed by Marvell International
* Ltd. under the terms of the GNU General Public License Version 2, June 1991
* (the "License"). You may use, redistribute and/or modify this File in
* accordance with the terms and conditions of the License, a copy of which
* is available along with the File in the gpl.txt file or by writing to
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 or on the worldwide web at http://www.gnu.org/licenses/gpl.txt.
*
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
* this warranty disclaimer.
*
*/
/************************************************************************
Change log:
03/01/08: Initial creation
************************************************************************/
#ifndef _UAP_H
#define _UAP_H
#if (BYTE_ORDER == LITTLE_ENDIAN)
#undef BIG_ENDIAN
#endif
/** 16 bits byte swap */
#define swap_byte_16(x) \
((u16)((((u16)(x) & 0x00ffU) << 8) | \
(((u16)(x) & 0xff00U) >> 8)))
/** 32 bits byte swap */
#define swap_byte_32(x) \
((u32)((((u32)(x) & 0x000000ffUL) << 24) | \
(((u32)(x) & 0x0000ff00UL) << 8) | \
(((u32)(x) & 0x00ff0000UL) >> 8) | \
(((u32)(x) & 0xff000000UL) >> 24)))
/** 64 bits byte swap */
#define swap_byte_64(x) \
((u64)((u64)(((u64)(x) & 0x00000000000000ffULL) << 56) | \
(u64)(((u64)(x) & 0x000000000000ff00ULL) << 40) | \
(u64)(((u64)(x) & 0x0000000000ff0000ULL) << 24) | \
(u64)(((u64)(x) & 0x00000000ff000000ULL) << 8) | \
(u64)(((u64)(x) & 0x000000ff00000000ULL) >> 8) | \
(u64)(((u64)(x) & 0x0000ff0000000000ULL) >> 24) | \
(u64)(((u64)(x) & 0x00ff000000000000ULL) >> 40) | \
(u64)(((u64)(x) & 0xff00000000000000ULL) >> 56) ))
#ifdef BIG_ENDIAN
/** Convert from 16 bit little endian format to CPU format */
#define uap_le16_to_cpu(x) swap_byte_16(x)
/** Convert from 32 bit little endian format to CPU format */
#define uap_le32_to_cpu(x) swap_byte_32(x)
/** Convert from 64 bit little endian format to CPU format */
#define uap_le64_to_cpu(x) swap_byte_64(x)
/** Convert to 16 bit little endian format from CPU format */
#define uap_cpu_to_le16(x) swap_byte_16(x)
/** Convert to 32 bit little endian format from CPU format */
#define uap_cpu_to_le32(x) swap_byte_32(x)
/** Convert to 64 bit little endian format from CPU format */
#define uap_cpu_to_le64(x) swap_byte_64(x)
/** Convert APCMD header to little endian format from CPU format */
#define endian_convert_request_header(x); \
{ \
(x)->CmdCode = uap_cpu_to_le16((x)->CmdCode); \
(x)->Size = uap_cpu_to_le16((x)->Size); \
(x)->SeqNum = uap_cpu_to_le16((x)->SeqNum); \
(x)->Result = uap_cpu_to_le16((x)->Result); \
}
/** Convert APCMD header from little endian format to CPU format */
#define endian_convert_response_header(x); \
{ \
(x)->CmdCode = uap_le16_to_cpu((x)->CmdCode); \
(x)->Size = uap_le16_to_cpu((x)->Size); \
(x)->SeqNum = uap_le16_to_cpu((x)->SeqNum); \
(x)->Result = uap_le16_to_cpu((x)->Result); \
}
/** Convert TLV header to little endian format from CPU format */
#define endian_convert_tlv_header_out(x); \
{ \
(x)->Tag = uap_cpu_to_le16((x)->Tag); \
(x)->Length = uap_cpu_to_le16((x)->Length); \
}
/** Convert TLV header from little endian format to CPU format */
#define endian_convert_tlv_header_in(x); \
{ \
(x)->Tag = uap_le16_to_cpu((x)->Tag); \
(x)->Length = uap_le16_to_cpu((x)->Length); \
}
#else /* BIG_ENDIAN */
/** Do nothing */
#define uap_le16_to_cpu(x) x
/** Do nothing */
#define uap_le32_to_cpu(x) x
/** Do nothing */
#define uap_le64_to_cpu(x) x
/** Do nothing */
#define uap_cpu_to_le16(x) x
/** Do nothing */
#define uap_cpu_to_le32(x) x
/** Do nothing */
#define uap_cpu_to_le64(x) x
/** Do nothing */
#define endian_convert_request_header(x)
/** Do nothing */
#define endian_convert_response_header(x)
/** Do nothing */
#define endian_convert_tlv_header_out(x)
/** Do nothing */
#define endian_convert_tlv_header_in(x)
#endif /* BIG_ENDIAN */
/** uAP application version string */
#define UAP_VERSION "1.12"
/** Host Command ioctl number */
#define UAPHOSTCMD (SIOCDEVPRIVATE + 1)
/** Private command ID to Power Mode */
#define UAP_POWER_MODE (SIOCDEVPRIVATE + 3)
/** Default device name */
#define DEFAULT_DEV_NAME "uap0"
/** Success */
#define UAP_SUCCESS 1
/** Failure */
#define UAP_FAILURE 0
/** MAC BROADCAST */
#define UAP_RET_MAC_BROADCAST 0x1FF
/** MAC MULTICAST */
#define UAP_RET_MAC_MULTICAST 0x1FE
/** Command is successful */
#define CMD_SUCCESS 0
/** Command fails */
#define CMD_FAILURE -1
/** BSS start error : Invalid parameters */
#define BSS_FAILURE_START_INVAL -2
/** BSS start error : BSS already started */
#define BSS_FAILURE_START_REDUNDANT -3
/** BSS stop error : BSS already stopped */
#define BSS_FAILURE_STOP_REDUNDANT -2
/** BSS stop error : No active BSS */
#define BSS_FAILURE_STOP_INVAL -3
/** Maximum line length for config file */
#define MAX_LINE_LENGTH 240
/** Maximum command length */
#define MAX_CMD_LENGTH 100
/** Size of command buffer */
#define MRVDRV_SIZE_OF_CMD_BUFFER (2 * 1024)
/** Maximum number of clients supported by AP */
#define MAX_NUM_CLIENTS 16
/** Maximum number of MAC addresses for one-shot filter modifications */
#define MAX_MAC_ONESHOT_FILTER 16
/** Maximum SSID length */
#define MAX_SSID_LENGTH 32
/** Maximum SSID length */
#define MIN_SSID_LENGTH 1
/** Maximum WPA passphrase length */
#define MAX_WPA_PASSPHRASE_LENGTH 64
/** Minimum WPA passphrase length */
#define MIN_WPA_PASSPHRASE_LENGTH 8
/** Maximum data rates */
#define MAX_DATA_RATES 14
/** Maximum length of lines in configuration file */
#define MAX_CONFIG_LINE 240
/** MSB bit is set if its a basic rate */
#define BASIC_RATE_SET_BIT 0x80
/** Maximum group key timer */
#define MAX_GRP_TIMER 86400
/** Maximum Retry Limit */
#define MAX_RETRY_LIMIT 14
/** Maximum TX Power Limit */
#define MAX_TX_POWER 20
/** Minimum TX Power Limit */
#define MIN_TX_POWER 0
/** Maximum channels */
#define MAX_CHANNELS 14
/** Maximum RTS threshold */
#define MAX_RTS_THRESHOLD 2347
/** Maximum fragmentation threshold */
#define MAX_FRAG_THRESHOLD 2346
/** Minimum fragmentation threshold */
#define MIN_FRAG_THRESHOLD 256
/** Maximum stage out time */
#define MAX_STAGE_OUT_TIME 864000
/** Minimum stage out time */
#define MIN_STAGE_OUT_TIME 300
/** Maximum DTIM period */
#define MAX_DTIM_PERIOD 100
/** Maximum BEACON period */
#define MAX_BEACON_PERIOD 4000
/** Minimum BEACON period */
#define MIN_BEACON_PERIOD 50
/** Maximum IE buffer length */
#define MAX_IE_BUFFER_LEN 256
/** Maximum custom IE count */
#define MAX_CUSTOM_IE_COUNT 4
/** Maximum number of rates allowed at a time */
#define MAX_RATES 12
/** Default wait period in seconds */
#define DEFAULT_WAIT_TIME 3
#ifdef __GNUC__
/** Structure packing begins */
#define PACK_START
/** Structure packeing end */
#define PACK_END __attribute__ ((packed))
#else
/** Structure packing begins */
#define PACK_START __packed
/** Structure packeing end */
#define PACK_END
#endif
#ifndef ETH_ALEN
/** MAC address length */
#define ETH_ALEN 6
#endif
/** Action field value : get */
#define ACTION_GET 0
/** Action field value : set */
#define ACTION_SET 1
/**
* Hex or Decimal to Integer
* @param num string to convert into decimal or hex
*/
#define A2HEXDECIMAL(num) \
(strncasecmp("0x", (num), 2)?(unsigned int) strtoll((num),NULL,0):a2hex((num)))\
/**
* Check of decimal or hex string
* @param num string
*/
#define IS_HEX_OR_DIGIT(num) \
(strncasecmp("0x", (num), 2)?ISDIGIT((num)):ishexstring((num)))\
/** Find minimum value */
#ifndef MIN
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#endif /* MIN */
/** Character, 1 byte */
typedef char s8;
/** Unsigned character, 1 byte */
typedef unsigned char u8;
/** Short integer */
typedef signed short s16;
/** Unsigned short integer */
typedef unsigned short u16;
/** Long integer */
typedef signed long s32;
/** Unsigned long integer */
typedef unsigned long u32;
/** Valid Input Commands */
typedef enum
{
RDEEPROM,
SCANCHANNELS,
TXPOWER,
PROTOCOL,
CHANNEL,
RATE,
BROADCASTSSID,
RTSTHRESH,
FRAGTHRESH,
DTIMPERIOD,
RADIOCONTROL,
TXDATARATE,
MCBCDATARATE,
PKTFWD,
STAAGEOUTTIMER,
AUTHMODE,
GROUPREKEYTIMER,
MAXSTANUM,
BEACONPERIOD,
RETRYLIMIT,
RSNREPLAYPROT,
COEX_COMM_BITMAP,
COEX_PROTECTION,
COEX_SCO_ACL_FREQ,
COEX_ACL_ENABLED,
COEX_ACL_BT_TIME,
COEX_ACL_WLAN_TIME,
} valid_inputs;
/** Message verbosity level */
enum
{ MSG_NONE, MSG_DEBUG, MSG_ALL };
/** oids_table */
typedef struct
{
/** oid type */
u16 type;
/** oid len */
u16 len;
/** oid name */
char *name;
} oids_table;
/** 4 byte header to store buf len*/
#define BUF_HEADER_SIZE 4
/** AP CMD header */
#define APCMDHEADER /** Buf Size */ \
u32 BufSize; \
/** CmdCode */ \
u16 CmdCode; \
/** Size */ \
u16 Size; \
/** SeqNum */ \
u16 SeqNum; \
/** Result */ \
s16 Result
/** TLV header */
#define TLVHEADER /** Tag */ \
u16 Tag; \
/** Length */ \
u16 Length
/* TLV Definitions */
/** TLV buffer header*/
typedef PACK_START struct _TLVBUF_HEADER
{
/** Header type */
u16 Type;
/** Header length */
u16 Len;
/** Data */
u8 Data[0];
} PACK_END TLVBUF_HEADER;
/** Band config ACS mode */
#define BAND_CONFIG_ACS_MODE 0x40
/** TLV buffer : Channel Config */
typedef PACK_START struct _TLVBUF_CHANNEL_CONFIG
{
/** Header */
TLVHEADER;
/** Band Configuration
*
* [7-6] Channel Selection Mode; 00 manual, 01 ACS
* [3-2] Channel Width; 00 20 MHz
* [1-0] Band Info; 00 2.4 GHz
*/
u8 BandConfigType;
/** Channel number */
u8 ChanNumber;
} PACK_END TLVBUF_CHANNEL_CONFIG;
/** Channel List Entry */
typedef PACK_START struct _CHANNEL_LIST
{
/** Band Config */
u8 BandConfigType;
/** Channel Number */
u8 ChanNumber;
/** Reserved */
u8 Reserved1;
/** Reserved */
u16 Reserved2;
/** Reserved */
u16 Reserved3;
} PACK_END CHANNEL_LIST;
/** TLV buffer : Channel List */
typedef PACK_START struct _TLVBUF_CHANNEL_LIST
{
/** Header */
TLVHEADER;
/** Channel List */
CHANNEL_LIST ChanList[0];
} PACK_END TLVBUF_CHANNEL_LIST;
/** TLV buffer : AP MAC address */
typedef PACK_START struct _TLVBUF_AP_MAC_ADDRESS
{
/** Header */
TLVHEADER;
/** AP MAC address */
u8 ApMacAddr[ETH_ALEN];
} PACK_END TLVBUF_AP_MAC_ADDRESS;
/** TLV buffer : SSID */
typedef PACK_START struct _TLVBUF_SSID
{
/** Header */
TLVHEADER;
/** SSID */
u8 Ssid[0];
} PACK_END TLVBUF_SSID;
/** TLV buffer : Beacon period */
typedef PACK_START struct _TLVBUF_BEACON_PERIOD
{
/** Header */
TLVHEADER;
/** Beacon period */
u16 BeaconPeriod_ms;
} PACK_END TLVBUF_BEACON_PERIOD;
/** TLV buffer : DTIM period */
typedef PACK_START struct _TLVBUF_DTIM_PERIOD
{
/** Header */
TLVHEADER;
/** DTIM period */
u8 DtimPeriod;
} PACK_END TLVBUF_DTIM_PERIOD;
/** TLV buffer : Channel */
typedef PACK_START struct _TLVBUF_PHYPARAMDSSET
{
/** Header */
TLVHEADER;
/** Channel */
u8 Channel;
} PACK_END TLVBUF_PHYPARAMDSSET;
/** TLV buffer : Operational rates */
typedef PACK_START struct _TLVBUF_RATES
{
/** Header */
TLVHEADER;
/** Operational rates */
u8 OperationalRates[0];
} PACK_END TLVBUF_RATES;
/** TLV buffer : Tx power */
typedef PACK_START struct _TLVBUF_TX_POWER
{
/** Header */
TLVHEADER;
/** Tx power in dBm */
u8 TxPower_dBm;
} PACK_END TLVBUF_TX_POWER;
/** TLV buffer : SSID broadcast control */
typedef PACK_START struct _TLVBUF_BCAST_SSID_CTL
{
/** Header */
TLVHEADER;
/** SSID broadcast control flag */
u8 BcastSsidCtl;
} PACK_END TLVBUF_BCAST_SSID_CTL;
/** TLV buffer : RSN replay protection */
typedef PACK_START struct _tlvbuf_rsn_replay_prot
{
/** Header */
TLVHEADER;
/** RSN replay protection control flag */
u8 rsn_replay_prot;
} PACK_END tlvbuf_rsn_replay_prot;
/** TLV buffer : Preamble control */
typedef PACK_START struct _TLVBUF_PREAMBLE_CTL
{
/** Header */
TLVHEADER;
/** Preamble type */
u8 PreambleType;
} PACK_END TLVBUF_PREAMBLE_CTL;
/** TLV buffer : Antenna control */
typedef PACK_START struct _TLVBUF_ANTENNA_CTL
{
/** Header */
TLVHEADER;
/** Antenna type */
u8 WhichAntenna;
/** Antenna mode */
u8 AntennaMode;
} PACK_END TLVBUF_ANTENNA_CTL;
/** TLV buffer : RTS threshold */
typedef PACK_START struct _TLVBUF_RTS_THRESHOLD
{
/** Header */
TLVHEADER;
/** RTS threshold */
u16 RtsThreshold;
} PACK_END TLVBUF_RTS_THRESHOLD;
/** TLV buffer : Radio control */
typedef PACK_START struct _TLVBUF_RADIO_CTL
{
/** Header */
TLVHEADER;
/** Radio control flag */
u8 RadioCtl;
} PACK_END TLVBUF_RADIO_CTL;
/** TLV buffer : Tx data rate */
typedef PACK_START struct _TLVBUF_TX_DATA_RATE
{
/** Header */
TLVHEADER;
/** Tx data rate */
u16 TxDataRate;
} PACK_END TLVBUF_TX_DATA_RATE;
/** TLV buffer : MCBC Data Rate */
typedef PACK_START struct _TLVBUF_MCBC_DATA_RATE
{
/** Header */
TLVHEADER;
/** MCBC data rate */
u16 MCBCdatarate;
} PACK_END TLVBUF_MCBC_DATA_RATE;
/** TLV buffer : Packet forward control */
typedef PACK_START struct _TLVBUF_PKT_FWD_CTL
{
/** Header */
TLVHEADER;
/** Packet forwarding control flag */
u8 PktFwdCtl;
} PACK_END TLVBUF_PKT_FWD_CTL;
/** TLV buffer : STA information */
typedef PACK_START struct _TLVBUF_STA_INFO
{
/** Header */
TLVHEADER;
/** STA MAC address */
u8 MacAddress[ETH_ALEN];
/** Power mfg status */
u8 PowerMfgStatus;
/** RSSI */
s8 Rssi;
} PACK_END TLVBUF_STA_INFO;
/** TLV buffer : STA MAC address filtering control */
typedef PACK_START struct _TLVBUF_STA_MAC_ADDR_FILTER
{
/** Header */
TLVHEADER;
/** Filter mode */
u8 FilterMode;
/** Number of STA MACs */
u8 Count;
/** STA MAC addresses buffer */
u8 MacAddress[0];
} PACK_END TLVBUF_STA_MAC_ADDR_FILTER;
/** TLV buffer : STA ageout timer */
typedef PACK_START struct _TLVBUF_STA_AGEOUT_TIMER
{
/** Header */
TLVHEADER;
/** STA ageout timer in ms */
u32 StaAgeoutTimer_ms;
} PACK_END TLVBUF_STA_AGEOUT_TIMER;
/** TLV buffer : max station number */
typedef PACK_START struct _TLVBUF_MAX_STA_NUM
{
/** Header */
TLVHEADER;
/** max station number */
u16 Max_sta_num;
} PACK_END TLVBUF_MAX_STA_NUM;
/** TLV buffer : retry limit */
typedef PACK_START struct _TLVBUF_RETRY_LIMIT
{
/** Header */
TLVHEADER;
/** retry limit */
u8 retry_limit;
} PACK_END TLVBUF_RETRY_LIMIT;
/* Bitmap for protocol to use */
/** No security */
#define PROTOCOL_NO_SECURITY 1
/** Static WEP */
#define PROTOCOL_STATIC_WEP 2
/** WPA */
#define PROTOCOL_WPA 8
/** WPA2 */
#define PROTOCOL_WPA2 32
/** WP2 Mixed */
#define PROTOCOL_WPA2_MIXED 40
/* Bitmap for unicast/bcast cipher type */
/** None */
#define CIPHER_NONE 0
/** WEP 40 */
#define CIPHER_WEP_40 1
/** WEP 104 */
#define CIPHER_WEP_104 2
/** TKIP */
#define CIPHER_TKIP 4
/** AES CCMP */
#define CIPHER_AES_CCMP 8
/** valid cipher bitmap */
#define CIPHER_BITMAP 0x0c
/** TLV buffer : Authentication Mode */
typedef PACK_START struct _TLVBUF_AUTH_MODE
{
/** Header */
TLVHEADER;
/** Authentication Mode */
u8 AuthMode;
} PACK_END TLVBUF_AUTH_MODE;
/** TLV buffer : Security Protocol */
typedef PACK_START struct _TLVBUF_PROTOCOL
{
/** Header */
TLVHEADER;
/** Security protocol */
u16 Protocol;
} PACK_END TLVBUF_PROTOCOL;
/** TLV buffer : cipher */
typedef PACK_START struct _TLVBUF_CIPHER
{
/** Header */
TLVHEADER;
/** Pairwise cipher */
u8 PairwiseCipher;
/** Group cipher */
u8 GroupCipher;
} PACK_END TLVBUF_CIPHER;
/** TLV buffer : Group re-key time */
typedef PACK_START struct _TLVBUF_GROUP_REKEY_TIMER
{
/** Header */
TLVHEADER;
/** Group rekey time in seconds */
u32 GroupRekeyTime_sec;
} PACK_END TLVBUF_GROUP_REKEY_TIMER;
/** Key_mgmt_psk */
#define KEY_MGMT_NONE 0x04
/** Key_mgmt_none */
#define KEY_MGMT_PSK 0x02
/** TLV buffer : KeyMgmt */
typedef PACK_START struct _TLVBUF_AKMP
{
/** Header */
TLVHEADER;
/** KeyMgmt */
u16 KeyMgmt;
} PACK_END TLVBUF_AKMP;
/** TLV buffer : Single WEP key */
typedef PACK_START struct _TLVBUF_WEP_KEY
{
/** Header */
TLVHEADER;
/** Key index */
u8 KeyIndex;
/** Default key flag */
u8 IsDefault;
/** Key */
u8 Key[0];
} PACK_END TLVBUF_WEP_KEY;
/** custom IE */
typedef PACK_START struct _custom_ie
{
/** IE Index */
u16 ie_index;
/** Mgmt Subtype Mask */
u16 mgmt_subtype_mask;
/** IE Length */
u16 ie_length;
/** IE buffer */
u8 ie_buffer[0];
} PACK_END custom_ie;
/** TLV buffer : custom IE */
typedef PACK_START struct _tlvbuf_custom_ie
{
/** Header */
TLVHEADER;
/** custom IE data */
custom_ie ie_data[0];
} PACK_END tlvbuf_custom_ie;
/** TLV buffer : WPA passphrase */
typedef PACK_START struct _TLVBUF_WPA_PASSPHRASE
{
/** Header */
TLVHEADER;
/** WPA passphrase */
u8 Passphrase[0];
} PACK_END TLVBUF_WPA_PASSPHRASE;
/** TLV buffer : Fragmentation threshold */
typedef PACK_START struct _TLVBUF_FRAG_THRESHOLD
{
/** Header */
TLVHEADER;
/** Fragmentation threshold */
u16 FragThreshold;
} PACK_END TLVBUF_FRAG_THRESHOLD;
/* APCMD definitions */
/** APCMD buffer */
typedef PACK_START struct _APCMDBUF
{
/** Header */
APCMDHEADER;
}
PACK_END APCMDBUF;
/** APCMD header length */
#define APCMDHEADERLEN (sizeof(APCMDBUF))
/** APCMD buffer : sys_info request */
typedef PACK_START struct _APCMDBUF_SYS_INFO_REQUEST
{
/** Header */
APCMDHEADER;
} PACK_END APCMDBUF_SYS_INFO_REQUEST;
/** APCMD buffer : sys_info response */
typedef PACK_START struct _APCMDBUF_SYS_INFO_RESPONSE
{
/** Header */
APCMDHEADER;
/** System information buffer */
u8 SysInfo[64];
} PACK_END APCMDBUF_SYS_INFO_RESPONSE;
/** APCMD buffer : sys_reset */
typedef PACK_START struct _APCMDBUF_SYS_RESET
{
/** Header */
APCMDHEADER;
} PACK_END APCMDBUF_SYS_RESET;
/** APCMD buffer : sys_configure */
typedef PACK_START struct _APCMDBUF_SYS_CONFIGURE
{
/** Header */
APCMDHEADER;
/** Action : GET or SET */
u16 Action;
} PACK_END APCMDBUF_SYS_CONFIGURE;
/** APCMD buffer : SNMP MIB */
typedef PACK_START struct _APCMDBUF_SNMP_MIB
{
/** Header */
APCMDHEADER;
/** Action : GET or SET */
u16 Action;
} PACK_END APCMDBUF_SNMP_MIB;
/** APCMD buffer : bss_start */
typedef PACK_START struct _APCMDBUF_BSS_START
{
/** Header */
APCMDHEADER;
} PACK_END APCMDBUF_BSS_START;
/** APCMD buffer : bss_stop */
typedef PACK_START struct _APCMDBUF_BSS_STOP
{
/** Header */
APCMDHEADER;
} PACK_END APCMDBUF_BSS_STOP;
/** APCMD buffer : sta_list request */
typedef PACK_START struct _APCMDBUF_STA_LIST_REQUEST
{
/** Header */
APCMDHEADER;
} PACK_END APCMDBUF_STA_LIST_REQUEST;
/** APCMD buffer : sta_list response */
typedef PACK_START struct _APCMDBUF_STA_LIST_RESPONSE
{
/** Header */
APCMDHEADER;
/** Number of STAs */
u16 StaCount;
/** STA information TLVs */
TLVBUF_STA_INFO StaList[0];
} PACK_END APCMDBUF_STA_LIST_RESPONSE;
/** APCMD buffer : sta_deauth */
typedef PACK_START struct _APCMDBUF_STA_DEAUTH
{
/** Header */
APCMDHEADER;
/** STA MAC address to deauthenticate */
u8 StaMacAddress[ETH_ALEN];
/** Reason Code */
u16 ReasonCode;
} PACK_END APCMDBUF_STA_DEAUTH;
/** TLV : BT Coex common configuration */
typedef PACK_START struct _tlvbuf_coex_common_cfg
{
/** Header */
TLVHEADER;
/** Configuration bitmap */
u32 config_bitmap;
/** Reserved */
u32 reserved[4];
} PACK_END tlvbuf_coex_common_cfg;
/** TLV : BT Coex SCO configuration */
typedef PACK_START struct _tlvbuf_coex_sco_cfg
{
/** Header */
TLVHEADER;
/** Qtime protection */
u16 protection_qtime[4];
/** Rate protection */
u16 protection_rate;
/** ACL frequency */
u16 acl_frequency;
/** Reserved */
u32 reserved[4];
} PACK_END tlvbuf_coex_sco_cfg;
/** TLV : BT Coex ACL configuration */
typedef PACK_START struct _tlvbuf_coex_acl_cfg
{
/** Header */
TLVHEADER;
/** Enabled or not */
u16 enabled;
/** BT time */
u16 bt_time;
/** Wlan time */
u16 wlan_time;
/** Rate protection */
u16 protection_rate;
/** Reserved */
u32 reserved[4];
} PACK_END tlvbuf_coex_acl_cfg;
/** TLV : BT Coex statistics */
typedef PACK_START struct _tlvbuf_coex_stats
{
/** Header */
TLVHEADER;
/** Null not sent */
u32 null_not_sent;
/** Null queued */
u32 null_queued;
/** Null not queued */
u32 null_not_queued;
/** CF end queued */
u32 cf_end_queued;
/** CF end not queued */
u32 cf_end_not_queued;
/** Null allocation failures */
u32 null_alloc_fail;
/** CF end allocation failures */
u32 cf_end_alloc_fail;
/** Reserved */
u32 reserved[8];
} PACK_END tlvbuf_coex_stats;
/** APCMD buffer : BT Coex API extension */
typedef PACK_START struct _apcmdbuf_coex_config
{
/** Header */
APCMDHEADER;
/** Action : GET or SET */
u16 action;
/** Reserved for alignment */
u16 coex_reserved;
/** TLV buffer */
u8 tlv_buffer[0];
} PACK_END apcmdbuf_coex_config;
/** Reg TYPE*/
enum reg_commands
{
CMD_MAC = 0,
CMD_BBP,
CMD_RF
};
/** APCMD buffer: Regrdwr */
typedef PACK_START struct _APCMDBUF_REG_RDWR
{
/** Header */
APCMDHEADER;
/** Read or Write */
u16 Action;
/** Register offset */
u16 Offset;
/** Value */
u32 Value;
} PACK_END APCMDBUF_REG_RDWR;
/** sub-band type */
typedef PACK_START struct _IEEEtypes_SubbandSet
{
u8 FirstChan; /**< First channel */
u8 NoOfChan; /**< Number of channels */
u8 MaxTxPwr; /**< Maximum Tx power */
} PACK_END IEEEtypes_SubbandSet_t;
/** country code length used for 802.11D */
#define COUNTRY_CODE_LEN 3
/** MAX domain SUB-BAND*/
#define MAX_SUB_BANDS 40
/** Max Multi Domain Entries for G */
#define MaxMultiDomainCapabilityEntryG 1
/** Max Multi Domain Entries for A */
#define MaxMultiDomainCapabilityEntryA 31
/** Country code and Sub-band */
typedef PACK_START struct domain_param
{
TLVHEADER;
u8 CountryCode[COUNTRY_CODE_LEN]; /**< Country code */
IEEEtypes_SubbandSet_t Subband[0]; /**< Set of subbands */
} PACK_END domain_param_t;
/** HostCmd_CFG_80211D */
typedef PACK_START struct _APCMDBUF_CFG_80211D
{
/** Header */
APCMDHEADER;
/** Action */
u16 Action; /* 0 = ACT_GET; 1 = ACT_SET; */
/** Domain parameters */
domain_param_t Domain;
} PACK_END APCMDBUF_CFG_80211D;
/** HostCmd_MEM_ACCESS */
typedef PACK_START struct _APCMDBUF_MEM_ACCESS
{
/** Header */
APCMDHEADER;
/** Action */
u16 Action; /* 0 = ACT_GET; 1 = ACT_SET; */
/** Reserved field */
u16 Reserved;
/** Address */
u32 Address;
/** Value */
u32 Value;
} PACK_END APCMDBUF_MEM_ACCESS;
/** HostCmd_EEPROM_ACCESS */
typedef PACK_START struct _APCMDBUF_EEPROM_ACCESS
{
/** Header */
APCMDHEADER;
/** Action */
u16 Action; /* 0 = ACT_GET; */
/** Reserved field */
u16 Offset; /* Multiples of 4 */
/** Address */
u16 ByteCount; /* Multiples of 4 */
/** Value */
u8 Value[1];