diff --git a/mxm_wifiex/wlan_src/README_MLAN b/mxm_wifiex/wlan_src/README_MLAN index 148cead..b76529c 100644 --- a/mxm_wifiex/wlan_src/README_MLAN +++ b/mxm_wifiex/wlan_src/README_MLAN @@ -1321,6 +1321,9 @@ hssetpara This command is used to set host sleep parameters. Usage: + echo "hssetpara=2 0xff 0xc8 3 400" > /proc/mwlan/adapter0/config + echo "hssetpara=2 1 0xc8 3 400 " > /proc/mwlan/adapter0/config + 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] (optional)[type min_wake_holdoff] This command takes one (condition), two (condition and GPIO#) or three diff --git a/mxm_wifiex/wlan_src/mapp/mlanconfig/config/robust_btc_MM.conf b/mxm_wifiex/wlan_src/mapp/mlanconfig/config/robust_btc_MM.conf index cf8a8cd..e14bee3 100644 --- a/mxm_wifiex/wlan_src/mapp/mlanconfig/config/robust_btc_MM.conf +++ b/mxm_wifiex/wlan_src/mapp/mlanconfig/config/robust_btc_MM.conf @@ -1,4 +1,4 @@ -# File : robust_btc_MM.conf +# File : robust_btc.conf ######################### Robust Coex command ############### mode_get={ @@ -14,9 +14,43 @@ mode_get={ } } +mode_timeshare={ + CmdCode=0x00e0 # do NOT change this line + Action:2=1 # SET + RSVD:2=0 + + # Robust Coex Mode TLV + RobustCoexTlvType:2=0x0160 + RobustCoexTlvLength:2={ + # All the modes below are mutually exclusive of each other; + Enable:1=0x01 # Bit0: Enable 2x2 or 1x1 Time Distribute(TMD) + # Robust Coex(RBC) mode, when uAP bss start, + # uAP TMD RBC scheme is enabled, + # STA TMD RBC scheme is disabled. + Reserved:3=0 + } +} + +mode_spatial={ + CmdCode=0x00e0 # do NOT change this line + Action:2=1 # SET + RSVD:2=0 + + # Robust Coex Mode TLV + RobustCoexTlvType:2=0x0160 + RobustCoexTlvLength:2={ + # All the modes below are mutually exclusive of each other; + Enable:1=0x82 # Bit1: Enable 1x1 SMPS Spatial RBC Mode, e.g. 0x02 + # Bit7: Enable uAP+STA SMPS RBC Mode, + # when uAP bss start, uAP SMPS RBC scheme enable, + # must combined with BIT1 or BIT2, e.g. 0x82, 0x84. + Reserved:3=0 + } +} + mode_none={ - CmdCode=0x00e0 # do NOT change this line - Action:2=1 # SET + CmdCode=0x00e0 # do NOT change this line + Action:2=1 # SET RSVD:2=0 # Robust Coex Mode TLV @@ -41,3 +75,221 @@ mode_bca={ Reserved:3=0 } } + + +mode_2={ + CmdCode=0x00e0 # do NOT change this line + Action:2=1 # SET + RSVD:2=0 + + # Robust Coex Mode TLV + RobustCoexTlvType:2=0x0160 + RobustCoexTlvLength:2={ + Enable:1=0x20 # Concurrent Coex mode with Tx power control and Rx De-sense. + # Used for chips which has separate antenna for BT + Reserved:3=0 + } +} + +gpio_cfg={ + CmdCode=0x00e0 # do NOT change this line + Action:2=1 # SET + RSVD:2=0 + + # Robust Coex Mode TLV + RobustCoexTlvType:2=0x021B + RobustCoexTlvLength:2={ + Enable:1=0x1 # enable GPIO cfg for external bt request + gpionum:1=4 # gpio 4 + gpiopolarity:1=1 # Polarity High + } +} + +external_coex_config={ + CmdCode=0x00e0 + Action:2=1 //0x0 get, 0x1 set + RSVD:2=0 + RobustCoexTlvType:2=0x0238 //TLV ID + RobustCoexTlvLength:2={ + Enabled:1=0x01 // 0x00 disable, 0x01 enable + + ExtHighInputPriority:1=0x02 // Input priority: 0x00 Input Low Priority, 0x01 Input Medium Priority, 0x02 Input High Priority + ExtLowInputPriority:1=0x02 + + ExtPriGPIONum:1=0x06; // Input Priority signal GPIO pin number + ExtPriGPIOPolarity:1=0x01; // Polarity: 0x00 Active Low, 0x01 Active High + + ExtReqGPIONum:1=0x07; // Input Request signal GPIO pin number + ExtReqGPIOPolarity:1=0x01; // Polarity: 0x00 Active Low, 0x01 Active High + + ExtGrntGPIONum:1=0x05; // Output Grant signal GPIO pin number + ExtGrntGPIOPolarity:1=0x01; // Polarity: 0x00 Active Low, 0x01 Active High + + } +} + +external_coex_uwb_config={ + CmdCode=0x00e0 + Action:2=1 # 0x0 get, 0x1 set + RSVD:2=0 + RobustCoexTlvType:2=0x0238 # TLV ID + RobustCoexTlvLength:2={ + Enabled:1=0x03 # 0x03 to configure UWB + } +} + +external_coex_config_2={ + CmdCode=0x00e0 + Action:2=1 //0x0 get, 0x1 set + RSVD:2=0 + RobustCoexTlvType:2=0x0238 //TLV ID + RobustCoexTlvLength:2={ + Enabled:1=0x02 // 0x00 disable, 0x02 enable (KF2, Fixed GPIO external COEX) + + ExtHighInputPriority:1=0x02 // Input priority: 0x00 Input Low Priority, 0x01 Input Medium Priority, 0x02 Input High Priority + ExtLowInputPriority:1=0x02 + } +} + +external_coex_uart_config={ + CmdCode=0x00e0 + Action:2=1 //0x0 get, 0x1 set + RSVD:2=0 + RobustCoexTlvType:2=0x0238 //TLV ID + RobustCoexTlvLength:2={ + Enabled:1=0x04 // 0x00 disable, 0x04: UART enable + Loopback:1=0x00 // 0x00 Loopback disable, 0x01 Loopback enable 0x02 UARTGPIO, 0x06 Get LTE Stats, 0x05 Clear LTE stats + BaudRate:4=4000000 // UART Baud Rate, 4000000: 4M baudrate, 3000000 = 3M baudrate + } +} + +external_coex_pta_config={ + CmdCode=0x00e0 + Action:2=1 // 0x0 get, 0x1 set + RSVD:2=0 + RobustCoexTlvType:2=0x0238 // TLV ID + RobustCoexTlvLength:2={ + Enabled:1=0x05 // 0x00 disable, 0x01 enable + ExtWifiBtArb:1=0x01 // 0x00 disable, 0x01 enable + PolGrantPin:1=0x01 // 0x00 active high, 0x01 active low + EnablePriPtaInt:1=0x01 // 0x00 disable, 0x01 enable + EnableStateFromPta:1=0x02 // 0x00 state input disable + // 0x01 state info is from state pin + // 0x02 state info is sampled on priority pin. + SetPriSampTiming:2=100 // Timing to sample Priority bit + SetStateInfoSampTiming:2=100 // Timing to sample Tx/Rx info + ExtRadioTrafficPrio:1=0x01 // 0x00 disable, 0x01 enable external traffic Tx/Rx Priority. + ExtCoexHwIntWci2:1=0x00 // 0x00 disable, 0x01 enable(wci-2 interface) + } +} + +#In Station generic case +#BT time is set as BTTime +#Wlan time is set as Wlan Time +generictime={ + CmdCode=0x00e0 + Action:2=1 + RSVD:2=0 + RobustCoexTlvType:2=0x0390 + RobustCoexTlvLength:2={ + Enable:2=0x01 + BtTime:2=10 #(12.5ms)Enter value in Units (1Unit = 1.25ms), BTTime must be less than 65535 + WlanTime:2=20 #(25ms)Enter value in Units (1Unit = 1.25ms), WlanTime must be less than 65535 + } +} + +#WLAN duty low prio time is set as WlanLowPrioTime +#WLAN duty total time is set as TotalTime +wlandutytime={ + CmdCode=0x00e0 + Action:2=1 + RSVD:2=0 + RobustCoexTlvType:2=0x0390 + RobustCoexTlvLength:2={ + Enable:2=0x02 # Enable = 1 is for generic time, 0x02 for Dutycycle feature, 0x03 disables DutyCycle feature + WlanLowPrioTime:2=30 #(30ms)Enter value in Units (1Unit = 1ms), keep it less than TotalTime + TotalTime:2=100 #(100ms)Enter value in Units (1Unit = 1ms), TotalTime must be <= 100 + } +} + +#In Station A2DP case +#BT time is set as BTTime +#Wlan time is set as Wlan Time +a2dptime={ + CmdCode=0x00e0 + Action:2=1 + RSVD:2=0 + RobustCoexTlvType:2=0x0391 + RobustCoexTlvLength:2={ + Enable:2=0x01 + BtTime:2=10000 #(10ms) BTTime must be less than 65535 + WlanTime:2=39500 #(39.5ms) WlanTime must be less than 65535 + } +} + +#In Station inquiry case +#BT time is set as BTTime +#Wlan time is set as Wlan Time +inquirytime={ + CmdCode=0x00e0 + Action:2=1 + RSVD:2=0 + RobustCoexTlvType:2=0x0392 + RobustCoexTlvLength:2={ + Enable:2=0x01 + BtTime:2=21215 #(21.215ms) BTTime must be less than 65535 + WlanTime:2=11000 #(11ms) WlanTime must be less than 65535 + } +} + +#In Ap generic case +#BT time is BTTimeBusy when BT has traffic +#BT time is BTTimeIdle when BT is idle +#Wlan time is WlanTimeBusy when Wlan has traffic +#Wlan time is WlanTimeIdle when Wlan is idle +ap_generictime={ + CmdCode=0x00e0 + Action:2=1 + RSVD:2=0 + RobustCoexTlvType:2=0x0393 + RobustCoexTlvLength:2={ + Enable:2=0x01 + BtTime_MAX:2=23000 #(23ms) BTTime(BT Busy) must be less than 28767 + BtTime_MIN:2=6500 #(6.5ms) BTTime(BT Idle) must be less than 28767 + WlanTime_MAX:2=18000 #(18ms) WlanTime(Wlan Busy) must be less than 32767 + WlanTime_MIN:2=5750 #(5.75ms) WlanTime(Wlan Idle) must be less than 32767 + } +} + +#In Ap A2DP case +#BT time is change from BTTimeMax to BTTimeMin +#Wlan time is change from WlanTimeMax to WlanTimeMin +ap_a2dptime={ + CmdCode=0x00e0 + Action:2=1 + RSVD:2=0 + RobustCoexTlvType:2=0x0394 + RobustCoexTlvLength:2={ + Enable:2=0x01 + BtTimebusy:2=23000 #(23ms) Maximum BTTime must be less than 32767 + BtTimeidle:2=6500 #(6.5ms) Minimum BTTime must be less than 32767 + WlanTimebusy:2=18000 #(18ms) Maximum WlanTime must be less than 32767 + WlanTimeidle:2=5750 #(5.75ms) Minimum WlanTime must be less than 32767 + } +} + +#In Ap inquiry case +#BT time is set as BTTime +#Wlan time is set as Wlan Time +ap_inquirytime={ + CmdCode=0x00e0 + Action:2=1 + RSVD:2=0 + RobustCoexTlvType:2=0x0395 + RobustCoexTlvLength:2={ + Enable:2=0x01 + BtTime:2=28750 #(28.75ms) BTTime must less than 32767 + WlanTime:2=20000 #(20ms) WlanTime must be less than 32767 + } +} +######################### Robust Coex command ############### diff --git a/mxm_wifiex/wlan_src/mlan/mlan_cmdevt.c b/mxm_wifiex/wlan_src/mlan/mlan_cmdevt.c index a3130ae..3e5915e 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_cmdevt.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_cmdevt.c @@ -7788,8 +7788,10 @@ static void wlan_fill_link_statistic(mlan_private *priv, .get_link_statistic; /* TLV parse */ - left_len = resp->size - sizeof(HostCmd_DS_802_11_LINK_STATISTIC) - - S_DS_GEN; + if (resp->size > (sizeof(HostCmd_DS_802_11_LINK_STATISTIC) - S_DS_GEN)) + left_len = resp->size - + sizeof(HostCmd_DS_802_11_LINK_STATISTIC) - S_DS_GEN; + tlv = (MrvlIEtypesHeader_t *)(plink_stat->value); DBG_HEXDUMP(MDAT_D, "tlv:", (void *)tlv, 1024); while (left_len > sizeof(MrvlIEtypesHeader_t)) { diff --git a/mxm_wifiex/wlan_src/mlan/mlan_decl.h b/mxm_wifiex/wlan_src/mlan/mlan_decl.h index 23e533c..a42e794 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_decl.h +++ b/mxm_wifiex/wlan_src/mlan/mlan_decl.h @@ -33,7 +33,7 @@ #define _MLAN_DECL_H_ /** MLAN release version */ -#define MLAN_RELEASE_VERSION "344.p1" +#define MLAN_RELEASE_VERSION "344.p2" /** Re-define generic data types for MLAN/MOAL */ /** Signed char (1-byte) */ diff --git a/mxm_wifiex/wlan_src/mlan/mlan_join.c b/mxm_wifiex/wlan_src/mlan/mlan_join.c index 29aab6b..716babf 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_join.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_join.c @@ -880,6 +880,7 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv, MrvlIEtypes_RatesParamSet_t *prates_tlv; MrvlIEtypes_AuthType_t *pauth_tlv = MNULL; MrvlIEtypes_RsnParamSet_t *prsn_ie_tlv = MNULL; + MrvlIEtypes_SAE_PWE_Mode_t *prsnx_ie_tlv = MNULL; MrvlIEtypes_SecurityCfg_t *psecurity_cfg_ie = MNULL; MrvlIEtypes_ChanListParamSet_t *pchan_tlv; WLAN_802_11_RATES rates; @@ -1183,6 +1184,37 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv, prsn_ie_tlv->header.len = wlan_cpu_to_le16( prsn_ie_tlv->header.len); } + if (pbss_desc->prsnx_ie) { + prsnx_ie_tlv = + (MrvlIEtypes_SAE_PWE_Mode_t *)pos; + prsnx_ie_tlv->header.type = + (t_u16)(*(pbss_desc->prsnx_ie)) + .ieee_hdr.element_id; + prsnx_ie_tlv->header.type = + prsnx_ie_tlv->header.type & 0x00FF; + prsnx_ie_tlv->header.type = wlan_cpu_to_le16( + prsnx_ie_tlv->header.type); + prsnx_ie_tlv->header.len = + (t_u16)(*(pbss_desc->prsnx_ie)) + .ieee_hdr.len; + prsnx_ie_tlv->header.len = + prsnx_ie_tlv->header.len & 0x00FF; + + memcpy_ext(pmadapter, prsnx_ie_tlv->pwe, + &((*(pbss_desc->prsnx_ie)).data[0]), + prsnx_ie_tlv->header.len, + prsnx_ie_tlv->header.len); + + HEXDUMP("ASSOC_CMD: RSNX IE", + (t_u8 *)prsnx_ie_tlv, + sizeof(prsnx_ie_tlv->header) + + prsnx_ie_tlv->header.len); + + pos += sizeof(prsnx_ie_tlv->header) + + prsnx_ie_tlv->header.len; + prsnx_ie_tlv->header.len = wlan_cpu_to_le16( + prsnx_ie_tlv->header.len); + } } } diff --git a/mxm_wifiex/wlan_src/mlan/mlan_uap_cmdevent.c b/mxm_wifiex/wlan_src/mlan/mlan_uap_cmdevent.c index 6ab930a..9f3a236 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_uap_cmdevent.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_uap_cmdevent.c @@ -2241,6 +2241,7 @@ static mlan_status wlan_uap_ret_cmd_ap_config(pmlan_private pmpriv, tlv_chan_band = (MrvlIEtypes_channel_band_t *)tlv; bss->param.bss_config.bandcfg = tlv_chan_band->bandcfg; bss->param.bss_config.channel = tlv_chan_band->channel; + pmpriv->uap_channel = tlv_chan_band->channel; pmpriv->uap_state_chan_cb.bandcfg = tlv_chan_band->bandcfg; pmpriv->uap_state_chan_cb.channel = @@ -2678,6 +2679,12 @@ static mlan_status wlan_uap_ret_sys_config(pmlan_private pmpriv, chan_band_tlv->channel; bss->param.ap_channel.is_11n_enabled = pmpriv->is_11n_enabled; + pmpriv->uap_channel = + chan_band_tlv->channel; + pmpriv->uap_state_chan_cb.bandcfg = + chan_band_tlv->bandcfg; + pmpriv->uap_state_chan_cb.channel = + chan_band_tlv->channel; bss->param.ap_channel.is_dfs_chan = wlan_11h_radar_detect_required( pmpriv, @@ -3880,6 +3887,8 @@ static void wlan_check_uap_capability(pmlan_private priv, pmlan_buffer pevent) tlv_len + sizeof(MrvlIEtypesHeader_t)); pchan_info = (MrvlIEtypes_channel_band_t *)tlv; priv->uap_channel = pchan_info->channel; + priv->uap_state_chan_cb.channel = pchan_info->channel; + priv->uap_state_chan_cb.bandcfg = pchan_info->bandcfg; PRINTM(MCMND, "uap_channel FW: 0x%x\n", priv->uap_channel); event->bss_index = priv->bss_index; @@ -5647,9 +5656,7 @@ mlan_status wlan_ops_uap_process_event(t_void *priv) .no_channel_change_on_radar || pmpriv->adapter->dfs_test_params .fixed_new_channel_on_radar) { - if (pmadapter->state_rdh.stage == RDH_OFF || - pmadapter->state_rdh.stage == - RDH_SET_CUSTOM_IE) { + if (pmadapter->state_rdh.stage == RDH_OFF) { pmadapter->state_rdh.stage = RDH_CHK_INTFS; wlan_11h_radar_detected_handling( @@ -5752,6 +5759,8 @@ mlan_status wlan_ops_uap_process_event(t_void *priv) } else { /* Handle Host-based DFS and non-DFS(normal uap) case */ pmpriv->intf_state_11h.tx_disabled = MFALSE; + } + if (pmpriv->uap_host_based) { memset(pmadapter, event_buf, 0x00, MAX_EVENT_SIZE); /* Setup event buffer */ pevent->bss_index = pmpriv->bss_index; diff --git a/mxm_wifiex/wlan_src/mlinux/mlan_decl.h b/mxm_wifiex/wlan_src/mlinux/mlan_decl.h index 23e533c..a42e794 100644 --- a/mxm_wifiex/wlan_src/mlinux/mlan_decl.h +++ b/mxm_wifiex/wlan_src/mlinux/mlan_decl.h @@ -33,7 +33,7 @@ #define _MLAN_DECL_H_ /** MLAN release version */ -#define MLAN_RELEASE_VERSION "344.p1" +#define MLAN_RELEASE_VERSION "344.p2" /** Re-define generic data types for MLAN/MOAL */ /** Signed char (1-byte) */ diff --git a/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.h b/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.h index 0e39e99..e469de6 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.h +++ b/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.h @@ -272,10 +272,6 @@ int woal_cfg80211_mgmt_tx(struct wiphy *wiphy, #endif u64 *cookie); -#if KERNEL_VERSION(3, 14, 0) <= CFG80211_VERSION_CODE -void woal_update_radar_chans_dfs_state(struct wiphy *wiphy); -#endif - mlan_status woal_register_cfg80211(moal_private *priv); extern struct ieee80211_supported_band cfg80211_band_2ghz; diff --git a/mxm_wifiex/wlan_src/mlinux/moal_cfg80211_util.c b/mxm_wifiex/wlan_src/mlinux/moal_cfg80211_util.c index 8fe6c06..39bb82c 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_cfg80211_util.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_cfg80211_util.c @@ -1762,14 +1762,16 @@ static int woal_deinit_ring_buffer(moal_private *priv) ENTER(); - for (i = 0; i < RING_ID_MAX - 1; i++) { + for (i = 0; i < RING_ID_MAX; i++) { ring_buff = (wifi_ring_buffer *)priv->rings[i]; if (!ring_buff) continue; spin_lock_irqsave(&ring_buff->lock, lock_flags); ring_state = ring_buff->state; - if (ring_state == RING_ACTIVE) + if (ring_state == RING_ACTIVE) { ring_buff->state = RING_STOP; + ring_buff->interval = 0; + } spin_unlock_irqrestore(&ring_buff->lock, lock_flags); if (ring_state == RING_ACTIVE) cancel_delayed_work_sync(&ring_buff->work); diff --git a/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c b/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c index 1aad13e..73fd9b2 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c @@ -4467,6 +4467,43 @@ done: return ret; } +/** + * @brief Process Set Host Sleep parameters from proc buffer + * + * @param handle A pointer to moal_handle structure + * @param pbuf A pointer to buffer for host sleep parameters + * @param respbuflen Available length of response buffer + * + * @return 0 --success, otherwise fail + */ +int woal_process_proc_hssetpara(moal_handle *handle, t_u8 *buf) +{ + int data[15] = {0}; + int user_data_len = 0; + int ret = 0; + t_u8 respbuf[500]; + moal_private *priv = woal_get_priv(handle, MLAN_BSS_ROLE_ANY); + + ENTER(); + if (!priv) { + LEAVE(); + return ret; + } + memset((char *)data, 0, sizeof(data)); + parse_arguments(buf, data, ARRAY_SIZE(data), &user_data_len); + if (sizeof(int) * user_data_len > sizeof(data)) { + PRINTM(MERROR, "Too many arguments\n"); + LEAVE(); + return -EINVAL; + } + if (user_data_len >= 1 && user_data_len <= 15) { + sprintf(respbuf, "%s%s%s", CMD_NXP, PRIV_CMD_HSCFG, buf); + ret = woal_priv_hscfg(priv, respbuf, sizeof(respbuf), MFALSE); + } + LEAVE(); + return ret; +} + /** * @brief Set Host Sleep parameters * @@ -15312,19 +15349,17 @@ done: static int woal_priv_dfs_offload_enable(moal_private *priv, t_u8 *respbuf, t_u32 respbuflen) { - struct wiphy *wiphy = NULL; int ret = 0, dfs_offload_en = 0, user_data_len = 0, header_len = 0, dfs_offload; ENTER(); - if (priv && priv->wdev) - wiphy = priv->wdev->wiphy; - if (!wiphy) { - PRINTM(MERROR, "wiphy is NULL\n"); + if (!priv) { + PRINTM(MERROR, "priv is NULL\n"); ret = -EFAULT; goto done; } + dfs_offload = moal_extflg_isset(priv->phandle, EXT_DFS_OFFLOAD); if (woal_is_any_interface_active(priv->phandle)) { PRINTM(MERROR, @@ -15352,7 +15387,6 @@ static int woal_priv_dfs_offload_enable(moal_private *priv, t_u8 *respbuf, moal_extflg_set(priv->phandle, EXT_DFS_OFFLOAD); else moal_extflg_clear(priv->phandle, EXT_DFS_OFFLOAD); - woal_update_radar_chans_dfs_state(wiphy); } done: LEAVE(); diff --git a/mxm_wifiex/wlan_src/mlinux/moal_init.c b/mxm_wifiex/wlan_src/mlinux/moal_init.c index 2cb85d9..fdbeb3a 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_init.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_init.c @@ -69,7 +69,12 @@ static int beacon_hints; #if defined(STA_CFG80211) || defined(UAP_CFG80211) #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) -static int host_mlme; +#ifdef IMX_SUPPORT +static int host_mlme = 1; +#else +static int host_mlme = 0; +#endif + #endif #endif @@ -2606,8 +2611,15 @@ MODULE_PARM_DESC( #if defined(STA_CFG80211) || defined(UAP_CFG80211) #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) module_param(host_mlme, int, 0); -MODULE_PARM_DESC(host_mlme, - "1: Enable Host MLME Support; 0: Disable Host MLME support"); +#ifdef IMX_SUPPORT +MODULE_PARM_DESC( + host_mlme, + "1: Enable Host MLME Support (Default); 0: Disable Host MLME support"); +#else +MODULE_PARM_DESC( + host_mlme, + "1: Enable Host MLME Support; 0: Disable Host MLME support (Default)"); +#endif #endif #endif diff --git a/mxm_wifiex/wlan_src/mlinux/moal_main.c b/mxm_wifiex/wlan_src/mlinux/moal_main.c index 5799f40..85ad811 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_main.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_main.c @@ -966,6 +966,7 @@ static void woal_hang_work_queue(struct work_struct *work) netif_carrier_off(priv->netdev); priv->media_connected = MFALSE; // disconnect + moal_connection_status_check_pmqos(priv->phandle); #ifdef STA_CFG80211 #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) if (IS_STA_CFG80211(cfg80211_wext) && priv->wdev && @@ -6952,20 +6953,17 @@ static int woal_process_tcp_ack(moal_private *priv, mlan_buffer *pmbuf) } } #if 0 -/* Might have race conditions with woal_tcp_ack_timer_func - * Causing kernel panic, ageout handler will free tcp_sess - * for now. - */ - else if ((*((t_u8 *)tcph + 13) & 0x11) == 0x11) { + /* Might have race conditions with woal_tcp_ack_timer_func + * Causing kernel panic, ageout handler will free tcp_sess + * for now. + */ + else if((*((t_u8 *)tcph + 13) & 0x11) == 0x11){ /* TCP ACK + Fin */ spin_lock_irqsave(&priv->tcp_sess_lock, flags); - 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); + 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) { - PRINTM(MDATA, "wlan: delete TCP seesion %p\n", - tcp_session); + PRINTM(MDATA,"wlan: delete TCP seesion %p\n",tcp_session); list_del(&tcp_session->link); if (tcp_session->is_timer_set) woal_cancel_timer(&tcp_session->ack_timer); @@ -6975,8 +6973,9 @@ static int woal_process_tcp_ack(moal_private *priv, mlan_buffer *pmbuf) kfree(tcp_session); } spin_unlock_irqrestore(&priv->tcp_sess_lock, flags); - } + } #endif + done: LEAVE(); return ret; @@ -7219,6 +7218,9 @@ mlan_status woal_atoi(int *data, char *a) } else { if ((i == 0) && (a[i] == '-')) { mul = -1; + } else if (a[i] == 0xa) { + // line feed + break; } else { PRINTM(MERROR, "Invalid char %c in string %s\n", a[i], a); diff --git a/mxm_wifiex/wlan_src/mlinux/moal_main.h b/mxm_wifiex/wlan_src/mlinux/moal_main.h index 8433dc3..2778aa7 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_main.h +++ b/mxm_wifiex/wlan_src/mlinux/moal_main.h @@ -3377,6 +3377,7 @@ int woal_enable_hs(moal_private *priv); /** Get wakeup reason */ mlan_status woal_get_wakeup_reason(moal_private *priv, mlan_ds_hs_wakeup_reason *wakeup_reason); +int woal_process_proc_hssetpara(moal_handle *handle, t_u8 *buf); #define FW_DUMP_INFO_LEN 0x280000 /** mem dump header */ typedef struct { diff --git a/mxm_wifiex/wlan_src/mlinux/moal_proc.c b/mxm_wifiex/wlan_src/mlinux/moal_proc.c index 902e0b1..1e4679c 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_proc.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_proc.c @@ -607,6 +607,11 @@ static ssize_t woal_config_write(struct file *f, const char __user *buf, PRINTM(MMSG, "on=%d drop_point=%d\n", handle->tp_acnt.on, handle->tp_acnt.drop_point); } + if (!strncmp(databuf, "hssetpara=", strlen("hssetpara="))) { + line += strlen("hssetpara") + 1; + PRINTM(MCMND, "hssetpara=%s\n", line); + woal_process_proc_hssetpara(handle, line); + } if (!strncmp(databuf, "rf_test_mode", strlen("rf_test_mode"))) { line += strlen("rf_test_mode") + 1; config_data = (t_u32)woal_string_to_number(line); @@ -686,6 +691,8 @@ static int woal_config_read(struct seq_file *sfp, void *data) { moal_handle *handle = (moal_handle *)sfp->private; int i; + moal_private *priv = woal_get_priv(handle, MLAN_BSS_ROLE_ANY); + mlan_ds_hs_cfg hscfg; ENTER(); @@ -697,6 +704,13 @@ static int woal_config_read(struct seq_file *sfp, void *data) seq_printf(sfp, "hardware_status=%d\n", (int)handle->hardware_status); seq_printf(sfp, "netlink_num=%d\n", (int)handle->netlink_num); seq_printf(sfp, "drv_mode=%d\n", (int)handle->params.drv_mode); + if (priv) { + memset(&hscfg, 0, sizeof(mlan_ds_hs_cfg)); + woal_set_get_hs_params(priv, MLAN_ACT_GET, MOAL_IOCTL_WAIT, + &hscfg); + seq_printf(sfp, "hssetpara=%d,0x%x,%d,%d\n", hscfg.conditions, + hscfg.gpio, hscfg.gap, hscfg.hs_wake_interval); + } #ifdef SDIO if (IS_SD(handle->card_type)) { seq_printf(sfp, "sdcmd52rw=%d 0x%0x 0x%02X\n", diff --git a/mxm_wifiex/wlan_src/mlinux/moal_shim.c b/mxm_wifiex/wlan_src/mlinux/moal_shim.c index d2cbaea..2d803af 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_shim.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_shim.c @@ -2116,15 +2116,22 @@ void woal_request_busfreq_pmqos_add(t_void *handle) #endif if (moal_extflg_isset(pmhandle, EXT_PMQOS)) { #if LINUX_VERSION_CODE <= KERNEL_VERSION(5, 6, 0) -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36) #ifdef IMX_SUPPORT - pm_qos_add_request(&pmhandle->woal_pm_qos_req, - PM_QOS_CPU_DMA_LATENCY, 0); + if (!pm_qos_request_active(&pmhandle->woal_pm_qos_req)) + pm_qos_add_request(&pmhandle->woal_pm_qos_req, + PM_QOS_CPU_DMA_LATENCY, 0); + else + PRINTM(MERROR, "PM-QOS request already active\n"); #endif #endif #elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 7, 0) #ifdef IMX_SUPPORT - cpu_latency_qos_add_request(&pmhandle->woal_pm_qos_req, 0); + if (!cpu_latency_qos_request_active(&pmhandle->woal_pm_qos_req)) + cpu_latency_qos_add_request(&pmhandle->woal_pm_qos_req, + 0); + else + PRINTM(MERROR, "PM-QOS request already active\n"); #endif #endif } @@ -2144,14 +2151,21 @@ void woal_release_busfreq_pmqos_remove(t_void *handle) if (moal_extflg_isset(pmhandle, EXT_PMQOS)) { #if LINUX_VERSION_CODE <= KERNEL_VERSION(5, 6, 0) -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36) #ifdef IMX_SUPPORT - pm_qos_remove_request(&pmhandle->woal_pm_qos_req); + if (pm_qos_request_active(&pmhandle->woal_pm_qos_req)) + pm_qos_remove_request(&pmhandle->woal_pm_qos_req); + else + PRINTM(MERROR, "PM-QOS request already removed\n"); #endif #endif #elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 7, 0) #ifdef IMX_SUPPORT - cpu_latency_qos_remove_request(&pmhandle->woal_pm_qos_req); + if (cpu_latency_qos_request_active(&pmhandle->woal_pm_qos_req)) + cpu_latency_qos_remove_request( + &pmhandle->woal_pm_qos_req); + else + PRINTM(MERROR, "PM-QOS request already removed\n"); #endif #endif } diff --git a/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c b/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c index 6310b14..4a521b3 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c @@ -3551,40 +3551,6 @@ done: /******************************************************** Global Functions ********************************************************/ -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) -/** - * @brief Set all radar channel's dfs_state - * - * @param wiphy A pointer to wiphy structure - * - * @return N/A - */ -void woal_update_radar_chans_dfs_state(struct wiphy *wiphy) -{ - moal_handle *handle = (moal_handle *)woal_get_wiphy_priv(wiphy); - enum ieee80211_band band; - struct ieee80211_supported_band *sband; - int i; - for (band = 0; band < IEEE80211_NUM_BANDS; band++) { - sband = wiphy->bands[band]; - if (!sband) - continue; - for (i = 0; i < sband->n_channels; i++) { - if (sband->channels[i].flags & IEEE80211_CHAN_RADAR) { - if (moal_extflg_isset(handle, EXT_DFS_OFFLOAD)) - sband->channels[i].dfs_state = - NL80211_DFS_AVAILABLE; - else - sband->channels[i].dfs_state = - NL80211_DFS_USABLE; - } - } - } - PRINTM(MCMND, "Set radar dfs_state: dfs_offload=%d\n", - moal_extflg_isset(handle, EXT_DFS_OFFLOAD)); -} -#endif - #if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 0, 0) /** @@ -4015,10 +3981,6 @@ woal_cfg80211_reg_notifier(struct wiphy *wiphy, #endif } -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) - if (moal_extflg_isset(handle, EXT_DFS_OFFLOAD)) - woal_update_radar_chans_dfs_state(wiphy); -#endif memset(region, 0, sizeof(region)); moal_memcpy_ext(priv->phandle, region, request->alpha2, sizeof(request->alpha2), sizeof(region)); @@ -4296,8 +4258,8 @@ static int woal_find_wps_ie_in_probereq(const t_u8 *ie, int len) } #ifdef UAP_CFG80211 -#define SCAN_RESULT_EXPIRTED 1 /** scan result expired value */ +#define SCAN_RESULT_EXPIRTED 1 /** * @brief check if the scan result expired * @@ -9839,6 +9801,9 @@ mlan_status woal_register_cfg80211(moal_private *priv) #endif } #endif +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 18, 0) + wiphy->features |= NL80211_FEATURE_TX_POWER_INSERTION; +#endif #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 4, 0) wiphy->features |= NL80211_FEATURE_INACTIVITY_TIMER; #endif