diff options
author | Fugang Duan <fugang.duan@nxp.com> | 2020-11-04 10:15:11 +0800 |
---|---|---|
committer | Fugang Duan <fugang.duan@nxp.com> | 2020-11-04 16:51:29 +0800 |
commit | f186a4e65f54a28973c743f8c007b18c1ce95be6 (patch) | |
tree | 4455527d38e8f382ebe62e5f428f4903b047ff9a | |
parent | a51f268dd7e6eeaefe8289f60195d8f24327f780 (diff) |
MLK-24962 net: wireless: nxp: mxm_wifiex: upgrade to mxm5x16203 release
Upgrade to mxm5x16203 verison:
- added support for PCIE-UART W8997 SoC
- fixed Wi-Fi CTSNet and VTSHAL test case failures
- fixed kernel warnings seen on enabling CFI feature
- added coverity and checkpatch related fixes
Reviewed-by: yang.tian <yang.tian@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
44 files changed, 1831 insertions, 412 deletions
diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/Makefile b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/Makefile index 9cb077cc70dc..8ee9b932231f 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/Makefile +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/Makefile @@ -30,7 +30,7 @@ CONFIG_SD8978=n CONFIG_USB8978=n CONFIG_SD8997=n CONFIG_USB8997=n -CONFIG_PCIE8997=n +CONFIG_PCIE8997=y CONFIG_SD8987=y CONFIG_SD9097=n CONFIG_USB9097=n diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_11ax.c b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_11ax.c index 0106e260e322..e4d731a06d07 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_11ax.c +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_11ax.c @@ -93,23 +93,33 @@ t_u8 wlan_check_ap_11ax_twt_supported(BSSDescriptor_t *pbss_desc) t_u8 wlan_check_11ax_twt_supported(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc) { - MrvlIEtypes_He_cap_t *phecap = MNULL; - MrvlIEtypes_He_cap_t *hw_he_cap = MNULL; - - if (!wlan_check_ap_11ax_twt_supported(pbss_desc)) + MrvlIEtypes_He_cap_t *phecap = + (MrvlIEtypes_He_cap_t *)&pmpriv->user_he_cap; + MrvlIEtypes_He_cap_t *hw_he_cap = + (MrvlIEtypes_He_cap_t *)&pmpriv->adapter->hw_he_cap; + if (pbss_desc && !wlan_check_ap_11ax_twt_supported(pbss_desc)) { + PRINTM(MINFO, "AP don't support twt feature\n"); return MFALSE; - if (pbss_desc->bss_band & BAND_A) { - hw_he_cap = (MrvlIEtypes_He_cap_t *)&pmpriv->adapter->hw_he_cap; - phecap = (MrvlIEtypes_He_cap_t *)&pmpriv->user_he_cap; - } else { - hw_he_cap = - (MrvlIEtypes_He_cap_t *)&pmpriv->adapter->hw_2g_he_cap; - phecap = (MrvlIEtypes_He_cap_t *)&pmpriv->user_2g_he_cap; } - if (!(hw_he_cap->he_mac_cap[0] & HE_MAC_CAP_TWT_REQ_SUPPORT)) + if (pbss_desc) { + if (pbss_desc->bss_band & BAND_A) { + hw_he_cap = (MrvlIEtypes_He_cap_t *)&pmpriv->adapter + ->hw_he_cap; + phecap = (MrvlIEtypes_He_cap_t *)&pmpriv->user_he_cap; + } else { + hw_he_cap = (MrvlIEtypes_He_cap_t *)&pmpriv->adapter + ->hw_2g_he_cap; + phecap = + (MrvlIEtypes_He_cap_t *)&pmpriv->user_2g_he_cap; + } + } + if (!(hw_he_cap->he_mac_cap[0] & HE_MAC_CAP_TWT_REQ_SUPPORT)) { + PRINTM(MINFO, "FW don't support TWT\n"); return MFALSE; + } if (phecap->he_mac_cap[0] & HE_MAC_CAP_TWT_REQ_SUPPORT) return MTRUE; + PRINTM(MINFO, "USER HE_MAC_CAP don't support TWT\n"); return MFALSE; } diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_11h.c b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_11h.c index baf108b63167..c62b9cd0a160 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_11h.c +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_11h.c @@ -3005,7 +3005,6 @@ t_bool wlan_11h_is_channel_under_nop(mlan_adapter *pmadapter, t_u8 channel) wlan_dfs_timestamp_t *pdfs_ts = MNULL; t_u32 now_sec, now_usec; t_bool ret = MFALSE; - ENTER(); pdfs_ts = wlan_11h_find_dfs_timestamp(pmadapter, channel); @@ -3029,9 +3028,9 @@ t_bool wlan_11h_is_channel_under_nop(mlan_adapter *pmadapter, t_u8 channel) } /* if entry is expired, remove it */ - if (!ret) + if (!ret) { wlan_11h_remove_dfs_timestamp(pmadapter, pdfs_ts); - else + } else PRINTM(MMSG, "11h: channel %d is under NOP - can't use.\n", channel); @@ -4043,7 +4042,7 @@ mlan_status wlan_11h_dfs_event_preprocessing(mlan_adapter *pmadapter) { mlan_status ret = MLAN_STATUS_FAILURE; mlan_private *pmpriv = MNULL; - mlan_private *priv_list[MLAN_MAX_BSS_NUM]; + mlan_private *priv_list[MLAN_MAX_BSS_NUM] = {0}; ENTER(); switch (pmadapter->event_cause & EVENT_ID_MASK) { diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_cfp.c b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_cfp.c index 172556c8d44a..cd3045ace0c7 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_cfp.c +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_cfp.c @@ -3376,6 +3376,43 @@ void wlan_free_fw_cfp_tables(mlan_adapter *pmadapter) } /** + * @brief Get DFS chan list + * + * @param pmadapter Pointer to mlan_adapter + * @param pioctl_req Pointer to mlan_ioctl_req + * + * @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE + */ +mlan_status wlan_get_cfp_table(pmlan_adapter pmadapter, + pmlan_ioctl_req pioctl_req) +{ + mlan_ds_misc_cfg *ds_misc_cfg = MNULL; + mlan_status ret = MLAN_STATUS_FAILURE; + chan_freq_power_t *cfp = MNULL; + t_u32 cfp_no = 0; + + ENTER(); + if (pioctl_req) { + ds_misc_cfg = (mlan_ds_misc_cfg *)pioctl_req->pbuf; + if (pioctl_req->action == MLAN_ACT_GET) { + cfp = wlan_get_region_cfp_table( + pmadapter, pmadapter->region_code, + ds_misc_cfg->param.cfp.band, &cfp_no); + if (cfp) { + ds_misc_cfg->param.cfp.num_chan = cfp_no; + memcpy_ext(pmadapter, + ds_misc_cfg->param.cfp.cfp_tbl, cfp, + cfp_no * sizeof(chan_freq_power_t), + cfp_no * sizeof(chan_freq_power_t)); + } + ret = MLAN_STATUS_SUCCESS; + } + } + LEAVE(); + return ret; +} + +/** * @brief Get power tables and cfp tables for set region code * into the IOCTL request buffer * diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_cmdevt.c b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_cmdevt.c index 66c9c971080f..3bc6060194fb 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_cmdevt.c +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_cmdevt.c @@ -957,7 +957,7 @@ static t_u16 wlan_get_cmd_timeout(t_u16 cmd_id) timeout = MRVDRV_TIMER_5S; break; default: - timeout = MRVDRV_TIMER_1S * 10; + timeout = MRVDRV_TIMER_1S * 2; break; } LEAVE(); @@ -5941,6 +5941,34 @@ mlan_status wlan_cmd_reg_access(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd, cmd_eeprom->value = 0; break; } + case HostCmd_CMD_BCA_REG_ACCESS: { + HostCmd_DS_BCA_REG_ACCESS *bca_reg; + cmd->size = wlan_cpu_to_le16(sizeof(HostCmd_DS_BCA_REG_ACCESS) + + S_DS_GEN); + bca_reg = (HostCmd_DS_BCA_REG_ACCESS *)&cmd->params.bca_reg; + bca_reg->action = wlan_cpu_to_le16(cmd_action); + bca_reg->offset = wlan_cpu_to_le16((t_u16)reg_rw->offset); + bca_reg->value = wlan_cpu_to_le32(reg_rw->value); +#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \ + defined(PCIE9097) || defined(USB9097) || defined(SD9097) + if ((reg_rw->type == MLAN_REG_BCA2) && + (IS_CARD9098(pmadapter->card_type) || + IS_CARD9097(pmadapter->card_type))) { + tlv = (MrvlIEtypes_Reg_type_t + *)((t_u8 *)cmd + + sizeof(HostCmd_DS_BCA_REG_ACCESS) + + S_DS_GEN); + tlv->header.type = + wlan_cpu_to_le16(TLV_TYPE_REG_ACCESS_CTRL); + tlv->header.len = wlan_cpu_to_le16(sizeof(t_u8)); + tlv->type = MLAN_REG_BCA2; + cmd->size = wlan_cpu_to_le16( + sizeof(HostCmd_DS_BCA_REG_ACCESS) + S_DS_GEN + + sizeof(MrvlIEtypes_Reg_type_t)); + } +#endif + break; + } default: LEAVE(); return MLAN_STATUS_FAILURE; @@ -6040,6 +6068,13 @@ mlan_status wlan_ret_reg_access(mlan_adapter *pmadapter, t_u16 type, } break; } + case HostCmd_CMD_BCA_REG_ACCESS: { + HostCmd_DS_BCA_REG_ACCESS *reg; + reg = (HostCmd_DS_BCA_REG_ACCESS *)&resp->params.bca_reg; + reg_rw->offset = (t_u32)wlan_le16_to_cpu(reg->offset); + reg_rw->value = wlan_le32_to_cpu(reg->value); + break; + } default: pioctl_buf->status_code = MLAN_ERROR_CMD_RESP_FAIL; LEAVE(); @@ -6810,7 +6845,7 @@ mlan_status wlan_ret_packet_aggr_ctrl(pmlan_private pmpriv, #if defined(USB) mlan_adapter *pmadapter = pmpriv->adapter; t_u8 i; - t_u8 change; + t_u8 change = 0; usb_tx_aggr_params *pusb_tx_aggr = MNULL; #endif @@ -7097,13 +7132,13 @@ static void wlan_fill_link_statistic(mlan_private *priv, /* get wifi_interface_link_layer_info in driver, not in firmware */ if (priv->bss_role == MLAN_BSS_ROLE_STA) { - iface_stat->info.mode = WIFI_INTERFACE_STA; + iface_stat->info.mode = MLAN_INTERFACE_STA; if (priv->media_connected) - iface_stat->info.state = WIFI_ASSOCIATING; + iface_stat->info.state = MLAN_ASSOCIATING; else - iface_stat->info.state = WIFI_DISCONNECTED; - iface_stat->info.roaming = WIFI_ROAMING_IDLE; - iface_stat->info.capabilities = WIFI_CAPABILITY_QOS; + iface_stat->info.state = MLAN_DISCONNECTED; + iface_stat->info.roaming = MLAN_ROAMING_IDLE; + iface_stat->info.capabilities = MLAN_CAPABILITY_QOS; memcpy_ext(priv->adapter, iface_stat->info.ssid, priv->curr_bss_params.bss_descriptor.ssid.ssid, MLAN_MAX_SSID_LENGTH, MLAN_MAX_SSID_LENGTH); @@ -7111,8 +7146,8 @@ static void wlan_fill_link_statistic(mlan_private *priv, priv->curr_bss_params.bss_descriptor.mac_address, MLAN_MAC_ADDR_LENGTH, MLAN_MAC_ADDR_LENGTH); } else { - iface_stat->info.mode = WIFI_INTERFACE_SOFTAP; - iface_stat->info.capabilities = WIFI_CAPABILITY_QOS; + iface_stat->info.mode = MLAN_INTERFACE_SOFTAP; + iface_stat->info.capabilities = MLAN_CAPABILITY_QOS; } memcpy_ext(priv->adapter, iface_stat->info.mac_addr, priv->curr_addr, MLAN_MAC_ADDR_LENGTH, MLAN_MAC_ADDR_LENGTH); diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_decl.h b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_decl.h index 63d61566e7cb..f566e3091996 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_decl.h +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_decl.h @@ -24,7 +24,7 @@ #define _MLAN_DECL_H_ /** MLAN release version */ -#define MLAN_RELEASE_VERSION "186.p6" +#define MLAN_RELEASE_VERSION "203" /** Re-define generic data types for MLAN/MOAL */ /** Signed char (1-byte) */ @@ -198,6 +198,10 @@ typedef t_s32 t_sval; #define MLAN_RATE_INDEX_OFDM7 11 /** Rate index for MCS 0 */ #define MLAN_RATE_INDEX_MCS0 0 +/** Rate index for MCS 2 */ +#define MLAN_RATE_INDEX_MCS2 2 +/** Rate index for MCS 4 */ +#define MLAN_RATE_INDEX_MCS4 4 /** Rate index for MCS 7 */ #define MLAN_RATE_INDEX_MCS7 7 /** Rate index for MCS 9 */ @@ -556,8 +560,6 @@ typedef enum { #define MREG_D MBIT(9) -#define MLOG_D MBIT(10) - #define MMPA_D MBIT(15) #define MDAT_D MBIT(16) #define MCMD_D MBIT(17) @@ -751,6 +753,7 @@ typedef enum _mlan_event_id { MLAN_EVENT_ID_DRV_ASSOC_FAILURE_LOGGER = 0x80000026, MLAN_EVENT_ID_DRV_ASSOC_SUCC_LOGGER = 0x80000027, MLAN_EVENT_ID_DRV_DISCONNECT_LOGGER = 0x80000028, + MLAN_EVENT_ID_DRV_WIFI_STATUS = 0x80000029, } mlan_event_id; /** Data Structures */ @@ -772,12 +775,30 @@ typedef MLAN_PACK_START struct _MrvlIEtypesHeader { t_u16 len; } MLAN_PACK_END MrvlIEtypesHeader_t; +/** MrvlExtIEtypesHeader_t */ +typedef MLAN_PACK_START struct _MrvlExtIEtypesHeader { + /** Header type */ + t_u16 type; + /** Header length */ + t_u16 len; + /** ext id */ + t_u8 ext_id; +} MLAN_PACK_END MrvlExtIEtypesHeader_t; + +/** MrvlIEtypes_Data_t */ +typedef MLAN_PACK_START struct _MrvlExtIEtypes_Data_t { + /** Header */ + MrvlExtIEtypesHeader_t header; + /** Data */ + t_u8 data[]; +} MLAN_PACK_END MrvlExtIEtypes_Data_t; + /** MrvlIEtypes_Data_t */ typedef MLAN_PACK_START struct _MrvlIEtypes_Data_t { /** Header */ MrvlIEtypesHeader_t header; /** Data */ - t_u8 data[1]; + t_u8 data[]; } MLAN_PACK_END MrvlIEtypes_Data_t; #define OID_TYPE_CAL 0x2 @@ -1259,6 +1280,14 @@ typedef enum { WIFI_PREAMBLE_VHT = 0x4 } wifi_preamble; +/** timeval */ +typedef struct { + /** Time (seconds) */ + t_u32 time_sec; + /** Time (micro seconds) */ + t_u32 time_usec; +} wifi_timeval; + #define MAX_NUM_RATE 32 #define MAX_RADIO 2 #define MAX_NUM_CHAN 1 @@ -1268,55 +1297,55 @@ typedef enum { #define BUF_MAXLEN 4096 /** connection state */ typedef enum { - WIFI_DISCONNECTED = 0, - WIFI_AUTHENTICATING = 1, - WIFI_ASSOCIATING = 2, - WIFI_ASSOCIATED = 3, + MLAN_DISCONNECTED = 0, + MLAN_AUTHENTICATING = 1, + MLAN_ASSOCIATING = 2, + MLAN_ASSOCIATED = 3, /** if done by firmware/driver */ - WIFI_EAPOL_STARTED = 4, + MLAN_EAPOL_STARTED = 4, /** if done by firmware/driver */ - WIFI_EAPOL_COMPLETED = 5, -} wifi_connection_state; + MLAN_EAPOL_COMPLETED = 5, +} mlan_connection_state; /** roam state */ typedef enum { - WIFI_ROAMING_IDLE = 0, - WIFI_ROAMING_ACTIVE = 1, -} wifi_roam_state; + MLAN_ROAMING_IDLE = 0, + MLAN_ROAMING_ACTIVE = 1, +} mlan_roam_state; /** interface mode */ typedef enum { - WIFI_INTERFACE_STA = 0, - WIFI_INTERFACE_SOFTAP = 1, - WIFI_INTERFACE_IBSS = 2, - WIFI_INTERFACE_P2P_CLIENT = 3, - WIFI_INTERFACE_P2P_GO = 4, - WIFI_INTERFACE_NAN = 5, - WIFI_INTERFACE_MESH = 6, -} wifi_interface_mode; + MLAN_INTERFACE_STA = 0, + MLAN_INTERFACE_SOFTAP = 1, + MLAN_INTERFACE_IBSS = 2, + MLAN_INTERFACE_P2P_CLIENT = 3, + MLAN_INTERFACE_P2P_GO = 4, + MLAN_INTERFACE_NAN = 5, + MLAN_INTERFACE_MESH = 6, +} mlan_interface_mode; /** set for QOS association */ -#define WIFI_CAPABILITY_QOS 0x00000001 +#define MLAN_CAPABILITY_QOS 0x00000001 /** set for protected association (802.11 beacon frame control protected bit * set) */ -#define WIFI_CAPABILITY_PROTECTED 0x00000002 +#define MLAN_CAPABILITY_PROTECTED 0x00000002 /** set if 802.11 Extended Capabilities element interworking bit is set */ -#define WIFI_CAPABILITY_INTERWORKING 0x00000004 +#define MLAN_CAPABILITY_INTERWORKING 0x00000004 /** set for HS20 association */ -#define WIFI_CAPABILITY_HS20 0x00000008 +#define MLAN_CAPABILITY_HS20 0x00000008 /** set is 802.11 Extended Capabilities element UTF-8 SSID bit is set */ -#define WIFI_CAPABILITY_SSID_UTF8 0x00000010 +#define MLAN_CAPABILITY_SSID_UTF8 0x00000010 /** set is 802.11 Country Element is present */ -#define WIFI_CAPABILITY_COUNTRY 0x00000020 +#define MLAN_CAPABILITY_COUNTRY 0x00000020 /** link layer status */ typedef struct { /** interface mode */ - wifi_interface_mode mode; + mlan_interface_mode mode; /** interface mac address (self) */ t_u8 mac_addr[6]; /** connection state (valid for STA, CLI only) */ - wifi_connection_state state; + mlan_connection_state state; /** roaming state */ - wifi_roam_state roaming; + mlan_roam_state roaming; /** WIFI_CAPABILITY_XXX (self) */ t_u32 capabilities; /** null terminated SSID */ @@ -1327,7 +1356,7 @@ typedef struct { t_u8 ap_country_str[3]; /** country string for this association */ t_u8 country_str[3]; -} wifi_interface_link_layer_info, *wifi_interface_handle; +} mlan_interface_link_layer_info, *mlan_interface_handle; /** channel statistics */ typedef struct { @@ -1340,14 +1369,6 @@ typedef struct { t_u32 cca_busy_time; } wifi_channel_stat; -/** timeval */ -typedef struct { - /** Time (seconds) */ - t_u32 time_sec; - /** Time (micro seconds) */ - t_u32 time_usec; -} wifi_timeval; - #define timeval_to_msec(timeval) \ (t_u64)((t_u64)(timeval.time_sec) * 1000 + \ (t_u64)(timeval.time_usec) / 1000) @@ -1482,7 +1503,7 @@ typedef struct { /** wifi interface */ /* wifi_interface_handle iface;*/ /** current state of the interface */ - wifi_interface_link_layer_info info; + mlan_interface_link_layer_info info; /** access point beacon received count from connected AP */ t_u32 beacon_rx; /** Average beacon offset encountered (beacon_TSF - TBTT) @@ -1666,6 +1687,9 @@ typedef struct _mlan_callbacks { const t_void *pmem2, t_u32 num); /** moal_udelay */ t_void (*moal_udelay)(t_void *pmoal_handle, t_u32 udelay); + /** moal_usleep_range */ + t_void (*moal_usleep_range)(t_void *pmoal_handle, t_u32 min_delay, + t_u32 max_delay); /** moal_get_boot_ktime */ mlan_status (*moal_get_boot_ktime)(t_void *pmoal_handle, t_u64 *pnsec); /** moal_get_system_time */ diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_fw.h b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_fw.h index 4f77888116cd..9612873407a0 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_fw.h +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_fw.h @@ -389,6 +389,9 @@ typedef enum _WLAN_802_11_WEP_STATUS { /** TLV type : Channel band list */ #define TLV_TYPE_CHANNELBANDLIST (PROPRIETARY_TLV_BASE_ID + 0x2a) /* 0x012a */ +/** TLV type : Security Cfg */ +#define TLV_TYPE_SECURITY_CFG (PROPRIETARY_TLV_BASE_ID + 0x3a) /* 0x013a */ + /** TLV type : Passphrase */ #define TLV_TYPE_PASSPHRASE (PROPRIETARY_TLV_BASE_ID + 0x3c) /* 0x013c */ /** TLV type : SAE Password */ @@ -1479,6 +1482,9 @@ typedef MLAN_PACK_START struct _MrvlIEtypes_He_cap_t { /** Host Command ID : Target device access */ #define HostCmd_CMD_TARGET_ACCESS 0x012a +/** Host Command ID: BCA device access */ +#define HostCmd_CMD_BCA_REG_ACCESS 0x0272 + /** Host Command ID: DFS repeater mode */ #define HostCmd_DFS_REPEATER_MODE 0x012b @@ -1588,6 +1594,8 @@ typedef MLAN_PACK_START struct _power_table_attr { #define HostCmd_CMD_TWT_CFG 0x0270 #define HostCmd_CMD_LOW_POWER_MODE_CFG 0x026e +#define HostCmd_CMD_UAP_BEACON_STUCK_CFG 0x0271 +#define HostCmd_CMD_ARB_CONFIG 0x0273 /** Enhanced PS modes */ typedef enum _ENH_PS_MODES { @@ -1798,6 +1806,8 @@ typedef enum _ENH_PS_MODES { /** Card Event definition : Pre-Beacon Lost */ #define EVENT_PRE_BEACON_LOST 0x00000031 +#define EVENT_WATCHDOG_TMOUT 0x00000032 + /** Card Event definition : Add BA event */ #define EVENT_ADDBA 0x00000033 /** Card Event definition : Del BA event */ @@ -2520,6 +2530,26 @@ typedef MLAN_PACK_START struct _MrvlIEtypes_RsnParamSet_t { t_u8 rsn_ie[]; } MLAN_PACK_END MrvlIEtypes_RsnParamSet_t; +/** MrvlIEtypes_SecurityCfg_t */ +typedef MLAN_PACK_START struct _MrvlIEtypes_SecurityCfg_t { + /** Header */ + MrvlIEtypesHeader_t header; + /** enable 11w */ + t_u8 use_mfp; +} MLAN_PACK_END MrvlIEtypes_SecurityCfg_t; + +/** Host Command ID : _HostCmd_DS_BEACON_STUCK_CFG */ +typedef MLAN_PACK_START struct _HostCmd_DS_BEACON_STUCK_CFG { + /** ACT_GET/ACT_SET */ + t_u8 action; + /** No of beacon interval after which firmware will check if beacon Tx + * is going fine */ + t_u8 beacon_stuck_detect_count; + /** Upon performing MAC reset, no of beacon interval after which + * firmware will check if recovery was successful */ + t_u8 recovery_confirm_count; +} MLAN_PACK_END HostCmd_DS_BEACON_STUCK_CFG; + /** Key Info flag for multicast key */ #define KEY_INFO_MCAST_KEY 0x01 /** Key Info flag for unicast key */ @@ -5299,6 +5329,16 @@ typedef MLAN_PACK_START struct _HostCmd_DS_MAC_REG_ACCESS { t_u32 value; } MLAN_PACK_END HostCmd_DS_MAC_REG_ACCESS; +/** HostCmd_CMD_BCA_REG_ACCESS */ +typedef MLAN_PACK_START struct _HostCmd_DS_BCA_REG_ACCESS { + /** Action */ + t_u16 action; + /** BCA register offset */ + t_u16 offset; + /** BCA register value */ + t_u32 value; +} MLAN_PACK_END HostCmd_DS_BCA_REG_ACCESS; + /** HostCmd_CMD_BBP_REG_ACCESS */ typedef MLAN_PACK_START struct _HostCmd_DS_BBP_REG_ACCESS { /** Acion */ @@ -6963,6 +7003,16 @@ typedef MLAN_PACK_START struct _HostCmd_DS_CMD_RX_ABORT_CFG_EXT { t_s8 ceil_rssi_threshold; } MLAN_PACK_END HostCmd_DS_CMD_RX_ABORT_CFG_EXT; +/** HostCmd_CMD_ARB_CONFIG */ +typedef MLAN_PACK_START struct _HostCmd_DS_CMD_ARB_CONFIG { + /** Action */ + t_u16 action; + /** 0-4 */ + t_u32 arb_mode; + /** 1: use FW enhancement, 0: use FW default */ + t_u32 reserved; +} MLAN_PACK_END HostCmd_DS_CMD_ARB_CONFIG; + /** HostCmd_DS_CMD_TX_AMPDU_PROT_MODE */ typedef MLAN_PACK_START struct _HostCmd_DS_CMD_TX_AMPDU_PROT_MODE { /** Action */ @@ -7166,7 +7216,8 @@ typedef struct MLAN_PACK_START _HostCmd_DS_COMMAND { HostCmd_DS_MEM_ACCESS mem; /** Target device access */ HostCmd_DS_TARGET_ACCESS target; - + /** BCA register access */ + HostCmd_DS_BCA_REG_ACCESS bca_reg; /** Inactivity timeout extend */ HostCmd_DS_INACTIVITY_TIMEOUT_EXT inactivity_to; #ifdef UAP_SUPPORT @@ -7258,9 +7309,11 @@ typedef struct MLAN_PACK_START _HostCmd_DS_COMMAND { HostCmd_DS_CHANNEL_TRPC_CONFIG ch_trpc_config; HostCmd_DS_LOW_POWER_MODE_CFG lpm_cfg; HostCmd_DS_BAND_STEERING band_steer_info; + HostCmd_DS_BEACON_STUCK_CFG beacon_stuck_cfg; struct mfg_cmd_generic_cfg mfg_generic_cfg; struct mfg_cmd_tx_cont mfg_tx_cont; struct mfg_cmd_tx_frame2 mfg_tx_frame2; + HostCmd_DS_CMD_ARB_CONFIG arb_cfg; } params; } MLAN_PACK_END HostCmd_DS_COMMAND, *pHostCmd_DS_COMMAND; diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_ioctl.h b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_ioctl.h index b22e69ccf924..9523410e6b57 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_ioctl.h +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_ioctl.h @@ -326,6 +326,9 @@ enum _mlan_ioctl_req_id { MLAN_OID_MISC_RF_TEST_GENERIC = 0x00200075, MLAN_OID_MISC_RF_TEST_TX_CONT = 0x00200076, MLAN_OID_MISC_RF_TEST_TX_FRAME = 0x00200077, + MLAN_OID_MISC_ARB_CONFIG = 0x00200078, + MLAN_OID_MISC_BEACON_STUCK = 0x00200079, + MLAN_OID_MISC_CFP_TABLE = 0x0020007A, }; /** Sub command size */ @@ -693,6 +696,8 @@ typedef struct _mlan_ssid_bssid { t_u32 channel_flags; /** host mlme flag*/ t_u8 host_mlme; + /* Use management frame protection (IEEE 802.11w) in this association*/ + t_u8 use_mfp; /** assoicate resp frame/ie from firmware */ mlan_ds_misc_assoc_rsp assoc_rsp; } mlan_ssid_bssid, *pmlan_ssid_bssid; @@ -2833,6 +2838,21 @@ typedef struct _mlan_ds_band_steer_cfg { t_u8 max_btm_req_allowed; } mlan_ds_band_steer_cfg, *pmlan_ds_band_steer_cfg; +/** Type definition of mlan_ds_beacon_stuck_param_cfg for MLAN_IOCTL_POWER_CFG + */ +typedef struct _mlan_ds_beacon_stuck_param_cfg { + /** subcmd */ + t_u32 subcmd; + /** Set/Get */ + t_u8 action; + /** No of beacon interval after which firmware will check if beacon Tx + * is going fine */ + t_u8 beacon_stuck_detect_count; + /** Upon performing MAC reset, no of beacon interval after which + * firmware will check if recovery was successful */ + t_u8 recovery_confirm_count; +} mlan_ds_beacon_stuck_param_cfg, *pmlan_ds_beacon_stuck_param_cfg; + /*-----------------------------------------------------------------*/ /** Power Management Configuration Group */ /*-----------------------------------------------------------------*/ @@ -3984,11 +4004,13 @@ enum _mlan_reg_type { MLAN_REG_RF, MLAN_REG_CAU = 5, MLAN_REG_PSU = 6, + MLAN_REG_BCA = 7, #if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \ defined(PCIE9097) || defined(USB9097) || defined(SD9097) MLAN_REG_MAC2 = 0x81, MLAN_REG_BBP2 = 0x82, - MLAN_REG_RF2 = 0x83 + MLAN_REG_RF2 = 0x83, + MLAN_REG_BCA2 = 0x87 #endif }; @@ -4309,6 +4331,14 @@ typedef struct _mlan_ds_misc_cfp_code { t_u32 cfp_code_a; } mlan_ds_misc_cfp_code; +/** Type definition of mlan_ds_misc_arb_cfg + * for MLAN_OID_MISC_ARB_CFG + */ +typedef struct _mlan_ds_misc_arb_cfg { + /** arb mode 0-4 */ + t_u32 arb_mode; +} mlan_ds_misc_arb_cfg; + /** Type definition of mlan_ds_misc_country_code * for MLAN_OID_MISC_COUNTRY_CODE */ @@ -4932,6 +4962,17 @@ typedef struct _mlan_ds_misc_chnrgpwr_cfg { /** chnrgpwr buf */ t_u8 chnrgpwr_buf[2048]; } mlan_ds_misc_chnrgpwr_cfg; + +/** dfs chan list for MLAN_OID_MISC_CFP_TABLE */ +typedef struct _mlan_ds_misc_cfp_tbl { + /** band */ + t_u8 band; + /** num chan */ + t_u8 num_chan; + /** cfp table */ + chan_freq_power_t cfp_tbl[]; +} mlan_ds_misc_cfp_tbl; + /** Type definition of mlan_ds_misc_cfg for MLAN_IOCTL_MISC_CFG */ typedef struct _mlan_ds_misc_cfg { /** Sub-command */ @@ -5042,9 +5083,12 @@ typedef struct _mlan_ds_misc_cfg { mlan_ds_misc_chnrgpwr_cfg rgchnpwr_cfg; mlan_ds_band_steer_cfg band_steer_cfg; + mlan_ds_beacon_stuck_param_cfg beacon_stuck_cfg; struct mfg_cmd_generic_cfg mfg_generic_cfg; struct mfg_cmd_tx_cont mfg_tx_cont; struct mfg_cmd_tx_frame2 mfg_tx_frame2; + mlan_ds_misc_arb_cfg arb_cfg; + mlan_ds_misc_cfp_tbl cfp; } param; } mlan_ds_misc_cfg, *pmlan_ds_misc_cfg; diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_join.c b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_join.c index 622d84da4ce9..81b46d19598e 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_join.c +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_join.c @@ -803,6 +803,7 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv, MrvlIEtypes_RatesParamSet_t *prates_tlv; MrvlIEtypes_AuthType_t *pauth_tlv; MrvlIEtypes_RsnParamSet_t *prsn_ie_tlv = MNULL; + MrvlIEtypes_SecurityCfg_t *psecurity_cfg_ie = MNULL; MrvlIEtypes_ChanListParamSet_t *pchan_tlv; WLAN_802_11_RATES rates; t_u32 rates_size; @@ -972,6 +973,20 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv, wlan_cpu_to_le16(prsn_ie_tlv->header.len); /** parse rsn ie to find whether ft akm is used*/ ft_akm = wlan_ft_akm_is_used(pmpriv, pmpriv->wpa_ie); + /* Append PMF Configuration coming from cfg80211 layer + */ + psecurity_cfg_ie = (MrvlIEtypes_SecurityCfg_t *)pos; + psecurity_cfg_ie->header.type = + wlan_cpu_to_le16(TLV_TYPE_SECURITY_CFG); + if (!pmpriv->curr_bss_params.use_mfp) + psecurity_cfg_ie->use_mfp = MFALSE; + else + psecurity_cfg_ie->use_mfp = MTRUE; + psecurity_cfg_ie->header.len = sizeof(t_u8); + pos += sizeof(psecurity_cfg_ie->header) + + psecurity_cfg_ie->header.len; + PRINTM(MCMND, "use_mfp=%d\n", + pmpriv->curr_bss_params.use_mfp); } #ifdef DRV_EMBEDDED_SUPPLICANT else if (supplicantIsEnabled(pmpriv->psapriv)) { diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_main.h b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_main.h index a0035f27db4d..ddfbfc52c35d 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_main.h +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_main.h @@ -851,6 +851,7 @@ typedef struct { t_u8 data_rates[WLAN_SUPPORTED_RATES]; /** Host MLME flag*/ t_u8 host_mlme; + t_u8 use_mfp; } current_bss_params_t; /** Sleep_params */ @@ -3325,6 +3326,12 @@ mlan_status wlan_cmd_cck_desense_cfg(pmlan_private pmpriv, mlan_status wlan_ret_cck_desense_cfg(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp, mlan_ioctl_req *pioctl_buf); + +mlan_status wlan_cmd_arb_cfg(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd, + t_u16 cmd_action, t_void *pdata_buf); +mlan_status wlan_ret_arb_cfg(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp, + mlan_ioctl_req *pioctl_buf); + mlan_status wlan_misc_ioctl_rxabortcfg(pmlan_adapter pmadapter, pmlan_ioctl_req pioctl_req); mlan_status wlan_misc_ioctl_rxabortcfg_ext(pmlan_adapter pmadapter, @@ -3341,6 +3348,8 @@ mlan_status wlan_ret_mfg(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp, mlan_ioctl_req *pioctl_buf); mlan_status wlan_misc_ioctl_rf_test_cfg(pmlan_adapter pmadapter, pmlan_ioctl_req pioctl_req); +mlan_status wlan_misc_ioctl_arb_cfg(pmlan_adapter pmadapter, + pmlan_ioctl_req pioctl_req); /* CFP related functions */ /** Region code index table */ extern t_u16 region_code_index[MRVDRV_MAX_REGION_CODE]; @@ -3688,6 +3697,8 @@ void wlan_free_fw_cfp_tables(mlan_adapter *pmadapter); mlan_status wlan_misc_chan_reg_cfg(pmlan_adapter pmadapter, pmlan_ioctl_req pioctl_req); +mlan_status wlan_get_cfp_table(pmlan_adapter pmadapter, + pmlan_ioctl_req pioctl_req); mlan_status wlan_get_cfpinfo(pmlan_adapter pmadapter, pmlan_ioctl_req pioctl_req); diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_misc.c b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_misc.c index d89e101599ce..33e51546a5e6 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_misc.c +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_misc.c @@ -1579,6 +1579,13 @@ mlan_status wlan_reg_mem_ioctl_reg_rw(pmlan_adapter pmadapter, case MLAN_REG_PSU: cmd_no = HostCmd_CMD_TARGET_ACCESS; break; + case MLAN_REG_BCA: +#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \ + defined(PCIE9097) || defined(USB9097) || defined(SD9097) + case MLAN_REG_BCA2: +#endif + cmd_no = HostCmd_CMD_BCA_REG_ACCESS; + break; default: pioctl_req->status_code = MLAN_ERROR_IOCTL_INVALID; ret = MLAN_STATUS_FAILURE; @@ -2089,13 +2096,13 @@ static void wlan_fill_link_statistic_in_host(mlan_private *priv, /* get wifi_interface_link_layer_info in driver, not in firmware */ if (priv->bss_role == MLAN_BSS_ROLE_STA) { - iface_stat->info.mode = WIFI_INTERFACE_STA; + iface_stat->info.mode = MLAN_INTERFACE_STA; if (priv->media_connected) - iface_stat->info.state = WIFI_ASSOCIATING; + iface_stat->info.state = MLAN_ASSOCIATING; else - iface_stat->info.state = WIFI_DISCONNECTED; - iface_stat->info.roaming = WIFI_ROAMING_IDLE; - iface_stat->info.capabilities = WIFI_CAPABILITY_QOS; + iface_stat->info.state = MLAN_DISCONNECTED; + iface_stat->info.roaming = MLAN_ROAMING_IDLE; + iface_stat->info.capabilities = MLAN_CAPABILITY_QOS; memcpy_ext(priv->adapter, iface_stat->info.ssid, priv->curr_bss_params.bss_descriptor.ssid.ssid, MLAN_MAX_SSID_LENGTH, MLAN_MAX_SSID_LENGTH); @@ -2103,8 +2110,8 @@ static void wlan_fill_link_statistic_in_host(mlan_private *priv, priv->curr_bss_params.bss_descriptor.mac_address, MLAN_MAC_ADDR_LENGTH, MLAN_MAC_ADDR_LENGTH); } else { - iface_stat->info.mode = WIFI_INTERFACE_SOFTAP; - iface_stat->info.capabilities = WIFI_CAPABILITY_QOS; + iface_stat->info.mode = MLAN_INTERFACE_SOFTAP; + iface_stat->info.capabilities = MLAN_CAPABILITY_QOS; } memcpy_ext(priv->adapter, iface_stat->info.mac_addr, priv->curr_addr, MLAN_MAC_ADDR_LENGTH, MLAN_MAC_ADDR_LENGTH); @@ -2161,7 +2168,7 @@ static void wlan_fill_link_statistic_in_host(mlan_private *priv, priv->curr_bss_params.bss_descriptor.mac_address, MLAN_MAC_ADDR_LENGTH, MLAN_MAC_ADDR_LENGTH); iface_stat->peer_info[0].capabilities = - WIFI_CAPABILITY_QOS; + MLAN_CAPABILITY_QOS; wlan_fill_hal_wifi_rate_in_host( priv, iface_stat->peer_info[0].rate_stats, &(iface_stat->peer_info[0].num_rate)); @@ -2183,7 +2190,7 @@ static void wlan_fill_link_statistic_in_host(mlan_private *priv, MLAN_MAC_ADDR_LENGTH, MLAN_MAC_ADDR_LENGTH); iface_stat->peer_info[num_peers].capabilities = - WIFI_CAPABILITY_QOS; + MLAN_CAPABILITY_QOS; wlan_fill_hal_wifi_rate_in_host( priv, iface_stat->peer_info[num_peers] @@ -2728,7 +2735,7 @@ void wlan_add_ext_capa_info_ie(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc, SET_EXTCAP_EXT_CHANNEL_SWITCH(pmpriv->ext_cap); else RESET_EXTCAP_EXT_CHANNEL_SWITCH(pmpriv->ext_cap); - if (pbss_desc && wlan_check_11ax_twt_supported(pmpriv, pbss_desc)) + if (wlan_check_11ax_twt_supported(pmpriv, pbss_desc)) SET_EXTCAP_TWT_REQ(pmpriv->ext_cap); memcpy_ext(pmpriv->adapter, &pext_cap->ext_cap, &pmpriv->ext_cap, sizeof(pmpriv->ext_cap), sizeof(pext_cap->ext_cap)); @@ -5248,7 +5255,7 @@ mlan_status wlan_misc_ioctl_oper_class(pmlan_adapter pmadapter, { pmlan_private pmpriv = pmadapter->priv[pioctl_req->bss_index]; mlan_ds_misc_cfg *misc = MNULL; - t_u8 channel, bandwidth, oper_class; + t_u8 channel, bandwidth, oper_class = 0; mlan_status ret = MLAN_STATUS_SUCCESS; ENTER(); diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_pcie.c b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_pcie.c index ec6b501b26cc..04cd3f403422 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_pcie.c +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_pcie.c @@ -2294,7 +2294,7 @@ static mlan_status wlan_pcie_process_cmd_resp(mlan_adapter *pmadapter) mlan_status ret = MLAN_STATUS_SUCCESS; pmlan_callbacks pcb = &pmadapter->callbacks; pmlan_buffer pmbuf = pmadapter->pcard_pcie->cmdrsp_buf; - + pmlan_buffer cmd_buf = MNULL; t_u16 resp_len = 0; ENTER(); @@ -2349,6 +2349,15 @@ static mlan_status wlan_pcie_process_cmd_resp(mlan_adapter *pmadapter) mlan_delay_for_sleep_cookie(pmadapter, MAX_DELAY_LOOP_COUNT); #endif + cmd_buf = pmadapter->pcard_pcie->cmd_buf; + if (cmd_buf) { + pcb->moal_unmap_memory( + pmadapter->pmoal_handle, + cmd_buf->pbuf + cmd_buf->data_offset, + cmd_buf->buf_pa, WLAN_UPLD_SIZE, + PCI_DMA_TODEVICE); + pmadapter->pcard_pcie->cmd_buf = MNULL; + } } memcpy_ext(pmadapter, pmadapter->upld_buf, pmbuf->pbuf + pmbuf->data_offset + @@ -2990,9 +2999,9 @@ static mlan_status wlan_pcie_prog_fw_w_helper(mlan_adapter *pmadapter, "Failed reading length from boot code\n"); goto done; } - if (len) + if (len || offset) break; - wlan_udelay(pmadapter, 50); + wlan_udelay(pmadapter, 10); } if (!len) { @@ -3113,6 +3122,7 @@ static mlan_status wlan_pcie_prog_fw_w_helper(mlan_adapter *pmadapter, goto done; } read_retry_cnt++; + pcb->moal_usleep_range(pmadapter->pmoal_handle, 10, 20); } while ((ireg_intr & CPU_INTR_DOOR_BELL) == CPU_INTR_DOOR_BELL); /* got interrupt - can unmap buffer now */ diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_sdio.c b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_sdio.c index b56118bbdcef..d216caa6acdc 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_sdio.c +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_sdio.c @@ -661,7 +661,7 @@ static mlan_status wlan_sdio_prog_fw_w_helper(pmlan_adapter pmadapter, t_u8 *fw, check_fw_status = MTRUE; } #endif -#ifdef SD9097 +#if defined(SD9097) if (IS_SD9097(pmadapter->card_type)) check_fw_status = MTRUE; #endif diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_shim.c b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_shim.c index 60472c8db461..903b4e263849 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_shim.c +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_shim.c @@ -254,10 +254,14 @@ mlan_status mlan_register(pmlan_device pmdevice, t_void **ppmlan_adapter) MASSERT(pmdevice->callbacks.moal_mfree); MASSERT(pmdevice->callbacks.moal_memset); MASSERT(pmdevice->callbacks.moal_memmove); + MASSERT(pmdevice->callbacks.moal_udelay); + MASSERT(pmdevice->callbacks.moal_usleep_range); if (!pmdevice->callbacks.moal_malloc || !pmdevice->callbacks.moal_mfree || !pmdevice->callbacks.moal_memset || + !pmdevice->callbacks.moal_udelay || + !pmdevice->callbacks.moal_usleep_range || !pmdevice->callbacks.moal_memmove) { LEAVE(); return MLAN_STATUS_FAILURE; diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_sta_cmd.c b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_sta_cmd.c index 2be2c32a263a..982988cbb233 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_sta_cmd.c +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_sta_cmd.c @@ -2100,6 +2100,48 @@ static mlan_status wlan_cmd_get_sensor_temp(pmlan_private pmpriv, } /** + * @brief This function prepares command of arb cfg + * + * @param pmpriv A pointer to mlan_private structure + * @param cmd A pointer to HostCmd_DS_COMMAND structure + * @param cmd_action the action: GET or SET + * @param pdata_buf A pointer to data buffer + * @return MLAN_STATUS_SUCCESS + */ +mlan_status wlan_cmd_arb_cfg(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd, + t_u16 cmd_action, t_void *pdata_buf) +{ + HostCmd_DS_CMD_ARB_CONFIG *cfg_cmd = + (HostCmd_DS_CMD_ARB_CONFIG *)&cmd->params.arb_cfg; + mlan_ds_misc_arb_cfg *misc_cfg = (mlan_ds_misc_arb_cfg *)pdata_buf; + + ENTER(); + + cmd->command = wlan_cpu_to_le16(HostCmd_CMD_ARB_CONFIG); + cmd->size = + wlan_cpu_to_le16(sizeof(HostCmd_DS_CMD_ARB_CONFIG) + S_DS_GEN); + cfg_cmd->action = wlan_cpu_to_le16(cmd_action); + + if (cmd_action == HostCmd_ACT_GEN_SET) { + cfg_cmd->arb_mode = wlan_cpu_to_le32(misc_cfg->arb_mode); + if (misc_cfg->arb_mode == 3) { +#define DEF_ARB_TX_WIN 4 +#define DEF_ARB_TIMEOUT 0 + pmpriv->add_ba_param.timeout = DEF_ARB_TIMEOUT; + pmpriv->add_ba_param.tx_win_size = DEF_ARB_TX_WIN; + } else { + pmpriv->add_ba_param.timeout = + MLAN_DEFAULT_BLOCK_ACK_TIMEOUT; + pmpriv->add_ba_param.tx_win_size = + MLAN_STA_AMPDU_DEF_TXWINSIZE; + } + } + + LEAVE(); + return MLAN_STATUS_SUCCESS; +} + +/** * @brief This function sends get sta band channel command to firmware. * * @param priv A pointer to mlan_private structure @@ -2611,6 +2653,7 @@ mlan_status wlan_ops_sta_prepare_cmd(t_void *priv, t_u16 cmd_no, case HostCmd_CMD_CAU_REG_ACCESS: case HostCmd_CMD_TARGET_ACCESS: case HostCmd_CMD_802_11_EEPROM_ACCESS: + case HostCmd_CMD_BCA_REG_ACCESS: ret = wlan_cmd_reg_access(pmpriv, cmd_ptr, cmd_action, pdata_buf); break; @@ -2779,6 +2822,9 @@ mlan_status wlan_ops_sta_prepare_cmd(t_void *priv, t_u16 cmd_no, ret = wlan_cmd_rxabortcfg_ext(pmpriv, cmd_ptr, cmd_action, pdata_buf); break; + case HostCmd_CMD_ARB_CONFIG: + ret = wlan_cmd_arb_cfg(pmpriv, cmd_ptr, cmd_action, pdata_buf); + break; case HostCmd_CMD_TX_AMPDU_PROT_MODE: ret = wlan_cmd_tx_ampdu_prot_mode(pmpriv, cmd_ptr, cmd_action, pdata_buf); diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_sta_cmdresp.c b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_sta_cmdresp.c index 318bdf476a1c..5e1a5b1a659f 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_sta_cmdresp.c +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_sta_cmdresp.c @@ -1943,6 +1943,33 @@ mlan_status wlan_ret_get_sensor_temp(pmlan_private pmpriv, } /** + * @brief This function handles the command response of arb Cfg + * + * @param pmpriv A pointer to mlan_private structure + * @param resp A pointer to HostCmd_DS_COMMAND + * @param pioctl_buf A pointer to mlan_ioctl_req structure + * + * @return MLAN_STATUS_SUCCESS + */ +mlan_status wlan_ret_arb_cfg(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp, + mlan_ioctl_req *pioctl_buf) +{ + HostCmd_DS_CMD_ARB_CONFIG *cfg_cmd = + (HostCmd_DS_CMD_ARB_CONFIG *)&resp->params.arb_cfg; + mlan_ds_misc_cfg *misc_cfg = MNULL; + + ENTER(); + + if (pioctl_buf) { + misc_cfg = (mlan_ds_misc_cfg *)pioctl_buf->pbuf; + misc_cfg->param.arb_cfg.arb_mode = + wlan_le32_to_cpu(cfg_cmd->arb_mode); + } + LEAVE(); + return MLAN_STATUS_SUCCESS; +} + +/** * @brief This function handles the command response of sta get band and * channel * @@ -2533,6 +2560,7 @@ mlan_status wlan_ops_sta_process_cmdresp(t_void *priv, t_u16 cmdresp_no, case HostCmd_CMD_CAU_REG_ACCESS: case HostCmd_CMD_TARGET_ACCESS: case HostCmd_CMD_802_11_EEPROM_ACCESS: + case HostCmd_CMD_BCA_REG_ACCESS: ret = wlan_ret_reg_access(pmpriv->adapter, cmdresp_no, resp, pioctl_buf); break; @@ -2655,6 +2683,9 @@ mlan_status wlan_ops_sta_process_cmdresp(t_void *priv, t_u16 cmdresp_no, case HostCmd_CMD_RX_ABORT_CFG_EXT: ret = wlan_ret_rxabortcfg_ext(pmpriv, resp, pioctl_buf); break; + case HostCmd_CMD_ARB_CONFIG: + ret = wlan_ret_arb_cfg(pmpriv, resp, pioctl_buf); + break; case HostCmd_CMD_TX_AMPDU_PROT_MODE: ret = wlan_ret_tx_ampdu_prot_mode(pmpriv, resp, pioctl_buf); break; diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_sta_event.c b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_sta_event.c index 304efa99eceb..f5acb10cda68 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_sta_event.c +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_sta_event.c @@ -25,6 +25,7 @@ Change log: 10/13/2008: initial version ********************************************************/ +#include <linux/types.h> #include "mlan.h" #include "mlan_join.h" #include "mlan_util.h" @@ -981,7 +982,7 @@ mlan_status wlan_ops_sta_process_event(t_void *priv) pevent->bss_index = pmpriv->bss_index; pevent->event_id = MLAN_EVENT_ID_SSU_DUMP_FILE; pevent->event_len = MLAN_SSU_BUF_SIZE; - *(t_u64 *)pevent->event_buf = (t_u64)pmadapter->ssu_buf->pbuf + + *(t_u64 *)pevent->event_buf = (uintptr_t)pmadapter->ssu_buf->pbuf + pmadapter->ssu_buf->data_offset; wlan_recv_event(pmpriv, pevent->event_id, pevent); wlan_free_ssu_pcie_buf(pmadapter); diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_sta_ioctl.c b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_sta_ioctl.c index 159328d554a3..908e688e37ef 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_sta_ioctl.c +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_sta_ioctl.c @@ -1059,6 +1059,8 @@ static mlan_status wlan_bss_ioctl_start(pmlan_adapter pmadapter, "SSID found in scan list ... associating...\n"); pmpriv->curr_bss_params.host_mlme = bss->param.ssid_bssid.host_mlme; + pmpriv->curr_bss_params.use_mfp = + bss->param.ssid_bssid.use_mfp; /* Clear any past association response stored for * application retrieval */ pmpriv->assoc_rsp_size = 0; @@ -4775,6 +4777,37 @@ mlan_status wlan_misc_pmfcfg(pmlan_adapter pmadapter, return ret; } +/** + * @brief HW ARB Cfg + * + * @param pmadapter A pointer to mlan_adapter structure + * @param pioctl_req A pointer to ioctl request buffer + * + * @return MLAN_STATUS_PENDING --success, otherwise fail + */ +mlan_status wlan_misc_ioctl_arb_cfg(pmlan_adapter pmadapter, + pmlan_ioctl_req pioctl_req) +{ + mlan_private *pmpriv = pmadapter->priv[pioctl_req->bss_index]; + mlan_ds_misc_cfg *pmisc = (mlan_ds_misc_cfg *)pioctl_req->pbuf; + mlan_status ret = MLAN_STATUS_SUCCESS; + t_u16 cmd_action = 0; + + ENTER(); + + if (pioctl_req->action == MLAN_ACT_SET) + cmd_action = HostCmd_ACT_GEN_SET; + else + cmd_action = HostCmd_ACT_GEN_GET; + ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_ARB_CONFIG, cmd_action, 0, + (t_void *)pioctl_req, &(pmisc->param.arb_cfg)); + if (ret == MLAN_STATUS_SUCCESS) + ret = MLAN_STATUS_PENDING; + + LEAVE(); + return ret; +} + mlan_status wlan_misc_ioctl_get_sensor_temp(pmlan_adapter pmadapter, pmlan_ioctl_req pioctl_req) { @@ -5133,6 +5166,9 @@ static mlan_status wlan_misc_cfg_ioctl(pmlan_adapter pmadapter, case MLAN_OID_MISC_RF_TEST_TX_FRAME: status = wlan_misc_ioctl_rf_test_cfg(pmadapter, pioctl_req); break; + case MLAN_OID_MISC_ARB_CONFIG: + status = wlan_misc_ioctl_arb_cfg(pmadapter, pioctl_req); + break; default: if (pioctl_req) pioctl_req->status_code = MLAN_ERROR_IOCTL_INVALID; diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_uap_cmdevent.c b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_uap_cmdevent.c index 9715131bbc85..45ea63030b9b 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_uap_cmdevent.c +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_uap_cmdevent.c @@ -115,6 +115,70 @@ mlan_status wlan_ret_set_get_band_steering_cfg(mlan_private *pmpriv, } /** + * @brief This function prepares command of BEACON_STUCK_CFG + * + * @param pmpriv A pointer to mlan_private structure + * @param cmd A pointer to HostCmd_DS_COMMAND structure + * @param cmd_action + * @param pdata_buf A pointer to data buffer + * @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE + */ +mlan_status wlan_cmd_set_get_beacon_stuck_cfg(IN pmlan_private pmpriv, + IN HostCmd_DS_COMMAND *cmd, + IN t_u16 cmd_action, + IN t_void *pdata_buf) +{ + HostCmd_DS_BEACON_STUCK_CFG *pbeacon_stuck_param_cfg = + (HostCmd_DS_BEACON_STUCK_CFG *)(pdata_buf + sizeof(t_u32)); + + ENTER(); + + cmd->command = wlan_cpu_to_le16(HostCmd_CMD_UAP_BEACON_STUCK_CFG); + cmd->size = wlan_cpu_to_le16(sizeof(HostCmd_DS_BEACON_STUCK_CFG) + + S_DS_GEN); + cmd->params.beacon_stuck_cfg.beacon_stuck_detect_count = + pbeacon_stuck_param_cfg->beacon_stuck_detect_count; + cmd->params.beacon_stuck_cfg.recovery_confirm_count = + pbeacon_stuck_param_cfg->recovery_confirm_count; + cmd->params.beacon_stuck_cfg.action = cmd_action; + + LEAVE(); + return MLAN_STATUS_SUCCESS; +} + +/** + * @brief This function handle response of HostCmd_CMD_UAP_BEACON_STUCK_CFG + * + * @param pmpriv A pointer to mlan_private structure + * @param resp Pointer to command response buffer + * + * @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE + */ +mlan_status wlan_ret_set_get_beacon_stuck_cfg(mlan_private *pmpriv, + HostCmd_DS_COMMAND *resp, + mlan_ioctl_req *pioctl_buf) +{ + mlan_status ret = MLAN_STATUS_SUCCESS; + HostCmd_DS_BEACON_STUCK_CFG *pbeacon_stuck_param_cfg = + &resp->params.beacon_stuck_cfg; + mlan_ds_misc_cfg *pbeacon_stuck; + + ENTER(); + + pbeacon_stuck = (mlan_ds_misc_cfg *)pioctl_buf->pbuf; + + pbeacon_stuck->param.beacon_stuck_cfg.action = + pbeacon_stuck_param_cfg->action; + pbeacon_stuck->param.beacon_stuck_cfg.beacon_stuck_detect_count = + pbeacon_stuck_param_cfg->beacon_stuck_detect_count; + pbeacon_stuck->param.beacon_stuck_cfg.recovery_confirm_count = + pbeacon_stuck_param_cfg->recovery_confirm_count; + + LEAVE(); + return ret; +} + +/** * @brief This function handles the command response error * * @param pmpriv A pointer to mlan_private structure @@ -4000,6 +4064,7 @@ static mlan_status wlan_uap_cmd_add_station(pmlan_private pmpriv, mlan_adapter *pmadapter = pmpriv->adapter; MrvlIETypes_HTCap_t *phtcap; MrvlIETypes_VHTCap_t *pvhtcap; + MrvlIEtypes_Extension_t *pext_tlv; MrvlIEtypes_StaFlag_t *pstaflag; int i; @@ -4103,6 +4168,13 @@ static mlan_status wlan_uap_cmd_add_station(pmlan_private pmpriv, break; case OPER_MODE_NTF: break; + case EXTENSION: + pext_tlv = (MrvlIEtypes_Extension_t *)tlv; + if (pext_tlv->ext_id == HE_CAPABILITY) { + sta_ptr->is_11ax_enabled = MTRUE; + PRINTM(MCMND, "STA supports 11ax\n"); + } + break; default: break; } @@ -4119,12 +4191,7 @@ static mlan_status wlan_uap_cmd_add_station(pmlan_private pmpriv, tlv_buf_left -= sizeof(MrvlIEtypesHeader_t) + tlv_len; } - if (sta_ptr->is_11ac_enabled) { - if (pmpriv->uap_channel <= 14) - sta_ptr->bandmode = BAND_GAC; - else - sta_ptr->bandmode = BAND_AAC; - } else if (sta_ptr->is_11n_enabled) { + if (sta_ptr->is_11n_enabled) { if (pmpriv->uap_channel <= 14) sta_ptr->bandmode = BAND_GN; else @@ -4136,6 +4203,19 @@ static mlan_status wlan_uap_cmd_add_station(pmlan_private pmpriv, sta_ptr->bandmode = BAND_A; } else sta_ptr->bandmode = BAND_B; + if (sta_ptr->is_11ac_enabled) { + if (pmpriv->uap_channel <= 14) + sta_ptr->bandmode = BAND_GAC; + else + sta_ptr->bandmode = BAND_AAC; + } + if (sta_ptr->is_11ax_enabled) { + if (pmpriv->uap_channel <= 14) + sta_ptr->bandmode = BAND_GAX; + else + sta_ptr->bandmode = BAND_AAX; + } + for (i = 0; i < MAX_NUM_TID; i++) { if (sta_ptr->is_11n_enabled) sta_ptr->ampdu_sta[i] = @@ -4390,7 +4470,9 @@ mlan_status wlan_ops_uap_prepare_cmd(t_void *priv, t_u16 cmd_no, case HostCmd_CMD_BBP_REG_ACCESS: case HostCmd_CMD_RF_REG_ACCESS: case HostCmd_CMD_CAU_REG_ACCESS: + case HostCmd_CMD_TARGET_ACCESS: case HostCmd_CMD_802_11_EEPROM_ACCESS: + case HostCmd_CMD_BCA_REG_ACCESS: ret = wlan_cmd_reg_access(pmpriv, cmd_ptr, cmd_action, pdata_buf); break; @@ -4505,6 +4587,10 @@ mlan_status wlan_ops_uap_prepare_cmd(t_void *priv, t_u16 cmd_no, ret = wlan_cmd_set_get_band_steering_cfg(pmpriv, cmd_ptr, cmd_action, pdata_buf); break; + case HostCmd_CMD_UAP_BEACON_STUCK_CFG: + ret = wlan_cmd_set_get_beacon_stuck_cfg(pmpriv, cmd_ptr, + cmd_action, pdata_buf); + break; default: PRINTM(MERROR, "PREP_CMD: unknown command- %#x\n", cmd_no); if (pioctl_req) @@ -4772,7 +4858,9 @@ mlan_status wlan_ops_uap_process_cmdresp(t_void *priv, t_u16 cmdresp_no, case HostCmd_CMD_BBP_REG_ACCESS: case HostCmd_CMD_RF_REG_ACCESS: case HostCmd_CMD_CAU_REG_ACCESS: + case HostCmd_CMD_TARGET_ACCESS: case HostCmd_CMD_802_11_EEPROM_ACCESS: + case HostCmd_CMD_BCA_REG_ACCESS: ret = wlan_ret_reg_access(pmpriv->adapter, cmdresp_no, resp, pioctl_buf); break; @@ -4863,6 +4951,10 @@ mlan_status wlan_ops_uap_process_cmdresp(t_void *priv, t_u16 cmdresp_no, ret = wlan_ret_set_get_band_steering_cfg(pmpriv, resp, pioctl_buf); break; + case HostCmd_CMD_UAP_BEACON_STUCK_CFG: + ret = wlan_ret_set_get_beacon_stuck_cfg(pmpriv, resp, + pioctl_buf); + break; default: PRINTM(MERROR, "CMD_RESP: Unknown command response %#x\n", resp->command); @@ -5338,6 +5430,18 @@ mlan_status wlan_ops_uap_process_event(t_void *priv) pmadapter->fw_hang_report = MTRUE; wlan_recv_event(pmpriv, MLAN_EVENT_ID_DRV_DBG_DUMP, MNULL); break; + case EVENT_WATCHDOG_TMOUT: + PRINTM(MEVENT, "EVENT: EVENT_WATCHDOG_TMOUT reasoncode=%d\n", + wlan_le16_to_cpu(*(t_u16 *)(pmbuf->pbuf + + pmbuf->data_offset + + sizeof(eventcause)))); + pevent->event_id = MLAN_EVENT_ID_DRV_WIFI_STATUS; + pevent->event_len = sizeof(pevent->event_id) + sizeof(t_u16); + memcpy_ext(pmadapter, (t_u8 *)pevent->event_buf, + pmbuf->pbuf + pmbuf->data_offset + + sizeof(eventcause), + sizeof(t_u16), sizeof(t_u16)); + break; default: pevent->event_id = MLAN_EVENT_ID_DRV_PASSTHRU; break; diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_uap_ioctl.c b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_uap_ioctl.c index 3df8d78c6c7f..5f2040ccbbf3 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_uap_ioctl.c +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_uap_ioctl.c @@ -1205,6 +1205,48 @@ static mlan_status wlan_misc_band_steering_cfg(pmlan_adapter pmadapter, } /** + * @brief Set Beacon Stuck Detect Mechanism Configurations + * + * @param pmadapter A pointer to mlan_adapter structure + * @param pioctl_req A pointer to ioctl request buffer + * + * @return MLAN_STATUS_SUCCES/MLAN_STATUS_PENDING --success, + * otherwise fail + */ +static mlan_status wlan_misc_beacon_stuck_cfg(IN pmlan_adapter pmadapter, + IN pmlan_ioctl_req pioctl_req) +{ + mlan_status ret = MLAN_STATUS_SUCCESS; + mlan_private *pmpriv = pmadapter->priv[pioctl_req->bss_index]; + mlan_ds_misc_cfg *pm = MNULL; + + ENTER(); + + if (pioctl_req->buf_len < sizeof(mlan_ds_beacon_stuck_param_cfg)) { + PRINTM(MWARN, "MLAN bss IOCTL length is too short.\n"); + pioctl_req->data_read_written = 0; + pioctl_req->buf_len_needed = + sizeof(mlan_ds_beacon_stuck_param_cfg); + pioctl_req->status_code = MLAN_ERROR_INVALID_PARAMETER; + LEAVE(); + return MLAN_STATUS_RESOURCE; + } + pm = (mlan_ds_misc_cfg *)pioctl_req->pbuf; + + ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_UAP_BEACON_STUCK_CFG, + (t_u16)pm->param.beacon_stuck_cfg.action, 0, + (t_void *)pioctl_req, + (t_void *)&pm->param.beacon_stuck_cfg); + + LEAVE(); + + if (ret == MLAN_STATUS_SUCCESS) + ret = MLAN_STATUS_PENDING; + + return ret; +} + +/** * @brief Set SNMP MIB for 11D * * @param pmadapter A pointer to mlan_adapter structure @@ -2051,8 +2093,13 @@ mlan_status wlan_ops_uap_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req) if (misc->sub_command == MLAN_OID_MISC_BAND_STEERING) status = wlan_misc_band_steering_cfg(pmadapter, pioctl_req); + if (misc->sub_command == MLAN_OID_MISC_BEACON_STUCK) + status = wlan_misc_beacon_stuck_cfg(pmadapter, + pioctl_req); if (misc->sub_command == MLAN_OID_MISC_GET_REGIONPWR_CFG) status = wlan_get_rgchnpwr_cfg(pmadapter, pioctl_req); + if (misc->sub_command == MLAN_OID_MISC_CFP_TABLE) + status = wlan_get_cfp_table(pmadapter, pioctl_req); break; case MLAN_IOCTL_POWER_CFG: power = (mlan_ds_power_cfg *)pioctl_req->pbuf; diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_usb.c b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_usb.c index 2b98de478251..5a5f2d8aa71e 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_usb.c +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlan/mlan_usb.c @@ -231,7 +231,7 @@ static mlan_status wlan_usb_prog_fw_w_helper(pmlan_adapter pmadapter, check_fw_status = MTRUE; } #endif -#ifdef USB9097 +#if defined(USB9097) if (IS_USB9097(pmadapter->card_type)) check_fw_status = MTRUE; #endif diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/mlan_decl.h b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/mlan_decl.h index 63d61566e7cb..f566e3091996 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/mlan_decl.h +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/mlan_decl.h @@ -24,7 +24,7 @@ #define _MLAN_DECL_H_ /** MLAN release version */ -#define MLAN_RELEASE_VERSION "186.p6" +#define MLAN_RELEASE_VERSION "203" /** Re-define generic data types for MLAN/MOAL */ /** Signed char (1-byte) */ @@ -198,6 +198,10 @@ typedef t_s32 t_sval; #define MLAN_RATE_INDEX_OFDM7 11 /** Rate index for MCS 0 */ #define MLAN_RATE_INDEX_MCS0 0 +/** Rate index for MCS 2 */ +#define MLAN_RATE_INDEX_MCS2 2 +/** Rate index for MCS 4 */ +#define MLAN_RATE_INDEX_MCS4 4 /** Rate index for MCS 7 */ #define MLAN_RATE_INDEX_MCS7 7 /** Rate index for MCS 9 */ @@ -556,8 +560,6 @@ typedef enum { #define MREG_D MBIT(9) -#define MLOG_D MBIT(10) - #define MMPA_D MBIT(15) #define MDAT_D MBIT(16) #define MCMD_D MBIT(17) @@ -751,6 +753,7 @@ typedef enum _mlan_event_id { MLAN_EVENT_ID_DRV_ASSOC_FAILURE_LOGGER = 0x80000026, MLAN_EVENT_ID_DRV_ASSOC_SUCC_LOGGER = 0x80000027, MLAN_EVENT_ID_DRV_DISCONNECT_LOGGER = 0x80000028, + MLAN_EVENT_ID_DRV_WIFI_STATUS = 0x80000029, } mlan_event_id; /** Data Structures */ @@ -772,12 +775,30 @@ typedef MLAN_PACK_START struct _MrvlIEtypesHeader { t_u16 len; } MLAN_PACK_END MrvlIEtypesHeader_t; +/** MrvlExtIEtypesHeader_t */ +typedef MLAN_PACK_START struct _MrvlExtIEtypesHeader { + /** Header type */ + t_u16 type; + /** Header length */ + t_u16 len; + /** ext id */ + t_u8 ext_id; +} MLAN_PACK_END MrvlExtIEtypesHeader_t; + +/** MrvlIEtypes_Data_t */ +typedef MLAN_PACK_START struct _MrvlExtIEtypes_Data_t { + /** Header */ + MrvlExtIEtypesHeader_t header; + /** Data */ + t_u8 data[]; +} MLAN_PACK_END MrvlExtIEtypes_Data_t; + /** MrvlIEtypes_Data_t */ typedef MLAN_PACK_START struct _MrvlIEtypes_Data_t { /** Header */ MrvlIEtypesHeader_t header; /** Data */ - t_u8 data[1]; + t_u8 data[]; } MLAN_PACK_END MrvlIEtypes_Data_t; #define OID_TYPE_CAL 0x2 @@ -1259,6 +1280,14 @@ typedef enum { WIFI_PREAMBLE_VHT = 0x4 } wifi_preamble; +/** timeval */ +typedef struct { + /** Time (seconds) */ + t_u32 time_sec; + /** Time (micro seconds) */ + t_u32 time_usec; +} wifi_timeval; + #define MAX_NUM_RATE 32 #define MAX_RADIO 2 #define MAX_NUM_CHAN 1 @@ -1268,55 +1297,55 @@ typedef enum { #define BUF_MAXLEN 4096 /** connection state */ typedef enum { - WIFI_DISCONNECTED = 0, - WIFI_AUTHENTICATING = 1, - WIFI_ASSOCIATING = 2, - WIFI_ASSOCIATED = 3, + MLAN_DISCONNECTED = 0, + MLAN_AUTHENTICATING = 1, + MLAN_ASSOCIATING = 2, + MLAN_ASSOCIATED = 3, /** if done by firmware/driver */ - WIFI_EAPOL_STARTED = 4, + MLAN_EAPOL_STARTED = 4, /** if done by firmware/driver */ - WIFI_EAPOL_COMPLETED = 5, -} wifi_connection_state; + MLAN_EAPOL_COMPLETED = 5, +} mlan_connection_state; /** roam state */ typedef enum { - WIFI_ROAMING_IDLE = 0, - WIFI_ROAMING_ACTIVE = 1, -} wifi_roam_state; + MLAN_ROAMING_IDLE = 0, + MLAN_ROAMING_ACTIVE = 1, +} mlan_roam_state; /** interface mode */ typedef enum { - WIFI_INTERFACE_STA = 0, - WIFI_INTERFACE_SOFTAP = 1, - WIFI_INTERFACE_IBSS = 2, - WIFI_INTERFACE_P2P_CLIENT = 3, - WIFI_INTERFACE_P2P_GO = 4, - WIFI_INTERFACE_NAN = 5, - WIFI_INTERFACE_MESH = 6, -} wifi_interface_mode; + MLAN_INTERFACE_STA = 0, + MLAN_INTERFACE_SOFTAP = 1, + MLAN_INTERFACE_IBSS = 2, + MLAN_INTERFACE_P2P_CLIENT = 3, + MLAN_INTERFACE_P2P_GO = 4, + MLAN_INTERFACE_NAN = 5, + MLAN_INTERFACE_MESH = 6, +} mlan_interface_mode; /** set for QOS association */ -#define WIFI_CAPABILITY_QOS 0x00000001 +#define MLAN_CAPABILITY_QOS 0x00000001 /** set for protected association (802.11 beacon frame control protected bit * set) */ -#define WIFI_CAPABILITY_PROTECTED 0x00000002 +#define MLAN_CAPABILITY_PROTECTED 0x00000002 /** set if 802.11 Extended Capabilities element interworking bit is set */ -#define WIFI_CAPABILITY_INTERWORKING 0x00000004 +#define MLAN_CAPABILITY_INTERWORKING 0x00000004 /** set for HS20 association */ -#define WIFI_CAPABILITY_HS20 0x00000008 +#define MLAN_CAPABILITY_HS20 0x00000008 /** set is 802.11 Extended Capabilities element UTF-8 SSID bit is set */ -#define WIFI_CAPABILITY_SSID_UTF8 0x00000010 +#define MLAN_CAPABILITY_SSID_UTF8 0x00000010 /** set is 802.11 Country Element is present */ -#define WIFI_CAPABILITY_COUNTRY 0x00000020 +#define MLAN_CAPABILITY_COUNTRY 0x00000020 /** link layer status */ typedef struct { /** interface mode */ - wifi_interface_mode mode; + mlan_interface_mode mode; /** interface mac address (self) */ t_u8 mac_addr[6]; /** connection state (valid for STA, CLI only) */ - wifi_connection_state state; + mlan_connection_state state; /** roaming state */ - wifi_roam_state roaming; + mlan_roam_state roaming; /** WIFI_CAPABILITY_XXX (self) */ t_u32 capabilities; /** null terminated SSID */ @@ -1327,7 +1356,7 @@ typedef struct { t_u8 ap_country_str[3]; /** country string for this association */ t_u8 country_str[3]; -} wifi_interface_link_layer_info, *wifi_interface_handle; +} mlan_interface_link_layer_info, *mlan_interface_handle; /** channel statistics */ typedef struct { @@ -1340,14 +1369,6 @@ typedef struct { t_u32 cca_busy_time; } wifi_channel_stat; -/** timeval */ -typedef struct { - /** Time (seconds) */ - t_u32 time_sec; - /** Time (micro seconds) */ - t_u32 time_usec; -} wifi_timeval; - #define timeval_to_msec(timeval) \ (t_u64)((t_u64)(timeval.time_sec) * 1000 + \ (t_u64)(timeval.time_usec) / 1000) @@ -1482,7 +1503,7 @@ typedef struct { /** wifi interface */ /* wifi_interface_handle iface;*/ /** current state of the interface */ - wifi_interface_link_layer_info info; + mlan_interface_link_layer_info info; /** access point beacon received count from connected AP */ t_u32 beacon_rx; /** Average beacon offset encountered (beacon_TSF - TBTT) @@ -1666,6 +1687,9 @@ typedef struct _mlan_callbacks { const t_void *pmem2, t_u32 num); /** moal_udelay */ t_void (*moal_udelay)(t_void *pmoal_handle, t_u32 udelay); + /** moal_usleep_range */ + t_void (*moal_usleep_range)(t_void *pmoal_handle, t_u32 min_delay, + t_u32 max_delay); /** moal_get_boot_ktime */ mlan_status (*moal_get_boot_ktime)(t_void *pmoal_handle, t_u64 *pnsec); /** moal_get_system_time */ diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/mlan_ioctl.h b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/mlan_ioctl.h index b22e69ccf924..9523410e6b57 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/mlan_ioctl.h +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/mlan_ioctl.h @@ -326,6 +326,9 @@ enum _mlan_ioctl_req_id { MLAN_OID_MISC_RF_TEST_GENERIC = 0x00200075, MLAN_OID_MISC_RF_TEST_TX_CONT = 0x00200076, MLAN_OID_MISC_RF_TEST_TX_FRAME = 0x00200077, + MLAN_OID_MISC_ARB_CONFIG = 0x00200078, + MLAN_OID_MISC_BEACON_STUCK = 0x00200079, + MLAN_OID_MISC_CFP_TABLE = 0x0020007A, }; /** Sub command size */ @@ -693,6 +696,8 @@ typedef struct _mlan_ssid_bssid { t_u32 channel_flags; /** host mlme flag*/ t_u8 host_mlme; + /* Use management frame protection (IEEE 802.11w) in this association*/ + t_u8 use_mfp; /** assoicate resp frame/ie from firmware */ mlan_ds_misc_assoc_rsp assoc_rsp; } mlan_ssid_bssid, *pmlan_ssid_bssid; @@ -2833,6 +2838,21 @@ typedef struct _mlan_ds_band_steer_cfg { t_u8 max_btm_req_allowed; } mlan_ds_band_steer_cfg, *pmlan_ds_band_steer_cfg; +/** Type definition of mlan_ds_beacon_stuck_param_cfg for MLAN_IOCTL_POWER_CFG + */ +typedef struct _mlan_ds_beacon_stuck_param_cfg { + /** subcmd */ + t_u32 subcmd; + /** Set/Get */ + t_u8 action; + /** No of beacon interval after which firmware will check if beacon Tx + * is going fine */ + t_u8 beacon_stuck_detect_count; + /** Upon performing MAC reset, no of beacon interval after which + * firmware will check if recovery was successful */ + t_u8 recovery_confirm_count; +} mlan_ds_beacon_stuck_param_cfg, *pmlan_ds_beacon_stuck_param_cfg; + /*-----------------------------------------------------------------*/ /** Power Management Configuration Group */ /*-----------------------------------------------------------------*/ @@ -3984,11 +4004,13 @@ enum _mlan_reg_type { MLAN_REG_RF, MLAN_REG_CAU = 5, MLAN_REG_PSU = 6, + MLAN_REG_BCA = 7, #if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \ defined(PCIE9097) || defined(USB9097) || defined(SD9097) MLAN_REG_MAC2 = 0x81, MLAN_REG_BBP2 = 0x82, - MLAN_REG_RF2 = 0x83 + MLAN_REG_RF2 = 0x83, + MLAN_REG_BCA2 = 0x87 #endif }; @@ -4309,6 +4331,14 @@ typedef struct _mlan_ds_misc_cfp_code { t_u32 cfp_code_a; } mlan_ds_misc_cfp_code; +/** Type definition of mlan_ds_misc_arb_cfg + * for MLAN_OID_MISC_ARB_CFG + */ +typedef struct _mlan_ds_misc_arb_cfg { + /** arb mode 0-4 */ + t_u32 arb_mode; +} mlan_ds_misc_arb_cfg; + /** Type definition of mlan_ds_misc_country_code * for MLAN_OID_MISC_COUNTRY_CODE */ @@ -4932,6 +4962,17 @@ typedef struct _mlan_ds_misc_chnrgpwr_cfg { /** chnrgpwr buf */ t_u8 chnrgpwr_buf[2048]; } mlan_ds_misc_chnrgpwr_cfg; + +/** dfs chan list for MLAN_OID_MISC_CFP_TABLE */ +typedef struct _mlan_ds_misc_cfp_tbl { + /** band */ + t_u8 band; + /** num chan */ + t_u8 num_chan; + /** cfp table */ + chan_freq_power_t cfp_tbl[]; +} mlan_ds_misc_cfp_tbl; + /** Type definition of mlan_ds_misc_cfg for MLAN_IOCTL_MISC_CFG */ typedef struct _mlan_ds_misc_cfg { /** Sub-command */ @@ -5042,9 +5083,12 @@ typedef struct _mlan_ds_misc_cfg { mlan_ds_misc_chnrgpwr_cfg rgchnpwr_cfg; mlan_ds_band_steer_cfg band_steer_cfg; + mlan_ds_beacon_stuck_param_cfg beacon_stuck_cfg; struct mfg_cmd_generic_cfg mfg_generic_cfg; struct mfg_cmd_tx_cont mfg_tx_cont; struct mfg_cmd_tx_frame2 mfg_tx_frame2; + mlan_ds_misc_arb_cfg arb_cfg; + mlan_ds_misc_cfp_tbl cfp; } param; } mlan_ds_misc_cfg, *pmlan_ds_misc_cfg; diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c index 63f1f2a35f79..abcf6149bd34 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c @@ -173,6 +173,15 @@ static struct ieee80211_channel mac1_cfg80211_channels_5ghz[] = { {.center_freq = 5805, .hw_value = 161, .max_power = 20}, {.center_freq = 5825, .hw_value = 165, .max_power = 20}, }; + +struct ieee80211_supported_band mac1_cfg80211_band_2ghz = { + .channels = cfg80211_channels_2ghz, + .band = IEEE80211_BAND_2GHZ, + .n_channels = ARRAY_SIZE(cfg80211_channels_2ghz), + .bitrates = cfg80211_rates, + .n_bitrates = ARRAY_SIZE(cfg80211_rates), +}; + struct ieee80211_supported_band mac1_cfg80211_band_5ghz = { .channels = mac1_cfg80211_channels_5ghz, .band = IEEE80211_BAND_5GHZ, @@ -1470,6 +1479,7 @@ int woal_cfg80211_set_default_key(struct wiphy *wiphy, mlan_bss_info bss_info; ENTER(); + memset(&bss_info, 0, sizeof(mlan_bss_info)); if (GET_BSS_ROLE(priv) == MLAN_BSS_ROLE_STA) { woal_get_bss_info(priv, MOAL_IOCTL_WAIT, &bss_info); if (!bss_info.wep_status) { @@ -1572,6 +1582,7 @@ int woal_cfg80211_set_rekey_data(struct wiphy *wiphy, struct net_device *dev, return ret; } + memset(&fw_info, 0, sizeof(mlan_fw_info)); woal_request_get_fw_info(priv, MOAL_IOCTL_WAIT, &fw_info); if (!fw_info.fw_supplicant_support) { LEAVE(); @@ -2344,6 +2355,11 @@ void woal_cfg80211_mgmt_frame_register(struct wiphy *wiphy, struct net_device *dev, u16 frame_type, bool reg) #else +#if KERNEL_VERSION(5, 8, 0) <= CFG80211_VERSION_CODE +void woal_cfg80211_mgmt_frame_register(struct wiphy *wiphy, + struct wireless_dev *wdev, + struct mgmt_frame_regs *upd) +#else /** * @brief register/unregister mgmt frame forwarding * @@ -2358,6 +2374,7 @@ void woal_cfg80211_mgmt_frame_register(struct wiphy *wiphy, struct wireless_dev *wdev, u16 frame_type, bool reg) #endif +#endif { #if KERNEL_VERSION(3, 6, 0) <= CFG80211_VERSION_CODE struct net_device *dev = wdev->netdev; @@ -2366,6 +2383,16 @@ void woal_cfg80211_mgmt_frame_register(struct wiphy *wiphy, ENTER(); +#if KERNEL_VERSION(5, 8, 0) <= CFG80211_VERSION_CODE + if ((upd->interface_stypes & BIT(IEEE80211_STYPE_AUTH >> 4)) + /** Supplicant 2.8 always register auth, FW will handle auth when + * host_mlme=0 + */ + && !moal_extflg_isset(priv->phandle, EXT_HOST_MLME)) + upd->interface_stypes &= ~BIT(IEEE80211_STYPE_AUTH >> 4); + woal_reg_rx_mgmt_ind(priv, MLAN_ACT_SET, &upd->interface_stypes, + MOAL_NO_WAIT); +#else if (frame_type == IEEE80211_STYPE_AUTH #if KERNEL_VERSION(3, 8, 0) <= CFG80211_VERSION_CODE /** Supplicant 2.8 always register auth, FW will handle auth when @@ -2378,7 +2405,7 @@ void woal_cfg80211_mgmt_frame_register(struct wiphy *wiphy, return; } woal_mgmt_frame_register(priv, frame_type, reg); - +#endif LEAVE(); } @@ -3291,12 +3318,25 @@ static t_u16 woal_filter_beacon_ies(moal_private *priv, const t_u8 *ie, int len, "IE too big, fail copy COUNTRY INFO IE\n"); } break; - case EXTENDED_SUPPORTED_RATES: - case WLAN_EID_ERP_INFO: case HT_CAPABILITY: case HT_OPERATION: case VHT_CAPABILITY: case VHT_OPERATION: + if (moal_extflg_isset(priv->phandle, EXT_HOST_MLME)) { + if ((out_len + length + 2) < ie_out_len) { + moal_memcpy_ext(priv->phandle, + ie_out + out_len, pos, + length + 2, + ie_out_len - out_len); + out_len += length + 2; + } else { + PRINTM(MERROR, + "IE too big, fail copy COUNTRY INFO IE\n"); + } + } + break; + case EXTENDED_SUPPORTED_RATES: + case WLAN_EID_ERP_INFO: /* Fall Through */ case REGULATORY_CLASS: /* Fall Through */ @@ -3306,7 +3346,9 @@ static t_u16 woal_filter_beacon_ies(moal_private *priv, const t_u8 *ie, int len, break; case EXTENSION: ext_id = *(pos + 2); - if (ext_id == HE_CAPABILITY || ext_id == HE_OPERATION) + if ((ext_id == HE_CAPABILITY || + ext_id == HE_OPERATION) && + !moal_extflg_isset(priv->phandle, EXT_HOST_MLME)) break; else { if ((out_len + length + 2) < ie_out_len) { @@ -3716,8 +3758,9 @@ int woal_cfg80211_mgmt_frame_ie( DBG_HEXDUMP(MCMD_D, "beacon vendor IE", beacon_ies_data->ie_buffer, beacon_ies_data->ie_length); - } else if (beacon_vendor_index != - MLAN_CUSTOM_IE_AUTO_IDX_MASK) { + } + if (beacon_vendor_index != MLAN_CUSTOM_IE_AUTO_IDX_MASK && + !beacon_ies_data->ie_length) { /* clear the beacon vendor ies */ if (beacon_vendor_index > MAX_MGMT_IE_INDEX) { PRINTM(MERROR, @@ -4166,7 +4209,7 @@ Bit59-61: 0x1 (Max Nc) Bit75: 0x1 (Rx 1024-QAM Support < 242-tone RU) */ -#define UAP_HE_MAC_CAP0_MASK 0x01 +#define UAP_HE_MAC_CAP0_MASK 0x00 #define UAP_HE_MAC_CAP1_MASK 0x00 #define UAP_HE_MAC_CAP2_MASK 0x00 #define UAP_HE_MAC_CAP3_MASK 0x00 @@ -4214,7 +4257,7 @@ Bit58: 0x1 (HE SU PPDU and HE MU PPDU with 4xHE-LTF+0.8usGI) Bit59-61: 0x1 (Max Nc) Bit75: 0x1 (Rx 1024-QAM Support < 242-tone RU) */ -#define UAP_HE_2G_MAC_CAP0_MASK 0x01 +#define UAP_HE_2G_MAC_CAP0_MASK 0x00 #define UAP_HE_2G_MAC_CAP1_MASK 0x00 #define UAP_HE_2G_MAC_CAP2_MASK 0x00 #define UAP_HE_2G_MAC_CAP3_MASK 0x00 @@ -4386,6 +4429,8 @@ void woal_cfg80211_free_iftype_data(struct wiphy *wiphy) for (band = NL80211_BAND_2GHZ; band < NUM_NL80211_BANDS; ++band) { if (!wiphy->bands[band]) continue; + if (!wiphy->bands[band]->iftype_data) + continue; kfree(wiphy->bands[band]->iftype_data); wiphy->bands[band]->n_iftype_data = 0; } diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.h b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.h index b0059970fe41..f68e50c95c7f 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.h +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.h @@ -207,7 +207,12 @@ void woal_cfg80211_mgmt_frame_register(struct wiphy *wiphy, #else struct net_device *dev, #endif - t_u16 frame_type, bool reg); +#if KERNEL_VERSION(5, 8, 0) <= CFG80211_VERSION_CODE + struct mgmt_frame_regs *upd +#else + t_u16 frame_type, bool reg +#endif +); int woal_cfg80211_mgmt_tx(struct wiphy *wiphy, #if KERNEL_VERSION(3, 6, 0) <= CFG80211_VERSION_CODE @@ -241,6 +246,7 @@ mlan_status woal_register_cfg80211(moal_private *priv); extern struct ieee80211_supported_band cfg80211_band_2ghz; extern struct ieee80211_supported_band cfg80211_band_5ghz; +extern struct ieee80211_supported_band mac1_cfg80211_band_2ghz; extern struct ieee80211_supported_band mac1_cfg80211_band_5ghz; #if defined(STA_SUPPORT) && defined(UAP_SUPPORT) diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_cfg80211_util.c b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_cfg80211_util.c index 61bc83c2ed2b..695666f9af5d 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_cfg80211_util.c +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_cfg80211_util.c @@ -95,6 +95,79 @@ const struct nl80211_vendor_cmd_info vendor_events[] = { /**add vendor event here*/ }; +/**nxp vendor policies*/ +#if KERNEL_VERSION(5, 3, 0) <= CFG80211_VERSION_CODE + +static const struct nla_policy woal_ll_stat_policy[ATTR_LL_STATS_MAX + 1] = { + [ATTR_LL_STATS_MPDU_SIZE_THRESHOLD] = {.type = NLA_U32}, + [ATTR_LL_STATS_AGGRESSIVE_STATS_GATHERING] = {.type = NLA_U32}, + [ATTR_LL_STATS_CLEAR_REQ_MASK] = {.type = NLA_U32}, + [ATTR_LL_STATS_STOP_REQ] = {.type = NLA_U8}}; + +static const struct nla_policy woal_logger_policy[ATTR_WIFI_LOGGER_MAX + 1] = { + [ATTR_WIFI_LOGGER_RING_ID] = {.type = NLA_STRING}, + [ATTR_WIFI_LOGGER_VERBOSE_LEVEL] = {.type = NLA_U32}, + [ATTR_WIFI_LOGGER_FLAGS] = {.type = NLA_U32}, + [ATTR_WIFI_LOGGER_MIN_DATA_SIZE] = {.type = NLA_U32}, + [ATTR_WIFI_LOGGER_MAX_INTERVAL_SEC] = {.type = NLA_U32}}; + +static const struct nla_policy woal_attr_policy[ATTR_WIFI_MAX + 1] = { + [ATTR_CHANNELS_BAND] = {.type = NLA_U32}, + [ATTR_SCAN_MAC_OUI_SET] = {.type = NLA_STRING, .len = 3}, + [ATTR_NODFS_VALUE] = {.type = NLA_U32}, + [ATTR_GET_CONCURRENCY_MATRIX_SET_SIZE_MAX] = {.type = NLA_U32}, +}; + +// clang-format off +static const struct nla_policy + woal_nd_offload_policy[ATTR_ND_OFFLOAD_MAX + 1] = { + [ATTR_ND_OFFLOAD_CONTROL] = {.type = NLA_U8}, +}; +// clang-format on + +static const struct nla_policy + woal_rssi_monitor_policy[ATTR_RSSI_MONITOR_MAX + 1] = { + [ATTR_RSSI_MONITOR_CONTROL] = {.type = NLA_U32}, + [ATTR_RSSI_MONITOR_MIN_RSSI] = {.type = NLA_S8}, + [ATTR_RSSI_MONITOR_MAX_RSSI] = {.type = NLA_S8}, +}; + +static const struct nla_policy + woal_packet_filter_policy[ATTR_PACKET_FILTER_MAX + 1] = { + [ATTR_PACKET_FILTER_TOTAL_LENGTH] = {.type = NLA_U32}, + [ATTR_PACKET_FILTER_PROGRAM] = {.type = NLA_STRING}, +}; + +// clang-format off +static const struct nla_policy + woal_fw_roaming_policy[MRVL_WLAN_VENDOR_ATTR_FW_ROAMING_MAX + 1] = { + [MRVL_WLAN_VENDOR_ATTR_FW_ROAMING_CONTROL] = {.type = NLA_U32}, + [MRVL_WLAN_VENDOR_ATTR_FW_ROAMING_CONFIG_BSSID] = { + .type = NLA_MIN_LEN, + .len = sizeof(int)}, + [MRVL_WLAN_VENDOR_ATTR_FW_ROAMING_CONFIG_SSID] = { + .type = NLA_MIN_LEN, + .len = sizeof(int)}, +}; +// clang-format on + +static const struct nla_policy + woal_keep_alive_policy[MKEEP_ALIVE_ATTRIBUTE_MAX + 1] = { + [MKEEP_ALIVE_ATTRIBUTE_ID] = {.type = NLA_U8}, + [MKEEP_ALIVE_ATTRIBUTE_ETHER_TYPE] = {.type = NLA_U16}, + [MKEEP_ALIVE_ATTRIBUTE_IP_PKT] = {.type = NLA_MIN_LEN, + .len = 1}, + [MKEEP_ALIVE_ATTRIBUTE_IP_PKT_LEN] = {.type = NLA_U16}, + [MKEEP_ALIVE_ATTRIBUTE_SRC_MAC_ADDR] = {.type = NLA_STRING, + .len = ETH_ALEN}, + [MKEEP_ALIVE_ATTRIBUTE_DST_MAC_ADDR] = {.type = NLA_STRING, + .len = ETH_ALEN}, + [MKEEP_ALIVE_ATTRIBUTE_PERIOD_MSEC] = {.type = NLA_U32}, + [MKEEP_ALIVE_ATTRIBUTE_RETRY_INTERVAL] = {.type = NLA_U32}, + [MKEEP_ALIVE_ATTRIBUTE_RETRY_CNT] = {.type = NLA_U8}, +}; +#endif + /** * @brief get the event id of the events array * @@ -728,6 +801,7 @@ static int woal_cfg80211_subcmd_get_supp_feature_set(struct wiphy *wiphy, WLAN_FEATURE_CONTROL_ROAMING | WLAN_FEATURE_SCAN_RAND | WLAN_FEATURE_MKEEP_ALIVE; + memset(&fw_info, 0, sizeof(mlan_fw_info)); woal_request_get_fw_info(priv, MOAL_IOCTL_WAIT, &fw_info); if (fw_info.fw_bands & BAND_A) supp_feature_set |= WLAN_FEATURE_INFRA_5G; @@ -2739,11 +2813,6 @@ static int woal_cfg80211_subcmd_link_statistic_get(struct wiphy *wiphy, t_u64 max_msec = (t_u64)24 * (t_u64)24 * (t_u64)3600 * (t_u64)1000; moal_handle *handle = priv->phandle; - /*Sending this command frequently causes TP to drop.*/ - /*ToDo : Check in vendor HAL if this callback is needed so frequently - * during normal run*/ - if (!(drvdbg & MLOG_D)) - return 0; /* Allocate an IOCTL request buffer */ req = woal_alloc_mlan_ioctl_req(sizeof(t_u32) + BUF_MAXLEN); if (req == NULL) { @@ -2924,13 +2993,13 @@ static int woal_cfg80211_subcmd_link_statistic_set(struct wiphy *wiphy, return err; if (!tb[ATTR_LL_STATS_MPDU_SIZE_THRESHOLD] || - !tb[ATTR_LL_STATS_AGGRSSIVE_STATS_GATHERING]) + !tb[ATTR_LL_STATS_AGGRESSIVE_STATS_GATHERING]) return -EINVAL; ll_params.mpdu_size_threshold = nla_get_u32(tb[ATTR_LL_STATS_MPDU_SIZE_THRESHOLD]); ll_params.aggressive_statistics_gathering = - nla_get_u32(tb[ATTR_LL_STATS_AGGRSSIVE_STATS_GATHERING]); + nla_get_u32(tb[ATTR_LL_STATS_AGGRESSIVE_STATS_GATHERING]); PRINTM(MEVENT, "link layer params mpdu_size_threshold = 0x%x, aggressive_statistics_gathering = 0x%x\n", @@ -3789,7 +3858,8 @@ const struct wiphy_vendor_command vendor_commands[] = { WIPHY_VENDOR_CMD_NEED_NETDEV, .doit = woal_cfg80211_subcmd_get_valid_channels, #if KERNEL_VERSION(5, 3, 0) <= CFG80211_VERSION_CODE - .policy = VENDOR_CMD_RAW_DATA, + .policy = woal_attr_policy, + .maxattr = ATTR_WIFI_MAX, #endif }, { @@ -3801,7 +3871,8 @@ const struct wiphy_vendor_command vendor_commands[] = { WIPHY_VENDOR_CMD_NEED_NETDEV, .doit = woal_cfg80211_subcmd_set_scan_mac_oui, #if KERNEL_VERSION(5, 3, 0) <= CFG80211_VERSION_CODE - .policy = VENDOR_CMD_RAW_DATA, + .policy = woal_attr_policy, + .maxattr = ATTR_WIFI_MAX, #endif }, { @@ -3813,7 +3884,8 @@ const struct wiphy_vendor_command vendor_commands[] = { WIPHY_VENDOR_CMD_NEED_NETDEV, .doit = woal_cfg80211_subcmd_link_statistic_set, #if KERNEL_VERSION(5, 3, 0) <= CFG80211_VERSION_CODE - .policy = VENDOR_CMD_RAW_DATA, + .policy = woal_ll_stat_policy, + .maxattr = ATTR_LL_STATS_MAX, #endif }, { @@ -3837,7 +3909,8 @@ const struct wiphy_vendor_command vendor_commands[] = { WIPHY_VENDOR_CMD_NEED_NETDEV, .doit = woal_cfg80211_subcmd_link_statistic_clr, #if KERNEL_VERSION(5, 3, 0) <= CFG80211_VERSION_CODE - .policy = VENDOR_CMD_RAW_DATA, + .policy = woal_ll_stat_policy, + .maxattr = ATTR_LL_STATS_MAX, #endif }, #ifdef STA_CFG80211 @@ -3850,7 +3923,8 @@ const struct wiphy_vendor_command vendor_commands[] = { WIPHY_VENDOR_CMD_NEED_NETDEV, .doit = woal_cfg80211_subcmd_rssi_monitor, #if KERNEL_VERSION(5, 3, 0) <= CFG80211_VERSION_CODE - .policy = VENDOR_CMD_RAW_DATA, + .policy = woal_rssi_monitor_policy, + .maxattr = ATTR_RSSI_MONITOR_MAX, #endif }, #endif @@ -3875,7 +3949,8 @@ const struct wiphy_vendor_command vendor_commands[] = { WIPHY_VENDOR_CMD_NEED_NETDEV, .doit = woal_cfg80211_subcmd_fw_roaming_enable, #if KERNEL_VERSION(5, 3, 0) <= CFG80211_VERSION_CODE - .policy = VENDOR_CMD_RAW_DATA, + .policy = woal_fw_roaming_policy, + .maxattr = MRVL_WLAN_VENDOR_ATTR_FW_ROAMING_MAX, #endif }, { @@ -3887,7 +3962,8 @@ const struct wiphy_vendor_command vendor_commands[] = { WIPHY_VENDOR_CMD_NEED_NETDEV, .doit = woal_cfg80211_subcmd_fw_roaming_config, #if KERNEL_VERSION(5, 3, 0) <= CFG80211_VERSION_CODE - .policy = VENDOR_CMD_RAW_DATA, + .policy = woal_fw_roaming_policy, + .maxattr = MRVL_WLAN_VENDOR_ATTR_FW_ROAMING_MAX, #endif }, { @@ -3899,7 +3975,8 @@ const struct wiphy_vendor_command vendor_commands[] = { WIPHY_VENDOR_CMD_NEED_NETDEV, .doit = woal_cfg80211_subcmd_start_keep_alive, #if KERNEL_VERSION(5, 3, 0) <= CFG80211_VERSION_CODE - .policy = VENDOR_CMD_RAW_DATA, + .policy = woal_keep_alive_policy, + .maxattr = MKEEP_ALIVE_ATTRIBUTE_MAX, #endif }, { @@ -3914,7 +3991,6 @@ const struct wiphy_vendor_command vendor_commands[] = { .policy = VENDOR_CMD_RAW_DATA, #endif }, - { .info = { .vendor_id = MRVL_VENDOR_ID, @@ -3938,7 +4014,8 @@ const struct wiphy_vendor_command vendor_commands[] = { WIPHY_VENDOR_CMD_NEED_NETDEV, .doit = woal_cfg80211_subcmd_11k_cfg, #if KERNEL_VERSION(5, 3, 0) <= CFG80211_VERSION_CODE - .policy = VENDOR_CMD_RAW_DATA, + .policy = woal_nd_offload_policy, + .maxattr = ATTR_ND_OFFLOAD_MAX, #endif }, { @@ -3999,7 +4076,8 @@ const struct wiphy_vendor_command vendor_commands[] = { WIPHY_VENDOR_CMD_NEED_NETDEV, .doit = woal_cfg80211_subcmd_get_wifi_logger_supp_feature_set, #if KERNEL_VERSION(5, 3, 0) <= CFG80211_VERSION_CODE - .policy = VENDOR_CMD_RAW_DATA, + .policy = woal_logger_policy, + .maxattr = ATTR_WIFI_LOGGER_MAX, #endif }, { @@ -4012,7 +4090,8 @@ const struct wiphy_vendor_command vendor_commands[] = { WIPHY_VENDOR_CMD_NEED_RUNNING, .doit = woal_cfg80211_subcmd_get_ring_buff_status, #if KERNEL_VERSION(5, 3, 0) <= CFG80211_VERSION_CODE - .policy = VENDOR_CMD_RAW_DATA, + .policy = woal_logger_policy, + .maxattr = ATTR_WIFI_LOGGER_MAX, #endif }, { @@ -4025,7 +4104,8 @@ const struct wiphy_vendor_command vendor_commands[] = { WIPHY_VENDOR_CMD_NEED_RUNNING, .doit = woal_cfg80211_subcmd_start_logging, #if KERNEL_VERSION(5, 3, 0) <= CFG80211_VERSION_CODE - .policy = VENDOR_CMD_RAW_DATA, + .policy = woal_logger_policy, + .maxattr = ATTR_WIFI_LOGGER_MAX, #endif }, { @@ -4038,7 +4118,8 @@ const struct wiphy_vendor_command vendor_commands[] = { WIPHY_VENDOR_CMD_NEED_RUNNING, .doit = woal_cfg80211_subcmd_get_ring_data, #if KERNEL_VERSION(5, 3, 0) <= CFG80211_VERSION_CODE - .policy = VENDOR_CMD_RAW_DATA, + .policy = woal_logger_policy, + .maxattr = ATTR_WIFI_LOGGER_MAX, #endif }, { @@ -4090,7 +4171,8 @@ const struct wiphy_vendor_command vendor_commands[] = { WIPHY_VENDOR_CMD_NEED_RUNNING, .doit = woal_cfg80211_subcmd_set_packet_filter, #if KERNEL_VERSION(5, 3, 0) <= CFG80211_VERSION_CODE - .policy = VENDOR_CMD_RAW_DATA, + .policy = woal_packet_filter_policy, + .maxattr = ATTR_PACKET_FILTER_MAX, #endif }, { diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_cfg80211_util.h b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_cfg80211_util.h index a37411f5222f..d98eca3923fe 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_cfg80211_util.h +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_cfg80211_util.h @@ -639,7 +639,7 @@ void woal_cfg80211_dfs_vendor_event(moal_private *priv, int event, enum ATTR_LINK_LAYER_STAT { ATTR_LL_STATS_INVALID, ATTR_LL_STATS_MPDU_SIZE_THRESHOLD, - ATTR_LL_STATS_AGGRSSIVE_STATS_GATHERING, + ATTR_LL_STATS_AGGRESSIVE_STATS_GATHERING, ATTR_LL_STATS_IFACE, ATTR_LL_STATS_NUM_RADIO, ATTR_LL_STATS_RADIO, @@ -718,6 +718,7 @@ typedef enum { #define MKEEP_ALIVE_IP_PKT_MAX 256 enum mkeep_alive_attributes { + MKEEP_ALIVE_ATTRIBUTE_INVALID = 0, MKEEP_ALIVE_ATTRIBUTE_ID, MKEEP_ALIVE_ATTRIBUTE_ETHER_TYPE, MKEEP_ALIVE_ATTRIBUTE_IP_PKT, diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_debug.c b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_debug.c index bea75345a3cb..10da4dc270b4 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_debug.c +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_debug.c @@ -1239,6 +1239,15 @@ static int woal_debug_proc_open(struct inode *inode, struct file *file) #endif } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) +static const struct proc_ops debug_proc_fops = { + .proc_open = woal_debug_proc_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = single_release, + .proc_write = woal_debug_write, +}; +#else static const struct file_operations debug_proc_fops = { .owner = THIS_MODULE, .open = woal_debug_proc_open, @@ -1247,7 +1256,17 @@ static const struct file_operations debug_proc_fops = { .release = single_release, .write = woal_debug_write, }; +#endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) +static const struct proc_ops histogram_proc_fops = { + .proc_open = woal_histogram_proc_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = single_release, + .proc_write = woal_histogram_write, +}; +#else static const struct file_operations histogram_proc_fops = { .owner = THIS_MODULE, .open = woal_histogram_proc_open, @@ -1256,7 +1275,16 @@ static const struct file_operations histogram_proc_fops = { .release = single_release, .write = woal_histogram_write, }; +#endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) +static const struct proc_ops log_proc_fops = { + .proc_open = woal_log_proc_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = single_release, +}; +#else static const struct file_operations log_proc_fops = { .owner = THIS_MODULE, .open = woal_log_proc_open, @@ -1264,7 +1292,7 @@ static const struct file_operations log_proc_fops = { .llseek = seq_lseek, .release = single_release, }; - +#endif /******************************************************** Global Functions ********************************************************/ diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c index df6eb333eae5..a677688142f2 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c @@ -187,7 +187,7 @@ mlan_status parse_arguments(t_u8 *pos, int *data, int datalen, * @param raw_size raw data buffer size * @return Number of bytes read **/ -int string2raw(char *str, unsigned char *raw, int raw_size) +int string2raw(unsigned char *str, unsigned char *raw, int raw_size) { int len = (strlen(str) + 1) / 2; int i = 0; @@ -2023,6 +2023,7 @@ int woal_setget_priv_txratecfg(moal_private *priv, t_u8 *respbuf, int ret = 0; int user_data_len = 0; mlan_status status = MLAN_STATUS_SUCCESS; + txrate_setting *rate_setting = NULL; ENTER(); @@ -2121,6 +2122,62 @@ int woal_setget_priv_txratecfg(moal_private *priv, t_u8 *respbuf, PRINTM(MIOCTL, "SET: txratefg HE Rate Setting: 0x%x\n", data[3]); + +/* HE Preamble type */ +#define HE_SU_PREAMBLE 0 +#define HE_ER_PREAMBLE 1 + +/* HE ER SU Type */ +#define HE_ER_SU_BANDWIDTH_TONE242 0 +#define HE_ER_SU_BANDWIDTH_TONE106 1 + + rate_setting = (txrate_setting *)&data[3]; + + if (data[0] == MLAN_RATE_FORMAT_HE) { + if (rate_setting->preamble == + HE_ER_PREAMBLE) { + if (rate_setting->bandwidth == + HE_ER_SU_BANDWIDTH_TONE242) { + if ((data[1] > + MLAN_RATE_INDEX_MCS4) || + data[2] > + MLAN_RATE_NSS1) { + PRINTM(MERROR, + "Invalid rate and MCS or NSS configuration for 242 tone\n"); + ret = -EINVAL; + goto done; + } + } else if (rate_setting + ->bandwidth == + HE_ER_SU_BANDWIDTH_TONE106) { + if ((data[1] != + MLAN_RATE_INDEX_MCS0) || + data[2] != + MLAN_RATE_NSS1) { + PRINTM(MERROR, + "Invalid rate and MCS or NSS configuration\n for 106 tone"); + ret = -EINVAL; + goto done; + } + } else { + PRINTM(MERROR, + "Invalid Bandwidth for HE ER Preamble\n"); + ret = -EINVAL; + goto done; + } + } + if (rate_setting->dcm) { + if ((data[1] == + MLAN_RATE_INDEX_MCS2) || + (data[1] > + MLAN_RATE_INDEX_MCS4)) { + PRINTM(MERROR, + "Invalid MCS configuration if DCM is supported\n"); + ret = -EINVAL; + goto done; + } + } + } } else { rate->param.rate_cfg.rate_setting = 0xffff; } @@ -6823,8 +6880,10 @@ static int woal_priv_getcfgchanlist(moal_private *priv, t_u8 *respbuf, sband->channels[i].flags; plist->chan_list[i + num_chan].max_power = sband->channels[i].max_power; +#if LINUX_VERSION_CODE > KERNEL_VERSION(3, 8, 13) plist->chan_list[i + num_chan].dfs_state = sband->channels[i].dfs_state; +#endif } num_chan += sband->n_channels; } @@ -9748,7 +9807,7 @@ static int woal_priv_11n_amsdu_aggr_ctrl(moal_private *priv, t_u8 *respbuf, { mlan_ioctl_req *req = NULL; mlan_ds_11n_cfg *cfg_11n = NULL; - int ret = 0, data[2]; + int ret = 0, data[2] = {0}; int user_data_len = 0, header_len = 0; mlan_status status = MLAN_STATUS_SUCCESS; @@ -10179,7 +10238,7 @@ static int woal_priv_dfs_testing(moal_private *priv, t_u8 *respbuf, mlan_ioctl_req *req = NULL; mlan_ds_11h_cfg *ds_11hcfg = NULL; int ret = 0; - int data[4]; + int data[4] = {0}; int user_data_len = 0, header_len = 0; mlan_status status = MLAN_STATUS_SUCCESS; @@ -10284,7 +10343,7 @@ static int woal_priv_dfs53cfg(moal_private *priv, t_u8 *respbuf, mlan_ioctl_req *req = NULL; mlan_ds_11h_cfg *ds_11hcfg = NULL; int ret = 0; - int data; + int data = 0; int user_data_len = 0, header_len = 0; mlan_status status = MLAN_STATUS_SUCCESS; @@ -10366,7 +10425,7 @@ static int woal_priv_cfp_code(moal_private *priv, t_u8 *respbuf, { int ret = 0; int user_data_len = 0, header_len = 0; - int data[2]; + int data[2] = {0}; mlan_ioctl_req *req = NULL; mlan_ds_misc_cfg *misc_cfg = NULL; mlan_ds_misc_cfp_code *cfp_code = NULL; @@ -11142,7 +11201,7 @@ static int woal_priv_tx_bf_cfg(moal_private *priv, t_u8 *respbuf, int header_len = 0; int ret = 0, copy_len = 0; int bf_action = 0, interval = 0; - int snr = 0, i, tmp_val; + int snr = 0, i, tmp_val = 0; t_u8 buf[MAX_IN_OUT_CHAR], char_count = 0; t_u8 *str, *token, *pos; t_u16 action = 0; @@ -11635,7 +11694,7 @@ static int woal_priv_robustcoex(moal_private *priv, t_u8 *respbuf, t_u32 respbuflen) { int header_len = 0, user_data_len = 0; - int ret = 0, data[3]; + int ret = 0, data[3] = {0}; mlan_ds_misc_cfg *robust_coex_cfg = NULL; mlan_ioctl_req *req = NULL; mlan_status status = MLAN_STATUS_SUCCESS; @@ -11724,7 +11783,7 @@ done: static int woal_priv_dmcs(moal_private *priv, t_u8 *respbuf, t_u32 respbuflen) { int header_len = 0, user_data_len = 0; - int ret = 0, data[2]; + int ret = 0, data[2] = {0}; mlan_ds_misc_cfg *dmcs_cfg = NULL; mlan_ioctl_req *req = NULL; mlan_status status = MLAN_STATUS_SUCCESS; @@ -12328,7 +12387,7 @@ static int woal_priv_dfs_repeater_cfg(moal_private *priv, t_u8 *respbuf, t_u32 respbuflen) { int ret = 0; - int user_data_len = 0, header_len = 0, data[1]; + int user_data_len = 0, header_len = 0, data[1] = {0}; mlan_ioctl_req *req = NULL; mlan_ds_misc_cfg *misc_cfg = NULL; mlan_ds_misc_dfs_repeater *dfs_repeater = NULL; @@ -13192,23 +13251,25 @@ static int woal_priv_extend_channel_switch(moal_private *priv, t_u8 *respbuf, ENTER(); - if (!priv || !priv->phandle) { - PRINTM(MERROR, "priv or handle is null\n"); - ret = -EFAULT; - goto done; - } - - if (priv->bss_role != MLAN_BSS_ROLE_UAP) { + if (!priv || !priv->phandle || (priv->bss_role != MLAN_BSS_ROLE_UAP) || + (priv->bss_started != MTRUE)) { PRINTM(MERROR, - "Extended Channel Switch is only allowed for AP/GO mode\n"); + "priv or handle is null or interface is not AP/GO" + "or AP is not started\n"); ret = -EFAULT; - goto done; + LEAVE(); + return ret; } - if (priv->bss_started != MTRUE) { - PRINTM(MERROR, "AP is not started!\n"); - ret = -EFAULT; - goto done; + parse_arguments(respbuf + strlen(CMD_NXP) + + strlen(PRIV_CMD_EXTEND_CHAN_SWITCH), + data, ARRAY_SIZE(data), &user_data_len); + + if (sizeof(int) * user_data_len > sizeof(data)) { + PRINTM(MERROR, "Too many arguments\n"); + ret = -EINVAL; + LEAVE(); + return ret; } ioctl_req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_misc_cfg)); @@ -13231,16 +13292,6 @@ static int woal_priv_extend_channel_switch(moal_private *priv, t_u8 *respbuf, MGMT_MASK_BEACON | MGMT_MASK_PROBE_RESP; /*Add IE for BEACON/probe resp*/ - parse_arguments(respbuf + strlen(CMD_NXP) + - strlen(PRIV_CMD_EXTEND_CHAN_SWITCH), - data, ARRAY_SIZE(data), &user_data_len); - - if (sizeof(int) * user_data_len > sizeof(data)) { - PRINTM(MERROR, "Too many arguments\n"); - ret = -EINVAL; - goto done; - } - chan_switch = (IEEEtypes_ChanSwitchAnn_t *)pcust_chansw_ie->ie_buffer; chan_switch->element_id = CHANNEL_SWITCH_ANN; chan_switch->len = 3; @@ -13530,6 +13581,7 @@ static int woal_priv_config_random_mac(moal_private *priv, t_u8 *respbuf, int header_len = 0, space_len = 0, i; t_u8 rand_data[3]; const t_u8 zero_mac[MLAN_MAC_ADDR_LENGTH] = {0, 0, 0, 0, 0, 0}; + char fakemac_sts[16]; ENTER(); @@ -13576,8 +13628,11 @@ static int woal_priv_config_random_mac(moal_private *priv, t_u8 *respbuf, goto done; } - ret = sprintf(respbuf, "FAKEMAC parameter is %s\n", - (t_u8 *)(respbuf + header_len + 1 + space_len)) + + memset(fakemac_sts, 0, sizeof(fakemac_sts)); + snprintf(fakemac_sts, sizeof(fakemac_sts), "%s", + (respbuf + header_len + 1 + space_len)); + ret = snprintf(respbuf, respbuflen, "FAKEMAC parameter is %s\n", + fakemac_sts) + 1; PRINTM(MMSG, "FAKEMAC parameter is %s\n", (t_u8 *)(respbuf + header_len + 1 + space_len)); @@ -13917,7 +13972,7 @@ int woal_priv_rx_abort_cfg(moal_private *priv, t_u8 *respbuf, t_u32 respbuflen) mlan_ioctl_req *req = NULL; mlan_ds_misc_cfg *misc = NULL; int ret = 0; - int data[2]; + int data[2] = {0}; int header_len = 0, user_data_len = 0; mlan_status status = MLAN_STATUS_SUCCESS; @@ -14001,7 +14056,7 @@ int woal_priv_rx_abort_cfg_ext(moal_private *priv, t_u8 *respbuf, mlan_ioctl_req *req = NULL; mlan_ds_misc_cfg *misc = NULL; int ret = 0; - int data[3]; + int data[3] = {0}; int header_len = 0, user_data_len = 0; mlan_status status = MLAN_STATUS_SUCCESS; @@ -14098,7 +14153,7 @@ int woal_priv_tx_ampdu_prot_mode(moal_private *priv, t_u8 *respbuf, mlan_ioctl_req *req = NULL; mlan_ds_misc_cfg *misc = NULL; int ret = 0; - int data[1]; + int data[1] = {0}; int header_len = 0, user_data_len = 0; mlan_status status = MLAN_STATUS_SUCCESS; @@ -14178,7 +14233,7 @@ int woal_priv_rate_adapt_cfg(moal_private *priv, t_u8 *respbuf, mlan_ioctl_req *req = NULL; mlan_ds_misc_cfg *misc = NULL; int ret = 0; - int data[4]; + int data[4] = {0}; int header_len = 0, user_data_len = 0; mlan_status status = MLAN_STATUS_SUCCESS; @@ -14284,7 +14339,7 @@ int woal_priv_cck_desense_cfg(moal_private *priv, t_u8 *respbuf, mlan_ioctl_req *req = NULL; mlan_ds_misc_cfg *misc = NULL; int ret = 0; - int data[5]; + int data[5] = {0}; int header_len = 0, user_data_len = 0; mlan_status status = MLAN_STATUS_SUCCESS; @@ -14482,6 +14537,83 @@ done: } /** + * @brief Set/Get HW ARB config + * + * @param priv A pointer to moal_private structure + * @param respbuf A pointer to response buffer + * @param respbuflen Available length of response buffer + * + * @return Number of bytes written, negative for failure. + */ +int woal_priv_arbcfg(moal_private *priv, t_u8 *respbuf, t_u32 respbuflen) +{ + mlan_ioctl_req *req = NULL; + mlan_ds_misc_cfg *misc = NULL; + int ret = 0; + int data[1]; + int header_len = 0, user_data_len = 0; + mlan_status status = MLAN_STATUS_SUCCESS; + + ENTER(); + + if (!respbuf) { + PRINTM(MERROR, "response buffer is not available!\n"); + ret = -EINVAL; + goto done; + } + header_len = strlen(CMD_NXP) + strlen(PRIV_CMD_ARB_CFG); + user_data_len = strlen(respbuf) - header_len; + + /* Allocate an IOCTL request buffer */ + req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_misc_cfg)); + if (req == NULL) { + ret = -ENOMEM; + goto done; + } + /* Fill request buffer */ + misc = (mlan_ds_misc_cfg *)req->pbuf; + misc->sub_command = MLAN_OID_MISC_ARB_CONFIG; + req->req_id = MLAN_IOCTL_MISC_CFG; + if (strlen(respbuf) == header_len) { + /* GET operation */ + user_data_len = 0; + req->action = MLAN_ACT_GET; + } else { + /* SET operation */ + parse_arguments(respbuf + header_len, data, ARRAY_SIZE(data), + &user_data_len); + if (user_data_len != 1) { + PRINTM(MERROR, "Invalid Parameter\n"); + ret = -EFAULT; + goto done; + } + if (data[0] < 0 || data[0] > 4) { + PRINTM(MERROR, "Invalid Parameter: arb mode 0-4\n"); + ret = -EFAULT; + goto done; + } + misc->param.arb_cfg.arb_mode = (t_u32)data[0]; + req->action = MLAN_ACT_SET; + } + /* Send IOCTL request to MLAN */ + status = woal_request_ioctl(priv, req, MOAL_IOCTL_WAIT); + if (status != MLAN_STATUS_SUCCESS) { + ret = -EFAULT; + goto done; + } + + data[0] = misc->param.arb_cfg.arb_mode; + moal_memcpy_ext(priv->phandle, respbuf, (t_u32 *)data, sizeof(data), + respbuflen); + ret = sizeof(data); +done: + if (status != MLAN_STATUS_PENDING) + kfree(req); + + LEAVE(); + return ret; +} +/** * @brief Set priv command for Android * @param dev A pointer to net_device structure * @param req A pointer to ifreq structure @@ -15376,6 +15508,11 @@ int woal_android_priv_cmd(struct net_device *dev, struct ifreq *req) /* Set/Get DFS W53 settings */ len = woal_priv_dfs53cfg(priv, buf, priv_cmd.total_len); goto handled; + } else if (strnicmp(buf + strlen(CMD_NXP), PRIV_CMD_ARB_CFG, + strlen(PRIV_CMD_ARB_CFG)) == 0) { + /* Set/Get CFP table codes */ + len = woal_priv_arbcfg(priv, buf, priv_cmd.total_len); + goto handled; } else if (strnicmp(buf + strlen(CMD_NXP), PRIV_CMD_CFP_CODE, strlen(PRIV_CMD_CFP_CODE)) == 0) { /* Set/Get CFP table codes */ @@ -15698,7 +15835,7 @@ int woal_android_priv_cmd(struct net_device *dev, struct ifreq *req) } else if (strncmp(buf, "SETROAMING", strlen("SETROAMING")) == 0) { pdata = buf + strlen("SETROAMING") + 1; #ifdef STA_CFG80211 -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) if (moal_extflg_isset(priv->phandle, EXT_HOST_MLME)) goto done; #endif @@ -15716,7 +15853,7 @@ int woal_android_priv_cmd(struct net_device *dev, struct ifreq *req) } else if (strncmp(buf, "ROAM", strlen("ROAM")) == 0) { pdata = buf + strlen("ROAM") + 1; #ifdef STA_CFG80211 -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) if (moal_extflg_isset(priv->phandle, EXT_HOST_MLME)) goto done; #endif diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.h b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.h index 2e7637e3a291..3630a2e2836e 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.h +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.h @@ -274,6 +274,8 @@ typedef struct _chan_stats { /**Private command ID to set/get independent reset*/ #define PRIV_CMD_IND_RST_CFG "indrstcfg" +#define PRIV_CMD_ARB_CFG "arb" + /**Private command to configure static rx abort config */ #define PRIV_CMD_RX_ABORT_CFG "rx_abort_cfg" /**Private command to configure dynamic rx abort config */ @@ -486,6 +488,83 @@ typedef struct woal_priv_addba { t_u32 rx_amsdu; } woal_addba; +typedef struct _txrate_setting { + t_u16 preamble : 2; /*BIT1-BIT0: + * For legacy 11b: preamble type + * 00 = long + * 01 = short + * 10/11 = reserved + * For legacy 11g: reserved + * For 11n: Green field PPDU indicator + * 00 = HT-mix + * 01 = HT-GF + * 10/11 = reserved. + * For 11ac: reserved. + * For 11ax: + * 00 = HE-SU + * 01 = HE-EXT-SU + * 10 = HE-MU + * 11 = HE trigger based + */ + t_u16 bandwidth : 3; /* BIT2- BIT4 + * For 11n and 11ac traffic: Bandwidth + * 0 = 20Mhz + * 1 = 40Mhz + * 2 = 80 Mhz + * 3 = 160 Mhz + * 4-7 = reserved + * For legacy rate : BW>0 implies non-HT + * duplicates. For HE SU PPDU: 0 = 20Mhz 1 = 40Mhz + * 2 = 80 Mhz + * 3 = 160 Mhz + * 4-7 = reserved + * For HE ER SU PPDU: + * 0 = 242-tone RU + * 1 = upper frequency 106 tone RU within the + * primary 20 Mhz. For HE MU PPDU: 0 = 20Mhz. 1 = + * 40Mhz. 2 = 80Mhz non-preamble puncturing mode 3 + * = 160Mhz and 80+80 Mhz non-preamble. 4 = for + * preemble puncturing in 80 Mhz , where in the + * preamble only the secondary 20Mhz is punctured. + * 5 = for preemble puncturing in 80 Mhz , + * where in the preamble only one of the two + * 20Mhz subchannels in the secondary 40Mhz is + * punctured. 6 = for preemble puncturing in 160 + * Mhz or 80 Mhz + 80 Mhz, where in the primary 80 + * Mhz of the preamble only the secondary 20 Mhz is + * punctured. 7 = for preemble puncturing in 160 + * Mhz or 80 Mhz + 80 Mhz, where in the primary 80 + * Mhz of the preamble the primary 40 Mhz is + * present. + */ + t_u16 shortGI : 2; /*BIT5- BIT6 + * For legacy: not used + * For 11n: 00 = normal, 01 =shortGI, 10/11 = + * reserved For 11ac: SGI map to VHT-SIG-A2[0] + * VHT-SIG-A2[1] is set to 1 if short guard + * interval is used and NSYM mod 10 = 9, otherwise + * set to 0. For 11ax: 00 = 1xHELTF+GI0.8usec 01 = + * 2xHELTF+GI0.8usec 10 = 2xHELTF+GI1.6usec 11 = + * 4xHELTF+GI0.8 usec if both DCM and STBC are 1 + * 4xHELTF+GI3.2 usec otherwise + */ + t_u16 stbc : 1; // BIT7, 0: no STBC; 1: STBC + t_u16 dcm : 1; // BIT8, 0: no DCM; 1: DCM used. + t_u16 adv_coding : 1; // BIT9, 0: BCC; 1: LDPC. + t_u16 doppler : 2; /* BIT11-BIT10, + 00: Doppler0 + 01: Doppler 1 with Mma =10 + 10: Doppler 1 with Mma =20 + */ + t_u16 max_pktext : 2; /*BIT12-BIT13: + * Max packet extension + * 0 - 0 usec + * 1 - 8 usec + * 2 - 16 usec. + */ + t_u16 reserverd : 2; // BIT14-BIT15 +} __ATTRIB_PACK__ txrate_setting; + /** data structure for cmd txratecfg */ typedef struct woal_priv_tx_rate_cfg { /* LG rate: 0, HT rate: 1, VHT rate: 2 */ diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_ioctl.c b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_ioctl.c index 588a760ca931..98b7afa45ba2 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_ioctl.c +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_ioctl.c @@ -3026,6 +3026,10 @@ int woal_enable_hs(moal_private *priv) sdio_claim_host(((struct sdio_mmc_card *)handle->card)->func); } #endif + +#ifdef SDIO_SUSPEND_RESUME + memset(&pm_info, 0, sizeof(mlan_ds_ps_info)); +#endif if ((handle->hs_activated == MTRUE) || (handle->is_suspended == MTRUE)) { PRINTM(MCMND, "suspend success! force=%u skip=%u\n", @@ -5036,7 +5040,7 @@ int woal_find_essid(moal_private *priv, mlan_ssid_bssid *ssid_bssid, { int ret = 0; mlan_scan_resp scan_resp; - struct timeval t; + wifi_timeval t; ENTER(); if (MLAN_STATUS_SUCCESS != @@ -5055,7 +5059,7 @@ int woal_find_essid(moal_private *priv, mlan_ssid_bssid *ssid_bssid, woal_get_monotonic_time(&t); /** scan result timeout value */ #define SCAN_RESULT_AGEOUT 10 - if (t.tv_sec > (scan_resp.age_in_secs + SCAN_RESULT_AGEOUT)) { + if (t.time_sec > (scan_resp.age_in_secs + SCAN_RESULT_AGEOUT)) { LEAVE(); return MLAN_STATUS_FAILURE; } @@ -6822,11 +6826,11 @@ mlan_status woal_process_rf_test_mode_cmd(moal_handle *handle, t_u32 cmd, switch (cmd) { case MFG_CMD_TX_ANT: - if (val != 1 && val != 2) + if (val != 1 && val != 2 && val != 3) err = MTRUE; break; case MFG_CMD_RX_ANT: - if (val != 1 && val != 2) + if (val != 1 && val != 2 && val != 3) err = MTRUE; break; case MFG_CMD_RF_BAND_AG: diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_main.c b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_main.c index bb4f9cd6a3a4..f020313b1088 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_main.c +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_main.c @@ -616,6 +616,7 @@ static mlan_callbacks woal_callbacks = { .moal_memmove = moal_memmove, .moal_memcmp = moal_memcmp, .moal_udelay = moal_udelay, + .moal_usleep_range = moal_usleep_range, .moal_get_system_time = moal_get_system_time, .moal_get_boot_ktime = moal_get_boot_ktime, .moal_init_timer = moal_init_timer, @@ -639,7 +640,12 @@ static mlan_callbacks woal_callbacks = { int woal_open(struct net_device *dev); int woal_close(struct net_device *dev); int woal_set_mac_address(struct net_device *dev, void *addr); -void woal_tx_timeout(struct net_device *dev); +void woal_tx_timeout(struct net_device *dev +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) + , + unsigned int txqueue +#endif +); struct net_device_stats *woal_get_stats(struct net_device *dev); #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 29) #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0) @@ -1496,7 +1502,11 @@ mlan_status woal_init_sw(moal_handle *handle) } moal_memcpy_ext(handle, &device.callbacks, &woal_callbacks, sizeof(mlan_callbacks), sizeof(mlan_callbacks)); +#if defined(STA_CFG80211) || defined(UAP_CFG80211) +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) device.fw_region = fw_region; +#endif +#endif device.drv_mode = handle->params.drv_mode; if (MLAN_STATUS_SUCCESS == mlan_register(&device, &pmlan)) handle->pmlan_adapter = pmlan; @@ -3156,14 +3166,13 @@ static mlan_status woal_request_fw_dpc(moal_handle *handle, const struct firmware *firmware) { mlan_status ret = MLAN_STATUS_SUCCESS; - struct timeval tstamp; - + wifi_timeval tstamp; ENTER(); if (!firmware) { woal_get_monotonic_time(&tstamp); - if (tstamp.tv_sec > - (handle->req_fw_time.tv_sec + REQUEST_FW_TIMEOUT)) { + if (tstamp.time_sec > + (handle->req_fw_time.time_sec + REQUEST_FW_TIMEOUT)) { PRINTM(MERROR, "No firmware image found. Skipping download\n"); ret = MLAN_STATUS_FAILURE; @@ -3346,7 +3355,7 @@ mlan_status woal_init_fw(moal_handle *handle) void woal_fill_mlan_buffer(moal_private *priv, mlan_buffer *pmbuf, struct sk_buff *skb) { - struct timeval tstamp; + wifi_timeval tstamp; struct ethhdr *eth; t_u8 tid = 0; dot11_txcontrol *txcontrol; @@ -3430,7 +3439,11 @@ void woal_fill_mlan_buffer(moal_private *priv, mlan_buffer *pmbuf, */ woal_get_monotonic_time(&tstamp); #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0) + skb->tstamp = ktime_get_raw(); +#else skb->tstamp = timeval_to_ktime(tstamp); +#endif #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14) skb_set_timestamp(skb, &tstamp); #else @@ -3449,8 +3462,8 @@ void woal_fill_mlan_buffer(moal_private *priv, mlan_buffer *pmbuf, pmbuf->data_len = skb->len; pmbuf->priority = skb->priority; pmbuf->buf_type = 0; - pmbuf->in_ts_sec = (t_u32)tstamp.tv_sec; - pmbuf->in_ts_usec = (t_u32)tstamp.tv_usec; + pmbuf->in_ts_sec = tstamp.time_sec; + pmbuf->in_ts_usec = tstamp.time_usec; LEAVE(); return; @@ -3870,6 +3883,7 @@ moal_private *woal_add_interface(moal_handle *handle, t_u8 bss_index, priv->bss_type == MLAN_BSS_TYPE_UAP) { #if defined(SD8887) || defined(SD8987) mlan_fw_info fw_info; + memset(&fw_info, 0, sizeof(mlan_fw_info)); woal_request_get_fw_info(priv, MOAL_IOCTL_WAIT, &fw_info); if (MFALSE #ifdef SD8887 @@ -4029,9 +4043,11 @@ void woal_remove_interface(moal_handle *handle, t_u8 bss_index) /* Clear the priv in handle */ #if defined(STA_CFG80211) || defined(UAP_CFG80211) +#if LINUX_VERSION_CODE > KERNEL_VERSION(3, 8, 13) if (IS_STA_OR_UAP_CFG80211(handle->params.cfg80211_wext)) priv->phandle->wiphy->extended_capabilities = NULL; #endif +#endif priv->phandle->priv[priv->bss_index] = NULL; priv->phandle = NULL; priv->netdev = NULL; @@ -4327,10 +4343,10 @@ int woal_open(struct net_device *dev) { moal_private *priv = (moal_private *)netdev_priv(dev); #if defined(USB) -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) struct usb_interface *intf = ((struct usb_card_rec *)priv->phandle->card)->intf; -#endif /* >= 2.6.24 */ +#endif /* < 2.6.34 */ #endif /* USB_SUSPEND_RESUME */ t_u8 carrier_on = MFALSE; @@ -4344,11 +4360,21 @@ int woal_open(struct net_device *dev) } #if defined(USB) if (IS_USB(priv->phandle->card_type)) { - /* Error enabling PM on interface */ - if (usb_autopm_get_interface(intf)) { - LEAVE(); - return -EIO; - } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 32) + intf->pm_usage_cnt = 1; +#else + atomic_set(&intf->pm_usage_cnt, 1); +#endif /* < 2.6.32 */ + usb_autopm_put_interface(intf); +#else + struct usb_device *udev = + ((struct usb_card_rec *)(priv->phandle->card))->udev; + usb_lock_device(udev); + atomic_set(&udev->dev.power.usage_count, 1); + usb_enable_autosuspend(udev); + usb_unlock_device(udev); +#endif /* < 2.6.34 */ } #endif /* USB_SUSPEND_RESUME */ @@ -4419,10 +4445,10 @@ int woal_close(struct net_device *dev) { moal_private *priv = (moal_private *)netdev_priv(dev); #if defined(USB) -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) struct usb_interface *intf = ((struct usb_card_rec *)priv->phandle->card)->intf; -#endif /* >= 2.6.24 */ +#endif /* < 2.6.34 */ #endif /* USB_SUSPEND_RESUME */ #ifdef STA_CFG80211 int cfg80211_wext = priv->phandle->params.cfg80211_wext; @@ -4470,7 +4496,21 @@ int woal_close(struct net_device *dev) MODULE_PUT; #if defined(USB) if (IS_USB(priv->phandle->card_type)) { - usb_autopm_put_interface(intf); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 32) + intf->pm_usage_cnt = 0; +#else + atomic_set(&intf->pm_usage_cnt, 0); +#endif /* < 2.6.32 */ + usb_autopm_get_interface(intf); +#else + struct usb_device *udev = + ((struct usb_card_rec *)(priv->phandle->card))->udev; + usb_lock_device(udev); + atomic_set(&udev->dev.power.usage_count, 0); + usb_disable_autosuspend(udev); + usb_unlock_device(udev); +#endif /* < 2.6.34 */ } #endif /* USB_SUSPEND_RESUME */ @@ -4549,7 +4589,7 @@ done: t_u8 woal_check_driver_status(moal_handle *handle) { moal_private *priv = NULL; - struct timeval t; + wifi_timeval t; int i = 0; mlan_debug_info *info = &(handle->debug_info); @@ -4566,15 +4606,15 @@ t_u8 woal_check_driver_status(moal_handle *handle) #define MOAL_CMD_TIMEOUT 20 woal_get_monotonic_time(&t); if (info->dnld_cmd_in_secs && info->pending_cmd && - (t.tv_sec > (info->dnld_cmd_in_secs + MOAL_CMD_TIMEOUT_MAX))) { - if (t.tv_sec > (info->dnld_cmd_in_secs + MOAL_CMD_TIMEOUT) && + (t.time_sec > (info->dnld_cmd_in_secs + MOAL_CMD_TIMEOUT_MAX))) { + if (t.time_sec > (info->dnld_cmd_in_secs + MOAL_CMD_TIMEOUT) && !info->num_cmd_timeout) { PRINTM(MERROR, "Ignore invalid time, wait=%d\n", - (int)(t.tv_sec - info->dnld_cmd_in_secs)); + (int)(t.time_sec - info->dnld_cmd_in_secs)); } else { PRINTM(MERROR, "Timeout cmd id = 0x%x wait=%d\n", info->pending_cmd, - (int)(t.tv_sec - info->dnld_cmd_in_secs)); + (int)(t.time_sec - info->dnld_cmd_in_secs)); LEAVE(); return MTRUE; } @@ -4610,11 +4650,11 @@ t_u8 woal_check_driver_status(moal_handle *handle) } if (info->pm_wakeup_card_req && info->pm_wakeup_fw_try) { #define MAX_WAIT_TIME 3 - if (t.tv_sec > (info->pm_wakeup_in_secs + MAX_WAIT_TIME)) { + if (t.time_sec > (info->pm_wakeup_in_secs + MAX_WAIT_TIME)) { PRINTM(MERROR, "wakeup_dev_req=%d wakeup_tries=%d wait=%d\n", info->pm_wakeup_card_req, info->pm_wakeup_fw_try, - (int)(t.tv_sec - info->pm_wakeup_in_secs)); + (int)(t.time_sec - info->pm_wakeup_in_secs)); LEAVE(); return MTRUE; } @@ -4847,7 +4887,12 @@ void woal_ioctl_timeout(moal_handle *handle) * * @return N/A */ -void woal_tx_timeout(struct net_device *dev) +void woal_tx_timeout(struct net_device *dev +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) + , + unsigned int txqueue +#endif +) { moal_private *priv = (moal_private *)netdev_priv(dev); @@ -5791,6 +5836,8 @@ void woal_init_priv(moal_private *priv, t_u8 wait_option) priv->pa_netdev->dev_addr, ETH_ALEN, ETH_ALEN); priv->current_addr[4] ^= 0x80; + if (priv->phandle->second_mac) + priv->current_addr[5] ^= 0x80; PRINTM(MCMND, "Set WFD interface addr: " MACSTR "\n", @@ -7895,9 +7942,13 @@ mlan_status woal_request_country_power_table(moal_private *priv, char *country) LEAVE(); return MLAN_STATUS_FAILURE; } +#if defined(STA_CFG80211) || defined(UAP_CFG80211) +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) if (fw_region) strncpy(country_name, "rgpower_XX.bin", strlen("rgpower_XX.bin")); +#endif +#endif handle = priv->phandle; /* Replace XX with ISO 3166-1 alpha-2 country code */ @@ -7915,7 +7966,8 @@ mlan_status woal_request_country_power_table(moal_private *priv, char *country) else memset(file_path, 0, sizeof(file_path)); } else { - strncpy(file_path, "nxp/", sizeof(file_path)); + strncpy(file_path, "nxp/", + MIN((sizeof(file_path) - 1), strlen("nxp/"))); } if ((strlen(file_path) + strlen(country_name)) < @@ -7932,6 +7984,8 @@ mlan_status woal_request_country_power_table(moal_private *priv, char *country) PRINTM(MMSG, "Trying download country_power_tble: %s\n", file_path); ret = woal_set_user_init_data(handle, COUNTRY_POWER_TABLE, MOAL_IOCTL_WAIT, file_path); +#if defined(STA_CFG80211) || defined(UAP_CFG80211) +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) /* Try download WW rgpowertable */ if (fw_region && (ret == MLAN_STATUS_FILE_ERR)) { strncpy(country_name, "rgpower_WW.bin", @@ -7954,6 +8008,8 @@ mlan_status woal_request_country_power_table(moal_private *priv, char *country) ret = woal_set_user_init_data(handle, COUNTRY_POWER_TABLE, MOAL_IOCTL_WAIT, file_path); } +#endif +#endif LEAVE(); return ret; } @@ -7996,7 +8052,11 @@ t_void woal_evt_work_queue(struct work_struct *work) moal_handle *handle = container_of(work, moal_handle, evt_work); struct woal_event *evt; unsigned long flags; +#if defined(UAP_CFG80211) || defined(STA_CFG80211) +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) moal_private *priv; +#endif +#endif ENTER(); if (handle->surprise_removed == MTRUE) { LEAVE(); @@ -8027,6 +8087,8 @@ t_void woal_evt_work_queue(struct work_struct *work) #endif #endif break; +#if defined(UAP_CFG80211) || defined(STA_CFG80211) +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) case WOAL_EVENT_DEAUTH: priv = evt->priv; woal_host_mlme_disconnect(evt->priv, evt->reason_code, @@ -8037,6 +8099,8 @@ t_void woal_evt_work_queue(struct work_struct *work) woal_host_mlme_process_assoc_resp( (moal_private *)evt->priv, &evt->assoc_resp); break; +#endif +#endif } kfree(evt); spin_lock_irqsave(&handle->evt_lock, flags); @@ -8061,7 +8125,6 @@ t_void woal_rx_work_queue(struct work_struct *work) #endif #endif #endif - struct timeval tstamp; wifi_timeval start_timeval; wifi_timeval end_timeval; @@ -8071,14 +8134,10 @@ t_void woal_rx_work_queue(struct work_struct *work) return; } - woal_get_monotonic_time(&tstamp); - start_timeval.time_sec = (t_u32)tstamp.tv_sec; - start_timeval.time_usec = (t_u32)tstamp.tv_usec; + woal_get_monotonic_time(&start_timeval); mlan_rx_process(handle->pmlan_adapter, NULL); - woal_get_monotonic_time(&tstamp); - end_timeval.time_sec = (t_u32)tstamp.tv_sec; - end_timeval.time_usec = (t_u32)tstamp.tv_usec; + woal_get_monotonic_time(&end_timeval); handle->rx_time += (t_u64)(timeval_to_usec(end_timeval) - timeval_to_usec(start_timeval)); PRINTM(MINFO, diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_main.h b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_main.h index 41ecd642f202..425f1b03f58a 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_main.h +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_main.h @@ -217,7 +217,7 @@ typedef t_u8 BOOLEAN; #define INTF_CARDTYPE "---------%s-MXM" -#define KERN_VERSION "4X" +#define KERN_VERSION "5X" #define V15 "15" #define V16 "16" @@ -991,8 +991,12 @@ struct tx_status_info { enum woal_event_type { WOAL_EVENT_CHAN_SWITCH, WOAL_EVENT_BGSCAN_STOP, +#if defined(UAP_CFG80211) || defined(STA_CFG80211) +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) WOAL_EVENT_DEAUTH, WOAL_EVENT_ASSOC_RESP, +#endif +#endif }; /** woal event */ @@ -1542,7 +1546,7 @@ enum ext_mod_params { EXT_BEACON_HINTS, #endif #ifdef STA_CFG80211 -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) EXT_HOST_MLME, #endif #endif @@ -1662,7 +1666,7 @@ struct _moal_handle { /** Firmware */ const struct firmware *firmware; /** Firmware request start time */ - struct timeval req_fw_time; + wifi_timeval req_fw_time; /** Init config file */ const struct firmware *init_cfg_data; /** Init config file */ @@ -2406,17 +2410,40 @@ static inline moal_private *woal_get_priv_bss_type(moal_handle *handle, return NULL; } +static inline moal_private *woal_get_vir_priv_bss_type(moal_handle *handle, + mlan_bss_type bss_type) +{ + int i; + + for (i = 0; i < MIN(handle->priv_num, MLAN_MAX_BSS_NUM); i++) { + if (handle->priv[i]) { + if (handle->priv[i]->bss_type == bss_type && + handle->priv[i]->bss_virtual) + return handle->priv[i]; + } + } + return NULL; +} + #if defined(STA_CFG80211) || defined(UAP_CFG80211) #endif -static inline void woal_get_monotonic_time(struct timeval *tv) +static inline void woal_get_monotonic_time(wifi_timeval *tv) { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) + struct timespec64 ts; +#else struct timespec ts; +#endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) + ktime_get_raw_ts64(&ts); +#else getrawmonotonic(&ts); +#endif if (tv) { - tv->tv_sec = ts.tv_sec; - tv->tv_usec = ts.tv_nsec / 1000; + tv->time_sec = (t_u32)ts.tv_sec; + tv->time_usec = (t_u32)ts.tv_nsec / 1000; } } diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_pcie.c b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_pcie.c index aef47db72593..f61c3fa327de 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_pcie.c +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_pcie.c @@ -30,11 +30,20 @@ Change log: #include "moal_pcie.h" +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35) +#include <linux/pm_qos.h> +#endif + +#include <linux/busfreq-imx.h> /******************************************************** Local Variables ********************************************************/ #define DRV_NAME "NXP mdriver PCIe" +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35) +static struct pm_qos_request woal_pcie_pm_qos_req; +#endif + /* PCIE resume handler */ static int woal_pcie_resume(struct pci_dev *pdev); static void woal_pcie_reg_dbg(moal_handle *phandle); @@ -1335,9 +1344,17 @@ mlan_status woal_pcie_bus_register(void) mlan_status ret = MLAN_STATUS_SUCCESS; ENTER(); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35) + pm_qos_add_request(&woal_pcie_pm_qos_req, PM_QOS_CPU_DMA_LATENCY, 0); +#endif + + request_bus_freq(BUS_FREQ_HIGH); /* API registers the NXP PCIE driver */ if (pci_register_driver(&wlan_pcie)) { PRINTM(MFATAL, "PCIE Driver Registration Failed \n"); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35) + pm_qos_remove_request(&woal_pcie_pm_qos_req); +#endif ret = MLAN_STATUS_FAILURE; } @@ -1354,8 +1371,12 @@ void woal_pcie_bus_unregister(void) { ENTER(); + release_bus_freq(BUS_FREQ_HIGH); /* PCIE Driver Unregistration */ pci_unregister_driver(&wlan_pcie); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35) + pm_qos_remove_request(&woal_pcie_pm_qos_req); +#endif LEAVE(); } diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_priv.c b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_priv.c index 691f917a1fe7..8397ab666bb1 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_priv.c +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_priv.c @@ -436,7 +436,7 @@ static int woal_deep_sleep_ioctl(moal_private *priv, struct iwreq *wrq) int ret = 0; int user_data_len; t_u32 deep_sleep = DEEP_SLEEP_OFF; - t_u32 data[2]; + t_u32 data[2] = {0}; int copy_len; t_u16 idletime = DEEP_SLEEP_IDLE_TIME; @@ -4077,7 +4077,7 @@ static int woal_tx_bf_cfg_ioctl(moal_private *priv, struct iwreq *wrq) { int ret = 0, data_length = wrq->u.data.length; int bf_action = 0, interval = 0; - int snr = 0, i, tmp_val; + int snr = 0, i, tmp_val = 0; t_u8 buf[MAX_IN_OUT_CHAR], char_count = 0; t_u8 *str, *token, *pos; t_u16 action = 0; diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_proc.c b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_proc.c index e18f6e7993ce..1d1898c32b05 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_proc.c +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_proc.c @@ -285,6 +285,14 @@ static int woal_info_proc_open(struct inode *inode, struct file *file) #endif } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) +static const struct proc_ops info_proc_fops = { + .proc_open = woal_info_proc_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = single_release, +}; +#else static const struct file_operations info_proc_fops = { .owner = THIS_MODULE, .open = woal_info_proc_open, @@ -292,6 +300,7 @@ static const struct file_operations info_proc_fops = { .llseek = seq_lseek, .release = single_release, }; +#endif #ifdef SDIO #define CMD52_STR_LEN 50 @@ -634,6 +643,15 @@ static int woal_config_proc_open(struct inode *inode, struct file *file) #endif } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) +static const struct proc_ops config_proc_fops = { + .proc_open = woal_config_proc_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = single_release, + .proc_write = woal_config_write, +}; +#else static const struct file_operations config_proc_fops = { .owner = THIS_MODULE, .open = woal_config_proc_open, @@ -642,6 +660,7 @@ static const struct file_operations config_proc_fops = { .release = single_release, .write = woal_config_write, }; +#endif /** * @brief wifi status proc read function @@ -676,6 +695,14 @@ static int woal_wifi_status_proc_open(struct inode *inode, struct file *file) #endif } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) +static const struct proc_ops wifi_status_proc_fops = { + .proc_open = woal_wifi_status_proc_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = single_release, +}; +#else static const struct file_operations wifi_status_proc_fops = { .owner = THIS_MODULE, .open = woal_wifi_status_proc_open, @@ -683,6 +710,7 @@ static const struct file_operations wifi_status_proc_fops = { .llseek = seq_lseek, .release = single_release, }; +#endif /******************************************************** Global Functions diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_shim.c b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_shim.c index c99e6e9332ad..a18c7cfbf1b9 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_shim.c +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_shim.c @@ -393,12 +393,31 @@ t_s32 moal_memcmp(t_void *pmoal_handle, const t_void *pmem1, t_void moal_udelay(t_void *pmoal_handle, t_u32 delay) { if (delay >= 1000) - mdelay(delay / 1000); + msleep(delay / 1000); if (delay % 1000) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36) + usleep_range(delay % 1000 - 1, delay % 1000); +#else udelay(delay % 1000); +#endif } /** + * @brief usleep_range function + * + * @param pmoal_handle Pointer to the MOAL context + * @param min_delay minimal delay in micro-second + * @param max_delay delay in micro-second + * + * @return N/A + */ +t_void moal_usleep_range(t_void *pmoal_handle, t_u32 min_delay, t_u32 max_delay) +{ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36) + usleep_range(min_delay, max_delay); +#endif +} +/** * @brief Retrieves the current system time * * @param pmoal_handle Pointer to the MOAL context @@ -410,11 +429,11 @@ t_void moal_udelay(t_void *pmoal_handle, t_u32 delay) mlan_status moal_get_system_time(t_void *pmoal_handle, t_u32 *psec, t_u32 *pusec) { - struct timeval t; + wifi_timeval t; woal_get_monotonic_time(&t); - *psec = (t_u32)t.tv_sec; - *pusec = (t_u32)t.tv_usec; + *psec = t.time_sec; + *pusec = t.time_usec; return MLAN_STATUS_SUCCESS; } @@ -869,7 +888,6 @@ mlan_status moal_send_packet_complete(t_void *pmoal_handle, pmlan_buffer pmbuf, #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 29) t_u32 index = 0; #endif - struct timeval tstamp; ENTER(); if (pmbuf && pmbuf->buf_type == MLAN_BUF_TYPE_RAW_DATA) { @@ -959,9 +977,7 @@ mlan_status moal_send_packet_complete(t_void *pmoal_handle, pmlan_buffer pmbuf, done: if ((atomic_read(&handle->tx_pending) == 0) && !is_zero_timeval(handle->tx_time_start)) { - woal_get_monotonic_time(&tstamp); - handle->tx_time_end.time_sec = (t_u32)tstamp.tv_sec; - handle->tx_time_end.time_usec = (t_u32)tstamp.tv_usec; + woal_get_monotonic_time(&handle->tx_time_end); handle->tx_time += (t_u64)(timeval_to_usec(handle->tx_time_end) - timeval_to_usec(handle->tx_time_start)); @@ -1396,8 +1412,6 @@ mlan_status moal_recv_event(t_void *pmoal_handle, pmlan_event pmevent) #if defined(UAP_CFG80211) || defined(STA_CFG80211) pchan_band_info pchan_info = NULL; #endif - struct timeval tstamp; - t_u8 radar_detected; ENTER(); @@ -1558,11 +1572,7 @@ mlan_status moal_recv_event(t_void *pmoal_handle, pmlan_event pmevent) } if (!is_zero_timeval(priv->phandle->scan_time_start)) { - woal_get_monotonic_time(&tstamp); - priv->phandle->scan_time_end.time_sec = - (t_u32)tstamp.tv_sec; - priv->phandle->scan_time_end.time_usec = - (t_u32)tstamp.tv_usec; + woal_get_monotonic_time(&priv->phandle->scan_time_end); priv->phandle->scan_time += (t_u64)( timeval_to_usec(priv->phandle->scan_time_end) - timeval_to_usec( @@ -1955,6 +1965,9 @@ mlan_status moal_recv_event(t_void *pmoal_handle, pmlan_event pmevent) woal_process_hang(priv->phandle); wifi_status = 2; break; + case MLAN_EVENT_ID_DRV_WIFI_STATUS: + wifi_status = *(t_u16 *)(pmevent->event_buf + sizeof(t_u32)); + break; case MLAN_EVENT_ID_FW_BG_SCAN: if (priv->media_connected == MTRUE) priv->bg_scan_start = MFALSE; @@ -2131,10 +2144,15 @@ mlan_status moal_recv_event(t_void *pmoal_handle, pmlan_event pmevent) woal_cfg80211_dfs_vendor_event( priv, event_dfs_radar_detected, &priv->chan); - else + else { +#endif + if (priv->uap_host_based && priv->bss_started) + cfg80211_radar_event(priv->wdev->wiphy, + &priv->chan, + GFP_KERNEL); +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) + } #endif - cfg80211_radar_event(priv->wdev->wiphy, - &priv->chan, GFP_KERNEL); } #endif /* CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 12, 0 */ #endif /* UAP_CFG80211 */ @@ -2261,6 +2279,7 @@ mlan_status moal_recv_event(t_void *pmoal_handle, pmlan_event pmevent) sizeof(t_u32)); } #endif + memset(&pm_info, 0, sizeof(mlan_ds_ps_info)); if (priv->phandle->suspend_fail == MFALSE) { woal_get_pm_info(priv, &pm_info); if (pm_info.is_suspend_allowed == MTRUE) { diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_shim.h b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_shim.h index 600b06b7de04..e692a083095a 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_shim.h +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_shim.h @@ -88,6 +88,8 @@ t_s32 moal_memcmp(t_void *pmoal_handle, const t_void *pmem1, const t_void *pmem2, t_u32 num); /** moal_udelay */ t_void moal_udelay(t_void *pmoal_handle, t_u32 udelay); +t_void moal_usleep_range(t_void *pmoal_handle, t_u32 min_delay, + t_u32 max_delay); mlan_status moal_get_boot_ktime(t_void *pmoal_handle, t_u64 *pnsec); mlan_status moal_get_system_time(t_void *pmoal_handle, t_u32 *psec, t_u32 *pusec); diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c index 38d3ea66d574..98f71fa5b052 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c @@ -335,7 +335,11 @@ static struct cfg80211_ops woal_cfg80211_ops = { #endif #endif #if CFG80211_VERSION_CODE >= KERNEL_VERSION(2, 6, 37) +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 8, 0) + .update_mgmt_frame_registrations = woal_cfg80211_mgmt_frame_register, +#else .mgmt_frame_register = woal_cfg80211_mgmt_frame_register, +#endif .mgmt_tx = woal_cfg80211_mgmt_tx, #endif @@ -513,7 +517,7 @@ static const struct wiphy_coalesce_support coalesce_support = { * * @return MTRUE/MFALSE */ -t_u8 is_cfg80211_special_region_code(char *region_string) +t_u8 is_cfg80211_special_region_code(t_u8 *region_string) { t_u8 i; region_code_t cfg80211_special_region_code[] = { @@ -1549,6 +1553,11 @@ static int woal_process_country_ie(moal_private *priv, struct cfg80211_bss *bss) priv->phandle->country_code[0] = country_ie[2]; priv->phandle->country_code[1] = country_ie[3]; priv->phandle->country_code[2] = ' '; + if (is_cfg80211_special_region_code(priv->phandle->country_code)) { + PRINTM(MIOCTL, "Skip special region code in CountryIE"); + LEAVE(); + return 0; + } if (MLAN_STATUS_SUCCESS != woal_set_region_code(priv, priv->phandle->country_code)) PRINTM(MERROR, "Set country code failed!\n"); @@ -2405,6 +2414,7 @@ static int woal_cfg80211_associate(struct wiphy *wiphy, struct net_device *dev, goto done; } ssid_bssid.host_mlme = priv->host_mlme; + ssid_bssid.use_mfp = req->use_mfp; if (req->bss->channel) { ssid_bssid.channel_flags = req->bss->channel->flags; @@ -2850,6 +2860,10 @@ int woal_cfg80211_assoc(moal_private *priv, void *sme, t_u8 wait_option, ssid_bssid.channel_flags |= CHAN_FLAGS_MAX; PRINTM(MCMND, "channel flags=0x%x\n", channel->flags); } +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) + if (conn_param) + ssid_bssid.use_mfp = conn_param->mfp; +#endif if (MLAN_STATUS_SUCCESS != woal_bss_start(priv, MOAL_IOCTL_WAIT_TIMEOUT, &ssid_bssid)) { ret = -EFAULT; @@ -2897,68 +2911,22 @@ done: } /** - * @brief Request the driver to dump the station information + * @brief Request the driver to fill the tx/rx rate info * * @param priv A pointer to moal_private structure * @param sinfo A pointer to station_info structure * * @return 0 -- success, otherwise fail */ -static mlan_status woal_cfg80211_dump_station_info(moal_private *priv, - struct station_info *sinfo) +void woal_cfg80211_fill_rate_info(moal_private *priv, + struct station_info *sinfo) { mlan_status ret = MLAN_STATUS_SUCCESS; - mlan_ds_get_signal signal; - mlan_ds_get_stats stats; mlan_ioctl_req *req = NULL; mlan_ds_rate *rate = NULL; t_u16 Rates[12] = {0x02, 0x04, 0x0B, 0x16, 0x0C, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6c}; -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 0, 0) - mlan_bss_info bss_info; - t_u8 dtim_period = 0; -#endif - ENTER(); -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 0, 0) - sinfo->filled = MBIT(NL80211_STA_INFO_RX_BYTES) | - MBIT(NL80211_STA_INFO_TX_BYTES) | - MBIT(NL80211_STA_INFO_RX_PACKETS) | - MBIT(NL80211_STA_INFO_TX_PACKETS) | - MBIT(NL80211_STA_INFO_SIGNAL) | - MBIT(NL80211_STA_INFO_TX_BITRATE); -#else - sinfo->filled = STATION_INFO_RX_BYTES | STATION_INFO_TX_BYTES | - STATION_INFO_RX_PACKETS | STATION_INFO_TX_PACKETS | - STATION_INFO_SIGNAL | STATION_INFO_TX_BITRATE; -#endif - -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(2, 6, 37) -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 0, 0) - sinfo->filled |= MBIT(NL80211_STA_INFO_TX_FAILED); -#else - sinfo->filled |= STATION_INFO_TX_FAILED; -#endif -#endif - - /* Get signal information from the firmware */ - memset(&signal, 0, sizeof(mlan_ds_get_signal)); - if (MLAN_STATUS_SUCCESS != - woal_get_signal_info(priv, MOAL_IOCTL_WAIT, &signal)) { - PRINTM(MERROR, "Error getting signal information\n"); - ret = MLAN_STATUS_FAILURE; - goto done; - } - - /* Get stats information from the firmware */ - memset(&stats, 0, sizeof(mlan_ds_get_stats)); - if (MLAN_STATUS_SUCCESS != - woal_get_stats_info(priv, MOAL_IOCTL_WAIT, &stats)) { - PRINTM(MERROR, "Error getting stats information\n"); - ret = MLAN_STATUS_FAILURE; - goto done; - } - req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_rate)); if (req == NULL) { ret = MLAN_STATUS_FAILURE; @@ -3012,6 +2980,21 @@ static mlan_status woal_cfg80211_dump_station_info(moal_private *priv, #endif } #endif +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 1, 18) + else if (rate->param.data_rate.tx_rate_format == + MLAN_RATE_FORMAT_HE) { + sinfo->txrate.flags = RATE_INFO_FLAGS_HE_MCS; + sinfo->txrate.nss = rate->param.data_rate.tx_nss + 1; + sinfo->txrate.mcs = rate->param.data_rate.tx_mcs_index; + sinfo->txrate.he_gi = rate->param.data_rate.tx_ht_gi; + if (rate->param.data_rate.tx_ht_bw == MLAN_VHT_BW80) + sinfo->txrate.bw = RATE_INFO_BW_80; + else if (rate->param.data_rate.tx_ht_bw == MLAN_HT_BW40) + sinfo->txrate.bw = RATE_INFO_BW_40; + else + sinfo->txrate.bw = RATE_INFO_BW_20; + } +#endif if (rate->param.data_rate.tx_ht_gi == MLAN_HT_SGI) sinfo->txrate.flags |= RATE_INFO_FLAGS_SHORT_GI; sinfo->txrate.mcs = rate->param.data_rate.tx_mcs_index; @@ -3020,6 +3003,117 @@ static mlan_status woal_cfg80211_dump_station_info(moal_private *priv, sinfo->txrate.legacy = Rates[rate->param.data_rate.tx_data_rate] * 5; } + // Fill Rx rate +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 0, 0) + if (rate->param.data_rate.rx_rate_format != MLAN_RATE_FORMAT_LG) { + if (rate->param.data_rate.rx_rate_format == + MLAN_RATE_FORMAT_HT) { + sinfo->rxrate.flags = RATE_INFO_FLAGS_MCS; + if (rate->param.data_rate.rx_ht_bw == MLAN_HT_BW40) + sinfo->rxrate.bw = RATE_INFO_BW_40; + else + sinfo->rxrate.bw = RATE_INFO_BW_20; + } else if (rate->param.data_rate.rx_rate_format == + MLAN_RATE_FORMAT_VHT) { + sinfo->rxrate.flags = RATE_INFO_FLAGS_VHT_MCS; + sinfo->rxrate.nss = rate->param.data_rate.rx_nss + 1; + if (rate->param.data_rate.rx_ht_bw == MLAN_VHT_BW80) + sinfo->rxrate.bw = RATE_INFO_BW_80; + else if (rate->param.data_rate.rx_ht_bw == MLAN_HT_BW40) + sinfo->rxrate.bw = RATE_INFO_BW_40; + else + sinfo->rxrate.bw = RATE_INFO_BW_20; + } +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 1, 18) + else if (rate->param.data_rate.rx_rate_format == + MLAN_RATE_FORMAT_HE) { + sinfo->rxrate.flags = RATE_INFO_FLAGS_HE_MCS; + sinfo->rxrate.nss = rate->param.data_rate.rx_nss + 1; + sinfo->rxrate.mcs = rate->param.data_rate.rx_mcs_index; + sinfo->rxrate.he_gi = rate->param.data_rate.rx_ht_gi; + if (rate->param.data_rate.rx_ht_bw == MLAN_VHT_BW80) + sinfo->rxrate.bw = RATE_INFO_BW_80; + else if (rate->param.data_rate.rx_ht_bw == MLAN_HT_BW40) + sinfo->rxrate.bw = RATE_INFO_BW_40; + else + sinfo->rxrate.bw = RATE_INFO_BW_20; + } +#endif + if (rate->param.data_rate.rx_ht_gi == MLAN_HT_SGI) + sinfo->rxrate.flags |= RATE_INFO_FLAGS_SHORT_GI; + sinfo->rxrate.mcs = rate->param.data_rate.rx_mcs_index; + } else { + /* Bit rate is in 500 kb/s units. Convert it to 100kb/s units */ + sinfo->rxrate.legacy = + Rates[rate->param.data_rate.rx_data_rate] * 5; + } +#endif +done: + if (ret != MLAN_STATUS_PENDING) + kfree(req); + LEAVE(); + return; +} +/** + * @brief Request the driver to dump the station information + * + * @param priv A pointer to moal_private structure + * @param sinfo A pointer to station_info structure + * + * @return 0 -- success, otherwise fail + */ +static mlan_status woal_cfg80211_dump_station_info(moal_private *priv, + struct station_info *sinfo) +{ + mlan_status ret = MLAN_STATUS_SUCCESS; + mlan_ds_get_signal signal; + mlan_ds_get_stats stats; +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 0, 0) + mlan_bss_info bss_info; + t_u8 dtim_period = 0; +#endif + + ENTER(); +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 0, 0) + sinfo->filled = MBIT(NL80211_STA_INFO_RX_BYTES) | + MBIT(NL80211_STA_INFO_TX_BYTES) | + MBIT(NL80211_STA_INFO_RX_PACKETS) | + MBIT(NL80211_STA_INFO_TX_PACKETS) | + MBIT(NL80211_STA_INFO_SIGNAL) | + MBIT(NL80211_STA_INFO_TX_BITRATE) | + MBIT(NL80211_STA_INFO_RX_BITRATE); +#else + sinfo->filled = STATION_INFO_RX_BYTES | STATION_INFO_TX_BYTES | + STATION_INFO_RX_PACKETS | STATION_INFO_TX_PACKETS | + STATION_INFO_SIGNAL | STATION_INFO_TX_BITRATE; +#endif + +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(2, 6, 37) +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 0, 0) + sinfo->filled |= MBIT(NL80211_STA_INFO_TX_FAILED); +#else + sinfo->filled |= STATION_INFO_TX_FAILED; +#endif +#endif + + /* Get signal information from the firmware */ + memset(&signal, 0, sizeof(mlan_ds_get_signal)); + if (MLAN_STATUS_SUCCESS != + woal_get_signal_info(priv, MOAL_IOCTL_WAIT, &signal)) { + PRINTM(MERROR, "Error getting signal information\n"); + ret = MLAN_STATUS_FAILURE; + goto done; + } + + /* Get stats information from the firmware */ + memset(&stats, 0, sizeof(mlan_ds_get_stats)); + if (MLAN_STATUS_SUCCESS != + woal_get_stats_info(priv, MOAL_IOCTL_WAIT, &stats)) { + PRINTM(MERROR, "Error getting stats information\n"); + ret = MLAN_STATUS_FAILURE; + goto done; + } + sinfo->rx_bytes = priv->stats.rx_bytes; sinfo->tx_bytes = priv->stats.tx_bytes; sinfo->rx_packets = priv->stats.rx_packets; @@ -3054,11 +3148,8 @@ static mlan_status woal_cfg80211_dump_station_info(moal_private *priv, } sinfo->bss_param.dtim_period = dtim_period; #endif - + woal_cfg80211_fill_rate_info(priv, sinfo); done: - if (ret != MLAN_STATUS_PENDING) - kfree(req); - LEAVE(); return ret; } @@ -3428,6 +3519,7 @@ woal_cfg80211_reg_notifier(struct wiphy *wiphy, "cfg80211 regulatory domain callback " "%c%c initiator=%d\n", request->alpha2[0], request->alpha2[1], request->initiator); + memset(&fw_info, 0, sizeof(mlan_fw_info)); woal_request_get_fw_info(priv, MOAL_IOCTL_WAIT, &fw_info); if (fw_info.force_reg) { PRINTM(MINFO, @@ -3709,16 +3801,27 @@ static int woal_find_wps_ie_in_probereq(const t_u8 *ie, int len) t_u8 woal_is_scan_result_expired(moal_private *priv) { mlan_scan_resp scan_resp; - struct timeval t; + wifi_timeval t; ENTER(); + // Don't block ACS scan if (GET_BSS_ROLE(priv) == MLAN_BSS_ROLE_UAP) { LEAVE(); return MTRUE; } + // Don't block scan when non any interface active if (!woal_is_any_interface_active(priv->phandle)) { LEAVE(); return MTRUE; } +#if defined(WIFI_DIRECT_SUPPORT) +#if CFG80211_VERSION_CODE >= WIFI_DIRECT_KERNEL_VERSION + // Do not skip p2p interface connect scan + if (priv->bss_type == MLAN_BSS_TYPE_WIFIDIRECT) { + LEAVE(); + return MTRUE; + } +#endif +#endif if (MLAN_STATUS_SUCCESS != woal_get_scan_table(priv, MOAL_IOCTL_WAIT, &scan_resp)) { @@ -3728,7 +3831,7 @@ t_u8 woal_is_scan_result_expired(moal_private *priv) woal_get_monotonic_time(&t); /** scan result expired value */ #define SCAN_RESULT_EXPIRTED 1 - if (t.tv_sec > (scan_resp.age_in_secs + SCAN_RESULT_EXPIRTED)) { + if (t.time_sec > (scan_resp.age_in_secs + SCAN_RESULT_EXPIRTED)) { LEAVE(); return MTRUE; } @@ -3780,7 +3883,6 @@ static int woal_cfg80211_scan(struct wiphy *wiphy, struct net_device *dev, #endif int ret = 0, i; unsigned long flags; - struct timeval tstamp; ENTER(); @@ -3836,10 +3938,7 @@ static int woal_cfg80211_scan(struct wiphy *wiphy, struct net_device *dev, priv->phandle->scan_request = request; spin_unlock_irqrestore(&priv->phandle->scan_req_lock, flags); if (is_zero_timeval(priv->phandle->scan_time_start)) { - woal_get_monotonic_time(&tstamp); - priv->phandle->scan_time_start.time_sec = (t_u32)tstamp.tv_sec; - priv->phandle->scan_time_start.time_usec = - (t_u32)tstamp.tv_usec; + woal_get_monotonic_time(&priv->phandle->scan_time_start); PRINTM(MINFO, "%s : start_timeval=%d:%d \n", __func__, priv->phandle->scan_time_start.time_sec, priv->phandle->scan_time_start.time_usec); @@ -3859,6 +3958,7 @@ static int woal_cfg80211_scan(struct wiphy *wiphy, struct net_device *dev, if (priv->phandle->scan_request->n_channels <= 38) scan_req->ext_scan_type = EXT_SCAN_ENHANCE; + memset(&scan_cfg, 0, sizeof(mlan_scan_cfg)); #ifdef WIFI_DIRECT_SUPPORT if (priv->phandle->miracast_mode) scan_req->scan_chan_gap = priv->phandle->scan_chan_gap; @@ -6883,6 +6983,9 @@ int woal_cfg80211_uap_add_station(struct wiphy *wiphy, struct net_device *dev, t_u8 *pos; t_u8 qosinfo; MrvlIEtypes_Data_t *tlv; +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) + MrvlExtIEtypes_Data_t *ext_tlv; +#endif mlan_status status; int ret = 0; @@ -6908,6 +7011,11 @@ int woal_cfg80211_uap_add_station(struct wiphy *wiphy, struct net_device *dev, if (params->opmode_notif_used) req_len += sizeof(MrvlIEtypesHeader_t) + sizeof(u8); #endif + +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) + if (params->he_capa_len) + req_len += sizeof(MrvlExtIEtypesHeader_t) + params->he_capa_len; +#endif req = woal_alloc_mlan_ioctl_req(req_len); if (req == NULL) { ret = -ENOMEM; @@ -7013,6 +7121,21 @@ int woal_cfg80211_uap_add_station(struct wiphy *wiphy, struct net_device *dev, tlv = (MrvlIEtypes_Data_t *)pos; } #endif +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) + if (params->he_capa_len) { + ext_tlv = (MrvlExtIEtypes_Data_t *)pos; + ext_tlv->header.type = EXTENSION; + ext_tlv->header.len = params->he_capa_len + sizeof(u8); + ext_tlv->header.ext_id = HE_CAPABILITY; + moal_memcpy_ext(priv->phandle, ext_tlv->data, + (u8 *)params->he_capa, params->he_capa_len, + params->he_capa_len); + pos += sizeof(MrvlExtIEtypesHeader_t) + params->he_capa_len; + bss->param.sta_info.tlv_len += + sizeof(MrvlExtIEtypesHeader_t) + params->he_capa_len; + tlv = (MrvlIEtypes_Data_t *)pos; + } +#endif DBG_HEXDUMP(MCMD_D, "sta tlv", &bss->param.sta_info.tlv[0], bss->param.sta_info.tlv_len); /* Send IOCTL request to MLAN */ @@ -7415,6 +7538,7 @@ mlan_status woal_register_cfg80211(moal_private *priv) ENTER(); + memset(&fw_info, 0, sizeof(mlan_fw_info)); woal_request_get_fw_info(priv, MOAL_IOCTL_WAIT, &fw_info); reg_alpha2 = priv->phandle->params.reg_alpha2; wiphy = wiphy_new(&woal_cfg80211_ops, sizeof(moal_handle *)); @@ -7492,7 +7616,11 @@ mlan_status woal_register_cfg80211(moal_private *priv) } /* Supported bands */ if (fw_info.fw_bands & (BAND_B | BAND_G | BAND_GN | BAND_GAC)) { - wiphy->bands[IEEE80211_BAND_2GHZ] = &cfg80211_band_2ghz; + if (priv->phandle->second_mac) + wiphy->bands[IEEE80211_BAND_2GHZ] = + &mac1_cfg80211_band_2ghz; + else + wiphy->bands[IEEE80211_BAND_2GHZ] = &cfg80211_band_2ghz; /* If 2.4G enable, it will overwrite default to 2.4G*/ priv->phandle->band = IEEE80211_BAND_2GHZ; } diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_uap.c b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_uap.c index 1974205bab8a..a1d30c32adcd 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_uap.c +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_uap.c @@ -470,6 +470,88 @@ done: } /** + * @brief configure beacon stuck detect mechanism + * + * @param dev A pointer to net_device structure + * @param req A pointer to ifreq structure + * @return 0 --success, otherwise fail + */ +static int woal_uap_beacon_stuck(struct net_device *dev, struct ifreq *req) +{ + moal_private *priv = (moal_private *)netdev_priv(dev); + mlan_ioctl_req *ioctl_req = NULL; + mlan_ds_misc_cfg *pm = NULL; + beacon_stuck_detect_para param; + int ret = 0; + mlan_status status = MLAN_STATUS_SUCCESS; + + ENTER(); + + memset(¶m, 0, sizeof(param)); + + /* Sanity check */ + if (req->ifr_data == NULL) { + PRINTM(MERROR, "woal_uap_beacon_stuck() corrupt data\n"); + ret = -EFAULT; + goto done; + } + + if (copy_from_user(¶m, req->ifr_data, sizeof(param))) { + PRINTM(MERROR, "Copy from user failed\n"); + ret = -EFAULT; + goto done; + } + + DBG_HEXDUMP(MCMD_D, "beacon_stuck_detect_para", (t_u8 *)¶m, + sizeof(param)); + + ioctl_req = woal_alloc_mlan_ioctl_req( + sizeof(mlan_ds_beacon_stuck_param_cfg)); + if (ioctl_req == NULL) { + LEAVE(); + return -ENOMEM; + } + + pm = (mlan_ds_misc_cfg *)ioctl_req->pbuf; + pm->sub_command = MLAN_OID_MISC_BEACON_STUCK; + ioctl_req->req_id = MLAN_IOCTL_MISC_CFG; + + pm->param.beacon_stuck_cfg.action = param.action; + pm->param.beacon_stuck_cfg.beacon_stuck_detect_count = + param.beacon_stuck_detect_count; + pm->param.beacon_stuck_cfg.recovery_confirm_count = + param.recovery_confirm_count; + + status = woal_request_ioctl(priv, ioctl_req, MOAL_IOCTL_WAIT); + + if (status != MLAN_STATUS_SUCCESS) { + ret = -EFAULT; + goto done; + } + + param.action = pm->param.beacon_stuck_cfg.action; + param.beacon_stuck_detect_count = + pm->param.beacon_stuck_cfg.beacon_stuck_detect_count; + param.recovery_confirm_count = + pm->param.beacon_stuck_cfg.recovery_confirm_count; + + /* Copy to user */ + if (copy_to_user(req->ifr_data, ¶m, sizeof(param))) { + PRINTM(MERROR, "Copy to user failed!\n"); + ret = -EFAULT; + goto done; + } + +done: + if (status != MLAN_STATUS_PENDING) + kfree(ioctl_req); + + LEAVE(); + + return ret; +} + +/** * @brief configure tx_pause settings * * @param dev A pointer to net_device structure @@ -2255,7 +2337,9 @@ static int woal_uap_ioctl(struct net_device *dev, struct ifreq *req) case UAP_BAND_STEER: ret = woal_uap_band_steer(dev, req); break; - + case UAP_BEACON_STUCK_DETECT: + ret = woal_uap_beacon_stuck(dev, req); + break; default: break; } @@ -3047,7 +3131,7 @@ static int woal_uap_set_wapi_flag_ioctl(moal_private *priv, wapi_msg *msg) } woal_enable_wapi(priv, MTRUE); done: - if (status != MLAN_STATUS_PENDING) + if ((status != MLAN_STATUS_PENDING) && req) kfree(req); LEAVE(); return ret; @@ -3163,7 +3247,8 @@ done: * * @return 0 --success, otherwise fail */ -int woal_set_uap_ht_tx_cfg(moal_private *priv, Band_Config_t bandcfg, t_u8 en) +int woal_set_uap_ht_tx_cfg(moal_private *priv, Band_Config_t bandcfg, + t_u16 ht_cap, t_u8 en) { int ret = 0; mlan_ds_11n_cfg *cfg_11n = NULL; @@ -3184,13 +3269,13 @@ int woal_set_uap_ht_tx_cfg(moal_private *priv, Band_Config_t bandcfg, t_u8 en) /* Set HT Tx configurations */ if (bandcfg.chanBand == BAND_2GHZ) { if (en) - cfg_11n->param.tx_cfg.httxcap = 0x20; + cfg_11n->param.tx_cfg.httxcap = ht_cap; else cfg_11n->param.tx_cfg.httxcap = 0; cfg_11n->param.tx_cfg.misc_cfg = BAND_SELECT_BG; } else if (bandcfg.chanBand == BAND_5GHZ) { if (en) - cfg_11n->param.tx_cfg.httxcap = 0x6f; + cfg_11n->param.tx_cfg.httxcap = ht_cap; else cfg_11n->param.tx_cfg.httxcap = 0; cfg_11n->param.tx_cfg.misc_cfg = BAND_SELECT_A; @@ -3227,6 +3312,7 @@ mlan_status woal_uap_set_11n_status(moal_private *priv, mlan_fw_info fw_info; ENTER(); + memset(&fw_info, 0, sizeof(mlan_fw_info)); if (action == MLAN_ACT_DISABLE) { if ((sys_cfg->supported_mcs_set[0] == 0) && (sys_cfg->supported_mcs_set[4] == 0) && @@ -3280,6 +3366,7 @@ int woal_uap_set_11ac_status(moal_private *priv, t_u8 action, t_u8 vht20_40, ENTER(); + memset(&fw_info, 0, sizeof(mlan_fw_info)); woal_request_get_fw_info(priv, MOAL_IOCTL_WAIT, &fw_info); req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_11ac_cfg)); @@ -3407,6 +3494,7 @@ int woal_uap_set_11ax_status(moal_private *priv, t_u8 action, t_u8 band, mlan_ds_11ax_he_cfg he_cfg; ENTER(); + memset(&fw_info, 0, sizeof(mlan_fw_info)); woal_request_get_fw_info(priv, MOAL_IOCTL_WAIT, &fw_info); if ((band == BAND_5GHZ && !(fw_info.fw_bands & BAND_AAX)) || (band == BAND_2GHZ && !(fw_info.fw_bands & BAND_GAX))) { diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_uap.h b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_uap.h index 3f1fdcb80ab5..d8182c1561b3 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_uap.h +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_uap.h @@ -89,6 +89,8 @@ Change log: #define UAP_CHAN_SWITCH_COUNT_CFG 23 #define UAP_BAND_STEER 24 +#define UAP_BEACON_STUCK_DETECT 25 + /** Private command ID to Power Mode */ #define UAP_POWER_MODE (SIOCDEVPRIVATE + 3) @@ -422,6 +424,20 @@ typedef struct _band_steer_para { } band_steer_para; +/** beacon stuck detect mechanism parameters */ +typedef struct _beacon_stuck_detect_para { + /** subcmd */ + t_u32 subcmd; + /** Set/Get */ + t_u8 action; + /** No of beacon interval after which firmware will check if beacon Tx + * is going fine */ + t_u8 beacon_stuck_detect_count; + /** Upon performing MAC reset, no of beacon interval after which + * firmware will check if recovery was successful */ + t_u8 recovery_confirm_count; +} beacon_stuck_detect_para; + /** tx_data_pause parameters */ typedef struct _tx_data_pause_para { /** subcmd */ @@ -550,7 +566,8 @@ int woal_uap_set_11ac_status(moal_private *priv, t_u8 action, t_u8 vht20_40, int woal_11ax_cfg(moal_private *priv, t_u8 action, mlan_ds_11ax_he_cfg *he_cfg); int woal_uap_set_11ax_status(moal_private *priv, t_u8 action, t_u8 band, IEEEtypes_HECap_t *hecap_ie); -int woal_set_uap_ht_tx_cfg(moal_private *priv, Band_Config_t bandcfg, t_u8 en); +int woal_set_uap_ht_tx_cfg(moal_private *priv, Band_Config_t bandcfg, + t_u16 ht_cap, t_u8 en); mlan_status woal_uap_set_11n_status(moal_private *priv, mlan_uap_bss_param *sys_cfg, t_u8 action); #ifdef UAP_WEXT diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_uap_cfg80211.c b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_uap_cfg80211.c index 707a9abc5445..f065de43005b 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_uap_cfg80211.c +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_uap_cfg80211.c @@ -422,18 +422,20 @@ static t_void woal_set_wmm_ies(moal_private *priv, const t_u8 *ie, int len, /** * @brief initialize AP or GO bss config * @param priv A pointer to moal private structure + * @param band BAND_2GHZ/BAND_5GHZ * @param params A pointer to cfg80211_ap_settings structure * @return 0 -- success, otherwise fail */ -t_u8 woal_check_11ac_capability(moal_private *priv, +t_u8 woal_check_11ac_capability(moal_private *priv, t_u8 band, struct cfg80211_ap_settings *params) #else /** * @brief initialize AP or GO bss config + * @param band BAND_2GHZ/BAND_5GHZ * @param priv A pointer to moal private structure * @return 0 -- success, otherwise fail */ -t_u8 woal_check_11ac_capability(moal_private *priv) +t_u8 woal_check_11ac_capability(moal_private *priv, t_u8 band) #endif { mlan_fw_info fw_info; @@ -442,8 +444,15 @@ t_u8 woal_check_11ac_capability(moal_private *priv) const u8 *vht_ie = NULL; #endif ENTER(); + memset(&fw_info, 0, sizeof(mlan_fw_info)); woal_request_get_fw_info(priv, MOAL_IOCTL_WAIT, &fw_info); - if (!(fw_info.fw_bands & BAND_AAC)) { + if ((band == BAND_5GHZ) && !(fw_info.fw_bands & BAND_AAC)) { + PRINTM(MCMND, "FW don't support 5G AC"); + LEAVE(); + return enable_11ac; + } + if ((band == BAND_2GHZ) && !(fw_info.fw_bands & BAND_GAC)) { + PRINTM(MCMND, "FW don't support 2G AC"); LEAVE(); return enable_11ac; } @@ -479,6 +488,7 @@ t_u8 woal_check_11ax_capability(moal_private *priv, t_u8 band, t_u8 he_txrx_mcs_support[4] = {0xff, 0xff, 0xff, 0xff}; #endif ENTER(); + memset(&fw_info, 0, sizeof(mlan_fw_info)); woal_request_get_fw_info(priv, MOAL_IOCTL_WAIT, &fw_info); if ((band == BAND_5GHZ) && !(fw_info.fw_bands & BAND_AAX)) { PRINTM(MCMND, "FW don't support 5G AX\n"); @@ -963,16 +973,6 @@ static int woal_cfg80211_beacon_config(moal_private *priv, priv->channel); #endif #endif - -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) - enable_11ac = woal_check_11ac_capability(priv, params); - if (enable_11ac && - ((priv->chan.width == NL80211_CHAN_WIDTH_20) || - (priv->chan.width == NL80211_CHAN_WIDTH_40))) - vht20_40 = MTRUE; -#else - enable_11ac = woal_check_11ac_capability(priv); -#endif #ifdef WIFI_DIRECT_SUPPORT if (priv->bss_type == MLAN_BSS_TYPE_WIFIDIRECT) moal_memcpy_ext(priv->phandle, @@ -997,6 +997,17 @@ static int woal_cfg80211_beacon_config(moal_private *priv, params->head_len, params->tail, params->tail_len); #endif +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) + enable_11ac = woal_check_11ac_capability( + priv, sys_config->bandcfg.chanBand, params); + if (enable_11ac && + ((priv->chan.width == NL80211_CHAN_WIDTH_20) || + (priv->chan.width == NL80211_CHAN_WIDTH_40))) + vht20_40 = MTRUE; +#else + enable_11ac = woal_check_11ac_capability( + priv, sys_config->bandcfg.chanBand); +#endif #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) enable_11ax = woal_check_11ax_capability( @@ -1237,22 +1248,23 @@ static int woal_cfg80211_beacon_config(moal_private *priv, (sys_config->protocol == PROTOCOL_WPA)) enable_11n = MFALSE; if (!enable_11n) { - woal_set_uap_ht_tx_cfg(priv, sys_config->bandcfg, MFALSE); + woal_set_uap_ht_tx_cfg(priv, sys_config->bandcfg, ht_cap, + MFALSE); woal_uap_set_11n_status(priv, sys_config, MLAN_ACT_DISABLE); } else { - woal_set_uap_ht_tx_cfg(priv, sys_config->bandcfg, MTRUE); + woal_set_uap_ht_tx_cfg(priv, sys_config->bandcfg, ht_cap, + MTRUE); woal_uap_set_11n_status(priv, sys_config, MLAN_ACT_ENABLE); woal_set_get_tx_bf_cap(priv, MLAN_ACT_GET, &sys_config->tx_bf_cap); } - if (sys_config->bandcfg.chanBand == BAND_5GHZ) { - if (enable_11ac && enable_11n) { - vhtcap_ie = woal_get_vhtcap_info(ie, ie_len); - woal_uap_set_11ac_status(priv, MLAN_ACT_ENABLE, - vht20_40, vhtcap_ie); - } else - woal_uap_set_11ac_status(priv, MLAN_ACT_DISABLE, - vht20_40, NULL); + if (enable_11ac && enable_11n) { + vhtcap_ie = woal_get_vhtcap_info(ie, ie_len); + woal_uap_set_11ac_status(priv, MLAN_ACT_ENABLE, vht20_40, + vhtcap_ie); + } else { + woal_uap_set_11ac_status(priv, MLAN_ACT_DISABLE, vht20_40, + NULL); } if (enable_11ax && enable_11n) { #if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) @@ -1467,6 +1479,12 @@ int woal_cfg80211_add_virt_if(struct wiphy *wiphy, ENTER(); ASSERT_RTNL(); + priv = woal_get_vir_priv_bss_type(handle, MLAN_BSS_TYPE_WIFIDIRECT); + if (priv && priv->bss_role == MLAN_BSS_ROLE_UAP && + priv->bss_started == MTRUE) { + if (handle->pref_mac) + handle = (moal_handle *)handle->pref_mac; + } priv = (moal_private *)woal_get_priv_bss_type(handle, MLAN_BSS_TYPE_WIFIDIRECT); if (!priv || !priv->phandle) { @@ -1615,11 +1633,13 @@ int woal_cfg80211_del_virt_if(struct wiphy *wiphy, struct net_device *dev) moal_private *vir_priv = NULL; moal_private *remain_priv = NULL; moal_handle *handle = (moal_handle *)woal_get_wiphy_priv(wiphy); + t_u8 find_bss = MFALSE; for (i = 0; i < handle->priv_num; i++) { vir_priv = handle->priv[i]; if (vir_priv) { if (vir_priv->netdev == dev) { + find_bss = MTRUE; PRINTM(MMSG, "Del virtual interface %s, index=%d\n", dev->name, i); @@ -1627,6 +1647,23 @@ int woal_cfg80211_del_virt_if(struct wiphy *wiphy, struct net_device *dev) } } } + if (!find_bss) { + /* Switch to the other MAC */ + if (handle->pref_mac) + handle = (moal_handle *)handle->pref_mac; + for (i = 0; i < handle->priv_num; i++) { + vir_priv = handle->priv[i]; + if (vir_priv) { + if (vir_priv->netdev == dev) { + find_bss = MTRUE; + PRINTM(MMSG, + "Del virtual interface %s, index=%d\n", + dev->name, i); + break; + } + } + } + } priv = (moal_private *)woal_get_priv_bss_type(handle, MLAN_BSS_TYPE_WIFIDIRECT); @@ -2568,8 +2605,7 @@ int woal_uap_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev, BIT(NL80211_STA_INFO_TX_BYTES) | BIT(NL80211_STA_INFO_RX_PACKETS) | BIT(NL80211_STA_INFO_TX_PACKETS) | - BIT(NL80211_STA_INFO_SIGNAL) | - BIT(NL80211_STA_INFO_TX_BITRATE); + BIT(NL80211_STA_INFO_SIGNAL); stainfo->rx_bytes = priv->stats.rx_bytes; stainfo->tx_bytes = priv->stats.tx_bytes; diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_uap_wext.c b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_uap_wext.c index 05f10a0b2fe9..51967247f796 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_uap_wext.c +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_uap_wext.c @@ -129,8 +129,8 @@ static int channel_to_frequency(t_u16 channel, t_u8 band) * @return 0 --success */ static int woal_config_commit(struct net_device *dev, - struct iw_request_info *info, char *cwrq, - char *extra) + struct iw_request_info *info, + union iwreq_data *cwrq, char *extra) { ENTER(); @@ -149,8 +149,9 @@ static int woal_config_commit(struct net_device *dev, * @return 0 --success */ static int woal_get_name(struct net_device *dev, struct iw_request_info *info, - char *cwrq, char *extra) + union iwreq_data *wrqu, char *extra) { + char *cwrq = wrqu->name; ENTER(); strcpy(cwrq, "IEEE 802.11-DS"); LEAVE(); @@ -168,9 +169,10 @@ static int woal_get_name(struct net_device *dev, struct iw_request_info *info, * @return 0 --success */ static int woal_get_wap(struct net_device *dev, struct iw_request_info *info, - struct sockaddr *awrq, char *extra) + union iwreq_data *wrqu, char *extra) { moal_private *priv = (moal_private *)netdev_priv(dev); + struct sockaddr *awrq = &wrqu->addr; int ret = 0; ENTER(); @@ -198,10 +200,11 @@ static int woal_get_wap(struct net_device *dev, struct iw_request_info *info, * @return 0 --success, otherwise fail */ static int woal_set_wap(struct net_device *dev, struct iw_request_info *info, - struct sockaddr *awrq, char *extra) + union iwreq_data *wrqu, char *extra) { int ret = 0; moal_private *priv = (moal_private *)netdev_priv(dev); + struct sockaddr *awrq = &wrqu->addr; const t_u8 zero_mac[MLAN_MAC_ADDR_LENGTH] = {0, 0, 0, 0, 0, 0}; ENTER(); @@ -249,9 +252,10 @@ done: * @return 0 --success, otherwise fail */ static int woal_set_freq(struct net_device *dev, struct iw_request_info *info, - struct iw_freq *fwrq, char *extra) + union iwreq_data *wrqu, char *extra) { moal_private *priv = (moal_private *)netdev_priv(dev); + struct iw_freq *fwrq = &wrqu->freq; mlan_uap_bss_param *sys_cfg = NULL, *ap_cfg = NULL; int ret = 0, chan = 0, i = 0; @@ -328,9 +332,10 @@ done: * @return 0 --success, otherwise fail */ static int woal_get_freq(struct net_device *dev, struct iw_request_info *info, - struct iw_freq *fwrq, char *extra) + union iwreq_data *wrqu, char *extra) { moal_private *priv = (moal_private *)netdev_priv(dev); + struct iw_freq *fwrq = &wrqu->freq; mlan_uap_bss_param *ap_cfg = NULL; t_u8 band = 0; int ret = 0; @@ -373,10 +378,11 @@ static int woal_get_freq(struct net_device *dev, struct iw_request_info *info, * @return 0 --success, otherwise fail */ static int woal_set_bss_mode(struct net_device *dev, - struct iw_request_info *info, t_u32 *uwrq, - char *extra) + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) { int ret = 0; + t_u32 *uwrq = &wrqu->mode; ENTER(); switch (*uwrq) { @@ -404,9 +410,10 @@ static int woal_set_bss_mode(struct net_device *dev, * @return 0 --success */ static int woal_get_bss_mode(struct net_device *dev, - struct iw_request_info *info, t_u32 *uwrq, - char *extra) + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) { + t_u32 *uwrq = &wrqu->mode; ENTER(); *uwrq = IW_MODE_MASTER; @@ -609,9 +616,10 @@ done: * @return 0 --success, otherwise fail */ static int woal_get_encode(struct net_device *dev, struct iw_request_info *info, - struct iw_point *dwrq, char *extra) + union iwreq_data *wrqu, char *extra) { moal_private *priv = (moal_private *)netdev_priv(dev); + struct iw_point *dwrq = &wrqu->data; int index = (dwrq->flags & IW_ENCODE_INDEX); wep_key *pkey = NULL; mlan_uap_bss_param *ap_cfg = NULL; @@ -712,7 +720,7 @@ done: * @return -EOPNOTSUPP */ static int woal_get_gen_ie(struct net_device *dev, struct iw_request_info *info, - struct iw_point *dwrq, char *extra) + union iwreq_data *wrqu, char *extra) { ENTER(); LEAVE(); @@ -734,9 +742,10 @@ static int woal_get_gen_ie(struct net_device *dev, struct iw_request_info *info, * @return 0 --success, otherwise fail */ static int woal_set_gen_ie(struct net_device *dev, struct iw_request_info *info, - struct iw_point *dwrq, char *extra) + union iwreq_data *wrqu, char *extra) { moal_private *priv = (moal_private *)netdev_priv(dev); + struct iw_point *dwrq = &wrqu->data; mlan_uap_bss_param *sys_cfg = NULL; IEEEtypes_Header_t *tlv = NULL; int tlv_hdr_len = sizeof(IEEEtypes_Header_t), tlv_buf_left = 0; @@ -871,10 +880,11 @@ done: */ static int woal_set_encode_ext(struct net_device *dev, struct iw_request_info *info, - struct iw_point *dwrq, char *extra) + union iwreq_data *wrqu, char *extra) { struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; moal_private *priv = (moal_private *)netdev_priv(dev); + struct iw_point *dwrq = &wrqu->data; int key_index; t_u8 *pkey_material = NULL; mlan_ioctl_req *req = NULL; @@ -1020,7 +1030,7 @@ done: */ static int woal_get_encode_ext(struct net_device *dev, struct iw_request_info *info, - struct iw_point *dwrq, char *extra) + union iwreq_data *wrqu, char *extra) { ENTER(); LEAVE(); @@ -1038,7 +1048,7 @@ static int woal_get_encode_ext(struct net_device *dev, * @return 0--success, otherwise fail */ static int woal_set_mlme(struct net_device *dev, struct iw_request_info *info, - struct iw_point *dwrq, char *extra) + union iwreq_data *wrqu, char *extra) { struct iw_mlme *mlme = (struct iw_mlme *)extra; moal_private *priv = (moal_private *)netdev_priv(dev); @@ -1158,10 +1168,11 @@ done: * @return 0 --success, otherwise fail */ static int woal_set_auth(struct net_device *dev, struct iw_request_info *info, - struct iw_param *vwrq, char *extra) + union iwreq_data *wrqu, char *extra) { int ret = 0; moal_private *priv = (moal_private *)netdev_priv(dev); + struct iw_param *vwrq = &wrqu->param; mlan_uap_bss_param *sys_cfg = NULL; ENTER(); @@ -1335,9 +1346,10 @@ done: * @return 0 --success, otherwise fail */ static int woal_get_auth(struct net_device *dev, struct iw_request_info *info, - struct iw_param *vwrq, char *extra) + union iwreq_data *wrqu, char *extra) { moal_private *priv = (moal_private *)netdev_priv(dev); + struct iw_param *vwrq = &wrqu->param; mlan_uap_bss_param *ap_cfg = NULL; ENTER(); @@ -1438,9 +1450,10 @@ static int woal_get_auth(struct net_device *dev, struct iw_request_info *info, * @return 0 --success, otherwise fail */ static int woal_get_range(struct net_device *dev, struct iw_request_info *info, - struct iw_point *dwrq, char *extra) + union iwreq_data *wrqu, char *extra) { moal_private *priv = (moal_private *)netdev_priv(dev); + struct iw_point *dwrq = &wrqu->data; mlan_uap_bss_param *ap_cfg = NULL; struct iw_range *range = (struct iw_range *)extra; t_u8 band = 0; @@ -1581,7 +1594,7 @@ static int woal_get_range(struct net_device *dev, struct iw_request_info *info, * @return 0 --success, otherwise fail */ static int woal_set_priv(struct net_device *dev, struct iw_request_info *info, - struct iw_point *dwrq, char *extra) + union iwreq_data *wrqu, char *extra) { ENTER(); LEAVE(); @@ -1599,9 +1612,10 @@ static int woal_set_priv(struct net_device *dev, struct iw_request_info *info, * @return 0--success, otherwise fail */ static int woal_set_essid(struct net_device *dev, struct iw_request_info *info, - struct iw_point *dwrq, char *extra) + union iwreq_data *wrqu, char *extra) { moal_private *priv = (moal_private *)netdev_priv(dev); + struct iw_point *dwrq = &wrqu->data; mlan_uap_bss_param *sys_cfg = NULL; int ret = 0; diff --git a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_wext.c b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_wext.c index 7b0d3404d1af..0072b18a0aea 100644 --- a/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_wext.c +++ b/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_wext.c @@ -194,8 +194,8 @@ static int woal_get_nick(struct net_device *dev, struct iw_request_info *info, * @return 0 --success */ static int woal_config_commit(struct net_device *dev, - struct iw_request_info *info, char *cwrq, - char *extra) + struct iw_request_info *info, + union iwreq_data *cwrq, char *extra) { ENTER(); @@ -214,8 +214,9 @@ static int woal_config_commit(struct net_device *dev, * @return 0 --success */ static int woal_get_name(struct net_device *dev, struct iw_request_info *info, - char *cwrq, char *extra) + union iwreq_data *wrqu, char *extra) { + char *cwrq = wrqu->name; ENTER(); strcpy(cwrq, "IEEE 802.11-DS"); LEAVE(); @@ -233,10 +234,11 @@ static int woal_get_name(struct net_device *dev, struct iw_request_info *info, * @return 0 --success, otherwise fail */ static int woal_set_freq(struct net_device *dev, struct iw_request_info *info, - struct iw_freq *fwrq, char *extra) + union iwreq_data *wrqu, char *extra) { int ret = 0; moal_private *priv = (moal_private *)netdev_priv(dev); + struct iw_freq *fwrq = &wrqu->freq; mlan_ds_bss *bss = NULL; mlan_ioctl_req *req = NULL; mlan_status status = MLAN_STATUS_SUCCESS; @@ -288,10 +290,11 @@ done: * @return 0 --success, otherwise fail */ static int woal_get_freq(struct net_device *dev, struct iw_request_info *info, - struct iw_freq *fwrq, char *extra) + union iwreq_data *wrqu, char *extra) { int ret = 0; moal_private *priv = (moal_private *)netdev_priv(dev); + struct iw_freq *fwrq = &wrqu->freq; mlan_ds_bss *bss = NULL; mlan_ioctl_req *req = NULL; mlan_status status = MLAN_STATUS_SUCCESS; @@ -334,11 +337,12 @@ done: * @return 0 --success, otherwise fail */ static int woal_set_bss_mode(struct net_device *dev, - struct iw_request_info *info, t_u32 *uwrq, - char *extra) + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) { int ret = 0; moal_private *priv = (moal_private *)netdev_priv(dev); + t_u32 *uwrq = &wrqu->mode; mlan_ds_bss *bss = NULL; mlan_ioctl_req *req = NULL; mlan_status status = MLAN_STATUS_SUCCESS; @@ -394,10 +398,11 @@ done: * @return 0 --success */ static int woal_get_wap(struct net_device *dev, struct iw_request_info *info, - struct sockaddr *awrq, char *extra) + union iwreq_data *wrqu, char *extra) { int ret = 0; moal_private *priv = (moal_private *)netdev_priv(dev); + struct sockaddr *awrq = &wrqu->addr; mlan_bss_info bss_info; ENTER(); @@ -430,12 +435,13 @@ static int woal_get_wap(struct net_device *dev, struct iw_request_info *info, * @return 0 --success, otherwise fail */ static int woal_set_wap(struct net_device *dev, struct iw_request_info *info, - struct sockaddr *awrq, char *extra) + union iwreq_data *wrqu, char *extra) { int ret = 0; const t_u8 bcast[MLAN_MAC_ADDR_LENGTH] = {255, 255, 255, 255, 255, 255}; const t_u8 zero_mac[MLAN_MAC_ADDR_LENGTH] = {0, 0, 0, 0, 0, 0}; moal_private *priv = (moal_private *)netdev_priv(dev); + struct sockaddr *awrq = &wrqu->addr; mlan_ssid_bssid ssid_bssid; mlan_bss_info bss_info; @@ -527,10 +533,11 @@ done: * @return 0 --success */ static int woal_get_bss_mode(struct net_device *dev, - struct iw_request_info *info, t_u32 *uwrq, - char *extra) + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) { moal_private *priv = (moal_private *)netdev_priv(dev); + t_u32 *uwrq = &wrqu->mode; ENTER(); *uwrq = woal_get_mode(priv, MOAL_IOCTL_WAIT); LEAVE(); @@ -548,7 +555,7 @@ static int woal_get_bss_mode(struct net_device *dev, * @return 0 --success */ static int woal_set_sens(struct net_device *dev, struct iw_request_info *info, - struct iw_param *vwrq, char *extra) + union iwreq_data *wrqu, char *extra) { int ret = 0; @@ -569,7 +576,7 @@ static int woal_set_sens(struct net_device *dev, struct iw_request_info *info, * @return -1 */ static int woal_get_sens(struct net_device *dev, struct iw_request_info *info, - struct iw_param *vwrq, char *extra) + union iwreq_data *wrqu, char *extra) { int ret = -1; @@ -716,7 +723,7 @@ static int woal_set_power(struct net_device *dev, struct iw_request_info *info, static int woal_get_power(struct net_device *dev, struct iw_request_info *info, struct iw_param *vwrq, char *extra) { - int ret = 0, ps_mode; + int ret = 0, ps_mode = 0; moal_private *priv = (moal_private *)netdev_priv(dev); ENTER(); @@ -950,10 +957,11 @@ done: * @return 0 --success, otherwise fail */ static int woal_get_encode(struct net_device *dev, struct iw_request_info *info, - struct iw_point *dwrq, char *extra) + union iwreq_data *wrqu, char *extra) { int ret = 0; moal_private *priv = (moal_private *)netdev_priv(dev); + struct iw_point *dwrq = &wrqu->data; mlan_ds_sec_cfg *sec = NULL; mlan_ioctl_req *req = NULL; t_u32 auth_mode; @@ -1264,10 +1272,11 @@ done: * @return 0 --success, otherwise fail */ static int woal_get_gen_ie(struct net_device *dev, struct iw_request_info *info, - struct iw_point *dwrq, char *extra) + union iwreq_data *wrqu, char *extra) { int ret = 0; moal_private *priv = (moal_private *)netdev_priv(dev); + struct iw_point *dwrq = &wrqu->data; int copy_size = 0, ie_len; t_u8 ie[MAX_IE_SIZE]; @@ -1304,10 +1313,11 @@ done: * @return 0 --success, otherwise fail */ static int woal_set_gen_ie(struct net_device *dev, struct iw_request_info *info, - struct iw_point *dwrq, char *extra) + union iwreq_data *wrqu, char *extra) { int ret = 0; moal_private *priv = (moal_private *)netdev_priv(dev); + struct iw_point *dwrq = &wrqu->data; int ie_len = dwrq->length; const t_u8 wps_oui[] = {0x00, 0x50, 0xf2, 0x04}; mlan_ds_wps_cfg *pwps = NULL; @@ -1364,10 +1374,11 @@ done: */ static int woal_set_encode_ext(struct net_device *dev, struct iw_request_info *info, - struct iw_point *dwrq, char *extra) + union iwreq_data *wrqu, char *extra) { struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; moal_private *priv = (moal_private *)netdev_priv(dev); + struct iw_point *dwrq = &wrqu->data; int key_index; t_u8 *pkey_material = NULL; mlan_ioctl_req *req = NULL; @@ -1497,7 +1508,7 @@ done: */ static int woal_get_encode_ext(struct net_device *dev, struct iw_request_info *info, - struct iw_point *dwrq, char *extra) + union iwreq_data *wrqu, char *extra) { ENTER(); LEAVE(); @@ -1515,7 +1526,7 @@ static int woal_get_encode_ext(struct net_device *dev, * @return 0--success, otherwise fail */ static int woal_set_mlme(struct net_device *dev, struct iw_request_info *info, - struct iw_point *dwrq, char *extra) + union iwreq_data *wrqu, char *extra) { struct iw_mlme *mlme = (struct iw_mlme *)extra; moal_private *priv = (moal_private *)netdev_priv(dev); @@ -1543,10 +1554,11 @@ static int woal_set_mlme(struct net_device *dev, struct iw_request_info *info, * @return 0 --success, otherwise fail */ static int woal_set_auth(struct net_device *dev, struct iw_request_info *info, - struct iw_param *vwrq, char *extra) + union iwreq_data *wrqu, char *extra) { int ret = 0; moal_private *priv = (moal_private *)netdev_priv(dev); + struct iw_param *vwrq = &wrqu->param; t_u32 auth_mode = 0; t_u32 encrypt_mode = 0; ENTER(); @@ -1639,10 +1651,11 @@ static int woal_set_auth(struct net_device *dev, struct iw_request_info *info, * @return 0 --success, otherwise fail */ static int woal_get_auth(struct net_device *dev, struct iw_request_info *info, - struct iw_param *vwrq, char *extra) + union iwreq_data *wrqu, char *extra) { int ret = 0; moal_private *priv = (moal_private *)netdev_priv(dev); + struct iw_param *vwrq = &wrqu->param; t_u32 encrypt_mode = 0; t_u32 auth_mode; t_u32 wpa_enable; @@ -1748,10 +1761,11 @@ static int woal_set_pmksa(struct net_device *dev, struct iw_request_info *info, * @return 0 --success, otherwise fail */ static int woal_get_range(struct net_device *dev, struct iw_request_info *info, - struct iw_point *dwrq, char *extra) + union iwreq_data *wrqu, char *extra) { int i; moal_private *priv = (moal_private *)netdev_priv(dev); + struct iw_point *dwrq = &wrqu->data; struct iw_range *range = (struct iw_range *)extra; moal_802_11_rates rates; mlan_chan_list *pchan_list = NULL; @@ -1957,10 +1971,11 @@ done: * @return 0 --success, otherwise fail */ static int woal_set_priv(struct net_device *dev, struct iw_request_info *info, - struct iw_point *dwrq, char *extra) + union iwreq_data *wrqu, char *extra) { int ret = 0; moal_private *priv = (moal_private *)netdev_priv(dev); + struct iw_point *dwrq = &wrqu->data; char *buf = NULL; int power_mode = 0; int band = 0; @@ -2372,9 +2387,10 @@ done: * @return 0--success, otherwise fail */ static int woal_set_essid(struct net_device *dev, struct iw_request_info *info, - struct iw_point *dwrq, char *extra) + union iwreq_data *wrqu, char *extra) { moal_private *priv = (moal_private *)netdev_priv(dev); + struct iw_point *dwrq = &wrqu->data; mlan_802_11_ssid req_ssid; mlan_ssid_bssid ssid_bssid; #ifdef REASSOCIATION |