From c832879ea1343f5f2c30174978ce25850fe72d09 Mon Sep 17 00:00:00 2001 From: Carlos Garces Date: Wed, 20 Oct 2021 13:23:32 +0200 Subject: [PATCH 01/20] Remove unused headers Port 109709e142eb69c76c78176fe8cd70a4278410a0 Port 0aba3f417fff530fbf031b8f31c37e2d018e44c2 --- include/drv_types.h | 1 - include/usb_osintf.h | 26 ------------------- include/usb_vendor_req.h | 56 ---------------------------------------- 3 files changed, 83 deletions(-) delete mode 100644 include/usb_osintf.h delete mode 100644 include/usb_vendor_req.h diff --git a/include/drv_types.h b/include/drv_types.h index d71d15c..e37762f 100644 --- a/include/drv_types.h +++ b/include/drv_types.h @@ -1735,7 +1735,6 @@ int rtw_suspend_free_assoc_resource(_adapter *padapter); /* HCI Related header file */ #ifdef CONFIG_USB_HCI - #include #include #include #endif diff --git a/include/usb_osintf.h b/include/usb_osintf.h deleted file mode 100644 index 7e5feed..0000000 --- a/include/usb_osintf.h +++ /dev/null @@ -1,26 +0,0 @@ -/****************************************************************************** - * - * Copyright(c) 2007 - 2017 Realtek Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - *****************************************************************************/ -#ifndef __USB_OSINTF_H -#define __USB_OSINTF_H - -#include - -#define USBD_HALTED(Status) ((ULONG)(Status) >> 30 == 3) - - -u8 usbvendorrequest(struct dvobj_priv *pdvobjpriv, RT_USB_BREQUEST brequest, RT_USB_WVALUE wvalue, u8 windex, void *data, u8 datalen, u8 isdirectionin); - - -#endif diff --git a/include/usb_vendor_req.h b/include/usb_vendor_req.h deleted file mode 100644 index a003bfb..0000000 --- a/include/usb_vendor_req.h +++ /dev/null @@ -1,56 +0,0 @@ -/****************************************************************************** - * - * Copyright(c) 2007 - 2017 Realtek Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - *****************************************************************************/ -#ifndef _USB_VENDOR_REQUEST_H_ -#define _USB_VENDOR_REQUEST_H_ - -/* 4 Set/Get Register related wIndex/Data */ -#define RT_USB_RESET_MASK_OFF 0 -#define RT_USB_RESET_MASK_ON 1 -#define RT_USB_SLEEP_MASK_OFF 0 -#define RT_USB_SLEEP_MASK_ON 1 -#define RT_USB_LDO_ON 1 -#define RT_USB_LDO_OFF 0 - -/* 4 Set/Get SYSCLK related wValue or Data */ -#define RT_USB_SYSCLK_32KHZ 0 -#define RT_USB_SYSCLK_40MHZ 1 -#define RT_USB_SYSCLK_60MHZ 2 - - -typedef enum _RT_USB_BREQUEST { - RT_USB_SET_REGISTER = 1, - RT_USB_SET_SYSCLK = 2, - RT_USB_GET_SYSCLK = 3, - RT_USB_GET_REGISTER = 4 -} RT_USB_BREQUEST; - - -typedef enum _RT_USB_WVALUE { - RT_USB_RESET_MASK = 1, - RT_USB_SLEEP_MASK = 2, - RT_USB_USB_HRCPWM = 3, - RT_USB_LDO = 4, - RT_USB_BOOT_TYPE = 5 -} RT_USB_WVALUE; - - -#if 0 -BOOLEAN usbvendorrequest(PCE_USB_DEVICE CEdevice, RT_USB_BREQUEST bRequest, RT_USB_WVALUE wValue, UCHAR wIndex, PVOID Data, UCHAR DataLength, BOOLEAN isDirectionIn); -BOOLEAN CEusbGetStatusRequest(PCE_USB_DEVICE CEdevice, IN USHORT Op, IN USHORT Index, PVOID Data); -BOOLEAN CEusbFeatureRequest(PCE_USB_DEVICE CEdevice, IN USHORT Op, IN USHORT FeatureSelector, IN USHORT Index); -BOOLEAN CEusbGetDescriptorRequest(PCE_USB_DEVICE CEdevice, IN short urbLength, IN UCHAR DescriptorType, IN UCHAR Index, IN USHORT LanguageId, IN PVOID TransferBuffer, IN ULONG TransferBufferLength); -#endif - -#endif From 51d0819382215a83a78adcdfe5cf87c857e602aa Mon Sep 17 00:00:00 2001 From: Carlos Garces Date: Wed, 20 Oct 2021 16:42:09 +0200 Subject: [PATCH 02/20] Use cpu_to_le16() insted of RTW_PUT_LE16() Port 83a9b6694d1e300ca8240fdf654650dcc096c86f --- core/mesh/rtw_mesh.c | 8 ++++---- core/rtw_ieee80211.c | 7 +++---- core/rtw_iol.c | 6 ------ core/rtw_mlme.c | 2 +- core/rtw_p2p.c | 27 ++++++++++----------------- hal/hal_mcc.c | 2 +- include/osdep_service.h | 5 ----- os_dep/linux/ioctl_cfg80211.c | 10 ++++------ 8 files changed, 23 insertions(+), 44 deletions(-) diff --git a/core/mesh/rtw_mesh.c b/core/mesh/rtw_mesh.c index 7409aa0..79c7958 100644 --- a/core/mesh/rtw_mesh.c +++ b/core/mesh/rtw_mesh.c @@ -85,19 +85,19 @@ inline u8 *rtw_set_ie_mpm(u8 *buf, u32 *buf_len u8 data[24] = {0}; u8 *pos = data; - RTW_PUT_LE16(pos, proto_id); + *(u16 *) (pos) = cpu_to_le16(proto_id); pos += 2; - RTW_PUT_LE16(pos, llid); + *(u16 *) (pos) = cpu_to_le16(llid); pos += 2; if (plid) { - RTW_PUT_LE16(pos, *plid); + *(u16 *) (pos) = cpu_to_le16(*plid)); pos += 2; } if (reason) { - RTW_PUT_LE16(pos, *reason); + *(u16 *) (pos) = cpu_to_le16(*reason)); pos += 2; } diff --git a/core/rtw_ieee80211.c b/core/rtw_ieee80211.c index fa949b8..45150b6 100644 --- a/core/rtw_ieee80211.c +++ b/core/rtw_ieee80211.c @@ -282,8 +282,8 @@ inline u8 *rtw_set_ie_mesh_ch_switch_parm(u8 *buf, u32 *buf_len, u8 ttl, ie_data[0] = ttl; ie_data[1] = flags; - RTW_PUT_LE16((u8 *)&ie_data[2], reason); - RTW_PUT_LE16((u8 *)&ie_data[4], precedence); + *(u16 *)(ie_data+2) = cpu_to_le16(reason); + *(u16 *)(ie_data+4) = cpu_to_le16(precedence); return rtw_set_ie(buf, 0x118, 6, ie_data, buf_len); } @@ -2169,8 +2169,7 @@ u32 rtw_set_p2p_attr_content(u8 *pbuf, u8 attr_id, u16 attr_len, u8 *pdata_attr) *pbuf = attr_id; - /* *(u16*)(pbuf + 1) = cpu_to_le16(attr_len); */ - RTW_PUT_LE16(pbuf + 1, attr_len); + *(u16 *)(pbuf + 1) = cpu_to_le16(attr_len); if (pdata_attr) memcpy(pbuf + 3, pdata_attr, attr_len); diff --git a/core/rtw_iol.c b/core/rtw_iol.c index e287b36..37f5d50 100644 --- a/core/rtw_iol.c +++ b/core/rtw_iol.c @@ -118,7 +118,6 @@ int _rtw_IOL_append_WB_cmd(struct xmit_frame *xmit_frame, u16 addr, u8 value, u8 { struct ioreg_cfg cmd = {8, IOREG_CMD_WB_REG, 0x0, 0x0, 0x0}; - /* RTW_PUT_LE16((u8*)&cmd.address, addr); */ /* RTW_PUT_LE32((u8*)&cmd.value, (u32)value); */ cmd.address = cpu_to_le16(addr); cmd.data = cpu_to_le32(value); @@ -138,7 +137,6 @@ int _rtw_IOL_append_WW_cmd(struct xmit_frame *xmit_frame, u16 addr, u16 value, u { struct ioreg_cfg cmd = {8, IOREG_CMD_WW_REG, 0x0, 0x0, 0x0}; - /* RTW_PUT_LE16((u8*)&cmd.address, addr); */ /* RTW_PUT_LE32((u8*)&cmd.value, (u32)value); */ cmd.address = cpu_to_le16(addr); cmd.data = cpu_to_le32(value); @@ -158,7 +156,6 @@ int _rtw_IOL_append_WD_cmd(struct xmit_frame *xmit_frame, u16 addr, u32 value, u { struct ioreg_cfg cmd = {8, IOREG_CMD_WD_REG, 0x0, 0x0, 0x0}; - /* RTW_PUT_LE16((u8*)&cmd.address, addr); */ /* RTW_PUT_LE32((u8*)&cmd.value, (u32)value); */ cmd.address = cpu_to_le16(addr); cmd.data = cpu_to_le32(value); @@ -179,7 +176,6 @@ int _rtw_IOL_append_WRF_cmd(struct xmit_frame *xmit_frame, u8 rf_path, u16 addr, { struct ioreg_cfg cmd = {8, IOREG_CMD_W_RF, 0x0, 0x0, 0x0}; - /* RTW_PUT_LE16((u8*)&cmd.address, addr); */ /* RTW_PUT_LE32((u8*)&cmd.value, (u32)value); */ cmd.address = (rf_path << 8) | ((addr) & 0xFF); cmd.data = cpu_to_le32(value); @@ -201,7 +197,6 @@ int _rtw_IOL_append_WRF_cmd(struct xmit_frame *xmit_frame, u8 rf_path, u16 addr, int rtw_IOL_append_DELAY_US_cmd(struct xmit_frame *xmit_frame, u16 us) { struct ioreg_cfg cmd = {4, IOREG_CMD_DELAY_US, 0x0, 0x0, 0x0}; - /* RTW_PUT_LE16((u8*)&cmd.address, us); */ cmd.address = cpu_to_le16(us); /* RTW_INFO("%s %u\n", __FUNCTION__, us); */ @@ -212,7 +207,6 @@ int rtw_IOL_append_DELAY_MS_cmd(struct xmit_frame *xmit_frame, u16 ms) { struct ioreg_cfg cmd = {4, IOREG_CMD_DELAY_US, 0x0, 0x0, 0x0}; - /* RTW_PUT_LE16((u8*)&cmd.address, ms); */ cmd.address = cpu_to_le16(ms); /* RTW_INFO("%s %u\n", __FUNCTION__, ms); */ diff --git a/core/rtw_mlme.c b/core/rtw_mlme.c index 48e10ba..34fcfef 100644 --- a/core/rtw_mlme.c +++ b/core/rtw_mlme.c @@ -4321,7 +4321,7 @@ int rtw_rsn_sync_pmkid(_adapter *adapter, u8 *ie, uint ie_len, int i_ent) } else info.pmkid_cnt = 0; /* update new pmkid_cnt */ - RTW_PUT_LE16(info.pmkid_list - 2, info.pmkid_cnt); + *(u16 *)(info.pmkid_list - 2) = cpu_to_le16(info.pmkid_cnt); if (info.gmcs) memcpy(info.pmkid_list + 16 * info.pmkid_cnt, gm_cs, 4); diff --git a/core/rtw_p2p.c b/core/rtw_p2p.c index fc0310d..d801867 100644 --- a/core/rtw_p2p.c +++ b/core/rtw_p2p.c @@ -1900,8 +1900,7 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) p2pie[p2pielen++] = P2P_ATTR_CAPABILITY; /* Length: */ - /* *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 0x0002 ); */ - RTW_PUT_LE16(p2pie + p2pielen, 0x0002); + *(u16 *) (p2pie + p2pielen) = cpu_to_le16(0x0002); p2pielen += 2; /* Value: */ @@ -1929,19 +1928,16 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) p2pie[p2pielen++] = P2P_ATTR_EX_LISTEN_TIMING; /* Length: */ - /* *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 0x0004 ); */ - RTW_PUT_LE16(p2pie + p2pielen, 0x0004); + *(u16 *) (p2pie + p2pielen) = cpu_to_le16(0x0004); p2pielen += 2; /* Value: */ /* Availability Period */ - /* *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 0xFFFF ); */ - RTW_PUT_LE16(p2pie + p2pielen, 0xFFFF); + *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 0xFFFF ); p2pielen += 2; /* Availability Interval */ - /* *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 0xFFFF ); */ - RTW_PUT_LE16(p2pie + p2pielen, 0xFFFF); + *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 0xFFFF ); p2pielen += 2; @@ -1963,12 +1959,12 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) /* *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 21 + pwdinfo->device_name_len ); */ #ifdef CONFIG_INTEL_WIDI if (widi_version == 35) - RTW_PUT_LE16(p2pie + p2pielen, 21 + 8 + pwdinfo->device_name_len); + *(u16 *) (p2pie + p2pielen) = cpu_to_le16(21 + 8 + pwdinfo->device_name_len); else if (widi_version == 40) - RTW_PUT_LE16(p2pie + p2pielen, 21 + 8 * pmlmepriv->num_p2p_sdt + pwdinfo->device_name_len); + *(u16 *) (p2pie + p2pielen) = cpu_to_le16(21 + 8 * pmlmepriv->num_p2p_sdt + pwdinfo->device_name_len); else #endif /* CONFIG_INTEL_WIDI */ - RTW_PUT_LE16(p2pie + p2pielen, 21 + pwdinfo->device_name_len); + *(u16 *) (p2pie + p2pielen) = cpu_to_le16(21 + pwdinfo->device_name_len); p2pielen += 2; /* Value: */ @@ -2101,8 +2097,7 @@ u32 build_prov_disc_request_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 p2pie[p2pielen++] = P2P_ATTR_CAPABILITY; /* Length: */ - /* *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 0x0002 ); */ - RTW_PUT_LE16(p2pie + p2pielen, 0x0002); + *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 0x0002 ); p2pielen += 2; /* Value: */ @@ -2123,8 +2118,7 @@ u32 build_prov_disc_request_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 /* Length: */ /* 21->P2P Device Address (6bytes) + Config Methods (2bytes) + Primary Device Type (8bytes) */ /* + NumofSecondDevType (1byte) + WPS Device Name ID field (2bytes) + WPS Device Name Len field (2bytes) */ - /* *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 21 + pwdinfo->device_name_len ); */ - RTW_PUT_LE16(p2pie + p2pielen, 21 + pwdinfo->device_name_len); + *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 21 + pwdinfo->device_name_len ); p2pielen += 2; /* Value: */ @@ -2187,8 +2181,7 @@ u32 build_prov_disc_request_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 p2pie[p2pielen++] = P2P_ATTR_GROUP_ID; /* Length: */ - /* *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( ETH_ALEN + ussidlen ); */ - RTW_PUT_LE16(p2pie + p2pielen, ETH_ALEN + ussidlen); + *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( ETH_ALEN + ussidlen ); p2pielen += 2; /* Value: */ diff --git a/hal/hal_mcc.c b/hal/hal_mcc.c index a1cf8fd..d8eafbd 100644 --- a/hal/hal_mcc.c +++ b/hal/hal_mcc.c @@ -98,7 +98,7 @@ static void rtw_hal_mcc_build_p2p_noa_attr(PADAPTER padapter, u8 *ie, u32 *ie_le p2p_noa_attr_len = p2p_noa_attr_len + 1; /* attrute length(2 bytes) length = noa_desc_num*13 + 2 */ - RTW_PUT_LE16(p2p_noa_attr_ie + p2p_noa_attr_len, (noa_desc_num * 13 + 2)); + *(u16 *) (p2p_noa_attr_ie + p2p_noa_attr_len) = cpu_to_le16(noa_desc_num * 13 + 2); p2p_noa_attr_len = p2p_noa_attr_len + 2; /* Index (1 byte) */ diff --git a/include/osdep_service.h b/include/osdep_service.h index 18d67a5..ae08c06 100644 --- a/include/osdep_service.h +++ b/include/osdep_service.h @@ -514,11 +514,6 @@ extern u32 rtw_random32(void); } while (0) #define RTW_GET_LE16(a) ((u16) (((a)[1] << 8) | (a)[0])) -#define RTW_PUT_LE16(a, val) \ - do { \ - (a)[1] = ((u16) (val)) >> 8; \ - (a)[0] = ((u16) (val)) & 0xff; \ - } while (0) #define RTW_GET_BE24(a) ((((u32) (a)[0]) << 16) | (((u32) (a)[1]) << 8) | \ ((u32) (a)[2])) diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index 6bdb7a9..453c944 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -6411,8 +6411,7 @@ void rtw_cfg80211_issue_p2p_provision_request(_adapter *padapter, const u8 *buf, p2p_ie[p2pielen++] = P2P_ATTR_CAPABILITY; /* Length: */ - /* *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 0x0002 ); */ - RTW_PUT_LE16(p2p_ie + p2pielen, 0x0002); + *(u16*) ( p2p_ie + p2pielen ) = cpu_to_le16( 0x0002 ); p2pielen += 2; /* Value: */ @@ -6429,8 +6428,7 @@ void rtw_cfg80211_issue_p2p_provision_request(_adapter *padapter, const u8 *buf, /* Length: */ /* 21->P2P Device Address (6bytes) + Config Methods (2bytes) + Primary Device Type (8bytes) */ /* + NumofSecondDevType (1byte) + WPS Device Name ID field (2bytes) + WPS Device Name Len field (2bytes) */ - /* *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 21 + pwdinfo->device_name_len ); */ - RTW_PUT_LE16(p2p_ie + p2pielen, devinfo_contentlen); + *(u16*) (p2p_ie + p2pielen) = cpu_to_le16(devinfo_contentlen); p2pielen += 2; /* Value: */ @@ -8158,7 +8156,7 @@ u8 *rtw_cfg80211_construct_mesh_beacon_ies(struct wiphy *wiphy, _adapter *adapte c = ies + 8; /* beacon interval */ - RTW_PUT_LE16(c , setup->beacon_interval); + *((u16 *)c) = cpu_to_le16(setup->beacon_interval); c += 2; /* capability */ @@ -8208,7 +8206,7 @@ u8 *rtw_cfg80211_construct_mesh_beacon_ies(struct wiphy *wiphy, _adapter *adapte memset(ht_op, 0, HT_OP_IE_LEN); /* WLAN_EID_HT_CAPABILITY */ - RTW_PUT_LE16(HT_CAP_ELE_CAP_INFO(ht_cap), sta_ht_cap->cap); + *(u16 *) (HT_CAP_ELE_CAP_INFO(ht_cap)) = cpu_to_le16(sta_ht_cap->cap); SET_HT_CAP_ELE_MAX_AMPDU_LEN_EXP(ht_cap, sta_ht_cap->ampdu_factor); SET_HT_CAP_ELE_MIN_MPDU_S_SPACE(ht_cap, sta_ht_cap->ampdu_density); memcpy(HT_CAP_ELE_SUP_MCS_SET(ht_cap), &sta_ht_cap->mcs, 16); From 4bd55ad6446f30303ea59cb93debf024aaa791f8 Mon Sep 17 00:00:00 2001 From: Carlos Garces Date: Wed, 20 Oct 2021 16:51:24 +0200 Subject: [PATCH 03/20] Remove unused sd_int_dpc --- include/sdio_hal.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/sdio_hal.h b/include/sdio_hal.h index 6e49835..fe5fa13 100644 --- a/include/sdio_hal.h +++ b/include/sdio_hal.h @@ -15,7 +15,6 @@ #ifndef __SDIO_HAL_H__ #define __SDIO_HAL_H__ -void sd_int_dpc(PADAPTER padapter); u8 rtw_set_hal_ops(_adapter *padapter); #ifdef CONFIG_RTL8188E From 7a171741769aaa9f54cc4fc927d8f28b3fcac8e2 Mon Sep 17 00:00:00 2001 From: Carlos Garces Date: Wed, 20 Oct 2021 16:58:06 +0200 Subject: [PATCH 04/20] remove unused macros in include/ieee80211.h Link: https://lore.kernel.org/r/c50cba3974772347888bd55085b1e5e44ef0687d.1626533647.git.fabioaiuto83@gmail.com --- include/ieee80211.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/include/ieee80211.h b/include/ieee80211.h index 29dd539..3d3c8ce 100644 --- a/include/ieee80211.h +++ b/include/ieee80211.h @@ -294,13 +294,8 @@ enum NETWORK_TYPE { #define IsSupported24G(NetType) ((NetType) & SUPPORTED_24G_NETTYPE_MSK ? _TRUE : _FALSE) #define is_supported_5g(NetType) ((NetType) & SUPPORTED_5G_NETTYPE_MSK ? _TRUE : _FALSE) -#define IsEnableHWCCK(NetType) IsSupported24G(NetType) #define IsEnableHWOFDM(NetType) ((NetType) & (WIRELESS_11G | WIRELESS_11_24N | SUPPORTED_5G_NETTYPE_MSK) ? _TRUE : _FALSE) - -#define IsSupportedRxCCK(NetType) IsEnableHWCCK(NetType) #define IsSupportedRxOFDM(NetType) IsEnableHWOFDM(NetType) -#define IsSupportedRxHT(NetType) IsEnableHWOFDM(NetType) - #define IsSupportedTxCCK(NetType) ((NetType) & (WIRELESS_11B) ? _TRUE : _FALSE) #define IsSupportedTxOFDM(NetType) ((NetType) & (WIRELESS_11G | WIRELESS_11A) ? _TRUE : _FALSE) #define is_supported_ht(NetType) ((NetType) & (WIRELESS_11_24N | WIRELESS_11_5N) ? _TRUE : _FALSE) From de617fc8d50783d7a55c5a7c573e360cb827b6be Mon Sep 17 00:00:00 2001 From: Carlos Garces Date: Wed, 20 Oct 2021 17:34:38 +0200 Subject: [PATCH 05/20] Fix IEEE80211 authentication algorithm constants. Use the values provided by linux/wireless.h Port 5befa937e8daaebcde81b9423eb93f3ff2e918f7 Port b658acbf64ae38b8fca982c2929ccc0bf4eb1ea2 --- include/ieee80211.h | 3 --- os_dep/linux/ioctl_linux.c | 16 ++++++++-------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/include/ieee80211.h b/include/ieee80211.h index 3d3c8ce..631c785 100644 --- a/include/ieee80211.h +++ b/include/ieee80211.h @@ -89,9 +89,6 @@ enum { #define IEEE_PARAM_IEEE_802_1X 6 #define IEEE_PARAM_WPAX_SELECT 7 -#define AUTH_ALG_OPEN_SYSTEM 0x1 -#define AUTH_ALG_SHARED_KEY 0x2 -#define AUTH_ALG_LEAP 0x00000004 #define IEEE_MLME_STA_DEAUTH 1 #define IEEE_MLME_STA_DISASSOC 2 diff --git a/os_dep/linux/ioctl_linux.c b/os_dep/linux/ioctl_linux.c index 2c7b3cf..5a5858e 100644 --- a/os_dep/linux/ioctl_linux.c +++ b/os_dep/linux/ioctl_linux.c @@ -755,13 +755,13 @@ static int wpa_set_auth_algs(struct net_device *dev, u32 value) _adapter *padapter = (_adapter *) rtw_netdev_priv(dev); int ret = 0; - if ((value & AUTH_ALG_SHARED_KEY) && (value & AUTH_ALG_OPEN_SYSTEM)) { - RTW_INFO("wpa_set_auth_algs, AUTH_ALG_SHARED_KEY and AUTH_ALG_OPEN_SYSTEM [value:0x%x]\n", value); + if ((value & IW_AUTH_ALG_SHARED_KEY) && (value & IW_AUTH_ALG_OPEN_SYSTEM)) { + RTW_INFO("wpa_set_auth_algs, IW_AUTH_ALG_SHARED_KEY and IW_AUTH_ALG_OPEN_SYSTEM [value:0x%x]\n", value); padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled; padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeAutoSwitch; padapter->securitypriv.dot11AuthAlgrthm = dot11AuthAlgrthm_Auto; - } else if (value & AUTH_ALG_SHARED_KEY) { - RTW_INFO("wpa_set_auth_algs, AUTH_ALG_SHARED_KEY [value:0x%x]\n", value); + } else if (value & IW_AUTH_ALG_SHARED_KEY) { + RTW_INFO("wpa_set_auth_algs, IW_AUTH_ALG_SHARED_KEY [value:0x%x]\n", value); padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled; #ifdef CONFIG_PLATFORM_MT53XX @@ -771,8 +771,8 @@ static int wpa_set_auth_algs(struct net_device *dev, u32 value) padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeShared; padapter->securitypriv.dot11AuthAlgrthm = dot11AuthAlgrthm_Shared; #endif - } else if (value & AUTH_ALG_OPEN_SYSTEM) { - RTW_INFO("wpa_set_auth_algs, AUTH_ALG_OPEN_SYSTEM\n"); + } else if (value & IW_AUTH_ALG_OPEN_SYSTEM) { + RTW_INFO("wpa_set_auth_algs, IW_AUTH_ALG_OPEN_SYSTEM\n"); /* padapter->securitypriv.ndisencryptstatus = Ndis802_11EncryptionDisabled; */ if (padapter->securitypriv.ndisauthtype < Ndis802_11AuthModeWPAPSK) { #ifdef CONFIG_PLATFORM_MT53XX @@ -784,8 +784,8 @@ static int wpa_set_auth_algs(struct net_device *dev, u32 value) #endif } - } else if (value & AUTH_ALG_LEAP) - RTW_INFO("wpa_set_auth_algs, AUTH_ALG_LEAP\n"); + } else if (value & IW_AUTH_ALG_LEAP) + RTW_INFO("wpa_set_auth_algs, IW_AUTH_ALG_LEAP\n"); else { RTW_INFO("wpa_set_auth_algs, error!\n"); ret = -EINVAL; From 77e7d6747cd298cc8e4cfed6921ccf2605032493 Mon Sep 17 00:00:00 2001 From: Carlos Garces Date: Wed, 20 Oct 2021 18:36:56 +0200 Subject: [PATCH 06/20] Replace custom emun Replace rtw_ieee80211_channel_flags with ieee80211_channel_flags from net/cfg80211.h Replace rtw_ieee80211_root_mode_identifier with ieee80211_root_mode_identifier from linux/ieee80211.h port b658acbf64ae38b8fca982c2929ccc0bf4eb1ea2 port 5befa937e8daaebcde81b9423eb93f3ff2e918f7 --- core/mesh/rtw_mesh.c | 2 +- core/mesh/rtw_mesh_hwmp.c | 10 +++---- core/rtw_mlme_ext.c | 2 +- include/ieee80211.h | 51 +++-------------------------------- os_dep/linux/ioctl_cfg80211.c | 4 +-- 5 files changed, 12 insertions(+), 57 deletions(-) diff --git a/core/mesh/rtw_mesh.c b/core/mesh/rtw_mesh.c index 79c7958..3a252ec 100644 --- a/core/mesh/rtw_mesh.c +++ b/core/mesh/rtw_mesh.c @@ -3035,7 +3035,7 @@ void rtw_mesh_cfg_init(_adapter *adapter) mcfg->dot11MeshHWMPpreqMinInterval = RTW_MESH_PREQ_MIN_INT; mcfg->dot11MeshHWMPperrMinInterval = RTW_MESH_PERR_MIN_INT; mcfg->dot11MeshHWMPnetDiameterTraversalTime = RTW_MESH_DIAM_TRAVERSAL_TIME; - mcfg->dot11MeshHWMPRootMode = RTW_IEEE80211_ROOTMODE_NO_ROOT; + mcfg->dot11MeshHWMPRootMode = IEEE80211_ROOTMODE_NO_ROOT; mcfg->dot11MeshHWMPRannInterval = RTW_MESH_RANN_INTERVAL; mcfg->dot11MeshGateAnnouncementProtocol = _FALSE; mcfg->dot11MeshForwarding = _TRUE; diff --git a/core/mesh/rtw_mesh_hwmp.c b/core/mesh/rtw_mesh_hwmp.c index 42b1a29..2d39e25 100644 --- a/core/mesh/rtw_mesh_hwmp.c +++ b/core/mesh/rtw_mesh_hwmp.c @@ -1519,15 +1519,15 @@ void rtw_mesh_path_tx_root_frame(_adapter *adapter) ? RTW_RANN_FLAG_IS_GATE : 0; switch (mshcfg->dot11MeshHWMPRootMode) { - case RTW_IEEE80211_PROACTIVE_RANN: + case IEEE80211_PROACTIVE_RANN: rtw_mesh_path_sel_frame_tx(RTW_MPATH_RANN, flags, adapter_mac_addr(adapter), ++minfo->sn, 0, NULL, 0, bcast_addr, 0, mshcfg->element_ttl, interval, 0, 0, adapter); break; - case RTW_IEEE80211_PROACTIVE_PREQ_WITH_PREP: + case IEEE80211_PROACTIVE_PREQ_WITH_PREP: flags |= RTW_IEEE80211_PREQ_PROACTIVE_PREP_FLAG; - case RTW_IEEE80211_PROACTIVE_PREQ_NO_PREP: + case IEEE80211_PROACTIVE_PREQ_NO_PREP: interval = mshcfg->dot11MeshHWMPactivePathToRootTimeout; target_flags |= RTW_IEEE80211_PREQ_TO_FLAG | RTW_IEEE80211_PREQ_USN_FLAG; @@ -1570,7 +1570,7 @@ static void rtw_ieee80211_mesh_rootpath(_adapter *adapter) rtw_mesh_path_tx_root_frame(adapter); - if (adapter->mesh_cfg.dot11MeshHWMPRootMode == RTW_IEEE80211_PROACTIVE_RANN) + if (adapter->mesh_cfg.dot11MeshHWMPRootMode == IEEE80211_PROACTIVE_RANN) interval = adapter->mesh_cfg.dot11MeshHWMPRannInterval; else interval = adapter->mesh_cfg.dot11MeshHWMProotInterval; @@ -1583,7 +1583,7 @@ BOOLEAN rtw_ieee80211_mesh_root_setup(_adapter *adapter) { BOOLEAN root_enabled = _FALSE; - if (adapter->mesh_cfg.dot11MeshHWMPRootMode > RTW_IEEE80211_ROOTMODE_ROOT) { + if (adapter->mesh_cfg.dot11MeshHWMPRootMode > IEEE80211_ROOTMODE_ROOT) { rtw_set_bit(RTW_MESH_WORK_ROOT, &adapter->wrkq_flags); root_enabled = _TRUE; } diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index 7358168..2f769e2 100644 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -14397,7 +14397,7 @@ static int rtw_scan_ch_decision(_adapter *padapter, struct rtw_ieee80211_channel if (0) RTW_INFO(FUNC_ADPT_FMT" "CHAN_FMT"\n", FUNC_ADPT_ARG(padapter), CHAN_ARG(&in[i])); - if (!in[i].hw_value || (in[i].flags & RTW_IEEE80211_CHAN_DISABLED)) + if (!in[i].hw_value || (in[i].flags & IEEE80211_CHAN_DISABLED)) continue; if (rtw_mlme_band_check(padapter, in[i].hw_value) == _FALSE) continue; diff --git a/include/ieee80211.h b/include/ieee80211.h index 631c785..c7fbc09 100644 --- a/include/ieee80211.h +++ b/include/ieee80211.h @@ -1592,55 +1592,10 @@ enum rtw_ieee80211_preq_target_flags { RTW_IEEE80211_PREQ_USN_FLAG = 1<<2, }; -/** - * enum rtw_ieee80211_root_mode_identifier - root mesh STA mode identifier - * - * These attribute are used by dot11MeshHWMPRootMode to set root mesh STA mode - * - * @RTW_IEEE80211_ROOTMODE_NO_ROOT: the mesh STA is not a root mesh STA (default) - * @RTW_IEEE80211_ROOTMODE_ROOT: the mesh STA is a root mesh STA if greater than - * this value - * @RTW_IEEE80211_PROACTIVE_PREQ_NO_PREP: the mesh STA is a root mesh STA supports - * the proactive PREQ with proactive PREP subfield set to 0 - * @RTW_IEEE80211_PROACTIVE_PREQ_WITH_PREP: the mesh STA is a root mesh STA - * supports the proactive PREQ with proactive PREP subfield set to 1 - * @RTW_IEEE80211_PROACTIVE_RANN: the mesh STA is a root mesh STA supports - * the proactive RANN - */ -enum rtw_ieee80211_root_mode_identifier { - RTW_IEEE80211_ROOTMODE_NO_ROOT = 0, - RTW_IEEE80211_ROOTMODE_ROOT = 1, - RTW_IEEE80211_PROACTIVE_PREQ_NO_PREP = 2, - RTW_IEEE80211_PROACTIVE_PREQ_WITH_PREP = 3, - RTW_IEEE80211_PROACTIVE_RANN = 4, -}; -/** - * enum rtw_ieee80211_channel_flags - channel flags - * - * Channel flags set by the regulatory control code. - * - * @RTW_IEEE80211_CHAN_DISABLED: This channel is disabled. - * @RTW_IEEE80211_CHAN_PASSIVE_SCAN: Only passive scanning is permitted - * on this channel. - * @RTW_IEEE80211_CHAN_NO_IBSS: IBSS is not allowed on this channel. - * @RTW_IEEE80211_CHAN_RADAR: Radar detection is required on this channel. - * @RTW_IEEE80211_CHAN_NO_HT40PLUS: extension channel above this channel - * is not permitted. - * @RTW_IEEE80211_CHAN_NO_HT40MINUS: extension channel below this channel - * is not permitted. - */ -enum rtw_ieee80211_channel_flags { - RTW_IEEE80211_CHAN_DISABLED = 1 << 0, - RTW_IEEE80211_CHAN_PASSIVE_SCAN = 1 << 1, - RTW_IEEE80211_CHAN_NO_IBSS = 1 << 2, - RTW_IEEE80211_CHAN_RADAR = 1 << 3, - RTW_IEEE80211_CHAN_NO_HT40PLUS = 1 << 4, - RTW_IEEE80211_CHAN_NO_HT40MINUS = 1 << 5, -}; - -#define RTW_IEEE80211_CHAN_NO_HT40 \ - (RTW_IEEE80211_CHAN_NO_HT40PLUS | RTW_IEEE80211_CHAN_NO_HT40MINUS) +/* for kernel 3.14 , both value are changed to IEEE80211_CHAN_NO_IR*/ +#define RTW_IEEE80211_CHAN_NO_IBSS (1 << 2) +#define RTW_IEEE80211_CHAN_PASSIVE_SCAN (1 << 1) /* Represent channel details, subset of ieee80211_channel */ struct rtw_ieee80211_channel { diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index 453c944..05b2a8e 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -8030,9 +8030,9 @@ static void rtw_cfg80211_mesh_cfg_set(_adapter *adapter, const struct mesh_confi mcfg->dot11MeshGateAnnouncementProtocol = conf->dot11MeshGateAnnouncementProtocol; /* our current gate annc implementation rides on root annc with gate annc bit in PREQ flags */ if (mcfg->dot11MeshGateAnnouncementProtocol - && mcfg->dot11MeshHWMPRootMode <= RTW_IEEE80211_ROOTMODE_ROOT + && mcfg->dot11MeshHWMPRootMode <= IEEE80211_ROOTMODE_ROOT ) { - mcfg->dot11MeshHWMPRootMode = RTW_IEEE80211_PROACTIVE_RANN; + mcfg->dot11MeshHWMPRootMode = IEEE80211_PROACTIVE_RANN; RTW_INFO(ADPT_FMT" enable PROACTIVE_RANN becaue gate annc is needed\n", ADPT_ARG(adapter)); } if (chk_mesh_attr(NL80211_MESHCONF_HWMP_RANN_INTERVAL, mask)) From 27246f4eb5a4bf146e1889d673ac02a90d026098 Mon Sep 17 00:00:00 2001 From: Carlos Garces Date: Wed, 20 Oct 2021 19:02:50 +0200 Subject: [PATCH 07/20] use eth_broadcast_addr() to assign broadcast address Using eth_broadcast_addr() to assign broadcast address instead of copying from an array that contains the all-ones broadcast address Port 78adf574c969c14a470b686af8d6bd7e1dcf142b Port 3b0a4a1bdb0f6348dba797a0fa1cf161f5639ded Port 44c26bec861476f89ac5aee0bb19df128a42543b Link: https://lore.kernel.org/r/20210616081243.2511663-4-yangyingliang@huawei.com --- core/rtw_br_ext.c | 2 +- core/rtw_mlme_ext.c | 13 +++++-------- hal/hal_com.c | 16 +++++----------- hal/hal_mcc.c | 4 +--- os_dep/linux/ioctl_cfg80211.c | 5 ++--- os_dep/linux/ioctl_linux.c | 2 +- 6 files changed, 15 insertions(+), 27 deletions(-) diff --git a/core/rtw_br_ext.c b/core/rtw_br_ext.c index 8a67073..a2c491e 100644 --- a/core/rtw_br_ext.c +++ b/core/rtw_br_ext.c @@ -811,7 +811,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) if (*((unsigned char *)&iph->daddr + 3) == 0xff) { /* L2 is unicast but L3 is broadcast, make L2 bacome broadcast */ RTW_INFO("NAT25: Set DA as boardcast\n"); - memset(skb->data, 0xff, ETH_ALEN); + eth_broadcast_addr(skb->data); } else { /* forward unknow IP packet to upper TCP/IP */ RTW_INFO("NAT25: Replace DA with BR's MAC\n"); diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index 2f769e2..280651f 100644 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -5786,7 +5786,6 @@ int _issue_probereq_p2p(_adapter *padapter, u8 *da, int wait_ack) unsigned char *mac; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); - u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; struct wifidirect_info *pwdinfo = &(padapter->wdinfo); u8 wpsie[255] = { 0x00 }, p2pie[255] = { 0x00 }; u16 wpsielen = 0, p2pielen = 0; @@ -5831,8 +5830,8 @@ int _issue_probereq_p2p(_adapter *padapter, u8 *da, int wait_ack) memcpy(pwlanhdr->addr3, pwdinfo->p2p_peer_interface_addr, ETH_ALEN); } else { /* broadcast probe request frame */ - memcpy(pwlanhdr->addr1, bc_addr, ETH_ALEN); - memcpy(pwlanhdr->addr3, bc_addr, ETH_ALEN); + eth_broadcast_addr(pwlanhdr->addr1); + eth_broadcast_addr(pwlanhdr->addr3); } } memcpy(pwlanhdr->addr2, mac, ETH_ALEN); @@ -7792,7 +7791,6 @@ void issue_beacon(_adapter *padapter, int timeout_ms) struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network); - u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; #ifdef CONFIG_P2P struct wifidirect_info *pwdinfo = &(padapter->wdinfo); #endif /* CONFIG_P2P */ @@ -7838,7 +7836,7 @@ void issue_beacon(_adapter *padapter, int timeout_ms) fctrl = &(pwlanhdr->frame_ctl); *(fctrl) = 0; - memcpy(pwlanhdr->addr1, bc_addr, ETH_ALEN); + eth_broadcast_addr(pwlanhdr->addr1); memcpy(pwlanhdr->addr2, adapter_mac_addr(padapter), ETH_ALEN); memcpy(pwlanhdr->addr3, get_my_bssid(cur_network), ETH_ALEN); @@ -8392,7 +8390,6 @@ int _issue_probereq(_adapter *padapter, const NDIS_802_11_SSID *pssid, const u8 struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); int bssrate_len = 0; - u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; #ifdef CONFIG_RTW_CFGVENDOR_RANDOM_MAC_OUI struct rtw_wdev_priv *pwdev_priv = adapter_wdev_data(padapter); #endif @@ -8432,8 +8429,8 @@ int _issue_probereq(_adapter *padapter, const NDIS_802_11_SSID *pssid, const u8 memcpy(pwlanhdr->addr3, da, ETH_ALEN); } else { /* broadcast probe request frame */ - memcpy(pwlanhdr->addr1, bc_addr, ETH_ALEN); - memcpy(pwlanhdr->addr3, bc_addr, ETH_ALEN); + eth_broadcast_addr(pwlanhdr->addr1); + eth_broadcast_addr(pwlanhdr->addr3); } memcpy(pwlanhdr->addr2, mac, ETH_ALEN); diff --git a/hal/hal_com.c b/hal/hal_com.c index bdc3b2d..ca7ad38 100644 --- a/hal/hal_com.c +++ b/hal/hal_com.c @@ -5968,7 +5968,6 @@ static void rtw_hal_construct_P2PBeacon(_adapter *padapter, u8 *pframe, u32 *pLe struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network); - u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; #ifdef CONFIG_P2P struct wifidirect_info *pwdinfo = &(padapter->wdinfo); #endif /* CONFIG_P2P */ @@ -5988,7 +5987,7 @@ static void rtw_hal_construct_P2PBeacon(_adapter *padapter, u8 *pframe, u32 *pLe fctrl = &(pwlanhdr->frame_ctl); *(fctrl) = 0; - memcpy(pwlanhdr->addr1, bc_addr, ETH_ALEN); + eth_broadcast_addr(pwlanhdr->addr1); memcpy(pwlanhdr->addr2, adapter_mac_addr(padapter), ETH_ALEN); memcpy(pwlanhdr->addr3, get_my_bssid(cur_network), ETH_ALEN); @@ -7389,8 +7388,6 @@ void rtw_hal_construct_beacon(_adapter *padapter, struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network); - u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; - /* RTW_INFO("%s\n", __FUNCTION__); */ @@ -7399,7 +7396,7 @@ void rtw_hal_construct_beacon(_adapter *padapter, fctrl = &(pwlanhdr->frame_ctl); *(fctrl) = 0; - memcpy(pwlanhdr->addr1, bc_addr, ETH_ALEN); + eth_broadcast_addr(pwlanhdr->addr1); memcpy(pwlanhdr->addr2, adapter_mac_addr(padapter), ETH_ALEN); memcpy(pwlanhdr->addr3, get_my_bssid(cur_network), ETH_ALEN); @@ -7526,8 +7523,6 @@ void rtw_hal_construct_fw_dbg_msg_pkt( struct wlan_network *cur_network = &pmlmepriv->cur_network; struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; - /* RTW_INFO("%s:%d\n", __FUNCTION__, bForcePowerSave); */ @@ -7536,7 +7531,7 @@ void rtw_hal_construct_fw_dbg_msg_pkt( fctrl = &pwlanhdr->frame_ctl; *(fctrl) = 0; - memcpy(pwlanhdr->addr1, bc_addr, ETH_ALEN); + eth_broadcast_addr(pwlanhdr->addr1); memcpy(pwlanhdr->addr2, adapter_mac_addr(padapter), ETH_ALEN); memcpy(pwlanhdr->addr3, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); @@ -8040,7 +8035,6 @@ static void rtw_hal_construct_ProbeReq(_adapter *padapter, u8 *pframe, struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); int bssrate_len = 0; - u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; mac = adapter_mac_addr(padapter); @@ -8048,8 +8042,8 @@ static void rtw_hal_construct_ProbeReq(_adapter *padapter, u8 *pframe, fctrl = &(pwlanhdr->frame_ctl); *(fctrl) = 0; - memcpy(pwlanhdr->addr1, bc_addr, ETH_ALEN); - memcpy(pwlanhdr->addr3, bc_addr, ETH_ALEN); + eth_broadcast_addr(pwlanhdr->addr1); + eth_broadcast_addr(pwlanhdr->addr3); memcpy(pwlanhdr->addr2, mac, ETH_ALEN); diff --git a/hal/hal_mcc.c b/hal/hal_mcc.c index d8eafbd..aee46de 100644 --- a/hal/hal_mcc.c +++ b/hal/hal_mcc.c @@ -984,8 +984,6 @@ exit: static void rtw_hal_construct_CTS(PADAPTER padapter, u8 *pframe, u32 *pLength) { - u8 broadcast_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; - /* frame type, length = 1*/ set_frame_sub_type(pframe, WIFI_RTS); @@ -997,7 +995,7 @@ static void rtw_hal_construct_CTS(PADAPTER padapter, u8 *pframe, u32 *pLength) *(pframe + 3) = 0x78; /* frame recvaddr, length = 6 */ - memcpy((pframe + 4), broadcast_addr, ETH_ALEN); + eth_broadcast_addr((pframe + 4)); memcpy((pframe + 4 + ETH_ALEN), adapter_mac_addr(padapter), ETH_ALEN); memcpy((pframe + 4 + ETH_ALEN*2), adapter_mac_addr(padapter), ETH_ALEN); *pLength = 22; diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index 05b2a8e..d6fddbf 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -788,7 +788,6 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(_adapter *padapter, struct wlan_net size_t len, bssinf_len = 0; struct rtw_ieee80211_hdr *pwlanhdr; unsigned short *fctrl; - u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; struct wireless_dev *wdev = padapter->rtw_wdev; struct wiphy *wiphy = wdev->wiphy; @@ -863,7 +862,7 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(_adapter *padapter, struct wlan_net /* pmlmeext->mgnt_seq++; */ if (pnetwork->network.Reserved[0] == BSS_TYPE_BCN) { /* IEEE80211_STYPE_BEACON */ - memcpy(pwlanhdr->addr1, bc_addr, ETH_ALEN); + eth_broadcast_addr(pwlanhdr->addr1); set_frame_sub_type(pbuf, IEEE80211_STYPE_BEACON); } else { memcpy(pwlanhdr->addr1, adapter_mac_addr(padapter), ETH_ALEN); @@ -1724,7 +1723,7 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev memset(param, 0, param_len); param->cmd = IEEE_CMD_SET_ENCRYPTION; - memset(param->sta_addr, 0xff, ETH_ALEN); + eth_broadcast_addr(param->sta_addr); switch (params->cipher) { case IW_AUTH_CIPHER_NONE: diff --git a/os_dep/linux/ioctl_linux.c b/os_dep/linux/ioctl_linux.c index 5a5858e..7a4f7d2 100644 --- a/os_dep/linux/ioctl_linux.c +++ b/os_dep/linux/ioctl_linux.c @@ -3040,7 +3040,7 @@ static int rtw_wx_set_enc_ext(struct net_device *dev, memset(param, 0, param_len); param->cmd = IEEE_CMD_SET_ENCRYPTION; - memset(param->sta_addr, 0xff, ETH_ALEN); + eth_broadcast_addr(param->sta_addr); switch (pext->alg) { From 539ec6269e688855ea928c92551edfca7b3348a6 Mon Sep 17 00:00:00 2001 From: Carlos Garces Date: Wed, 20 Oct 2021 19:16:08 +0200 Subject: [PATCH 08/20] remove HAL_{BB,MAC,RF,FW}_ENABLE macros remove HAL_{BB,MAC,RF,FW}_ENABLE macros. They are used to turn on/off by hand some core capabilities we want to be always 'on'. port bb1c456d7f88b60b28b9f51e28031fc67cdb8d7b port b4e1882d750facd317ac2572d6bf36a05b0b0c36 Link: https://lore.kernel.org/r/04248acbd22f9be30d21891926e134490b34036a.1623756906.git.fabioaiuto83@gmail.com --- hal/phydm/halrf/halrf.c | 10 ---------- hal/phydm/halrf/rtl8192e/halrf_8192e_ap.c | 4 ---- hal/phydm/halrf/rtl8192e/halrf_8192e_ce.c | 7 ------- hal/phydm/halrf/rtl8192e/halrf_8192e_win.c | 7 ------- hal/rtl8192e/rtl8192e_hal_init.c | 8 -------- hal/rtl8192e/rtl8192e_phycfg.c | 15 --------------- hal/rtl8192e/usb/usb_halinit.c | 7 +------ include/autoconf.h | 2 -- include/hal_phy.h | 13 ------------- 9 files changed, 1 insertion(+), 72 deletions(-) diff --git a/hal/phydm/halrf/halrf.c b/hal/phydm/halrf/halrf.c index ac47232..1ca6ef7 100644 --- a/hal/phydm/halrf/halrf.c +++ b/hal/phydm/halrf/halrf.c @@ -760,9 +760,6 @@ void halrf_segment_iqk_trigger(void *dm_void, boolean clear, return; #endif -#if DISABLE_BB_RF - return; -#endif if (iqk_info->rfk_forbidden) return; @@ -1330,10 +1327,6 @@ void halrf_iqk_trigger(void *dm_void, boolean is_recovery) if (!(rf->rf_supportability & HAL_RF_IQK)) return; -#if DISABLE_BB_RF - return; -#endif - if (iqk_info->rfk_forbidden) return; @@ -1483,9 +1476,6 @@ void halrf_lck_trigger(void *dm_void) if (!(rf->rf_supportability & HAL_RF_LCK)) return; -#if DISABLE_BB_RF - return; -#endif if (iqk_info->rfk_forbidden) return; while (*dm->is_scan_in_process) { diff --git a/hal/phydm/halrf/rtl8192e/halrf_8192e_ap.c b/hal/phydm/halrf/rtl8192e/halrf_8192e_ap.c index 145d910..45c3e40 100644 --- a/hal/phydm/halrf/rtl8192e/halrf_8192e_ap.c +++ b/hal/phydm/halrf/rtl8192e/halrf_8192e_ap.c @@ -1754,10 +1754,6 @@ void phy_set_rf_path_switch_8192e( HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter); #endif -#ifdef DISABLE_BB_RF - return; -#endif - #if !(DM_ODM_SUPPORT_TYPE & ODM_AP) if (IS_92C_SERIAL(hal_data->version_id)) _phy_set_rf_path_switch_8192e(adapter, is_main, true); diff --git a/hal/phydm/halrf/rtl8192e/halrf_8192e_ce.c b/hal/phydm/halrf/rtl8192e/halrf_8192e_ce.c index 7c5f1d5..1a5922f 100644 --- a/hal/phydm/halrf/rtl8192e/halrf_8192e_ce.c +++ b/hal/phydm/halrf/rtl8192e/halrf_8192e_ce.c @@ -1961,10 +1961,6 @@ void phy_set_rf_path_switch_8192e( HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter); #endif -#if DISABLE_BB_RF - return; -#endif - #if !(DM_ODM_SUPPORT_TYPE & ODM_AP) #if (DM_ODM_SUPPORT_TYPE == ODM_CE) _phy_set_rf_path_switch_8192e(dm, is_main, true); @@ -2012,9 +2008,6 @@ boolean phy_query_rf_path_switch_8192e( { HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter); -#if DISABLE_BB_RF - return true; -#endif #if !(DM_ODM_SUPPORT_TYPE & ODM_AP) if (IS_2T2R(hal_data->version_id)) return _phy_query_rf_path_switch_8192e(adapter, true); diff --git a/hal/phydm/halrf/rtl8192e/halrf_8192e_win.c b/hal/phydm/halrf/rtl8192e/halrf_8192e_win.c index 5880d73..a3c2241 100644 --- a/hal/phydm/halrf/rtl8192e/halrf_8192e_win.c +++ b/hal/phydm/halrf/rtl8192e/halrf_8192e_win.c @@ -2070,10 +2070,6 @@ void phy_set_rf_path_switch_8192e( /* HAL_DATA_TYPE *hal_data = GET_HAL_DATA(((PADAPTER)adapter)); */ #endif -#if DISABLE_BB_RF - return; -#endif - #if !(DM_ODM_SUPPORT_TYPE & ODM_AP) _phy_set_rf_path_switch_8192e(adapter, is_main, true); @@ -2123,9 +2119,6 @@ boolean phy_query_rf_path_switch_8192e( { HAL_DATA_TYPE *hal_data = GET_HAL_DATA(((PADAPTER)adapter)); -#if DISABLE_BB_RF - return true; -#endif #if !(DM_ODM_SUPPORT_TYPE & ODM_AP) if (IS_2T2R(hal_data->VersionID)) return _phy_query_rf_path_switch_8192e(adapter, true); diff --git a/hal/rtl8192e/rtl8192e_hal_init.c b/hal/rtl8192e/rtl8192e_hal_init.c index 08835e9..d2c0aa0 100644 --- a/hal/rtl8192e/rtl8192e_hal_init.c +++ b/hal/rtl8192e/rtl8192e_hal_init.c @@ -3633,10 +3633,6 @@ VOID _InitBeaconMaxError_8192E( /* Set CCK and OFDM Block "ON" */ void _BBTurnOnBlock_8192E(PADAPTER padapter) { -#if (DISABLE_BB_RF) - return; -#endif - phy_set_bb_reg(padapter, rFPGA0_RFMOD, bCCKEn, 0x1); phy_set_bb_reg(padapter, rFPGA0_RFMOD, bOFDMEn, 0x1); } @@ -3647,11 +3643,7 @@ hal_ReadRFType_8192E( { HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); -#if DISABLE_BB_RF - pHalData->rf_chip = RF_PSEUDO_11N; -#else pHalData->rf_chip = RF_6052; -#endif pHalData->BandSet = BAND_ON_2_4G; diff --git a/hal/rtl8192e/rtl8192e_phycfg.c b/hal/rtl8192e/rtl8192e_phycfg.c index 55707df..1a62e05 100644 --- a/hal/rtl8192e/rtl8192e_phycfg.c +++ b/hal/rtl8192e/rtl8192e_phycfg.c @@ -51,10 +51,6 @@ PHY_QueryBBReg8192E( { u32 ReturnValue = 0, OriginalValue, BitShift; -#if (DISABLE_BB_RF == 1) - return 0; -#endif - /* RTW_INFO("--->PHY_QueryBBReg8812(): RegAddr(%#x), BitMask(%#x)\n", RegAddr, BitMask); */ @@ -77,10 +73,6 @@ PHY_SetBBReg8192E( { u4Byte OriginalValue, BitShift; -#if (DISABLE_BB_RF == 1) - return; -#endif - if (BitMask != bMaskDWord) { /* if not "double word" write */ OriginalValue = rtw_read32(Adapter, RegAddr); @@ -230,10 +222,6 @@ PHY_QueryRFReg8192E( { u32 Original_Value, Readback_Value, BitShift; -#if (DISABLE_BB_RF == 1) - return 0; -#endif - Original_Value = phy_RFSerialRead(Adapter, eRFPath, RegAddr); BitShift = PHY_CalculateBitShift(BitMask); @@ -252,9 +240,6 @@ PHY_SetRFReg8192E( ) { u32 Original_Value, BitShift; -#if (DISABLE_BB_RF == 1) - return; -#endif if (BitMask == 0) return; diff --git a/hal/rtl8192e/usb/usb_halinit.c b/hal/rtl8192e/usb/usb_halinit.c index 67e129e..4c01cd2 100644 --- a/hal/rtl8192e/usb/usb_halinit.c +++ b/hal/rtl8192e/usb/usb_halinit.c @@ -870,21 +870,17 @@ u32 rtl8192eu_hal_init(PADAPTER Adapter) pHalData->current_channel = 6;/* default set to 6 */ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_MAC); -#if (HAL_MAC_ENABLE == 1) status = PHY_MACConfig8192E(Adapter); if (status == _FAIL) goto exit; -#endif HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_BB); -#if (HAL_BB_ENABLE == 1) status = PHY_BBConfig8192E(Adapter); if (status == _FAIL) goto exit; -#endif HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_RF); -#if (HAL_RF_ENABLE == 1) + status = PHY_RFConfig8192E(Adapter); if (status == _FAIL) goto exit; @@ -975,7 +971,6 @@ u32 rtl8192eu_hal_init(PADAPTER Adapter) #endif /* CONFIG_RTW_LED */ _BBTurnOnBlock_8192E(Adapter); -#endif /* */ /* Joseph Note: Keep RfRegChnlVal for later use. */ diff --git a/include/autoconf.h b/include/autoconf.h index bd75643..1357401 100644 --- a/include/autoconf.h +++ b/include/autoconf.h @@ -237,8 +237,6 @@ #define ENABLE_USB_DROP_INCORRECT_OUT - -#define DISABLE_BB_RF 0 #define RTW_CONFIG_RFREG18_WA /* #define RTL8191C_FPGA_NETWORKTYPE_ADHOC 0 */ diff --git a/include/hal_phy.h b/include/hal_phy.h index 342613b..4b83cd6 100644 --- a/include/hal_phy.h +++ b/include/hal_phy.h @@ -15,19 +15,6 @@ #ifndef __HAL_PHY_H__ #define __HAL_PHY_H__ - -#if DISABLE_BB_RF - #define HAL_FW_ENABLE 0 - #define HAL_MAC_ENABLE 0 - #define HAL_BB_ENABLE 0 - #define HAL_RF_ENABLE 0 -#else /* FPGA_PHY and ASIC */ - #define HAL_FW_ENABLE 1 - #define HAL_MAC_ENABLE 1 - #define HAL_BB_ENABLE 1 - #define HAL_RF_ENABLE 1 -#endif - #define RF6052_MAX_TX_PWR 0x3F #define RF6052_MAX_REG_88E 0xFF #define RF6052_MAX_REG_92C 0x7F From 5a65660af3f9fc3a050e98560e0c02826deeb32b Mon Sep 17 00:00:00 2001 From: Carlos Garces Date: Wed, 20 Oct 2021 19:33:46 +0200 Subject: [PATCH 09/20] convert function to static function chk_sta_is_alive() is used only inside core/rtw_ap.c so remove the prototype and convert it to static. Link: https://lore.kernel.org/r/20210623130103.7727-1-fabioaiuto83@gmail.com --- core/rtw_ap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/rtw_ap.c b/core/rtw_ap.c index 2da3dbe..acbf3bc 100644 --- a/core/rtw_ap.c +++ b/core/rtw_ap.c @@ -268,8 +268,7 @@ void rtw_remove_bcn_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 index) } -u8 chk_sta_is_alive(struct sta_info *psta); -u8 chk_sta_is_alive(struct sta_info *psta) +static u8 chk_sta_is_alive(struct sta_info *psta) { u8 ret = _FALSE; #ifdef DBG_EXPIRATION_CHK From 6b480dfa8e4f04a9b6818c409d36f1f53afb1192 Mon Sep 17 00:00:00 2001 From: Carlos Garces Date: Wed, 20 Oct 2021 21:54:12 +0200 Subject: [PATCH 10/20] include/ieee80211.h cleaup. Remove empty functions from ieee80211.h Use values from linux/ieee80211.h port 12a17d72f7948148b80c0dfa72ea983da33464ba port a9d8763889737b7e0f83956e093bd48190876044 port 872cfb096d3a009709b56f23f5280a359bbe58e2 port a4bc0fa9ec51008bb494943ec98b4ad836e3a216 port 13e00f8ebded278a7887d98ad65ceabc24f3776a --- core/mesh/rtw_mesh.c | 8 +- core/mesh/rtw_mesh_hwmp.c | 36 +-- core/rtw_beamforming.c | 12 +- core/rtw_ieee80211.c | 50 +--- core/rtw_mlme_ext.c | 122 ++++----- core/rtw_p2p.c | 18 +- core/rtw_recv.c | 24 +- core/rtw_rm.c | 4 +- core/rtw_rm_fsm.c | 2 +- core/rtw_tdls.c | 92 +++---- core/rtw_xmit.c | 46 ++-- hal/hal_com.c | 6 +- hal/rtl8192e/usb/rtl8192eu_xmit.c | 2 +- hal/rtl8192e/usb/usb_ops_linux.c | 2 +- include/ieee80211.h | 419 ++---------------------------- os_dep/linux/ioctl_cfg80211.c | 32 +-- os_dep/linux/ioctl_linux.c | 21 +- 17 files changed, 224 insertions(+), 672 deletions(-) diff --git a/core/mesh/rtw_mesh.c b/core/mesh/rtw_mesh.c index 3a252ec..7fc10e2 100644 --- a/core/mesh/rtw_mesh.c +++ b/core/mesh/rtw_mesh.c @@ -1772,7 +1772,7 @@ static int rtw_mesh_check_frames(_adapter *adapter, const u8 **buf, size_t *len, frame_body = *buf + sizeof(struct rtw_ieee80211_hdr_3addr); category = frame_body[0]; - if (category == RTW_WLAN_CATEGORY_SELF_PROTECTED) { + if (category == WLAN_CATEGORY_SELF_PROTECTED) { action = frame_body[1]; switch (action) { case RTW_ACT_SELF_PROTECTED_MESH_OPEN: @@ -1845,7 +1845,7 @@ unsigned int on_action_self_protected(_adapter *adapter, union recv_frame *rfram goto exit; category = frame_body[0]; - if (category != RTW_WLAN_CATEGORY_SELF_PROTECTED) + if (category != WLAN_CATEGORY_SELF_PROTECTED) goto exit; action = frame_body[1]; @@ -1904,7 +1904,7 @@ unsigned int on_action_mesh(_adapter *adapter, union recv_frame *rframe) /* check stainfo exist? */ category = frame_body[0]; - if (category != RTW_WLAN_CATEGORY_MESH) + if (category != WLAN_CATEGORY_MESH_ACTION) goto exit; action = frame_body[1]; @@ -2531,7 +2531,7 @@ static u8 *rtw_mesh_construct_peer_mesh_close(_adapter *adapter, struct mesh_pli set_frame_sub_type(frame, IEEE80211_STYPE_ACTION); pos += sizeof(struct rtw_ieee80211_hdr_3addr); - *(pos++) = RTW_WLAN_CATEGORY_SELF_PROTECTED; + *(pos++) = WLAN_CATEGORY_SELF_PROTECTED; *(pos++) = RTW_ACT_SELF_PROTECTED_MESH_CLOSE; pos = rtw_set_ie_mesh_id(pos, NULL, minfo->mesh_id, minfo->mesh_id_len); diff --git a/core/mesh/rtw_mesh_hwmp.c b/core/mesh/rtw_mesh_hwmp.c index 2d39e25..0aa47b9 100644 --- a/core/mesh/rtw_mesh_hwmp.c +++ b/core/mesh/rtw_mesh_hwmp.c @@ -218,7 +218,7 @@ static int rtw_mesh_path_sel_frame_tx(enum rtw_mpath_frame_type mpath_action, u8 struct xmit_frame *pmgntframe = NULL; struct rtw_ieee80211_hdr *pwlanhdr = NULL; struct pkt_attrib *pattrib = NULL; - u8 category = RTW_WLAN_CATEGORY_MESH; + u8 category = WLAN_CATEGORY_MESH_ACTION; u8 action = RTW_ACT_MESH_HWMP_PATH_SELECTION; u16 *fctrl = NULL; u8 *pos, ie_len; @@ -330,7 +330,7 @@ int rtw_mesh_path_error_tx(_adapter *adapter, struct rtw_ieee80211_hdr *pwlanhdr = NULL; struct pkt_attrib *pattrib = NULL; struct rtw_mesh_info *minfo = &adapter->mesh_info; - u8 category = RTW_WLAN_CATEGORY_MESH; + u8 category = WLAN_CATEGORY_MESH_ACTION; u8 action = RTW_ACT_MESH_HWMP_PATH_SELECTION; u8 *pos, ie_len; u16 *fctrl = NULL; @@ -644,7 +644,7 @@ static void rtw_hwmp_preq_frame_process(_adapter *adapter, target_flags = RTW_PREQ_IE_TARGET_F(preq_elem); /* PREQ gate announcements */ flags = RTW_PREQ_IE_FLAGS(preq_elem); - preq_is_gate = !!(flags & RTW_IEEE80211_PREQ_IS_GATE_FLAG); + preq_is_gate = !!(flags & IEEE80211_PREQ_IS_GATE_FLAG); RTW_HWMP_DBG("received PREQ from "MAC_FMT"\n", MAC_ARG(originator_addr)); @@ -677,11 +677,11 @@ static void rtw_hwmp_preq_frame_process(_adapter *adapter, } target_sn = minfo->sn; } else if (is_broadcast_mac_addr(target_addr) && - (target_flags & RTW_IEEE80211_PREQ_TO_FLAG)) { + (target_flags & IEEE80211_PREQ_TO_FLAG)) { rtw_rcu_read_lock(); path = rtw_mesh_path_lookup(adapter, originator_addr); if (path) { - if (flags & RTW_IEEE80211_PREQ_PROACTIVE_PREP_FLAG) { + if (flags & IEEE80211_PREQ_PROACTIVE_PREP_FLAG) { reply = _TRUE; target_addr = adapter_mac_addr(adapter); target_sn = ++minfo->sn; @@ -722,13 +722,13 @@ static void rtw_hwmp_preq_frame_process(_adapter *adapter, RTW_SN_LT(path->sn, target_sn)) { path->sn = target_sn; path->flags |= RTW_MESH_PATH_SN_VALID; - } else if ((!(target_flags & RTW_IEEE80211_PREQ_TO_FLAG)) && + } else if ((!(target_flags & IEEE80211_PREQ_TO_FLAG)) && (path->flags & RTW_MESH_PATH_ACTIVE)) { reply = _TRUE; target_metric = path->metric; target_sn = path->sn; /* Case E2 of sec 13.10.9.3 IEEE 802.11-2012*/ - target_flags |= RTW_IEEE80211_PREQ_TO_FLAG; + target_flags |= IEEE80211_PREQ_TO_FLAG; } } rtw_rcu_read_unlock(); @@ -748,7 +748,7 @@ static void rtw_hwmp_preq_frame_process(_adapter *adapter, RTW_HWMP_DBG("replying to the PREQ (PREQ for us)\n"); if (mshcfg->dot11MeshGateAnnouncementProtocol) { /* BIT 7 is used to identify the prep is from mesh gate */ - to_gate_ask = RTW_IEEE80211_PREQ_IS_GATE_FLAG | BIT(7); + to_gate_ask = IEEE80211_PREQ_IS_GATE_FLAG | BIT(7); } else { to_gate_ask = 0; } @@ -780,7 +780,7 @@ static void rtw_hwmp_preq_frame_process(_adapter *adapter, da = (path && path->is_root) ? path->rann_snd_addr : bcast_addr; - if (flags & RTW_IEEE80211_PREQ_PROACTIVE_PREP_FLAG) { + if (flags & IEEE80211_PREQ_PROACTIVE_PREP_FLAG) { target_addr = RTW_PREQ_IE_TARGET_ADDR(preq_elem); target_sn = RTW_PREQ_IE_TARGET_SN(preq_elem); } @@ -831,7 +831,7 @@ static void rtw_hwmp_prep_frame_process(_adapter *adapter, enter_critical_bh(&path->state_lock); path->gate_asked = false; exit_critical_bh(&path->state_lock); - if (!(flags & RTW_IEEE80211_PREQ_IS_GATE_FLAG)) { + if (!(flags & IEEE80211_PREQ_IS_GATE_FLAG)) { enter_critical_bh(&path->state_lock); rtw_mesh_gate_del(adapter->mesh_info.mesh_paths, path); exit_critical_bh(&path->state_lock); @@ -957,7 +957,7 @@ static void rtw_hwmp_rann_frame_process(_adapter *adapter, ttl = rann->rann_ttl; flags = rann->rann_flags; - root_is_gate = !!(flags & RTW_RANN_FLAG_IS_GATE); + root_is_gate = !!(flags & RANN_FLAG_IS_GATE); originator_addr = rann->rann_addr; originator_sn = le32_to_cpu(rann->rann_seq); interval = le32_to_cpu(rann->rann_interval); @@ -1429,9 +1429,9 @@ void rtw_mesh_path_start_discovery(_adapter *adapter) } if (preq_node->flags & RTW_PREQ_Q_F_REFRESH) - target_flags |= RTW_IEEE80211_PREQ_TO_FLAG; + target_flags |= IEEE80211_PREQ_TO_FLAG; else - target_flags &= ~RTW_IEEE80211_PREQ_TO_FLAG; + target_flags &= ~IEEE80211_PREQ_TO_FLAG; #ifdef CONFIG_RTW_MESH_ADD_ROOT_CHK is_root_add_chk = !!(path->flags & RTW_MESH_PATH_ROOT_ADD_CHK); @@ -1443,7 +1443,7 @@ void rtw_mesh_path_start_discovery(_adapter *adapter) #ifdef CONFIG_RTW_MESH_ON_DMD_GANN flags = (mshcfg->dot11MeshGateAnnouncementProtocol) - ? RTW_IEEE80211_PREQ_IS_GATE_FLAG : 0; + ? IEEE80211_PREQ_IS_GATE_FLAG : 0; #endif rtw_mesh_path_sel_frame_tx(RTW_MPATH_PREQ, flags, adapter_mac_addr(adapter), minfo->sn, target_flags, path->dst, path->sn, da, 0, @@ -1516,7 +1516,7 @@ void rtw_mesh_path_tx_root_frame(_adapter *adapter) u8 flags, target_flags = 0; flags = (mshcfg->dot11MeshGateAnnouncementProtocol) - ? RTW_RANN_FLAG_IS_GATE : 0; + ? RANN_FLAG_IS_GATE : 0; switch (mshcfg->dot11MeshHWMPRootMode) { case IEEE80211_PROACTIVE_RANN: @@ -1526,11 +1526,11 @@ void rtw_mesh_path_tx_root_frame(_adapter *adapter) interval, 0, 0, adapter); break; case IEEE80211_PROACTIVE_PREQ_WITH_PREP: - flags |= RTW_IEEE80211_PREQ_PROACTIVE_PREP_FLAG; + flags |= IEEE80211_PREQ_PROACTIVE_PREP_FLAG; case IEEE80211_PROACTIVE_PREQ_NO_PREP: interval = mshcfg->dot11MeshHWMPactivePathToRootTimeout; - target_flags |= RTW_IEEE80211_PREQ_TO_FLAG | - RTW_IEEE80211_PREQ_USN_FLAG; + target_flags |= IEEE80211_PREQ_TO_FLAG | + IEEE80211_PREQ_USN_FLAG; rtw_mesh_path_sel_frame_tx(RTW_MPATH_PREQ, flags, adapter_mac_addr(adapter), ++minfo->sn, target_flags, (u8 *) bcast_addr, 0, bcast_addr, diff --git a/core/rtw_beamforming.c b/core/rtw_beamforming.c index d0898b7..e405bf2 100644 --- a/core/rtw_beamforming.c +++ b/core/rtw_beamforming.c @@ -1631,8 +1631,8 @@ u32 rtw_bf_get_report_packet(PADAPTER adapter, union recv_frame *precv_frame) category = frame_body[0]; action = frame_body[1]; - if ((category == RTW_WLAN_CATEGORY_VHT) - && (action == RTW_WLAN_ACTION_VHT_COMPRESSED_BEAMFORMING)) { + if ((category == WLAN_CATEGORY_VHT) + && (action == WLAN_VHT_ACTION_COMPRESSED_BF)) { pMIMOCtrlField = pframe + 26; Nc = (*pMIMOCtrlField) & 0x7; Nr = ((*pMIMOCtrlField) & 0x38) >> 3; @@ -1646,8 +1646,8 @@ u32 rtw_bf_get_report_packet(PADAPTER adapter, union recv_frame *precv_frame) pCSIMatrix = pMIMOCtrlField + 3 + Nc; CSIMatrixLen = frame_len - 26 - 3 - Nc; info->TargetCSIInfo.bVHT = _TRUE; - } else if ((category == RTW_WLAN_CATEGORY_HT) - && (action == RTW_WLAN_ACTION_HT_COMPRESS_BEAMFORMING)) { + } else if ((category == WLAN_CATEGORY_HT) + && (action == WLAN_HT_ACTION_COMPRESSED_BF)) { pMIMOCtrlField = pframe + 26; Nc = (*pMIMOCtrlField) & 0x3; Nr = ((*pMIMOCtrlField) & 0xC) >> 2; @@ -1726,8 +1726,8 @@ u8 rtw_bf_send_vht_gid_mgnt_packet(PADAPTER adapter, u8 *ra, u8 *gid, u8 *positi memcpy(wlanhdr->addr2, adapter_mac_addr(adapter), ETH_ALEN); memcpy(wlanhdr->addr3, get_bssid(mlmepriv), ETH_ALEN); - pframe[24] = RTW_WLAN_CATEGORY_VHT; - pframe[25] = RTW_WLAN_ACTION_VHT_GROUPID_MANAGEMENT; + pframe[24] = WLAN_CATEGORY_VHT; + pframe[25] = WLAN_VHT_ACTION_GROUPID_MGMT; /* Set Membership Status Array */ ptr = pframe + 26; memcpy(ptr, gid, 8); diff --git a/core/rtw_ieee80211.c b/core/rtw_ieee80211.c index 45150b6..4ecbeda 100644 --- a/core/rtw_ieee80211.c +++ b/core/rtw_ieee80211.c @@ -2663,50 +2663,6 @@ void rtw_bss_ex_del_wfd_attr(WLAN_BSSID_EX *bss_ex, u8 attr_id) } } -/* Baron adds to avoid FreeBSD warning */ -int ieee80211_is_empty_essid(const char *essid, int essid_len) -{ - /* Single white space is for Linksys APs */ - if (essid_len == 1 && essid[0] == ' ') - return 1; - - /* Otherwise, if the entire essid is 0, we assume it is hidden */ - while (essid_len) { - essid_len--; - if (essid[essid_len] != '\0') - return 0; - } - - return 1; -} - -int ieee80211_get_hdrlen(u16 fc) -{ - int hdrlen = 24; - - switch (WLAN_FC_GET_TYPE(fc)) { - case RTW_IEEE80211_FTYPE_DATA: - if (fc & RTW_IEEE80211_STYPE_QOS_DATA) - hdrlen += 2; - if ((fc & RTW_IEEE80211_FCTL_FROMDS) && (fc & RTW_IEEE80211_FCTL_TODS)) - hdrlen += 6; /* Addr4 */ - break; - case RTW_IEEE80211_FTYPE_CTL: - switch (WLAN_FC_GET_STYPE(fc)) { - case RTW_IEEE80211_STYPE_CTS: - case RTW_IEEE80211_STYPE_ACK: - hdrlen = 10; - break; - default: - hdrlen = 16; - break; - } - break; - } - - return hdrlen; -} - u8 rtw_ht_mcsset_to_nss(u8 *supp_mcs_set) { u8 nss = 1; @@ -2826,15 +2782,15 @@ int rtw_action_frame_parse(const u8 *frame, u32 frame_len, u8 *category, u8 *act fc = le16_to_cpu(((struct rtw_ieee80211_hdr_3addr *)frame)->frame_ctl); - if ((fc & (RTW_IEEE80211_FCTL_FTYPE | RTW_IEEE80211_FCTL_STYPE)) - != (RTW_IEEE80211_FTYPE_MGMT | RTW_IEEE80211_STYPE_ACTION) + if ((fc & ( IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) + != (IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ACTION) ) return _FALSE; c = frame_body[0]; switch (c) { - case RTW_WLAN_CATEGORY_P2P: /* vendor-specific */ + case WLAN_CATEGORY_VENDOR_SPECIFIC: /* vendor-specific */ break; default: a = frame_body[1]; diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index 280651f..bf2043d 100644 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -68,30 +68,30 @@ struct mlme_handler mlme_ap_tbl[] = { #endif struct action_handler OnAction_tbl[] = { - {RTW_WLAN_CATEGORY_SPECTRUM_MGMT, "ACTION_SPECTRUM_MGMT", on_action_spct}, - {RTW_WLAN_CATEGORY_QOS, "ACTION_QOS", &OnAction_qos}, - {RTW_WLAN_CATEGORY_DLS, "ACTION_DLS", &OnAction_dls}, - {RTW_WLAN_CATEGORY_BACK, "ACTION_BACK", &OnAction_back}, - {RTW_WLAN_CATEGORY_PUBLIC, "ACTION_PUBLIC", on_action_public}, - {RTW_WLAN_CATEGORY_RADIO_MEAS, "ACTION_RADIO_MEAS", &on_action_rm}, - {RTW_WLAN_CATEGORY_FT, "ACTION_FT", &OnAction_ft}, - {RTW_WLAN_CATEGORY_HT, "ACTION_HT", &OnAction_ht}, + {WLAN_CATEGORY_SPECTRUM_MGMT, "ACTION_SPECTRUM_MGMT", on_action_spct}, + {WLAN_CATEGORY_QOS, "ACTION_QOS", &OnAction_qos}, + {WLAN_CATEGORY_DLS, "ACTION_DLS", &OnAction_dls}, + {WLAN_CATEGORY_BACK, "ACTION_BACK", &OnAction_back}, + {WLAN_CATEGORY_PUBLIC, "ACTION_PUBLIC", on_action_public}, + {WLAN_CATEGORY_RADIO_MEASUREMENT, "ACTION_RADIO_MEAS", &on_action_rm}, + {WLAN_CATEGORY_FAST_BBS_TRANSITION, "ACTION_FT", &OnAction_ft}, + {WLAN_CATEGORY_HT, "ACTION_HT", &OnAction_ht}, #ifdef CONFIG_IEEE80211W - {RTW_WLAN_CATEGORY_SA_QUERY, "ACTION_SA_QUERY", &OnAction_sa_query}, + {WLAN_CATEGORY_SA_QUERY, "ACTION_SA_QUERY", &OnAction_sa_query}, #else - {RTW_WLAN_CATEGORY_SA_QUERY, "ACTION_SA_QUERY", &DoReserved}, + {WLAN_CATEGORY_SA_QUERY, "ACTION_SA_QUERY", &DoReserved}, #endif /* CONFIG_IEEE80211W */ #ifdef CONFIG_RTW_WNM - {RTW_WLAN_CATEGORY_WNM, "ACTION_WNM", &on_action_wnm}, + {WLAN_CATEGORY_WNM, "ACTION_WNM", &on_action_wnm}, #endif - {RTW_WLAN_CATEGORY_UNPROTECTED_WNM, "ACTION_UNPROTECTED_WNM", &DoReserved}, + {WLAN_CATEGORY_WNM_UNPROTECTED, "ACTION_UNPROTECTED_WNM", &DoReserved}, #ifdef CONFIG_RTW_MESH - {RTW_WLAN_CATEGORY_MESH, "ACTION_MESH", &on_action_mesh}, - {RTW_WLAN_CATEGORY_SELF_PROTECTED, "ACTION_SELF_PROTECTED", &on_action_self_protected}, + {WLAN_CATEGORY_MESH_ACTION, "ACTION_MESH", &on_action_mesh}, + {WLAN_CATEGORY_SELF_PROTECTED, "ACTION_SELF_PROTECTED", &on_action_self_protected}, #endif - {RTW_WLAN_CATEGORY_WMM, "ACTION_WMM", &OnAction_wmm}, - {RTW_WLAN_CATEGORY_VHT, "ACTION_VHT", &OnAction_vht}, - {RTW_WLAN_CATEGORY_P2P, "ACTION_P2P", &OnAction_p2p}, + {WLAN_CATEGORY_WMM, "ACTION_WMM", &OnAction_wmm}, + {WLAN_CATEGORY_VHT, "ACTION_VHT", &OnAction_vht}, + {WLAN_CATEGORY_VENDOR_SPECIFIC, "ACTION_P2P", &OnAction_p2p}, }; @@ -1304,9 +1304,9 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame) #ifdef CONFIG_TDLS if ((index << 4) == IEEE80211_STYPE_ACTION) { - /* category==public (4), action==TDLS_DISCOVERY_RESPONSE */ - if (*(pframe + 24) == RTW_WLAN_CATEGORY_PUBLIC && *(pframe + 25) == TDLS_DISCOVERY_RESPONSE) { - RTW_INFO("[TDLS] Recv %s from "MAC_FMT"\n", rtw_tdls_action_txt(TDLS_DISCOVERY_RESPONSE), MAC_ARG(get_addr2_ptr(pframe))); + /* category==public (4), action==WLAN_TDLS_DISCOVERY_RESPONSE */ + if (*(pframe + 24) == WLAN_CATEGORY_PUBLIC && *(pframe + 25) == WLAN_TDLS_DISCOVERY_RESPONSE) { + RTW_INFO("[TDLS] Recv %s from "MAC_FMT"\n", rtw_tdls_action_txt(WLAN_TDLS_DISCOVERY_RESPONSE), MAC_ARG(get_addr2_ptr(pframe))); On_TDLS_Dis_Rsp(padapter, precv_frame); } } @@ -3155,7 +3155,7 @@ unsigned int on_action_spct(_adapter *padapter, union recv_frame *precv_frame) goto exit; category = frame_body[0]; - if (category != RTW_WLAN_CATEGORY_SPECTRUM_MGMT) + if (category != WLAN_CATEGORY_SPECTRUM_MGMT) goto exit; action = frame_body[1]; @@ -3217,7 +3217,7 @@ unsigned int on_action_wnm(_adapter *adapter, union recv_frame *rframe) goto exit; category = frame_body[0]; - if (category != RTW_WLAN_CATEGORY_WNM) + if (category != WLAN_CATEGORY_WNM) goto exit; action = frame_body[1]; @@ -3620,7 +3620,7 @@ unsigned int OnAction_back(_adapter *padapter, union recv_frame *precv_frame) frame_body = (unsigned char *)(pframe + sizeof(struct rtw_ieee80211_hdr_3addr)); category = frame_body[0]; - if (category == RTW_WLAN_CATEGORY_BACK) { /* representing Block Ack */ + if (category == WLAN_CATEGORY_BACK) { /* representing Block Ack */ #ifdef CONFIG_TDLS if ((psta->tdls_sta_state & TDLS_LINKED_STATE) && (psta->htpriv.ht_option == _TRUE) && @@ -3634,7 +3634,7 @@ unsigned int OnAction_back(_adapter *padapter, union recv_frame *precv_frame) action = frame_body[1]; RTW_INFO("%s, action=%d\n", __FUNCTION__, action); switch (action) { - case RTW_WLAN_ACTION_ADDBA_REQ: /* ADDBA request */ + case WLAN_ACTION_ADDBA_REQ: /* ADDBA request */ memcpy(&(pmlmeinfo->ADDBA_req), &(frame_body[2]), sizeof(struct ADDBA_request)); /* process_addba_req(padapter, (u8*)&(pmlmeinfo->ADDBA_req), GetAddr3Ptr(pframe)); */ @@ -3642,7 +3642,7 @@ unsigned int OnAction_back(_adapter *padapter, union recv_frame *precv_frame) break; - case RTW_WLAN_ACTION_ADDBA_RESP: /* ADDBA response */ + case WLAN_ACTION_ADDBA_RESP: /* ADDBA response */ /* status = frame_body[3] | (frame_body[4] << 8); */ /* endian issue */ status = RTW_GET_LE16(&frame_body[3]); @@ -3674,7 +3674,7 @@ unsigned int OnAction_back(_adapter *padapter, union recv_frame *precv_frame) /* RTW_INFO("marc: ADDBA RSP: %x\n", pmlmeinfo->agg_enable_bitmap); */ break; - case RTW_WLAN_ACTION_DELBA: /* DELBA */ + case WLAN_ACTION_DELBA: /* DELBA */ if ((frame_body[3] & BIT(3)) == 0) { psta->htpriv.agg_enable_bitmap &= ~(1 << ((frame_body[3] >> 4) & 0xf)); psta->htpriv.candidate_tid_bitmap &= ~(1 << ((frame_body[3] >> 4) & 0xf)); @@ -3735,7 +3735,7 @@ int get_reg_classes_full_count(struct p2p_channels *channel_list) void issue_p2p_GO_request(_adapter *padapter, u8 *raddr) { struct p2p_channels *ch_list = &(adapter_to_rfctl(padapter)->channel_list); - unsigned char category = RTW_WLAN_CATEGORY_PUBLIC; + unsigned char category = WLAN_CATEGORY_PUBLIC; u8 action = P2P_PUB_ACTION_ACTION; u32 p2poui = cpu_to_be32(P2POUI); u8 oui_subtype = P2P_GO_NEGO_REQ; @@ -4131,7 +4131,7 @@ void issue_p2p_GO_request(_adapter *padapter, u8 *raddr) void issue_p2p_GO_response(_adapter *padapter, u8 *raddr, u8 *frame_body, uint len, u8 result) { struct p2p_channels *ch_list = &(adapter_to_rfctl(padapter)->channel_list); - unsigned char category = RTW_WLAN_CATEGORY_PUBLIC; + unsigned char category = WLAN_CATEGORY_PUBLIC; u8 action = P2P_PUB_ACTION_ACTION; u32 p2poui = cpu_to_be32(P2POUI); u8 oui_subtype = P2P_GO_NEGO_RESP; @@ -4548,7 +4548,7 @@ void issue_p2p_GO_response(_adapter *padapter, u8 *raddr, u8 *frame_body, uint l void issue_p2p_GO_confirm(_adapter *padapter, u8 *raddr, u8 result) { - unsigned char category = RTW_WLAN_CATEGORY_PUBLIC; + unsigned char category = WLAN_CATEGORY_PUBLIC; u8 action = P2P_PUB_ACTION_ACTION; u32 p2poui = cpu_to_be32(P2POUI); u8 oui_subtype = P2P_GO_NEGO_CONF; @@ -4782,7 +4782,7 @@ void issue_p2p_GO_confirm(_adapter *padapter, u8 *raddr, u8 result) void issue_p2p_invitation_request(_adapter *padapter, u8 *raddr) { struct p2p_channels *ch_list = &(adapter_to_rfctl(padapter)->channel_list); - unsigned char category = RTW_WLAN_CATEGORY_PUBLIC; + unsigned char category = WLAN_CATEGORY_PUBLIC; u8 action = P2P_PUB_ACTION_ACTION; u32 p2poui = cpu_to_be32(P2POUI); u8 oui_subtype = P2P_INVIT_REQ; @@ -5080,7 +5080,7 @@ void issue_p2p_invitation_request(_adapter *padapter, u8 *raddr) void issue_p2p_invitation_response(_adapter *padapter, u8 *raddr, u8 dialogToken, u8 status_code) { struct p2p_channels *ch_list = &(adapter_to_rfctl(padapter)->channel_list); - unsigned char category = RTW_WLAN_CATEGORY_PUBLIC; + unsigned char category = WLAN_CATEGORY_PUBLIC; u8 action = P2P_PUB_ACTION_ACTION; u32 p2poui = cpu_to_be32(P2POUI); u8 oui_subtype = P2P_INVIT_RESP; @@ -5314,7 +5314,7 @@ void issue_p2p_invitation_response(_adapter *padapter, u8 *raddr, u8 dialogToken void issue_p2p_provision_request(_adapter *padapter, u8 *pssid, u8 ussidlen, u8 *pdev_raddr) { - unsigned char category = RTW_WLAN_CATEGORY_PUBLIC; + unsigned char category = WLAN_CATEGORY_PUBLIC; u8 action = P2P_PUB_ACTION_ACTION; u8 dialogToken = 1; u32 p2poui = cpu_to_be32(P2POUI); @@ -6611,7 +6611,7 @@ unsigned int on_action_public(_adapter *padapter, union recv_frame *precv_frame) goto exit; category = frame_body[0]; - if (category != RTW_WLAN_CATEGORY_PUBLIC) + if (category != WLAN_CATEGORY_PUBLIC) goto exit; action = frame_body[1]; @@ -6909,7 +6909,7 @@ unsigned int OnAction_ft(_adapter *padapter, union recv_frame *precv_frame) pframe_body = pframe + sizeof(struct rtw_ieee80211_hdr_3addr); category = pframe_body[0]; - if (category != RTW_WLAN_CATEGORY_FT) + if (category != WLAN_CATEGORY_FAST_BBS_TRANSITION) goto exit; action_code = pframe_body[1]; @@ -7164,7 +7164,7 @@ void rtw_wnm_issue_action(_adapter *padapter, u8 action, u8 reason) pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); - category = RTW_WLAN_CATEGORY_WNM; + category = WLAN_CATEGORY_WNM; pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); @@ -7208,12 +7208,12 @@ unsigned int OnAction_ht(_adapter *padapter, union recv_frame *precv_frame) goto exit; category = frame_body[0]; - if (category != RTW_WLAN_CATEGORY_HT) + if (category != WLAN_CATEGORY_HT) goto exit; action = frame_body[1]; switch (action) { - case RTW_WLAN_ACTION_HT_SM_PS: + case WLAN_HT_ACTION_SMPS: #ifdef CONFIG_80211N_HT #ifdef CONFIG_AP_MODE if (check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE) == _TRUE) @@ -7221,9 +7221,9 @@ unsigned int OnAction_ht(_adapter *padapter, union recv_frame *precv_frame) #endif /*CONFIG_AP_MODE*/ #endif /*CONFIG_80211N_HT*/ break; - case RTW_WLAN_ACTION_HT_COMPRESS_BEAMFORMING: + case WLAN_HT_ACTION_COMPRESSED_BF: #ifdef CONFIG_BEAMFORMING - /*RTW_INFO("RTW_WLAN_ACTION_HT_COMPRESS_BEAMFORMING\n");*/ + /*RTW_INFO("WLAN_HT_ACTION_COMPRESSED_BF\n");*/ rtw_beamforming_get_report_frame(padapter, precv_frame); #endif /*CONFIG_BEAMFORMING*/ break; @@ -7309,25 +7309,25 @@ unsigned int OnAction_vht(_adapter *padapter, union recv_frame *precv_frame) goto exit; category = frame_body[0]; - if (category != RTW_WLAN_CATEGORY_VHT) + if (category != WLAN_CATEGORY_VHT) goto exit; action = frame_body[1]; switch (action) { - case RTW_WLAN_ACTION_VHT_COMPRESSED_BEAMFORMING: + case WLAN_VHT_ACTION_COMPRESSED_BF: #ifdef CONFIG_BEAMFORMING - /*RTW_INFO("RTW_WLAN_ACTION_VHT_COMPRESSED_BEAMFORMING\n");*/ + /*RTW_INFO("WLAN_VHT_ACTION_COMPRESSED_BF\n");*/ rtw_beamforming_get_report_frame(padapter, precv_frame); #endif /*CONFIG_BEAMFORMING*/ break; - case RTW_WLAN_ACTION_VHT_OPMODE_NOTIFICATION: + case WLAN_VHT_ACTION_OPMODE_NOTIF: /* CategoryCode(1) + ActionCode(1) + OpModeNotification(1) */ - /* RTW_INFO("RTW_WLAN_ACTION_VHT_OPMODE_NOTIFICATION\n"); */ + /* RTW_INFO("WLAN_VHT_ACTION_OPMODE_NOTIF\n"); */ psta = rtw_get_stainfo(&padapter->stapriv, whdr->addr2); if (psta) rtw_process_vht_op_mode_notify(padapter, &frame_body[2], psta); break; - case RTW_WLAN_ACTION_VHT_GROUPID_MANAGEMENT: + case WLAN_VHT_ACTION_GROUPID_MGMT: #ifdef CONFIG_BEAMFORMING #ifdef RTW_BEAMFORMING_VERSION_2 rtw_beamforming_get_vht_gid_mgnt_frame(padapter, precv_frame); @@ -7360,7 +7360,7 @@ unsigned int OnAction_p2p(_adapter *padapter, union recv_frame *precv_frame) frame_body = (unsigned char *)(pframe + sizeof(struct rtw_ieee80211_hdr_3addr)); category = frame_body[0]; - if (category != RTW_WLAN_CATEGORY_P2P) + if (category != WLAN_CATEGORY_VENDOR_SPECIFIC) return _SUCCESS; if (cpu_to_be32(*((u32 *)(frame_body + 1))) != P2POUI) @@ -9914,7 +9914,7 @@ void issue_action_spct_ch_switch(_adapter *padapter, u8 *ra, u8 new_ch, u8 ch_of /* category, action */ { u8 category, action; - category = RTW_WLAN_CATEGORY_SPECTRUM_MGMT; + category = WLAN_CATEGORY_SPECTRUM_MGMT; action = RTW_WLAN_ACTION_SPCT_CHL_SWITCH; pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); @@ -9934,7 +9934,7 @@ void issue_action_spct_ch_switch(_adapter *padapter, u8 *ra, u8 new_ch, u8 ch_of #ifdef CONFIG_IEEE80211W void issue_action_SA_Query(_adapter *padapter, unsigned char *raddr, unsigned char action, unsigned short tid, u8 key_type) { - u8 category = RTW_WLAN_CATEGORY_SA_QUERY; + u8 category = WLAN_CATEGORY_SA_QUERY; u16 reason_code; struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; @@ -10037,7 +10037,7 @@ static int issue_action_ba(_adapter *padapter, unsigned char *raddr, unsigned ch , u8 tid, u8 size, u16 status, u8 initiator, int wait_ack) { int ret = _FAIL; - u8 category = RTW_WLAN_CATEGORY_BACK; + u8 category = WLAN_CATEGORY_BACK; u16 start_seq; u16 BA_para_set; u16 BA_timeout_value; @@ -10092,7 +10092,7 @@ static int issue_action_ba(_adapter *padapter, unsigned char *raddr, unsigned ch if (category == 3) { switch (action) { - case RTW_WLAN_ACTION_ADDBA_REQ: + case WLAN_ACTION_ADDBA_REQ: do { pmlmeinfo->dialogToken++; } while (pmlmeinfo->dialogToken == 0); @@ -10134,7 +10134,7 @@ static int issue_action_ba(_adapter *padapter, unsigned char *raddr, unsigned ch pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&(BA_starting_seqctrl)), &(pattrib->pktlen)); break; - case RTW_WLAN_ACTION_ADDBA_RESP: + case WLAN_ACTION_ADDBA_RESP: pframe = rtw_set_fixed_ie(pframe, 1, &(pmlmeinfo->ADDBA_req.dialog_token), &(pattrib->pktlen)); status = cpu_to_le16(status); pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&status), &(pattrib->pktlen)); @@ -10160,7 +10160,7 @@ static int issue_action_ba(_adapter *padapter, unsigned char *raddr, unsigned ch pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&(pmlmeinfo->ADDBA_req.BA_timeout_value)), &(pattrib->pktlen)); break; - case RTW_WLAN_ACTION_DELBA: + case WLAN_ACTION_DELBA: BA_para_set = 0; BA_para_set |= (tid << 12) & IEEE80211_DELBA_PARAM_TID_MASK; BA_para_set |= (initiator << 11) & IEEE80211_DELBA_PARAM_INITIATOR_MASK; @@ -10197,7 +10197,7 @@ exit: */ inline void issue_addba_req(_adapter *adapter, unsigned char *ra, u8 tid) { - issue_action_ba(adapter, ra, RTW_WLAN_ACTION_ADDBA_REQ + issue_action_ba(adapter, ra, WLAN_ACTION_ADDBA_REQ , tid , 0 /* unused */ , 0 /* unused */ @@ -10219,7 +10219,7 @@ inline void issue_addba_req(_adapter *adapter, unsigned char *ra, u8 tid) */ inline void issue_addba_rsp(_adapter *adapter, unsigned char *ra, u8 tid, u16 status, u8 size) { - issue_action_ba(adapter, ra, RTW_WLAN_ACTION_ADDBA_RESP + issue_action_ba(adapter, ra, WLAN_ACTION_ADDBA_RESP , tid , size , status @@ -10251,7 +10251,7 @@ inline u8 issue_addba_rsp_wait_ack(_adapter *adapter, unsigned char *ra, u8 tid, goto exit; do { - ret = issue_action_ba(adapter, ra, RTW_WLAN_ACTION_ADDBA_RESP + ret = issue_action_ba(adapter, ra, WLAN_ACTION_ADDBA_RESP , tid , size , status @@ -10296,7 +10296,7 @@ exit: */ inline void issue_del_ba(_adapter *adapter, unsigned char *ra, u8 tid, u16 reason, u8 initiator) { - issue_action_ba(adapter, ra, RTW_WLAN_ACTION_DELBA + issue_action_ba(adapter, ra, WLAN_ACTION_DELBA , tid , 0 /* unused */ , reason @@ -10329,7 +10329,7 @@ int issue_del_ba_ex(_adapter *adapter, unsigned char *ra, u8 tid, u16 reason, u8 goto exit; do { - ret = issue_action_ba(adapter, ra, RTW_WLAN_ACTION_DELBA + ret = issue_action_ba(adapter, ra, WLAN_ACTION_DELBA , tid , 0 /* unused */ , reason @@ -10394,7 +10394,7 @@ void issue_action_BSSCoexistPacket(_adapter *padapter) RTW_INFO("%s\n", __FUNCTION__); - category = RTW_WLAN_CATEGORY_PUBLIC; + category = WLAN_CATEGORY_PUBLIC; action = ACT_PUBLIC_BSSCOEXIST; pmgntframe = alloc_mgtxmitframe(pxmitpriv); @@ -10518,8 +10518,8 @@ int _issue_action_SM_PS(_adapter *padapter , unsigned char *raddr , u8 NewMimoP { int ret = _FAIL; - unsigned char category = RTW_WLAN_CATEGORY_HT; - u8 action = RTW_WLAN_ACTION_HT_SM_PS; + unsigned char category = WLAN_CATEGORY_HT; + u8 action = WLAN_HT_ACTION_SMPS; u8 sm_power_control = 0; struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; @@ -13481,7 +13481,7 @@ void rtw_ft_issue_action_req(_adapter *padapter, u8 *pTargetAddr) struct rtw_ieee80211_hdr *pwlanhdr; struct pkt_attrib *pattrib; u8 *pframe; - u8 category = RTW_WLAN_CATEGORY_FT; + u8 category = WLAN_CATEGORY_FAST_BBS_TRANSITION; u8 action = RTW_WLAN_ACTION_FT_REQ; pmgntframe = alloc_mgtxmitframe(pxmitpriv); diff --git a/core/rtw_p2p.c b/core/rtw_p2p.c index d801867..47394c9 100644 --- a/core/rtw_p2p.c +++ b/core/rtw_p2p.c @@ -148,7 +148,7 @@ static void issue_group_disc_req(struct wifidirect_info *pwdinfo, u8 *da) _adapter *padapter = pwdinfo->padapter; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); - unsigned char category = RTW_WLAN_CATEGORY_P2P;/* P2P action frame */ + unsigned char category = WLAN_CATEGORY_VENDOR_SPECIFIC;/* P2P action frame */ u32 p2poui = cpu_to_be32(P2POUI); u8 oui_subtype = P2P_GO_DISC_REQUEST; u8 dialogToken = 0; @@ -206,7 +206,7 @@ static void issue_p2p_devdisc_resp(struct wifidirect_info *pwdinfo, u8 *da, u8 s _adapter *padapter = pwdinfo->padapter; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); - unsigned char category = RTW_WLAN_CATEGORY_PUBLIC; + unsigned char category = WLAN_CATEGORY_PUBLIC; u8 action = P2P_PUB_ACTION_ACTION; u32 p2poui = cpu_to_be32(P2POUI); u8 oui_subtype = P2P_DEVDISC_RESP; @@ -272,7 +272,7 @@ static void issue_p2p_devdisc_resp(struct wifidirect_info *pwdinfo, u8 *da, u8 s static void issue_p2p_provision_resp(struct wifidirect_info *pwdinfo, u8 *raddr, u8 *frame_body, u16 config_method) { _adapter *padapter = pwdinfo->padapter; - unsigned char category = RTW_WLAN_CATEGORY_PUBLIC; + unsigned char category = WLAN_CATEGORY_PUBLIC; u8 action = P2P_PUB_ACTION_ACTION; u8 dialogToken = frame_body[7]; /* The Dialog Token of provisioning discovery request frame. */ u32 p2poui = cpu_to_be32(P2POUI); @@ -387,7 +387,7 @@ static void issue_p2p_presence_resp(struct wifidirect_info *pwdinfo, u8 *da, u8 _adapter *padapter = pwdinfo->padapter; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); - unsigned char category = RTW_WLAN_CATEGORY_P2P;/* P2P action frame */ + unsigned char category = WLAN_CATEGORY_VENDOR_SPECIFIC;/* P2P action frame */ u32 p2poui = cpu_to_be32(P2POUI); u8 oui_subtype = P2P_PRESENCE_RESPONSE; u8 p2pie[MAX_P2P_IE_LEN] = { 0x00 }; @@ -3741,7 +3741,7 @@ u32 rtw_xframe_build_wfd_ie(struct xmit_frame *xframe) u32 wfdielen = 0; category = frame_body[0]; - if (category == RTW_WLAN_CATEGORY_PUBLIC) { + if (category == WLAN_CATEGORY_PUBLIC) { action = frame_body[1]; if (action == ACT_PUBLIC_VENDOR && _rtw_memcmp(frame_body + 2, P2P_OUI, 4) == _TRUE @@ -3778,7 +3778,7 @@ u32 rtw_xframe_build_wfd_ie(struct xmit_frame *xframe) } } - } else if (category == RTW_WLAN_CATEGORY_P2P) { + } else if (category == WLAN_CATEGORY_VENDOR_SPECIFIC) { OUI_Subtype = frame_body[5]; dialogToken = frame_body[6]; @@ -3820,7 +3820,7 @@ bool rtw_xframe_del_wfd_ie(struct xmit_frame *xframe) uint ies_len = 0; category = frame_body[0]; - if (category == RTW_WLAN_CATEGORY_PUBLIC) { + if (category == WLAN_CATEGORY_PUBLIC) { action = frame_body[1]; if (action == ACT_PUBLIC_VENDOR && _rtw_memcmp(frame_body + 2, P2P_OUI, 4) == _TRUE @@ -3961,7 +3961,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx) frame_body = (unsigned char *)(buf + sizeof(struct rtw_ieee80211_hdr_3addr)); category = frame_body[0]; /* just for check */ - if (category == RTW_WLAN_CATEGORY_PUBLIC) { + if (category == WLAN_CATEGORY_PUBLIC) { action = frame_body[1]; if (action == ACT_PUBLIC_VENDOR && _rtw_memcmp(frame_body + 2, P2P_OUI, 4) == _TRUE @@ -4298,7 +4298,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx) } - } else if (category == RTW_WLAN_CATEGORY_P2P) { + } else if (category == WLAN_CATEGORY_VENDOR_SPECIFIC) { OUI_Subtype = frame_body[5]; dialogToken = frame_body[6]; diff --git a/core/rtw_recv.c b/core/rtw_recv.c index 9cb73de..45d0e3f 100644 --- a/core/rtw_recv.c +++ b/core/rtw_recv.c @@ -1013,8 +1013,8 @@ sint OnTDLS(_adapter *adapter, union recv_frame *precv_frame) ptdls_sta = rtw_get_stainfo(pstapriv, ieee80211_get_SA((struct ieee80211_hdr *)ptr)); if (ptdls_sta == NULL) { switch (*paction) { - case TDLS_SETUP_REQUEST: - case TDLS_DISCOVERY_REQUEST: + case WLAN_TDLS_SETUP_REQUEST: + case WLAN_TDLS_DISCOVERY_REQUEST: break; default: RTW_INFO("[TDLS] %s - Direct Link Peer = "MAC_FMT" not found for action = %d\n", __func__, MAC_ARG(ieee80211_get_SA((struct ieee80211_hdr *)ptr)), *paction); @@ -1024,32 +1024,32 @@ sint OnTDLS(_adapter *adapter, union recv_frame *precv_frame) } switch (*paction) { - case TDLS_SETUP_REQUEST: + case WLAN_TDLS_SETUP_REQUEST: ret = On_TDLS_Setup_Req(adapter, precv_frame, ptdls_sta); break; - case TDLS_SETUP_RESPONSE: + case WLAN_TDLS_SETUP_RESPONSE: ret = On_TDLS_Setup_Rsp(adapter, precv_frame, ptdls_sta); break; - case TDLS_SETUP_CONFIRM: + case WLAN_TDLS_SETUP_CONFIRM: ret = On_TDLS_Setup_Cfm(adapter, precv_frame, ptdls_sta); break; - case TDLS_TEARDOWN: + case WLAN_TDLS_TEARDOWN: ret = On_TDLS_Teardown(adapter, precv_frame, ptdls_sta); break; - case TDLS_DISCOVERY_REQUEST: + case WLAN_TDLS_DISCOVERY_REQUEST: ret = On_TDLS_Dis_Req(adapter, precv_frame); break; - case TDLS_PEER_TRAFFIC_INDICATION: + case WLAN_TDLS_PEER_TRAFFIC_INDICATION: ret = On_TDLS_Peer_Traffic_Indication(adapter, precv_frame, ptdls_sta); break; - case TDLS_PEER_TRAFFIC_RESPONSE: + case WLAN_TDLS_PEER_TRAFFIC_RESPONSE: ret = On_TDLS_Peer_Traffic_Rsp(adapter, precv_frame, ptdls_sta); break; #ifdef CONFIG_TDLS_CH_SW - case TDLS_CHANNEL_SWITCH_REQUEST: + case WLAN_TDLS_CHANNEL_SWITCH_REQUEST: ret = On_TDLS_Ch_Switch_Req(adapter, precv_frame, ptdls_sta); break; - case TDLS_CHANNEL_SWITCH_RESPONSE: + case WLAN_TDLS_CHANNEL_SWITCH_RESPONSE: ret = On_TDLS_Ch_Switch_Rsp(adapter, precv_frame, ptdls_sta); break; #endif @@ -4351,7 +4351,7 @@ int recv_func_posthandle(_adapter *padapter, union recv_frame *prframe) pcategory = psnap_type + ETH_TYPE_LEN + PAYLOAD_TYPE_LEN; if ((_rtw_memcmp(psnap_type, SNAP_ETH_TYPE_TDLS, ETH_TYPE_LEN)) && - ((*pcategory == RTW_WLAN_CATEGORY_TDLS) || (*pcategory == RTW_WLAN_CATEGORY_P2P))) { + ((*pcategory == WLAN_CATEGORY_TDLS) || (*pcategory == WLAN_CATEGORY_VENDOR_SPECIFIC))) { ret = OnTDLS(padapter, prframe); if (ret == _FAIL) goto _exit_recv_func; diff --git a/core/rtw_rm.c b/core/rtw_rm.c index 2df4186..834db77 100644 --- a/core/rtw_rm.c +++ b/core/rtw_rm.c @@ -282,7 +282,7 @@ u8 rm_add_nb_req(_adapter *padapter, struct sta_info *psta) } prm->psta = psta; - prm->q.category = RTW_WLAN_CATEGORY_RADIO_MEAS; + prm->q.category = WLAN_CATEGORY_RADIO_MEASUREMENT; prm->q.diag_token = pmlmeinfo->dialogToken++; prm->q.m_token = 1; @@ -2279,7 +2279,7 @@ static void rm_dbg_add_meas(_adapter *padapter, char *s) prmpriv->prm_sel = NULL; return; } - prm->q.category = RTW_WLAN_CATEGORY_RADIO_MEAS; + prm->q.category = WLAN_CATEGORY_RADIO_MEASUREMENT; prm->q.e_id = _MEAS_REQ_IE_; /* 38 */ if (prm->q.action_code == RM_ACT_RADIO_MEAS_REQ) diff --git a/core/rtw_rm_fsm.c b/core/rtw_rm_fsm.c index 190b770..19fef5f 100644 --- a/core/rtw_rm_fsm.c +++ b/core/rtw_rm_fsm.c @@ -519,7 +519,7 @@ static int rm_state_idle(struct rm_obj *prm, enum RM_EV_ID evid) u32 val32; - prm->p.category = RTW_WLAN_CATEGORY_RADIO_MEAS; + prm->p.category = WLAN_CATEGORY_RADIO_MEASUREMENT; switch (evid) { case RM_EV_state_in: diff --git a/core/rtw_tdls.c b/core/rtw_tdls.c index 809c9de..bd91838 100644 --- a/core/rtw_tdls.c +++ b/core/rtw_tdls.c @@ -1247,7 +1247,7 @@ int issue_tdls_setup_req(_adapter *padapter, struct tdls_txmgmt *ptxmgmt, int wa ptdlsinfo->sta_cnt++; } - ptxmgmt->action_code = TDLS_SETUP_REQUEST; + ptxmgmt->action_code = WLAN_TDLS_SETUP_REQUEST; pattrib = &pmgntframe->attrib; pmgntframe->frame_tag = DATA_FRAMETAG; @@ -1302,7 +1302,7 @@ int _issue_tdls_teardown(_adapter *padapter, struct tdls_txmgmt *ptxmgmt, struct RTW_INFO("[TDLS] %s\n", __FUNCTION__); - ptxmgmt->action_code = TDLS_TEARDOWN; + ptxmgmt->action_code = WLAN_TDLS_TEARDOWN; pmgntframe = alloc_mgtxmitframe(pxmitpriv); if (pmgntframe == NULL) @@ -1388,7 +1388,7 @@ int issue_tdls_dis_req(_adapter *padapter, struct tdls_txmgmt *ptxmgmt) RTW_INFO("[TDLS] %s\n", __FUNCTION__); - ptxmgmt->action_code = TDLS_DISCOVERY_REQUEST; + ptxmgmt->action_code = WLAN_TDLS_DISCOVERY_REQUEST; pmgntframe = alloc_mgtxmitframe(pxmitpriv); if (pmgntframe == NULL) goto exit; @@ -1427,7 +1427,7 @@ int issue_tdls_setup_rsp(_adapter *padapter, struct tdls_txmgmt *ptxmgmt) RTW_INFO("[TDLS] %s\n", __FUNCTION__); - ptxmgmt->action_code = TDLS_SETUP_RESPONSE; + ptxmgmt->action_code = WLAN_TDLS_SETUP_RESPONSE; pmgntframe = alloc_mgtxmitframe(pxmitpriv); if (pmgntframe == NULL) goto exit; @@ -1468,7 +1468,7 @@ int issue_tdls_setup_cfm(_adapter *padapter, struct tdls_txmgmt *ptxmgmt) RTW_INFO("[TDLS] %s\n", __FUNCTION__); - ptxmgmt->action_code = TDLS_SETUP_CONFIRM; + ptxmgmt->action_code = WLAN_TDLS_SETUP_CONFIRM; pmgntframe = alloc_mgtxmitframe(pxmitpriv); if (pmgntframe == NULL) goto exit; @@ -1565,7 +1565,7 @@ int issue_tdls_peer_traffic_rsp(_adapter *padapter, struct sta_info *ptdls_sta, RTW_INFO("[TDLS] %s\n", __FUNCTION__); - ptxmgmt->action_code = TDLS_PEER_TRAFFIC_RESPONSE; + ptxmgmt->action_code = WLAN_TDLS_PEER_TRAFFIC_RESPONSE; pmgntframe = alloc_mgtxmitframe(pxmitpriv); if (pmgntframe == NULL) @@ -1610,7 +1610,7 @@ int issue_tdls_peer_traffic_indication(_adapter *padapter, struct sta_info *ptdl RTW_INFO("[TDLS] %s\n", __FUNCTION__); memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); - txmgmt.action_code = TDLS_PEER_TRAFFIC_INDICATION; + txmgmt.action_code = WLAN_TDLS_PEER_TRAFFIC_INDICATION; pmgntframe = alloc_mgtxmitframe(pxmitpriv); if (pmgntframe == NULL) @@ -1663,7 +1663,7 @@ int issue_tdls_ch_switch_req(_adapter *padapter, struct sta_info *ptdls_sta) } memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); - txmgmt.action_code = TDLS_CHANNEL_SWITCH_REQUEST; + txmgmt.action_code = WLAN_TDLS_CHANNEL_SWITCH_REQUEST; pmgntframe = alloc_mgtxmitframe(pxmitpriv); if (pmgntframe == NULL) @@ -1709,7 +1709,7 @@ int issue_tdls_ch_switch_rsp(_adapter *padapter, struct tdls_txmgmt *ptxmgmt, in goto exit; } - ptxmgmt->action_code = TDLS_CHANNEL_SWITCH_RESPONSE; + ptxmgmt->action_code = WLAN_TDLS_CHANNEL_SWITCH_RESPONSE; pmgntframe = alloc_mgtxmitframe(pxmitpriv); if (pmgntframe == NULL) @@ -2356,7 +2356,7 @@ int On_TDLS_Dis_Req(_adapter *padapter, union recv_frame *precv_frame) ptr += prx_pkt_attrib->hdrlen + prx_pkt_attrib->iv_len + LLC_HEADER_SIZE + ETH_TYPE_LEN + PAYLOAD_TYPE_LEN; txmgmt.dialog_token = *(ptr + 2); memcpy(&txmgmt.peer, precv_frame->u.hdr.attrib.src, ETH_ALEN); - txmgmt.action_code = TDLS_DISCOVERY_RESPONSE; + txmgmt.action_code = WLAN_TDLS_DISCOVERY_RESPONSE; parsing_length = ((union recv_frame *)precv_frame)->u.hdr.len - prx_pkt_attrib->hdrlen - prx_pkt_attrib->iv_len @@ -2815,7 +2815,7 @@ void rtw_build_tdls_setup_req_ies(_adapter *padapter, struct xmit_frame *pxmitfr pframe_head = pframe; /* For rtw_tdls_set_ht_cap() */ pframe = rtw_tdls_set_payload_type(pframe, pattrib); - pframe = rtw_tdls_set_category(pframe, pattrib, RTW_WLAN_CATEGORY_TDLS); + pframe = rtw_tdls_set_category(pframe, pattrib, WLAN_CATEGORY_TDLS); pframe = rtw_tdls_set_action(pframe, pattrib, ptxmgmt); pframe = rtw_tdls_set_dialog(pframe, pattrib, ptxmgmt); @@ -2891,7 +2891,7 @@ void rtw_build_tdls_setup_rsp_ies(_adapter *padapter, struct xmit_frame *pxmitfr pframe_head = pframe; pframe = rtw_tdls_set_payload_type(pframe, pattrib); - pframe = rtw_tdls_set_category(pframe, pattrib, RTW_WLAN_CATEGORY_TDLS); + pframe = rtw_tdls_set_category(pframe, pattrib, WLAN_CATEGORY_TDLS); pframe = rtw_tdls_set_action(pframe, pattrib, ptxmgmt); pframe = rtw_tdls_set_status_code(pframe, pattrib, ptxmgmt); @@ -2980,7 +2980,7 @@ void rtw_build_tdls_setup_cfm_ies(_adapter *padapter, struct xmit_frame *pxmitfr u8 *pftie = NULL, *ptimeout_ie = NULL, *plinkid_ie = NULL, *prsnie = NULL, *pftie_mic = NULL; pframe = rtw_tdls_set_payload_type(pframe, pattrib); - pframe = rtw_tdls_set_category(pframe, pattrib, RTW_WLAN_CATEGORY_TDLS); + pframe = rtw_tdls_set_category(pframe, pattrib, WLAN_CATEGORY_TDLS); pframe = rtw_tdls_set_action(pframe, pattrib, ptxmgmt); pframe = rtw_tdls_set_status_code(pframe, pattrib, ptxmgmt); pframe = rtw_tdls_set_dialog(pframe, pattrib, ptxmgmt); @@ -3042,7 +3042,7 @@ void rtw_build_tdls_teardown_ies(_adapter *padapter, struct xmit_frame *pxmitfra u8 *pftie = NULL, *pftie_mic = NULL, *plinkid_ie = NULL; pframe = rtw_tdls_set_payload_type(pframe, pattrib); - pframe = rtw_tdls_set_category(pframe, pattrib, RTW_WLAN_CATEGORY_TDLS); + pframe = rtw_tdls_set_category(pframe, pattrib, WLAN_CATEGORY_TDLS); pframe = rtw_tdls_set_action(pframe, pattrib, ptxmgmt); pframe = rtw_tdls_set_status_code(pframe, pattrib, ptxmgmt); @@ -3071,7 +3071,7 @@ void rtw_build_tdls_dis_req_ies(_adapter *padapter, struct xmit_frame *pxmitfram struct pkt_attrib *pattrib = &pxmitframe->attrib; pframe = rtw_tdls_set_payload_type(pframe, pattrib); - pframe = rtw_tdls_set_category(pframe, pattrib, RTW_WLAN_CATEGORY_TDLS); + pframe = rtw_tdls_set_category(pframe, pattrib, WLAN_CATEGORY_TDLS); pframe = rtw_tdls_set_action(pframe, pattrib, ptxmgmt); pframe = rtw_tdls_set_dialog(pframe, pattrib, ptxmgmt); pframe = rtw_tdls_set_linkid(padapter, pframe, pattrib, _TRUE); @@ -3088,7 +3088,7 @@ void rtw_build_tdls_dis_rsp_ies(_adapter *padapter, struct xmit_frame *pxmitfram pktlen_index = pattrib->pktlen; pframe_head = pframe; - pframe = rtw_tdls_set_category(pframe, pattrib, RTW_WLAN_CATEGORY_PUBLIC); + pframe = rtw_tdls_set_category(pframe, pattrib, WLAN_CATEGORY_PUBLIC); pframe = rtw_tdls_set_action(pframe, pattrib, ptxmgmt); pframe = rtw_tdls_set_dialog(pframe, pattrib, ptxmgmt); pframe = rtw_tdls_set_capability(padapter, pframe, pattrib); @@ -3125,7 +3125,7 @@ void rtw_build_tdls_peer_traffic_indication_ies(_adapter *padapter, struct xmit_ u8 AC_queue = 0; pframe = rtw_tdls_set_payload_type(pframe, pattrib); - pframe = rtw_tdls_set_category(pframe, pattrib, RTW_WLAN_CATEGORY_TDLS); + pframe = rtw_tdls_set_category(pframe, pattrib, WLAN_CATEGORY_TDLS); pframe = rtw_tdls_set_action(pframe, pattrib, ptxmgmt); pframe = rtw_tdls_set_dialog(pframe, pattrib, ptxmgmt); @@ -3154,7 +3154,7 @@ void rtw_build_tdls_peer_traffic_rsp_ies(_adapter *padapter, struct xmit_frame * struct pkt_attrib *pattrib = &pxmitframe->attrib; pframe = rtw_tdls_set_payload_type(pframe, pattrib); - pframe = rtw_tdls_set_category(pframe, pattrib, RTW_WLAN_CATEGORY_TDLS); + pframe = rtw_tdls_set_category(pframe, pattrib, WLAN_CATEGORY_TDLS); pframe = rtw_tdls_set_action(pframe, pattrib, ptxmgmt); pframe = rtw_tdls_set_dialog(pframe, pattrib, ptxmgmt); @@ -3176,7 +3176,7 @@ void rtw_build_tdls_ch_switch_req_ies(_adapter *padapter, struct xmit_frame *pxm ptdls_sta->ch_switch_timeout = switch_timeout; pframe = rtw_tdls_set_payload_type(pframe, pattrib); - pframe = rtw_tdls_set_category(pframe, pattrib, RTW_WLAN_CATEGORY_TDLS); + pframe = rtw_tdls_set_category(pframe, pattrib, WLAN_CATEGORY_TDLS); pframe = rtw_tdls_set_action(pframe, pattrib, ptxmgmt); pframe = rtw_tdls_set_target_ch(padapter, pframe, pattrib); pframe = rtw_tdls_set_reg_class(pframe, pattrib, ptdls_sta); @@ -3208,7 +3208,7 @@ void rtw_build_tdls_ch_switch_rsp_ies(_adapter *padapter, struct xmit_frame *pxm struct sta_priv *pstapriv = &padapter->stapriv; pframe = rtw_tdls_set_payload_type(pframe, pattrib); - pframe = rtw_tdls_set_category(pframe, pattrib, RTW_WLAN_CATEGORY_TDLS); + pframe = rtw_tdls_set_category(pframe, pattrib, WLAN_CATEGORY_TDLS); pframe = rtw_tdls_set_action(pframe, pattrib, ptxmgmt); pframe = rtw_tdls_set_status_code(pframe, pattrib, ptxmgmt); @@ -3230,7 +3230,7 @@ void rtw_build_tunneled_probe_req_ies(_adapter *padapter, struct xmit_frame *pxm struct pkt_attrib *pattrib = &pxmitframe->attrib; struct wifidirect_info *pwdinfo; - u8 category = RTW_WLAN_CATEGORY_P2P; + u8 category = WLAN_CATEGORY_VENDOR_SPECIFIC; u8 WFA_OUI[3] = { 0x50, 0x6f, 0x9a}; u8 probe_req = 4; u8 wfdielen = 0; @@ -3260,7 +3260,7 @@ void rtw_build_tunneled_probe_rsp_ies(_adapter *padapter, struct xmit_frame *pxm struct dvobj_priv *dvobj = adapter_to_dvobj(padapter); struct pkt_attrib *pattrib = &pxmitframe->attrib; struct wifidirect_info *pwdinfo; - u8 category = RTW_WLAN_CATEGORY_P2P; + u8 category = WLAN_CATEGORY_VENDOR_SPECIFIC; u8 WFA_OUI[3] = { 0x50, 0x6f, 0x9a}; u8 probe_rsp = 5; u8 wfdielen = 0; @@ -3475,30 +3475,30 @@ int rtw_tdls_is_driver_setup(_adapter *padapter) const char *rtw_tdls_action_txt(enum TDLS_ACTION_FIELD action) { switch (action) { - case TDLS_SETUP_REQUEST: - return "TDLS_SETUP_REQUEST"; - case TDLS_SETUP_RESPONSE: - return "TDLS_SETUP_RESPONSE"; - case TDLS_SETUP_CONFIRM: - return "TDLS_SETUP_CONFIRM"; - case TDLS_TEARDOWN: - return "TDLS_TEARDOWN"; - case TDLS_PEER_TRAFFIC_INDICATION: - return "TDLS_PEER_TRAFFIC_INDICATION"; - case TDLS_CHANNEL_SWITCH_REQUEST: - return "TDLS_CHANNEL_SWITCH_REQUEST"; - case TDLS_CHANNEL_SWITCH_RESPONSE: - return "TDLS_CHANNEL_SWITCH_RESPONSE"; - case TDLS_PEER_PSM_REQUEST: - return "TDLS_PEER_PSM_REQUEST"; - case TDLS_PEER_PSM_RESPONSE: - return "TDLS_PEER_PSM_RESPONSE"; - case TDLS_PEER_TRAFFIC_RESPONSE: - return "TDLS_PEER_TRAFFIC_RESPONSE"; - case TDLS_DISCOVERY_REQUEST: - return "TDLS_DISCOVERY_REQUEST"; - case TDLS_DISCOVERY_RESPONSE: - return "TDLS_DISCOVERY_RESPONSE"; + case WLAN_TDLS_SETUP_REQUEST: + return "WLAN_TDLS_SETUP_REQUEST"; + case WLAN_TDLS_SETUP_RESPONSE: + return "WLAN_TDLS_SETUP_RESPONSE"; + case WLAN_TDLS_SETUP_CONFIRM: + return "WLAN_TDLS_SETUP_CONFIRM"; + case WLAN_TDLS_TEARDOWN: + return "WLAN_TDLS_TEARDOWN"; + case WLAN_TDLS_PEER_TRAFFIC_INDICATION: + return "WLAN_TDLS_PEER_TRAFFIC_INDICATION"; + case WLAN_TDLS_CHANNEL_SWITCH_REQUEST: + return "WLAN_TDLS_CHANNEL_SWITCH_REQUEST"; + case WLAN_TDLS_CHANNEL_SWITCH_RESPONSE: + return "WLAN_TDLS_CHANNEL_SWITCH_RESPONSE"; + case WLAN_TDLS_PEER_PSM_REQUEST: + return "WLAN_TDLS_PEER_PSM_REQUEST"; + case WLAN_TDLS_PEER_PSM_RESPONSE: + return "WLAN_TDLS_PEER_PSM_RESPONSE"; + case WLAN_TDLS_PEER_TRAFFIC_RESPONSE: + return "WLAN_TDLS_PEER_TRAFFIC_RESPONSE"; + case WLAN_TDLS_DISCOVERY_REQUEST: + return "WLAN_TDLS_DISCOVERY_REQUEST"; + case WLAN_TDLS_DISCOVERY_RESPONSE: + return "WLAN_TDLS_DISCOVERY_RESPONSE"; default: return "UNKNOWN"; } diff --git a/core/rtw_xmit.c b/core/rtw_xmit.c index c547dcf..a779541 100644 --- a/core/rtw_xmit.c +++ b/core/rtw_xmit.c @@ -1996,7 +1996,7 @@ int rtw_build_tdls_ies(_adapter *padapter, struct xmit_frame *pxmitframe, u8 *pf ptdls_sta = rtw_get_stainfo((&padapter->stapriv), pattrib->dst); if (ptdls_sta == NULL) { switch (ptxmgmt->action_code) { - case TDLS_DISCOVERY_REQUEST: + case WLAN_TDLS_DISCOVERY_REQUEST: case TUNNELED_PROBE_REQ: case TUNNELED_PROBE_RSP: break; @@ -2008,33 +2008,33 @@ int rtw_build_tdls_ies(_adapter *padapter, struct xmit_frame *pxmitframe, u8 *pf } switch (ptxmgmt->action_code) { - case TDLS_SETUP_REQUEST: + case WLAN_TDLS_SETUP_REQUEST: rtw_build_tdls_setup_req_ies(padapter, pxmitframe, pframe, ptxmgmt, ptdls_sta); break; - case TDLS_SETUP_RESPONSE: + case WLAN_TDLS_SETUP_RESPONSE: rtw_build_tdls_setup_rsp_ies(padapter, pxmitframe, pframe, ptxmgmt, ptdls_sta); break; - case TDLS_SETUP_CONFIRM: + case WLAN_TDLS_SETUP_CONFIRM: rtw_build_tdls_setup_cfm_ies(padapter, pxmitframe, pframe, ptxmgmt, ptdls_sta); break; - case TDLS_TEARDOWN: + case WLAN_TDLS_TEARDOWN: rtw_build_tdls_teardown_ies(padapter, pxmitframe, pframe, ptxmgmt, ptdls_sta); break; - case TDLS_DISCOVERY_REQUEST: + case WLAN_TDLS_DISCOVERY_REQUEST: rtw_build_tdls_dis_req_ies(padapter, pxmitframe, pframe, ptxmgmt); break; - case TDLS_PEER_TRAFFIC_INDICATION: + case WLAN_TDLS_PEER_TRAFFIC_INDICATION: rtw_build_tdls_peer_traffic_indication_ies(padapter, pxmitframe, pframe, ptxmgmt, ptdls_sta); break; #ifdef CONFIG_TDLS_CH_SW - case TDLS_CHANNEL_SWITCH_REQUEST: + case WLAN_TDLS_CHANNEL_SWITCH_REQUEST: rtw_build_tdls_ch_switch_req_ies(padapter, pxmitframe, pframe, ptxmgmt, ptdls_sta); break; - case TDLS_CHANNEL_SWITCH_RESPONSE: + case WLAN_TDLS_CHANNEL_SWITCH_RESPONSE: rtw_build_tdls_ch_switch_rsp_ies(padapter, pxmitframe, pframe, ptxmgmt, ptdls_sta); break; #endif - case TDLS_PEER_TRAFFIC_RESPONSE: + case WLAN_TDLS_PEER_TRAFFIC_RESPONSE: rtw_build_tdls_peer_traffic_rsp_ies(padapter, pxmitframe, pframe, ptxmgmt, ptdls_sta); break; #ifdef CONFIG_WFD @@ -2073,29 +2073,29 @@ s32 rtw_make_tdls_wlanhdr(_adapter *padapter , u8 *hdr, struct pkt_attrib *pattr set_frame_sub_type(fctrl, pattrib->subtype); switch (ptxmgmt->action_code) { - case TDLS_SETUP_REQUEST: - case TDLS_SETUP_RESPONSE: - case TDLS_SETUP_CONFIRM: - case TDLS_PEER_TRAFFIC_INDICATION: - case TDLS_PEER_PSM_REQUEST: + case WLAN_TDLS_SETUP_REQUEST: + case WLAN_TDLS_SETUP_RESPONSE: + case WLAN_TDLS_SETUP_CONFIRM: + case WLAN_TDLS_PEER_TRAFFIC_INDICATION: + case WLAN_TDLS_PEER_PSM_REQUEST: case TUNNELED_PROBE_REQ: case TUNNELED_PROBE_RSP: - case TDLS_DISCOVERY_REQUEST: + case WLAN_TDLS_DISCOVERY_REQUEST: SetToDs(fctrl); memcpy(pwlanhdr->addr1, get_bssid(pmlmepriv), ETH_ALEN); memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN); memcpy(pwlanhdr->addr3, pattrib->dst, ETH_ALEN); break; - case TDLS_CHANNEL_SWITCH_REQUEST: - case TDLS_CHANNEL_SWITCH_RESPONSE: - case TDLS_PEER_PSM_RESPONSE: - case TDLS_PEER_TRAFFIC_RESPONSE: + case WLAN_TDLS_CHANNEL_SWITCH_REQUEST: + case WLAN_TDLS_CHANNEL_SWITCH_RESPONSE: + case WLAN_TDLS_PEER_PSM_RESPONSE: + case WLAN_TDLS_PEER_TRAFFIC_RESPONSE: memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN); memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN); memcpy(pwlanhdr->addr3, get_bssid(pmlmepriv), ETH_ALEN); tdls_seq = 1; break; - case TDLS_TEARDOWN: + case WLAN_TDLS_TEARDOWN: if (ptxmgmt->status_code == _RSON_TDLS_TEAR_UN_RSN_) { memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN); memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN); @@ -2113,7 +2113,7 @@ s32 rtw_make_tdls_wlanhdr(_adapter *padapter , u8 *hdr, struct pkt_attrib *pattr if (pattrib->encrypt) SetPrivacy(fctrl); - if (ptxmgmt->action_code == TDLS_PEER_TRAFFIC_RESPONSE) + if (ptxmgmt->action_code == WLAN_TDLS_PEER_TRAFFIC_RESPONSE) SetPwrMgt(fctrl); if (pqospriv->qos_option) { @@ -4418,7 +4418,7 @@ s32 rtw_monitor_xmit_entry(struct sk_buff *skb, struct net_device *ndev) /* Check DATA/MGNT frames */ pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; frame_ctl = le16_to_cpu(pwlanhdr->frame_ctl); - if ((frame_ctl & RTW_IEEE80211_FCTL_FTYPE) == RTW_IEEE80211_FTYPE_DATA) { + if ((frame_ctl & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA) { pattrib = &pmgntframe->attrib; update_monitor_frame_attrib(padapter, pattrib); diff --git a/hal/hal_com.c b/hal/hal_com.c index ca7ad38..4f04c9b 100644 --- a/hal/hal_com.c +++ b/hal/hal_com.c @@ -6550,7 +6550,7 @@ static void rtw_hal_construct_P2PProbeRsp(_adapter *padapter, u8 *pframe, u32 *p static void rtw_hal_construct_P2PNegoRsp(_adapter *padapter, u8 *pframe, u32 *pLength) { struct p2p_channels *ch_list = &(adapter_to_rfctl(padapter)->channel_list); - unsigned char category = RTW_WLAN_CATEGORY_PUBLIC; + unsigned char category = WLAN_CATEGORY_PUBLIC; u8 action = P2P_PUB_ACTION_ACTION; u32 p2poui = cpu_to_be32(P2POUI); u8 oui_subtype = P2P_GO_NEGO_RESP; @@ -6953,7 +6953,7 @@ static void rtw_hal_construct_P2PNegoRsp(_adapter *padapter, u8 *pframe, u32 *pL static void rtw_hal_construct_P2PInviteRsp(_adapter *padapter, u8 *pframe, u32 *pLength) { - unsigned char category = RTW_WLAN_CATEGORY_PUBLIC; + unsigned char category = WLAN_CATEGORY_PUBLIC; u8 action = P2P_PUB_ACTION_ACTION; u32 p2poui = cpu_to_be32(P2POUI); u8 oui_subtype = P2P_INVIT_RESP; @@ -7200,7 +7200,7 @@ static void rtw_hal_construct_P2PInviteRsp(_adapter *padapter, u8 *pframe, u32 * static void rtw_hal_construct_P2PProvisionDisRsp(_adapter *padapter, u8 *pframe, u32 *pLength) { - unsigned char category = RTW_WLAN_CATEGORY_PUBLIC; + unsigned char category = WLAN_CATEGORY_PUBLIC; u8 action = P2P_PUB_ACTION_ACTION; u8 dialogToken = 0; u32 p2poui = cpu_to_be32(P2POUI); diff --git a/hal/rtl8192e/usb/rtl8192eu_xmit.c b/hal/rtl8192e/usb/rtl8192eu_xmit.c index 8f43e60..e94556d 100644 --- a/hal/rtl8192e/usb/rtl8192eu_xmit.c +++ b/hal/rtl8192e/usb/rtl8192eu_xmit.c @@ -939,7 +939,7 @@ s32 rtl8192eu_hostap_mgnt_xmit_entry(_adapter *padapter, _pkt *pkt) fc = le16_to_cpu(tx_hdr->frame_ctl); bmcst = is_multicast_ether_addr(tx_hdr->addr1); - if ((fc & RTW_IEEE80211_FCTL_FTYPE) != RTW_IEEE80211_FTYPE_MGMT) + if ((fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_MGMT) goto _exit; pxmit_skb = rtw_skb_alloc(len + TXDESC_SIZE); diff --git a/hal/rtl8192e/usb/usb_ops_linux.c b/hal/rtl8192e/usb/usb_ops_linux.c index a70639a..60826fd 100644 --- a/hal/rtl8192e/usb/usb_ops_linux.c +++ b/hal/rtl8192e/usb/usb_ops_linux.c @@ -179,7 +179,7 @@ int recvbuf2recvframe(PADAPTER padapter, void *ptr) #ifdef CONFIG_RX_PACKET_APPEND_FCS if (check_fwstate(&padapter->mlmepriv, WIFI_MONITOR_STATE) == _FALSE) if ((pattrib->pkt_rpt_type == NORMAL_RX) && rtw_hal_rcr_check(padapter, RCR_APPFCS)) - pattrib->pkt_len -= IEEE80211_FCS_LEN; + pattrib->pkt_len -= FCS_LEN; #endif if (rtw_os_alloc_recvframe(padapter, precvframe, diff --git a/include/ieee80211.h b/include/ieee80211.h index c7fbc09..1b05a20 100644 --- a/include/ieee80211.h +++ b/include/ieee80211.h @@ -397,15 +397,6 @@ struct sta_data { /* this is stolen from ipw2200 driver */ #define IEEE_IBSS_MAC_HASH_SIZE 31 -struct ieee_ibss_seq { - u8 mac[ETH_ALEN]; - u16 seq_num; - u16 frag_num; - unsigned long packet_time; - _list list; -}; - - struct rtw_ieee80211_hdr { u16 frame_ctl; u16 duration_id; @@ -488,78 +479,10 @@ enum eap_type { #define IEEE80211_3ADDR_LEN 24 #define IEEE80211_4ADDR_LEN 30 -#define IEEE80211_FCS_LEN 4 #define MIN_FRAG_THRESHOLD 256U #define MAX_FRAG_THRESHOLD 2346U -/* Frame control field constants */ -#define RTW_IEEE80211_FCTL_VERS 0x0003 -#define RTW_IEEE80211_FCTL_FTYPE 0x000c -#define RTW_IEEE80211_FCTL_STYPE 0x00f0 -#define RTW_IEEE80211_FCTL_TODS 0x0100 -#define RTW_IEEE80211_FCTL_FROMDS 0x0200 -#define RTW_IEEE80211_FCTL_MOREFRAGS 0x0400 -#define RTW_IEEE80211_FCTL_RETRY 0x0800 -#define RTW_IEEE80211_FCTL_PM 0x1000 -#define RTW_IEEE80211_FCTL_MOREDATA 0x2000 -#define RTW_IEEE80211_FCTL_PROTECTED 0x4000 -#define RTW_IEEE80211_FCTL_ORDER 0x8000 -#define RTW_IEEE80211_FCTL_CTL_EXT 0x0f00 - -#define RTW_IEEE80211_FTYPE_MGMT 0x0000 -#define RTW_IEEE80211_FTYPE_CTL 0x0004 -#define RTW_IEEE80211_FTYPE_DATA 0x0008 -#define RTW_IEEE80211_FTYPE_EXT 0x000c - -/* management */ -#define RTW_IEEE80211_STYPE_ASSOC_REQ 0x0000 -#define RTW_IEEE80211_STYPE_ASSOC_RESP 0x0010 -#define RTW_IEEE80211_STYPE_REASSOC_REQ 0x0020 -#define RTW_IEEE80211_STYPE_REASSOC_RESP 0x0030 -#define RTW_IEEE80211_STYPE_PROBE_REQ 0x0040 -#define RTW_IEEE80211_STYPE_PROBE_RESP 0x0050 -#define RTW_IEEE80211_STYPE_BEACON 0x0080 -#define RTW_IEEE80211_STYPE_ATIM 0x0090 -#define RTW_IEEE80211_STYPE_DISASSOC 0x00A0 -#define RTW_IEEE80211_STYPE_AUTH 0x00B0 -#define RTW_IEEE80211_STYPE_DEAUTH 0x00C0 -#define RTW_IEEE80211_STYPE_ACTION 0x00D0 - -/* control */ -#define RTW_IEEE80211_STYPE_CTL_EXT 0x0060 -#define RTW_IEEE80211_STYPE_BACK_REQ 0x0080 -#define RTW_IEEE80211_STYPE_BACK 0x0090 -#define RTW_IEEE80211_STYPE_PSPOLL 0x00A0 -#define RTW_IEEE80211_STYPE_RTS 0x00B0 -#define RTW_IEEE80211_STYPE_CTS 0x00C0 -#define RTW_IEEE80211_STYPE_ACK 0x00D0 -#define RTW_IEEE80211_STYPE_CFEND 0x00E0 -#define RTW_IEEE80211_STYPE_CFENDACK 0x00F0 - -/* data */ -#define RTW_IEEE80211_STYPE_DATA 0x0000 -#define RTW_IEEE80211_STYPE_DATA_CFACK 0x0010 -#define RTW_IEEE80211_STYPE_DATA_CFPOLL 0x0020 -#define RTW_IEEE80211_STYPE_DATA_CFACKPOLL 0x0030 -#define RTW_IEEE80211_STYPE_NULLFUNC 0x0040 -#define RTW_IEEE80211_STYPE_CFACK 0x0050 -#define RTW_IEEE80211_STYPE_CFPOLL 0x0060 -#define RTW_IEEE80211_STYPE_CFACKPOLL 0x0070 -#define RTW_IEEE80211_STYPE_QOS_DATA 0x0080 -#define RTW_IEEE80211_STYPE_QOS_DATA_CFACK 0x0090 -#define RTW_IEEE80211_STYPE_QOS_DATA_CFPOLL 0x00A0 -#define RTW_IEEE80211_STYPE_QOS_DATA_CFACKPOLL 0x00B0 -#define RTW_IEEE80211_STYPE_QOS_NULLFUNC 0x00C0 -#define RTW_IEEE80211_STYPE_QOS_CFACK 0x00D0 -#define RTW_IEEE80211_STYPE_QOS_CFPOLL 0x00E0 -#define RTW_IEEE80211_STYPE_QOS_CFACKPOLL 0x00F0 - -/* sequence control field */ -#define RTW_IEEE80211_SCTL_FRAG 0x000F -#define RTW_IEEE80211_SCTL_SEQ 0xFFF0 - - #define RTW_ERP_INFO_NON_ERP_PRESENT BIT(0) #define RTW_ERP_INFO_USE_PROTECTION BIT(1) #define RTW_ERP_INFO_BARKER_PREAMBLE_MODE BIT(2) @@ -598,13 +521,13 @@ struct ieee80211_snap_hdr { #define SNAP_SIZE sizeof(struct ieee80211_snap_hdr) -#define WLAN_FC_GET_TYPE(fc) ((fc) & RTW_IEEE80211_FCTL_FTYPE) -#define WLAN_FC_GET_STYPE(fc) ((fc) & RTW_IEEE80211_FCTL_STYPE) +#define WLAN_FC_GET_TYPE(fc) ((fc) & IEEE80211_FCTL_FTYPE) +#define WLAN_FC_GET_STYPE(fc) ((fc) & IEEE80211_FCTL_STYPE) #define WLAN_QC_GET_TID(qc) ((qc) & 0x0f) -#define WLAN_GET_SEQ_FRAG(seq) ((seq) & RTW_IEEE80211_SCTL_FRAG) -#define WLAN_GET_SEQ_SEQ(seq) ((seq) & RTW_IEEE80211_SCTL_SEQ) +#define WLAN_GET_SEQ_FRAG(seq) ((seq) & IEEE80211_SCTL_FRAG) +#define WLAN_GET_SEQ_SEQ(seq) ((seq) & IEEE80211_SCTL_SEQ) #define WLAN_REASON_SA_QUERY_TIMEOUT 65532 #define WLAN_REASON_ACTIVE_ROAM 65533 @@ -945,83 +868,12 @@ extern struct rate_section_ent rates_by_sections[]; #define rate_section_to_tx_num(section) (rates_by_sections[(section)].tx_num) #define rate_section_rate_num(section) (rates_by_sections[(section)].rate_num) -/* NOTE: This data is for statistical purposes; not all hardware provides this - * information for frames received. Not setting these will not cause - * any adverse affects. */ -struct ieee80211_rx_stats { - /* u32 mac_time[2]; */ - s8 rssi; - u8 signal; - u8 noise; - u8 received_channel; - u16 rate; /* in 100 kbps */ - /* u8 control; */ - u8 mask; - u8 freq; - u16 len; -}; - /* IEEE 802.11 requires that STA supports concurrent reception of at least * three fragmented frames. This define can be increased to support more * concurrent frames, but it should be noted that each entry can consume about * 2 kB of RAM and increasing cache size will slow down frame reassembly. */ #define IEEE80211_FRAG_CACHE_LEN 4 -struct ieee80211_frag_entry { - u32 first_frag_time; - uint seq; - uint last_frag; - uint qos; /* jackson */ - uint tid; /* jackson */ - struct sk_buff *skb; - u8 src_addr[ETH_ALEN]; - u8 dst_addr[ETH_ALEN]; -}; - -struct ieee80211_stats { - uint tx_unicast_frames; - uint tx_multicast_frames; - uint tx_fragments; - uint tx_unicast_octets; - uint tx_multicast_octets; - uint tx_deferred_transmissions; - uint tx_single_retry_frames; - uint tx_multiple_retry_frames; - uint tx_retry_limit_exceeded; - uint tx_discards; - uint rx_unicast_frames; - uint rx_multicast_frames; - uint rx_fragments; - uint rx_unicast_octets; - uint rx_multicast_octets; - uint rx_fcs_errors; - uint rx_discards_no_buffer; - uint tx_discards_wrong_sa; - uint rx_discards_undecryptable; - uint rx_message_in_msg_fragments; - uint rx_message_in_bad_msg_fragments; -}; - -struct ieee80211_softmac_stats { - uint rx_ass_ok; - uint rx_ass_err; - uint rx_probe_rq; - uint tx_probe_rs; - uint tx_beacons; - uint rx_auth_rq; - uint rx_auth_rs_ok; - uint rx_auth_rs_err; - uint tx_auth_rq; - uint no_auth_rs; - uint no_ass_rs; - uint tx_ass_rq; - uint rx_ass_rq; - uint tx_probe_rq; - uint reassoc; - uint swtxstop; - uint swtxawake; -}; - #define SEC_KEY_1 (1<<0) #define SEC_KEY_2 (1<<1) #define SEC_KEY_3 (1<<2) @@ -1043,46 +895,6 @@ struct ieee80211_softmac_stats { #define BIP_MAX_KEYID 5 #define BIP_AAD_SIZE 20 -#if defined(PLATFORM_LINUX) || defined(CONFIG_RTL8711FW) - -struct ieee80211_security { - u16 active_key:2, - enabled:1, - auth_mode:2, - auth_algo:4, - unicast_uses_group:1; - u8 key_sizes[WEP_KEYS]; - u8 keys[WEP_KEYS][WEP_KEY_LEN]; - u8 level; - u16 flags; -} __attribute__((packed)); - -#endif - -/* - - 802.11 data frame from AP - - ,-------------------------------------------------------------------. -Bytes | 2 | 2 | 6 | 6 | 6 | 2 | 0..2312 | 4 | - |------|------|---------|---------|---------|------|---------|------| -Desc. | ctrl | dura | DA/RA | TA | SA | Sequ | frame | fcs | - | | tion | (BSSID) | | | ence | data | | - `-------------------------------------------------------------------' - -Total: 28-2340 bytes - -*/ - -struct ieee80211_header_data { - u16 frame_ctl; - u16 duration_id; - u8 addr1[6]; - u8 addr2[6]; - u8 addr3[6]; - u16 seq_ctrl; -}; - #define BEACON_PROBE_SSID_ID_POSITION 12 /* Management Frame Information Element Types */ @@ -1101,11 +913,6 @@ struct ieee80211_header_data { #if defined(PLATFORM_LINUX) || defined(CONFIG_RTL8711FW) -struct ieee80211_info_element_hdr { - u8 id; - u8 len; -} __attribute__((packed)); - struct ieee80211_info_element { u8 id; u8 len; @@ -1133,49 +940,6 @@ struct ieee80211_info_element { #define IEEE80211_DEFAULT_TX_ESSID "Penguin" #define IEEE80211_DEFAULT_BASIC_RATE 10 - -#if defined(PLATFORM_LINUX) || defined(CONFIG_RTL8711FW) - - -struct ieee80211_authentication { - struct ieee80211_header_data header; - u16 algorithm; - u16 transaction; - u16 status; - /* struct ieee80211_info_element_hdr info_element; */ -} __attribute__((packed)); - - -struct ieee80211_probe_response { - struct ieee80211_header_data header; - u32 time_stamp[2]; - u16 beacon_interval; - u16 capability; - struct ieee80211_info_element info_element; -} __attribute__((packed)); - -struct ieee80211_probe_request { - struct ieee80211_header_data header; - /*struct ieee80211_info_element info_element;*/ -} __attribute__((packed)); - -struct ieee80211_assoc_request_frame { - struct rtw_ieee80211_hdr_3addr header; - u16 capability; - u16 listen_interval; - /* u8 current_ap[ETH_ALEN]; */ - struct ieee80211_info_element_hdr info_element; -} __attribute__((packed)); - -struct ieee80211_assoc_response_frame { - struct rtw_ieee80211_hdr_3addr header; - u16 capability; - u16 status; - u16 aid; - /* struct ieee80211_info_element info_element; supported rates */ -} __attribute__((packed)); -#endif - struct ieee80211_txb { u8 nr_frags; u8 encrypted; @@ -1220,49 +984,6 @@ struct ieee80211_txb { #define IEEE80211_PS_UNICAST IEEE80211_DTIM_UCAST #define IEEE80211_PS_MBCAST IEEE80211_DTIM_MBCAST #define IW_ESSID_MAX_SIZE 32 -#if 0 -struct ieee80211_network { - /* These entries are used to identify a unique network */ - u8 bssid[ETH_ALEN]; - u8 channel; - /* Ensure null-terminated for any debug msgs */ - u8 ssid[IW_ESSID_MAX_SIZE + 1]; - u8 ssid_len; - u8 rssi; /* relative signal strength */ - u8 sq; /* signal quality */ - - /* These are network statistics */ - /* struct ieee80211_rx_stats stats; */ - u16 capability; - u16 aid; - u8 rates[MAX_RATES_LENGTH]; - u8 rates_len; - u8 rates_ex[MAX_RATES_EX_LENGTH]; - u8 rates_ex_len; - - u8 edca_parmsets[18]; - - u8 mode; - u8 flags; - u8 time_stamp[8]; - u16 beacon_interval; - u16 listen_interval; - u16 atim_window; - u8 wpa_ie[MAX_WPA_IE_LEN]; - size_t wpa_ie_len; - u8 rsn_ie[MAX_WPA_IE_LEN]; - size_t rsn_ie_len; - u8 country[6]; - u8 dtim_period; - u8 dtim_data; - u8 power_constraint; - u8 qosinfo; - u8 qbssload[5]; - u8 network_type; - int join_res; - unsigned long last_scanned; -}; -#endif /* join_res: -1: authentication fail @@ -1354,55 +1075,16 @@ typedef struct tx_pending_t { #define IEEE_G (1<<2) #define IEEE_MODE_MASK (IEEE_A | IEEE_B | IEEE_G) -/* Baron move to ieee80211.c */ -int ieee80211_is_empty_essid(const char *essid, int essid_len); -int ieee80211_get_hdrlen(u16 fc); - -#if 0 - /* Action frame categories (IEEE 802.11-2007, 7.3.1.11, Table 7-24) */ - #define WLAN_ACTION_SPECTRUM_MGMT 0 - #define WLAN_ACTION_QOS 1 - #define WLAN_ACTION_DLS 2 - #define WLAN_ACTION_BLOCK_ACK 3 - #define WLAN_ACTION_RADIO_MEASUREMENT 5 - #define WLAN_ACTION_FT 6 - #define WLAN_ACTION_SA_QUERY 8 - #define WLAN_ACTION_WMM 17 -#endif - - -/* Action category code */ -enum rtw_ieee80211_category { - RTW_WLAN_CATEGORY_SPECTRUM_MGMT = 0, - RTW_WLAN_CATEGORY_QOS = 1, - RTW_WLAN_CATEGORY_DLS = 2, - RTW_WLAN_CATEGORY_BACK = 3, - RTW_WLAN_CATEGORY_PUBLIC = 4, /* IEEE 802.11 public action frames */ - RTW_WLAN_CATEGORY_RADIO_MEAS = 5, - RTW_WLAN_CATEGORY_FT = 6, - RTW_WLAN_CATEGORY_HT = 7, - RTW_WLAN_CATEGORY_SA_QUERY = 8, - RTW_WLAN_CATEGORY_WNM = 10, - RTW_WLAN_CATEGORY_UNPROTECTED_WNM = 11, /* add for CONFIG_IEEE80211W, none 11w also can use */ - RTW_WLAN_CATEGORY_TDLS = 12, - RTW_WLAN_CATEGORY_MESH = 13, - RTW_WLAN_CATEGORY_MULTIHOP = 14, - RTW_WLAN_CATEGORY_SELF_PROTECTED = 15, - RTW_WLAN_CATEGORY_WMM = 17, - RTW_WLAN_CATEGORY_VHT = 21, - RTW_WLAN_CATEGORY_P2P = 0x7f,/* P2P action frames */ -}; - #define CATEGORY_IS_GROUP_PRIVACY(cat) \ - (cat == RTW_WLAN_CATEGORY_MESH || cat == RTW_WLAN_CATEGORY_MULTIHOP) + (cat == WLAN_CATEGORY_MESH_ACTION || cat == WLAN_CATEGORY_MULTIHOP_ACTION) #define CATEGORY_IS_NON_ROBUST(cat) \ - (cat == RTW_WLAN_CATEGORY_PUBLIC \ - || cat == RTW_WLAN_CATEGORY_HT \ - || cat == RTW_WLAN_CATEGORY_UNPROTECTED_WNM \ - || cat == RTW_WLAN_CATEGORY_SELF_PROTECTED \ - || cat == RTW_WLAN_CATEGORY_VHT \ - || cat == RTW_WLAN_CATEGORY_P2P) + (cat == WLAN_CATEGORY_PUBLIC \ + || cat == WLAN_CATEGORY_HT \ + || cat == WLAN_CATEGORY_WNM_UNPROTECTED \ + || cat == WLAN_CATEGORY_SELF_PROTECTED \ + || cat == WLAN_CATEGORY_VHT \ + || cat == WLAN_CATEGORY_VENDOR_SPECIFIC) #define CATEGORY_IS_ROBUST(cat) !CATEGORY_IS_NON_ROBUST(cat) @@ -1463,51 +1145,12 @@ enum _PUBLIC_ACTION { }; #ifdef CONFIG_TDLS -enum TDLS_ACTION_FIELD { - TDLS_SETUP_REQUEST = 0, - TDLS_SETUP_RESPONSE = 1, - TDLS_SETUP_CONFIRM = 2, - TDLS_TEARDOWN = 3, - TDLS_PEER_TRAFFIC_INDICATION = 4, - TDLS_CHANNEL_SWITCH_REQUEST = 5, - TDLS_CHANNEL_SWITCH_RESPONSE = 6, - TDLS_PEER_PSM_REQUEST = 7, - TDLS_PEER_PSM_RESPONSE = 8, - TDLS_PEER_TRAFFIC_RESPONSE = 9, - TDLS_DISCOVERY_REQUEST = 10, - TDLS_DISCOVERY_RESPONSE = 14, /* it's used in public action frame */ -}; +#define WLAN_TDLS_DISCOVERY_RESPONSE = 14 /* it's used in public action frame */ #define TUNNELED_PROBE_REQ 15 #define TUNNELED_PROBE_RSP 16 #endif /* CONFIG_TDLS */ -/* BACK action code */ -enum rtw_ieee80211_back_actioncode { - RTW_WLAN_ACTION_ADDBA_REQ = 0, - RTW_WLAN_ACTION_ADDBA_RESP = 1, - RTW_WLAN_ACTION_DELBA = 2, -}; - -/* HT features action code */ -enum rtw_ieee80211_ht_actioncode { - RTW_WLAN_ACTION_HT_NOTI_CHNL_WIDTH = 0, - RTW_WLAN_ACTION_HT_SM_PS = 1, - RTW_WLAN_ACTION_HT_PSMP = 2, - RTW_WLAN_ACTION_HT_SET_PCO_PHASE = 3, - RTW_WLAN_ACTION_HT_CSI = 4, - RTW_WLAN_ACTION_HT_NON_COMPRESS_BEAMFORMING = 5, - RTW_WLAN_ACTION_HT_COMPRESS_BEAMFORMING = 6, - RTW_WLAN_ACTION_HT_ASEL_FEEDBACK = 7, -}; - -/* BACK (block-ack) parties */ -enum rtw_ieee80211_back_parties { - RTW_WLAN_BACK_RECIPIENT = 0, - RTW_WLAN_BACK_INITIATOR = 1, - RTW_WLAN_BACK_TIMER = 2, -}; - /*20/40 BSS Coexistence element */ #define RTW_WLAN_20_40_BSS_COEX_INFO_REQ BIT(0) #define RTW_WLAN_20_40_BSS_COEX_40MHZ_INTOL BIT(1) @@ -1515,13 +1158,10 @@ enum rtw_ieee80211_back_parties { #define RTW_WLAN_20_40_BSS_COEX_OBSS_EXEMPT_REQ BIT(3) #define RTW_WLAN_20_40_BSS_COEX_OBSS_EXEMPT_GRNT BIT(4) -/* VHT features action code */ -enum rtw_ieee80211_vht_actioncode { - RTW_WLAN_ACTION_VHT_COMPRESSED_BEAMFORMING = 0, - RTW_WLAN_ACTION_VHT_GROUPID_MANAGEMENT = 1, - RTW_WLAN_ACTION_VHT_OPMODE_NOTIFICATION = 2, -}; - +#ifndef WLAN_CATEGORY_FAST_BBS_TRANSITION +/*Commit 1806239dec0dacde373f0b53f076319f6c6d95cb v5.14-rc1 */ +#define WLAN_CATEGORY_FAST_BBS_TRANSITION 6 +#endif /*IEEE 802.11r action code*/ #ifdef CONFIG_RTW_80211R enum rtw_ieee80211_ft_actioncode { @@ -1566,32 +1206,7 @@ enum rtw_ieee80211_wnm_actioncode { #define VENDOR_HT_CAPAB_OUI_TYPE 0x33 /* 00-90-4c:0x33 */ -enum rtw_ieee80211_rann_flags { - RTW_RANN_FLAG_IS_GATE = 1 << 0, -}; - -/** - * enum rtw_ieee80211_preq_flags - mesh PREQ element flags - * - * @RTW_IEEE80211_PREQ_IS_GATE_FLAG: Gate Announcement subfield - * @RTW_IEEE80211_PREQ_PROACTIVE_PREP_FLAG: proactive PREP subfield - */ -enum rtw_ieee80211_preq_flags { - RTW_IEEE80211_PREQ_IS_GATE_FLAG = 1 << 0, - RTW_IEEE80211_PREQ_PROACTIVE_PREP_FLAG = 1 << 2, -}; - -/** - * enum rtw_ieee80211_preq_target_flags - mesh PREQ element per target flags - * - * @RTW_IEEE80211_PREQ_TO_FLAG: target only subfield - * @RTW_IEEE80211_PREQ_USN_FLAG: unknown target HWMP sequence number subfield - */ -enum rtw_ieee80211_preq_target_flags { - RTW_IEEE80211_PREQ_TO_FLAG = 1<<0, - RTW_IEEE80211_PREQ_USN_FLAG = 1<<2, -}; - +#define IEEE80211_PREQ_IS_GATE_FLAG (1 << 0) /* for kernel 3.14 , both value are changed to IEEE80211_CHAN_NO_IR*/ #define RTW_IEEE80211_CHAN_NO_IBSS (1 << 2) diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index d6fddbf..58d08ce 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -4504,7 +4504,7 @@ static int rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struct net_de dot11_hdr = (struct rtw_ieee80211_hdr *)skb->data; frame_ctl = le16_to_cpu(dot11_hdr->frame_ctl); /* Check if the QoS bit is set */ - if ((frame_ctl & RTW_IEEE80211_FCTL_FTYPE) == RTW_IEEE80211_FTYPE_DATA) { + if ((frame_ctl & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA) { /* Check if this ia a Wireless Distribution System (WDS) frame * which has 4 MAC addresses */ @@ -4531,8 +4531,8 @@ static int rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struct net_de return ret; - } else if ((frame_ctl & (RTW_IEEE80211_FCTL_FTYPE | RTW_IEEE80211_FCTL_STYPE)) - == (RTW_IEEE80211_FTYPE_MGMT | RTW_IEEE80211_STYPE_ACTION) + } else if ((frame_ctl & ( IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) + == (IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ACTION) ) { /* only for action frames */ struct xmit_frame *pmgntframe; @@ -4561,7 +4561,7 @@ static int rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struct net_de if (type >= 0) goto dump; #endif - if (category == RTW_WLAN_CATEGORY_PUBLIC) + if (category == WLAN_CATEGORY_PUBLIC) RTW_INFO("RTW_Tx:%s\n", action_public_str(action)); else RTW_INFO("RTW_Tx:category(%u), action(%u)\n", category, action); @@ -4601,7 +4601,7 @@ dump: dump_mgntframe(padapter, pmgntframe); } else - RTW_INFO("frame_ctl=0x%x\n", frame_ctl & (RTW_IEEE80211_FCTL_FTYPE | RTW_IEEE80211_FCTL_STYPE)); + RTW_INFO("frame_ctl=0x%x\n", frame_ctl & ( IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)); fail: @@ -6203,7 +6203,7 @@ void rtw_cfg80211_rx_action(_adapter *adapter, union recv_frame *rframe, const c } #endif rtw_action_frame_parse(frame, frame_len, &category, &action); - if (category == RTW_WLAN_CATEGORY_PUBLIC) { + if (category == WLAN_CATEGORY_PUBLIC) { if (action == ACT_PUBLIC_GAS_INITIAL_REQ) { rtw_mi_set_scan_deny(adapter, 200); rtw_mi_scan_abort(adapter, _FALSE); /*rtw_scan_abort_no_wait*/ @@ -6286,7 +6286,7 @@ void rtw_cfg80211_issue_p2p_provision_request(_adapter *padapter, const u8 *buf, u16 capability = 0; uint capability_len = 0; - unsigned char category = RTW_WLAN_CATEGORY_PUBLIC; + unsigned char category = WLAN_CATEGORY_PUBLIC; u8 action = P2P_PUB_ACTION_ACTION; u8 dialogToken = 1; u32 p2poui = cpu_to_be32(P2POUI); @@ -7329,7 +7329,7 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy, wait_ack = 0; goto dump; } - else if (frame_styp == RTW_IEEE80211_STYPE_AUTH) { + else if (frame_styp == IEEE80211_STYPE_AUTH) { int retval = 0; RTW_INFO("RTW_Tx:tx_ch=%d, no_cck=%u, da="MAC_FMT"\n", tx_ch, no_cck, MAC_ARG(GetAddr1Ptr(buf))); @@ -7367,7 +7367,7 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy, } } #endif - if (category == RTW_WLAN_CATEGORY_PUBLIC) { + if (category == WLAN_CATEGORY_PUBLIC) { RTW_INFO("RTW_Tx:%s\n", action_public_str(action)); switch (action) { case ACT_PUBLIC_GAS_INITIAL_REQ: @@ -7378,7 +7378,7 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy, } } #ifdef CONFIG_RTW_80211K - else if (category == RTW_WLAN_CATEGORY_RADIO_MEAS) + else if (category == WLAN_CATEGORY_RADIO_MEASUREMENT) RTW_INFO("RTW_Tx: RRM Action\n"); #endif else @@ -7616,22 +7616,22 @@ static int cfg80211_rtw_tdls_mgmt(struct wiphy *wiphy, #endif switch (txmgmt.action_code) { - case TDLS_SETUP_REQUEST: + case WLAN_TDLS_SETUP_REQUEST: issue_tdls_setup_req(padapter, &txmgmt, _TRUE); break; - case TDLS_SETUP_RESPONSE: + case WLAN_TDLS_SETUP_RESPONSE: issue_tdls_setup_rsp(padapter, &txmgmt); break; - case TDLS_SETUP_CONFIRM: + case WLAN_TDLS_SETUP_CONFIRM: issue_tdls_setup_cfm(padapter, &txmgmt); break; - case TDLS_TEARDOWN: + case WLAN_TDLS_TEARDOWN: issue_tdls_teardown(padapter, &txmgmt, _TRUE); break; - case TDLS_DISCOVERY_REQUEST: + case WLAN_TDLS_DISCOVERY_REQUEST: issue_tdls_dis_req(padapter, &txmgmt); break; - case TDLS_DISCOVERY_RESPONSE: + case WLAN_TDLS_DISCOVERY_RESPONSE: issue_tdls_dis_rsp(padapter, &txmgmt, pmlmeinfo->enc_algo ? _TRUE : _FALSE); break; } diff --git a/os_dep/linux/ioctl_linux.c b/os_dep/linux/ioctl_linux.c index 7a4f7d2..398b51c 100644 --- a/os_dep/linux/ioctl_linux.c +++ b/os_dep/linux/ioctl_linux.c @@ -6689,25 +6689,6 @@ static int wpa_set_param(struct net_device *dev, u8 name, u32 value) * be set. */ -#if 0 - struct ieee80211_security sec = { - .flags = SEC_ENABLED, - .enabled = value, - }; - ieee->drop_unencrypted = value; - /* We only change SEC_LEVEL for open mode. Others - * are set by ipw_wpa_set_encryption. - */ - if (!value) { - sec.flags |= SEC_LEVEL; - sec.level = SEC_LEVEL_0; - } else { - sec.flags |= SEC_LEVEL; - sec.level = SEC_LEVEL_1; - } - if (ieee->set_security) - ieee->set_security(ieee->dev, &sec); -#endif break; } @@ -11642,7 +11623,7 @@ static u8 pktcmp(PADAPTER padapter, u8 *txbuf, u32 txsz, u8 *rxbuf, u32 rxsz) phal = GET_HAL_DATA(padapter); if (rtw_hal_rcr_check(padapter, RCR_APPFCS)) - fcssize = IEEE80211_FCS_LEN; + fcssize = FCS_LEN; else fcssize = 0; From 4799326c6f0807beef37db9d02a75cb6547c34c7 Mon Sep 17 00:00:00 2001 From: Carlos Garces Date: Thu, 21 Oct 2021 17:30:03 +0200 Subject: [PATCH 11/20] switch to common ieee80211 headers This patch switches to and and deletes a lot of duplicate definitions plus many unused ones. rtw_ieee80211_hdr_3addr_qos is duplicate of ieee80211_qos_hdr. rtw_ieee80211_spectrum_mgmt_actioncode is a duplication of ieee80211_spectrum_mgmt_actioncode rtw_ieee80211_hdr_3addr is duplicate of ieee80211_hdr_3addr. rtw_ieee80211_hdr is duplicate of ieee80211_hdr rtw_ieee80211s_hdr is duplicate of ieee80211s_hdr rtw_ieee80211_rann_ie is duplicate of ieee80211_rann_ie from include/linux/ieee80211.h. Link: https://lore.kernel.org/r/20200906133236.556427-1-insafonov@gmail.com Link: https://lore.kernel.org/r/20200609194848.166130-1-pterjan@google.com Also port 5cd8396540b5f7ef7c3ac499e967dd4deb8e9930 bbfe286b07d8282f4957dee692e85b3bd60de770 d87f574d6923c546e7d0f75ce0581436376b98a6 36eb7d108e8de3097f373eb8629d8739d4fa3e74 1b9e6df5169b36b3242e2e28c39f9bbfc01863e8 d94971aa97670d400371baef5d9d5cf6dc8ea2b5 --- core/mesh/rtw_mesh.c | 115 +++++------ core/mesh/rtw_mesh.h | 6 +- core/mesh/rtw_mesh_hwmp.c | 46 ++--- core/rtw_ap.c | 4 +- core/rtw_beamforming.c | 56 +++--- core/rtw_ieee80211.c | 30 +-- core/rtw_mlme_ext.c | 321 +++++++++++++++--------------- core/rtw_mp.c | 6 +- core/rtw_mp_ioctl.c | 6 +- core/rtw_p2p.c | 92 ++++----- core/rtw_recv.c | 12 +- core/rtw_rm.c | 24 +-- core/rtw_security.c | 6 +- core/rtw_tdls.c | 20 +- core/rtw_wapi_sms4.c | 4 +- core/rtw_wlan_util.c | 20 +- core/rtw_xmit.c | 26 +-- hal/hal_com.c | 130 ++++++------ hal/phydm/txbf/haltxbfinterface.c | 24 +-- hal/rtl8192e/usb/rtl8192eu_xmit.c | 6 +- include/ieee80211.h | 313 ++++------------------------- os_dep/linux/ioctl_cfg80211.c | 97 +++++---- os_dep/linux/ioctl_linux.c | 6 +- 23 files changed, 547 insertions(+), 823 deletions(-) diff --git a/core/mesh/rtw_mesh.c b/core/mesh/rtw_mesh.c index 7fc10e2..5e0ada3 100644 --- a/core/mesh/rtw_mesh.c +++ b/core/mesh/rtw_mesh.c @@ -1312,7 +1312,7 @@ static int rtw_mpm_tx_ies_sync_bss(_adapter *adapter, struct mesh_plink_ent *pli #endif /* count for new frame length */ - new_len = sizeof(struct rtw_ieee80211_hdr_3addr) + tlv_ies_offset; + new_len = sizeof(struct ieee80211_hdr_3addr) + tlv_ies_offset; left = BSS_EX_TLV_IES_LEN(network); pos = BSS_EX_TLV_IES(network); while (left >= 2) { @@ -1349,10 +1349,10 @@ static int rtw_mpm_tx_ies_sync_bss(_adapter *adapter, struct mesh_plink_ent *pli } /* build new frame */ - memcpy(new_buf, fhead, sizeof(struct rtw_ieee80211_hdr_3addr) + tlv_ies_offset); + memcpy(new_buf, fhead, sizeof(struct ieee80211_hdr_3addr) + tlv_ies_offset); new_fhead = new_buf; new_flen = new_len; - new_fbody = new_fhead + sizeof(struct rtw_ieee80211_hdr_3addr); + new_fbody = new_fhead + sizeof(struct ieee80211_hdr_3addr); fpos = new_fbody + tlv_ies_offset; left = BSS_EX_TLV_IES_LEN(network); @@ -1483,7 +1483,7 @@ static int rtw_mpm_check_frames(_adapter *adapter, u8 action, const u8 **buf, si u8 *fhead = (u8 *)*buf; size_t flen = *len; u8 *peer_addr = tx ? GetAddr1Ptr(fhead) : get_addr2_ptr(fhead); - u8 *frame_body = fhead + sizeof(struct rtw_ieee80211_hdr_3addr); + u8 *frame_body = fhead + sizeof(struct ieee80211_hdr_3addr); struct mpm_frame_info mpm_info; u8 tlv_ies_offset; u8 *mpm_ie = NULL; @@ -1493,11 +1493,11 @@ static int rtw_mpm_check_frames(_adapter *adapter, u8 action, const u8 **buf, si int ret = 0; u8 mpm_log_buf[MPM_LOG_BUF_LEN] = {0}; - if (action == RTW_ACT_SELF_PROTECTED_MESH_OPEN) + if (action == WLAN_SP_MESH_PEERING_OPEN) tlv_ies_offset = 4; - else if (action == RTW_ACT_SELF_PROTECTED_MESH_CONF) + else if (action == WLAN_SP_MESH_PEERING_CONFIRM) tlv_ies_offset = 6; - else if (action == RTW_ACT_SELF_PROTECTED_MESH_CLOSE) + else if (action == WLAN_SP_MESH_PEERING_CLOSE) tlv_ies_offset = 2; else { rtw_warn_on(1); @@ -1505,23 +1505,20 @@ static int rtw_mpm_check_frames(_adapter *adapter, u8 action, const u8 **buf, si } plink = rtw_mesh_plink_get(adapter, peer_addr); - if (!plink && (tx == _TRUE || action == RTW_ACT_SELF_PROTECTED_MESH_CONF)) { - /* warning message if no plink when: 1.TX all MPM or 2.RX CONF */ - RTW_WARN("RTW_%s:%s without plink of "MAC_FMT"\n" - , (tx == _TRUE) ? "Tx" : "Rx", action_self_protected_str(action), MAC_ARG(peer_addr)); + if (!plink && (tx == _TRUE || action == WLAN_SP_MESH_PEERING_CONFIRM)) { goto exit; } memset(&mpm_info, 0, sizeof(struct mpm_frame_info)); - if (action == RTW_ACT_SELF_PROTECTED_MESH_CONF) { + if (action == WLAN_SP_MESH_PEERING_CONFIRM) { mpm_info.aid = (u8 *)frame_body + 4; mpm_info.aid_v = RTW_GET_LE16(mpm_info.aid); } - mpm_ie = rtw_get_ie(fhead + sizeof(struct rtw_ieee80211_hdr_3addr) + tlv_ies_offset + mpm_ie = rtw_get_ie(fhead + sizeof(struct ieee80211_hdr_3addr) + tlv_ies_offset , WLAN_EID_MPM, &mpm_ielen - , flen - sizeof(struct rtw_ieee80211_hdr_3addr) - tlv_ies_offset); + , flen - sizeof(struct ieee80211_hdr_3addr) - tlv_ies_offset); if (!mpm_ie || mpm_ielen < 2 + 2) goto exit; @@ -1531,7 +1528,7 @@ static int rtw_mpm_check_frames(_adapter *adapter, u8 action, const u8 **buf, si mpm_info.llid_v = RTW_GET_LE16(mpm_info.llid); switch (action) { - case RTW_ACT_SELF_PROTECTED_MESH_OPEN: + case WLAN_SP_MESH_PEERING_OPEN: /* pid:2, llid:2, (chosen_pmk:16) */ if (mpm_info.pid_v == 0 && mpm_ielen == 4) ; @@ -1540,7 +1537,7 @@ static int rtw_mpm_check_frames(_adapter *adapter, u8 action, const u8 **buf, si else goto exit; break; - case RTW_ACT_SELF_PROTECTED_MESH_CONF: + case WLAN_SP_MESH_PEERING_CONFIRM: /* pid:2, llid:2, plid:2, (chosen_pmk:16) */ mpm_info.plid = mpm_info.llid + 2; mpm_info.plid_v = RTW_GET_LE16(mpm_info.plid); @@ -1551,7 +1548,7 @@ static int rtw_mpm_check_frames(_adapter *adapter, u8 action, const u8 **buf, si else goto exit; break; - case RTW_ACT_SELF_PROTECTED_MESH_CLOSE: + case WLAN_SP_MESH_PEERING_CLOSE: /* pid:2, llid:2, (plid:2), reason:2, (chosen_pmk:16) */ if (mpm_info.pid_v == 0 && mpm_ielen == 6) { /* MPM, without plid */ @@ -1581,15 +1578,15 @@ static int rtw_mpm_check_frames(_adapter *adapter, u8 action, const u8 **buf, si }; if (mpm_info.pid_v == 1) { - mic_ie = rtw_get_ie(fhead + sizeof(struct rtw_ieee80211_hdr_3addr) + tlv_ies_offset + mic_ie = rtw_get_ie(fhead + sizeof(struct ieee80211_hdr_3addr) + tlv_ies_offset , WLAN_EID_MIC, &mic_ielen - , flen - sizeof(struct rtw_ieee80211_hdr_3addr) - tlv_ies_offset); + , flen - sizeof(struct ieee80211_hdr_3addr) - tlv_ies_offset); if (!mic_ie || mic_ielen != AES_BLOCK_SIZE) goto exit; } #if CONFIG_RTW_MPM_TX_IES_SYNC_BSS - if ((action == RTW_ACT_SELF_PROTECTED_MESH_OPEN || action == RTW_ACT_SELF_PROTECTED_MESH_CONF) + if ((action == WLAN_SP_MESH_PEERING_OPEN || action == WLAN_SP_MESH_PEERING_CONFIRM) && tx == _TRUE ) { #define DBG_RTW_MPM_TX_IES_SYNC_BSS 0 @@ -1602,8 +1599,8 @@ static int rtw_mpm_check_frames(_adapter *adapter, u8 action, const u8 **buf, si if (DBG_RTW_MPM_TX_IES_SYNC_BSS) { RTW_INFO(FUNC_ADPT_FMT" before:\n", FUNC_ADPT_ARG(adapter)); dump_ies(RTW_DBGDUMP - , fhead + sizeof(struct rtw_ieee80211_hdr_3addr) + tlv_ies_offset - , flen - sizeof(struct rtw_ieee80211_hdr_3addr) - tlv_ies_offset); + , fhead + sizeof(struct ieee80211_hdr_3addr) + tlv_ies_offset + , flen - sizeof(struct ieee80211_hdr_3addr) - tlv_ies_offset); } rtw_mpm_tx_ies_sync_bss(adapter, plink @@ -1615,18 +1612,18 @@ static int rtw_mpm_check_frames(_adapter *adapter, u8 action, const u8 **buf, si /* update pointer & len for new frame */ fhead = nbuf; flen = nlen; - frame_body = fhead + sizeof(struct rtw_ieee80211_hdr_3addr); + frame_body = fhead + sizeof(struct ieee80211_hdr_3addr); if (mpm_info.pid_v == 1) { - mic_ie = rtw_get_ie(fhead + sizeof(struct rtw_ieee80211_hdr_3addr) + tlv_ies_offset + mic_ie = rtw_get_ie(fhead + sizeof(struct ieee80211_hdr_3addr) + tlv_ies_offset , WLAN_EID_MIC, &mic_ielen - , flen - sizeof(struct rtw_ieee80211_hdr_3addr) - tlv_ies_offset); + , flen - sizeof(struct ieee80211_hdr_3addr) - tlv_ies_offset); } if (DBG_RTW_MPM_TX_IES_SYNC_BSS) { RTW_INFO(FUNC_ADPT_FMT" after:\n", FUNC_ADPT_ARG(adapter)); dump_ies(RTW_DBGDUMP - , fhead + sizeof(struct rtw_ieee80211_hdr_3addr) + tlv_ies_offset - , flen - sizeof(struct rtw_ieee80211_hdr_3addr) - tlv_ies_offset); + , fhead + sizeof(struct ieee80211_hdr_3addr) + tlv_ies_offset + , flen - sizeof(struct ieee80211_hdr_3addr) - tlv_ies_offset); } } bypass_sync_bss: @@ -1636,14 +1633,14 @@ bypass_sync_bss: goto mpm_log; #if CONFIG_RTW_MESH_PEER_BLACKLIST - if (action == RTW_ACT_SELF_PROTECTED_MESH_OPEN) { + if (action == WLAN_SP_MESH_PEERING_OPEN) { if (tx) rtw_mesh_plink_set_peer_conf_timeout(adapter, peer_addr); } else #endif #if CONFIG_RTW_MESH_ACNODE_PREVENT - if (action == RTW_ACT_SELF_PROTECTED_MESH_CLOSE) { + if (action == WLAN_SP_MESH_PEERING_CLOSE) { if (tx && mpm_info.reason && mpm_info.reason_v == WLAN_REASON_MESH_MAX_PEERS) { if (rtw_mesh_scanned_is_acnode_confirmed(adapter, plink->scanned) && rtw_mesh_acnode_prevent_allow_sacrifice(adapter) @@ -1676,7 +1673,7 @@ bypass_sync_bss: } } else #endif - if (action == RTW_ACT_SELF_PROTECTED_MESH_CONF) { + if (action == WLAN_SP_MESH_PEERING_CONFIRM) { _irqL irqL; u8 *ies = NULL; u16 ies_len = 0; @@ -1718,13 +1715,13 @@ bypass_sync_bss: /* copy mesh confirm IEs */ if (mpm_info.pid_v == 1) /* not include MIC & encrypted AMPE */ - ies_len = (mic_ie - fhead) - sizeof(struct rtw_ieee80211_hdr_3addr) - 2; + ies_len = (mic_ie - fhead) - sizeof(struct ieee80211_hdr_3addr) - 2; else - ies_len = flen - sizeof(struct rtw_ieee80211_hdr_3addr) - 2; + ies_len = flen - sizeof(struct ieee80211_hdr_3addr) - 2; ies = rtw_zmalloc(ies_len); if (ies) { - memcpy(ies, fhead + sizeof(struct rtw_ieee80211_hdr_3addr) + 2, ies_len); + memcpy(ies, fhead + sizeof(struct ieee80211_hdr_3addr) + 2, ies_len); if (tx == _FALSE) { plink->rx_conf_ies = ies; plink->rx_conf_ies_len = ies_len; @@ -1743,11 +1740,6 @@ release_plink_ctl: mpm_log: rtw_mpm_info_msg(&mpm_info, mpm_log_buf); - RTW_INFO("RTW_%s:%s %s\n" - , (tx == _TRUE) ? "Tx" : "Rx" - , action_self_protected_str(action) - , mpm_log_buf - ); ret = 1; @@ -1769,21 +1761,20 @@ static int rtw_mesh_check_frames(_adapter *adapter, const u8 **buf, size_t *len, const u8 *frame_body; u8 category, action; - frame_body = *buf + sizeof(struct rtw_ieee80211_hdr_3addr); + frame_body = *buf + sizeof(struct ieee80211_hdr_3addr); category = frame_body[0]; if (category == WLAN_CATEGORY_SELF_PROTECTED) { action = frame_body[1]; switch (action) { - case RTW_ACT_SELF_PROTECTED_MESH_OPEN: - case RTW_ACT_SELF_PROTECTED_MESH_CONF: - case RTW_ACT_SELF_PROTECTED_MESH_CLOSE: + case WLAN_SP_MESH_PEERING_OPEN: + case WLAN_SP_MESH_PEERING_CONFIRM: + case WLAN_SP_MESH_PEERING_CLOSE: rtw_mpm_check_frames(adapter, action, buf, len, tx); is_mesh_frame = action; break; case RTW_ACT_SELF_PROTECTED_MESH_GK_INFORM: - case RTW_ACT_SELF_PROTECTED_MESH_GK_ACK: - RTW_INFO("RTW_%s:%s\n", (tx == _TRUE) ? "Tx" : "Rx", action_self_protected_str(action)); + case WLAN_SP_MGK_ACK: is_mesh_frame = action; break; default: @@ -1836,7 +1827,7 @@ unsigned int on_action_self_protected(_adapter *adapter, union recv_frame *rfram struct sta_info *sta = NULL; u8 *pframe = rframe->u.hdr.rx_data; uint frame_len = rframe->u.hdr.len; - u8 *frame_body = (u8 *)(pframe + sizeof(struct rtw_ieee80211_hdr_3addr)); + u8 *frame_body = (u8 *)(pframe + sizeof(struct ieee80211_hdr_3addr)); u8 category; u8 action; @@ -1850,11 +1841,11 @@ unsigned int on_action_self_protected(_adapter *adapter, union recv_frame *rfram action = frame_body[1]; switch (action) { - case RTW_ACT_SELF_PROTECTED_MESH_OPEN: - case RTW_ACT_SELF_PROTECTED_MESH_CONF: - case RTW_ACT_SELF_PROTECTED_MESH_CLOSE: + case WLAN_SP_MESH_PEERING_OPEN: + case WLAN_SP_MESH_PEERING_CONFIRM: + case WLAN_SP_MESH_PEERING_CLOSE: case RTW_ACT_SELF_PROTECTED_MESH_GK_INFORM: - case RTW_ACT_SELF_PROTECTED_MESH_GK_ACK: + case WLAN_SP_MGK_ACK: if (!(MLME_IS_MESH(adapter) && MLME_IS_ASOC(adapter))) goto exit; #ifdef CONFIG_IOCTL_CFG80211 @@ -1894,7 +1885,7 @@ unsigned int on_action_mesh(_adapter *adapter, union recv_frame *rframe) struct sta_priv *stapriv = &adapter->stapriv; u8 *pframe = rframe->u.hdr.rx_data; uint frame_len = rframe->u.hdr.len; - u8 *frame_body = (u8 *)(pframe + sizeof(struct rtw_ieee80211_hdr_3addr)); + u8 *frame_body = (u8 *)(pframe + sizeof(struct ieee80211_hdr_3addr)); u8 category; u8 action; @@ -1909,7 +1900,7 @@ unsigned int on_action_mesh(_adapter *adapter, union recv_frame *rframe) action = frame_body[1]; switch (action) { - case RTW_ACT_MESH_HWMP_PATH_SELECTION: + case WLAN_MESH_ACTION_HWMP_PATH_SELECTION: rtw_mesh_rx_path_sel_frame(adapter, rframe); ret = _SUCCESS; break; @@ -2506,12 +2497,12 @@ static u8 *rtw_mesh_construct_peer_mesh_close(_adapter *adapter, struct mesh_pli struct rtw_mesh_info *minfo = &adapter->mesh_info; u8 *frame = NULL, *pos; u32 flen; - struct rtw_ieee80211_hdr *whdr; + struct ieee80211_hdr *whdr; if (minfo->mesh_auth_id && !MESH_PLINK_AEK_VALID(plink)) goto exit; - flen = sizeof(struct rtw_ieee80211_hdr_3addr) + flen = sizeof(struct ieee80211_hdr_3addr) + 2 /* category, action */ + 2 + minfo->mesh_id_len /* mesh id */ + 2 + 8 + (minfo->mesh_auth_id ? 16 : 0) /* mpm */ @@ -2523,16 +2514,16 @@ static u8 *rtw_mesh_construct_peer_mesh_close(_adapter *adapter, struct mesh_pli if (!frame) goto exit; - whdr = (struct rtw_ieee80211_hdr *)frame; + whdr = (struct ieee80211_hdr *)frame; memcpy(whdr->addr1, adapter_mac_addr(adapter), ETH_ALEN); memcpy(whdr->addr2, plink->addr, ETH_ALEN); memcpy(whdr->addr3, adapter_mac_addr(adapter), ETH_ALEN); set_frame_sub_type(frame, IEEE80211_STYPE_ACTION); - pos += sizeof(struct rtw_ieee80211_hdr_3addr); + pos += sizeof(struct ieee80211_hdr_3addr); *(pos++) = WLAN_CATEGORY_SELF_PROTECTED; - *(pos++) = RTW_ACT_SELF_PROTECTED_MESH_CLOSE; + *(pos++) = WLAN_SP_MESH_PEERING_CLOSE; pos = rtw_set_ie_mesh_id(pos, NULL, minfo->mesh_id, minfo->mesh_id_len); @@ -2558,7 +2549,7 @@ static u8 *rtw_mesh_construct_peer_mesh_close(_adapter *adapter, struct mesh_pli memcpy(ampe_buf + 38, plink->l_nonce, 32); enc_ret = rtw_mpm_ampe_enc(adapter, plink - , frame + sizeof(struct rtw_ieee80211_hdr_3addr) + , frame + sizeof(struct ieee80211_hdr_3addr) , pos, ampe_buf, 1); if (enc_ret != _SUCCESS) { rtw_mfree(frame, flen); @@ -3457,7 +3448,7 @@ s8 rtw_mesh_tx_set_whdr_mctrl_len(u8 mesh_frame_mode, struct pkt_attrib *attrib) void rtw_mesh_tx_build_mctrl(_adapter *adapter, struct pkt_attrib *attrib, u8 *buf) { - struct rtw_ieee80211s_hdr *mctrl = (struct rtw_ieee80211s_hdr *)buf; + struct ieee80211s_hdr *mctrl = (struct ieee80211s_hdr *)buf; memset(mctrl, 0, XATTRIB_GET_MCTRL_LEN(attrib)); @@ -3505,7 +3496,7 @@ void rtw_mesh_tx_build_mctrl(_adapter *adapter, struct pkt_attrib *attrib, u8 *b } u8 rtw_mesh_tx_build_whdr(_adapter *adapter, struct pkt_attrib *attrib - , u16 *fctrl, struct rtw_ieee80211_hdr *whdr) + , u16 *fctrl, struct ieee80211_hdr *whdr) { switch (attrib->mesh_frame_mode) { case MESH_UCAST_DATA: /* 1, 1, RA, TA, mDA(=DA), mSA(=SA) */ @@ -3635,7 +3626,7 @@ exit: } int rtw_mesh_rx_data_validate_mctrl(_adapter *adapter, union recv_frame *rframe - , const struct rtw_ieee80211s_hdr *mctrl, const u8 *mda, const u8 *msa + , const struct ieee80211s_hdr *mctrl, const u8 *mda, const u8 *msa , u8 *mctrl_len , const u8 **da, const u8 **sa) { @@ -3689,7 +3680,7 @@ inline int rtw_mesh_rx_validate_mctrl_non_amsdu(_adapter *adapter, union recv_fr int ret; ret = rtw_mesh_rx_data_validate_mctrl(adapter, rframe - , (struct rtw_ieee80211s_hdr *)(get_recvframe_data(rframe) + rattrib->hdrlen + rattrib->iv_len) + , (struct ieee80211s_hdr *)(get_recvframe_data(rframe) + rattrib->hdrlen + rattrib->iv_len) , rattrib->mda, rattrib->msa , &rattrib->mesh_ctrl_len , &da, &sa); @@ -3756,7 +3747,7 @@ endlookup: int rtw_mesh_rx_msdu_act_check(union recv_frame *rframe , const u8 *mda, const u8 *msa , const u8 *da, const u8 *sa - , struct rtw_ieee80211s_hdr *mctrl + , struct ieee80211s_hdr *mctrl , struct xmit_frame **fwd_frame, _list *b2u_list) { _adapter *adapter = rframe->u.hdr.adapter; diff --git a/core/mesh/rtw_mesh.h b/core/mesh/rtw_mesh.h index bc480d8..7b7acfe 100644 --- a/core/mesh/rtw_mesh.h +++ b/core/mesh/rtw_mesh.h @@ -505,18 +505,18 @@ int rtw_mesh_addr_resolve(_adapter *adapter, struct xmit_frame *xframe, _pkt *pk s8 rtw_mesh_tx_set_whdr_mctrl_len(u8 mesh_frame_mode, struct pkt_attrib *attrib); void rtw_mesh_tx_build_mctrl(_adapter *adapter, struct pkt_attrib *attrib, u8 *buf); u8 rtw_mesh_tx_build_whdr(_adapter *adapter, struct pkt_attrib *attrib - , u16 *fctrl, struct rtw_ieee80211_hdr *whdr); + , u16 *fctrl, struct ieee80211_hdr *whdr); int rtw_mesh_rx_data_validate_hdr(_adapter *adapter, union recv_frame *rframe, struct sta_info **sta); int rtw_mesh_rx_data_validate_mctrl(_adapter *adapter, union recv_frame *rframe - , const struct rtw_ieee80211s_hdr *mctrl, const u8 *mda, const u8 *msa + , const struct ieee80211s_hdr *mctrl, const u8 *mda, const u8 *msa , u8 *mctrl_len, const u8 **da, const u8 **sa); int rtw_mesh_rx_validate_mctrl_non_amsdu(_adapter *adapter, union recv_frame *rframe); int rtw_mesh_rx_msdu_act_check(union recv_frame *rframe , const u8 *mda, const u8 *msa , const u8 *da, const u8 *sa - , struct rtw_ieee80211s_hdr *mctrl + , struct ieee80211s_hdr *mctrl , struct xmit_frame **fwd_frame, _list *b2u_list); void dump_mesh_stats(void *sel, _adapter *adapter); diff --git a/core/mesh/rtw_mesh_hwmp.c b/core/mesh/rtw_mesh_hwmp.c index 0aa47b9..a9ea348 100644 --- a/core/mesh/rtw_mesh_hwmp.c +++ b/core/mesh/rtw_mesh_hwmp.c @@ -216,10 +216,10 @@ static int rtw_mesh_path_sel_frame_tx(enum rtw_mpath_frame_type mpath_action, u8 struct xmit_priv *pxmitpriv = &(adapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &(adapter->mlmeextpriv); struct xmit_frame *pmgntframe = NULL; - struct rtw_ieee80211_hdr *pwlanhdr = NULL; + struct ieee80211_hdr *pwlanhdr = NULL; struct pkt_attrib *pattrib = NULL; u8 category = WLAN_CATEGORY_MESH_ACTION; - u8 action = RTW_ACT_MESH_HWMP_PATH_SELECTION; + u8 action = WLAN_MESH_ACTION_HWMP_PATH_SELECTION; u16 *fctrl = NULL; u8 *pos, ie_len; @@ -233,10 +233,10 @@ static int rtw_mesh_path_sel_frame_tx(enum rtw_mpath_frame_type mpath_action, u8 memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pos = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pos; + pwlanhdr = (struct ieee80211_hdr *)pos; - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; memcpy(pwlanhdr->addr1, da, ETH_ALEN); @@ -247,8 +247,8 @@ static int rtw_mesh_path_sel_frame_tx(enum rtw_mpath_frame_type mpath_action, u8 pmlmeext->mgnt_seq++; set_frame_sub_type(pos, IEEE80211_STYPE_ACTION); - pos += sizeof(struct rtw_ieee80211_hdr_3addr); - pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pos += sizeof(struct ieee80211_hdr_3addr); + pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr); pos = rtw_set_fixed_ie(pos, 1, &(category), &(pattrib->pktlen)); pos = rtw_set_fixed_ie(pos, 1, &(action), &(pattrib->pktlen)); @@ -268,7 +268,7 @@ static int rtw_mesh_path_sel_frame_tx(enum rtw_mpath_frame_type mpath_action, u8 break; case RTW_MPATH_RANN: RTW_HWMP_DBG("sending RANN from "MAC_FMT"\n", MAC_ARG(originator_addr)); - ie_len = sizeof(struct rtw_ieee80211_rann_ie); + ie_len = sizeof(struct ieee80211_rann_ie); pattrib->pktlen += (ie_len + 2); *pos++ = WLAN_EID_RANN; break; @@ -327,11 +327,11 @@ int rtw_mesh_path_error_tx(_adapter *adapter, struct xmit_priv *pxmitpriv = &(adapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &(adapter->mlmeextpriv); struct xmit_frame *pmgntframe = NULL; - struct rtw_ieee80211_hdr *pwlanhdr = NULL; + struct ieee80211_hdr *pwlanhdr = NULL; struct pkt_attrib *pattrib = NULL; struct rtw_mesh_info *minfo = &adapter->mesh_info; u8 category = WLAN_CATEGORY_MESH_ACTION; - u8 action = RTW_ACT_MESH_HWMP_PATH_SELECTION; + u8 action = WLAN_MESH_ACTION_HWMP_PATH_SELECTION; u8 *pos, ie_len; u16 *fctrl = NULL; @@ -347,9 +347,9 @@ int rtw_mesh_path_error_tx(_adapter *adapter, memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pos = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pos; + pwlanhdr = (struct ieee80211_hdr *)pos; - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; memcpy(pwlanhdr->addr1, ra, ETH_ALEN); @@ -360,8 +360,8 @@ int rtw_mesh_path_error_tx(_adapter *adapter, pmlmeext->mgnt_seq++; set_frame_sub_type(pos, IEEE80211_STYPE_ACTION); - pos += sizeof(struct rtw_ieee80211_hdr_3addr); - pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pos += sizeof(struct ieee80211_hdr_3addr); + pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr); pos = rtw_set_fixed_ie(pos, 1, &(category), &(pattrib->pktlen)); pos = rtw_set_fixed_ie(pos, 1, &(action), &(pattrib->pktlen)); @@ -622,7 +622,7 @@ void rtw_ieee80211s_update_metric(_adapter *adapter, u8 mac_id, } static void rtw_hwmp_preq_frame_process(_adapter *adapter, - struct rtw_ieee80211_hdr_3addr *mgmt, + struct ieee80211_hdr_3addr *mgmt, const u8 *preq_elem, u32 originator_metric) { struct rtw_mesh_info *minfo = &adapter->mesh_info; @@ -805,7 +805,7 @@ rtw_next_hop_deref_protected(struct rtw_mesh_path *path) } static void rtw_hwmp_prep_frame_process(_adapter *adapter, - struct rtw_ieee80211_hdr_3addr *mgmt, + struct ieee80211_hdr_3addr *mgmt, const u8 *prep_elem, u32 metric) { struct rtw_mesh_cfg *mshcfg = &adapter->mesh_cfg; @@ -887,7 +887,7 @@ fail: } static void rtw_hwmp_perr_frame_process(_adapter *adapter, - struct rtw_ieee80211_hdr_3addr *mgmt, + struct ieee80211_hdr_3addr *mgmt, const u8 *perr_elem) { struct rtw_mesh_cfg *mshcfg = &adapter->mesh_cfg; @@ -942,8 +942,8 @@ endperr: } static void rtw_hwmp_rann_frame_process(_adapter *adapter, - struct rtw_ieee80211_hdr_3addr *mgmt, - const struct rtw_ieee80211_rann_ie *rann) + struct ieee80211_hdr_3addr *mgmt, + const struct ieee80211_rann_ie *rann) { struct sta_info *sta; struct sta_priv *pstapriv = &adapter->stapriv; @@ -1060,7 +1060,7 @@ static void rtw_hwmp_rann_frame_process(_adapter *adapter, } static u32 rtw_hwmp_route_info_get(_adapter *adapter, - struct rtw_ieee80211_hdr_3addr *mgmt, + struct ieee80211_hdr_3addr *mgmt, const u8 *hwmp_ie, enum rtw_mpath_frame_type action) { struct rtw_mesh_path *path; @@ -1227,8 +1227,8 @@ void rtw_mesh_rx_path_sel_frame(_adapter *adapter, union recv_frame *rframe) struct rx_pkt_attrib *attrib = &rframe->u.hdr.attrib; u8 *pframe = rframe->u.hdr.rx_data, *start; uint frame_len = rframe->u.hdr.len, left; - struct rtw_ieee80211_hdr_3addr *frame_hdr = (struct rtw_ieee80211_hdr_3addr *)pframe; - u8 *frame_body = (u8 *)(pframe + sizeof(struct rtw_ieee80211_hdr_3addr)); + struct ieee80211_hdr_3addr *frame_hdr = (struct ieee80211_hdr_3addr *)pframe; + u8 *frame_body = (u8 *)(pframe + sizeof(struct ieee80211_hdr_3addr)); ParseRes parse_res; plink = rtw_mesh_plink_get(adapter, get_addr2_ptr(pframe)); @@ -1238,7 +1238,7 @@ void rtw_mesh_rx_path_sel_frame(_adapter *adapter, union recv_frame *rframe) rtw_mesh_rx_hwmp_frame_cnts(adapter, get_addr2_ptr(pframe)); /* Mesh action frame IE offset = 2 */ - attrib->hdrlen = sizeof(struct rtw_ieee80211_hdr_3addr); + attrib->hdrlen = sizeof(struct ieee80211_hdr_3addr); left = frame_len - attrib->hdrlen - attrib->iv_len - attrib->icv_len - 2; start = pframe + attrib->hdrlen + 2; @@ -1277,7 +1277,7 @@ void rtw_mesh_rx_path_sel_frame(_adapter *adapter, union recv_frame *rframe) rtw_hwmp_perr_frame_process(adapter, frame_hdr, elems.perr); } if (elems.rann) - rtw_hwmp_rann_frame_process(adapter, frame_hdr, (struct rtw_ieee80211_rann_ie *)elems.rann); + rtw_hwmp_rann_frame_process(adapter, frame_hdr, (struct ieee80211_rann_ie *)elems.rann); } void rtw_mesh_queue_preq(struct rtw_mesh_path *path, u8 flags) diff --git a/core/rtw_ap.c b/core/rtw_ap.c index acbf3bc..2fb1e85 100644 --- a/core/rtw_ap.c +++ b/core/rtw_ap.c @@ -3331,8 +3331,8 @@ void rtw_process_public_act_bsscoex(_adapter *padapter, u8 *pframe, uint frame_l struct sta_priv *pstapriv = &padapter->stapriv; u8 beacon_updated = _FALSE; struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); - u8 *frame_body = pframe + sizeof(struct rtw_ieee80211_hdr_3addr); - uint frame_body_len = frame_len - sizeof(struct rtw_ieee80211_hdr_3addr); + u8 *frame_body = pframe + sizeof(struct ieee80211_hdr_3addr); + uint frame_body_len = frame_len - sizeof(struct ieee80211_hdr_3addr); u8 category, action; psta = rtw_get_stainfo(pstapriv, get_addr2_ptr(pframe)); diff --git a/core/rtw_beamforming.c b/core/rtw_beamforming.c index e405bf2..a5a422c 100644 --- a/core/rtw_beamforming.c +++ b/core/rtw_beamforming.c @@ -176,7 +176,7 @@ static u8 _send_ht_ndpa_packet(PADAPTER adapter, u8 *ra, enum channel_width bw) u8 ActionHdr[4] = {ACT_CAT_VENDOR, 0x00, 0xE0, 0x4C}; /* MISC */ struct pkt_attrib *attrib; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; enum MGN_RATE txrate; u8 *pframe; u16 duration = 0; @@ -215,10 +215,10 @@ static u8 _send_ht_ndpa_packet(PADAPTER adapter, u8 *ra, enum channel_width bw) memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; /* Frame control */ - pwlanhdr->frame_ctl = 0; + pwlanhdr->frame_control = 0; set_frame_sub_type(pframe, attrib->subtype); set_order_bit(pframe); @@ -272,7 +272,7 @@ static u8 _send_vht_ndpa_packet(PADAPTER adapter, u8 *ra, u16 aid, enum channel_ struct ndpa_sta_info sta_info; /* MISC */ struct pkt_attrib *attrib; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; u8 *pframe; enum MGN_RATE txrate; u16 duration = 0; @@ -310,10 +310,10 @@ static u8 _send_vht_ndpa_packet(PADAPTER adapter, u8 *ra, u16 aid, enum channel_ memset(pmgntframe->buf_addr, 0, TXDESC_OFFSET + WLANHDR_OFFSET); pframe = pmgntframe->buf_addr + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; /* Frame control */ - pwlanhdr->frame_ctl = 0; + pwlanhdr->frame_control = 0; set_frame_sub_type(pframe, attrib->subtype); /* Duration */ @@ -379,7 +379,7 @@ static u8 _send_vht_mu_ndpa_packet(PADAPTER adapter, enum channel_width bw) struct ndpa_sta_info sta_info; /* MISC */ struct pkt_attrib *attrib; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; enum MGN_RATE txrate; u8 *pframe; u8 *ra = NULL; @@ -427,10 +427,10 @@ static u8 _send_vht_mu_ndpa_packet(PADAPTER adapter, enum channel_width bw) memset(pmgntframe->buf_addr, 0, TXDESC_OFFSET + WLANHDR_OFFSET); pframe = pmgntframe->buf_addr + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; /* Frame control */ - pwlanhdr->frame_ctl = 0; + pwlanhdr->frame_control = 0; set_frame_sub_type(pframe, attrib->subtype); /* Duration */ @@ -490,7 +490,7 @@ static u8 _send_bf_report_poll(PADAPTER adapter, u8 *ra, u8 bFinalPoll) struct xmit_frame *pmgntframe; /* MISC */ struct pkt_attrib *attrib; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; u8 *pframe; @@ -519,10 +519,10 @@ static u8 _send_bf_report_poll(PADAPTER adapter, u8 *ra, u8 bFinalPoll) memset(pmgntframe->buf_addr, 0, TXDESC_OFFSET + WLANHDR_OFFSET); pframe = pmgntframe->buf_addr + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; /* Frame control */ - pwlanhdr->frame_ctl = 0; + pwlanhdr->frame_control = 0; set_frame_sub_type(pframe, attrib->subtype); /* Duration */ @@ -1627,7 +1627,7 @@ u32 rtw_bf_get_report_packet(PADAPTER adapter, union recv_frame *precv_frame) if (!bfee) return _FAIL; - frame_body = pframe + sizeof(struct rtw_ieee80211_hdr_3addr); + frame_body = pframe + sizeof(struct ieee80211_hdr_3addr); category = frame_body[0]; action = frame_body[1]; @@ -1693,7 +1693,7 @@ u8 rtw_bf_send_vht_gid_mgnt_packet(PADAPTER adapter, u8 *ra, u8 *gid, u8 *positi struct xmit_frame *pmgntframe; /* MISC */ struct pkt_attrib *attrib; - struct rtw_ieee80211_hdr *wlanhdr; + struct ieee80211_hdr *wlanhdr; u8 *pframe, *ptr; @@ -1714,9 +1714,9 @@ u8 rtw_bf_send_vht_gid_mgnt_packet(PADAPTER adapter, u8 *ra, u8 *gid, u8 *positi memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)pmgntframe->buf_addr + TXDESC_OFFSET; - wlanhdr = (struct rtw_ieee80211_hdr *)pframe; + wlanhdr = (struct ieee80211_hdr *)pframe; - wlanhdr->frame_ctl = 0; + wlanhdr->frame_control = 0; set_frame_sub_type(pframe, attrib->subtype); set_duration(pframe, 0); SetFragNum(pframe, 0); @@ -2176,7 +2176,7 @@ BOOLEAN issue_ht_sw_ndpa_packet(PADAPTER Adapter, u8 *ra, enum channel_width bw, { struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; struct xmit_priv *pxmitpriv = &(Adapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &Adapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); @@ -2209,9 +2209,9 @@ BOOLEAN issue_ht_sw_ndpa_packet(PADAPTER Adapter, u8 *ra, enum channel_width bw, pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &pwlanhdr->frame_ctl; + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; set_order_bit(pframe); @@ -2255,7 +2255,7 @@ BOOLEAN issue_ht_ndpa_packet(PADAPTER Adapter, u8 *ra, enum channel_width bw, u8 { struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; struct xmit_priv *pxmitpriv = &(Adapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &Adapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); @@ -2285,9 +2285,9 @@ BOOLEAN issue_ht_ndpa_packet(PADAPTER Adapter, u8 *ra, enum channel_width bw, u8 pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &pwlanhdr->frame_ctl; + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; set_order_bit(pframe); @@ -2334,7 +2334,7 @@ BOOLEAN issue_vht_sw_ndpa_packet(PADAPTER Adapter, u8 *ra, u16 aid, enum channel { struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; struct xmit_priv *pxmitpriv = &(Adapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &Adapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); @@ -2372,9 +2372,9 @@ BOOLEAN issue_vht_sw_ndpa_packet(PADAPTER Adapter, u8 *ra, u16 aid, enum channel pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &pwlanhdr->frame_ctl; + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; set_frame_sub_type(pframe, WIFI_NDPA); @@ -2428,7 +2428,7 @@ BOOLEAN issue_vht_ndpa_packet(PADAPTER Adapter, u8 *ra, u16 aid, enum channel_wi { struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; struct xmit_priv *pxmitpriv = &(Adapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &Adapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); @@ -2458,9 +2458,9 @@ BOOLEAN issue_vht_ndpa_packet(PADAPTER Adapter, u8 *ra, u16 aid, enum channel_wi pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &pwlanhdr->frame_ctl; + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; set_frame_sub_type(pframe, WIFI_NDPA); diff --git a/core/rtw_ieee80211.c b/core/rtw_ieee80211.c index 4ecbeda..0b1ca99 100644 --- a/core/rtw_ieee80211.c +++ b/core/rtw_ieee80211.c @@ -2775,12 +2775,12 @@ u16 rtw_mcs_rate(u8 rf_type, u8 bw_40MHz, u8 short_GI, unsigned char *MCS_rate) int rtw_action_frame_parse(const u8 *frame, u32 frame_len, u8 *category, u8 *action) { - const u8 *frame_body = frame + sizeof(struct rtw_ieee80211_hdr_3addr); + const u8 *frame_body = frame + sizeof(struct ieee80211_hdr_3addr); u16 fc; u8 c; u8 a = ACT_PUBLIC_MAX; - fc = le16_to_cpu(((struct rtw_ieee80211_hdr_3addr *)frame)->frame_ctl); + fc = le16_to_cpu(((struct ieee80211_hdr_3addr *)frame)->frame_control); if ((fc & ( IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) != (IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ACTION) @@ -2804,29 +2804,3 @@ int rtw_action_frame_parse(const u8 *frame, u32 frame_len, u8 *category, u8 *act return _TRUE; } -static const char *_action_public_str[] = { - "ACT_PUB_BSSCOEXIST", - "ACT_PUB_DSE_ENABLE", - "ACT_PUB_DSE_DEENABLE", - "ACT_PUB_DSE_REG_LOCATION", - "ACT_PUB_EXT_CHL_SWITCH", - "ACT_PUB_DSE_MSR_REQ", - "ACT_PUB_DSE_MSR_RPRT", - "ACT_PUB_MP", - "ACT_PUB_DSE_PWR_CONSTRAINT", - "ACT_PUB_VENDOR", - "ACT_PUB_GAS_INITIAL_REQ", - "ACT_PUB_GAS_INITIAL_RSP", - "ACT_PUB_GAS_COMEBACK_REQ", - "ACT_PUB_GAS_COMEBACK_RSP", - "ACT_PUB_TDLS_DISCOVERY_RSP", - "ACT_PUB_LOCATION_TRACK", - "ACT_PUB_RSVD", -}; - -const char *action_public_str(u8 action) -{ - action = (action >= ACT_PUBLIC_MAX) ? ACT_PUBLIC_MAX : action; - return _action_public_str[action]; -} - diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index bf2043d..ce14057 100644 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -1790,8 +1790,8 @@ static void rtw_check_legacy_ap(_adapter *padapter, u8 *pframe, u32 len) u16 cur_op_mode; #endif /* checking IEs */ - left = len - sizeof(struct rtw_ieee80211_hdr_3addr) - _BEACON_IE_OFFSET_; - pos = pframe + sizeof(struct rtw_ieee80211_hdr_3addr) + _BEACON_IE_OFFSET_; + left = len - sizeof(struct ieee80211_hdr_3addr) - _BEACON_IE_OFFSET_; + pos = pframe + sizeof(struct ieee80211_hdr_3addr) + _BEACON_IE_OFFSET_; if (rtw_ieee802_11_parse_elems(pos, left, &elems, 1) == ParseFailed) { RTW_INFO("%s: parse fail for "MAC_FMT"\n", __func__, MAC_ARG(GetAddr3Ptr(pframe))); return; @@ -1881,7 +1881,7 @@ unsigned int OnBeacon(_adapter *padapter, union recv_frame *precv_frame) } /* check the vendor of the assoc AP */ - pmlmeinfo->assoc_AP_vendor = check_assoc_AP(pframe + sizeof(struct rtw_ieee80211_hdr_3addr), len - sizeof(struct rtw_ieee80211_hdr_3addr)); + pmlmeinfo->assoc_AP_vendor = check_assoc_AP(pframe + sizeof(struct ieee80211_hdr_3addr), len - sizeof(struct ieee80211_hdr_3addr)); /* update TSF Value */ update_TSF(pmlmeext, pframe, len); @@ -3145,7 +3145,7 @@ unsigned int on_action_spct(_adapter *padapter, union recv_frame *precv_frame) struct sta_priv *pstapriv = &padapter->stapriv; u8 *pframe = precv_frame->u.hdr.rx_data; uint frame_len = precv_frame->u.hdr.len; - u8 *frame_body = (u8 *)(pframe + sizeof(struct rtw_ieee80211_hdr_3addr)); + u8 *frame_body = (u8 *)(pframe + sizeof(struct ieee80211_hdr_3addr)); u8 category; u8 action; @@ -3163,12 +3163,12 @@ unsigned int on_action_spct(_adapter *padapter, union recv_frame *precv_frame) RTW_INFO(FUNC_ADPT_FMT" action:%u\n", FUNC_ADPT_ARG(padapter), action); switch (action) { - case RTW_WLAN_ACTION_SPCT_MSR_REQ: - case RTW_WLAN_ACTION_SPCT_MSR_RPRT: - case RTW_WLAN_ACTION_SPCT_TPC_REQ: - case RTW_WLAN_ACTION_SPCT_TPC_RPRT: + case WLAN_ACTION_SPCT_MSR_REQ: + case WLAN_ACTION_SPCT_MSR_RPRT: + case WLAN_ACTION_SPCT_TPC_REQ: + case WLAN_ACTION_SPCT_TPC_RPRT: break; - case RTW_WLAN_ACTION_SPCT_CHL_SWITCH: + case WLAN_ACTION_SPCT_CHL_SWITCH: #ifdef CONFIG_SPCT_CH_SWITCH ret = on_action_spct_ch_switch(padapter, psta , frame_body + 2, frame_len - (frame_body - pframe) - 2); @@ -3206,8 +3206,8 @@ unsigned int on_action_wnm(_adapter *adapter, union recv_frame *rframe) struct sta_priv *stapriv = &(adapter->stapriv); u8 *frame = rframe->u.hdr.rx_data; u32 frame_len = rframe->u.hdr.len; - u8 *frame_body = (u8 *)(frame + sizeof(struct rtw_ieee80211_hdr_3addr)); - u32 frame_body_len = frame_len - sizeof(struct rtw_ieee80211_hdr_3addr); + u8 *frame_body = (u8 *)(frame + sizeof(struct ieee80211_hdr_3addr)); + u32 frame_body_len = frame_len - sizeof(struct ieee80211_hdr_3addr); u8 category, action; int cnt = 0; char msg[16]; @@ -3617,7 +3617,7 @@ unsigned int OnAction_back(_adapter *padapter, union recv_frame *precv_frame) if (psta == NULL) return _SUCCESS; - frame_body = (unsigned char *)(pframe + sizeof(struct rtw_ieee80211_hdr_3addr)); + frame_body = (unsigned char *)(pframe + sizeof(struct ieee80211_hdr_3addr)); category = frame_body[0]; if (category == WLAN_CATEGORY_BACK) { /* representing Block Ack */ @@ -3749,7 +3749,7 @@ void issue_p2p_GO_request(_adapter *padapter, u8 *raddr) struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; unsigned char *pframe; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; unsigned short *fctrl; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); @@ -3768,9 +3768,9 @@ void issue_p2p_GO_request(_adapter *padapter, u8 *raddr) memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; memcpy(pwlanhdr->addr1, raddr, ETH_ALEN); @@ -3781,8 +3781,8 @@ void issue_p2p_GO_request(_adapter *padapter, u8 *raddr) pmlmeext->mgnt_seq++; set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); - pframe += sizeof(struct rtw_ieee80211_hdr_3addr); - pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pframe += sizeof(struct ieee80211_hdr_3addr); + pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr); pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); @@ -4145,7 +4145,7 @@ void issue_p2p_GO_response(_adapter *padapter, u8 *raddr, u8 *frame_body, uint l struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; unsigned char *pframe; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; unsigned short *fctrl; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); @@ -4167,9 +4167,9 @@ void issue_p2p_GO_response(_adapter *padapter, u8 *raddr, u8 *frame_body, uint l memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; memcpy(pwlanhdr->addr1, raddr, ETH_ALEN); @@ -4180,8 +4180,8 @@ void issue_p2p_GO_response(_adapter *padapter, u8 *raddr, u8 *frame_body, uint l pmlmeext->mgnt_seq++; set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); - pframe += sizeof(struct rtw_ieee80211_hdr_3addr); - pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pframe += sizeof(struct ieee80211_hdr_3addr); + pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr); pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); @@ -4558,7 +4558,7 @@ void issue_p2p_GO_confirm(_adapter *padapter, u8 *raddr, u8 result) struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; unsigned char *pframe; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; unsigned short *fctrl; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); @@ -4579,9 +4579,9 @@ void issue_p2p_GO_confirm(_adapter *padapter, u8 *raddr, u8 result) memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; memcpy(pwlanhdr->addr1, raddr, ETH_ALEN); @@ -4592,8 +4592,8 @@ void issue_p2p_GO_confirm(_adapter *padapter, u8 *raddr, u8 result) pmlmeext->mgnt_seq++; set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); - pframe += sizeof(struct rtw_ieee80211_hdr_3addr); - pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pframe += sizeof(struct ieee80211_hdr_3addr); + pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr); pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); @@ -4797,7 +4797,7 @@ void issue_p2p_invitation_request(_adapter *padapter, u8 *raddr) struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; unsigned char *pframe; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; unsigned short *fctrl; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); @@ -4815,9 +4815,9 @@ void issue_p2p_invitation_request(_adapter *padapter, u8 *raddr) memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; memcpy(pwlanhdr->addr1, raddr, ETH_ALEN); @@ -4828,8 +4828,8 @@ void issue_p2p_invitation_request(_adapter *padapter, u8 *raddr) pmlmeext->mgnt_seq++; set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); - pframe += sizeof(struct rtw_ieee80211_hdr_3addr); - pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pframe += sizeof(struct ieee80211_hdr_3addr); + pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr); pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); @@ -5094,7 +5094,7 @@ void issue_p2p_invitation_response(_adapter *padapter, u8 *raddr, u8 dialogToken struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; unsigned char *pframe; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; unsigned short *fctrl; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); @@ -5112,9 +5112,9 @@ void issue_p2p_invitation_response(_adapter *padapter, u8 *raddr, u8 dialogToken memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; memcpy(pwlanhdr->addr1, raddr, ETH_ALEN); @@ -5125,8 +5125,8 @@ void issue_p2p_invitation_response(_adapter *padapter, u8 *raddr, u8 dialogToken pmlmeext->mgnt_seq++; set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); - pframe += sizeof(struct rtw_ieee80211_hdr_3addr); - pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pframe += sizeof(struct ieee80211_hdr_3addr); + pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr); pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); @@ -5329,7 +5329,7 @@ void issue_p2p_provision_request(_adapter *padapter, u8 *pssid, u8 ussidlen, u8 struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; unsigned char *pframe; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; unsigned short *fctrl; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); @@ -5348,9 +5348,9 @@ void issue_p2p_provision_request(_adapter *padapter, u8 *pssid, u8 ussidlen, u8 memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; memcpy(pwlanhdr->addr1, pdev_raddr, ETH_ALEN); @@ -5361,8 +5361,8 @@ void issue_p2p_provision_request(_adapter *padapter, u8 *pssid, u8 ussidlen, u8 pmlmeext->mgnt_seq++; set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); - pframe += sizeof(struct rtw_ieee80211_hdr_3addr); - pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pframe += sizeof(struct ieee80211_hdr_3addr); + pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr); pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); @@ -5448,7 +5448,7 @@ void issue_probersp_p2p(_adapter *padapter, unsigned char *da) struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; unsigned char *pframe; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; unsigned short *fctrl; unsigned char *mac; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); @@ -5486,11 +5486,11 @@ void issue_probersp_p2p(_adapter *padapter, unsigned char *da) memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; mac = adapter_mac_addr(padapter); - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; memcpy(pwlanhdr->addr1, da, ETH_ALEN); memcpy(pwlanhdr->addr2, mac, ETH_ALEN); @@ -5502,7 +5502,7 @@ void issue_probersp_p2p(_adapter *padapter, unsigned char *da) pmlmeext->mgnt_seq++; set_frame_sub_type(fctrl, IEEE80211_STYPE_PROBE_RESP); - pattrib->hdrlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pattrib->hdrlen = sizeof(struct ieee80211_hdr_3addr); pattrib->pktlen = pattrib->hdrlen; pframe += pattrib->hdrlen; @@ -5781,7 +5781,7 @@ int _issue_probereq_p2p(_adapter *padapter, u8 *da, int wait_ack) struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; unsigned char *pframe; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; unsigned short *fctrl; unsigned char *mac; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); @@ -5813,11 +5813,11 @@ int _issue_probereq_p2p(_adapter *padapter, u8 *da, int wait_ack) memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; mac = adapter_mac_addr(padapter); - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; if (da) { @@ -5840,8 +5840,8 @@ int _issue_probereq_p2p(_adapter *padapter, u8 *da, int wait_ack) pmlmeext->mgnt_seq++; set_frame_sub_type(pframe, IEEE80211_STYPE_PROBE_REQ); - pframe += sizeof(struct rtw_ieee80211_hdr_3addr); - pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pframe += sizeof(struct ieee80211_hdr_3addr); + pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr); if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_PROVISION_DIS_REQ)) pframe = rtw_set_ie(pframe, WLAN_EID_SSID, pwdinfo->tx_prov_disc_info.ssid.SsidLength, pwdinfo->tx_prov_disc_info.ssid.Ssid, &(pattrib->pktlen)); @@ -6157,7 +6157,7 @@ s32 rtw_action_public_decache(union recv_frame *rframe, u8 token_offset) struct mlme_ext_priv *mlmeext = &(adapter->mlmeextpriv); u8 *frame = rframe->u.hdr.rx_data; u16 seq_ctrl = ((rframe->u.hdr.attrib.seq_num & 0xffff) << 4) | (rframe->u.hdr.attrib.frag_num & 0xf); - u8 token = *(rframe->u.hdr.rx_data + sizeof(struct rtw_ieee80211_hdr_3addr) + token_offset); + u8 token = *(rframe->u.hdr.rx_data + sizeof(struct ieee80211_hdr_3addr) + token_offset); if (GetRetry(frame)) { if ((seq_ctrl == mlmeext->action_public_rxseq) @@ -6192,7 +6192,7 @@ unsigned int on_action_public_p2p(union recv_frame *precv_frame) u32 merged_p2p_ielen = 0; #endif /* CONFIG_P2P */ - frame_body = (unsigned char *)(pframe + sizeof(struct rtw_ieee80211_hdr_3addr)); + frame_body = (unsigned char *)(pframe + sizeof(struct ieee80211_hdr_3addr)); #ifdef CONFIG_P2P _cancel_timer_ex(&pwdinfo->reset_ch_sitesurvey); @@ -6206,7 +6206,7 @@ unsigned int on_action_public_p2p(union recv_frame *precv_frame) if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE) || rtw_p2p_chk_state(pwdinfo, P2P_STATE_IDLE)) return _SUCCESS; - len -= sizeof(struct rtw_ieee80211_hdr_3addr); + len -= sizeof(struct ieee80211_hdr_3addr); switch (frame_body[6]) { /* OUI Subtype */ case P2P_GO_NEGO_REQ: { @@ -6556,7 +6556,7 @@ unsigned int on_action_public_vendor(union recv_frame *precv_frame) { unsigned int ret = _FAIL; u8 *pframe = precv_frame->u.hdr.rx_data; - u8 *frame_body = pframe + sizeof(struct rtw_ieee80211_hdr_3addr); + u8 *frame_body = pframe + sizeof(struct ieee80211_hdr_3addr); if (_rtw_memcmp(frame_body + 2, P2P_OUI, 4) == _TRUE) { if (rtw_action_public_decache(precv_frame, 7) == _FAIL) @@ -6576,7 +6576,7 @@ unsigned int on_action_public_default(union recv_frame *precv_frame, u8 action) { unsigned int ret = _FAIL; u8 *pframe = precv_frame->u.hdr.rx_data; - u8 *frame_body = pframe + sizeof(struct rtw_ieee80211_hdr_3addr); + u8 *frame_body = pframe + sizeof(struct ieee80211_hdr_3addr); u8 token; _adapter *adapter = precv_frame->u.hdr.adapter; int cnt = 0; @@ -6588,7 +6588,6 @@ unsigned int on_action_public_default(union recv_frame *precv_frame, u8 action) goto exit; #ifdef CONFIG_IOCTL_CFG80211 - cnt += sprintf((msg + cnt), "%s(token:%u)", action_public_str(action), token); rtw_cfg80211_rx_action(adapter, precv_frame, msg); #endif @@ -6603,7 +6602,7 @@ unsigned int on_action_public(_adapter *padapter, union recv_frame *precv_frame) unsigned int ret = _FAIL; u8 *pframe = precv_frame->u.hdr.rx_data; uint frame_len = precv_frame->u.hdr.len; - u8 *frame_body = pframe + sizeof(struct rtw_ieee80211_hdr_3addr); + u8 *frame_body = pframe + sizeof(struct ieee80211_hdr_3addr); u8 category, action; /* check RA matches or not */ @@ -6616,7 +6615,7 @@ unsigned int on_action_public(_adapter *padapter, union recv_frame *precv_frame) action = frame_body[1]; switch (action) { - case ACT_PUBLIC_BSSCOEXIST: + case WLAN_PUB_ACTION_20_40_BSS_COEX: #ifdef CONFIG_80211N_HT #ifdef CONFIG_AP_MODE /*20/40 BSS Coexistence Management frame is a Public Action frame*/ @@ -6625,7 +6624,7 @@ unsigned int on_action_public(_adapter *padapter, union recv_frame *precv_frame) #endif /*CONFIG_AP_MODE*/ #endif /*CONFIG_80211N_HT*/ break; - case ACT_PUBLIC_VENDOR: + case WLAN_PUB_ACTION_VENDOR_SPECIFIC : ret = on_action_public_vendor(precv_frame); break; default: @@ -6906,7 +6905,7 @@ unsigned int OnAction_ft(_adapter *padapter, union recv_frame *precv_frame) pft_roam = &(pmlmepriv->ft_roam); pframe = precv_frame->u.hdr.rx_data; frame_len = precv_frame->u.hdr.len; - pframe_body = pframe + sizeof(struct rtw_ieee80211_hdr_3addr); + pframe_body = pframe + sizeof(struct ieee80211_hdr_3addr); category = pframe_body[0]; if (category != WLAN_CATEGORY_FAST_BBS_TRANSITION) @@ -6921,7 +6920,7 @@ unsigned int OnAction_ft(_adapter *padapter, union recv_frame *precv_frame) goto exit; } - status_code = le16_to_cpu(*(u16 *)((SIZE_PTR)pframe + sizeof(struct rtw_ieee80211_hdr_3addr) + 14)); + status_code = le16_to_cpu(*(u16 *)((SIZE_PTR)pframe + sizeof(struct ieee80211_hdr_3addr) + 14)); if (status_code != 0) { RTW_ERR("FT: WLAN ACTION FT RESPONSE fail, status: %d\n", status_code); goto exit; @@ -7135,7 +7134,7 @@ void rtw_wnm_issue_action(_adapter *padapter, u8 action, u8 reason) struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); struct xmit_frame *pmgntframe; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; struct pkt_attrib *pattrib; u8 category, dialog_token, termination_delay, *pframe; u16 *fctrl; @@ -7148,9 +7147,9 @@ void rtw_wnm_issue_action(_adapter *padapter, u8 action, u8 reason) memset(pmgntframe->buf_addr, 0, (WLANHDR_OFFSET + TXDESC_OFFSET)); pframe = (u8 *)(pmgntframe->buf_addr + TXDESC_OFFSET); - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; memcpy(pwlanhdr->addr1, get_my_bssid(&pmlmeinfo->network), ETH_ALEN); @@ -7161,8 +7160,8 @@ void rtw_wnm_issue_action(_adapter *padapter, u8 action, u8 reason) pmlmeext->mgnt_seq++; set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); - pframe += sizeof(struct rtw_ieee80211_hdr_3addr); - pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pframe += sizeof(struct ieee80211_hdr_3addr); + pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr); category = WLAN_CATEGORY_WNM; pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); @@ -7200,7 +7199,7 @@ exit: unsigned int OnAction_ht(_adapter *padapter, union recv_frame *precv_frame) { u8 *pframe = precv_frame->u.hdr.rx_data; - u8 *frame_body = pframe + sizeof(struct rtw_ieee80211_hdr_3addr); + u8 *frame_body = pframe + sizeof(struct ieee80211_hdr_3addr); u8 category, action; /* check RA matches or not */ @@ -7299,8 +7298,8 @@ unsigned int OnAction_vht(_adapter *padapter, union recv_frame *precv_frame) { #ifdef CONFIG_80211AC_VHT u8 *pframe = precv_frame->u.hdr.rx_data; - struct rtw_ieee80211_hdr_3addr *whdr = (struct rtw_ieee80211_hdr_3addr *)pframe; - u8 *frame_body = pframe + sizeof(struct rtw_ieee80211_hdr_3addr); + struct ieee80211_hdr_3addr *whdr = (struct ieee80211_hdr_3addr *)pframe; + u8 *frame_body = pframe + sizeof(struct ieee80211_hdr_3addr); u8 category, action; struct sta_info *psta = NULL; @@ -7357,7 +7356,7 @@ unsigned int OnAction_p2p(_adapter *padapter, union recv_frame *precv_frame) if (!_rtw_memcmp(adapter_mac_addr(padapter), GetAddr1Ptr(pframe), ETH_ALEN)) return _SUCCESS; - frame_body = (unsigned char *)(pframe + sizeof(struct rtw_ieee80211_hdr_3addr)); + frame_body = (unsigned char *)(pframe + sizeof(struct ieee80211_hdr_3addr)); category = frame_body[0]; if (category != WLAN_CATEGORY_VENDOR_SPECIFIC) @@ -7375,7 +7374,7 @@ unsigned int OnAction_p2p(_adapter *padapter, union recv_frame *precv_frame) } else #endif /* CONFIG_IOCTL_CFG80211 */ { - len -= sizeof(struct rtw_ieee80211_hdr_3addr); + len -= sizeof(struct ieee80211_hdr_3addr); OUI_Subtype = frame_body[5]; dialogToken = frame_body[6]; @@ -7417,7 +7416,7 @@ unsigned int OnAction(_adapter *padapter, union recv_frame *precv_frame) unsigned char *frame_body; u8 *pframe = precv_frame->u.hdr.rx_data; - frame_body = (unsigned char *)(pframe + sizeof(struct rtw_ieee80211_hdr_3addr)); + frame_body = (unsigned char *)(pframe + sizeof(struct ieee80211_hdr_3addr)); category = frame_body[0]; @@ -7780,7 +7779,7 @@ void issue_beacon(_adapter *padapter, int timeout_ms) struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; unsigned char *pframe; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; unsigned short *fctrl; unsigned int rate_len; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); @@ -7830,10 +7829,10 @@ void issue_beacon(_adapter *padapter, int timeout_ms) memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; eth_broadcast_addr(pwlanhdr->addr1); @@ -7844,8 +7843,8 @@ void issue_beacon(_adapter *padapter, int timeout_ms) /* pmlmeext->mgnt_seq++; */ set_frame_sub_type(pframe, IEEE80211_STYPE_BEACON); - pframe += sizeof(struct rtw_ieee80211_hdr_3addr); - pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pframe += sizeof(struct ieee80211_hdr_3addr); + pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr); if (MLME_IS_AP(padapter) || MLME_IS_MESH(padapter)) { /* RTW_INFO("ie len=%d\n", cur_network->IELength); */ @@ -7961,8 +7960,8 @@ void issue_beacon(_adapter *padapter, int timeout_ms) u8 *wps_ie; uint wps_ielen; u8 sr = 0; - wps_ie = rtw_get_wps_ie(pmgntframe->buf_addr + TXDESC_OFFSET + sizeof(struct rtw_ieee80211_hdr_3addr) + _BEACON_IE_OFFSET_, - pattrib->pktlen - sizeof(struct rtw_ieee80211_hdr_3addr) - _BEACON_IE_OFFSET_, NULL, &wps_ielen); + wps_ie = rtw_get_wps_ie(pmgntframe->buf_addr + TXDESC_OFFSET + sizeof(struct ieee80211_hdr_3addr) + _BEACON_IE_OFFSET_, + pattrib->pktlen - sizeof(struct ieee80211_hdr_3addr) - _BEACON_IE_OFFSET_, NULL, &wps_ielen); if (wps_ie && wps_ielen > 0) rtw_get_wps_attr_content(wps_ie, wps_ielen, WPS_ATTR_SELECTED_REGISTRAR, (u8 *)(&sr), NULL); if (sr != 0) @@ -8101,7 +8100,7 @@ void issue_probersp(_adapter *padapter, unsigned char *da, u8 is_valid_p2p_probe struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; unsigned char *pframe; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; unsigned short *fctrl; unsigned char *mac, *bssid; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); @@ -8140,12 +8139,12 @@ void issue_probersp(_adapter *padapter, unsigned char *da, u8 is_valid_p2p_probe memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; mac = adapter_mac_addr(padapter); bssid = cur_network->MacAddress; - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; memcpy(pwlanhdr->addr1, da, ETH_ALEN); memcpy(pwlanhdr->addr2, mac, ETH_ALEN); @@ -8155,7 +8154,7 @@ void issue_probersp(_adapter *padapter, unsigned char *da, u8 is_valid_p2p_probe pmlmeext->mgnt_seq++; set_frame_sub_type(fctrl, IEEE80211_STYPE_PROBE_RESP); - pattrib->hdrlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pattrib->hdrlen = sizeof(struct ieee80211_hdr_3addr); pattrib->pktlen = pattrib->hdrlen; pframe += pattrib->hdrlen; @@ -8206,7 +8205,7 @@ void issue_probersp(_adapter *padapter, unsigned char *da, u8 is_valid_p2p_probe sint ssid_ielen; sint ssid_ielen_diff; u8 buf[MAX_IE_SZ]; - u8 *ies = pmgntframe->buf_addr + TXDESC_OFFSET + sizeof(struct rtw_ieee80211_hdr_3addr); + u8 *ies = pmgntframe->buf_addr + TXDESC_OFFSET + sizeof(struct ieee80211_hdr_3addr); ssid_ie = rtw_get_ie(ies + _FIXED_IE_LENGTH_, WLAN_EID_SSID, &ssid_ielen, (pframe - ies) - _FIXED_IE_LENGTH_); @@ -8382,7 +8381,7 @@ int _issue_probereq(_adapter *padapter, const NDIS_802_11_SSID *pssid, const u8 struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; unsigned char *pframe; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; unsigned short *fctrl; unsigned char *mac; unsigned char bssrate[NumRates]; @@ -8409,7 +8408,7 @@ int _issue_probereq(_adapter *padapter, const NDIS_802_11_SSID *pssid, const u8 memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; #ifdef CONFIG_RTW_CFGVENDOR_RANDOM_MAC_OUI if ((pwdev_priv->pno_mac_addr[0] != 0xFF) @@ -8420,7 +8419,7 @@ int _issue_probereq(_adapter *padapter, const NDIS_802_11_SSID *pssid, const u8 #endif mac = adapter_mac_addr(padapter); - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; if (da) { @@ -8455,8 +8454,8 @@ int _issue_probereq(_adapter *padapter, const NDIS_802_11_SSID *pssid, const u8 } set_frame_sub_type(pframe, IEEE80211_STYPE_PROBE_REQ); - pframe += sizeof(struct rtw_ieee80211_hdr_3addr); - pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pframe += sizeof(struct ieee80211_hdr_3addr); + pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr); if (pssid && !MLME_IS_MESH(padapter)) pframe = rtw_set_ie(pframe, WLAN_EID_SSID, pssid->SsidLength, pssid->Ssid, &(pattrib->pktlen)); @@ -8575,7 +8574,7 @@ void issue_auth(_adapter *padapter, struct sta_info *psta, unsigned short status struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; unsigned char *pframe; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; unsigned short *fctrl; unsigned int val32; unsigned short val16; @@ -8598,17 +8597,17 @@ void issue_auth(_adapter *padapter, struct sta_info *psta, unsigned short status memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; set_frame_sub_type(pframe, IEEE80211_STYPE_AUTH); - pframe += sizeof(struct rtw_ieee80211_hdr_3addr); - pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pframe += sizeof(struct ieee80211_hdr_3addr); + pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr); if (psta) { /* for AP mode */ @@ -8701,7 +8700,7 @@ void issue_auth(_adapter *padapter, struct sta_info *psta, unsigned short status SetPrivacy(fctrl); - pattrib->hdrlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pattrib->hdrlen = sizeof(struct ieee80211_hdr_3addr); pattrib->encrypt = _WEP40_; @@ -8727,7 +8726,7 @@ void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *p { #ifdef CONFIG_AP_MODE struct xmit_frame *pmgntframe; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; struct pkt_attrib *pattrib; unsigned char *pbuf, *pframe; unsigned short val, ie_status; @@ -8763,9 +8762,9 @@ void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *p memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; memcpy((void *)GetAddr1Ptr(pwlanhdr), pstat->cmn.mac_addr, ETH_ALEN); @@ -8780,7 +8779,7 @@ void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *p else return; - pattrib->hdrlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pattrib->hdrlen = sizeof(struct ieee80211_hdr_3addr); pattrib->pktlen += pattrib->hdrlen; pframe += pattrib->hdrlen; @@ -8955,7 +8954,7 @@ void _issue_assocreq(_adapter *padapter, u8 is_reassoc) struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; unsigned char *pframe; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; unsigned short *fctrl; unsigned short val16; unsigned int i, j, index = 0; @@ -9000,9 +8999,9 @@ void _issue_assocreq(_adapter *padapter, u8 is_reassoc) memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; memcpy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); memcpy(pwlanhdr->addr2, adapter_mac_addr(padapter), ETH_ALEN); @@ -9015,8 +9014,8 @@ void _issue_assocreq(_adapter *padapter, u8 is_reassoc) else set_frame_sub_type(pframe, IEEE80211_STYPE_ASSOC_REQ); - pframe += sizeof(struct rtw_ieee80211_hdr_3addr); - pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pframe += sizeof(struct ieee80211_hdr_3addr); + pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr); /* caps */ @@ -9441,7 +9440,7 @@ static int _issue_nulldata(_adapter *padapter, unsigned char *da, unsigned int p struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; unsigned char *pframe; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; unsigned short *fctrl; struct xmit_priv *pxmitpriv; struct mlme_ext_priv *pmlmeext; @@ -9472,9 +9471,9 @@ static int _issue_nulldata(_adapter *padapter, unsigned char *da, unsigned int p memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; if (MLME_IS_AP(padapter)) @@ -9507,8 +9506,8 @@ static int _issue_nulldata(_adapter *padapter, unsigned char *da, unsigned int p pmlmeext->mgnt_seq++; set_frame_sub_type(pframe, IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC); - pframe += sizeof(struct rtw_ieee80211_hdr_3addr) + a4_shift; - pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr) + a4_shift; + pframe += sizeof(struct ieee80211_hdr_3addr) + a4_shift; + pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr) + a4_shift; pattrib->last_txcmdsz = pattrib->pktlen; @@ -9586,7 +9585,7 @@ static int _issue_qos_nulldata(_adapter *padapter, unsigned char *da, u16 tid, u struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; unsigned char *pframe; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; unsigned short *fctrl, *qc; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); @@ -9615,9 +9614,9 @@ static int _issue_qos_nulldata(_adapter *padapter, unsigned char *da, u16 tid, u memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; if (MLME_IS_AP(padapter)) @@ -9661,8 +9660,8 @@ static int _issue_qos_nulldata(_adapter *padapter, unsigned char *da, u16 tid, u pmlmeext->mgnt_seq++; set_frame_sub_type(pframe, IEEE80211_FTYPE_DATA | IEEE80211_STYPE_QOS_NULLFUNC); - pframe += sizeof(struct rtw_ieee80211_hdr_3addr_qos) + a4_shift; - pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr_qos) + a4_shift; + pframe += sizeof(struct ieee80211_qos_hdr) + a4_shift; + pattrib->pktlen = sizeof(struct ieee80211_qos_hdr) + a4_shift; pattrib->last_txcmdsz = pattrib->pktlen; @@ -9738,7 +9737,7 @@ static int _issue_deauth(_adapter *padapter, unsigned char *da, unsigned short r struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; unsigned char *pframe; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; unsigned short *fctrl; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); @@ -9772,9 +9771,9 @@ static int _issue_deauth(_adapter *padapter, unsigned char *da, unsigned short r memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; memcpy(pwlanhdr->addr1, da, ETH_ALEN); @@ -9785,8 +9784,8 @@ static int _issue_deauth(_adapter *padapter, unsigned char *da, unsigned short r pmlmeext->mgnt_seq++; set_frame_sub_type(pframe, IEEE80211_STYPE_DEAUTH); - pframe += sizeof(struct rtw_ieee80211_hdr_3addr); - pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pframe += sizeof(struct ieee80211_hdr_3addr); + pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr); reason = cpu_to_le16(reason); pframe = rtw_set_fixed_ie(pframe, _RSON_CODE_ , (unsigned char *)&reason, &(pattrib->pktlen)); @@ -9873,7 +9872,7 @@ void issue_action_spct_ch_switch(_adapter *padapter, u8 *ra, u8 new_ch, u8 ch_of struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; unsigned char *pframe; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; unsigned short *fctrl; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); @@ -9895,9 +9894,9 @@ void issue_action_spct_ch_switch(_adapter *padapter, u8 *ra, u8 new_ch, u8 ch_of memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; memcpy(pwlanhdr->addr1, ra, ETH_ALEN); /* RA */ @@ -9908,14 +9907,14 @@ void issue_action_spct_ch_switch(_adapter *padapter, u8 *ra, u8 new_ch, u8 ch_of pmlmeext->mgnt_seq++; set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); - pframe += sizeof(struct rtw_ieee80211_hdr_3addr); - pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pframe += sizeof(struct ieee80211_hdr_3addr); + pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr); /* category, action */ { u8 category, action; category = WLAN_CATEGORY_SPECTRUM_MGMT; - action = RTW_WLAN_ACTION_SPCT_CHL_SWITCH; + action = WLAN_ACTION_SPCT_CHL_SWITCH; pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); @@ -9939,7 +9938,7 @@ void issue_action_SA_Query(_adapter *padapter, unsigned char *raddr, unsigned ch struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; u8 *pframe; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; u16 *fctrl; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); @@ -9967,9 +9966,9 @@ void issue_action_SA_Query(_adapter *padapter, unsigned char *raddr, unsigned ch memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; if (raddr) @@ -9983,8 +9982,8 @@ void issue_action_SA_Query(_adapter *padapter, unsigned char *raddr, unsigned ch pmlmeext->mgnt_seq++; set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); - pframe += sizeof(struct rtw_ieee80211_hdr_3addr); - pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pframe += sizeof(struct ieee80211_hdr_3addr); + pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr); pframe = rtw_set_fixed_ie(pframe, 1, &category, &pattrib->pktlen); pframe = rtw_set_fixed_ie(pframe, 1, &action, &pattrib->pktlen); @@ -10045,7 +10044,7 @@ static int issue_action_ba(_adapter *padapter, unsigned char *raddr, unsigned ch struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; u8 *pframe; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; u16 *fctrl; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); @@ -10070,9 +10069,9 @@ static int issue_action_ba(_adapter *padapter, unsigned char *raddr, unsigned ch memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; /* memcpy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); */ @@ -10084,8 +10083,8 @@ static int issue_action_ba(_adapter *padapter, unsigned char *raddr, unsigned ch pmlmeext->mgnt_seq++; set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); - pframe += sizeof(struct rtw_ieee80211_hdr_3addr); - pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pframe += sizeof(struct ieee80211_hdr_3addr); + pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr); pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); @@ -10371,7 +10370,7 @@ void issue_action_BSSCoexistPacket(_adapter *padapter) struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; unsigned char *pframe; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; unsigned short *fctrl; struct wlan_network *pnetwork = NULL; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); @@ -10395,7 +10394,7 @@ void issue_action_BSSCoexistPacket(_adapter *padapter) category = WLAN_CATEGORY_PUBLIC; - action = ACT_PUBLIC_BSSCOEXIST; + action = WLAN_PUB_ACTION_20_40_BSS_COEX; pmgntframe = alloc_mgtxmitframe(pxmitpriv); if (pmgntframe == NULL) @@ -10408,9 +10407,9 @@ void issue_action_BSSCoexistPacket(_adapter *padapter) memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; memcpy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); @@ -10421,8 +10420,8 @@ void issue_action_BSSCoexistPacket(_adapter *padapter) pmlmeext->mgnt_seq++; set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); - pframe += sizeof(struct rtw_ieee80211_hdr_3addr); - pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pframe += sizeof(struct ieee80211_hdr_3addr); + pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr); pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); @@ -10524,7 +10523,7 @@ int _issue_action_SM_PS(_adapter *padapter , unsigned char *raddr , u8 NewMimoP struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; unsigned char *pframe; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; unsigned short *fctrl; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); @@ -10558,9 +10557,9 @@ int _issue_action_SM_PS(_adapter *padapter , unsigned char *raddr , u8 NewMimoP memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; memcpy(pwlanhdr->addr1, raddr, ETH_ALEN); /* RA */ @@ -10571,8 +10570,8 @@ int _issue_action_SM_PS(_adapter *padapter , unsigned char *raddr , u8 NewMimoP pmlmeext->mgnt_seq++; set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); - pframe += sizeof(struct rtw_ieee80211_hdr_3addr); - pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pframe += sizeof(struct ieee80211_hdr_3addr); + pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr); /* category, action */ pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); @@ -10917,7 +10916,7 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - len = packet_len - sizeof(struct rtw_ieee80211_hdr_3addr); + len = packet_len - sizeof(struct ieee80211_hdr_3addr); if (len > MAX_IE_SZ) { /* RTW_INFO("IE too long for survey event\n"); */ @@ -10949,7 +10948,7 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI /* below is to copy the information element */ bssid->IELength = len; - memcpy(bssid->IEs, (pframe + sizeof(struct rtw_ieee80211_hdr_3addr)), bssid->IELength); + memcpy(bssid->IEs, (pframe + sizeof(struct ieee80211_hdr_3addr)), bssid->IELength); /* get the signal strength */ /* bssid->Rssi = precv_frame->u.hdr.attrib.SignalStrength; */ /* 0-100 index. */ @@ -13284,8 +13283,8 @@ void rtw_ft_update_bcn(_adapter *padapter, union recv_frame *precv_frame) /* check the vendor of the assoc AP */ pmlmeinfo->assoc_AP_vendor = - check_assoc_AP(pframe+sizeof(struct rtw_ieee80211_hdr_3addr), - (len - sizeof(struct rtw_ieee80211_hdr_3addr))); + check_assoc_AP(pframe+sizeof(struct ieee80211_hdr_3addr), + (len - sizeof(struct ieee80211_hdr_3addr))); /* update TSF Value */ update_TSF(pmlmeext, pframe, len); @@ -13305,9 +13304,9 @@ void rtw_ft_start_clnt_join(_adapter *padapter) if (rtw_ft_otd_roam(padapter)) { pmlmeinfo->state = WIFI_FW_AUTH_SUCCESS | WIFI_FW_STATION_STATE; pft_roam->ft_event.ies = - (pft_roam->ft_action + sizeof(struct rtw_ieee80211_hdr_3addr) + 16); + (pft_roam->ft_action + sizeof(struct ieee80211_hdr_3addr) + 16); pft_roam->ft_event.ies_len = - (pft_roam->ft_action_len - sizeof(struct rtw_ieee80211_hdr_3addr)); + (pft_roam->ft_action_len - sizeof(struct ieee80211_hdr_3addr)); /*Not support RIC*/ pft_roam->ft_event.ric_ies = NULL; @@ -13437,9 +13436,9 @@ u8 rtw_ft_update_auth_rsp_ies(_adapter *padapter, u8 *pframe, u32 len) rtw_buf_update(&pmlmepriv->auth_rsp, &pmlmepriv->auth_rsp_len, pframe, len); pft_roam->ft_event.ies = - (pmlmepriv->auth_rsp + sizeof(struct rtw_ieee80211_hdr_3addr) + 6); + (pmlmepriv->auth_rsp + sizeof(struct ieee80211_hdr_3addr) + 6); pft_roam->ft_event.ies_len = - (pmlmepriv->auth_rsp_len - sizeof(struct rtw_ieee80211_hdr_3addr) - 6); + (pmlmepriv->auth_rsp_len - sizeof(struct ieee80211_hdr_3addr) - 6); /*Not support RIC*/ pft_roam->ft_event.ric_ies = NULL; @@ -13478,7 +13477,7 @@ void rtw_ft_issue_action_req(_adapter *padapter, u8 *pTargetAddr) struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); struct xmit_frame *pmgntframe; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; struct pkt_attrib *pattrib; u8 *pframe; u8 category = WLAN_CATEGORY_FAST_BBS_TRANSITION; @@ -13493,8 +13492,8 @@ void rtw_ft_issue_action_req(_adapter *padapter, u8 *pTargetAddr) memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; - pwlanhdr->frame_ctl = 0; + pwlanhdr = (struct ieee80211_hdr *)pframe; + pwlanhdr->frame_control = 0; memcpy(pwlanhdr->addr1, get_my_bssid(&pmlmeinfo->network), ETH_ALEN); memcpy(pwlanhdr->addr2, adapter_mac_addr(padapter), ETH_ALEN); @@ -13504,8 +13503,8 @@ void rtw_ft_issue_action_req(_adapter *padapter, u8 *pTargetAddr) pmlmeext->mgnt_seq++; set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); - pframe += sizeof(struct rtw_ieee80211_hdr_3addr); - pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pframe += sizeof(struct ieee80211_hdr_3addr); + pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr); pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); @@ -16725,7 +16724,7 @@ u8 rtw_getmacreg_hdl(_adapter *padapter, u8 *pbuf) int rtw_sae_preprocess(_adapter *adapter, const u8 *buf, u32 len, u8 tx) { #ifdef CONFIG_IOCTL_CFG80211 - const u8 *frame_body = buf + sizeof(struct rtw_ieee80211_hdr_3addr); + const u8 *frame_body = buf + sizeof(struct ieee80211_hdr_3addr); u16 alg; u16 seq; u16 status; diff --git a/core/rtw_mp.c b/core/rtw_mp.c index 4114604..81c8a85 100644 --- a/core/rtw_mp.c +++ b/core/rtw_mp.c @@ -1830,7 +1830,7 @@ void SetPacketTx(PADAPTER padapter) { u8 *ptr, *pkt_start, *pkt_end; u32 pkt_size, i; - struct rtw_ieee80211_hdr *hdr; + struct ieee80211_hdr *hdr; u8 payload; bool bmcast; struct pkt_attrib *pattrib; @@ -1943,8 +1943,8 @@ void SetPacketTx(PADAPTER padapter) #endif /* 3 4. make wlan header, make_wlanhdr() */ - hdr = (struct rtw_ieee80211_hdr *)pkt_start; - set_frame_sub_type(&hdr->frame_ctl, pattrib->subtype); + hdr = (struct ieee80211_hdr *)pkt_start; + set_frame_sub_type(&hdr->frame_control, pattrib->subtype); memcpy(hdr->addr1, pattrib->dst, ETH_ALEN); /* DA */ memcpy(hdr->addr2, pattrib->src, ETH_ALEN); /* SA */ diff --git a/core/rtw_mp_ioctl.c b/core/rtw_mp_ioctl.c index 096b980..35b1b0e 100644 --- a/core/rtw_mp_ioctl.c +++ b/core/rtw_mp_ioctl.c @@ -2249,7 +2249,7 @@ unsigned int mp_ioctl_xmit_packet_hdl(struct oid_par_priv *poid_par_priv) unsigned char *pframe, *pmp_pkt; struct ethhdr *pethhdr; struct pkt_attrib *pattrib; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; unsigned short *fctrl; int llc_sz, payload_len; struct mp_xmit_frame *pxframe = NULL; @@ -2295,9 +2295,9 @@ unsigned int mp_ioctl_xmit_packet_hdl(struct oid_par_priv *poid_par_priv) memset(pxframe->mem, 0 , WLANHDR_OFFSET); pframe = (u8 *)(pxframe->mem) + WLANHDR_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; set_frame_sub_type(pframe, (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA)); diff --git a/core/rtw_p2p.c b/core/rtw_p2p.c index 47394c9..f6cbde8 100644 --- a/core/rtw_p2p.c +++ b/core/rtw_p2p.c @@ -143,7 +143,7 @@ static void issue_group_disc_req(struct wifidirect_info *pwdinfo, u8 *da) struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; unsigned char *pframe; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; unsigned short *fctrl; _adapter *padapter = pwdinfo->padapter; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); @@ -166,9 +166,9 @@ static void issue_group_disc_req(struct wifidirect_info *pwdinfo, u8 *da) memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; memcpy(pwlanhdr->addr1, da, ETH_ALEN); @@ -179,8 +179,8 @@ static void issue_group_disc_req(struct wifidirect_info *pwdinfo, u8 *da) pmlmeext->mgnt_seq++; set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); - pframe += sizeof(struct rtw_ieee80211_hdr_3addr); - pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pframe += sizeof(struct ieee80211_hdr_3addr); + pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr); /* Build P2P action frame header */ pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); @@ -201,7 +201,7 @@ static void issue_p2p_devdisc_resp(struct wifidirect_info *pwdinfo, u8 *da, u8 s struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; unsigned char *pframe; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; unsigned short *fctrl; _adapter *padapter = pwdinfo->padapter; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); @@ -226,9 +226,9 @@ static void issue_p2p_devdisc_resp(struct wifidirect_info *pwdinfo, u8 *da, u8 s memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; memcpy(pwlanhdr->addr1, da, ETH_ALEN); @@ -239,8 +239,8 @@ static void issue_p2p_devdisc_resp(struct wifidirect_info *pwdinfo, u8 *da, u8 s pmlmeext->mgnt_seq++; set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); - pframe += sizeof(struct rtw_ieee80211_hdr_3addr); - pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pframe += sizeof(struct ieee80211_hdr_3addr); + pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr); /* Build P2P public action frame header */ pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); @@ -286,7 +286,7 @@ static void issue_p2p_provision_resp(struct wifidirect_info *pwdinfo, u8 *raddr, struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; unsigned char *pframe; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; unsigned short *fctrl; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); @@ -303,9 +303,9 @@ static void issue_p2p_provision_resp(struct wifidirect_info *pwdinfo, u8 *raddr, memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; memcpy(pwlanhdr->addr1, raddr, ETH_ALEN); @@ -316,8 +316,8 @@ static void issue_p2p_provision_resp(struct wifidirect_info *pwdinfo, u8 *raddr, pmlmeext->mgnt_seq++; set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); - pframe += sizeof(struct rtw_ieee80211_hdr_3addr); - pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pframe += sizeof(struct ieee80211_hdr_3addr); + pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr); pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); @@ -382,7 +382,7 @@ static void issue_p2p_presence_resp(struct wifidirect_info *pwdinfo, u8 *da, u8 struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; unsigned char *pframe; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; unsigned short *fctrl; _adapter *padapter = pwdinfo->padapter; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); @@ -407,9 +407,9 @@ static void issue_p2p_presence_resp(struct wifidirect_info *pwdinfo, u8 *da, u8 memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; memcpy(pwlanhdr->addr1, da, ETH_ALEN); @@ -420,8 +420,8 @@ static void issue_p2p_presence_resp(struct wifidirect_info *pwdinfo, u8 *da, u8 pmlmeext->mgnt_seq++; set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); - pframe += sizeof(struct rtw_ieee80211_hdr_3addr); - pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pframe += sizeof(struct ieee80211_hdr_3addr); + pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr); /* Build P2P action frame header */ pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); @@ -2428,7 +2428,7 @@ u32 process_p2p_devdisc_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint le u8 *p2p_ie; u32 p2p_ielen = 0; - frame_body = (unsigned char *)(pframe + sizeof(struct rtw_ieee80211_hdr_3addr)); + frame_body = (unsigned char *)(pframe + sizeof(struct ieee80211_hdr_3addr)); dialogToken = frame_body[7]; status = P2P_STATUS_FAIL_UNKNOWN_P2PGROUP; @@ -2506,7 +2506,7 @@ u8 process_p2p_provdisc_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint l u16 uconfig_method = 0; - frame_body = (pframe + sizeof(struct rtw_ieee80211_hdr_3addr)); + frame_body = (pframe + sizeof(struct ieee80211_hdr_3addr)); wpsie = rtw_get_wps_ie(frame_body + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_IE_OFFSET_, NULL, &wps_ielen); if (wpsie) { @@ -3050,7 +3050,7 @@ u8 process_p2p_presence_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint le u8 dialogToken = 0; u8 status = P2P_STATUS_SUCCESS; - frame_body = (unsigned char *)(pframe + sizeof(struct rtw_ieee80211_hdr_3addr)); + frame_body = (unsigned char *)(pframe + sizeof(struct ieee80211_hdr_3addr)); dialogToken = frame_body[6]; @@ -3735,7 +3735,7 @@ u32 rtw_xframe_build_wfd_ie(struct xmit_frame *xframe) _adapter *adapter = xframe->padapter; struct wifidirect_info *wdinfo = &adapter->wdinfo; u8 *frame = xframe->buf_addr + TXDESC_OFFSET; - u8 *frame_body = frame + sizeof(struct rtw_ieee80211_hdr_3addr); + u8 *frame_body = frame + sizeof(struct ieee80211_hdr_3addr); u8 *frame_tail = frame + xframe->attrib.pktlen; u8 category, action, OUI_Subtype, dialogToken = 0; u32 wfdielen = 0; @@ -3743,7 +3743,7 @@ u32 rtw_xframe_build_wfd_ie(struct xmit_frame *xframe) category = frame_body[0]; if (category == WLAN_CATEGORY_PUBLIC) { action = frame_body[1]; - if (action == ACT_PUBLIC_VENDOR + if (action == WLAN_PUB_ACTION_VENDOR_SPECIFIC && _rtw_memcmp(frame_body + 2, P2P_OUI, 4) == _TRUE ) { OUI_Subtype = frame_body[6]; @@ -3812,7 +3812,7 @@ bool rtw_xframe_del_wfd_ie(struct xmit_frame *xframe) { #define DBG_XFRAME_DEL_WFD_IE 0 u8 *frame = xframe->buf_addr + TXDESC_OFFSET; - u8 *frame_body = frame + sizeof(struct rtw_ieee80211_hdr_3addr); + u8 *frame_body = frame + sizeof(struct ieee80211_hdr_3addr); u8 *frame_tail = frame + xframe->attrib.pktlen; u8 category, action, OUI_Subtype; u8 *ies = NULL; @@ -3822,7 +3822,7 @@ bool rtw_xframe_del_wfd_ie(struct xmit_frame *xframe) category = frame_body[0]; if (category == WLAN_CATEGORY_PUBLIC) { action = frame_body[1]; - if (action == ACT_PUBLIC_VENDOR + if (action == WLAN_PUB_ACTION_VENDOR_SPECIFIC && _rtw_memcmp(frame_body + 2, P2P_OUI, 4) == _TRUE ) { OUI_Subtype = frame_body[6]; @@ -3958,12 +3958,12 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx) u8 *iaddr = NULL; u8 *gbssid = NULL; - frame_body = (unsigned char *)(buf + sizeof(struct rtw_ieee80211_hdr_3addr)); + frame_body = (unsigned char *)(buf + sizeof(struct ieee80211_hdr_3addr)); category = frame_body[0]; /* just for check */ if (category == WLAN_CATEGORY_PUBLIC) { action = frame_body[1]; - if (action == ACT_PUBLIC_VENDOR + if (action == WLAN_PUB_ACTION_VENDOR_SPECIFIC && _rtw_memcmp(frame_body + 2, P2P_OUI, 4) == _TRUE ) { OUI_Subtype = frame_body[6]; @@ -3971,13 +3971,13 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx) is_p2p_frame = OUI_Subtype; #ifdef CONFIG_DEBUG_CFG80211 - RTW_INFO("ACTION_CATEGORY_PUBLIC: ACT_PUBLIC_VENDOR, OUI=0x%x, OUI_Subtype=%d, dialogToken=%d\n", + RTW_INFO("ACTION_CATEGORY_PUBLIC: WLAN_PUB_ACTION_VENDOR_SPECIFIC , OUI=0x%x, OUI_Subtype=%d, dialogToken=%d\n", cpu_to_be32(*((u32 *)(frame_body + 2))), OUI_Subtype, dialogToken); #endif p2p_ie = rtw_get_p2p_ie( - (u8 *)buf + sizeof(struct rtw_ieee80211_hdr_3addr) + _PUBLIC_ACTION_IE_OFFSET_ - , len - sizeof(struct rtw_ieee80211_hdr_3addr) - _PUBLIC_ACTION_IE_OFFSET_ + (u8 *)buf + sizeof(struct ieee80211_hdr_3addr) + _PUBLIC_ACTION_IE_OFFSET_ + , len - sizeof(struct ieee80211_hdr_3addr) - _PUBLIC_ACTION_IE_OFFSET_ , NULL, &p2p_ielen); switch (OUI_Subtype) { /* OUI Subtype */ @@ -3996,7 +3996,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx) #if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT) if (rtw_mi_check_status(padapter, MI_LINKED) && padapter->registrypriv.full_ch_in_p2p_handshake == 0) - rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len - sizeof(struct rtw_ieee80211_hdr_3addr)); + rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len - sizeof(struct ieee80211_hdr_3addr)); #endif } @@ -4036,10 +4036,10 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx) if (!tx) { #if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT) if (rtw_mi_check_status(padapter, MI_LINKED) - && rtw_chk_p2pie_ch_list_with_buddy(padapter, frame_body, len - sizeof(struct rtw_ieee80211_hdr_3addr)) == _FALSE + && rtw_chk_p2pie_ch_list_with_buddy(padapter, frame_body, len - sizeof(struct ieee80211_hdr_3addr)) == _FALSE && padapter->registrypriv.full_ch_in_p2p_handshake == 0) { RTW_INFO(FUNC_ADPT_FMT" ch_list has no intersect with buddy\n", FUNC_ADPT_ARG(padapter)); - rtw_change_p2pie_ch_list(padapter, frame_body, len - sizeof(struct rtw_ieee80211_hdr_3addr), 0); + rtw_change_p2pie_ch_list(padapter, frame_body, len - sizeof(struct ieee80211_hdr_3addr), 0); } #endif } @@ -4052,7 +4052,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx) if (tx) { #if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT) if (rtw_mi_check_status(padapter, MI_LINKED) && padapter->registrypriv.full_ch_in_p2p_handshake == 0) - rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len - sizeof(struct rtw_ieee80211_hdr_3addr)); + rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len - sizeof(struct ieee80211_hdr_3addr)); #endif } @@ -4093,10 +4093,10 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx) pwdev_priv->provdisc_req_issued = _FALSE; #if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT) if (rtw_mi_check_status(padapter, MI_LINKED) - && rtw_chk_p2pie_ch_list_with_buddy(padapter, frame_body, len - sizeof(struct rtw_ieee80211_hdr_3addr)) == _FALSE + && rtw_chk_p2pie_ch_list_with_buddy(padapter, frame_body, len - sizeof(struct ieee80211_hdr_3addr)) == _FALSE && padapter->registrypriv.full_ch_in_p2p_handshake == 0) { RTW_INFO(FUNC_ADPT_FMT" ch_list has no intersect with buddy\n", FUNC_ADPT_ARG(padapter)); - rtw_change_p2pie_ch_list(padapter, frame_body, len - sizeof(struct rtw_ieee80211_hdr_3addr), 0); + rtw_change_p2pie_ch_list(padapter, frame_body, len - sizeof(struct ieee80211_hdr_3addr), 0); } #endif } @@ -4110,7 +4110,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx) if (tx) { #if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT) if (rtw_mi_check_status(padapter, MI_LINKED) && padapter->registrypriv.full_ch_in_p2p_handshake == 0) - rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len - sizeof(struct rtw_ieee80211_hdr_3addr)); + rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len - sizeof(struct ieee80211_hdr_3addr)); #endif } @@ -4153,7 +4153,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx) #if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT) if (rtw_mi_check_status(padapter, MI_LINKED) && padapter->registrypriv.full_ch_in_p2p_handshake == 0) - rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len - sizeof(struct rtw_ieee80211_hdr_3addr)); + rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len - sizeof(struct ieee80211_hdr_3addr)); #endif } @@ -4190,14 +4190,14 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx) #if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT) if (rtw_mi_check_status(padapter, MI_LINKED) && padapter->registrypriv.full_ch_in_p2p_handshake == 0) { #if defined(CONFIG_P2P_INVITE_IOT) - if (op_ch != -1 && rtw_chk_p2pie_op_ch_with_buddy(padapter, frame_body, len - sizeof(struct rtw_ieee80211_hdr_3addr)) == _FALSE) { + if (op_ch != -1 && rtw_chk_p2pie_op_ch_with_buddy(padapter, frame_body, len - sizeof(struct ieee80211_hdr_3addr)) == _FALSE) { RTW_INFO(FUNC_ADPT_FMT" op_ch:%u has no intersect with buddy\n", FUNC_ADPT_ARG(padapter), op_ch); - rtw_change_p2pie_ch_list(padapter, frame_body, len - sizeof(struct rtw_ieee80211_hdr_3addr), 0); + rtw_change_p2pie_ch_list(padapter, frame_body, len - sizeof(struct ieee80211_hdr_3addr), 0); } else #endif - if (rtw_chk_p2pie_ch_list_with_buddy(padapter, frame_body, len - sizeof(struct rtw_ieee80211_hdr_3addr)) == _FALSE) { + if (rtw_chk_p2pie_ch_list_with_buddy(padapter, frame_body, len - sizeof(struct ieee80211_hdr_3addr)) == _FALSE) { RTW_INFO(FUNC_ADPT_FMT" ch_list has no intersect with buddy\n", FUNC_ADPT_ARG(padapter)); - rtw_change_p2pie_ch_list(padapter, frame_body, len - sizeof(struct rtw_ieee80211_hdr_3addr), 0); + rtw_change_p2pie_ch_list(padapter, frame_body, len - sizeof(struct ieee80211_hdr_3addr), 0); } } #endif @@ -4211,7 +4211,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx) if (tx) { #if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT) if (rtw_mi_check_status(padapter, MI_LINKED) && padapter->registrypriv.full_ch_in_p2p_handshake == 0) - rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len - sizeof(struct rtw_ieee80211_hdr_3addr)); + rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len - sizeof(struct ieee80211_hdr_3addr)); #endif } @@ -4261,7 +4261,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx) RTW_INFO("RTW_%s:P2P_DEVDISC_RESP, dialogToken=%d, status:%d\n", (tx == _TRUE) ? "Tx" : "Rx", dialogToken, cont ? *cont : -1); break; case P2P_PROVISION_DISC_REQ: { - size_t frame_body_len = len - sizeof(struct rtw_ieee80211_hdr_3addr); + size_t frame_body_len = len - sizeof(struct ieee80211_hdr_3addr); u8 *p2p_ie; uint p2p_ielen = 0; uint contentlen = 0; diff --git a/core/rtw_recv.c b/core/rtw_recv.c index 45d0e3f..5bc6501 100644 --- a/core/rtw_recv.c +++ b/core/rtw_recv.c @@ -177,7 +177,7 @@ void _rtw_free_recv_priv(struct recv_priv *precvpriv) bool rtw_rframe_del_wfd_ie(union recv_frame *rframe, u8 ies_offset) { #define DBG_RFRAME_DEL_WFD_IE 0 - u8 *ies = rframe->u.hdr.rx_data + sizeof(struct rtw_ieee80211_hdr_3addr) + ies_offset; + u8 *ies = rframe->u.hdr.rx_data + sizeof(struct ieee80211_hdr_3addr) + ies_offset; uint ies_len_ori = rframe->u.hdr.len - (ies - rframe->u.hdr.rx_data); uint ies_len; @@ -1762,7 +1762,7 @@ static sint validate_mgmt_protect(_adapter *adapter, union recv_frame *precv_fra } else { RTW_INFO(FUNC_ADPT_FMT" bmc:%u, action(%u), privacy:%u, encrypt:%u, bdecrypted:%u\n" , FUNC_ADPT_ARG(adapter), is_bmc - , *(ptr + sizeof(struct rtw_ieee80211_hdr_3addr)) + , *(ptr + sizeof(struct ieee80211_hdr_3addr)) , pattrib->privacy, pattrib->encrypt, pattrib->bdecrypted); } } @@ -1775,7 +1775,7 @@ static sint validate_mgmt_protect(_adapter *adapter, union recv_frame *precv_fra } if (subtype == IEEE80211_STYPE_ACTION) - category = *(ptr + sizeof(struct rtw_ieee80211_hdr_3addr)); + category = *(ptr + sizeof(struct ieee80211_hdr_3addr)); if (is_bmc) { /* broadcast cases */ @@ -1873,7 +1873,7 @@ bip_verify: /* cases to decrypt mgmt frame */ pattrib->bdecrypted = 0; pattrib->encrypt = _AES_; - pattrib->hdrlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pattrib->hdrlen = sizeof(struct ieee80211_hdr_3addr); /* set iv and icv length */ SET_ICE_IV_LEN(pattrib->iv_len, pattrib->icv_len, pattrib->encrypt); @@ -3049,7 +3049,7 @@ int amsdu_to_msdu(_adapter *padapter, union recv_frame *prframe) #ifdef CONFIG_RTW_MESH if (MLME_IS_MESH(padapter)) { u8 *mda = pdata, *msa = pdata + ETH_ALEN; - struct rtw_ieee80211s_hdr *mctrl = (struct rtw_ieee80211s_hdr *)(pdata + ETH_HLEN); + struct ieee80211s_hdr *mctrl = (struct ieee80211s_hdr *)(pdata + ETH_HLEN); int v_ret; v_ret = rtw_mesh_rx_data_validate_mctrl(padapter, prframe @@ -3167,7 +3167,7 @@ static int recv_process_mpdu(_adapter *padapter, union recv_frame *prframe) act = rtw_mesh_rx_msdu_act_check(prframe , pattrib->mda, pattrib->msa , pattrib->dst, pattrib->src - , (struct rtw_ieee80211s_hdr *)(get_recvframe_data(prframe) + pattrib->hdrlen + pattrib->iv_len) + , (struct ieee80211s_hdr *)(get_recvframe_data(prframe) + pattrib->hdrlen + pattrib->iv_len) , &fwd_frame, &b2u_list); } #endif diff --git a/core/rtw_rm.c b/core/rtw_rm.c index 834db77..5874918 100644 --- a/core/rtw_rm.c +++ b/core/rtw_rm.c @@ -319,7 +319,7 @@ static u8 *build_wlan_hdr(_adapter *padapter, struct xmit_frame *pmgntframe, u8 *pframe; u16 *fctrl; struct pkt_attrib *pattr; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; @@ -331,9 +331,9 @@ static u8 *build_wlan_hdr(_adapter *padapter, struct xmit_frame *pmgntframe, memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; memcpy(pwlanhdr->addr1, psta->cmn.mac_addr, ETH_ALEN); @@ -349,8 +349,8 @@ static u8 *build_wlan_hdr(_adapter *padapter, struct xmit_frame *pmgntframe, set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); - pframe += sizeof(struct rtw_ieee80211_hdr_3addr); - pattr->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pframe += sizeof(struct ieee80211_hdr_3addr); + pattr->pktlen = sizeof(struct ieee80211_hdr_3addr); return pframe; } @@ -763,7 +763,7 @@ int rm_recv_radio_mens_req(_adapter *padapter, struct rm_obj *prm; struct rm_priv *prmpriv = &padapter->rmpriv; u8 *pdiag_body = (u8 *)(precv_frame->u.hdr.rx_data + - sizeof(struct rtw_ieee80211_hdr_3addr)); + sizeof(struct ieee80211_hdr_3addr)); u8 *pmeas_body = &pdiag_body[5]; u8 rmid, update = 0; @@ -863,7 +863,7 @@ int rm_recv_radio_mens_rep(_adapter *padapter, struct rm_obj *prm; u32 rmid; u8 *pdiag_body = (u8 *)(precv_frame->u.hdr.rx_data + - sizeof(struct rtw_ieee80211_hdr_3addr)); + sizeof(struct ieee80211_hdr_3addr)); u8 *pmeas_body = &pdiag_body[3]; @@ -907,7 +907,7 @@ int rm_radio_mens_nb_rep(_adapter *padapter, union recv_frame *precv_frame, struct sta_info *psta) { u8 *pdiag_body = (u8 *)(precv_frame->u.hdr.rx_data + - sizeof(struct rtw_ieee80211_hdr_3addr)); + sizeof(struct ieee80211_hdr_3addr)); u8 *pmeas_body = &pdiag_body[3]; u32 len = precv_frame->u.hdr.len; u32 rmid; @@ -938,7 +938,7 @@ int rm_radio_mens_nb_rep(_adapter *padapter, #ifdef CONFIG_LAYER2_ROAMING if (rtw_wnm_btm_candidates_survey(padapter ,(pdiag_body + 3) - ,(len - sizeof(struct rtw_ieee80211_hdr_3addr)) + ,(len - sizeof(struct ieee80211_hdr_3addr)) ,_FALSE) == _FAIL) return _FALSE; #endif @@ -954,7 +954,7 @@ unsigned int rm_on_action(_adapter *padapter, union recv_frame *precv_frame) u8 *pframe_body = NULL; u8 action_code = 0; u8 diag_token = 0; - struct rtw_ieee80211_hdr_3addr *whdr; + struct ieee80211_hdr_3addr *whdr; struct sta_info *psta; @@ -965,7 +965,7 @@ unsigned int rm_on_action(_adapter *padapter, union recv_frame *precv_frame) GetAddr1Ptr(pframe), ETH_ALEN)) goto exit; - whdr = (struct rtw_ieee80211_hdr_3addr *)pframe; + whdr = (struct ieee80211_hdr_3addr *)pframe; RTW_INFO("RM: %s bssid = " MAC_FMT "\n", __func__, MAC_ARG(whdr->addr2)); @@ -977,7 +977,7 @@ unsigned int rm_on_action(_adapter *padapter, union recv_frame *precv_frame) } pframe_body = (unsigned char *)(pframe + - sizeof(struct rtw_ieee80211_hdr_3addr)); + sizeof(struct ieee80211_hdr_3addr)); /* Figure 8-438 radio measurement request frame Action field format */ /* Category = pframe_body[0] = 5 (Radio Measurement) */ diff --git a/core/rtw_security.c b/core/rtw_security.c index 526cb03..e209f7b 100644 --- a/core/rtw_security.c +++ b/core/rtw_security.c @@ -2041,7 +2041,7 @@ u32 rtw_BIP_verify(_adapter *padapter, u8 *whdr_pos, sint flen uint len, ori_len; u16 pkt_keyid = 0; u64 pkt_ipn = 0; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; u8 mic[16]; mme = whdr_pos + flen - 18; @@ -2073,7 +2073,7 @@ u32 rtw_BIP_verify(_adapter *padapter, u8 *whdr_pos, sint flen } /* mapping to wlan header */ - pwlanhdr = (struct rtw_ieee80211_hdr *)whdr_pos; + pwlanhdr = (struct ieee80211_hdr *)whdr_pos; /* save the frame body + MME */ memcpy(BIP_AAD + BIP_AAD_SIZE, whdr_pos + WLAN_HDR_A3_LEN, flen - WLAN_HDR_A3_LEN); @@ -2085,7 +2085,7 @@ u32 rtw_BIP_verify(_adapter *padapter, u8 *whdr_pos, sint flen memset(mme + 10, 0, 8); /* conscruct AAD, copy frame control field */ - memcpy(BIP_AAD, &pwlanhdr->frame_ctl, 2); + memcpy(BIP_AAD, &pwlanhdr->frame_control, 2); ClearRetry(BIP_AAD); ClearPwrMgt(BIP_AAD); ClearMData(BIP_AAD); diff --git a/core/rtw_tdls.c b/core/rtw_tdls.c index bd91838..14c82a5 100644 --- a/core/rtw_tdls.c +++ b/core/rtw_tdls.c @@ -282,7 +282,7 @@ int _issue_nulldata_to_TDLS_peer_STA(_adapter *padapter, unsigned char *da, unsi struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; unsigned char *pframe; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; unsigned short *fctrl, *qc; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); @@ -305,9 +305,9 @@ int _issue_nulldata_to_TDLS_peer_STA(_adapter *padapter, unsigned char *da, unsi memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; if (power_mode) @@ -329,8 +329,8 @@ int _issue_nulldata_to_TDLS_peer_STA(_adapter *padapter, unsigned char *da, unsi pmlmeext->mgnt_seq++; set_frame_sub_type(pframe, IEEE80211_FTYPE_DATA | IEEE80211_STYPE_QOS_NULLFUNC); - pframe += sizeof(struct rtw_ieee80211_hdr_3addr_qos); - pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr_qos); + pframe += sizeof(struct ieee80211_qos_hdr); + pattrib->pktlen = sizeof(struct ieee80211_qos_hdr); pattrib->last_txcmdsz = pattrib->pktlen; @@ -1505,7 +1505,7 @@ int issue_tdls_dis_rsp(_adapter *padapter, struct tdls_txmgmt *ptxmgmt, u8 priva struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; unsigned char *pframe; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; unsigned short *fctrl; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); @@ -1523,9 +1523,9 @@ int issue_tdls_dis_rsp(_adapter *padapter, struct tdls_txmgmt *ptxmgmt, u8 priva memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; /* unicast probe request frame */ @@ -1540,8 +1540,8 @@ int issue_tdls_dis_rsp(_adapter *padapter, struct tdls_txmgmt *ptxmgmt, u8 priva pmlmeext->mgnt_seq++; set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); - pframe += sizeof(struct rtw_ieee80211_hdr_3addr); - pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pframe += sizeof(struct ieee80211_hdr_3addr); + pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr); rtw_build_tdls_dis_rsp_ies(padapter, pmgntframe, pframe, ptxmgmt, privacy); diff --git a/core/rtw_wapi_sms4.c b/core/rtw_wapi_sms4.c index 5acdf84..1cb251c 100644 --- a/core/rtw_wapi_sms4.c +++ b/core/rtw_wapi_sms4.c @@ -310,7 +310,7 @@ void SecCalculateMicSMS4( memcpy((TempBuf + 16), (pHeader + 16), 6); /* Addr3 */ - fc = le16_to_cpu(header->frame_ctl); + fc = le16_to_cpu(header->frame_control); @@ -473,7 +473,7 @@ u8 WapiCheckPnInSwDecrypt( header = (struct ieee80211_hdr_3addr_qos *)pskb->data; pTaddr = header->addr2; pRaddr = header->addr1; - fc = le16_to_cpu(header->frame_ctl); + fc = le16_to_cpu(header->frame_control); if (GetToDs(&fc)) pDaddr = header->addr3; diff --git a/core/rtw_wlan_util.c b/core/rtw_wlan_util.c index 1ef4098..61ec1c9 100644 --- a/core/rtw_wlan_util.c +++ b/core/rtw_wlan_util.c @@ -2263,7 +2263,7 @@ int check_ielen(u8 *start, uint len) int validate_beacon_len(u8 *pframe, u32 len) { - u8 ie_offset = _BEACON_IE_OFFSET_ + sizeof(struct rtw_ieee80211_hdr_3addr); + u8 ie_offset = _BEACON_IE_OFFSET_ + sizeof(struct ieee80211_hdr_3addr); if (len < ie_offset) { RTW_INFO("%s: incorrect beacon length(%d)\n", __func__, len); @@ -2422,7 +2422,7 @@ void rtw_debug_rx_bcn(_adapter *adapter, u8 *pframe, u32 packet_len) { struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv; struct mlme_ext_info *mlmeinfo = &(pmlmeext->mlmext_info); - u16 sn = ((struct rtw_ieee80211_hdr_3addr *)pframe)->seq_ctl >> 4; + u16 sn = ((struct ieee80211_hdr_3addr *)pframe)->seq_ctl >> 4; u64 tsf, tsf_offset; u8 dtim_cnt, dtim_period, tim_bmap, tim_pvbit; @@ -2468,8 +2468,8 @@ int rtw_get_bcn_keys(ADAPTER *Adapter, u8 *pframe, u32 packet_len, capability = le16_to_cpu(*(unsigned short *)(pframe + WLAN_HDR_A3_LEN + 10)); /* checking IEs */ - left = packet_len - sizeof(struct rtw_ieee80211_hdr_3addr) - _BEACON_IE_OFFSET_; - pos = pframe + sizeof(struct rtw_ieee80211_hdr_3addr) + _BEACON_IE_OFFSET_; + left = packet_len - sizeof(struct ieee80211_hdr_3addr) - _BEACON_IE_OFFSET_; + pos = pframe + sizeof(struct ieee80211_hdr_3addr) + _BEACON_IE_OFFSET_; if (rtw_ieee802_11_parse_elems(pos, left, &elems, 1) == ParseFailed) return _FALSE; @@ -3585,7 +3585,7 @@ void update_TSF(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len) u8 *pIE; u32 *pbuf; - pIE = pframe + sizeof(struct rtw_ieee80211_hdr_3addr); + pIE = pframe + sizeof(struct ieee80211_hdr_3addr); pbuf = (u32 *)pIE; pmlmeext->TSFValue = le32_to_cpu(*(pbuf + 1)); @@ -4178,7 +4178,7 @@ unsigned int setup_beacon_frame(_adapter *padapter, unsigned char *beacon_frame) unsigned short ATIMWindow; unsigned char *pframe; struct tx_desc *ptxdesc; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; unsigned short *fctrl; unsigned int rate_len, len = 0; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); @@ -4191,9 +4191,9 @@ unsigned int setup_beacon_frame(_adapter *padapter, unsigned char *beacon_frame) pframe = beacon_frame + TXDESC_SIZE; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; memcpy(pwlanhdr->addr1, bc_addr, ETH_ALEN); @@ -4202,8 +4202,8 @@ unsigned int setup_beacon_frame(_adapter *padapter, unsigned char *beacon_frame) set_frame_sub_type(pframe, IEEE80211_STYPE_BEACON); - pframe += sizeof(struct rtw_ieee80211_hdr_3addr); - len = sizeof(struct rtw_ieee80211_hdr_3addr); + pframe += sizeof(struct ieee80211_hdr_3addr); + len = sizeof(struct ieee80211_hdr_3addr); /* timestamp will be inserted by hardware */ pframe += 8; diff --git a/core/rtw_xmit.c b/core/rtw_xmit.c index a779541..b000442 100644 --- a/core/rtw_xmit.c +++ b/core/rtw_xmit.c @@ -1720,12 +1720,12 @@ s32 rtw_make_wlanhdr(_adapter *padapter , u8 *hdr, struct pkt_attrib *pattrib) { u16 *qc; - struct rtw_ieee80211_hdr *pwlanhdr = (struct rtw_ieee80211_hdr *)hdr; + struct ieee80211_hdr *pwlanhdr = (struct ieee80211_hdr *)hdr; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct qos_priv *pqospriv = &pmlmepriv->qospriv; u8 qos_option = _FALSE; sint res = _SUCCESS; - u16 *fctrl = &pwlanhdr->frame_ctl; + u16 *fctrl =&pwlanhdr->frame_control; /* struct sta_info *psta; */ @@ -2057,7 +2057,7 @@ exit: s32 rtw_make_tdls_wlanhdr(_adapter *padapter , u8 *hdr, struct pkt_attrib *pattrib, struct tdls_txmgmt *ptxmgmt) { u16 *qc; - struct rtw_ieee80211_hdr *pwlanhdr = (struct rtw_ieee80211_hdr *)hdr; + struct ieee80211_hdr *pwlanhdr = (struct ieee80211_hdr *)hdr; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct qos_priv *pqospriv = &pmlmepriv->qospriv; struct sta_priv *pstapriv = &padapter->stapriv; @@ -2065,7 +2065,7 @@ s32 rtw_make_tdls_wlanhdr(_adapter *padapter , u8 *hdr, struct pkt_attrib *pattr u8 tdls_seq = 0, baddr[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; sint res = _SUCCESS; - u16 *fctrl = &pwlanhdr->frame_ctl; + u16 *fctrl =&pwlanhdr->frame_control; memset(hdr, 0, WLANHDR_OFFSET); @@ -2777,7 +2777,7 @@ s32 rtw_mgmt_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; u8 MME[_MME_IE_LENGTH_]; _irqL irqL; @@ -2792,14 +2792,14 @@ s32 rtw_mgmt_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame } mem_start = pframe = (u8 *)(pxmitframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; subtype = get_frame_sub_type(pframe); /* bit(7)~bit(2) */ /* check if robust mgmt frame */ if (subtype != IEEE80211_STYPE_DEAUTH && subtype != IEEE80211_STYPE_DISASSOC && subtype != IEEE80211_STYPE_ACTION) return _SUCCESS; if (subtype == IEEE80211_STYPE_ACTION) { - category = *(pframe + sizeof(struct rtw_ieee80211_hdr_3addr)); + category = *(pframe + sizeof(struct ieee80211_hdr_3addr)); if (CATEGORY_IS_NON_ROBUST(category)) return _SUCCESS; } @@ -2878,7 +2878,7 @@ s32 rtw_mgmt_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame memset(MME, 0, _MME_IE_LENGTH_); - MGMT_body = pframe + sizeof(struct rtw_ieee80211_hdr_3addr); + MGMT_body = pframe + sizeof(struct ieee80211_hdr_3addr); pframe += pattrib->pktlen; /* octent 0 and 1 is key index ,BIP keyid is 4 or 5, LSB only need octent 0 */ @@ -2891,10 +2891,10 @@ s32 rtw_mgmt_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame pframe = rtw_set_ie(pframe, WLAN_EID_MMIE , 16 , MME, &(pattrib->pktlen)); pattrib->last_txcmdsz = pattrib->pktlen; /* total frame length - header length */ - frame_body_len = pattrib->pktlen - sizeof(struct rtw_ieee80211_hdr_3addr); + frame_body_len = pattrib->pktlen - sizeof(struct ieee80211_hdr_3addr); /* conscruct AAD, copy frame control field */ - memcpy(BIP_AAD, &pwlanhdr->frame_ctl, 2); + memcpy(BIP_AAD, &pwlanhdr->frame_control, 2); ClearRetry(BIP_AAD); ClearPwrMgt(BIP_AAD); ClearMData(BIP_AAD); @@ -4371,7 +4371,7 @@ s32 rtw_monitor_xmit_entry(struct sk_buff *skb, struct net_device *ndev) struct ieee80211_radiotap_header rtap_hdr; _adapter *padapter = (_adapter *)rtw_netdev_priv(ndev); struct pkt_file pktfile; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; struct pkt_attrib *pattrib; struct xmit_frame *pmgntframe; struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); @@ -4416,8 +4416,8 @@ s32 rtw_monitor_xmit_entry(struct sk_buff *skb, struct net_device *ndev) /* Check DATA/MGNT frames */ - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; - frame_ctl = le16_to_cpu(pwlanhdr->frame_ctl); + pwlanhdr = (struct ieee80211_hdr *)pframe; + frame_ctl = le16_to_cpu(pwlanhdr->frame_control); if ((frame_ctl & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA) { pattrib = &pmgntframe->attrib; diff --git a/hal/hal_com.c b/hal/hal_com.c index 4f04c9b..0e6320e 100644 --- a/hal/hal_com.c +++ b/hal/hal_com.c @@ -5955,7 +5955,7 @@ static void rtw_hal_construct_P2PBeacon(_adapter *padapter, u8 *pframe, u32 *pLe /* struct xmit_frame *pmgntframe; */ /* struct pkt_attrib *pattrib; */ /* unsigned char *pframe; */ - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; unsigned short *fctrl; unsigned int rate_len; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); @@ -5981,10 +5981,10 @@ static void rtw_hal_construct_P2PBeacon(_adapter *padapter, u8 *pframe, u32 *pLe /* _enter_critical_bh(&pmlmepriv->bcn_update_lock, &irqL); * #endif */ /* #if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) */ - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; eth_broadcast_addr(pwlanhdr->addr1); @@ -5995,8 +5995,8 @@ static void rtw_hal_construct_P2PBeacon(_adapter *padapter, u8 *pframe, u32 *pLe /* pmlmeext->mgnt_seq++; */ set_frame_sub_type(pframe, IEEE80211_STYPE_BEACON); - pframe += sizeof(struct rtw_ieee80211_hdr_3addr); - pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pframe += sizeof(struct ieee80211_hdr_3addr); + pktlen = sizeof(struct ieee80211_hdr_3addr); if ((pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE) { /* RTW_INFO("ie len=%d\n", cur_network->IELength); */ @@ -6112,8 +6112,8 @@ static void rtw_hal_construct_P2PBeacon(_adapter *padapter, u8 *pframe, u32 *pLe u8 *wps_ie; uint wps_ielen; u8 sr = 0; - wps_ie = rtw_get_wps_ie(pmgntframe->buf_addr + TXDESC_OFFSET + sizeof(struct rtw_ieee80211_hdr_3addr) + _BEACON_IE_OFFSET_, - pattrib->pktlen - sizeof(struct rtw_ieee80211_hdr_3addr) - _BEACON_IE_OFFSET_, NULL, &wps_ielen); + wps_ie = rtw_get_wps_ie(pmgntframe->buf_addr + TXDESC_OFFSET + sizeof(struct ieee80211_hdr_3addr) + _BEACON_IE_OFFSET_, + pattrib->pktlen - sizeof(struct ieee80211_hdr_3addr) - _BEACON_IE_OFFSET_, NULL, &wps_ielen); if (wps_ie && wps_ielen > 0) rtw_get_wps_attr_content(wps_ie, wps_ielen, WPS_ATTR_SELECTED_REGISTRAR, (u8 *)(&sr), NULL); if (sr != 0) @@ -6231,7 +6231,7 @@ static void rtw_hal_construct_P2PProbeRsp(_adapter *padapter, u8 *pframe, u32 *p /* struct xmit_frame *pmgntframe; */ /* struct pkt_attrib *pattrib; */ /* unsigned char *pframe; */ - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; unsigned short *fctrl; unsigned char *mac; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); @@ -6257,11 +6257,11 @@ static void rtw_hal_construct_P2PProbeRsp(_adapter *padapter, u8 *pframe, u32 *p u8 dbgbufLen = 0, index = 0; RTW_INFO("%s\n", __FUNCTION__); - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; mac = adapter_mac_addr(padapter); - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; /* DA filled by FW */ @@ -6274,7 +6274,7 @@ static void rtw_hal_construct_P2PProbeRsp(_adapter *padapter, u8 *pframe, u32 *p SetSeqNum(pwlanhdr, 0); set_frame_sub_type(fctrl, IEEE80211_STYPE_PROBE_RESP); - pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pktlen = sizeof(struct ieee80211_hdr_3addr); pframe += pktlen; @@ -6567,7 +6567,7 @@ static void rtw_hal_construct_P2PNegoRsp(_adapter *padapter, u8 *pframe, u32 *pL /* struct xmit_frame *pmgntframe; */ /* struct pkt_attrib *pattrib; */ /* unsigned char *pframe; */ - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; unsigned short *fctrl; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); @@ -6584,9 +6584,9 @@ static void rtw_hal_construct_P2PNegoRsp(_adapter *padapter, u8 *pframe, u32 *pL u8 dbgbufLen = 0, index = 0; RTW_INFO("%s\n", __FUNCTION__); - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; /* RA, filled by FW */ @@ -6597,7 +6597,7 @@ static void rtw_hal_construct_P2PNegoRsp(_adapter *padapter, u8 *pframe, u32 *pL SetSeqNum(pwlanhdr, 0); set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); - pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pktlen = sizeof(struct ieee80211_hdr_3addr); pframe += pktlen; pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pktlen)); @@ -6970,7 +6970,7 @@ static void rtw_hal_construct_P2PInviteRsp(_adapter *padapter, u8 *pframe, u32 * /* struct xmit_frame *pmgntframe; */ /* struct pkt_attrib *pattrib; */ /* unsigned char *pframe; */ - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; unsigned short *fctrl; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); @@ -6983,9 +6983,9 @@ static void rtw_hal_construct_P2PInviteRsp(_adapter *padapter, u8 *pframe, u32 * RTW_INFO("%s\n", __FUNCTION__); - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; /* RA fill by FW */ @@ -6998,8 +6998,8 @@ static void rtw_hal_construct_P2PInviteRsp(_adapter *padapter, u8 *pframe, u32 * SetSeqNum(pwlanhdr, 0); set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); - pframe += sizeof(struct rtw_ieee80211_hdr_3addr); - pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pframe += sizeof(struct ieee80211_hdr_3addr); + pktlen = sizeof(struct ieee80211_hdr_3addr); pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pktlen)); @@ -7215,7 +7215,7 @@ static void rtw_hal_construct_P2PProvisionDisRsp(_adapter *padapter, u8 *pframe, /* struct xmit_frame *pmgntframe; */ /* struct pkt_attrib *pattrib; */ /* unsigned char *pframe; */ - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; unsigned short *fctrl; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); @@ -7228,9 +7228,9 @@ static void rtw_hal_construct_P2PProvisionDisRsp(_adapter *padapter, u8 *pframe, RTW_INFO("%s\n", __FUNCTION__); - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; /* RA filled by FW */ @@ -7241,8 +7241,8 @@ static void rtw_hal_construct_P2PProvisionDisRsp(_adapter *padapter, u8 *pframe, SetSeqNum(pwlanhdr, 0); set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); - pframe += sizeof(struct rtw_ieee80211_hdr_3addr); - pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pframe += sizeof(struct ieee80211_hdr_3addr); + pktlen = sizeof(struct ieee80211_hdr_3addr); pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pktlen)); @@ -7382,7 +7382,7 @@ u8 rtw_hal_set_p2p_wowlan_offload_cmd(_adapter *adapter) void rtw_hal_construct_beacon(_adapter *padapter, u8 *pframe, u32 *pLength) { - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; u16 *fctrl; u32 rate_len, pktlen; struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); @@ -7391,9 +7391,9 @@ void rtw_hal_construct_beacon(_adapter *padapter, /* RTW_INFO("%s\n", __FUNCTION__); */ - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; eth_broadcast_addr(pwlanhdr->addr1); @@ -7404,8 +7404,8 @@ void rtw_hal_construct_beacon(_adapter *padapter, /* pmlmeext->mgnt_seq++; */ set_frame_sub_type(pframe, IEEE80211_STYPE_BEACON); - pframe += sizeof(struct rtw_ieee80211_hdr_3addr); - pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pframe += sizeof(struct ieee80211_hdr_3addr); + pktlen = sizeof(struct ieee80211_hdr_3addr); /* timestamp will be inserted by hardware */ pframe += 8; @@ -7481,7 +7481,7 @@ _ConstructBeacon: static void rtw_hal_construct_PSPoll(_adapter *padapter, u8 *pframe, u32 *pLength) { - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; u16 *fctrl; u32 pktlen; struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); @@ -7489,10 +7489,10 @@ static void rtw_hal_construct_PSPoll(_adapter *padapter, /* RTW_INFO("%s\n", __FUNCTION__); */ - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; /* Frame control. */ - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; SetPwrMgt(fctrl); set_frame_sub_type(pframe, (IEEE80211_FTYPE_CTL | IEEE80211_STYPE_PSPOLL)); @@ -7516,7 +7516,7 @@ void rtw_hal_construct_fw_dbg_msg_pkt( u8 *pframe, u32 *plength) { - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; u16 *fctrl; u32 pktlen; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -7526,9 +7526,9 @@ void rtw_hal_construct_fw_dbg_msg_pkt( /* RTW_INFO("%s:%d\n", __FUNCTION__, bForcePowerSave); */ - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &pwlanhdr->frame_ctl; + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; eth_broadcast_addr(pwlanhdr->addr1); @@ -7539,7 +7539,7 @@ void rtw_hal_construct_fw_dbg_msg_pkt( set_frame_sub_type(pframe, (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA)); - pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pktlen = sizeof(struct ieee80211_hdr_3addr); *plength = pktlen; } @@ -7554,7 +7554,7 @@ void rtw_hal_construct_NullFunctionData( u8 bEosp, u8 bForcePowerSave) { - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; u16 *fctrl; u32 pktlen; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -7566,9 +7566,9 @@ void rtw_hal_construct_NullFunctionData( /* RTW_INFO("%s:%d\n", __FUNCTION__, bForcePowerSave); */ - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &pwlanhdr->frame_ctl; + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; if (bForcePowerSave) SetPwrMgt(fctrl); @@ -7604,19 +7604,19 @@ void rtw_hal_construct_NullFunctionData( set_duration(pwlanhdr, 0); if (bQoS == _TRUE) { - struct rtw_ieee80211_hdr_3addr_qos *pwlanqoshdr; + struct ieee80211_qos_hdr *pwlanqoshdr; set_frame_sub_type(pframe, IEEE80211_FTYPE_DATA | IEEE80211_STYPE_QOS_NULLFUNC); - pwlanqoshdr = (struct rtw_ieee80211_hdr_3addr_qos *)pframe; - SetPriority(&pwlanqoshdr->qc, AC); - SetEOSP(&pwlanqoshdr->qc, bEosp); + pwlanqoshdr = (struct ieee80211_qos_hdr *)pframe; + SetPriority(&pwlanqoshdr->qos_ctrl, AC); + SetEOSP(&pwlanqoshdr->qos_ctrl, bEosp); - pktlen = sizeof(struct rtw_ieee80211_hdr_3addr_qos); + pktlen = sizeof(struct ieee80211_qos_hdr); } else { set_frame_sub_type(pframe, IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC); - pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pktlen = sizeof(struct ieee80211_hdr_3addr); } *pLength = pktlen; @@ -7625,7 +7625,7 @@ void rtw_hal_construct_NullFunctionData( void rtw_hal_construct_ProbeRsp(_adapter *padapter, u8 *pframe, u32 *pLength, BOOLEAN bHideSSID) { - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; u16 *fctrl; u8 *mac, *bssid, *sta_addr; u32 pktlen; @@ -7635,13 +7635,13 @@ void rtw_hal_construct_ProbeRsp(_adapter *padapter, u8 *pframe, u32 *pLength, /*RTW_INFO("%s\n", __FUNCTION__);*/ - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; mac = adapter_mac_addr(padapter); bssid = cur_network->MacAddress; sta_addr = get_my_bssid(&pmlmeinfo->network); - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; memcpy(pwlanhdr->addr1, sta_addr, ETH_ALEN); memcpy(pwlanhdr->addr2, mac, ETH_ALEN); @@ -7650,7 +7650,7 @@ void rtw_hal_construct_ProbeRsp(_adapter *padapter, u8 *pframe, u32 *pLength, SetSeqNum(pwlanhdr, 0); set_frame_sub_type(fctrl, IEEE80211_STYPE_PROBE_RESP); - pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pktlen = sizeof(struct ieee80211_hdr_3addr); pframe += pktlen; if (cur_network->IELength > MAX_IE_SZ) @@ -7669,7 +7669,7 @@ static void rtw_hal_append_tkip_mic(PADAPTER padapter, { struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; struct mic_data micdata; struct sta_info *psta = NULL; int res = 0; @@ -7682,7 +7682,7 @@ static void rtw_hal_append_tkip_mic(PADAPTER padapter, RTW_INFO("%s(): Add MIC, offset: %d\n", __func__, offset); - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; psta = rtw_get_stainfo(&padapter->stapriv, get_my_bssid(&(pmlmeinfo->network))); @@ -7721,7 +7721,7 @@ static void rtw_hal_construct_ARPRsp( u8 *pIPAddress ) { - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; u16 *fctrl; u32 pktlen; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -7736,9 +7736,9 @@ static void rtw_hal_construct_ARPRsp( u8 EncryptionHeadOverhead = 0, arp_offset = 0; /* RTW_INFO("%s:%d\n", __FUNCTION__, bForcePowerSave); */ - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &pwlanhdr->frame_ctl; + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; /* ------------------------------------------------------------------------- */ @@ -7848,7 +7848,7 @@ static void rtw_hal_construct_ARPRsp( static void rtw_hal_construct_na_message(_adapter *padapter, u8 *pframe, u32 *pLength) { - struct rtw_ieee80211_hdr *pwlanhdr = NULL; + struct ieee80211_hdr *pwlanhdr = NULL; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wlan_network *cur_network = &pmlmepriv->cur_network; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; @@ -7870,9 +7870,9 @@ static void rtw_hal_construct_na_message(_adapter *padapter, u8 EncryptionHeadOverhead = 0, na_msg_offset = 0; /* RTW_INFO("%s:%d\n", __FUNCTION__, bForcePowerSave); */ - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &pwlanhdr->frame_ctl; + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; /* ------------------------------------------------------------------------- */ @@ -8025,7 +8025,7 @@ static void rtw_hal_construct_ndp_info(_adapter *padapter, static void rtw_hal_construct_ProbeReq(_adapter *padapter, u8 *pframe, u32 *pLength, pno_ssid_t *ssid) { - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; u16 *fctrl; u32 pktlen; unsigned char *mac; @@ -8036,10 +8036,10 @@ static void rtw_hal_construct_ProbeReq(_adapter *padapter, u8 *pframe, struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); int bssrate_len = 0; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; mac = adapter_mac_addr(padapter); - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; eth_broadcast_addr(pwlanhdr->addr1); @@ -8050,7 +8050,7 @@ static void rtw_hal_construct_ProbeReq(_adapter *padapter, u8 *pframe, SetSeqNum(pwlanhdr, 0); set_frame_sub_type(pframe, IEEE80211_STYPE_PROBE_REQ); - pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pktlen = sizeof(struct ieee80211_hdr_3addr); pframe += pktlen; if (ssid == NULL) @@ -8204,7 +8204,7 @@ static void rtw_hal_construct_GTKRsp( u32 *pLength ) { - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; u16 *fctrl; u32 pktlen; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -8218,9 +8218,9 @@ static void rtw_hal_construct_GTKRsp( u8 EncryptionHeadOverhead = 0; /* RTW_INFO("%s:%d\n", __FUNCTION__, bForcePowerSave); */ - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &pwlanhdr->frame_ctl; + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; /* ------------------------------------------------------------------------- */ diff --git a/hal/phydm/txbf/haltxbfinterface.c b/hal/phydm/txbf/haltxbfinterface.c index 7ddeff9..ecb4bbb 100644 --- a/hal/phydm/txbf/haltxbfinterface.c +++ b/hal/phydm/txbf/haltxbfinterface.c @@ -1011,7 +1011,7 @@ send_fw_ht_ndpa_packet( struct _ADAPTER *adapter = dm->adapter; struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; struct xmit_priv *pxmitpriv = &(adapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); @@ -1048,9 +1048,9 @@ send_fw_ht_ndpa_packet( pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &pwlanhdr->frame_ctl; + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; set_order_bit(pframe); @@ -1099,7 +1099,7 @@ send_sw_ht_ndpa_packet( struct _ADAPTER *adapter = dm->adapter; struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; struct xmit_priv *pxmitpriv = &(adapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); @@ -1134,9 +1134,9 @@ send_sw_ht_ndpa_packet( pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &pwlanhdr->frame_ctl; + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; set_order_bit(pframe); @@ -1186,7 +1186,7 @@ send_fw_vht_ndpa_packet( struct _ADAPTER *adapter = dm->adapter; struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; struct xmit_priv *pxmitpriv = &(adapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); @@ -1224,9 +1224,9 @@ send_fw_vht_ndpa_packet( pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &pwlanhdr->frame_ctl; + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; set_frame_sub_type(pframe, WIFI_NDPA); @@ -1287,7 +1287,7 @@ send_sw_vht_ndpa_packet( struct _ADAPTER *adapter = dm->adapter; struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; struct xmit_priv *pxmitpriv = &(adapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); @@ -1325,9 +1325,9 @@ send_sw_vht_ndpa_packet( pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &pwlanhdr->frame_ctl; + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; set_frame_sub_type(pframe, WIFI_NDPA); diff --git a/hal/rtl8192e/usb/rtl8192eu_xmit.c b/hal/rtl8192e/usb/rtl8192eu_xmit.c index e94556d..b3b5fd8 100644 --- a/hal/rtl8192e/usb/rtl8192eu_xmit.c +++ b/hal/rtl8192e/usb/rtl8192eu_xmit.c @@ -923,7 +923,7 @@ s32 rtl8192eu_hostap_mgnt_xmit_entry(_adapter *padapter, _pkt *pkt) struct urb *urb; unsigned char *pxmitbuf; struct tx_desc *ptxdesc; - struct rtw_ieee80211_hdr *tx_hdr; + struct ieee80211_hdr *tx_hdr; struct hostapd_priv *phostapdpriv = padapter->phostapdpriv; struct net_device *pnetdev = padapter->pnetdev; HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); @@ -935,8 +935,8 @@ s32 rtl8192eu_hostap_mgnt_xmit_entry(_adapter *padapter, _pkt *pkt) skb = pkt; len = skb->len; - tx_hdr = (struct rtw_ieee80211_hdr *)(skb->data); - fc = le16_to_cpu(tx_hdr->frame_ctl); + tx_hdr = (struct ieee80211_hdr *)(skb->data); + fc = le16_to_cpu(tx_hdr->frame_control); bmcst = is_multicast_ether_addr(tx_hdr->addr1); if ((fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_MGMT) diff --git a/include/ieee80211.h b/include/ieee80211.h index 1b05a20..e0a9e94 100644 --- a/include/ieee80211.h +++ b/include/ieee80211.h @@ -15,9 +15,6 @@ #ifndef __IEEE80211_H #define __IEEE80211_H -#define MGMT_QUEUE_NUM 5 - -#define ETH_ALEN 6 #define ETH_TYPE_LEN 2 #define PAYLOAD_TYPE_LEN 1 @@ -380,64 +377,6 @@ struct sta_data { #define IW_QUAL_NOISE_UPDATED 0x4 #endif -#define IEEE80211_DATA_LEN 2304 -/* Maximum size for the MA-UNITDATA primitive, 802.11 standard section - 6.2.1.1.2. - - The figure in section 7.1.2 suggests a body size of up to 2312 - bytes is allowed, which is a bit confusing, I suspect this - represents the 2304 bytes of real data, plus a possible 8 bytes of - WEP IV and ICV. (this interpretation suggested by Ramiro Barreiro) */ - - -#define IEEE80211_HLEN 30 -#define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN) - - -/* this is stolen from ipw2200 driver */ -#define IEEE_IBSS_MAC_HASH_SIZE 31 - -struct rtw_ieee80211_hdr { - u16 frame_ctl; - u16 duration_id; - u8 addr1[ETH_ALEN]; - u8 addr2[ETH_ALEN]; - u8 addr3[ETH_ALEN]; - u16 seq_ctl; - u8 addr4[ETH_ALEN]; -} __attribute__((packed)); - -struct rtw_ieee80211_hdr_3addr { - u16 frame_ctl; - u16 duration_id; - u8 addr1[ETH_ALEN]; - u8 addr2[ETH_ALEN]; - u8 addr3[ETH_ALEN]; - u16 seq_ctl; -} __attribute__((packed)); - - -struct rtw_ieee80211_hdr_qos { - u16 frame_ctl; - u16 duration_id; - u8 addr1[ETH_ALEN]; - u8 addr2[ETH_ALEN]; - u8 addr3[ETH_ALEN]; - u16 seq_ctl; - u8 addr4[ETH_ALEN]; - u16 qc; -} __attribute__((packed)); - -struct rtw_ieee80211_hdr_3addr_qos { - u16 frame_ctl; - u16 duration_id; - u8 addr1[ETH_ALEN]; - u8 addr2[ETH_ALEN]; - u8 addr3[ETH_ALEN]; - u16 seq_ctl; - u16 qc; -} __attribute__((packed)); - struct eapol { u8 snap[6]; u16 ethertype; @@ -446,40 +385,6 @@ struct eapol { u16 length; } __attribute__((packed)); -struct rtw_ieee80211s_hdr { - u8 flags; - u8 ttl; - u32 seqnum; - u8 eaddr1[ETH_ALEN]; - u8 eaddr2[ETH_ALEN]; -} __attribute__((packed)); - -/** - * struct rtw_ieee80211_rann_ie - * - * This structure refers to "Root Announcement information element" - */ - struct rtw_ieee80211_rann_ie { - u8 rann_flags; - u8 rann_hopcount; - u8 rann_ttl; - u8 rann_addr[ETH_ALEN]; - u32 rann_seq; - u32 rann_interval; - u32 rann_metric; -} __attribute__((packed)); - -enum eap_type { - EAP_PACKET = 0, - EAPOL_START, - EAPOL_LOGOFF, - EAPOL_KEY, - EAPOL_ENCAP_ASF_ALERT -}; - -#define IEEE80211_3ADDR_LEN 24 -#define IEEE80211_4ADDR_LEN 30 - #define MIN_FRAG_THRESHOLD 256U #define MAX_FRAG_THRESHOLD 2346U @@ -489,16 +394,11 @@ enum eap_type { /* QoS,QOS */ #define NORMAL_ACK 0 -#define NO_ACK 1 -#define NON_EXPLICIT_ACK 2 -#define BLOCK_ACK 3 #ifndef ETH_P_PAE #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ #endif /* ETH_P_PAE */ -#define ETH_P_PREAUTH 0x88C7 /* IEEE 802.11i pre-authentication */ - #define ETH_P_ECONET 0x0018 #ifndef ETH_P_80211_RAW @@ -521,14 +421,6 @@ struct ieee80211_snap_hdr { #define SNAP_SIZE sizeof(struct ieee80211_snap_hdr) -#define WLAN_FC_GET_TYPE(fc) ((fc) & IEEE80211_FCTL_FTYPE) -#define WLAN_FC_GET_STYPE(fc) ((fc) & IEEE80211_FCTL_STYPE) - -#define WLAN_QC_GET_TID(qc) ((qc) & 0x0f) - -#define WLAN_GET_SEQ_FRAG(seq) ((seq) & IEEE80211_SCTL_FRAG) -#define WLAN_GET_SEQ_SEQ(seq) ((seq) & IEEE80211_SCTL_SEQ) - #define WLAN_REASON_SA_QUERY_TIMEOUT 65532 #define WLAN_REASON_ACTIVE_ROAM 65533 #define WLAN_REASON_JOIN_WRONG_CHANNEL 65534 @@ -578,44 +470,6 @@ struct ieee80211_snap_hdr { #define IEEE80211_OFDM_RATE_54MB 0x6C #define IEEE80211_BASIC_RATE_MASK 0x80 -#define IEEE80211_CCK_RATE_1MB_MASK (1<<0) -#define IEEE80211_CCK_RATE_2MB_MASK (1<<1) -#define IEEE80211_CCK_RATE_5MB_MASK (1<<2) -#define IEEE80211_CCK_RATE_11MB_MASK (1<<3) -#define IEEE80211_OFDM_RATE_6MB_MASK (1<<4) -#define IEEE80211_OFDM_RATE_9MB_MASK (1<<5) -#define IEEE80211_OFDM_RATE_12MB_MASK (1<<6) -#define IEEE80211_OFDM_RATE_18MB_MASK (1<<7) -#define IEEE80211_OFDM_RATE_24MB_MASK (1<<8) -#define IEEE80211_OFDM_RATE_36MB_MASK (1<<9) -#define IEEE80211_OFDM_RATE_48MB_MASK (1<<10) -#define IEEE80211_OFDM_RATE_54MB_MASK (1<<11) - -#define IEEE80211_CCK_RATES_MASK 0x0000000F -#define IEEE80211_CCK_BASIC_RATES_MASK (IEEE80211_CCK_RATE_1MB_MASK | \ - IEEE80211_CCK_RATE_2MB_MASK) -#define IEEE80211_CCK_DEFAULT_RATES_MASK (IEEE80211_CCK_BASIC_RATES_MASK | \ - IEEE80211_CCK_RATE_5MB_MASK | \ - IEEE80211_CCK_RATE_11MB_MASK) - -#define IEEE80211_OFDM_RATES_MASK 0x00000FF0 -#define IEEE80211_OFDM_BASIC_RATES_MASK (IEEE80211_OFDM_RATE_6MB_MASK | \ - IEEE80211_OFDM_RATE_12MB_MASK | \ - IEEE80211_OFDM_RATE_24MB_MASK) -#define IEEE80211_OFDM_DEFAULT_RATES_MASK (IEEE80211_OFDM_BASIC_RATES_MASK | \ - IEEE80211_OFDM_RATE_9MB_MASK | \ - IEEE80211_OFDM_RATE_18MB_MASK | \ - IEEE80211_OFDM_RATE_36MB_MASK | \ - IEEE80211_OFDM_RATE_48MB_MASK | \ - IEEE80211_OFDM_RATE_54MB_MASK) -#define IEEE80211_DEFAULT_RATES_MASK (IEEE80211_OFDM_DEFAULT_RATES_MASK | \ - IEEE80211_CCK_DEFAULT_RATES_MASK) - -#define IEEE80211_NUM_OFDM_RATES 8 -#define IEEE80211_NUM_CCK_RATES 4 -#define IEEE80211_OFDM_SHIFT_MASK_A 4 - - enum MGN_RATE { MGN_1M = 0x02, MGN_2M = 0x04, @@ -841,11 +695,6 @@ const char *rate_section_str(u8 section); #define IS_HT_RATE_SECTION(section) ((section) >= HT_1SS && (section) <= HT_4SS) #define IS_VHT_RATE_SECTION(section) ((section) >= VHT_1SS && (section) <= VHT_4SS) -#define IS_1T_RATE_SECTION(section) ((section) == CCK || (section) == OFDM || (section) == HT_1SS || (section) == VHT_1SS) -#define IS_2T_RATE_SECTION(section) ((section) == HT_2SS || (section) == VHT_2SS) -#define IS_3T_RATE_SECTION(section) ((section) == HT_3SS || (section) == VHT_3SS) -#define IS_4T_RATE_SECTION(section) ((section) == HT_4SS || (section) == VHT_4SS) - extern u8 mgn_rates_cck[]; extern u8 mgn_rates_ofdm[]; extern u8 mgn_rates_mcs0_7[]; @@ -872,53 +721,17 @@ extern struct rate_section_ent rates_by_sections[]; * three fragmented frames. This define can be increased to support more * concurrent frames, but it should be noted that each entry can consume about * 2 kB of RAM and increasing cache size will slow down frame reassembly. */ -#define IEEE80211_FRAG_CACHE_LEN 4 - -#define SEC_KEY_1 (1<<0) -#define SEC_KEY_2 (1<<1) -#define SEC_KEY_3 (1<<2) -#define SEC_KEY_4 (1<<3) -#define SEC_ACTIVE_KEY (1<<4) -#define SEC_AUTH_MODE (1<<5) -#define SEC_UNICAST_GROUP (1<<6) -#define SEC_LEVEL (1<<7) -#define SEC_ENABLED (1<<8) - -#define SEC_LEVEL_0 0 /* None */ -#define SEC_LEVEL_1 1 /* WEP 40 and 104 bit */ -#define SEC_LEVEL_2 2 /* Level 1 + TKIP */ -#define SEC_LEVEL_2_CKIP 3 /* Level 1 + CKIP */ -#define SEC_LEVEL_3 4 /* Level 2 + CCMP */ #define WEP_KEYS 4 -#define WEP_KEY_LEN 13 + #define BIP_MAX_KEYID 5 #define BIP_AAD_SIZE 20 -#define BEACON_PROBE_SSID_ID_POSITION 12 - -/* Management Frame Information Element Types */ -#define MFIE_TYPE_SSID 0 -#define MFIE_TYPE_RATES 1 -#define MFIE_TYPE_FH_SET 2 -#define MFIE_TYPE_DS_SET 3 -#define MFIE_TYPE_CF_SET 4 -#define MFIE_TYPE_TIM 5 -#define MFIE_TYPE_IBSS_SET 6 -#define MFIE_TYPE_CHALLENGE 16 -#define MFIE_TYPE_ERP 42 -#define MFIE_TYPE_RSN 48 -#define MFIE_TYPE_RATES_EX 50 -#define MFIE_TYPE_GENERIC 221 - -#if defined(PLATFORM_LINUX) || defined(CONFIG_RTL8711FW) - struct ieee80211_info_element { u8 id; u8 len; u8 data[0]; } __attribute__((packed)); -#endif /* * These are the data types that can make up management packets @@ -937,22 +750,6 @@ struct ieee80211_info_element { u16 status; */ -#define IEEE80211_DEFAULT_TX_ESSID "Penguin" -#define IEEE80211_DEFAULT_BASIC_RATE 10 - -struct ieee80211_txb { - u8 nr_frags; - u8 encrypted; - u16 reserved; - u16 frag_size; - u16 payload_size; - struct sk_buff *fragments[0]; -}; - - -/* SWEEP TABLE ENTRIES NUMBER*/ -#define MAX_SWEEP_TAB_ENTRIES 42 -#define MAX_SWEEP_TAB_ENTRIES_PER_PACKET 7 /* MAX_RATES_LENGTH needs to be 12. The spec says 8, and many APs * only use 8, and then use extended rates for the remaining supported * rates. Other APs, however, stick all of their supported rates on the @@ -1088,61 +885,45 @@ typedef struct tx_pending_t { #define CATEGORY_IS_ROBUST(cat) !CATEGORY_IS_NON_ROBUST(cat) -/* SPECTRUM_MGMT action code */ -enum rtw_ieee80211_spectrum_mgmt_actioncode { - RTW_WLAN_ACTION_SPCT_MSR_REQ = 0, - RTW_WLAN_ACTION_SPCT_MSR_RPRT = 1, - RTW_WLAN_ACTION_SPCT_TPC_REQ = 2, - RTW_WLAN_ACTION_SPCT_TPC_RPRT = 3, - RTW_WLAN_ACTION_SPCT_CHL_SWITCH = 4, - RTW_WLAN_ACTION_SPCT_EXT_CHL_SWITCH = 5, -}; - -/* SELF_PROTECTED action code */ -enum rtw_ieee80211_self_protected_actioncode { - RTW_ACT_SELF_PROTECTED_RSVD = 0, - RTW_ACT_SELF_PROTECTED_MESH_OPEN = 1, - RTW_ACT_SELF_PROTECTED_MESH_CONF = 2, - RTW_ACT_SELF_PROTECTED_MESH_CLOSE = 3, - RTW_ACT_SELF_PROTECTED_MESH_GK_INFORM = 4, - RTW_ACT_SELF_PROTECTED_MESH_GK_ACK = 5, - RTW_ACT_SELF_PROTECTED_NUM, -}; - -/* MESH action code */ -enum rtw_ieee80211_mesh_actioncode { - RTW_ACT_MESH_LINK_METRIC_REPORT, - RTW_ACT_MESH_HWMP_PATH_SELECTION, - RTW_ACT_MESH_GATE_ANNOUNCEMENT, - RTW_ACT_MESH_CONGESTION_CONTROL_NOTIFICATION, - RTW_ACT_MESH_MCCA_SETUP_REQUEST, - RTW_ACT_MESH_MCCA_SETUP_REPLY, - RTW_ACT_MESH_MCCA_ADVERTISEMENT_REQUEST, - RTW_ACT_MESH_MCCA_ADVERTISEMENT, - RTW_ACT_MESH_MCCA_TEARDOWN, - RTW_ACT_MESH_TBTT_ADJUSTMENT_REQUEST, - RTW_ACT_MESH_TBTT_ADJUSTMENT_RESPONSE, -}; - -enum _PUBLIC_ACTION { - ACT_PUBLIC_BSSCOEXIST = 0, /* 20/40 BSS Coexistence */ - ACT_PUBLIC_DSE_ENABLE = 1, - ACT_PUBLIC_DSE_DEENABLE = 2, - ACT_PUBLIC_DSE_REG_LOCATION = 3, - ACT_PUBLIC_EXT_CHL_SWITCH = 4, - ACT_PUBLIC_DSE_MSR_REQ = 5, - ACT_PUBLIC_DSE_MSR_RPRT = 6, - ACT_PUBLIC_MP = 7, /* Measurement Pilot */ - ACT_PUBLIC_DSE_PWR_CONSTRAINT = 8, - ACT_PUBLIC_VENDOR = 9, /* for WIFI_DIRECT */ - ACT_PUBLIC_GAS_INITIAL_REQ = 10, - ACT_PUBLIC_GAS_INITIAL_RSP = 11, - ACT_PUBLIC_GAS_COMEBACK_REQ = 12, - ACT_PUBLIC_GAS_COMEBACK_RSP = 13, - ACT_PUBLIC_TDLS_DISCOVERY_RSP = 14, - ACT_PUBLIC_LOCATION_TRACK = 15, - ACT_PUBLIC_MAX +#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0)) +/*Commit 3cb57df37bf3c87c7bbd2bd6f94d9d48c1c8e2ae v4.13-rc1 */ +enum ieee80211_pub_actioncode_extend { + WLAN_PUB_ACTION_20_40_BSS_COEX = 0, + WLAN_PUB_ACTION_DSE_ENABLEMENT = 1, + WLAN_PUB_ACTION_DSE_DEENABLEMENT = 2, + WLAN_PUB_ACTION_DSE_REG_LOC_ANN = 3, + WLAN_PUB_ACTION_DSE_MSMT_REQ = 5, + WLAN_PUB_ACTION_DSE_MSMT_RESP = 6, + WLAN_PUB_ACTION_MSMT_PILOT = 7, + WLAN_PUB_ACTION_DSE_PC = 8, + WLAN_PUB_ACTION_VENDOR_SPECIFIC = 9, + WLAN_PUB_ACTION_GAS_INITIAL_REQ = 10, + WLAN_PUB_ACTION_GAS_INITIAL_RESP = 11, + WLAN_PUB_ACTION_GAS_COMEBACK_REQ = 12, + WLAN_PUB_ACTION_GAS_COMEBACK_RESP = 13, + WLAN_PUB_ACTION_LOC_TRACK_NOTI = 15, + WLAN_PUB_ACTION_QAB_REQUEST_FRAME = 16, + WLAN_PUB_ACTION_QAB_RESPONSE_FRAME = 17, + WLAN_PUB_ACTION_QMF_POLICY = 18, + WLAN_PUB_ACTION_QMF_POLICY_CHANGE = 19, + WLAN_PUB_ACTION_QLOAD_REQUEST = 20, + WLAN_PUB_ACTION_QLOAD_REPORT = 21, + WLAN_PUB_ACTION_HCCA_TXOP_ADVERT = 22, + WLAN_PUB_ACTION_HCCA_TXOP_RESPONSE = 23, + WLAN_PUB_ACTION_PUBLIC_KEY = 24, + WLAN_PUB_ACTION_CHANNEL_AVAIL_QUERY = 25, + WLAN_PUB_ACTION_CHANNEL_SCHEDULE_MGMT = 26, + WLAN_PUB_ACTION_CONTACT_VERI_SIGNAL = 27, + WLAN_PUB_ACTION_GDD_ENABLEMENT_REQ = 28, + WLAN_PUB_ACTION_GDD_ENABLEMENT_RESP = 29, + WLAN_PUB_ACTION_NETWORK_CHANNEL_CONTROL = 30, + WLAN_PUB_ACTION_WHITE_SPACE_MAP_ANN = 31, + WLAN_PUB_ACTION_FTM_REQUEST = 32, + WLAN_PUB_ACTION_FTM = 33, + WLAN_PUB_ACTION_FILS_DISCOVERY = 34, }; +#endif +#define ACT_PUBLIC_MAX (WLAN_PUB_ACTION_LOC_TRACK_NOTI + 1) #ifdef CONFIG_TDLS #define WLAN_TDLS_DISCOVERY_RESPONSE = 14 /* it's used in public action frame */ @@ -1152,7 +933,6 @@ enum _PUBLIC_ACTION { #endif /* CONFIG_TDLS */ /*20/40 BSS Coexistence element */ -#define RTW_WLAN_20_40_BSS_COEX_INFO_REQ BIT(0) #define RTW_WLAN_20_40_BSS_COEX_40MHZ_INTOL BIT(1) #define RTW_WLAN_20_40_BSS_COEX_20MHZ_WIDTH_REQ BIT(2) #define RTW_WLAN_20_40_BSS_COEX_OBSS_EXEMPT_REQ BIT(3) @@ -1187,20 +967,6 @@ enum rtw_ieee80211_wnm_actioncode { #define WME_OUI_SUBTYPE_INFORMATION_ELEMENT 0 #define WME_OUI_SUBTYPE_PARAMETER_ELEMENT 1 #define WME_OUI_SUBTYPE_TSPEC_ELEMENT 2 -#define WME_VERSION 1 - -#define WME_ACTION_CODE_SETUP_REQUEST 0 -#define WME_ACTION_CODE_SETUP_RESPONSE 1 -#define WME_ACTION_CODE_TEARDOWN 2 - -#define WME_SETUP_RESPONSE_STATUS_ADMISSION_ACCEPTED 0 -#define WME_SETUP_RESPONSE_STATUS_INVALID_PARAMETERS 1 -#define WME_SETUP_RESPONSE_STATUS_REFUSED 3 - -#define WME_TSPEC_DIRECTION_UPLINK 0 -#define WME_TSPEC_DIRECTION_DOWNLINK 1 -#define WME_TSPEC_DIRECTION_BI_DIRECTIONAL 3 - #define OUI_BROADCOM 0x00904c /* Broadcom (Epigram) */ @@ -1460,7 +1226,6 @@ u8 rtw_ht_mcsset_to_nss(u8 *supp_mcs_set); u32 rtw_ht_mcs_set_to_bitmap(u8 *mcs_set, u8 nss); int rtw_action_frame_parse(const u8 *frame, u32 frame_len, u8 *category, u8 *action); -const char *action_public_str(u8 action); u8 key_2char2num(u8 hch, u8 lch); u8 str_2char2num(u8 hch, u8 lch); diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index 58d08ce..b26aaf7 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -786,7 +786,7 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(_adapter *padapter, struct wlan_net u8 *pbuf; size_t buf_size = MAX_BSSINFO_LEN; size_t len, bssinf_len = 0; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; unsigned short *fctrl; struct wireless_dev *wdev = padapter->rtw_wdev; @@ -801,7 +801,7 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(_adapter *padapter, struct wlan_net /* RTW_INFO("%s\n", __func__); */ - bssinf_len = pnetwork->network.IELength + sizeof(struct rtw_ieee80211_hdr_3addr); + bssinf_len = pnetwork->network.IELength + sizeof(struct ieee80211_hdr_3addr); if (bssinf_len > buf_size) { RTW_INFO("%s IE Length too long > %zu byte\n", __FUNCTION__, buf_size); goto exit; @@ -854,8 +854,8 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(_adapter *padapter, struct wlan_net /* pbuf = buf; */ - pwlanhdr = (struct rtw_ieee80211_hdr *)pbuf; - fctrl = &(pwlanhdr->frame_ctl); + pwlanhdr = (struct ieee80211_hdr *)pbuf; + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; SetSeqNum(pwlanhdr, 0/*pmlmeext->mgnt_seq*/); @@ -873,8 +873,8 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(_adapter *padapter, struct wlan_net memcpy(pwlanhdr->addr3, pnetwork->network.MacAddress, ETH_ALEN); - /* pbuf += sizeof(struct rtw_ieee80211_hdr_3addr); */ - len = sizeof(struct rtw_ieee80211_hdr_3addr); + /* pbuf += sizeof(struct ieee80211_hdr_3addr); */ + len = sizeof(struct ieee80211_hdr_3addr); memcpy((pbuf + len), pnetwork->network.IEs, pnetwork->network.IELength); *((u64 *)(pbuf + len)) = cpu_to_le64(notify_timestamp); @@ -1124,10 +1124,10 @@ check_bss: #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) roam_info.bssid = cur_network->network.MacAddress; - roam_info.req_ie = pmlmepriv->assoc_req + sizeof(struct rtw_ieee80211_hdr_3addr) + 2; - roam_info.req_ie_len = pmlmepriv->assoc_req_len - sizeof(struct rtw_ieee80211_hdr_3addr) - 2; - roam_info.resp_ie = pmlmepriv->assoc_rsp + sizeof(struct rtw_ieee80211_hdr_3addr) + 6; - roam_info.resp_ie_len = pmlmepriv->assoc_rsp_len - sizeof(struct rtw_ieee80211_hdr_3addr) - 6; + roam_info.req_ie = pmlmepriv->assoc_req + sizeof(struct ieee80211_hdr_3addr) + 2; + roam_info.req_ie_len = pmlmepriv->assoc_req_len - sizeof(struct ieee80211_hdr_3addr) - 2; + roam_info.resp_ie = pmlmepriv->assoc_rsp + sizeof(struct ieee80211_hdr_3addr) + 6; + roam_info.resp_ie_len = pmlmepriv->assoc_rsp_len - sizeof(struct ieee80211_hdr_3addr) - 6; cfg80211_roamed(padapter->pnetdev, &roam_info, GFP_ATOMIC); #else @@ -1136,10 +1136,10 @@ check_bss: , notify_channel #endif , cur_network->network.MacAddress - , pmlmepriv->assoc_req + sizeof(struct rtw_ieee80211_hdr_3addr) + 2 - , pmlmepriv->assoc_req_len - sizeof(struct rtw_ieee80211_hdr_3addr) - 2 - , pmlmepriv->assoc_rsp + sizeof(struct rtw_ieee80211_hdr_3addr) + 6 - , pmlmepriv->assoc_rsp_len - sizeof(struct rtw_ieee80211_hdr_3addr) - 6 + , pmlmepriv->assoc_req + sizeof(struct ieee80211_hdr_3addr) + 2 + , pmlmepriv->assoc_req_len - sizeof(struct ieee80211_hdr_3addr) - 2 + , pmlmepriv->assoc_rsp + sizeof(struct ieee80211_hdr_3addr) + 6 + , pmlmepriv->assoc_rsp_len - sizeof(struct ieee80211_hdr_3addr) - 6 , GFP_ATOMIC); #endif /*LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)*/ @@ -1156,10 +1156,10 @@ check_bss: if (check_fwstate(pmlmepriv, WIFI_MONITOR_STATE) != _TRUE) rtw_cfg80211_connect_result(pwdev, cur_network->network.MacAddress - , pmlmepriv->assoc_req + sizeof(struct rtw_ieee80211_hdr_3addr) + 2 - , pmlmepriv->assoc_req_len - sizeof(struct rtw_ieee80211_hdr_3addr) - 2 - , pmlmepriv->assoc_rsp + sizeof(struct rtw_ieee80211_hdr_3addr) + 6 - , pmlmepriv->assoc_rsp_len - sizeof(struct rtw_ieee80211_hdr_3addr) - 6 + , pmlmepriv->assoc_req + sizeof(struct ieee80211_hdr_3addr) + 2 + , pmlmepriv->assoc_req_len - sizeof(struct ieee80211_hdr_3addr) - 2 + , pmlmepriv->assoc_rsp + sizeof(struct ieee80211_hdr_3addr) + 6 + , pmlmepriv->assoc_rsp_len - sizeof(struct ieee80211_hdr_3addr) - 6 , WLAN_STATUS_SUCCESS, GFP_ATOMIC); #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 11, 0) || defined(COMPAT_KERNEL_RELEASE) RTW_INFO("pwdev->sme_state(a)=%d\n", pwdev->sme_state); @@ -4386,7 +4386,7 @@ void rtw_cfg80211_indicate_sta_disassoc(_adapter *padapter, const u8 *da, unsign int channel; u8 *pmgmt_frame; uint frame_len; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; unsigned short *fctrl; u8 mgmt_buf[128] = {0}; struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); @@ -4404,9 +4404,9 @@ void rtw_cfg80211_indicate_sta_disassoc(_adapter *padapter, const u8 *da, unsign freq = rtw_ch2freq(channel); pmgmt_frame = mgmt_buf; - pwlanhdr = (struct rtw_ieee80211_hdr *)pmgmt_frame; + pwlanhdr = (struct ieee80211_hdr *)pmgmt_frame; - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; memcpy(pwlanhdr->addr1, adapter_mac_addr(padapter), ETH_ALEN); @@ -4417,8 +4417,8 @@ void rtw_cfg80211_indicate_sta_disassoc(_adapter *padapter, const u8 *da, unsign pmlmeext->mgnt_seq++; set_frame_sub_type(pmgmt_frame, IEEE80211_STYPE_DEAUTH); - pmgmt_frame += sizeof(struct rtw_ieee80211_hdr_3addr); - frame_len = sizeof(struct rtw_ieee80211_hdr_3addr); + pmgmt_frame += sizeof(struct ieee80211_hdr_3addr); + frame_len = sizeof(struct ieee80211_hdr_3addr); reason = cpu_to_le16(reason); pmgmt_frame = rtw_set_fixed_ie(pmgmt_frame, _RSON_CODE_ , (unsigned char *)&reason, &frame_len); @@ -4463,7 +4463,7 @@ static int rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struct net_de u16 frame_ctl; unsigned char src_mac_addr[ETH_ALEN]; unsigned char dst_mac_addr[ETH_ALEN]; - struct rtw_ieee80211_hdr *dot11_hdr; + struct ieee80211_hdr *dot11_hdr; struct ieee80211_radiotap_header *rtap_hdr; _adapter *padapter = (_adapter *)rtw_netdev_priv(ndev); #ifdef CONFIG_DFS_MASTER @@ -4501,16 +4501,16 @@ static int rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struct net_de /* Skip the ratio tap header */ skb_pull(skb, rtap_len); - dot11_hdr = (struct rtw_ieee80211_hdr *)skb->data; - frame_ctl = le16_to_cpu(dot11_hdr->frame_ctl); + dot11_hdr = (struct ieee80211_hdr *)skb->data; + frame_ctl = le16_to_cpu(dot11_hdr->frame_control); /* Check if the QoS bit is set */ if ((frame_ctl & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA) { /* Check if this ia a Wireless Distribution System (WDS) frame * which has 4 MAC addresses */ - if (dot11_hdr->frame_ctl & 0x0080) + if (dot11_hdr->frame_control & 0x0080) qos_len = 2; - if ((dot11_hdr->frame_ctl & 0x0300) == 0x0300) + if ((dot11_hdr->frame_control & 0x0300) == 0x0300) dot11_hdr_len += 6; memcpy(dst_mac_addr, dot11_hdr->addr1, sizeof(dst_mac_addr)); @@ -4540,7 +4540,7 @@ static int rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struct net_de unsigned char *pframe; /* u8 category, action, OUI_Subtype, dialogToken=0; */ /* unsigned char *frame_body; */ - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); u8 *buf = skb->data; @@ -4550,7 +4550,7 @@ static int rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struct net_de if (rtw_action_frame_parse(buf, len, &category, &action) == _FALSE) { RTW_INFO(FUNC_NDEV_FMT" frame_control:0x%x\n", FUNC_NDEV_ARG(ndev), - le16_to_cpu(((struct rtw_ieee80211_hdr_3addr *)buf)->frame_ctl)); + le16_to_cpu(((struct ieee80211_hdr_3addr *)buf)->frame_control)); goto fail; } @@ -4561,10 +4561,6 @@ static int rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struct net_de if (type >= 0) goto dump; #endif - if (category == WLAN_CATEGORY_PUBLIC) - RTW_INFO("RTW_Tx:%s\n", action_public_str(action)); - else - RTW_INFO("RTW_Tx:category(%u), action(%u)\n", category, action); dump: /* starting alloc mgmt frame to dump it */ @@ -4589,7 +4585,7 @@ dump: rtw_xframe_chk_wfd_ie(pmgntframe); #endif /* CONFIG_P2P */ - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; /* update seq number */ pmlmeext->mgnt_seq = GetSequence(pwlanhdr); pattrib->seqnum = pmlmeext->mgnt_seq; @@ -6204,7 +6200,7 @@ void rtw_cfg80211_rx_action(_adapter *adapter, union recv_frame *rframe, const c #endif rtw_action_frame_parse(frame, frame_len, &category, &action); if (category == WLAN_CATEGORY_PUBLIC) { - if (action == ACT_PUBLIC_GAS_INITIAL_REQ) { + if (action == WLAN_PUB_ACTION_GAS_INITIAL_REQ ) { rtw_mi_set_scan_deny(adapter, 200); rtw_mi_scan_abort(adapter, _FALSE); /*rtw_scan_abort_no_wait*/ } @@ -6269,7 +6265,7 @@ void rtw_cfg80211_rx_mframe(_adapter *adapter, union recv_frame *rframe, const c if (msg) RTW_INFO("RTW_Rx:%s\n", msg); else - RTW_INFO("RTW_Rx:frame_control:0x%02x\n", le16_to_cpu(((struct rtw_ieee80211_hdr_3addr *)rframe)->frame_ctl)); + RTW_INFO("RTW_Rx:frame_control:0x%02x\n", le16_to_cpu(((struct ieee80211_hdr_3addr *)rframe)->frame_control)); } } @@ -6299,14 +6295,14 @@ void rtw_cfg80211_issue_p2p_provision_request(_adapter *padapter, const u8 *buf, struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; unsigned char *pframe; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; unsigned short *fctrl; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct wifidirect_info *pwdinfo = &(padapter->wdinfo); - u8 *frame_body = (unsigned char *)(buf + sizeof(struct rtw_ieee80211_hdr_3addr)); - size_t frame_body_len = len - sizeof(struct rtw_ieee80211_hdr_3addr); + u8 *frame_body = (unsigned char *)(buf + sizeof(struct ieee80211_hdr_3addr)); + size_t frame_body_len = len - sizeof(struct ieee80211_hdr_3addr); RTW_INFO("[%s] In\n", __FUNCTION__); @@ -6368,9 +6364,9 @@ void rtw_cfg80211_issue_p2p_provision_request(_adapter *padapter, const u8 *buf, memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; - fctrl = &(pwlanhdr->frame_ctl); + fctrl =&pwlanhdr->frame_control; *(fctrl) = 0; memcpy(pwlanhdr->addr1, pwdinfo->tx_prov_disc_info.peerDevAddr, ETH_ALEN); @@ -6381,8 +6377,8 @@ void rtw_cfg80211_issue_p2p_provision_request(_adapter *padapter, const u8 *buf, pmlmeext->mgnt_seq++; set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); - pframe += sizeof(struct rtw_ieee80211_hdr_3addr); - pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + pframe += sizeof(struct ieee80211_hdr_3addr); + pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr); pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); @@ -7008,7 +7004,7 @@ static int _cfg80211_rtw_mgmt_tx(_adapter *padapter, u8 tx_ch, u8 no_cck, const unsigned char *pframe; int ret = _FAIL; bool ack = _TRUE; - struct rtw_ieee80211_hdr *pwlanhdr; + struct ieee80211_hdr *pwlanhdr; #if defined(RTW_ROCH_BACK_OP) && defined(CONFIG_P2P) && defined(CONFIG_CONCURRENT_MODE) struct rtw_wdev_priv *pwdev_priv = adapter_wdev_data(padapter); #endif @@ -7102,7 +7098,7 @@ issue_mgmt_frame: memcpy(pframe, (void *)buf, len); pattrib->pktlen = len; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + pwlanhdr = (struct ieee80211_hdr *)pframe; /* update seq number */ pmlmeext->mgnt_seq = GetSequence(pwlanhdr); pattrib->seqnum = pmlmeext->mgnt_seq; @@ -7321,7 +7317,7 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy, cfg80211_action_tx_status(ndev, *cookie, buf, len, ack, GFP_KERNEL); #endif - frame_styp = le16_to_cpu(((struct rtw_ieee80211_hdr_3addr *)buf)->frame_ctl) & IEEE80211_FCTL_STYPE; + frame_styp = le16_to_cpu(((struct ieee80211_hdr_3addr *)buf)->frame_control) & IEEE80211_FCTL_STYPE; if (IEEE80211_STYPE_PROBE_RESP == frame_styp) { #ifdef CONFIG_DEBUG_CFG80211 RTW_INFO("RTW_Tx: probe_resp tx_ch=%d, no_cck=%u, da="MAC_FMT"\n", tx_ch, no_cck, MAC_ARG(GetAddr1Ptr(buf))); @@ -7345,7 +7341,7 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy, if (rtw_action_frame_parse(buf, len, &category, &action) == _FALSE) { RTW_INFO(FUNC_ADPT_FMT" frame_control:0x%02x\n", FUNC_ADPT_ARG(padapter), - le16_to_cpu(((struct rtw_ieee80211_hdr_3addr *)buf)->frame_ctl)); + le16_to_cpu(((struct ieee80211_hdr_3addr *)buf)->frame_control)); goto exit; } @@ -7368,10 +7364,9 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy, } #endif if (category == WLAN_CATEGORY_PUBLIC) { - RTW_INFO("RTW_Tx:%s\n", action_public_str(action)); switch (action) { - case ACT_PUBLIC_GAS_INITIAL_REQ: - case ACT_PUBLIC_GAS_INITIAL_RSP: + case WLAN_PUB_ACTION_GAS_INITIAL_REQ : + case WLAN_PUB_ACTION_GAS_INITIAL_RESP: sleep_ms = 50; retry_guarantee_ms = RTW_MAX_MGMT_TX_MS_GAS; break; diff --git a/os_dep/linux/ioctl_linux.c b/os_dep/linux/ioctl_linux.c index 398b51c..5269179 100644 --- a/os_dep/linux/ioctl_linux.c +++ b/os_dep/linux/ioctl_linux.c @@ -11427,7 +11427,7 @@ static struct xmit_frame *createloopbackpkt(PADAPTER padapter, u32 size) struct pkt_attrib *pattrib; struct tx_desc *desc; u8 *pkt_start, *pkt_end, *ptr; - struct rtw_ieee80211_hdr *hdr; + struct ieee80211_hdr *hdr; bool bmcast; _irqL irqL; @@ -11532,8 +11532,8 @@ static struct xmit_frame *createloopbackpkt(PADAPTER padapter, u32 size) pkt_end = pkt_start + pattrib->last_txcmdsz; /* 3 5.1. make wlan header, make_wlanhdr() */ - hdr = (struct rtw_ieee80211_hdr *)pkt_start; - set_frame_sub_type(&hdr->frame_ctl, pattrib->subtype); + hdr = (struct ieee80211_hdr *)pkt_start; + set_frame_sub_type(&hdr->frame_control, pattrib->subtype); memcpy(hdr->addr1, pattrib->dst, ETH_ALEN); /* DA */ memcpy(hdr->addr2, pattrib->src, ETH_ALEN); /* SA */ memcpy(hdr->addr3, get_bssid(&padapter->mlmepriv), ETH_ALEN); /* RA, BSSID */ From 81a5bb2aa201c053562cf62fc44dc6d37b9688d7 Mon Sep 17 00:00:00 2001 From: Carlos Garces Date: Thu, 21 Oct 2021 18:05:27 +0200 Subject: [PATCH 12/20] Replace custom Information Element IDs Use enum ieee80211_eid from linux/ieee80211.h Fix 3555bdb25800fe9fb280c64663ab2e3a46762d63 --- core/rtw_mlme_ext.c | 2 +- core/rtw_rm.c | 6 +++--- core/rtw_rm_fsm.c | 2 +- core/rtw_tdls.c | 10 +++++----- core/rtw_wlan_util.c | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index ce14057..217c3b1 100644 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -11485,7 +11485,7 @@ static void process_80211d(PADAPTER padapter, WLAN_BSSID_EX *bssid) u8 noc; /* number of channel */ u8 j, k; - ie = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _COUNTRY_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_); + ie = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, WLAN_EID_COUNTRY, &len, bssid->IELength - _FIXED_IE_LENGTH_); if (!ie) return; if (len < 6) diff --git a/core/rtw_rm.c b/core/rtw_rm.c index 5874918..58797fe 100644 --- a/core/rtw_rm.c +++ b/core/rtw_rm.c @@ -812,7 +812,7 @@ int rm_recv_radio_mens_req(_adapter *padapter, RTW_INFO("RM: meas_type = %d\n", prm->q.m_type); #endif - if (prm->q.e_id != _MEAS_REQ_IE_) /* 38 */ + if (prm->q.e_id != WLAN_EID_MEASURE_REQUEST) /* 38 */ return _FALSE; switch (prm->q.m_type) { @@ -894,7 +894,7 @@ int rm_recv_radio_mens_rep(_adapter *padapter, RTW_INFO("RM: meas_mode = %d\n", prm->p.m_mode); RTW_INFO("RM: meas_type = %d\n", prm->p.m_type); #endif - if (prm->p.e_id != _MEAS_RSP_IE_) /* 39 */ + if (prm->p.e_id != WLAN_EID_MEASURE_REPORT) /* 39 */ return _FALSE; RTW_INFO("RM: recv %s\n", rm_type_rep_name(prm->p.m_type)); @@ -2280,7 +2280,7 @@ static void rm_dbg_add_meas(_adapter *padapter, char *s) return; } prm->q.category = WLAN_CATEGORY_RADIO_MEASUREMENT; - prm->q.e_id = _MEAS_REQ_IE_; /* 38 */ + prm->q.e_id = WLAN_EID_MEASURE_REQUEST; /* 38 */ if (prm->q.action_code == RM_ACT_RADIO_MEAS_REQ) sprintf(pstr(s), "\nAdd rmid=%x, meas_type=%s ok\n", diff --git a/core/rtw_rm_fsm.c b/core/rtw_rm_fsm.c index 19fef5f..6795150 100644 --- a/core/rtw_rm_fsm.c +++ b/core/rtw_rm_fsm.c @@ -528,7 +528,7 @@ static int rm_state_idle(struct rm_obj *prm, enum RM_EV_ID evid) /* copy attrib from meas_req to meas_rep */ prm->p.action_code = RM_ACT_RADIO_MEAS_REP; prm->p.diag_token = prm->q.diag_token; - prm->p.e_id = _MEAS_RSP_IE_; + prm->p.e_id = WLAN_EID_MEASURE_REPORT; prm->p.m_token = prm->q.m_token; prm->p.m_type = prm->q.m_type; prm->p.rpt = prm->q.rpt; diff --git a/core/rtw_tdls.c b/core/rtw_tdls.c index 14c82a5..2fba19c 100644 --- a/core/rtw_tdls.c +++ b/core/rtw_tdls.c @@ -718,7 +718,7 @@ u8 *rtw_tdls_set_sup_ch(_adapter *adapter, u8 *pframe, struct pkt_attrib *pattri ch_set_idx++; } - return rtw_set_ie(pframe, _SUPPORTED_CH_IE_, sup_ch_idx, sup_ch, &(pattrib->pktlen)); + return rtw_set_ie(pframe, WLAN_EID_SUPPORTED_CHANNELS, sup_ch_idx, sup_ch, &(pattrib->pktlen)); } u8 *rtw_tdls_set_rsnie(struct tdls_txmgmt *ptxmgmt, u8 *pframe, struct pkt_attrib *pattrib, int init, struct sta_info *ptdls_sta) @@ -1914,7 +1914,7 @@ sint On_TDLS_Setup_Req(_adapter *padapter, union recv_frame *precv_frame, struct memcpy(supportRate, pIE->data, pIE->Length); supportRateNum = pIE->Length; break; - case _COUNTRY_IE_: + case WLAN_EID_COUNTRY: break; case WLAN_EID_EXT_SUPP_RATES: if (supportRateNum < sizeof(supportRate)) { @@ -1922,7 +1922,7 @@ sint On_TDLS_Setup_Req(_adapter *padapter, union recv_frame *precv_frame, struct supportRateNum += pIE->Length; } break; - case _SUPPORTED_CH_IE_: + case WLAN_EID_SUPPORTED_CHANNELS: break; case WLAN_EID_RSN: rsnie_included = 1; @@ -2096,7 +2096,7 @@ int On_TDLS_Setup_Rsp(_adapter *padapter, union recv_frame *precv_frame, struct memcpy(supportRate, pIE->data, pIE->Length); supportRateNum = pIE->Length; break; - case _COUNTRY_IE_: + case WLAN_EID_COUNTRY: break; case WLAN_EID_EXT_SUPP_RATES: if (supportRateNum < sizeof(supportRate)) { @@ -2104,7 +2104,7 @@ int On_TDLS_Setup_Rsp(_adapter *padapter, union recv_frame *precv_frame, struct supportRateNum += pIE->Length; } break; - case _SUPPORTED_CH_IE_: + case WLAN_EID_SUPPORTED_CHANNELS: break; case WLAN_EID_RSN: prsnie = (u8 *)pIE; diff --git a/core/rtw_wlan_util.c b/core/rtw_wlan_util.c index 61ec1c9..d5c98c8 100644 --- a/core/rtw_wlan_util.c +++ b/core/rtw_wlan_util.c @@ -2732,7 +2732,7 @@ void process_csa_ie(_adapter *padapter, u8 *ies, uint ies_len) pIE = (PNDIS_802_11_VARIABLE_IEs)(ies + i); switch (pIE->ElementID) { - case _CH_SWTICH_ANNOUNCE_: + case WLAN_EID_CHANNEL_SWITCH: ch = *(pIE->data + 1); break; default: From 3f3d3a09861884e2b7a9abe3ef866db999fd73f7 Mon Sep 17 00:00:00 2001 From: Carlos Garces Date: Thu, 21 Oct 2021 18:22:21 +0200 Subject: [PATCH 13/20] remove unused macros in include/wifi.h remove declarations of unused macros in include/wifi.h Link: https://lore.kernel.org/r/1192085c7e891f801751f3adb7884083a2999483.1616854134.git.fabioaiuto83@gmail.com --- include/wifi.h | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/include/wifi.h b/include/wifi.h index a90dded..bc85d3c 100644 --- a/include/wifi.h +++ b/include/wifi.h @@ -90,11 +90,6 @@ enum { #define GetToDs(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(IEEE80211_FCTL_TODS)) != 0) -#define ClearToDs(pbuf) \ - do { \ - *(unsigned short *)(pbuf) &= (~cpu_to_le16(IEEE80211_FCTL_TODS)); \ - } while (0) - #define SetFrDs(pbuf) \ do { \ *(unsigned short *)(pbuf) |= cpu_to_le16(IEEE80211_FCTL_FROMDS); \ @@ -102,11 +97,6 @@ enum { #define GetFrDs(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(IEEE80211_FCTL_FROMDS)) != 0) -#define ClearFrDs(pbuf) \ - do { \ - *(unsigned short *)(pbuf) &= (~cpu_to_le16(IEEE80211_FCTL_FROMDS)); \ - } while (0) - #define get_tofr_ds(pframe) ((GetToDs(pframe) << 1) | GetFrDs(pframe)) @@ -160,12 +150,6 @@ enum { #define GetPrivacy(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(IEEE80211_FCTL_PROTECTED)) != 0) -#define ClearPrivacy(pbuf) \ - do { \ - *(unsigned short *)(pbuf) &= (~cpu_to_le16(IEEE80211_FCTL_PROTECTED)); \ - } while (0) - - #define GetOrder(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(IEEE80211_FCTL_ORDER)) != 0) #define GetFrameType(pbuf) (le16_to_cpu(*(unsigned short *)(pbuf)) & (BIT(3) | BIT(2))) From 86199d079183dc920e73f611779d28232a5aafc8 Mon Sep 17 00:00:00 2001 From: Carlos Garces Date: Thu, 21 Oct 2021 18:42:12 +0200 Subject: [PATCH 14/20] use native wireless IE codes from linux/ieee80211.h IE code definitions have been replaced with native ones to avoid code duplication. The unobvious substitutions are: _WPA_IE_ID_ -> WLAN_EID_VENDOR_SPECIFIC; _WPA2_IE_ID_ -> WLAN_EID_RSN. Link: https://lore.kernel.org/r/20201011105050.5896-1-insafonov@gmail.com --- core/rtw_ieee80211.c | 12 ++++++------ core/rtw_mlme.c | 6 +++--- core/rtw_mlme_ext.c | 4 ++-- core/rtw_tdls.c | 40 +++++++++++++++++++-------------------- include/rtw_security.h | 3 --- os_dep/linux/mlme_linux.c | 2 +- 6 files changed, 32 insertions(+), 35 deletions(-) diff --git a/core/rtw_ieee80211.c b/core/rtw_ieee80211.c index 0b1ca99..48d136e 100644 --- a/core/rtw_ieee80211.c +++ b/core/rtw_ieee80211.c @@ -592,7 +592,7 @@ unsigned char *rtw_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit) int limit_new = limit; while (1) { - pbuf = rtw_get_ie(pbuf, _WPA_IE_ID_, &len, limit_new); + pbuf = rtw_get_ie(pbuf, WLAN_EID_VENDOR_SPECIFIC, &len, limit_new); if (pbuf) { @@ -638,7 +638,7 @@ check_next_ie: unsigned char *rtw_get_wpa2_ie(unsigned char *pie, int *rsn_ie_len, int limit) { - return rtw_get_ie(pie, _WPA2_IE_ID_, rsn_ie_len, limit); + return rtw_get_ie(pie, WLAN_EID_RSN, rsn_ie_len, limit); } @@ -724,7 +724,7 @@ int rtw_parse_wpa_ie(u8 *wpa_ie, int wpa_ie_len, int *group_cipher, } - if ((*wpa_ie != _WPA_IE_ID_) || (*(wpa_ie + 1) != (u8)(wpa_ie_len - 2)) || + if ((*wpa_ie != WLAN_EID_VENDOR_SPECIFIC) || (*(wpa_ie + 1) != (u8)(wpa_ie_len - 2)) || (_rtw_memcmp(wpa_ie + 2, RTW_WPA_OUI_TYPE, WPA_SELECTOR_LEN) != _TRUE)) return _FAIL; @@ -982,7 +982,7 @@ int rtw_get_sec_ie(u8 *in_ie, uint in_len, u8 *rsn_ie, u16 *rsn_len, u8 *wpa_ie, while (cnt < in_len) { authmode = in_ie[cnt]; - if ((authmode == _WPA_IE_ID_) && (_rtw_memcmp(&in_ie[cnt + 2], &wpa_oui[0], 4) == _TRUE)) { + if ((authmode == WLAN_EID_VENDOR_SPECIFIC) && (_rtw_memcmp(&in_ie[cnt + 2], &wpa_oui[0], 4) == _TRUE)) { if (wpa_ie) memcpy(wpa_ie, &in_ie[cnt], in_ie[cnt + 1] + 2); @@ -990,7 +990,7 @@ int rtw_get_sec_ie(u8 *in_ie, uint in_len, u8 *rsn_ie, u16 *rsn_len, u8 *wpa_ie, *wpa_len = in_ie[cnt + 1] + 2; cnt += in_ie[cnt + 1] + 2; /* get next */ } else { - if (authmode == _WPA2_IE_ID_) { + if (authmode == WLAN_EID_RSN) { if (rsn_ie) memcpy(rsn_ie, &in_ie[cnt], in_ie[cnt + 1] + 2); @@ -1019,7 +1019,7 @@ u8 rtw_is_wps_ie(u8 *ie_ptr, uint *wps_ielen) eid = ie_ptr[0]; - if ((eid == _WPA_IE_ID_) && (_rtw_memcmp(&ie_ptr[2], wps_oui, 4) == _TRUE)) { + if ((eid == WLAN_EID_VENDOR_SPECIFIC) && (_rtw_memcmp(&ie_ptr[2], wps_oui, 4) == _TRUE)) { /* RTW_INFO("==> found WPS_IE.....\n"); */ *wps_ielen = ie_ptr[1] + 2; match = _TRUE; diff --git a/core/rtw_mlme.c b/core/rtw_mlme.c index 34fcfef..0758643 100644 --- a/core/rtw_mlme.c +++ b/core/rtw_mlme.c @@ -4350,15 +4350,15 @@ sint rtw_restruct_sec_ie(_adapter *adapter, u8 *out_ie) uint ndisauthmode = psecuritypriv->ndisauthtype; if ((ndisauthmode == Ndis802_11AuthModeWPA) || (ndisauthmode == Ndis802_11AuthModeWPAPSK)) - authmode = _WPA_IE_ID_; + authmode = WLAN_EID_VENDOR_SPECIFIC; if ((ndisauthmode == Ndis802_11AuthModeWPA2) || (ndisauthmode == Ndis802_11AuthModeWPA2PSK)) - authmode = _WPA2_IE_ID_; + authmode = WLAN_EID_RSN; if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS)) { memcpy(out_ie, psecuritypriv->wps_ie, psecuritypriv->wps_ie_len); ielength = psecuritypriv->wps_ie_len; - } else if ((authmode == _WPA_IE_ID_) || (authmode == _WPA2_IE_ID_)) { + } else if ((authmode == WLAN_EID_VENDOR_SPECIFIC) || (authmode == WLAN_EID_RSN)) { /* copy RSN or SSN */ memcpy(out_ie, psecuritypriv->supplicant_ie, psecuritypriv->supplicant_ie[1] + 2); /* debug for CONFIG_IEEE80211W diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index 217c3b1..3a88380 100644 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -13372,9 +13372,9 @@ static u8 rtw_ft_update_ftie( u8 *pie; u32 len; - if ((pie = rtw_get_ie(pft_roam->updated_ft_ies, _FTIE_, &len, + if ((pie = rtw_get_ie(pft_roam->updated_ft_ies, WLAN_EID_FAST_BSS_TRANSITION, &len, pft_roam->updated_ft_ies_len)) != NULL) { - *pframe = rtw_set_ie(*pframe, _FTIE_, len , + *pframe = rtw_set_ie(*pframe, WLAN_EID_FAST_BSS_TRANSITION, len , (pie+2), &(pattrib->pktlen)); } else return _FAIL; diff --git a/core/rtw_tdls.c b/core/rtw_tdls.c index 2fba19c..84787ce 100644 --- a/core/rtw_tdls.c +++ b/core/rtw_tdls.c @@ -754,17 +754,17 @@ u8 *rtw_tdls_set_ftie(struct tdls_txmgmt *ptxmgmt, u8 *pframe, struct pkt_attrib int len = 0; if (ptxmgmt->len > 0) - p = rtw_get_ie(ptxmgmt->buf, _FTIE_, &len, ptxmgmt->len); + p = rtw_get_ie(ptxmgmt->buf, WLAN_EID_FAST_BSS_TRANSITION, &len, ptxmgmt->len); if (p != NULL) - return rtw_set_ie(pframe, _FTIE_, len, p + 2, &(pattrib->pktlen)); + return rtw_set_ie(pframe, WLAN_EID_FAST_BSS_TRANSITION, len, p + 2, &(pattrib->pktlen)); else { if (ANonce != NULL) memcpy(FTIE.Anonce, ANonce, WPA_NONCE_LEN); if (SNonce != NULL) memcpy(FTIE.Snonce, SNonce, WPA_NONCE_LEN); - return rtw_set_ie(pframe, _FTIE_, TDLS_FTIE_DATA_LEN, + return rtw_set_ie(pframe, WLAN_EID_FAST_BSS_TRANSITION, TDLS_FTIE_DATA_LEN, (u8 *)FTIE.data, &(pattrib->pktlen)); } } @@ -881,7 +881,7 @@ u8 *rtw_tdls_set_supported_rate(_adapter *padapter, u8 *pframe, struct pkt_attri u8 *rtw_tdls_set_sup_reg_class(u8 *pframe, struct pkt_attrib *pattrib) { - return rtw_set_ie(pframe, _SRC_IE_ , sizeof(TDLS_SRC), TDLS_SRC, &(pattrib->pktlen)); + return rtw_set_ie(pframe, WLAN_EID_SUPPORTED_REGULATORY_CLASSES , sizeof(TDLS_SRC), TDLS_SRC, &(pattrib->pktlen)); } u8 *rtw_tdls_set_linkid(_adapter *padapter, u8 *pframe, struct pkt_attrib *pattrib, u8 init) @@ -900,7 +900,7 @@ u8 *rtw_tdls_set_linkid(_adapter *padapter, u8 *pframe, struct pkt_attrib *pattr memcpy((link_id_addr + 6), pattrib->dst, 6); memcpy((link_id_addr + 12), pattrib->src, 6); } - return rtw_set_ie(pframe, _LINK_ID_IE_, 18, link_id_addr, &(pattrib->pktlen)); + return rtw_set_ie(pframe, WLAN_EID_LINK_ID, 18, link_id_addr, &(pattrib->pktlen)); } #ifdef CONFIG_TDLS_CH_SW @@ -924,7 +924,7 @@ u8 *rtw_tdls_set_ch_sw(u8 *pframe, struct pkt_attrib *pattrib, struct sta_info * memcpy(ch_switch_timing, &switch_time, 2); memcpy(ch_switch_timing + 2, &switch_timeout, 2); - return rtw_set_ie(pframe, _CH_SWITCH_TIMING_, 4, ch_switch_timing, &(pattrib->pktlen)); + return rtw_set_ie(pframe, WLAN_EID_CHAN_SWITCH_TIMING, 4, ch_switch_timing, &(pattrib->pktlen)); } void rtw_tdls_set_ch_sw_oper_control(_adapter *padapter, u8 enable) @@ -1945,7 +1945,7 @@ sint On_TDLS_Setup_Req(_adapter *padapter, union recv_frame *precv_frame, struct break; case WLAN_EID_VENDOR_SPECIFIC: break; - case _FTIE_: + case WLAN_EID_FAST_BSS_TRANSITION: if (prx_pkt_attrib->encrypt) memcpy(SNonce, (ptr + j + 52), 32); break; @@ -1953,7 +1953,7 @@ sint On_TDLS_Setup_Req(_adapter *padapter, union recv_frame *precv_frame, struct if (prx_pkt_attrib->encrypt) timeout_interval = cpu_to_le32(*(u32 *)(ptr + j + 3)); break; - case _RIC_Descriptor_IE_: + case WLAN_EID_RIC_DESCRIPTOR: break; #ifdef CONFIG_80211N_HT case WLAN_EID_HT_CAPABILITY: @@ -1969,7 +1969,7 @@ sint On_TDLS_Setup_Req(_adapter *padapter, union recv_frame *precv_frame, struct #endif case EID_BSSCoexistence: break; - case _LINK_ID_IE_: + case WLAN_EID_LINK_ID: if (_rtw_memcmp(get_bssid(pmlmepriv), pIE->data, 6) == _FALSE) txmgmt.status_code = _STATS_NOT_IN_SAME_BSS_; break; @@ -2124,7 +2124,7 @@ int On_TDLS_Setup_Rsp(_adapter *padapter, union recv_frame *precv_frame, struct ptdls_sta->qos_option = _TRUE; } break; - case _FTIE_: + case WLAN_EID_FAST_BSS_TRANSITION: pftie = (u8 *)pIE; memcpy(ANonce, (ptr + j + 20), 32); break; @@ -2132,7 +2132,7 @@ int On_TDLS_Setup_Rsp(_adapter *padapter, union recv_frame *precv_frame, struct ptimeout_ie = (u8 *)pIE; timeout_interval = cpu_to_le32(*(u32 *)(ptimeout_ie + 3)); break; - case _RIC_Descriptor_IE_: + case WLAN_EID_RIC_DESCRIPTOR: break; #ifdef CONFIG_80211N_HT case WLAN_EID_HT_CAPABILITY: @@ -2152,7 +2152,7 @@ int On_TDLS_Setup_Rsp(_adapter *padapter, union recv_frame *precv_frame, struct #endif case EID_BSSCoexistence: break; - case _LINK_ID_IE_: + case WLAN_EID_LINK_ID: plinkid_ie = (u8 *)pIE; break; default: @@ -2271,7 +2271,7 @@ int On_TDLS_Setup_Cfm(_adapter *padapter, union recv_frame *precv_frame, struct ptdls_sta->qos_option = _TRUE; } break; - case _FTIE_: + case WLAN_EID_FAST_BSS_TRANSITION: pftie = (u8 *)pIE; break; case WLAN_EID_TIMEOUT_INTERVAL: @@ -2289,7 +2289,7 @@ int On_TDLS_Setup_Cfm(_adapter *padapter, union recv_frame *precv_frame, struct rtw_tdls_process_vht_op_mode_notify(padapter, ptdls_sta, pIE->data, pIE->Length); break; #endif - case _LINK_ID_IE_: + case WLAN_EID_LINK_ID: plinkid_ie = (u8 *)pIE; break; default: @@ -2371,7 +2371,7 @@ int On_TDLS_Dis_Req(_adapter *padapter, union recv_frame *precv_frame) pIE = (PNDIS_802_11_VARIABLE_IEs)(ptr + j); switch (pIE->ElementID) { - case _LINK_ID_IE_: + case WLAN_EID_LINK_ID: psta_ap = rtw_get_stainfo(pstapriv, pIE->data); if (psta_ap == NULL) goto exit; @@ -2574,9 +2574,9 @@ sint On_TDLS_Ch_Switch_Req(_adapter *padapter, union recv_frame *precv_frame, st break; } break; - case _LINK_ID_IE_: + case WLAN_EID_LINK_ID: break; - case _CH_SWITCH_TIMING_: + case WLAN_EID_CHAN_SWITCH_TIMING: ptdls_sta->ch_switch_time = (RTW_GET_LE16(pIE->data) >= TDLS_CH_SWITCH_TIME * 1000) ? RTW_GET_LE16(pIE->data) : TDLS_CH_SWITCH_TIME * 1000; ptdls_sta->ch_switch_timeout = (RTW_GET_LE16(pIE->data + 2) >= TDLS_CH_SWITCH_TIMEOUT * 1000) ? @@ -2672,9 +2672,9 @@ sint On_TDLS_Ch_Switch_Rsp(_adapter *padapter, union recv_frame *precv_frame, st pIE = (PNDIS_802_11_VARIABLE_IEs)(ptr + j); switch (pIE->ElementID) { - case _LINK_ID_IE_: + case WLAN_EID_LINK_ID: break; - case _CH_SWITCH_TIMING_: + case WLAN_EID_CHAN_SWITCH_TIMING: memcpy(&switch_time, pIE->data, 2); if (switch_time > ptdls_sta->ch_switch_time) memcpy(&ptdls_sta->ch_switch_time, &switch_time, 2); @@ -3144,7 +3144,7 @@ void rtw_build_tdls_peer_traffic_indication_ies(_adapter *padapter, struct xmit_ AC_queue = BIT(2); if (ptdls_sta->uapsd_vo & BIT(1)) AC_queue = BIT(3); - pframe = rtw_set_ie(pframe, _PTI_BUFFER_STATUS_, 1, &AC_queue, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_PU_BUFFER_STATUS, 1, &AC_queue, &(pattrib->pktlen)); } diff --git a/include/rtw_security.h b/include/rtw_security.h index 5d52d42..ff3c739 100644 --- a/include/rtw_security.h +++ b/include/rtw_security.h @@ -38,9 +38,6 @@ const char *security_type_str(u8 value); -#define _WPA_IE_ID_ 0xdd -#define _WPA2_IE_ID_ 0x30 - #define SHA256_MAC_LEN 32 #define AES_BLOCK_SIZE 16 #define AES_PRIV_SIZE (4 * 44) diff --git a/os_dep/linux/mlme_linux.c b/os_dep/linux/mlme_linux.c index 2098c19..4e66201 100644 --- a/os_dep/linux/mlme_linux.c +++ b/os_dep/linux/mlme_linux.c @@ -187,7 +187,7 @@ void rtw_report_sec_ie(_adapter *adapter, u8 authmode, u8 *sec_ie) buff = NULL; - if (authmode == _WPA_IE_ID_) { + if (authmode == WLAN_EID_VENDOR_SPECIFIC) { buff = rtw_zmalloc(IW_CUSTOM_MAX); if (NULL == buff) { From 34f947ef16f235eae948601151fa288fe2da17a5 Mon Sep 17 00:00:00 2001 From: Carlos Garces Date: Thu, 21 Oct 2021 19:46:49 +0200 Subject: [PATCH 15/20] remove typedefs in ieee80211.h This commit fixes checkpatch.pl warnings: also port the folowing commits 5ef6c5db04ffff21006099961c3c8acc5727b2c8 74941703accd4a94e7a74c31050d7985216b7034 7d0b4f3c9300f43b65125115f5728e1a5d39e270 --- core/mesh/rtw_mesh.h | 1 - core/rtw_ieee80211.c | 2 +- core/rtw_mlme_ext.c | 6 ++-- include/ieee80211.h | 84 ++++++-------------------------------------- 4 files changed, 14 insertions(+), 79 deletions(-) diff --git a/core/mesh/rtw_mesh.h b/core/mesh/rtw_mesh.h index 7b7acfe..166dad3 100644 --- a/core/mesh/rtw_mesh.h +++ b/core/mesh/rtw_mesh.h @@ -401,7 +401,6 @@ struct rtw_mesh_info { }; extern const char *_action_self_protected_str[]; -#define action_self_protected_str(action) ((action < RTW_ACT_SELF_PROTECTED_NUM) ? _action_self_protected_str[action] : _action_self_protected_str[0]) u8 *rtw_set_ie_mesh_id(u8 *buf, u32 *buf_len, const char *mesh_id, u8 id_len); u8 *rtw_set_ie_mesh_config(u8 *buf, u32 *buf_len diff --git a/core/rtw_ieee80211.c b/core/rtw_ieee80211.c index 48d136e..62e24bf 100644 --- a/core/rtw_ieee80211.c +++ b/core/rtw_ieee80211.c @@ -1295,7 +1295,7 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen, * @show_errors: Whether to show parsing errors in debug log * Returns: Parsing result */ -ParseRes rtw_ieee802_11_parse_elems(u8 *start, uint len, +enum ParseRes rtw_ieee802_11_parse_elems(u8 *start, uint len, struct rtw_ieee802_11_elems *elems, int show_errors) { diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index 3a88380..383eade 100644 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -2447,7 +2447,7 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) } - if (pkt_len < IEEE80211_3ADDR_LEN + ie_offset) { + if (pkt_len < sizeof(struct ieee80211_hdr_3addr) + ie_offset) { RTW_INFO("handle_assoc(reassoc=%d) - too short payload (len=%lu)" "\n", reassoc, (unsigned long)pkt_len); return _FAIL; @@ -2501,8 +2501,8 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) } /* now parse all ieee802_11 ie to point to elems */ - left = pkt_len - (IEEE80211_3ADDR_LEN + ie_offset); - pos = pframe + (IEEE80211_3ADDR_LEN + ie_offset); + left = pkt_len - (sizeof(struct ieee80211_hdr_3addr) + ie_offset); + pos = pframe + (sizeof(struct ieee80211_hdr_3addr) + ie_offset); if (rtw_ieee802_11_parse_elems(pos, left, &elems, 1) == ParseFailed) { RTW_INFO("STA " MAC_FMT " sent invalid association request\n", MAC_ARG(pstat->cmn.mac_addr)); diff --git a/include/ieee80211.h b/include/ieee80211.h index e0a9e94..5ac9229 100644 --- a/include/ieee80211.h +++ b/include/ieee80211.h @@ -219,7 +219,7 @@ struct wpa_eapol_key { /* followed by key_data_length bytes of key_data */ }; -typedef enum _RATEID_IDX_ { +enum RATEID_IDX { RATEID_IDX_BGN_40M_2SS = 0, RATEID_IDX_BGN_40M_1SS = 1, RATEID_IDX_BGN_20M_2SS_BN = 2, @@ -235,9 +235,9 @@ typedef enum _RATEID_IDX_ { RATEID_IDX_MIX2 = 12, RATEID_IDX_VHT_3SS = 13, RATEID_IDX_BGN_3SS = 14, -} RATEID_IDX, *PRATEID_IDX; +}; -typedef enum _RATR_TABLE_MODE { +enum RATR_TABLE_MODE { RATR_INX_WIRELESS_NGB = 0, /* BGN 40 Mhz 2SS 1SS */ RATR_INX_WIRELESS_NG = 1, /* GN or N */ RATR_INX_WIRELESS_NB = 2, /* BGN 20 Mhz 2SS 1SS or BN */ @@ -247,7 +247,7 @@ typedef enum _RATR_TABLE_MODE { RATR_INX_WIRELESS_B = 6, RATR_INX_WIRELESS_MC = 7, RATR_INX_WIRELESS_AC_N = 8, -} RATR_TABLE_MODE, *PRATR_TABLE_MODE; +}; enum NETWORK_TYPE { @@ -300,7 +300,7 @@ enum NETWORK_TYPE { -typedef struct ieee_param { +struct ieee_param { u32 cmd; u8 sta_addr[ETH_ALEN]; union { @@ -341,14 +341,14 @@ typedef struct ieee_param { #endif } u; -} ieee_param; +}; #ifdef CONFIG_AP_MODE -typedef struct ieee_param_ex { +struct ieee_param_ex { u32 cmd; u8 sta_addr[ETH_ALEN]; u8 data[0]; -} ieee_param_ex; +}; struct sta_data { u16 aid; @@ -433,24 +433,6 @@ struct ieee80211_snap_hdr { || reason == WLAN_REASON_SA_QUERY_TIMEOUT \ ) -#define IEEE80211_MGMT_HDR_LEN 24 -#define IEEE80211_DATA_HDR3_LEN 24 -#define IEEE80211_DATA_HDR4_LEN 30 - - -#define IEEE80211_STATMASK_SIGNAL (1<<0) -#define IEEE80211_STATMASK_RSSI (1<<1) -#define IEEE80211_STATMASK_NOISE (1<<2) -#define IEEE80211_STATMASK_RATE (1<<3) -#define IEEE80211_STATMASK_WEMASK 0x7 - - -#define IEEE80211_CCK_MODULATION (1<<0) -#define IEEE80211_OFDM_MODULATION (1<<1) - -#define IEEE80211_24GHZ_BAND (1<<0) -#define IEEE80211_52GHZ_BAND (1<<1) - #define IEEE80211_CCK_RATE_LEN 4 #define IEEE80211_NUM_OFDM_RATESLEN 8 @@ -788,45 +770,6 @@ join_res: > 0: TID */ -enum ieee80211_state { - - /* the card is not linked at all */ - IEEE80211_NOLINK = 0, - - /* IEEE80211_ASSOCIATING* are for BSS client mode - * the driver shall not perform RX filtering unless - * the state is LINKED. - * The driver shall just check for the state LINKED and - * defaults to NOLINK for ALL the other states (including - * LINKED_SCANNING) - */ - - /* the association procedure will start (wq scheduling)*/ - IEEE80211_ASSOCIATING, - IEEE80211_ASSOCIATING_RETRY, - - /* the association procedure is sending AUTH request*/ - IEEE80211_ASSOCIATING_AUTHENTICATING, - - /* the association procedure has successfully authentcated - * and is sending association request - */ - IEEE80211_ASSOCIATING_AUTHENTICATED, - - /* the link is ok. the card associated to a BSS or linked - * to a ibss cell or acting as an AP and creating the bss - */ - IEEE80211_LINKED, - - /* same as LINKED, but the driver shall apply RX filter - * rules as we are in NO_LINK mode. As the card is still - * logically linked, but it is doing a syncro site survey - * then it will be back to LINKED state. - */ - IEEE80211_LINKED_SCANNING, - -}; - #define DEFAULT_MAX_SCAN_AGE (15 * HZ) #define DEFAULT_FTS 2346 #define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x" @@ -858,13 +801,6 @@ extern __inline int is_zero_mac_addr(const u8 *addr) #define CFG_IEEE80211_RESERVE_FCS (1<<0) #define CFG_IEEE80211_COMPUTE_FCS (1<<1) -typedef struct tx_pending_t { - int frag; - struct ieee80211_txb *txb; -} tx_pending_t; - - - #define TID_NUM 16 #define IEEE_A (1<<0) @@ -1087,9 +1023,9 @@ struct rtw_ieee802_11_elems { #endif }; -typedef enum { ParseOK = 0, ParseUnknown = 1, ParseFailed = -1 } ParseRes; +enum ParseRes { ParseOK = 0, ParseUnknown = 1, ParseFailed = -1 }; -ParseRes rtw_ieee802_11_parse_elems(u8 *start, uint len, +enum ParseRes rtw_ieee802_11_parse_elems(u8 *start, uint len, struct rtw_ieee802_11_elems *elems, int show_errors); From 7a0d67040a10ab847f6b3f9f445b6342ea5db3b6 Mon Sep 17 00:00:00 2001 From: Carlos Garces Date: Thu, 21 Oct 2021 20:58:08 +0200 Subject: [PATCH 16/20] remove ELEMENT_ID enum Values are replaced with the equivalent ones from enum ieee80211_eid linux/ieee80211.h Link: https://lore.kernel.org/r/20201208040733.379197-22-ross.schm.dev@gmail.com --- core/rtw_ap.c | 18 ++++----- core/rtw_ieee80211.c | 6 +-- core/rtw_mlme.c | 2 +- core/rtw_mlme_ext.c | 44 +++++++++++----------- core/rtw_rm.c | 10 ++--- core/rtw_tdls.c | 38 +++++++++---------- core/rtw_vht.c | 24 ++++++------ core/rtw_wlan_util.c | 4 +- include/wifi.h | 77 -------------------------------------- os_dep/linux/ioctl_linux.c | 4 +- 10 files changed, 75 insertions(+), 152 deletions(-) diff --git a/core/rtw_ap.c b/core/rtw_ap.c index 2fb1e85..49f525b 100644 --- a/core/rtw_ap.c +++ b/core/rtw_ap.c @@ -2421,7 +2421,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) && (!rfctl->country_ent || COUNTRY_CHPLAN_EN_11AC(rfctl->country_ent)) ) { /* Parsing VHT CAP IE */ - p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, EID_VHTCapability, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); + p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_VHT_CAPABILITY, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); if (p && ie_len > 0) vht_cap = _TRUE; @@ -2452,7 +2452,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) SET_EXT_CAPABILITY_ELE_BSS_COEXIST(pmlmepriv->ext_capab_ie_data, 1); pmlmepriv->ext_capab_ie_len = 10; - rtw_set_ie(pbss_network->IEs + pbss_network->IELength, EID_EXTCapability, 8, pmlmepriv->ext_capab_ie_data, &len); + rtw_set_ie(pbss_network->IEs + pbss_network->IELength, WLAN_EID_EXT_CAPABILITY, 8, pmlmepriv->ext_capab_ie_data, &len); pbss_network->IELength += pmlmepriv->ext_capab_ie_len; } #endif /* CONFIG_80211N_HT */ @@ -3344,7 +3344,7 @@ void rtw_process_public_act_bsscoex(_adapter *padapter, u8 *pframe, uint frame_l action = frame_body[1]; if (frame_body_len > 0) { - if ((frame_body[2] == EID_BSSCoexistence) && (frame_body[3] > 0)) { + if ((frame_body[2] == WLAN_EID_BSS_COEX_2040) && (frame_body[3] > 0)) { u8 ie_data = frame_body[4]; if (ie_data & RTW_WLAN_20_40_BSS_COEX_40MHZ_INTOL) { @@ -3364,8 +3364,8 @@ void rtw_process_public_act_bsscoex(_adapter *padapter, u8 *pframe, uint frame_l } if (frame_body_len > 8) { - /* if EID_BSSIntolerantChlReport ie exists */ - if ((frame_body[5] == EID_BSSIntolerantChlReport) && (frame_body[6] > 0)) { + /* if WLAN_EID_BSS_INTOLERANT_CHL_REPORT ie exists */ + if ((frame_body[5] == WLAN_EID_BSS_INTOLERANT_CHL_REPORT) && (frame_body[6] > 0)) { /*todo:*/ if (pmlmepriv->ht_intolerant_ch_reported == _FALSE) { pmlmepriv->ht_intolerant_ch_reported = _TRUE; @@ -4327,8 +4327,8 @@ void rtw_ap_update_bss_chbw(_adapter *adapter, WLAN_BSSID_EX *bss, u8 ch, u8 bw, int vht_cap_ielen, vht_op_ielen; u8 center_freq; - vht_cap_ie = rtw_get_ie((bss->IEs + sizeof(NDIS_802_11_FIXED_IEs)), EID_VHTCapability, &vht_cap_ielen, (bss->IELength - sizeof(NDIS_802_11_FIXED_IEs))); - vht_op_ie = rtw_get_ie((bss->IEs + sizeof(NDIS_802_11_FIXED_IEs)), EID_VHTOperation, &vht_op_ielen, (bss->IELength - sizeof(NDIS_802_11_FIXED_IEs))); + vht_cap_ie = rtw_get_ie((bss->IEs + sizeof(NDIS_802_11_FIXED_IEs)), WLAN_EID_VHT_CAPABILITY, &vht_cap_ielen, (bss->IELength - sizeof(NDIS_802_11_FIXED_IEs))); + vht_op_ie = rtw_get_ie((bss->IEs + sizeof(NDIS_802_11_FIXED_IEs)), WLAN_EID_VHT_OPERATION, &vht_op_ielen, (bss->IELength - sizeof(NDIS_802_11_FIXED_IEs))); center_freq = rtw_get_center_ch(ch, bw, offset); /* update vht cap ie */ @@ -4369,8 +4369,8 @@ void rtw_ap_update_bss_chbw(_adapter *adapter, WLAN_BSSID_EX *bss, u8 ch, u8 bw, u8 *ht_cap_ie, *ht_op_ie; int ht_cap_ielen, ht_op_ielen; - ht_cap_ie = rtw_get_ie((bss->IEs + sizeof(NDIS_802_11_FIXED_IEs)), EID_HTCapability, &ht_cap_ielen, (bss->IELength - sizeof(NDIS_802_11_FIXED_IEs))); - ht_op_ie = rtw_get_ie((bss->IEs + sizeof(NDIS_802_11_FIXED_IEs)), EID_HTInfo, &ht_op_ielen, (bss->IELength - sizeof(NDIS_802_11_FIXED_IEs))); + ht_cap_ie = rtw_get_ie((bss->IEs + sizeof(NDIS_802_11_FIXED_IEs)), WLAN_EID_HT_CAPABILITY, &ht_cap_ielen, (bss->IELength - sizeof(NDIS_802_11_FIXED_IEs))); + ht_op_ie = rtw_get_ie((bss->IEs + sizeof(NDIS_802_11_FIXED_IEs)), WLAN_EID_HT_OPERATION, &ht_op_ielen, (bss->IELength - sizeof(NDIS_802_11_FIXED_IEs))); /* update ht cap ie */ if (ht_cap_ie && ht_cap_ielen) { diff --git a/core/rtw_ieee80211.c b/core/rtw_ieee80211.c index 62e24bf..d860b0a 100644 --- a/core/rtw_ieee80211.c +++ b/core/rtw_ieee80211.c @@ -1776,13 +1776,13 @@ void rtw_ies_get_chbw(u8 *ies, int ies_len, u8 *ch, u8 *bw, u8 *offset, u8 ht, u u8 *ht_cap_ie, *ht_op_ie; int ht_cap_ielen, ht_op_ielen; - ht_cap_ie = rtw_get_ie(ies, EID_HTCapability, &ht_cap_ielen, ies_len); + ht_cap_ie = rtw_get_ie(ies, WLAN_EID_HT_CAPABILITY, &ht_cap_ielen, ies_len); if (ht_cap_ie && ht_cap_ielen) { if (GET_HT_CAP_ELE_CHL_WIDTH(ht_cap_ie + 2)) *bw = CHANNEL_WIDTH_40; } - ht_op_ie = rtw_get_ie(ies, EID_HTInfo, &ht_op_ielen, ies_len); + ht_op_ie = rtw_get_ie(ies, WLAN_EID_HT_OPERATION, &ht_op_ielen, ies_len); if (ht_op_ie && ht_op_ielen) { if (*ch == 0) *ch = GET_HT_OP_ELE_PRI_CHL(ht_op_ie + 2); @@ -1811,7 +1811,7 @@ void rtw_ies_get_chbw(u8 *ies, int ies_len, u8 *ch, u8 *bw, u8 *offset, u8 ht, u u8 *vht_op_ie; int vht_op_ielen; - vht_op_ie = rtw_get_ie(ies, EID_VHTOperation, &vht_op_ielen, ies_len); + vht_op_ie = rtw_get_ie(ies, WLAN_EID_VHT_OPERATION, &vht_op_ielen, ies_len); if (vht_op_ie && vht_op_ielen) { if (GET_VHT_OPERATION_ELE_CHL_WIDTH(vht_op_ie + 2) >= 1) *bw = CHANNEL_WIDTH_80; diff --git a/core/rtw_mlme.c b/core/rtw_mlme.c index 0758643..d32a8e2 100644 --- a/core/rtw_mlme.c +++ b/core/rtw_mlme.c @@ -5118,7 +5118,7 @@ void rtw_append_exented_cap(_adapter *padapter, u8 *out_ie, uint *pout_len) transmit the Extended Capabilities element. */ if (_FALSE == _rtw_memcmp(cap_content, null_content, 8)) - pframe = rtw_set_ie(out_ie + *pout_len, EID_EXTCapability, 8, cap_content , pout_len); + pframe = rtw_set_ie(out_ie + *pout_len, WLAN_EID_EXT_CAPABILITY, 8, cap_content , pout_len); } #endif diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index 383eade..895fd5a 100644 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -2847,14 +2847,14 @@ unsigned int OnAssocRsp(_adapter *padapter, union recv_frame *precv_frame) break; #ifdef CONFIG_80211AC_VHT - case EID_VHTCapability: + case WLAN_EID_VHT_CAPABILITY: VHT_caps_handler(padapter, pIE); #ifdef ROKU_PRIVATE VHT_caps_handler_infra_ap(padapter, pIE); #endif /* ROKU_PRIVATE */ break; - case EID_VHTOperation: + case WLAN_EID_VHT_OPERATION: VHT_operation_handler(padapter, pIE); break; #endif @@ -8857,7 +8857,7 @@ void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *p u32 ie_len = 0; /* FILL VHT CAP IE */ - pbuf = rtw_get_ie(ie + _BEACON_IE_OFFSET_, EID_VHTCapability, &ie_len, (pnetwork->IELength - _BEACON_IE_OFFSET_)); + pbuf = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_VHT_CAPABILITY, &ie_len, (pnetwork->IELength - _BEACON_IE_OFFSET_)); if (pbuf && ie_len > 0) { memcpy(pframe, pbuf, ie_len + 2); pframe += (ie_len + 2); @@ -8865,7 +8865,7 @@ void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *p } /* FILL VHT OPERATION IE */ - pbuf = rtw_get_ie(ie + _BEACON_IE_OFFSET_, EID_VHTOperation, &ie_len, (pnetwork->IELength - _BEACON_IE_OFFSET_)); + pbuf = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_VHT_OPERATION, &ie_len, (pnetwork->IELength - _BEACON_IE_OFFSET_)); if (pbuf && ie_len > 0) { memcpy(pframe, pbuf, ie_len + 2); pframe += (ie_len + 2); @@ -9052,7 +9052,7 @@ void _issue_assocreq(_adapter *padapter, u8 is_reassoc) if (pmlmeext->cur_channel > 14) { pow_cap_ele[0] = 13; /* Minimum transmit power capability */ pow_cap_ele[1] = 21; /* Maximum transmit power capability */ - pframe = rtw_set_ie(pframe, EID_PowerCap, 2, pow_cap_ele, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_PWR_CAPABILITY, 2, pow_cap_ele, &(pattrib->pktlen)); /* supported channels */ while (sup_ch_idx < rfctl->max_chan_nums && rfctl->channel_set[sup_ch_idx].ChannelNum != 0) { @@ -9066,7 +9066,7 @@ void _issue_assocreq(_adapter *padapter, u8 is_reassoc) } sup_ch_idx++; } - pframe = rtw_set_ie(pframe, EID_SupportedChannels, idx_5g, sup_ch, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_SUPPORTED_CHANNELS, idx_5g, sup_ch, &(pattrib->pktlen)); } #endif /* CONFIG_DFS */ @@ -9183,7 +9183,7 @@ void _issue_assocreq(_adapter *padapter, u8 is_reassoc) } break; - case EID_WPA2: + case WLAN_EID_RSN: #ifdef CONFIG_RTW_80211R if ((is_reassoc) && (rtw_ft_roam(padapter))) { rtw_ft_update_rsnie(padapter, _TRUE, pattrib, &pframe); @@ -9199,36 +9199,36 @@ void _issue_assocreq(_adapter *padapter, u8 is_reassoc) } #endif /* CONFIG_IOCTL_CFG80211 */ - pframe = rtw_set_ie(pframe, EID_WPA2, pIE->Length, pIE->data, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_RSN, pIE->Length, pIE->data, &(pattrib->pktlen)); } break; #ifdef CONFIG_80211N_HT - case EID_HTCapability: + case WLAN_EID_HT_CAPABILITY: if (padapter->mlmepriv.htpriv.ht_option == _TRUE) { if (!(is_ap_in_tkip(padapter))) { memcpy(&(pmlmeinfo->HT_caps), pIE->data, sizeof(struct HT_caps_element)); pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info = cpu_to_le16(pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info); - pframe = rtw_set_ie(pframe, EID_HTCapability, pIE->Length , (u8 *)(&(pmlmeinfo->HT_caps)), &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_HT_CAPABILITY, pIE->Length , (u8 *)(&(pmlmeinfo->HT_caps)), &(pattrib->pktlen)); } } break; - case EID_EXTCapability: + case WLAN_EID_EXT_CAPABILITY: if (padapter->mlmepriv.htpriv.ht_option == _TRUE) - pframe = rtw_set_ie(pframe, EID_EXTCapability, pIE->Length, pIE->data, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_EXT_CAPABILITY, pIE->Length, pIE->data, &(pattrib->pktlen)); break; #endif /* CONFIG_80211N_HT */ #ifdef CONFIG_80211AC_VHT - case EID_VHTCapability: + case WLAN_EID_VHT_CAPABILITY: if (padapter->mlmepriv.vhtpriv.vht_option == _TRUE) - pframe = rtw_set_ie(pframe, EID_VHTCapability, pIE->Length, pIE->data, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_VHT_CAPABILITY, pIE->Length, pIE->data, &(pattrib->pktlen)); break; - case EID_OpModeNotification: + case WLAN_EID_OPMODE_NOTIF: if (padapter->mlmepriv.vhtpriv.vht_option == _TRUE) - pframe = rtw_set_ie(pframe, EID_OpModeNotification, pIE->Length, pIE->data, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_OPMODE_NOTIF, pIE->Length, pIE->data, &(pattrib->pktlen)); break; #endif /* CONFIG_80211AC_VHT */ default: @@ -10433,7 +10433,7 @@ void issue_action_BSSCoexistPacket(_adapter *padapter) iedata |= BIT(2);/* 20 MHz BSS Width Request */ - pframe = rtw_set_ie(pframe, EID_BSSCoexistence, 1, &iedata, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_BSS_COEX_2040, 1, &iedata, &(pattrib->pktlen)); } @@ -10496,7 +10496,7 @@ void issue_action_BSSCoexistPacket(_adapter *padapter) } } - pframe = rtw_set_ie(pframe, EID_BSSIntolerantChlReport, k, InfoContent, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_BSS_INTOLERANT_CHL_REPORT, k, InfoContent, &(pattrib->pktlen)); } @@ -13327,14 +13327,14 @@ u8 rtw_ft_update_rsnie( u8 *pie; u32 len; - pie = rtw_get_ie(pft_roam->updated_ft_ies, EID_WPA2, &len, + pie = rtw_get_ie(pft_roam->updated_ft_ies, WLAN_EID_RSN, &len, pft_roam->updated_ft_ies_len); if (!bwrite) return (pie)?_SUCCESS:_FAIL; if (pie) { - *pframe = rtw_set_ie(((u8 *)*pframe), EID_WPA2, len, + *pframe = rtw_set_ie(((u8 *)*pframe), WLAN_EID_RSN, len, pie+2, &(pattrib->pktlen)); } else return _FAIL; @@ -14021,11 +14021,11 @@ u8 join_cmd_hdl(_adapter *padapter, u8 *pbuf) #endif /* CONFIG_80211N_HT */ #ifdef CONFIG_80211AC_VHT - case EID_VHTCapability: /* Get VHT Cap IE. */ + case WLAN_EID_VHT_CAPABILITY: /* Get VHT Cap IE. */ pmlmeinfo->VHT_enable = 1; break; - case EID_VHTOperation: /* Get VHT Operation IE. */ + case WLAN_EID_VHT_OPERATION: /* Get VHT Operation IE. */ break; #endif /* CONFIG_80211AC_VHT */ default: diff --git a/core/rtw_rm.c b/core/rtw_rm.c index 58797fe..31d9c3f 100644 --- a/core/rtw_rm.c +++ b/core/rtw_rm.c @@ -1103,11 +1103,11 @@ static u8 *rm_gen_bcn_detail_elem(_adapter *padapter, u8 *pframe, continue; #if (RM_MORE_DBG_MSG) switch (eid) { - case EID_QBSSLoad: - RTW_INFO("RM: EID_QBSSLoad\n"); + case WLAN_EID_QBSS_LOAD: + RTW_INFO("RM: WLAN_EID_QBSS_LOAD\n"); break; - case EID_HTCapability: - RTW_INFO("RM: EID_HTCapability\n"); + case WLAN_EID_HT_CAPABILITY: + RTW_INFO("RM: WLAN_EID_HT_CAPABILITY\n"); break; case _MDIE_: RTW_INFO("RM: EID_MobilityDomain\n"); @@ -1220,7 +1220,7 @@ static u8 *rm_bcn_rep_fill_scan_resule (struct rm_obj *prm, my_len = 0; /* meas ID */ - val8 = EID_MeasureReport; + val8 = WLAN_EID_MEASURE_REPORT; pframe = rtw_set_fixed_ie(pframe, 1, &val8, &my_len); /* remember position form elelment length */ diff --git a/core/rtw_tdls.c b/core/rtw_tdls.c index 84787ce..948a543 100644 --- a/core/rtw_tdls.c +++ b/core/rtw_tdls.c @@ -664,7 +664,7 @@ void rtw_tdls_process_vht_op_mode_notify(_adapter *padapter, struct sta_info *pt u8 *rtw_tdls_set_aid(_adapter *padapter, u8 *pframe, struct pkt_attrib *pattrib) { - return rtw_set_ie(pframe, EID_AID, 2, (u8 *)&(padapter->mlmepriv.cur_network.aid), &(pattrib->pktlen)); + return rtw_set_ie(pframe, WLAN_EID_AID, 2, (u8 *)&(padapter->mlmepriv.cur_network.aid), &(pattrib->pktlen)); } u8 *rtw_tdls_set_vht_cap(_adapter *padapter, u8 *pframe, struct pkt_attrib *pattrib) @@ -777,10 +777,10 @@ u8 *rtw_tdls_set_timeout_interval(struct tdls_txmgmt *ptxmgmt, u8 *pframe, struc int len = 0; if (ptxmgmt->len > 0) - p = rtw_get_ie(ptxmgmt->buf, WLAN_EID_TIMEOUT_INTERVAL, &len, ptxmgmt->len); + p = rtw_get_ie(ptxmgmt->buf, WLAN_WLAN_EID_TIMEOUT_INTERVAL_INTERVAL, &len, ptxmgmt->len); if (p != NULL) - return rtw_set_ie(pframe, WLAN_EID_TIMEOUT_INTERVAL, len, p + 2, &(pattrib->pktlen)); + return rtw_set_ie(pframe, WLAN_WLAN_EID_TIMEOUT_INTERVAL_INTERVAL, len, p + 2, &(pattrib->pktlen)); else { /* Timeout interval */ timeout_itvl[0] = 0x02; @@ -789,7 +789,7 @@ u8 *rtw_tdls_set_timeout_interval(struct tdls_txmgmt *ptxmgmt, u8 *pframe, struc else memcpy(timeout_itvl + 1, (u8 *)(&ptdls_sta->TDLS_PeerKey_Lifetime), 4); - return rtw_set_ie(pframe, WLAN_EID_TIMEOUT_INTERVAL, 5, timeout_itvl, &(pattrib->pktlen)); + return rtw_set_ie(pframe, WLAN_WLAN_EID_TIMEOUT_INTERVAL_INTERVAL, 5, timeout_itvl, &(pattrib->pktlen)); } } @@ -802,7 +802,7 @@ u8 *rtw_tdls_set_bss_coexist(_adapter *padapter, u8 *pframe, struct pkt_attrib * /* Information Bit should be set by TDLS test plan 5.9 */ iedata |= BIT(0); - return rtw_set_ie(pframe, EID_BSSCoexistence, 1, &iedata, &(pattrib->pktlen)); + return rtw_set_ie(pframe, WLAN_EID_BSS_COEX_2040, 1, &iedata, &(pattrib->pktlen)); } u8 *rtw_tdls_set_payload_type(u8 *pframe, struct pkt_attrib *pattrib) @@ -843,7 +843,7 @@ u8 *rtw_tdls_set_reg_class(u8 *pframe, struct pkt_attrib *pattrib, struct sta_in u8 *rtw_tdls_set_second_channel_offset(u8 *pframe, struct pkt_attrib *pattrib, u8 ch_offset) { - return rtw_set_ie(pframe, EID_SecondaryChnlOffset , 1, &ch_offset, &(pattrib->pktlen)); + return rtw_set_ie(pframe, WLAN_EID_SECONDARY_CHANNEL_OFFSET , 1, &ch_offset, &(pattrib->pktlen)); } u8 *rtw_tdls_set_capability(_adapter *padapter, u8 *pframe, struct pkt_attrib *pattrib) @@ -1949,7 +1949,7 @@ sint On_TDLS_Setup_Req(_adapter *padapter, union recv_frame *precv_frame, struct if (prx_pkt_attrib->encrypt) memcpy(SNonce, (ptr + j + 52), 32); break; - case WLAN_EID_TIMEOUT_INTERVAL: + case WLAN_WLAN_EID_TIMEOUT_INTERVAL_INTERVAL: if (prx_pkt_attrib->encrypt) timeout_interval = cpu_to_le32(*(u32 *)(ptr + j + 3)); break; @@ -1961,13 +1961,13 @@ sint On_TDLS_Setup_Req(_adapter *padapter, union recv_frame *precv_frame, struct break; #endif #ifdef CONFIG_80211AC_VHT - case EID_AID: + case WLAN_EID_AID: break; - case EID_VHTCapability: + case WLAN_EID_VHT_CAPABILITY: rtw_tdls_process_vht_cap(padapter, ptdls_sta, pIE->data, pIE->Length); break; #endif - case EID_BSSCoexistence: + case WLAN_EID_BSS_COEX_2040: break; case WLAN_EID_LINK_ID: if (_rtw_memcmp(get_bssid(pmlmepriv), pIE->data, 6) == _FALSE) @@ -2128,7 +2128,7 @@ int On_TDLS_Setup_Rsp(_adapter *padapter, union recv_frame *precv_frame, struct pftie = (u8 *)pIE; memcpy(ANonce, (ptr + j + 20), 32); break; - case WLAN_EID_TIMEOUT_INTERVAL: + case WLAN_WLAN_EID_TIMEOUT_INTERVAL_INTERVAL: ptimeout_ie = (u8 *)pIE; timeout_interval = cpu_to_le32(*(u32 *)(ptimeout_ie + 3)); break; @@ -2140,17 +2140,17 @@ int On_TDLS_Setup_Rsp(_adapter *padapter, union recv_frame *precv_frame, struct break; #endif #ifdef CONFIG_80211AC_VHT - case EID_AID: + case WLAN_EID_AID: /* todo in the future if necessary */ break; - case EID_VHTCapability: + case WLAN_EID_VHT_CAPABILITY: rtw_tdls_process_vht_cap(padapter, ptdls_sta, pIE->data, pIE->Length); break; - case EID_OpModeNotification: + case WLAN_EID_OPMODE_NOTIF: rtw_tdls_process_vht_op_mode_notify(padapter, ptdls_sta, pIE->data, pIE->Length); break; #endif - case EID_BSSCoexistence: + case WLAN_EID_BSS_COEX_2040: break; case WLAN_EID_LINK_ID: plinkid_ie = (u8 *)pIE; @@ -2274,7 +2274,7 @@ int On_TDLS_Setup_Cfm(_adapter *padapter, union recv_frame *precv_frame, struct case WLAN_EID_FAST_BSS_TRANSITION: pftie = (u8 *)pIE; break; - case WLAN_EID_TIMEOUT_INTERVAL: + case WLAN_WLAN_EID_TIMEOUT_INTERVAL_INTERVAL: ptimeout_ie = (u8 *)pIE; break; #ifdef CONFIG_80211N_HT @@ -2282,10 +2282,10 @@ int On_TDLS_Setup_Cfm(_adapter *padapter, union recv_frame *precv_frame, struct break; #endif #ifdef CONFIG_80211AC_VHT - case EID_VHTOperation: + case WLAN_EID_VHT_OPERATION: rtw_tdls_process_vht_operation(padapter, ptdls_sta, pIE->data, pIE->Length); break; - case EID_OpModeNotification: + case WLAN_EID_OPMODE_NOTIF: rtw_tdls_process_vht_op_mode_notify(padapter, ptdls_sta, pIE->data, pIE->Length); break; #endif @@ -2559,7 +2559,7 @@ sint On_TDLS_Ch_Switch_Req(_adapter *padapter, union recv_frame *precv_frame, st pIE = (PNDIS_802_11_VARIABLE_IEs)(ptr + j); switch (pIE->ElementID) { - case EID_SecondaryChnlOffset: + case WLAN_EID_SECONDARY_CHANNEL_OFFSET: switch (*(pIE->data)) { case EXTCHNL_OFFSET_UPPER: pchsw_info->ch_offset = HAL_PRIME_CHNL_OFFSET_LOWER; diff --git a/core/rtw_vht.c b/core/rtw_vht.c index 14ad568..15a9230 100644 --- a/core/rtw_vht.c +++ b/core/rtw_vht.c @@ -763,7 +763,7 @@ u32 rtw_build_vht_operation_ie(_adapter *padapter, u8 *pbuf, u8 channel) memcpy(operation + 3, pvhtpriv->vht_mcs_map, 2); - rtw_set_ie(pbuf, EID_VHTOperation, 5, operation, &len); + rtw_set_ie(pbuf, WLAN_EID_VHT_OPERATION, 5, operation, &len); return len; } @@ -786,7 +786,7 @@ u32 rtw_build_vht_op_mode_notify_ie(_adapter *padapter, u8 *pbuf, u8 bw) pvhtpriv->vht_op_mode_notify = opmode; - pbuf = rtw_set_ie(pbuf, EID_OpModeNotification, 1, &opmode, &len); + pbuf = rtw_set_ie(pbuf, WLAN_EID_OPMODE_NOTIF, 1, &opmode, &len); return len; } @@ -926,7 +926,7 @@ u32 rtw_build_vht_cap_ie(_adapter *padapter, u8 *pbuf) SET_VHT_CAPABILITY_ELE_MCS_RX_HIGHEST_RATE(pcap, HighestRate); /* indicate we support highest rx rate is 600Mbps. */ SET_VHT_CAPABILITY_ELE_MCS_TX_HIGHEST_RATE(pcap, HighestRate); /* indicate we support highest tx rate is 600Mbps. */ - pbuf = rtw_set_ie(pbuf, EID_VHTCapability, 12, pcap, &len); + pbuf = rtw_set_ie(pbuf, WLAN_EID_VHT_CAPABILITY, 12, pcap, &len); return len; } @@ -948,10 +948,10 @@ u32 rtw_restructure_vht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, uint in_le ht_op_ie = rtw_get_ie(in_ie + 12, WLAN_EID_HT_OPERATION, &ielen, in_len - 12); if (!ht_op_ie || ielen != HT_OP_IE_LEN) goto exit; - vht_cap_ie = rtw_get_ie(in_ie + 12, EID_VHTCapability, &ielen, in_len - 12); + vht_cap_ie = rtw_get_ie(in_ie + 12, WLAN_EID_VHT_CAPABILITY, &ielen, in_len - 12); if (!vht_cap_ie || ielen != VHT_CAP_IE_LEN) goto exit; - vht_op_ie = rtw_get_ie(in_ie + 12, EID_VHTOperation, &ielen, in_len - 12); + vht_op_ie = rtw_get_ie(in_ie + 12, WLAN_EID_VHT_OPERATION, &ielen, in_len - 12); if (!vht_op_ie || ielen != VHT_OP_IE_LEN) goto exit; @@ -961,7 +961,7 @@ u32 rtw_restructure_vht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, uint in_le /* VHT Operation element */ out_vht_op_ie = out_ie + *pout_len; - rtw_set_ie(out_vht_op_ie, EID_VHTOperation, VHT_OP_IE_LEN, vht_op_ie + 2 , pout_len); + rtw_set_ie(out_vht_op_ie, WLAN_EID_VHT_OPERATION, VHT_OP_IE_LEN, vht_op_ie + 2 , pout_len); /* get primary channel from HT_OP_IE */ oper_ch = GET_HT_OP_ELE_PRI_CHL(ht_op_ie + 2); @@ -1072,7 +1072,7 @@ void rtw_vht_ies_attach(_adapter *padapter, WLAN_BSSID_EX *pnetwork) sint ie_len = 0; u8 *p = NULL; - p = rtw_get_ie(pnetwork->IEs + _BEACON_IE_OFFSET_, EID_VHTCapability, &ie_len, + p = rtw_get_ie(pnetwork->IEs + _BEACON_IE_OFFSET_, WLAN_EID_VHT_CAPABILITY, &ie_len, (pnetwork->IELength - _BEACON_IE_OFFSET_)); if (p && ie_len > 0) return; @@ -1082,7 +1082,7 @@ void rtw_vht_ies_attach(_adapter *padapter, WLAN_BSSID_EX *pnetwork) /* VHT Operation mode notifiy bit in Extended IE (127) */ SET_EXT_CAPABILITY_ELE_OP_MODE_NOTIF(pmlmepriv->ext_capab_ie_data, 1); pmlmepriv->ext_capab_ie_len = 10; - rtw_set_ie(pnetwork->IEs + pnetwork->IELength, EID_EXTCapability, 8, pmlmepriv->ext_capab_ie_data, &len); + rtw_set_ie(pnetwork->IEs + pnetwork->IELength, WLAN_EID_EXT_CAPABILITY, 8, pmlmepriv->ext_capab_ie_data, &len); pnetwork->IELength += pmlmepriv->ext_capab_ie_len; /* VHT Capabilities element */ @@ -1103,9 +1103,9 @@ void rtw_vht_ies_detach(_adapter *padapter, WLAN_BSSID_EX *pnetwork) { struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); - rtw_remove_bcn_ie(padapter, pnetwork, EID_EXTCapability); - rtw_remove_bcn_ie(padapter, pnetwork, EID_VHTCapability); - rtw_remove_bcn_ie(padapter, pnetwork, EID_VHTOperation); + rtw_remove_bcn_ie(padapter, pnetwork, WLAN_EID_EXT_CAPABILITY); + rtw_remove_bcn_ie(padapter, pnetwork, WLAN_EID_VHT_CAPABILITY); + rtw_remove_bcn_ie(padapter, pnetwork, WLAN_EID_VHT_OPERATION); pmlmepriv->vhtpriv.vht_option = _FALSE; } @@ -1123,7 +1123,7 @@ void rtw_check_for_vht20(_adapter *adapter, u8 *ies, int ies_len) int vht_op_ielen; RTW_INFO(FUNC_ADPT_FMT" vht80 is not allowed without ht40\n", FUNC_ADPT_ARG(adapter)); - vht_op_ie = rtw_get_ie(ies, EID_VHTOperation, &vht_op_ielen, ies_len); + vht_op_ie = rtw_get_ie(ies, WLAN_EID_VHT_OPERATION, &vht_op_ielen, ies_len); if (vht_op_ie && vht_op_ielen) { RTW_INFO(FUNC_ADPT_FMT" switch to vht20\n", FUNC_ADPT_ARG(adapter)); SET_VHT_OPERATION_ELE_CHL_WIDTH(vht_op_ie + 2, 0); diff --git a/core/rtw_wlan_util.c b/core/rtw_wlan_util.c index d5c98c8..a6cfa90 100644 --- a/core/rtw_wlan_util.c +++ b/core/rtw_wlan_util.c @@ -2691,7 +2691,7 @@ void update_beacon_info(_adapter *padapter, u8 *pframe, uint pkt_len, struct sta bwmode_update_check(padapter, pIE); break; #ifdef CONFIG_80211AC_VHT - case EID_OpModeNotification: + case WLAN_EID_OPMODE_NOTIF: rtw_process_vht_op_mode_notify(padapter, pIE->data, psta); break; #endif /* CONFIG_80211AC_VHT */ @@ -3254,7 +3254,7 @@ unsigned char get_vht_mu_bfer_cap(u8 *pframe, uint len) switch (pIE->ElementID) { - case EID_VHTCapability: + case WLAN_EID_VHT_CAPABILITY: mu_bfer = GET_VHT_CAPABILITY_ELE_MU_BFER(pIE->data); break; default: diff --git a/include/wifi.h b/include/wifi.h index bc85d3c..e8cf7f7 100644 --- a/include/wifi.h +++ b/include/wifi.h @@ -318,83 +318,6 @@ static inline int IsFrameTypeData(unsigned char *pframe) #define _FIXED_IE_LENGTH_ _BEACON_IE_OFFSET_ -typedef enum _ELEMENT_ID { - EID_SsId = 0, /* service set identifier (0:32) */ - EID_SupRates = 1, /* supported rates (1:8) */ - EID_FHParms = 2, /* FH parameter set (5) */ - EID_DSParms = 3, /* DS parameter set (1) */ - EID_CFParms = 4, /* CF parameter set (6) */ - EID_Tim = 5, /* Traffic Information Map (4:254) */ - EID_IbssParms = 6, /* IBSS parameter set (2) */ - EID_Country = 7, /* */ - - /* Form 7.3.2: Information elements in 802.11E/D13.0, page 46. */ - EID_QBSSLoad = 11, - EID_EDCAParms = 12, - EID_TSpec = 13, - EID_TClass = 14, - EID_Schedule = 15, - /* */ - - EID_Ctext = 16, /* challenge text*/ - EID_POWER_CONSTRAINT = 32, /* Power Constraint*/ - - /* vivi for WIFITest, 802.11h AP, 20100427 */ - /* 2010/12/26 MH The definition we can declare always!! */ - EID_PowerCap = 33, - EID_SupportedChannels = 36, - EID_ChlSwitchAnnounce = 37, - - EID_MeasureRequest = 38, /* Measurement Request */ - EID_MeasureReport = 39, /* Measurement Report */ - - EID_ERPInfo = 42, - - /* Form 7.3.2: Information elements in 802.11E/D13.0, page 46. */ - EID_TSDelay = 43, - EID_TCLASProc = 44, - EID_HTCapability = 45, - EID_QoSCap = 46, - /* */ - - EID_WPA2 = 48, - EID_ExtSupRates = 50, - - EID_FTIE = 55, /* Defined in 802.11r */ - EID_Timeout = 56, /* Defined in 802.11r */ - - EID_SupRegulatory = 59, /* Supported Requlatory Classes 802.11y */ - EID_HTInfo = 61, - EID_SecondaryChnlOffset = 62, - - EID_BSSCoexistence = 72, /* 20/40 BSS Coexistence */ - EID_BSSIntolerantChlReport = 73, - EID_OBSS = 74, /* Overlapping BSS Scan Parameters */ - - EID_LinkIdentifier = 101, /* Defined in 802.11z */ - EID_WakeupSchedule = 102, /* Defined in 802.11z */ - EID_ChnlSwitchTimeing = 104, /* Defined in 802.11z */ - EID_PTIControl = 105, /* Defined in 802.11z */ - EID_PUBufferStatus = 106, /* Defined in 802.11z */ - - EID_EXTCapability = 127, /* Extended Capabilities */ - /* From S19:Aironet IE and S21:AP IP address IE in CCX v1.13, p16 and p18. */ - EID_Aironet = 133, /* 0x85: Aironet Element for Cisco CCX */ - EID_CiscoIP = 149, /* 0x95: IP Address IE for Cisco CCX */ - - EID_CellPwr = 150, /* 0x96: Cell Power Limit IE. Ref. 0x96. */ - - EID_CCKM = 156, - - EID_Vendor = 221, /* 0xDD: Vendor Specific */ - - EID_WAPI = 68, - EID_VHTCapability = 191, /* Based on 802.11ac D2.0 */ - EID_VHTOperation = 192, /* Based on 802.11ac D2.0 */ - EID_AID = 197, /* Based on 802.11ac D4.0 */ - EID_OpModeNotification = 199, /* Based on 802.11ac D3.0 */ -} ELEMENT_ID, *PELEMENT_ID; - /* --------------------------------------------------------------------------- Below is the fixed elements... -----------------------------------------------------------------------------*/ diff --git a/os_dep/linux/ioctl_linux.c b/os_dep/linux/ioctl_linux.c index 5269179..7991d4c 100644 --- a/os_dep/linux/ioctl_linux.c +++ b/os_dep/linux/ioctl_linux.c @@ -367,7 +367,7 @@ static inline char *iwe_stream_protocol_process(_adapter *padapter, #ifdef CONFIG_80211AC_VHT /* parsing VHT_CAP_IE */ if(padapter->registrypriv.wireless_mode & WIRELESS_11AC) { - p = rtw_get_ie(&pnetwork->network.IEs[ie_offset], EID_VHTCapability, &vht_ielen, pnetwork->network.IELength - ie_offset); + p = rtw_get_ie(&pnetwork->network.IEs[ie_offset], WLAN_EID_VHT_CAPABILITY, &vht_ielen, pnetwork->network.IELength - ie_offset); if (p && vht_ielen > 0) vht_cap = _TRUE; } @@ -436,7 +436,7 @@ static inline char *iwe_stream_rate_process(_adapter *padapter, #ifdef CONFIG_80211AC_VHT /* parsing VHT_CAP_IE */ if(padapter->registrypriv.wireless_mode & WIRELESS_11AC){ - p = rtw_get_ie(&pnetwork->network.IEs[ie_offset], EID_VHTCapability, &vht_ielen, pnetwork->network.IELength - ie_offset); + p = rtw_get_ie(&pnetwork->network.IEs[ie_offset], WLAN_EID_VHT_CAPABILITY, &vht_ielen, pnetwork->network.IELength - ie_offset); if (p && vht_ielen > 0) { u8 mcs_map[2]; From 04b4fa6f82d36aed5c81fc6f3445093ef1542aac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Garc=C3=A9s?= Date: Fri, 22 Oct 2021 22:16:38 +0200 Subject: [PATCH 17/20] use the proper WLAN_OUI_TYPE_MICROSOFT_* definitions. port 42282f4147e2bc5b89d6a050244a7c5475613d83 --- core/rtw_ieee80211.c | 6 +++--- include/ieee80211.h | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/core/rtw_ieee80211.c b/core/rtw_ieee80211.c index d860b0a..92f029a 100644 --- a/core/rtw_ieee80211.c +++ b/core/rtw_ieee80211.c @@ -1214,13 +1214,13 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen, /* Microsoft/Wi-Fi information elements are further typed and * subtyped */ switch (pos[3]) { - case 1: + case WLAN_OUI_TYPE_MICROSOFT_WPA: /* Microsoft OUI (00:50:F2) with OUI Type 1: * real WPA information element */ elems->wpa_ie = pos; elems->wpa_ie_len = elen; break; - case WME_OUI_TYPE: /* this is a Wi-Fi WME info. element */ + case WLAN_OUI_TYPE_MICROSOFT_WMM: /* this is a Wi-Fi WME info. element */ if (elen < 5) { RTW_DBG("short WME " "information element ignored " @@ -1246,7 +1246,7 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen, return -1; } break; - case 4: + case WLAN_OUI_TYPE_MICROSOFT_WPS: /* Wi-Fi Protected Setup (WPS) IE */ elems->wps_ie = pos; elems->wps_ie_len = elen; diff --git a/include/ieee80211.h b/include/ieee80211.h index 5ac9229..dacb471 100644 --- a/include/ieee80211.h +++ b/include/ieee80211.h @@ -898,8 +898,6 @@ enum rtw_ieee80211_wnm_actioncode { }; #endif -#define WME_OUI_TYPE 2 - #define WME_OUI_SUBTYPE_INFORMATION_ELEMENT 0 #define WME_OUI_SUBTYPE_PARAMETER_ELEMENT 1 #define WME_OUI_SUBTYPE_TSPEC_ELEMENT 2 From 879f617f820240aeaf7c3b9e8d57c2fffe02b9bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Garc=C3=A9s?= Date: Fri, 22 Oct 2021 22:26:10 +0200 Subject: [PATCH 18/20] Remove extern as it is defined but never used RTW_WPA_VERSION is removed as is declared and defined but never used in the code. Port 2c4b2980ae16a2d8d35f126ddb9fbcba809e2612 --- core/rtw_ieee80211.c | 1 - include/ieee80211.h | 1 - 2 files changed, 2 deletions(-) diff --git a/core/rtw_ieee80211.c b/core/rtw_ieee80211.c index 92f029a..12e230e 100644 --- a/core/rtw_ieee80211.c +++ b/core/rtw_ieee80211.c @@ -21,7 +21,6 @@ u8 RTW_WPA_OUI_TYPE[] = { 0x00, 0x50, 0xf2, 1 }; -u16 RTW_WPA_VERSION = 1; u8 WPA_AUTH_KEY_MGMT_NONE[] = { 0x00, 0x50, 0xf2, 0 }; u8 WPA_AUTH_KEY_MGMT_UNSPEC_802_1X[] = { 0x00, 0x50, 0xf2, 1 }; u8 WPA_AUTH_KEY_MGMT_PSK_OVER_802_1X[] = { 0x00, 0x50, 0xf2, 2 }; diff --git a/include/ieee80211.h b/include/ieee80211.h index dacb471..ed317f4 100644 --- a/include/ieee80211.h +++ b/include/ieee80211.h @@ -110,7 +110,6 @@ enum { #define WPA_SELECTOR_LEN 4 extern u8 RTW_WPA_OUI_TYPE[] ; -extern u16 RTW_WPA_VERSION ; extern u8 WPA_AUTH_KEY_MGMT_NONE[]; extern u8 WPA_AUTH_KEY_MGMT_UNSPEC_802_1X[]; extern u8 WPA_AUTH_KEY_MGMT_PSK_OVER_802_1X[]; From 99c0f78547eb5679046fcb93415e21bb5c8bed84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Garc=C3=A9s?= Date: Fri, 22 Oct 2021 23:03:43 +0200 Subject: [PATCH 19/20] replace while with shorter for loop Simplify rtw_get_rateset_len() by replacing the while loop with a shorter for loop. Also replace tabs with spaces in the definition line. --- core/rtw_ieee80211.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/core/rtw_ieee80211.c b/core/rtw_ieee80211.c index 12e230e..2134a34 100644 --- a/core/rtw_ieee80211.c +++ b/core/rtw_ieee80211.c @@ -482,18 +482,13 @@ void rtw_set_supported_rate(u8 *SupportedRates, uint mode) } } -uint rtw_get_rateset_len(u8 *rateset) +uint rtw_get_rateset_len(u8 *rateset) { - uint i = 0; - while (1) { - if ((rateset[i]) == 0) - break; + uint i; - if (i > 12) + for (i = 0; i < 13; i++) + if (rateset[i] == 0) break; - - i++; - } return i; } From 97bac22d5bb8e901ec290152c97a75e20acb69c9 Mon Sep 17 00:00:00 2001 From: Carlos Garces Date: Sat, 23 Oct 2021 11:09:24 +0200 Subject: [PATCH 20/20] Remove duplicate names for rtw_read[n] and rtw_write[n] rtw_read[n]() is redefined as _rtw_read[n]() and PlatformEFIORead[n]Byte Same for rtw_write[n]() furntions Link: https://lore.kernel.org/r/9880c86c2aad7d95a714d8b03b28b83634f98c1e.1621361919.git-series.hello@bryanbrattlof.com Link: https://lore.kernel.org/r/11458342572f21d9df58b3969ad1f16fdff157f4.1621361919.git-series.hello@bryanbrattlof.com Link: https://lore.kernel.org/r/15956707341f76de683245c392063b8121a805ea.1621361919.git-series.hello@bryanbrattlof.com Link: https://lore.kernel.org/r/35ffc9cd5af7009b317361033a6ca5263307d61a.1621361919.git-series.hello@bryanbrattlof.com Link: https://lore.kernel.org/r/7d53fb295f67f01c72640045afb88150391bce35.1621361919.git-series.hello@bryanbrattlof.com Link: https://lore.kernel.org/r/43917aee34e85139e613578cf6f14938211c8835.1621361919.git-series.hello@bryanbrattlof.com Port of 51d4aa6d6bf35d85d318831df60a34bad27cdb9e 8ff74e4307b42302c89023faf8fd37dbde4c4666 16b1b3c8221a40bf899dfeebdb3d5245ecb65515 7f06caf9a40bb3c08fe86c8355ace25b7ce69ba9 1c42d72e4747fb546eba53821ae56ecf827202a7 4d6bfc6f62705ec5baee9c572d4ca03bc9e36c00 --- core/efuse/rtw_efuse.c | 14 ++--- core/rtw_io.c | 98 +++----------------------------- core/rtw_mp.c | 6 +- hal/HalPwrSeqCmd.c | 8 +-- hal/hal_mp.c | 2 +- hal/phydm/phydm_interface.c | 12 ++-- hal/rtl8192e/rtl8192e_hal_init.c | 12 ++-- hal/rtl8192e/usb/usb_halinit.c | 68 +++++++++++----------- include/rtw_io.h | 70 +++-------------------- os_dep/linux/ioctl_mp.c | 8 +-- 10 files changed, 79 insertions(+), 219 deletions(-) diff --git a/core/efuse/rtw_efuse.c b/core/efuse/rtw_efuse.c index 1c3eb8d..b7c02d4 100644 --- a/core/efuse/rtw_efuse.c +++ b/core/efuse/rtw_efuse.c @@ -805,13 +805,13 @@ VOID efuse_PreUpdateAction( #ifdef CONFIG_RTL8812A BackupRegs[3] = phy_query_mac_reg(pAdapter, REG_AFE_MISC, bMaskDWord); #endif - PlatformEFIOWrite4Byte(pAdapter, REG_RCR, 0x1); - PlatformEFIOWrite1Byte(pAdapter, REG_RXFLTMAP0, 0); - PlatformEFIOWrite1Byte(pAdapter, REG_RXFLTMAP0+1, 0); - PlatformEFIOWrite1Byte(pAdapter, REG_RXFLTMAP0+2, 0); - PlatformEFIOWrite1Byte(pAdapter, REG_RXFLTMAP0+3, 0); - PlatformEFIOWrite1Byte(pAdapter, REG_RXFLTMAP0+4, 0); - PlatformEFIOWrite1Byte(pAdapter, REG_RXFLTMAP0+5, 0); + rtw_write32(pAdapter, REG_RCR, 0x1); + rtw_write8(pAdapter, REG_RXFLTMAP0, 0); + rtw_write8(pAdapter, REG_RXFLTMAP0+1, 0); + rtw_write8(pAdapter, REG_RXFLTMAP0+2, 0); + rtw_write8(pAdapter, REG_RXFLTMAP0+3, 0); + rtw_write8(pAdapter, REG_RXFLTMAP0+4, 0); + rtw_write8(pAdapter, REG_RXFLTMAP0+5, 0); #ifdef CONFIG_RTL8812A /* <20140410, Kordan> 0x11 = 0x4E, lower down LX_SPS0 voltage. (Asked by Chunchu)*/ phy_set_mac_reg(pAdapter, REG_AFE_MISC, bMaskByte1, 0x4E); diff --git a/core/rtw_io.c b/core/rtw_io.c index 55ed7b1..3afbe5b 100644 --- a/core/rtw_io.c +++ b/core/rtw_io.c @@ -60,7 +60,7 @@ jackson@realtek.com.tw #endif -u8 _rtw_read8(_adapter *adapter, u32 addr) +u8 rtw_read8(_adapter *adapter, u32 addr) { u8 r_val; /* struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; */ @@ -73,7 +73,7 @@ u8 _rtw_read8(_adapter *adapter, u32 addr) return r_val; } -u16 _rtw_read16(_adapter *adapter, u32 addr) +u16 rtw_read16(_adapter *adapter, u32 addr) { u16 r_val; /* struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; */ @@ -86,7 +86,7 @@ u16 _rtw_read16(_adapter *adapter, u32 addr) return rtw_le16_to_cpu(r_val); } -u32 _rtw_read32(_adapter *adapter, u32 addr) +u32 rtw_read32(_adapter *adapter, u32 addr) { u32 r_val; /* struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; */ @@ -100,7 +100,7 @@ u32 _rtw_read32(_adapter *adapter, u32 addr) } -int _rtw_write8(_adapter *adapter, u32 addr, u8 val) +int rtw_write8(_adapter *adapter, u32 addr, u8 val) { /* struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; */ struct io_priv *pio_priv = &adapter->iopriv; @@ -113,7 +113,7 @@ int _rtw_write8(_adapter *adapter, u32 addr, u8 val) return RTW_STATUS_CODE(ret); } -int _rtw_write16(_adapter *adapter, u32 addr, u16 val) +int rtw_write16(_adapter *adapter, u32 addr, u16 val) { /* struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; */ struct io_priv *pio_priv = &adapter->iopriv; @@ -127,7 +127,7 @@ int _rtw_write16(_adapter *adapter, u32 addr, u16 val) return RTW_STATUS_CODE(ret); } -int _rtw_write32(_adapter *adapter, u32 addr, u32 val) +int rtw_write32(_adapter *adapter, u32 addr, u32 val) { /* struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; */ struct io_priv *pio_priv = &adapter->iopriv; @@ -142,7 +142,7 @@ int _rtw_write32(_adapter *adapter, u32 addr, u32 val) return RTW_STATUS_CODE(ret); } -int _rtw_writeN(_adapter *adapter, u32 addr , u32 length , u8 *pdata) +int rtw_writeN(_adapter *adapter, u32 addr , u32 length , u8 *pdata) { /* struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; */ struct io_priv *pio_priv = &adapter->iopriv; @@ -717,90 +717,6 @@ bool match_rf_write_sniff_ranges(_adapter *adapter, u8 path, u32 addr, u32 mask) return _FALSE; } -u8 dbg_rtw_read8(_adapter *adapter, u32 addr, const char *caller, const int line) -{ - u8 val = _rtw_read8(adapter, addr); - const struct rtw_io_sniff_ent *ent = match_read_sniff(adapter, addr, 1, val); - - if (ent) { - RTW_INFO("DBG_IO %s:%d rtw_read8(0x%04x) return 0x%02x %s\n" - , caller, line, addr, val, rtw_io_sniff_ent_get_tag(ent)); - } - - return val; -} - -u16 dbg_rtw_read16(_adapter *adapter, u32 addr, const char *caller, const int line) -{ - u16 val = _rtw_read16(adapter, addr); - const struct rtw_io_sniff_ent *ent = match_read_sniff(adapter, addr, 2, val); - - if (ent) { - RTW_INFO("DBG_IO %s:%d rtw_read16(0x%04x) return 0x%04x %s\n" - , caller, line, addr, val, rtw_io_sniff_ent_get_tag(ent)); - } - - return val; -} - -u32 dbg_rtw_read32(_adapter *adapter, u32 addr, const char *caller, const int line) -{ - u32 val = _rtw_read32(adapter, addr); - const struct rtw_io_sniff_ent *ent = match_read_sniff(adapter, addr, 4, val); - - if (ent) { - RTW_INFO("DBG_IO %s:%d rtw_read32(0x%04x) return 0x%08x %s\n" - , caller, line, addr, val, rtw_io_sniff_ent_get_tag(ent)); - } - - return val; -} - -int dbg_rtw_write8(_adapter *adapter, u32 addr, u8 val, const char *caller, const int line) -{ - const struct rtw_io_sniff_ent *ent = match_write_sniff(adapter, addr, 1, val); - - if (ent) { - RTW_INFO("DBG_IO %s:%d rtw_write8(0x%04x, 0x%02x) %s\n" - , caller, line, addr, val, rtw_io_sniff_ent_get_tag(ent)); - } - - return _rtw_write8(adapter, addr, val); -} -int dbg_rtw_write16(_adapter *adapter, u32 addr, u16 val, const char *caller, const int line) -{ - const struct rtw_io_sniff_ent *ent = match_write_sniff(adapter, addr, 2, val); - - if (ent) { - RTW_INFO("DBG_IO %s:%d rtw_write16(0x%04x, 0x%04x) %s\n" - , caller, line, addr, val, rtw_io_sniff_ent_get_tag(ent)); - } - - return _rtw_write16(adapter, addr, val); -} -int dbg_rtw_write32(_adapter *adapter, u32 addr, u32 val, const char *caller, const int line) -{ - const struct rtw_io_sniff_ent *ent = match_write_sniff(adapter, addr, 4, val); - - if (ent) { - RTW_INFO("DBG_IO %s:%d rtw_write32(0x%04x, 0x%08x) %s\n" - , caller, line, addr, val, rtw_io_sniff_ent_get_tag(ent)); - } - - return _rtw_write32(adapter, addr, val); -} -int dbg_rtw_writeN(_adapter *adapter, u32 addr , u32 length , u8 *data, const char *caller, const int line) -{ - const struct rtw_io_sniff_ent *ent = match_write_sniff(adapter, addr, length, 0); - - if (ent) { - RTW_INFO("DBG_IO %s:%d rtw_writeN(0x%04x, %u) %s\n" - , caller, line, addr, length, rtw_io_sniff_ent_get_tag(ent)); - } - - return _rtw_writeN(adapter, addr, length, data); -} - #ifdef CONFIG_SDIO_HCI u8 dbg_rtw_sd_f0_read8(_adapter *adapter, u32 addr, const char *caller, const int line) { diff --git a/core/rtw_mp.c b/core/rtw_mp.c index 81c8a85..951b76e 100644 --- a/core/rtw_mp.c +++ b/core/rtw_mp.c @@ -331,7 +331,7 @@ void mpt_InitHWConfig(PADAPTER Adapter) phy_set_mac_reg(Adapter, 0x4C , BIT23, 0); /*select DPDT_P and DPDT_N as output pin*/ #ifdef CONFIG_RTL8814A else if (IS_HARDWARE_TYPE_8814A(Adapter)) - PlatformEFIOWrite2Byte(Adapter, REG_RXFLTMAP1_8814A, 0x2000); + rtw_write16(Adapter, REG_RXFLTMAP1_8814A, 0x2000); #endif #ifdef CONFIG_RTL8812A @@ -346,7 +346,7 @@ void mpt_InitHWConfig(PADAPTER Adapter) else if (IS_HARDWARE_TYPE_8822B(Adapter)) { u32 tmp_reg = 0; - PlatformEFIOWrite2Byte(Adapter, REG_RXFLTMAP1_8822B, 0x2000); + rtw_write16(Adapter, REG_RXFLTMAP1_8822B, 0x2000); /* fixed wifi can't 2.4g tx suggest by Szuyitasi 20160504 */ phy_set_bb_reg(Adapter, 0x70, bMaskByte3, 0x0e); RTW_INFO(" 0x73 = 0x%x\n", phy_query_bb_reg(Adapter, 0x70, bMaskByte3)); @@ -358,7 +358,7 @@ void mpt_InitHWConfig(PADAPTER Adapter) #endif /* CONFIG_RTL8822B */ #ifdef CONFIG_RTL8821C else if (IS_HARDWARE_TYPE_8821C(Adapter)) - PlatformEFIOWrite2Byte(Adapter, REG_RXFLTMAP1_8821C, 0x2000); + rtw_write16(Adapter, REG_RXFLTMAP1_8821C, 0x2000); #endif /* CONFIG_RTL8821C */ #if defined(CONFIG_RTL8188F) || defined(CONFIG_RTL8188GTV) else if (IS_HARDWARE_TYPE_8188F(Adapter) || IS_HARDWARE_TYPE_8188GTV(Adapter)) { diff --git a/hal/HalPwrSeqCmd.c b/hal/HalPwrSeqCmd.c index fbac1fe..7831615 100644 --- a/hal/HalPwrSeqCmd.c +++ b/hal/HalPwrSeqCmd.c @@ -142,13 +142,13 @@ u8 HalPwrSeqCmdParsing( RTW_ERR("[WARNING] PCIE polling(0x%X) timeout(%d), Toggle 0x04[3] and try again.\n", offset, maxPollingCnt); if (IS_HARDWARE_TYPE_8723DE(padapter)) - PlatformEFIOWrite1Byte(padapter, 0x40, (PlatformEFIORead1Byte(padapter, 0x40)) & (~BIT3)); + rtw_write8(padapter, 0x40, (rtw_read8(padapter, 0x40)) & (~BIT3)); - PlatformEFIOWrite1Byte(padapter, 0x04, PlatformEFIORead1Byte(padapter, 0x04) | BIT3); - PlatformEFIOWrite1Byte(padapter, 0x04, PlatformEFIORead1Byte(padapter, 0x04) & ~BIT3); + rtw_write8(padapter, 0x04, rtw_read8(padapter, 0x04) | BIT3); + rtw_write8(padapter, 0x04, rtw_read8(padapter, 0x04) & ~BIT3); if (IS_HARDWARE_TYPE_8723DE(padapter)) - PlatformEFIOWrite1Byte(padapter, 0x40, PlatformEFIORead1Byte(padapter, 0x40)|BIT3); + rtw_write8(padapter, 0x40, rtw_read8(padapter, 0x40)|BIT3); /* Retry Polling Process one more time */ pollingCount = 0; diff --git a/hal/hal_mp.c b/hal/hal_mp.c index faab54f..412b7ce 100644 --- a/hal/hal_mp.c +++ b/hal/hal_mp.c @@ -90,7 +90,7 @@ void hal_mpt_SwitchRfSetting(PADAPTER pAdapter) pMptCtx->backup0x52_RF_A = (u1Byte)phy_query_rf_reg(pAdapter, RF_PATH_A, RF_0x52, 0x000F0); pMptCtx->backup0x52_RF_B = (u1Byte)phy_query_rf_reg(pAdapter, RF_PATH_B, RF_0x52, 0x000F0); - if ((PlatformEFIORead4Byte(pAdapter, 0xF4) & BIT29) == BIT29) { + if ((rtw_read32(pAdapter, 0xF4) & BIT29) == BIT29) { phy_set_rf_reg(pAdapter, RF_PATH_A, RF_0x52, 0x000F0, 0xB); phy_set_rf_reg(pAdapter, RF_PATH_B, RF_0x52, 0x000F0, 0xB); } else { diff --git a/hal/phydm/phydm_interface.c b/hal/phydm/phydm_interface.c index 1c96c90..e9d305c 100644 --- a/hal/phydm/phydm_interface.c +++ b/hal/phydm/phydm_interface.c @@ -52,7 +52,7 @@ u8 odm_read_1byte(struct dm_struct *dm, u32 reg_addr) return rtw_read8(adapter, reg_addr); #elif (DM_ODM_SUPPORT_TYPE & ODM_WIN) void *adapter = dm->adapter; - return PlatformEFIORead1Byte(adapter, reg_addr); + return rtw_read8(adapter, reg_addr); #elif (DM_ODM_SUPPORT_TYPE & ODM_IOT) void *adapter = dm->adapter; @@ -78,7 +78,7 @@ u16 odm_read_2byte(struct dm_struct *dm, u32 reg_addr) return rtw_read16(adapter, reg_addr); #elif (DM_ODM_SUPPORT_TYPE & ODM_WIN) void *adapter = dm->adapter; - return PlatformEFIORead2Byte(adapter, reg_addr); + return rtw_read16(adapter, reg_addr); #elif (DM_ODM_SUPPORT_TYPE & ODM_IOT) void *adapter = dm->adapter; @@ -104,7 +104,7 @@ u32 odm_read_4byte(struct dm_struct *dm, u32 reg_addr) return rtw_read32(adapter, reg_addr); #elif (DM_ODM_SUPPORT_TYPE & ODM_WIN) void *adapter = dm->adapter; - return PlatformEFIORead4Byte(adapter, reg_addr); + return rtw_read32(adapter, reg_addr); #elif (DM_ODM_SUPPORT_TYPE & ODM_IOT) void *adapter = dm->adapter; @@ -130,7 +130,7 @@ void odm_write_1byte(struct dm_struct *dm, u32 reg_addr, u8 data) rtw_write8(adapter, reg_addr, data); #elif (DM_ODM_SUPPORT_TYPE & ODM_WIN) void *adapter = dm->adapter; - PlatformEFIOWrite1Byte(adapter, reg_addr, data); + rtw_write8(adapter, reg_addr, data); #elif (DM_ODM_SUPPORT_TYPE & ODM_IOT) void *adapter = dm->adapter; @@ -156,7 +156,7 @@ void odm_write_2byte(struct dm_struct *dm, u32 reg_addr, u16 data) rtw_write16(adapter, reg_addr, data); #elif (DM_ODM_SUPPORT_TYPE & ODM_WIN) void *adapter = dm->adapter; - PlatformEFIOWrite2Byte(adapter, reg_addr, data); + rtw_write16(adapter, reg_addr, data); #elif (DM_ODM_SUPPORT_TYPE & ODM_IOT) void *adapter = dm->adapter; @@ -182,7 +182,7 @@ void odm_write_4byte(struct dm_struct *dm, u32 reg_addr, u32 data) rtw_write32(adapter, reg_addr, data); #elif (DM_ODM_SUPPORT_TYPE & ODM_WIN) void *adapter = dm->adapter; - PlatformEFIOWrite4Byte(adapter, reg_addr, data); + rtw_write32(adapter, reg_addr, data); #elif (DM_ODM_SUPPORT_TYPE & ODM_IOT) void *adapter = dm->adapter; diff --git a/hal/rtl8192e/rtl8192e_hal_init.c b/hal/rtl8192e/rtl8192e_hal_init.c index d2c0aa0..63aed1b 100644 --- a/hal/rtl8192e/rtl8192e_hal_init.c +++ b/hal/rtl8192e/rtl8192e_hal_init.c @@ -3741,16 +3741,16 @@ u8 SetHwReg8192E(PADAPTER Adapter, u8 variable, u8 *val) val[1] = 0x0e; } /* SIFS for OFDM Data ACK */ - PlatformEFIOWrite1Byte(Adapter, REG_SIFS_CTX_8192E+1, val[0]); + rtw_write8(Adapter, REG_SIFS_CTX_8192E+1, val[0]); /* SIFS for OFDM consecutive tx like CTS data! */ - PlatformEFIOWrite1Byte(Adapter, REG_SIFS_TRX_8192E+1, val[1]); + rtw_write8(Adapter, REG_SIFS_TRX_8192E+1, val[1]); - PlatformEFIOWrite1Byte(Adapter, REG_SPEC_SIFS_8192E+1, val[0]); - PlatformEFIOWrite1Byte(Adapter, REG_MAC_SPEC_SIFS_8192E+1, val[0]); + rtw_write8(Adapter, REG_SPEC_SIFS_8192E+1, val[0]); + rtw_write8(Adapter, REG_MAC_SPEC_SIFS_8192E+1, val[0]); /* Revise SIFS setting due to Hardware register definition change. */ - PlatformEFIOWrite1Byte(Adapter, REG_RESP_SIFS_OFDM_8192E+1, val[0]); - PlatformEFIOWrite1Byte(Adapter, REG_RESP_SIFS_OFDM_8192E, val[0]); + rtw_write8(Adapter, REG_RESP_SIFS_OFDM_8192E+1, val[0]); + rtw_write8(Adapter, REG_RESP_SIFS_OFDM_8192E, val[0]); } #if 0 diff --git a/hal/rtl8192e/usb/usb_halinit.c b/hal/rtl8192e/usb/usb_halinit.c index 4c01cd2..662aced 100644 --- a/hal/rtl8192e/usb/usb_halinit.c +++ b/hal/rtl8192e/usb/usb_halinit.c @@ -170,64 +170,64 @@ _InitBurstPktLen_8192EU(IN PADAPTER Adapter) HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - /* PlatformEFIOWrite2Byte(Adapter, REG_TRXDMA_CTRL_8195, 0xf5b0); */ - /* PlatformEFIOWrite2Byte(Adapter, REG_TRXDMA_CTRL_8812, 0xf5b4); */ - PlatformEFIOWrite2Byte(Adapter, REG_RXDMA_STATUS_8192E, 0x7400); /* burset lenght=4, set 0x3400 for burset length=2 */ - PlatformEFIOWrite1Byte(Adapter, 0x289, 0xf5); /* for rxdma control */ - /* PlatformEFIOWrite1Byte(Adapter, 0x3a, 0x46); */ + /* rtw_write16(Adapter, REG_TRXDMA_CTRL_8195, 0xf5b0); */ + /* rtw_write16(Adapter, REG_TRXDMA_CTRL_8812, 0xf5b4); */ + rtw_write16(Adapter, REG_RXDMA_STATUS_8192E, 0x7400); /* burset lenght=4, set 0x3400 for burset length=2 */ + rtw_write8(Adapter, 0x289, 0xf5); /* for rxdma control */ + /* rtw_write8(Adapter, 0x3a, 0x46); */ /* 0x456 = 0x70, sugguested by Zhilin */ - /* PlatformEFIOWrite1Byte(Adapter, REG_AMPDU_MAX_TIME_8192E, 0x70); */ + /* rtw_write8(Adapter, REG_AMPDU_MAX_TIME_8192E, 0x70); */ /* Suggention by SD1 Jong and Pisa, by Maddest 20130107. */ - PlatformEFIOWrite2Byte(Adapter, REG_MAX_AGGR_NUM_8192E, 0x0e0e); - PlatformEFIOWrite1Byte(Adapter, REG_FWHW_TXQ_CTRL_8192E, 0x80);/* EN_AMPDU_RTY_NEW */ - PlatformEFIOWrite1Byte(Adapter, REG_AMPDU_MAX_TIME_8192E, 0x5e); - PlatformEFIOWrite4Byte(Adapter, REG_FAST_EDCA_CTRL_8192E, 0x03087777); + rtw_write16(Adapter, REG_MAX_AGGR_NUM_8192E, 0x0e0e); + rtw_write8(Adapter, REG_FWHW_TXQ_CTRL_8192E, 0x80);/* EN_AMPDU_RTY_NEW */ + rtw_write8(Adapter, REG_AMPDU_MAX_TIME_8192E, 0x5e); + rtw_write32(Adapter, REG_FAST_EDCA_CTRL_8192E, 0x03087777); - /* PlatformEFIOWrite4Byte(Adapter, 0x458, 0xffffffff); */ - PlatformEFIOWrite1Byte(Adapter, REG_USTIME_TSF_8192E, 0x50); - PlatformEFIOWrite1Byte(Adapter, REG_USTIME_EDCA_8192E, 0x50); + /* rtw_write32(Adapter, 0x458, 0xffffffff); */ + rtw_write8(Adapter, REG_USTIME_TSF_8192E, 0x50); + rtw_write8(Adapter, REG_USTIME_EDCA_8192E, 0x50); if (IS_HARDWARE_TYPE_8821U(Adapter) || IS_HARDWARE_TYPE_8192EU(Adapter)) speedvalue = BIT7; else - speedvalue = PlatformEFIORead1Byte(Adapter, 0xff); /* check device operation speed: SS 0xff bit7 */ + speedvalue = rtw_read8(Adapter, 0xff); /* check device operation speed: SS 0xff bit7 */ if (speedvalue & BIT7) { /* USB2/1.1 Mode */ - temp = PlatformEFIORead1Byte(Adapter, REG_USB_INFO); + temp = rtw_read8(Adapter, REG_USB_INFO); if (((temp >> 4) & 0x03) == 0) { /* pHalData->UsbBulkOutSize = 512; */ - provalue = PlatformEFIORead1Byte(Adapter, REG_RXDMA_PRO_8192E); - PlatformEFIOWrite1Byte(Adapter, REG_RXDMA_PRO_8192E, (provalue | BIT(4) & (~BIT(5)))); /* set burst pkt len=512B */ - PlatformEFIOWrite2Byte(Adapter, REG_RXDMA_PRO_8192E, 0x1e); + provalue = rtw_read8(Adapter, REG_RXDMA_PRO_8192E); + rtw_write8(Adapter, REG_RXDMA_PRO_8192E, (provalue | BIT(4) & (~BIT(5)))); /* set burst pkt len=512B */ + rtw_write16(Adapter, REG_RXDMA_PRO_8192E, 0x1e); } else { /* pHalData->UsbBulkOutSize = 64; */ - provalue = PlatformEFIORead1Byte(Adapter, REG_RXDMA_PRO_8192E); - PlatformEFIOWrite1Byte(Adapter, REG_RXDMA_PRO_8192E, ((provalue | BIT(5)) & (~BIT(4)))); /* set burst pkt len=64B */ + provalue = rtw_read8(Adapter, REG_RXDMA_PRO_8192E); + rtw_write8(Adapter, REG_RXDMA_PRO_8192E, ((provalue | BIT(5)) & (~BIT(4)))); /* set burst pkt len=64B */ } - PlatformEFIOWrite2Byte(Adapter, REG_RXDMA_AGG_PG_TH_8192E, 0x2005); /* dmc agg th 20K */ + rtw_write16(Adapter, REG_RXDMA_AGG_PG_TH_8192E, 0x2005); /* dmc agg th 20K */ pHalData->bSupportUSB3 = FALSE; } - PlatformEFIOWrite1Byte(Adapter, REG_DWBCN0_CTRL_8192E, 0x10); + rtw_write8(Adapter, REG_DWBCN0_CTRL_8192E, 0x10); - PlatformEFIOWrite1Byte(Adapter, 0x4c7, PlatformEFIORead1Byte(Adapter, 0x4c7) | BIT(7)); /* enable single pkt ampdu */ - PlatformEFIOWrite1Byte(Adapter, REG_RX_PKT_LIMIT_8192E, 0x18); /* for VHT packet length 11K */ + rtw_write8(Adapter, 0x4c7, rtw_read8(Adapter, 0x4c7) | BIT(7)); /* enable single pkt ampdu */ + rtw_write8(Adapter, REG_RX_PKT_LIMIT_8192E, 0x18); /* for VHT packet length 11K */ - /* PlatformEFIOWrite1Byte(Adapter, REG_MAX_AGGR_NUM_8192E, 0x1f); */ - PlatformEFIOWrite1Byte(Adapter, REG_PIFS_8192E, 0x00); - /* PlatformEFIOWrite1Byte(Adapter, REG_FWHW_TXQ_CTRL_8192E, PlatformEFIORead1Byte(Adapter, REG_FWHW_TXQ_CTRL)&(~BIT(7))); */ + /* rtw_write8(Adapter, REG_MAX_AGGR_NUM_8192E, 0x1f); */ + rtw_write8(Adapter, REG_PIFS_8192E, 0x00); + /* rtw_write8(Adapter, REG_FWHW_TXQ_CTRL_8192E, rtw_read8(Adapter, REG_FWHW_TXQ_CTRL)&(~BIT(7))); */ #ifdef CONFIG_TX_EARLY_MODE if (pHalData->AMPDUBurstMode) - PlatformEFIOWrite1Byte(Adapter, REG_SW_AMPDU_BURST_MODE_CTRL_8192E, 0x5F); + rtw_write8(Adapter, REG_SW_AMPDU_BURST_MODE_CTRL_8192E, 0x5F); #endif - PlatformEFIOWrite1Byte(Adapter, 0x1c, PlatformEFIORead1Byte(Adapter, 0x1c) | BIT(5) | BIT(6)); /* to prevent mac is reseted by bus. 20111208, by Page */ + rtw_write8(Adapter, 0x1c, rtw_read8(Adapter, 0x1c) | BIT(5) | BIT(6)); /* to prevent mac is reseted by bus. 20111208, by Page */ #endif } @@ -255,8 +255,8 @@ static u32 _InitPowerOn_8192EU(_adapter *padapter) /* 0x14[23:20]=b��0101 (raise 1.2V voltage) - u1Byte tmp1Byte = PlatformEFIORead1Byte(Adapter,0x16); - PlatformEFIOWrite1Byte(Adapter,0x16,tmp1Byte |BIT4|BIT6); */ + u1Byte tmp1Byte = rtw_read8(Adapter,0x16); + rtw_write8(Adapter,0x16,tmp1Byte |BIT4|BIT6); */ u32 voltage = rtw_read32(padapter , REG_SYS_SWR_CTRL2_8192E); if (((voltage & 0x00F00000) >> 20) == 0x4) { @@ -1106,10 +1106,10 @@ u32 rtl8192eu_hal_init(PADAPTER Adapter) #endif /* CONFIG_XMIT_ACK */ /* Fixed LDPC rx hang issue. */ { - u4Byte tmp4Byte = PlatformEFIORead4Byte(Adapter, REG_SYS_SWR_CTRL1_8192E); - PlatformEFIOWrite1Byte(Adapter, REG_SYS_SWR_CTRL2_8192E, 0x75); + u4Byte tmp4Byte = rtw_read32(Adapter, REG_SYS_SWR_CTRL1_8192E); + rtw_write8(Adapter, REG_SYS_SWR_CTRL2_8192E, 0x75); tmp4Byte = (tmp4Byte & 0xfff00fff) | (0x7E << 12); - PlatformEFIOWrite4Byte(Adapter, REG_SYS_SWR_CTRL1_8192E, tmp4Byte); + rtw_write32(Adapter, REG_SYS_SWR_CTRL1_8192E, tmp4Byte); } exit: diff --git a/include/rtw_io.h b/include/rtw_io.h index 5a29d24..8a0b810 100644 --- a/include/rtw_io.h +++ b/include/rtw_io.h @@ -335,18 +335,18 @@ extern void unregister_intf_hdl(struct intf_hdl *pintfhdl); extern void _rtw_attrib_read(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem); extern void _rtw_attrib_write(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem); -extern u8 _rtw_read8(_adapter *adapter, u32 addr); -extern u16 _rtw_read16(_adapter *adapter, u32 addr); -extern u32 _rtw_read32(_adapter *adapter, u32 addr); +extern u8 rtw_read8(_adapter *adapter, u32 addr); +extern u16 rtw_read16(_adapter *adapter, u32 addr); +extern u32 rtw_read32(_adapter *adapter, u32 addr); extern void _rtw_read_mem(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem); extern void _rtw_read_port(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem); extern void _rtw_read_port_cancel(_adapter *adapter); -extern int _rtw_write8(_adapter *adapter, u32 addr, u8 val); -extern int _rtw_write16(_adapter *adapter, u32 addr, u16 val); -extern int _rtw_write32(_adapter *adapter, u32 addr, u32 val); -extern int _rtw_writeN(_adapter *adapter, u32 addr, u32 length, u8 *pdata); +extern int rtw_write8(_adapter *adapter, u32 addr, u8 val); +extern int rtw_write16(_adapter *adapter, u32 addr, u16 val); +extern int rtw_write32(_adapter *adapter, u32 addr, u32 val); +extern int rtw_writeN(_adapter *adapter, u32 addr, u32 length, u8 *pdata); #ifdef CONFIG_SDIO_HCI u8 _rtw_sd_f0_read8(_adapter *adapter, u32 addr); @@ -377,15 +377,6 @@ const struct rtw_io_sniff_ent *match_write_sniff(_adapter *adapter, u32 addr, u1 bool match_rf_read_sniff_ranges(_adapter *adapter, u8 path, u32 addr, u32 mask); bool match_rf_write_sniff_ranges(_adapter *adapter, u8 path, u32 addr, u32 mask); -extern u8 dbg_rtw_read8(_adapter *adapter, u32 addr, const char *caller, const int line); -extern u16 dbg_rtw_read16(_adapter *adapter, u32 addr, const char *caller, const int line); -extern u32 dbg_rtw_read32(_adapter *adapter, u32 addr, const char *caller, const int line); - -extern int dbg_rtw_write8(_adapter *adapter, u32 addr, u8 val, const char *caller, const int line); -extern int dbg_rtw_write16(_adapter *adapter, u32 addr, u16 val, const char *caller, const int line); -extern int dbg_rtw_write32(_adapter *adapter, u32 addr, u32 val, const char *caller, const int line); -extern int dbg_rtw_writeN(_adapter *adapter, u32 addr , u32 length , u8 *data, const char *caller, const int line); - #ifdef CONFIG_SDIO_HCI u8 dbg_rtw_sd_f0_read8(_adapter *adapter, u32 addr, const char *caller, const int line); #ifdef CONFIG_SDIO_INDIRECT_ACCESS @@ -398,18 +389,10 @@ int dbg_rtw_sd_iwrite32(_adapter *adapter, u32 addr, u32 val, const char *caller #endif /* CONFIG_SDIO_INDIRECT_ACCESS */ #endif /* CONFIG_SDIO_HCI */ -#define rtw_read8(adapter, addr) dbg_rtw_read8((adapter), (addr), __FUNCTION__, __LINE__) -#define rtw_read16(adapter, addr) dbg_rtw_read16((adapter), (addr), __FUNCTION__, __LINE__) -#define rtw_read32(adapter, addr) dbg_rtw_read32((adapter), (addr), __FUNCTION__, __LINE__) #define rtw_read_mem(adapter, addr, cnt, mem) _rtw_read_mem((adapter), (addr), (cnt), (mem)) #define rtw_read_port(adapter, addr, cnt, mem) _rtw_read_port((adapter), (addr), (cnt), (mem)) #define rtw_read_port_cancel(adapter) _rtw_read_port_cancel((adapter)) -#define rtw_write8(adapter, addr, val) dbg_rtw_write8((adapter), (addr), (val), __FUNCTION__, __LINE__) -#define rtw_write16(adapter, addr, val) dbg_rtw_write16((adapter), (addr), (val), __FUNCTION__, __LINE__) -#define rtw_write32(adapter, addr, val) dbg_rtw_write32((adapter), (addr), (val), __FUNCTION__, __LINE__) -#define rtw_writeN(adapter, addr, length, data) dbg_rtw_writeN((adapter), (addr), (length), (data), __FUNCTION__, __LINE__) - #define rtw_write8_async(adapter, addr, val) _rtw_write8_async((adapter), (addr), (val)) #define rtw_write16_async(adapter, addr, val) _rtw_write16_async((adapter), (addr), (val)) #define rtw_write32_async(adapter, addr, val) _rtw_write32_async((adapter), (addr), (val)) @@ -432,17 +415,10 @@ int dbg_rtw_sd_iwrite32(_adapter *adapter, u32 addr, u32 val, const char *caller #endif /* CONFIG_SDIO_HCI */ #else /* DBG_IO */ -#define rtw_read8(adapter, addr) _rtw_read8((adapter), (addr)) -#define rtw_read16(adapter, addr) _rtw_read16((adapter), (addr)) -#define rtw_read32(adapter, addr) _rtw_read32((adapter), (addr)) #define rtw_read_mem(adapter, addr, cnt, mem) _rtw_read_mem((adapter), (addr), (cnt), (mem)) #define rtw_read_port(adapter, addr, cnt, mem) _rtw_read_port((adapter), (addr), (cnt), (mem)) #define rtw_read_port_cancel(adapter) _rtw_read_port_cancel((adapter)) -#define rtw_write8(adapter, addr, val) _rtw_write8((adapter), (addr), (val)) -#define rtw_write16(adapter, addr, val) _rtw_write16((adapter), (addr), (val)) -#define rtw_write32(adapter, addr, val) _rtw_write32((adapter), (addr), (val)) -#define rtw_writeN(adapter, addr, length, data) _rtw_writeN((adapter), (addr), (length), (data)) #define rtw_write8_async(adapter, addr, val) _rtw_write8_async((adapter), (addr), (val)) #define rtw_write16_async(adapter, addr, val) _rtw_write16_async((adapter), (addr), (val)) @@ -509,36 +485,4 @@ extern void bus_sync_io(struct io_queue *pio_q); extern u32 _ioreq2rwmem(struct io_queue *pio_q); extern void dev_power_down(_adapter *Adapter, u8 bpwrup); -/* -#define RTL_R8(reg) rtw_read8(padapter, reg) -#define RTL_R16(reg) rtw_read16(padapter, reg) -#define RTL_R32(reg) rtw_read32(padapter, reg) -#define RTL_W8(reg, val8) rtw_write8(padapter, reg, val8) -#define RTL_W16(reg, val16) rtw_write16(padapter, reg, val16) -#define RTL_W32(reg, val32) rtw_write32(padapter, reg, val32) -*/ - -/* -#define RTL_W8_ASYNC(reg, val8) rtw_write32_async(padapter, reg, val8) -#define RTL_W16_ASYNC(reg, val16) rtw_write32_async(padapter, reg, val16) -#define RTL_W32_ASYNC(reg, val32) rtw_write32_async(padapter, reg, val32) - -#define RTL_WRITE_BB(reg, val32) phy_SetUsbBBReg(padapter, reg, val32) -#define RTL_READ_BB(reg) phy_QueryUsbBBReg(padapter, reg) -*/ - -#define PlatformEFIOWrite1Byte(_a, _b, _c) \ - rtw_write8(_a, _b, _c) -#define PlatformEFIOWrite2Byte(_a, _b, _c) \ - rtw_write16(_a, _b, _c) -#define PlatformEFIOWrite4Byte(_a, _b, _c) \ - rtw_write32(_a, _b, _c) - -#define PlatformEFIORead1Byte(_a, _b) \ - rtw_read8(_a, _b) -#define PlatformEFIORead2Byte(_a, _b) \ - rtw_read16(_a, _b) -#define PlatformEFIORead4Byte(_a, _b) \ - rtw_read32(_a, _b) - #endif /* _RTL8711_IO_H_ */ diff --git a/os_dep/linux/ioctl_mp.c b/os_dep/linux/ioctl_mp.c index af92b7e..c4303d0 100644 --- a/os_dep/linux/ioctl_mp.c +++ b/os_dep/linux/ioctl_mp.c @@ -1087,10 +1087,10 @@ int rtw_mp_arx(struct net_device *dev, if (pmppriv->bloopback == _TRUE) { sprintf(extra , "Enter MAC LoopBack mode\n"); - _rtw_write32(padapter, 0x100, 0xB0106FF); - RTW_INFO("0x100 :0x%x" , _rtw_read32(padapter, 0x100)); - _rtw_write16(padapter, 0x608, 0x30c); - RTW_INFO("0x100 :0x%x" , _rtw_read32(padapter, 0x608)); + rtw_write32(padapter, 0x100, 0xB0106FF); + RTW_INFO("0x100 :0x%x" , rtw_read32(padapter, 0x100)); + rtw_write16(padapter, 0x608, 0x30c); + RTW_INFO("0x100 :0x%x" , rtw_read32(padapter, 0x608)); } wrqu->length = strlen(extra) + 1;