From e636c8d336489bf3eed5878299e6cc045bbad077 Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Tue, 20 Feb 2024 01:17:29 +0000 Subject: [PATCH] debug lk --- kernel/drivers/staging/rtl8723bs/include/wifi.h | 137 ++++++++++++++++++++------------------------- 1 files changed, 62 insertions(+), 75 deletions(-) diff --git a/kernel/drivers/staging/rtl8723bs/include/wifi.h b/kernel/drivers/staging/rtl8723bs/include/wifi.h index 559bf26..3a7dd2e 100644 --- a/kernel/drivers/staging/rtl8723bs/include/wifi.h +++ b/kernel/drivers/staging/rtl8723bs/include/wifi.h @@ -266,8 +266,8 @@ #define SetFrameType(pbuf, type) \ do { \ - *(unsigned short *)(pbuf) &= __constant_cpu_to_le16(~(BIT(3) | BIT(2))); \ - *(unsigned short *)(pbuf) |= __constant_cpu_to_le16(type); \ + *(unsigned short *)(pbuf) &= cpu_to_le16(~(BIT(3) | BIT(2))); \ + *(unsigned short *)(pbuf) |= cpu_to_le16(type); \ } while (0) #define GetFrameSubType(pbuf) (le16_to_cpu(*(__le16 *)(pbuf)) & (BIT(7) |\ @@ -347,7 +347,7 @@ (addr[4] == 0xff) && (addr[5] == 0xff)) ? true : false \ ) -__inline static int IS_MCAST(unsigned char *da) +static inline int IS_MCAST(unsigned char *da) { if ((*da) & 0x01) return true; @@ -355,91 +355,91 @@ return false; } -__inline static unsigned char * get_ra(unsigned char *pframe) +static inline unsigned char * get_ra(unsigned char *pframe) { unsigned char *ra; ra = GetAddr1Ptr(pframe); return ra; } -__inline static unsigned char * get_ta(unsigned char *pframe) +static inline unsigned char * get_ta(unsigned char *pframe) { unsigned char *ta; ta = GetAddr2Ptr(pframe); return ta; } -__inline static unsigned char * get_da(unsigned char *pframe) +static inline unsigned char * get_da(unsigned char *pframe) { unsigned char *da; unsigned int to_fr_ds = (GetToDs(pframe) << 1) | GetFrDs(pframe); switch (to_fr_ds) { - case 0x00: /* ToDs = 0, FromDs = 0 */ - da = GetAddr1Ptr(pframe); - break; - case 0x01: /* ToDs = 0, FromDs = 1 */ - da = GetAddr1Ptr(pframe); - break; - case 0x02: /* ToDs = 1, FromDs = 0 */ - da = GetAddr3Ptr(pframe); - break; - default: /* ToDs = 1, FromDs = 1 */ - da = GetAddr3Ptr(pframe); - break; + case 0x00: /* ToDs = 0, FromDs = 0 */ + da = GetAddr1Ptr(pframe); + break; + case 0x01: /* ToDs = 0, FromDs = 1 */ + da = GetAddr1Ptr(pframe); + break; + case 0x02: /* ToDs = 1, FromDs = 0 */ + da = GetAddr3Ptr(pframe); + break; + default: /* ToDs = 1, FromDs = 1 */ + da = GetAddr3Ptr(pframe); + break; } return da; } -__inline static unsigned char * get_sa(unsigned char *pframe) +static inline unsigned char * get_sa(unsigned char *pframe) { unsigned char *sa; unsigned int to_fr_ds = (GetToDs(pframe) << 1) | GetFrDs(pframe); switch (to_fr_ds) { - case 0x00: /* ToDs = 0, FromDs = 0 */ - sa = GetAddr2Ptr(pframe); - break; - case 0x01: /* ToDs = 0, FromDs = 1 */ - sa = GetAddr3Ptr(pframe); - break; - case 0x02: /* ToDs = 1, FromDs = 0 */ - sa = GetAddr2Ptr(pframe); - break; - default: /* ToDs = 1, FromDs = 1 */ - sa = GetAddr4Ptr(pframe); - break; + case 0x00: /* ToDs = 0, FromDs = 0 */ + sa = GetAddr2Ptr(pframe); + break; + case 0x01: /* ToDs = 0, FromDs = 1 */ + sa = GetAddr3Ptr(pframe); + break; + case 0x02: /* ToDs = 1, FromDs = 0 */ + sa = GetAddr2Ptr(pframe); + break; + default: /* ToDs = 1, FromDs = 1 */ + sa = GetAddr4Ptr(pframe); + break; } return sa; } -__inline static unsigned char * get_hdr_bssid(unsigned char *pframe) +static inline unsigned char * get_hdr_bssid(unsigned char *pframe) { unsigned char *sa = NULL; unsigned int to_fr_ds = (GetToDs(pframe) << 1) | GetFrDs(pframe); switch (to_fr_ds) { - case 0x00: /* ToDs = 0, FromDs = 0 */ - sa = GetAddr3Ptr(pframe); - break; - case 0x01: /* ToDs = 0, FromDs = 1 */ - sa = GetAddr2Ptr(pframe); - break; - case 0x02: /* ToDs = 1, FromDs = 0 */ - sa = GetAddr1Ptr(pframe); - break; - case 0x03: /* ToDs = 1, FromDs = 1 */ - sa = GetAddr1Ptr(pframe); - break; + case 0x00: /* ToDs = 0, FromDs = 0 */ + sa = GetAddr3Ptr(pframe); + break; + case 0x01: /* ToDs = 0, FromDs = 1 */ + sa = GetAddr2Ptr(pframe); + break; + case 0x02: /* ToDs = 1, FromDs = 0 */ + sa = GetAddr1Ptr(pframe); + break; + case 0x03: /* ToDs = 1, FromDs = 1 */ + sa = GetAddr1Ptr(pframe); + break; } return sa; } -__inline static int IsFrameTypeCtrl(unsigned char *pframe) +static inline int IsFrameTypeCtrl(unsigned char *pframe) { if (WIFI_CTRL_TYPE == GetFrameType(pframe)) return true; @@ -657,11 +657,6 @@ __le16 start_seq_num; } __attribute__((packed)); -/* 802.11 BAR control masks */ -#define IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL 0x0000 -#define IEEE80211_BAR_CTRL_CBMTID_COMPRESSED_BA 0x0004 - - /** * struct rtw_ieee80211_ht_cap - HT capabilities * @@ -693,12 +688,9 @@ } __attribute__ ((packed)); -struct HT_caps_element -{ - union - { - struct - { +struct HT_caps_element { + union { + struct { __le16 HT_caps_info; unsigned char AMPDU_para; unsigned char MCS_rate[16]; @@ -707,32 +699,28 @@ unsigned char ASEL_caps; } HT_cap_element; unsigned char HT_cap[26]; - }u; + } u; } __attribute__ ((packed)); -struct HT_info_element -{ +struct HT_info_element { unsigned char primary_channel; unsigned char infos[5]; unsigned char MCS_rate[16]; } __attribute__ ((packed)); -struct AC_param -{ +struct AC_param { unsigned char ACI_AIFSN; unsigned char CW; __le16 TXOP_limit; } __attribute__ ((packed)); -struct WMM_para_element -{ +struct WMM_para_element { unsigned char QoS_info; unsigned char reserved; struct AC_param ac_param[4]; } __attribute__ ((packed)); -struct ADDBA_request -{ +struct ADDBA_request { unsigned char dialog_token; __le16 BA_para_set; __le16 BA_timeout_value; @@ -1070,9 +1058,9 @@ P2P_STATE_TX_PROVISION_DIS_REQ = 6, /* In P2P provisioning discovery */ P2P_STATE_RX_PROVISION_DIS_RSP = 7, P2P_STATE_RX_PROVISION_DIS_REQ = 8, - P2P_STATE_GONEGO_ING = 9, /* Doing the group owner negoitation handshake */ - P2P_STATE_GONEGO_OK = 10, /* finish the group negoitation handshake with success */ - P2P_STATE_GONEGO_FAIL = 11, /* finish the group negoitation handshake with failure */ + P2P_STATE_GONEGO_ING = 9, /* Doing the group owner negotiation handshake */ + P2P_STATE_GONEGO_OK = 10, /* finish the group negotiation handshake with success */ + P2P_STATE_GONEGO_FAIL = 11, /* finish the group negotiation handshake with failure */ P2P_STATE_RECV_INVITE_REQ_MATCH = 12, /* receiving the P2P Invitation request and match with the profile. */ P2P_STATE_PROVISIONING_ING = 13, /* Doing the P2P WPS */ P2P_STATE_PROVISIONING_DONE = 14, /* Finish the P2P WPS */ @@ -1082,8 +1070,8 @@ P2P_STATE_RECV_INVITE_REQ_GO = 18, /* receiving the P2P Invitation request and this wifi is GO. */ P2P_STATE_RECV_INVITE_REQ_JOIN = 19, /* receiving the P2P Invitation request to join an existing P2P Group. */ P2P_STATE_RX_INVITE_RESP_FAIL = 20, /* recveing the P2P Invitation response with failure */ - P2P_STATE_RX_INFOR_NOREADY = 21, /* receiving p2p negoitation response with information is not available */ - P2P_STATE_TX_INFOR_NOREADY = 22, /* sending p2p negoitation response with information is not available */ + P2P_STATE_RX_INFOR_NOREADY = 21, /* receiving p2p negotiation response with information is not available */ + P2P_STATE_TX_INFOR_NOREADY = 22, /* sending p2p negotiation response with information is not available */ }; enum P2P_WPSINFO { @@ -1095,14 +1083,13 @@ #define P2P_PRIVATE_IOCTL_SET_LEN 64 -enum P2P_PROTO_WK_ID -{ +enum P2P_PROTO_WK_ID { P2P_FIND_PHASE_WK = 0, P2P_RESTORE_STATE_WK = 1, P2P_PRE_TX_PROVDISC_PROCESS_WK = 2, P2P_PRE_TX_NEGOREQ_PROCESS_WK = 3, P2P_PRE_TX_INVITEREQ_PROCESS_WK = 4, - P2P_AP_P2P_CH_SWITCH_PROCESS_WK =5, + P2P_AP_P2P_CH_SWITCH_PROCESS_WK = 5, P2P_RO_CH_WK = 6, }; @@ -1126,8 +1113,8 @@ #define WFD_DEVINFO_PC_TDLS 0x0080 #define WFD_DEVINFO_HDCP_SUPPORT 0x0100 -#define IP_MCAST_MAC(mac) ((mac[0]== 0x01) && (mac[1]== 0x00) && (mac[2]== 0x5e)) -#define ICMPV6_MCAST_MAC(mac) ((mac[0]== 0x33) && (mac[1]== 0x33) && (mac[2]!= 0xff)) +#define IP_MCAST_MAC(mac) ((mac[0] == 0x01) && (mac[1] == 0x00) && (mac[2] == 0x5e)) +#define ICMPV6_MCAST_MAC(mac) ((mac[0] == 0x33) && (mac[1] == 0x33) && (mac[2] != 0xff)) /* Regulatroy Domain */ struct regd_pair_mapping { -- Gitblit v1.6.2