1 /* SPDX-License-Identifier: GPL-2.0 */
2 /******************************************************************************
4 * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.
6 ******************************************************************************/
10 #define WLAN_IEEE_OUI_LEN 3
11 #define WLAN_CRC_LEN 4
12 #define WLAN_BSSID_LEN 6
13 #define WLAN_BSS_TS_LEN 8
14 #define WLAN_HDR_A3_LEN 24
15 #define WLAN_HDR_A4_LEN 30
16 #define WLAN_HDR_A3_QOS_LEN 26
17 #define WLAN_HDR_A4_QOS_LEN 32
18 #define WLAN_DATA_MAXLEN 2312
20 #define WLAN_A3_PN_OFFSET 24
21 #define WLAN_A4_PN_OFFSET 30
23 #define WLAN_MIN_ETHFRM_LEN 60
24 #define WLAN_MAX_ETHFRM_LEN 1514
26 #define P80211CAPTURE_VERSION 0x80211001
28 /* This value is tested by WiFi 11n Test Plan 5.2.3. */
29 /* This test verifies the WLAN NIC can update the NAV through sending
30 * the CTS with large duration.
32 #define WiFiNavUpperUs 30000 /* 30 ms */
34 enum WIFI_FRAME_TYPE {
36 WIFI_CTRL_TYPE = (BIT(2)),
37 WIFI_DATA_TYPE = (BIT(3)),
38 WIFI_QOS_DATA_TYPE = (BIT(7) | BIT(3)), /* QoS Data */
41 enum WIFI_FRAME_SUBTYPE {
42 /* below is for mgt frame */
43 WIFI_ASSOCREQ = (0 | WIFI_MGT_TYPE),
44 WIFI_ASSOCRSP = (BIT(4) | WIFI_MGT_TYPE),
45 WIFI_REASSOCREQ = (BIT(5) | WIFI_MGT_TYPE),
46 WIFI_REASSOCRSP = (BIT(5) | BIT(4) | WIFI_MGT_TYPE),
47 WIFI_PROBEREQ = (BIT(6) | WIFI_MGT_TYPE),
48 WIFI_PROBERSP = (BIT(6) | BIT(4) | WIFI_MGT_TYPE),
49 WIFI_BEACON = (BIT(7) | WIFI_MGT_TYPE),
50 WIFI_ATIM = (BIT(7) | BIT(4) | WIFI_MGT_TYPE),
51 WIFI_DISASSOC = (BIT(7) | BIT(5) | WIFI_MGT_TYPE),
52 WIFI_AUTH = (BIT(7) | BIT(5) | BIT(4) | WIFI_MGT_TYPE),
53 WIFI_DEAUTH = (BIT(7) | BIT(6) | WIFI_MGT_TYPE),
54 WIFI_ACTION = (BIT(7) | BIT(6) | BIT(4) | WIFI_MGT_TYPE),
56 /* below is for control frame */
57 WIFI_PSPOLL = (BIT(7) | BIT(5) | WIFI_CTRL_TYPE),
58 WIFI_RTS = (BIT(7) | BIT(5) | BIT(4) | WIFI_CTRL_TYPE),
59 WIFI_CTS = (BIT(7) | BIT(6) | WIFI_CTRL_TYPE),
60 WIFI_ACK = (BIT(7) | BIT(6) | BIT(4) | WIFI_CTRL_TYPE),
61 WIFI_CFEND = (BIT(7) | BIT(6) | BIT(5) | WIFI_CTRL_TYPE),
62 WIFI_CFEND_CFACK = (BIT(7) | BIT(6) | BIT(5) | BIT(4) |
65 /* below is for data frame */
66 WIFI_DATA = (0 | WIFI_DATA_TYPE),
67 WIFI_DATA_CFACK = (BIT(4) | WIFI_DATA_TYPE),
68 WIFI_DATA_CFPOLL = (BIT(5) | WIFI_DATA_TYPE),
69 WIFI_DATA_CFACKPOLL = (BIT(5) | BIT(4) | WIFI_DATA_TYPE),
70 WIFI_DATA_NULL = (BIT(6) | WIFI_DATA_TYPE),
71 WIFI_CF_ACK = (BIT(6) | BIT(4) | WIFI_DATA_TYPE),
72 WIFI_CF_POLL = (BIT(6) | BIT(5) | WIFI_DATA_TYPE),
73 WIFI_CF_ACKPOLL = (BIT(6) | BIT(5) | BIT(4) | WIFI_DATA_TYPE),
74 WIFI_QOS_DATA_NULL = (BIT(6) | WIFI_QOS_DATA_TYPE),
77 enum WIFI_STATUS_CODE {
78 _STATS_SUCCESSFUL_ = 0,
80 _STATS_CAP_FAIL_ = 10,
83 _STATS_NO_SUPP_ALG_ = 13,
84 _STATS_OUT_OF_AUTH_SEQ_ = 14,
85 _STATS_CHALLENGE_FAIL_ = 15,
86 _STATS_AUTH_TIMEOUT_ = 16,
87 _STATS_UNABLE_HANDLE_STA_ = 17,
88 _STATS_RATE_FAIL_ = 18,
91 enum WIFI_REG_DOMAIN {
105 #define _TO_DS_ BIT(8)
106 #define _FROM_DS_ BIT(9)
107 #define _MORE_FRAG_ BIT(10)
108 #define _RETRY_ BIT(11)
109 #define _PWRMGT_ BIT(12)
110 #define _MORE_DATA_ BIT(13)
111 #define _PRIVACY_ BIT(14)
112 #define _ORDER_ BIT(15)
114 #define SetToDs(pbuf) \
115 *(__le16 *)(pbuf) |= cpu_to_le16(_TO_DS_)
117 #define GetToDs(pbuf) (((*(__le16 *)(pbuf)) & cpu_to_le16(_TO_DS_)) != 0)
119 #define ClearToDs(pbuf) \
120 *(__le16 *)(pbuf) &= (~cpu_to_le16(_TO_DS_))
122 #define SetFrDs(pbuf) \
123 *(__le16 *)(pbuf) |= cpu_to_le16(_FROM_DS_)
125 #define GetFrDs(pbuf) (((*(__le16 *)(pbuf)) & cpu_to_le16(_FROM_DS_)) != 0)
127 #define ClearFrDs(pbuf) \
128 *(__le16 *)(pbuf) &= (~cpu_to_le16(_FROM_DS_))
130 #define get_tofr_ds(pframe) ((GetToDs(pframe) << 1) | GetFrDs(pframe))
132 #define SetMFrag(pbuf) \
133 *(__le16 *)(pbuf) |= cpu_to_le16(_MORE_FRAG_)
135 #define GetMFrag(pbuf) (((*(__le16 *)(pbuf)) & cpu_to_le16(_MORE_FRAG_)) != 0)
137 #define ClearMFrag(pbuf) \
138 *(__le16 *)(pbuf) &= (~cpu_to_le16(_MORE_FRAG_))
140 #define SetRetry(pbuf) \
141 *(__le16 *)(pbuf) |= cpu_to_le16(_RETRY_)
143 #define GetRetry(pbuf) (((*(__le16 *)(pbuf)) & cpu_to_le16(_RETRY_)) != 0)
145 #define ClearRetry(pbuf) \
146 *(__le16 *)(pbuf) &= (~cpu_to_le16(_RETRY_))
148 #define SetPwrMgt(pbuf) \
149 *(__le16 *)(pbuf) |= cpu_to_le16(_PWRMGT_)
151 #define GetPwrMgt(pbuf) (((*(__le16 *)(pbuf)) & cpu_to_le16(_PWRMGT_)) != 0)
153 #define ClearPwrMgt(pbuf) \
154 *(__le16 *)(pbuf) &= (~cpu_to_le16(_PWRMGT_))
156 #define SetMData(pbuf) \
157 *(__le16 *)(pbuf) |= cpu_to_le16(_MORE_DATA_)
159 #define GetMData(pbuf) (((*(__le16 *)(pbuf)) & cpu_to_le16(_MORE_DATA_)) != 0)
161 #define ClearMData(pbuf) \
162 *(__le16 *)(pbuf) &= (~cpu_to_le16(_MORE_DATA_))
164 #define SetPrivacy(pbuf) \
165 *(__le16 *)(pbuf) |= cpu_to_le16(_PRIVACY_)
167 #define GetPrivacy(pbuf) \
168 (((*(__le16 *)(pbuf)) & cpu_to_le16(_PRIVACY_)) != 0)
170 #define GetOrder(pbuf) \
171 (((*(__le16 *)(pbuf)) & cpu_to_le16(_ORDER_)) != 0)
173 #define GetFrameType(pbuf) \
174 (le16_to_cpu(*(__le16 *)(pbuf)) & (BIT(3) | BIT(2)))
176 #define GetFrameSubType(pbuf) (le16_to_cpu(*(__le16 *)(pbuf)) & (BIT(7) |\
177 BIT(6) | BIT(5) | BIT(4) | BIT(3) | BIT(2)))
179 #define SetFrameSubType(pbuf, type) \
181 *(__le16 *)(pbuf) &= cpu_to_le16(~(BIT(7) | BIT(6) | \
182 BIT(5) | BIT(4) | BIT(3) | BIT(2))); \
183 *(__le16 *)(pbuf) |= cpu_to_le16(type); \
186 #define GetSequence(pbuf) \
187 (le16_to_cpu(*(__le16 *)((size_t)(pbuf) + 22)) >> 4)
189 #define GetFragNum(pbuf) \
190 (le16_to_cpu(*(__le16 *)((size_t)(pbuf) + 22)) & 0x0f)
192 #define SetSeqNum(pbuf, num) \
194 *(__le16 *)((size_t)(pbuf) + 22) = \
195 ((*(__le16 *)((size_t)(pbuf) + 22)) & cpu_to_le16((unsigned short)0x000f)) | \
196 cpu_to_le16((unsigned short)(0xfff0 & (num << 4))); \
199 #define SetDuration(pbuf, dur) \
200 *(__le16 *)((size_t)(pbuf) + 2) = cpu_to_le16(0xffff & (dur))
202 #define SetPriority(pbuf, tid) \
203 *(__le16 *)(pbuf) |= cpu_to_le16(tid & 0xf)
205 #define GetPriority(pbuf) ((le16_to_cpu(*(__le16 *)(pbuf))) & 0xf)
207 #define SetEOSP(pbuf, eosp) \
208 *(__le16 *)(pbuf) |= cpu_to_le16((eosp & 1) << 4)
210 #define SetAckpolicy(pbuf, ack) \
211 *(__le16 *)(pbuf) |= cpu_to_le16((ack & 3) << 5)
213 #define GetAckpolicy(pbuf) (((le16_to_cpu(*(__le16 *)pbuf)) >> 5) & 0x3)
215 #define GetAMsdu(pbuf) (((le16_to_cpu(*(__le16 *)pbuf)) >> 7) & 0x1)
217 #define GetAid(pbuf) (le16_to_cpu(*(__le16 *)((size_t)(pbuf) + 2)) & 0x3fff)
219 #define GetAddr1Ptr(pbuf) ((unsigned char *)((size_t)(pbuf) + 4))
221 #define GetAddr2Ptr(pbuf) ((unsigned char *)((size_t)(pbuf) + 10))
223 #define GetAddr3Ptr(pbuf) ((unsigned char *)((size_t)(pbuf) + 16))
225 #define GetAddr4Ptr(pbuf) ((unsigned char *)((size_t)(pbuf) + 24))
227 static inline unsigned char *get_da(unsigned char *pframe)
230 unsigned int to_fr_ds = (GetToDs(pframe) << 1) | GetFrDs(pframe);
233 case 0x00: /* ToDs=0, FromDs=0 */
234 da = GetAddr1Ptr(pframe);
236 case 0x01: /* ToDs=0, FromDs=1 */
237 da = GetAddr1Ptr(pframe);
239 case 0x02: /* ToDs=1, FromDs=0 */
240 da = GetAddr3Ptr(pframe);
242 default: /* ToDs=1, FromDs=1 */
243 da = GetAddr3Ptr(pframe);
249 static inline unsigned char *get_sa(unsigned char *pframe)
252 unsigned int to_fr_ds = (GetToDs(pframe) << 1) | GetFrDs(pframe);
255 case 0x00: /* ToDs=0, FromDs=0 */
256 sa = GetAddr2Ptr(pframe);
258 case 0x01: /* ToDs=0, FromDs=1 */
259 sa = GetAddr3Ptr(pframe);
261 case 0x02: /* ToDs=1, FromDs=0 */
262 sa = GetAddr2Ptr(pframe);
264 default: /* ToDs=1, FromDs=1 */
265 sa = GetAddr4Ptr(pframe);
271 static inline unsigned char *get_hdr_bssid(unsigned char *pframe)
274 unsigned int to_fr_ds = (GetToDs(pframe) << 1) | GetFrDs(pframe);
277 case 0x00: /* ToDs=0, FromDs=0 */
278 sa = GetAddr3Ptr(pframe);
280 case 0x01: /* ToDs=0, FromDs=1 */
281 sa = GetAddr2Ptr(pframe);
283 case 0x02: /* ToDs=1, FromDs=0 */
284 sa = GetAddr1Ptr(pframe);
286 case 0x03: /* ToDs=1, FromDs=1 */
287 sa = GetAddr1Ptr(pframe);
296 static inline int IsFrameTypeCtrl(unsigned char *pframe)
298 if (GetFrameType(pframe) == WIFI_CTRL_TYPE)
304 /*-----------------------------------------------------------------------------
305 Below is for the security related definition
306 ------------------------------------------------------------------------------*/
307 #define _RESERVED_FRAME_TYPE_ 0
308 #define _SKB_FRAME_TYPE_ 2
309 #define _PRE_ALLOCMEM_ 1
310 #define _PRE_ALLOCHDR_ 3
311 #define _PRE_ALLOCLLCHDR_ 4
312 #define _PRE_ALLOCICVHDR_ 5
313 #define _PRE_ALLOCMICHDR_ 6
316 ((priv->pmib->dot11BssType.net_work_type & WIRELESS_11A) ? 16 : 10)
317 #define _ACKCTSLNG_ 14 /* 14 bytes long, including crclng */
320 #define _ASOCREQ_IE_OFFSET_ 4 /* excluding wlan_hdr */
321 #define _ASOCRSP_IE_OFFSET_ 6
322 #define _REASOCREQ_IE_OFFSET_ 10
323 #define _REASOCRSP_IE_OFFSET_ 6
324 #define _PROBEREQ_IE_OFFSET_ 0
325 #define _PROBERSP_IE_OFFSET_ 12
326 #define _AUTH_IE_OFFSET_ 6
327 #define _DEAUTH_IE_OFFSET_ 0
328 #define _BEACON_IE_OFFSET_ 12
329 #define _PUBLIC_ACTION_IE_OFFSET_ 8
331 #define _FIXED_IE_LENGTH_ _BEACON_IE_OFFSET_
334 #define _SUPPORTEDRATES_IE_ 1
337 #define _IBSS_PARA_IE_ 6
338 #define _COUNTRY_IE_ 7
339 #define _CHLGETXT_IE_ 16
340 #define _SUPPORTED_CH_IE_ 36
341 #define _CH_SWTICH_ANNOUNCE_ 37 /* Secondary Channel Offset */
342 #define _RSN_IE_2_ 48
343 #define _SSN_IE_1_ 221
344 #define _ERPINFO_IE_ 42
345 #define _EXT_SUPPORTEDRATES_IE_ 50
347 #define _HT_CAPABILITY_IE_ 45
349 #define _TIMEOUT_ITVL_IE_ 56
351 #define _HT_EXTRA_INFO_IE_ 61
352 #define _HT_ADD_INFO_IE_ 61 /* _HT_EXTRA_INFO_IE_ */
355 #define EID_BSSCoexistence 72 /* 20/40 BSS Coexistence */
356 #define EID_BSSIntolerantChlReport 73
357 #define _RIC_Descriptor_IE_ 75
359 #define _LINK_ID_IE_ 101
360 #define _CH_SWITCH_TIMING_ 104
361 #define _PTI_BUFFER_STATUS_ 106
362 #define _EXT_CAP_IE_ 127
363 #define _VENDOR_SPECIFIC_IE_ 221
365 #define _RESERVED47_ 47
367 /* ---------------------------------------------------------------------------
368 Below is the fixed elements...
369 -----------------------------------------------------------------------------*/
370 #define _AUTH_ALGM_NUM_ 2
371 #define _AUTH_SEQ_NUM_ 2
372 #define _BEACON_ITERVAL_ 2
373 #define _CAPABILITY_ 2
374 #define _CURRENT_APADDR_ 6
375 #define _LISTEN_INTERVAL_ 2
376 #define _RSON_CODE_ 2
378 #define _STATUS_CODE_ 2
379 #define _TIMESTAMP_ 8
381 #define AUTH_ODD_TO 0
382 #define AUTH_EVEN_TO 1
384 #define WLAN_ETHCONV_ENCAP 1
385 #define WLAN_ETHCONV_RFC1042 2
386 #define WLAN_ETHCONV_8021h 3
388 #define cap_ESS BIT(0)
389 #define cap_IBSS BIT(1)
390 #define cap_CFPollable BIT(2)
391 #define cap_CFRequest BIT(3)
392 #define cap_Privacy BIT(4)
393 #define cap_ShortPremble BIT(5)
394 #define cap_PBCC BIT(6)
395 #define cap_ChAgility BIT(7)
396 #define cap_SpecMgmt BIT(8)
397 #define cap_QoSi BIT(9)
398 #define cap_ShortSlot BIT(10)
400 /*-----------------------------------------------------------------------------
401 Below is the definition for 802.11i / 802.1x
402 ------------------------------------------------------------------------------*/
403 #define _IEEE8021X_MGT_ 1 /* WPA */
404 #define _IEEE8021X_PSK_ 2 /* WPA with pre-shared key */
407 * #define _NO_PRIVACY_ 0
408 * #define _WEP_40_PRIVACY_ 1
409 * #define _TKIP_PRIVACY_ 2
410 * #define _WRAP_PRIVACY_ 3
411 * #define _CCMP_PRIVACY_ 4
412 * #define _WEP_104_PRIVACY_ 5
413 * #define _WEP_WPA_MIXED_PRIVACY_ 6 WEP + WPA
416 /*-----------------------------------------------------------------------------
417 Below is the definition for WMM
418 ------------------------------------------------------------------------------*/
419 #define _WMM_IE_Length_ 7 /* for WMM STA */
420 #define _WMM_Para_Element_Length_ 24
422 /*-----------------------------------------------------------------------------
423 Below is the definition for 802.11n
424 ------------------------------------------------------------------------------*/
427 * struct rtw_ieee80211_ht_cap - HT additional information
429 * This structure refers to "HT information element" as
430 * described in 802.11n draft section 7.3.2.53
432 struct ieee80211_ht_addt_info {
433 unsigned char control_chan;
434 unsigned char ht_param;
435 unsigned short operation_mode;
436 unsigned short stbc_param;
437 unsigned char basic_set[16];
440 struct HT_info_element {
441 unsigned char primary_channel;
442 unsigned char infos[5];
443 unsigned char MCS_rate[16];
447 unsigned char ACI_AIFSN;
452 struct WMM_para_element {
453 unsigned char QoS_info;
454 unsigned char reserved;
455 struct AC_param ac_param[4];
458 struct ADDBA_request {
459 unsigned char dialog_token;
461 unsigned short BA_timeout_value;
462 unsigned short BA_starting_seqctrl;
465 enum ht_cap_ampdu_factor {
466 MAX_AMPDU_FACTOR_8K = 0,
467 MAX_AMPDU_FACTOR_16K = 1,
468 MAX_AMPDU_FACTOR_32K = 2,
469 MAX_AMPDU_FACTOR_64K = 3,
472 #define OP_MODE_PURE 0
473 #define OP_MODE_MAY_BE_LEGACY_STAS 1
474 #define OP_MODE_20MHZ_HT_STA_ASSOCED 2
475 #define OP_MODE_MIXED 3
477 #define HT_INFO_HT_PARAM_SECONDARY_CHNL_OFF_MASK ((u8)BIT(0) | BIT(1))
478 #define HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE ((u8)BIT(0))
479 #define HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW ((u8)BIT(0) | BIT(1))
480 #define HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH ((u8)BIT(2))
481 #define HT_INFO_HT_PARAM_RIFS_MODE ((u8)BIT(3))
482 #define HT_INFO_HT_PARAM_CTRL_ACCESS_ONLY ((u8)BIT(4))
483 #define HT_INFO_HT_PARAM_SRV_INTERVAL_GRANULARITY ((u8)BIT(5))
485 #define HT_INFO_OPERATION_MODE_OP_MODE_MASK \
486 ((u16)(0x0001 | 0x0002))
487 #define HT_INFO_OPERATION_MODE_OP_MODE_OFFSET 0
488 #define HT_INFO_OPERATION_MODE_NON_GF_DEVS_PRESENT ((u8)BIT(2))
489 #define HT_INFO_OPERATION_MODE_TRANSMIT_BURST_LIMIT ((u8)BIT(3))
490 #define HT_INFO_OPERATION_MODE_NON_HT_STA_PRESENT ((u8)BIT(4))
492 #define HT_INFO_STBC_PARAM_DUAL_BEACON ((u16)BIT(6))
493 #define HT_INFO_STBC_PARAM_DUAL_STBC_PROTECT ((u16)BIT(7))
494 #define HT_INFO_STBC_PARAM_SECONDARY_BC ((u16)BIT(8))
495 #define HT_INFO_STBC_PARAM_LSIG_TXOP_PROTECT_ALLOWED ((u16)BIT(9))
496 #define HT_INFO_STBC_PARAM_PCO_ACTIVE ((u16)BIT(10))
497 #define HT_INFO_STBC_PARAM_PCO_PHASE ((u16)BIT(11))
499 /* ===============WPS Section=============== */
501 #define WPSOUI 0x0050f204
502 /* WPS attribute ID */
503 #define WPS_ATTR_VER1 0x104A
504 #define WPS_ATTR_SIMPLE_CONF_STATE 0x1044
505 #define WPS_ATTR_RESP_TYPE 0x103B
506 #define WPS_ATTR_UUID_E 0x1047
507 #define WPS_ATTR_MANUFACTURER 0x1021
508 #define WPS_ATTR_MODEL_NAME 0x1023
509 #define WPS_ATTR_MODEL_NUMBER 0x1024
510 #define WPS_ATTR_SERIAL_NUMBER 0x1042
511 #define WPS_ATTR_PRIMARY_DEV_TYPE 0x1054
512 #define WPS_ATTR_SEC_DEV_TYPE_LIST 0x1055
513 #define WPS_ATTR_DEVICE_NAME 0x1011
514 #define WPS_ATTR_CONF_METHOD 0x1008
515 #define WPS_ATTR_RF_BANDS 0x103C
516 #define WPS_ATTR_DEVICE_PWID 0x1012
517 #define WPS_ATTR_REQUEST_TYPE 0x103A
518 #define WPS_ATTR_ASSOCIATION_STATE 0x1002
519 #define WPS_ATTR_CONFIG_ERROR 0x1009
520 #define WPS_ATTR_VENDOR_EXT 0x1049
521 #define WPS_ATTR_SELECTED_REGISTRAR 0x1041
523 /* Value of WPS Request Type Attribute */
524 #define WPS_REQ_TYPE_ENROLLEE_INFO_ONLY 0x00
525 #define WPS_REQ_TYPE_ENROLLEE_OPEN_8021X 0x01
526 #define WPS_REQ_TYPE_REGISTRAR 0x02
527 #define WPS_REQ_TYPE_WLAN_MANAGER_REGISTRAR 0x03
529 /* Value of WPS Response Type Attribute */
530 #define WPS_RESPONSE_TYPE_INFO_ONLY 0x00
531 #define WPS_RESPONSE_TYPE_8021X 0x01
532 #define WPS_RESPONSE_TYPE_REGISTRAR 0x02
533 #define WPS_RESPONSE_TYPE_AP 0x03
535 /* Value of WPS WiFi Simple Configuration State Attribute */
536 #define WPS_WSC_STATE_NOT_CONFIG 0x01
537 #define WPS_WSC_STATE_CONFIG 0x02
539 /* Value of WPS Version Attribute */
540 #define WPS_VERSION_1 0x10
542 /* Value of WPS Configuration Method Attribute */
543 #define WPS_CONFIG_METHOD_FLASH 0x0001
544 #define WPS_CONFIG_METHOD_ETHERNET 0x0002
545 #define WPS_CONFIG_METHOD_LABEL 0x0004
546 #define WPS_CONFIG_METHOD_DISPLAY 0x0008
547 #define WPS_CONFIG_METHOD_E_NFC 0x0010
548 #define WPS_CONFIG_METHOD_I_NFC 0x0020
549 #define WPS_CONFIG_METHOD_NFC 0x0040
550 #define WPS_CONFIG_METHOD_PBC 0x0080
551 #define WPS_CONFIG_METHOD_KEYPAD 0x0100
552 #define WPS_CONFIG_METHOD_VPBC 0x0280
553 #define WPS_CONFIG_METHOD_PPBC 0x0480
554 #define WPS_CONFIG_METHOD_VDISPLAY 0x2008
555 #define WPS_CONFIG_METHOD_PDISPLAY 0x4008
557 /* Value of Category ID of WPS Primary Device Type Attribute */
558 #define WPS_PDT_CID_DISPLAYS 0x0007
559 #define WPS_PDT_CID_MULIT_MEDIA 0x0008
560 #define WPS_PDT_CID_RTK_WIDI WPS_PDT_CID_MULIT_MEDIA
562 /* Value of Sub Category ID of WPS Primary Device Type Attribute */
563 #define WPS_PDT_SCID_MEDIA_SERVER 0x0005
564 #define WPS_PDT_SCID_RTK_DMP WPS_PDT_SCID_MEDIA_SERVER
566 /* Value of Device Password ID */
567 #define WPS_DPID_P 0x0000
568 #define WPS_DPID_USER_SPEC 0x0001
569 #define WPS_DPID_MACHINE_SPEC 0x0002
570 #define WPS_DPID_REKEY 0x0003
571 #define WPS_DPID_PBC 0x0004
572 #define WPS_DPID_REGISTRAR_SPEC 0x0005
574 /* Value of WPS RF Bands Attribute */
575 #define WPS_RF_BANDS_2_4_GHZ 0x01
576 #define WPS_RF_BANDS_5_GHZ 0x02
578 /* Value of WPS Association State Attribute */
579 #define WPS_ASSOC_STATE_NOT_ASSOCIATED 0x00
580 #define WPS_ASSOC_STATE_CONNECTION_SUCCESS 0x01
581 #define WPS_ASSOC_STATE_CONFIGURATION_FAILURE 0x02
582 #define WPS_ASSOC_STATE_ASSOCIATION_FAILURE 0x03
583 #define WPS_ASSOC_STATE_IP_FAILURE 0x04
585 /* WPS Configuration Method */
586 #define WPS_CM_NONE 0x0000
587 #define WPS_CM_LABEL 0x0004
588 #define WPS_CM_DISPLYA 0x0008
589 #define WPS_CM_EXTERNAL_NFC_TOKEN 0x0010
590 #define WPS_CM_INTEGRATED_NFC_TOKEN 0x0020
591 #define WPS_CM_NFC_INTERFACE 0x0040
592 #define WPS_CM_PUSH_BUTTON 0x0080
593 #define WPS_CM_KEYPAD 0x0100
594 #define WPS_CM_SW_PUHS_BUTTON 0x0280
595 #define WPS_CM_HW_PUHS_BUTTON 0x0480
596 #define WPS_CM_SW_DISPLAY_P 0x2008
597 #define WPS_CM_LCD_DISPLAY_P 0x4008
599 #define IP_MCAST_MAC(mac) \
600 ((mac[0] == 0x01) && (mac[1] == 0x00) && (mac[2] == 0x5e))
601 #define ICMPV6_MCAST_MAC(mac) \
602 ((mac[0] == 0x33) && (mac[1] == 0x33) && (mac[2] != 0xff))
604 #endif /* _WIFI_H_ */