fix broken use of ../.. in Makefile that impacts builds in some circumstances
[debian/uaputl] / uaputl.h
1 /** @file  uaputl.h
2  *
3  *  @brief Header file for uaputl application
4  * 
5  * Copyright (C) 2008-2009, Marvell International Ltd. 
6  *
7  * This software file (the "File") is distributed by Marvell International 
8  * Ltd. under the terms of the GNU General Public License Version 2, June 1991 
9  * (the "License").  You may use, redistribute and/or modify this File in 
10  * accordance with the terms and conditions of the License, a copy of which 
11  * is available along with the File in the gpl.txt file or by writing to 
12  * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 
13  * 02111-1307 or on the worldwide web at http://www.gnu.org/licenses/gpl.txt.
14  *
15  * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE 
16  * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE 
17  * ARE EXPRESSLY DISCLAIMED.  The License provides additional details about 
18  * this warranty disclaimer.
19  *
20  */
21 /************************************************************************
22 Change log:
23     03/01/08: Initial creation
24 ************************************************************************/
25
26 #ifndef _UAP_H
27 #define _UAP_H
28
29 #if (BYTE_ORDER == LITTLE_ENDIAN)
30 #undef BIG_ENDIAN
31 #endif
32
33 /** 16 bits byte swap */
34 #define swap_byte_16(x) \
35   ((u16)((((u16)(x) & 0x00ffU) << 8) | \
36          (((u16)(x) & 0xff00U) >> 8)))
37
38 /** 32 bits byte swap */
39 #define swap_byte_32(x) \
40   ((u32)((((u32)(x) & 0x000000ffUL) << 24) | \
41          (((u32)(x) & 0x0000ff00UL) <<  8) | \
42          (((u32)(x) & 0x00ff0000UL) >>  8) | \
43          (((u32)(x) & 0xff000000UL) >> 24)))
44
45 /** 64 bits byte swap */
46 #define swap_byte_64(x) \
47   ((u64)((u64)(((u64)(x) & 0x00000000000000ffULL) << 56) | \
48          (u64)(((u64)(x) & 0x000000000000ff00ULL) << 40) | \
49          (u64)(((u64)(x) & 0x0000000000ff0000ULL) << 24) | \
50          (u64)(((u64)(x) & 0x00000000ff000000ULL) <<  8) | \
51          (u64)(((u64)(x) & 0x000000ff00000000ULL) >>  8) | \
52          (u64)(((u64)(x) & 0x0000ff0000000000ULL) >> 24) | \
53          (u64)(((u64)(x) & 0x00ff000000000000ULL) >> 40) | \
54          (u64)(((u64)(x) & 0xff00000000000000ULL) >> 56) ))
55
56 #ifdef BIG_ENDIAN
57 /** Convert from 16 bit little endian format to CPU format */
58 #define uap_le16_to_cpu(x) swap_byte_16(x)
59 /** Convert from 32 bit little endian format to CPU format */
60 #define uap_le32_to_cpu(x) swap_byte_32(x)
61 /** Convert from 64 bit little endian format to CPU format */
62 #define uap_le64_to_cpu(x) swap_byte_64(x)
63 /** Convert to 16 bit little endian format from CPU format */
64 #define uap_cpu_to_le16(x) swap_byte_16(x)
65 /** Convert to 32 bit little endian format from CPU format */
66 #define uap_cpu_to_le32(x) swap_byte_32(x)
67 /** Convert to 64 bit little endian format from CPU format */
68 #define uap_cpu_to_le64(x) swap_byte_64(x)
69
70 /** Convert APCMD header to little endian format from CPU format */
71 #define endian_convert_request_header(x);               \
72     {                                                   \
73         (x)->CmdCode = uap_cpu_to_le16((x)->CmdCode);   \
74         (x)->Size = uap_cpu_to_le16((x)->Size);         \
75         (x)->SeqNum = uap_cpu_to_le16((x)->SeqNum);     \
76         (x)->Result = uap_cpu_to_le16((x)->Result);     \
77     }
78
79 /** Convert APCMD header from little endian format to CPU format */
80 #define endian_convert_response_header(x);              \
81     {                                                   \
82         (x)->CmdCode = uap_le16_to_cpu((x)->CmdCode);   \
83         (x)->Size = uap_le16_to_cpu((x)->Size);         \
84         (x)->SeqNum = uap_le16_to_cpu((x)->SeqNum);     \
85         (x)->Result = uap_le16_to_cpu((x)->Result);     \
86     }
87
88 /** Convert TLV header to little endian format from CPU format */
89 #define endian_convert_tlv_header_out(x);           \
90     {                                               \
91         (x)->Tag = uap_cpu_to_le16((x)->Tag);       \
92         (x)->Length = uap_cpu_to_le16((x)->Length); \
93     }
94
95 /** Convert TLV header from little endian format to CPU format */
96 #define endian_convert_tlv_header_in(x);            \
97     {                                               \
98         (x)->Tag = uap_le16_to_cpu((x)->Tag);       \
99         (x)->Length = uap_le16_to_cpu((x)->Length); \
100     }
101
102 #else /* BIG_ENDIAN */
103 /** Do nothing */
104 #define uap_le16_to_cpu(x) x
105 /** Do nothing */
106 #define uap_le32_to_cpu(x) x
107 /** Do nothing */
108 #define uap_le64_to_cpu(x) x
109 /** Do nothing */
110 #define uap_cpu_to_le16(x) x
111 /** Do nothing */
112 #define uap_cpu_to_le32(x) x
113 /** Do nothing */
114 #define uap_cpu_to_le64(x) x
115
116 /** Do nothing */
117 #define endian_convert_request_header(x)
118 /** Do nothing */
119 #define endian_convert_response_header(x)
120 /** Do nothing */
121 #define endian_convert_tlv_header_out(x)
122 /** Do nothing */
123 #define endian_convert_tlv_header_in(x)
124 #endif /* BIG_ENDIAN */
125
126 /** uAP application version string */
127 #define UAP_VERSION         "1.12"
128 /** Host Command ioctl number */
129 #define UAPHOSTCMD          (SIOCDEVPRIVATE + 1)
130 /** Private command ID to Power Mode */
131 #define UAP_POWER_MODE      (SIOCDEVPRIVATE + 3)
132
133 /** Default device name */
134 #define DEFAULT_DEV_NAME    "uap0"
135
136 /** Success */
137 #define UAP_SUCCESS     1
138 /** Failure */
139 #define UAP_FAILURE     0
140 /** MAC BROADCAST */
141 #define UAP_RET_MAC_BROADCAST   0x1FF
142 /** MAC MULTICAST */
143 #define UAP_RET_MAC_MULTICAST   0x1FE
144
145 /** Command is successful */
146 #define CMD_SUCCESS     0
147 /** Command fails */
148 #define CMD_FAILURE     -1
149
150 /** BSS start error : Invalid parameters */
151 #define BSS_FAILURE_START_INVAL     -2
152 /** BSS start error : BSS already started */
153 #define BSS_FAILURE_START_REDUNDANT -3
154
155 /** BSS stop error : BSS already stopped */
156 #define BSS_FAILURE_STOP_REDUNDANT  -2
157 /** BSS stop error : No active BSS */
158 #define BSS_FAILURE_STOP_INVAL      -3
159
160 /** Maximum line length for config file */
161 #define MAX_LINE_LENGTH         240
162 /** Maximum command length */
163 #define MAX_CMD_LENGTH          100
164 /** Size of command buffer */
165 #define MRVDRV_SIZE_OF_CMD_BUFFER       (2 * 1024)
166 /** Maximum number of clients supported by AP */
167 #define MAX_NUM_CLIENTS         16
168 /** Maximum number of MAC addresses for one-shot filter modifications */
169 #define MAX_MAC_ONESHOT_FILTER  16
170 /** Maximum SSID length */
171 #define MAX_SSID_LENGTH         32
172 /** Maximum SSID length */
173 #define MIN_SSID_LENGTH         1
174 /** Maximum WPA passphrase length */
175 #define MAX_WPA_PASSPHRASE_LENGTH   64
176 /** Minimum WPA passphrase length */
177 #define MIN_WPA_PASSPHRASE_LENGTH   8
178 /** Maximum data rates */
179 #define MAX_DATA_RATES          14
180 /** Maximum length of lines in configuration file */
181 #define MAX_CONFIG_LINE         240
182 /** MSB bit is set if its a basic rate */
183 #define BASIC_RATE_SET_BIT     0x80
184 /** Maximum group key timer */
185 #define MAX_GRP_TIMER   86400
186 /** Maximum Retry Limit */
187 #define MAX_RETRY_LIMIT         14
188
189 /** Maximum TX Power Limit */
190 #define MAX_TX_POWER    20
191 /** Minimum TX Power Limit */
192 #define MIN_TX_POWER    0
193
194 /** Maximum channels */
195 #define MAX_CHANNELS    14
196 /** Maximum RTS threshold */
197 #define MAX_RTS_THRESHOLD   2347
198
199 /** Maximum fragmentation threshold */
200 #define MAX_FRAG_THRESHOLD 2346
201 /** Minimum fragmentation threshold */
202 #define MIN_FRAG_THRESHOLD 256
203
204 /** Maximum stage out time */
205 #define MAX_STAGE_OUT_TIME  864000
206 /** Minimum stage out time */
207 #define MIN_STAGE_OUT_TIME  300
208
209 /** Maximum DTIM period */
210 #define MAX_DTIM_PERIOD 100
211
212 /** Maximum BEACON period */
213 #define MAX_BEACON_PERIOD 4000
214
215 /** Minimum BEACON period */
216 #define MIN_BEACON_PERIOD 50
217
218 /** Maximum IE buffer length */
219 #define MAX_IE_BUFFER_LEN 256
220
221 /** Maximum custom IE count */
222 #define MAX_CUSTOM_IE_COUNT 4
223
224 /** Maximum number of rates allowed at a time */
225 #define MAX_RATES               12
226
227 /** Default wait period in seconds */
228 #define DEFAULT_WAIT_TIME       3
229
230 #ifdef __GNUC__
231 /** Structure packing begins */
232 #define PACK_START
233 /** Structure packeing end */
234 #define PACK_END  __attribute__ ((packed))
235 #else
236 /** Structure packing begins */
237 #define PACK_START   __packed
238 /** Structure packeing end */
239 #define PACK_END
240 #endif
241
242 #ifndef ETH_ALEN
243 /** MAC address length */
244 #define ETH_ALEN    6
245 #endif
246
247 /** Action field value : get */
248 #define ACTION_GET  0
249 /** Action field value : set */
250 #define ACTION_SET  1
251 /**
252  * Hex or Decimal to Integer 
253  * @param   num string to convert into decimal or hex
254  */
255 #define A2HEXDECIMAL(num)  \
256     (strncasecmp("0x", (num), 2)?(unsigned int) strtoll((num),NULL,0):a2hex((num)))\
257
258 /**
259  * Check of decimal or hex string
260  * @param   num string
261  */
262 #define IS_HEX_OR_DIGIT(num) \
263     (strncasecmp("0x", (num), 2)?ISDIGIT((num)):ishexstring((num)))\
264
265 /** Find minimum value */
266 #ifndef MIN
267 #define MIN(a, b) ((a) < (b) ? (a) : (b))
268 #endif /* MIN */
269
270 /** Character, 1 byte */
271 typedef char s8;
272 /** Unsigned character, 1 byte */
273 typedef unsigned char u8;
274
275 /** Short integer */
276 typedef signed short s16;
277 /** Unsigned short integer */
278 typedef unsigned short u16;
279
280 /** Long integer */
281 typedef signed long s32;
282 /** Unsigned long integer */
283 typedef unsigned long u32;
284
285 /** Valid Input Commands */
286 typedef enum
287 {
288     RDEEPROM,
289     SCANCHANNELS,
290     TXPOWER,
291     PROTOCOL,
292     CHANNEL,
293     RATE,
294     BROADCASTSSID,
295     RTSTHRESH,
296     FRAGTHRESH,
297     DTIMPERIOD,
298     RADIOCONTROL,
299     TXDATARATE,
300     MCBCDATARATE,
301     PKTFWD,
302     STAAGEOUTTIMER,
303     AUTHMODE,
304     GROUPREKEYTIMER,
305     MAXSTANUM,
306     BEACONPERIOD,
307     RETRYLIMIT,
308     RSNREPLAYPROT,
309     COEX_COMM_BITMAP,
310     COEX_PROTECTION,
311     COEX_SCO_ACL_FREQ,
312     COEX_ACL_ENABLED,
313     COEX_ACL_BT_TIME,
314     COEX_ACL_WLAN_TIME,
315 } valid_inputs;
316
317 /** Message verbosity level */
318 enum
319 { MSG_NONE, MSG_DEBUG, MSG_ALL };
320
321 /** oids_table */
322 typedef struct
323 {
324     /** oid type */
325     u16 type;
326     /** oid len */
327     u16 len;
328     /** oid name */
329     char *name;
330 } oids_table;
331
332 /** 4 byte header to store buf len*/
333 #define BUF_HEADER_SIZE 4
334
335 /** AP CMD header */
336 #define APCMDHEADER     /** Buf Size */                             \
337                         u32 BufSize;                                \
338                         /** CmdCode */                              \
339                         u16 CmdCode;                                \
340                         /** Size */                                 \
341                         u16 Size;                                   \
342                         /** SeqNum */                               \
343                         u16 SeqNum;                                 \
344                         /** Result */                               \
345                         s16 Result
346
347 /** TLV header */
348 #define TLVHEADER       /** Tag */                                  \
349                         u16 Tag;                                    \
350                         /** Length */                               \
351                         u16 Length
352
353 /* TLV Definitions */
354
355 /** TLV buffer header*/
356 typedef PACK_START struct _TLVBUF_HEADER
357 {
358     /** Header type */
359     u16 Type;
360     /** Header length */
361     u16 Len;
362     /** Data */
363     u8 Data[0];
364 } PACK_END TLVBUF_HEADER;
365
366 /** Band config ACS mode */
367 #define BAND_CONFIG_ACS_MODE    0x40
368
369 /** TLV buffer : Channel Config */
370 typedef PACK_START struct _TLVBUF_CHANNEL_CONFIG
371 {
372     /** Header */
373     TLVHEADER;
374     /** Band Configuration 
375      *
376      * [7-6] Channel Selection Mode; 00 manual, 01 ACS
377      * [3-2] Channel Width; 00 20 MHz
378      * [1-0] Band Info; 00 2.4 GHz
379      */
380     u8 BandConfigType;
381     /** Channel number */
382     u8 ChanNumber;
383 } PACK_END TLVBUF_CHANNEL_CONFIG;
384
385 /** Channel List Entry */
386 typedef PACK_START struct _CHANNEL_LIST
387 {
388     /** Band Config */
389     u8 BandConfigType;
390     /** Channel Number */
391     u8 ChanNumber;
392     /** Reserved */
393     u8 Reserved1;
394     /** Reserved */
395     u16 Reserved2;
396     /** Reserved */
397     u16 Reserved3;
398 } PACK_END CHANNEL_LIST;
399
400 /** TLV buffer : Channel List */
401 typedef PACK_START struct _TLVBUF_CHANNEL_LIST
402 {
403     /** Header */
404     TLVHEADER;
405     /** Channel List */
406     CHANNEL_LIST ChanList[0];
407 } PACK_END TLVBUF_CHANNEL_LIST;
408
409 /** TLV buffer : AP MAC address */
410 typedef PACK_START struct _TLVBUF_AP_MAC_ADDRESS
411 {
412     /** Header */
413     TLVHEADER;
414     /** AP MAC address */
415     u8 ApMacAddr[ETH_ALEN];
416 } PACK_END TLVBUF_AP_MAC_ADDRESS;
417
418 /** TLV buffer : SSID */
419 typedef PACK_START struct _TLVBUF_SSID
420 {
421     /** Header */
422     TLVHEADER;
423     /** SSID */
424     u8 Ssid[0];
425 } PACK_END TLVBUF_SSID;
426
427 /** TLV buffer : Beacon period */
428 typedef PACK_START struct _TLVBUF_BEACON_PERIOD
429 {
430     /** Header */
431     TLVHEADER;
432     /** Beacon period */
433     u16 BeaconPeriod_ms;
434 } PACK_END TLVBUF_BEACON_PERIOD;
435
436 /** TLV buffer : DTIM period */
437 typedef PACK_START struct _TLVBUF_DTIM_PERIOD
438 {
439     /** Header */
440     TLVHEADER;
441     /** DTIM period */
442     u8 DtimPeriod;
443 } PACK_END TLVBUF_DTIM_PERIOD;
444
445 /** TLV buffer : Channel */
446 typedef PACK_START struct _TLVBUF_PHYPARAMDSSET
447 {
448     /** Header */
449     TLVHEADER;
450     /** Channel */
451     u8 Channel;
452 } PACK_END TLVBUF_PHYPARAMDSSET;
453
454 /** TLV buffer : Operational rates */
455 typedef PACK_START struct _TLVBUF_RATES
456 {
457     /** Header */
458     TLVHEADER;
459     /** Operational rates */
460     u8 OperationalRates[0];
461 } PACK_END TLVBUF_RATES;
462
463 /** TLV buffer : Tx power */
464 typedef PACK_START struct _TLVBUF_TX_POWER
465 {
466     /** Header */
467     TLVHEADER;
468     /** Tx power in dBm */
469     u8 TxPower_dBm;
470 } PACK_END TLVBUF_TX_POWER;
471
472 /** TLV buffer : SSID broadcast control */
473 typedef PACK_START struct _TLVBUF_BCAST_SSID_CTL
474 {
475     /** Header */
476     TLVHEADER;
477     /** SSID broadcast control flag */
478     u8 BcastSsidCtl;
479 } PACK_END TLVBUF_BCAST_SSID_CTL;
480
481 /** TLV buffer : RSN replay protection */
482 typedef PACK_START struct _tlvbuf_rsn_replay_prot
483 {
484     /** Header */
485     TLVHEADER;
486     /** RSN replay protection control flag */
487     u8 rsn_replay_prot;
488 } PACK_END tlvbuf_rsn_replay_prot;
489
490 /** TLV buffer : Preamble control */
491 typedef PACK_START struct _TLVBUF_PREAMBLE_CTL
492 {
493     /** Header */
494     TLVHEADER;
495     /** Preamble type */
496     u8 PreambleType;
497 } PACK_END TLVBUF_PREAMBLE_CTL;
498
499 /** TLV buffer : Antenna control */
500 typedef PACK_START struct _TLVBUF_ANTENNA_CTL
501 {
502     /** Header */
503     TLVHEADER;
504     /** Antenna type */
505     u8 WhichAntenna;
506     /** Antenna mode */
507     u8 AntennaMode;
508 } PACK_END TLVBUF_ANTENNA_CTL;
509
510 /** TLV buffer : RTS threshold */
511 typedef PACK_START struct _TLVBUF_RTS_THRESHOLD
512 {
513     /** Header */
514     TLVHEADER;
515     /** RTS threshold */
516     u16 RtsThreshold;
517 } PACK_END TLVBUF_RTS_THRESHOLD;
518
519 /** TLV buffer : Radio control */
520 typedef PACK_START struct _TLVBUF_RADIO_CTL
521 {
522     /** Header */
523     TLVHEADER;
524     /** Radio control flag */
525     u8 RadioCtl;
526 } PACK_END TLVBUF_RADIO_CTL;
527
528 /** TLV buffer : Tx data rate */
529 typedef PACK_START struct _TLVBUF_TX_DATA_RATE
530 {
531     /** Header */
532     TLVHEADER;
533     /** Tx data rate */
534     u16 TxDataRate;
535 } PACK_END TLVBUF_TX_DATA_RATE;
536
537 /** TLV buffer : MCBC Data Rate */
538 typedef PACK_START struct _TLVBUF_MCBC_DATA_RATE
539 {
540     /** Header */
541     TLVHEADER;
542     /** MCBC data rate */
543     u16 MCBCdatarate;
544 } PACK_END TLVBUF_MCBC_DATA_RATE;
545
546 /** TLV buffer : Packet forward control */
547 typedef PACK_START struct _TLVBUF_PKT_FWD_CTL
548 {
549     /** Header */
550     TLVHEADER;
551     /** Packet forwarding control flag */
552     u8 PktFwdCtl;
553 } PACK_END TLVBUF_PKT_FWD_CTL;
554
555 /** TLV buffer : STA information */
556 typedef PACK_START struct _TLVBUF_STA_INFO
557 {
558     /** Header */
559     TLVHEADER;
560     /** STA MAC address */
561     u8 MacAddress[ETH_ALEN];
562     /** Power mfg status */
563     u8 PowerMfgStatus;
564     /** RSSI */
565     s8 Rssi;
566 } PACK_END TLVBUF_STA_INFO;
567
568 /** TLV buffer : STA MAC address filtering control */
569 typedef PACK_START struct _TLVBUF_STA_MAC_ADDR_FILTER
570 {
571     /** Header */
572     TLVHEADER;
573     /** Filter mode */
574     u8 FilterMode;
575     /** Number of STA MACs */
576     u8 Count;
577     /** STA MAC addresses buffer */
578     u8 MacAddress[0];
579 } PACK_END TLVBUF_STA_MAC_ADDR_FILTER;
580
581 /** TLV buffer : STA ageout timer */
582 typedef PACK_START struct _TLVBUF_STA_AGEOUT_TIMER
583 {
584     /** Header */
585     TLVHEADER;
586     /** STA ageout timer in ms */
587     u32 StaAgeoutTimer_ms;
588 } PACK_END TLVBUF_STA_AGEOUT_TIMER;
589
590 /** TLV buffer : max station number */
591 typedef PACK_START struct _TLVBUF_MAX_STA_NUM
592 {
593     /** Header */
594     TLVHEADER;
595     /** max station number */
596     u16 Max_sta_num;
597 } PACK_END TLVBUF_MAX_STA_NUM;
598
599 /** TLV buffer : retry limit */
600 typedef PACK_START struct _TLVBUF_RETRY_LIMIT
601 {
602     /** Header */
603     TLVHEADER;
604     /** retry limit */
605     u8 retry_limit;
606 } PACK_END TLVBUF_RETRY_LIMIT;
607
608 /* Bitmap for protocol to use */
609 /** No security */
610 #define PROTOCOL_NO_SECURITY            1
611 /** Static WEP */
612 #define PROTOCOL_STATIC_WEP             2
613 /** WPA */
614 #define PROTOCOL_WPA                    8
615 /** WPA2 */
616 #define PROTOCOL_WPA2                   32
617 /** WP2 Mixed */
618 #define PROTOCOL_WPA2_MIXED             40
619
620 /* Bitmap for unicast/bcast cipher type */
621 /** None */
622 #define CIPHER_NONE                 0
623 /** WEP 40 */
624 #define CIPHER_WEP_40                   1
625 /** WEP 104 */
626 #define CIPHER_WEP_104                  2
627 /** TKIP */
628 #define CIPHER_TKIP                     4
629 /** AES CCMP */
630 #define CIPHER_AES_CCMP                 8
631 /** valid cipher bitmap */
632 #define CIPHER_BITMAP                   0x0c
633
634 /** TLV buffer : Authentication Mode */
635 typedef PACK_START struct _TLVBUF_AUTH_MODE
636 {
637     /** Header */
638     TLVHEADER;
639     /** Authentication Mode */
640     u8 AuthMode;
641 } PACK_END TLVBUF_AUTH_MODE;
642
643 /** TLV buffer : Security Protocol */
644 typedef PACK_START struct _TLVBUF_PROTOCOL
645 {
646     /** Header */
647     TLVHEADER;
648     /** Security protocol */
649     u16 Protocol;
650 } PACK_END TLVBUF_PROTOCOL;
651
652 /** TLV buffer : cipher */
653 typedef PACK_START struct _TLVBUF_CIPHER
654 {
655     /** Header */
656     TLVHEADER;
657     /** Pairwise cipher */
658     u8 PairwiseCipher;
659     /** Group cipher */
660     u8 GroupCipher;
661 } PACK_END TLVBUF_CIPHER;
662
663 /** TLV buffer : Group re-key time */
664 typedef PACK_START struct _TLVBUF_GROUP_REKEY_TIMER
665 {
666     /** Header */
667     TLVHEADER;
668     /** Group rekey time in seconds */
669     u32 GroupRekeyTime_sec;
670 } PACK_END TLVBUF_GROUP_REKEY_TIMER;
671
672 /** Key_mgmt_psk */
673 #define KEY_MGMT_NONE   0x04
674 /** Key_mgmt_none */
675 #define KEY_MGMT_PSK    0x02
676
677 /** TLV buffer : KeyMgmt */
678 typedef PACK_START struct _TLVBUF_AKMP
679 {
680     /** Header */
681     TLVHEADER;
682     /** KeyMgmt */
683     u16 KeyMgmt;
684 } PACK_END TLVBUF_AKMP;
685
686 /** TLV buffer : Single WEP key */
687 typedef PACK_START struct _TLVBUF_WEP_KEY
688 {
689     /** Header */
690     TLVHEADER;
691     /** Key index */
692     u8 KeyIndex;
693     /** Default key flag */
694     u8 IsDefault;
695     /** Key */
696     u8 Key[0];
697 } PACK_END TLVBUF_WEP_KEY;
698
699 /** custom IE */
700 typedef PACK_START struct _custom_ie
701 {
702     /** IE Index */
703     u16 ie_index;
704     /** Mgmt Subtype Mask */
705     u16 mgmt_subtype_mask;
706     /** IE Length */
707     u16 ie_length;
708     /** IE buffer */
709     u8 ie_buffer[0];
710 } PACK_END custom_ie;
711
712 /** TLV buffer : custom IE */
713 typedef PACK_START struct _tlvbuf_custom_ie
714 {
715     /** Header */
716     TLVHEADER;
717     /** custom IE data */
718     custom_ie ie_data[0];
719 } PACK_END tlvbuf_custom_ie;
720
721 /** TLV buffer : WPA passphrase */
722 typedef PACK_START struct _TLVBUF_WPA_PASSPHRASE
723 {
724     /** Header */
725     TLVHEADER;
726     /** WPA passphrase */
727     u8 Passphrase[0];
728 } PACK_END TLVBUF_WPA_PASSPHRASE;
729
730 /** TLV buffer : Fragmentation threshold */
731 typedef PACK_START struct _TLVBUF_FRAG_THRESHOLD
732 {
733     /** Header */
734     TLVHEADER;
735     /** Fragmentation threshold */
736     u16 FragThreshold;
737 } PACK_END TLVBUF_FRAG_THRESHOLD;
738
739 /* APCMD definitions */
740 /** APCMD buffer */
741 typedef PACK_START struct _APCMDBUF
742 {
743     /** Header */
744     APCMDHEADER;
745 }
746 PACK_END APCMDBUF;
747
748 /** APCMD header length */
749 #define APCMDHEADERLEN  (sizeof(APCMDBUF))
750
751 /** APCMD buffer : sys_info request */
752 typedef PACK_START struct _APCMDBUF_SYS_INFO_REQUEST
753 {
754     /** Header */
755     APCMDHEADER;
756 } PACK_END APCMDBUF_SYS_INFO_REQUEST;
757
758 /** APCMD buffer : sys_info response */
759 typedef PACK_START struct _APCMDBUF_SYS_INFO_RESPONSE
760 {
761     /** Header */
762     APCMDHEADER;
763     /** System information buffer */
764     u8 SysInfo[64];
765 } PACK_END APCMDBUF_SYS_INFO_RESPONSE;
766
767 /** APCMD buffer : sys_reset */
768 typedef PACK_START struct _APCMDBUF_SYS_RESET
769 {
770     /** Header */
771     APCMDHEADER;
772 } PACK_END APCMDBUF_SYS_RESET;
773
774 /** APCMD buffer : sys_configure */
775 typedef PACK_START struct _APCMDBUF_SYS_CONFIGURE
776 {
777     /** Header */
778     APCMDHEADER;
779     /** Action : GET or SET */
780     u16 Action;
781 } PACK_END APCMDBUF_SYS_CONFIGURE;
782
783 /** APCMD buffer : SNMP MIB */
784 typedef PACK_START struct _APCMDBUF_SNMP_MIB
785 {
786     /** Header */
787     APCMDHEADER;
788     /** Action : GET or SET */
789     u16 Action;
790 } PACK_END APCMDBUF_SNMP_MIB;
791 /** APCMD buffer : bss_start */
792 typedef PACK_START struct _APCMDBUF_BSS_START
793 {
794     /** Header */
795     APCMDHEADER;
796 } PACK_END APCMDBUF_BSS_START;
797
798 /** APCMD buffer : bss_stop */
799 typedef PACK_START struct _APCMDBUF_BSS_STOP
800 {
801     /** Header */
802     APCMDHEADER;
803 } PACK_END APCMDBUF_BSS_STOP;
804
805 /** APCMD buffer : sta_list request */
806 typedef PACK_START struct _APCMDBUF_STA_LIST_REQUEST
807 {
808     /** Header */
809     APCMDHEADER;
810 } PACK_END APCMDBUF_STA_LIST_REQUEST;
811
812 /** APCMD buffer : sta_list response */
813 typedef PACK_START struct _APCMDBUF_STA_LIST_RESPONSE
814 {
815     /** Header */
816     APCMDHEADER;
817     /** Number of STAs */
818     u16 StaCount;
819     /** STA information TLVs */
820     TLVBUF_STA_INFO StaList[0];
821 } PACK_END APCMDBUF_STA_LIST_RESPONSE;
822
823 /** APCMD buffer : sta_deauth */
824 typedef PACK_START struct _APCMDBUF_STA_DEAUTH
825 {
826     /** Header */
827     APCMDHEADER;
828     /** STA MAC address to deauthenticate */
829     u8 StaMacAddress[ETH_ALEN];
830     /** Reason Code */
831     u16 ReasonCode;
832 } PACK_END APCMDBUF_STA_DEAUTH;
833
834 /** TLV : BT Coex common configuration */
835 typedef PACK_START struct _tlvbuf_coex_common_cfg
836 {
837     /** Header */
838     TLVHEADER;
839     /** Configuration bitmap */
840     u32 config_bitmap;
841     /** Reserved */
842     u32 reserved[4];
843 } PACK_END tlvbuf_coex_common_cfg;
844
845 /** TLV : BT Coex SCO configuration */
846 typedef PACK_START struct _tlvbuf_coex_sco_cfg
847 {
848     /** Header */
849     TLVHEADER;
850     /** Qtime protection */
851     u16 protection_qtime[4];
852     /** Rate protection */
853     u16 protection_rate;
854     /** ACL frequency */
855     u16 acl_frequency;
856     /** Reserved */
857     u32 reserved[4];
858 } PACK_END tlvbuf_coex_sco_cfg;
859
860 /** TLV : BT Coex ACL configuration */
861 typedef PACK_START struct _tlvbuf_coex_acl_cfg
862 {
863     /** Header */
864     TLVHEADER;
865     /** Enabled or not */
866     u16 enabled;
867     /** BT time */
868     u16 bt_time;
869     /** Wlan time */
870     u16 wlan_time;
871     /** Rate protection */
872     u16 protection_rate;
873     /** Reserved */
874     u32 reserved[4];
875 } PACK_END tlvbuf_coex_acl_cfg;
876
877 /** TLV : BT Coex statistics */
878 typedef PACK_START struct _tlvbuf_coex_stats
879 {
880     /** Header */
881     TLVHEADER;
882     /** Null not sent */
883     u32 null_not_sent;
884     /** Null queued */
885     u32 null_queued;
886     /** Null not queued */
887     u32 null_not_queued;
888     /** CF end queued */
889     u32 cf_end_queued;
890     /** CF end not queued */
891     u32 cf_end_not_queued;
892     /** Null allocation failures */
893     u32 null_alloc_fail;
894     /** CF end allocation failures */
895     u32 cf_end_alloc_fail;
896     /** Reserved */
897     u32 reserved[8];
898 } PACK_END tlvbuf_coex_stats;
899
900 /** APCMD buffer : BT Coex API extension */
901 typedef PACK_START struct _apcmdbuf_coex_config
902 {
903     /** Header */
904     APCMDHEADER;
905     /** Action : GET or SET */
906     u16 action;
907     /** Reserved for alignment */
908     u16 coex_reserved;
909     /** TLV buffer */
910     u8 tlv_buffer[0];
911 } PACK_END apcmdbuf_coex_config;
912
913 /** Reg TYPE*/
914 enum reg_commands
915 {
916     CMD_MAC = 0,
917     CMD_BBP,
918     CMD_RF
919 };
920
921 /** APCMD buffer: Regrdwr */
922 typedef PACK_START struct _APCMDBUF_REG_RDWR
923 {
924    /** Header */
925     APCMDHEADER;
926    /** Read or Write */
927     u16 Action;
928    /** Register offset */
929     u16 Offset;
930    /** Value */
931     u32 Value;
932 } PACK_END APCMDBUF_REG_RDWR;
933
934 /** sub-band type */
935 typedef PACK_START struct _IEEEtypes_SubbandSet
936 {
937     u8 FirstChan;       /**< First channel */
938     u8 NoOfChan;        /**< Number of channels */
939     u8 MaxTxPwr;        /**< Maximum Tx power */
940 } PACK_END IEEEtypes_SubbandSet_t;
941
942 /** country code length  used for 802.11D */
943 #define COUNTRY_CODE_LEN    3
944
945 /** MAX domain SUB-BAND*/
946 #define MAX_SUB_BANDS 40
947
948 /** Max Multi Domain Entries for G */
949 #define MaxMultiDomainCapabilityEntryG 1
950
951 /** Max Multi Domain Entries for A */
952 #define MaxMultiDomainCapabilityEntryA 31
953
954 /** Country code and Sub-band */
955 typedef PACK_START struct domain_param
956 {
957     TLVHEADER;
958     u8 CountryCode[COUNTRY_CODE_LEN];           /**< Country code */
959     IEEEtypes_SubbandSet_t Subband[0];          /**< Set of subbands */
960 } PACK_END domain_param_t;
961
962 /** HostCmd_CFG_80211D */
963 typedef PACK_START struct _APCMDBUF_CFG_80211D
964 {
965     /** Header */
966     APCMDHEADER;
967     /** Action */
968     u16 Action;                 /* 0 = ACT_GET; 1 = ACT_SET; */
969     /** Domain parameters */
970     domain_param_t Domain;
971 } PACK_END APCMDBUF_CFG_80211D;
972
973 /** HostCmd_MEM_ACCESS */
974 typedef PACK_START struct _APCMDBUF_MEM_ACCESS
975 {
976     /** Header */
977     APCMDHEADER;
978     /** Action */
979     u16 Action;                 /* 0 = ACT_GET; 1 = ACT_SET; */
980     /** Reserved field */
981     u16 Reserved;
982     /** Address */
983     u32 Address;
984     /** Value */
985     u32 Value;
986 } PACK_END APCMDBUF_MEM_ACCESS;
987
988 /** HostCmd_EEPROM_ACCESS */
989 typedef PACK_START struct _APCMDBUF_EEPROM_ACCESS
990 {
991     /** Header */
992     APCMDHEADER;
993     /** Action */
994     u16 Action;                 /* 0 = ACT_GET; */
995     /** Reserved field */
996     u16 Offset;                 /* Multiples of 4 */
997     /** Address */
998     u16 ByteCount;              /* Multiples of 4 */
999     /** Value */
1000     u8 Value[1];
1001 } PACK_END APCMDBUF_EEPROM_ACCESS;
1002
1003 /** Max EEPROM length */
1004 #define MAX_EEPROM_LEN         20
1005
1006 /**subcmd id for glbal flag */
1007 #define DEBUG_SUBCOMMAND_GMODE          1
1008 /**subcmd id for Majorid mask */
1009 #define DEBUG_SUBCOMMAND_MAJOREVTMASK   2
1010 /**subcmd id to trigger a scan */
1011 #define DEBUG_SUBCOMMAND_CHANNEL_SCAN   3
1012
1013 /** Channel scan entry for each channel */
1014 typedef PACK_START struct _CHANNEL_SCAN_ENTRY_T
1015 {
1016     /** Channel Number */
1017     u8 chan_num;
1018     /** Number of APs */
1019     u8 num_of_aps;
1020     /** CCA count */
1021     u32 CCA_count;
1022     /** Duration */
1023     u32 duration;
1024     /** Channel weight */
1025     u32 channel_weight;
1026 } PACK_END CHANNEL_SCAN_ENTRY_T;
1027
1028 /** Channel scan entry */
1029 typedef PACK_START struct _CHANNEL_SCAN_ENTRY
1030 {
1031     /** Number of channels */
1032     u8 numChannels;
1033     /** Channel scan entry */
1034     CHANNEL_SCAN_ENTRY_T cst[0];
1035 } PACK_END CHANNEL_SCAN_ENTRY;
1036
1037 /** debugConfig_t */
1038 typedef PACK_START union
1039 {
1040         /** used in all new debug commands */
1041     u32 value;
1042         /** used in DEBUG_SUBCOMMAND_GMODE */
1043     u8 globalDebugMode;
1044         /** used in DEBUG_SUBCOMMAND_MAJOREVTMASK */
1045     u32 debugMajorIdMask;
1046         /** used in DEBUG_SUBCOMMAND_CHANNEL_SCAN */
1047     CHANNEL_SCAN_ENTRY cs_entry;
1048 } PACK_END debugConfig_t;
1049
1050 /** HostCmd_SYS_DEBUG */
1051 typedef PACK_START struct _APCMDBUF_SYS_DEBUG
1052 {
1053     /** Header */
1054     APCMDHEADER;
1055     /** Action */
1056     u16 Action;                 /* 0 = ACT_GET; 1 = ACT_SET; */
1057     /** Sub command */
1058     u32 subcmd;
1059     /** debug parameter */
1060     debugConfig_t debugConfig;
1061 } PACK_END APCMDBUF_SYS_DEBUG;
1062
1063 /** HostCmd_CFG_DATA */
1064 typedef PACK_START struct _APCMDBUF_CFG_DATA
1065 {
1066     /** Header */
1067     APCMDHEADER;
1068     /** Action */
1069     u16 action;
1070     /** Type */
1071     u16 type;
1072     /** Data length */
1073     u16 data_len;
1074     /** Data */
1075     u8 data[0];
1076 } PACK_END APCMDBUF_CFG_DATA;
1077
1078 /** Maximum size of set/get configurations */
1079 #define MAX_CFG_DATA_SIZE               2000    /* less than
1080                                                    MRVDRV_SIZE_OF_CMD_BUFFER */
1081
1082 /** Host Command ID bit mask (bit 11:0) */
1083 #define HostCmd_CMD_ID_MASK             0x0fff
1084 /** APCMD response check */
1085 #define APCMD_RESP_CHECK            0x8000
1086
1087 /* AP CMD IDs */
1088 /** APCMD : sys_info */
1089 #define APCMD_SYS_INFO              0x00ae
1090 /** APCMD : sys_reset */
1091 #define APCMD_SYS_RESET             0x00af
1092 /** APCMD : sys_configure */
1093 #define APCMD_SYS_CONFIGURE         0x00b0
1094 /** APCMD : bss_start */
1095 #define APCMD_BSS_START             0x00b1
1096 /** APCMD : bss_stop */
1097 #define APCMD_BSS_STOP              0x00b2
1098 /** APCMD : sta_list */
1099 #define APCMD_STA_LIST              0x00b3
1100 /** APCMD : sta_deauth */
1101 #define APCMD_STA_DEAUTH            0x00b5
1102 /** SNMP MIB SET/GET */
1103 #define HostCmd_SNMP_MIB            0x0016
1104 /** Read/Write Mac register */
1105 #define HostCmd_CMD_MAC_REG_ACCESS  0x0019
1106 /** Read/Write BBP register */
1107 #define HostCmd_CMD_BBP_REG_ACCESS  0x001a
1108 /** Read/Write RF register */
1109 #define HostCmd_CMD_RF_REG_ACCESS   0x001b
1110 /** Host Command ID : EEPROM access */
1111 #define HostCmd_EEPROM_ACCESS       0x0059
1112 /** Host Command ID : Memory access */
1113 #define HostCmd_CMD_MEM_ACCESS      0x0086
1114 /** Host Command ID : 802.11D configuration */
1115 #define HostCmd_CMD_802_11D_DOMAIN_INFO      0x005b
1116 /** Host Command ID : Configuration data */
1117 #define HostCmd_CMD_CFG_DATA        0x008f
1118 /** Host Command ID:  SYS_DEBUG */
1119 #define APCMD_SYS_DEBUG             0x00db
1120
1121 /** Host Command ID:  ROBUST_COEX */
1122 #define HostCmd_ROBUST_COEX              0x00e0
1123
1124 /** Oid for 802.11D enable/disable */
1125 #define OID_80211D_ENABLE           0x0009
1126
1127 /* TLV IDs */
1128 /** TLV : Base */
1129 #define PROPRIETARY_TLV_BASE_ID         0x0100
1130
1131 /**TLV: Domain type */
1132 #define TLV_TYPE_DOMAIN                 0x0007
1133
1134 /** TLV : SSID */
1135 #define MRVL_SSID_TLV_ID                0x0000
1136 /** TLV : Operational rates */
1137 #define MRVL_RATES_TLV_ID               0x0001
1138 /** TLV : Channel */
1139 #define MRVL_PHYPARAMDSSET_TLV_ID       0x0003
1140 /** TLV type : Scan Channels list */
1141 #define MRVL_CHANNELLIST_TLV_ID       (PROPRIETARY_TLV_BASE_ID + 1)
1142 /** TLV type : Authentication type */
1143 #define MRVL_AUTH_TLV_ID              (PROPRIETARY_TLV_BASE_ID + 31)
1144 /** TLV Id : Channel Config */
1145 #define MRVL_CHANNELCONFIG_TLV_ID       (PROPRIETARY_TLV_BASE_ID + 42)
1146 /** TLV : AP MAC address */
1147 #define MRVL_AP_MAC_ADDRESS_TLV_ID      (PROPRIETARY_TLV_BASE_ID + 43)
1148 /** TLV : Beacon period */
1149 #define MRVL_BEACON_PERIOD_TLV_ID       (PROPRIETARY_TLV_BASE_ID + 44)
1150 /** TLV : DTIM period */
1151 #define MRVL_DTIM_PERIOD_TLV_ID         (PROPRIETARY_TLV_BASE_ID + 45)
1152 /** TLV : Tx power */
1153 #define MRVL_TX_POWER_TLV_ID            (PROPRIETARY_TLV_BASE_ID + 47)
1154 /** TLV : SSID broadcast control */
1155 #define MRVL_BCAST_SSID_CTL_TLV_ID      (PROPRIETARY_TLV_BASE_ID + 48)
1156 /** TLV : Preamble control */
1157 #define MRVL_PREAMBLE_CTL_TLV_ID        (PROPRIETARY_TLV_BASE_ID + 49)
1158 /** TLV : Antenna control */
1159 #define MRVL_ANTENNA_CTL_TLV_ID         (PROPRIETARY_TLV_BASE_ID + 50)
1160 /** TLV : RTS threshold */
1161 #define MRVL_RTS_THRESHOLD_TLV_ID       (PROPRIETARY_TLV_BASE_ID + 51)
1162 /** TLV : Radio control */
1163 #define MRVL_RADIO_CTL_TLV_ID           (PROPRIETARY_TLV_BASE_ID + 52)
1164 /** TLV : Tx data rate */
1165 #define MRVL_TX_DATA_RATE_TLV_ID        (PROPRIETARY_TLV_BASE_ID + 53)
1166 /** TLV : Packet forwarding control */
1167 #define MRVL_PKT_FWD_CTL_TLV_ID         (PROPRIETARY_TLV_BASE_ID + 54)
1168 /** TLV : STA information */
1169 #define MRVL_STA_INFO_TLV_ID            (PROPRIETARY_TLV_BASE_ID + 55)
1170 /** TLV : STA MAC address filter */
1171 #define MRVL_STA_MAC_ADDR_FILTER_TLV_ID (PROPRIETARY_TLV_BASE_ID + 56)
1172 /** TLV : STA ageout timer */
1173 #define MRVL_STA_AGEOUT_TIMER_TLV_ID    (PROPRIETARY_TLV_BASE_ID + 57)
1174 /** TLV : WEP keys */
1175 #define MRVL_WEP_KEY_TLV_ID             (PROPRIETARY_TLV_BASE_ID + 59)
1176 /** TLV : WPA passphrase */
1177 #define MRVL_WPA_PASSPHRASE_TLV_ID      (PROPRIETARY_TLV_BASE_ID + 60)
1178 /** TLV type : protocol TLV */
1179 #define MRVL_PROTOCOL_TLV_ID            (PROPRIETARY_TLV_BASE_ID + 64)
1180 /** TLV type : AKMP TLV */
1181 #define MRVL_AKMP_TLV_ID                (PROPRIETARY_TLV_BASE_ID + 65)
1182 /** TLV type : Cipher TLV */
1183 #define MRVL_CIPHER_TLV_ID              (PROPRIETARY_TLV_BASE_ID + 66)
1184 /** TLV : Fragment threshold */
1185 #define MRVL_FRAG_THRESHOLD_TLV_ID      (PROPRIETARY_TLV_BASE_ID + 70)
1186 /** TLV : Group rekey timer */
1187 #define MRVL_GRP_REKEY_TIME_TLV_ID      (PROPRIETARY_TLV_BASE_ID + 71)
1188 /**TLV: Max Station number */
1189 #define MRVL_MAX_STA_CNT_TLV_ID         (PROPRIETARY_TLV_BASE_ID + 85)
1190 /**TLV: Retry limit */
1191 #define MRVL_RETRY_LIMIT_TLV_ID         (PROPRIETARY_TLV_BASE_ID + 93)
1192 /**TLV: MCBC data rate */
1193 #define MRVL_MCBC_DATA_RATE_TLV_ID        (PROPRIETARY_TLV_BASE_ID + 98)
1194 /**TLV: RSN replay protection */
1195 #define MRVL_RSN_REPLAY_PROT_TLV_ID       (PROPRIETARY_TLV_BASE_ID + 100)
1196 /** TLV: Management IE list */
1197 #define MRVL_MGMT_IE_LIST_TLV_ID          (PROPRIETARY_TLV_BASE_ID + 105)
1198 /** TLV : Coex common configuration */
1199 #define MRVL_BT_COEX_COMMON_CFG_TLV_ID    (PROPRIETARY_TLV_BASE_ID + 108)
1200 /** TLV : Coex SCO configuration */
1201 #define MRVL_BT_COEX_SCO_CFG_TLV_ID       (PROPRIETARY_TLV_BASE_ID + 109)
1202 /** TLV : Coex ACL configuration */
1203 #define MRVL_BT_COEX_ACL_CFG_TLV_ID       (PROPRIETARY_TLV_BASE_ID + 110)
1204 /** TLV : Coex stats configuration */
1205 #define MRVL_BT_COEX_STATS_TLV_ID         (PROPRIETARY_TLV_BASE_ID + 111)
1206
1207 /** sleep_param */
1208 typedef struct _ps_sleep_param
1209 {
1210     /** control bitmap */
1211     u32 ctrl_bitmap;
1212     /** minimum sleep period (micro second) */
1213     u32 min_sleep;
1214     /** maximum sleep period (micro second) */
1215     u32 max_sleep;
1216 } ps_sleep_param;
1217
1218 /** inactivity sleep_param */
1219 typedef struct _inact_sleep_param
1220 {
1221     /** inactivity timeout (micro second) */
1222     u32 inactivity_to;
1223     /** miniumu awake period (micro second) */
1224     u32 min_awake;
1225     /** maximum awake period (micro second) */
1226     u32 max_awake;
1227 } inact_sleep_param;
1228
1229 /** flag for ps mode */
1230 #define PS_FLAG_PS_MODE                 1
1231 /** flag for sleep param */
1232 #define PS_FLAG_SLEEP_PARAM             2
1233 /** flag for inactivity sleep param */
1234 #define PS_FLAG_INACT_SLEEP_PARAM       4
1235
1236 /** Disable power mode */
1237 #define PS_MODE_DISABLE                      0
1238 /** Enable periodic dtim ps */
1239 #define PS_MODE_PERIODIC_DTIM                1
1240 /** Enable inactivity ps */
1241 #define PS_MODE_INACTIVITY                   2
1242
1243 /** sleep parameter */
1244 #define SLEEP_PARAMETER                     1
1245 /** inactivity sleep parameter */
1246 #define INACTIVITY_SLEEP_PARAMETER          2
1247
1248 /** sleep parameter : lower limit in micro-sec */
1249 #define PS_SLEEP_PARAM_MIN                  5000
1250 /** sleep parameter : upper limit in micro-sec */
1251 #define PS_SLEEP_PARAM_MAX                  32000
1252 /** power save awake period minimum value in micro-sec */
1253 #define PS_AWAKE_PERIOD_MIN                 10
1254
1255 /** ps_mgmt */
1256 typedef struct _ps_mgmt
1257 {
1258     /** flags for valid field */
1259     u16 flags;
1260     /** power mode */
1261     u16 ps_mode;
1262     /** sleep param */
1263     ps_sleep_param sleep_param;
1264     /** inactivity sleep param */
1265     inact_sleep_param inact_param;
1266 } ps_mgmt;
1267
1268 /** Function Prototype Declaration */
1269 int mac2raw(char *mac, u8 * raw);
1270 void print_mac(u8 * raw);
1271 int uap_ioctl(u8 * cmd, u16 * size, u16 buf_size);
1272 void print_auth(TLVBUF_AUTH_MODE * tlv);
1273 void print_tlv(u8 * buf, u16 len);
1274 void print_cipher(TLVBUF_CIPHER * tlv);
1275 void print_rate(TLVBUF_RATES * tlv);
1276 int string2raw(char *str, unsigned char *raw);
1277 void print_mac_filter(TLVBUF_STA_MAC_ADDR_FILTER * tlv);
1278 int ishexstring(void *hex);
1279 inline int ISDIGIT(char *x);
1280 unsigned int a2hex(char *s);
1281 int fparse_for_hex(FILE * fp, u8 * dst);
1282 int is_input_valid(valid_inputs cmd, int argc, char *argv[]);
1283 int is_cipher_valid(int pairwisecipher, int groupcipher);
1284 int get_sys_cfg_rates(u8 * rates);
1285 int is_tx_rate_valid(u8 rate);
1286 int is_mcbc_rate_valid(u8 rate);
1287 void hexdump_data(char *prompt, void *p, int len, char delim);
1288 unsigned char hexc2bin(char chr);
1289 #endif /* _UAP_H */