From b75d3eed9332e292be0b35529042bfa64a949e3f Mon Sep 17 00:00:00 2001 From: yunjie Date: Mon, 31 Oct 2022 18:11:25 +0000 Subject: [PATCH] MA-20857 WCS MM5X17366 - Q4-2022 RC1 patch integrate Reason: WiFi driver integrate Test: on i.MX8MQ with 9098 module Change-Id: I85fd1d140e529fe055209f1aca24b57f494a1d02 Signed-off-by: yunjie --- mxm_wifiex/wlan_src/Makefile | 42 ++-- mxm_wifiex/wlan_src/mlan/mlan_11h.c | 10 +- mxm_wifiex/wlan_src/mlan/mlan_decl.h | 24 ++- mxm_wifiex/wlan_src/mlan/mlan_fw.h | 139 ++++++++++++ mxm_wifiex/wlan_src/mlan/mlan_ieee.h | 174 +++++++++++++++ mxm_wifiex/wlan_src/mlan/mlan_init.h | 13 ++ mxm_wifiex/wlan_src/mlan/mlan_ioctl.h | 122 +++++++++++ mxm_wifiex/wlan_src/mlan/mlan_main.h | 50 +++++ mxm_wifiex/wlan_src/mlinux/mlan_decl.h | 24 ++- mxm_wifiex/wlan_src/mlinux/mlan_ieee.h | 174 +++++++++++++++ mxm_wifiex/wlan_src/mlinux/mlan_ioctl.h | 122 +++++++++++ mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c | 23 +- mxm_wifiex/wlan_src/mlinux/moal_cfg80211.h | 14 +- .../wlan_src/mlinux/moal_cfg80211_util.c | 15 +- .../wlan_src/mlinux/moal_cfg80211_util.h | 1 + mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c | 48 +++-- mxm_wifiex/wlan_src/mlinux/moal_ioctl.c | 55 ++++- mxm_wifiex/wlan_src/mlinux/moal_main.c | 202 +++++++++--------- mxm_wifiex/wlan_src/mlinux/moal_main.h | 44 +++- mxm_wifiex/wlan_src/mlinux/moal_pcie.c | 2 + mxm_wifiex/wlan_src/mlinux/moal_sdio_mmc.c | 4 +- mxm_wifiex/wlan_src/mlinux/moal_shim.c | 12 +- .../wlan_src/mlinux/moal_sta_cfg80211.c | 16 +- .../wlan_src/mlinux/moal_uap_cfg80211.c | 12 +- 24 files changed, 1148 insertions(+), 194 deletions(-) diff --git a/mxm_wifiex/wlan_src/Makefile b/mxm_wifiex/wlan_src/Makefile index 83c8347..f873d61 100644 --- a/mxm_wifiex/wlan_src/Makefile +++ b/mxm_wifiex/wlan_src/Makefile @@ -1,27 +1,19 @@ # File: Makefile # -# Copyright 2014-2022 NXP +# Copyright 2008-2022 NXP # -# NXP CONFIDENTIAL -# The source code contained or described herein and all documents related to -# the source code (Materials) are owned by NXP, its -# suppliers and/or its licensors. Title to the Materials remains with NXP, -# its suppliers and/or its licensors. The Materials contain -# trade secrets and proprietary and confidential information of NXP, its -# suppliers and/or its licensors. The Materials are protected by worldwide copyright -# and trade secret laws and treaty provisions. No part of the Materials may be -# used, copied, reproduced, modified, published, uploaded, posted, -# transmitted, distributed, or disclosed in any way without NXP's prior -# express written permission. +# This software file (the File) is distributed by NXP +# under the terms of the GNU General Public License Version 2, June 1991 +# (the License). You may use, redistribute and/or modify the File in +# accordance with the terms and conditions of the License, a copy of which +# is available by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the +# worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. # -# No license under any patent, copyright, trade secret or other intellectual -# property right is granted to or conferred upon you by disclosure or delivery -# of the Materials, either expressly, by implication, inducement, estoppel or -# otherwise. Any license under such intellectual property rights must be -# express and approved by NXP in writing. -# -# Alternatively, this software may be distributed under the terms of GPL v2. -# SPDX-License-Identifier: GPL-2.0 +# THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE +# IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE +# ARE EXPRESSLY DISCLAIMED. The License provides additional details about +# this warranty disclaimer. # CONFIG_COMPATDIR=n @@ -93,6 +85,9 @@ CONFIG_MFG_CMD_SUPPORT=y # OpenWrt support CONFIG_OPENWRT_SUPPORT=n +# Big-endian platform +CONFIG_BIG_ENDIAN=n + ifeq ($(CONFIG_DRV_EMBEDDED_SUPPLICANT), y) @@ -135,6 +130,9 @@ ARCH ?= arm64 CONFIG_IMX_SUPPORT=y ifeq ($(CONFIG_IMX_SUPPORT),y) ccflags-y += -DIMX_SUPPORT +ifneq ($(ANDROID_PRODUCT_OUT),) +ccflags-y += -DIMX_ANDROID +endif endif KERNELDIR ?= /usr/src/arm/linux_5_10_y_kernel/linux-nxp CROSS_COMPILE ?= /opt/fsl-imx-internal-xwayland/5.10-gatesgarth/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux- @@ -193,6 +191,10 @@ ifeq ($(CONFIG_MFG_CMD_SUPPORT),y) ccflags-y += -DMFG_CMD_SUPPORT endif +ifeq ($(CONFIG_BIG_ENDIAN),y) + ccflags-y += -DBIG_ENDIAN_SUPPORT +endif + ifeq ($(CONFIG_USERSPACE_32BIT_OVER_KERNEL_64BIT),y) ccflags-y += -DUSERSPACE_32BIT_OVER_KERNEL_64BIT endif diff --git a/mxm_wifiex/wlan_src/mlan/mlan_11h.c b/mxm_wifiex/wlan_src/mlan/mlan_11h.c index b0b809c..c37ccce 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_11h.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_11h.c @@ -2903,10 +2903,12 @@ t_s32 wlan_11h_process_join(mlan_private *priv, t_u8 **ppbuffer, priv, ppbuffer, band, channel, p11h_bss_info); } } else { - /* Deactivate 11h functions in the firmware */ - wlan_11h_activate(priv, MNULL, MFALSE); - pcap_info->spectrum_mgmt = MFALSE; - wlan_11h_check_update_radar_det_state(priv); + if (pcap_info->ibss) { + /* Deactivate 11h functions in the firmware */ + wlan_11h_activate(priv, MNULL, MFALSE); + pcap_info->spectrum_mgmt = MFALSE; + wlan_11h_check_update_radar_det_state(priv); + } } LEAVE(); diff --git a/mxm_wifiex/wlan_src/mlan/mlan_decl.h b/mxm_wifiex/wlan_src/mlan/mlan_decl.h index 2236e5a..e9c41a6 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_decl.h +++ b/mxm_wifiex/wlan_src/mlan/mlan_decl.h @@ -24,7 +24,7 @@ #define _MLAN_DECL_H_ /** MLAN release version */ -#define MLAN_RELEASE_VERSION "362" +#define MLAN_RELEASE_VERSION "366" /** Re-define generic data types for MLAN/MOAL */ /** Signed char (1-byte) */ @@ -967,6 +967,16 @@ typedef enum _dfs_moe_t { /** Band_Config_t */ typedef MLAN_PACK_START struct _Band_Config_t { +#ifdef BIG_ENDIAN_SUPPORT + /** Channel Selection Mode - (00)=manual, (01)=ACS, (02)=user*/ + t_u8 scanMode : 2; + /** Secondary Channel Offset - (00)=None, (01)=Above, (11)=Below */ + t_u8 chan2Offset : 2; + /** Channel Width - (00)=20MHz, (10)=40MHz, (11)=80MHz */ + t_u8 chanWidth : 2; + /** Band Info - (00)=2.4GHz, (01)=5GHz */ + t_u8 chanBand : 2; +#else /** Band Info - (00)=2.4GHz, (01)=5GHz */ t_u8 chanBand : 2; /** Channel Width - (00)=20MHz, (10)=40MHz, (11)=80MHz */ @@ -975,6 +985,7 @@ typedef MLAN_PACK_START struct _Band_Config_t { t_u8 chan2Offset : 2; /** Channel Selection Mode - (00)=manual, (01)=ACS, (02)=Adoption mode*/ t_u8 scanMode : 2; +#endif } MLAN_PACK_END Band_Config_t; /** channel_band_t */ @@ -1176,6 +1187,16 @@ typedef MLAN_PACK_START struct _radiotap_info { /** txpower structure */ typedef MLAN_PACK_START struct { +#ifdef BIG_ENDIAN_SUPPORT + /** Host tx power ctrl: + 0x0: use fw setting for TX power + 0x1: value specified in bit[6] and bit[5:0] are valid */ + t_u8 hostctl : 1; + /** Sign of the power specified in bit[5:0] */ + t_u8 sign : 1; + /** Power to be used for transmission(in dBm) */ + t_u8 abs_val : 6; +#else /** Power to be used for transmission(in dBm) */ t_u8 abs_val : 6; /** Sign of the power specified in bit[5:0] */ @@ -1184,6 +1205,7 @@ typedef MLAN_PACK_START struct { 0x0: use fw setting for TX power 0x1: value specified in bit[6] and bit[5:0] are valid */ t_u8 hostctl : 1; +#endif } MLAN_PACK_END tx_power_t; /* pkt_txctrl */ typedef MLAN_PACK_START struct _pkt_txctrl { diff --git a/mxm_wifiex/wlan_src/mlan/mlan_fw.h b/mxm_wifiex/wlan_src/mlan/mlan_fw.h index 1a6af8a..6a74e15 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_fw.h +++ b/mxm_wifiex/wlan_src/mlan/mlan_fw.h @@ -2266,6 +2266,43 @@ typedef MLAN_PACK_START struct _MrvlIEtypes_TDLS_Idle_Timeout_t { #define TXPD_RETRY_ENABLE MBIT(12) /** tx_control*/ +#ifdef BIG_ENDIAN_SUPPORT +typedef MLAN_PACK_START struct _tx_ctrl { + /** reserved */ + t_u32 reserved : 3; + /** mc retry packet */ + t_u32 mc_pkt_retry : 1; + /** end of mc AMPDU */ + t_u32 mc_ampdu_end : 1; + /** start of mc AMPDU */ + t_u32 mc_ampdu_start : 1; + /** End of mc cycle */ + t_u32 mc_cycle_end : 1; + /** start of mc cycle */ + t_u32 mc_cycle_start : 1; + /** bw 0-20MHz, 1-40MHz */ + t_u32 bw : 3; + /** Rate used for transmission MCS0-7*/ + t_u32 tx_rate : 5; + /** Control the use of txRate. 0 - use FW setting, 1 - use the specified + * txRate;*/ + t_u32 host_txrate_ctrl : 1; + /** 0/1 - use FW setting, 2 - ACK_IMMD, 3 - NO_ACK.*/ + t_u32 ack_policy : 2; + /** Control the use of retryLimit. 0 - use FW setting, 1 - use the + * specified retryLimit.*/ + t_u32 host_retry_ctrl : 1; + /** retry limit */ + t_u32 retry_limit : 4; + /** Control the use of txPower. 0 - use FW power setting, 1 - use the + * specified txPower.*/ + t_u32 host_tx_powerctrl : 1; + /** Sign of the txPower, 0 - positive_sign(+), 1 - negative_sign(-). */ + t_u32 tx_power_sign : 1; + /** Power used for transmission(in dBm); */ + t_u32 tx_power : 6; +} MLAN_PACK_END tx_ctrl; +#else typedef MLAN_PACK_START struct _tx_ctrl { /** Power used for transmission(in dBm); */ t_u32 tx_power : 6; @@ -2301,6 +2338,7 @@ typedef MLAN_PACK_START struct _tx_ctrl { /** reserved */ t_u32 reserved : 3; } MLAN_PACK_END tx_ctrl; +#endif /** mc tx ctrl */ typedef MLAN_PACK_START struct _mc_tx_ctrl { @@ -2383,6 +2421,32 @@ typedef MLAN_PACK_START struct _RxPD { } MLAN_PACK_END RxPD, *PRxPD; /** IEEEtypes_FrameCtl_t*/ +#ifdef BIG_ENDIAN_SUPPORT +typedef MLAN_PACK_START struct _IEEEtypes_FrameCtl_t { + /** Order */ + t_u8 order : 1; + /** Wep */ + t_u8 wep : 1; + /** More Data */ + t_u8 more_data : 1; + /** Power Mgmt */ + t_u8 pwr_mgmt : 1; + /** Retry */ + t_u8 retry : 1; + /** More Frag */ + t_u8 more_frag : 1; + /** From DS */ + t_u8 from_ds : 1; + /** To DS */ + t_u8 to_ds : 1; + /** Sub Type */ + t_u8 sub_type : 4; + /** Type */ + t_u8 type : 2; + /** Protocol Version */ + t_u8 protocol_version : 2; +} MLAN_PACK_END IEEEtypes_FrameCtl_t; +#else typedef MLAN_PACK_START struct _IEEEtypes_FrameCtl_t { /** Protocol Version */ t_u8 protocol_version : 2; @@ -2407,6 +2471,7 @@ typedef MLAN_PACK_START struct _IEEEtypes_FrameCtl_t { /** Order */ t_u8 order : 1; } MLAN_PACK_END IEEEtypes_FrameCtl_t; +#endif /** MrvlIETypes_MgmtFrameSet_t */ typedef MLAN_PACK_START struct _MrvlIETypes_MgmtFrameSet_t { @@ -2517,6 +2582,24 @@ typedef MLAN_PACK_START struct _parsed_region_chan_11d { /** ChanScanMode_t */ typedef MLAN_PACK_START struct _ChanScanMode_t { +#ifdef BIG_ENDIAN_SUPPORT + /** Reserved */ + t_u8 reserved_7 : 1; + /** First passive scan then active scan */ + t_u8 passive_to_active_scan : 1; + /** First channel in scan */ + t_u8 first_chan : 1; + /** Enable hidden ssid report */ + t_u8 hidden_ssid_report : 1; + /** Enable probe response timeout */ + t_u8 rsp_timeout_en : 1; + /** Multidomain scan mode */ + t_u8 multidomain_scan : 1; + /** Disble channel filtering flag */ + t_u8 disable_chan_filt : 1; + /** Channel scan mode passive flag */ + t_u8 passive_scan : 1; +#else /** Channel scan mode passive flag */ t_u8 passive_scan : 1; /** Disble channel filtering flag */ @@ -2533,6 +2616,7 @@ typedef MLAN_PACK_START struct _ChanScanMode_t { t_u8 passive_to_active_scan : 1; /** Reserved */ t_u8 reserved_7 : 1; +#endif } MLAN_PACK_END ChanScanMode_t; /** ChanScanParamSet_t */ @@ -2989,24 +3073,50 @@ typedef MLAN_PACK_START struct _HostCmd_DS_GTK_REKEY_PARAMS { /** Data structure of WMM QoS information */ typedef MLAN_PACK_START struct _WmmQosInfo_t { +#ifdef BIG_ENDIAN_SUPPORT + /** QoS UAPSD */ + t_u8 qos_uapsd : 1; + /** Reserved */ + t_u8 reserved : 3; + /** Parameter set count */ + t_u8 para_set_count : 4; +#else /** Parameter set count */ t_u8 para_set_count : 4; /** Reserved */ t_u8 reserved : 3; /** QoS UAPSD */ t_u8 qos_uapsd : 1; +#endif /* BIG_ENDIAN_SUPPORT */ } MLAN_PACK_END WmmQosInfo_t, *pWmmQosInfo_t; /** Data structure of WMM ECW */ typedef MLAN_PACK_START struct _WmmEcw_t { +#ifdef BIG_ENDIAN_SUPPORT + /** Maximum Ecw */ + t_u8 ecw_max : 4; + /** Minimum Ecw */ + t_u8 ecw_min : 4; +#else /** Minimum Ecw */ t_u8 ecw_min : 4; /** Maximum Ecw */ t_u8 ecw_max : 4; +#endif /* BIG_ENDIAN_SUPPORT */ } MLAN_PACK_END WmmEcw_t, *pWmmEcw_t; /** Data structure of WMM Aci/Aifsn */ typedef MLAN_PACK_START struct _WmmAciAifsn_t { +#ifdef BIG_ENDIAN_SUPPORT + /** Reserved */ + t_u8 reserved : 1; + /** Aci */ + t_u8 aci : 2; + /** Acm */ + t_u8 acm : 1; + /** Aifsn */ + t_u8 aifsn : 4; +#else /** Aifsn */ t_u8 aifsn : 4; /** Acm */ @@ -3015,6 +3125,7 @@ typedef MLAN_PACK_START struct _WmmAciAifsn_t { t_u8 aci : 2; /** Reserved */ t_u8 reserved : 1; +#endif /* BIG_ENDIAN_SUPPORT */ } MLAN_PACK_END WmmAciAifsn_t, *pWmmAciAifsn_t; /** Data structure of WMM AC parameters */ @@ -5292,9 +5403,15 @@ typedef MLAN_PACK_START struct { */ typedef MLAN_PACK_START struct { mlan_wmm_queue_stats_action_e action; /**< Start, Stop, or Get */ +#ifdef BIG_ENDIAN_SUPPORT + t_u8 select_bin : 7; /**< WMM_AC_BK(0) to WMM_AC_VO(3), or TID */ + t_u8 select_is_userpri : 1; /**< Set if select_bin is UP, Clear for AC + */ +#else t_u8 select_is_userpri : 1; /**< Set if select_bin is UP, Clear for AC */ t_u8 select_bin : 7; /**< WMM_AC_BK(0) to WMM_AC_VO(3), or TID */ +#endif t_u16 pkt_count; /**< Number of successful packets transmitted */ t_u16 pkt_loss; /**< Packets lost; not included in pktCount */ t_u32 avg_queue_delay; /**< Average Queue delay in microsec */ @@ -7145,6 +7262,20 @@ typedef MLAN_PACK_START enum _MeasType_t { * @brief Mode octet of the measurement request element (7.3.2.21) */ typedef MLAN_PACK_START struct { +#ifdef BIG_ENDIAN_SUPPORT + /**< Reserved */ + t_u8 rsvd5_7 : 3; + /**< 11k: duration spec. for meas. is mandatory */ + t_u8 duration_mandatory : 1; + /**< 11h: en/disable report rcpt. of spec. type */ + t_u8 report : 1; + /**< 11h: en/disable requests of specified type */ + t_u8 request : 1; + /**< 11h: enable report/request bits */ + t_u8 enable : 1; + /**< 11k: series or parallel with previous meas */ + t_u8 parallel : 1; +#else /**< 11k: series or parallel with previous meas */ t_u8 parallel : 1; /**< 11h: enable report/request bits */ @@ -7157,6 +7288,7 @@ typedef MLAN_PACK_START struct { t_u8 duration_mandatory : 1; /**< Reserved */ t_u8 rsvd5_7 : 3; +#endif /* BIG_ENDIAN_SUPPORT */ } MLAN_PACK_END MeasReqMode_t; @@ -7201,10 +7333,17 @@ typedef union { * @brief Mode octet of the measurement report element (7.3.2.22) */ typedef MLAN_PACK_START struct { +#ifdef BIG_ENDIAN_SUPPORT + t_u8 rsvd3_7 : 5; /**< Reserved */ + t_u8 refused : 1; /**< Measurement refused */ + t_u8 incapable : 1; /**< Incapable of performing measurement */ + t_u8 late : 1; /**< Start TSF time missed for measurement */ +#else t_u8 late : 1; /**< Start TSF time missed for measurement */ t_u8 incapable : 1; /**< Incapable of performing measurement */ t_u8 refused : 1; /**< Measurement refused */ t_u8 rsvd3_7 : 5; /**< Reserved */ +#endif /* BIG_ENDIAN_SUPPORT */ } MLAN_PACK_END MeasRptMode_t; diff --git a/mxm_wifiex/wlan_src/mlan/mlan_ieee.h b/mxm_wifiex/wlan_src/mlan/mlan_ieee.h index d8384ad..d9a2ce7 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_ieee.h +++ b/mxm_wifiex/wlan_src/mlan/mlan_ieee.h @@ -46,10 +46,17 @@ typedef enum _WLAN_802_11_NETWORK_TYPE { Wlan802_11NetworkTypeMax } WLAN_802_11_NETWORK_TYPE; +#ifdef BIG_ENDIAN_SUPPORT +/** Frame control: Type Mgmt frame */ +#define IEEE80211_FC_MGMT_FRAME_TYPE_MASK 0x3000 +/** Frame control: SubType Mgmt frame */ +#define IEEE80211_GET_FC_MGMT_FRAME_SUBTYPE(fc) (((fc)&0xF000) >> 12) +#else /** Frame control: Type Mgmt frame */ #define IEEE80211_FC_MGMT_FRAME_TYPE_MASK 0x000C /** Frame control: SubType Mgmt frame */ #define IEEE80211_GET_FC_MGMT_FRAME_SUBTYPE(fc) (((fc)&0x00F0) >> 4) +#endif #ifdef PRAGMA_PACK #pragma pack(push, 1) @@ -172,12 +179,21 @@ typedef MLAN_PACK_START struct _IEEEtypes_Generic_t { /**ft capability policy*/ typedef MLAN_PACK_START struct _IEEEtypes_FtCapPolicy_t { +#ifdef BIG_ENDIAN_SUPPORT + /** Reserved */ + t_u8 reserved : 6; + /** RIC support */ + t_u8 ric : 1; + /** FT over the DS capable */ + t_u8 ft_over_ds : 1; +#else /** FT over the DS capable */ t_u8 ft_over_ds : 1; /** RIC support */ t_u8 ric : 1; /** Reserved */ t_u8 reserved : 6; +#endif } MLAN_PACK_END IEEEtypes_FtCapPolicy_t; /** Mobility domain IE */ @@ -310,6 +326,25 @@ typedef MLAN_PACK_START struct _TLV_Generic_t { #define CAPINFO_MASK (~(MBIT(15) | MBIT(14) | MBIT(11) | MBIT(9))) /** Capability Bit Map*/ +#ifdef BIG_ENDIAN_SUPPORT +typedef MLAN_PACK_START struct _IEEEtypes_CapInfo_t { + t_u8 rsrvd1 : 2; + t_u8 dsss_ofdm : 1; + t_u8 radio_measurement : 1; + t_u8 rsvrd2 : 1; + t_u8 short_slot_time : 1; + t_u8 rsrvd3 : 1; + t_u8 spectrum_mgmt : 1; + t_u8 chan_agility : 1; + t_u8 pbcc : 1; + t_u8 short_preamble : 1; + t_u8 privacy : 1; + t_u8 cf_poll_rqst : 1; + t_u8 cf_pollable : 1; + t_u8 ibss : 1; + t_u8 ess : 1; +} MLAN_PACK_END IEEEtypes_CapInfo_t, *pIEEEtypes_CapInfo_t; +#else typedef MLAN_PACK_START struct _IEEEtypes_CapInfo_t { /** Capability Bit Map : ESS */ t_u8 ess : 1; @@ -342,6 +377,7 @@ typedef MLAN_PACK_START struct _IEEEtypes_CapInfo_t { /** Capability Bit Map : Reserved */ t_u8 rsrvd1 : 2; } MLAN_PACK_END IEEEtypes_CapInfo_t, *pIEEEtypes_CapInfo_t; +#endif /* BIG_ENDIAN_SUPPORT */ /** IEEEtypes_Ssid_t */ typedef MLAN_PACK_START struct _IEEEtypes_Ssid_t { @@ -556,16 +592,35 @@ typedef MLAN_PACK_START struct _IEEEtypes_Wpa_t { /** Data structure of WMM QoS information */ typedef MLAN_PACK_START struct _IEEEtypes_WmmQosInfo_t { +#ifdef BIG_ENDIAN_SUPPORT + /** QoS UAPSD */ + t_u8 qos_uapsd : 1; + /** Reserved */ + t_u8 reserved : 3; + /** Parameter set count */ + t_u8 para_set_count : 4; +#else /** Parameter set count */ t_u8 para_set_count : 4; /** Reserved */ t_u8 reserved : 3; /** QoS UAPSD */ t_u8 qos_uapsd : 1; +#endif /* BIG_ENDIAN_SUPPORT */ } MLAN_PACK_END IEEEtypes_WmmQosInfo_t, *pIEEEtypes_WmmQosInfo_t; /** Data structure of WMM Aci/Aifsn */ typedef MLAN_PACK_START struct _IEEEtypes_WmmAciAifsn_t { +#ifdef BIG_ENDIAN_SUPPORT + /** Reserved */ + t_u8 reserved : 1; + /** Aci */ + t_u8 aci : 2; + /** Acm */ + t_u8 acm : 1; + /** Aifsn */ + t_u8 aifsn : 4; +#else /** Aifsn */ t_u8 aifsn : 4; /** Acm */ @@ -574,14 +629,22 @@ typedef MLAN_PACK_START struct _IEEEtypes_WmmAciAifsn_t { t_u8 aci : 2; /** Reserved */ t_u8 reserved : 1; +#endif /* BIG_ENDIAN_SUPPORT */ } MLAN_PACK_END IEEEtypes_WmmAciAifsn_t, *pIEEEtypes_WmmAciAifsn_t; /** Data structure of WMM ECW */ typedef MLAN_PACK_START struct _IEEEtypes_WmmEcw_t { +#ifdef BIG_ENDIAN_SUPPORT + /** Maximum Ecw */ + t_u8 ecw_max : 4; + /** Minimum Ecw */ + t_u8 ecw_min : 4; +#else /** Minimum Ecw */ t_u8 ecw_min : 4; /** Maximum Ecw */ t_u8 ecw_max : 4; +#endif /* BIG_ENDIAN_SUPPORT */ } MLAN_PACK_END IEEEtypes_WmmEcw_t, *pIEEEtypes_WmmEcw_t; /** Data structure of WMM AC parameters */ @@ -669,6 +732,22 @@ typedef MLAN_PACK_START enum _IEEEtypes_WMM_TSPEC_TS_TRAFFIC_TYPE_e { /** Data structure of WMM TSPEC information */ typedef MLAN_PACK_START struct { +#ifdef BIG_ENDIAN_SUPPORT + t_u8 Reserved17_23 : 7; /* ! Reserved */ + t_u8 Schedule : 1; + IEEEtypes_WMM_TSPEC_TS_Info_AckPolicy_e AckPolicy : 2; + t_u8 UserPri : 3; /* ! 802.1d User Priority */ + // IEEEtypes_WMM_TSPEC_TS_Info_PSB_e PowerSaveBehavior : 1; /* + // !Legacy/Trigg*/ + t_u8 PowerSaveBehavior : 1; + t_u8 Aggregation : 1; /* ! Reserved */ + t_u8 AccessPolicy2 : 1; /* ! */ + t_u8 AccessPolicy1 : 1; /* ! */ + IEEEtypes_WMM_TSPEC_TS_Info_Direction_e Direction : 2; + t_u8 TID : 4; /* ! Unique identifier */ + // IEEEtypes_WMM_TSPEC_TS_TRAFFIC_TYPE_e TrafficType : 1; + t_u8 TrafficType : 1; +#else // IEEEtypes_WMM_TSPEC_TS_TRAFFIC_TYPE_e TrafficType : 1; t_u8 TrafficType : 1; t_u8 TID : 4; /* ! Unique identifier */ @@ -683,19 +762,31 @@ typedef MLAN_PACK_START struct { IEEEtypes_WMM_TSPEC_TS_Info_AckPolicy_e AckPolicy : 2; t_u8 Schedule : 1; t_u8 Reserved17_23 : 7; /* ! Reserved */ +#endif } MLAN_PACK_END IEEEtypes_WMM_TSPEC_TS_Info_t; /** Data structure of WMM TSPEC Nominal Size */ typedef MLAN_PACK_START struct { +#ifdef BIG_ENDIAN_SUPPORT + t_u16 Fixed : 1; /* ! 1: Fixed size given in Size, 0: Var, size is + nominal */ + t_u16 Size : 15; /* ! Nominal size in octets */ +#else t_u16 Size : 15; /* ! Nominal size in octets */ t_u16 Fixed : 1; /* ! 1: Fixed size given in Size, 0: Var, size is nominal */ +#endif } MLAN_PACK_END IEEEtypes_WMM_TSPEC_NomMSDUSize_t; /** Data structure of WMM TSPEC SBWA */ typedef MLAN_PACK_START struct { +#ifdef BIG_ENDIAN_SUPPORT + t_u16 Whole : 3; /* ! Whole portion */ + t_u16 Fractional : 13; /* ! Fractional portion */ +#else t_u16 Fractional : 13; /* ! Fractional portion */ t_u16 Whole : 3; /* ! Whole portion */ +#endif } MLAN_PACK_END IEEEtypes_WMM_TSPEC_SBWA; /** Data structure of WMM TSPEC Body */ @@ -1036,6 +1127,26 @@ typedef MLAN_PACK_START struct _VHT_MCS_set { /** VHT Capabilities info field, reference 802.11ac D1.4 p89 */ typedef MLAN_PACK_START struct _VHT_capa { #if 0 +#ifdef BIG_ENDIAN_SUPPORT + t_u8 mpdu_max_len:2; + t_u8 chan_width:2; + t_u8 rx_LDPC:1; + t_u8 sgi_80:1; + t_u8 sgi_160:1; + t_u8 tx_STBC:1; + t_u8 rx_STBC:3; + t_u8 SU_beamformer_capa:1; + t_u8 SU_beamformee_capa:1; + t_u8 beamformer_ante_num:3; + t_u8 sounding_dim_num:3; + t_u8 MU_beamformer_capa:1; + t_u8 MU_beamformee_capa:1; + t_u8 VHT_TXOP_ps:1; + t_u8 HTC_VHT_capa:1; + t_u8 max_ampdu_len:3; + t_u8 link_apapt_capa:2; + t_u8 reserved_1:4; +#else t_u8 reserved_1:4; t_u8 link_apapt_capa:2; t_u8 max_ampdu_len:3; @@ -1054,6 +1165,7 @@ typedef MLAN_PACK_START struct _VHT_capa { t_u8 rx_LDPC:1; t_u8 chan_width:2; t_u8 mpdu_max_len:2; +#endif /* BIG_ENDIAN_SUPPORT */ #endif t_u32 vht_cap_info; VHT_MCS_set_t mcs_sets; @@ -1162,6 +1274,24 @@ typedef MLAN_PACK_START struct _IEEEtypes_Extension_t { } MLAN_PACK_END IEEEtypes_Extension_t, *pIEEEtypes_Extension_t; typedef MLAN_PACK_START struct _IEEEtypes_HeMcsMap_t { +#ifdef BIG_ENDIAN_SUPPORT + /** Max HE-MAC for 8 SS */ + t_u8 max_mcs_8ss : 2; + /** Max HE-MAC for 7 SS */ + t_u8 max_mcs_7ss : 2; + /** Max HE-MAC for 6 SS */ + t_u8 max_mcs_6ss : 2; + /** Max HE-MAC for 5 SS */ + t_u8 max_mcs_5ss : 2; + /** Max HE-MAC for 4 SS */ + t_u8 max_mcs_4ss : 2; + /** Max HE-MAC for 3 SS */ + t_u8 max_mcs_3ss : 2; + /** Max HE-MAC for 2 SS */ + t_u8 max_mcs_2ss : 2; + /** Max HE-MAC for 1 SS */ + t_u8 max_mcs_1ss : 2; +#else /** Max HE-MAC for 1 SS */ t_u8 max_mcs_1ss : 2; /** Max HE-MAC for 2 SS */ @@ -1178,6 +1308,7 @@ typedef MLAN_PACK_START struct _IEEEtypes_HeMcsMap_t { t_u8 max_mcs_7ss : 2; /** Max HE-MAC for 8 SS */ t_u8 max_mcs_8ss : 2; +#endif } MLAN_PACK_END IEEEtypes_HeMcsMap_t, *pIEEEtypes_HeMcsMap_t; typedef MLAN_PACK_START struct _IEEEtypes_HeMcsNss_t { @@ -1204,6 +1335,24 @@ typedef MLAN_PACK_START struct _IEEEtypes_HECap_t { } MLAN_PACK_END IEEEtypes_HECap_t, *pIEEEtypes_HECap_t; typedef MLAN_PACK_START struct _IEEEtypes_HeOpParam_t { +#ifdef BIG_ENDIAN_SUPPORT + /** Reserved, including 6G Operation Info Pressent (bit17) */ + t_u8 reserved : 6; /* bit 18-23 */ + /* 6g operation info present */ + t_u8 he_6g_op_info_present : 1; /* bit 17 */ + /** ER SU Disable */ + t_u8 er_su_disable : 1; /* bit 16 */ + /** Co-Hosted BSS */ + t_u16 co_located_bss : 1; /* bit 15 */ + /** VHT Operation Info Present */ + t_u16 vht_op_info_present : 1; /* bit 14 */ + /** TXOP Duration RTS Threshold */ + t_u16 txop_dur_rts_threshold : 10; /* bit 4-13 */ + /** TWT Required */ + t_u16 twt_req : 1; /* bit 3 */ + /** Default PE Duration */ + t_u16 default_pe_dur : 3; /* bit 0-2 */ +#else /** Default PE Duration */ t_u16 default_pe_dur : 3; /* bit 0-2 */ /** TWT Required */ @@ -1220,15 +1369,25 @@ typedef MLAN_PACK_START struct _IEEEtypes_HeOpParam_t { t_u8 he_6g_op_info_present : 1; /* bit 17 */ /** Reserved bit 18-23 */ t_u8 reserved : 6; /* bit 18-23 */ +#endif } MLAN_PACK_END IEEEtypes_HeOpParam_t; typedef MLAN_PACK_START struct _IEEEtypes_HeBssColorInfo_t { +#ifdef BIG_ENDIAN_SUPPORT + /** BSS Color Disabled */ + t_u8 bss_color_disabled : 1; /* bit 7 */ + /** Partial BSS Color */ + t_u8 partial_bss_color : 1; /* bit 6 */ + /** BSS Color */ + t_u8 bss_color : 6; /* bit 0-5 */ +#else /** BSS Color */ t_u8 bss_color : 6; /* bit 0-5 */ /** Partial BSS Color */ t_u8 partial_bss_color : 1; /* bit 6 */ /** BSS Color Disabled */ t_u8 bss_color_disabled : 1; /* bit 7 */ +#endif } MLAN_PACK_END IEEEtypes_HeBssColorInfo_t; typedef MLAN_PACK_START struct _IEEEtypes_HeOp_t { @@ -1390,6 +1549,20 @@ typedef MLAN_PACK_START struct { *** @brief Map octet of the basic measurement report (7.3.2.22.1) **/ typedef MLAN_PACK_START struct { +#ifdef BIG_ENDIAN_SUPPORT + /**< Reserved */ + t_u8 rsvd5_7 : 3; + /**< Channel is unmeasured */ + t_u8 unmeasured : 1; + /**< Radar detected on channel */ + t_u8 radar : 1; + /**< Unidentified signal found on channel */ + t_u8 unidentified_sig : 1; + /**< OFDM preamble detected on channel */ + t_u8 ofdm_preamble : 1; + /**< At least one valid MPDU received on channel */ + t_u8 bss : 1; +#else /**< At least one valid MPDU received on channel */ t_u8 bss : 1; /**< OFDM preamble detected on channel */ @@ -1402,6 +1575,7 @@ typedef MLAN_PACK_START struct { t_u8 unmeasured : 1; /**< Reserved */ t_u8 rsvd5_7 : 3; +#endif /* BIG_ENDIAN_SUPPORT */ } MLAN_PACK_END MeasRptBasicMap_t; diff --git a/mxm_wifiex/wlan_src/mlan/mlan_init.h b/mxm_wifiex/wlan_src/mlan/mlan_init.h index 4a9022a..65e8259 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_init.h +++ b/mxm_wifiex/wlan_src/mlan/mlan_init.h @@ -104,9 +104,22 @@ typedef MLAN_PACK_START struct _FWSyncPkt { t_u32 fw_ready; } MLAN_PACK_END FWSyncPkt; +#ifdef BIG_ENDIAN_SUPPORT +/** Convert sequence number and command fields + * of fwheader to correct endian format + */ +#define endian_convert_syncfwheader(x) \ + { \ + (x)->cmd = wlan_le32_to_cpu((x)->cmd); \ + (x)->seq_num = wlan_le32_to_cpu((x)->seq_num); \ + (x)->status = wlan_le32_to_cpu((x)->status); \ + (x)->offset = wlan_le32_to_cpu((x)->offset); \ + } +#else /** Convert sequence number and command fields * of fwheader to correct endian format */ #define endian_convert_syncfwheader(x) +#endif /* BIG_ENDIAN_SUPPORT */ #endif /* _MLAN_INIT_H_ */ diff --git a/mxm_wifiex/wlan_src/mlan/mlan_ioctl.h b/mxm_wifiex/wlan_src/mlan/mlan_ioctl.h index b9192ab..b09307d 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_ioctl.h +++ b/mxm_wifiex/wlan_src/mlan/mlan_ioctl.h @@ -770,14 +770,31 @@ typedef struct _mlan_ssid_bssid { /** Data structure of WMM ECW */ typedef struct _wmm_ecw_t { +#ifdef BIG_ENDIAN_SUPPORT + /** Maximum Ecw */ + t_u8 ecw_max : 4; + /** Minimum Ecw */ + t_u8 ecw_min : 4; +#else /** Minimum Ecw */ t_u8 ecw_min : 4; /** Maximum Ecw */ t_u8 ecw_max : 4; +#endif /* BIG_ENDIAN_SUPPORT */ } wmm_ecw_t, *pwmm_ecw_t; /** Data structure of WMM Aci/Aifsn */ typedef struct _wmm_aci_aifsn_t { +#ifdef BIG_ENDIAN_SUPPORT + /** Reserved */ + t_u8 reserved : 1; + /** Aci */ + t_u8 aci : 2; + /** Acm */ + t_u8 acm : 1; + /** Aifsn */ + t_u8 aifsn : 4; +#else /** Aifsn */ t_u8 aifsn : 4; /** Acm */ @@ -786,6 +803,7 @@ typedef struct _wmm_aci_aifsn_t { t_u8 aci : 2; /** Reserved */ t_u8 reserved : 1; +#endif /* BIG_ENDIAN_SUPPORT */ } wmm_aci_aifsn_t, *pwmm_aci_aifsn_t; /** Data structure of WMM AC parameters */ @@ -992,12 +1010,21 @@ typedef struct _wep_param { /** Data structure of WMM QoS information */ typedef struct _wmm_qos_info_t { +#ifdef BIG_ENDIAN_SUPPORT + /** QoS UAPSD */ + t_u8 qos_uapsd : 1; + /** Reserved */ + t_u8 reserved : 3; + /** Parameter set count */ + t_u8 para_set_count : 4; +#else /** Parameter set count */ t_u8 para_set_count : 4; /** Reserved */ t_u8 reserved : 3; /** QoS UAPSD */ t_u8 qos_uapsd : 1; +#endif /* BIG_ENDIAN_SUPPORT */ } wmm_qos_info_t, *pwmm_qos_info_t; /** Data structure of WMM parameter IE */ @@ -1913,6 +1940,100 @@ typedef struct _mlan_ver_ext { char version_str[MLAN_MAX_VER_STR_LEN]; } mlan_ver_ext, *pmlan_ver_ext; +#ifdef BIG_ENDIAN_SUPPORT +/** Extended Capabilities Data */ +typedef struct MLAN_PACK_START _ExtCap_t { + /** Extended Capabilities value */ + t_u8 rsvdBit87 : 1; /* bit 87 */ + t_u8 rsvdBit86 : 1; /* bit 86 */ + t_u8 rsvdBit85 : 1; /* bit 85 */ + t_u8 beacon_prot : 1; /* bit 84 */ + t_u8 rsvdBit83 : 1; /* bit 83 */ + t_u8 rsvdBit82 : 1; /* bit 82 */ + t_u8 rsvdBit81 : 1; /* bit 81 */ + t_u8 rsvdBit80 : 1; /* bit 80 */ + t_u8 rsvdBit79 : 1; /* bit 79 */ + t_u8 TWTResp : 1; /* bit 78 */ + t_u8 TWTReq : 1; /* bit 77 */ + t_u8 rsvdBit76 : 1; /* bit 76 */ + t_u8 rsvdBit75 : 1; /* bit 75 */ + t_u8 rsvdBit74 : 1; /* bit 74 */ + t_u8 rsvdBit73 : 1; /* bit 73 */ + t_u8 FILS : 1; /* bit 72 */ + t_u8 FTMI : 1; /* bit 71 */ + t_u8 FTMR : 1; /* bit 70 */ + t_u8 CAQ : 1; /* bit 69 */ + t_u8 rsvdBit68 : 1; /* bit 68 */ + t_u8 NCC : 1; /* bit 67 */ + t_u8 rsvdBit66 : 1; /* bit 66 */ + t_u8 chanSchedMgnt : 1; /* bit 65 */ + t_u8 MaxAMSDU1 : 1; /* bit 64 */ + t_u8 MaxAMSDU0 : 1; /* bit 63 */ + t_u8 OperModeNtf : 1; /* bit 62 */ + t_u8 TDLSWildBandwidth : 1; /* bit 61 */ + t_u8 rsvdBit60 : 1; /* bit 60 */ + t_u8 rsvdBit59 : 1; /* bit 59 */ + t_u8 rsvdBit58 : 1; /* bit 58 */ + t_u8 rsvdBit57 : 1; /* bit 57 */ + t_u8 rsvdBit56 : 1; /* bit 56 */ + t_u8 rsvdBit55 : 1; /* bit 55 */ + t_u8 rsvdBit54 : 1; /* bit 54 */ + t_u8 rsvdBit53 : 1; /* bit 53 */ + t_u8 rsvdBit52 : 1; /* bit 52 */ + t_u8 rsvdBit51 : 1; /* bit 51 */ + t_u8 rsvdBit50 : 1; /* bit 50 */ + t_u8 rsvdBit49 : 1; /* bit 49 */ + t_u8 rsvdBit48 : 1; /* bit 48 */ + t_u8 rsvdBit47 : 1; /* bit 47 */ + t_u8 rsvdBit46 : 1; /* bit 46 */ + t_u8 rsvdBit45 : 1; /* bit 45 */ + t_u8 rsvdBit44 : 1; /* bit 44 */ + t_u8 rsvdBit43 : 1; /* bit 43 */ + t_u8 rsvdBit42 : 1; /* bit 42 */ + t_u8 rsvdBit41 : 1; /* bit 41 */ + t_u8 rsvdBit40 : 1; /* bit 40 */ + t_u8 TDLSChlSwitchProhib : 1; /* bit 39 */ + t_u8 TDLSProhibited : 1; /* bit 38 */ + t_u8 TDLSSupport : 1; /* bit 37 */ + t_u8 MSGCF_Capa : 1; /* bit 36 */ + t_u8 Reserved35 : 1; /* bit 35 */ + t_u8 SSPN_Interface : 1; /* bit 34 */ + t_u8 EBR : 1; /* bit 33 */ + t_u8 Qos_Map : 1; /* bit 32 */ + t_u8 Interworking : 1; /* bit 31 */ + t_u8 TDLSChannelSwitching : 1; /* bit 30 */ + t_u8 TDLSPeerPSMSupport : 1; /* bit 29 */ + t_u8 TDLSPeerUAPSDSupport : 1; /* bit 28 */ + t_u8 UTC : 1; /* bit 27 */ + t_u8 DMS : 1; /* bit 26 */ + t_u8 SSID_List : 1; /* bit 25 */ + t_u8 ChannelUsage : 1; /* bit 24 */ + t_u8 TimingMeasurement : 1; /* bit 23 */ + t_u8 MultipleBSSID : 1; /* bit 22 */ + t_u8 AC_StationCount : 1; /* bit 21 */ + t_u8 QoSTrafficCap : 1; /* bit 20 */ + t_u8 BSS_Transition : 1; /* bit 19 */ + t_u8 TIM_Broadcast : 1; /* bit 18 */ + t_u8 WNM_Sleep : 1; /* bit 17 */ + t_u8 TFS : 1; /* bit 16 */ + t_u8 GeospatialLocation : 1; /* bit 15 */ + t_u8 CivicLocation : 1; /* bit 14 */ + t_u8 CollocatedIntf : 1; /* bit 13 */ + t_u8 ProxyARPService : 1; /* bit 12 */ + t_u8 FMS : 1; /* bit 11 */ + t_u8 LocationTracking : 1; /* bit 10 */ + t_u8 MulticastDiagnostics : 1; /* bit 9 */ + t_u8 Diagnostics : 1; /* bit 8 */ + t_u8 Event : 1; /* bit 7 */ + t_u8 SPSMP_Support : 1; /* bit 6 */ + t_u8 Reserved5 : 1; /* bit 5 */ + t_u8 PSMP_Capable : 1; /* bit 4 */ + t_u8 RejectUnadmFrame : 1; /* bit 3 */ + t_u8 ExtChanSwitching : 1; /* bit 2 */ + t_u8 Reserved1 : 1; /* bit 1 */ + t_u8 BSS_CoexistSupport : 1; /* bit 0 */ +} MLAN_PACK_END ExtCap_t, *pExtCap_t; +#else /** Extended Capabilities Data */ typedef struct MLAN_PACK_START _ExtCap_t { /** Extended Capabilities value */ @@ -2005,6 +2126,7 @@ typedef struct MLAN_PACK_START _ExtCap_t { t_u8 rsvdBit86 : 1; /* bit 86 */ t_u8 rsvdBit87 : 1; /* bit 87 */ } MLAN_PACK_END ExtCap_t, *pExtCap_t; +#endif /** ExtCap : TDLS prohibited */ #define IS_EXTCAP_TDLS_PROHIBITED(ext_cap) (ext_cap.TDLSProhibited) diff --git a/mxm_wifiex/wlan_src/mlan/mlan_main.h b/mxm_wifiex/wlan_src/mlan/mlan_main.h index a7daad9..5f730db 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_main.h +++ b/mxm_wifiex/wlan_src/mlan/mlan_main.h @@ -308,6 +308,55 @@ extern t_u32 mlan_drvdbg; (t_u64)(((t_u64)(x)&0x00ff000000000000ULL) >> 40) | \ (t_u64)(((t_u64)(x)&0xff00000000000000ULL) >> 56))) +#ifdef BIG_ENDIAN_SUPPORT +/** Convert ulong n/w to host */ +#define mlan_ntohl(x) x +/** Convert host ulong to n/w */ +#define mlan_htonl(x) x +/** Convert n/w to host */ +#define mlan_ntohs(x) x +/** Convert host to n/w */ +#define mlan_htons(x) x +/** Convert from 16 bit little endian format to CPU format */ +#define wlan_le16_to_cpu(x) swap_byte_16(x) +/** Convert from 32 bit little endian format to CPU format */ +#define wlan_le32_to_cpu(x) swap_byte_32(x) +/** Convert from 64 bit little endian format to CPU format */ +#define wlan_le64_to_cpu(x) swap_byte_64(x) +/** Convert to 16 bit little endian format from CPU format */ +#define wlan_cpu_to_le16(x) swap_byte_16(x) +/** Convert to 32 bit little endian format from CPU format */ +#define wlan_cpu_to_le32(x) swap_byte_32(x) +/** Convert to 64 bit little endian format from CPU format */ +#define wlan_cpu_to_le64(x) swap_byte_64(x) + +/** Convert TxPD to little endian format from CPU format */ +#define endian_convert_TxPD(x) \ + { \ + (x)->tx_pkt_length = wlan_cpu_to_le16((x)->tx_pkt_length); \ + (x)->tx_pkt_offset = wlan_cpu_to_le16((x)->tx_pkt_offset); \ + (x)->tx_pkt_type = wlan_cpu_to_le16((x)->tx_pkt_type); \ + (x)->tx_control = wlan_cpu_to_le32((x)->tx_control); \ + (x)->tx_control_1 = wlan_cpu_to_le32((x)->tx_control_1); \ + } +/** Convert RxPD from little endian format to CPU format */ +#define endian_convert_RxPD(x) \ + { \ + (x)->rx_pkt_length = wlan_le16_to_cpu((x)->rx_pkt_length); \ + (x)->rx_pkt_offset = wlan_le16_to_cpu((x)->rx_pkt_offset); \ + (x)->rx_pkt_type = wlan_le16_to_cpu((x)->rx_pkt_type); \ + (x)->seq_num = wlan_le16_to_cpu((x)->seq_num); \ + (x)->rx_info = wlan_le32_to_cpu((x)->rx_info); +} + +/** Convert RxPD extra header from little endian format to CPU format */ +#define endian_convert_RxPD_extra_header(x) \ + do { \ + (x)->channel_flags = wlan_le16_to_cpu((x)->channel_flags); \ + (x)->vht_sig1 = wlan_le32_to_cpu((x)->vht_sig1); \ + (x)->vht_sig2 = wlan_le32_to_cpu((x)->vht_sig2); \ + } while (0) +#else /** Convert ulong n/w to host */ #define mlan_ntohl(x) swap_byte_32(x) /** Convert host ulong to n/w */ @@ -341,6 +390,7 @@ extern t_u32 mlan_drvdbg; #define endian_convert_RxPD_extra_header(x) \ do { \ } while (0) +#endif /* BIG_ENDIAN_SUPPORT */ /** Global moal_assert_callback */ extern t_void (*assert_callback)(t_void *pmoal_handle, t_u32 cond); diff --git a/mxm_wifiex/wlan_src/mlinux/mlan_decl.h b/mxm_wifiex/wlan_src/mlinux/mlan_decl.h index 2236e5a..e9c41a6 100644 --- a/mxm_wifiex/wlan_src/mlinux/mlan_decl.h +++ b/mxm_wifiex/wlan_src/mlinux/mlan_decl.h @@ -24,7 +24,7 @@ #define _MLAN_DECL_H_ /** MLAN release version */ -#define MLAN_RELEASE_VERSION "362" +#define MLAN_RELEASE_VERSION "366" /** Re-define generic data types for MLAN/MOAL */ /** Signed char (1-byte) */ @@ -967,6 +967,16 @@ typedef enum _dfs_moe_t { /** Band_Config_t */ typedef MLAN_PACK_START struct _Band_Config_t { +#ifdef BIG_ENDIAN_SUPPORT + /** Channel Selection Mode - (00)=manual, (01)=ACS, (02)=user*/ + t_u8 scanMode : 2; + /** Secondary Channel Offset - (00)=None, (01)=Above, (11)=Below */ + t_u8 chan2Offset : 2; + /** Channel Width - (00)=20MHz, (10)=40MHz, (11)=80MHz */ + t_u8 chanWidth : 2; + /** Band Info - (00)=2.4GHz, (01)=5GHz */ + t_u8 chanBand : 2; +#else /** Band Info - (00)=2.4GHz, (01)=5GHz */ t_u8 chanBand : 2; /** Channel Width - (00)=20MHz, (10)=40MHz, (11)=80MHz */ @@ -975,6 +985,7 @@ typedef MLAN_PACK_START struct _Band_Config_t { t_u8 chan2Offset : 2; /** Channel Selection Mode - (00)=manual, (01)=ACS, (02)=Adoption mode*/ t_u8 scanMode : 2; +#endif } MLAN_PACK_END Band_Config_t; /** channel_band_t */ @@ -1176,6 +1187,16 @@ typedef MLAN_PACK_START struct _radiotap_info { /** txpower structure */ typedef MLAN_PACK_START struct { +#ifdef BIG_ENDIAN_SUPPORT + /** Host tx power ctrl: + 0x0: use fw setting for TX power + 0x1: value specified in bit[6] and bit[5:0] are valid */ + t_u8 hostctl : 1; + /** Sign of the power specified in bit[5:0] */ + t_u8 sign : 1; + /** Power to be used for transmission(in dBm) */ + t_u8 abs_val : 6; +#else /** Power to be used for transmission(in dBm) */ t_u8 abs_val : 6; /** Sign of the power specified in bit[5:0] */ @@ -1184,6 +1205,7 @@ typedef MLAN_PACK_START struct { 0x0: use fw setting for TX power 0x1: value specified in bit[6] and bit[5:0] are valid */ t_u8 hostctl : 1; +#endif } MLAN_PACK_END tx_power_t; /* pkt_txctrl */ typedef MLAN_PACK_START struct _pkt_txctrl { diff --git a/mxm_wifiex/wlan_src/mlinux/mlan_ieee.h b/mxm_wifiex/wlan_src/mlinux/mlan_ieee.h index d8384ad..d9a2ce7 100644 --- a/mxm_wifiex/wlan_src/mlinux/mlan_ieee.h +++ b/mxm_wifiex/wlan_src/mlinux/mlan_ieee.h @@ -46,10 +46,17 @@ typedef enum _WLAN_802_11_NETWORK_TYPE { Wlan802_11NetworkTypeMax } WLAN_802_11_NETWORK_TYPE; +#ifdef BIG_ENDIAN_SUPPORT +/** Frame control: Type Mgmt frame */ +#define IEEE80211_FC_MGMT_FRAME_TYPE_MASK 0x3000 +/** Frame control: SubType Mgmt frame */ +#define IEEE80211_GET_FC_MGMT_FRAME_SUBTYPE(fc) (((fc)&0xF000) >> 12) +#else /** Frame control: Type Mgmt frame */ #define IEEE80211_FC_MGMT_FRAME_TYPE_MASK 0x000C /** Frame control: SubType Mgmt frame */ #define IEEE80211_GET_FC_MGMT_FRAME_SUBTYPE(fc) (((fc)&0x00F0) >> 4) +#endif #ifdef PRAGMA_PACK #pragma pack(push, 1) @@ -172,12 +179,21 @@ typedef MLAN_PACK_START struct _IEEEtypes_Generic_t { /**ft capability policy*/ typedef MLAN_PACK_START struct _IEEEtypes_FtCapPolicy_t { +#ifdef BIG_ENDIAN_SUPPORT + /** Reserved */ + t_u8 reserved : 6; + /** RIC support */ + t_u8 ric : 1; + /** FT over the DS capable */ + t_u8 ft_over_ds : 1; +#else /** FT over the DS capable */ t_u8 ft_over_ds : 1; /** RIC support */ t_u8 ric : 1; /** Reserved */ t_u8 reserved : 6; +#endif } MLAN_PACK_END IEEEtypes_FtCapPolicy_t; /** Mobility domain IE */ @@ -310,6 +326,25 @@ typedef MLAN_PACK_START struct _TLV_Generic_t { #define CAPINFO_MASK (~(MBIT(15) | MBIT(14) | MBIT(11) | MBIT(9))) /** Capability Bit Map*/ +#ifdef BIG_ENDIAN_SUPPORT +typedef MLAN_PACK_START struct _IEEEtypes_CapInfo_t { + t_u8 rsrvd1 : 2; + t_u8 dsss_ofdm : 1; + t_u8 radio_measurement : 1; + t_u8 rsvrd2 : 1; + t_u8 short_slot_time : 1; + t_u8 rsrvd3 : 1; + t_u8 spectrum_mgmt : 1; + t_u8 chan_agility : 1; + t_u8 pbcc : 1; + t_u8 short_preamble : 1; + t_u8 privacy : 1; + t_u8 cf_poll_rqst : 1; + t_u8 cf_pollable : 1; + t_u8 ibss : 1; + t_u8 ess : 1; +} MLAN_PACK_END IEEEtypes_CapInfo_t, *pIEEEtypes_CapInfo_t; +#else typedef MLAN_PACK_START struct _IEEEtypes_CapInfo_t { /** Capability Bit Map : ESS */ t_u8 ess : 1; @@ -342,6 +377,7 @@ typedef MLAN_PACK_START struct _IEEEtypes_CapInfo_t { /** Capability Bit Map : Reserved */ t_u8 rsrvd1 : 2; } MLAN_PACK_END IEEEtypes_CapInfo_t, *pIEEEtypes_CapInfo_t; +#endif /* BIG_ENDIAN_SUPPORT */ /** IEEEtypes_Ssid_t */ typedef MLAN_PACK_START struct _IEEEtypes_Ssid_t { @@ -556,16 +592,35 @@ typedef MLAN_PACK_START struct _IEEEtypes_Wpa_t { /** Data structure of WMM QoS information */ typedef MLAN_PACK_START struct _IEEEtypes_WmmQosInfo_t { +#ifdef BIG_ENDIAN_SUPPORT + /** QoS UAPSD */ + t_u8 qos_uapsd : 1; + /** Reserved */ + t_u8 reserved : 3; + /** Parameter set count */ + t_u8 para_set_count : 4; +#else /** Parameter set count */ t_u8 para_set_count : 4; /** Reserved */ t_u8 reserved : 3; /** QoS UAPSD */ t_u8 qos_uapsd : 1; +#endif /* BIG_ENDIAN_SUPPORT */ } MLAN_PACK_END IEEEtypes_WmmQosInfo_t, *pIEEEtypes_WmmQosInfo_t; /** Data structure of WMM Aci/Aifsn */ typedef MLAN_PACK_START struct _IEEEtypes_WmmAciAifsn_t { +#ifdef BIG_ENDIAN_SUPPORT + /** Reserved */ + t_u8 reserved : 1; + /** Aci */ + t_u8 aci : 2; + /** Acm */ + t_u8 acm : 1; + /** Aifsn */ + t_u8 aifsn : 4; +#else /** Aifsn */ t_u8 aifsn : 4; /** Acm */ @@ -574,14 +629,22 @@ typedef MLAN_PACK_START struct _IEEEtypes_WmmAciAifsn_t { t_u8 aci : 2; /** Reserved */ t_u8 reserved : 1; +#endif /* BIG_ENDIAN_SUPPORT */ } MLAN_PACK_END IEEEtypes_WmmAciAifsn_t, *pIEEEtypes_WmmAciAifsn_t; /** Data structure of WMM ECW */ typedef MLAN_PACK_START struct _IEEEtypes_WmmEcw_t { +#ifdef BIG_ENDIAN_SUPPORT + /** Maximum Ecw */ + t_u8 ecw_max : 4; + /** Minimum Ecw */ + t_u8 ecw_min : 4; +#else /** Minimum Ecw */ t_u8 ecw_min : 4; /** Maximum Ecw */ t_u8 ecw_max : 4; +#endif /* BIG_ENDIAN_SUPPORT */ } MLAN_PACK_END IEEEtypes_WmmEcw_t, *pIEEEtypes_WmmEcw_t; /** Data structure of WMM AC parameters */ @@ -669,6 +732,22 @@ typedef MLAN_PACK_START enum _IEEEtypes_WMM_TSPEC_TS_TRAFFIC_TYPE_e { /** Data structure of WMM TSPEC information */ typedef MLAN_PACK_START struct { +#ifdef BIG_ENDIAN_SUPPORT + t_u8 Reserved17_23 : 7; /* ! Reserved */ + t_u8 Schedule : 1; + IEEEtypes_WMM_TSPEC_TS_Info_AckPolicy_e AckPolicy : 2; + t_u8 UserPri : 3; /* ! 802.1d User Priority */ + // IEEEtypes_WMM_TSPEC_TS_Info_PSB_e PowerSaveBehavior : 1; /* + // !Legacy/Trigg*/ + t_u8 PowerSaveBehavior : 1; + t_u8 Aggregation : 1; /* ! Reserved */ + t_u8 AccessPolicy2 : 1; /* ! */ + t_u8 AccessPolicy1 : 1; /* ! */ + IEEEtypes_WMM_TSPEC_TS_Info_Direction_e Direction : 2; + t_u8 TID : 4; /* ! Unique identifier */ + // IEEEtypes_WMM_TSPEC_TS_TRAFFIC_TYPE_e TrafficType : 1; + t_u8 TrafficType : 1; +#else // IEEEtypes_WMM_TSPEC_TS_TRAFFIC_TYPE_e TrafficType : 1; t_u8 TrafficType : 1; t_u8 TID : 4; /* ! Unique identifier */ @@ -683,19 +762,31 @@ typedef MLAN_PACK_START struct { IEEEtypes_WMM_TSPEC_TS_Info_AckPolicy_e AckPolicy : 2; t_u8 Schedule : 1; t_u8 Reserved17_23 : 7; /* ! Reserved */ +#endif } MLAN_PACK_END IEEEtypes_WMM_TSPEC_TS_Info_t; /** Data structure of WMM TSPEC Nominal Size */ typedef MLAN_PACK_START struct { +#ifdef BIG_ENDIAN_SUPPORT + t_u16 Fixed : 1; /* ! 1: Fixed size given in Size, 0: Var, size is + nominal */ + t_u16 Size : 15; /* ! Nominal size in octets */ +#else t_u16 Size : 15; /* ! Nominal size in octets */ t_u16 Fixed : 1; /* ! 1: Fixed size given in Size, 0: Var, size is nominal */ +#endif } MLAN_PACK_END IEEEtypes_WMM_TSPEC_NomMSDUSize_t; /** Data structure of WMM TSPEC SBWA */ typedef MLAN_PACK_START struct { +#ifdef BIG_ENDIAN_SUPPORT + t_u16 Whole : 3; /* ! Whole portion */ + t_u16 Fractional : 13; /* ! Fractional portion */ +#else t_u16 Fractional : 13; /* ! Fractional portion */ t_u16 Whole : 3; /* ! Whole portion */ +#endif } MLAN_PACK_END IEEEtypes_WMM_TSPEC_SBWA; /** Data structure of WMM TSPEC Body */ @@ -1036,6 +1127,26 @@ typedef MLAN_PACK_START struct _VHT_MCS_set { /** VHT Capabilities info field, reference 802.11ac D1.4 p89 */ typedef MLAN_PACK_START struct _VHT_capa { #if 0 +#ifdef BIG_ENDIAN_SUPPORT + t_u8 mpdu_max_len:2; + t_u8 chan_width:2; + t_u8 rx_LDPC:1; + t_u8 sgi_80:1; + t_u8 sgi_160:1; + t_u8 tx_STBC:1; + t_u8 rx_STBC:3; + t_u8 SU_beamformer_capa:1; + t_u8 SU_beamformee_capa:1; + t_u8 beamformer_ante_num:3; + t_u8 sounding_dim_num:3; + t_u8 MU_beamformer_capa:1; + t_u8 MU_beamformee_capa:1; + t_u8 VHT_TXOP_ps:1; + t_u8 HTC_VHT_capa:1; + t_u8 max_ampdu_len:3; + t_u8 link_apapt_capa:2; + t_u8 reserved_1:4; +#else t_u8 reserved_1:4; t_u8 link_apapt_capa:2; t_u8 max_ampdu_len:3; @@ -1054,6 +1165,7 @@ typedef MLAN_PACK_START struct _VHT_capa { t_u8 rx_LDPC:1; t_u8 chan_width:2; t_u8 mpdu_max_len:2; +#endif /* BIG_ENDIAN_SUPPORT */ #endif t_u32 vht_cap_info; VHT_MCS_set_t mcs_sets; @@ -1162,6 +1274,24 @@ typedef MLAN_PACK_START struct _IEEEtypes_Extension_t { } MLAN_PACK_END IEEEtypes_Extension_t, *pIEEEtypes_Extension_t; typedef MLAN_PACK_START struct _IEEEtypes_HeMcsMap_t { +#ifdef BIG_ENDIAN_SUPPORT + /** Max HE-MAC for 8 SS */ + t_u8 max_mcs_8ss : 2; + /** Max HE-MAC for 7 SS */ + t_u8 max_mcs_7ss : 2; + /** Max HE-MAC for 6 SS */ + t_u8 max_mcs_6ss : 2; + /** Max HE-MAC for 5 SS */ + t_u8 max_mcs_5ss : 2; + /** Max HE-MAC for 4 SS */ + t_u8 max_mcs_4ss : 2; + /** Max HE-MAC for 3 SS */ + t_u8 max_mcs_3ss : 2; + /** Max HE-MAC for 2 SS */ + t_u8 max_mcs_2ss : 2; + /** Max HE-MAC for 1 SS */ + t_u8 max_mcs_1ss : 2; +#else /** Max HE-MAC for 1 SS */ t_u8 max_mcs_1ss : 2; /** Max HE-MAC for 2 SS */ @@ -1178,6 +1308,7 @@ typedef MLAN_PACK_START struct _IEEEtypes_HeMcsMap_t { t_u8 max_mcs_7ss : 2; /** Max HE-MAC for 8 SS */ t_u8 max_mcs_8ss : 2; +#endif } MLAN_PACK_END IEEEtypes_HeMcsMap_t, *pIEEEtypes_HeMcsMap_t; typedef MLAN_PACK_START struct _IEEEtypes_HeMcsNss_t { @@ -1204,6 +1335,24 @@ typedef MLAN_PACK_START struct _IEEEtypes_HECap_t { } MLAN_PACK_END IEEEtypes_HECap_t, *pIEEEtypes_HECap_t; typedef MLAN_PACK_START struct _IEEEtypes_HeOpParam_t { +#ifdef BIG_ENDIAN_SUPPORT + /** Reserved, including 6G Operation Info Pressent (bit17) */ + t_u8 reserved : 6; /* bit 18-23 */ + /* 6g operation info present */ + t_u8 he_6g_op_info_present : 1; /* bit 17 */ + /** ER SU Disable */ + t_u8 er_su_disable : 1; /* bit 16 */ + /** Co-Hosted BSS */ + t_u16 co_located_bss : 1; /* bit 15 */ + /** VHT Operation Info Present */ + t_u16 vht_op_info_present : 1; /* bit 14 */ + /** TXOP Duration RTS Threshold */ + t_u16 txop_dur_rts_threshold : 10; /* bit 4-13 */ + /** TWT Required */ + t_u16 twt_req : 1; /* bit 3 */ + /** Default PE Duration */ + t_u16 default_pe_dur : 3; /* bit 0-2 */ +#else /** Default PE Duration */ t_u16 default_pe_dur : 3; /* bit 0-2 */ /** TWT Required */ @@ -1220,15 +1369,25 @@ typedef MLAN_PACK_START struct _IEEEtypes_HeOpParam_t { t_u8 he_6g_op_info_present : 1; /* bit 17 */ /** Reserved bit 18-23 */ t_u8 reserved : 6; /* bit 18-23 */ +#endif } MLAN_PACK_END IEEEtypes_HeOpParam_t; typedef MLAN_PACK_START struct _IEEEtypes_HeBssColorInfo_t { +#ifdef BIG_ENDIAN_SUPPORT + /** BSS Color Disabled */ + t_u8 bss_color_disabled : 1; /* bit 7 */ + /** Partial BSS Color */ + t_u8 partial_bss_color : 1; /* bit 6 */ + /** BSS Color */ + t_u8 bss_color : 6; /* bit 0-5 */ +#else /** BSS Color */ t_u8 bss_color : 6; /* bit 0-5 */ /** Partial BSS Color */ t_u8 partial_bss_color : 1; /* bit 6 */ /** BSS Color Disabled */ t_u8 bss_color_disabled : 1; /* bit 7 */ +#endif } MLAN_PACK_END IEEEtypes_HeBssColorInfo_t; typedef MLAN_PACK_START struct _IEEEtypes_HeOp_t { @@ -1390,6 +1549,20 @@ typedef MLAN_PACK_START struct { *** @brief Map octet of the basic measurement report (7.3.2.22.1) **/ typedef MLAN_PACK_START struct { +#ifdef BIG_ENDIAN_SUPPORT + /**< Reserved */ + t_u8 rsvd5_7 : 3; + /**< Channel is unmeasured */ + t_u8 unmeasured : 1; + /**< Radar detected on channel */ + t_u8 radar : 1; + /**< Unidentified signal found on channel */ + t_u8 unidentified_sig : 1; + /**< OFDM preamble detected on channel */ + t_u8 ofdm_preamble : 1; + /**< At least one valid MPDU received on channel */ + t_u8 bss : 1; +#else /**< At least one valid MPDU received on channel */ t_u8 bss : 1; /**< OFDM preamble detected on channel */ @@ -1402,6 +1575,7 @@ typedef MLAN_PACK_START struct { t_u8 unmeasured : 1; /**< Reserved */ t_u8 rsvd5_7 : 3; +#endif /* BIG_ENDIAN_SUPPORT */ } MLAN_PACK_END MeasRptBasicMap_t; diff --git a/mxm_wifiex/wlan_src/mlinux/mlan_ioctl.h b/mxm_wifiex/wlan_src/mlinux/mlan_ioctl.h index b9192ab..b09307d 100644 --- a/mxm_wifiex/wlan_src/mlinux/mlan_ioctl.h +++ b/mxm_wifiex/wlan_src/mlinux/mlan_ioctl.h @@ -770,14 +770,31 @@ typedef struct _mlan_ssid_bssid { /** Data structure of WMM ECW */ typedef struct _wmm_ecw_t { +#ifdef BIG_ENDIAN_SUPPORT + /** Maximum Ecw */ + t_u8 ecw_max : 4; + /** Minimum Ecw */ + t_u8 ecw_min : 4; +#else /** Minimum Ecw */ t_u8 ecw_min : 4; /** Maximum Ecw */ t_u8 ecw_max : 4; +#endif /* BIG_ENDIAN_SUPPORT */ } wmm_ecw_t, *pwmm_ecw_t; /** Data structure of WMM Aci/Aifsn */ typedef struct _wmm_aci_aifsn_t { +#ifdef BIG_ENDIAN_SUPPORT + /** Reserved */ + t_u8 reserved : 1; + /** Aci */ + t_u8 aci : 2; + /** Acm */ + t_u8 acm : 1; + /** Aifsn */ + t_u8 aifsn : 4; +#else /** Aifsn */ t_u8 aifsn : 4; /** Acm */ @@ -786,6 +803,7 @@ typedef struct _wmm_aci_aifsn_t { t_u8 aci : 2; /** Reserved */ t_u8 reserved : 1; +#endif /* BIG_ENDIAN_SUPPORT */ } wmm_aci_aifsn_t, *pwmm_aci_aifsn_t; /** Data structure of WMM AC parameters */ @@ -992,12 +1010,21 @@ typedef struct _wep_param { /** Data structure of WMM QoS information */ typedef struct _wmm_qos_info_t { +#ifdef BIG_ENDIAN_SUPPORT + /** QoS UAPSD */ + t_u8 qos_uapsd : 1; + /** Reserved */ + t_u8 reserved : 3; + /** Parameter set count */ + t_u8 para_set_count : 4; +#else /** Parameter set count */ t_u8 para_set_count : 4; /** Reserved */ t_u8 reserved : 3; /** QoS UAPSD */ t_u8 qos_uapsd : 1; +#endif /* BIG_ENDIAN_SUPPORT */ } wmm_qos_info_t, *pwmm_qos_info_t; /** Data structure of WMM parameter IE */ @@ -1913,6 +1940,100 @@ typedef struct _mlan_ver_ext { char version_str[MLAN_MAX_VER_STR_LEN]; } mlan_ver_ext, *pmlan_ver_ext; +#ifdef BIG_ENDIAN_SUPPORT +/** Extended Capabilities Data */ +typedef struct MLAN_PACK_START _ExtCap_t { + /** Extended Capabilities value */ + t_u8 rsvdBit87 : 1; /* bit 87 */ + t_u8 rsvdBit86 : 1; /* bit 86 */ + t_u8 rsvdBit85 : 1; /* bit 85 */ + t_u8 beacon_prot : 1; /* bit 84 */ + t_u8 rsvdBit83 : 1; /* bit 83 */ + t_u8 rsvdBit82 : 1; /* bit 82 */ + t_u8 rsvdBit81 : 1; /* bit 81 */ + t_u8 rsvdBit80 : 1; /* bit 80 */ + t_u8 rsvdBit79 : 1; /* bit 79 */ + t_u8 TWTResp : 1; /* bit 78 */ + t_u8 TWTReq : 1; /* bit 77 */ + t_u8 rsvdBit76 : 1; /* bit 76 */ + t_u8 rsvdBit75 : 1; /* bit 75 */ + t_u8 rsvdBit74 : 1; /* bit 74 */ + t_u8 rsvdBit73 : 1; /* bit 73 */ + t_u8 FILS : 1; /* bit 72 */ + t_u8 FTMI : 1; /* bit 71 */ + t_u8 FTMR : 1; /* bit 70 */ + t_u8 CAQ : 1; /* bit 69 */ + t_u8 rsvdBit68 : 1; /* bit 68 */ + t_u8 NCC : 1; /* bit 67 */ + t_u8 rsvdBit66 : 1; /* bit 66 */ + t_u8 chanSchedMgnt : 1; /* bit 65 */ + t_u8 MaxAMSDU1 : 1; /* bit 64 */ + t_u8 MaxAMSDU0 : 1; /* bit 63 */ + t_u8 OperModeNtf : 1; /* bit 62 */ + t_u8 TDLSWildBandwidth : 1; /* bit 61 */ + t_u8 rsvdBit60 : 1; /* bit 60 */ + t_u8 rsvdBit59 : 1; /* bit 59 */ + t_u8 rsvdBit58 : 1; /* bit 58 */ + t_u8 rsvdBit57 : 1; /* bit 57 */ + t_u8 rsvdBit56 : 1; /* bit 56 */ + t_u8 rsvdBit55 : 1; /* bit 55 */ + t_u8 rsvdBit54 : 1; /* bit 54 */ + t_u8 rsvdBit53 : 1; /* bit 53 */ + t_u8 rsvdBit52 : 1; /* bit 52 */ + t_u8 rsvdBit51 : 1; /* bit 51 */ + t_u8 rsvdBit50 : 1; /* bit 50 */ + t_u8 rsvdBit49 : 1; /* bit 49 */ + t_u8 rsvdBit48 : 1; /* bit 48 */ + t_u8 rsvdBit47 : 1; /* bit 47 */ + t_u8 rsvdBit46 : 1; /* bit 46 */ + t_u8 rsvdBit45 : 1; /* bit 45 */ + t_u8 rsvdBit44 : 1; /* bit 44 */ + t_u8 rsvdBit43 : 1; /* bit 43 */ + t_u8 rsvdBit42 : 1; /* bit 42 */ + t_u8 rsvdBit41 : 1; /* bit 41 */ + t_u8 rsvdBit40 : 1; /* bit 40 */ + t_u8 TDLSChlSwitchProhib : 1; /* bit 39 */ + t_u8 TDLSProhibited : 1; /* bit 38 */ + t_u8 TDLSSupport : 1; /* bit 37 */ + t_u8 MSGCF_Capa : 1; /* bit 36 */ + t_u8 Reserved35 : 1; /* bit 35 */ + t_u8 SSPN_Interface : 1; /* bit 34 */ + t_u8 EBR : 1; /* bit 33 */ + t_u8 Qos_Map : 1; /* bit 32 */ + t_u8 Interworking : 1; /* bit 31 */ + t_u8 TDLSChannelSwitching : 1; /* bit 30 */ + t_u8 TDLSPeerPSMSupport : 1; /* bit 29 */ + t_u8 TDLSPeerUAPSDSupport : 1; /* bit 28 */ + t_u8 UTC : 1; /* bit 27 */ + t_u8 DMS : 1; /* bit 26 */ + t_u8 SSID_List : 1; /* bit 25 */ + t_u8 ChannelUsage : 1; /* bit 24 */ + t_u8 TimingMeasurement : 1; /* bit 23 */ + t_u8 MultipleBSSID : 1; /* bit 22 */ + t_u8 AC_StationCount : 1; /* bit 21 */ + t_u8 QoSTrafficCap : 1; /* bit 20 */ + t_u8 BSS_Transition : 1; /* bit 19 */ + t_u8 TIM_Broadcast : 1; /* bit 18 */ + t_u8 WNM_Sleep : 1; /* bit 17 */ + t_u8 TFS : 1; /* bit 16 */ + t_u8 GeospatialLocation : 1; /* bit 15 */ + t_u8 CivicLocation : 1; /* bit 14 */ + t_u8 CollocatedIntf : 1; /* bit 13 */ + t_u8 ProxyARPService : 1; /* bit 12 */ + t_u8 FMS : 1; /* bit 11 */ + t_u8 LocationTracking : 1; /* bit 10 */ + t_u8 MulticastDiagnostics : 1; /* bit 9 */ + t_u8 Diagnostics : 1; /* bit 8 */ + t_u8 Event : 1; /* bit 7 */ + t_u8 SPSMP_Support : 1; /* bit 6 */ + t_u8 Reserved5 : 1; /* bit 5 */ + t_u8 PSMP_Capable : 1; /* bit 4 */ + t_u8 RejectUnadmFrame : 1; /* bit 3 */ + t_u8 ExtChanSwitching : 1; /* bit 2 */ + t_u8 Reserved1 : 1; /* bit 1 */ + t_u8 BSS_CoexistSupport : 1; /* bit 0 */ +} MLAN_PACK_END ExtCap_t, *pExtCap_t; +#else /** Extended Capabilities Data */ typedef struct MLAN_PACK_START _ExtCap_t { /** Extended Capabilities value */ @@ -2005,6 +2126,7 @@ typedef struct MLAN_PACK_START _ExtCap_t { t_u8 rsvdBit86 : 1; /* bit 86 */ t_u8 rsvdBit87 : 1; /* bit 87 */ } MLAN_PACK_END ExtCap_t, *pExtCap_t; +#endif /** ExtCap : TDLS prohibited */ #define IS_EXTCAP_TDLS_PROHIBITED(ext_cap) (ext_cap.TDLSProhibited) diff --git a/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c b/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c index 3962724..217ed98 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c @@ -1211,7 +1211,7 @@ int woal_cfg80211_change_virtual_intf(struct wiphy *wiphy, #endif /* WIFI_DIRECT_SUPPORT */ #if defined(STA_SUPPORT) && defined(UAP_SUPPORT) if (priv->bss_type == MLAN_BSS_TYPE_UAP) { -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 15, 2) +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13) woal_cfg80211_del_beacon(wiphy, dev, 0); #else woal_cfg80211_del_beacon(wiphy, dev); @@ -1445,7 +1445,7 @@ fail: */ #endif int woal_cfg80211_add_key(struct wiphy *wiphy, struct net_device *netdev, -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 15, 2) +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_13) int link_id, #endif t_u8 key_index, @@ -1504,7 +1504,7 @@ int woal_cfg80211_add_key(struct wiphy *wiphy, struct net_device *netdev, */ #endif int woal_cfg80211_del_key(struct wiphy *wiphy, struct net_device *netdev, -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 15, 2) +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_13) int link_id, #endif t_u8 key_index, @@ -1563,7 +1563,7 @@ int woal_cfg80211_del_key(struct wiphy *wiphy, struct net_device *netdev, #endif int woal_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *netdev, -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 15, 2) +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_13) int link_id, #endif t_u8 key_index @@ -1598,7 +1598,7 @@ int woal_cfg80211_set_default_key(struct wiphy *wiphy, #if KERNEL_VERSION(2, 6, 30) <= CFG80211_VERSION_CODE int woal_cfg80211_set_default_mgmt_key(struct wiphy *wiphy, struct net_device *netdev, -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 15, 2) +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_13) int link_id, #endif t_u8 key_index) @@ -1612,7 +1612,7 @@ int woal_cfg80211_set_default_mgmt_key(struct wiphy *wiphy, #if KERNEL_VERSION(5, 10, 0) <= CFG80211_VERSION_CODE int woal_cfg80211_set_default_beacon_key(struct wiphy *wiphy, struct net_device *netdev, -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 15, 2) +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_13) int link_id, #endif t_u8 key_index) @@ -2199,7 +2199,7 @@ done: * @return 0 -- success, otherwise fail */ int woal_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev, -#if KERNEL_VERSION(5, 15, 2) <= CFG80211_VERSION_CODE +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13) unsigned int link_id, #endif const u8 *peer, @@ -4715,7 +4715,7 @@ done: */ void woal_cfg80211_free_bands(struct wiphy *wiphy) { - enum nl80211_band band; + t_u8 band; for (band = NL80211_BAND_2GHZ; band < IEEE80211_NUM_BANDS; ++band) { if (!wiphy->bands[band]) @@ -4889,10 +4889,10 @@ void woal_cfg80211_notify_channel(moal_private *priv, #if KERNEL_VERSION(3, 14, 0) <= CFG80211_VERSION_CODE mutex_lock(&priv->wdev->mtx); #endif -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 15, 2) +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13) cfg80211_ch_switch_notify(priv->netdev, &chandef, 0); #else - cfg80211_ch_switch_notify(priv->netdev, &chandef, 0); + cfg80211_ch_switch_notify(priv->netdev, &chandef); #endif #if KERNEL_VERSION(3, 14, 0) <= CFG80211_VERSION_CODE mutex_unlock(&priv->wdev->mtx); @@ -5238,7 +5238,8 @@ int woal_get_wiphy_chan_dfs_state(struct wiphy *wiphy, if (sband->channels[i].flags & IEEE80211_CHAN_RADAR) { #if CFG80211_VERSION_CODE > KERNEL_VERSION(3, 8, 13) ch_dfs_state->dfs_state = - (dfs_state_t)sband->channels[i].dfs_state; + (dfs_state_t)sband->channels[i] + .dfs_state; ch_dfs_state->dfs_required = MTRUE; #endif } diff --git a/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.h b/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.h index 566f498..fadf07b 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.h +++ b/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.h @@ -128,7 +128,7 @@ int woal_cfg80211_change_virtual_intf(struct wiphy *wiphy, int woal_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed); int woal_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev, -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 15, 2) +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_13) int link_id, #endif t_u8 key_index, @@ -138,7 +138,7 @@ int woal_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev, const t_u8 *mac_addr, struct key_params *params); int woal_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev, -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 15, 2) +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_13) int link_id, #endif t_u8 key_index, @@ -162,7 +162,7 @@ int woal_cfg80211_flush_pmksa(struct wiphy *wiphy, struct net_device *dev); #endif int woal_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev, -#if KERNEL_VERSION(5, 15, 2) <= CFG80211_VERSION_CODE +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13) unsigned int link_id, #endif const u8 *peer, @@ -213,7 +213,7 @@ int woal_cfg80211_set_channel(struct wiphy *wiphy, #if KERNEL_VERSION(2, 6, 37) < CFG80211_VERSION_CODE int woal_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *dev, -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 15, 2) +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_13) int link_id, #endif t_u8 key_index, bool ucast, bool mcast); @@ -225,7 +225,7 @@ int woal_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *dev, #if KERNEL_VERSION(2, 6, 30) <= CFG80211_VERSION_CODE int woal_cfg80211_set_default_mgmt_key(struct wiphy *wiphy, struct net_device *netdev, -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 15, 2) +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_13) int link_id, #endif t_u8 key_index); @@ -234,7 +234,7 @@ int woal_cfg80211_set_default_mgmt_key(struct wiphy *wiphy, #if KERNEL_VERSION(5, 10, 0) <= CFG80211_VERSION_CODE int woal_cfg80211_set_default_beacon_key(struct wiphy *wiphy, struct net_device *netdev, -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 15, 2) +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_13) int link_id, #endif t_u8 key_index); @@ -436,7 +436,7 @@ int woal_cfg80211_set_beacon(struct wiphy *wiphy, struct net_device *dev, struct beacon_parameters *params); #endif -#if KERNEL_VERSION(5, 15, 2) <= CFG80211_VERSION_CODE +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13) int woal_cfg80211_del_beacon(struct wiphy *wiphy, struct net_device *dev, unsigned int link_id); #else diff --git a/mxm_wifiex/wlan_src/mlinux/moal_cfg80211_util.c b/mxm_wifiex/wlan_src/mlinux/moal_cfg80211_util.c index bd8468f..667f209 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_cfg80211_util.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_cfg80211_util.c @@ -52,6 +52,18 @@ static const struct nl80211_vendor_cmd_info vendor_events[] = { .vendor_id = MRVL_VENDOR_ID, .subcmd = event_fw_dump_done, }, /*event_id 1*/ + { + .vendor_id = MRVL_VENDOR_ID, + .subcmd = event_fw_reset_success, + }, /*event_id 2*/ + { + .vendor_id = MRVL_VENDOR_ID, + .subcmd = event_fw_reset_failure, + }, /*event_id 3*/ + { + .vendor_id = MRVL_VENDOR_ID, + .subcmd = event_fw_reset_start, + }, /*event_id 4*/ { .vendor_id = MRVL_VENDOR_ID, .subcmd = event_rssi_monitor, @@ -775,7 +787,8 @@ static int woal_cfg80211_subcmd_get_supp_feature_set(struct wiphy *wiphy, | WLAN_FEATURE_LINK_LAYER_STATS | WLAN_FEATURE_LOGGER | WLAN_FEATURE_RSSI_MONITOR | WLAN_FEATURE_CONFIG_NDO | WLAN_FEATURE_SCAN_RAND | - WLAN_FEATURE_MKEEP_ALIVE | WLAN_FEATURE_PNO; + WLAN_FEATURE_MKEEP_ALIVE | WLAN_FEATURE_PNO | + WLAN_FEATURE_TDLS; memset(&fw_info, 0, sizeof(mlan_fw_info)); if (MLAN_STATUS_SUCCESS != diff --git a/mxm_wifiex/wlan_src/mlinux/moal_cfg80211_util.h b/mxm_wifiex/wlan_src/mlinux/moal_cfg80211_util.h index 8f4587f..8908bc8 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_cfg80211_util.h +++ b/mxm_wifiex/wlan_src/mlinux/moal_cfg80211_util.h @@ -626,6 +626,7 @@ enum vendor_event { event_fw_dump_done = 1, event_fw_reset_success = 2, event_fw_reset_failure = 3, + event_fw_reset_start = 4, event_rssi_monitor = 0x1501, event_set_key_mgmt_offload = 0x10001, event_fw_roam_success = 0x10002, diff --git a/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c b/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c index ab83dab..51014bb 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c @@ -16380,6 +16380,7 @@ static int woal_priv_extend_channel_switch(moal_private *priv, t_u8 *respbuf, int ret = 0; int user_data_len = 0; int data[5] = {0}; + t_u8 channel; mlan_ds_11h_chan_dfs_state ch_dfs; ENTER(); @@ -16409,26 +16410,35 @@ static int woal_priv_extend_channel_switch(moal_private *priv, t_u8 *respbuf, LEAVE(); return ret; } - memset(&ch_dfs, 0, sizeof(ch_dfs)); - ch_dfs.channel = data[2]; - if (woal_11h_chan_dfs_state(priv, MLAN_ACT_GET, &ch_dfs)) { - PRINTM(MERROR, "%s: woal_11h_chan_dfs_state failed \n", - __func__); - ret = -EFAULT; - LEAVE(); - return ret; + + /* For 2.4G channels skip the DFS checks */ + channel = data[2]; + if (channel > MAX_BG_CHANNEL) { + memset(&ch_dfs, 0, sizeof(ch_dfs)); + ch_dfs.channel = data[2]; + + if (woal_11h_chan_dfs_state(priv, MLAN_ACT_GET, &ch_dfs)) { + PRINTM(MERROR, "%s: woal_11h_chan_dfs_state failed \n", + __func__); + ret = -EFAULT; + LEAVE(); + return ret; + } + + if (ch_dfs.dfs_required && + (ch_dfs.dfs_state == DFS_UNAVAILABLE || + ch_dfs.dfs_state == DFS_USABLE)) { + PRINTM(MERROR, + "DFS: Channel=%d is not Available, cannot switch to this channel\n", + data[2]); + ret = -EFAULT; + LEAVE(); + return ret; + } + + if (ch_dfs.dfs_required) + woal_enable_dfs(priv, data[2], MOAL_IOCTL_WAIT); } - if (ch_dfs.dfs_required && (ch_dfs.dfs_state == DFS_UNAVAILABLE || - ch_dfs.dfs_state == DFS_USABLE)) { - PRINTM(MERROR, - "DFS: Channel=%d is not Available, cannot switch to this channel\n", - data[2]); - ret = -EFAULT; - LEAVE(); - return ret; - } - if (ch_dfs.dfs_required) - woal_enable_dfs(priv, data[2], MOAL_IOCTL_WAIT); if (data[1]) { if (woal_check_valid_channel_operclass(priv, data[2], data[1])) { diff --git a/mxm_wifiex/wlan_src/mlinux/moal_ioctl.c b/mxm_wifiex/wlan_src/mlinux/moal_ioctl.c index b18dbe0..d48a709 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_ioctl.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_ioctl.c @@ -7541,15 +7541,41 @@ static int parse_radio_mode_string(const char *s, size_t len, return ret; } +/* + * @brief PoweLevelToDUT11Bits + * + * @param Pwr A user txpwr values of type int + * @param PowerLevel A Pointer of uint32 type for converted txpwr vals + * @return nothing just exit + */ + +static void PoweLevelToDUT11Bits(int Pwr, t_u32 *PowerLevel) +{ + int Z = 0; + + if ((Pwr > 64) || (Pwr < -64)) + return; + + Z = (int)(Pwr * 16); + if (Z < 0) { + Z = Z + (1 << 11); + } + (*PowerLevel) = (t_u32)Z; + + return; +} + /* * @brief Parse mfg cmd tx pwr string * + * @param handle A pointer to moal_handle structure * @param s A pointer to user buffer * @param len Length of user buffer * @param d A pointer to mfg_cmd_generic_cfg struct * @return 0 on success, -EINVAL otherwise */ -static int parse_tx_pwr_string(const char *s, size_t len, + +static int parse_tx_pwr_string(moal_handle *handle, const char *s, size_t len, struct mfg_cmd_generic_cfg *d) { int ret = MLAN_STATUS_SUCCESS; @@ -7557,12 +7583,19 @@ static int parse_tx_pwr_string(const char *s, size_t len, char *tmp = NULL; char *pos = NULL; gfp_t flag; + t_u32 tx_pwr_converted = 0xffffffff; + int tx_pwr_local = 0; + t_u8 fc_card = MFALSE; ENTER(); if (!s || !d) { LEAVE(); return -EINVAL; } +#ifdef SD9177 + if (IS_SD9177(handle->card_type)) + fc_card = MTRUE; +#endif flag = (in_atomic() || irqs_disabled()) ? GFP_ATOMIC : GFP_KERNEL; string = kzalloc(TX_PWR_STR_LEN, flag); if (string == NULL) { @@ -7578,9 +7611,15 @@ static int parse_tx_pwr_string(const char *s, size_t len, /* tx power value */ pos = strsep(&string, " \t"); - if (pos) + if (fc_card && pos) { + /* for sd9177 we need to convert user power vals including -ve + * vals as per labtool */ + tx_pwr_local = woal_string_to_number(pos); + PoweLevelToDUT11Bits(tx_pwr_local, &tx_pwr_converted); + d->data1 = tx_pwr_converted; + } else if (pos) { d->data1 = (t_u32)woal_string_to_number(pos); - + } /* modulation */ pos = strsep(&string, " \t"); if (pos) @@ -7591,7 +7630,7 @@ static int parse_tx_pwr_string(const char *s, size_t len, if (pos) d->data3 = (t_u32)woal_string_to_number(pos); - if ((d->data1 > 24) || (d->data2 > 2)) + if (((!fc_card) && (d->data1 > 24)) || (d->data2 > 2)) ret = -EINVAL; kfree(tmp); @@ -7637,13 +7676,13 @@ static int parse_tx_cont_string(const char *s, size_t len, if (pos) d->enable_tx = (t_u32)woal_string_to_number(pos); - if (d->enable_tx == MFALSE) - goto done; - pos = strsep(&string, " \t"); if (pos) d->cw_mode = (t_u32)woal_string_to_number(pos); + if (d->enable_tx == MFALSE) + goto done; + pos = strsep(&string, " \t"); if (pos) d->payload_pattern = (t_u32)woal_string_to_number(pos); @@ -7997,7 +8036,7 @@ mlan_status woal_process_rf_test_mode_cmd(moal_handle *handle, t_u32 cmd, err = MTRUE; break; case MFG_CMD_RFPWR: - if (parse_tx_pwr_string(buffer, len, + if (parse_tx_pwr_string(handle, buffer, len, &misc->param.mfg_generic_cfg)) err = MTRUE; break; diff --git a/mxm_wifiex/wlan_src/mlinux/moal_main.c b/mxm_wifiex/wlan_src/mlinux/moal_main.c index b188d32..499719b 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_main.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_main.c @@ -939,9 +939,9 @@ static void woal_hang_work_queue(struct work_struct *work) cfg80211_wext = reset_handle->params.cfg80211_wext; // stop pending scan #ifdef STA_CFG80211 - if (IS_STA_CFG80211(cfg80211_wext) && reset_handle->scan_request) { + if (IS_STA_CFG80211(cfg80211_wext) && reset_handle->scan_request && + reset_handle->scan_priv) { moal_private *scan_priv = reset_handle->scan_priv; - cancel_delayed_work_sync(&reset_handle->scan_timeout_work); /** some supplicant can not handle SCAN abort event */ if (scan_priv->bss_type == MLAN_BSS_TYPE_STA) woal_cfg80211_scan_done(reset_handle->scan_request, @@ -951,6 +951,7 @@ static void woal_hang_work_queue(struct work_struct *work) MFALSE); reset_handle->scan_request = NULL; reset_handle->scan_priv = NULL; + cancel_delayed_work_sync(&reset_handle->scan_timeout_work); reset_handle->scan_pending_on_block = MFALSE; MOAL_REL_SEMAPHORE(&reset_handle->async_sem); } @@ -968,10 +969,10 @@ static void woal_hang_work_queue(struct work_struct *work) #ifdef STA_CFG80211 #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) if (IS_STA_CFG80211(cfg80211_wext) && priv->wdev && -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2) +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13) priv->wdev->connected) { #else - priv->wdev->connected) { + priv->wdev->current_bss) { #endif #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) if (priv->host_mlme) @@ -1015,14 +1016,25 @@ static void woal_hang_work_queue(struct work_struct *work) if (priv) { woal_broadcast_event(priv, CUS_EVT_FW_RECOVER_START, strlen(CUS_EVT_FW_RECOVER_START)); +#ifdef STA_CFG80211 +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) + if (IS_STA_OR_UAP_CFG80211(cfg80211_wext)) + woal_cfg80211_vendor_event( + priv, event_fw_reset_start, + CUS_EVT_FW_RECOVER_START, + strlen(CUS_EVT_FW_RECOVER_START)); +#endif +#endif } if (IS_SD(reset_handle->card_type)) { + PRINTM(MMSG, "WIFI auto_fw_reload: fw_reload=1\n"); ret = woal_request_fw_reload( reset_handle, FW_RELOAD_SDIO_INBAND_RESET); } #ifdef PCIE else if (IS_PCIE(reset_handle->card_type)) { reset_handle->init_wait_q_woken = MFALSE; + PRINTM(MMSG, "WIFI auto_fw_reload: fw_reload=4\n"); ret = woal_request_fw_reload(reset_handle, FW_RELOAD_PCIE_RESET); if (!ret) { @@ -3897,7 +3909,7 @@ static mlan_status woal_init_fw_dpc(moal_handle *handle) fw.fw_reload = handle->params.fw_reload; else fw.fw_reload = 0; - wifi_status = WIFI_STATUS_OK; + wifi_status = WIFI_STATUS_FW_DNLD; ret = mlan_dnld_fw(handle->pmlan_adapter, &fw); if (ret == MLAN_STATUS_FAILURE) { wifi_status = WIFI_STATUS_DNLD_FW_FAIL; @@ -3908,7 +3920,7 @@ static mlan_status woal_init_fw_dpc(moal_handle *handle) handle->ops.reg_dbg(handle); goto done; } - wifi_status = WIFI_STATUS_OK; + wifi_status = WIFI_STATUS_FW_DNLD_COMPLETE; #if defined(USB) if (handle->boot_state == USB_FW_DNLD) { @@ -3962,11 +3974,13 @@ static mlan_status woal_init_fw_dpc(moal_handle *handle) return ret; } handle->init_wait_q_woken = MFALSE; + wifi_status = WIFI_STATUS_INIT_FW; ret = mlan_init_fw(handle->pmlan_adapter); if (ret == MLAN_STATUS_FAILURE) { wifi_status = WIFI_STATUS_INIT_FW_FAIL; goto done; } else if (ret == MLAN_STATUS_SUCCESS) { + wifi_status = WIFI_STATUS_OK; handle->hardware_status = HardwareStatusReady; goto done; } @@ -3987,6 +4001,7 @@ static mlan_status woal_init_fw_dpc(moal_handle *handle) ret = MLAN_STATUS_FAILURE; goto done; } + wifi_status = WIFI_STATUS_OK; ret = MLAN_STATUS_SUCCESS; done: if (handle->dpd_data) { @@ -4665,7 +4680,7 @@ mlan_status woal_init_sta_dev(struct net_device *dev, moal_private *priv) (MAX_MTU_SIZE + MLAN_MIN_DATA_HEADER_LEN + priv->extra_tx_head_len)) { dev->max_mtu = MAX_MTU_SIZE; - PRINTM(MMSG, "wlan: %s set max_mtu %d\n", dev->name, + PRINTM(MINFO, "wlan: %s set max_mtu %d\n", dev->name, dev->max_mtu); } #ifdef MFG_CMD_SUPPORT @@ -4836,69 +4851,65 @@ moal_private *woal_add_interface(moal_handle *handle, t_u8 bss_index, #endif ENTER(); -#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 29) -#define MAX_WMM_QUEUE 4 - /* Allocate an Ethernet device */ - dev = alloc_etherdev_mq(sizeof(moal_private), MAX_WMM_QUEUE); -#else - dev = alloc_etherdev(sizeof(moal_private)); -#endif - if (!dev) { - PRINTM(MFATAL, "Init virtual ethernet device failed\n"); - goto error; - } - /* Allocate device name */ -#ifdef STA_SUPPORT memset(name, 0, sizeof(name)); - if (handle->params.sta_name) - snprintf(name, sizeof(name), "%s%%d", handle->params.sta_name); - else if (handle->second_mac) - snprintf(name, sizeof(name), "m%s", default_mlan_name); - else - snprintf(name, sizeof(name), "%s", default_mlan_name); - - if ((bss_type == MLAN_BSS_TYPE_STA) && - (dev_alloc_name(dev, name) < 0)) { - PRINTM(MERROR, "Could not allocate mlan device name\n"); - goto error; - } + switch (bss_type) { +#ifdef STA_SUPPORT + case MLAN_BSS_TYPE_STA: + if (handle->params.sta_name) + snprintf(name, sizeof(name), "%s%%d", + handle->params.sta_name); + else if (handle->second_mac) + snprintf(name, sizeof(name), "m%s", default_mlan_name); + else + snprintf(name, sizeof(name), "%s", default_mlan_name); + break; #endif #ifdef UAP_SUPPORT - memset(name, 0, sizeof(name)); - if (handle->params.uap_name) - snprintf(name, sizeof(name), "%s%%d", handle->params.uap_name); - else if (handle->second_mac) - snprintf(name, sizeof(name), "m%s", default_uap_name); - else - snprintf(name, sizeof(name), "%s", default_uap_name); - if ((bss_type == MLAN_BSS_TYPE_UAP) && - (dev_alloc_name(dev, name) < 0)) { - PRINTM(MERROR, "Could not allocate uap device name\n"); - goto error; - } + case MLAN_BSS_TYPE_UAP: + if (handle->params.uap_name) + snprintf(name, sizeof(name), "%s%%d", + handle->params.uap_name); + else if (handle->second_mac) + snprintf(name, sizeof(name), "m%s", default_uap_name); + else + snprintf(name, sizeof(name), "%s", default_uap_name); + break; #endif #ifdef WIFI_DIRECT_SUPPORT - memset(name, 0, sizeof(name)); - if (handle->params.wfd_name) - snprintf(name, sizeof(name), "%s%%d", handle->params.wfd_name); - else if (handle->second_mac) - snprintf(name, sizeof(name), "m%s", default_wfd_name); - else - snprintf(name, sizeof(name), "%s", default_wfd_name); - if ((bss_type == MLAN_BSS_TYPE_WIFIDIRECT) && - (dev_alloc_name(dev, name) < 0)) { - PRINTM(MERROR, "Could not allocate wifidirect device name\n"); - goto error; - } + case MLAN_BSS_TYPE_WIFIDIRECT: + if (handle->params.wfd_name) + snprintf(name, sizeof(name), "%s%%d", + handle->params.wfd_name); + else if (handle->second_mac) + snprintf(name, sizeof(name), "m%s", default_wfd_name); + else + snprintf(name, sizeof(name), "%s", default_wfd_name); + break; #endif - memset(name, 0, sizeof(name)); - if (handle->second_mac) - snprintf(name, sizeof(name), "m%s", default_dfs_name); - else - snprintf(name, sizeof(name), "%s", default_dfs_name); - if ((bss_type == MLAN_BSS_TYPE_DFS) && - (dev_alloc_name(dev, name) < 0)) { - PRINTM(MERROR, "Could not allocate DFS device name\n"); + case MLAN_BSS_TYPE_DFS: + if (handle->second_mac) + snprintf(name, sizeof(name), "m%s", default_dfs_name); + else + snprintf(name, sizeof(name), "%s", default_dfs_name); + break; + default: + PRINTM(MERROR, "woal_add_interface: invalid bss_type=%d\n", + bss_type); + return NULL; + } + +#define MAX_WMM_QUEUE 4 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0) + /* Allocate an net device */ + dev = alloc_netdev_mq(sizeof(moal_private), name, NET_NAME_UNKNOWN, + ether_setup, MAX_WMM_QUEUE); +#else + dev = alloc_netdev_mq(sizeof(moal_private), name, ether_setup, + MAX_WMM_QUEUE); +#endif + + if (!dev) { + PRINTM(MERROR, "alloc_netdev failed\n"); goto error; } priv = (moal_private *)netdev_priv(dev); @@ -5102,7 +5113,7 @@ moal_private *woal_add_interface(moal_handle *handle, t_u8 bss_index, netif_carrier_off(dev); woal_stop_queue(dev); - PRINTM(MINFO, "%s: NXP 802.11 Adapter\n", dev->name); + PRINTM(MMSG, "Register NXP 802.11 Adapter %s\n", dev->name); if (bss_type == MLAN_BSS_TYPE_STA || priv->bss_type == MLAN_BSS_TYPE_UAP) { @@ -5795,10 +5806,10 @@ int woal_close(struct net_device *dev) woal_cancel_scan(priv, MOAL_IOCTL_WAIT); #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2) +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13) if (IS_STA_CFG80211(cfg80211_wext) && priv->wdev->connected) { #else - if (IS_STA_CFG80211(cfg80211_wext) && priv->wdev->connected) { + if (IS_STA_CFG80211(cfg80211_wext) && priv->wdev->current_bss) { #endif priv->cfg_disconnect = MTRUE; cfg80211_disconnected(priv->netdev, 0, NULL, 0, @@ -6743,7 +6754,7 @@ void woal_flush_tcp_sess_queue(moal_private *priv) list_for_each_entry_safe (tcp_sess, tmp_node, &priv->tcp_sess_queue, link) { list_del(&tcp_sess->link); - if (tcp_sess->is_timer_set) + if (atomic_read(&tcp_sess->is_timer_set)) woal_cancel_timer(&tcp_sess->ack_timer); skb = (struct sk_buff *)tcp_sess->ack_skb; if (skb) @@ -6809,7 +6820,7 @@ static void woal_ageout_tcp_sess_queue(moal_private *priv) PRINTM(MDATA, "wlan: ageout TCP seesion %p\n", tcp_sess); list_del(&tcp_sess->link); - if (tcp_sess->is_timer_set) + if (atomic_read(&tcp_sess->is_timer_set)) woal_cancel_timer(&tcp_sess->ack_timer); skb = (struct sk_buff *)tcp_sess->ack_skb; if (skb) @@ -6839,7 +6850,7 @@ static void woal_tcp_ack_timer_func(void *context) #endif ENTER(); spin_lock_irqsave(&priv->tcp_sess_lock, flags); - tcp_session->is_timer_set = MFALSE; + atomic_set(&tcp_session->is_timer_set, MFALSE); skb = (struct sk_buff *)tcp_session->ack_skb; pmbuf = (mlan_buffer *)tcp_session->pmbuf; tcp_session->ack_skb = NULL; @@ -6906,9 +6917,8 @@ static void woal_send_tcp_ack(moal_private *priv, struct tcp_sess *tcp_session) t_u32 index = 0; #endif ENTER(); - if (tcp_session->is_timer_set) { + if (atomic_cmpxchg(&tcp_session->is_timer_set, MTRUE, MFALSE)) { woal_cancel_timer(&tcp_session->ack_timer); - tcp_session->is_timer_set = MFALSE; } tcp_session->ack_skb = NULL; tcp_session->pmbuf = NULL; @@ -7032,7 +7042,7 @@ static int woal_process_tcp_ack(moal_private *priv, mlan_buffer *pmbuf) woal_initialize_timer(&tcp_session->ack_timer, woal_tcp_ack_timer_func, tcp_session); - tcp_session->is_timer_set = MTRUE; + atomic_set(&tcp_session->is_timer_set, MTRUE); woal_mod_timer(&tcp_session->ack_timer, MOAL_TIMER_1MS); list_add_tail(&tcp_session->link, &priv->tcp_sess_queue); @@ -7049,7 +7059,7 @@ static int woal_process_tcp_ack(moal_private *priv, mlan_buffer *pmbuf) tcp_session->priv = (void *)priv; skb = (struct sk_buff *)pmbuf->pdesc; skb->cb[0] = 0; - tcp_session->is_timer_set = MTRUE; + atomic_set(&tcp_session->is_timer_set, MTRUE); woal_mod_timer(&tcp_session->ack_timer, MOAL_TIMER_1MS); spin_unlock_irqrestore(&priv->tcp_sess_lock, flags); ret = HOLD_TCP_ACK; @@ -7093,7 +7103,7 @@ static int woal_process_tcp_ack(moal_private *priv, mlan_buffer *pmbuf) if (tcp_session) { PRINTM(MDATA,"wlan: delete TCP seesion %p\n",tcp_session); list_del(&tcp_session->link); - if (tcp_session->is_timer_set) + if (atomic_read(&tcp_session->is_timer_set)) woal_cancel_timer(&tcp_session->ack_timer); skb = (struct sk_buff *)tcp_session->ack_skb; if (skb) @@ -8926,10 +8936,10 @@ t_void woal_send_disconnect_to_system(moal_private *priv, if (IS_STA_CFG80211(cfg80211_wext)) { spin_lock_irqsave(&priv->connect_lock, flags); if (!priv->cfg_disconnect && !priv->cfg_connect && priv->wdev && -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2) +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13) priv->wdev->connected) { #else - priv->wdev->connected) { + priv->wdev->current_bss) { #endif PRINTM(MMSG, "wlan: Disconnected from " MACSTR @@ -10543,6 +10553,11 @@ moal_handle *woal_add_card(void *card, struct device *dev, moal_if_ops *if_ops, PRINTM(MERROR, "Fail to load module parameter file\n"); goto err_kmalloc; } + if (!handle->params.drv_mode) { + PRINTM(MMSG, "wlan: stop init_adapter, drv_mode=%d\n", + handle->params.drv_mode); + goto err_kmalloc; + } #ifdef IMX_SUPPORT #ifdef SDIO if (IS_SD(handle->card_type)) { @@ -10721,11 +10736,7 @@ moal_handle *woal_add_card(void *card, struct device *dev, moal_if_ops *if_ops, if (moal_extflg_isset(handle, EXT_NAPI)) { init_dummy_netdev(&handle->napi_dev); netif_napi_add(&handle->napi_dev, &handle->napi_rx, -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) - woal_netdev_poll_rx); -#else woal_netdev_poll_rx, NAPI_BUDGET); -#endif napi_enable(&handle->napi_rx); } @@ -11183,21 +11194,18 @@ static int woal_reset_and_reload_fw(moal_handle *handle, t_u8 mode) woal_sdio_reset_hw(handle); goto reload_fw; } - if (!IS_SD9098(handle->card_type) && !IS_SD9097(handle->card_type) && - !IS_SDNW62X(handle->card_type) && !IS_SD9177(handle->card_type)) { - mlan_pm_wakeup_card(handle->pmlan_adapter, MTRUE); - /** wait SOC fully wake up */ - for (tries = 0; tries < FW_POLL_TRIES; ++tries) { - ret = handle->ops.write_reg(handle, reset_reg, 0xba); - if (ret == MLAN_STATUS_SUCCESS) { - handle->ops.read_reg(handle, reset_reg, &value); - if (value == 0xba) { - PRINTM(MMSG, "FW wake up\n"); - break; - } + mlan_pm_wakeup_card(handle->pmlan_adapter, MTRUE); + /** wait SOC fully wake up */ + for (tries = 0; tries < FW_POLL_TRIES; ++tries) { + ret = handle->ops.write_reg(handle, reset_reg, 0xba); + if (ret == MLAN_STATUS_SUCCESS) { + handle->ops.read_reg(handle, reset_reg, &value); + if (value == 0xba) { + PRINTM(MMSG, "FW wake up\n"); + break; } - udelay(1000); } + udelay(1000); } /* Write register to notify FW */ if (handle->ops.write_reg(handle, reset_reg, reset_val) != @@ -11226,9 +11234,7 @@ static int woal_reset_and_reload_fw(moal_handle *handle, t_u8 mode) ret = -EFAULT; goto done; } - if (!IS_SD9098(handle->card_type) && !IS_SD9097(handle->card_type) && - !IS_SDNW62X(handle->card_type) && !IS_SD9177(handle->card_type)) - mlan_pm_wakeup_card(handle->pmlan_adapter, MFALSE); + mlan_pm_wakeup_card(handle->pmlan_adapter, MFALSE); reload_fw: /* Download FW */ ret = woal_request_fw(handle); @@ -11514,6 +11520,7 @@ int woal_request_fw_reload(moal_handle *phandle, t_u8 mode) moal_handle *ref_handle = NULL; ENTER(); + wifi_status = WIFI_STATUS_FW_RELOAD; #ifdef PCIE if (mode == FW_RELOAD_PCIE_RESET) { card = (pcie_service_card *)handle->card; @@ -11588,6 +11595,7 @@ int woal_request_fw_reload(moal_handle *phandle, t_u8 mode) woal_post_reset(handle); if (ref_handle) woal_post_reset(ref_handle); + wifi_status = WIFI_STATUS_OK; done: LEAVE(); return ret; diff --git a/mxm_wifiex/wlan_src/mlinux/moal_main.h b/mxm_wifiex/wlan_src/mlinux/moal_main.h index b6de43d..6559743 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_main.h +++ b/mxm_wifiex/wlan_src/mlinux/moal_main.h @@ -156,6 +156,17 @@ Change log: #define COMPAT_VERSION_CODE KERNEL_VERSION(0, 0, 0) #define CFG80211_VERSION_CODE MAX(LINUX_VERSION_CODE, COMPAT_VERSION_CODE) +#define IMX_ANDROID_13 0 + +#ifdef IMX_SUPPORT +#ifdef IMX_ANDROID +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 15, 41) +#undef IMX_ANDROID_13 +#define IMX_ANDROID_13 1 +#endif +#endif +#endif + /** * Reason Code 3: STA is leaving (or has left) IBSS or ESS */ @@ -327,12 +338,16 @@ typedef enum _MOAL_HARDWARE_STATUS { } MOAL_HARDWARE_STATUS; #define WIFI_STATUS_OK 0 -#define WIFI_STATUS_DNLD_FW_FAIL 1 -#define WIFI_STATUS_INIT_FW_FAIL 2 -#define WIFI_STATUS_TX_TIMEOUT 3 -#define WIFI_STATUS_WIFI_HANG 4 -#define WIFI_STATUS_SCAN_TIMEOUT 5 -#define WIFI_STATUS_FW_DUMP 6 +#define WIFI_STATUS_FW_DNLD 1 +#define WIFI_STATUS_FW_DNLD_COMPLETE 2 +#define WIFI_STATUS_INIT_FW 3 +#define WIFI_STATUS_DNLD_FW_FAIL 4 +#define WIFI_STATUS_INIT_FW_FAIL 5 +#define WIFI_STATUS_TX_TIMEOUT 6 +#define WIFI_STATUS_WIFI_HANG 7 +#define WIFI_STATUS_SCAN_TIMEOUT 8 +#define WIFI_STATUS_FW_DUMP 9 +#define WIFI_STATUS_FW_RELOAD 10 /** fw cap info 11p */ #define FW_CAPINFO_80211P MBIT(24) @@ -1099,7 +1114,7 @@ struct tcp_sess { /** timer for ack */ moal_drv_timer ack_timer __ATTRIB_ALIGN__; /** timer is set */ - BOOLEAN is_timer_set; + atomic_t is_timer_set; /** last update time*/ wifi_timeval update_time; }; @@ -3064,6 +3079,20 @@ static inline void hexdump(t_u32 level, char *prompt, t_u8 *buf, int len) } while (0) #endif +#ifdef BIG_ENDIAN_SUPPORT +/** Convert from 16 bit little endian format to CPU format */ +#define woal_le16_to_cpu(x) le16_to_cpu(x) +/** Convert from 32 bit little endian format to CPU format */ +#define woal_le32_to_cpu(x) le32_to_cpu(x) +/** Convert from 64 bit little endian format to CPU format */ +#define woal_le64_to_cpu(x) le64_to_cpu(x) +/** Convert to 16 bit little endian format from CPU format */ +#define woal_cpu_to_le16(x) cpu_to_le16(x) +/** Convert to 32 bit little endian format from CPU format */ +#define woal_cpu_to_le32(x) cpu_to_le32(x) +/** Convert to 64 bit little endian format from CPU format */ +#define woal_cpu_to_le64(x) cpu_to_le64(x) +#else /** Do nothing */ #define woal_le16_to_cpu(x) x /** Do nothing */ @@ -3076,6 +3105,7 @@ static inline void hexdump(t_u32 level, char *prompt, t_u8 *buf, int len) #define woal_cpu_to_le32(x) x /** Do nothing */ #define woal_cpu_to_le64(x) x +#endif /** * @brief This function returns first available priv diff --git a/mxm_wifiex/wlan_src/mlinux/moal_pcie.c b/mxm_wifiex/wlan_src/mlinux/moal_pcie.c index c0bfbc9..27f495f 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_pcie.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_pcie.c @@ -132,6 +132,8 @@ static const struct pci_device_id wlan_ids[] = { /* moal interface ops */ static moal_if_ops pcie_ops; +MODULE_DEVICE_TABLE(pci, wlan_ids); + /******************************************************** Global Variables ********************************************************/ diff --git a/mxm_wifiex/wlan_src/mlinux/moal_sdio_mmc.c b/mxm_wifiex/wlan_src/mlinux/moal_sdio_mmc.c index 3f19491..67419c0 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_sdio_mmc.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_sdio_mmc.c @@ -129,6 +129,8 @@ static const struct sdio_device_id wlan_ids[] = { {}, }; +MODULE_DEVICE_TABLE(sdio, wlan_ids); + int woal_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id); void woal_sdio_remove(struct sdio_func *func); #ifdef SDIO @@ -512,7 +514,7 @@ int woal_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id) if (NULL == woal_add_card(card, &card->func->dev, &sdiommc_ops, card_type)) { - PRINTM(MERROR, "woal_add_card failed\n"); + PRINTM(MMSG, "woal_add_card failed\n"); ret = MLAN_STATUS_FAILURE; goto err; } diff --git a/mxm_wifiex/wlan_src/mlinux/moal_shim.c b/mxm_wifiex/wlan_src/mlinux/moal_shim.c index 6f401af..98094a9 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_shim.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_shim.c @@ -3454,10 +3454,10 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent) PRINTM(MMSG, "Channel Under Nop: notify cfg80211 new channel=%d\n", priv->channel); -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2) +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13) cfg80211_ch_switch_notify(priv->netdev, &priv->chan, 0); #else - cfg80211_ch_switch_notify(priv->netdev, &priv->chan, 0); + cfg80211_ch_switch_notify(priv->netdev, &priv->chan); #endif priv->chan_under_nop = MFALSE; } @@ -3788,10 +3788,10 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent) PRINTM(MEVENT, "HostMlme %s: Receive deauth/disassociate\n", priv->netdev->name); -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2) +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13) if (!priv->wdev->connected) { #else - if (!priv->wdev->connected) { + if (!priv->wdev->current_bss) { #endif PRINTM(MEVENT, "HostMlme: Drop deauth/disassociate, current_bss = null\n"); @@ -4162,10 +4162,10 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent) roam_info = kzalloc(sizeof(struct cfg80211_roam_info), GFP_ATOMIC); if (roam_info) { -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_13) roam_info->links[0].bssid = priv->cfg_bssid; #else - roam_info->links[0].bssid = priv->cfg_bssid; + roam_info->bssid = priv->cfg_bssid; #endif roam_info->req_ie = req_ie; roam_info->req_ie_len = ie_len; diff --git a/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c b/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c index a9b5285..92cb039 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c @@ -103,7 +103,7 @@ static int woal_cfg80211_dump_survey(struct wiphy *wiphy, #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) static int woal_cfg80211_get_channel(struct wiphy *wiphy, struct wireless_dev *wdev, -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 15, 2) +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13) unsigned int link_id, #endif struct cfg80211_chan_def *chandef); @@ -4420,6 +4420,12 @@ static int woal_cfg80211_scan(struct wiphy *wiphy, struct net_device *dev, ENTER(); PRINTM(MINFO, "Received scan request on %s\n", dev->name); + if (priv->phandle->driver_status) { + PRINTM(MERROR, + "Block woal_cfg80211_scan in abnormal driver state\n"); + LEAVE(); + return -EFAULT; + } if (priv->phandle->scan_pending_on_block == MTRUE) { PRINTM(MCMND, "scan already in processing...\n"); LEAVE(); @@ -5380,7 +5386,7 @@ static int woal_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev, if (priv->media_connected == MFALSE) { PRINTM(MMSG, " Already disconnected\n"); #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 15, 2) +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13) if (priv->wdev->connected && #else if (priv->wdev->current_bss && @@ -5711,7 +5717,7 @@ done: #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) static int woal_cfg80211_get_channel(struct wiphy *wiphy, struct wireless_dev *wdev, -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 15, 2) +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13) unsigned int link_id, #endif struct cfg80211_chan_def *chandef) @@ -8621,7 +8627,7 @@ int woal_cfg80211_update_ft_ies(struct wiphy *wiphy, struct net_device *dev, passoc_rsp = (IEEEtypes_AssocRsp_t *) assoc_rsp->assoc_resp_buf; #if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 15, 2) +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_13) roam_info.links[0].bssid = priv->cfg_bssid; #else roam_info.bssid = priv->cfg_bssid; @@ -9093,7 +9099,7 @@ void woal_start_roaming(moal_private *priv) } #endif #if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 15, 2) +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_13) roam_info.links[0].bssid = priv->cfg_bssid; #else roam_info.bssid = priv->cfg_bssid; diff --git a/mxm_wifiex/wlan_src/mlinux/moal_uap_cfg80211.c b/mxm_wifiex/wlan_src/mlinux/moal_uap_cfg80211.c index 0556c40..f4316f5 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_uap_cfg80211.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_uap_cfg80211.c @@ -2348,7 +2348,7 @@ int woal_cfg80211_del_virtual_intf(struct wiphy *wiphy, } } if (vir_priv && vir_priv->bss_type == MLAN_BSS_TYPE_UAP) { -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 15, 2) +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13) if (woal_cfg80211_del_beacon(wiphy, dev, 0)) #else if (woal_cfg80211_del_beacon(wiphy, dev)) @@ -2356,13 +2356,13 @@ int woal_cfg80211_del_virtual_intf(struct wiphy *wiphy, PRINTM(MERROR, "%s: del_beacon failed\n", __func__); #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 0, 0) -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 15, 2) +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13) vir_priv->wdev->links[0].ap.beacon_interval = 0; #else vir_priv->wdev->beacon_interval = 0; #endif #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 15, 0) -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 15, 2) +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13) memset(&vir_priv->wdev->links[0].ap.chandef, 0, sizeof(vir_priv->wdev->links[0].ap.chandef)); #else @@ -2371,7 +2371,7 @@ int woal_cfg80211_del_virtual_intf(struct wiphy *wiphy, #endif #endif #endif -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 15, 2) +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13) vir_priv->wdev->u.ap.ssid_len = 0; #else vir_priv->wdev->ssid_len = 0; @@ -2650,7 +2650,7 @@ done: * * @return 0 -- success, otherwise fail */ -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 15, 2) +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13) int woal_cfg80211_del_beacon(struct wiphy *wiphy, struct net_device *dev, unsigned int link_id) #else @@ -3436,7 +3436,7 @@ static void woal_switch_uap_channel(moal_private *priv, t_u8 wait_option) priv->channel = uap_channel.channel; moal_memcpy_ext(priv->phandle, &priv->chan, &priv->csa_chan, sizeof(struct cfg80211_chan_def), sizeof(priv->chan)); -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 15, 2) +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13) cfg80211_ch_switch_notify(priv->netdev, &priv->chan, 0); #else cfg80211_ch_switch_notify(priv->netdev, &priv->chan);