forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-02-20 e636c8d336489bf3eed5878299e6cc045bbad077
kernel/drivers/staging/rtl8723bs/include/wifi.h
....@@ -266,8 +266,8 @@
266266
267267 #define SetFrameType(pbuf, type) \
268268 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); \
271271 } while (0)
272272
273273 #define GetFrameSubType(pbuf) (le16_to_cpu(*(__le16 *)(pbuf)) & (BIT(7) |\
....@@ -347,7 +347,7 @@
347347 (addr[4] == 0xff) && (addr[5] == 0xff)) ? true : false \
348348 )
349349
350
-__inline static int IS_MCAST(unsigned char *da)
350
+static inline int IS_MCAST(unsigned char *da)
351351 {
352352 if ((*da) & 0x01)
353353 return true;
....@@ -355,91 +355,91 @@
355355 return false;
356356 }
357357
358
-__inline static unsigned char * get_ra(unsigned char *pframe)
358
+static inline unsigned char * get_ra(unsigned char *pframe)
359359 {
360360 unsigned char *ra;
361361 ra = GetAddr1Ptr(pframe);
362362 return ra;
363363 }
364
-__inline static unsigned char * get_ta(unsigned char *pframe)
364
+static inline unsigned char * get_ta(unsigned char *pframe)
365365 {
366366 unsigned char *ta;
367367 ta = GetAddr2Ptr(pframe);
368368 return ta;
369369 }
370370
371
-__inline static unsigned char * get_da(unsigned char *pframe)
371
+static inline unsigned char * get_da(unsigned char *pframe)
372372 {
373373 unsigned char *da;
374374 unsigned int to_fr_ds = (GetToDs(pframe) << 1) | GetFrDs(pframe);
375375
376376 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;
389389 }
390390
391391 return da;
392392 }
393393
394394
395
-__inline static unsigned char * get_sa(unsigned char *pframe)
395
+static inline unsigned char * get_sa(unsigned char *pframe)
396396 {
397397 unsigned char *sa;
398398 unsigned int to_fr_ds = (GetToDs(pframe) << 1) | GetFrDs(pframe);
399399
400400 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;
413413 }
414414
415415 return sa;
416416 }
417417
418
-__inline static unsigned char * get_hdr_bssid(unsigned char *pframe)
418
+static inline unsigned char * get_hdr_bssid(unsigned char *pframe)
419419 {
420420 unsigned char *sa = NULL;
421421 unsigned int to_fr_ds = (GetToDs(pframe) << 1) | GetFrDs(pframe);
422422
423423 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;
436436 }
437437
438438 return sa;
439439 }
440440
441441
442
-__inline static int IsFrameTypeCtrl(unsigned char *pframe)
442
+static inline int IsFrameTypeCtrl(unsigned char *pframe)
443443 {
444444 if (WIFI_CTRL_TYPE == GetFrameType(pframe))
445445 return true;
....@@ -657,11 +657,6 @@
657657 __le16 start_seq_num;
658658 } __attribute__((packed));
659659
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
-
665660 /**
666661 * struct rtw_ieee80211_ht_cap - HT capabilities
667662 *
....@@ -693,12 +688,9 @@
693688 } __attribute__ ((packed));
694689
695690
696
-struct HT_caps_element
697
-{
698
- union
699
- {
700
- struct
701
- {
691
+struct HT_caps_element {
692
+ union {
693
+ struct {
702694 __le16 HT_caps_info;
703695 unsigned char AMPDU_para;
704696 unsigned char MCS_rate[16];
....@@ -707,32 +699,28 @@
707699 unsigned char ASEL_caps;
708700 } HT_cap_element;
709701 unsigned char HT_cap[26];
710
- }u;
702
+ } u;
711703 } __attribute__ ((packed));
712704
713
-struct HT_info_element
714
-{
705
+struct HT_info_element {
715706 unsigned char primary_channel;
716707 unsigned char infos[5];
717708 unsigned char MCS_rate[16];
718709 } __attribute__ ((packed));
719710
720
-struct AC_param
721
-{
711
+struct AC_param {
722712 unsigned char ACI_AIFSN;
723713 unsigned char CW;
724714 __le16 TXOP_limit;
725715 } __attribute__ ((packed));
726716
727
-struct WMM_para_element
728
-{
717
+struct WMM_para_element {
729718 unsigned char QoS_info;
730719 unsigned char reserved;
731720 struct AC_param ac_param[4];
732721 } __attribute__ ((packed));
733722
734
-struct ADDBA_request
735
-{
723
+struct ADDBA_request {
736724 unsigned char dialog_token;
737725 __le16 BA_para_set;
738726 __le16 BA_timeout_value;
....@@ -1070,9 +1058,9 @@
10701058 P2P_STATE_TX_PROVISION_DIS_REQ = 6, /* In P2P provisioning discovery */
10711059 P2P_STATE_RX_PROVISION_DIS_RSP = 7,
10721060 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 */
10761064 P2P_STATE_RECV_INVITE_REQ_MATCH = 12, /* receiving the P2P Invitation request and match with the profile. */
10771065 P2P_STATE_PROVISIONING_ING = 13, /* Doing the P2P WPS */
10781066 P2P_STATE_PROVISIONING_DONE = 14, /* Finish the P2P WPS */
....@@ -1082,8 +1070,8 @@
10821070 P2P_STATE_RECV_INVITE_REQ_GO = 18, /* receiving the P2P Invitation request and this wifi is GO. */
10831071 P2P_STATE_RECV_INVITE_REQ_JOIN = 19, /* receiving the P2P Invitation request to join an existing P2P Group. */
10841072 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 */
10871075 };
10881076
10891077 enum P2P_WPSINFO {
....@@ -1095,14 +1083,13 @@
10951083
10961084 #define P2P_PRIVATE_IOCTL_SET_LEN 64
10971085
1098
-enum P2P_PROTO_WK_ID
1099
-{
1086
+enum P2P_PROTO_WK_ID {
11001087 P2P_FIND_PHASE_WK = 0,
11011088 P2P_RESTORE_STATE_WK = 1,
11021089 P2P_PRE_TX_PROVDISC_PROCESS_WK = 2,
11031090 P2P_PRE_TX_NEGOREQ_PROCESS_WK = 3,
11041091 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,
11061093 P2P_RO_CH_WK = 6,
11071094 };
11081095
....@@ -1126,8 +1113,8 @@
11261113 #define WFD_DEVINFO_PC_TDLS 0x0080
11271114 #define WFD_DEVINFO_HDCP_SUPPORT 0x0100
11281115
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))
11311118
11321119 /* Regulatroy Domain */
11331120 struct regd_pair_mapping {