diff --git a/mxm_wifiex/wlan_src/Makefile b/mxm_wifiex/wlan_src/Makefile index 0a48aa9..56bed75 100644 --- a/mxm_wifiex/wlan_src/Makefile +++ b/mxm_wifiex/wlan_src/Makefile @@ -44,6 +44,9 @@ CONFIG_USB8997=n CONFIG_PCIE8997=y CONFIG_SD8987=y CONFIG_SD9097=n +CONFIG_SD9177=n +CONFIG_SD8801=n +CONFIG_USB8801=n CONFIG_USB9097=n CONFIG_PCIE9097=n CONFIG_SD9098=n @@ -241,10 +244,22 @@ ifeq ($(CONFIG_SD9097),y) CONFIG_SDIO=y ccflags-y += -DSD9097 endif +ifeq ($(CONFIG_SD9177),y) + CONFIG_SDIO=y + ccflags-y += -DSD9177 +endif +ifeq ($(CONFIG_SD8801),y) + CONFIG_SDIO=y + ccflags-y += -DSD8801 +endif ifeq ($(CONFIG_SD9098),y) CONFIG_SDIO=y ccflags-y += -DSD9098 endif +ifeq ($(CONFIG_USB8801),y) + CONFIG_MUSB=y + ccflags-y += -DUSB8801 +endif ifeq ($(CONFIG_USB8897),y) CONFIG_MUSB=y ccflags-y += -DUSB8897 @@ -319,6 +334,10 @@ endif #ccflags-y += -Wmissing-include-dirs #ccflags-y += -Wshadow #ccflags-y += -Wsign-compare +#ccflags-y += -Wunused-macros +#ccflags-y += -Wmissing-field-initializers +#ccflags-y += -Wstringop-truncation +#ccflags-y += -Wmisleading-indentation ############################################################################# # Make Targets ############################################################################# diff --git a/mxm_wifiex/wlan_src/README_MLAN b/mxm_wifiex/wlan_src/README_MLAN index f9ed20b..27ead6d 100644 --- a/mxm_wifiex/wlan_src/README_MLAN +++ b/mxm_wifiex/wlan_src/README_MLAN @@ -98,6 +98,7 @@ rx_work=0|1|2 pcie_int_mode=0|1|2 pcie_int_mode=0|1 + ring_size=32|64|128|256|512 aggrctrl=1|0 usb_aggr=0|1|2 low_power_mode_enable=0|1 @@ -437,6 +438,7 @@ SYNOPSIS mlanutl mlanX 11axcmd mlanutl mlanX txratecfg [l] [m] [n] [o] mlanutl uapX txratecfg [l] [m] [n] [o] + mlanutl mlanX hssetpara condition [GPIO# [gap]] [ind_GPIO# [level]] DESCRIPTION Those commands are used to send additional commands to the NXP MLAN @@ -1288,3 +1290,116 @@ txratecfg STBC is 1, DMC is 0, Coding is 1, maxPE is 2. mlanutl mlan0 txratecfg 0xff : Disable fixed rate and uses auto rate +hssetpara + This command is used to set host sleep parameters. + + Usage: + mlanutl mlanX hssetpara condition [GPIO# [gap]] (optional)[type ind_GPIO# [level]] (optional)[type event_force_ignore event_use_ext_gap ext_gap [gpio_wave]] (optional)[type hs_wakeup_interval] + + This command takes one (condition), two (condition and GPIO#) or three + (condition, GPIO# and gap).If more than three parameters, it can set different or multiple features indicating by type and + the detailed usage is the same as hscfg above. + + where Condition is: + bit 0 = 1 -- broadcast data + bit 1 = 1 -- unicast data + bit 2 = 1 -- mac event + bit 3 = 1 -- multicast data + bit 6 = 1 -- Wakeup when mgmt frame received. + Bit 31 = 1 -- Don't wakeup when IPV6 packet received. + + The host sleep mode will be canceled if condition is set to -1. The default is 0x7. + + where GPIO is the pin number of GPIO used to wakeup the host. It could be any valid + GPIO pin# (e.g. 0-7) or 0xff (interface, e.g. SDIO will be used instead). + The default is 0xff. + + where Gap is the gap in milliseconds between wakeup signal and wakeup event or 0xff + for special setting (host acknowledge required) when GPIO is used to wakeup host. + The default is 200. + + The host sleep set except for cancellation will be blocked if host sleep is + already activated. + + where ind_GPIO# is the pin number of GPIO used to indicate wakeup source. The level on + this GPIO will indicate normal wakeup source or abnormal wakeup source. + + where level is used to set level(0/1) on ind_GPIO# pin for indication normal wakeup source. + The opposite level will indicate abnormal wakeup source. The default value is 0. + + where event_force_ignore is a bitmap,each bit represent one wakeup reason event. Set the bit means this + wakeup reason should be force ignored in firmware. Reset the bit means do not handle this reason. + + where event_use_ext_gap is a bitmap, each bit represent one wakeup reason event. Set the bit means this + wakeup reason should use ext_gap to indicate host. Reset the bit means do not handle this reason. + + where event_force_ignore and event_use_ext_gap have the same wakeup reason event definition of each bit: + bit 0 = 1 --Disconnect + bit 1 = 1 --GTK/iGTK rekey failure + bit 2 = 1 --Eapol + other bits --Reserved + They should not set both for one same wakeup reason. + + where ext_gap is the extend gap based on third parameter Gap. Only valid when use_ext_gap is used. + The total gap is (Gap + (x+1)*ext_gap). x means the bit number(start from 0) of this reason in use_ext_gap. + + where gpio_wave is used to set GPIO wave level for hscfg extend. 0 means falling edge, 1 means rising edge. + This parameter is optional and default value is 0. + + where hs_wakeup_interval is used to set host sleep wakeup interval and the type must set to 3 to indicate + this feature. And the value will round to the nearest multiple dtim*beacon_interval in fw. The unit is milliseconds. + + Examples: + mlanutl mlan0 hssetpara -1 : Cancel host sleep mode + mlanutl mlan0 hssetpara 3 : Broadcast and unicast data + Use GPIO and gap set previously + mlanutl mlan0 hssetpara 2 3 : Unicast data + Use GPIO 3 and gap set previously + mlanutl mlan0 hssetpara 2 1 0xa0 : Unicast data + Use GPIO 1 and gap 160 ms + mlanutl mlan0 hssetpara 2 0xff : Unicast data + Use interface (e.g. SDIO) + Use gap set previously + mlanutl mlan0 hssetpara 4 3 0xff : MAC event + Use GPIO 3 + Special host sleep mode + mlanutl mlan0 hssetpara 1 0xff 0xff : Broadcast data + + mlanutl mlan0 hssetpara 2 1 0xa0 1 5 1 : Unicast data + Use GPIO 1 + Gap 160 ms + type=1 to set indication GPIO feature + Use GPIO 5 to indicate wakeup source + High level on GPIO 5 means this is a normal wakeup + mlanutl mlan0 hssetpara 2 1 0xa0 1 5 : Unicast data + Use GPIO 1 + Gap 160 ms + type=1 to set indication GPIO feature + Use GPIO 5 to indicate wakeup source + Use level set previously. + + mlanutl mlan0 hssetpara 2 1 0xa0 2 0 0x1 10 1: Unicast data + Use GPIO 1 + Gap 160 ms + type=2 to set extend hscfg feature + Force_ignore not used + Disconnect will use extend gap to indicate host + Use gap 170. + Rising edge + mlanutl mlan0 hssetpara 2 1 0xa0 2 0x1 0 0 0: Unicast data + Use GPIO 1 + Gap 160 ms + type=2 to set extend hscfg feature + Falling edge + Force ignore Disconnect + Extend gap not used + Not used. + Falling edge + mlanutl mlan0 hssetpara 2 1 0xa0 3 400: Unicast data + Use GPIO 1 + Gap 160 ms + type=3 to set hs_wakeup_interval feature + hs_wakeup_interval set to 400ms + + Note: The parameters will be saved in the driver and be used when host suspends. + The ind_GPIO# and level parameters only work with specific board and firmware. diff --git a/mxm_wifiex/wlan_src/mapp/mlanutl/mlanutl.c b/mxm_wifiex/wlan_src/mapp/mlanutl/mlanutl.c index a5b32ed..05f9b8f 100644 --- a/mxm_wifiex/wlan_src/mapp/mlanutl/mlanutl.c +++ b/mxm_wifiex/wlan_src/mapp/mlanutl/mlanutl.c @@ -49,26 +49,12 @@ Change log: /** mlanutl version number */ #define MLANUTL_VER "M1.3.02" -/** Initial number of total private ioctl calls */ -#define IW_INIT_PRIV_NUM 128 -/** Maximum number of total private ioctl calls supported */ -#define IW_MAX_PRIV_NUM 1024 - /** Termination flag */ int terminate_flag = 0; /******************************************************** Local Variables ********************************************************/ -#define BAND_B (1U << 0) -#define BAND_G (1U << 1) -#define BAND_A (1U << 2) -#define BAND_GN (1U << 3) -#define BAND_AN (1U << 4) -#define BAND_GAC (1U << 5) -#define BAND_AAC (1U << 6) -#define BAND_GAX (1U << 8) -#define BAND_AAX (1U << 9) /** Stringification of rateId enumeration */ const char *rateIdStr[] = {"1", "2", "5.5", "11", "--", "6", "9", "12", @@ -95,10 +81,11 @@ const char *rateIdStr[] = {"1", "2", "5.5", "11", "--", "6", "9", "12", #define MFW_D MBIT(19) #define MIF_D MBIT(20) +#ifdef DEBUG_LEVEL2 #define MENTRY MBIT(28) #define MWARN MBIT(29) #define MINFO MBIT(30) -#define MHEX_DUMP MBIT(31) +#endif #endif static int process_version(int argc, char *argv[]); @@ -125,6 +112,7 @@ static int process_htcapinfo(int argc, char *argv[]); static int process_addbapara(int argc, char *argv[]); static int process_aggrpriotbl(int argc, char *argv[]); static int process_addbareject(int argc, char *argv[]); +static int process_hssetpara(int argc, char *argv[]); struct command_node command_list[] = { {"version", process_version}, @@ -152,6 +140,7 @@ struct command_node command_list[] = { {"addbareject", process_addbareject}, {"httxcfg", process_httxcfg}, {"htcapinfo", process_htcapinfo}, + {"hssetpara", process_hssetpara}, }; static char *usage[] = { @@ -186,6 +175,7 @@ static char *usage[] = { " aggrpriotbl", " addbapara", " addbareject", + " hssetpara", }; /** Socket */ @@ -379,7 +369,7 @@ static int prepare_buffer(t_u8 *buffer, char *cmd, t_u32 num, char *args[]) /* Flag it for our use */ pos = buffer; - strncpy((char *)pos, CMD_NXP, strlen(CMD_NXP)); + memcpy((char *)pos, CMD_NXP, strlen(CMD_NXP)); pos += (strlen(CMD_NXP)); /* Insert command */ @@ -391,7 +381,7 @@ static int prepare_buffer(t_u8 *buffer, char *cmd, t_u32 num, char *args[]) strncpy((char *)pos, args[i], strlen(args[i])); pos += strlen(args[i]); if (i < (num - 1)) { - strncpy((char *)pos, " ", strlen(" ")); + memcpy((char *)pos, " ", strlen(" ")); pos += 1; } } @@ -3623,6 +3613,67 @@ int process_host_cmd_resp(char *cmd_name, t_u8 *buf) return ret; } +/** + * @brief Process hssetpara configuration + * @param argc Number of arguments + * @param argv A pointer to arguments array + * @return MLAN_STATUS_SUCCESS--success, otherwise--fail + */ +static int process_hssetpara(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: hssetpara fail\n"); + if (cmd) + free(cmd); + if (buffer) + free(buffer); + return MLAN_STATUS_FAILURE; + } + + if (buffer) + free(buffer); + if (cmd) + free(cmd); + + return MLAN_STATUS_SUCCESS; +} + /******************************************************** Global Functions ********************************************************/ diff --git a/mxm_wifiex/wlan_src/mlan/mlan_11d.c b/mxm_wifiex/wlan_src/mlan/mlan_11d.c index f8463f2..a3ef84e 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_11d.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_11d.c @@ -71,32 +71,55 @@ static region_code_mapping_t region_code_mapping[] = { /* Following two structures define the supported channels */ /** Channels for 802.11b/g */ static chan_freq_power_t channel_freq_power_UN_BG[] = { - {1, 2412, TX_PWR_DEFAULT}, {2, 2417, TX_PWR_DEFAULT}, - {3, 2422, TX_PWR_DEFAULT}, {4, 2427, TX_PWR_DEFAULT}, - {5, 2432, TX_PWR_DEFAULT}, {6, 2437, TX_PWR_DEFAULT}, - {7, 2442, TX_PWR_DEFAULT}, {8, 2447, TX_PWR_DEFAULT}, - {9, 2452, TX_PWR_DEFAULT}, {10, 2457, TX_PWR_DEFAULT}, - {11, 2462, TX_PWR_DEFAULT}, {12, 2467, TX_PWR_DEFAULT}, - {13, 2472, TX_PWR_DEFAULT}, {14, 2484, TX_PWR_DEFAULT}}; + {1, 2412, TX_PWR_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {2, 2417, TX_PWR_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {3, 2422, TX_PWR_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {4, 2427, TX_PWR_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {5, 2432, TX_PWR_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {6, 2437, TX_PWR_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {7, 2442, TX_PWR_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {8, 2447, TX_PWR_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {9, 2452, TX_PWR_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {10, 2457, TX_PWR_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {11, 2462, TX_PWR_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {12, 2467, TX_PWR_DEFAULT, MFALSE, {0x1d, 0, 0}}, + {13, 2472, TX_PWR_DEFAULT, MFALSE, {0x1d, 0, 0}}, + {14, 2484, TX_PWR_DEFAULT, MFALSE, {0x1d, 0, 0}}, +}; /** Channels for 802.11a/j */ static chan_freq_power_t channel_freq_power_UN_AJ[] = { - {8, 5040, TX_PWR_DEFAULT}, {12, 5060, TX_PWR_DEFAULT}, - {16, 5080, TX_PWR_DEFAULT}, {34, 5170, TX_PWR_DEFAULT}, - {38, 5190, TX_PWR_DEFAULT}, {42, 5210, TX_PWR_DEFAULT}, - {46, 5230, TX_PWR_DEFAULT}, {36, 5180, TX_PWR_DEFAULT}, - {40, 5200, TX_PWR_DEFAULT}, {44, 5220, TX_PWR_DEFAULT}, - {48, 5240, TX_PWR_DEFAULT}, {52, 5260, TX_PWR_DEFAULT}, - {56, 5280, TX_PWR_DEFAULT}, {60, 5300, TX_PWR_DEFAULT}, - {64, 5320, TX_PWR_DEFAULT}, {100, 5500, TX_PWR_DEFAULT}, - {104, 5520, TX_PWR_DEFAULT}, {108, 5540, TX_PWR_DEFAULT}, - {112, 5560, TX_PWR_DEFAULT}, {116, 5580, TX_PWR_DEFAULT}, - {120, 5600, TX_PWR_DEFAULT}, {124, 5620, TX_PWR_DEFAULT}, - {128, 5640, TX_PWR_DEFAULT}, {132, 5660, TX_PWR_DEFAULT}, - {136, 5680, TX_PWR_DEFAULT}, {140, 5700, TX_PWR_DEFAULT}, - {149, 5745, TX_PWR_DEFAULT}, {153, 5765, TX_PWR_DEFAULT}, - {157, 5785, TX_PWR_DEFAULT}, {161, 5805, TX_PWR_DEFAULT}, - {165, 5825, TX_PWR_DEFAULT}, + {8, 5040, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {12, 5060, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {16, 5080, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {34, 5170, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {36, 5180, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {38, 5190, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {40, 5200, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {42, 5210, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {44, 5220, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {46, 5230, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {48, 5240, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {52, 5260, TX_PWR_DEFAULT, MTRUE, {0x13, 0, 0}}, + {56, 5280, TX_PWR_DEFAULT, MTRUE, {0x13, 0, 0}}, + {60, 5300, TX_PWR_DEFAULT, MTRUE, {0x13, 0, 0}}, + {64, 5320, TX_PWR_DEFAULT, MTRUE, {0x13, 0, 0}}, + {100, 5500, TX_PWR_DEFAULT, MTRUE, {0x13, 0, 0}}, + {104, 5520, TX_PWR_DEFAULT, MTRUE, {0x13, 0, 0}}, + {108, 5540, TX_PWR_DEFAULT, MTRUE, {0x13, 0, 0}}, + {112, 5560, TX_PWR_DEFAULT, MTRUE, {0x13, 0, 0}}, + {116, 5580, TX_PWR_DEFAULT, MTRUE, {0x13, 0, 0}}, + {120, 5600, TX_PWR_DEFAULT, MTRUE, {0x13, 0, 0}}, + {124, 5620, TX_PWR_DEFAULT, MTRUE, {0x13, 0, 0}}, + {128, 5640, TX_PWR_DEFAULT, MTRUE, {0x13, 0, 0}}, + {132, 5660, TX_PWR_DEFAULT, MTRUE, {0x13, 0, 0}}, + {136, 5680, TX_PWR_DEFAULT, MTRUE, {0x13, 0, 0}}, + {140, 5700, TX_PWR_DEFAULT, MTRUE, {0x13, 0, 0}}, + {149, 5745, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {153, 5765, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {157, 5785, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {161, 5805, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {165, 5825, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}} /* {240, 4920, TX_PWR_DEFAULT}, {244, 4940, TX_PWR_DEFAULT}, {248, 4960, TX_PWR_DEFAULT}, diff --git a/mxm_wifiex/wlan_src/mlan/mlan_11h.c b/mxm_wifiex/wlan_src/mlan/mlan_11h.c index ef40e43..0781cc0 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_11h.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_11h.c @@ -1332,9 +1332,6 @@ wlan_11h_prepare_custom_ie_chansw(mlan_adapter *pmadapter, } #ifdef UAP_SUPPORT -/** Bits 2,3 of band config define the band width */ -#define UAP_BAND_WIDTH_MASK 0x0C - /** * @brief Check if start channel 165 is allowed to operate in * previous uAP channel's band config diff --git a/mxm_wifiex/wlan_src/mlan/mlan_cfp.c b/mxm_wifiex/wlan_src/mlan/mlan_cfp.c index de6dd2f..80cdc4a 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_cfp.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_cfp.c @@ -48,10 +48,6 @@ /** 200mW */ #define WLAN_TX_PWR_JP_A_DEFAULT 23 /** 100mW */ -#define WLAN_TX_PWR_FR_100MW 20 -/** 10mW */ -#define WLAN_TX_PWR_FR_10MW 10 -/** 100mW */ #define WLAN_TX_PWR_EMEA_DEFAULT 20 /** 2000mW */ #define WLAN_TX_PWR_CN_2000MW 33 @@ -59,12 +55,6 @@ #define WLAN_TX_PWR_200MW 23 /** 1000mW */ #define WLAN_TX_PWR_1000MW 30 -/** 30mW */ -#define WLAN_TX_PWR_SP_30MW 14 -/** 60mW */ -#define WLAN_TX_PWR_SP_60MW 17 -/** 25mW */ -#define WLAN_TX_PWR_25MW 14 /** 250mW */ #define WLAN_TX_PWR_250MW 24 @@ -122,119 +112,118 @@ typedef struct _cfp_table { /* Format { Channel, Frequency (MHz), MaxTxPower } */ /** Band : 'B/G', Region: World Wide Safe */ static chan_freq_power_t channel_freq_power_00_BG[] = { - {1, 2412, WLAN_TX_PWR_00_DEFAULT, MFALSE, {0x1c, 0}}, - {2, 2417, WLAN_TX_PWR_00_DEFAULT, MFALSE, {0x1c, 0}}, - {3, 2422, WLAN_TX_PWR_00_DEFAULT, MFALSE, {0x1c, 0}}, - {4, 2427, WLAN_TX_PWR_00_DEFAULT, MFALSE, {0x1c, 0}}, - {5, 2432, WLAN_TX_PWR_00_DEFAULT, MFALSE, {0x1c, 0}}, - {6, 2437, WLAN_TX_PWR_00_DEFAULT, MFALSE, {0x1c, 0}}, - {7, 2442, WLAN_TX_PWR_00_DEFAULT, MFALSE, {0x1c, 0}}, - {8, 2447, WLAN_TX_PWR_00_DEFAULT, MFALSE, {0x1c, 0}}, - {9, 2452, WLAN_TX_PWR_00_DEFAULT, MFALSE, {0x1c, 0}}, - {10, 2457, WLAN_TX_PWR_00_DEFAULT, MFALSE, {0x1c, 0}}, - {11, 2462, WLAN_TX_PWR_00_DEFAULT, MFALSE, {0x1c, 0}}, - {12, 2467, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x1f, 0}}, - {13, 2472, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x1f, 0}}}; + {1, 2412, WLAN_TX_PWR_00_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {2, 2417, WLAN_TX_PWR_00_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {3, 2422, WLAN_TX_PWR_00_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {4, 2427, WLAN_TX_PWR_00_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {5, 2432, WLAN_TX_PWR_00_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {6, 2437, WLAN_TX_PWR_00_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {7, 2442, WLAN_TX_PWR_00_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {8, 2447, WLAN_TX_PWR_00_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {9, 2452, WLAN_TX_PWR_00_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {10, 2457, WLAN_TX_PWR_00_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {11, 2462, WLAN_TX_PWR_00_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {12, 2467, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x1d, 0, 0}}, + {13, 2472, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x1d, 0, 0}}}; /* Format { Channel, Frequency (MHz), MaxTxPower } */ /** Band: 'B/G', Region: USA FCC/Canada IC */ static chan_freq_power_t channel_freq_power_US_BG[] = { - {1, 2412, WLAN_TX_PWR_US_DEFAULT, MFALSE}, - {2, 2417, WLAN_TX_PWR_US_DEFAULT, MFALSE}, - {3, 2422, WLAN_TX_PWR_US_DEFAULT, MFALSE}, - {4, 2427, WLAN_TX_PWR_US_DEFAULT, MFALSE}, - {5, 2432, WLAN_TX_PWR_US_DEFAULT, MFALSE}, - {6, 2437, WLAN_TX_PWR_US_DEFAULT, MFALSE}, - {7, 2442, WLAN_TX_PWR_US_DEFAULT, MFALSE}, - {8, 2447, WLAN_TX_PWR_US_DEFAULT, MFALSE}, - {9, 2452, WLAN_TX_PWR_US_DEFAULT, MFALSE}, - {10, 2457, WLAN_TX_PWR_US_DEFAULT, MFALSE}, - {11, 2462, WLAN_TX_PWR_US_DEFAULT, MFALSE}}; + {1, 2412, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {2, 2417, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {3, 2422, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {4, 2427, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {5, 2432, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {6, 2437, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {7, 2442, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {8, 2447, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {9, 2452, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {10, 2457, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {11, 2462, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x1c, 0, 0}}}; /** Band: 'B/G', Region: Europe ETSI/China */ static chan_freq_power_t channel_freq_power_EU_BG[] = { - {1, 2412, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE}, - {2, 2417, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE}, - {3, 2422, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE}, - {4, 2427, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE}, - {5, 2432, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE}, - {6, 2437, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE}, - {7, 2442, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE}, - {8, 2447, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE}, - {9, 2452, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE}, - {10, 2457, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE}, - {11, 2462, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE}, - {12, 2467, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE}, - {13, 2472, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE}}; + {1, 2412, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {2, 2417, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {3, 2422, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {4, 2427, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {5, 2432, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {6, 2437, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {7, 2442, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {8, 2447, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {9, 2452, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {10, 2457, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {11, 2462, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {12, 2467, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x1d, 0, 0}}, + {13, 2472, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x1d, 0, 0}}}; /** Band: 'B/G', Region: Japan */ static chan_freq_power_t channel_freq_power_JPN41_BG[] = { - {1, 2412, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}, - {2, 2417, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}, - {3, 2422, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}, - {4, 2427, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}, - {5, 2432, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}, - {6, 2437, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}, - {7, 2442, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}, - {8, 2447, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}, - {9, 2452, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}, - {10, 2457, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}, - {11, 2462, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}, - {12, 2467, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}, - {13, 2472, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}}; + {1, 2412, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {2, 2417, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {3, 2422, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {4, 2427, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {5, 2432, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {6, 2437, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {7, 2442, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {8, 2447, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {9, 2452, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {10, 2457, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {11, 2462, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {12, 2467, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1d, 0, 0}}, + {13, 2472, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1d, 0, 0}}}; /** Band: 'B/G', Region: Japan */ static chan_freq_power_t channel_freq_power_JPN40_BG[] = { - {14, 2484, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}}; + {14, 2484, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1d, 0, 0}}}; /** Band: 'B/G', Region: Japan */ static chan_freq_power_t channel_freq_power_JPNFE_BG[] = { - {1, 2412, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}, - {2, 2417, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}, - {3, 2422, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}, - {4, 2427, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}, - {5, 2432, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}, - {6, 2437, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}, - {7, 2442, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}, - {8, 2447, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}, - {9, 2452, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}, - {10, 2457, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}, - {11, 2462, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}, - {12, 2467, WLAN_TX_PWR_JP_BG_DEFAULT, MTRUE}, - {13, 2472, WLAN_TX_PWR_JP_BG_DEFAULT, MTRUE}}; + {1, 2412, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {2, 2417, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {3, 2422, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {4, 2427, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {5, 2432, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {6, 2437, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {7, 2442, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {8, 2447, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {9, 2452, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {10, 2457, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {11, 2462, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {12, 2467, WLAN_TX_PWR_JP_BG_DEFAULT, MTRUE, {0x1d, 0, 0}}, + {13, 2472, WLAN_TX_PWR_JP_BG_DEFAULT, MTRUE, {0x1d, 0, 0}}}; /** Band : 'B/G', Region: Brazil */ static chan_freq_power_t channel_freq_power_BR_BG[] = { - {1, 2412, WLAN_TX_PWR_1000MW, MFALSE}, - {2, 2417, WLAN_TX_PWR_1000MW, MFALSE}, - {3, 2422, WLAN_TX_PWR_1000MW, MFALSE}, - {4, 2427, WLAN_TX_PWR_1000MW, MFALSE}, - {5, 2432, WLAN_TX_PWR_1000MW, MFALSE}, - {6, 2437, WLAN_TX_PWR_1000MW, MFALSE}, - {7, 2442, WLAN_TX_PWR_1000MW, MFALSE}, - {8, 2447, WLAN_TX_PWR_1000MW, MFALSE}, - {9, 2452, WLAN_TX_PWR_1000MW, MFALSE}, - {10, 2457, WLAN_TX_PWR_1000MW, MFALSE}, - {11, 2462, WLAN_TX_PWR_1000MW, MFALSE}, - {12, 2467, WLAN_TX_PWR_1000MW, MFALSE}, - {13, 2472, WLAN_TX_PWR_1000MW, MFALSE}, -}; + {1, 2412, WLAN_TX_PWR_1000MW, MFALSE, {0x1c, 0, 0}}, + {2, 2417, WLAN_TX_PWR_1000MW, MFALSE, {0x1c, 0, 0}}, + {3, 2422, WLAN_TX_PWR_1000MW, MFALSE, {0x1c, 0, 0}}, + {4, 2427, WLAN_TX_PWR_1000MW, MFALSE, {0x1c, 0, 0}}, + {5, 2432, WLAN_TX_PWR_1000MW, MFALSE, {0x1c, 0, 0}}, + {6, 2437, WLAN_TX_PWR_1000MW, MFALSE, {0x1c, 0, 0}}, + {7, 2442, WLAN_TX_PWR_1000MW, MFALSE, {0x1c, 0, 0}}, + {8, 2447, WLAN_TX_PWR_1000MW, MFALSE, {0x1c, 0, 0}}, + {9, 2452, WLAN_TX_PWR_1000MW, MFALSE, {0x1c, 0, 0}}, + {10, 2457, WLAN_TX_PWR_1000MW, MFALSE, {0x1c, 0, 0}}, + {11, 2462, WLAN_TX_PWR_1000MW, MFALSE, {0x1c, 0, 0}}, + {12, 2467, WLAN_TX_PWR_1000MW, MFALSE, {0x1d, 0, 0}}, + {13, 2472, WLAN_TX_PWR_1000MW, MFALSE, {0x1d, 0, 0}}}; /** Band : 'B/G', Region: Special */ static chan_freq_power_t channel_freq_power_SPECIAL_BG[] = { - {1, 2412, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}, - {2, 2417, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}, - {3, 2422, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}, - {4, 2427, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}, - {5, 2432, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}, - {6, 2437, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}, - {7, 2442, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}, - {8, 2447, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}, - {9, 2452, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}, - {10, 2457, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}, - {11, 2462, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}, - {12, 2467, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}, - {13, 2472, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}, - {14, 2484, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE}}; + {1, 2412, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {2, 2417, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {3, 2422, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {4, 2427, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {5, 2432, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {6, 2437, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {7, 2442, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {8, 2447, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {9, 2452, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {10, 2457, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {11, 2462, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}}, + {12, 2467, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1d, 0, 0}}, + {13, 2472, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1d, 0, 0}}, + {14, 2484, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1d, 0, 0}}}; /** * The 2.4GHz CFP tables @@ -299,302 +288,296 @@ static cfp_table_t cfp_table_BG[] = { /* Format { Channel, Frequency (MHz), MaxTxPower, DFS } */ /** Band: 'A', Region: World Wide Safe */ static chan_freq_power_t channel_freq_power_00_A[] = { - {36, 5180, WLAN_TX_PWR_00_DEFAULT, MFALSE, {0x10, 0}}, - {40, 5200, WLAN_TX_PWR_00_DEFAULT, MFALSE, {0x10, 0}}, - {44, 5220, WLAN_TX_PWR_00_DEFAULT, MFALSE, {0x10, 0}}, - {48, 5240, WLAN_TX_PWR_00_DEFAULT, MFALSE, {0x10, 0}}, - {52, 5260, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x13, 0}}, - {56, 5280, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x13, 0}}, - {60, 5300, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x13, 0}}, - {64, 5320, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x13, 0}}, - {100, 5500, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x13, 0}}, - {104, 5520, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x13, 0}}, - {108, 5540, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x13, 0}}, - {112, 5560, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x13, 0}}, - {116, 5580, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x13, 0}}, - {120, 5600, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x13, 0}}, - {124, 5620, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x13, 0}}, - {128, 5640, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x13, 0}}, - {132, 5660, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x13, 0}}, - {136, 5680, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x13, 0}}, - {140, 5700, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x13, 0}}, - {144, 5720, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x13, 0}}, - {149, 5745, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x13, 0}}, - {153, 5765, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x13, 0}}, - {157, 5785, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x13, 0}}, - {161, 5805, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x13, 0}}, - {165, 5825, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x13, 0}}}; + {36, 5180, WLAN_TX_PWR_00_DEFAULT, MFALSE, {0x10, 0, 0}}, + {40, 5200, WLAN_TX_PWR_00_DEFAULT, MFALSE, {0x10, 0, 0}}, + {44, 5220, WLAN_TX_PWR_00_DEFAULT, MFALSE, {0x10, 0, 0}}, + {48, 5240, WLAN_TX_PWR_00_DEFAULT, MFALSE, {0x10, 0, 0}}, + {52, 5260, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x13, 0, 0}}, + {56, 5280, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x13, 0, 0}}, + {60, 5300, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x13, 0, 0}}, + {64, 5320, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x13, 0, 0}}, + {100, 5500, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x13, 0, 0}}, + {104, 5520, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x13, 0, 0}}, + {108, 5540, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x13, 0, 0}}, + {112, 5560, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x13, 0, 0}}, + {116, 5580, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x13, 0, 0}}, + {120, 5600, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x13, 0, 0}}, + {124, 5620, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x13, 0, 0}}, + {128, 5640, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x13, 0, 0}}, + {132, 5660, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x13, 0, 0}}, + {136, 5680, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x13, 0, 0}}, + {140, 5700, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x13, 0, 0}}, + {144, 5720, WLAN_TX_PWR_00_DEFAULT, MTRUE, {0x13, 0, 0}}, + {149, 5745, WLAN_TX_PWR_00_DEFAULT, MFALSE, {0x10, 0, 0}}, + {153, 5765, WLAN_TX_PWR_00_DEFAULT, MFALSE, {0x10, 0, 0}}, + {157, 5785, WLAN_TX_PWR_00_DEFAULT, MFALSE, {0x10, 0, 0}}, + {161, 5805, WLAN_TX_PWR_00_DEFAULT, MFALSE, {0x10, 0, 0}}, + {165, 5825, WLAN_TX_PWR_00_DEFAULT, MFALSE, {0x10, 0, 0}}}; /* Format { Channel, Frequency (MHz), MaxTxPower, DFS } */ /** Band: 'A', Region: USA FCC */ static chan_freq_power_t channel_freq_power_A[] = { - {36, 5180, WLAN_TX_PWR_US_DEFAULT, MFALSE}, - {40, 5200, WLAN_TX_PWR_US_DEFAULT, MFALSE}, - {44, 5220, WLAN_TX_PWR_US_DEFAULT, MFALSE}, - {48, 5240, WLAN_TX_PWR_US_DEFAULT, MFALSE}, - {52, 5260, WLAN_TX_PWR_US_DEFAULT, MTRUE}, - {56, 5280, WLAN_TX_PWR_US_DEFAULT, MTRUE}, - {60, 5300, WLAN_TX_PWR_US_DEFAULT, MTRUE}, - {64, 5320, WLAN_TX_PWR_US_DEFAULT, MTRUE}, - {100, 5500, WLAN_TX_PWR_US_DEFAULT, MTRUE}, - {104, 5520, WLAN_TX_PWR_US_DEFAULT, MTRUE}, - {108, 5540, WLAN_TX_PWR_US_DEFAULT, MTRUE}, - {112, 5560, WLAN_TX_PWR_US_DEFAULT, MTRUE}, - {116, 5580, WLAN_TX_PWR_US_DEFAULT, MTRUE}, - {120, 5600, WLAN_TX_PWR_US_DEFAULT, MTRUE}, - {124, 5620, WLAN_TX_PWR_US_DEFAULT, MTRUE}, - {128, 5640, WLAN_TX_PWR_US_DEFAULT, MTRUE}, - {132, 5660, WLAN_TX_PWR_US_DEFAULT, MTRUE}, - {136, 5680, WLAN_TX_PWR_US_DEFAULT, MTRUE}, - {140, 5700, WLAN_TX_PWR_US_DEFAULT, MTRUE}, - {144, 5720, WLAN_TX_PWR_US_DEFAULT, MTRUE}, - {149, 5745, WLAN_TX_PWR_US_DEFAULT, MFALSE}, - {153, 5765, WLAN_TX_PWR_US_DEFAULT, MFALSE}, - {157, 5785, WLAN_TX_PWR_US_DEFAULT, MFALSE}, - {161, 5805, WLAN_TX_PWR_US_DEFAULT, MFALSE}, - {165, 5825, WLAN_TX_PWR_US_DEFAULT, MFALSE}}; + {36, 5180, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}}, + {40, 5200, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}}, + {44, 5220, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}}, + {48, 5240, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}}, + {52, 5260, WLAN_TX_PWR_US_DEFAULT, MTRUE, {0x13, 0, 0}}, + {56, 5280, WLAN_TX_PWR_US_DEFAULT, MTRUE, {0x13, 0, 0}}, + {60, 5300, WLAN_TX_PWR_US_DEFAULT, MTRUE, {0x13, 0, 0}}, + {64, 5320, WLAN_TX_PWR_US_DEFAULT, MTRUE, {0x13, 0, 0}}, + {100, 5500, WLAN_TX_PWR_US_DEFAULT, MTRUE, {0x13, 0, 0}}, + {104, 5520, WLAN_TX_PWR_US_DEFAULT, MTRUE, {0x13, 0, 0}}, + {108, 5540, WLAN_TX_PWR_US_DEFAULT, MTRUE, {0x13, 0, 0}}, + {112, 5560, WLAN_TX_PWR_US_DEFAULT, MTRUE, {0x13, 0, 0}}, + {116, 5580, WLAN_TX_PWR_US_DEFAULT, MTRUE, {0x13, 0, 0}}, + {120, 5600, WLAN_TX_PWR_US_DEFAULT, MTRUE, {0x13, 0, 0}}, + {124, 5620, WLAN_TX_PWR_US_DEFAULT, MTRUE, {0x13, 0, 0}}, + {128, 5640, WLAN_TX_PWR_US_DEFAULT, MTRUE, {0x13, 0, 0}}, + {132, 5660, WLAN_TX_PWR_US_DEFAULT, MTRUE, {0x13, 0, 0}}, + {136, 5680, WLAN_TX_PWR_US_DEFAULT, MTRUE, {0x13, 0, 0}}, + {140, 5700, WLAN_TX_PWR_US_DEFAULT, MTRUE, {0x13, 0, 0}}, + {144, 5720, WLAN_TX_PWR_US_DEFAULT, MTRUE, {0x13, 0, 0}}, + {149, 5745, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}}, + {153, 5765, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}}, + {157, 5785, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}}, + {161, 5805, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}}, + {165, 5825, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}}}; /** Band: 'A', Region: Canada IC */ static chan_freq_power_t channel_freq_power_CAN_A[] = { - {36, 5180, WLAN_TX_PWR_US_DEFAULT, MFALSE}, - {40, 5200, WLAN_TX_PWR_US_DEFAULT, MFALSE}, - {44, 5220, WLAN_TX_PWR_US_DEFAULT, MFALSE}, - {48, 5240, WLAN_TX_PWR_US_DEFAULT, MFALSE}, - {52, 5260, WLAN_TX_PWR_US_DEFAULT, MTRUE}, - {56, 5280, WLAN_TX_PWR_US_DEFAULT, MTRUE}, - {60, 5300, WLAN_TX_PWR_US_DEFAULT, MTRUE}, - {64, 5320, WLAN_TX_PWR_US_DEFAULT, MTRUE}, - {100, 5500, WLAN_TX_PWR_US_DEFAULT, MTRUE}, - {104, 5520, WLAN_TX_PWR_US_DEFAULT, MTRUE}, - {108, 5540, WLAN_TX_PWR_US_DEFAULT, MTRUE}, - {112, 5560, WLAN_TX_PWR_US_DEFAULT, MTRUE}, - {116, 5580, WLAN_TX_PWR_US_DEFAULT, MTRUE}, - {132, 5660, WLAN_TX_PWR_US_DEFAULT, MTRUE}, - {136, 5680, WLAN_TX_PWR_US_DEFAULT, MTRUE}, - {140, 5700, WLAN_TX_PWR_US_DEFAULT, MTRUE}, - {144, 5720, WLAN_TX_PWR_US_DEFAULT, MTRUE}, - {149, 5745, WLAN_TX_PWR_US_DEFAULT, MFALSE}, - {153, 5765, WLAN_TX_PWR_US_DEFAULT, MFALSE}, - {157, 5785, WLAN_TX_PWR_US_DEFAULT, MFALSE}, - {161, 5805, WLAN_TX_PWR_US_DEFAULT, MFALSE}, - {165, 5825, WLAN_TX_PWR_US_DEFAULT, MFALSE}}; + {36, 5180, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}}, + {40, 5200, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}}, + {44, 5220, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}}, + {48, 5240, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}}, + {52, 5260, WLAN_TX_PWR_US_DEFAULT, MTRUE, {0x13, 0, 0}}, + {56, 5280, WLAN_TX_PWR_US_DEFAULT, MTRUE, {0x13, 0, 0}}, + {60, 5300, WLAN_TX_PWR_US_DEFAULT, MTRUE, {0x13, 0, 0}}, + {64, 5320, WLAN_TX_PWR_US_DEFAULT, MTRUE, {0x13, 0, 0}}, + {100, 5500, WLAN_TX_PWR_US_DEFAULT, MTRUE, {0x13, 0, 0}}, + {104, 5520, WLAN_TX_PWR_US_DEFAULT, MTRUE, {0x13, 0, 0}}, + {108, 5540, WLAN_TX_PWR_US_DEFAULT, MTRUE, {0x13, 0, 0}}, + {112, 5560, WLAN_TX_PWR_US_DEFAULT, MTRUE, {0x13, 0, 0}}, + {116, 5580, WLAN_TX_PWR_US_DEFAULT, MTRUE, {0x13, 0, 0}}, + {132, 5660, WLAN_TX_PWR_US_DEFAULT, MTRUE, {0x13, 0, 0}}, + {136, 5680, WLAN_TX_PWR_US_DEFAULT, MTRUE, {0x13, 0, 0}}, + {140, 5700, WLAN_TX_PWR_US_DEFAULT, MTRUE, {0x13, 0, 0}}, + {144, 5720, WLAN_TX_PWR_US_DEFAULT, MTRUE, {0x13, 0, 0}}, + {149, 5745, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}}, + {153, 5765, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}}, + {157, 5785, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}}, + {161, 5805, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}}, + {165, 5825, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}}}; /** Band: 'A', Region: Europe ETSI */ static chan_freq_power_t channel_freq_power_EU_A[] = { - {36, 5180, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE}, - {40, 5200, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE}, - {44, 5220, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE}, - {48, 5240, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE}, - {52, 5260, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE}, - {56, 5280, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE}, - {60, 5300, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE}, - {64, 5320, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE}, - {100, 5500, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE}, - {104, 5520, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE}, - {108, 5540, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE}, - {112, 5560, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE}, - {116, 5580, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE}, - {120, 5600, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE}, - {124, 5620, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE}, - {128, 5640, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE}, - {132, 5660, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE}, - {136, 5680, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE}, - {140, 5700, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE}, - {149, 5745, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE}, - {153, 5765, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE}, - {157, 5785, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE}, - {161, 5805, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE}, - {165, 5825, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE}}; + {36, 5180, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}}, + {40, 5200, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}}, + {44, 5220, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}}, + {48, 5240, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}}, + {52, 5260, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE, {0x13, 0, 0}}, + {56, 5280, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE, {0x13, 0, 0}}, + {60, 5300, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE, {0x13, 0, 0}}, + {64, 5320, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE, {0x13, 0, 0}}, + {100, 5500, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE, {0x13, 0, 0}}, + {104, 5520, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE, {0x13, 0, 0}}, + {108, 5540, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE, {0x13, 0, 0}}, + {112, 5560, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE, {0x13, 0, 0}}, + {116, 5580, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE, {0x13, 0, 0}}, + {120, 5600, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE, {0x13, 0, 0}}, + {124, 5620, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE, {0x13, 0, 0}}, + {128, 5640, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE, {0x13, 0, 0}}, + {132, 5660, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE, {0x13, 0, 0}}, + {136, 5680, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE, {0x13, 0, 0}}, + {140, 5700, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE, {0x13, 0, 0}}, + {149, 5745, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}}, + {153, 5765, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}}, + {157, 5785, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}}, + {161, 5805, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}}, + {165, 5825, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}}}; /** Band: 'A', Region: Japan */ static chan_freq_power_t channel_freq_power_JPN_A[] = { - {36, 5180, WLAN_TX_PWR_JP_A_DEFAULT, MFALSE}, - {40, 5200, WLAN_TX_PWR_JP_A_DEFAULT, MFALSE}, - {44, 5220, WLAN_TX_PWR_JP_A_DEFAULT, MFALSE}, - {48, 5240, WLAN_TX_PWR_JP_A_DEFAULT, MFALSE}, - {52, 5260, WLAN_TX_PWR_JP_A_DEFAULT, MTRUE}, - {56, 5280, WLAN_TX_PWR_JP_A_DEFAULT, MTRUE}, - {60, 5300, WLAN_TX_PWR_JP_A_DEFAULT, MTRUE}, - {64, 5320, WLAN_TX_PWR_JP_A_DEFAULT, MTRUE}, - {100, 5500, WLAN_TX_PWR_JP_A_DEFAULT, MTRUE}, - {104, 5520, WLAN_TX_PWR_JP_A_DEFAULT, MTRUE}, - {108, 5540, WLAN_TX_PWR_JP_A_DEFAULT, MTRUE}, - {112, 5560, WLAN_TX_PWR_JP_A_DEFAULT, MTRUE}, - {116, 5580, WLAN_TX_PWR_JP_A_DEFAULT, MTRUE}, - {120, 5600, WLAN_TX_PWR_JP_A_DEFAULT, MTRUE}, - {124, 5620, WLAN_TX_PWR_JP_A_DEFAULT, MTRUE}, - {128, 5640, WLAN_TX_PWR_JP_A_DEFAULT, MTRUE}, - {132, 5660, WLAN_TX_PWR_JP_A_DEFAULT, MTRUE}, - {136, 5680, WLAN_TX_PWR_JP_A_DEFAULT, MTRUE}, - {140, 5700, WLAN_TX_PWR_JP_A_DEFAULT, MTRUE}, - {144, 5720, WLAN_TX_PWR_JP_A_DEFAULT, MTRUE}}; + {36, 5180, WLAN_TX_PWR_JP_A_DEFAULT, MFALSE, {0x10, 0, 0}}, + {40, 5200, WLAN_TX_PWR_JP_A_DEFAULT, MFALSE, {0x10, 0, 0}}, + {44, 5220, WLAN_TX_PWR_JP_A_DEFAULT, MFALSE, {0x10, 0, 0}}, + {48, 5240, WLAN_TX_PWR_JP_A_DEFAULT, MFALSE, {0x10, 0, 0}}, + {52, 5260, WLAN_TX_PWR_JP_A_DEFAULT, MTRUE, {0x13, 0, 0}}, + {56, 5280, WLAN_TX_PWR_JP_A_DEFAULT, MTRUE, {0x13, 0, 0}}, + {60, 5300, WLAN_TX_PWR_JP_A_DEFAULT, MTRUE, {0x13, 0, 0}}, + {64, 5320, WLAN_TX_PWR_JP_A_DEFAULT, MTRUE, {0x13, 0, 0}}, + {100, 5500, WLAN_TX_PWR_JP_A_DEFAULT, MTRUE, {0x13, 0, 0}}, + {104, 5520, WLAN_TX_PWR_JP_A_DEFAULT, MTRUE, {0x13, 0, 0}}, + {108, 5540, WLAN_TX_PWR_JP_A_DEFAULT, MTRUE, {0x13, 0, 0}}, + {112, 5560, WLAN_TX_PWR_JP_A_DEFAULT, MTRUE, {0x13, 0, 0}}, + {116, 5580, WLAN_TX_PWR_JP_A_DEFAULT, MTRUE, {0x13, 0, 0}}, + {120, 5600, WLAN_TX_PWR_JP_A_DEFAULT, MTRUE, {0x13, 0, 0}}, + {124, 5620, WLAN_TX_PWR_JP_A_DEFAULT, MTRUE, {0x13, 0, 0}}, + {128, 5640, WLAN_TX_PWR_JP_A_DEFAULT, MTRUE, {0x13, 0, 0}}, + {132, 5660, WLAN_TX_PWR_JP_A_DEFAULT, MTRUE, {0x13, 0, 0}}, + {136, 5680, WLAN_TX_PWR_JP_A_DEFAULT, MTRUE, {0x13, 0, 0}}, + {140, 5700, WLAN_TX_PWR_JP_A_DEFAULT, MTRUE, {0x13, 0, 0}}, + {144, 5720, WLAN_TX_PWR_JP_A_DEFAULT, MTRUE, {0x13, 0, 0}}}; /** Band: 'A', Region: China */ static chan_freq_power_t channel_freq_power_CN_A[] = { - {36, 5180, WLAN_TX_PWR_200MW, MFALSE}, - {40, 5200, WLAN_TX_PWR_200MW, MFALSE}, - {44, 5220, WLAN_TX_PWR_200MW, MFALSE}, - {48, 5240, WLAN_TX_PWR_200MW, MFALSE}, - {52, 5260, WLAN_TX_PWR_200MW, MTRUE}, - {56, 5280, WLAN_TX_PWR_200MW, MTRUE}, - {60, 5300, WLAN_TX_PWR_200MW, MTRUE}, - {64, 5320, WLAN_TX_PWR_200MW, MTRUE}, - {149, 5745, WLAN_TX_PWR_CN_2000MW, MFALSE}, - {153, 5765, WLAN_TX_PWR_CN_2000MW, MFALSE}, - {157, 5785, WLAN_TX_PWR_CN_2000MW, MFALSE}, - {161, 5805, WLAN_TX_PWR_CN_2000MW, MFALSE}, - {165, 5825, WLAN_TX_PWR_CN_2000MW, MFALSE}}; + {36, 5180, WLAN_TX_PWR_200MW, MFALSE, {0x10, 0, 0}}, + {40, 5200, WLAN_TX_PWR_200MW, MFALSE, {0x10, 0, 0}}, + {44, 5220, WLAN_TX_PWR_200MW, MFALSE, {0x10, 0, 0}}, + {48, 5240, WLAN_TX_PWR_200MW, MFALSE, {0x10, 0, 0}}, + {52, 5260, WLAN_TX_PWR_200MW, MTRUE, {0x13, 0, 0}}, + {56, 5280, WLAN_TX_PWR_200MW, MTRUE, {0x13, 0, 0}}, + {60, 5300, WLAN_TX_PWR_200MW, MTRUE, {0x13, 0, 0}}, + {64, 5320, WLAN_TX_PWR_200MW, MTRUE, {0x13, 0, 0}}, + {149, 5745, WLAN_TX_PWR_CN_2000MW, MFALSE, {0x10, 0, 0}}, + {153, 5765, WLAN_TX_PWR_CN_2000MW, MFALSE, {0x10, 0, 0}}, + {157, 5785, WLAN_TX_PWR_CN_2000MW, MFALSE, {0x10, 0, 0}}, + {161, 5805, WLAN_TX_PWR_CN_2000MW, MFALSE, {0x10, 0, 0}}, + {165, 5825, WLAN_TX_PWR_CN_2000MW, MFALSE, {0x10, 0, 0}}}; /** Band: 'A', NULL */ static chan_freq_power_t channel_freq_power_NULL_A[] = {}; /** Band: 'A', Region: Spain/Austria/Brazil */ static chan_freq_power_t channel_freq_power_SPN2_A[] = { - {36, 5180, WLAN_TX_PWR_200MW, MFALSE}, - {40, 5200, WLAN_TX_PWR_200MW, MFALSE}, - {44, 5220, WLAN_TX_PWR_200MW, MFALSE}, - {48, 5240, WLAN_TX_PWR_200MW, MFALSE}, - {52, 5260, WLAN_TX_PWR_200MW, MTRUE}, - {56, 5280, WLAN_TX_PWR_200MW, MTRUE}, - {60, 5300, WLAN_TX_PWR_200MW, MTRUE}, - {64, 5320, WLAN_TX_PWR_200MW, MTRUE}, -}; + {36, 5180, WLAN_TX_PWR_200MW, MFALSE, {0x10, 0, 0}}, + {40, 5200, WLAN_TX_PWR_200MW, MFALSE, {0x10, 0, 0}}, + {44, 5220, WLAN_TX_PWR_200MW, MFALSE, {0x10, 0, 0}}, + {48, 5240, WLAN_TX_PWR_200MW, MFALSE, {0x10, 0, 0}}, + {52, 5260, WLAN_TX_PWR_200MW, MTRUE, {0x13, 0, 0}}, + {56, 5280, WLAN_TX_PWR_200MW, MTRUE, {0x13, 0, 0}}, + {60, 5300, WLAN_TX_PWR_200MW, MTRUE, {0x13, 0, 0}}, + {64, 5320, WLAN_TX_PWR_200MW, MTRUE, {0x13, 0, 0}}}; /** Band: 'A', Region: Brazil */ static chan_freq_power_t channel_freq_power_BR1_A[] = { - {100, 5500, WLAN_TX_PWR_250MW, MTRUE}, - {104, 5520, WLAN_TX_PWR_250MW, MTRUE}, - {108, 5540, WLAN_TX_PWR_250MW, MTRUE}, - {112, 5560, WLAN_TX_PWR_250MW, MTRUE}, - {116, 5580, WLAN_TX_PWR_250MW, MTRUE}, - {120, 5600, WLAN_TX_PWR_250MW, MTRUE}, - {124, 5620, WLAN_TX_PWR_250MW, MTRUE}, - {128, 5640, WLAN_TX_PWR_250MW, MTRUE}, - {132, 5660, WLAN_TX_PWR_250MW, MTRUE}, - {136, 5680, WLAN_TX_PWR_250MW, MTRUE}, - {140, 5700, WLAN_TX_PWR_250MW, MTRUE}, -}; + {100, 5500, WLAN_TX_PWR_250MW, MTRUE, {0x13, 0, 0}}, + {104, 5520, WLAN_TX_PWR_250MW, MTRUE, {0x13, 0, 0}}, + {108, 5540, WLAN_TX_PWR_250MW, MTRUE, {0x13, 0, 0}}, + {112, 5560, WLAN_TX_PWR_250MW, MTRUE, {0x13, 0, 0}}, + {116, 5580, WLAN_TX_PWR_250MW, MTRUE, {0x13, 0, 0}}, + {120, 5600, WLAN_TX_PWR_250MW, MTRUE, {0x13, 0, 0}}, + {124, 5620, WLAN_TX_PWR_250MW, MTRUE, {0x13, 0, 0}}, + {128, 5640, WLAN_TX_PWR_250MW, MTRUE, {0x13, 0, 0}}, + {132, 5660, WLAN_TX_PWR_250MW, MTRUE, {0x13, 0, 0}}, + {136, 5680, WLAN_TX_PWR_250MW, MTRUE, {0x13, 0, 0}}, + {140, 5700, WLAN_TX_PWR_250MW, MTRUE, {0x13, 0, 0}}}; /** Band: 'A', Region: Brazil */ static chan_freq_power_t channel_freq_power_BR2_A[] = { - {149, 5745, WLAN_TX_PWR_1000MW, MFALSE}, - {153, 5765, WLAN_TX_PWR_1000MW, MFALSE}, - {157, 5785, WLAN_TX_PWR_1000MW, MFALSE}, - {161, 5805, WLAN_TX_PWR_1000MW, MFALSE}, - {165, 5825, WLAN_TX_PWR_1000MW, MFALSE}}; + {149, 5745, WLAN_TX_PWR_1000MW, MFALSE, {0x10, 0, 0}}, + {153, 5765, WLAN_TX_PWR_1000MW, MFALSE, {0x10, 0, 0}}, + {157, 5785, WLAN_TX_PWR_1000MW, MFALSE, {0x10, 0, 0}}, + {161, 5805, WLAN_TX_PWR_1000MW, MFALSE, {0x10, 0, 0}}, + {165, 5825, WLAN_TX_PWR_1000MW, MFALSE, {0x10, 0, 0}}}; /** Band: 'A', Region: Russia */ static chan_freq_power_t channel_freq_power_RU_A[] = { - {36, 5180, WLAN_TX_PWR_DEFAULT, MFALSE}, - {40, 5200, WLAN_TX_PWR_DEFAULT, MFALSE}, - {44, 5220, WLAN_TX_PWR_DEFAULT, MFALSE}, - {48, 5240, WLAN_TX_PWR_DEFAULT, MFALSE}, - {52, 5260, WLAN_TX_PWR_DEFAULT, MFALSE}, - {56, 5280, WLAN_TX_PWR_DEFAULT, MFALSE}, - {60, 5300, WLAN_TX_PWR_DEFAULT, MFALSE}, - {64, 5320, WLAN_TX_PWR_DEFAULT, MFALSE}, - {132, 5660, WLAN_TX_PWR_DEFAULT, MFALSE}, - {136, 5680, WLAN_TX_PWR_DEFAULT, MFALSE}, - {140, 5700, WLAN_TX_PWR_DEFAULT, MFALSE}, - {149, 5745, WLAN_TX_PWR_DEFAULT, MFALSE}, - {153, 5765, WLAN_TX_PWR_DEFAULT, MFALSE}, - {157, 5785, WLAN_TX_PWR_DEFAULT, MFALSE}, - {161, 5805, WLAN_TX_PWR_DEFAULT, MFALSE}, -}; + {36, 5180, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {40, 5200, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {44, 5220, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {48, 5240, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {52, 5260, WLAN_TX_PWR_DEFAULT, MTRUE, {0x13, 0, 0}}, + {56, 5280, WLAN_TX_PWR_DEFAULT, MTRUE, {0x13, 0, 0}}, + {60, 5300, WLAN_TX_PWR_DEFAULT, MTRUE, {0x13, 0, 0}}, + {64, 5320, WLAN_TX_PWR_DEFAULT, MTRUE, {0x13, 0, 0}}, + {132, 5660, WLAN_TX_PWR_DEFAULT, MTRUE, {0x13, 0, 0}}, + {136, 5680, WLAN_TX_PWR_DEFAULT, MTRUE, {0x13, 0, 0}}, + {140, 5700, WLAN_TX_PWR_DEFAULT, MTRUE, {0x13, 0, 0}}, + {149, 5745, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {153, 5765, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {157, 5785, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {161, 5805, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}}; /** Band: 'A', Region: Mexico */ static chan_freq_power_t channel_freq_power_MX_A[] = { - {36, 5180, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE}, - {40, 5200, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE}, - {44, 5220, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE}, - {48, 5240, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE}, - {52, 5260, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE}, - {56, 5280, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE}, - {60, 5300, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE}, - {64, 5320, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE}, - {100, 5500, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE}, - {104, 5520, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE}, - {108, 5540, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE}, - {112, 5560, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE}, - {116, 5580, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE}, - {132, 5660, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE}, - {136, 5680, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE}, - {140, 5700, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE}, - {149, 5745, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE}, - {153, 5765, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE}, - {157, 5785, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE}, - {161, 5805, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE}, - {165, 5825, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE}}; + {36, 5180, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}}, + {40, 5200, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}}, + {44, 5220, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}}, + {48, 5240, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}}, + {52, 5260, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE, {0x13, 0, 0}}, + {56, 5280, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE, {0x13, 0, 0}}, + {60, 5300, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE, {0x13, 0, 0}}, + {64, 5320, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE, {0x13, 0, 0}}, + {100, 5500, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE, {0x13, 0, 0}}, + {104, 5520, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE, {0x13, 0, 0}}, + {108, 5540, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE, {0x13, 0, 0}}, + {112, 5560, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE, {0x13, 0, 0}}, + {116, 5580, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE, {0x13, 0, 0}}, + {132, 5660, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE, {0x13, 0, 0}}, + {136, 5680, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE, {0x13, 0, 0}}, + {140, 5700, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE, {0x13, 0, 0}}, + {149, 5745, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}}, + {153, 5765, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}}, + {157, 5785, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}}, + {161, 5805, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}}, + {165, 5825, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}}}; /** Band: 'A', Code: 1, Low band (5150-5250 MHz) channels */ static chan_freq_power_t channel_freq_power_low_band[] = { - {36, 5180, WLAN_TX_PWR_DEFAULT, MFALSE}, - {40, 5200, WLAN_TX_PWR_DEFAULT, MFALSE}, - {44, 5220, WLAN_TX_PWR_DEFAULT, MFALSE}, - {48, 5240, WLAN_TX_PWR_DEFAULT, MFALSE}, -}; + {36, 5180, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {40, 5200, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {44, 5220, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {48, 5240, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}}; /** Band: 'A', Code: 2, Lower middle band (5250-5350 MHz) channels */ static chan_freq_power_t channel_freq_power_lower_middle_band[] = { - {52, 5260, WLAN_TX_PWR_DEFAULT, MTRUE}, - {56, 5280, WLAN_TX_PWR_DEFAULT, MTRUE}, - {60, 5300, WLAN_TX_PWR_DEFAULT, MTRUE}, - {64, 5320, WLAN_TX_PWR_DEFAULT, MTRUE}, -}; + {52, 5260, WLAN_TX_PWR_DEFAULT, MTRUE, {0x13, 0, 0}}, + {56, 5280, WLAN_TX_PWR_DEFAULT, MTRUE, {0x13, 0, 0}}, + {60, 5300, WLAN_TX_PWR_DEFAULT, MTRUE, {0x13, 0, 0}}, + {64, 5320, WLAN_TX_PWR_DEFAULT, MTRUE, {0x13, 0, 0}}}; /** Band: 'A', Code: 3, Upper middle band (5470-5725 MHz) channels */ static chan_freq_power_t channel_freq_power_upper_middle_band[] = { - {100, 5500, WLAN_TX_PWR_DEFAULT, MTRUE}, - {104, 5520, WLAN_TX_PWR_DEFAULT, MTRUE}, - {108, 5540, WLAN_TX_PWR_DEFAULT, MTRUE}, - {112, 5560, WLAN_TX_PWR_DEFAULT, MTRUE}, - {116, 5580, WLAN_TX_PWR_DEFAULT, MTRUE}, - {120, 5600, WLAN_TX_PWR_DEFAULT, MTRUE}, - {124, 5620, WLAN_TX_PWR_DEFAULT, MTRUE}, - {128, 5640, WLAN_TX_PWR_DEFAULT, MTRUE}, - {132, 5660, WLAN_TX_PWR_DEFAULT, MTRUE}, - {136, 5680, WLAN_TX_PWR_DEFAULT, MTRUE}, - {140, 5700, WLAN_TX_PWR_DEFAULT, MTRUE}, -}; + {100, 5500, WLAN_TX_PWR_DEFAULT, MTRUE, {0x13, 0, 0}}, + {104, 5520, WLAN_TX_PWR_DEFAULT, MTRUE, {0x13, 0, 0}}, + {108, 5540, WLAN_TX_PWR_DEFAULT, MTRUE, {0x13, 0, 0}}, + {112, 5560, WLAN_TX_PWR_DEFAULT, MTRUE, {0x13, 0, 0}}, + {116, 5580, WLAN_TX_PWR_DEFAULT, MTRUE, {0x13, 0, 0}}, + {120, 5600, WLAN_TX_PWR_DEFAULT, MTRUE, {0x13, 0, 0}}, + {124, 5620, WLAN_TX_PWR_DEFAULT, MTRUE, {0x13, 0, 0}}, + {128, 5640, WLAN_TX_PWR_DEFAULT, MTRUE, {0x13, 0, 0}}, + {132, 5660, WLAN_TX_PWR_DEFAULT, MTRUE, {0x13, 0, 0}}, + {136, 5680, WLAN_TX_PWR_DEFAULT, MTRUE, {0x13, 0, 0}}, + {140, 5700, WLAN_TX_PWR_DEFAULT, MTRUE, {0x13, 0, 0}}}; /** Band: 'A', Code: 4, High band (5725-5850 MHz) channels */ static chan_freq_power_t channel_freq_power_high_band[] = { - {149, 5745, WLAN_TX_PWR_DEFAULT, MFALSE}, - {153, 5765, WLAN_TX_PWR_DEFAULT, MFALSE}, - {157, 5785, WLAN_TX_PWR_DEFAULT, MFALSE}, - {161, 5805, WLAN_TX_PWR_DEFAULT, MFALSE}, - {165, 5825, WLAN_TX_PWR_DEFAULT, MFALSE}}; + {149, 5745, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {153, 5765, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {157, 5785, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {161, 5805, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {165, 5825, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}}; /** Band: 'A', Code: 5, Low band (5150-5250 MHz) and * High band (5725-5850 MHz) channels */ static chan_freq_power_t channel_freq_power_low_high_band[] = { - {36, 5180, WLAN_TX_PWR_DEFAULT, MFALSE}, - {40, 5200, WLAN_TX_PWR_DEFAULT, MFALSE}, - {44, 5220, WLAN_TX_PWR_DEFAULT, MFALSE}, - {48, 5240, WLAN_TX_PWR_DEFAULT, MFALSE}, - {149, 5745, WLAN_TX_PWR_DEFAULT, MFALSE}, - {153, 5765, WLAN_TX_PWR_DEFAULT, MFALSE}, - {157, 5785, WLAN_TX_PWR_DEFAULT, MFALSE}, - {161, 5805, WLAN_TX_PWR_DEFAULT, MFALSE}, - {165, 5825, WLAN_TX_PWR_DEFAULT, MFALSE}}; + {36, 5180, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {40, 5200, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {44, 5220, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {48, 5240, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {149, 5745, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {153, 5765, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {157, 5785, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {161, 5805, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {165, 5825, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}}; /** Band: 'A', Code: 6, Low band (5150-5250 MHz) and * mid low (5260-5320) and High band (5725-5850 MHz) channels */ static chan_freq_power_t channel_freq_power_low_middle_high_band[] = { - {36, 5180, WLAN_TX_PWR_DEFAULT, MFALSE}, - {40, 5200, WLAN_TX_PWR_DEFAULT, MFALSE}, - {44, 5220, WLAN_TX_PWR_DEFAULT, MFALSE}, - {48, 5240, WLAN_TX_PWR_DEFAULT, MFALSE}, - {52, 5260, WLAN_TX_PWR_DEFAULT, MFALSE}, - {56, 5280, WLAN_TX_PWR_DEFAULT, MFALSE}, - {60, 5300, WLAN_TX_PWR_DEFAULT, MFALSE}, - {64, 5320, WLAN_TX_PWR_DEFAULT, MFALSE}, - {149, 5745, WLAN_TX_PWR_DEFAULT, MFALSE}, - {153, 5765, WLAN_TX_PWR_DEFAULT, MFALSE}, - {157, 5785, WLAN_TX_PWR_DEFAULT, MFALSE}, - {161, 5805, WLAN_TX_PWR_DEFAULT, MFALSE}, - {165, 5825, WLAN_TX_PWR_DEFAULT, MFALSE}}; + {36, 5180, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {40, 5200, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {44, 5220, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {48, 5240, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {52, 5260, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {56, 5280, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {60, 5300, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {64, 5320, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {149, 5745, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {153, 5765, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {157, 5785, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {161, 5805, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}, + {165, 5825, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}}; /** * The 5GHz CFP tables @@ -1393,8 +1376,6 @@ t_bool wlan_is_etsi_country(pmlan_adapter pmadapter, t_u8 *country_code) return MFALSE; } -#define BAND_MASK_5G 0x03 -#define ANTENNA_OFFSET 2 /** * @brief This function adjust the antenna index * @@ -1424,6 +1405,7 @@ t_u8 wlan_adjust_antenna(pmlan_private priv, RxPD *prx_pd) } #if defined(SD8887) || defined(SD8987) +#define ANTENNA_OFFSET 2 if (MFALSE #ifdef SD8887 || IS_SD8887(priv->adapter->card_type) @@ -1495,6 +1477,60 @@ t_u16 wlan_adjust_data_rate(mlan_private *priv, t_u8 rx_rate, t_u8 rate_info) #ifdef STA_SUPPORT #endif /* STA_SUPPORT */ +/** + * @brief convert TX rate_info from v14 to v15+ FW rate_info + * + * @param v14_rate_info v14 rate info + * + * @return v15+ rate info + */ +t_u8 wlan_convert_v14_tx_rate_info(pmlan_private pmpriv, t_u8 v14_rate_info) +{ + t_u8 rate_info = 0; + + if (!pmpriv->adapter->pcard_info->v14_fw_api) { + PRINTM(MERROR, "%s: Not convert for this is not V14 FW\n", + __func__); + return v14_rate_info; + } + + rate_info = v14_rate_info & 0x01; + /* band */ + rate_info |= (v14_rate_info & MBIT(1)) << 1; + /* short GI */ + rate_info |= (v14_rate_info & MBIT(2)) << 2; + return rate_info; +} + +/** + * @brief convert RX rate_info from v14 to v15+ FW rate_info + * + * @param v14_rate_info v14 rate info + * + * @return v15+ rate info + */ +t_u8 wlan_convert_v14_rx_rate_info(pmlan_private pmpriv, t_u8 v14_rate_info) +{ + t_u8 rate_info = 0; + t_u8 mode = 0; + t_u8 bw = 0; + t_u8 sgi = 0; + + if (!pmpriv->adapter->pcard_info->v14_fw_api) { + PRINTM(MERROR, "%s: Not convert for this is not V14 FW\n", + __func__); + return v14_rate_info; + } + + mode = v14_rate_info & MBIT(0); + bw = v14_rate_info & MBIT(1); + sgi = (v14_rate_info & 0x04) >> 2; + + rate_info = (mode & 0x01) | ((bw & 0x01) << 2) | ((sgi & 0x01) << 4); + + return rate_info; +} + /** * @brief Use index to get the data rate * diff --git a/mxm_wifiex/wlan_src/mlan/mlan_cmdevt.c b/mxm_wifiex/wlan_src/mlan/mlan_cmdevt.c index 0d8bd05..fd394be 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_cmdevt.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_cmdevt.c @@ -162,13 +162,13 @@ static t_void wlan_dump_info(mlan_adapter *pmadapter, t_u8 reason) #ifdef DEBUG_LEVEL1 t_u32 sec = 0, usec = 0; #endif - t_u8 i; + t_u16 i; #ifdef SDIO t_u8 j; - t_u8 mp_aggr_pkt_limit = pmadapter->pcard_sd->mp_aggr_pkt_limit; + t_u8 mp_aggr_pkt_limit; #endif t_u16 cmd_id, cmd_act; - mlan_private *pmpriv = MNULL; + mlan_private *pmpriv = wlan_get_priv(pmadapter, MLAN_BSS_ROLE_ANY); ENTER(); @@ -192,10 +192,12 @@ static t_void wlan_dump_info(mlan_adapter *pmadapter, t_u8 reason) } if ((reason == REASON_CODE_NO_CMD_NODE) && (pmadapter->dbg.num_no_cmd_node > 1)) { - if (pmadapter->dbg.num_no_cmd_node >= 5) - wlan_recv_event(wlan_get_priv(pmadapter, - MLAN_BSS_ROLE_ANY), - MLAN_EVENT_ID_DRV_DBG_DUMP, MNULL); + if (pmadapter->dbg.num_no_cmd_node >= 5) { + if (pmpriv) + wlan_recv_event(pmpriv, + MLAN_EVENT_ID_DRV_DBG_DUMP, + MNULL); + } LEAVE(); return; } @@ -320,6 +322,7 @@ static t_void wlan_dump_info(mlan_adapter *pmadapter, t_u8 reason) PRINTM(MERROR, "scan_processing = %d\n", pmadapter->scan_processing); #ifdef SDIO if (IS_SD(pmadapter->card_type)) { + mp_aggr_pkt_limit = pmadapter->pcard_sd->mp_aggr_pkt_limit; PRINTM(MERROR, "mp_rd_bitmap=0x%x curr_rd_port=0x%x\n", pmadapter->pcard_sd->mp_rd_bitmap, pmadapter->pcard_sd->curr_rd_port); @@ -360,9 +363,11 @@ static t_void wlan_dump_info(mlan_adapter *pmadapter, t_u8 reason) pmadapter->pcard_pcie->evtbd_wrptr); PRINTM(MERROR, "last_wr_index:%d\n", pmadapter->pcard_pcie->txbd_wrptr & - (pmadapter->pcard_pcie->reg->txrx_bd_size - 1)); + (pmadapter->pcard_pcie->txrx_bd_size - 1)); + PRINTM(MERROR, " txrx_bd_size = %d\n", + pmadapter->pcard_pcie->txrx_bd_size); PRINTM(MERROR, "Tx pkt size:\n"); - for (i = 0; i < pmadapter->pcard_pcie->reg->txrx_bd_size; i++) { + for (i = 0; i < pmadapter->pcard_pcie->txrx_bd_size; i++) { PRINTM(MERROR, "%04d ", pmadapter->pcard_pcie->last_tx_pkt_size[i]); if (((i + 1) % 16) == 0) @@ -383,11 +388,15 @@ static t_void wlan_dump_info(mlan_adapter *pmadapter, t_u8 reason) wlan_recv_event(pmpriv, MLAN_EVENT_ID_DRV_DBG_DUMP, MNULL); - else - wlan_recv_event( - wlan_get_priv(pmadapter, - MLAN_BSS_ROLE_ANY), - MLAN_EVENT_ID_DRV_DBG_DUMP, MNULL); + else { + pmpriv = wlan_get_priv(pmadapter, + MLAN_BSS_ROLE_ANY); + if (pmpriv) + wlan_recv_event( + pmpriv, + MLAN_EVENT_ID_DRV_DBG_DUMP, + MNULL); + } } } PRINTM(MERROR, "-------- Dump info End---------\n", reason); @@ -3275,6 +3284,15 @@ mlan_status wlan_ret_802_11_tx_rate_query(pmlan_private pmpriv, pmpriv->tx_rate = resp->params.tx_rate.tx_rate; pmpriv->tx_rate_info = resp->params.tx_rate.tx_rate_info; + if (pmpriv->adapter->pcard_info->v14_fw_api) { + pmpriv->tx_rate_info = wlan_convert_v14_tx_rate_info( + pmpriv, pmpriv->tx_rate_info); + PRINTM(MINFO, + "%s: v14_fw_api=%d tx_rate=%d tx_rate_info=0x%x->0x%x\n", + __func__, pmpriv->adapter->pcard_info->v14_fw_api, + pmpriv->tx_rate, resp->params.tx_rate.tx_rate_info, + pmpriv->tx_rate_info); + } if ((pmpriv->tx_rate_info & 0x3) == MLAN_RATE_FORMAT_HE) pmpriv->ext_tx_rate_info = resp->params.tx_rate.ext_tx_rate_info; diff --git a/mxm_wifiex/wlan_src/mlan/mlan_decl.h b/mxm_wifiex/wlan_src/mlan/mlan_decl.h index 7d622e1..34c114f 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_decl.h +++ b/mxm_wifiex/wlan_src/mlan/mlan_decl.h @@ -24,7 +24,7 @@ #define _MLAN_DECL_H_ /** MLAN release version */ -#define MLAN_RELEASE_VERSION "241" +#define MLAN_RELEASE_VERSION "247" /** Re-define generic data types for MLAN/MOAL */ /** Signed char (1-byte) */ @@ -886,12 +886,6 @@ enum { SCAN_MODE_MANUAL = 0, SCAN_MODE_USER, }; -/** max cac time 10 minutes */ -#define MAX_CAC_DWELL_TIME 600000 -/** default cac time 60 seconds */ -#define DEF_CAC_DWELL_TIME 60000 -/** start freq for 5G */ -#define START_FREQ_11A_BAND 5000 /** DFS state */ typedef enum _dfs_state_t { /** Channel can be used, CAC (Channel Availability Check) must be done @@ -903,6 +897,13 @@ typedef enum _dfs_state_t { DFS_AVAILABLE = 2, } dfs_state_t; +/** max cac time 10 minutes */ +#define MAX_CAC_DWELL_TIME 600000 +/** default cac time 60 seconds */ +#define DEF_CAC_DWELL_TIME 60000 +/** start freq for 5G */ +#define START_FREQ_11A_BAND 5000 + typedef enum _dfs_w53_cfg_t { /** DFS W53 Default Fw Value */ DFS_W53_DEFAULT_FW = 0, @@ -976,6 +977,9 @@ typedef struct _cfp_dyn_t { t_u16 flags; /** TRUE: Channel is blacklisted (do not use) */ t_bool blacklist; + /** DFS state of the channel + * 0:DFS_USABLE 1:DFS_AVAILABLE 2:DFS_UNAVAILABLE */ + dfs_state_t dfs_state; } cfp_dyn_t; /** Chan-Freq-TxPower mapping table*/ @@ -2090,6 +2094,9 @@ typedef struct _mlan_device { /** MFG mode */ t_u32 mfg_mode; #endif +#ifdef PCIE + t_u16 ring_size; +#endif #if defined(SDIO) /** SDIO interrupt mode (0: INT_MODE_SDIO, 1: INT_MODE_GPIO) */ t_u32 int_mode; diff --git a/mxm_wifiex/wlan_src/mlan/mlan_fw.h b/mxm_wifiex/wlan_src/mlan/mlan_fw.h index f593ac7..04b89e0 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_fw.h +++ b/mxm_wifiex/wlan_src/mlan/mlan_fw.h @@ -1233,6 +1233,8 @@ typedef enum _WLAN_802_11_WEP_STATUS { #define TLV_TYPE_RX_PKT_COAL_CONFIG (PROPRIETARY_TLV_BASE_ID + 0xC9) #endif +#define TLV_TYPE_PREV_BSSID (PROPRIETARY_TLV_BASE_ID + 330) + /** Host Command ID : Channel report request */ #define HostCmd_CMD_CHAN_REPORT_REQUEST 0x00dd @@ -1370,6 +1372,14 @@ typedef enum _WLAN_802_11_WEP_STATUS { #define IS_FW_SUPPORT_MULTIBSSID(_adapter) \ (_adapter->fw_cap_ext & FW_CAPINFO_EXT_MULTI_BSSID) +/** MrvlIEtypes_PrevBssid_t */ +typedef MLAN_PACK_START struct _MrvlIEtypes_PrevBssid_t { + /** Header */ + MrvlIEtypesHeader_t header; + /** prev_bssid **/ + t_u8 prev_bssid[6]; +} MLAN_PACK_END MrvlIEtypes_PrevBssid_t; + /** FW cap info TLV */ typedef MLAN_PACK_START struct _MrvlIEtypes_fw_cap_info_t { /** Header type */ diff --git a/mxm_wifiex/wlan_src/mlan/mlan_init.c b/mxm_wifiex/wlan_src/mlan/mlan_init.c index 16a3cd7..a435843 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_init.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_init.c @@ -902,7 +902,7 @@ t_void wlan_init_adapter(pmlan_adapter pmadapter) #if defined(PCIE9098) || defined(PCIE9097) if (pmadapter->pcard_pcie->reg->use_adma) { pmadapter->pcard_pcie->rxbd_wrptr = - pmadapter->pcard_pcie->reg->txrx_bd_size; + pmadapter->pcard_pcie->txrx_bd_size; pmadapter->pcard_pcie->evtbd_wrptr = MLAN_MAX_EVT_BD; } #endif diff --git a/mxm_wifiex/wlan_src/mlan/mlan_ioctl.h b/mxm_wifiex/wlan_src/mlan/mlan_ioctl.h index 29a8c02..c0015af 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_ioctl.h +++ b/mxm_wifiex/wlan_src/mlan/mlan_ioctl.h @@ -695,6 +695,8 @@ typedef struct _mlan_ssid_bssid { t_u32 idx; /** Receive signal strength in dBm */ t_s32 rssi; + /* previous bssid */ + mlan_802_11_mac_addr prev_bssid; /**channel*/ t_u16 channel; /**mobility domain value*/ diff --git a/mxm_wifiex/wlan_src/mlan/mlan_join.c b/mxm_wifiex/wlan_src/mlan/mlan_join.c index 36d099a..080ca90 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_join.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_join.c @@ -880,12 +880,12 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv, #ifdef DRV_EMBEDDED_SUPPLICANT void *rsn_wpa_ie_tmp = MNULL; #endif - //#ifdef ENABLE_802_11R - // t_u8 ft_akm = 0; - //#endif + t_u8 ft_akm = 0; t_u8 oper_class; t_u8 oper_class_flag = MFALSE; MrvlIEtypes_HostMlme_t *host_mlme_tlv = MNULL; + MrvlIEtypes_PrevBssid_t *prev_bssid_tlv = MNULL; + t_u8 zero_mac[MLAN_MAC_ADDR_LENGTH] = {0}; ENTER(); @@ -1041,10 +1041,8 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv, prsn_ie_tlv->header.len; prsn_ie_tlv->header.len = wlan_cpu_to_le16(prsn_ie_tlv->header.len); - //#ifdef ENABLE_802_11R /** parse rsn ie to find whether ft akm is used*/ - // ft_akm = wlan_ft_akm_is_used(pmpriv, pmpriv->wpa_ie); - //#endif + ft_akm = wlan_ft_akm_is_used(pmpriv, pmpriv->wpa_ie); /* Append PMF Configuration coming from cfg80211 layer */ psecurity_cfg_ie = (MrvlIEtypes_SecurityCfg_t *)pos; @@ -1199,7 +1197,7 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv, wlan_cmd_append_generic_ie(pmpriv, &pos); - if (pbss_desc->pmd_ie) + if (ft_akm && pbss_desc->pmd_ie) wlan_cmd_append_pass_through_ie( pmpriv, (IEEEtypes_Generic_t *)pbss_desc->pmd_ie, &pos); wlan_cmd_append_tsf_tlv(pmpriv, &pos, pbss_desc); @@ -1214,6 +1212,19 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv, pos += sizeof(host_mlme_tlv->header) + host_mlme_tlv->header.len; } + if (memcmp(pmadapter, &pmpriv->curr_bss_params.prev_bssid, zero_mac, + MLAN_MAC_ADDR_LENGTH)) { + prev_bssid_tlv = (MrvlIEtypes_PrevBssid_t *)pos; + prev_bssid_tlv->header.type = + wlan_cpu_to_le16(TLV_TYPE_PREV_BSSID); + prev_bssid_tlv->header.len = MLAN_MAC_ADDR_LENGTH; + memcpy_ext(pmadapter, prev_bssid_tlv->prev_bssid, + &pmpriv->curr_bss_params.prev_bssid, + MLAN_MAC_ADDR_LENGTH, MLAN_MAC_ADDR_LENGTH); + PRINTM(MCMND, "ASSOCIATE: PREV_BSSID = " MACSTR "\n", + MAC2STR(pmpriv->curr_bss_params.prev_bssid)); + pos += sizeof(prev_bssid_tlv->header) + MLAN_MAC_ADDR_LENGTH; + } if (wlan_11d_create_dnld_countryinfo(pmpriv, (t_u8)pbss_desc->bss_band)) { diff --git a/mxm_wifiex/wlan_src/mlan/mlan_main.h b/mxm_wifiex/wlan_src/mlan/mlan_main.h index 5cff51a..be2b181 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_main.h +++ b/mxm_wifiex/wlan_src/mlan/mlan_main.h @@ -553,7 +553,7 @@ extern t_void (*assert_callback)(t_void *pmoal_handle, t_u32 cond); /** Maximum numbfer of registers to read for multiple port */ #if defined(SD8887) || defined(SD8997) || defined(SD8977) || \ defined(SD8987) || defined(SD9098) || defined(SD9097) || \ - defined(SD8978) + defined(SD8978) || defined(SD9177) #define MAX_MP_REGS 196 #else /* upto 0xB7 */ @@ -854,6 +854,7 @@ typedef struct { t_u8 data_rates[WLAN_SUPPORTED_RATES]; /** Host MLME flag*/ t_u8 host_mlme; + mlan_802_11_mac_addr prev_bssid; t_u8 use_mfp; } current_bss_params_t; @@ -1887,6 +1888,10 @@ typedef struct _mlan_init_para { t_u8 uap_max_sta; /** dfs w53 cfg */ t_u8 dfs53cfg; +#ifdef PCIE + /** adma ring size */ + t_u16 ring_size; +#endif } mlan_init_para, *pmlan_init_para; #ifdef SDIO @@ -2052,8 +2057,9 @@ typedef struct _mlan_sdio_card { #ifdef PCIE #define MAX_TXRX_BD 32 #define ADMA_MAX_TXRX_BD 512 -/** 512 entry will mapping to 9*/ -#define TX_RX_NUM_DESC 9 +#define ADMA_DEF_TXRX_BD 128 +/** 128 entry will mapping to 7*/ +#define TXRX_DEF_NUM_DESC 7 /** 8 entry will mapping to 3 */ #define EVT_NUM_DESC 3 #define MLAN_MAX_TXRX_BD MAX(ADMA_MAX_TXRX_BD, MAX_TXRX_BD) @@ -2123,8 +2129,6 @@ typedef struct _mlan_pcie_card_reg { t_u8 use_adma; /** write to clear interrupt status flag */ t_u8 msi_int_wr_clr; - /** txrx data dma ring size */ - t_u16 txrx_bd_size; } mlan_pcie_card_reg, *pmlan_pcie_card_reg; typedef struct _mlan_pcie_card { @@ -2153,6 +2157,10 @@ typedef struct _mlan_pcie_card { mlan_buffer *tx_buf_list[MLAN_MAX_TXRX_BD]; /** Flush indicator for txbd_ring */ t_bool txbd_flush; + /** txrx data dma ring size */ + t_u16 txrx_bd_size; + /** txrx num desc */ + t_u16 txrx_num_desc; /** Shadow copy of RXBD write pointer */ t_u32 rxbd_wrptr; @@ -2213,6 +2221,8 @@ typedef struct _mlan_usb_card { typedef struct _mlan_card_info { /** Max Tx buffer size */ t_u32 max_tx_buf_size; + /** support V14_FW_API */ + t_u8 v14_fw_api; /** support V16_FW_API */ t_u8 v16_fw_api; /** support V17_FW_API */ @@ -3387,6 +3397,8 @@ t_void wlan_free_curr_bcn(mlan_private *pmpriv); #endif /* STA_SUPPORT */ /* Rate related functions */ +t_u8 wlan_convert_v14_tx_rate_info(pmlan_private pmpriv, t_u8 v14_rate_info); +t_u8 wlan_convert_v14_rx_rate_info(pmlan_private pmpriv, t_u8 v14_rate_info); /** Convert index into data rate */ t_u32 wlan_index_to_data_rate(pmlan_adapter pmadapter, t_u8 index, t_u8 rate_info, t_u8 ext_rate_info); diff --git a/mxm_wifiex/wlan_src/mlan/mlan_meas.c b/mxm_wifiex/wlan_src/mlan/mlan_meas.c index 35142e8..435c704 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_meas.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_meas.c @@ -42,9 +42,6 @@ Change Log: #include "mlan_ioctl.h" #include "mlan_meas.h" -/** Default measurement duration when not provided by the application */ -#define WLAN_MEAS_DEFAULT_MEAS_DURATION 1000U /* TUs */ - #ifdef DEBUG_LEVEL2 /** String descriptions of the different measurement enums. Debug display */ static const char *meas_type_str[WLAN_MEAS_NUM_TYPES] = { diff --git a/mxm_wifiex/wlan_src/mlan/mlan_misc.c b/mxm_wifiex/wlan_src/mlan/mlan_misc.c index b7709dc..dd15214 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_misc.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_misc.c @@ -596,7 +596,7 @@ mlan_status wlan_get_info_debug_info(pmlan_adapter pmadapter, debug_info->evtbd_ring_size = pmadapter->pcard_pcie->evtbd_ring_size; debug_info->txrx_bd_size = - pmadapter->pcard_pcie->reg->txrx_bd_size; + pmadapter->pcard_pcie->txrx_bd_size; } #endif debug_info->data_sent = pmadapter->data_sent; diff --git a/mxm_wifiex/wlan_src/mlan/mlan_pcie.c b/mxm_wifiex/wlan_src/mlan/mlan_pcie.c index c265f29..aefa40e 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_pcie.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_pcie.c @@ -353,6 +353,41 @@ done: LEAVE(); return ret; } + +/** + * @brief This function init the adma ring size from user input + * + * @param pmadapter A pointer to mlan_adapter structure + * + * @return N/A + */ +static void wlan_pcie_init_adma_ring_size(mlan_adapter *pmadapter) +{ + t_u16 num_desc = 0; + t_u16 ring_size = 0; + + ring_size = pmadapter->init_para.ring_size; + if (!ring_size) + return; + if (ring_size < MAX_TXRX_BD) + ring_size = MAX_TXRX_BD; + else if (ring_size > ADMA_MAX_TXRX_BD) + ring_size = ADMA_MAX_TXRX_BD; + if (ring_size != pmadapter->pcard_pcie->txrx_bd_size) { + ring_size = ring_size >> 1; + while (ring_size > 0) { + ring_size = ring_size >> 1; + num_desc++; + } + pmadapter->pcard_pcie->txrx_bd_size = 1 << num_desc; + pmadapter->pcard_pcie->txrx_num_desc = num_desc; + } + PRINTM(MMSG, "ring_size =%d num_desc=%d\n", + pmadapter->pcard_pcie->txrx_bd_size, + pmadapter->pcard_pcie->txrx_num_desc); + return; +} + #endif #if defined(PCIE9098) || defined(PCIE9097) @@ -700,14 +735,14 @@ static mlan_status wlan_pcie_create_txbd_ring(mlan_adapter *pmadapter) if (!pmadapter->pcard_pcie->reg->use_adma) pmadapter->pcard_pcie->txbd_ring_size = sizeof(mlan_pcie_data_buf) * - pmadapter->pcard_pcie->reg->txrx_bd_size; + pmadapter->pcard_pcie->txrx_bd_size; #endif #if defined(PCIE9098) || defined(PCIE9097) if (pmadapter->pcard_pcie->reg->use_adma) pmadapter->pcard_pcie->txbd_ring_size = sizeof(adma_dual_desc_buf) * - pmadapter->pcard_pcie->reg->txrx_bd_size; + pmadapter->pcard_pcie->txrx_bd_size; #endif PRINTM(MINFO, "TX ring: allocating %d bytes\n", pmadapter->pcard_pcie->txbd_ring_size); @@ -732,7 +767,7 @@ static mlan_status wlan_pcie_create_txbd_ring(mlan_adapter *pmadapter) (t_u32)pmadapter->pcard_pcie->txbd_ring_pbase, pmadapter->pcard_pcie->txbd_ring_size); - for (i = 0; i < pmadapter->pcard_pcie->reg->txrx_bd_size; i++) { + for (i = 0; i < pmadapter->pcard_pcie->txrx_bd_size; i++) { pmadapter->pcard_pcie->tx_buf_list[i] = MNULL; #if defined(PCIE9098) || defined(PCIE9097) if (pmadapter->pcard_pcie->reg->use_adma) { @@ -795,7 +830,7 @@ static mlan_status wlan_pcie_delete_txbd_ring(mlan_adapter *pmadapter) ENTER(); - for (i = 0; i < pmadapter->pcard_pcie->reg->txrx_bd_size; i++) { + for (i = 0; i < pmadapter->pcard_pcie->txrx_bd_size; i++) { if (pmadapter->pcard_pcie->tx_buf_list[i]) { pmbuf = pmadapter->pcard_pcie->tx_buf_list[i]; pcb->moal_unmap_memory(pmadapter->pmoal_handle, @@ -895,7 +930,7 @@ static mlan_status wlan_pcie_create_rxbd_ring(mlan_adapter *pmadapter) to several descriptors */ pmadapter->pcard_pcie->rxbd_ring_size = sizeof(mlan_pcie_data_buf) * - pmadapter->pcard_pcie->reg->txrx_bd_size; + pmadapter->pcard_pcie->txrx_bd_size; } #endif @@ -903,14 +938,14 @@ static mlan_status wlan_pcie_create_rxbd_ring(mlan_adapter *pmadapter) /* * driver maintaines the write pointer and firmware maintaines the read * pointer. The read pointer starts at 0 (zero) while the write pointer - * starts at pmadapter->pcard_pcie->reg->txrx_bd_size; + * starts at pmadapter->pcard_pcie->txrx_bd_size; */ if (pmadapter->pcard_pcie->reg->use_adma) { pmadapter->pcard_pcie->rxbd_wrptr = - pmadapter->pcard_pcie->reg->txrx_bd_size; + pmadapter->pcard_pcie->txrx_bd_size; pmadapter->pcard_pcie->rxbd_ring_size = sizeof(adma_dual_desc_buf) * - pmadapter->pcard_pcie->reg->txrx_bd_size; + pmadapter->pcard_pcie->txrx_bd_size; } #endif @@ -937,7 +972,7 @@ static mlan_status wlan_pcie_create_rxbd_ring(mlan_adapter *pmadapter) (t_u32)pmadapter->pcard_pcie->rxbd_ring_pbase, pmadapter->pcard_pcie->rxbd_ring_size); - for (i = 0; i < pmadapter->pcard_pcie->reg->txrx_bd_size; i++) { + for (i = 0; i < pmadapter->pcard_pcie->txrx_bd_size; i++) { /* Allocate buffer here so that firmware can DMA data on it */ pmbuf = wlan_alloc_mlan_buffer(pmadapter, MLAN_RX_DATA_BUF_SIZE, MLAN_RX_HEADER_LEN, @@ -1032,7 +1067,7 @@ static mlan_status wlan_pcie_delete_rxbd_ring(mlan_adapter *pmadapter) #endif ENTER(); - for (i = 0; i < pmadapter->pcard_pcie->reg->txrx_bd_size; i++) { + for (i = 0; i < pmadapter->pcard_pcie->txrx_bd_size; i++) { if (pmadapter->pcard_pcie->rx_buf_list[i]) { pmbuf = pmadapter->pcard_pcie->rx_buf_list[i]; pcb->moal_unmap_memory(pmadapter->pmoal_handle, @@ -1486,7 +1521,7 @@ static t_u8 wlan_check_tx_pending_buffer(mlan_adapter *pmadapter, t_u32 rdptr) */ static mlan_status wlan_pcie_send_data_complete(mlan_adapter *pmadapter) { - const t_u32 num_tx_buffs = pmadapter->pcard_pcie->reg->txrx_bd_size; + const t_u32 num_tx_buffs = pmadapter->pcard_pcie->txrx_bd_size; mlan_status ret = MLAN_STATUS_SUCCESS; pmlan_callbacks pcb = &pmadapter->callbacks; mlan_buffer *pmbuf; @@ -1624,19 +1659,20 @@ done: #endif #if defined(PCIE9098) || defined(PCIE9097) -#define ADMA_TXBD_IS_FULL(wrptr, rdptr) \ - (((wrptr & TXRX_RW_PTR_MASK) == (rdptr & TXRX_RW_PTR_MASK)) && \ - ((wrptr & TXRX_RW_PTR_ROLLOVER_IND) != \ - (rdptr & TXRX_RW_PTR_ROLLOVER_IND))) +#define ADMA_TXBD_IS_FULL(wrptr, rdptr, mask, rollover_ind) \ + (((wrptr & mask) == (rdptr & mask)) && \ + ((wrptr & rollover_ind) != (rdptr & rollover_ind))) #endif static t_u8 wlan_check_txbd_not_full(mlan_adapter *pmadapter) { + t_u32 txrx_rw_ptr_mask; + t_u32 txrx_rw_ptr_rollover_ind; #if defined(PCIE8997) || defined(PCIE8897) - t_u32 txrx_rw_ptr_mask = pmadapter->pcard_pcie->reg->txrx_rw_ptr_mask; - t_u32 txrx_rw_ptr_rollover_ind = - pmadapter->pcard_pcie->reg->txrx_rw_ptr_rollover_ind; if (!pmadapter->pcard_pcie->reg->use_adma) { + txrx_rw_ptr_mask = pmadapter->pcard_pcie->reg->txrx_rw_ptr_mask; + txrx_rw_ptr_rollover_ind = + pmadapter->pcard_pcie->reg->txrx_rw_ptr_rollover_ind; if (PCIE_TXBD_NOT_FULL(pmadapter->pcard_pcie->txbd_wrptr, pmadapter->pcard_pcie->txbd_rdptr, txrx_rw_ptr_mask, @@ -1648,8 +1684,12 @@ static t_u8 wlan_check_txbd_not_full(mlan_adapter *pmadapter) #endif #if defined(PCIE9098) || defined(PCIE9097) if (pmadapter->pcard_pcie->reg->use_adma) { + txrx_rw_ptr_mask = pmadapter->pcard_pcie->txrx_bd_size - 1; + txrx_rw_ptr_rollover_ind = pmadapter->pcard_pcie->txrx_bd_size; if (!ADMA_TXBD_IS_FULL(pmadapter->pcard_pcie->txbd_wrptr, - pmadapter->pcard_pcie->txbd_rdptr)) + pmadapter->pcard_pcie->txbd_rdptr, + txrx_rw_ptr_mask, + txrx_rw_ptr_rollover_ind)) return MTRUE; else return MFALSE; @@ -1683,7 +1723,7 @@ static mlan_status wlan_pcie_send_data(mlan_adapter *pmadapter, t_u8 type, #if defined(PCIE9098) || defined(PCIE9097) adma_dual_desc_buf *padma_bd_buf = MNULL; #endif - const t_u32 num_tx_buffs = pmadapter->pcard_pcie->reg->txrx_bd_size; + const t_u32 num_tx_buffs = pmadapter->pcard_pcie->txrx_bd_size; mlan_status ret = MLAN_STATUS_PENDING; pmlan_callbacks pcb = &pmadapter->callbacks; t_u32 rxbd_val = 0; @@ -1969,7 +2009,7 @@ static mlan_status wlan_pcie_process_recv_data(mlan_adapter *pmadapter) mlan_buffer *pmbuf = MNULL; t_u32 txbd_val = 0; t_u16 rx_len, rx_type; - const t_u32 num_rx_buffs = pmadapter->pcard_pcie->reg->txrx_bd_size; + const t_u32 num_rx_buffs = pmadapter->pcard_pcie->txrx_bd_size; t_u32 reg_rxbd_rdptr = pmadapter->pcard_pcie->reg->reg_rxbd_rdptr; #if defined(PCIE8997) || defined(PCIE8897) t_u32 txrx_rw_ptr_mask = pmadapter->pcard_pcie->reg->txrx_rw_ptr_mask; @@ -2007,7 +2047,7 @@ static mlan_status wlan_pcie_process_recv_data(mlan_adapter *pmadapter) rd_index = pmadapter->pcard_pcie->rxbd_rdptr & (num_rx_buffs - 1); if (rd_index > - (t_u32)(pmadapter->pcard_pcie->reg->txrx_bd_size - 1)) { + (t_u32)(pmadapter->pcard_pcie->txrx_bd_size - 1)) { PRINTM(MERROR, "RECV DATA: Invalid Rx buffer index.\n"); ret = MLAN_STATUS_FAILURE; goto done; @@ -2127,7 +2167,7 @@ static mlan_status wlan_pcie_process_recv_data(mlan_adapter *pmadapter) /* update rxbd's rdptrs */ if ((++pmadapter->pcard_pcie->rxbd_rdptr & txrx_rw_ptr_mask) == - pmadapter->pcard_pcie->reg->txrx_bd_size) { + pmadapter->pcard_pcie->txrx_bd_size) { pmadapter->pcard_pcie->rxbd_rdptr = ((pmadapter->pcard_pcie->rxbd_rdptr & txrx_rw_ptr_rollover_ind) ^ @@ -2137,7 +2177,7 @@ static mlan_status wlan_pcie_process_recv_data(mlan_adapter *pmadapter) /* update rxbd's wrptrs */ if ((++pmadapter->pcard_pcie->rxbd_wrptr & txrx_rw_ptr_mask) == - pmadapter->pcard_pcie->reg->txrx_bd_size) { + pmadapter->pcard_pcie->txrx_bd_size) { pmadapter->pcard_pcie->rxbd_wrptr = ((pmadapter->pcard_pcie->rxbd_wrptr & txrx_rw_ptr_rollover_ind) ^ @@ -3290,12 +3330,14 @@ mlan_status wlan_get_pcie_device(pmlan_adapter pmadapter) case CARD_TYPE_PCIE8897: pmadapter->pcard_pcie->reg = &mlan_reg_pcie8897; pmadapter->pcard_info = &mlan_card_info_pcie8897; + pmadapter->pcard_pcie->txrx_bd_size = MAX_TXRX_BD; break; #endif #ifdef PCIE8997 case CARD_TYPE_PCIE8997: pmadapter->pcard_pcie->reg = &mlan_reg_pcie8997; pmadapter->pcard_info = &mlan_card_info_pcie8997; + pmadapter->pcard_pcie->txrx_bd_size = MAX_TXRX_BD; break; #endif #if defined(PCIE9098) || defined(PCIE9097) @@ -3303,6 +3345,8 @@ mlan_status wlan_get_pcie_device(pmlan_adapter pmadapter) case CARD_TYPE_PCIE9098: pmadapter->pcard_pcie->reg = &mlan_reg_pcie9098; pmadapter->pcard_info = &mlan_card_info_pcie9098; + pmadapter->pcard_pcie->txrx_bd_size = ADMA_DEF_TXRX_BD; + pmadapter->pcard_pcie->txrx_num_desc = TXRX_DEF_NUM_DESC; #ifdef PCIE9097 if (card_type == CARD_TYPE_PCIE9097 && pmadapter->card_rev == CHIP_9097_REV_B0) @@ -4025,6 +4069,12 @@ mlan_status wlan_alloc_pcie_ring_buf(pmlan_adapter pmadapter) mlan_status ret = MLAN_STATUS_SUCCESS; ENTER(); +#if defined(PCIE9098) || defined(PCIE9097) + if ((pmadapter->card_type == CARD_TYPE_PCIE9098) || + (pmadapter->card_type == CARD_TYPE_PCIE9097)) { + wlan_pcie_init_adma_ring_size(pmadapter); + } +#endif pmadapter->pcard_pcie->cmdrsp_buf = MNULL; ret = wlan_pcie_create_txbd_ring(pmadapter); if (ret) @@ -4137,12 +4187,12 @@ mlan_status wlan_set_pcie_buf_config(mlan_private *pmpriv) (t_u32)(pmadapter->pcard_pcie->txbd_ring_pbase); host_spec.txbd_addr_hi = (t_u32)( ((t_u64)pmadapter->pcard_pcie->txbd_ring_pbase) >> 32); - host_spec.txbd_count = pmadapter->pcard_pcie->reg->txrx_bd_size; + host_spec.txbd_count = pmadapter->pcard_pcie->txrx_bd_size; host_spec.rxbd_addr_lo = (t_u32)(pmadapter->pcard_pcie->rxbd_ring_pbase); host_spec.rxbd_addr_hi = (t_u32)( ((t_u64)pmadapter->pcard_pcie->rxbd_ring_pbase) >> 32); - host_spec.rxbd_count = pmadapter->pcard_pcie->reg->txrx_bd_size; + host_spec.rxbd_count = pmadapter->pcard_pcie->txrx_bd_size; host_spec.evtbd_addr_lo = (t_u32)(pmadapter->pcard_pcie->evtbd_ring_pbase); host_spec.evtbd_addr_hi = (t_u32)( @@ -4165,11 +4215,11 @@ mlan_status wlan_set_pcie_buf_config(mlan_private *pmpriv) /** config ADMA for Tx Data */ wlan_init_adma(pmadapter, ADMA_TX_DATA, pmadapter->pcard_pcie->txbd_ring_pbase, - TX_RX_NUM_DESC, MTRUE); + pmadapter->pcard_pcie->txrx_num_desc, MTRUE); /** config ADMA for Rx Data */ wlan_init_adma(pmadapter, ADMA_RX_DATA, pmadapter->pcard_pcie->rxbd_ring_pbase, - TX_RX_NUM_DESC, MTRUE); + pmadapter->pcard_pcie->txrx_num_desc, MTRUE); /** config ADMA for Rx Event */ wlan_init_adma(pmadapter, ADMA_EVENT, pmadapter->pcard_pcie->evtbd_ring_pbase, diff --git a/mxm_wifiex/wlan_src/mlan/mlan_pcie.h b/mxm_wifiex/wlan_src/mlan/mlan_pcie.h index b26d01f..f912e70 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_pcie.h +++ b/mxm_wifiex/wlan_src/mlan/mlan_pcie.h @@ -487,7 +487,6 @@ static const struct _mlan_pcie_card_reg mlan_reg_pcie8897 = { .txrx_rw_ptr_rollover_ind = MBIT(10), .use_adma = MFALSE, .msi_int_wr_clr = MTRUE, - .txrx_bd_size = MAX_TXRX_BD, }; static const struct _mlan_card_info mlan_card_info_pcie8897 = { @@ -527,7 +526,6 @@ static const struct _mlan_pcie_card_reg mlan_reg_pcie8997 = { .txrx_rw_ptr_rollover_ind = MBIT(12), .use_adma = MFALSE, .msi_int_wr_clr = MTRUE, - .txrx_bd_size = MAX_TXRX_BD, }; static const struct _mlan_card_info mlan_card_info_pcie8997 = { @@ -569,7 +567,6 @@ static const struct _mlan_pcie_card_reg mlan_reg_pcie9098 = { .host_intr_cmd_dnld = PCIE9098_HOST_INTR_CMD_DNLD, .use_adma = MTRUE, .msi_int_wr_clr = MTRUE, - .txrx_bd_size = ADMA_MAX_TXRX_BD, }; static const struct _mlan_card_info mlan_card_info_pcie9098 = { @@ -612,7 +609,6 @@ static const struct _mlan_pcie_card_reg mlan_reg_pcie9097_b0 = { .host_intr_cmd_dnld = PCIE9098_HOST_INTR_CMD_DNLD, .use_adma = MTRUE, .msi_int_wr_clr = MTRUE, - .txrx_bd_size = ADMA_MAX_TXRX_BD, }; #endif diff --git a/mxm_wifiex/wlan_src/mlan/mlan_scan.c b/mxm_wifiex/wlan_src/mlan/mlan_scan.c index fccb410..4da9ff5 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_scan.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_scan.c @@ -977,7 +977,11 @@ wlan_scan_channel_list(mlan_private *pmpriv, t_void *pioctl_buf, /* Send the scan command to the firmware with the specified cfg */ - if (pmadapter->ext_scan) + if (pmadapter->ext_scan +#ifdef USB8801 + && !IS_USB8801(pmadapter->card_type) +#endif + ) cmd_no = HostCmd_CMD_802_11_SCAN_EXT; else cmd_no = HostCmd_CMD_802_11_SCAN; diff --git a/mxm_wifiex/wlan_src/mlan/mlan_sdio.c b/mxm_wifiex/wlan_src/mlan/mlan_sdio.c index c6d13ce..751a109 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_sdio.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_sdio.c @@ -70,6 +70,34 @@ static mlan_status wlan_sdio_init_ioport(mlan_adapter *pmadapter) ENTER(); if (pmadapter->pcard_sd->supports_sdio_new_mode) { pmadapter->pcard_sd->ioport = MEM_PORT; + } else { + if (MLAN_STATUS_SUCCESS == + pcb->moal_read_reg(pmadapter->pmoal_handle, + pmadapter->pcard_sd->reg->io_port_0_reg, + ®)) + pmadapter->pcard_sd->ioport |= (reg & 0xff); + else { + LEAVE(); + return MLAN_STATUS_FAILURE; + } + if (MLAN_STATUS_SUCCESS == + pcb->moal_read_reg(pmadapter->pmoal_handle, + pmadapter->pcard_sd->reg->io_port_1_reg, + ®)) + pmadapter->pcard_sd->ioport |= ((reg & 0xff) << 8); + else { + LEAVE(); + return MLAN_STATUS_FAILURE; + } + if (MLAN_STATUS_SUCCESS == + pcb->moal_read_reg(pmadapter->pmoal_handle, + pmadapter->pcard_sd->reg->io_port_2_reg, + ®)) + pmadapter->pcard_sd->ioport |= ((reg & 0xff) << 16); + else { + LEAVE(); + return MLAN_STATUS_FAILURE; + } } PRINTM(MINFO, "SDIO FUNC1 IO port: 0x%x\n", pmadapter->pcard_sd->ioport); @@ -215,23 +243,36 @@ static mlan_status wlan_get_rd_port(mlan_adapter *pmadapter, t_u8 *pport) LEAVE(); return MLAN_STATUS_FAILURE; } - } - if (pmadapter->pcard_sd->mp_rd_bitmap & - (1 << pmadapter->pcard_sd->curr_rd_port)) { - pmadapter->pcard_sd->mp_rd_bitmap &= - (t_u32)(~(1 << pmadapter->pcard_sd->curr_rd_port)); - *pport = pmadapter->pcard_sd->curr_rd_port; - - /* hw rx wraps round only after port (MAX_PORT-1) */ - if (++pmadapter->pcard_sd->curr_rd_port == max_ports) - pmadapter->pcard_sd->curr_rd_port = reg->start_rd_port; } else { - LEAVE(); - return MLAN_STATUS_FAILURE; + if (!(rd_bitmap & (CTRL_PORT_MASK | reg->data_port_mask))) { + LEAVE(); + return MLAN_STATUS_FAILURE; + } } + if (!new_mode && (pmadapter->pcard_sd->mp_rd_bitmap & CTRL_PORT_MASK)) { + pmadapter->pcard_sd->mp_rd_bitmap &= (t_u32)(~CTRL_PORT_MASK); + *pport = CTRL_PORT; + PRINTM(MIF_D, "wlan_get_rd_port: port=%d mp_rd_bitmap=0x%08x\n", + *pport, pmadapter->pcard_sd->mp_rd_bitmap); + } else { + if (pmadapter->pcard_sd->mp_rd_bitmap & + (1 << pmadapter->pcard_sd->curr_rd_port)) { + pmadapter->pcard_sd->mp_rd_bitmap &= (t_u32)( + ~(1 << pmadapter->pcard_sd->curr_rd_port)); + *pport = pmadapter->pcard_sd->curr_rd_port; - PRINTM(MIF_D, "port=%d mp_rd_bitmap=0x%08x -> 0x%08x\n", *pport, - rd_bitmap, pmadapter->pcard_sd->mp_rd_bitmap); + /* hw rx wraps round only after port (MAX_PORT-1) */ + if (++pmadapter->pcard_sd->curr_rd_port == max_ports) + pmadapter->pcard_sd->curr_rd_port = + reg->start_rd_port; + } else { + LEAVE(); + return MLAN_STATUS_FAILURE; + } + + PRINTM(MIF_D, "port=%d mp_rd_bitmap=0x%08x -> 0x%08x\n", *pport, + rd_bitmap, pmadapter->pcard_sd->mp_rd_bitmap); + } LEAVE(); return MLAN_STATUS_SUCCESS; @@ -248,6 +289,7 @@ static mlan_status wlan_get_wr_port_data(mlan_adapter *pmadapter, t_u8 *pport) { t_u32 wr_bitmap = pmadapter->pcard_sd->mp_wr_bitmap; const mlan_sdio_card_reg *reg = pmadapter->pcard_sd->reg; + t_bool new_mode = pmadapter->pcard_sd->supports_sdio_new_mode; ENTER(); @@ -273,6 +315,14 @@ static mlan_status wlan_get_wr_port_data(mlan_adapter *pmadapter, t_u8 *pport) LEAVE(); return MLAN_STATUS_RESOURCE; } + if ((!new_mode) && (*pport == CTRL_PORT)) { + PRINTM(MERROR, + "Invalid data port=%d cur port=%d mp_wr_bitmap=0x%08x -> 0x%08x\n", + *pport, pmadapter->pcard_sd->curr_wr_port, wr_bitmap, + pmadapter->pcard_sd->mp_wr_bitmap); + LEAVE(); + return MLAN_STATUS_FAILURE; + } PRINTM(MIF_D, "port=%d mp_wr_bitmap=0x%08x -> 0x%08x\n", *pport, wr_bitmap, pmadapter->pcard_sd->mp_wr_bitmap); LEAVE(); @@ -295,7 +345,7 @@ static mlan_status wlan_sdio_poll_card_status(mlan_adapter *pmadapter, ENTER(); - for (tries = 0; tries < MAX_POLL_TRIES; tries++) { + for (tries = 0; tries < 10000; tries++) { if (pcb->moal_read_reg(pmadapter->pmoal_handle, pmadapter->pcard_sd->reg->poll_reg, &cs) != MLAN_STATUS_SUCCESS) @@ -672,6 +722,10 @@ static mlan_status wlan_sdio_prog_fw_w_helper(pmlan_adapter pmadapter, t_u8 *fw, #if defined(SD9097) if (IS_SD9097(pmadapter->card_type)) check_fw_status = MTRUE; +#endif +#if defined(SD9177) + if (IS_SD9177(pmadapter->card_type)) + check_fw_status = MTRUE; #endif /* Perform firmware data transfer */ do { @@ -1103,6 +1157,10 @@ static mlan_status wlan_receive_mp_aggr_buf(mlan_adapter *pmadapter) cmd53_port = (pmadapter->pcard_sd->ioport | SDIO_MPA_ADDR_BASE | (port_count << 8)) + pmadapter->pcard_sd->mpa_rx.start_port; + } else { + cmd53_port = (pmadapter->pcard_sd->ioport | SDIO_MPA_ADDR_BASE | + (pmadapter->pcard_sd->mpa_rx.ports << 4)) + + pmadapter->pcard_sd->mpa_rx.start_port; } do { ret = pcb->moal_read_data_sync(pmadapter->pmoal_handle, @@ -1222,6 +1280,14 @@ static mlan_status wlan_sdio_card_to_host_mp_aggr(mlan_adapter *pmadapter, t_bool new_mode = pmadapter->pcard_sd->supports_sdio_new_mode; ENTER(); + if (!new_mode && (port == CTRL_PORT)) { + /* Read the command response or event without aggr */ + PRINTM(MINFO, + "card_2_host_mp_aggr: No aggr for control port\n"); + + f_do_rx_cur = 1; + goto rx_curr_single; + } if (!pmadapter->pcard_sd->mpa_rx.enabled) { PRINTM(MINFO, @@ -1231,7 +1297,9 @@ static mlan_status wlan_sdio_card_to_host_mp_aggr(mlan_adapter *pmadapter, goto rx_curr_single; } if ((new_mode && - (pmadapter->pcard_sd->mp_rd_bitmap & reg->data_port_mask))) { + (pmadapter->pcard_sd->mp_rd_bitmap & reg->data_port_mask)) || + (!new_mode && (pmadapter->pcard_sd->mp_rd_bitmap & + (~((t_u32)CTRL_PORT_MASK))))) { /* Some more data RX pending */ PRINTM(MINFO, "card_2_host_mp_aggr: Not last packet\n"); @@ -1270,8 +1338,13 @@ static mlan_status wlan_sdio_card_to_host_mp_aggr(mlan_adapter *pmadapter, /* Curr pkt can be aggregated */ if (new_mode) MP_RX_AGGR_SETUP(pmadapter, pmbuf, port, rx_len); + else + MP_RX_AGGR_SETUP_NONEWMODE(pmadapter, pmbuf, port, + rx_len); if (MP_RX_AGGR_PKT_LIMIT_REACHED(pmadapter) || - ((new_mode && MP_RX_AGGR_PORT_LIMIT_REACHED(pmadapter)))) { + ((new_mode && MP_RX_AGGR_PORT_LIMIT_REACHED(pmadapter)) || + (!new_mode && + MP_RX_AGGR_PORT_LIMIT_REACHED_NONEWMODE(pmadapter)))) { PRINTM(MINFO, "card_2_host_mp_aggr: Aggregation Packet limit reached\n"); /* No more pkts allowed in Aggr buf, rx it */ @@ -1300,7 +1373,17 @@ rx_curr_single: ret = MLAN_STATUS_FAILURE; goto done; } - if (new_mode) { + if (!new_mode && + ((port == CTRL_PORT) && ((pkt_type != MLAN_TYPE_EVENT) && + (pkt_type != MLAN_TYPE_CMD)))) { + PRINTM(MERROR, + "Wrong pkt from CTRL PORT: type=%d, len=%dd\n", + pkt_type, pmbuf->data_len); + pmbuf->status_code = MLAN_ERROR_DATA_RX_FAIL; + ret = MLAN_STATUS_FAILURE; + goto done; + } + if (new_mode || (port != CTRL_PORT)) { if (pkt_type != MLAN_TYPE_DATA && pkt_type != MLAN_TYPE_SPA_DATA) { PRINTM(MERROR, @@ -1312,7 +1395,7 @@ rx_curr_single: } } - if (new_mode) + if (new_mode || (port != CTRL_PORT)) pmadapter->pcard_sd->mpa_rx_count[0]++; wlan_decode_rx_packet(pmadapter, pmbuf, pkt_type, MTRUE); @@ -1322,6 +1405,9 @@ rx_curr_single: /* Curr pkt can be aggregated */ if (new_mode) MP_RX_AGGR_SETUP(pmadapter, pmbuf, port, rx_len); + else + MP_RX_AGGR_SETUP_NONEWMODE(pmadapter, pmbuf, port, + rx_len); } done: if (ret == MLAN_STATUS_FAILURE) { @@ -1397,6 +1483,10 @@ mlan_status wlan_send_mp_aggr_buf(mlan_adapter *pmadapter) cmd53_port = (pmadapter->pcard_sd->ioport | SDIO_MPA_ADDR_BASE | (port_count << 8)) + pmadapter->pcard_sd->mpa_tx.start_port; + } else { + cmd53_port = (pmadapter->pcard_sd->ioport | SDIO_MPA_ADDR_BASE | + (pmadapter->pcard_sd->mpa_tx.ports << 4)) + + pmadapter->pcard_sd->mpa_tx.start_port; } if (pmadapter->pcard_sd->mpa_tx.pkt_cnt == 1) cmd53_port = pmadapter->pcard_sd->ioport + @@ -1560,12 +1650,19 @@ static mlan_status wlan_host_to_card_mp_aggr(mlan_adapter *pmadapter, if (!pmadapter->pcard_sd->mpa_tx.buf) { if (new_mode) MP_TX_AGGR_BUF_PUT_SG(pmadapter, mbuf, port); + else + MP_TX_AGGR_BUF_PUT_SG_NONEWMODE(pmadapter, mbuf, + port); aggr_sg = MTRUE; } else { if (new_mode) MP_TX_AGGR_BUF_PUT(pmadapter, mbuf, port); + else + MP_TX_AGGR_BUF_PUT_NONEWMODE(pmadapter, mbuf, + port); } - if (MP_TX_AGGR_PKT_LIMIT_REACHED(pmadapter)) { + if (MP_TX_AGGR_PKT_LIMIT_REACHED(pmadapter) || + (!new_mode && MP_TX_AGGR_PORT_LIMIT_REACHED(pmadapter))) { PRINTM(MIF_D, "host_2_card_mp_aggr: Aggregation Pkt limit reached\n"); /* No more pkts allowed in Aggr buf, send it */ @@ -1634,10 +1731,16 @@ tx_curr_single: if (!pmadapter->pcard_sd->mpa_tx.buf) { if (new_mode) MP_TX_AGGR_BUF_PUT_SG(pmadapter, mbuf, port); + else + MP_TX_AGGR_BUF_PUT_SG_NONEWMODE(pmadapter, mbuf, + port); aggr_sg = MTRUE; } else { if (new_mode) MP_TX_AGGR_BUF_PUT(pmadapter, mbuf, port); + else + MP_TX_AGGR_BUF_PUT_NONEWMODE(pmadapter, mbuf, + port); } } /* Always return PENDING in SG mode */ @@ -1670,6 +1773,12 @@ static mlan_status wlan_sdio_check_winner_status(mlan_adapter *pmadapter, ENTER(); +#ifdef SD8801 + if (IS_SD8801(pmadapter->card_type)) { + *val = 0; + return MLAN_STATUS_SUCCESS; + } +#endif pcb = &pmadapter->callbacks; if (MLAN_STATUS_SUCCESS != pcb->moal_read_reg(pmadapter->pmoal_handle, @@ -1835,6 +1944,10 @@ poll_fw: LEAVE(); return ret; } +#ifdef SD9177 + if (IS_SD9177(pmadapter->card_type)) + wlan_mdelay(pmadapter, 1000); +#endif done: /* re-enable host interrupt for mlan after fw dnld is successful */ @@ -1907,6 +2020,20 @@ mlan_status wlan_get_sdio_device(pmlan_adapter pmadapter) pmadapter->pcard_sd->mp_rx_aggr_buf_size = SDIO_MP_AGGR_BUF_SIZE_MAX; switch (card_type) { +#ifdef SD8801 + case CARD_TYPE_SD8801: + pmadapter->pcard_sd->reg = &mlan_reg_sd8801; + pmadapter->pcard_info = &mlan_card_info_sd8801; + pmadapter->pcard_sd->max_ports = MAX_PORT_16; + pmadapter->pcard_sd->mp_aggr_pkt_limit = + SDIO_MP_AGGR_DEF_PKT_LIMIT_8; + pmadapter->pcard_sd->supports_sdio_new_mode = MFALSE; + pmadapter->pcard_sd->mp_tx_aggr_buf_size = + SDIO_MP_AGGR_BUF_SIZE_32K; + pmadapter->pcard_sd->mp_rx_aggr_buf_size = + SDIO_MP_AGGR_BUF_SIZE_32K; + break; +#endif #ifdef SD8887 case CARD_TYPE_SD8887: pmadapter->pcard_sd->reg = &mlan_reg_sd8887; @@ -1949,6 +2076,12 @@ mlan_status wlan_get_sdio_device(pmlan_adapter pmadapter) pmadapter->pcard_sd->reg = &mlan_reg_sd8977_sd8997; pmadapter->pcard_info = &mlan_card_info_sd9097; break; +#endif +#ifdef SD9177 + case CARD_TYPE_SD9177: + pmadapter->pcard_sd->reg = &mlan_reg_sd8977_sd8997; + pmadapter->pcard_info = &mlan_card_info_sd9177; + break; #endif default: PRINTM(MERROR, "can't get right card type \n"); @@ -2044,6 +2177,8 @@ static mlan_status wlan_sdio_card_to_host_recovery(mlan_adapter *pmadapter, t_u32 pkt_type = 0; mlan_status ret = MLAN_STATUS_FAILURE; ENTER(); + if (!pmadapter->pcard_sd->supports_sdio_new_mode) + goto done; if (MP_RX_AGGR_IN_PROGRESS(pmadapter)) { PRINTM(MDATA, "Recovery:do Rx Aggr\n"); /* do aggr RX now */ @@ -2234,6 +2369,15 @@ static mlan_status wlan_process_sdio_int_status(mlan_adapter *pmadapter) pmadapter->data_sent = MFALSE; } } + if ((!new_mode) && (pmadapter->cmd_sent == MTRUE)) { + /* Check if firmware has attach buffer at command port and + * update just that in wr_bit_map. */ + pmadapter->pcard_sd->mp_wr_bitmap |= + (t_u32)pmadapter->pcard_sd->mp_regs[reg->wr_bitmap_l] & + CTRL_PORT_MASK; + if (pmadapter->pcard_sd->mp_wr_bitmap & CTRL_PORT_MASK) + pmadapter->cmd_sent = MFALSE; + } if (sdio_ireg & UP_LD_HOST_INT_STATUS) { pmadapter->pcard_sd->mp_rd_bitmap = @@ -2280,7 +2424,8 @@ static mlan_status wlan_process_sdio_int_status(mlan_adapter *pmadapter) } rx_len = (t_u16)(rx_blocks * MLAN_SDIO_BLOCK_SIZE); - if ((rx_len > MRVDRV_ETH_RX_PACKET_BUFFER_SIZE)) + if ((rx_len > MRVDRV_ETH_RX_PACKET_BUFFER_SIZE) || + (!new_mode && (port == CTRL_PORT))) pmbuf = wlan_alloc_mlan_buffer( pmadapter, rx_len, 0, MOAL_MALLOC_BUFFER); @@ -2303,7 +2448,12 @@ static mlan_status wlan_process_sdio_int_status(mlan_adapter *pmadapter) if (MLAN_STATUS_SUCCESS != wlan_sdio_card_to_host_mp_aggr(pmadapter, pmbuf, port, rx_len)) { - pmadapter->dbg.num_rx_card_to_host_failure++; + if ((!new_mode) && (port == CTRL_PORT)) + pmadapter->dbg + .num_cmdevt_card_to_host_failure++; + else + pmadapter->dbg + .num_rx_card_to_host_failure++; PRINTM(MERROR, "Card to host failed: int status=0x%x\n", @@ -2401,6 +2551,9 @@ mlan_status wlan_sdio_host_to_card(mlan_adapter *pmadapter, t_u8 type, } else { /*Type must be MLAN_TYPE_CMD*/ pmadapter->cmd_sent = MTRUE; + if (!new_mode) + pmadapter->pcard_sd->mp_wr_bitmap &= + (t_u32)(~(1 << CTRL_PORT)); if (pmbuf->data_len <= SDIO_INTF_HEADER_LEN || pmbuf->data_len > WLAN_UPLD_SIZE) PRINTM(MWARN, @@ -2411,6 +2564,8 @@ mlan_status wlan_sdio_host_to_card(mlan_adapter *pmadapter, t_u8 type, if (new_mode) cmd53_port = (pmadapter->pcard_sd->ioport) | CMD_PORT_SLCT; + else + cmd53_port = pmadapter->pcard_sd->ioport + CTRL_PORT; ret = wlan_write_data_sync(pmadapter, pmbuf, cmd53_port); } @@ -2437,7 +2592,7 @@ exit: return ret; } -#if defined(SD9098) || defined(SD9097) +#if (defined(SD9098) || defined(SD9097) || defined(SD9177)) /** * @brief This function sends vdll data to the card. * @@ -2498,7 +2653,7 @@ static mlan_status wlan_sdio_host_to_card_ext(pmlan_private pmpriv, t_u8 type, mlan_status ret = MLAN_STATUS_SUCCESS; mlan_adapter *pmadapter = pmpriv->adapter; -#if defined(SD9098) || defined(SD9097) +#if (defined(SD9098) || defined(SD9097) || defined(SD9177)) if (type == MLAN_TYPE_VDLL) return wlan_sdio_send_vdll(pmadapter, pmbuf); #endif @@ -2961,7 +3116,8 @@ mlan_status wlan_reset_fw(pmlan_adapter pmadapter) goto done; } #if defined(SD8997) || defined(SD8977) || defined(SD8987) || \ - defined(SD9098) || defined(SD9097) || defined(SD8978) + defined(SD9098) || defined(SD9097) || defined(SD8978) || \ + defined(SD9177) if (MFALSE #ifdef SD8997 || IS_SD8997(pmadapter->card_type) @@ -2980,6 +3136,9 @@ mlan_status wlan_reset_fw(pmlan_adapter pmadapter) #endif #ifdef SD9097 || IS_SD9097(pmadapter->card_type) +#endif +#ifdef SD9177 + || IS_SD9177(pmadapter->card_type) #endif ) { pcb->moal_read_reg(pmadapter->pmoal_handle, diff --git a/mxm_wifiex/wlan_src/mlan/mlan_sdio.h b/mxm_wifiex/wlan_src/mlan/mlan_sdio.h index 328c782..60dca48 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_sdio.h +++ b/mxm_wifiex/wlan_src/mlan/mlan_sdio.h @@ -130,6 +130,10 @@ Change log: #define REG_PORT 0 /** Port for memory */ #define MEM_PORT 0x10000 +/** Ctrl port */ +#define CTRL_PORT 0 +/** Ctrl port mask */ +#define CTRL_PORT_MASK 0x0001 /** Card Control Registers : cmd53 new mode */ #define CMD53_NEW_MODE (0x1U << 0) /** Card Control Registers : cmd53 tx len format 1 (0x10) */ @@ -190,6 +194,29 @@ Change log: a->pcard_sd->mpa_tx.pkt_cnt++; \ } while (0) +#define MP_TX_AGGR_BUF_PUT_NONEWMODE(a, mbuf, port) \ + do { \ + pmadapter->callbacks.moal_memmove( \ + a->pmoal_handle, \ + &a->pcard_sd->mpa_tx.buf[a->pcard_sd->mpa_tx.buf_len], \ + mbuf->pbuf + mbuf->data_offset, mbuf->data_len); \ + a->pcard_sd->mpa_tx.buf_len += mbuf->data_len; \ + a->pcard_sd->mpa_tx.mp_wr_info[a->pcard_sd->mpa_tx.pkt_cnt] = \ + *(t_u16 *)(mbuf->pbuf + mbuf->data_offset); \ + if (!a->pcard_sd->mpa_tx.pkt_cnt) { \ + a->pcard_sd->mpa_tx.start_port = port; \ + } \ + if (a->pcard_sd->mpa_tx.start_port <= port) { \ + a->pcard_sd->mpa_tx.ports |= \ + (1 << (a->pcard_sd->mpa_tx.pkt_cnt)); \ + } else { \ + a->pcard_sd->mpa_tx.ports |= \ + (1 << (a->pcard_sd->mpa_tx.pkt_cnt + 1 + \ + (a->pcard_sd->max_ports - \ + a->pcard_sd->mp_end_port))); \ + } \ + a->pcard_sd->mpa_tx.pkt_cnt++; \ + } while (0) #define MP_TX_AGGR_BUF_PUT_SG(a, mbuf, port) \ do { \ a->pcard_sd->mpa_tx.buf_len += mbuf->data_len; \ @@ -203,11 +230,37 @@ Change log: a->pcard_sd->mpa_tx.ports |= (1 << port); \ a->pcard_sd->mpa_tx.pkt_cnt++; \ } while (0) +#define MP_TX_AGGR_BUF_PUT_SG_NONEWMODE(a, mbuf, port) \ + do { \ + a->pcard_sd->mpa_tx.buf_len += mbuf->data_len; \ + a->pcard_sd->mpa_tx.mp_wr_info[a->pcard_sd->mpa_tx.pkt_cnt] = \ + *(t_u16 *)(mbuf->pbuf + mbuf->data_offset); \ + a->pcard_sd->mpa_tx.mbuf_arr[a->pcard_sd->mpa_tx.pkt_cnt] = \ + mbuf; \ + if (!a->pcard_sd->mpa_tx.pkt_cnt) { \ + a->pcard_sd->mpa_tx.start_port = port; \ + } \ + if (a->pcard_sd->mpa_tx.start_port <= port) { \ + a->pcard_sd->mpa_tx.ports |= \ + (1 << (a->pcard_sd->mpa_tx.pkt_cnt)); \ + } else { \ + a->pcard_sd->mpa_tx.ports |= \ + (1 << (a->pcard_sd->mpa_tx.pkt_cnt + 1 + \ + (a->pcard_sd->max_ports - \ + a->pcard_sd->mp_end_port))); \ + } \ + a->pcard_sd->mpa_tx.pkt_cnt++; \ + } while (0) /** SDIO Tx aggregation limit ? */ #define MP_TX_AGGR_PKT_LIMIT_REACHED(a) \ ((a->pcard_sd->mpa_tx.pkt_cnt) == (a->pcard_sd->mpa_tx.pkt_aggr_limit)) +#define MP_TX_AGGR_PORT_LIMIT_REACHED(a) \ + ((a->pcard_sd->curr_wr_port < a->pcard_sd->mpa_tx.start_port) && \ + (((a->pcard_sd->max_ports - a->pcard_sd->mpa_tx.start_port) + \ + a->pcard_sd->curr_wr_port) >= a->pcard_sd->mp_aggr_pkt_limit)) + /** Reset SDIO Tx aggregation buffer parameters */ #define MP_TX_AGGR_BUF_RESET(a) \ do { \ @@ -236,6 +289,11 @@ Change log: ((a->pcard_sd->curr_rd_port - a->pcard_sd->mpa_rx.start_port) >= \ (a->pcard_sd->mp_end_port >> 1))) +#define MP_RX_AGGR_PORT_LIMIT_REACHED_NONEWMODE(a) \ + ((a->pcard_sd->curr_rd_port < a->pcard_sd->mpa_rx.start_port) && \ + (((a->pcard_sd->max_ports - a->pcard_sd->mpa_rx.start_port) + \ + a->pcard_sd->curr_rd_port) >= a->pcard_sd->mp_aggr_pkt_limit)) + /** SDIO Rx aggregation in progress ? */ #define MP_RX_AGGR_IN_PROGRESS(a) (a->pcard_sd->mpa_rx.pkt_cnt > 0) @@ -258,6 +316,26 @@ Change log: a->pcard_sd->mpa_rx.pkt_cnt++; \ } while (0) +#define MP_RX_AGGR_SETUP_NONEWMODE(a, mbuf, port, rx_len) \ + do { \ + a->pcard_sd->mpa_rx.buf_len += rx_len; \ + if (!a->pcard_sd->mpa_rx.pkt_cnt) { \ + a->pcard_sd->mpa_rx.start_port = port; \ + } \ + if (a->pcard_sd->mpa_rx.start_port <= port) { \ + a->pcard_sd->mpa_rx.ports |= \ + (1 << (a->pcard_sd->mpa_rx.pkt_cnt)); \ + } else { \ + a->pcard_sd->mpa_rx.ports |= \ + (1 << (a->pcard_sd->mpa_rx.pkt_cnt + 1)); \ + } \ + a->pcard_sd->mpa_rx.mbuf_arr[a->pcard_sd->mpa_rx.pkt_cnt] = \ + mbuf; \ + a->pcard_sd->mpa_rx.len_arr[a->pcard_sd->mpa_rx.pkt_cnt] = \ + rx_len; \ + a->pcard_sd->mpa_rx.pkt_cnt++; \ + } while (0); + /** Reset SDIO Rx aggregation buffer parameters */ #define MP_RX_AGGR_BUF_RESET(a) \ do { \ @@ -342,6 +420,46 @@ static const struct _mlan_card_info mlan_card_info_sd8887 = { }; #endif +#ifdef SD8801 +static const struct _mlan_sdio_card_reg mlan_reg_sd8801 = { + .start_rd_port = 1, + .start_wr_port = 1, + .base_0_reg = 0x40, + .base_1_reg = 0x41, + .poll_reg = 0x30, + .host_int_enable = UP_LD_HOST_INT_MASK | DN_LD_HOST_INT_MASK, + .host_int_status = DN_LD_HOST_INT_STATUS | UP_LD_HOST_INT_STATUS, + .status_reg_0 = 0x60, + .status_reg_1 = 0x61, + .sdio_int_mask = 0x3f, + .data_port_mask = 0x0000fffe, + .max_mp_regs = 64, + .rd_bitmap_l = 0x4, + .rd_bitmap_u = 0x5, + .wr_bitmap_l = 0x6, + .wr_bitmap_u = 0x7, + .rd_len_p0_l = 0x8, + .rd_len_p0_u = 0x9, + .io_port_0_reg = 0x78, + .io_port_1_reg = 0x79, + .io_port_2_reg = 0x7A, + .host_int_rsr_reg = 0x01, + .host_int_mask_reg = 0x02, + .host_int_status_reg = 0x03, + .card_misc_cfg_reg = 0x6c, + .fw_reset_reg = 0x64, + .fw_reset_val = 0, +}; + +static const struct _mlan_card_info mlan_card_info_sd8801 = { + .max_tx_buf_size = MLAN_TX_DATA_BUF_SIZE_2K, + .v14_fw_api = 1, + .v16_fw_api = 0, + .supp_ps_handshake = 0, + .default_11n_tx_bf_cap = DEFAULT_11N_TX_BF_CAP_1X1, +}; +#endif + #ifdef SD8897 static const struct _mlan_sdio_card_reg mlan_reg_sd8897 = { .start_rd_port = 0, @@ -413,7 +531,8 @@ static const struct _mlan_card_info mlan_card_info_sd8897 = { #endif #if defined(SD8977) || defined(SD8997) || defined(SD8987) || \ - defined(SD9098) || defined(SD9097) || defined(SD8978) + defined(SD9098) || defined(SD9097) || defined(SD8978) || \ + defined(SD9177) static const struct _mlan_sdio_card_reg mlan_reg_sd8977_sd8997 = { .start_rd_port = 0, .start_wr_port = 0, @@ -508,6 +627,15 @@ static const struct _mlan_card_info mlan_card_info_sd9098 = { .default_11n_tx_bf_cap = DEFAULT_11N_TX_BF_CAP_2X2, }; #endif +#ifdef SD9177 +static const struct _mlan_card_info mlan_card_info_sd9177 = { + .max_tx_buf_size = MLAN_TX_DATA_BUF_SIZE_4K, + .v16_fw_api = 1, + .v17_fw_api = 1, + .supp_ps_handshake = 0, + .default_11n_tx_bf_cap = DEFAULT_11N_TX_BF_CAP_1X1, +}; +#endif #if defined(SD8977) || defined(SD8978) static const struct _mlan_card_info mlan_card_info_sd8977 = { diff --git a/mxm_wifiex/wlan_src/mlan/mlan_shim.c b/mxm_wifiex/wlan_src/mlan/mlan_shim.c index 63c4ca9..c3cdb7c 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_shim.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_shim.c @@ -378,6 +378,7 @@ mlan_status mlan_register(pmlan_device pmdevice, t_void **ppmlan_adapter) memcpy_ext(pmadapter, &pmadapter->ops, &mlan_pcie_ops, sizeof(mlan_adapter_operations), sizeof(mlan_adapter_operations)); + pmadapter->init_para.ring_size = pmdevice->ring_size; ret = wlan_get_pcie_device(pmadapter); if (MLAN_STATUS_SUCCESS != ret) { ret = MLAN_STATUS_FAILURE; diff --git a/mxm_wifiex/wlan_src/mlan/mlan_sta_ioctl.c b/mxm_wifiex/wlan_src/mlan/mlan_sta_ioctl.c index 81fab2e..d63dcba 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_sta_ioctl.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_sta_ioctl.c @@ -1059,6 +1059,10 @@ static mlan_status wlan_bss_ioctl_start(pmlan_adapter pmadapter, "SSID found in scan list ... associating...\n"); pmpriv->curr_bss_params.host_mlme = bss->param.ssid_bssid.host_mlme; + memcpy_ext(pmpriv->adapter, + &pmpriv->curr_bss_params.prev_bssid, + &bss->param.ssid_bssid.prev_bssid, + MLAN_MAC_ADDR_LENGTH, MLAN_MAC_ADDR_LENGTH); /* Clear any past association response stored for * application retrieval */ pmpriv->assoc_rsp_size = 0; @@ -4315,10 +4319,6 @@ static mlan_status wlan_misc_ioctl_subscribe_evt(pmlan_adapter pmadapter, return ret; } -#define FLTR_BUF_IP_OFFSET 24 -#define FLTR_BUF_IP_OFFSET_2_IP_1 9 -#define FLTR_BUF_IP_OFFSET_2_IP_2 26 - /** * @brief MEF configuration * diff --git a/mxm_wifiex/wlan_src/mlan/mlan_sta_rx.c b/mxm_wifiex/wlan_src/mlan/mlan_sta_rx.c index 9446c07..5cf92ec 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_sta_rx.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_sta_rx.c @@ -576,6 +576,15 @@ mlan_status wlan_ops_sta_process_rx_packet(t_void *adapter, pmlan_buffer pmbuf) prx_pd = (RxPD *)(pmbuf->pbuf + pmbuf->data_offset); /* Endian conversion */ endian_convert_RxPD(prx_pd); + if (priv->adapter->pcard_info->v14_fw_api) { + t_u8 rxpd_rate_info_orig = prx_pd->rate_info; + prx_pd->rate_info = wlan_convert_v14_rx_rate_info( + priv, rxpd_rate_info_orig); + PRINTM(MINFO, + "STA RX: v14_fw_api=%d rx_rate =%d rxpd_rate_info=0x%x->0x%x\n", + priv->adapter->pcard_info->v14_fw_api, prx_pd->rx_rate, + rxpd_rate_info_orig, prx_pd->rate_info); + } rx_pkt_type = prx_pd->rx_pkt_type; prx_pkt = (RxPacketHdr_t *)((t_u8 *)prx_pd + prx_pd->rx_pkt_offset); diff --git a/mxm_wifiex/wlan_src/mlan/mlan_uap_txrx.c b/mxm_wifiex/wlan_src/mlan/mlan_uap_txrx.c index 1edee7d..e8e3085 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_uap_txrx.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_uap_txrx.c @@ -320,6 +320,16 @@ mlan_status wlan_ops_uap_process_rx_packet(t_void *adapter, pmlan_buffer pmbuf) /* Endian conversion */ endian_convert_RxPD(prx_pd); + if (priv->adapter->pcard_info->v14_fw_api) { + t_u8 rxpd_rate_info_orig = prx_pd->rate_info; + prx_pd->rate_info = wlan_convert_v14_rx_rate_info( + priv, rxpd_rate_info_orig); + PRINTM(MINFO, + "UAP RX: v14_fw_api=%d rx_rate =%d rxpd_rate_info=0x%x->0x%x\n", + priv->adapter->pcard_info->v14_fw_api, prx_pd->rx_rate, + rxpd_rate_info_orig, prx_pd->rate_info); + } + if (priv->rx_pkt_info) { ext_rate_info = (t_u8)(prx_pd->rx_info >> 16); pmbuf->u.rx_info.data_rate = diff --git a/mxm_wifiex/wlan_src/mlan/mlan_usb.c b/mxm_wifiex/wlan_src/mlan/mlan_usb.c index b1a2abd..5e32dec 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_usb.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_usb.c @@ -37,6 +37,15 @@ Change log: /******************************************************** Local Variables ********************************************************/ +#ifdef USB8801 +static const struct _mlan_card_info mlan_card_info_usb8801 = { + .max_tx_buf_size = MLAN_TX_DATA_BUF_SIZE_2K, + .v14_fw_api = 1, + .v16_fw_api = 0, + .supp_ps_handshake = 1, + .default_11n_tx_bf_cap = DEFAULT_11N_TX_BF_CAP_1X1, +}; +#endif #ifdef USB8897 static const struct _mlan_card_info mlan_card_info_usb8897 = { .max_tx_buf_size = MLAN_TX_DATA_BUF_SIZE_4K, @@ -729,6 +738,11 @@ mlan_status wlan_get_usb_device(pmlan_adapter pmadapter) } switch (card_type) { +#ifdef USB8801 + case CARD_TYPE_USB8801: + pmadapter->pcard_info = &mlan_card_info_usb8801; + break; +#endif #ifdef USB8897 case CARD_TYPE_USB8897: pmadapter->pcard_info = &mlan_card_info_usb8897; diff --git a/mxm_wifiex/wlan_src/mlan/mlan_wmm.c b/mxm_wifiex/wlan_src/mlan/mlan_wmm.c index 2e29079..1ff9ac1 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_wmm.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_wmm.c @@ -45,35 +45,6 @@ Change log: Local Variables ********************************************************/ -/** Maximum value FW can accept for driver delay in packet transmission */ -#define DRV_PKT_DELAY_TO_FW_MAX 512 - -/* - * Upper and Lower threshold for packet queuing in the driver - - * - When the number of packets queued reaches the upper limit, - * the driver will stop the net queue in the app/kernel space. - - * - When the number of packets drops beneath the lower limit after - * having reached the upper limit, the driver will restart the net - * queue. - */ - -/** Lower threshold for packet queuing in the driver. - * When the number of packets drops beneath the lower limit after having - * reached the upper limit, the driver will restart the net queue. - */ -#define WMM_QUEUED_PACKET_LOWER_LIMIT 180 - -/** Upper threshold for packet queuing in the driver. - * When the number of packets queued reaches the upper limit, the driver - * will stop the net queue in the app/kernel space. - */ -#define WMM_QUEUED_PACKET_UPPER_LIMIT 200 - -/** Offset for TOS field in the IP header */ -#define IPTOS_OFFSET 5 - /** WMM information IE */ static const t_u8 wmm_info_ie[] = {WMM_IE, 0x07, 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00}; diff --git a/mxm_wifiex/wlan_src/mlinux/mlan_decl.h b/mxm_wifiex/wlan_src/mlinux/mlan_decl.h index 7d622e1..34c114f 100644 --- a/mxm_wifiex/wlan_src/mlinux/mlan_decl.h +++ b/mxm_wifiex/wlan_src/mlinux/mlan_decl.h @@ -24,7 +24,7 @@ #define _MLAN_DECL_H_ /** MLAN release version */ -#define MLAN_RELEASE_VERSION "241" +#define MLAN_RELEASE_VERSION "247" /** Re-define generic data types for MLAN/MOAL */ /** Signed char (1-byte) */ @@ -886,12 +886,6 @@ enum { SCAN_MODE_MANUAL = 0, SCAN_MODE_USER, }; -/** max cac time 10 minutes */ -#define MAX_CAC_DWELL_TIME 600000 -/** default cac time 60 seconds */ -#define DEF_CAC_DWELL_TIME 60000 -/** start freq for 5G */ -#define START_FREQ_11A_BAND 5000 /** DFS state */ typedef enum _dfs_state_t { /** Channel can be used, CAC (Channel Availability Check) must be done @@ -903,6 +897,13 @@ typedef enum _dfs_state_t { DFS_AVAILABLE = 2, } dfs_state_t; +/** max cac time 10 minutes */ +#define MAX_CAC_DWELL_TIME 600000 +/** default cac time 60 seconds */ +#define DEF_CAC_DWELL_TIME 60000 +/** start freq for 5G */ +#define START_FREQ_11A_BAND 5000 + typedef enum _dfs_w53_cfg_t { /** DFS W53 Default Fw Value */ DFS_W53_DEFAULT_FW = 0, @@ -976,6 +977,9 @@ typedef struct _cfp_dyn_t { t_u16 flags; /** TRUE: Channel is blacklisted (do not use) */ t_bool blacklist; + /** DFS state of the channel + * 0:DFS_USABLE 1:DFS_AVAILABLE 2:DFS_UNAVAILABLE */ + dfs_state_t dfs_state; } cfp_dyn_t; /** Chan-Freq-TxPower mapping table*/ @@ -2090,6 +2094,9 @@ typedef struct _mlan_device { /** MFG mode */ t_u32 mfg_mode; #endif +#ifdef PCIE + t_u16 ring_size; +#endif #if defined(SDIO) /** SDIO interrupt mode (0: INT_MODE_SDIO, 1: INT_MODE_GPIO) */ t_u32 int_mode; diff --git a/mxm_wifiex/wlan_src/mlinux/mlan_ioctl.h b/mxm_wifiex/wlan_src/mlinux/mlan_ioctl.h index 29a8c02..c0015af 100644 --- a/mxm_wifiex/wlan_src/mlinux/mlan_ioctl.h +++ b/mxm_wifiex/wlan_src/mlinux/mlan_ioctl.h @@ -695,6 +695,8 @@ typedef struct _mlan_ssid_bssid { t_u32 idx; /** Receive signal strength in dBm */ t_s32 rssi; + /* previous bssid */ + mlan_802_11_mac_addr prev_bssid; /**channel*/ t_u16 channel; /**mobility domain value*/ diff --git a/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c b/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c index 19d58c4..e5da4ca 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c @@ -3468,8 +3468,8 @@ static t_u8 is_selected_registrar_on(const t_u8 *ie, int len) u8 *pos = NULL; while (left_len > (int)sizeof(TLV_Generic_t)) { - tlv_type = ntohs(tlv->type); - tlv_len = ntohs(tlv->len); + tlv_type = ntohs((__force __be16)tlv->type); + tlv_len = ntohs((__force __be16)tlv->len); if (tlv_type == TLV_ID_SELECTED_REGISTRAR) { PRINTM(MIOCTL, "Selected Registrar found !"); pos = (u8 *)tlv + sizeof(TLV_Generic_t); @@ -4150,12 +4150,14 @@ void woal_cfg80211_setup_vht_cap(moal_private *priv, } vht_cap->vht_supported = true; vht_cap->cap = cfg_11ac->param.vht_cfg.vht_cap_info; - vht_cap->vht_mcs.rx_mcs_map = (t_u16)cfg_11ac->param.vht_cfg.vht_rx_mcs; + vht_cap->vht_mcs.rx_mcs_map = + (__force __le16)cfg_11ac->param.vht_cfg.vht_rx_mcs; vht_cap->vht_mcs.rx_highest = - (t_u16)cfg_11ac->param.vht_cfg.vht_rx_max_rate; - vht_cap->vht_mcs.tx_mcs_map = (t_u16)cfg_11ac->param.vht_cfg.vht_tx_mcs; + (__force __le16)cfg_11ac->param.vht_cfg.vht_rx_max_rate; + vht_cap->vht_mcs.tx_mcs_map = + (__force __le16)cfg_11ac->param.vht_cfg.vht_tx_mcs; vht_cap->vht_mcs.tx_highest = - (t_u16)cfg_11ac->param.vht_cfg.vht_tx_max_rate; + (__force __le16)cfg_11ac->param.vht_cfg.vht_tx_max_rate; PRINTM(MCMND, "vht_cap=0x%x rx_mcs_map=0x%x rx_max=0x%x tx_mcs_map=0x%x tx_max=0x%x\n", vht_cap->cap, vht_cap->vht_mcs.rx_mcs_map, @@ -4655,9 +4657,11 @@ void woal_cfg80211_notify_antcfg(moal_private *priv, struct wiphy *wiphy, wiphy->bands[IEEE80211_BAND_5GHZ] ->ht_cap.mcs.rx_mask[1] = 0; wiphy->bands[IEEE80211_BAND_5GHZ] - ->vht_cap.vht_mcs.rx_mcs_map = 0xfffe; + ->vht_cap.vht_mcs.rx_mcs_map = + (__force __le16)0xfffe; wiphy->bands[IEEE80211_BAND_5GHZ] - ->vht_cap.vht_mcs.tx_mcs_map = 0xfffe; + ->vht_cap.vht_mcs.tx_mcs_map = + (__force __le16)0xfffe; } else if ((radio->param.ant_cfg.tx_antenna & 0xFF00) == 0x300 || (radio->param.ant_cfg.rx_antenna & 0xFF00) == @@ -4665,9 +4669,11 @@ void woal_cfg80211_notify_antcfg(moal_private *priv, struct wiphy *wiphy, wiphy->bands[IEEE80211_BAND_5GHZ] ->ht_cap.mcs.rx_mask[1] = 0xff; wiphy->bands[IEEE80211_BAND_5GHZ] - ->vht_cap.vht_mcs.rx_mcs_map = 0xfffa; + ->vht_cap.vht_mcs.rx_mcs_map = + (__force __le16)0xfffa; wiphy->bands[IEEE80211_BAND_5GHZ] - ->vht_cap.vht_mcs.tx_mcs_map = 0xfffa; + ->vht_cap.vht_mcs.tx_mcs_map = + (__force __le16)0xfffa; } } } diff --git a/mxm_wifiex/wlan_src/mlinux/moal_debug.c b/mxm_wifiex/wlan_src/mlinux/moal_debug.c index 3d31b65..5635105 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_debug.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_debug.c @@ -553,7 +553,6 @@ void woal_hist_data_add(moal_private *priv, t_u16 rx_rate, t_s8 snr, t_s8 nflr, #define MAX_MCS_NUM_SUPP 16 #define MAX_MCS_NUM_AC 10 #define MAX_MCS_NUM_AX 12 -#define RATE_INDEX_MCS0 12 /** * @brief histogram info in proc * @@ -1072,7 +1071,7 @@ static int woal_debug_read(struct seq_file *sfp, void *data) info->eventbd_rdptr, info->eventbd_wrptr); seq_printf(sfp, "last_wr_index:%d\n", info->txbd_wrptr & (info->txrx_bd_size - 1)); - seq_printf(sfp, "TxRx BD size:%d\n", info->txrx_bd_size); + seq_printf(sfp, "txrx bd size:%d\n", info->txrx_bd_size); } #endif seq_printf(sfp, "tcp_ack_drop_cnt=%d\n", priv->tcp_ack_drop_cnt); diff --git a/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c b/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c index b89f470..491df6c 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c @@ -2183,7 +2183,7 @@ static int woal_setget_priv_txratecfg(moal_private *priv, t_u8 *respbuf, data[3]); /* HE Preamble type */ -#define HE_SU_PREAMBLE 0 +//#define HE_SU_PREAMBLE 0 #define HE_ER_PREAMBLE 1 /* HE ER SU Type */ @@ -11596,7 +11596,6 @@ done: #define SNR_THRESHOLD_PARAM 4 #define SOUND_INTVL_PARAM 5 #define BF_MODE_PARAM 6 -#define MAX_TX_BF_GLOBAL_ARGS 6 #define BF_CFG_ACT_GET 0 #define BF_CFG_ACT_SET 1 diff --git a/mxm_wifiex/wlan_src/mlinux/moal_init.c b/mxm_wifiex/wlan_src/mlinux/moal_init.c index 81de4f5..9d9f034 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_init.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_init.c @@ -174,6 +174,7 @@ static int usb_aggr; #ifdef PCIE /* Enable/disable Message Signaled Interrupt (MSI) */ int pcie_int_mode = PCIE_INT_MODE_MSI; +static int ring_size; #endif /* PCIE */ static int low_power_mode_enable; @@ -272,6 +273,9 @@ static card_type_entry card_type_map_tbl[] = { #ifdef SD9098 {CARD_TYPE_SD9098, 0, CARD_SD9098}, #endif +#ifdef SD9177 + {CARD_TYPE_SD9177, 0, CARD_SD9177}, +#endif #ifdef PCIE8897 {CARD_TYPE_PCIE8897, 0, CARD_PCIE8897}, #endif @@ -874,6 +878,14 @@ static mlan_status parse_cfg_read_block(t_u8 *data, t_u32 size, params->pcie_int_mode = out_data; PRINTM(MMSG, "pcie_int_mode=%d\n", params->pcie_int_mode); + } else if (IS_PCIE(handle->card_type) && + strncmp(line, "ring_size", strlen("ring_size")) == + 0) { + if (parse_line_read_int(line, &out_data) != + MLAN_STATUS_SUCCESS) + goto err; + params->ring_size = out_data; + PRINTM(MMSG, "ring_size=%d\n", params->ring_size); } #endif else if (strncmp(line, "low_power_mode_enable", @@ -924,7 +936,8 @@ static mlan_status parse_cfg_read_block(t_u8 *data, t_u32 size, #if defined(SD8997) || defined(PCIE8997) || defined(USB8997) || \ defined(SD8977) || defined(SD8987) || defined(SD9098) || \ defined(USB9098) || defined(PCIE9098) || defined(SD9097) || \ - defined(USB9097) || defined(PCIE9097) || defined(SD8978) + defined(USB9097) || defined(PCIE9097) || defined(SD8978) || \ + defined(SD9177) else if (strncmp(line, "pmic", strlen("pmic")) == 0) { if (parse_line_read_int(line, &out_data) != MLAN_STATUS_SUCCESS) @@ -1363,6 +1376,9 @@ static void woal_setup_module_param(moal_handle *handle, moal_mod_para *params) handle->params.pcie_int_mode = pcie_int_mode; if (params) handle->params.pcie_int_mode = params->pcie_int_mode; + handle->params.ring_size = ring_size; + if (params) + handle->params.ring_size = params->ring_size; #endif /* PCIE */ if (low_power_mode_enable) moal_extflg_set(handle, EXT_LOW_PW_MODE); @@ -1380,7 +1396,8 @@ static void woal_setup_module_param(moal_handle *handle, moal_mod_para *params) #if defined(SD8997) || defined(PCIE8997) || defined(USB8997) || \ defined(SD8977) || defined(SD8987) || defined(SD9098) || \ defined(USB9098) || defined(PCIE9098) || defined(SD9097) || \ - defined(USB9097) || defined(PCIE9097) || defined(SD8978) + defined(USB9097) || defined(PCIE9097) || defined(SD8978) || \ + defined(SD9177) if (pmic) moal_extflg_set(handle, EXT_PMIC); #endif @@ -2232,6 +2249,9 @@ MODULE_PARM_DESC(usb_aggr, "0: MLAN default; 1: Enable USB aggr; 2: Disable USB aggr"); #endif #ifdef PCIE +module_param(ring_size, int, 0); +MODULE_PARM_DESC(ring_size, + "adma dma ring size: 32/64/128/256/512, default 128"); module_param(pcie_int_mode, int, 0); MODULE_PARM_DESC(pcie_int_mode, "0: Legacy mode; 1: MSI mode; 2: MSI-X mode"); #endif /* PCIE */ diff --git a/mxm_wifiex/wlan_src/mlinux/moal_main.c b/mxm_wifiex/wlan_src/mlinux/moal_main.c index c1ced93..bb65246 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_main.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_main.c @@ -82,6 +82,41 @@ moal_handle *m_handle[MAX_MLAN_ADAPTER]; Local Variables ********************************************************/ +#ifdef SD8801 +static struct _card_info card_info_SD8801 = { + .embedded_supp = 0, + .drcs = 0, + .go_noa = 0, + .v14_fw_api = 1, + .v16_fw_api = 0, + .v17_fw_api = 0, + .pmic = 0, + .cal_data_cfg = 0, + .low_power_enable = 1, + .rx_rate_max = 76, + .histogram_table_num = 1, + .feature_control = FEATURE_CTRL_DEFAULT & (~FEATURE_CTRL_STREAM_2X2), + .fw_name = SD8801_DEFAULT_WLAN_FW_NAME, + .fw_name_wlan = SD8801_DEFAULT_WLAN_FW_NAME, +#ifdef SDIO + .dump_fw_info = 0, + .dump_fw_ctrl_reg = 0x63, + .dump_fw_start_reg = 0x64, + .dump_fw_end_reg = 0x6A, + .dump_fw_host_ready = 0xee, + .dump_reg.reg_table = {0x28, 0x30, 0x34, 0x38, 0x3c}, + .dump_reg.reg_table_size = 5, + .scratch_reg = 0x60, + .func1_reg_start = 0x10, + .func1_reg_end = 0x17, + .fw_reset_reg = 0x64, + .fw_reset_val = 0, + .slew_rate_reg = 0x8000231C, + .slew_rate_bit_offset = 14, +#endif + .per_pkt_cfg_support = 0, +}; +#endif #ifdef SD8887 static struct _card_info card_info_SD8887 = { .embedded_supp = 1, @@ -382,6 +417,45 @@ static struct _card_info card_info_SD9097 = { }; #endif +#ifdef SD9177 +static struct _card_info card_info_SD9177 = { + .embedded_supp = 1, + .drcs = 1, + .go_noa = 1, + .v16_fw_api = 1, + .v17_fw_api = 1, + .pmic = 1, + .cal_data_cfg = 0, + .low_power_enable = 0, + .rx_rate_max = 412, + .histogram_table_num = 3, + .feature_control = FEATURE_CTRL_DEFAULT, + .rev_id_reg = 0xc8, + .host_strap_reg = 0xf4, + .magic_reg = 0xf0, + .fw_name = SD9177_DEFAULT_COMBO_FW_NAME, + .fw_name_wlan = SD9177_DEFAULT_WLAN_FW_NAME, +#ifdef SDIO + .dump_fw_info = DUMP_FW_SDIO_V3, + .dump_fw_ctrl_reg = 0xf9, + .dump_fw_start_reg = 0xf1, + .dump_fw_end_reg = 0xf8, + .dump_fw_host_ready = 0xcc, + .dump_reg.reg_table = {0x08, 0x58, 0x5C, 0x5D, 0x60, 0x61, 0x62, 0x64, + 0x65, 0x66, 0x68, 0x69, 0x6a}, + .dump_reg.reg_table_size = 13, + .scratch_reg = 0xe8, + .func1_reg_start = 0x10, + .func1_reg_end = 0x17, + .fw_reset_reg = 0x0EE, + .fw_reset_val = 0x99, + .slew_rate_reg = 0x90002328, + .slew_rate_bit_offset = 12, +#endif + .per_pkt_cfg_support = 1, +}; +#endif + #ifdef PCIE8997 static struct _card_info card_info_PCIE8997 = { .embedded_supp = 1, @@ -447,6 +521,26 @@ static struct _card_info card_info_PCIE9098 = { }; #endif +#ifdef USB8801 +static struct _card_info card_info_USB8801 = { + .embedded_supp = 0, + .drcs = 0, + .go_noa = 0, + .v14_fw_api = 1, + .v16_fw_api = 0, + .v17_fw_api = 0, + .pmic = 0, + .cal_data_cfg = 0, + .low_power_enable = 1, + .rx_rate_max = 76, + .feature_control = FEATURE_CTRL_DEFAULT & (~FEATURE_CTRL_STREAM_2X2), + .histogram_table_num = 1, + .fw_name = USB8801_DEFAULT_WLAN_FW_NAME, + .fw_name_wlan = USB8801_DEFAULT_WLAN_FW_NAME, + .per_pkt_cfg_support = 0, +}; +#endif + #ifdef USB8978 static struct _card_info card_info_USB8978 = { .embedded_supp = 1, @@ -687,6 +781,13 @@ static void woal_hang_work_queue(struct work_struct *work) LEAVE(); return; } + flush_workqueue(reset_handle->workqueue); + flush_workqueue(reset_handle->evt_workqueue); + if (reset_handle->rx_workqueue) { + flush_workqueue(reset_handle->rx_workqueue); + } + mlan_ioctl(reset_handle->pmlan_adapter, NULL); + for (i = 0; i < reset_handle->priv_num; i++) { if (reset_handle->priv[i] && reset_handle->priv[i]->netdev) { PRINTM(MMSG, "Close netdev %s\n", @@ -714,12 +815,6 @@ void woal_process_hang(moal_handle *handle) if (reset_handle == NULL) { PRINTM(MMSG, "Start to process hanging\n"); reset_handle = handle; - flush_workqueue(handle->workqueue); - flush_workqueue(handle->evt_workqueue); - if (handle->rx_workqueue) { - flush_workqueue(handle->rx_workqueue); - } - mlan_ioctl(handle->pmlan_adapter, NULL); queue_work(hang_workqueue, &hang_work); #define WAKE_LOCK_HANG 5000 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0) @@ -1425,6 +1520,10 @@ mlan_status woal_init_sw(moal_handle *handle) device.cfg_11d = (t_u32)handle->params.cfg_11d; #endif device.indrstcfg = (t_u32)handle->params.indrstcfg; +#ifdef PCIE + if (IS_PCIE(handle->card_type)) + device.ring_size = handle->params.ring_size; +#endif #ifdef SDIO if (IS_SD(handle->card_type)) { device.sdio_rx_aggr_enable = @@ -2005,8 +2104,8 @@ static t_u32 woal_process_init_cfg(moal_handle *handle, t_u8 *data, t_size size) goto done; } /* Copy value */ - strncpy(value, intf_s, - MIN((MAX_PARAM_LEN - 1), strlen(intf_s))); + memcpy(value, intf_s, + MIN((MAX_PARAM_LEN - 1), strlen(intf_s))); if (MLAN_STATUS_SUCCESS != woal_process_regrdwr(handle, type, offset, value)) { @@ -2634,6 +2733,7 @@ done: return status; } +#ifdef CONFIG_RPS static ssize_t woal_set_rps_map(struct netdev_rx_queue *queue, const char *buf, size_t len) { @@ -2710,6 +2810,7 @@ static ssize_t woal_set_rps_map(struct netdev_rx_queue *queue, const char *buf, free_cpumask_var(mask); return len; } +#endif /** * @brief Add interfaces DPC @@ -2820,6 +2921,7 @@ static mlan_status woal_add_card_dpc(moal_handle *handle) woal_set_uap_operation_ctrl(handle); #endif +#ifdef CONFIG_RPS if (moal_extflg_isset(handle, EXT_RPS)) { moal_private *priv_rps = woal_get_priv_bss_type(handle, MLAN_BSS_TYPE_STA); @@ -2838,6 +2940,7 @@ static mlan_status woal_add_card_dpc(moal_handle *handle) } } } +#endif #ifdef MFG_CMD_SUPPORT done: @@ -3221,9 +3324,15 @@ static mlan_status woal_init_fw_dpc(moal_handle *handle) handle->hardware_status = HardwareStatusReady; goto done; } - /* Wait for mlan_init to complete */ - wait_event_timeout(handle->init_wait_q, handle->init_wait_q_woken, - 5 * HZ); +#ifdef SD9177 + if (IS_SD9177(handle->card_type)) + wait_event_timeout(handle->init_wait_q, + handle->init_wait_q_woken, 10 * HZ); + else +#endif + /* Wait for mlan_init to complete */ + wait_event_timeout(handle->init_wait_q, + handle->init_wait_q_woken, 5 * HZ); if (handle->hardware_status != HardwareStatusReady) { woal_moal_debug_info(woal_get_priv(handle, MLAN_BSS_ROLE_ANY), handle, MTRUE); @@ -5511,8 +5620,10 @@ static int woal_process_tcp_ack(moal_private *priv, mlan_buffer *pmbuf) } priv->tcp_ack_cnt++; spin_lock_irqsave(&priv->tcp_sess_lock, flags); - tcp_session = woal_get_tcp_sess(priv, iph->saddr, tcph->source, - iph->daddr, tcph->dest); + tcp_session = woal_get_tcp_sess(priv, (__force t_u32)iph->saddr, + (__force t_u16)tcph->source, + (__force t_u32)iph->daddr, + (__force t_u16)tcph->dest); if (!tcp_session) { tcp_session = kmalloc(sizeof(struct tcp_sess), GFP_ATOMIC); @@ -5525,10 +5636,10 @@ static int woal_process_tcp_ack(moal_private *priv, mlan_buffer *pmbuf) tcp_session->ack_skb = pmbuf->pdesc; tcp_session->pmbuf = pmbuf; pmbuf->flags |= MLAN_BUF_FLAG_TCP_ACK; - tcp_session->src_ip_addr = iph->saddr; - tcp_session->dst_ip_addr = iph->daddr; - tcp_session->src_tcp_port = tcph->source; - tcp_session->dst_tcp_port = tcph->dest; + tcp_session->src_ip_addr = (__force t_u32)iph->saddr; + tcp_session->dst_ip_addr = (__force t_u32)iph->daddr; + tcp_session->src_tcp_port = (__force t_u32)tcph->source; + tcp_session->dst_tcp_port = (__force t_u32)tcph->dest; tcp_session->ack_seq = ntohl(tcph->ack_seq); tcp_session->priv = (void *)priv; skb = (struct sk_buff *)pmbuf->pdesc; @@ -5618,15 +5729,13 @@ static int woal_start_xmit(moal_private *priv, struct sk_buff *skb) priv->stats.tx_dropped++; goto done; } + // kernel crash with cloned skb without copy + // uap0 <-->muap0 bridge if ((skb->cloned && -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 13, 0) - (atomic_read(&skb->users.refs) > 1)) -#else - (atomic_read(&skb->users) > 1)) -#endif - || (skb_headroom(skb) < - (MLAN_MIN_DATA_HEADER_LEN + sizeof(mlan_buffer) + - priv->extra_tx_head_len))) { + (!is_unicast_ether_addr(((struct ethhdr *)skb->data)->h_dest))) || + (skb_headroom(skb) < + (MLAN_MIN_DATA_HEADER_LEN + sizeof(mlan_buffer) + + priv->extra_tx_head_len))) { PRINTM(MWARN, "Tx: skb cloned %d or Insufficient skb headroom %d\n", skb->cloned, skb_headroom(skb)); @@ -6374,6 +6483,11 @@ static int woal_get_card_info(moal_handle *phandle) ENTER(); switch (phandle->card_type) { +#ifdef SD8801 + case CARD_TYPE_SD8801: + phandle->card_info = &card_info_SD8801; + break; +#endif #ifdef SD8887 case CARD_TYPE_SD8887: phandle->card_info = &card_info_SD8887; @@ -6419,6 +6533,11 @@ static int woal_get_card_info(moal_handle *phandle) phandle->card_info = &card_info_SD9097; break; #endif +#ifdef SD9177 + case CARD_TYPE_SD9177: + phandle->card_info = &card_info_SD9177; + break; +#endif #ifdef PCIE8997 case CARD_TYPE_PCIE8997: phandle->card_info = &card_info_PCIE8997; @@ -6435,6 +6554,11 @@ static int woal_get_card_info(moal_handle *phandle) phandle->event_fw_dump = MTRUE; break; #endif +#ifdef USB8801 + case CARD_TYPE_USB8801: + phandle->card_info = &card_info_USB8801; + break; +#endif #ifdef USB8997 case CARD_TYPE_USB8997: phandle->card_info = &card_info_USB8997; @@ -7162,8 +7286,8 @@ t_void woal_send_disconnect_to_system(moal_private *priv, memset(event_buf, 0, sizeof(event_buf)); custom_len = strlen(CUS_EVT_AP_CONNECTED); - strncpy(event_buf, CUS_EVT_AP_CONNECTED, - MIN((int)(sizeof(event_buf) - 1), custom_len)); + memcpy(event_buf, CUS_EVT_AP_CONNECTED, + MIN((int)(sizeof(event_buf) - 1), custom_len)); woal_broadcast_event(priv, event_buf, custom_len + ETH_ALEN); LEAVE(); } @@ -8296,13 +8420,13 @@ mlan_status woal_request_country_power_table(moal_private *priv, char *country) #if defined(STA_CFG80211) || defined(UAP_CFG80211) #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) if (handle->params.cntry_txpwr == CNTRY_RGPOWER_MODE) - strncpy(country_name, "rgpower_XX.bin", - strlen("rgpower_XX.bin")); + memcpy(country_name, "rgpower_XX.bin", + strlen("rgpower_XX.bin")); #endif #endif /* Replace XX with ISO 3166-1 alpha-2 country code */ - strncpy(strstr(country_name, "XX"), country, strlen(country)); + memcpy(strstr(country_name, "XX"), country, strlen(country)); fw_name = handle->params.fw_name; memset(file_path, 0, sizeof(file_path)); /* file_path should be Null terminated */ @@ -8316,8 +8440,8 @@ mlan_status woal_request_country_power_table(moal_private *priv, char *country) else memset(file_path, 0, sizeof(file_path)); } else { - strncpy(file_path, "nxp/", - MIN((sizeof(file_path) - 1), strlen("nxp/"))); + memcpy(file_path, "nxp/", + MIN((sizeof(file_path) - 1), strlen("nxp/"))); } if ((strlen(file_path) + strlen(country_name)) < @@ -8339,8 +8463,8 @@ mlan_status woal_request_country_power_table(moal_private *priv, char *country) /* Try download WW rgpowertable */ if ((handle->params.cntry_txpwr == CNTRY_RGPOWER_MODE) && (ret == MLAN_STATUS_FILE_ERR)) { - strncpy(country_name, "rgpower_WW.bin", - strlen("rgpower_WW.bin")); + memcpy(country_name, "rgpower_WW.bin", + strlen("rgpower_WW.bin")); last_slash = strrchr(file_path, '/'); if (last_slash) memset(last_slash + 1, 0, @@ -8617,8 +8741,6 @@ t_void woal_main_work_queue(struct work_struct *work) woal_usb_submit_rx_data_urbs(handle); } #endif - if (atomic_read(&handle->tx_pending) == 1) - usleep_range(30, 30); handle->main_state = MOAL_START_MAIN_PROCESS; /* Call MLAN main process */ mlan_main_process(handle->pmlan_adapter); @@ -8627,6 +8749,143 @@ t_void woal_main_work_queue(struct work_struct *work) LEAVE(); } +#ifdef IMX_SUPPORT +/** + * @brief This function allocates the interrupt line to wakeup + * the host, and initializes the device for wakeup + * + * @param handle A pointer to moal_handle structure + * + * @return N/A + */ +void woal_regist_oob_wakeup_irq(moal_handle *handle) +{ + int ret; + struct device *dev = handle->hotplug_device; + struct device_node *node; + + ENTER(); + + node = of_find_compatible_node(NULL, NULL, "nxp,host-wake"); + if (!node) + goto err_exit; + + handle->irq_oob_wakeup = irq_of_parse_and_map(node, 0); + if (!handle->irq_oob_wakeup) { + dev_dbg(dev, "fail to parse irq_oob_wakeup from device tree\n"); + goto err_exit; + } + + ret = devm_request_irq(dev, handle->irq_oob_wakeup, + woal_oob_wakeup_irq_handler, IRQF_TRIGGER_LOW, + "wifi_oob_wakeup", handle); + if (ret) { + dev_err(dev, "Failed to request irq_oob_wakeup %d (%d)\n", + handle->irq_oob_wakeup, ret); + goto err_exit; + } + + disable_irq(handle->irq_oob_wakeup); + if (device_init_wakeup(dev, true)) { + dev_err(dev, "fail to init irq_oob_wakeup\n"); + goto err_exit; + } + + LEAVE(); + return; + +err_exit: + handle->irq_oob_wakeup = -1; +} + +/** + * @brief This function frees the wakeup interrupt line + * + * @param handle A pointer to moal_handle structure + * + * @return N/A + */ +void woal_unregist_oob_wakeup_irq(moal_handle *handle) +{ + struct device *dev = handle->hotplug_device; + + ENTER(); + devm_free_irq(dev, handle->irq_oob_wakeup, handle); + LEAVE(); +} + +/** + * @brief This function disables power management wakeup + * + * @param handle A pointer to moal_handle structure + * + * @return N/A + */ +void woal_disable_oob_wakeup_irq(moal_handle *handle) +{ + ENTER(); + + if (handle->irq_oob_wakeup >= 0) { + if (handle->wake_by_wifi) + return; + else { + disable_irq_wake(handle->irq_oob_wakeup); + disable_irq(handle->irq_oob_wakeup); + } + } + + LEAVE(); +} + +/** + * @brief This function enables power management wakeup + * + * @param handle A pointer to moal_handle structure + * + * @return N/A + */ +void woal_enable_oob_wakeup_irq(moal_handle *handle) +{ + ENTER(); + + /* Enable platform specific wakeup interrupt */ + if (handle->irq_oob_wakeup >= 0) { + handle->wake_by_wifi = false; + enable_irq(handle->irq_oob_wakeup); + enable_irq_wake(handle->irq_oob_wakeup); + } + + LEAVE(); +} + +/** + * @brief This function will be called when the wakeup IRQ occurs + * + * @param irq Wakeup interrupt line + * @param priv A void pointer to store moal_handle structure pointer + * + * @return Returns status of interrupt handler. + */ +irqreturn_t woal_oob_wakeup_irq_handler(int irq, void *priv) +{ + moal_handle *handle = priv; + struct device *dev = handle->hotplug_device; + + ENTER(); + + dev_dbg(dev, "%s: OOB wakeup by wifi", __func__); + handle->wake_by_wifi = true; + disable_irq_nosync(irq); + + /* Notify PM core we are wakeup source */ + pm_wakeup_event(dev, 0); + pm_system_wakeup(); + + LEAVE(); + return IRQ_HANDLED; +} +#endif /* IMX_SUPPORT */ + /** * @brief This function adds the card. it will probe the * card, allocate the mlan_private and initialize the device. @@ -9286,7 +9545,7 @@ static int woal_reset_and_reload_fw(moal_handle *handle) ret = -EFAULT; goto done; } -#if defined(SD9098) || defined(SD9097) +#if defined(SD9098) || defined(SD9097) || defined(SD9177) if (IS_SD9098(handle->card_type) || IS_SD9097(handle->card_type) || IS_SD9177(handle->card_type)) handle->ops.write_reg(handle, 0x00, 0x10); diff --git a/mxm_wifiex/wlan_src/mlinux/moal_main.h b/mxm_wifiex/wlan_src/mlinux/moal_main.h index 201084f..aaf918c 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_main.h +++ b/mxm_wifiex/wlan_src/mlinux/moal_main.h @@ -128,6 +128,11 @@ Change log: #include "moal_priv.h" #endif +#ifdef IMX_SUPPORT +#include +#include +#endif /* IMX_SUPPORT */ + #ifndef MIN /** Find minimum */ #define MIN(a, b) ((a) < (b) ? (a) : (b)) @@ -1559,6 +1564,8 @@ typedef struct _card_info { t_bool drcs; /** support Go NOA*/ t_bool go_noa; + /** support V14_FW_API*/ + t_bool v14_fw_api; /** support V16_FW_API*/ t_bool v16_fw_api; /** support V17_FW_API*/ @@ -1733,13 +1740,15 @@ typedef struct _moal_mod_para { #endif #ifdef PCIE int pcie_int_mode; + int ring_size; #endif /* PCIE */ int wakelock_timeout; unsigned int dev_cap_mask; #if defined(SD8997) || defined(PCIE8997) || defined(USB8997) || \ defined(SD8977) || defined(SD8987) || defined(SD9098) || \ defined(USB9098) || defined(PCIE9098) || defined(SD9097) || \ - defined(USB9097) || defined(PCIE9097) || defined(SD8978) + defined(USB9097) || defined(PCIE9097) || defined(SD8978) || \ + defined(SD9177) int pmic; #endif int antcfg; @@ -1901,6 +1910,12 @@ struct _moal_handle { wait_queue_head_t hs_activate_wait_q __ATTRIB_ALIGN__; /** auto_arp and ipv6 offload enable/disable flag */ t_u8 hs_auto_arp; +#ifdef IMX_SUPPORT + /** wakeup irq number */ + int irq_oob_wakeup; + /** wakeup notify flag */ + bool wake_by_wifi; +#endif /* IMX_SUPPORT */ /** Card pointer */ t_void *card; /** Rx pending in MLAN */ @@ -3288,4 +3303,12 @@ mlan_status woal_vdll_req_fw(moal_handle *handle); void woal_ioctl_get_misc_conf(moal_private *priv, mlan_ds_misc_cfg *info); t_u8 woal_get_second_channel_offset(int chan); + +#ifdef IMX_SUPPORT +void woal_regist_oob_wakeup_irq(moal_handle *handle); +void woal_unregist_oob_wakeup_irq(moal_handle *handle); +void woal_disable_oob_wakeup_irq(moal_handle *handle); +void woal_enable_oob_wakeup_irq(moal_handle *handle); +irqreturn_t woal_oob_wakeup_irq_handler(int irq, void *priv); +#endif /* IMX_SUPPORT */ #endif /* _MOAL_MAIN_H */ diff --git a/mxm_wifiex/wlan_src/mlinux/moal_pcie.c b/mxm_wifiex/wlan_src/mlinux/moal_pcie.c index 12bdca8..8cb7bea 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_pcie.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_pcie.c @@ -259,14 +259,14 @@ static t_u16 woal_update_card_type(t_void *card) * * @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE */ -mlan_status woal_do_flr(moal_handle *handle, bool prepare, bool flr_flag) +static mlan_status woal_do_flr(moal_handle *handle, bool prepare, bool flr_flag) { unsigned int i; int index = 0; mlan_status status = MLAN_STATUS_SUCCESS; moal_private *priv = NULL; pcie_service_card *card = NULL; - int fw_serial_bkp; + int fw_serial_bkp = 0; ENTER(); @@ -485,6 +485,10 @@ static int woal_pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id) goto err; } +#ifdef IMX_SUPPORT + woal_regist_oob_wakeup_irq(card->handle); +#endif /* IMX_SUPPORT */ + LEAVE(); return ret; err: @@ -523,6 +527,10 @@ static void woal_pcie_remove(struct pci_dev *dev) return; } handle->surprise_removed = MTRUE; + +#ifdef IMX_SUPPORT + woal_unregist_oob_wakeup_irq(card->handle); +#endif /* IMX_SUPPORT */ woal_remove_card(card); woal_pcie_cleanup(card); kfree(card); @@ -637,6 +645,9 @@ static int woal_pcie_suspend(struct pci_dev *pdev, pm_message_t state) pci_enable_wake(pdev, pci_choose_state(pdev, state), 1); pci_save_state(pdev); pci_set_power_state(pdev, pci_choose_state(pdev, state)); +#ifdef IMX_SUPPORT + woal_enable_oob_wakeup_irq(handle); +#endif /* IMX_SUPPORT */ done: PRINTM(MCMND, "<--- Leave woal_pcie_suspend --->\n"); LEAVE(); @@ -683,6 +694,7 @@ static int woal_pcie_resume(struct pci_dev *pdev) keep_power = MTRUE; else keep_power = MFALSE; + pci_set_power_state(pdev, PCI_D0); pci_restore_state(pdev); pci_enable_wake(pdev, PCI_D0, 0); @@ -700,6 +712,9 @@ static int woal_pcie_resume(struct pci_dev *pdev) woal_cancel_hs(woal_get_priv(handle, MLAN_BSS_ROLE_ANY), MOAL_NO_WAIT); +#ifdef IMX_SUPPORT + woal_disable_oob_wakeup_irq(handle); +#endif /* IMX_SUPPORT */ } done: PRINTM(MCMND, "<--- Leave woal_pcie_resume --->\n"); @@ -1098,9 +1113,12 @@ exit: static mlan_status woal_pcie_preinit(struct pci_dev *pdev) { int ret; + if (pdev->multifunction) device_disable_async_suspend(&pdev->dev); + ret = pci_enable_device(pdev); + if (ret) goto err_enable_dev; @@ -1303,7 +1321,6 @@ static mlan_status woal_pcie_register_dev(moal_handle *handle) "mrvl_pcie", pdev); if (ret) { PRINTM(MFATAL, "request_irq failed: ret=%d\n", ret); - handle->card = NULL; ret = MLAN_STATUS_FAILURE; goto done; } @@ -1312,7 +1329,6 @@ static mlan_status woal_pcie_register_dev(moal_handle *handle) default: PRINTM(MFATAL, "pcie_int_mode %d failed\n", pcie_int_mode); - handle->card = NULL; ret = MLAN_STATUS_FAILURE; goto done; break; @@ -1762,7 +1778,6 @@ typedef enum { } dumped_mem_type; #define MAX_NAME_LEN 8 -#define MAX_FULL_NAME_LEN 32 typedef struct { t_u8 mem_name[MAX_NAME_LEN]; @@ -1790,7 +1805,6 @@ static memory_type_mapping mem_type_mapping_tbl_8897[] = { #if defined(PCIE8997) || defined(PCIE9098) || defined(PCIE9097) #define DEBUG_HOST_READY_8997 0xCC #define DEBUG_HOST_EVENT_READY 0xAA -#define DEBUG_MEMDUMP_FINISH_8997 0xDD static memory_type_mapping mem_type_mapping_tbl_8997 = {"DUMP", NULL, NULL, 0xDD, 0x00}; diff --git a/mxm_wifiex/wlan_src/mlinux/moal_priv.c b/mxm_wifiex/wlan_src/mlinux/moal_priv.c index c1ec0e6..7005caf 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_priv.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_priv.c @@ -4061,7 +4061,6 @@ done: #define SNR_THRESHOLD_PARAM 4 #define SOUND_INTVL_PARAM 5 #define BF_MODE_PARAM 6 -#define MAX_TX_BF_GLOBAL_ARGS 6 #define BF_CFG_ACT_GET 0 #define BF_CFG_ACT_SET 1 diff --git a/mxm_wifiex/wlan_src/mlinux/moal_proc.c b/mxm_wifiex/wlan_src/mlinux/moal_proc.c index 867159e..a8b4c50 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_proc.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_proc.c @@ -1064,8 +1064,8 @@ void woal_create_proc_entry(moal_private *priv) #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26) if (!priv->proc_entry) { memset(proc_dir_name, 0, sizeof(proc_dir_name)); - strncpy(proc_dir_name, priv->phandle->proc_wlan_name, - sizeof(proc_dir_name) - 2); + memcpy(proc_dir_name, priv->phandle->proc_wlan_name, + sizeof(proc_dir_name) - 2); proc_dir_name[strlen(proc_dir_name)] = '/'; if (strlen(dev->name) > diff --git a/mxm_wifiex/wlan_src/mlinux/moal_sdio.h b/mxm_wifiex/wlan_src/mlinux/moal_sdio.h index 957f511..a8e4882 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_sdio.h +++ b/mxm_wifiex/wlan_src/mlinux/moal_sdio.h @@ -73,6 +73,10 @@ Change log: #define SD8887_WLAN_A0_FW_NAME "nxp/sd8887_wlan.bin" #endif /* SD8887_MULTI_FW */ +#ifdef SD8801 +#define SD8801_DEFAULT_WLAN_FW_NAME "nxp/sd8801_uapsta.bin" +#endif /* SD8801 */ + /** Default firmware name */ #ifdef SD8887 #define SD8887_DEFAULT_COMBO_FW_NAME "nxp/sd8887_uapsta_a2.bin" @@ -135,6 +139,15 @@ Change log: #define SD9097_WLAN_V1_FW_NAME "nxp/sd9097_wlan_v1.bin" #endif /* SD9097 */ +#ifdef SD9177 +#define SD9177_A0 0x01 +#define SD9177_DEFAULT_COMBO_FW_NAME "nxp/sdsd9177_combo.bin" +#define SDUART9177_DEFAULT_COMBO_FW_NAME "nxp/sduart9177_combo.bin" +#define SDSD9177_DEFAULT_COMBO_FW_NAME "nxp/sdsd9177_combo.bin" +#define SD9177_DEFAULT_WLAN_FW_NAME "nxp/sd9177_wlan.bin" +/** Device ID for SD9177 */ +#define SD_DEVICE_ID_9177 (0x0205) +#endif /* SD9177 */ /******************************************************** Global Functions ********************************************************/ diff --git a/mxm_wifiex/wlan_src/mlinux/moal_sdio_mmc.c b/mxm_wifiex/wlan_src/mlinux/moal_sdio_mmc.c index fab3955..c83b261 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_sdio_mmc.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_sdio_mmc.c @@ -31,7 +31,9 @@ Change log: #include "moal_sdio.h" /** define nxp vendor id */ +#ifdef SD9177 #define NXP_VENDOR_ID 0x0471 +#endif #define MRVL_VENDOR_ID 0x02df /******************************************************** @@ -47,6 +49,10 @@ static moal_if_ops sdiommc_ops; /** Device ID for SD8887 */ #define SD_DEVICE_ID_8887 (0x9135) #endif +#ifdef SD8801 +/** Device ID for SD8801 FN1 */ +#define SD_DEVICE_ID_8801 (0x9139) +#endif #ifdef SD8897 /** Device ID for SD8897 */ #define SD_DEVICE_ID_8897 (0x912d) @@ -77,16 +83,15 @@ static moal_if_ops sdiommc_ops; /** Device ID for SD9097 */ #define SD_DEVICE_ID_9097 (0x9155) #endif -/** Device ID any */ -#ifndef SD_DEVICE_ANY -#define SD_DEVICE_ANY (0xffff) -#endif /* SD_DEVICE_ANY */ /** WLAN IDs */ static const struct sdio_device_id wlan_ids[] = { #ifdef SD8887 {SDIO_DEVICE(MRVL_VENDOR_ID, SD_DEVICE_ID_8887)}, #endif +#ifdef SD8801 + {SDIO_DEVICE(MRVL_VENDOR_ID, SD_DEVICE_ID_8801)}, +#endif #ifdef SD8897 {SDIO_DEVICE(MRVL_VENDOR_ID, SD_DEVICE_ID_8897)}, #endif @@ -108,6 +113,9 @@ static const struct sdio_device_id wlan_ids[] = { #endif #ifdef SD9097 {SDIO_DEVICE(MRVL_VENDOR_ID, SD_DEVICE_ID_9097)}, +#endif +#ifdef SD9177 + {SDIO_DEVICE(NXP_VENDOR_ID, SD_DEVICE_ID_9177)}, #endif {}, }; @@ -288,6 +296,20 @@ static t_u16 woal_update_card_type(t_void *card) (strlen(INTF_CARDTYPE) + strlen(KERN_VERSION))); } #endif +#ifdef SD8801 + if (cardp_sd->func->device == SD_DEVICE_ID_8801) { + card_type = CARD_TYPE_SD8801; + moal_memcpy_ext(NULL, driver_version, CARD_SD8801, + strlen(CARD_SD8801), strlen(driver_version)); + moal_memcpy_ext( + NULL, + driver_version + strlen(INTF_CARDTYPE) + + strlen(KERN_VERSION), + V14, strlen(V14), + strlen(driver_version) - + (strlen(INTF_CARDTYPE) + strlen(KERN_VERSION))); + } +#endif #ifdef SD8897 if (cardp_sd->func->device == SD_DEVICE_ID_8897) { @@ -387,6 +409,20 @@ static t_u16 woal_update_card_type(t_void *card) strlen(driver_version) - (strlen(INTF_CARDTYPE) + strlen(KERN_VERSION))); } +#endif +#ifdef SD9177 + if (cardp_sd->func->device == SD_DEVICE_ID_9177) { + card_type = CARD_TYPE_SD9177; + moal_memcpy_ext(NULL, driver_version, CARD_SD9177, + strlen(CARD_SD9177), strlen(driver_version)); + moal_memcpy_ext( + NULL, + driver_version + strlen(INTF_CARDTYPE) + + strlen(KERN_VERSION), + V17, strlen(V17), + strlen(driver_version) - + (strlen(INTF_CARDTYPE) + strlen(KERN_VERSION))); + } #endif return card_type; } @@ -513,10 +549,6 @@ void woal_wlan_is_suspended(moal_handle *handle) } #endif -#define SHUTDOWN_HOST_SLEEP_DEF_GAP 100 -#define SHUTDOWN_HOST_SLEEP_DEF_GPIO 0x3 -#define SHUTDOWN_HOST_SLEEP_DEF_COND 0x0 - /** @brief This function handles client driver shutdown * * @param dev A pointer to device structure @@ -1276,7 +1308,7 @@ static mlan_status woal_sdiommc_get_fw_name(moal_handle *handle) t_u32 rev_id_reg = handle->card_info->rev_id_reg; #if defined(SD8987) || defined(SD8997) || defined(SD9098) || \ - defined(SD9097) || defined(SD8978) + defined(SD9097) || defined(SD8978) || defined(SD9177) t_u32 magic_reg = handle->card_info->magic_reg; t_u32 magic = 0; t_u32 host_strap_reg = handle->card_info->host_strap_reg; @@ -1287,12 +1319,16 @@ static mlan_status woal_sdiommc_get_fw_name(moal_handle *handle) if (handle->params.fw_name) goto done; +#ifdef SD8801 + if (IS_SD8801(handle->card_type)) + goto done; +#endif /** Revision ID register */ woal_sdiommc_read_reg(handle, rev_id_reg, &revision_id); PRINTM(MCMND, "revision_id=0x%x\n", revision_id); #if defined(SD8987) || defined(SD8997) || defined(SD9098) || \ - defined(SD9097) || defined(SD8978) + defined(SD9097) || defined(SD8978) || defined(SD9177) /** Revision ID register */ woal_sdiommc_read_reg(handle, magic_reg, &magic); /** Revision ID register */ @@ -1440,6 +1476,26 @@ static mlan_status woal_sdiommc_get_fw_name(moal_handle *handle) } } #endif +#ifdef SD9177 + if (IS_SD9177(handle->card_type)) { + switch (revision_id) { + case SD9177_A0: + if (magic == CHIP_MAGIC_VALUE) { + if (strap == CARD_TYPE_SD_UART) + strcpy(handle->card_info->fw_name, + SDUART9177_DEFAULT_COMBO_FW_NAME); + else + strcpy(handle->card_info->fw_name, + SDSD9177_DEFAULT_COMBO_FW_NAME); + } + strcpy(handle->card_info->fw_name_wlan, + SD9177_DEFAULT_WLAN_FW_NAME); + break; + default: + break; + } + } +#endif done: PRINTM(MCMND, "combo fw:%s wlan fw:%s \n", handle->card_info->fw_name, handle->card_info->fw_name_wlan); @@ -1470,7 +1526,6 @@ typedef enum { } dumped_mem_type; #define MAX_NAME_LEN 8 -#define MAX_FULL_NAME_LEN 32 typedef struct { t_u8 mem_name[MAX_NAME_LEN]; @@ -1549,6 +1604,234 @@ static rdwr_status woal_cmd52_rdwr_firmware(moal_handle *phandle, t_u8 doneflag) return RDWR_STATUS_SUCCESS; } +#ifdef SD8801 +#define DEBUG_HOST_READY 0xEE +#define DEBUG_FW_DONE 0xFF +#define DEBUG_MEMDUMP_FINISH 0xFE +#define MAX_POLL_TRIES 100 +#define DEBUG_ITCM_DONE 0xaa +#define DEBUG_DTCM_DONE 0xbb +#define DEBUG_SQRAM_DONE 0xcc + +#define DEBUG_DUMP_CTRL_REG 0x63 +#define DEBUG_DUMP_FIRST_REG 0x62 +#define DEBUG_DUMP_START_REG 0x64 +#define DEBUG_DUMP_END_REG 0x6a +#define ITCM_SIZE 0x60000 +#define SQRAM_SIZE 0x33500 +#define DTCM_SIZE 0x14000 + +/** + * @brief This function dump firmware memory to file + * + * @param phandle A pointer to moal_handle + * + * @return N/A + */ +void woal_dump_firmware_info(moal_handle *phandle) +{ + int ret = 0; + unsigned int reg, reg_start, reg_end; + t_u8 path_name[64], file_name[32]; + t_u8 *ITCM_Ptr = NULL; + t_u8 *DTCM_Ptr = NULL; + t_u8 *SQRAM_Ptr = NULL; + t_u8 *dbg_ptr = NULL; + t_u32 sec, usec; + t_u8 ctrl_data = 0; + t_u32 dtcm_size = DTCM_SIZE; + t_u32 sqram_size = SQRAM_SIZE; + t_u8 *end_ptr = NULL; + int tries; + + if (!phandle) { + PRINTM(MERROR, "Could not dump firmwware info\n"); + return; + } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0) + /** Create dump directort*/ + woal_create_dump_dir(phandle, path_name, sizeof(path_name)); +#else + memset(path_name, 0, sizeof(path_name)); + strcpy(path_name, "/data"); +#endif + PRINTM(MMSG, "Directory name is %s\n", path_name); + woal_dump_drv_info(phandle, path_name); + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 32) + sdio_claim_host(((struct sdio_mmc_card *)phandle->card)->func); +#endif + /* start dump fw memory */ + moal_get_system_time(phandle, &sec, &usec); + PRINTM(MMSG, "==== DEBUG MODE OUTPUT START: %u.%06u ====\n", sec, usec); + ret = moal_vmalloc(phandle, ITCM_SIZE + 1, (t_u8 **)&ITCM_Ptr); + if ((ret != MLAN_STATUS_SUCCESS) || !ITCM_Ptr) { + PRINTM(MERROR, "Error: vmalloc ITCM buffer failed!!!\n"); + goto done; + } + + PRINTM(MMSG, "DTCM_SIZE=0x%x\n", dtcm_size); + ret = moal_vmalloc(phandle, dtcm_size + 1, (t_u8 **)&DTCM_Ptr); + if ((ret != MLAN_STATUS_SUCCESS) || !DTCM_Ptr) { + PRINTM(MERROR, "Error: vmalloc DTCM buffer failed!!!\n"); + goto done; + } + ret = moal_vmalloc(phandle, sqram_size + 1, (t_u8 **)&SQRAM_Ptr); + if ((ret != MLAN_STATUS_SUCCESS) || !SQRAM_Ptr) { + PRINTM(MERROR, "Error: vmalloc SQRAM buffer failed!!!\n"); + goto done; + } + dbg_ptr = ITCM_Ptr; + end_ptr = ITCM_Ptr + ITCM_SIZE; + moal_get_system_time(phandle, &sec, &usec); + PRINTM(MMSG, "Start ITCM output %u.%06u, please wait...\n", sec, usec); + reg_start = DEBUG_DUMP_START_REG; + reg_end = DEBUG_DUMP_END_REG; + do { + ret = woal_sdio_writeb(phandle, DEBUG_DUMP_CTRL_REG, + DEBUG_HOST_READY); + if (ret) { + PRINTM(MERROR, "SDIO Write ERR\n"); + goto done; + } + for (tries = 0; tries < MAX_POLL_TRIES; tries++) { + ret = woal_sdio_readb(phandle, DEBUG_DUMP_CTRL_REG, + &ctrl_data); + if (ret) { + PRINTM(MERROR, "SDIO READ ERR\n"); + goto done; + } + if ((ctrl_data == DEBUG_FW_DONE) || + (ctrl_data == DEBUG_ITCM_DONE) || + (ctrl_data == DEBUG_DTCM_DONE) || + (ctrl_data == DEBUG_SQRAM_DONE)) + break; + if (ctrl_data != DEBUG_HOST_READY) { + ret = woal_sdio_writeb(phandle, + DEBUG_DUMP_CTRL_REG, + DEBUG_HOST_READY); + if (ret) { + PRINTM(MERROR, "SDIO Write ERR\n"); + goto done; + } + } + udelay(100); + } + if (ctrl_data == DEBUG_HOST_READY) { + PRINTM(MERROR, "Fail to pull ctrl_data\n"); + goto done; + } + reg = DEBUG_DUMP_FIRST_REG; + ret = woal_sdio_readb(phandle, reg, dbg_ptr); + if (ret) { + PRINTM(MMSG, "SDIO READ ERR\n"); + goto done; + } + if (dbg_ptr < end_ptr) + dbg_ptr++; + else { + PRINTM(MERROR, "pre-allocced buf is not enough\n"); + goto done; + } + for (reg = reg_start; reg <= reg_end; reg++) { + ret = woal_sdio_readb(phandle, reg, dbg_ptr); + if (ret) { + PRINTM(MMSG, "SDIO READ ERR\n"); + goto done; + } + if (dbg_ptr < end_ptr) + dbg_ptr++; + else + PRINTM(MMSG, + "pre-allocced buf is not enough\n"); + } + switch (ctrl_data) { + case DEBUG_ITCM_DONE: +#ifdef MLAN_64BIT + PRINTM(MMSG, "ITCM done: size=0x%lx\n", + dbg_ptr - ITCM_Ptr); +#else + PRINTM(MMSG, "ITCM done: size=0x%x\n", + dbg_ptr - ITCM_Ptr); +#endif + memset(file_name, 0, sizeof(file_name)); + sprintf(file_name, "%s", "file_sdio_ITCM"); + if (MLAN_STATUS_SUCCESS != + woal_save_dump_info_to_file(path_name, file_name, + ITCM_Ptr, ITCM_SIZE)) + PRINTM(MMSG, "Can't save dump file %s in %s\n", + file_name, path_name); + dbg_ptr = DTCM_Ptr; + end_ptr = DTCM_Ptr + dtcm_size; + moal_get_system_time(phandle, &sec, &usec); + PRINTM(MMSG, + "Start DTCM output %u.%06u, please wait...\n", + sec, usec); + break; + case DEBUG_DTCM_DONE: +#ifdef MLAN_64BIT + PRINTM(MMSG, "DTCM done: size=0x%lx\n", + dbg_ptr - DTCM_Ptr); +#else + PRINTM(MMSG, "DTCM done: size=0x%x\n", + dbg_ptr - DTCM_Ptr); +#endif + memset(file_name, 0, sizeof(file_name)); + sprintf(file_name, "%s", "file_sdio_DTCM"); + if (MLAN_STATUS_SUCCESS != + woal_save_dump_info_to_file(path_name, file_name, + DTCM_Ptr, dtcm_size)) + PRINTM(MMSG, "Can't save dump file %s in %s\n", + file_name, path_name); + dbg_ptr = SQRAM_Ptr; + end_ptr = SQRAM_Ptr + sqram_size; + moal_get_system_time(phandle, &sec, &usec); + PRINTM(MMSG, + "Start SQRAM output %u.%06u, please wait...\n", + sec, usec); + break; + case DEBUG_SQRAM_DONE: +#ifdef MLAN_64BIT + PRINTM(MMSG, "SQRAM done: size=0x%lx\n", + dbg_ptr - SQRAM_Ptr); +#else + PRINTM(MMSG, "SQRAM done: size=0x%x\n", + dbg_ptr - SQRAM_Ptr); +#endif + memset(file_name, 0, sizeof(file_name)); + sprintf(file_name, "%s", "file_sdio_SQRAM"); + if (MLAN_STATUS_SUCCESS != + woal_save_dump_info_to_file(path_name, file_name, + SQRAM_Ptr, sqram_size)) + PRINTM(MMSG, "Can't save dump file %s in %s\n", + file_name, path_name); + PRINTM(MMSG, "End output!\n"); + break; + default: + break; + } + } while (ctrl_data != DEBUG_SQRAM_DONE); + + PRINTM(MMSG, + "The output ITCM/DTCM/SQRAM have been saved to files successfully!\n"); + moal_get_system_time(phandle, &sec, &usec); + PRINTM(MMSG, "==== DEBUG MODE OUTPUT END: %u.%06u ====\n", sec, usec); + /* end dump fw memory */ +done: +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 32) + sdio_release_host(((struct sdio_mmc_card *)phandle->card)->func); +#endif + if (ITCM_Ptr) + moal_vfree(phandle, ITCM_Ptr); + if (DTCM_Ptr) + moal_vfree(phandle, DTCM_Ptr); + if (SQRAM_Ptr) + moal_vfree(phandle, SQRAM_Ptr); + PRINTM(MMSG, "==== DEBUG MODE END ====\n"); + return; +} +#endif + /** * @brief This function dump firmware memory to file * @@ -1994,6 +2277,11 @@ static void woal_sdiommc_dump_fw_info(moal_handle *phandle) } else if (phandle->card_info->dump_fw_info == DUMP_FW_SDIO_V3) { woal_dump_firmware_info_v3(phandle); } +#ifdef SD8801 + else { + woal_dump_firmware_info(phandle); + } +#endif phandle->fw_dump = MFALSE; mlan_pm_wakeup_card(phandle->pmlan_adapter, MFALSE); queue_work(phandle->workqueue, &phandle->main_work); diff --git a/mxm_wifiex/wlan_src/mlinux/moal_shim.c b/mxm_wifiex/wlan_src/mlinux/moal_shim.c index 84c0966..0892104 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_shim.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_shim.c @@ -184,6 +184,10 @@ mlan_status moal_malloc_consistent(t_void *pmoal, t_u32 size, t_u8 **ppbuf, moal_handle *handle = (moal_handle *)pmoal; pcie_service_card *card = (pcie_service_card *)handle->card; *pbuf_pa = 0; + + if (!card) + return MLAN_STATUS_FAILURE; + *ppbuf = (t_u8 *)pci_alloc_consistent(card->dev, size, (dma_addr_t *)pbuf_pa); if (*ppbuf == NULL) { @@ -213,7 +217,7 @@ mlan_status moal_mfree_consistent(t_void *pmoal, t_u32 size, t_u8 *pbuf, moal_handle *handle = (moal_handle *)pmoal; pcie_service_card *card = handle->card; - if (!pbuf) + if (!pbuf || !card) return MLAN_STATUS_FAILURE; pci_free_consistent(card->dev, size, pbuf, buf_pa); @@ -240,6 +244,9 @@ mlan_status moal_map_memory(t_void *pmoal, t_u8 *pbuf, t_u64 *pbuf_pa, dma_addr_t dma; + if (!card) + return MLAN_STATUS_FAILURE; + /* Init memory to device */ dma = pci_map_single(card->dev, pbuf, size, flag); #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) @@ -272,6 +279,9 @@ mlan_status moal_unmap_memory(t_void *pmoal, t_u8 *pbuf, t_u64 buf_pa, moal_handle *handle = (moal_handle *)pmoal; pcie_service_card *card = (pcie_service_card *)handle->card; + if (!card) + return MLAN_STATUS_FAILURE; + pci_unmap_single(card->dev, buf_pa, size, flag); return MLAN_STATUS_SUCCESS; @@ -817,7 +827,9 @@ mlan_status moal_get_vdll_data(t_void *pmoal, t_u32 len, t_u8 *pbuf) mlan_status moal_get_hw_spec_complete(t_void *pmoal, mlan_status status, mlan_hw_info *phw, pmlan_bss_tbl ptbl) { +#if defined(PCIE9098) moal_handle *handle = (moal_handle *)pmoal; +#endif ENTER(); if (status == MLAN_STATUS_SUCCESS) { @@ -1458,7 +1470,8 @@ mlan_status moal_recv_packet(t_void *pmoal, pmlan_buffer pmbuf) if (priv->rx_protocols.protocol_num) { for (j = 0; j < priv->rx_protocols.protocol_num; j++) { - if (htons(skb->protocol) == + if (htons((__force t_u16) + skb->protocol) == priv->rx_protocols.protocols[j]) rx_info_flag = MTRUE; } @@ -1573,7 +1586,7 @@ static void moal_connection_status_check_pmqos(t_void *pmoal) * * @return N/A */ -void woal_rx_mgmt_pkt_event(moal_private *priv, t_u8 *pkt, t_u16 len) +static void woal_rx_mgmt_pkt_event(moal_private *priv, t_u8 *pkt, t_u16 len) { struct woal_event *evt; unsigned long flags; @@ -1622,6 +1635,9 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent) #endif #endif mlan_ds_ps_info pm_info; + moal_handle *handle = (moal_handle *)pmoal; + moal_handle *ref_handle = NULL; + #ifdef STA_CFG80211 t_u8 hw_test; #endif @@ -1639,7 +1655,10 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent) ENTER(); if (pmevent->event_id == MLAN_EVENT_ID_FW_DUMP_INFO) { woal_store_firmware_dump(pmoal, pmevent); - ((moal_handle *)pmoal)->driver_status = MTRUE; + handle->driver_status = MTRUE; + ref_handle = (moal_handle *)handle->pref_mac; + if (ref_handle) + ref_handle->driver_status = MTRUE; goto done; } if ((pmevent->event_id != MLAN_EVENT_ID_DRV_DEFER_RX_WORK) && @@ -1653,8 +1672,7 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent) } #endif /* SSU_SUPPORT */ if (pmevent->event_id == MLAN_EVENT_ID_STORE_HOST_CMD_RESP) { - woal_save_host_cmdresp((moal_handle *)pmoal, - (mlan_cmdresp_event *)pmevent); + woal_save_host_cmdresp(handle, (mlan_cmdresp_event *)pmevent); goto done; } priv = woal_bss_index_to_priv(pmoal, pmevent->bss_index); @@ -2184,6 +2202,9 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent) break; case MLAN_EVENT_ID_DRV_DBG_DUMP: priv->phandle->driver_status = MTRUE; + ref_handle = (moal_handle *)priv->phandle->pref_mac; + if (ref_handle) + ref_handle->driver_status = MTRUE; woal_moal_debug_info(priv, NULL, MFALSE); woal_broadcast_event(priv, CUS_EVT_DRIVER_HANG, strlen(CUS_EVT_DRIVER_HANG)); diff --git a/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c b/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c index b0e5825..f4d6826 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c @@ -2078,7 +2078,7 @@ static int woal_cfg80211_authenticate(struct wiphy *wiphy, memset(mgmt, 0, MGMT_HEADER_LEN); /**Authentication Frame: Frame Control*/ mgmt->frame_control = - cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_AUTH); + woal_cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_AUTH); /**Authentication Frame: Destination Address*/ moal_memcpy_ext(priv->phandle, mgmt->da, req->bss->bssid, ETH_ALEN, sizeof(mgmt->da)); @@ -2128,7 +2128,7 @@ static int woal_cfg80211_authenticate(struct wiphy *wiphy, &packet_len, sizeof(packet_len), sizeof(packet_len)); /**Authentication Frame: Authentication Alg*/ - mgmt->u.auth.auth_alg = cpu_to_le16(auth_alg); + mgmt->u.auth.auth_alg = woal_cpu_to_le16(auth_alg); mgmt->u.auth.auth_transaction = trans; /**Authentication Frame: Status code*/ mgmt->u.auth.status_code = status_code; @@ -2148,7 +2148,7 @@ static int woal_cfg80211_authenticate(struct wiphy *wiphy, priv->host_mlme = MTRUE; priv->auth_flag = HOST_MLME_AUTH_PENDING; - priv->auth_alg = cpu_to_le16(auth_alg); + priv->auth_alg = woal_cpu_to_le16(auth_alg); PRINTM(MCMND, "wlan: HostMlme %s send auth to bssid " MACSTR "\n", dev->name, MAC2STR(req->bss->bssid)); @@ -2494,6 +2494,11 @@ static int woal_cfg80211_associate(struct wiphy *wiphy, struct net_device *dev, ssid_bssid.channel_flags |= CHAN_FLAGS_MAX; PRINTM(MCMND, "channel flags=0x%x\n", req->bss->channel->flags); } + if (req->prev_bssid) { + moal_memcpy_ext(priv->phandle, ssid_bssid.prev_bssid, + req->prev_bssid, ETH_ALEN, + sizeof(ssid_bssid.prev_bssid)); + } PRINTM(MCMND, "wlan: HostMlme %s send assoicate to bssid " MACSTR "\n", priv->netdev->name, MAC2STR(req->bss->bssid)); @@ -2929,6 +2934,14 @@ int woal_cfg80211_assoc(moal_private *priv, void *sme, t_u8 wait_option, ssid_bssid.channel_flags |= CHAN_FLAGS_MAX; PRINTM(MCMND, "channel flags=0x%x\n", channel->flags); } +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 7, 0) + if (conn_param && conn_param->prev_bssid) { + moal_memcpy_ext(priv->phandle, ssid_bssid.prev_bssid, + conn_param->prev_bssid, ETH_ALEN, + sizeof(ssid_bssid.prev_bssid)); + } +#endif + if (MLAN_STATUS_SUCCESS != woal_bss_start(priv, MOAL_IOCTL_WAIT_TIMEOUT, &ssid_bssid)) { ret = -EFAULT; @@ -4278,7 +4291,7 @@ static int woal_send_ft_action_requst(moal_private *priv, t_u8 *ie, t_u8 len, HEADER_SIZE + sizeof(packet_len)); memset(mgmt, 0, MGMT_HEADER_LEN); mgmt->frame_control = - cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ACTION); + woal_cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ACTION); moal_memcpy_ext(priv->phandle, mgmt->da, bssid, ETH_ALEN, sizeof(mgmt->da)); moal_memcpy_ext(priv->phandle, mgmt->sa, priv->current_addr, ETH_ALEN, @@ -4384,7 +4397,7 @@ static int woal_send_ft_auth_requst(moal_private *priv, t_u8 *ie, t_u8 len, HEADER_SIZE + sizeof(packet_len)); memset(mgmt, 0, MGMT_HEADER_LEN); mgmt->frame_control = - cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_AUTH); + woal_cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_AUTH); moal_memcpy_ext(priv->phandle, mgmt->da, bssid, ETH_ALEN, sizeof(mgmt->da)); moal_memcpy_ext(priv->phandle, mgmt->sa, priv->current_addr, ETH_ALEN, @@ -4394,9 +4407,9 @@ static int woal_send_ft_auth_requst(moal_private *priv, t_u8 *ie, t_u8 len, moal_memcpy_ext(priv->phandle, mgmt->addr4, addr, ETH_ALEN, sizeof(mgmt->addr4)); - mgmt->u.auth.auth_alg = cpu_to_le16(WLAN_AUTH_FT); - mgmt->u.auth.auth_transaction = cpu_to_le16(1); - mgmt->u.auth.status_code = cpu_to_le16(0); + mgmt->u.auth.auth_alg = woal_cpu_to_le16(WLAN_AUTH_FT); + mgmt->u.auth.auth_transaction = woal_cpu_to_le16(1); + mgmt->u.auth.status_code = woal_cpu_to_le16(0); if (ie && len) moal_memcpy_ext(priv->phandle, (t_u8 *)(&mgmt->u.auth.variable), ie, len, len); @@ -8752,10 +8765,10 @@ void woal_host_mlme_disconnect(moal_private *priv, u16 reason_code, u8 *sa) struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)frame_buf; ENTER(); - mgmt->frame_control = IEEE80211_STYPE_DEAUTH; + mgmt->frame_control = (__force __le16)IEEE80211_STYPE_DEAUTH; mgmt->duration = 0; mgmt->seq_ctrl = 0; - mgmt->u.deauth.reason_code = reason_code; + mgmt->u.deauth.reason_code = (__force __le16)reason_code; if (GET_BSS_ROLE(priv) == MLAN_BSS_ROLE_STA) { moal_memcpy_ext(priv->phandle, mgmt->da, broadcast_addr, ETH_ALEN, sizeof(mgmt->da)); diff --git a/mxm_wifiex/wlan_src/mlinux/moal_uap_cfg80211.c b/mxm_wifiex/wlan_src/mlinux/moal_uap_cfg80211.c index 3b2bb4e..394e0f9 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_uap_cfg80211.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_uap_cfg80211.c @@ -170,7 +170,7 @@ static t_u8 woal_check_rsn_ie(IEEEtypes_Rsn_t *rsn_ie, default: break; } - count = le16_to_cpu(rsn_ie->pairwise_cipher.count); + count = woal_le16_to_cpu(rsn_ie->pairwise_cipher.count); for (i = 0; i < count; i++) { switch (rsn_ie->pairwise_cipher.list[i].type) { case WPA_CIPHER_TKIP: @@ -191,7 +191,7 @@ static t_u8 woal_check_rsn_ie(IEEEtypes_Rsn_t *rsn_ie, (wpa_suite_auth_key_mgmt_t *)((u8 *)rsn_ie + sizeof(IEEEtypes_Rsn_t) + (count - 1) * sizeof(wpa_suite)); - count = le16_to_cpu(key_mgmt->count); + count = woal_le16_to_cpu(key_mgmt->count); if (left < (int)(sizeof(wpa_suite_auth_key_mgmt_t) + (count - 1) * sizeof(wpa_suite))) return MFALSE; @@ -247,7 +247,7 @@ static t_u8 woal_check_wpa_ie(IEEEtypes_Wpa_t *wpa_ie, default: break; } - count = le16_to_cpu(wpa_ie->pairwise_cipher.count); + count = woal_le16_to_cpu(wpa_ie->pairwise_cipher.count); for (i = 0; i < count; i++) { switch (wpa_ie->pairwise_cipher.list[i].type) { case WPA_CIPHER_TKIP: @@ -268,7 +268,7 @@ static t_u8 woal_check_wpa_ie(IEEEtypes_Wpa_t *wpa_ie, (wpa_suite_auth_key_mgmt_t *)((u8 *)wpa_ie + sizeof(IEEEtypes_Wpa_t) + (count - 1) * sizeof(wpa_suite)); - count = le16_to_cpu(key_mgmt->count); + count = woal_le16_to_cpu(key_mgmt->count); if (left < (int)(sizeof(wpa_suite_auth_key_mgmt_t) + (count - 1) * sizeof(wpa_suite))) return MFALSE; diff --git a/mxm_wifiex/wlan_src/mlinux/moal_usb.c b/mxm_wifiex/wlan_src/mlinux/moal_usb.c index 4c7f900..d7a41ce 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_usb.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_usb.c @@ -60,6 +60,10 @@ static const char usbdriver_name[] = "usbxxx"; /** This structure contains the device signature */ static struct usb_device_id woal_usb_table[] = { /* Enter the device signature inside */ +#ifdef USB8801 + {NXP_USB_DEVICE(USB8801_VID_1, USB8801_PID_1, "NXP WLAN USB Adapter")}, + {NXP_USB_DEVICE(USB8801_VID_1, USB8801_PID_2, "NXP WLAN USB Adapter")}, +#endif #ifdef USB8897 {NXP_USB_DEVICE(USB8897_VID_1, USB8897_PID_1, "NXP WLAN USB Adapter")}, {NXP_USB_DEVICE(USB8897_VID_1, USB8897_PID_2, "NXP WLAN USB Adapter")}, @@ -97,6 +101,9 @@ static struct usb_device_id woal_usb_table[] = { /** This structure contains the device signature */ static struct usb_device_id woal_usb_table_skip_fwdnld[] = { /* Enter the device signature inside */ +#ifdef USB8801 + {NXP_USB_DEVICE(USB8801_VID_1, USB8801_PID_2, "NXP WLAN USB Adapter")}, +#endif #ifdef USB8897 {NXP_USB_DEVICE(USB8897_VID_1, USB8897_PID_2, "NXP WLAN USB Adapter")}, #endif @@ -672,6 +679,22 @@ static t_u16 woal_update_card_type(t_void *card) t_u16 card_type = 0; /* Update card type */ +#ifdef USB8801 + if (woal_cpu_to_le16(cardp_usb->udev->descriptor.idProduct) == + USB8801_PID_1 || + woal_cpu_to_le16(cardp_usb->udev->descriptor.idProduct) == + USB8801_PID_2) { + card_type = CARD_TYPE_USB8801; + moal_memcpy_ext(NULL, driver_version, CARD_USB8801, + strlen(CARD_USB8801), strlen(driver_version)); + moal_memcpy_ext(NULL, + driver_version + strlen(INTF_CARDTYPE) + + strlen(KERN_VERSION), + V14, strlen(V14), + strlen(driver_version) - strlen(INTF_CARDTYPE) - + strlen(KERN_VERSION)); + } +#endif #ifdef USB8897 if (woal_cpu_to_le16(cardp_usb->udev->descriptor.idProduct) == USB8897_PID_1 || @@ -809,6 +832,9 @@ static int woal_usb_probe(struct usb_interface *intf, woal_cpu_to_le16(udev->descriptor.idProduct), woal_cpu_to_le16(udev->descriptor.bcdDevice)); switch (woal_cpu_to_le16(udev->descriptor.idProduct)) { +#ifdef USB8801 + case USB8801_PID_1: +#endif /* USB8801 */ #ifdef USB8897 case USB8897_PID_1: #endif /* USB8897 */ @@ -833,6 +859,9 @@ static int woal_usb_probe(struct usb_interface *intf, else usb_cardp->boot_state = USB_FW_DNLD; break; +#ifdef USB8801 + case USB8801_PID_2: +#endif /* USB8801 */ #ifdef USB8897 case USB8897_PID_2: #endif /* USB8897 */ @@ -1912,6 +1941,10 @@ static mlan_status woal_usb_get_fw_name(moal_handle *handle) goto done; if (cardp->boot_state == USB_FW_READY) goto done; +#ifdef USB8801 + if (IS_USB8801(handle->card_type)) + goto done; +#endif #if defined(USB8997) || defined(USB9098) || defined(USB9097) || defined(USB8978) ret = woal_check_chip_revision(handle, &revision_id, &strap); diff --git a/mxm_wifiex/wlan_src/mlinux/moal_usb.h b/mxm_wifiex/wlan_src/mlinux/moal_usb.h index 5a0b393..5d20c3f 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_usb.h +++ b/mxm_wifiex/wlan_src/mlinux/moal_usb.h @@ -28,6 +28,14 @@ Change Log: #ifndef _MOAL_USB_H #define _MOAL_USB_H +#ifdef USB8801 +/** USB VID 1 */ +#define USB8801_VID_1 0x1286 +/** USB PID 1 */ +#define USB8801_PID_1 0x2049 +/** USB PID 2 */ +#define USB8801_PID_2 0x204a +#endif /* USB8801 */ #ifdef USB8997 /** USB VID 1 */ #define USB8997_VID_1 0x1286 @@ -92,7 +100,8 @@ Change Log: /** Number of Rx data URB */ #define MVUSB_RX_DATA_URB 6 -#if defined(USB8997) || defined(USB9098) || defined(USB9097) || defined(USB8978) +#if defined(USB8997) || defined(USB9098) || defined(USB9097) || \ + defined(USB8978) || defined(USB8801) /* Transmit buffer size for chip revision check */ #define CHIP_REV_TX_BUF_SIZE 16 /* Receive buffer size for chip revision check */ @@ -102,6 +111,9 @@ Change Log: #define EXTEND_HDR (0xAB950000) #define EXTEND_V1 (0x00000001) #define EXTEND_V2 (0x00000002) +#ifdef USB8801 +#define USB8801_DEFAULT_WLAN_FW_NAME "nxp/usb8801_uapsta.bin" +#endif /* USB8801 */ #endif diff --git a/mxm_wifiex/wlan_src/mlinux/moal_wext.c b/mxm_wifiex/wlan_src/mlinux/moal_wext.c index 67d5799..d69a112 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_wext.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_wext.c @@ -33,8 +33,6 @@ Change log: (IW_EV_ADDR_LEN + MLAN_MAX_SSID_LENGTH + IW_EV_UINT_LEN + \ IW_EV_FREQ_LEN + IW_EV_QUAL_LEN + MLAN_MAX_SSID_LENGTH + \ IW_EV_PARAM_LEN + 40) /* 40 for WPAIE */ -/** Macro for minimum size of scan buffer */ -#define MIN_ACCEPTED_GET_SCAN_BUF 8000 /******************************************************** Local Functions