From 4310e0ca2faaab2617d70afe5a822735ae46d282 Mon Sep 17 00:00:00 2001 From: Sherry Sun Date: Tue, 19 Jul 2022 12:20:01 +0800 Subject: [PATCH] mxm_wifiex: update to mxm5x17344.p1 release Driver Bug Fixes: ----------------- 1. WCSWREL-352: Fixed WiFi driver kernel panic with "use after free" print 2. WCSWREL-353: Fixed WiFi driver panic when switch AP to another AP 3. WCSWREL-337: merge the L5.18 build errors and warnings fix patches into next wifi release 4. WSW-16518: Fixed STA going to unresponsive state during basic UAPSD operation 5. WSW-19350: Observed "unexpected kernel BRK exception" in STA 2G VHT with BT HID traffic running simultaneously 6. WSW-19640: cannot enable the "20/40 BSS Coexistence Management" support Signed-off-by: Sherry Sun --- mxm_wifiex/wlan_src/Makefile | 1 - mxm_wifiex/wlan_src/README_MLAN | 2 + .../mapp/mlanconfig/config/coex_int_api.conf | 15 +- .../mapp/mlanconfig/config/wifi_mod_para.conf | 6 +- mxm_wifiex/wlan_src/mapp/mlanutl/mlanutl.c | 130 +++++++++ mxm_wifiex/wlan_src/mapp/mlanutl/mlanutl.h | 12 +- mxm_wifiex/wlan_src/mapp/mlanutl/mlanwls.c | 159 +++++++---- mxm_wifiex/wlan_src/mapp/mlanutl/mlanwls.h | 22 +- mxm_wifiex/wlan_src/mlan/mlan_11ax.c | 18 +- mxm_wifiex/wlan_src/mlan/mlan_11d.c | 3 +- mxm_wifiex/wlan_src/mlan/mlan_11h.c | 20 +- mxm_wifiex/wlan_src/mlan/mlan_11n.c | 11 +- mxm_wifiex/wlan_src/mlan/mlan_11n_rxreorder.c | 13 +- mxm_wifiex/wlan_src/mlan/mlan_cmdevt.c | 56 +++- mxm_wifiex/wlan_src/mlan/mlan_decl.h | 30 +- mxm_wifiex/wlan_src/mlan/mlan_fw.h | 46 +++- mxm_wifiex/wlan_src/mlan/mlan_ieee.h | 11 +- mxm_wifiex/wlan_src/mlan/mlan_ioctl.h | 32 ++- mxm_wifiex/wlan_src/mlan/mlan_join.c | 33 +-- mxm_wifiex/wlan_src/mlan/mlan_main.h | 21 +- mxm_wifiex/wlan_src/mlan/mlan_misc.c | 93 +++++-- mxm_wifiex/wlan_src/mlan/mlan_scan.c | 45 ++- mxm_wifiex/wlan_src/mlan/mlan_sdio.c | 2 +- mxm_wifiex/wlan_src/mlan/mlan_shim.c | 2 + mxm_wifiex/wlan_src/mlan/mlan_sta_cmdresp.c | 9 +- mxm_wifiex/wlan_src/mlan/mlan_sta_event.c | 12 +- mxm_wifiex/wlan_src/mlan/mlan_sta_ioctl.c | 7 +- mxm_wifiex/wlan_src/mlan/mlan_sta_rx.c | 6 +- mxm_wifiex/wlan_src/mlan/mlan_uap_cmdevent.c | 125 ++++++++- mxm_wifiex/wlan_src/mlan/mlan_uap_ioctl.c | 82 +++++- mxm_wifiex/wlan_src/mlan/mlan_uap_txrx.c | 2 +- mxm_wifiex/wlan_src/mlan/mlan_wmm.c | 57 +++- mxm_wifiex/wlan_src/mlan/mlan_wmm.h | 3 +- mxm_wifiex/wlan_src/mlinux/mlan_decl.h | 30 +- mxm_wifiex/wlan_src/mlinux/mlan_ieee.h | 11 +- mxm_wifiex/wlan_src/mlinux/mlan_ioctl.h | 32 ++- mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c | 94 ++++--- mxm_wifiex/wlan_src/mlinux/moal_cfg80211.h | 4 +- .../wlan_src/mlinux/moal_cfg80211_util.c | 2 + mxm_wifiex/wlan_src/mlinux/moal_debug.c | 1 + mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c | 260 +++++++++++++++++- mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.h | 9 + mxm_wifiex/wlan_src/mlinux/moal_init.c | 49 ++-- mxm_wifiex/wlan_src/mlinux/moal_ioctl.c | 32 ++- mxm_wifiex/wlan_src/mlinux/moal_main.c | 83 +++--- mxm_wifiex/wlan_src/mlinux/moal_main.h | 31 ++- mxm_wifiex/wlan_src/mlinux/moal_pcie.c | 97 ++++++- mxm_wifiex/wlan_src/mlinux/moal_pcie.h | 2 +- mxm_wifiex/wlan_src/mlinux/moal_proc.c | 16 +- mxm_wifiex/wlan_src/mlinux/moal_sdio.h | 4 +- mxm_wifiex/wlan_src/mlinux/moal_sdio_mmc.c | 15 +- mxm_wifiex/wlan_src/mlinux/moal_shim.c | 115 +++++--- .../wlan_src/mlinux/moal_sta_cfg80211.c | 134 ++++++--- mxm_wifiex/wlan_src/mlinux/moal_uap.c | 8 +- .../wlan_src/mlinux/moal_uap_cfg80211.c | 74 +++-- 55 files changed, 1705 insertions(+), 484 deletions(-) diff --git a/mxm_wifiex/wlan_src/Makefile b/mxm_wifiex/wlan_src/Makefile index b15026c..83c8347 100644 --- a/mxm_wifiex/wlan_src/Makefile +++ b/mxm_wifiex/wlan_src/Makefile @@ -477,7 +477,6 @@ endif - MOALOBJS = mlinux/moal_main.o \ mlinux/moal_ioctl.o \ mlinux/moal_shim.o \ diff --git a/mxm_wifiex/wlan_src/README_MLAN b/mxm_wifiex/wlan_src/README_MLAN index 7c68005..148cead 100644 --- a/mxm_wifiex/wlan_src/README_MLAN +++ b/mxm_wifiex/wlan_src/README_MLAN @@ -434,6 +434,8 @@ SYNOPSIS mlanutl mlanX 11axcmd mlanutl mlanX txratecfg [l] [m] [n] [o] mlanutl uapX txratecfg [l] [m] [n] [o] + mlanutl mlanX txwatchdog [l] + mlanutl uapX txwatchdog [l] mlanutl mlanX hssetpara condition [GPIO# [gap]] [ind_GPIO# [level]] mlanutl mlanX mefcfg mlanutl mlanX cloud_keep_alive diff --git a/mxm_wifiex/wlan_src/mapp/mlanconfig/config/coex_int_api.conf b/mxm_wifiex/wlan_src/mapp/mlanconfig/config/coex_int_api.conf index 86fa067..5d8bfac 100644 --- a/mxm_wifiex/wlan_src/mapp/mlanconfig/config/coex_int_api.conf +++ b/mxm_wifiex/wlan_src/mapp/mlanconfig/config/coex_int_api.conf @@ -106,21 +106,8 @@ get_15_4_stats={ BCAArbitrationTLVType:2=0x024F # do NOT change this line RobustCoexTlvLength:2={ Version:2=0x1 # Firecrest - Action:2=1 # GET 15.4 Statistics + Action:2=2 # GET 15.4 Statistics length:4=52 # Length of collected statistics stats:52=0 # Accumulated Statistics } } - -get_bt_stats={ - CmdCode=0x0277 # do NOT change this line - - # BCA Arbitration TLV - BCAArbitrationTLVType:2=0x024F # do NOT change this line - RobustCoexTlvLength:2={ - Version:2=0x1 # Firecrest - Action:2=2 # GET BT Statistics - length:4=28 # Length of collected statistics - stats:28=0 # Accumulated Statistics - } -} diff --git a/mxm_wifiex/wlan_src/mapp/mlanconfig/config/wifi_mod_para.conf b/mxm_wifiex/wlan_src/mapp/mlanconfig/config/wifi_mod_para.conf index 911404d..5e978b8 100644 --- a/mxm_wifiex/wlan_src/mapp/mlanconfig/config/wifi_mod_para.conf +++ b/mxm_wifiex/wlan_src/mapp/mlanconfig/config/wifi_mod_para.conf @@ -67,7 +67,7 @@ SD8997 = { # drv_mode=7 #} -#SD8978 = { +#SDIW416 = { # cfg80211_wext=0xf # wfd_name=p2p # hw_name=SDIW416 @@ -84,10 +84,10 @@ SD8997 = { # drv_mode=7 #} -#SD9177 = { +#SDIW612 = { # cfg80211_wext=0xf # wfd_name=p2p -# hw_name=SDNW611 +# hw_name=SDIW612 # max_vir_bss=1 # drv_mode=7 #} diff --git a/mxm_wifiex/wlan_src/mapp/mlanutl/mlanutl.c b/mxm_wifiex/wlan_src/mapp/mlanutl/mlanutl.c index 39ac69c..101787f 100644 --- a/mxm_wifiex/wlan_src/mapp/mlanutl/mlanutl.c +++ b/mxm_wifiex/wlan_src/mapp/mlanutl/mlanutl.c @@ -127,6 +127,8 @@ char mod_conv_a_2x2[6][35] = { #endif #endif +#define MAX_CH_LOAD_DURATION 10 + static int process_version(int argc, char *argv[]); static int process_verext(int argc, char *argv[]); static int process_hostcmd(int argc, char *argv[]); @@ -155,6 +157,8 @@ static int process_hssetpara(int argc, char *argv[]); static int process_mefcfg(int argc, char *argv[]); static int process_cloud_keep_alive(int argc, char *argv[]); static int process_min_ba_threshold_cfg(int argc, char *argv[]); +static int process_txwatchdog(int argc, char *argv[]); +static int process_getuuid(int argc, char *argv[]); struct command_node command_list[] = { {"version", process_version}, @@ -186,6 +190,8 @@ struct command_node command_list[] = { {"mefcfg", process_mefcfg}, {"cloud_keep_alive", process_cloud_keep_alive}, {"min_ba_threshold", process_min_ba_threshold_cfg}, + {"txwatchdog", process_txwatchdog}, + {"getuuid", process_getuuid}, }; static char *usage[] = { @@ -5180,6 +5186,130 @@ done: return ret; } +/** + * * @brief Process txwatchdog check command + * * @param argc number of arguments + * * @param argv A pointer to arguments array + * * @return MLAN_STATUS_SUCCESS--success, otherwise--fail + * */ +static int process_txwatchdog(int argc, char *argv[]) +{ + t_u8 *buffer = NULL; + struct eth_priv_cmd *cmd = NULL; + struct ifreq ifr; + + /* Initialize buffer */ + buffer = (t_u8 *)malloc(BUFFER_LENGTH); + if (!buffer) { + printf("ERR:Cannot allocate buffer for command!\n"); + return MLAN_STATUS_FAILURE; + } + + prepare_buffer(buffer, argv[2], (argc - 3), &argv[3]); + + cmd = (struct eth_priv_cmd *)malloc(sizeof(struct eth_priv_cmd)); + if (!cmd) { + printf("ERR:Cannot allocate buffer for command!\n"); + free(buffer); + return MLAN_STATUS_FAILURE; + } + + /* Fill up buffer */ +#ifdef USERSPACE_32BIT_OVER_KERNEL_64BIT + memset(cmd, 0, sizeof(struct eth_priv_cmd)); + memcpy(&cmd->buf, &buffer, sizeof(buffer)); +#else + cmd->buf = buffer; +#endif + cmd->used_len = 0; + cmd->total_len = BUFFER_LENGTH; + + /* Perform IOCTL */ + memset(&ifr, 0, sizeof(struct ifreq)); + strncpy(ifr.ifr_ifrn.ifrn_name, dev_name, strlen(dev_name)); + ifr.ifr_ifru.ifru_data = (void *)cmd; + + if (ioctl(sockfd, MLAN_ETH_PRIV, &ifr)) { + perror("mlanutl"); + fprintf(stderr, "mlanutl: txwatchdog fail\n"); + if (cmd) + free(cmd); + if (buffer) + free(buffer); + return MLAN_STATUS_FAILURE; + } + + /* Process Get result */ + if (argc == 3) { + printf("txwatchdog check: %s\n", + ((*(t_u32 *)buffer == 0) ? "Disabled" : "Enabled")); + } + + if (buffer) + free(buffer); + if (cmd) + free(cmd); + + return MLAN_STATUS_SUCCESS; +} + +static int process_getuuid(int argc, char *argv[]) +{ + t_u8 *buffer = NULL; + struct eth_priv_cmd *cmd = NULL; + struct ifreq ifr; + + /* Initialize buffer */ + buffer = (t_u8 *)malloc(BUFFER_LENGTH); + if (!buffer) { + printf("ERR:Cannot allocate buffer for command!\n"); + return MLAN_STATUS_FAILURE; + } + + prepare_buffer(buffer, argv[2], 0, NULL); + + cmd = (struct eth_priv_cmd *)malloc(sizeof(struct eth_priv_cmd)); + if (!cmd) { + printf("ERR:Cannot allocate buffer for command!\n"); + free(buffer); + return MLAN_STATUS_FAILURE; + } + + /* Fill up buffer */ +#ifdef USERSPACE_32BIT_OVER_KERNEL_64BIT + memset(cmd, 0, sizeof(struct eth_priv_cmd)); + memcpy(&cmd->buf, &buffer, sizeof(buffer)); +#else + cmd->buf = buffer; +#endif + cmd->used_len = 0; + cmd->total_len = BUFFER_LENGTH; + + /* Perform IOCTL */ + memset(&ifr, 0, sizeof(struct ifreq)); + strncpy(ifr.ifr_ifrn.ifrn_name, dev_name, strlen(dev_name)); + ifr.ifr_ifru.ifru_data = (void *)cmd; + + if (ioctl(sockfd, MLAN_ETH_PRIV, &ifr)) { + perror("mlanutl"); + fprintf(stderr, "mlanutl: version fail\n"); + if (cmd) + free(cmd); + if (buffer) + free(buffer); + return MLAN_STATUS_FAILURE; + } + + printf("uuid: %s\n", buffer); + + if (buffer) + free(buffer); + if (cmd) + free(cmd); + + return MLAN_STATUS_SUCCESS; +} + /******************************************************** Global Functions ********************************************************/ diff --git a/mxm_wifiex/wlan_src/mapp/mlanutl/mlanutl.h b/mxm_wifiex/wlan_src/mapp/mlanutl/mlanutl.h index 2378cb0..549b6e4 100644 --- a/mxm_wifiex/wlan_src/mapp/mlanutl/mlanutl.h +++ b/mxm_wifiex/wlan_src/mapp/mlanutl/mlanutl.h @@ -148,13 +148,13 @@ enum _mlan_act_ioctl { #define ETH_ALEN 6 #endif -/** Action field value : get */ +/** Action field value: get */ #define ACTION_GET 0 -/** Action field value : set */ +/** Action field value: set */ #define ACTION_SET 1 -/** Action field value: add */ +/** Action field value: add */ #define ACTION_ADD 2 -/** Action field value: remove */ +/** Action field value: remove */ #define ACTION_REMOVE 3 /** Maximum number of TID */ @@ -570,8 +570,8 @@ typedef struct MrvlIEtypes_Data_t { /** channel band */ enum { BAND_2GHZ = 0, BAND_5GHZ = 1, - BAND_4GHZ = 2, - BAND_6GHZ = 3, + BAND_6GHZ = 2, + BAND_4GHZ = 3, }; /** channel offset */ diff --git a/mxm_wifiex/wlan_src/mapp/mlanutl/mlanwls.c b/mxm_wifiex/wlan_src/mapp/mlanutl/mlanwls.c index 5baad77..2db304c 100644 --- a/mxm_wifiex/wlan_src/mapp/mlanutl/mlanwls.c +++ b/mxm_wifiex/wlan_src/mapp/mlanutl/mlanwls.c @@ -55,7 +55,8 @@ Change log: /*Command arguments index*/ #define NXP_ADDR "530 Holgerway SanJose" -#define PROTO_DOT11AZ 1 +#define PROTO_DOT11AZ_NTB 1 +#define PROTO_DOT11AZ_TB 2 #define PROTO_DOT11MC 0 #define FTM_SUBCMD_INDEX 3 @@ -99,7 +100,7 @@ static int process_subcommand(int argc, char *argv[]); static int process_ftm_session_cfg(int argc, char *argv[], void *param); static int process_ftm_session_ctrl(int argc, char *argv[], void *param); -static int process_dot11az_ntb_cfg(int argc, char *argv[], void *param); +static int process_dot11az_ranging_cfg(int argc, char *argv[], void *param); static int process_dot11mc_ftm_cfg(int argc, char *argv[], void *param); static int process_ftm_start(int argc, char *argv[], void *param); static int process_ftm_stop(int argc, char *argv[], void *param); @@ -131,13 +132,14 @@ static char *mlanwls_help[] = { static char *ftm_session_cfg_help[] = { "Usage: ", - " mlanutl mlan0 ftm session_cfg [] ", + " mlanutl mlan0 ftm session_cfg [ ] ", " where,", - " : 0:Dot11mc, 1:Dot11az_ntb", + " : 0:Dot11mc, 1:Dot11az_ntb, 2:Dot11az_tb", " : Config file with Dot11mc / dot11az parameters", "", " eg: mlanutl mlan0 ftm session_cfg 0 config/ftm.conf - Sets dot11mc FTM session params from config file", - " mlanutl mlan0 ftm session_cfg 1 config/ftm.conf - Sets dot11az ntb session params from donfig file", + " mlanutl mlan0 ftm session_cfg 1 config/ftm.conf - Sets dot11az ntb session params from config file", + " mlanutl mlan0 ftm session_cfg 2 config/ftm.conf - Sets dot11az tb ranging session params from config file", " "}; static char *ftm_session_ctrl_help[] = { @@ -308,32 +310,38 @@ static int process_ftm_hostcmd_resp(char *cmd_name, t_u8 *buf) case HostCmd_CMD_FTM_SESSION_CFG: phostcmd = (hostcmd_ds_ftm_session_cmd *)buf; if ((le16_to_cpu(phostcmd->cmd.ftm_session_cfg.tlv.cfg_11az - .ntb_tlv.type) == - FTM_NTB_RANGING_CFG_TLV_ID)) { + .range_tlv.type) == + FTM_NTB_RANGING_CFG_TLV_ID) || + (le16_to_cpu(phostcmd->cmd.ftm_session_cfg.tlv.cfg_11az + .range_tlv.type) == + FTM_TB_RANGING_CFG_TLV_ID)) { if (le16_to_cpu(phostcmd->cmd.ftm_session_cfg.action) == MLAN_ACT_GET) { /* Get */ - printf("\n\nGet NTB Ranging Parameters: \n"); + printf("\n\nGet Ranging Parameters: \n"); } else { /* Set */ - printf("\n\nSet NTB Ranging Parameters: \n"); + printf("\n\nSet Ranging Parameters: \n"); } printf("---------------------------------\n"); printf("format_bw:%d \n", phostcmd->cmd.ftm_session_cfg.tlv.cfg_11az - .ntb_tlv.val.format_bw); + .range_tlv.val.format_bw); printf("az_measurement_freq:%d \n", phostcmd->cmd.ftm_session_cfg.tlv.cfg_11az - .ntb_tlv.val.az_measurement_freq); + .range_tlv.val.az_measurement_freq); printf("az_number_of_measurements:%d \n", phostcmd->cmd.ftm_session_cfg.tlv.cfg_11az - .ntb_tlv.val.az_number_of_measurements); + .range_tlv.val.az_number_of_measurements); printf("max_i2r_sts_upto80:%d \n", phostcmd->cmd.ftm_session_cfg.tlv.cfg_11az - .ntb_tlv.val.max_i2r_sts_upto80); - printf("max_r2i_sts_upto80:%d \n\n", + .range_tlv.val.max_i2r_sts_upto80); + printf("max_r2i_sts_upto80:%d \n", phostcmd->cmd.ftm_session_cfg.tlv.cfg_11az - .ntb_tlv.val.max_r2i_sts_upto80); + .range_tlv.val.max_r2i_sts_upto80); + printf("i2r_lmr_feedback:%d \n\n", + phostcmd->cmd.ftm_session_cfg.tlv.cfg_11az + .range_tlv.val.i2r_lmr_feedback); } else if ((le16_to_cpu(phostcmd->cmd.ftm_session_cfg.tlv .cfg_11mc.sess_tlv.type) == FTM_SESSION_CFG_INITATOR_TLV_ID)) { @@ -819,7 +827,7 @@ done: * @return MLAN_STATUS_SUCCESS--success, otherwise--fail */ -static int process_dot11az_ntb_cfg(int argc, char *argv[], void *param) +static int process_dot11az_ranging_cfg(int argc, char *argv[], void *param) { int ret = MLAN_STATUS_SUCCESS; t_u8 *buffer = NULL; @@ -850,26 +858,35 @@ static int process_dot11az_ntb_cfg(int argc, char *argv[], void *param) phostcmd->cmd_hdr.size = cpu_to_le16(phostcmd->cmd_hdr.size); phostcmd->cmd.ftm_session_cfg.action = cpu_to_le16(app_data->hostcmd_action); - phostcmd->cmd.ftm_session_cfg.tlv.cfg_11az.ntb_tlv.type = - cpu_to_le16(FTM_NTB_RANGING_CFG_TLV_ID); - phostcmd->cmd.ftm_session_cfg.tlv.cfg_11az.ntb_tlv.len = - cpu_to_le16(sizeof(ntb_ranging_cfg_t)); + phostcmd->cmd.ftm_session_cfg.tlv.cfg_11az.range_tlv.len = + cpu_to_le16(sizeof(ranging_cfg_t)); + + if (app_data->protocol_type == PROTO_DOT11AZ_TB) { + phostcmd->cmd.ftm_session_cfg.tlv.cfg_11az.range_tlv.type = + cpu_to_le16(FTM_TB_RANGING_CFG_TLV_ID); + } else { + phostcmd->cmd.ftm_session_cfg.tlv.cfg_11az.range_tlv.type = + cpu_to_le16(FTM_NTB_RANGING_CFG_TLV_ID); + } if (app_data->hostcmd_action == MLAN_ACT_SET) { - phostcmd->cmd.ftm_session_cfg.tlv.cfg_11az.ntb_tlv.val - .format_bw = app_data->ntb_cfg.format_bw; - phostcmd->cmd.ftm_session_cfg.tlv.cfg_11az.ntb_tlv.val + phostcmd->cmd.ftm_session_cfg.tlv.cfg_11az.range_tlv.val + .format_bw = app_data->range_cfg.format_bw; + phostcmd->cmd.ftm_session_cfg.tlv.cfg_11az.range_tlv.val .max_i2r_sts_upto80 = - app_data->ntb_cfg.max_i2r_sts_upto80; - phostcmd->cmd.ftm_session_cfg.tlv.cfg_11az.ntb_tlv.val + app_data->range_cfg.max_i2r_sts_upto80; + phostcmd->cmd.ftm_session_cfg.tlv.cfg_11az.range_tlv.val .max_r2i_sts_upto80 = - app_data->ntb_cfg.max_r2i_sts_upto80; - phostcmd->cmd.ftm_session_cfg.tlv.cfg_11az.ntb_tlv.val + app_data->range_cfg.max_r2i_sts_upto80; + phostcmd->cmd.ftm_session_cfg.tlv.cfg_11az.range_tlv.val .az_measurement_freq = - app_data->ntb_cfg.az_measurement_freq; - phostcmd->cmd.ftm_session_cfg.tlv.cfg_11az.ntb_tlv.val + app_data->range_cfg.az_measurement_freq; + phostcmd->cmd.ftm_session_cfg.tlv.cfg_11az.range_tlv.val .az_number_of_measurements = - app_data->ntb_cfg.az_number_of_measurements; + app_data->range_cfg.az_number_of_measurements; + phostcmd->cmd.ftm_session_cfg.tlv.cfg_11az.range_tlv.val + .i2r_lmr_feedback = + app_data->range_cfg.i2r_lmr_feedback; } /*Perform ioctl and process response*/ ret = mlanwls_send_ioctl(buffer); @@ -914,8 +931,7 @@ static int process_dot11mc_ftm_cfg(int argc, char *argv[], void *param) /*Parse the arguments*/ phostcmd->cmd_hdr.command = cpu_to_le16(HostCmd_CMD_FTM_SESSION_CFG); - phostcmd->cmd_hdr.size = - S_DS_GEN + sizeof(t_u16) + sizeof(dot11mc_ftm_cfg_t); + phostcmd->cmd_hdr.size = S_DS_GEN + sizeof(t_u16); phostcmd->cmd.ftm_session_cfg.action = cpu_to_le16(app_data->hostcmd_action); @@ -944,6 +960,7 @@ static int process_dot11mc_ftm_cfg(int argc, char *argv[], void *param) app_data->civic_request; phostcmd->cmd.ftm_session_cfg.tlv.cfg_11mc.sess_tlv.lci_req = app_data->lci_request; + phostcmd->cmd_hdr.size += sizeof(ftm_session_cfg_tlv_t); if (app_data->lci_request) { phostcmd->cmd.ftm_session_cfg.tlv.cfg_11mc.lci_tlv.type = @@ -962,6 +979,7 @@ static int process_dot11mc_ftm_cfg(int argc, char *argv[], void *param) .longitude = app_data->lci_cfg.longitude; phostcmd->cmd.ftm_session_cfg.tlv.cfg_11mc.lci_tlv.val .long_unc = app_data->lci_cfg.long_unc; + phostcmd->cmd_hdr.size += sizeof(lci_tlv_t); } if (app_data->civic_request) { @@ -970,8 +988,9 @@ static int process_dot11mc_ftm_cfg(int argc, char *argv[], void *param) FTM_SESSION_CFG_LOCATION_CIVIC_TLV_ID); phostcmd->cmd.ftm_session_cfg.tlv.cfg_11mc.civic_tlv .len = cpu_to_le16( - sizeof(civic_loc_cfg_t) + - app_data->civic_cfg.civic_address_length - 1); + (sizeof(civic_loc_cfg_t) - + sizeof(app_data->civic_cfg.civic_address)) + + app_data->civic_cfg.civic_address_length); phostcmd->cmd.ftm_session_cfg.tlv.cfg_11mc.civic_tlv.val .civic_address_type = app_data->civic_cfg.civic_address_type; @@ -989,6 +1008,8 @@ static int process_dot11mc_ftm_cfg(int argc, char *argv[], void *param) &app_data->civic_cfg.civic_address[0], app_data->civic_cfg.civic_address_length); phostcmd->cmd_hdr.size += + sizeof(civic_loc_tlv_t) - + sizeof(app_data->civic_cfg.civic_address) + app_data->civic_cfg .civic_address_length; /*copy the variable len @@ -1304,9 +1325,10 @@ static int process_ftm_session_cfg(int argc, char *argv[], void *param) } app_data = (wls_app_data_t *)param; - if (app_data->protocol_type == PROTO_DOT11AZ) { - printf("[INFO] Set/Get DOT11AZ Config \n"); - ret = process_dot11az_ntb_cfg(argc, argv, param); + if ((app_data->protocol_type == PROTO_DOT11AZ_NTB) || + (app_data->protocol_type == PROTO_DOT11AZ_TB)) { + printf("[INFO] Set/Get DOT11AZ Ranging Config \n"); + ret = process_dot11az_ranging_cfg(argc, argv, param); } else { printf("[INFO] Set/Get DOT11MC (Legacy) Config \n"); ret = process_dot11mc_ftm_cfg(argc, argv, param); @@ -1349,7 +1371,8 @@ done: static int process_subcommand(int argc, char *argv[]) { - int i, ret; + int i = 0; + int ret = MLAN_STATUS_SUCCESS; /*Parse the user command to update the priv data and call subcommand * handlers*/ @@ -1461,7 +1484,7 @@ static int mlanwls_read_ftm_config(char *file_name) char *data = NULL; int arg_num, li; char *args[30]; - t_u8 param; + t_u8 param = 0; // read config config_file = fopen(file_name, "r"); @@ -1582,43 +1605,62 @@ static int mlanwls_read_ftm_config(char *file_name) PRINT_CFG("\t CIVIC_ADDRESS_TYPE=%d\n", param); } else if (strcmp(args[0], "ADDRESS") == 0) { - memcpy(&(gwls_data.civic_cfg.civic_address[0]), - &args[1], strlen(args[1])); - gwls_data.civic_cfg.civic_address_length = - strlen(args[1]); - PRINT_CFG("\t ADDRESS=%s\n", args[1]); + if (strlen(args[1]) <= 255) { + gwls_data.civic_cfg + .civic_address_length = + strlen(args[1]); + strncpy((char *)&gwls_data.civic_cfg + .civic_address[0], + args[1], + gwls_data.civic_cfg + .civic_address_length); + PRINT_CFG("\t ADDRESS=%s\n", args[1]); + } else { + DBG_ERROR( + "\t [ERROR] Invalid Civic Address Len\n"); + } } else { // printf("Invalid line entry\n %s",args[1]); } } - if (gwls_data.protocol_type == PROTO_DOT11AZ) { - if (strcmp(args[0], "DOT11AZ_CFG") == 0) { - printf("DOT11AZ_CFG\n\n"); + if ((gwls_data.protocol_type == PROTO_DOT11AZ_NTB) || + (gwls_data.protocol_type == PROTO_DOT11AZ_TB)) { + if (strcmp(args[0], "DOT11AZ_RANGING_CFG") == 0) { + if (gwls_data.protocol_type == + PROTO_DOT11AZ_NTB) { + printf("DOT11AZ_NTB_RANGING_CFG\n\n"); + } else { + printf("DOT11AZ_TB_RANGING_CFG\n\n"); + } } else if (strcmp(args[0], "FORMAT_BW") == 0) { - gwls_data.ntb_cfg.format_bw = + gwls_data.range_cfg.format_bw = (t_u8)(atoi(args[1])); PRINT_CFG("\t FORMAT_BW=%d\n", param); } else if (strcmp(args[0], "MAX_I2R_STS_UPTO80") == 0) { - gwls_data.ntb_cfg.max_i2r_sts_upto80 = + gwls_data.range_cfg.max_i2r_sts_upto80 = (t_u8)(atoi(args[1])); PRINT_CFG("\t MAX_I2R_STS_UPTO80=%d\n", param); } else if (strcmp(args[0], "MAX_R2I_STS_UPTO80") == 0) { - gwls_data.ntb_cfg.max_r2i_sts_upto80 = + gwls_data.range_cfg.max_r2i_sts_upto80 = (t_u8)(atoi(args[1])); PRINT_CFG("\t MAX_R2I_STS_UPTO80=%d\n", param); } else if (strcmp(args[0], "AZ_MEASUREMENT_FREQ") == 0) { - gwls_data.ntb_cfg.az_measurement_freq = + gwls_data.range_cfg.az_measurement_freq = (t_u8)(atoi(args[1])); PRINT_CFG("\t AZ_MEASUREMENT_FREQ=%d\n", param); } else if (strcmp(args[0], "AZ_NUMBER_OF_MEASUREMENTS") == 0) { - gwls_data.ntb_cfg.az_number_of_measurements = + gwls_data.range_cfg.az_number_of_measurements = (t_u8)(atoi(args[1])); PRINT_CFG("\t AZ_NUMBER_OF_MEASUREMENTS=%d\n", param); + } else if (strcmp(args[0], "I2R_LMR_FEEDBACK") == 0) { + gwls_data.range_cfg.i2r_lmr_feedback = + (t_u8)(atoi(args[1])); + PRINT_CFG("\t I2R_LMR_FEEDBACK=%d\n\n", param); } else { // printf("Invalid line entry%s\n",args[1]); } @@ -1654,12 +1696,13 @@ static int mlanwls_init(void) gwls_data.terminate_app = 0; gwls_data.protocol_type = 0; - /*DOT11AZ NTB Ranging default config*/ - gwls_data.ntb_cfg.az_measurement_freq = 1; - gwls_data.ntb_cfg.az_number_of_measurements = 6; - gwls_data.ntb_cfg.format_bw = 2; - gwls_data.ntb_cfg.max_i2r_sts_upto80 = 0; - gwls_data.ntb_cfg.max_r2i_sts_upto80 = 1; + /*DOT11AZ NTB/TB Ranging default config*/ + gwls_data.range_cfg.az_measurement_freq = 1; + gwls_data.range_cfg.az_number_of_measurements = 6; + gwls_data.range_cfg.format_bw = 2; + gwls_data.range_cfg.max_i2r_sts_upto80 = 0; + gwls_data.range_cfg.max_r2i_sts_upto80 = 1; + gwls_data.range_cfg.i2r_lmr_feedback = 0; /*DOT11MC FTM session default config*/ gwls_data.session_cfg.burst_exponent = 0; diff --git a/mxm_wifiex/wlan_src/mapp/mlanutl/mlanwls.h b/mxm_wifiex/wlan_src/mapp/mlanutl/mlanwls.h index 0731e8e..e8135ae 100644 --- a/mxm_wifiex/wlan_src/mapp/mlanutl/mlanwls.h +++ b/mxm_wifiex/wlan_src/mapp/mlanutl/mlanwls.h @@ -76,6 +76,7 @@ Change log: #define PROPRIETARY_TLV_BASE_ID 0x0100 #define FTM_SESSION_CFG_INITATOR_TLV_ID (PROPRIETARY_TLV_BASE_ID + 273) #define FTM_NTB_RANGING_CFG_TLV_ID (PROPRIETARY_TLV_BASE_ID + 343) +#define FTM_TB_RANGING_CFG_TLV_ID (PROPRIETARY_TLV_BASE_ID + 344) #define FTM_RANGE_REPORT_TLV_ID \ (PROPRIETARY_TLV_BASE_ID + 0x10C) /* 0x0100 + 0x10C = 0x20C */ #define FTM_SESSION_CFG_LCI_TLV_ID (PROPRIETARY_TLV_BASE_ID + 270) @@ -93,8 +94,9 @@ typedef struct { char **help; } wls_app_command_table; -/** Structure of FTM_SESSION_CFG_NTB_RANGING TLV data*/ -typedef struct _ntb_ranging_cfg { +/** Structure of FTM_SESSION_CFG_NTB_RANGING / FTM_SESSION_CFG_TB_RANGING TLV + * data*/ +typedef struct _ranging_cfg { /** Indicates the channel BW for session*/ /*0: HE20, 1: HE40, 2: HE80, 3: HE80+80, 4: HE160, 5:HE160_SRF*/ t_u8 format_bw; @@ -110,12 +112,14 @@ typedef struct _ntb_ranging_cfg { t_u8 az_measurement_freq; /**Indicates the number of measurements to be done for session*/ t_u8 az_number_of_measurements; + /** Initator lmr feedback */ + t_u8 i2r_lmr_feedback; /**Include location civic request (Expect location civic from * responder)*/ t_u8 civic_req; /**Include LCI request (Expect LCI info from responder)*/ t_u8 lci_req; -} __ATTRIB_PACK__ ntb_ranging_cfg_t; +} __ATTRIB_PACK__ ranging_cfg_t; /** Structure of FTM_SESSION_CFG TLV data*/ typedef struct _ftm_session_cfg { @@ -147,7 +151,7 @@ typedef struct _civic_loc_cfg { /**Civic address length*/ t_u8 civic_address_length; /**Civic Address*/ - t_u8 civic_address[]; + t_u8 civic_address[256]; } __ATTRIB_PACK__ civic_loc_cfg_t; /** Structure for FTM_SESSION_CFG_LCI TLV data*/ @@ -169,14 +173,14 @@ typedef struct _lci_cfg { } __ATTRIB_PACK__ lci_cfg_t; /** Structure for FTM_SESSION_CFG_NTB_RANGING TLV*/ -typedef struct _ntb_ranging_cfg_tlv { +typedef struct _ranging_cfg_tlv { /** Type*/ t_u16 type; /** Length*/ t_u16 len; /** Value*/ - ntb_ranging_cfg_t val; -} __ATTRIB_PACK__ ntb_ranging_cfg_tlv_t; + ranging_cfg_t val; +} __ATTRIB_PACK__ ranging_cfg_tlv_t; /** Structure for FTM_SESSION_CFG TLV*/ typedef struct _ftm_session_cfg_tlv { @@ -224,7 +228,7 @@ typedef struct _dot11mc_ftm_cfg { /** Structure for DOT11AZ FTM_SESSION_CFG */ typedef struct _dot11az_ftmcfg_ntb_t { /** NTB session cfg */ - ntb_ranging_cfg_tlv_t ntb_tlv; + ranging_cfg_tlv_t range_tlv; } __ATTRIB_PACK__ dot11az_ftm_cfg_t; /** Type definition for hostcmd_ftm_session_cfg */ @@ -367,7 +371,7 @@ typedef struct _wls_app_data { /** Is civic data available in cfg*/ t_u8 civic_request; /**ntb cfg param*/ - ntb_ranging_cfg_t ntb_cfg; + ranging_cfg_t range_cfg; /** 11mc session cfg param*/ ftm_session_cfg_t session_cfg; /** lci cfg data*/ diff --git a/mxm_wifiex/wlan_src/mlan/mlan_11ax.c b/mxm_wifiex/wlan_src/mlan/mlan_11ax.c index 38dc973..3876a31 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_11ax.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_11ax.c @@ -110,12 +110,14 @@ t_u8 wlan_check_11ax_twt_supported(mlan_private *pmpriv, (MrvlIEtypes_He_cap_t *)&pmpriv->user_he_cap; MrvlIEtypes_He_cap_t *hw_he_cap = (MrvlIEtypes_He_cap_t *)&pmpriv->adapter->hw_he_cap; + t_u16 band_selected = BAND_A; + 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) { - if (pbss_desc->bss_band & BAND_A) { + if (pbss_desc->bss_band & band_selected) { hw_he_cap = (MrvlIEtypes_He_cap_t *)&pmpriv->adapter ->hw_he_cap; phecap = (MrvlIEtypes_He_cap_t *)&pmpriv->user_he_cap; @@ -417,6 +419,7 @@ int wlan_cmd_append_11ax_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc, t_u16 cfg_value = 0; t_u16 hw_value = 0; MrvlIEtypes_He_cap_t *phw_hecap = MNULL; + t_u16 band_selected = BAND_A; ENTER(); @@ -436,7 +439,7 @@ int wlan_cmd_append_11ax_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc, } bw_80p80 = wlan_is_80_80_support(pmpriv, pbss_desc); phecap = (MrvlIEtypes_He_cap_t *)*ppbuffer; - if (pbss_desc->bss_band & BAND_A) { + if (pbss_desc->bss_band & band_selected) { memcpy_ext(pmadapter, *ppbuffer, pmpriv->user_he_cap, pmpriv->user_hecap_len, pmpriv->user_hecap_len); *ppbuffer += pmpriv->user_hecap_len; @@ -458,7 +461,7 @@ int wlan_cmd_append_11ax_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc, if (IS_CARD9098(pmpriv->adapter->card_type) || IS_CARDNW62X(pmpriv->adapter->card_type) || IS_CARD9097(pmpriv->adapter->card_type)) { - if (pbss_desc->bss_band & BAND_A) { + if (pbss_desc->bss_band & band_selected) { rx_nss = GET_RXMCSSUPP(pmpriv->adapter->user_htstream >> 8); tx_nss = GET_TXMCSSUPP(pmpriv->adapter->user_htstream >> @@ -643,15 +646,6 @@ static mlan_status wlan_11ax_ioctl_hecfg(pmlan_adapter pmadapter, ENTER(); - if (pioctl_req->buf_len < sizeof(mlan_ds_11ax_cfg)) { - PRINTM(MINFO, "MLAN bss IOCTL length is too short.\n"); - pioctl_req->data_read_written = 0; - pioctl_req->buf_len_needed = sizeof(mlan_ds_11ax_cfg); - pioctl_req->status_code = MLAN_ERROR_INVALID_PARAMETER; - LEAVE(); - return MLAN_STATUS_RESOURCE; - } - cfg = (mlan_ds_11ax_cfg *)pioctl_req->pbuf; if ((cfg->param.he_cfg.band & MBIT(0)) && diff --git a/mxm_wifiex/wlan_src/mlan/mlan_11d.c b/mxm_wifiex/wlan_src/mlan/mlan_11d.c index 1dc5636..818d457 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_11d.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_11d.c @@ -418,8 +418,7 @@ static mlan_status wlan_11d_update_chan_pwr_table(mlan_private *pmpriv, /* Channel not found. Update the channel in the channel-power table */ parsed_region_chan->chan_pwr[i].chan = chan; - parsed_region_chan->chan_pwr[i].band = - (t_u8)pbss_desc->bss_band; + parsed_region_chan->chan_pwr[i].band = pbss_desc->bss_band; parsed_region_chan->chan_pwr[i].pwr = tx_power; parsed_region_chan->chan_pwr[i].ap_seen = MTRUE; parsed_region_chan->no_of_chan++; diff --git a/mxm_wifiex/wlan_src/mlan/mlan_11h.c b/mxm_wifiex/wlan_src/mlan/mlan_11h.c index 304df15..594a253 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_11h.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_11h.c @@ -686,11 +686,11 @@ static mlan_status wlan_11h_cmd_chan_rpt_req(mlan_private *priv, ptlv_zero_dfs->Header.len = wlan_cpu_to_le16(sizeof(t_u8)); if (!is_cancel_req) { ptlv_zero_dfs->zero_dfs_enbl = MTRUE; - PRINTM(MCMND, "ZeroDFS: START: chan=%d\n", + PRINTM(MCMND, "DFS: START: chan=%d\n", pchan_rpt_req->chan_desc.chanNum); } else { ptlv_zero_dfs->zero_dfs_enbl = MFALSE; - PRINTM(MCMND, "ZeroDFS: STOP\n"); + PRINTM(MCMND, "DFS: STOP\n"); } pcmd_ptr->size += sizeof(MrvlIEtypes_ZeroDfsOperation_t); pcmd_ptr->size = wlan_cpu_to_le16(pcmd_ptr->size); @@ -2426,7 +2426,11 @@ t_s32 wlan_11h_process_start(mlan_private *priv, t_u8 **ppbuffer, ((adapter->adhoc_start_band & BAND_A))) { if (!wlan_fw_11d_is_enabled(priv)) { /* No use having 11h enabled without 11d enabled */ - wlan_11d_enable(priv, MNULL, ENABLE_11D); + if (wlan_11d_enable(priv, MNULL, ENABLE_11D)) { + ret = MLAN_STATUS_FAILURE; + LEAVE(); + return ret; + } #ifdef STA_SUPPORT wlan_11d_create_dnld_countryinfo( priv, adapter->adhoc_start_band); @@ -2530,7 +2534,11 @@ t_s32 wlan_11h_process_join(mlan_private *priv, t_u8 **ppbuffer, if (p11h_bss_info->sensed_11h) { if (!wlan_fw_11d_is_enabled(priv)) { /* No use having 11h enabled without 11d enabled */ - wlan_11d_enable(priv, MNULL, ENABLE_11D); + if (wlan_11d_enable(priv, MNULL, ENABLE_11D)) { + ret = MLAN_STATUS_FAILURE; + LEAVE(); + return ret; + } #ifdef STA_SUPPORT wlan_11d_parse_dnld_countryinfo( priv, priv->pattempted_bss_desc); @@ -3326,7 +3334,7 @@ mlan_status wlan_11h_print_event_radar_detected(mlan_private *priv, wlan_11h_add_dfs_timestamp(priv->adapter, DFS_TS_REPR_NOP_START, *radar_chan); wlan_set_chan_dfs_state(priv, BAND_A, *radar_chan, DFS_UNAVAILABLE); - PRINTM(MEVENT, "ZeroDFS: Radar detected on %d\n", *radar_chan); + PRINTM(MEVENT, "DFS: Radar detected on %d\n", *radar_chan); LEAVE(); return MLAN_STATUS_SUCCESS; } @@ -3484,6 +3492,7 @@ void wlan_11h_update_bandcfg(mlan_private *pmpriv, Band_Config_t *uap_band_cfg, LEAVE(); } +#ifdef UAP_SUPPORT /** * @brief Get priv current index -- this is used to enter correct rdh_state * during radar handling @@ -3512,6 +3521,7 @@ wlan_11h_get_priv_curr_idx(mlan_private *pmpriv, } return (found == MTRUE) ? MLAN_STATUS_SUCCESS : MLAN_STATUS_FAILURE; } +#endif /** * @brief Driver handling for remove customeie diff --git a/mxm_wifiex/wlan_src/mlan/mlan_11n.c b/mxm_wifiex/wlan_src/mlan/mlan_11n.c index a5e1caa..cfb5cb8 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_11n.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_11n.c @@ -1059,7 +1059,7 @@ static void wlan_update_all_stations_ampdu(mlan_private *priv) } while (sta_ptr != (sta_node *)&priv->sta_list) { for (i = 0; i < MAX_NUM_TID; i++) { - if (sta_ptr->is_11n_enabled) + if (sta_ptr->is_11n_enabled || sta_ptr->is_11ax_enabled) sta_ptr->ampdu_sta[i] = priv->aggr_prio_tbl[i].ampdu_user; } @@ -1242,7 +1242,8 @@ static mlan_status wlan_11n_ioctl_supported_mcs_set(pmlan_adapter pmadapter, if ((ISSUPP_CHANWIDTH40(pmpriv->usr_dot_11n_dev_cap_bg) || ISSUPP_CHANWIDTH40(pmpriv->usr_dot_11n_dev_cap_a)) && !(pmpriv->curr_chan_flags & CHAN_FLAGS_NO_HT40PLUS && - pmpriv->curr_chan_flags & CHAN_FLAGS_NO_HT40MINUS)) + pmpriv->curr_chan_flags & CHAN_FLAGS_NO_HT40MINUS) && + pmadapter->init_para.mcs32 == 1) SETHT_MCS32(mcs_set); cfg = (mlan_ds_11n_cfg *)pioctl_req->pbuf; @@ -1550,7 +1551,8 @@ void wlan_fill_ht_cap_tlv(mlan_private *priv, MrvlIETypes_HTCap_t *pht_cap, * supprot*/ if (ISSUPP_CHANWIDTH40(usr_dot_11n_dev_cap) && !(priv->curr_chan_flags & CHAN_FLAGS_NO_HT40PLUS && - priv->curr_chan_flags & CHAN_FLAGS_NO_HT40MINUS)) + priv->curr_chan_flags & CHAN_FLAGS_NO_HT40MINUS) && + pmadapter->init_para.mcs32 == 1) SETHT_MCS32(pht_cap->ht_cap.supported_mcs_set); /* Clear RD responder bit */ @@ -1626,7 +1628,8 @@ void wlan_fill_ht_cap_ie(mlan_private *priv, IEEEtypes_HTCap_t *pht_cap, * supprot*/ if (ISSUPP_CHANWIDTH40(usr_dot_11n_dev_cap) && !(priv->curr_chan_flags & CHAN_FLAGS_NO_HT40PLUS && - priv->curr_chan_flags & CHAN_FLAGS_NO_HT40MINUS)) + priv->curr_chan_flags & CHAN_FLAGS_NO_HT40MINUS) && + pmadapter->init_para.mcs32 == 1) SETHT_MCS32(pht_cap->ht_cap.supported_mcs_set); /* Clear RD responder bit */ diff --git a/mxm_wifiex/wlan_src/mlan/mlan_11n_rxreorder.c b/mxm_wifiex/wlan_src/mlan/mlan_11n_rxreorder.c index 7a37f0c..0cf15d3 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_11n_rxreorder.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_11n_rxreorder.c @@ -623,6 +623,10 @@ mlan_status wlan_cmd_11n_addba_req(mlan_private *priv, HostCmd_DS_COMMAND *cmd, */ static t_u8 wlan_is_addba_reject(mlan_private *priv, t_u8 tid) { + if (tid >= MAX_NUM_TID) { + PRINTM(MERROR, "Wrong TID =%d", tid); + return ADDBA_RSP_STATUS_REJECT; + } #ifdef STA_SUPPORT #endif return priv->addba_reject[tid]; @@ -1421,6 +1425,7 @@ void wlan_flush_rxreorder_tbl(pmlan_adapter pmadapter) static void wlan_update_ampdu_rxwinsize(pmlan_adapter pmadapter, t_u8 coex_flag) { t_u8 i; + t_u8 j; t_u32 rx_win_size = 0; pmlan_private priv = MNULL; @@ -1450,7 +1455,9 @@ static void wlan_update_ampdu_rxwinsize(pmlan_adapter pmadapter, t_u8 coex_flag) priv->add_ba_param.rx_win_size = MLAN_UAP_COEX_AMPDU_DEF_RXWINSIZE; #endif - + priv->add_ba_param.rx_win_size = + MIN(priv->add_ba_param.rx_win_size, + priv->user_rxwinsize); } else { priv->add_ba_param.rx_win_size = priv->user_rxwinsize; @@ -1461,8 +1468,8 @@ static void wlan_update_ampdu_rxwinsize(pmlan_adapter pmadapter, t_u8 coex_flag) pmadapter->coex_rx_win_size; if (rx_win_size != priv->add_ba_param.rx_win_size) { if (priv->media_connected == MTRUE) { - for (i = 0; i < MAX_NUM_TID; i++) - wlan_11n_delba(priv, i); + for (j = 0; j < MAX_NUM_TID; j++) + wlan_11n_delba(priv, j); wlan_recv_event( priv, MLAN_EVENT_ID_DRV_DEFER_HANDLING, diff --git a/mxm_wifiex/wlan_src/mlan/mlan_cmdevt.c b/mxm_wifiex/wlan_src/mlan/mlan_cmdevt.c index 9528d4c..a3130ae 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_cmdevt.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_cmdevt.c @@ -66,6 +66,20 @@ Change Log: Local Functions ********************************************************/ #ifdef STA_SUPPORT +/** + * @brief This function check if the command was cancel scan command + * + * @param pcmd A pointer to HostCmd_DS_COMMAND structure + * @return N/A + */ +static t_u8 wlan_is_cancel_scan_cmd(HostCmd_DS_COMMAND *pcmd) +{ + HostCmd_DS_802_11_SCAN_EXT *pext_scan_cmd = &pcmd->params.ext_scan; + if (pext_scan_cmd->ext_scan_type == EXT_SCAN_CANCEL) + return MTRUE; + else + return MFALSE; +} /** * @brief This function inserts scan command node to scan_pending_q. * @@ -495,6 +509,7 @@ static t_void wlan_dump_info(mlan_adapter *pmadapter, t_u8 reason) pmadapter->pps_uapsd_mode, pmadapter->sleep_period.period); PRINTM(MERROR, "tx_lock_flag = %d\n", pmadapter->tx_lock_flag); PRINTM(MERROR, "scan_processing = %d\n", pmadapter->scan_processing); + PRINTM(MERROR, "scan_state = 0x%x\n", pmadapter->scan_state); PRINTM(MERROR, "bypass_pkt_count=%d\n", pmadapter->bypass_pkt_count); #ifdef SDIO if (IS_SD(pmadapter->card_type)) { @@ -1123,9 +1138,9 @@ static mlan_status wlan_cmd_host_cmd(pmlan_private pmpriv, * * @return timeout value for this command */ -static t_u16 wlan_get_cmd_timeout(t_u16 cmd_id) +static t_u32 wlan_get_cmd_timeout(t_u16 cmd_id) { - t_u16 timeout; + t_u32 timeout; ENTER(); switch (cmd_id) { case HostCmd_CMD_802_11_SCAN: @@ -1206,7 +1221,7 @@ static mlan_status wlan_dnld_cmd_to_fw(mlan_private *pmpriv, #ifdef DEBUG_LEVEL1 t_u32 sec = 0, usec = 0; #endif - t_u16 timeout = 0; + t_u32 timeout = 0; ENTER(); @@ -1293,6 +1308,9 @@ static mlan_status wlan_dnld_cmd_to_fw(mlan_private *pmpriv, } #endif + if (pcmd->command == HostCmd_CMD_802_11_SCAN_EXT) + pmadapter->scan_state |= wlan_get_ext_scan_state(pcmd); + PRINTM_GET_SYS_TIME(MCMND, &sec, &usec); PRINTM_NETINTF(MCMND, pmpriv); PRINTM(MCMND, @@ -1928,7 +1946,15 @@ mlan_status wlan_prepare_cmd(mlan_private *pmpriv, t_u16 cmd_no, #ifdef STA_SUPPORT if (cmd_no == HostCmd_CMD_802_11_SCAN || cmd_no == HostCmd_CMD_802_11_SCAN_EXT) { - wlan_queue_scan_cmd(pmpriv, pcmd_node); + if (cmd_no == HostCmd_CMD_802_11_SCAN_EXT && + pmadapter->ext_scan && pmadapter->ext_scan_enh && + pmadapter->ext_scan_type == EXT_SCAN_ENHANCE && + wlan_is_cancel_scan_cmd(cmd_ptr)) { + wlan_insert_cmd_to_pending_q(pmadapter, pcmd_node, + MFALSE); + } else + + wlan_queue_scan_cmd(pmpriv, pcmd_node); } else { #endif if ((cmd_no == HostCmd_CMD_802_11_HS_CFG_ENH) && @@ -5062,6 +5088,8 @@ mlan_status wlan_ret_get_hw_spec(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp, MrvlIEtypes_Extension_t *ext_tlv = MNULL; MrvlIEtypes_fw_cap_info_t *fw_cap_tlv = MNULL; + MrvlIEtypes_Secure_Boot_Uuid_t *sb_uuid_tlv = MNULL; + ENTER(); pmadapter->fw_cap_info = wlan_le32_to_cpu(hw_spec->fw_cap_info); @@ -5358,6 +5386,13 @@ mlan_status wlan_ret_get_hw_spec(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp, PRINTM(MCMND, "fw_cap_info=0x%x fw_cap_ext=0x%x\n", pmadapter->fw_cap_info, pmadapter->fw_cap_ext); break; + case TLV_TYPE_SECURE_BOOT_UUID: + sb_uuid_tlv = (MrvlIEtypes_Secure_Boot_Uuid_t *)tlv; + pmadapter->uuid_lo = sb_uuid_tlv->uuid_lo; + pmadapter->uuid_hi = sb_uuid_tlv->uuid_hi; + PRINTM(MMSG, "uuid: %llx%llx\n", pmadapter->uuid_lo, + pmadapter->uuid_hi); + break; default: break; } @@ -9146,6 +9181,7 @@ mlan_status wlan_ret_mc_aggr_cfg(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp, LEAVE(); return MLAN_STATUS_SUCCESS; } + /** * @brief This function prepares command of ch_load * @@ -9168,9 +9204,12 @@ mlan_status wlan_cmd_get_ch_load(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd, cmd->size = wlan_cpu_to_le16(sizeof(HostCmd_DS_GET_CH_LOAD) + S_DS_GEN); cfg_cmd->action = wlan_cpu_to_le16(cmd_action); cfg_cmd->ch_load = wlan_cpu_to_le16(cfg->ch_load_param); + cfg_cmd->noise = wlan_cpu_to_le16(cfg->noise); + cfg_cmd->duration = wlan_cpu_to_le16(cfg->duration); LEAVE(); return MLAN_STATUS_SUCCESS; } + /** * @brief This function handles the command response of ch_load * @@ -9185,13 +9224,10 @@ mlan_status wlan_ret_ch_load(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp, { HostCmd_DS_GET_CH_LOAD *cfg_cmd = (HostCmd_DS_GET_CH_LOAD *)&resp->params.ch_load; - mlan_ds_misc_cfg *misc_cfg = MNULL; ENTER(); - if (pioctl_buf) { - misc_cfg = (mlan_ds_misc_cfg *)pioctl_buf->pbuf; - misc_cfg->param.ch_load.ch_load_param = - wlan_le16_to_cpu(cfg_cmd->ch_load); - } + + pmpriv->ch_load_param = wlan_le16_to_cpu(cfg_cmd->ch_load); + pmpriv->noise = wlan_le16_to_cpu(cfg_cmd->noise); LEAVE(); return MLAN_STATUS_SUCCESS; } diff --git a/mxm_wifiex/wlan_src/mlan/mlan_decl.h b/mxm_wifiex/wlan_src/mlan/mlan_decl.h index e1f35b9..23e533c 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_decl.h +++ b/mxm_wifiex/wlan_src/mlan/mlan_decl.h @@ -33,7 +33,7 @@ #define _MLAN_DECL_H_ /** MLAN release version */ -#define MLAN_RELEASE_VERSION "322.p3" +#define MLAN_RELEASE_VERSION "344.p1" /** Re-define generic data types for MLAN/MOAL */ /** Signed char (1-byte) */ @@ -441,7 +441,7 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH]; /** SD8977 Card */ #define CARD_SD8977 "SD8977" /** SD8978 Card */ -#define CARD_SD8978 "SD8978" +#define CARD_SD8978 "SDIW416" /** SD8997 Card */ #define CARD_SD8997 "SD8997" /** SD8987 Card */ @@ -451,7 +451,7 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH]; /** SD9098 Card */ #define CARD_SD9098 "SD9098" /** SD9177 Card */ -#define CARD_SD9177 "SD9177" +#define CARD_SD9177 "SDIW612" /** SD8801 Card */ #define CARD_SD8801 "SD8801" /** SDNW62X Card */ @@ -490,6 +490,8 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH]; #define CARD_PCIEAW690 "PCIEAW690" /** PCIENW62X Card */ #define CARD_PCIENW62X "PCIENW62X" +/** PCIEIW629 Card */ +#define CARD_PCIEIW629 "PCIEIW629" #endif #ifdef USB @@ -523,7 +525,7 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH]; /** USB8997 Card */ #define CARD_USB8997 "USB8997" /** USB8978 Card */ -#define CARD_USB8978 "USB8978" +#define CARD_USB8978 "USBIW416" /** USB9098 Card */ #define CARD_USB9098 "USB9098" /** USB9097 Card */ @@ -699,6 +701,18 @@ typedef enum _mlan_buf_type { #endif } mlan_buf_type; +#define SCAN_STATE_SCAN_START MBIT(0) +#define SCAN_STATE_EXT_SCAN MBIT(1) +#define SCAN_STATE_EXT_SCAN_ENH MBIT(2) +#define SCAN_STATE_EXT_SCAN_CANCEL MBIT(3) +#define SCAN_STATE_EXT_SCAN_CMDRESP MBIT(4) +#define SCAN_STATE_EXT_SCAN_ENH_CMDRESP MBIT(5) +#define SCAN_STATE_EXT_SCAN_CANCEL_CMDRESP MBIT(6) +#define SCAN_STATE_EXT_SCAN_RESULT MBIT(7) +#define SCAN_STATE_LAST_EXT_SCAN_RESULT MBIT(8) +#define SCAN_STATE_EXT_SCAN_STATUS MBIT(9) +#define SCAN_STATE_SCAN_COMPLETE MBIT(10) + #ifdef USB /** mlan_usb_ep */ typedef enum _mlan_usb_ep { @@ -905,8 +919,8 @@ enum mlan_channel_type { /** channel band */ enum { BAND_2GHZ = 0, BAND_5GHZ = 1, - BAND_4GHZ = 2, - BAND_6GHZ = 3, + BAND_6GHZ = 2, + BAND_4GHZ = 3, }; /** channel offset */ @@ -2300,8 +2314,12 @@ typedef struct _mlan_device { t_u32 drv_mode; /** dfs w53 cfg */ t_u8 dfs53cfg; + /** dfs_offload */ + t_u8 dfs_offload; /** extend enhance scan */ t_u8 ext_scan; + /* mcs32 setting */ + t_u8 mcs32; } mlan_device, *pmlan_device; /** MLAN API function prototype */ diff --git a/mxm_wifiex/wlan_src/mlan/mlan_fw.h b/mxm_wifiex/wlan_src/mlan/mlan_fw.h index 6546b6b..6f31ef5 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_fw.h +++ b/mxm_wifiex/wlan_src/mlan/mlan_fw.h @@ -555,6 +555,9 @@ typedef enum _WLAN_802_11_WEP_STATUS { /** TLV type: fw cap info */ #define TLV_TYPE_FW_CAP_INFO (PROPRIETARY_TLV_BASE_ID + 318) +/** TLV type: secure boot uuid */ +#define TLV_TYPE_SECURE_BOOT_UUID (PROPRIETARY_TLV_BASE_ID + 348) + /** ADDBA TID mask */ #define ADDBA_TID_MASK (MBIT(2) | MBIT(3) | MBIT(4) | MBIT(5)) /** DELBA TID mask */ @@ -1360,6 +1363,7 @@ typedef enum _WLAN_802_11_WEP_STATUS { #define HostCmd_CMD_802_11_BAND_STEERING 0x026f /*** Host Command ID " MC_AGGR_CFG */ #define HostCmd_CMD_MC_AGGR_CFG 0x027a +#define HostCmd_CMD_802_11_STATS 0x0014 #define HostCmd_CMD_GET_CH_LOAD 0x027b /** Host Command ID : TDLS configuration */ @@ -3506,10 +3510,33 @@ typedef MLAN_PACK_START struct _HostCmd_DS_MC_AGGR_CFG { /** CTS2Self duration offset */ t_u16 cts2self_offset; } MLAN_PACK_END HostCmd_DS_MC_AGGR_CFG; + +/** Stats_Cfg_Params_TLV */ +typedef struct MLAN_PACK_START _Stats_Cfg_Params_TLV { + /** tlvHeader */ + MrvlIEtypesHeader_t tlvHeader; + /** op */ + t_u8 op; + /** reserved */ + t_u8 reserved; + /** mac */ + mlan_802_11_mac_addr mac; +} MLAN_PACK_END Stats_Cfg_Params_TLV_t; + +/** HostCmd_DS_STATS */ +typedef MLAN_PACK_START struct _HostCmd_DS_STATS { + /** Action */ + t_u16 action; + /** TLV buffer */ + t_u8 tlv_buffer[1]; +} MLAN_PACK_END HostCmd_DS_STATS; + typedef MLAN_PACK_START struct _HostCmd_DS_GET_CH_LOAD { /** Action */ t_u16 action; t_u16 ch_load; + t_s16 noise; + t_u16 duration; } MLAN_PACK_END HostCmd_DS_GET_CH_LOAD; /** HostCmd_DS_CMD_802_11_RSSI_INFO */ @@ -6273,9 +6300,12 @@ typedef MLAN_PACK_START struct _MrvlIEtypes_MacAddr_t { /** TLV type : AP WMM params */ #define TLV_TYPE_AP_WMM_PARAM (PROPRIETARY_TLV_BASE_ID + 0xd0) /* 0x01d0 */ /** TLV type : AP Tx beacon rate */ -#define TLV_TYPE_UAP_TX_BEACON_RATE \ - (PROPRIETARY_TLV_BASE_ID + 288) /* 0x0220 \ - */ +#define TLV_TYPE_UAP_TX_BEACON_RATE (PROPRIETARY_TLV_BASE_ID + 288) /* 0x0220 \ + */ +#define NXP_802_11_PER_PEER_STATS_CFG_TLV_ID \ + (PROPRIETARY_TLV_BASE_ID + 346) /* 0x025A */ +#define NXP_802_11_PER_PEER_STATS_ENTRY_TLV_ID \ + (PROPRIETARY_TLV_BASE_ID + 347) /* 0x025B */ /** MrvlIEtypes_beacon_period_t */ typedef MLAN_PACK_START struct _MrvlIEtypes_beacon_period_t { @@ -8008,6 +8038,7 @@ typedef struct MLAN_PACK_START _HostCmd_DS_COMMAND { HostCmd_DS_HAL_PHY_CFG hal_phy_cfg_params; HostCmd_DS_IPS_CONFIG ips_cfg; HostCmd_DS_MC_AGGR_CFG mc_aggr_cfg; + HostCmd_DS_STATS stats; HostCmd_DS_GET_CH_LOAD ch_load; } params; } MLAN_PACK_END HostCmd_DS_COMMAND, *pHostCmd_DS_COMMAND; @@ -8036,6 +8067,15 @@ typedef struct MLAN_PACK_START _opt_sleep_confirm_buffer { OPT_Confirm_Sleep ps_cfm_sleep; } MLAN_PACK_END opt_sleep_confirm_buffer; +typedef MLAN_PACK_START struct _MrvlIEtypes_Secure_Boot_Uuid_t { + /** Header */ + MrvlIEtypesHeader_t header; + + /** Secure boot uuid lower and higher 8 bytes */ + t_u64 uuid_lo; + t_u64 uuid_hi; +} MLAN_PACK_END MrvlIEtypes_Secure_Boot_Uuid_t; + /** req host side download vdll block */ #define VDLL_IND_TYPE_REQ 0 /** notify vdll start offset in firmware image */ diff --git a/mxm_wifiex/wlan_src/mlan/mlan_ieee.h b/mxm_wifiex/wlan_src/mlan/mlan_ieee.h index 3f37d67..3edee2d 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_ieee.h +++ b/mxm_wifiex/wlan_src/mlan/mlan_ieee.h @@ -1225,8 +1225,10 @@ typedef MLAN_PACK_START struct _IEEEtypes_HeOpParam_t { t_u16 co_located_bss : 1; /* bit 15 */ /** ER SU Disable */ t_u8 er_su_disable : 1; /* bit 16 */ - /** Reserved, including 6G Operation Info Pressent (bit17) */ - t_u8 reserved : 7; /* bit 17-23 */ + /* 6g operation info present */ + t_u8 he_6g_op_info_present : 1; /* bit 17 */ + /** Reserved bit 18-23 */ + t_u8 reserved : 6; /* bit 18-23 */ } MLAN_PACK_END IEEEtypes_HeOpParam_t; typedef MLAN_PACK_START struct _IEEEtypes_HeBssColorInfo_t { @@ -1666,7 +1668,10 @@ typedef MLAN_PACK_START struct { /**wait for all channel scan to complete to report scan result*/ #define BG_SCAN_WAIT_ALL_CHAN_DONE 0x80000000 /** Maximum number of channels that can be sent in bg scan config */ -#define WLAN_BG_SCAN_CHAN_MAX 38 +#define CHAN_MAX_24G 14 +#define CHAN_MAX_5G 24 +#define CHAN_MAX_UNII4 3 +#define WLAN_BG_SCAN_CHAN_MAX (CHAN_MAX_24G + CHAN_MAX_5G + CHAN_MAX_UNII4) /** Enumeration definition */ /** EES MODE */ diff --git a/mxm_wifiex/wlan_src/mlan/mlan_ioctl.h b/mxm_wifiex/wlan_src/mlan/mlan_ioctl.h index eb051af..7eecd41 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_ioctl.h +++ b/mxm_wifiex/wlan_src/mlan/mlan_ioctl.h @@ -369,6 +369,8 @@ enum _mlan_ioctl_req_id { MLAN_OID_MISC_IPS_CFG = 0x00200085, MLAN_OID_MISC_MC_AGGR_CFG = 0x00200086, MLAN_OID_MISC_CH_LOAD = 0x00200087, + MLAN_OID_MISC_STATS = 0x00200088, + MLAN_OID_MISC_CH_LOAD_RESULTS = 0x00200089, }; /** Sub command size */ @@ -1887,11 +1889,20 @@ typedef struct _mlan_fw_info { t_u8 prohibit_80mhz; /** FW support beacon protection */ t_u8 fw_beacon_prot; + + /* lower 8 bytes of uuid */ + t_u64 uuid_lo; + + /* higher 8 bytes of uuid */ + t_u64 uuid_hi; } mlan_fw_info, *pmlan_fw_info; /** Version string buffer length */ #define MLAN_MAX_VER_STR_LEN 128 +/** Maximum length of secure boot uuid */ +#define MLAN_MAX_UUID_LEN 32 + /** mlan_ver_ext data structure for MLAN_OID_GET_VER_EXT */ typedef struct _mlan_ver_ext { /** Selected version string */ @@ -2009,7 +2020,7 @@ typedef struct _mlan_bss_info { /** Channel */ t_u32 bss_chan; /** Band */ - t_u8 bss_band; + t_u16 bss_band; /** Region code */ t_u32 region_code; /** Connection status */ @@ -2201,6 +2212,8 @@ typedef struct _mlan_debug_info { t_u32 bypass_pkt_count; /** Corresponds to scan_processing member of mlan_adapter */ t_u32 scan_processing; + /** Corresponds to scan_state member of mlan_adapter */ + t_u32 scan_state; /** Corresponds to mlan_processing member of mlan_adapter */ t_u32 mlan_processing; /** Corresponds to main_lock_flag member of mlan_adapter */ @@ -4434,6 +4447,9 @@ typedef struct _mlan_ds_misc_cck_desense_cfg { #define MLAN_IPADDR_OP_ARP_FILTER MBIT(0) /** IP operation ARP response */ #define MLAN_IPADDR_OP_AUTO_ARP_RESP MBIT(1) +/** Enable opcode bit for MDNS & NS when device enter into suspend **/ +#define MLAN_OP_ADD_MDNS MBIT(2) +#define MLAN_OP_ADD_IPV6_NS MBIT(3) /** Type definition of mlan_ds_misc_ipaddr_cfg for MLAN_OID_MISC_IP_ADDR */ typedef struct _mlan_ds_misc_ipaddr_cfg { @@ -5501,10 +5517,23 @@ typedef struct _mlan_ds_mc_aggr_cfg { /** CTS2Self duration offset */ t_u16 cts2self_offset; } mlan_ds_mc_aggr_cfg; + +/** mlan_ds_stats */ +typedef struct _mlan_ds_stats { + /** action */ + t_u16 action; + /** tlv len */ + t_u16 tlv_len; + /** TLV buffer */ + t_u8 tlv_buf[1]; +} mlan_ds_stats; + typedef struct _mlan_ds_ch_load { /** action */ t_u8 action; t_u16 ch_load_param; + t_s16 noise; + t_u16 duration; } mlan_ds_ch_load; /** Type definition of mlan_ds_misc_cfg for MLAN_IOCTL_MISC_CFG */ @@ -5649,6 +5678,7 @@ typedef struct _mlan_ds_misc_cfg { mlan_ds_misc_tp_state tp_state; mlan_ds_hal_phy_cfg_params hal_phy_cfg_params; mlan_ds_mc_aggr_cfg mc_aggr_cfg; + mlan_ds_stats stats; #ifdef UAP_SUPPORT t_u8 wacp_mode; #endif diff --git a/mxm_wifiex/wlan_src/mlan/mlan_join.c b/mxm_wifiex/wlan_src/mlan/mlan_join.c index 09e6b5d..29aab6b 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_join.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_join.c @@ -1037,7 +1037,6 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv, pchan_tlv->chan_scan_param[0].bandcfg.chanBand = wlan_band_to_radio_type(pbss_desc->bss_band); - PRINTM(MINFO, "Assoc: TLV Bandcfg = %x\n", pchan_tlv->chan_scan_param[0].bandcfg); pos += sizeof(pchan_tlv->header) + sizeof(ChanScanParamSet_t); @@ -1218,8 +1217,7 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv, wlan_11ax_bandconfig_allowed(pmpriv, pbss_desc)) wlan_cmd_append_11ax_tlv(pmpriv, pbss_desc, &pos); - wlan_wmm_process_association_req(pmpriv, &pos, &pbss_desc->wmm_ie, - pbss_desc->pht_cap); + wlan_wmm_process_association_req(pmpriv, &pos, &pbss_desc->wmm_ie); if (pmpriv->sec_info.wapi_enabled && pmpriv->wapi_ie_len) wlan_cmd_append_wapi_ie(pmpriv, &pos); @@ -1489,7 +1487,7 @@ mlan_status wlan_ret_802_11_associate(mlan_private *pmpriv, pmpriv->curr_bss_params.bss_descriptor.channel = pbss_desc->phy_param_set.ds_param_set.current_chan; - pmpriv->curr_bss_params.band = (t_u8)pbss_desc->bss_band; + pmpriv->curr_bss_params.band = pbss_desc->bss_band; /* Store current channel for further reference. * This would save one extra call to get current @@ -1498,7 +1496,7 @@ mlan_status wlan_ret_802_11_associate(mlan_private *pmpriv, pmpriv->adapter->dfsr_channel = pmpriv->curr_bss_params.bss_descriptor.channel; - /* + /*` * Adjust the timestamps in the scan table to be relative to the newly * associated AP's TSF */ @@ -1509,10 +1507,7 @@ mlan_status wlan_ret_802_11_associate(mlan_private *pmpriv, else pmpriv->curr_bss_params.wmm_enabled = MFALSE; - if ((pmpriv->wmm_required || - (pbss_desc->pht_cap && - (pbss_desc->pht_cap->ieee_hdr.element_id == HT_CAPABILITY))) && - pmpriv->curr_bss_params.wmm_enabled) + if (pmpriv->wmm_required && pmpriv->curr_bss_params.wmm_enabled) pmpriv->wmm_enabled = MTRUE; else pmpriv->wmm_enabled = MFALSE; @@ -1605,8 +1600,6 @@ mlan_status wlan_ret_802_11_associate(mlan_private *pmpriv, wlan_recv_event(pmpriv, MLAN_EVENT_ID_DRV_CONNECTED, pevent); - /* Send OBSS scan param to the application if available */ - wlan_2040_coex_event(pmpriv); wlan_coex_ampdu_rxwinsize(pmpriv->adapter); if (!pmpriv->sec_info.wpa_enabled && !pmpriv->sec_info.wpa2_enabled && @@ -2006,6 +1999,7 @@ mlan_status wlan_cmd_802_11_ad_hoc_join(mlan_private *pmpriv, t_u32 i, rates_size = 0; t_u32 curr_pkt_filter; t_u8 *pos = (t_u8 *)padhoc_join + sizeof(HostCmd_DS_802_11_AD_HOC_JOIN); + t_s32 append_size_11h = 0; ENTER(); @@ -2098,7 +2092,7 @@ mlan_status wlan_cmd_802_11_ad_hoc_join(mlan_private *pmpriv, /* Copy the channel information */ pmpriv->curr_bss_params.bss_descriptor.channel = pbss_desc->channel; - pmpriv->curr_bss_params.band = (t_u8)pbss_desc->bss_band; + pmpriv->curr_bss_params.band = pbss_desc->bss_band; if (pmpriv->sec_info.wep_status == Wlan802_11WEPEnabled || pmpriv->sec_info.wpa_enabled || pmpriv->sec_info.ewpa_enabled) @@ -2144,10 +2138,17 @@ mlan_status wlan_cmd_802_11_ad_hoc_join(mlan_private *pmpriv, * adhoc/infra 11h behavior can be properly triggered. * pos modified if data is appended */ - cmd_append_size += wlan_11h_process_join( - pmpriv, &pos, &padhoc_join->bss_descriptor.cap, - (t_u8)pbss_desc->bss_band, pbss_desc->channel, - &pbss_desc->wlan_11h_bss_info); + append_size_11h += + wlan_11h_process_join(pmpriv, &pos, + &padhoc_join->bss_descriptor.cap, + pbss_desc->bss_band, pbss_desc->channel, + &pbss_desc->wlan_11h_bss_info); + if (append_size_11h >= 0) + cmd_append_size += append_size_11h; + else { + ret = MLAN_STATUS_FAILURE; + goto done; + } if (pmpriv->sec_info.wpa_enabled) { prsn_ie_tlv = (MrvlIEtypes_RsnParamSet_t *)pos; diff --git a/mxm_wifiex/wlan_src/mlan/mlan_main.h b/mxm_wifiex/wlan_src/mlan/mlan_main.h index feb46f1..3b57a8a 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_main.h +++ b/mxm_wifiex/wlan_src/mlan/mlan_main.h @@ -1316,6 +1316,10 @@ typedef struct _mlan_private { t_u32 amsdu_tx_cnt; /** tx msdu count in amsdu*/ t_u32 msdu_in_tx_amsdu_cnt; + /** channel load info for current channel */ + t_u16 ch_load_param; + /** Noise floor value for current channel */ + t_s16 noise; } mlan_private, *pmlan_private; typedef struct _assoc_logger { @@ -1808,7 +1812,7 @@ typedef struct _mef_entry { int num_wowlan_entry; /** Num for IPv6 neighbor solicitation message offload */ int num_ipv6_ns_offload; - + int clear_mef_entry; /** criteria*/ t_u32 criteria; /** MEF CFG Array to store etted_entry_bitmap; @@ -1875,11 +1879,14 @@ typedef struct _mlan_init_para { t_u8 uap_max_sta; /** dfs w53 cfg */ t_u8 dfs53cfg; + /** dfs_offload */ + t_u8 dfs_offload; #ifdef PCIE /** adma ring size */ t_u16 ring_size; #endif t_u8 ext_scan; + t_u8 mcs32; } mlan_init_para, *pmlan_init_para; #ifdef SDIO @@ -2448,6 +2455,8 @@ struct _mlan_adapter { pmlan_private pending_disconnect_priv; /** mlan_processing */ t_u32 scan_processing; + /** scan state */ + t_u32 scan_state; /** firmware support for roaming*/ t_u8 fw_roaming; /** User set passphrase*/ @@ -2778,6 +2787,11 @@ struct _mlan_adapter { t_u32 tp_state_on; /** Packet drop point */ t_u32 tp_state_drop_point; + /* lower 8 bytes of uuid */ + t_u64 uuid_lo; + + /* higher 8 bytes of uuid */ + t_u64 uuid_hi; }; /** Check if stream 2X2 enabled */ @@ -2881,7 +2895,7 @@ mlan_status wlan_misc_ioctl_init_shutdown(pmlan_adapter pmadapter, mlan_status wlan_get_info_debug_info(pmlan_adapter pmadapter, pmlan_ioctl_req pioctl_req); -#if defined(STA_SUPPORT) && defined(UAP_SUPPORT) +#if defined(STA_SUPPORT) || defined(UAP_SUPPORT) extern pmlan_operations mlan_ops[]; /** Set/Get BSS role */ mlan_status wlan_bss_ioctl_bss_role(pmlan_adapter pmadapter, @@ -3315,6 +3329,7 @@ mlan_status wlan_cmd_802_11_scan(pmlan_private pmpriv, HostCmd_DS_COMMAND *pcmd, mlan_status wlan_ret_802_11_scan(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp, t_void *pioctl_buf); +t_u8 wlan_get_ext_scan_state(HostCmd_DS_COMMAND *pcmd); /** Extended scan command handler */ mlan_status wlan_cmd_802_11_scan_ext(pmlan_private pmpriv, HostCmd_DS_COMMAND *pcmd, @@ -3971,6 +3986,8 @@ mlan_status wlan_misc_ioctl_mc_aggr_cfg(pmlan_adapter pmadapter, mlan_ioctl_req *pioctl_req); mlan_status wlan_misc_ioctl_ch_load(pmlan_adapter pmadapter, mlan_ioctl_req *pioctl_req); +mlan_status wlan_misc_ioctl_ch_load_results(pmlan_adapter pmadapter, + mlan_ioctl_req *pioctl_req); mlan_status wlan_cmd_get_ch_load(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd, t_u16 cmd_action, t_void *pdata_buf); mlan_status wlan_ret_ch_load(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp, diff --git a/mxm_wifiex/wlan_src/mlan/mlan_misc.c b/mxm_wifiex/wlan_src/mlan/mlan_misc.c index 55b1d8c..9f4702f 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_misc.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_misc.c @@ -450,6 +450,7 @@ mlan_status wlan_get_info_debug_info(pmlan_adapter pmadapter, debug_info->port_open = pmpriv->port_open; debug_info->bypass_pkt_count = pmadapter->bypass_pkt_count; debug_info->scan_processing = pmadapter->scan_processing; + debug_info->scan_state = pmadapter->scan_state; debug_info->mlan_processing = pmadapter->mlan_processing; debug_info->main_lock_flag = pmadapter->main_lock_flag; debug_info->main_process_cnt = pmadapter->main_process_cnt; @@ -2421,7 +2422,8 @@ mlan_status wlan_misc_ioctl_tdls_oper(pmlan_adapter pmadapter, sta_ptr->max_amsdu = MLAN_TX_DATA_BUF_SIZE_4K; for (i = 0; i < MAX_NUM_TID; i++) { - if (sta_ptr->is_11n_enabled) + if (sta_ptr->is_11n_enabled || + sta_ptr->is_11ax_enabled) sta_ptr->ampdu_sta[i] = pmpriv->aggr_prio_tbl[i] .ampdu_user; @@ -2474,7 +2476,8 @@ mlan_status wlan_misc_ioctl_tdls_oper(pmlan_adapter pmadapter, wlan_restore_tdls_packets(pmpriv, ptdls_oper->peer_mac, TDLS_TEAR_DOWN); - if (sta_ptr->is_11n_enabled) { + if (sta_ptr->is_11n_enabled || + sta_ptr->is_11ax_enabled) { wlan_cleanup_reorder_tbl( pmpriv, ptdls_oper->peer_mac); wlan_11n_cleanup_txbastream_tbl( @@ -3977,7 +3980,8 @@ mlan_status wlan_radio_ioctl_ant_cfg(pmlan_adapter pmadapter, defined(PCIE9097) || defined(SD9097) || defined(USB9097) || \ defined(SDNW62X) || defined(PCIENW62X) || defined(USBNW62X) if (IS_CARD9098(pmadapter->card_type) || - IS_CARD9097(pmadapter->card_type)) { + IS_CARD9097(pmadapter->card_type) || + IS_CARDNW62X(pmadapter->card_type)) { ant_cfg->tx_antenna &= 0x0303; ant_cfg->rx_antenna &= 0x0303; /** 2G antcfg TX */ @@ -5552,32 +5556,35 @@ mlan_status wlan_process_mef_cfg_cmd(mlan_private *pmpriv, mlan_status ret = MLAN_STATUS_SUCCESS; pmlan_callbacks pcb; mef_cfg_data mef; - mef_entry_t *pentry; + mef_entry_t *pentry = MNULL; mef_entry *pmef; t_u16 entry_num = 0; ENTER(); pcb = &pmadapter->callbacks; + memset(pmadapter, &mef, 0, sizeof(mef_cfg_data)); /** check how many entries in adapter*/ pmef = &pmadapter->entry_cfg; entry_num += pmef->enable_autoarp_entry; entry_num += pmef->num_wowlan_entry; entry_num += pmef->num_ipv6_ns_offload; - if (!entry_num) { + if (!entry_num && !pmef->clear_mef_entry) { PRINTM(MIOCTL, "No filter entries\n"); goto done; } - - ret = pcb->moal_malloc(pmadapter->pmoal_handle, - sizeof(mef_entry_t) * entry_num, MLAN_MEM_DEF, - (t_u8 **)&mef.pentry); - if (ret != MLAN_STATUS_SUCCESS || mef.pentry == MNULL) { - PRINTM(MERROR, "Failed to allocate cmd data buffer\n"); - ret = MLAN_STATUS_FAILURE; - goto err_handle; + if (entry_num) { + ret = pcb->moal_malloc(pmadapter->pmoal_handle, + sizeof(mef_entry_t) * entry_num, + MLAN_MEM_DEF, (t_u8 **)&mef.pentry); + if (ret != MLAN_STATUS_SUCCESS || mef.pentry == MNULL) { + PRINTM(MERROR, "Failed to allocate cmd data buffer\n"); + ret = MLAN_STATUS_FAILURE; + goto err_handle; + } } + /** Fill mef_cfg structure*/ mef.criteria = pmef->criteria; mef.entry_num = entry_num; @@ -5666,11 +5673,25 @@ mlan_status wlan_misc_ioctl_mef_flt_cfg(pmlan_adapter pmadapter, pmadapter)) PRINTM(MERROR, "Set MEF Entries Error\n"); - } else if (mef_cfg->op_code & - MLAN_IPADDR_OP_IP_REMOVE) { + } else if (!(mef_cfg->op_code & + MLAN_IPADDR_OP_IP_REMOVE)) { pmef->enable_autoarp_entry = 0; + pmef->num_wowlan_entry = 0; + pmef->num_ipv6_ns_offload = 0; + pmef->clear_mef_entry = 1; memset(pmadapter, &pmef->entry[5], 0, sizeof(mef_entry_t)); + memset(pmadapter, &pmef->entry[6], 0, + sizeof(mef_entry_t)); + memset(pmadapter, &pmef->entry[7], 0, + sizeof(mef_entry_t)); + if (MLAN_STATUS_SUCCESS != + wlan_process_mef_cfg_cmd( + pmadapter + ->priv[pioctl_req->bss_index], + pmadapter)) + PRINTM(MERROR, + "Clear MEF Entries Error\n"); } } break; @@ -6070,6 +6091,40 @@ mlan_status wlan_misc_ioctl_mc_aggr_cfg(pmlan_adapter pmadapter, LEAVE(); return ret; } +/** + * @brief get channel load results + * + * @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_ch_load_results(pmlan_adapter pmadapter, + mlan_ioctl_req *pioctl_req) +{ + mlan_private *pmpriv = MNULL; + mlan_status ret = MLAN_STATUS_SUCCESS; + t_u16 cmd_action = 0; + mlan_ds_misc_cfg *misc = MNULL; + + ENTER(); + if (pioctl_req == MNULL) + return MLAN_STATUS_FAILURE; + pmpriv = pmadapter->priv[pioctl_req->bss_index]; + misc = (mlan_ds_misc_cfg *)pioctl_req->pbuf; + cmd_action = pioctl_req->action; + + /* Send request to firmware */ + if (pmpriv->ch_load_param == 255) { + return MLAN_STATUS_FAILURE; + } else { + misc->param.ch_load.ch_load_param = pmpriv->ch_load_param; + misc->param.ch_load.noise = pmpriv->noise; + } + + LEAVE(); + return ret; +} /** * @brief get channel load @@ -6082,17 +6137,21 @@ mlan_status wlan_misc_ioctl_mc_aggr_cfg(pmlan_adapter pmadapter, mlan_status wlan_misc_ioctl_ch_load(pmlan_adapter pmadapter, mlan_ioctl_req *pioctl_req) { - mlan_private *pmpriv = pmadapter->priv[pioctl_req->bss_index]; + mlan_private *pmpriv = MNULL; mlan_status ret = MLAN_STATUS_SUCCESS; t_u16 cmd_action = 0; mlan_ds_misc_cfg *misc = MNULL; ENTER(); - + if (pioctl_req == MNULL) + return MLAN_STATUS_FAILURE; + pmpriv = pmadapter->priv[pioctl_req->bss_index]; misc = (mlan_ds_misc_cfg *)pioctl_req->pbuf; cmd_action = pioctl_req->action; /* Send request to firmware */ + pmpriv->ch_load_param = 255; /* Default value for identifying + update/non-updated value*/ ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_GET_CH_LOAD, cmd_action, 0, (t_void *)pioctl_req, (t_void *)&misc->param.ch_load); diff --git a/mxm_wifiex/wlan_src/mlan/mlan_scan.c b/mxm_wifiex/wlan_src/mlan/mlan_scan.c index 1a8b67e..150d85b 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_scan.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_scan.c @@ -1036,7 +1036,9 @@ wlan_scan_channel_list(mlan_private *pmpriv, t_void *pioctl_buf, wlan_cpu_to_le16(pvht_cap->header.len); } - if (IS_FW_SUPPORT_11AX(pmadapter)) { + if (IS_FW_SUPPORT_11AX(pmadapter) && + ((pmpriv->config_bands & BAND_GAX) || + (pmpriv->config_bands & BAND_AAX))) { phe_cap = (MrvlIEtypes_Extension_t *)ptlv_pos; len = wlan_fill_he_cap_tlv(pmpriv, pmpriv->config_bands, phe_cap, MFALSE); @@ -4227,6 +4229,7 @@ mlan_status wlan_scan_networks(mlan_private *pmpriv, t_void *pioctl_buf, &pmadapter->scan_pending_q, MNULL, MNULL); pmadapter->pscan_ioctl_req = pioctl_req; pmadapter->scan_processing = MTRUE; + pmadapter->scan_state = SCAN_STATE_SCAN_START; wlan_insert_cmd_to_pending_q(pmadapter, pcmd_node, MTRUE); } @@ -4843,6 +4846,26 @@ done: return ret; } +/** + * @brief Get ext_scan state from ext_scan_type + * + * + * @param pcmd A pointer to HostCmd_DS_COMMAND structure to be sent to + * firmware with the HostCmd_DS_802_11_SCAN_EXT structure + * + * @return + * SCAN_STATE_EXT_SCAN_ENH/SCAN_STATE_EXT_SCAN_CANCEL/SCAN_STATE_EXT_SCAN_ENH + */ +t_u8 wlan_get_ext_scan_state(HostCmd_DS_COMMAND *pcmd) +{ + HostCmd_DS_802_11_SCAN_EXT *pext_scan_cmd = &pcmd->params.ext_scan; + if (pext_scan_cmd->ext_scan_type == EXT_SCAN_ENHANCE) + return SCAN_STATE_EXT_SCAN_ENH; + if (pext_scan_cmd->ext_scan_type == EXT_SCAN_CANCEL) + return SCAN_STATE_EXT_SCAN_CANCEL; + return SCAN_STATE_EXT_SCAN; +} + /** * @brief Prepare an extended scan command to be sent to the firmware * @@ -4932,11 +4955,13 @@ mlan_status wlan_ret_802_11_scan_ext(mlan_private *pmpriv, ENTER(); PRINTM(MINFO, "EXT scan returns successfully\n"); + pmadapter->scan_state |= wlan_get_ext_scan_state(resp); ext_scan_type = pext_scan_cmd->ext_scan_type; if (ext_scan_type == EXT_SCAN_CANCEL) { PRINTM(MCMND, "Cancel scan command completed!\n"); wlan_request_cmd_lock(pmadapter); pmadapter->scan_processing = MFALSE; + pmadapter->scan_state |= SCAN_STATE_SCAN_COMPLETE; pmadapter->ext_scan_type = EXT_SCAN_DEFAULT; wlan_release_cmd_lock(pmadapter); /* Need to indicate IOCTL complete */ @@ -5756,6 +5781,13 @@ mlan_status wlan_handle_event_ext_scan_report(mlan_private *pmpriv, DBG_HEXDUMP(MCMD_D, "EVENT EXT_SCAN", pmbuf->pbuf + pmbuf->data_offset, pmbuf->data_len); + + if (!pevent_scan->more_event) + pmadapter->scan_state |= SCAN_STATE_EXT_SCAN_RESULT | + SCAN_STATE_LAST_EXT_SCAN_RESULT; + else + pmadapter->scan_state |= SCAN_STATE_EXT_SCAN_RESULT; + wlan_parse_ext_scan_result(pmpriv, pevent_scan->num_of_set, ptlv, tlv_buf_left); if (!pevent_scan->more_event && @@ -5789,6 +5821,7 @@ mlan_status wlan_handle_event_ext_scan_report(mlan_private *pmpriv, wlan_scan_process_results(pmpriv); wlan_request_cmd_lock(pmadapter); pmadapter->scan_processing = MFALSE; + pmadapter->scan_state |= SCAN_STATE_SCAN_COMPLETE; pioctl_req = pmadapter->pscan_ioctl_req; pmadapter->pscan_ioctl_req = MNULL; /* Need to indicate IOCTL complete */ @@ -5814,6 +5847,9 @@ mlan_status wlan_handle_event_ext_scan_report(mlan_private *pmpriv, wlan_flush_scan_queue(pmadapter); wlan_request_cmd_lock(pmadapter); pmadapter->scan_processing = MFALSE; + pmadapter->scan_state |= + SCAN_STATE_SCAN_COMPLETE; + pioctl_req = pmadapter->pscan_ioctl_req; pmadapter->pscan_ioctl_req = MNULL; /* Indicate IOCTL complete */ @@ -5874,6 +5910,7 @@ mlan_status wlan_handle_event_ext_scan_status(mlan_private *pmpriv, ret = MLAN_STATUS_FAILURE; goto done; } + pmadapter->scan_state |= SCAN_STATE_EXT_SCAN_STATUS; scan_event = (pmlan_event_scan_status)(pmbuf->pbuf + pmbuf->data_offset); @@ -5920,6 +5957,7 @@ done: wlan_flush_scan_queue(pmadapter); wlan_request_cmd_lock(pmadapter); pmadapter->scan_processing = MFALSE; + pmadapter->scan_state |= SCAN_STATE_SCAN_COMPLETE; pioctl_req = pmadapter->pscan_ioctl_req; pmadapter->pscan_ioctl_req = MNULL; /* Indicate IOCTL complete */ @@ -5980,6 +6018,7 @@ done: /** Complete scan ioctl */ wlan_request_cmd_lock(pmadapter); pmadapter->scan_processing = MFALSE; + pmadapter->scan_state |= SCAN_STATE_SCAN_COMPLETE; pioctl_req = pmadapter->pscan_ioctl_req; pmadapter->pscan_ioctl_req = MNULL; /* Need to indicate IOCTL complete */ @@ -6435,7 +6474,9 @@ mlan_status wlan_cmd_bgscan_config(mlan_private *pmpriv, pvht_cap->header.len = wlan_cpu_to_le16(pvht_cap->header.len); } - if (IS_FW_SUPPORT_11AX(pmadapter)) { + if (IS_FW_SUPPORT_11AX(pmadapter) && + ((pmpriv->config_bands & BAND_GAX) || + (pmpriv->config_bands & BAND_AAX))) { phe_cap = (MrvlIEtypes_Extension_t *)tlv; len = wlan_fill_he_cap_tlv(pmpriv, pmpriv->config_bands, phe_cap, MFALSE); diff --git a/mxm_wifiex/wlan_src/mlan/mlan_sdio.c b/mxm_wifiex/wlan_src/mlan/mlan_sdio.c index 9f300bc..ef20ecf 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_sdio.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_sdio.c @@ -2168,7 +2168,7 @@ static mlan_status wlan_sdio_check_fw_status(mlan_adapter *pmadapter, ret = MLAN_STATUS_SUCCESS; break; } else { - wlan_mdelay(pmadapter, 100); + wlan_mdelay(pmadapter, 10); ret = MLAN_STATUS_FAILURE; } } diff --git a/mxm_wifiex/wlan_src/mlan/mlan_shim.c b/mxm_wifiex/wlan_src/mlan/mlan_shim.c index fac5afe..e1d263b 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_shim.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_shim.c @@ -369,6 +369,7 @@ mlan_status mlan_register(pmlan_device pmdevice, t_void **ppmlan_adapter) pmadapter->card_type = pmdevice->card_type; pmadapter->card_rev = pmdevice->card_rev; pmadapter->init_para.uap_max_sta = pmdevice->uap_max_sta; + pmadapter->init_para.mcs32 = pmdevice->mcs32; #ifdef SDIO if (IS_SD(pmadapter->card_type)) { @@ -500,6 +501,7 @@ mlan_status mlan_register(pmlan_device pmdevice, t_void **ppmlan_adapter) } #endif pmadapter->init_para.dfs53cfg = pmdevice->dfs53cfg; + pmadapter->init_para.dfs_offload = pmdevice->dfs_offload; pmadapter->priv_num = 0; pmadapter->priv[0] = MNULL; diff --git a/mxm_wifiex/wlan_src/mlan/mlan_sta_cmdresp.c b/mxm_wifiex/wlan_src/mlan/mlan_sta_cmdresp.c index 726e8f5..8f392d5 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_sta_cmdresp.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_sta_cmdresp.c @@ -110,7 +110,8 @@ wlan_process_cmdreps_error_tdls_operation(mlan_private *pmpriv, if (ISSUPP_EXTCAP_TDLS_CHAN_SWITCH( sta_ptr->ExtCap.ext_cap)) wlan_tdls_config(pmpriv, MFALSE); - if (sta_ptr->is_11n_enabled) { + if (sta_ptr->is_11n_enabled || + sta_ptr->is_11ax_enabled) { wlan_cleanup_reorder_tbl( pmpriv, ptdls_oper_data->peer_mac); wlan_11n_cleanup_txbastream_tbl( @@ -1847,7 +1848,8 @@ static mlan_status wlan_ret_tdls_config(pmlan_private pmpriv, sta_ptr = wlan_get_station_entry( pmpriv, tdls_all_cfg->u.tdls_tear_down.peer_mac_addr); if (sta_ptr) { - if (sta_ptr->is_11n_enabled) { + if (sta_ptr->is_11n_enabled || + sta_ptr->is_11ax_enabled) { wlan_cleanup_reorder_tbl( pmpriv, tdls_all_cfg->u.tdls_tear_down .peer_mac_addr); @@ -2019,7 +2021,8 @@ static mlan_status wlan_ret_tdls_oper(pmlan_private pmpriv, if (ISSUPP_EXTCAP_TDLS_CHAN_SWITCH( sta_ptr->ExtCap.ext_cap)) wlan_tdls_config(pmpriv, MFALSE); - if (sta_ptr->is_11n_enabled) { + if (sta_ptr->is_11n_enabled || + sta_ptr->is_11ax_enabled) { wlan_cleanup_reorder_tbl(pmpriv, ptdls_oper->peer_mac); wlan_11n_cleanup_txbastream_tbl( diff --git a/mxm_wifiex/wlan_src/mlan/mlan_sta_event.c b/mxm_wifiex/wlan_src/mlan/mlan_sta_event.c index 2cc4ca4..0a13b5a 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_sta_event.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_sta_event.c @@ -148,7 +148,8 @@ static void wlan_parse_tdls_event(pmlan_private priv, pmlan_buffer pevent) } } for (i = 0; i < MAX_NUM_TID; i++) { - if (sta_ptr->is_11n_enabled) + if (sta_ptr->is_11n_enabled || + sta_ptr->is_11ax_enabled) sta_ptr->ampdu_sta[i] = priv->aggr_prio_tbl[i] .ampdu_user; @@ -221,7 +222,8 @@ static void wlan_parse_tdls_event(pmlan_private priv, pmlan_buffer pevent) wlan_restore_tdls_packets(priv, tdls_event->peer_mac_addr, TDLS_TEAR_DOWN); - if (sta_ptr->is_11n_enabled) { + if (sta_ptr->is_11n_enabled || + sta_ptr->is_11ax_enabled) { wlan_cleanup_reorder_tbl( priv, tdls_event->peer_mac_addr); wlan_11n_cleanup_txbastream_tbl( @@ -807,8 +809,8 @@ mlan_status wlan_ops_sta_process_event(t_void *priv) MRVDRV_TxPD_POWER_MGMT_NULL_PACKET | MRVDRV_TxPD_POWER_MGMT_LAST_PACKET) == MLAN_STATUS_SUCCESS) { - LEAVE(); - return MLAN_STATUS_SUCCESS; + ret = MLAN_STATUS_SUCCESS; + goto done; } } } @@ -885,6 +887,8 @@ mlan_status wlan_ops_sta_process_event(t_void *priv) } pmadapter->scan_block = MFALSE; wlan_recv_event(pmpriv, MLAN_EVENT_ID_FW_PORT_RELEASE, MNULL); + /* Send OBSS scan param to the application */ + wlan_2040_coex_event(pmpriv); break; case EVENT_STOP_TX: diff --git a/mxm_wifiex/wlan_src/mlan/mlan_sta_ioctl.c b/mxm_wifiex/wlan_src/mlan/mlan_sta_ioctl.c index e6562de..00e7f93 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_sta_ioctl.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_sta_ioctl.c @@ -304,7 +304,7 @@ static mlan_status wlan_get_info_bss_info(pmlan_adapter pmadapter, info->param.bss_info.beacon_interval = pbss_desc->beacon_period; /* Band */ - info->param.bss_info.bss_band = (t_u8)pbss_desc->bss_band; + info->param.bss_info.bss_band = pbss_desc->bss_band; /* Region code */ info->param.bss_info.region_code = pmadapter->region_code; @@ -455,6 +455,8 @@ static mlan_status wlan_get_info_ioctl(pmlan_adapter pmadapter, pmpriv->usr_dot_11ac_mcs_support; pget_info->param.fw_info.usr_dot_11ac_dev_cap_a = pmpriv->usr_dot_11ac_dev_cap_a; + pget_info->param.fw_info.uuid_lo = pmadapter->uuid_lo; + pget_info->param.fw_info.uuid_hi = pmadapter->uuid_hi; pget_info->param.fw_info.hw_hecap_len = pmadapter->hw_hecap_len; pget_info->param.fw_info.hw_2g_hecap_len = pmadapter->hw_2g_hecap_len; @@ -5336,6 +5338,9 @@ static mlan_status wlan_misc_cfg_ioctl(pmlan_adapter pmadapter, case MLAN_OID_MISC_CH_LOAD: status = wlan_misc_ioctl_ch_load(pmadapter, pioctl_req); break; + case MLAN_OID_MISC_CH_LOAD_RESULTS: + status = wlan_misc_ioctl_ch_load_results(pmadapter, pioctl_req); + break; case MLAN_OID_MISC_GET_TSF: status = wlan_misc_ioctl_get_tsf(pmadapter, pioctl_req); break; diff --git a/mxm_wifiex/wlan_src/mlan/mlan_sta_rx.c b/mxm_wifiex/wlan_src/mlan/mlan_sta_rx.c index c2e8777..b68fbe2 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_sta_rx.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_sta_rx.c @@ -42,6 +42,7 @@ Change log: #include "mlan_main.h" #include "mlan_11n_aggr.h" #include "mlan_11n_rxreorder.h" +#include "mlan_11ax.h" #ifdef DRV_EMBEDDED_SUPPLICANT #include "authenticator_api.h" #endif @@ -314,12 +315,14 @@ void wlan_process_tdls_action_frame(pmlan_private priv, t_u8 *pbuf, t_u32 len) break; case QOS_INFO: sta_ptr->qos_info = pos[2]; + sta_ptr->is_wmm_enabled = MTRUE; PRINTM(MDAT_D, "TDLS qos info %x\n", sta_ptr->qos_info); break; case VENDOR_SPECIFIC_221: pvendor_ie = (IEEEtypes_VendorHeader_t *)pos; if (!memcmp(priv->adapter, pvendor_ie->oui, wmm_oui, sizeof(wmm_oui))) { + sta_ptr->is_wmm_enabled = MTRUE; sta_ptr->qos_info = pos[8]; /** qos info in wmm parameters in response and @@ -812,7 +815,8 @@ mlan_status wlan_ops_sta_process_rx_packet(t_void *adapter, pmlan_buffer pmbuf) prx_pd->nf); } } - if (!sta_ptr || !sta_ptr->is_11n_enabled) { + if (!sta_ptr || (!sta_ptr->is_11n_enabled && + !sta_ptr->is_11ax_enabled)) { wlan_process_rx_packet(pmadapter, pmbuf); goto done; } diff --git a/mxm_wifiex/wlan_src/mlan/mlan_uap_cmdevent.c b/mxm_wifiex/wlan_src/mlan/mlan_uap_cmdevent.c index 8d9b7fb..6ab930a 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_uap_cmdevent.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_uap_cmdevent.c @@ -2505,6 +2505,8 @@ static mlan_status wlan_uap_ret_sys_config(pmlan_private pmpriv, MrvlIEtypes_uap_max_sta_cnt_t *tlv_uap_max_sta = MNULL; ENTER(); + sys_config->action = wlan_le16_to_cpu(sys_config->action); + if (pioctl_buf) { if (pioctl_buf->req_id == MLAN_IOCTL_BSS) { bss = (mlan_ds_bss *)pioctl_buf->pbuf; @@ -2801,8 +2803,11 @@ static mlan_status wlan_uap_ret_sys_config(pmlan_private pmpriv, } else { /* no ioctl: driver generated get/set */ switch (wlan_le16_to_cpu(tlv->header.type)) { case TLV_TYPE_UAP_MAC_ADDRESS: - memcpy_ext(pmpriv->adapter, pmpriv->curr_addr, tlv->mac, - MLAN_MAC_ADDR_LENGTH, MLAN_MAC_ADDR_LENGTH); + if (sys_config->action == HostCmd_ACT_GEN_SET) { + memcpy_ext(pmpriv->adapter, pmpriv->curr_addr, + tlv->mac, MLAN_MAC_ADDR_LENGTH, + MLAN_MAC_ADDR_LENGTH); + } break; case TLV_TYPE_UAP_MAX_STA_CNT_PER_CHIP: tlv_uap_max_sta = (MrvlIEtypes_uap_max_sta_cnt_t *)tlv; @@ -2959,6 +2964,12 @@ static mlan_status wlan_uap_cmd_snmp_mib(pmlan_private pmpriv, psnmp_mib->oid = wlan_cpu_to_le16((t_u16)cmd_oid); psnmp_mib->buf_size = 0; break; + case ChanTrackParam_i: + psnmp_mib->oid = wlan_cpu_to_le16((t_u16)cmd_oid); + psnmp_mib->buf_size = wlan_cpu_to_le16(sizeof(t_u8)); + psnmp_mib->value[0] = *((t_u8 *)pdata_buf); + cmd->size += sizeof(t_u8); + break; default: PRINTM(MERROR, "Unsupported OID.\n"); ret = MLAN_STATUS_FAILURE; @@ -4426,7 +4437,7 @@ static mlan_status wlan_uap_cmd_add_station(pmlan_private pmpriv, } for (i = 0; i < MAX_NUM_TID; i++) { - if (sta_ptr->is_11n_enabled) + if (sta_ptr->is_11n_enabled || sta_ptr->is_11ax_enabled) sta_ptr->ampdu_sta[i] = pmpriv->aggr_prio_tbl[i].ampdu_user; else @@ -4440,6 +4451,81 @@ done: return MLAN_STATUS_SUCCESS; } +/** + * @brief This function prepares command of per peer stats + * + * @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 + */ +static mlan_status wlan_cmd_stats(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd, + t_u16 cmd_action, t_void *pdata_buf) +{ + HostCmd_DS_STATS *stats_cmd = (HostCmd_DS_STATS *)&cmd->params.stats; + Stats_Cfg_Params_TLV_t *cfg_param = MNULL; + mlan_ds_stats *stats = (mlan_ds_stats *)pdata_buf; + Stats_Cfg_Params_TLV_t *stats_param = MNULL; + + ENTER(); + cmd->command = wlan_cpu_to_le16(HostCmd_CMD_802_11_STATS); + cmd->size = wlan_cpu_to_le16(sizeof(HostCmd_DS_STATS) + S_DS_GEN); + if (cmd_action) { + cmd->size = + wlan_cpu_to_le16(sizeof(HostCmd_DS_STATS) + S_DS_GEN + + sizeof(Stats_Cfg_Params_TLV_t) - 1); + stats_cmd->action = wlan_cpu_to_le16(HostCmd_ACT_GEN_SET); + + stats_param = (Stats_Cfg_Params_TLV_t *)stats->tlv_buf; + if (stats_param->tlvHeader.type == + NXP_802_11_PER_PEER_STATS_CFG_TLV_ID) { + cfg_param = + (Stats_Cfg_Params_TLV_t *)stats_cmd->tlv_buffer; + *cfg_param = *stats_param; + } + } else { + cmd->size = + wlan_cpu_to_le16(sizeof(HostCmd_DS_STATS) + S_DS_GEN); + stats_cmd->action = wlan_cpu_to_le16(HostCmd_ACT_GEN_GET); + } + LEAVE(); + return MLAN_STATUS_SUCCESS; +} + +/** + * @brief This function handles the command response of stats + * + * @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 + */ +static mlan_status wlan_ret_stats(pmlan_private pmpriv, + HostCmd_DS_COMMAND *resp, + mlan_ioctl_req *pioctl_buf) +{ + HostCmd_DS_STATS *cfg_cmd = (HostCmd_DS_STATS *)&resp->params.stats; + mlan_ds_misc_cfg *misc_cfg = MNULL; + t_u8 *pBuf = (t_u8 *)&cfg_cmd->tlv_buffer; + int len = resp->size; + + ENTER(); + if (pioctl_buf) { + misc_cfg = (mlan_ds_misc_cfg *)pioctl_buf->pbuf; + len -= (S_DS_GEN + sizeof(t_u16)); + memcpy_ext(pmpriv->adapter, + (t_u8 *)&misc_cfg->param.stats.tlv_buf, pBuf, len, + len); + misc_cfg->param.stats.tlv_len = len; + pioctl_buf->buf_len = sizeof(mlan_ds_stats) + len - 1; + } + + LEAVE(); + return MLAN_STATUS_SUCCESS; +} + /******************************************************** Global Functions ********************************************************/ @@ -4825,6 +4911,9 @@ mlan_status wlan_ops_uap_prepare_cmd(t_void *priv, t_u16 cmd_no, ret = wlan_cmd_mc_aggr_cfg(pmpriv, cmd_ptr, cmd_action, pdata_buf); break; + case HostCmd_CMD_802_11_STATS: + ret = wlan_cmd_stats(pmpriv, cmd_ptr, cmd_action, pdata_buf); + break; case HostCmd_CMD_GET_CH_LOAD: ret = wlan_cmd_get_ch_load(pmpriv, cmd_ptr, cmd_action, pdata_buf); @@ -5219,6 +5308,9 @@ mlan_status wlan_ops_uap_process_cmdresp(t_void *priv, t_u16 cmdresp_no, case HostCmd_CMD_MC_AGGR_CFG: ret = wlan_ret_mc_aggr_cfg(pmpriv, resp, pioctl_buf); break; + case HostCmd_CMD_802_11_STATS: + ret = wlan_ret_stats(pmpriv, resp, pioctl_buf); + break; case HostCmd_CMD_GET_CH_LOAD: ret = wlan_ret_ch_load(pmpriv, resp, pioctl_buf); break; @@ -5311,6 +5403,22 @@ mlan_status wlan_ops_uap_process_event(t_void *priv) MNULL); } #endif + if (wlan_11h_radar_detect_required(pmpriv, + pmpriv->uap_channel)) { + if (!wlan_11h_is_active(pmpriv)) { + /* active 11h extention in Fw */ + ret = wlan_11h_activate(pmpriv, MNULL, MTRUE); + ret = wlan_11h_config_master_radar_det(pmpriv, + MTRUE); + ret = wlan_11h_check_update_radar_det_state( + pmpriv); + } + if (pmpriv->uap_host_based && + !pmpriv->adapter->init_para.dfs_offload) + pmpriv->intf_state_11h.is_11h_host = MTRUE; + wlan_11h_set_dfs_check_chan(pmpriv, + pmpriv->uap_channel); + } break; case EVENT_MICRO_AP_BSS_ACTIVE: PRINTM(MEVENT, "EVENT: MICRO_AP_BSS_ACTIVE\n"); @@ -5365,14 +5473,15 @@ mlan_status wlan_ops_uap_process_event(t_void *priv) MAC2STR(sta_addr)); if (!sta_ptr) break; - if (pmpriv->is_11n_enabled + if (pmpriv->is_11n_enabled || pmpriv->is_11ax_enabled #ifdef DRV_EMBEDDED_AUTHENTICATOR || IsAuthenticatorEnabled(pmpriv->psapriv) #endif ) { wlan_check_sta_capability(pmpriv, pmbuf, sta_ptr); for (i = 0; i < MAX_NUM_TID; i++) { - if (sta_ptr->is_11n_enabled) + if (sta_ptr->is_11n_enabled || + sta_ptr->is_11ax_enabled) sta_ptr->ampdu_sta[i] = pmpriv->aggr_prio_tbl[i] .ampdu_user; @@ -5404,10 +5513,11 @@ mlan_status wlan_ops_uap_process_event(t_void *priv) wlan_recv_event(pmpriv, pevent->event_id, pevent); memcpy_ext(pmadapter, sta_addr, pmadapter->event_body + 2, MLAN_MAC_ADDR_LENGTH, MLAN_MAC_ADDR_LENGTH); + sta_ptr = wlan_get_station_entry(pmpriv, sta_addr); PRINTM_NETINTF(MMSG, pmpriv); PRINTM(MMSG, "wlan: EVENT: MICRO_AP_STA_DEAUTH " MACSTR "\n", MAC2STR(sta_addr)); - if (pmpriv->is_11n_enabled) { + if (pmpriv->is_11n_enabled || pmpriv->is_11ax_enabled) { wlan_cleanup_reorder_tbl(pmpriv, sta_addr); wlan_11n_cleanup_txbastream_tbl(pmpriv, sta_addr); } @@ -5620,7 +5730,8 @@ mlan_status wlan_ops_uap_process_event(t_void *priv) ret = wlan_11h_check_update_radar_det_state( pmpriv); } - if (pmpriv->uap_host_based) + if (pmpriv->uap_host_based && + !pmpriv->adapter->init_para.dfs_offload) pmpriv->intf_state_11h.is_11h_host = MTRUE; wlan_11h_set_dfs_check_chan(pmpriv, pchan_info->channel); diff --git a/mxm_wifiex/wlan_src/mlan/mlan_uap_ioctl.c b/mxm_wifiex/wlan_src/mlan/mlan_uap_ioctl.c index 98d5aa4..73cc0a0 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_uap_ioctl.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_uap_ioctl.c @@ -1462,7 +1462,7 @@ static mlan_status wlan_uap_callback_11h_channel_check_req(t_void *priv) if (dfs_state == DFS_AVAILABLE) { wlan_11h_set_dfs_check_chan( pmpriv, puap_state_chan_cb->channel); - PRINTM(MCMND, "ZERODFS: Channel %d is Avaliable\n", + PRINTM(MCMND, "DFS: Channel %d is Avaliable\n", puap_state_chan_cb->channel); pcb->moal_ioctl_complete(pmpriv->adapter->pmoal_handle, pioctl, MLAN_STATUS_COMPLETE); @@ -1832,6 +1832,39 @@ mlan_status wlan_uap_get_beacon_dtim(pmlan_private pmpriv) return ret; } +/** + * @brief Get/Start/Stop/Reset stats + * + * @param pmadapter A pointer to mlan_adapter structure + * @param pioctl_req A pointer to ioctl request buffer + * + * @return MLAN_STATUS_PENDING --success, otherwise fail + */ +static mlan_status wlan_misc_ioctl_stats(pmlan_adapter pmadapter, + mlan_ioctl_req *pioctl_req) +{ + mlan_private *pmpriv = pmadapter->priv[pioctl_req->bss_index]; + mlan_status ret = MLAN_STATUS_SUCCESS; + t_u16 cmd_action = 0; + mlan_ds_misc_cfg *misc = MNULL; + + ENTER(); + + misc = (mlan_ds_misc_cfg *)pioctl_req->pbuf; + cmd_action = pioctl_req->action; + + /* Send request to firmware */ + ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_802_11_STATS, cmd_action, 0, + (t_void *)pioctl_req, + (t_void *)&misc->param.stats); + + if (ret == MLAN_STATUS_SUCCESS) + ret = MLAN_STATUS_PENDING; + + LEAVE(); + return ret; +} + /** * @brief Set/Get deauth control. * @@ -1869,6 +1902,43 @@ static mlan_status wlan_uap_snmp_mib_ctrl_deauth(pmlan_adapter pmadapter, return ret; } +/** + * @brief Set/Get channel tracking control. + * + * @param pmadapter A pointer to mlan_adapter structure + * @param pioctl_req A pointer to ioctl request buffer + * + * @return MLAN_STATUS_PENDING --success, otherwise fail + */ +static mlan_status wlan_uap_snmp_mib_chan_track(pmlan_adapter pmadapter, + pmlan_ioctl_req pioctl_req) +{ + mlan_private *pmpriv = pmadapter->priv[pioctl_req->bss_index]; + mlan_status ret = MLAN_STATUS_SUCCESS; + mlan_ds_snmp_mib *mib = (mlan_ds_snmp_mib *)pioctl_req->pbuf; + t_u16 cmd_action = 0; + + ENTER(); + + mib = (mlan_ds_snmp_mib *)pioctl_req->pbuf; + if (pioctl_req->action == MLAN_ACT_SET) { + cmd_action = HostCmd_ACT_GEN_SET; + } else { + cmd_action = HostCmd_ACT_GEN_GET; + } + + /* Send command to firmware */ + ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_802_11_SNMP_MIB, cmd_action, + ChanTrackParam_i, (t_void *)pioctl_req, + &mib->param.chan_track); + + if (ret == MLAN_STATUS_SUCCESS) + ret = MLAN_STATUS_PENDING; + + LEAVE(); + return ret; +} + /** * @brief MLAN uap ioctl handler * @@ -2065,6 +2135,8 @@ mlan_status wlan_ops_uap_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req) pget_info->param.fw_info.antinfo = pmadapter->antinfo; pget_info->param.fw_info.max_ap_assoc_sta = pmadapter->max_sta_conn; + pget_info->param.fw_info.uuid_lo = pmadapter->uuid_lo; + pget_info->param.fw_info.uuid_hi = pmadapter->uuid_hi; } else if (pget_info->sub_command == MLAN_OID_LINK_STATS) status = wlan_ioctl_link_statistic(pmpriv, pioctl_req); break; @@ -2139,8 +2211,13 @@ mlan_status wlan_ops_uap_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req) if (misc->sub_command == MLAN_OID_MISC_MC_AGGR_CFG) status = wlan_misc_ioctl_mc_aggr_cfg(pmadapter, pioctl_req); + if (misc->sub_command == MLAN_OID_MISC_STATS) + status = wlan_misc_ioctl_stats(pmadapter, pioctl_req); if (misc->sub_command == MLAN_OID_MISC_CH_LOAD) status = wlan_misc_ioctl_ch_load(pmadapter, pioctl_req); + if (misc->sub_command == MLAN_OID_MISC_CH_LOAD_RESULTS) + status = wlan_misc_ioctl_ch_load_results(pmadapter, + pioctl_req); if (misc->sub_command == MLAN_OID_MISC_GET_TSF) status = wlan_misc_ioctl_get_tsf(pmadapter, pioctl_req); if (misc->sub_command == MLAN_OID_MISC_GET_CHAN_REGION_CFG) @@ -2249,6 +2326,9 @@ mlan_status wlan_ops_uap_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req) if (snmp->sub_command == MLAN_OID_SNMP_MIB_DOT11H_FAKERADAR) status = wlan_uap_snmp_mib_11h_fakeradar(pmadapter, pioctl_req); + if (snmp->sub_command == MLAN_OID_SNMP_MIB_CHAN_TRACK) + status = wlan_uap_snmp_mib_chan_track(pmadapter, + pioctl_req); break; case MLAN_IOCTL_SEC_CFG: sec = (mlan_ds_sec_cfg *)pioctl_req->pbuf; diff --git a/mxm_wifiex/wlan_src/mlan/mlan_uap_txrx.c b/mxm_wifiex/wlan_src/mlan/mlan_uap_txrx.c index 402833f..1784f58 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_uap_txrx.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_uap_txrx.c @@ -481,7 +481,7 @@ mlan_status wlan_ops_uap_process_rx_packet(t_void *adapter, pmlan_buffer pmbuf) } } /* check if UAP enable 11n */ - if (!priv->is_11n_enabled || + if ((!priv->is_11n_enabled && !priv->is_11ax_enabled) || (!wlan_11n_get_rxreorder_tbl((mlan_private *)priv, prx_pd->priority, ta) && (prx_pd->rx_pkt_type != PKT_TYPE_AMSDU))) { diff --git a/mxm_wifiex/wlan_src/mlan/mlan_wmm.c b/mxm_wifiex/wlan_src/mlan/mlan_wmm.c index e8750f5..72dc5eb 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_wmm.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_wmm.c @@ -43,6 +43,7 @@ Change log: #include "mlan_main.h" #include "mlan_wmm.h" #include "mlan_11n.h" +#include "mlan_11ax.h" #ifdef SDIO #include "mlan_sdio.h" #endif /* SDIO */ @@ -1651,6 +1652,47 @@ void wlan_wmm_setup_ac_downgrade(pmlan_private priv) LEAVE(); } +/** + * @brief This function checks whether a station has WMM enabled or not + * + * @param priv A pointer to mlan_private + * @param mac station mac address + * @return MTRUE or MFALSE + */ +static t_u8 is_station_wmm_enabled(mlan_private *priv, t_u8 *mac) +{ + sta_node *sta_ptr = MNULL; + sta_ptr = wlan_get_station_entry(priv, mac); + if (sta_ptr) { + if (sta_ptr->is_11n_enabled || sta_ptr->is_11ax_enabled) + return MTRUE; + } + return MFALSE; +} + +/** + * @brief This function checks whether wmm is supported + * + * @param priv A pointer to mlan_private + * @param ra Address of the receiver STA + * + * @return MTRUE or MFALSE + */ +static int wlan_is_wmm_enabled(mlan_private *priv, t_u8 *ra) +{ + int ret = MFALSE; + ENTER(); +#ifdef UAP_SUPPORT + if (GET_BSS_ROLE(priv) == MLAN_BSS_ROLE_UAP) { + if ((!(ra[0] & 0x01)) && + (priv->is_11n_enabled || priv->is_11ax_enabled)) + ret = is_station_wmm_enabled(priv, ra); + } +#endif /* UAP_SUPPORT */ + LEAVE(); + return ret; +} + /** * @brief Allocate and add a RA list for all TIDs with the given RA * @@ -1677,7 +1719,7 @@ void wlan_ralist_add(mlan_private *priv, t_u8 *ra) ra_list->ba_status = BA_STREAM_NOT_SETUP; ra_list->amsdu_in_ampdu = MFALSE; if (queuing_ra_based(priv)) { - ra_list->is_wmm_enabled = wlan_is_11n_enabled(priv, ra); + ra_list->is_wmm_enabled = wlan_is_wmm_enabled(priv, ra); if (ra_list->is_wmm_enabled) ra_list->max_amsdu = get_station_max_amsdu_size(priv, ra); @@ -1688,7 +1730,7 @@ void wlan_ralist_add(mlan_private *priv, t_u8 *ra) status = wlan_get_tdls_link_status(priv, ra); if (MTRUE == wlan_is_tdls_link_setup(status)) { ra_list->is_wmm_enabled = - is_station_11n_enabled(priv, ra); + is_station_wmm_enabled(priv, ra); if (ra_list->is_wmm_enabled) ra_list->max_amsdu = get_station_max_amsdu_size(priv, @@ -2018,7 +2060,7 @@ int wlan_ralist_update(mlan_private *priv, t_u8 *old_ra, t_u8 *new_ra) if (queuing_ra_based(priv)) { ra_list->is_wmm_enabled = - wlan_is_11n_enabled(priv, new_ra); + wlan_is_wmm_enabled(priv, new_ra); if (ra_list->is_wmm_enabled) ra_list->max_amsdu = get_station_max_amsdu_size( @@ -2356,13 +2398,11 @@ mlan_status wlan_ret_wmm_get_status(pmlan_private priv, t_u8 *ptlv, * @param ppassoc_buf Output parameter: Pointer to the TLV output buffer, * modified on return to point after the appended WMM TLV * @param pwmm_ie Pointer to the WMM IE for the BSS we are joining - * @param pht_cap Pointer to the HT IE for the BSS we are joining * * @return Length of data appended to the association tlv buffer */ t_u32 wlan_wmm_process_association_req(pmlan_private priv, t_u8 **ppassoc_buf, - IEEEtypes_WmmParameter_t *pwmm_ie, - IEEEtypes_HTCap_t *pht_cap) + IEEEtypes_WmmParameter_t *pwmm_ie) { MrvlIEtypes_WmmParamSet_t *pwmm_tlv; t_u32 ret_len = 0; @@ -2387,10 +2427,7 @@ t_u32 wlan_wmm_process_association_req(pmlan_private priv, t_u8 **ppassoc_buf, PRINTM(MINFO, "WMM: process assoc req: bss->wmmIe=0x%x\n", pwmm_ie->vend_hdr.element_id); - if ((priv->wmm_required || - (pht_cap && (pht_cap->ieee_hdr.element_id == HT_CAPABILITY) && - (priv->config_bands & BAND_GN || priv->config_bands & BAND_AN))) && - pwmm_ie->vend_hdr.element_id == WMM_IE) { + if (priv->wmm_required && pwmm_ie->vend_hdr.element_id == WMM_IE) { pwmm_tlv = (MrvlIEtypes_WmmParamSet_t *)*ppassoc_buf; pwmm_tlv->header.type = (t_u16)wmm_info_ie[0]; pwmm_tlv->header.type = wlan_cpu_to_le16(pwmm_tlv->header.type); diff --git a/mxm_wifiex/wlan_src/mlan/mlan_wmm.h b/mxm_wifiex/wlan_src/mlan/mlan_wmm.h index a45c5cd..5ac76bf 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_wmm.h +++ b/mxm_wifiex/wlan_src/mlan/mlan_wmm.h @@ -175,8 +175,7 @@ mlan_status wlan_ret_wmm_param_config(pmlan_private pmpriv, /** Process WMM association request */ extern t_u32 wlan_wmm_process_association_req(pmlan_private priv, t_u8 **ppAssocBuf, - IEEEtypes_WmmParameter_t *pWmmIE, - IEEEtypes_HTCap_t *pHTCap); + IEEEtypes_WmmParameter_t *pWmmIE); #endif /* STA_SUPPORT */ /** setup wmm queue priorities */ diff --git a/mxm_wifiex/wlan_src/mlinux/mlan_decl.h b/mxm_wifiex/wlan_src/mlinux/mlan_decl.h index e1f35b9..23e533c 100644 --- a/mxm_wifiex/wlan_src/mlinux/mlan_decl.h +++ b/mxm_wifiex/wlan_src/mlinux/mlan_decl.h @@ -33,7 +33,7 @@ #define _MLAN_DECL_H_ /** MLAN release version */ -#define MLAN_RELEASE_VERSION "322.p3" +#define MLAN_RELEASE_VERSION "344.p1" /** Re-define generic data types for MLAN/MOAL */ /** Signed char (1-byte) */ @@ -441,7 +441,7 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH]; /** SD8977 Card */ #define CARD_SD8977 "SD8977" /** SD8978 Card */ -#define CARD_SD8978 "SD8978" +#define CARD_SD8978 "SDIW416" /** SD8997 Card */ #define CARD_SD8997 "SD8997" /** SD8987 Card */ @@ -451,7 +451,7 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH]; /** SD9098 Card */ #define CARD_SD9098 "SD9098" /** SD9177 Card */ -#define CARD_SD9177 "SD9177" +#define CARD_SD9177 "SDIW612" /** SD8801 Card */ #define CARD_SD8801 "SD8801" /** SDNW62X Card */ @@ -490,6 +490,8 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH]; #define CARD_PCIEAW690 "PCIEAW690" /** PCIENW62X Card */ #define CARD_PCIENW62X "PCIENW62X" +/** PCIEIW629 Card */ +#define CARD_PCIEIW629 "PCIEIW629" #endif #ifdef USB @@ -523,7 +525,7 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH]; /** USB8997 Card */ #define CARD_USB8997 "USB8997" /** USB8978 Card */ -#define CARD_USB8978 "USB8978" +#define CARD_USB8978 "USBIW416" /** USB9098 Card */ #define CARD_USB9098 "USB9098" /** USB9097 Card */ @@ -699,6 +701,18 @@ typedef enum _mlan_buf_type { #endif } mlan_buf_type; +#define SCAN_STATE_SCAN_START MBIT(0) +#define SCAN_STATE_EXT_SCAN MBIT(1) +#define SCAN_STATE_EXT_SCAN_ENH MBIT(2) +#define SCAN_STATE_EXT_SCAN_CANCEL MBIT(3) +#define SCAN_STATE_EXT_SCAN_CMDRESP MBIT(4) +#define SCAN_STATE_EXT_SCAN_ENH_CMDRESP MBIT(5) +#define SCAN_STATE_EXT_SCAN_CANCEL_CMDRESP MBIT(6) +#define SCAN_STATE_EXT_SCAN_RESULT MBIT(7) +#define SCAN_STATE_LAST_EXT_SCAN_RESULT MBIT(8) +#define SCAN_STATE_EXT_SCAN_STATUS MBIT(9) +#define SCAN_STATE_SCAN_COMPLETE MBIT(10) + #ifdef USB /** mlan_usb_ep */ typedef enum _mlan_usb_ep { @@ -905,8 +919,8 @@ enum mlan_channel_type { /** channel band */ enum { BAND_2GHZ = 0, BAND_5GHZ = 1, - BAND_4GHZ = 2, - BAND_6GHZ = 3, + BAND_6GHZ = 2, + BAND_4GHZ = 3, }; /** channel offset */ @@ -2300,8 +2314,12 @@ typedef struct _mlan_device { t_u32 drv_mode; /** dfs w53 cfg */ t_u8 dfs53cfg; + /** dfs_offload */ + t_u8 dfs_offload; /** extend enhance scan */ t_u8 ext_scan; + /* mcs32 setting */ + t_u8 mcs32; } mlan_device, *pmlan_device; /** MLAN API function prototype */ diff --git a/mxm_wifiex/wlan_src/mlinux/mlan_ieee.h b/mxm_wifiex/wlan_src/mlinux/mlan_ieee.h index 3f37d67..3edee2d 100644 --- a/mxm_wifiex/wlan_src/mlinux/mlan_ieee.h +++ b/mxm_wifiex/wlan_src/mlinux/mlan_ieee.h @@ -1225,8 +1225,10 @@ typedef MLAN_PACK_START struct _IEEEtypes_HeOpParam_t { t_u16 co_located_bss : 1; /* bit 15 */ /** ER SU Disable */ t_u8 er_su_disable : 1; /* bit 16 */ - /** Reserved, including 6G Operation Info Pressent (bit17) */ - t_u8 reserved : 7; /* bit 17-23 */ + /* 6g operation info present */ + t_u8 he_6g_op_info_present : 1; /* bit 17 */ + /** Reserved bit 18-23 */ + t_u8 reserved : 6; /* bit 18-23 */ } MLAN_PACK_END IEEEtypes_HeOpParam_t; typedef MLAN_PACK_START struct _IEEEtypes_HeBssColorInfo_t { @@ -1666,7 +1668,10 @@ typedef MLAN_PACK_START struct { /**wait for all channel scan to complete to report scan result*/ #define BG_SCAN_WAIT_ALL_CHAN_DONE 0x80000000 /** Maximum number of channels that can be sent in bg scan config */ -#define WLAN_BG_SCAN_CHAN_MAX 38 +#define CHAN_MAX_24G 14 +#define CHAN_MAX_5G 24 +#define CHAN_MAX_UNII4 3 +#define WLAN_BG_SCAN_CHAN_MAX (CHAN_MAX_24G + CHAN_MAX_5G + CHAN_MAX_UNII4) /** Enumeration definition */ /** EES MODE */ diff --git a/mxm_wifiex/wlan_src/mlinux/mlan_ioctl.h b/mxm_wifiex/wlan_src/mlinux/mlan_ioctl.h index eb051af..7eecd41 100644 --- a/mxm_wifiex/wlan_src/mlinux/mlan_ioctl.h +++ b/mxm_wifiex/wlan_src/mlinux/mlan_ioctl.h @@ -369,6 +369,8 @@ enum _mlan_ioctl_req_id { MLAN_OID_MISC_IPS_CFG = 0x00200085, MLAN_OID_MISC_MC_AGGR_CFG = 0x00200086, MLAN_OID_MISC_CH_LOAD = 0x00200087, + MLAN_OID_MISC_STATS = 0x00200088, + MLAN_OID_MISC_CH_LOAD_RESULTS = 0x00200089, }; /** Sub command size */ @@ -1887,11 +1889,20 @@ typedef struct _mlan_fw_info { t_u8 prohibit_80mhz; /** FW support beacon protection */ t_u8 fw_beacon_prot; + + /* lower 8 bytes of uuid */ + t_u64 uuid_lo; + + /* higher 8 bytes of uuid */ + t_u64 uuid_hi; } mlan_fw_info, *pmlan_fw_info; /** Version string buffer length */ #define MLAN_MAX_VER_STR_LEN 128 +/** Maximum length of secure boot uuid */ +#define MLAN_MAX_UUID_LEN 32 + /** mlan_ver_ext data structure for MLAN_OID_GET_VER_EXT */ typedef struct _mlan_ver_ext { /** Selected version string */ @@ -2009,7 +2020,7 @@ typedef struct _mlan_bss_info { /** Channel */ t_u32 bss_chan; /** Band */ - t_u8 bss_band; + t_u16 bss_band; /** Region code */ t_u32 region_code; /** Connection status */ @@ -2201,6 +2212,8 @@ typedef struct _mlan_debug_info { t_u32 bypass_pkt_count; /** Corresponds to scan_processing member of mlan_adapter */ t_u32 scan_processing; + /** Corresponds to scan_state member of mlan_adapter */ + t_u32 scan_state; /** Corresponds to mlan_processing member of mlan_adapter */ t_u32 mlan_processing; /** Corresponds to main_lock_flag member of mlan_adapter */ @@ -4434,6 +4447,9 @@ typedef struct _mlan_ds_misc_cck_desense_cfg { #define MLAN_IPADDR_OP_ARP_FILTER MBIT(0) /** IP operation ARP response */ #define MLAN_IPADDR_OP_AUTO_ARP_RESP MBIT(1) +/** Enable opcode bit for MDNS & NS when device enter into suspend **/ +#define MLAN_OP_ADD_MDNS MBIT(2) +#define MLAN_OP_ADD_IPV6_NS MBIT(3) /** Type definition of mlan_ds_misc_ipaddr_cfg for MLAN_OID_MISC_IP_ADDR */ typedef struct _mlan_ds_misc_ipaddr_cfg { @@ -5501,10 +5517,23 @@ typedef struct _mlan_ds_mc_aggr_cfg { /** CTS2Self duration offset */ t_u16 cts2self_offset; } mlan_ds_mc_aggr_cfg; + +/** mlan_ds_stats */ +typedef struct _mlan_ds_stats { + /** action */ + t_u16 action; + /** tlv len */ + t_u16 tlv_len; + /** TLV buffer */ + t_u8 tlv_buf[1]; +} mlan_ds_stats; + typedef struct _mlan_ds_ch_load { /** action */ t_u8 action; t_u16 ch_load_param; + t_s16 noise; + t_u16 duration; } mlan_ds_ch_load; /** Type definition of mlan_ds_misc_cfg for MLAN_IOCTL_MISC_CFG */ @@ -5649,6 +5678,7 @@ typedef struct _mlan_ds_misc_cfg { mlan_ds_misc_tp_state tp_state; mlan_ds_hal_phy_cfg_params hal_phy_cfg_params; mlan_ds_mc_aggr_cfg mc_aggr_cfg; + mlan_ds_stats stats; #ifdef UAP_SUPPORT t_u8 wacp_mode; #endif diff --git a/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c b/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c index 99bb668..2f76c1b 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c @@ -175,6 +175,11 @@ extern const struct net_device_ops woal_netdev_ops; /******************************************************** * Global Functions ********************************************************/ +#ifdef UAP_SUPPORT +#if CFG80211_VERSION_CODE < KERNEL_VERSION(4, 20, 0) +int woal_11ax_cfg(moal_private *priv, t_u8 action, mlan_ds_11ax_he_cfg *he_cfg); +#endif +#endif /** * @brief Get the private structure from wiphy @@ -293,6 +298,32 @@ t_u8 woal_band_cfg_to_ieee_band(t_u32 band) return ret_radio_type; } +/** + * @brief Convert IEEE band type to radio_type + * + * @param ieeeband IEEE band + * + * @return radio_type + */ +t_u8 woal_ieee_band_to_radio_type(t_u8 ieee_band) +{ + t_u8 radio_type = 0; + + ENTER(); + + switch (ieee_band) { + case IEEE80211_BAND_5GHZ: + radio_type = BAND_5GHZ; + break; + case IEEE80211_BAND_2GHZ: + default: + radio_type = BAND_2GHZ; + break; + } + LEAVE(); + return radio_type; +} + /** * @brief Set/Enable encryption key * @@ -2411,6 +2442,8 @@ void woal_cfg80211_mgmt_frame_register(struct wiphy *wiphy, LEAVE(); } +#ifdef UAP_CFG80211 +#if KERNEL_VERSION(3, 12, 0) <= CFG80211_VERSION_CODE /* * @brief prepare and send WOAL_EVENT_CANCEL_CHANRPT * @@ -2431,17 +2464,15 @@ static void woal_cancel_chanrpt_event(moal_private *priv) return; } evt->priv = priv; -#ifdef UAP_CFG80211 -#if KERNEL_VERSION(3, 12, 0) <= CFG80211_VERSION_CODE evt->type = WOAL_EVENT_CANCEL_CHANRPT; -#endif -#endif INIT_LIST_HEAD(&evt->link); spin_lock_irqsave(&handle->evt_lock, flags); list_add_tail(&evt->link, &handle->evt_queue); spin_unlock_irqrestore(&handle->evt_lock, flags); queue_work(handle->evt_workqueue, &handle->evt_work); } +#endif +#endif #if KERNEL_VERSION(3, 2, 0) <= CFG80211_VERSION_CODE #if KERNEL_VERSION(3, 3, 0) <= CFG80211_VERSION_CODE @@ -2646,11 +2677,13 @@ int woal_cfg80211_mgmt_tx(struct wiphy *wiphy, woal_cancel_chanrpt_event(priv); #endif #endif +#ifdef UAP_SUPPORT if (!priv->bss_started) { PRINTM(MCMND, "Drop deauth packet before AP started\n"); goto done; } +#endif PRINTM(MMSG, "wlan: HostMlme %s send deauth/disassoc\n", priv->netdev->name); @@ -3369,6 +3402,7 @@ static t_u16 woal_filter_beacon_ies(moal_private *priv, const t_u8 *ie, int len, case HT_OPERATION: case VHT_CAPABILITY: case VHT_OPERATION: +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) if (moal_extflg_isset(priv->phandle, EXT_HOST_MLME)) { if ((out_len + length + 2) < (int)ie_out_len) { moal_memcpy_ext(priv->phandle, @@ -3381,6 +3415,7 @@ 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"); } } +#endif break; case EXTENDED_SUPPORTED_RATES: case WLAN_EID_ERP_INFO: @@ -3393,11 +3428,14 @@ 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) && - !moal_extflg_isset(priv->phandle, EXT_HOST_MLME)) + if ((ext_id == HE_CAPABILITY || ext_id == HE_OPERATION) +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) + && !moal_extflg_isset(priv->phandle, EXT_HOST_MLME) +#endif + ) break; else { +#ifdef UAP_SUPPORT #if CFG80211_VERSION_CODE < KERNEL_VERSION(4, 20, 0) if (ext_id == HE_CAPABILITY) { mlan_ds_11ax_he_cfg he_cfg; @@ -3440,6 +3478,7 @@ static t_u16 woal_filter_beacon_ies(moal_private *priv, const t_u8 *ie, int len, "Fail to get 11ax he_cap parameters\n"); } } else +#endif #endif { if ((out_len + length + 2) < @@ -4172,14 +4211,14 @@ struct ieee80211_supported_band *woal_setup_wiphy_bands(t_u8 ieee_band) sizeof(struct ieee80211_supported_band), GFP_KERNEL); if (!band) { - PRINTM(MERROR, "No memory for band\n"); + PRINTM(MERROR, "No memory for 5g band\n"); break; } band->channels = kmemdup(&cfg80211_channels_5ghz, sizeof(cfg80211_channels_5ghz), GFP_KERNEL); if (!band->channels) { - PRINTM(MERROR, "No memory for band->channel\n"); + PRINTM(MERROR, "No memory for 5g band->channel\n"); kfree(band); band = NULL; break; @@ -4192,14 +4231,14 @@ struct ieee80211_supported_band *woal_setup_wiphy_bands(t_u8 ieee_band) sizeof(struct ieee80211_supported_band), GFP_KERNEL); if (!band) { - PRINTM(MERROR, "No memory for band\n"); + PRINTM(MERROR, "No memory for 2g band\n"); break; } band->channels = kmemdup(&cfg80211_channels_2ghz, sizeof(cfg80211_channels_2ghz), GFP_KERNEL); if (!band->channels) { - PRINTM(MERROR, "No memory for band->channel\n"); + PRINTM(MERROR, "No memory for 2g band->channel\n"); kfree(band); band = NULL; break; @@ -4596,6 +4635,7 @@ void woal_cfg80211_free_bands(struct wiphy *wiphy) } } +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) /* * @brief prepare and send fake deauth packet to cfg80211 to * notify wpa_supplicant about disconnection @@ -4627,6 +4667,7 @@ void woal_deauth_event(moal_private *priv, int reason_code) spin_unlock_irqrestore(&handle->evt_lock, flags); queue_work(handle->evt_workqueue, &handle->evt_work); } +#endif #ifdef STA_CFG80211 #if KERNEL_VERSION(3, 2, 0) <= CFG80211_VERSION_CODE @@ -4675,27 +4716,6 @@ void woal_cfg80211_notify_sched_scan_stop(moal_private *priv) PRINTM(MEVENT, "Notify sched scan stopped\n"); } -/** - * @brief sched_scan work handler - * - * @param work a pointer to work_struct - * - * @return 0 -- success, otherwise fail - */ -void woal_sched_scan_work_queue(struct work_struct *work) -{ - struct delayed_work *delayed_work = - container_of(work, struct delayed_work, work); - moal_private *priv = - container_of(delayed_work, moal_private, sched_scan_work); - ENTER(); - - if (priv->sched_scanning) - woal_cfg80211_notify_sched_scan_stop(priv); - - LEAVE(); -} - /** * @brief report sched_scan result to kernel * @@ -4711,8 +4731,6 @@ void woal_report_sched_scan_result(moal_private *priv) priv->bg_scan_reqid #endif ); - queue_delayed_work(priv->sched_scan_workqueue, &priv->sched_scan_work, - msecs_to_jiffies(2000)); } #endif #endif @@ -4902,6 +4920,7 @@ void woal_cfg80211_notify_antcfg(moal_private *priv, struct wiphy *wiphy, 0x300 && (radio->param.ant_cfg.rx_antenna & 0xFF00) != 0)) { bands->ht_cap.mcs.rx_mask[1] = 0; +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 6, 0) bands->vht_cap.vht_mcs.rx_mcs_map = (__force __le16)0xfffe; bands->vht_cap.vht_mcs.tx_mcs_map = @@ -4910,6 +4929,7 @@ void woal_cfg80211_notify_antcfg(moal_private *priv, struct wiphy *wiphy, (__force __le16)0x186; bands->vht_cap.vht_mcs.tx_highest = (__force __le16)0x186; +#endif #if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) if (bands->n_iftype_data && bands->iftype_data && @@ -4936,6 +4956,7 @@ void woal_cfg80211_notify_antcfg(moal_private *priv, struct wiphy *wiphy, (radio->param.ant_cfg.rx_antenna & 0xFF00) == 0x300) { bands->ht_cap.mcs.rx_mask[1] = 0xff; +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 6, 0) bands->vht_cap.vht_mcs.rx_mcs_map = (__force __le16)0xfffa; bands->vht_cap.vht_mcs.tx_mcs_map = @@ -4944,6 +4965,7 @@ void woal_cfg80211_notify_antcfg(moal_private *priv, struct wiphy *wiphy, (__force __le16)0x30c; bands->vht_cap.vht_mcs.tx_highest = (__force __le16)0x30c; +#endif #if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) if (bands->n_iftype_data && bands->iftype_data && @@ -5161,8 +5183,8 @@ static void woal_update_wiphy_chan_dfs_state(struct wiphy *wiphy, t_u8 channel, } #if CFG80211_VERSION_CODE > KERNEL_VERSION(3, 8, 13) if (i < sband->n_channels) - PRINTM(MCMND, "ZERODFS: Set channel %d dfs_state: %d\n", - channel, sband->channels[i].dfs_state); + PRINTM(MCMND, "DFS: Set channel %d dfs_state: %d\n", channel, + sband->channels[i].dfs_state); #endif LEAVE(); } diff --git a/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.h b/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.h index 60591ad..20f43e8 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.h +++ b/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.h @@ -123,6 +123,7 @@ void woal_regulatory_work_queue(struct work_struct *work); #endif t_u8 woal_band_cfg_to_ieee_band(t_u32 band); +t_u8 woal_ieee_band_to_radio_type(t_u8 ieee_band); int woal_cfg80211_change_virtual_intf(struct wiphy *wiphy, struct net_device *dev, @@ -474,7 +475,6 @@ void woal_channel_switch_event(moal_private *priv, chan_band_info *pchan_info); #if KERNEL_VERSION(3, 2, 0) <= CFG80211_VERSION_CODE void woal_bgscan_stop_event(moal_private *priv); void woal_cfg80211_notify_sched_scan_stop(moal_private *priv); -void woal_sched_scan_work_queue(struct work_struct *work); void woal_report_sched_scan_result(moal_private *priv); #endif #endif @@ -485,7 +485,9 @@ void woal_cfg80211_notify_antcfg(moal_private *priv, struct wiphy *wiphy, mlan_ds_radio_cfg *radio); #endif +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) void woal_deauth_event(moal_private *priv, int reason_code); +#endif #if KERNEL_VERSION(3, 8, 0) <= CFG80211_VERSION_CODE mlan_status woal_chandef_create(moal_private *priv, diff --git a/mxm_wifiex/wlan_src/mlinux/moal_cfg80211_util.c b/mxm_wifiex/wlan_src/mlinux/moal_cfg80211_util.c index f1494f6..8fe6c06 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_cfg80211_util.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_cfg80211_util.c @@ -262,6 +262,7 @@ int woal_cfg80211_vendor_event(moal_private *priv, int event, t_u8 *data, return ret; } +#if KERNEL_VERSION(3, 14, 0) <= CFG80211_VERSION_CODE /** * @brief send fw dump complete event to vendorhal * @@ -275,6 +276,7 @@ void woal_cfg80211_vendor_event_fw_dump(moal_private *priv) woal_cfg80211_vendor_event(priv, event_fw_dump_done, CUS_EVT_FW_DUMP, strlen(CUS_EVT_FW_DUMP)); } +#endif /** * @brief send dfs vendor event to kernel diff --git a/mxm_wifiex/wlan_src/mlinux/moal_debug.c b/mxm_wifiex/wlan_src/mlinux/moal_debug.c index 0e71ba3..b7d0309 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_debug.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_debug.c @@ -125,6 +125,7 @@ static struct debug_data items[] = { item_addr(bypass_pkt_count), INFO_ADDR}, {"scan_processing", item_size(scan_processing), item_addr(scan_processing), INFO_ADDR}, + {"scan_state", item_size(scan_state), item_addr(scan_state), INFO_ADDR}, {"num_cmd_timeout", item_size(num_cmd_timeout), item_addr(num_cmd_timeout), INFO_ADDR}, {"timeout_cmd_id", item_size(timeout_cmd_id), item_addr(timeout_cmd_id), diff --git a/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c b/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c index 1f9039f..1aad13e 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c @@ -3036,6 +3036,7 @@ static int woal_priv_get_chanstats(moal_private *priv, t_u8 *respbuf, ret = -EINVAL; goto done; } + mdelay(10); memset(&scan_resp, 0, sizeof(scan_resp)); if (MLAN_STATUS_SUCCESS != woal_get_scan_table(priv, MOAL_IOCTL_WAIT, &scan_resp)) { @@ -4607,6 +4608,7 @@ static int woal_priv_set_get_scancfg(moal_private *priv, t_u8 *respbuf, ret = -EINVAL; goto done; } + req->action = MLAN_ACT_SET; moal_memcpy_ext(priv->phandle, &scan->param.scan_cfg, data, sizeof(data), sizeof(scan->param.scan_cfg)); @@ -10765,7 +10767,8 @@ static int woal_priv_fake_radar(moal_private *priv, t_u8 *respbuf, ENTER(); #ifdef UAP_CFG80211 #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) - if (priv && !(priv->chan.chan->flags & IEEE80211_CHAN_RADAR)) { + if (priv && priv->chan.chan && + !(priv->chan.chan->flags & IEEE80211_CHAN_RADAR)) { PRINTM(MERROR, "Current op channel NOT DFS\n"); LEAVE(); return -EINVAL; @@ -10990,6 +10993,7 @@ done: return ret; } +#ifdef UAP_SUPPORT /** * @brief determine the center frquency center index for bandwidth * of 80 MHz and 160 MHz @@ -11206,6 +11210,7 @@ static t_u8 woal_get_center_freq_idx(moal_private *priv, t_u16 band, } return center_freq_idx; } +#endif #if defined(UAP_SUPPORT) /** @@ -11845,21 +11850,24 @@ static int woal_priv_do_dfs_cac(moal_private *priv, t_u8 *respbuf, if (!data[0] || (priv->chan_rpt_req.chanNum && (priv->chan_rpt_req.chanNum != data[0]))) { - if (priv->chan_rpt_pending) { + if (priv->chan_rpt_pending || + (priv->bss_type == MLAN_BSS_TYPE_DFS)) { woal_11h_cancel_chan_report_ioctl( priv, MOAL_IOCTL_WAIT); priv->chan_rpt_pending = MFALSE; } memset(&priv->chan_rpt_req, 0, sizeof(mlan_ds_11h_chan_rep_req)); - PRINTM(MCMND, "ZeroDFS: Stop Radar detect\n"); + PRINTM(MCMND, "DFS: Stop Radar detect\n"); if (!data[0]) { - woal_uap_11h_ctrl(priv, MFALSE); + if (priv->bss_type == MLAN_BSS_TYPE_UAP) + woal_uap_11h_ctrl(priv, MFALSE); LEAVE(); return ret; } } - if (data[0] == priv->chan_rpt_req.chanNum) + if (data[0] == priv->chan_rpt_req.chanNum && + priv->bss_type == MLAN_BSS_TYPE_UAP) woal_uap_11h_ctrl(priv, MFALSE); memset(&ch_dfs_state, 0, sizeof(ch_dfs_state)); ch_dfs_state.channel = data[0]; @@ -11868,7 +11876,7 @@ static int woal_priv_do_dfs_cac(moal_private *priv, t_u8 *respbuf, if (!ch_dfs_state.dfs_required || ch_dfs_state.dfs_state == DFS_UNAVAILABLE) { PRINTM(MCMND, - "ZeroDFS: This channel=%d under NOP or not DFS channel\n", + "DFS: This channel=%d under NOP or not DFS channel\n", data[0]); LEAVE(); return -EINVAL; @@ -11916,7 +11924,7 @@ static int woal_priv_do_dfs_cac(moal_private *priv, t_u8 *respbuf, &chan_rpt_req, sizeof(mlan_ds_11h_chan_rep_req), sizeof(mlan_ds_11h_chan_rep_req)); PRINTM(MCMND, - "ZeroDFS: Start Radar detect on channel=%d, bandwidth=%d, cac time=%d\n", + "DFS: Start Radar detect on channel=%d, bandwidth=%d, cac time=%d\n", chan_rpt_req.chanNum, (int)(chan_rpt_req.bandcfg.chanWidth), chan_rpt_req.millisec_dwell_time); @@ -12271,6 +12279,124 @@ done: LEAVE(); return ret; } + +/** + * @brief per peer stats configure + * + * @param priv Pointer to moal_private structure + * @param respbuf Pointer to response buffer + * @param resplen Response buffer length + * + * @return 0 --success, otherwise fail + */ +static int woal_priv_stats(moal_private *priv, t_u8 *respbuf, t_u32 respbuflen) +{ + mlan_ioctl_req *ioctl_req = NULL; + mlan_ds_misc_cfg *misc = NULL; + mlan_ds_stats *stats; + mlan_status status = MLAN_STATUS_SUCCESS; + int ret = 0; + int header_len = 0; + + ENTER(); + + if (!priv || !priv->phandle) { + PRINTM(MERROR, "priv or handle is null\n"); + ret = -EFAULT; + goto done; + } + + ioctl_req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_misc_cfg)); + if (ioctl_req == NULL) { + ret = -ENOMEM; + goto done; + } + + misc = (mlan_ds_misc_cfg *)ioctl_req->pbuf; + misc->sub_command = MLAN_OID_MISC_STATS; + ioctl_req->req_id = MLAN_IOCTL_MISC_CFG; + + header_len = strlen(CMD_NXP) + strlen(PRIV_CMD_STATS); + stats = (mlan_ds_stats *)(respbuf + header_len); + ioctl_req->action = stats->action; + + moal_memcpy_ext(priv->phandle, &misc->param.stats, stats, + sizeof(mlan_ds_stats) + stats->tlv_len - 1, + sizeof(mlan_ds_stats) + stats->tlv_len - 1); + + status = woal_request_ioctl(priv, ioctl_req, MOAL_IOCTL_WAIT); + if (status != MLAN_STATUS_SUCCESS) { + ret = -EFAULT; + goto done; + } + + moal_memcpy_ext(priv->phandle, respbuf + header_len, + (mlan_ds_stats *)&misc->param.stats, ioctl_req->buf_len, + respbuflen - header_len); + ret = header_len + ioctl_req->buf_len; + +done: + LEAVE(); + return ret; +} +/** + * @brief get channel load results + * + * @param priv Pointer to moal_private structure + * @param respbuf Pointer to response buffer + * @param resplen Response buffer length + * + * @return 0 --success, otherwise fail + */ +static int woal_priv_get_ch_load_results(moal_private *priv, t_u8 *respbuf, + t_u32 respbuflen) +{ + mlan_ioctl_req *ioctl_req = NULL; + mlan_ds_misc_cfg *misc = NULL; + mlan_status status = MLAN_STATUS_SUCCESS; + mlan_ds_ch_load *cl_cfg; + int ret = 0; + int header_len = 0; + + ENTER(); + + if (!priv || !priv->phandle) { + PRINTM(MERROR, "priv or handle is null\n"); + ret = -EFAULT; + goto done; + } + + ioctl_req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_misc_cfg)); + if (ioctl_req == NULL) { + ret = -ENOMEM; + goto done; + } + + misc = (mlan_ds_misc_cfg *)ioctl_req->pbuf; + misc->sub_command = MLAN_OID_MISC_CH_LOAD_RESULTS; + ioctl_req->req_id = MLAN_IOCTL_MISC_CFG; + + header_len = strlen(CMD_NXP) + strlen(PRIV_CMD_CH_LOAD_RESULTS); + cl_cfg = (mlan_ds_ch_load *)(respbuf + header_len); + ioctl_req->action = cl_cfg->action; + status = woal_request_ioctl(priv, ioctl_req, MOAL_IOCTL_WAIT); + if (status != MLAN_STATUS_SUCCESS) { + ret = -EAGAIN; + goto done; + } + + cl_cfg->ch_load_param = misc->param.ch_load.ch_load_param; + cl_cfg->noise = misc->param.ch_load.noise; + ret = header_len + sizeof(misc->param.ch_load); + +done: + if (status != MLAN_STATUS_PENDING) + kfree(ioctl_req); + + LEAVE(); + return ret; +} + /** * @brief get channel load * @@ -12312,14 +12438,14 @@ static int woal_priv_get_ch_load(moal_private *priv, t_u8 *respbuf, cl_cfg = (mlan_ds_ch_load *)(respbuf + header_len); ioctl_req->action = cl_cfg->action; misc->param.ch_load.ch_load_param = cl_cfg->ch_load_param; - - status = woal_request_ioctl(priv, ioctl_req, MOAL_IOCTL_WAIT); - if (status != MLAN_STATUS_SUCCESS) { + misc->param.ch_load.noise = cl_cfg->noise; + misc->param.ch_load.duration = cl_cfg->duration; + status = woal_request_ioctl(priv, ioctl_req, MOAL_NO_WAIT); + if (status != MLAN_STATUS_SUCCESS && status != MLAN_STATUS_PENDING) { ret = -EFAULT; goto done; } - cl_cfg->ch_load_param = misc->param.ch_load.ch_load_param; ret = header_len + sizeof(misc->param.ch_load); done: @@ -13670,6 +13796,63 @@ done: return ret; } +/** + * * @brief Set and get txwatchdog check + * * @param priv Pointer to moal_private structure + * * @param respbuf Pointer to response buffer + * * @param resplen Response buffer length + * * + * * @return Number of bytes written, negative for failure. + * */ +static int woal_priv_txwatchdog(moal_private *priv, t_u8 *respbuf, + t_u32 respbuflen) +{ + int ret = 0; + int header_len = 0; + int user_data_len = 0; + int data[1] = {0}; + int allowed = 1; + t_u32 action; + + ENTER(); + + if (!priv || !priv->phandle) { + PRINTM(MERROR, "priv or handle is null\n"); + ret = -EFAULT; + goto done; + } + + header_len = strlen(CMD_NXP) + strlen(PRIV_CMD_TXWATCHDOG); + + if (strlen(respbuf) == header_len) { + action = MLAN_ACT_GET; + ret = sizeof(t_u32); + } else { + action = MLAN_ACT_SET; + parse_arguments(respbuf + header_len, data, ARRAY_SIZE(data), + &user_data_len); + if (user_data_len != allowed) { + PRINTM(MERROR, "Invalid number of args! %d\n", + user_data_len); + ret = -EINVAL; + goto done; + } + } + + if (action == MLAN_ACT_SET) { + priv->txwatchdog_disable = ((*data == 0) ? MTRUE : MFALSE); + } else { + *data = ((priv->txwatchdog_disable == MTRUE) ? 0 : 1); + } + memcpy(respbuf, data, sizeof(t_u32)); + PRINTM(MINFO, "priv->txwatchdog_disable:%u, action:%u, data[0]=%d\n", + priv->txwatchdog_disable, action, data[0]); + +done: + LEAVE(); + return ret; +} + #if defined(PCIE) /** * @brief Enable SSU support @@ -14371,6 +14554,7 @@ done: return ret; } +#ifdef UAP_SUPPORT /** * @brief Set/Get target channel * @param priv Pointer to moal_private structure @@ -14466,6 +14650,7 @@ done: LEAVE(); return ret; } +#endif #if defined(STA_CFG80211) || defined(UAP_CFG80211) #ifdef WIFI_DIRECT_SUPPORT @@ -15531,6 +15716,7 @@ done: return ret; } +#ifdef UAP_SUPPORT /** * @brief move the uAP to transition channel * @@ -15558,6 +15744,7 @@ void woal_move_to_next_channel(moal_private *priv) woal_action_channel_switch(priv, MTRUE, 0, next_chan, 0, MOAL_NO_WAIT); return; } +#endif /** * @brief Set extended channel switch ie @@ -17838,6 +18025,30 @@ done: return ret; } +static int woal_priv_get_uuid(moal_private *priv, t_u8 *respbuf, + t_u32 respbuflen) +{ + int ret = -1; + mlan_fw_info fw_info; + + ENTER(); + + if (!respbuf) { + PRINTM(MERROR, "response buffer is not available!\n"); + ret = -1; + } else { + fw_info.uuid_lo = fw_info.uuid_hi = 0x0ULL; + + woal_request_get_fw_info(priv, MOAL_IOCTL_WAIT, &fw_info); + snprintf(respbuf, MLAN_MAX_UUID_LEN + 1, "%llx%llx", + fw_info.uuid_lo, fw_info.uuid_hi); + ret = strlen(respbuf); + } + + LEAVE(); + return ret; +} + /** * @brief Set priv command for Android * @param dev A pointer to net_device structure @@ -17865,7 +18076,7 @@ int woal_android_priv_cmd(struct net_device *dev, struct ifreq *req) int len = 0; gfp_t flag; char *cmd_buf = NULL; -#if defined(STA_CFG80211) && defined(UAP_CFG80211) +#if defined(STA_CFG80211) || defined(UAP_CFG80211) int cfg80211_wext; #endif @@ -17875,7 +18086,7 @@ int woal_android_priv_cmd(struct net_device *dev, struct ifreq *req) ret = -EFAULT; goto done; } -#if defined(STA_CFG80211) && defined(UAP_CFG80211) +#if defined(STA_CFG80211) || defined(UAP_CFG80211) cfg80211_wext = priv->phandle->params.cfg80211_wext; #endif if (copy_from_user(&priv_cmd, req->ifr_data, @@ -18767,12 +18978,24 @@ int woal_android_priv_cmd(struct net_device *dev, struct ifreq *req) len = woal_priv_mc_aggr_cfg(priv, buf, priv_cmd.total_len); goto handled; + } else if (strnicmp(buf + strlen(CMD_NXP), PRIV_CMD_STATS, + strlen(PRIV_CMD_STATS)) == 0) { + /* stats */ + len = woal_priv_stats(priv, buf, priv_cmd.total_len); + goto handled; } else if (strnicmp(buf + strlen(CMD_NXP), PRIV_CMD_CH_LOAD, strlen(PRIV_CMD_CH_LOAD)) == 0) { /* mc_aggr_cfg*/ len = woal_priv_get_ch_load(priv, buf, priv_cmd.total_len); goto handled; + } else if (strnicmp(buf + strlen(CMD_NXP), + PRIV_CMD_CH_LOAD_RESULTS, + strlen(PRIV_CMD_CH_LOAD_RESULTS)) == 0) { + /* mc_aggr_cfg*/ + len = woal_priv_get_ch_load_results(priv, buf, + priv_cmd.total_len); + goto handled; } else if (strnicmp(buf + strlen(CMD_NXP), PRIV_CMD_TX_BF_CAP, strlen(PRIV_CMD_TX_BF_CAP)) == 0) { /* Set/Get Transmit beamforming capabilities */ @@ -18900,6 +19123,11 @@ int woal_android_priv_cmd(struct net_device *dev, struct ifreq *req) len = woal_priv_port_ctrl(priv, buf, priv_cmd.total_len); goto handled; + } else if (strnicmp(buf + strlen(CMD_NXP), PRIV_CMD_TXWATCHDOG, + strlen(PRIV_CMD_TXWATCHDOG)) == 0) { + len = woal_priv_txwatchdog(priv, buf, + priv_cmd.total_len); + goto handled; } else if (strnicmp(buf + strlen(CMD_NXP), PRIV_CMD_PB_BYPASS, strlen(PRIV_CMD_PB_BYPASS)) == 0) { /* Private IOCTL entry to get the By-passed TX packet @@ -18936,6 +19164,7 @@ int woal_android_priv_cmd(struct net_device *dev, struct ifreq *req) len = woal_priv_cfg_get_tsf_info(priv, buf, priv_cmd.total_len); goto handled; +#ifdef UAP_SUPPORT } else if (strnicmp(buf + strlen(CMD_NXP), PRIV_CMD_TARGET_CHANNEL, strlen(PRIV_CMD_TARGET_CHANNEL)) == 0) { @@ -18950,6 +19179,7 @@ int woal_android_priv_cmd(struct net_device *dev, struct ifreq *req) len = woal_priv_backup_channel(priv, buf, priv_cmd.total_len); goto handled; +#endif } else if (strnicmp(buf + strlen(CMD_NXP), PRIV_CMD_DFS_REPEATER_CFG, strlen(PRIV_CMD_DFS_REPEATER_CFG)) == 0) { @@ -19126,6 +19356,10 @@ int woal_android_priv_cmd(struct net_device *dev, struct ifreq *req) strlen(PRIV_CMD_IPS_CFG)) == 0) { len = woal_priv_ips_cfg(priv, buf, priv_cmd.total_len); goto handled; + } else if (strnicmp(buf + strlen(CMD_NXP), PRIV_CMD_GET_SB_UUID, + strlen(PRIV_CMD_GET_SB_UUID)) == 0) { + len = woal_priv_get_uuid(priv, buf, priv_cmd.total_len); + goto handled; } else { PRINTM(MERROR, "Unknown NXP PRIVATE command %s, ignored\n", diff --git a/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.h b/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.h index 4436cb5..1c76957 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.h +++ b/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.h @@ -301,7 +301,9 @@ typedef struct _chan_stats { #define PRIV_CMD_MCAST_AGGR_GROUP "mcast_aggr_group" #define PRIV_CMD_MC_AGGR_CFG "mc_aggr_cfg" +#define PRIV_CMD_STATS "stats" #define PRIV_CMD_CH_LOAD "getchload" +#define PRIV_CMD_CH_LOAD_RESULTS "getloadresults" #define PRIV_CMD_ARB_CFG "arb" @@ -379,6 +381,12 @@ typedef struct _ssu_params_cfg { #define PRIV_CMD_BOOTSLEEP "bootsleep" +/** Private command ID to config txwatchdog enable/disable */ +#define PRIV_CMD_TXWATCHDOG "txwatchdog" + +/** Private command to get secure boot uuid */ +#define PRIV_CMD_GET_SB_UUID "getuuid" + /** Private command: 11AX Cfg */ #define PRIV_CMD_11AXCFG "11axcfg" /** Private command: 11AX Cmd */ @@ -539,6 +547,7 @@ typedef struct woal_priv_addba { #define ACTION_ADD 2 /** Action field value: remove */ #define ACTION_REMOVE 3 + #define MC_AGGR_CTRL MBIT(0) /* mcast_aggr_group */ typedef struct _mcast_aggr_group { diff --git a/mxm_wifiex/wlan_src/mlinux/moal_init.c b/mxm_wifiex/wlan_src/mlinux/moal_init.c index 4003558..2cb85d9 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_init.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_init.c @@ -137,7 +137,7 @@ static int shutdown_hs; static int slew_rate = 3; #endif int tx_work = 0; -static int rps = 0; + static int tx_skb_clone = 0; #ifdef IMX_SUPPORT static int pmqos = 1; @@ -146,6 +146,7 @@ static int pmqos = 0; #endif static int chan_track = 0; +static int mcs32 = 1; #if defined(STA_SUPPORT) /** 802.11d configuration */ @@ -1175,17 +1176,6 @@ static mlan_status parse_cfg_read_block(t_u8 *data, t_u32 size, PRINTM(MMSG, "tx_work %s\n", moal_extflg_isset(handle, EXT_TX_WORK) ? "on" : "off"); - } else if (strncmp(line, "rps", strlen("rps")) == 0) { - if (parse_line_read_int(line, &out_data) != - MLAN_STATUS_SUCCESS) - goto err; - if (out_data) - moal_extflg_set(handle, EXT_RPS); - else - moal_extflg_clear(handle, EXT_RPS); - PRINTM(MMSG, "rps %s\n", - moal_extflg_isset(handle, EXT_RPS) ? "on" : - "off"); } else if (strncmp(line, "tx_skb_clone", strlen("tx_skb_clone")) == 0) { if (parse_line_read_int(line, &out_data) != @@ -1317,6 +1307,13 @@ static mlan_status parse_cfg_read_block(t_u8 *data, t_u32 size, PRINTM(MMSG, "wacp_moe=%d\n", params->wacp_mode); } #endif + else if (strncmp(line, "mcs32", strlen("mcs32")) == 0) { + if (parse_line_read_int(line, &out_data) != + MLAN_STATUS_SUCCESS) + goto err; + params->mcs32 = out_data; + PRINTM(MMSG, "mcs32=%d\n", params->mcs32); + } #if defined(STA_CFG80211) || defined(UAP_CFG80211) #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) else if (strncmp(line, "host_mlme", strlen("host_mlme")) == 0) { @@ -1427,11 +1424,13 @@ static void woal_setup_module_param(moal_handle *handle, moal_mod_para *params) woal_dup_string(&handle->params.uap_name, uap_name); handle->params.uap_max_sta = uap_max_sta; handle->params.wacp_mode = wacp_mode; + handle->params.mcs32 = mcs32; if (params) { handle->params.max_uap_bss = params->max_uap_bss; woal_dup_string(&handle->params.uap_name, params->uap_name); handle->params.uap_max_sta = params->uap_max_sta; handle->params.wacp_mode = params->wacp_mode; + handle->params.mcs32 = params->mcs32; } #endif /* UAP_SUPPORT */ #ifdef WIFI_DIRECT_SUPPORT @@ -1610,8 +1609,7 @@ static void woal_setup_module_param(moal_handle *handle, moal_mod_para *params) moal_extflg_set(handle, EXT_NAPI); if (tx_work) moal_extflg_set(handle, EXT_TX_WORK); - if (rps) - moal_extflg_set(handle, EXT_RPS); + if (tx_skb_clone) moal_extflg_set(handle, EXT_TX_SKB_CLONE); if (pmqos) @@ -1839,11 +1837,6 @@ void woal_init_from_dev_tree(void) PRINTM(MIOCTL, "tx_work=0x%x\n", data); tx_work = data; } - } else if (!strncmp(prop->name, "rps", strlen("rps"))) { - if (!of_property_read_u32(dt_node, prop->name, &data)) { - PRINTM(MIOCTL, "rps=0x%x\n", data); - rps = data; - } } else if (!strncmp(prop->name, "tx_skb_clone", strlen("tx_skb_clone"))) { if (!of_property_read_u32(dt_node, prop->name, &data)) { @@ -1855,6 +1848,11 @@ void woal_init_from_dev_tree(void) PRINTM(MIOCTL, "pmqos=0x%x\n", data); pmqos = data; } + } else if (!strncmp(prop->name, "mcs32", strlen("mcs32"))) { + if (!of_property_read_u32(dt_node, prop->name, &data)) { + PRINTM(MIOCTL, "mcs32=0x%x\n", data); + mcs32 = data; + } } #ifdef MFG_CMD_SUPPORT else if (!strncmp(prop->name, "mfg_mode", strlen("mfg_mode"))) { @@ -2125,8 +2123,13 @@ void woal_init_from_dev_tree(void) } } #endif - else if (!strncmp(prop->name, "sched_scan", - strlen("sched_scan"))) { + else if (!strncmp(prop->name, "mcs32", strlen("mcs32"))) { + if (!of_property_read_u32(dt_node, prop->name, &data)) { + PRINTM(MERROR, "mcs32=0x%x\n", data); + mcs32 = data; + } + } else if (!strncmp(prop->name, "sched_scan", + strlen("sched_scan"))) { if (!of_property_read_u32(dt_node, prop->name, &data)) { PRINTM(MIOCTL, "sched_scan=%d\n", data); sched_scan = data; @@ -2437,13 +2440,13 @@ MODULE_PARM_DESC( #endif module_param(tx_work, uint, 0660); MODULE_PARM_DESC(tx_work, "1: Enable tx_work; 0: Disable tx_work"); -module_param(rps, uint, 0660); -MODULE_PARM_DESC(rps, "1: Enable rps; 0: Disable rps"); module_param(tx_skb_clone, uint, 0660); MODULE_PARM_DESC(tx_skb_clone, "1: Enable tx_skb_clone; 0: Disable tx_skb_clone"); module_param(pmqos, uint, 0660); MODULE_PARM_DESC(pmqos, "1: Enable pmqos; 0: Disable pmqos"); +module_param(mcs32, uint, 0660); +MODULE_PARM_DESC(mcs32, "1: Enable mcs32; 0: Disable mcs32"); module_param(dpd_data_cfg, charp, 0); MODULE_PARM_DESC(dpd_data_cfg, "DPD data file name"); diff --git a/mxm_wifiex/wlan_src/mlinux/moal_ioctl.c b/mxm_wifiex/wlan_src/mlinux/moal_ioctl.c index 0723203..2e73e30 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_ioctl.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_ioctl.c @@ -2908,7 +2908,6 @@ static mlan_status woal_set_wake_on_mdns(moal_handle *handle, t_u8 enable) sizeof(filter->byte_seq)); entry->rpn[2] = RPN_TYPE_AND; filter++; - filter->fill_flag = (FILLING_TYPE | FILLING_PATTERN | FILLING_OFFSET | FILLING_NUM_BYTES); filter->type = TYPE_BYTE_EQ + 1; @@ -2917,7 +2916,6 @@ static mlan_status woal_set_wake_on_mdns(moal_handle *handle, t_u8 enable) filter->num_bytes = 1; entry->rpn[3] = RPN_TYPE_AND; filter++; - filter->fill_flag = (FILLING_TYPE | FILLING_PATTERN | FILLING_OFFSET | FILLING_NUM_BYTES); filter->type = TYPE_BYTE_EQ + 1; @@ -2927,16 +2925,14 @@ static mlan_status woal_set_wake_on_mdns(moal_handle *handle, t_u8 enable) filter++; entry->filter_num = 4; if (enable) { - ret = woal_request_ioctl(woal_get_priv(handle, - MLAN_BSS_ROLE_ANY), - req, MOAL_NO_WAIT); - if (ret != MLAN_STATUS_SUCCESS && ret != MLAN_STATUS_PENDING) - PRINTM(MIOCTL, "Set Mdns wake up failed! ret=%d\n", - ret); + mef_cfg->op_code = MLAN_OP_ADD_MDNS; } else { - PRINTM(MIOCTL, "Mdns wake up is disable\n"); + mef_cfg->op_code = MLAN_IPADDR_OP_IP_REMOVE; } - + ret = woal_request_ioctl(woal_get_priv(handle, MLAN_BSS_ROLE_ANY), req, + MOAL_NO_WAIT); + if (ret != MLAN_STATUS_SUCCESS && ret != MLAN_STATUS_PENDING) + PRINTM(MIOCTL, "Set Mdns wake up failed! ret=%d\n", ret); done: if (ret != MLAN_STATUS_PENDING) kfree(req); @@ -2953,7 +2949,7 @@ done: * @return MLAN_STATUS_SUCCESS/MLAN_STATUS_PENDING -- success, otherwise * fail */ -static mlan_status woal_set_ipv6_ns_offload(moal_handle *handle) +static mlan_status woal_set_ipv6_ns_offload(moal_handle *handle, t_u8 enable) { mlan_status ret = MLAN_STATUS_SUCCESS; mlan_ds_misc_cfg *misc = NULL; @@ -3003,7 +2999,11 @@ static mlan_status woal_set_ipv6_ns_offload(moal_handle *handle) moal_memcpy_ext(handle, filter->byte_seq, "\x87", 1, sizeof(filter->byte_seq)); entry->filter_num = 2; - + if (enable) { + mef_cfg->op_code = MLAN_OP_ADD_IPV6_NS; + } else { + mef_cfg->op_code = MLAN_IPADDR_OP_IP_REMOVE; + } ret = woal_request_ioctl(woal_get_priv(handle, MLAN_BSS_ROLE_ANY), req, MOAL_NO_WAIT); if (ret != MLAN_STATUS_SUCCESS && ret != MLAN_STATUS_PENDING) @@ -3425,12 +3425,16 @@ mlan_status woal_cancel_hs(moal_private *priv, t_u8 wait_option) woal_set_clear_pmk(priv, MLAN_ACT_CLEAR); #endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0) #if IS_ENABLED(CONFIG_IPV6) if (priv->phandle->hs_auto_arp) { PRINTM(MIOCTL, "Cancel Host Sleep... remove ipv6 offload\n"); /** Set ipv6 router advertisement message offload */ woal_set_ipv6_ra_offload(priv->phandle, MFALSE); } + /** Set Neighbor Solitation message offload */ + woal_set_ipv6_ns_offload(priv->phandle, MFALSE); +#endif #endif if (priv->phandle->hs_auto_arp) { @@ -3720,14 +3724,16 @@ int woal_enable_hs(moal_private *priv) #endif } media_connected = woal_check_media_connected(handle); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0) #if IS_ENABLED(CONFIG_IPV6) if (handle->hs_auto_arp && media_connected) { PRINTM(MIOCTL, "Host Sleep enabled... set ipv6 offload\n"); /** Set ipv6 router advertisement message offload */ woal_set_ipv6_ra_offload(handle, MTRUE); /** Set Neighbor Solitation message offload */ - woal_set_ipv6_ns_offload(handle); + woal_set_ipv6_ns_offload(handle, MTRUE); } +#endif #endif if (handle->hs_auto_arp) { diff --git a/mxm_wifiex/wlan_src/mlinux/moal_main.c b/mxm_wifiex/wlan_src/mlinux/moal_main.c index c1ba5d0..5799f40 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_main.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_main.c @@ -77,9 +77,11 @@ Change log: #include #endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0) #if IS_ENABLED(CONFIG_IPV6) #include #endif +#endif /******************************************************** Global Variables @@ -908,8 +910,10 @@ void woal_send_fw_dump_complete_event(moal_private *priv) woal_send_iwevcustom_event(priv, CUS_EVT_FW_DUMP_DONE); #endif #ifdef STA_CFG80211 +#if KERNEL_VERSION(3, 14, 0) <= CFG80211_VERSION_CODE if (IS_STA_CFG80211(cfg80211_wext)) woal_cfg80211_vendor_event_fw_dump(priv); +#endif #endif woal_broadcast_event(priv, CUS_EVT_FW_DUMP_DONE, strlen(CUS_EVT_FW_DUMP_DONE)); @@ -964,7 +968,7 @@ static void woal_hang_work_queue(struct work_struct *work) // disconnect #ifdef STA_CFG80211 #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) - if (IS_STA_CFG80211(cfg80211_wext) && + if (IS_STA_CFG80211(cfg80211_wext) && priv->wdev && priv->wdev->connected) { #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) if (priv->host_mlme) @@ -1247,6 +1251,7 @@ done: return ret; } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0) #if IS_ENABLED(CONFIG_IPV6) /** * @brief This function handle the net interface ipv6 address change event @@ -1320,6 +1325,7 @@ done: return ret; } #endif +#endif /** * @brief This function validates a SSID as being able to be printed @@ -2068,11 +2074,15 @@ mlan_status woal_init_sw(moal_handle *handle) #ifdef UAP_SUPPORT device.uap_max_sta = handle->params.uap_max_sta; #endif + device.mcs32 = handle->params.mcs32; device.hs_wake_interval = handle->params.hs_wake_interval; device.indication_gpio = handle->params.indication_gpio; device.hs_mimo_switch = moal_extflg_isset(handle, EXT_HS_MIMO_SWITCH); device.dfs53cfg = handle->params.dfs53cfg; +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) + device.dfs_offload = moal_extflg_isset(handle, EXT_DFS_OFFLOAD); +#endif for (i = 0; i < handle->drv_mode.intf_num; i++) { device.bss_attr[i].bss_type = @@ -3346,6 +3356,7 @@ static mlan_status woal_add_card_dpc(moal_handle *handle) mlan_status ret = MLAN_STATUS_SUCCESS; int i; char str_buf[MLAN_MAX_VER_STR_LEN]; + ENTER(); #if defined(USB) @@ -3452,6 +3463,7 @@ static mlan_status woal_add_card_dpc(moal_handle *handle) woal_set_uap_operation_ctrl(handle); #endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0) #if IS_ENABLED(CONFIG_IPV6) handle->woal_inet6_notifier.notifier_call = woal_inet6_netdeive_event; if (register_inet6addr_notifier(&handle->woal_inet6_notifier)) { @@ -3460,6 +3472,7 @@ static mlan_status woal_add_card_dpc(moal_handle *handle) goto err; } #endif +#endif #ifdef MFG_CMD_SUPPORT done: @@ -3472,8 +3485,10 @@ err: if (ret != MLAN_STATUS_SUCCESS) { PRINTM(MERROR, "Failed to add interface\n"); unregister_inetaddr_notifier(&handle->woal_notifier); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0) #if IS_ENABLED(CONFIG_IPV6) unregister_inet6addr_notifier(&handle->woal_inet6_notifier); +#endif #endif for (i = 0; i < MIN(MLAN_MAX_BSS_NUM, handle->priv_num); i++) @@ -4709,9 +4724,6 @@ moal_private *woal_add_interface(moal_handle *handle, t_u8 bss_index, moal_private *priv = NULL; char name[256]; int i = 0; -#ifdef STA_CFG80211 - char sched_scan_str[256]; -#endif #ifdef UAP_CFG80211 #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 12, 0) char csa_str[256]; @@ -4924,15 +4936,6 @@ moal_private *woal_add_interface(moal_handle *handle, t_u8 bss_index, goto error; } } - strcpy(sched_scan_str, "SCHED_SCAN"); - strcat(sched_scan_str, name); - priv->sched_scan_workqueue = alloc_workqueue( - sched_scan_str, WQ_HIGHPRI | WQ_MEM_RECLAIM | WQ_UNBOUND, 1); - if (!priv->sched_scan_workqueue) { - PRINTM(MERROR, "cannot alloc sched_scan workqueue \n"); - goto error; - } - INIT_DELAYED_WORK(&priv->sched_scan_work, woal_sched_scan_work_queue); #endif /* STA_SUPPORT */ #endif /* STA_CFG80211 */ @@ -5050,12 +5053,6 @@ error: destroy_workqueue(priv->mclist_workqueue); priv->mclist_workqueue = NULL; } -#ifdef STA_CFG80211 - if (priv->sched_scan_workqueue) { - destroy_workqueue(priv->sched_scan_workqueue); - priv->sched_scan_workqueue = NULL; - } -#endif #if defined(STA_CFG80211) || defined(UAP_CFG80211) if (priv->wdev && IS_STA_OR_UAP_CFG80211(handle->params.cfg80211_wext)) @@ -5166,13 +5163,6 @@ void woal_remove_interface(moal_handle *handle, t_u8 bss_index) priv->mclist_workqueue = NULL; } -#ifdef STA_CFG80211 - if (priv->sched_scan_workqueue) { - destroy_workqueue(priv->sched_scan_workqueue); - priv->sched_scan_workqueue = NULL; - } -#endif - #if defined(STA_CFG80211) || defined(UAP_CFG80211) /* Unregister wiphy device and free */ if (priv->wdev && IS_STA_OR_UAP_CFG80211(handle->params.cfg80211_wext)) @@ -6105,6 +6095,7 @@ void woal_mlan_debug_info(moal_private *priv) PRINTM(MERROR, "tx_lock_flag = %d\n", info->tx_lock_flag); PRINTM(MERROR, "port_open = %d\n", info->port_open); PRINTM(MERROR, "scan_processing = %d\n", info->scan_processing); + PRINTM(MERROR, "scan_state = 0x%x\n", info->scan_state); for (i = 0; i < (int)info->ralist_num; i++) { PRINTM(MERROR, "ralist ra: %02x:%02x:%02x:%02x:%02x:%02x tid=%d pkts=%d pause=%d\n", @@ -6176,7 +6167,8 @@ void woal_tx_timeout(struct net_device *dev dev->name, priv->bss_index, priv->num_tx_timeout); woal_set_trans_start(dev); - if (priv->num_tx_timeout == NUM_TX_TIMEOUT_THRESHOLD) { + if (priv->num_tx_timeout == NUM_TX_TIMEOUT_THRESHOLD && + priv->txwatchdog_disable == MFALSE) { if (drvdbg & MFW_D) auto_fw_dump = MTRUE; woal_mlan_debug_info(priv); @@ -6204,6 +6196,7 @@ struct net_device_stats *woal_get_stats(struct net_device *dev) return &priv->stats; } +#if !defined(STA_CFG80211) && !defined(UAP_CFG80211) /** * @brief This function determine the 802.1p/1d tag to use * @@ -6270,6 +6263,7 @@ unsigned int woal_classify8021d(struct sk_buff *skb) out: return tid; } +#endif #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 29) /** @@ -6307,7 +6301,11 @@ u16 woal_select_queue(struct net_device *dev, struct sk_buff *skb return index; } #if defined(STA_CFG80211) || defined(UAP_CFG80211) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) tid = skb->priority = cfg80211_classify8021d(skb, NULL); +#else + tid = skb->priority = cfg80211_classify8021d(skb); +#endif #else tid = skb->priority = woal_classify8021d(skb); #endif @@ -7062,10 +7060,8 @@ static int woal_start_xmit(moal_private *priv, struct sk_buff *skb) #endif if (is_zero_timeval(priv->phandle->tx_time_start)) { - priv->phandle->tx_time_start.time_sec = - pmbuf->in_ts_sec; - priv->phandle->tx_time_start.time_usec = - pmbuf->in_ts_usec; + priv->phandle->tx_time_start.time_sec = pmbuf->in_ts_sec; + priv->phandle->tx_time_start.time_usec = pmbuf->in_ts_usec; PRINTM(MINFO, "%s : start_timeval=%d:%d \n", __func__, priv->phandle->tx_time_start.time_sec, priv->phandle->tx_time_start.time_usec); @@ -7521,7 +7517,10 @@ void woal_init_priv(moal_private *priv, t_u8 wait_option) if (priv->bss_type != MLAN_BSS_TYPE_WIFIDIRECT) #endif { - priv->current_addr[4] += priv->bss_index; + if (priv->bss_index) { + priv->current_addr[0] |= 0x02; + priv->current_addr[4] += priv->bss_index; + } PRINTM(MCMND, "Set %s interface addr: " MACSTR "\n", priv->netdev->name, MAC2STR(priv->current_addr)); } @@ -8722,7 +8721,7 @@ t_void woal_store_firmware_dump(moal_handle *phandle, mlan_event *pmevent) if (seqnum == 1) { if (drvdbg & MFW_D) - drvdbg &= ~MFW_D; + phandle->fw_dump_status = MTRUE; if (phandle->fw_dump == MFALSE) { PRINTM(MMSG, "=====FW trigger dump====\n"); phandle->fw_dump = MTRUE; @@ -9138,6 +9137,7 @@ static int woal_dump_mlan_drv_info(moal_private *priv, t_u8 *buf) ptr += sprintf(ptr, "tx_lock_flag = %d\n", info->tx_lock_flag); ptr += sprintf(ptr, "port_open = %d\n", info->port_open); ptr += sprintf(ptr, "scan_processing = %d\n", info->scan_processing); + ptr += sprintf(ptr, "scan_state = %d\n", info->scan_state); #ifdef PCIE if (IS_PCIE(priv->phandle->card_type)) { @@ -9533,8 +9533,8 @@ void woal_moal_debug_info(moal_private *priv, moal_handle *handle, u8 flag) } #endif #ifdef DEBUG_LEVEL1 - if (drvdbg & MFW_D) { - drvdbg &= ~MFW_D; + if ((drvdbg & MFW_D) && !phandle->fw_dump_status) { + phandle->fw_dump_status = MTRUE; phandle->fw_dbg = MTRUE; queue_work(phandle->workqueue, &phandle->main_work); } @@ -9814,6 +9814,7 @@ t_void woal_evt_work_queue(struct work_struct *work) break; #endif #endif +#ifdef UAP_SUPPORT case WOAL_EVENT_CHAN_RPT: woal_process_chan_event((moal_private *)evt->priv, WOAL_EVENT_CHAN_RPT, @@ -9826,6 +9827,7 @@ t_void woal_evt_work_queue(struct work_struct *work) evt->radar_info.channel, evt->radar_info.radar); break; +#endif #ifdef UAP_CFG80211 #if KERNEL_VERSION(3, 12, 0) <= CFG80211_VERSION_CODE case WOAL_EVENT_CANCEL_CHANRPT: @@ -9834,6 +9836,8 @@ t_void woal_evt_work_queue(struct work_struct *work) break; #endif #endif + default: + break; } kfree(evt); spin_lock_irqsave(&handle->evt_lock, flags); @@ -9867,10 +9871,12 @@ t_void woal_rx_work_queue(struct work_struct *work) return; } #if defined(STA_CFG80211) || defined(UAP_CFG80211) +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 2, 0) if (handle->cfg80211_suspend == MTRUE) { LEAVE(); return; } +#endif #endif woal_get_monotonic_time(&start_timeval); mlan_rx_process(handle->pmlan_adapter, NULL); @@ -9966,7 +9972,8 @@ t_void woal_main_work_queue(struct work_struct *work) } if (handle->fw_dbg == MTRUE) { handle->fw_dbg = MFALSE; - handle->ops.dump_fw_info(handle); + if (handle->ops.dump_fw_info) + handle->ops.dump_fw_info(handle); LEAVE(); return; } @@ -10581,9 +10588,11 @@ mlan_status woal_remove_card(void *card) atomic_read(&handle->ioctl_pending)); } unregister_inetaddr_notifier(&handle->woal_notifier); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0) #if IS_ENABLED(CONFIG_IPV6) unregister_inet6addr_notifier(&handle->woal_inet6_notifier); #endif +#endif #if defined(STA_CFG80211) || defined(UAP_CFG80211) #if CFG80211_VERSION_CODE >= KERNEL_VERSION(2, 6, 39) @@ -10753,8 +10762,10 @@ mlan_status woal_switch_drv_mode(moal_handle *handle, t_u32 mode) } unregister_inetaddr_notifier(&handle->woal_notifier); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0) #if IS_ENABLED(CONFIG_IPV6) unregister_inet6addr_notifier(&handle->woal_inet6_notifier); +#endif #endif /* Remove interface */ diff --git a/mxm_wifiex/wlan_src/mlinux/moal_main.h b/mxm_wifiex/wlan_src/mlinux/moal_main.h index 3edbbf9..8433dc3 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_main.h +++ b/mxm_wifiex/wlan_src/mlinux/moal_main.h @@ -145,8 +145,10 @@ Change log: #include #endif /* IMX_SUPPORT */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0) #include +#else +#include #endif #ifndef MIN @@ -220,6 +222,10 @@ Change log: #define IEEE80211_NUM_BANDS NUM_NL80211_BANDS #endif +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 4, 0) +#define IEEE80211_BAND_6GHZ NL80211_BAND_6GHZ +#endif + /** * interface name */ @@ -266,6 +272,8 @@ typedef t_u8 BOOLEAN; #define CARD_TYPE_USB_USB 6 /** card type PCIE_USB */ #define CARD_TYPE_PCIE_USB 7 +/** card type SD9177_UART */ +#define CARD_TYPE_SD9177_UART 1 // As per datasheet/SoC design /** Driver version */ extern char driver_version[]; @@ -818,10 +826,12 @@ typedef enum { #define CUS_EVT_RADAR_DETECTED "EVENT=RADAR_DETECTED" /** Custom event : CAC finished */ #define CUS_EVT_CAC_FINISHED "EVENT=CAC_FINISHED" +#ifdef UAP_SUPPORT void woal_move_to_next_channel(moal_private *priv); void woal_chan_event(moal_private *priv, t_u8 type, t_u8 channel, t_u8 radar); void woal_process_chan_event(moal_private *priv, t_u8 type, t_u8 channel, t_u8 radar); +#endif /** Custom event : WEP ICV error */ #define CUS_EVT_WEP_ICV_ERR "EVENT=WEP_ICV_ERR" @@ -1427,10 +1437,6 @@ struct _moal_private { wlan_bgscan_cfg scan_cfg; /** sched scaning flag */ t_u8 sched_scanning; - /** sched_scan work queue */ - struct workqueue_struct *sched_scan_workqueue; - /** sched_scan work */ - struct delayed_work sched_scan_work; /** bgscan request id */ t_u64 bg_scan_reqid; #ifdef STA_CFG80211 @@ -1694,6 +1700,12 @@ struct _moal_private { void *rings[RING_ID_MAX]; t_u8 pkt_fate_monitor_enable; void *packet_filter; + /** txwatchdog disable */ + t_u8 txwatchdog_disable; + + /** secure boot uuid lower and higher 8 bytes */ + t_u64 uuid_lo; + t_u64 uuid_hi; }; #ifdef SDIO @@ -2059,7 +2071,6 @@ enum ext_mod_params { #endif #endif EXT_TX_WORK, - EXT_RPS, EXT_TX_SKB_CLONE, EXT_PMQOS, EXT_CHAN_TRACK, @@ -2154,6 +2165,8 @@ typedef struct _moal_mod_para { t_u16 inact_tmo; char *reg_alpha2; int dfs53cfg; + t_u8 mcs32; + } moal_mod_para; void woal_tp_acnt_timer_func(void *context); @@ -2545,6 +2558,8 @@ struct _moal_handle { moal_drv_timer fw_dump_timer __ATTRIB_ALIGN__; /** fw dump buffer total len */ t_u64 fw_dump_len; + /** fw dump status for each chip, useful in multichip drive */ + BOOLEAN fw_dump_status; /** Pointer of fw dump buffer */ t_u8 *fw_dump_buf; /** FW dump full name */ @@ -2588,8 +2603,10 @@ struct _moal_handle { /* feature_control */ t_u32 feature_control; struct notifier_block woal_notifier; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0) #if IS_ENABLED(CONFIG_IPV6) struct notifier_block woal_inet6_notifier; +#endif #endif mlan_ds_misc_keep_alive keep_alive[MAX_KEEP_ALIVE_ID]; struct net_device napi_dev; @@ -3777,8 +3794,10 @@ monitor_iface *woal_prepare_mon_if(moal_private *priv, const char *name, #endif #if defined(STA_CFG80211) || defined(UAP_CFG80211) +#if KERNEL_VERSION(3, 14, 0) <= CFG80211_VERSION_CODE void woal_cfg80211_vendor_event_fw_dump(moal_private *priv); #endif +#endif #ifdef STA_CFG80211 #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 1, 0) diff --git a/mxm_wifiex/wlan_src/mlinux/moal_pcie.c b/mxm_wifiex/wlan_src/mlinux/moal_pcie.c index 66078ab..f87a686 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_pcie.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_pcie.c @@ -44,9 +44,11 @@ Change log: #endif #endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0) #if IS_ENABLED(CONFIG_IPV6) #include #endif +#endif /******************************************************** Local Variables @@ -143,6 +145,11 @@ static moal_if_ops pcie_ops; ********************************************************/ static mlan_status woal_pcie_preinit(struct pci_dev *pdev); +#if defined(PCIE8897) || defined(PCIE8997) || defined(PCIE9098) || \ + defined(PCIE9097) || defined(PCIENW62X) +static rdwr_status woal_pcie_rdwr_firmware(moal_handle *phandle, t_u8 doneflag, + t_u8 resetflag); +#endif /** @brief This function updates the card types * @@ -305,8 +312,10 @@ static mlan_status woal_do_flr(moal_handle *handle, bool prepare, bool flr_flag) } unregister_inetaddr_notifier(&handle->woal_notifier); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0) #if IS_ENABLED(CONFIG_IPV6) unregister_inet6addr_notifier(&handle->woal_inet6_notifier); +#endif #endif /* Remove interface */ @@ -531,6 +540,46 @@ static void woal_pcie_remove(struct pci_dev *dev) return; } +/** + * @brief This function handles PCIE driver remove + * + * @param pdev A pointer to pci_dev structure + * + * @return error code + */ +static void woal_pcie_shutdown(struct pci_dev *dev) +{ + pcie_service_card *card; + moal_handle *handle; + + ENTER(); + PRINTM(MCMND, "<--- Enter woal_pcie_shutdown --->\n"); + + card = pci_get_drvdata(dev); + if (!card) { + PRINTM(MINFO, "PCIE card removed from slot\n"); + LEAVE(); + return; + } + handle = card->handle; + if (handle->second_mac) + goto done; +#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIENW62X) + if (IS_PCIE9098(handle->card_type) || IS_PCIENW62X(handle->card_type) || + IS_PCIE9097(handle->card_type)) { + if (RDWR_STATUS_FAILURE != + woal_pcie_rdwr_firmware(handle, 0, 1)) + PRINTM(MMSG, "wlan: start in-bound IR...\n"); + } +#endif +done: + handle->surprise_removed = MTRUE; + pci_disable_device(dev); + PRINTM(MCMND, "<--- Leave woal_pcie_shutdown --->\n"); + LEAVE(); + return; +} + /** * @brief Handle suspend * @@ -916,6 +965,7 @@ static struct pci_driver REFDATA wlan_pcie = { .id_table = wlan_ids, .probe = woal_pcie_probe, .remove = woal_pcie_remove, + .shutdown = woal_pcie_shutdown, #ifdef CONFIG_PM /* Power Management Hooks */ .suspend = woal_pcie_suspend, @@ -1176,13 +1226,21 @@ static mlan_status woal_pcie_init(pcie_service_card *card) pci_set_master(pdev); PRINTM(MINFO, "Try set_consistent_dma_mask(32)\n"); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) + ret = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32)); +#else ret = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); +#endif if (ret) { PRINTM(MERROR, "set_dma_mask(32) failed\n"); goto err_set_dma_mask; } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) + ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); +#else ret = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)); +#endif if (ret) { PRINTM(MERROR, "set_consistent_dma_mask(64) failed\n"); goto err_set_dma_mask; @@ -1821,6 +1879,7 @@ static memory_type_mapping mem_type_mapping_tbl_8897[] = { defined(PCIENW62X) #define DEBUG_HOST_READY_8997 0xCC #define DEBUG_HOST_EVENT_READY 0xAA +#define DEBUG_HOST_RESET_READY 0x99 static memory_type_mapping mem_type_mapping_tbl_8997 = {"DUMP", NULL, NULL, 0xDD, 0x00}; @@ -1850,10 +1909,12 @@ static mlan_status woal_read_reg_eight_bit(moal_handle *handle, t_u32 reg, * * @param phandle A pointer to moal_handle * @param doneflag done flag + * @param resetflag reset flag; * * @return MLAN_STATUS_SUCCESS */ -static rdwr_status woal_pcie_rdwr_firmware(moal_handle *phandle, t_u8 doneflag) +static rdwr_status woal_pcie_rdwr_firmware(moal_handle *phandle, t_u8 doneflag, + t_u8 resetflag) { int ret = 0; int tries = 0; @@ -1883,33 +1944,38 @@ static rdwr_status woal_pcie_rdwr_firmware(moal_handle *phandle, t_u8 doneflag) debug_host_ready = DEBUG_HOST_EVENT_READY; else debug_host_ready = DEBUG_HOST_READY_8997; + if (resetflag) + debug_host_ready = DEBUG_HOST_RESET_READY; dump_ctrl_reg = PCIE9098_DUMP_CTRL_REG; } #endif ret = woal_pcie_write_reg(phandle, dump_ctrl_reg, debug_host_ready); if (ret) { - PRINTM(MERROR, "PCIE Write ERR\n"); + PRINTM(MERROR, "PCIE Write ERR, reg=0x%x debug_reay=0x%x\n", + dump_ctrl_reg, debug_host_ready); return RDWR_STATUS_FAILURE; } #if defined(PCIE9098) || defined(PCIE9097) || defined(PCIENW62X) if (IS_PCIE9098(phandle->card_type) || IS_PCIENW62X(phandle->card_type) || IS_PCIE9097(phandle->card_type)) { - if (phandle->event_fw_dump) + if (phandle->event_fw_dump || resetflag) return RDWR_STATUS_SUCCESS; } #endif ret = woal_pcie_read_reg(phandle, dump_ctrl_reg, ®_data); if (ret) { - PRINTM(MERROR, "PCIE Read DEBUG_DUMP_CTRL_REG fail\n"); + PRINTM(MERROR, "PCIE Read DEBUG_DUMP_CTRL_REG 0x%x fail\n", + dump_ctrl_reg); return RDWR_STATUS_FAILURE; } for (tries = 0; tries < MAX_POLL_TRIES; tries++) { ret = woal_read_reg_eight_bit(phandle, dump_ctrl_reg, &ctrl_data); if (ret) { - PRINTM(MERROR, "PCIE READ ERR\n"); + PRINTM(MERROR, "PCIE READ reg 0x%x 8bit ERR\n", + dump_ctrl_reg); return RDWR_STATUS_FAILURE; } if (ctrl_data == DEBUG_FW_DONE) @@ -1917,7 +1983,9 @@ static rdwr_status woal_pcie_rdwr_firmware(moal_handle *phandle, t_u8 doneflag) if (doneflag && ctrl_data == doneflag) return RDWR_STATUS_DONE; if (ctrl_data != debug_host_ready) { - PRINTM(MMSG, "The ctrl reg was changed, try again!\n"); + PRINTM(MMSG, + "The ctrl reg was changed, ctrl_data=0x%x, host_ready:0x%x try again!\n", + ctrl_data, debug_host_ready); ret = woal_pcie_write_reg(phandle, dump_ctrl_reg, debug_host_ready); if (ret) { @@ -1932,7 +2000,8 @@ static rdwr_status woal_pcie_rdwr_firmware(moal_handle *phandle, t_u8 doneflag) #endif } if (ctrl_data == debug_host_ready) { - PRINTM(MERROR, "Fail to pull ctrl_data\n"); + PRINTM(MERROR, "Fail to pull ctrl_data=0x%x host_ready=0x%x\n", + ctrl_data, debug_host_ready); return RDWR_STATUS_FAILURE; } return RDWR_STATUS_SUCCESS; @@ -1984,7 +2053,8 @@ static void woal_pcie_dump_fw_info_v1(moal_handle *phandle) PRINTM(MMSG, "====PCIE DEBUG MODE OUTPUT START: %u.%06u ====\n", sec, usec); /* read the number of the memories which will dump */ - if (RDWR_STATUS_FAILURE == woal_pcie_rdwr_firmware(phandle, doneflag)) + if (RDWR_STATUS_FAILURE == + woal_pcie_rdwr_firmware(phandle, doneflag, 0)) goto done; reg = DEBUG_DUMP_START_REG; ret = woal_read_reg_eight_bit(phandle, reg, &dump_num); @@ -1998,7 +2068,7 @@ static void woal_pcie_dump_fw_info_v1(moal_handle *phandle) idx < dump_num && idx < ARRAY_SIZE(mem_type_mapping_tbl_8897); idx++) { if (RDWR_STATUS_FAILURE == - woal_pcie_rdwr_firmware(phandle, doneflag)) + woal_pcie_rdwr_firmware(phandle, doneflag, 0)) goto done; memory_size = 0; reg = DEBUG_DUMP_START_REG; @@ -2042,7 +2112,7 @@ static void woal_pcie_dump_fw_info_v1(moal_handle *phandle) PRINTM(MMSG, "Start %s output %u.%06u, please wait...\n", mem_type_mapping_tbl[idx].mem_name, sec, usec); do { - stat = woal_pcie_rdwr_firmware(phandle, doneflag); + stat = woal_pcie_rdwr_firmware(phandle, doneflag, 0); if (RDWR_STATUS_FAILURE == stat) goto done; @@ -2133,7 +2203,7 @@ static void woal_pcie_dump_fw_info_v2(moal_handle *phandle) IS_PCIE9097(phandle->card_type)) { if (phandle->event_fw_dump) { if (RDWR_STATUS_FAILURE != - woal_pcie_rdwr_firmware(phandle, doneflag)) { + woal_pcie_rdwr_firmware(phandle, doneflag, 0)) { PRINTM(MMSG, "====PCIE FW DUMP EVENT MODE START ====\n"); return; @@ -2147,7 +2217,8 @@ static void woal_pcie_dump_fw_info_v2(moal_handle *phandle) PRINTM(MMSG, "====PCIE DEBUG MODE OUTPUT START: %u.%06u ====\n", sec, usec); /* read the number of the memories which will dump */ - if (RDWR_STATUS_FAILURE == woal_pcie_rdwr_firmware(phandle, doneflag)) + if (RDWR_STATUS_FAILURE == + woal_pcie_rdwr_firmware(phandle, doneflag, 0)) goto done; #if defined(PCIE9098) || defined(PCIE9097) || defined(PCIENW62X) if (IS_PCIE9098(phandle->card_type) || @@ -2186,7 +2257,7 @@ static void woal_pcie_dump_fw_info_v2(moal_handle *phandle) PRINTM(MMSG, "Start %s output %u.%06u, please wait...\n", mem_type_mapping_tbl->mem_name, sec, usec); do { - stat = woal_pcie_rdwr_firmware(phandle, doneflag); + stat = woal_pcie_rdwr_firmware(phandle, doneflag, 0); if (RDWR_STATUS_FAILURE == stat) goto done; diff --git a/mxm_wifiex/wlan_src/mlinux/moal_pcie.h b/mxm_wifiex/wlan_src/mlinux/moal_pcie.h index f4a58ee..7b5879b 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_pcie.h +++ b/mxm_wifiex/wlan_src/mlinux/moal_pcie.h @@ -126,7 +126,7 @@ Change log: #define PCIEUARTNW62X_DEFAULT_COMBO_FW_NAME "nxp/pcieuartnw62x_combo.bin" #define PCIEUSBNW62X_DEFAULT_COMBO_FW_NAME "nxp/pcieusbnw62x_combo.bin" #define PCIENW62X_DEFAULT_WLAN_FW_NAME "nxp/pcienw62x_wlan.bin" -#endif /* PCIE8997 */ +#endif /* PCIENW62X */ #if defined(PCIE9098) || defined(PCIE9097) || defined(PCIENW62X) #define PCIE_NUM_MSIX_VECTORS 32 diff --git a/mxm_wifiex/wlan_src/mlinux/moal_proc.c b/mxm_wifiex/wlan_src/mlinux/moal_proc.c index 113cb16..902e0b1 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_proc.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_proc.c @@ -89,6 +89,7 @@ static int woal_info_proc_read(struct seq_file *sfp, void *data) struct net_device *netdev = (struct net_device *)sfp->private; char fmt[MLAN_MAX_VER_STR_LEN]; moal_private *priv = (moal_private *)netdev_priv(netdev); + mlan_fw_info fw_info; #ifdef STA_SUPPORT int i = 0; moal_handle *handle = NULL; @@ -113,6 +114,8 @@ static int woal_info_proc_read(struct seq_file *sfp, void *data) t_u8 c[4]; } ver; + fw_info.uuid_lo = fw_info.uuid_hi = 0x0ULL; + ENTER(); if (priv == NULL) @@ -162,6 +165,11 @@ static int woal_info_proc_read(struct seq_file *sfp, void *data) ver.l = handle->fw_release_number; seq_printf(sfp, "firmware_major_version=%u.%u.%u\n", ver.c[2], ver.c[1], ver.c[0]); + + woal_request_get_fw_info(priv, MOAL_IOCTL_WAIT, &fw_info); + if (fw_info.uuid_lo || fw_info.uuid_hi) + seq_printf(sfp, "uuid = %llx%llx\n", fw_info.uuid_lo, + fw_info.uuid_hi); #ifdef WIFI_DIRECT_SUPPORT if (priv->bss_type == MLAN_BSS_TYPE_WIFIDIRECT) { if (GET_BSS_ROLE(priv) == MLAN_BSS_ROLE_STA) @@ -531,18 +539,14 @@ static ssize_t woal_config_write(struct file *f, const char __user *buf, if (ref_handle) { priv = woal_get_priv(ref_handle, MLAN_BSS_ROLE_ANY); if (priv) { -#ifdef DEBUG_LEVEL1 - drvdbg &= ~MFW_D; -#endif + handle->fw_dump_status = MTRUE; woal_mlan_debug_info(priv); woal_moal_debug_info(priv, NULL, MFALSE); } } priv = woal_get_priv(handle, MLAN_BSS_ROLE_ANY); if (priv) { -#ifdef DEBUG_LEVEL1 - drvdbg &= ~MFW_D; -#endif + handle->fw_dump_status = MTRUE; woal_mlan_debug_info(priv); woal_moal_debug_info(priv, NULL, MFALSE); handle->ops.dump_fw_info(handle); diff --git a/mxm_wifiex/wlan_src/mlinux/moal_sdio.h b/mxm_wifiex/wlan_src/mlinux/moal_sdio.h index c4b2010..c3ec55a 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_sdio.h +++ b/mxm_wifiex/wlan_src/mlinux/moal_sdio.h @@ -159,10 +159,10 @@ Change log: #define SD9177_DEFAULT_COMBO_FW_NAME "nxp/sdsd_nw61x.bin" #define SD9177_DEFAULT_COMBO_V1_FW_NAME "nxp/sduart_nw61x_v1.bin" #define SDUART9177_DEFAULT_COMBO_FW_NAME "nxp/sduart_nw61x.bin" -#define SDSD9177_DEFAULT_COMBO_FW_NAME "sdsd_nw61x.bin" +#define SDSD9177_DEFAULT_COMBO_FW_NAME "nxp/sdsd_nw61x.bin" #define SD9177_DEFAULT_WLAN_FW_NAME "nxp/sd_w61x.bin" #define SDUART9177_DEFAULT_COMBO_V1_FW_NAME "nxp/sduart_nw61x_v1.bin" -#define SDSD9177_DEFAULT_COMBO_V1_FW_NAME "sdsd_nw61x_v1.bin" +#define SDSD9177_DEFAULT_COMBO_V1_FW_NAME "nxp/sdsd_nw61x_v1.bin" #define SD9177_DEFAULT_WLAN_V1_FW_NAME "nxp/sd_w61x_v1.bin" #endif /* SD9177 */ diff --git a/mxm_wifiex/wlan_src/mlinux/moal_sdio_mmc.c b/mxm_wifiex/wlan_src/mlinux/moal_sdio_mmc.c index ad87e30..0837fc6 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_sdio_mmc.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_sdio_mmc.c @@ -95,7 +95,7 @@ static moal_if_ops sdiommc_ops; #endif #ifdef SDNW62X /** Device ID for SDNW62X */ -#define SD_DEVICE_ID_NW62X (0x020C) +#define SD_DEVICE_ID_NW62X (0x020D) #endif /** WLAN IDs */ @@ -1184,14 +1184,21 @@ static void woal_sdiommc_unregister_dev(moal_handle *handle) ENTER(); if (handle->card) { struct sdio_mmc_card *card = handle->card; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0) struct sdio_func *func = card->func; - +#endif /* Release the SDIO IRQ */ sdio_claim_host(card->func); sdio_release_irq(card->func); sdio_disable_func(card->func); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0) if (handle->driver_status) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) + mmc_hw_reset(func->card); +#else mmc_hw_reset(func->card->host); +#endif +#endif sdio_release_host(card->func); sdio_set_drvdata(card->func, NULL); @@ -1553,7 +1560,7 @@ static mlan_status woal_sdiommc_get_fw_name(moal_handle *handle) switch (revision_id) { case SD9177_A0: if (magic == CHIP_MAGIC_VALUE) { - if (strap == CARD_TYPE_SD_UART) + if (strap == CARD_TYPE_SD9177_UART) strcpy(handle->card_info->fw_name, SDUART9177_DEFAULT_COMBO_FW_NAME); else @@ -1565,7 +1572,7 @@ static mlan_status woal_sdiommc_get_fw_name(moal_handle *handle) break; case SD9177_A1: if (magic == CHIP_MAGIC_VALUE) { - if (strap == CARD_TYPE_SD_UART) + if (strap == CARD_TYPE_SD9177_UART) strcpy(handle->card_info->fw_name, SDUART9177_DEFAULT_COMBO_V1_FW_NAME); else diff --git a/mxm_wifiex/wlan_src/mlinux/moal_shim.c b/mxm_wifiex/wlan_src/mlinux/moal_shim.c index dce331b..d2cbaea 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_shim.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_shim.c @@ -101,8 +101,9 @@ extern int wifi_status; mlan_status moal_malloc(t_void *pmoal, t_u32 size, t_u32 flag, t_u8 **ppbuf) { moal_handle *handle = (moal_handle *)pmoal; - gfp_t mem_flag = - (in_interrupt() || irqs_disabled()) ? GFP_ATOMIC : GFP_KERNEL; + gfp_t mem_flag = (in_interrupt() || in_atomic() || irqs_disabled()) ? + GFP_ATOMIC : + GFP_KERNEL; #ifdef USB if (!IS_USB(handle->card_type)) @@ -208,8 +209,13 @@ mlan_status moal_malloc_consistent(t_void *pmoal, t_u32 size, t_u8 **ppbuf, if (!card) return MLAN_STATUS_FAILURE; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) + *ppbuf = (t_u8 *)dma_alloc_coherent(&card->dev->dev, size, + (dma_addr_t *)&dma, GFP_KERNEL); +#else *ppbuf = (t_u8 *)pci_alloc_consistent(card->dev, size, (dma_addr_t *)&dma); +#endif if (*ppbuf == NULL) { PRINTM(MERROR, "%s: allocate consistent memory (%d bytes) failed!\n", @@ -268,9 +274,12 @@ mlan_status moal_map_memory(t_void *pmoal, t_u8 *pbuf, t_u64 *pbuf_pa, if (!card) return MLAN_STATUS_FAILURE; - /* Init memory to device */ + /* Init memory to device */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) + dma = dma_map_single(&card->dev->dev, pbuf, size, flag); + if (dma_mapping_error(&card->dev->dev, dma)) { +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) dma = pci_map_single(card->dev, pbuf, size, flag); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) if (pci_dma_mapping_error(card->dev, dma)) { #else if (pci_dma_mapping_error(dma)) { @@ -500,8 +509,9 @@ mlan_status moal_init_timer(t_void *pmoal, t_void **pptimer, t_void *pcontext) { moal_drv_timer *timer = NULL; - gfp_t mem_flag = - (in_interrupt() || irqs_disabled()) ? GFP_ATOMIC : GFP_KERNEL; + gfp_t mem_flag = (in_interrupt() || in_atomic() || irqs_disabled()) ? + GFP_ATOMIC : + GFP_KERNEL; timer = kmalloc(sizeof(moal_drv_timer), mem_flag); if (timer == NULL) @@ -1139,25 +1149,27 @@ mlan_status moal_send_packet_complete(t_void *pmoal, pmlan_buffer pmbuf, } #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 29) index = skb_get_queue_mapping(skb); - if(index < 4) - { + if (index < 4) { atomic_dec(&handle->tx_pending); if (atomic_dec_return( - &priv->wmm_tx_pending[index]) == - LOW_TX_PENDING) { + &priv->wmm_tx_pending[index]) == + LOW_TX_PENDING) { struct netdev_queue *txq = netdev_get_tx_queue( - priv->netdev, index); - if (netif_tx_queue_stopped(txq)) { - netif_tx_wake_queue(txq); + priv->netdev, + index); + if (netif_tx_queue_stopped( + txq)) { + netif_tx_wake_queue( + txq); PRINTM(MINFO, - "Wakeup Kernel Queue:%d\n", - index); + "Wakeup Kernel Queue:%d\n", + index); } } - } - else { - PRINTM(MERROR,"Wakeup invalid Kernel Queue\n"); + } else { + PRINTM(MERROR, + "Invalid queue index for skb\n"); } #else /*#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,29)*/ if (atomic_dec_return(&handle->tx_pending) < @@ -1513,7 +1525,8 @@ static mlan_status moal_recv_packet_to_mon_if(moal_handle *handle, /** Antenna */ rth->body.antenna_signal = -(rt_info.nf - rt_info.snr); rth->body.antenna_noise = -rt_info.nf; - rth->body.antenna = rt_info.antenna; + /* Convert FW antenna value to radiotap spec */ + rth->body.antenna = (t_u16)rt_info.antenna >> 1; /** MCS */ if (format == MLAN_RATE_FORMAT_HT) { rth->hdr.it_present |= cpu_to_le32( @@ -1594,10 +1607,10 @@ static mlan_status moal_recv_packet_to_mon_if(moal_handle *handle, /** PARTIAL_AID */ /** TODO: Not support now */ /** mcs_nss */ - rth->body.u.vht.mcs_nss[0] = - (vht_sig2 & (0xF0)) >> 4; + rth->body.u.vht.mcs_nss[0] = vht_sig2 & (0xF0); + /* Convert FW NSS value to radiotap spec */ rth->body.u.vht.mcs_nss[0] |= - (vht_sig1 & (0x1C00)) >> (10 - 4); + ((vht_sig1 & (0x1C00)) >> 10) + 1; /** coding */ if (vht_sig2 & MBIT(2)) rth->body.u.vht.coding |= @@ -1741,7 +1754,12 @@ mlan_status moal_recv_amsdu_packet(t_void *pmoal, pmlan_buffer pmbuf) frame->dev = netdev; frame->priority = skb->priority; payload = frame->data; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0) if (ether_addr_equal(payload, rfc1042_eth_hdr)) { +#else + if (!memcmp(payload, rfc1042_eth_hdr, + sizeof(rfc1042_eth_hdr))) { +#endif /* Remove RFC1042 */ skb_pull(frame, 6); memcpy(skb_push(frame, ETH_ALEN), src, ETH_ALEN); @@ -2191,6 +2209,7 @@ void moal_connection_status_check_pmqos(t_void *pmoal) } } +#ifdef UAP_SUPPORT #if defined(STA_CFG80211) || defined(UAP_CFG80211) #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) /** @@ -2224,6 +2243,7 @@ static void woal_rx_mgmt_pkt_event(moal_private *priv, t_u8 *pkt, t_u16 len) } #endif #endif +#endif /** * @brief This function handles event receive @@ -2288,7 +2308,9 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent) t_u8 event_buf[64]; t_u8 radar_chan; #ifdef UAP_CFG80211 +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 12, 0) moal_private *cfg_priv = NULL; +#endif #endif t_u8 auto_fw_dump = MFALSE; @@ -2760,13 +2782,25 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent) #if CFG80211_VERSION_CODE > KERNEL_VERSION(2, 6, 35) if (IS_STA_CFG80211(cfg80211_wext)) { struct cfg80211_bss *bss = NULL; +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 1, 0) + bss = cfg80211_get_bss(priv->wdev->wiphy, NULL, + priv->cfg_bssid, NULL, 0, + IEEE80211_BSS_TYPE_ESS, + IEEE80211_PRIVACY_ANY); + +#else bss = cfg80211_get_bss(priv->wdev->wiphy, NULL, priv->cfg_bssid, NULL, 0, WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS); +#endif if (bss) { cfg80211_unlink_bss(priv->wdev->wiphy, bss); +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) cfg80211_put_bss(priv->wdev->wiphy, bss); +#else + cfg80211_put_bss(bss); +#endif } if (!hw_test && priv->roaming_enabled) woal_config_bgscan_and_rssi(priv, MFALSE); @@ -3052,15 +3086,6 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent) CUS_EVT_RADAR_DETECTED, radar_chan); woal_broadcast_event(priv, event_buf, strlen(event_buf)); PRINTM(MEVENT, "Radar detected on channel %d\n", radar_chan); - if ((priv->target_chan && priv->bss_started && - (priv->target_chan != radar_chan)) || - priv->backup_chan) { - PRINTM(MEVENT, "Move to target or backup chan %d %d\n", - priv->target_chan, priv->backup_chan); - woal_move_to_next_channel(priv); - priv->target_chan = 0; - break; - } #ifdef UAP_CFG80211 #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 12, 0) @@ -3070,6 +3095,17 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent) if (cfg_priv) { woal_update_channel_dfs_state(radar_chan, DFS_UNAVAILABLE); +#ifdef UAP_SUPPORT + if ((priv->target_chan && priv->bss_started && + (priv->target_chan != radar_chan)) || + priv->backup_chan) { + PRINTM(MEVENT, + "Move to target or backup chan %d %d\n", + priv->target_chan, priv->backup_chan); + woal_move_to_next_channel(priv); + priv->target_chan = 0; + break; + } if (priv->bss_type == MLAN_BSS_TYPE_DFS) { woal_chan_event(priv, WOAL_EVENT_RADAR, priv->chan_rpt_req.chanNum, @@ -3077,6 +3113,7 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent) break; } } +#endif if (priv->phandle->is_cac_timer_set) { if (priv->bss_index == priv->phandle->cac_bss_index) { PRINTM(MEVENT, "radar detected during CAC \n"); @@ -3093,9 +3130,10 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent) NL80211_RADAR_CAC_ABORTED, GFP_KERNEL); #else - cfg80211_cac_event(priv->netdev, - NL80211_RADAR_CAC_ABORTED, - GFP_KERNEL); + cfg80211_cac_event( + priv->netdev, + NL80211_RADAR_CAC_ABORTED, + GFP_KERNEL); #endif cfg80211_radar_event( priv->wdev->wiphy, @@ -3378,12 +3416,14 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent) PRINTM(MEVENT, "FW_REMAIN_ON_CHANNEL_EXPIRED cookie = %#llx\n", priv->phandle->cookie); +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) if (priv->host_mlme && (priv->auth_flag & HOST_MLME_AUTH_PENDING)) { priv->auth_flag = 0; priv->host_mlme = MFALSE; priv->auth_alg = 0xFFFF; } +#endif priv->phandle->remain_on_channel = MFALSE; if (priv->phandle->cookie && !priv->phandle->is_remain_timer_set) { @@ -3420,12 +3460,7 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent) moal_memcpy_ext(priv->phandle, addr, pmevent->event_buf, ETH_ALEN, ETH_ALEN); - /** these field add in kernel 3.2, but some - * kernel do have the pacth to support it, - * like T3T and pxa978T 3.0.31 JB, these - * patch are needed to support - * wpa_supplicant 2.x */ -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 0, 31) +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 2, 0) if (pmevent->event_len > ETH_ALEN) { #if CFG80211_VERSION_CODE < KERNEL_VERSION(4, 0, 0) /* set station info filled flag */ diff --git a/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c b/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c index b1461bc..6310b14 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c @@ -275,6 +275,7 @@ static int woal_cfg80211_add_station(struct wiphy *wiphy, #endif #endif +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 4, 0) static int woal_cfg80211_deauthenticate(struct wiphy *wiphy, struct net_device *dev, struct cfg80211_deauth_request *req); @@ -282,6 +283,7 @@ static int woal_cfg80211_deauthenticate(struct wiphy *wiphy, static int woal_cfg80211_disassociate(struct wiphy *wiphy, struct net_device *dev, struct cfg80211_disassoc_request *req); +#endif /** cfg80211 operations */ static struct cfg80211_ops woal_cfg80211_ops = { @@ -292,8 +294,10 @@ static struct cfg80211_ops woal_cfg80211_ops = { #endif .connect = woal_cfg80211_connect, .disconnect = woal_cfg80211_disconnect, +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 4, 0) .deauth = woal_cfg80211_deauthenticate, .disassoc = woal_cfg80211_disassociate, +#endif .get_station = woal_cfg80211_get_station, .dump_station = woal_cfg80211_dump_station, .dump_survey = woal_cfg80211_dump_survey, @@ -1833,7 +1837,8 @@ woal_cfg80211_connect_scan(moal_private *priv, if (conn_param->channel) { scan_req->chan_list[0].chan_number = conn_param->channel->hw_value; - scan_req->chan_list[0].radio_type = conn_param->channel->band; + scan_req->chan_list[0].radio_type = + woal_ieee_band_to_radio_type(conn_param->channel->band); if (conn_param->channel->flags & IEEE80211_CHAN_PASSIVE_SCAN) scan_req->chan_list[0].scan_type = MLAN_SCAN_TYPE_PASSIVE; @@ -1853,7 +1858,8 @@ woal_cfg80211_connect_scan(moal_private *priv, ch = &sband->channels[i]; if (ch->flags & IEEE80211_CHAN_DISABLED) continue; - scan_req->chan_list[chan_idx].radio_type = band; + scan_req->chan_list[chan_idx].radio_type = + woal_ieee_band_to_radio_type(band); if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN) scan_req->chan_list[chan_idx].scan_type = MLAN_SCAN_TYPE_PASSIVE; @@ -2023,7 +2029,8 @@ static int woal_cfg80211_auth_scan(moal_private *priv, if (req->bss->channel) { scan_req->chan_list[0].chan_number = req->bss->channel->hw_value; - scan_req->chan_list[0].radio_type = req->bss->channel->band; + scan_req->chan_list[0].radio_type = + woal_ieee_band_to_radio_type(req->bss->channel->band); if (req->bss->channel->flags & IEEE80211_CHAN_PASSIVE_SCAN) scan_req->chan_list[0].scan_type = MLAN_SCAN_TYPE_PASSIVE; @@ -2043,7 +2050,8 @@ static int woal_cfg80211_auth_scan(moal_private *priv, ch = &sband->channels[i]; if (ch->flags & IEEE80211_CHAN_DISABLED) continue; - scan_req->chan_list[chan_idx].radio_type = band; + scan_req->chan_list[chan_idx].radio_type = + woal_ieee_band_to_radio_type(band); if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN) scan_req->chan_list[chan_idx].scan_type = MLAN_SCAN_TYPE_PASSIVE; @@ -2539,25 +2547,30 @@ void woal_host_mlme_process_assoc_resp(moal_private *priv, ->assoc_req_buf; #if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) - + mutex_lock(&priv->wdev->mtx); cfg80211_rx_assoc_resp( priv->netdev, bss, assoc_info->assoc_resp_buf, assoc_info->assoc_resp_len, -1, assoc_req_buf, assoc_info->assoc_req_len); + mutex_unlock(&priv->wdev->mtx); #else #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 18, 0) + mutex_lock(&priv->wdev->mtx); cfg80211_rx_assoc_resp( priv->netdev, bss, assoc_info->assoc_resp_buf, assoc_info->assoc_resp_len, -1); + mutex_unlock(&priv->wdev->mtx); #else #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) + mutex_lock(&priv->wdev->mtx); cfg80211_rx_assoc_resp( priv->netdev, bss, assoc_info->assoc_resp_buf, assoc_info->assoc_resp_len); + mutex_unlock(&priv->wdev->mtx); #else cfg80211_send_rx_assoc( priv->netdev, bss, @@ -3961,6 +3974,7 @@ woal_cfg80211_reg_notifier(struct wiphy *wiphy, #if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 0, 0) char *reg_alpha2 = NULL; #endif + t_u8 dfs_region = NXP_DFS_UNKNOWN; ENTER(); @@ -3974,16 +3988,19 @@ woal_cfg80211_reg_notifier(struct wiphy *wiphy, return; #endif } - +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 3, 0) + dfs_region = request->dfs_region; +#endif PRINTM(MCMND, "cfg80211 regulatory domain callback " "%c%c initiator=%d dfs_region=%d\n", request->alpha2[0], request->alpha2[1], request->initiator, - request->dfs_region); + dfs_region); + #if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 0, 0) if (!(wiphy->regulatory_flags & REGULATORY_WIPHY_SELF_MANAGED)) #endif - handle->dfs_region = request->dfs_region; + handle->dfs_region = dfs_region; memset(&fw_info, 0, sizeof(mlan_fw_info)); woal_request_get_fw_info(priv, MOAL_IOCTL_WAIT, &fw_info); @@ -4008,8 +4025,7 @@ woal_cfg80211_reg_notifier(struct wiphy *wiphy, region[2] = ' '; if ((handle->country_code[0] != request->alpha2[0]) || (handle->country_code[1] != request->alpha2[1])) { - if (handle->params.cntry_txpwr && - !handle->params.txpwrlimit_cfg) { + if (handle->params.cntry_txpwr) { t_u8 country_code[COUNTRY_CODE_LEN]; handle->country_code[0] = request->alpha2[0]; handle->country_code[1] = request->alpha2[1]; @@ -4280,8 +4296,8 @@ static int woal_find_wps_ie_in_probereq(const t_u8 *ie, int len) } #ifdef UAP_CFG80211 -/** scan result expired value */ #define SCAN_RESULT_EXPIRTED 1 +/** scan result expired value */ /** * @brief check if the scan result expired * @@ -4512,7 +4528,8 @@ static int woal_cfg80211_scan(struct wiphy *wiphy, struct net_device *dev, i++) { chan = priv->phandle->scan_request->channels[i]; scan_req->chan_list[i].chan_number = chan->hw_value; - scan_req->chan_list[i].radio_type = chan->band; + scan_req->chan_list[i].radio_type = + woal_ieee_band_to_radio_type(chan->band); if ((chan->flags & IEEE80211_CHAN_PASSIVE_SCAN) || !priv->phandle->scan_request->n_ssids) scan_req->chan_list[i].scan_type = @@ -5380,6 +5397,7 @@ static int woal_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev, return 0; } +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 4, 0) /** * @brief This function is deauthentication handler when host MLME * enable. @@ -5399,6 +5417,9 @@ static int woal_cfg80211_deauthenticate(struct wiphy *wiphy, struct cfg80211_deauth_request *req) { int ret = 0; +#if CFG80211_VERSION_CODE < KERNEL_VERSION(3, 11, 0) + moal_private *pmpriv = (moal_private *)woal_get_netdev_priv(dev); +#endif #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) moal_private *priv = (moal_private *)woal_get_netdev_priv(dev); if (priv->host_mlme) { @@ -5413,9 +5434,9 @@ static int woal_cfg80211_deauthenticate(struct wiphy *wiphy, ret = woal_cfg80211_disconnect(wiphy, dev, req->reason_code); #if CFG80211_VERSION_CODE < KERNEL_VERSION(3, 11, 0) - if (priv->wdev->iftype == NL80211_IFTYPE_STATION || - priv->wdev->iftype == NL80211_IFTYPE_P2P_CLIENT) - cfg80211_disconnected(priv->netdev, 0, NULL, 0, GFP_KERNEL); + if (pmpriv->wdev->iftype == NL80211_IFTYPE_STATION || + pmpriv->wdev->iftype == NL80211_IFTYPE_P2P_CLIENT) + cfg80211_disconnected(pmpriv->netdev, 0, NULL, 0, GFP_KERNEL); #endif return ret; } @@ -5438,6 +5459,9 @@ static int woal_cfg80211_disassociate(struct wiphy *wiphy, struct cfg80211_disassoc_request *req) { int ret = 0; +#if CFG80211_VERSION_CODE < KERNEL_VERSION(3, 11, 0) + moal_private *pmpriv = (moal_private *)woal_get_netdev_priv(dev); +#endif #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) moal_private *priv = (moal_private *)woal_get_netdev_priv(dev); if (priv->host_mlme) { @@ -5452,12 +5476,13 @@ static int woal_cfg80211_disassociate(struct wiphy *wiphy, ret = woal_cfg80211_disconnect(wiphy, dev, req->reason_code); #if CFG80211_VERSION_CODE < KERNEL_VERSION(3, 11, 0) - if (priv->wdev->iftype == NL80211_IFTYPE_STATION || - priv->wdev->iftype == NL80211_IFTYPE_P2P_CLIENT) - cfg80211_disconnected(priv->netdev, 0, NULL, 0, GFP_KERNEL); + if (pmpriv->wdev->iftype == NL80211_IFTYPE_STATION || + pmpriv->wdev->iftype == NL80211_IFTYPE_P2P_CLIENT) + cfg80211_disconnected(pmpriv->netdev, 0, NULL, 0, GFP_KERNEL); #endif return ret; } +#endif /** * @brief Request the driver to get the station information @@ -5939,10 +5964,8 @@ int woal_cfg80211_remain_on_channel_cfg(moal_private *priv, t_u8 wait_option, return -EBUSY; } #endif - if (chan->band == IEEE80211_BAND_2GHZ) - chan_cfg.bandcfg.chanBand = BAND_2GHZ; - else if (chan->band == IEEE80211_BAND_5GHZ) - chan_cfg.bandcfg.chanBand = BAND_5GHZ; + chan_cfg.bandcfg.chanBand = + woal_ieee_band_to_radio_type(chan->band); switch (channel_type) { case CHAN_HT40MINUS: chan_cfg.bandcfg.chan2Offset = SEC_CHAN_BELOW; @@ -6298,13 +6321,13 @@ int woal_cfg80211_sched_scan_start(struct wiphy *wiphy, struct net_device *dev, return -EINVAL; } #if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 4, 0) - PRINTM(MIOCTL, - "%s sched scan: n_ssids=%d n_match_sets=%d n_channels=%d interval=%d ie_len=%d\n", + PRINTM(MCMND, + "%s sched scan: n_ssids=%d n_match_sets=%d n_channels=%d interval=%d iterations=%d ie_len=%d\n", priv->netdev->name, request->n_ssids, request->n_match_sets, request->n_channels, request->scan_plans[0].interval, - (int)request->ie_len); + request->scan_plans[0].iterations, (int)request->ie_len); #else - PRINTM(MIOCTL, + PRINTM(MCMND, "%s sched scan: n_ssids=%d n_match_sets=%d n_channels=%d interval=%d ie_len=%d\n", priv->netdev->name, request->n_ssids, request->n_match_sets, request->n_channels, request->interval, (int)request->ie_len); @@ -6326,7 +6349,8 @@ int woal_cfg80211_sched_scan_start(struct wiphy *wiphy, struct net_device *dev, i++) { chan = request->channels[i]; priv->scan_cfg.chan_list[i].chan_number = chan->hw_value; - priv->scan_cfg.chan_list[i].radio_type = chan->band; + priv->scan_cfg.chan_list[i].radio_type = + woal_ieee_band_to_radio_type(chan->band); if (chan->flags & (IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_RADAR)) priv->scan_cfg.chan_list[i].scan_type = @@ -6368,10 +6392,14 @@ int woal_cfg80211_sched_scan_start(struct wiphy *wiphy, struct net_device *dev, * second */ /* We want to use 30 second for per scan cycle */ priv->scan_cfg.scan_interval = MIN_BGSCAN_INTERVAL; + priv->scan_cfg.repeat_count = 0; + #if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 4, 0) - if (request->scan_plans[0].interval * 1000 > MIN_BGSCAN_INTERVAL) + /* interval in seconds */ + if (request->scan_plans[0].interval) priv->scan_cfg.scan_interval = request->scan_plans[0].interval * 1000; + priv->scan_cfg.repeat_count = request->scan_plans[0].iterations; if (request->n_scan_plans >= 2) { priv->scan_cfg.config_ees = MTRUE; priv->scan_cfg.ees_mode = @@ -6380,24 +6408,23 @@ int woal_cfg80211_sched_scan_start(struct wiphy *wiphy, struct net_device *dev, request->scan_plans[0].interval * 1000; priv->scan_cfg.high_period_count = request->scan_plans[0].iterations; - priv->scan_cfg.mid_period = request->scan_plans[1].interval; - if (request->scan_plans[1].iterations == 0) - priv->scan_cfg.mid_period_count = DEF_REPEAT_COUNT; - else - priv->scan_cfg.mid_period_count = - request->scan_plans[1].iterations; + priv->scan_cfg.mid_period = + request->scan_plans[1].interval * 1000; + priv->scan_cfg.mid_period_count = + request->scan_plans[1].iterations; if (request->n_scan_plans == 3) { priv->scan_cfg.ees_mode |= MBIT(EES_MODE_LOW); priv->scan_cfg.low_period = - request->scan_plans[2].interval; - priv->scan_cfg.low_period_count = DEF_REPEAT_COUNT; + request->scan_plans[2].interval * 1000; + priv->scan_cfg.low_period_count = + request->scan_plans[2].iterations; } } #else - if (request->interval > MIN_BGSCAN_INTERVAL) + /* interval in miliseconds */ + if (request->interval) priv->scan_cfg.scan_interval = request->interval; #endif - priv->scan_cfg.repeat_count = DEF_REPEAT_COUNT; priv->scan_cfg.report_condition = BG_SCAN_SSID_MATCH | BG_SCAN_WAIT_ALL_CHAN_DONE; priv->scan_cfg.bss_type = MLAN_BSS_MODE_INFRA; @@ -6506,8 +6533,10 @@ int woal_cfg80211_resume(struct wiphy *wiphy) woal_inform_bss_from_scan_result( handle->priv[i], NULL, MOAL_IOCTL_WAIT); +#if KERNEL_VERSION(3, 2, 0) <= CFG80211_VERSION_CODE woal_report_sched_scan_result( handle->priv[i]); +#endif handle->priv[i]->last_event = 0; PRINTM(MCMND, "Report sched scan result in cfg80211 resume\n"); @@ -8688,6 +8717,7 @@ void woal_clear_conn_params(moal_private *priv) LEAVE(); } +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 2, 0) /** * @brief Build new roaming connect ie for okc * @@ -8829,6 +8859,7 @@ done: LEAVE(); return ret; } +#endif /** * @brief Start roaming: driver handle roaming @@ -9498,6 +9529,7 @@ static mlan_status woal_cfg80211_init_wiphy(moal_private *priv, wiphy->bands[IEEE80211_BAND_5GHZ]); #endif } + kfree(req); #if CFG80211_VERSION_CODE >= KERNEL_VERSION(2, 6, 38) @@ -9713,6 +9745,7 @@ mlan_status woal_register_cfg80211(moal_private *priv) #endif priv->phandle->band = IEEE80211_BAND_5GHZ; } + /* Supported bands */ if (fw_info.fw_bands & (BAND_B | BAND_G | BAND_GN | BAND_GAC)) { wiphy->bands[IEEE80211_BAND_2GHZ] = @@ -9816,6 +9849,19 @@ mlan_status woal_register_cfg80211(moal_private *priv) #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) wiphy->features |= NL80211_FEATURE_TDLS_CHANNEL_SWITCH; #endif + +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 0, 0) +#define WLAN_EXT_FEATURE_DFS_OFFLOAD 25 + if (moal_extflg_isset(priv->phandle, EXT_DFS_OFFLOAD)) { + if (NUM_NL80211_EXT_FEATURES > WLAN_EXT_FEATURE_DFS_OFFLOAD) { + PRINTM(MCMND, + "wlan: Set NL80211_EXT_FEATURE_DFS_OFFLOAD\n"); + wiphy_ext_feature_set(wiphy, + WLAN_EXT_FEATURE_DFS_OFFLOAD); + } + } +#endif + #if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 6, 0) if (moal_extflg_isset(priv->phandle, EXT_HOST_MLME)) wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_RRM); @@ -9899,6 +9945,14 @@ mlan_status woal_register_cfg80211(moal_private *priv) PRINTM(MIOCTL, "Follow countryIE provided by AP.\n"); } #endif +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) + /*REGULATORY_IGNORE_STALE_KICKOFF: the regulatory core will _not_ make + * sure all interfaces on this wiphy reside on allowed channels. If this + * flag is not set, upon a regdomain change, the interfaces are given a + * grace period (currently 60 seconds) to disconnect or move to an + * allowed channel.*/ + wiphy->regulatory_flags |= REGULATORY_IGNORE_STALE_KICKOFF; +#endif memset(&priv->phandle->country_code, 0, sizeof(priv->phandle->country_code)); @@ -9938,9 +9992,7 @@ mlan_status woal_register_cfg80211(moal_private *priv) wiphy->interface_modes &= ~(MBIT(NL80211_IFTYPE_MONITOR)); #if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 0, 0) - if (fw_info.force_reg || - (priv->phandle->params.txpwrlimit_cfg && - priv->phandle->params.cntry_txpwr == CNTRY_RGPOWER_MODE)) { + if (fw_info.force_reg) { PRINTM(MCMND, "FW region_code=%d force_reg=%d\n", fw_info.region_code, fw_info.force_reg); country = region_code_2_string(fw_info.region_code); diff --git a/mxm_wifiex/wlan_src/mlinux/moal_uap.c b/mxm_wifiex/wlan_src/mlinux/moal_uap.c index 8fba862..4381a09 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_uap.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_uap.c @@ -2121,8 +2121,8 @@ int woal_11h_chan_dfs_state(moal_private *priv, t_u8 action, #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) if (action == MLAN_ACT_GET) { if (IS_UAP_CFG80211(cfg80211_wext)) { - ret = woal_get_wiphy_chan_dfs_state(priv->wdev->wiphy, - ch_dfs_state); + ret = woal_get_wiphy_chan_dfs_state( + priv->phandle->wiphy, ch_dfs_state); if (!ret) { LEAVE(); return ret; @@ -2208,11 +2208,11 @@ static int woal_uap_skip_cac(struct net_device *dev, struct ifreq *req) goto done; if (param.skip_cac && ch_dfs_state.dfs_state == DFS_USABLE) PRINTM(MMSG, - "ZeroDFS: Requst skip cac on the channel %d which hasn't do CAC before!\n", + "DFS: Requst skip cac on the channel %d which hasn't do CAC before!\n", param.channel); ch_dfs_state.dfs_state = dfs_state; woal_11h_chan_dfs_state(priv, MLAN_ACT_SET, &ch_dfs_state); - PRINTM(MCMND, "ZeroDFS: Skip CAC on chan %d %d\n", param.channel, + PRINTM(MCMND, "DFS: Skip CAC on chan %d %d\n", param.channel, param.skip_cac); #ifdef UAP_CFG80211 #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) diff --git a/mxm_wifiex/wlan_src/mlinux/moal_uap_cfg80211.c b/mxm_wifiex/wlan_src/mlinux/moal_uap_cfg80211.c index 8c89bc7..a8091e0 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_uap_cfg80211.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_uap_cfg80211.c @@ -138,8 +138,17 @@ static int woal_deauth_assoc_station(moal_private *priv, u8 *mac_addr, for (i = 0; i < info->param.sta_list.sta_count; i++) { if (!memcmp(info->param.sta_list.info[i].mac_address, mac_addr, - ETH_ALEN)) + ETH_ALEN)) { + PRINTM(MMSG, "wlan: deauth station " MACSTR "\n", + MAC2STR(mac_addr)); ret = woal_deauth_station(priv, mac_addr, reason_code); +#if KERNEL_VERSION(3, 8, 0) <= CFG80211_VERSION_CODE + if (moal_extflg_isset(priv->phandle, EXT_HOST_MLME)) + cfg80211_del_sta(priv->netdev, mac_addr, + GFP_KERNEL); +#endif + break; + } } done: @@ -673,11 +682,17 @@ static void woal_convert_chan_to_bandconfig(moal_private *priv, struct cfg80211_chan_def *chandef) { ENTER(); - - if (chandef->chan->hw_value <= MAX_BG_CHANNEL) + memset(bandcfg, 0, sizeof(Band_Config_t)); + switch (chandef->chan->band) { + case NL80211_BAND_2GHZ: bandcfg->chanBand = BAND_2GHZ; - else + break; + case NL80211_BAND_5GHZ: bandcfg->chanBand = BAND_5GHZ; + break; + default: + break; + } switch (chandef->width) { case NL80211_CHAN_WIDTH_20_NOHT: case NL80211_CHAN_WIDTH_20: @@ -700,10 +715,16 @@ static void woal_convert_chan_to_bandconfig(moal_private *priv, default: break; } + PRINTM(MCMND, + "cfg80211 AP: channel=%d, chanBand=0x%x chanWidth=0x%x chan2Offset=0x%x\n", + chandef->chan->hw_value, bandcfg->chanBand, bandcfg->chanWidth, + bandcfg->chan2Offset); LEAVE(); return; } +#endif +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 12, 0) /** * @brief Enable radar detect for DFS channel * @@ -851,8 +872,10 @@ static int woal_cfg80211_beacon_config(moal_private *priv, int GoAgeoutTime = priv->phandle->params.GoAgeoutTime; #endif #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 12, 0) - mlan_ds_11h_chan_nop_info chan_nop_info; Band_Config_t bandcfg; +#endif +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 12, 0) + mlan_ds_11h_chan_nop_info chan_nop_info; #endif ENTER(); @@ -955,12 +978,14 @@ static int woal_cfg80211_beacon_config(moal_private *priv, sizeof(struct cfg80211_chan_def), sizeof(priv->chan)); #endif +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 12, 0) + woal_convert_chan_to_bandconfig(priv, &bandcfg, ¶ms->chandef); +#endif + #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 12, 0) if (priv->phandle->usr_nop_period_sec) { PRINTM(MCMND, "Checking if AP's channel %d is under NOP\n", priv->channel); - woal_convert_chan_to_bandconfig(priv, &bandcfg, - ¶ms->chandef); memset(&chan_nop_info, 0, sizeof(chan_nop_info)); chan_nop_info.curr_chan = priv->channel; chan_nop_info.chan_width = bandcfg.chanWidth; @@ -1088,6 +1113,11 @@ 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, 12, 0) + moal_memcpy_ext(priv->phandle, &sys_config->bandcfg, &bandcfg, + sizeof(bandcfg), sizeof(bandcfg)); +#endif + #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) enable_11ac = woal_check_11ac_capability( priv, sys_config->bandcfg.chanBand, params); @@ -1295,7 +1325,7 @@ static int woal_cfg80211_beacon_config(moal_private *priv, (priv->cipher == WLAN_CIPHER_SUITE_WEP104)) { sys_config->protocol = PROTOCOL_STATIC_WEP; sys_config->key_mgmt = KEY_MGMT_NONE; - sys_config->.wpa_cfg.length = 0; + sys_config->wpa_cfg.length = 0; moal_memcpy_ext(priv->phandle, &sys_config->wep_cfg.key0, &priv->uap_wep_key[0], sizeof(wep_key), sizeof(sys_config->wep_cfg.key0)); @@ -2825,6 +2855,11 @@ int woal_cfg80211_del_station(struct wiphy *wiphy, struct net_device *dev, if (moal_extflg_isset(priv->phandle, EXT_DFS_OFFLOAD)) woal_cancel_cac_block(priv); #endif + if (priv->media_connected == MFALSE) { + PRINTM(MINFO, "cfg80211: Media not connected!\n"); + LEAVE(); + return 0; + } #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) if (param) { @@ -2832,23 +2867,10 @@ int woal_cfg80211_del_station(struct wiphy *wiphy, struct net_device *dev, reason_code = param->reason_code; } #endif -#if KERNEL_VERSION(3, 8, 0) <= CFG80211_VERSION_CODE - if (moal_extflg_isset(priv->phandle, EXT_HOST_MLME)) { - if (mac_addr) - cfg80211_del_sta(dev, mac_addr, GFP_KERNEL); - } -#endif - if (priv->media_connected == MFALSE) { - PRINTM(MINFO, "cfg80211: Media not connected!\n"); - LEAVE(); - return 0; - } /** we will not send deauth to p2p interface, it might cause WPS failure */ if (mac_addr) { - PRINTM(MMSG, "wlan: deauth station " MACSTR "\n", - MAC2STR(mac_addr)); #ifdef WIFI_DIRECT_SUPPORT if (!priv->phandle->is_go_timer_set) #endif @@ -3276,10 +3298,8 @@ static void woal_switch_uap_channel(moal_private *priv, t_u8 wait_option) priv->csa_chan.width); break; } - if (priv->csa_chan.chan->band == IEEE80211_BAND_2GHZ) - uap_channel.bandcfg.chanBand = BAND_2GHZ; - else if (priv->csa_chan.chan->band == IEEE80211_BAND_5GHZ) - uap_channel.bandcfg.chanBand = BAND_5GHZ; + uap_channel.bandcfg.chanBand = + woal_ieee_band_to_radio_type(priv->csa_chan.chan->band); uap_channel.bandcfg.chan2Offset = chan2Offset; if (MLAN_STATUS_SUCCESS != woal_set_get_ap_channel(priv, MLAN_ACT_SET, wait_option, @@ -3327,6 +3347,7 @@ void woal_csa_work_queue(struct work_struct *work) LEAVE(); } +#if KERNEL_VERSION(3, 12, 0) <= CFG80211_VERSION_CODE /* * @brief handle WOAL_EVENT_CANCEL_CHANRPT * @@ -3336,7 +3357,6 @@ void woal_csa_work_queue(struct work_struct *work) */ void woal_process_cancel_chanrpt_event(moal_private *priv) { -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 12, 0) if (priv->phandle->is_cac_timer_set && priv->bss_index == priv->phandle->cac_bss_index) { woal_cancel_timer(&priv->phandle->cac_timer); @@ -3354,8 +3374,8 @@ void woal_process_cancel_chanrpt_event(moal_private *priv) sizeof(struct cfg80211_chan_def)); priv->phandle->cac_bss_index = 0xff; } -#endif } +#endif #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 15, 0) /**