.. | .. |
---|
266 | 266 | |
---|
267 | 267 | #define SetFrameType(pbuf, type) \ |
---|
268 | 268 | do { \ |
---|
269 | | - *(unsigned short *)(pbuf) &= __constant_cpu_to_le16(~(BIT(3) | BIT(2))); \ |
---|
270 | | - *(unsigned short *)(pbuf) |= __constant_cpu_to_le16(type); \ |
---|
| 269 | + *(unsigned short *)(pbuf) &= cpu_to_le16(~(BIT(3) | BIT(2))); \ |
---|
| 270 | + *(unsigned short *)(pbuf) |= cpu_to_le16(type); \ |
---|
271 | 271 | } while (0) |
---|
272 | 272 | |
---|
273 | 273 | #define GetFrameSubType(pbuf) (le16_to_cpu(*(__le16 *)(pbuf)) & (BIT(7) |\ |
---|
.. | .. |
---|
347 | 347 | (addr[4] == 0xff) && (addr[5] == 0xff)) ? true : false \ |
---|
348 | 348 | ) |
---|
349 | 349 | |
---|
350 | | -__inline static int IS_MCAST(unsigned char *da) |
---|
| 350 | +static inline int IS_MCAST(unsigned char *da) |
---|
351 | 351 | { |
---|
352 | 352 | if ((*da) & 0x01) |
---|
353 | 353 | return true; |
---|
.. | .. |
---|
355 | 355 | return false; |
---|
356 | 356 | } |
---|
357 | 357 | |
---|
358 | | -__inline static unsigned char * get_ra(unsigned char *pframe) |
---|
| 358 | +static inline unsigned char * get_ra(unsigned char *pframe) |
---|
359 | 359 | { |
---|
360 | 360 | unsigned char *ra; |
---|
361 | 361 | ra = GetAddr1Ptr(pframe); |
---|
362 | 362 | return ra; |
---|
363 | 363 | } |
---|
364 | | -__inline static unsigned char * get_ta(unsigned char *pframe) |
---|
| 364 | +static inline unsigned char * get_ta(unsigned char *pframe) |
---|
365 | 365 | { |
---|
366 | 366 | unsigned char *ta; |
---|
367 | 367 | ta = GetAddr2Ptr(pframe); |
---|
368 | 368 | return ta; |
---|
369 | 369 | } |
---|
370 | 370 | |
---|
371 | | -__inline static unsigned char * get_da(unsigned char *pframe) |
---|
| 371 | +static inline unsigned char * get_da(unsigned char *pframe) |
---|
372 | 372 | { |
---|
373 | 373 | unsigned char *da; |
---|
374 | 374 | unsigned int to_fr_ds = (GetToDs(pframe) << 1) | GetFrDs(pframe); |
---|
375 | 375 | |
---|
376 | 376 | switch (to_fr_ds) { |
---|
377 | | - case 0x00: /* ToDs = 0, FromDs = 0 */ |
---|
378 | | - da = GetAddr1Ptr(pframe); |
---|
379 | | - break; |
---|
380 | | - case 0x01: /* ToDs = 0, FromDs = 1 */ |
---|
381 | | - da = GetAddr1Ptr(pframe); |
---|
382 | | - break; |
---|
383 | | - case 0x02: /* ToDs = 1, FromDs = 0 */ |
---|
384 | | - da = GetAddr3Ptr(pframe); |
---|
385 | | - break; |
---|
386 | | - default: /* ToDs = 1, FromDs = 1 */ |
---|
387 | | - da = GetAddr3Ptr(pframe); |
---|
388 | | - break; |
---|
| 377 | + case 0x00: /* ToDs = 0, FromDs = 0 */ |
---|
| 378 | + da = GetAddr1Ptr(pframe); |
---|
| 379 | + break; |
---|
| 380 | + case 0x01: /* ToDs = 0, FromDs = 1 */ |
---|
| 381 | + da = GetAddr1Ptr(pframe); |
---|
| 382 | + break; |
---|
| 383 | + case 0x02: /* ToDs = 1, FromDs = 0 */ |
---|
| 384 | + da = GetAddr3Ptr(pframe); |
---|
| 385 | + break; |
---|
| 386 | + default: /* ToDs = 1, FromDs = 1 */ |
---|
| 387 | + da = GetAddr3Ptr(pframe); |
---|
| 388 | + break; |
---|
389 | 389 | } |
---|
390 | 390 | |
---|
391 | 391 | return da; |
---|
392 | 392 | } |
---|
393 | 393 | |
---|
394 | 394 | |
---|
395 | | -__inline static unsigned char * get_sa(unsigned char *pframe) |
---|
| 395 | +static inline unsigned char * get_sa(unsigned char *pframe) |
---|
396 | 396 | { |
---|
397 | 397 | unsigned char *sa; |
---|
398 | 398 | unsigned int to_fr_ds = (GetToDs(pframe) << 1) | GetFrDs(pframe); |
---|
399 | 399 | |
---|
400 | 400 | switch (to_fr_ds) { |
---|
401 | | - case 0x00: /* ToDs = 0, FromDs = 0 */ |
---|
402 | | - sa = GetAddr2Ptr(pframe); |
---|
403 | | - break; |
---|
404 | | - case 0x01: /* ToDs = 0, FromDs = 1 */ |
---|
405 | | - sa = GetAddr3Ptr(pframe); |
---|
406 | | - break; |
---|
407 | | - case 0x02: /* ToDs = 1, FromDs = 0 */ |
---|
408 | | - sa = GetAddr2Ptr(pframe); |
---|
409 | | - break; |
---|
410 | | - default: /* ToDs = 1, FromDs = 1 */ |
---|
411 | | - sa = GetAddr4Ptr(pframe); |
---|
412 | | - break; |
---|
| 401 | + case 0x00: /* ToDs = 0, FromDs = 0 */ |
---|
| 402 | + sa = GetAddr2Ptr(pframe); |
---|
| 403 | + break; |
---|
| 404 | + case 0x01: /* ToDs = 0, FromDs = 1 */ |
---|
| 405 | + sa = GetAddr3Ptr(pframe); |
---|
| 406 | + break; |
---|
| 407 | + case 0x02: /* ToDs = 1, FromDs = 0 */ |
---|
| 408 | + sa = GetAddr2Ptr(pframe); |
---|
| 409 | + break; |
---|
| 410 | + default: /* ToDs = 1, FromDs = 1 */ |
---|
| 411 | + sa = GetAddr4Ptr(pframe); |
---|
| 412 | + break; |
---|
413 | 413 | } |
---|
414 | 414 | |
---|
415 | 415 | return sa; |
---|
416 | 416 | } |
---|
417 | 417 | |
---|
418 | | -__inline static unsigned char * get_hdr_bssid(unsigned char *pframe) |
---|
| 418 | +static inline unsigned char * get_hdr_bssid(unsigned char *pframe) |
---|
419 | 419 | { |
---|
420 | 420 | unsigned char *sa = NULL; |
---|
421 | 421 | unsigned int to_fr_ds = (GetToDs(pframe) << 1) | GetFrDs(pframe); |
---|
422 | 422 | |
---|
423 | 423 | switch (to_fr_ds) { |
---|
424 | | - case 0x00: /* ToDs = 0, FromDs = 0 */ |
---|
425 | | - sa = GetAddr3Ptr(pframe); |
---|
426 | | - break; |
---|
427 | | - case 0x01: /* ToDs = 0, FromDs = 1 */ |
---|
428 | | - sa = GetAddr2Ptr(pframe); |
---|
429 | | - break; |
---|
430 | | - case 0x02: /* ToDs = 1, FromDs = 0 */ |
---|
431 | | - sa = GetAddr1Ptr(pframe); |
---|
432 | | - break; |
---|
433 | | - case 0x03: /* ToDs = 1, FromDs = 1 */ |
---|
434 | | - sa = GetAddr1Ptr(pframe); |
---|
435 | | - break; |
---|
| 424 | + case 0x00: /* ToDs = 0, FromDs = 0 */ |
---|
| 425 | + sa = GetAddr3Ptr(pframe); |
---|
| 426 | + break; |
---|
| 427 | + case 0x01: /* ToDs = 0, FromDs = 1 */ |
---|
| 428 | + sa = GetAddr2Ptr(pframe); |
---|
| 429 | + break; |
---|
| 430 | + case 0x02: /* ToDs = 1, FromDs = 0 */ |
---|
| 431 | + sa = GetAddr1Ptr(pframe); |
---|
| 432 | + break; |
---|
| 433 | + case 0x03: /* ToDs = 1, FromDs = 1 */ |
---|
| 434 | + sa = GetAddr1Ptr(pframe); |
---|
| 435 | + break; |
---|
436 | 436 | } |
---|
437 | 437 | |
---|
438 | 438 | return sa; |
---|
439 | 439 | } |
---|
440 | 440 | |
---|
441 | 441 | |
---|
442 | | -__inline static int IsFrameTypeCtrl(unsigned char *pframe) |
---|
| 442 | +static inline int IsFrameTypeCtrl(unsigned char *pframe) |
---|
443 | 443 | { |
---|
444 | 444 | if (WIFI_CTRL_TYPE == GetFrameType(pframe)) |
---|
445 | 445 | return true; |
---|
.. | .. |
---|
657 | 657 | __le16 start_seq_num; |
---|
658 | 658 | } __attribute__((packed)); |
---|
659 | 659 | |
---|
660 | | -/* 802.11 BAR control masks */ |
---|
661 | | -#define IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL 0x0000 |
---|
662 | | -#define IEEE80211_BAR_CTRL_CBMTID_COMPRESSED_BA 0x0004 |
---|
663 | | - |
---|
664 | | - |
---|
665 | 660 | /** |
---|
666 | 661 | * struct rtw_ieee80211_ht_cap - HT capabilities |
---|
667 | 662 | * |
---|
.. | .. |
---|
693 | 688 | } __attribute__ ((packed)); |
---|
694 | 689 | |
---|
695 | 690 | |
---|
696 | | -struct HT_caps_element |
---|
697 | | -{ |
---|
698 | | - union |
---|
699 | | - { |
---|
700 | | - struct |
---|
701 | | - { |
---|
| 691 | +struct HT_caps_element { |
---|
| 692 | + union { |
---|
| 693 | + struct { |
---|
702 | 694 | __le16 HT_caps_info; |
---|
703 | 695 | unsigned char AMPDU_para; |
---|
704 | 696 | unsigned char MCS_rate[16]; |
---|
.. | .. |
---|
707 | 699 | unsigned char ASEL_caps; |
---|
708 | 700 | } HT_cap_element; |
---|
709 | 701 | unsigned char HT_cap[26]; |
---|
710 | | - }u; |
---|
| 702 | + } u; |
---|
711 | 703 | } __attribute__ ((packed)); |
---|
712 | 704 | |
---|
713 | | -struct HT_info_element |
---|
714 | | -{ |
---|
| 705 | +struct HT_info_element { |
---|
715 | 706 | unsigned char primary_channel; |
---|
716 | 707 | unsigned char infos[5]; |
---|
717 | 708 | unsigned char MCS_rate[16]; |
---|
718 | 709 | } __attribute__ ((packed)); |
---|
719 | 710 | |
---|
720 | | -struct AC_param |
---|
721 | | -{ |
---|
| 711 | +struct AC_param { |
---|
722 | 712 | unsigned char ACI_AIFSN; |
---|
723 | 713 | unsigned char CW; |
---|
724 | 714 | __le16 TXOP_limit; |
---|
725 | 715 | } __attribute__ ((packed)); |
---|
726 | 716 | |
---|
727 | | -struct WMM_para_element |
---|
728 | | -{ |
---|
| 717 | +struct WMM_para_element { |
---|
729 | 718 | unsigned char QoS_info; |
---|
730 | 719 | unsigned char reserved; |
---|
731 | 720 | struct AC_param ac_param[4]; |
---|
732 | 721 | } __attribute__ ((packed)); |
---|
733 | 722 | |
---|
734 | | -struct ADDBA_request |
---|
735 | | -{ |
---|
| 723 | +struct ADDBA_request { |
---|
736 | 724 | unsigned char dialog_token; |
---|
737 | 725 | __le16 BA_para_set; |
---|
738 | 726 | __le16 BA_timeout_value; |
---|
.. | .. |
---|
1070 | 1058 | P2P_STATE_TX_PROVISION_DIS_REQ = 6, /* In P2P provisioning discovery */ |
---|
1071 | 1059 | P2P_STATE_RX_PROVISION_DIS_RSP = 7, |
---|
1072 | 1060 | P2P_STATE_RX_PROVISION_DIS_REQ = 8, |
---|
1073 | | - P2P_STATE_GONEGO_ING = 9, /* Doing the group owner negoitation handshake */ |
---|
1074 | | - P2P_STATE_GONEGO_OK = 10, /* finish the group negoitation handshake with success */ |
---|
1075 | | - P2P_STATE_GONEGO_FAIL = 11, /* finish the group negoitation handshake with failure */ |
---|
| 1061 | + P2P_STATE_GONEGO_ING = 9, /* Doing the group owner negotiation handshake */ |
---|
| 1062 | + P2P_STATE_GONEGO_OK = 10, /* finish the group negotiation handshake with success */ |
---|
| 1063 | + P2P_STATE_GONEGO_FAIL = 11, /* finish the group negotiation handshake with failure */ |
---|
1076 | 1064 | P2P_STATE_RECV_INVITE_REQ_MATCH = 12, /* receiving the P2P Invitation request and match with the profile. */ |
---|
1077 | 1065 | P2P_STATE_PROVISIONING_ING = 13, /* Doing the P2P WPS */ |
---|
1078 | 1066 | P2P_STATE_PROVISIONING_DONE = 14, /* Finish the P2P WPS */ |
---|
.. | .. |
---|
1082 | 1070 | P2P_STATE_RECV_INVITE_REQ_GO = 18, /* receiving the P2P Invitation request and this wifi is GO. */ |
---|
1083 | 1071 | P2P_STATE_RECV_INVITE_REQ_JOIN = 19, /* receiving the P2P Invitation request to join an existing P2P Group. */ |
---|
1084 | 1072 | P2P_STATE_RX_INVITE_RESP_FAIL = 20, /* recveing the P2P Invitation response with failure */ |
---|
1085 | | - P2P_STATE_RX_INFOR_NOREADY = 21, /* receiving p2p negoitation response with information is not available */ |
---|
1086 | | - P2P_STATE_TX_INFOR_NOREADY = 22, /* sending p2p negoitation response with information is not available */ |
---|
| 1073 | + P2P_STATE_RX_INFOR_NOREADY = 21, /* receiving p2p negotiation response with information is not available */ |
---|
| 1074 | + P2P_STATE_TX_INFOR_NOREADY = 22, /* sending p2p negotiation response with information is not available */ |
---|
1087 | 1075 | }; |
---|
1088 | 1076 | |
---|
1089 | 1077 | enum P2P_WPSINFO { |
---|
.. | .. |
---|
1095 | 1083 | |
---|
1096 | 1084 | #define P2P_PRIVATE_IOCTL_SET_LEN 64 |
---|
1097 | 1085 | |
---|
1098 | | -enum P2P_PROTO_WK_ID |
---|
1099 | | -{ |
---|
| 1086 | +enum P2P_PROTO_WK_ID { |
---|
1100 | 1087 | P2P_FIND_PHASE_WK = 0, |
---|
1101 | 1088 | P2P_RESTORE_STATE_WK = 1, |
---|
1102 | 1089 | P2P_PRE_TX_PROVDISC_PROCESS_WK = 2, |
---|
1103 | 1090 | P2P_PRE_TX_NEGOREQ_PROCESS_WK = 3, |
---|
1104 | 1091 | P2P_PRE_TX_INVITEREQ_PROCESS_WK = 4, |
---|
1105 | | - P2P_AP_P2P_CH_SWITCH_PROCESS_WK =5, |
---|
| 1092 | + P2P_AP_P2P_CH_SWITCH_PROCESS_WK = 5, |
---|
1106 | 1093 | P2P_RO_CH_WK = 6, |
---|
1107 | 1094 | }; |
---|
1108 | 1095 | |
---|
.. | .. |
---|
1126 | 1113 | #define WFD_DEVINFO_PC_TDLS 0x0080 |
---|
1127 | 1114 | #define WFD_DEVINFO_HDCP_SUPPORT 0x0100 |
---|
1128 | 1115 | |
---|
1129 | | -#define IP_MCAST_MAC(mac) ((mac[0]== 0x01) && (mac[1]== 0x00) && (mac[2]== 0x5e)) |
---|
1130 | | -#define ICMPV6_MCAST_MAC(mac) ((mac[0]== 0x33) && (mac[1]== 0x33) && (mac[2]!= 0xff)) |
---|
| 1116 | +#define IP_MCAST_MAC(mac) ((mac[0] == 0x01) && (mac[1] == 0x00) && (mac[2] == 0x5e)) |
---|
| 1117 | +#define ICMPV6_MCAST_MAC(mac) ((mac[0] == 0x33) && (mac[1] == 0x33) && (mac[2] != 0xff)) |
---|
1131 | 1118 | |
---|
1132 | 1119 | /* Regulatroy Domain */ |
---|
1133 | 1120 | struct regd_pair_mapping { |
---|