From 672207d6738b16eddd9f385ea64bc557533bb052 Mon Sep 17 00:00:00 2001 From: bings Date: Thu, 20 Jun 2019 17:39:39 +0800 Subject: [PATCH] qcacld-3.0: Ignore legacy rate set if it is HE connection Do not configure legacy rate to FW if it is HE connection, otherwise FW does not work. Change-Id: I31d167ee79b7b58cabad29e65cf6834a7151093d CRs-Fixed: 2472811 --- .../mlme/dispatcher/inc/wlan_mlme_api.h | 12 ++++++++ .../mlme/dispatcher/inc/wlan_mlme_ucfg_api.h | 15 ++++++++++ .../mlme/dispatcher/src/wlan_mlme_api.c | 17 +++++++++++ core/hdd/src/wlan_hdd_wext.c | 16 ++++++++++ core/wma/src/wma_mgmt.c | 30 +++++++++---------- 5 files changed, 75 insertions(+), 15 deletions(-) diff --git a/components/mlme/dispatcher/inc/wlan_mlme_api.h b/components/mlme/dispatcher/inc/wlan_mlme_api.h index ddb42e2933..6c630fc304 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_api.h @@ -2224,4 +2224,16 @@ wlan_mlme_get_self_gen_frm_pwr(struct wlan_objmgr_psoc *psoc, */ QDF_STATUS wlan_mlme_get_4way_hs_offload(struct wlan_objmgr_psoc *psoc, bool *value); + +/** + * mlme_get_peer_phymode() - get phymode of peer + * @psoc: pointer to psoc object + * @mac: Pointer to the mac addr of the peer + * @peer_phymode: phymode + * + * Return: QDF Status + */ +QDF_STATUS +mlme_get_peer_phymode(struct wlan_objmgr_psoc *psoc, uint8_t *mac, + enum wlan_phymode *peer_phymode); #endif /* _WLAN_MLME_API_H_ */ diff --git a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h index 529d595251..0a9f6e5393 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h @@ -3828,4 +3828,19 @@ ucfg_mlme_get_channel_bonding_5ghz(struct wlan_objmgr_psoc *psoc, QDF_STATUS ucfg_mlme_set_channel_bonding_5ghz(struct wlan_objmgr_psoc *psoc, uint32_t value); + +/** + * ucfg_mlme_get_peer_phymode() - get phymode of peer + * @psoc: pointer to psoc object + * @mac: Pointer to the mac addr of the peer + * @peer_phymode: phymode + * + * Return: QDF Status + */ +static inline QDF_STATUS +ucfg_mlme_get_peer_phymode(struct wlan_objmgr_psoc *psoc, uint8_t *mac, + enum wlan_phymode *peer_phymode) +{ + return mlme_get_peer_phymode(psoc, mac, peer_phymode); +} #endif /* _WLAN_MLME_UCFG_API_H_ */ diff --git a/components/mlme/dispatcher/src/wlan_mlme_api.c b/components/mlme/dispatcher/src/wlan_mlme_api.c index ac1b57998e..c621a59c0e 100644 --- a/components/mlme/dispatcher/src/wlan_mlme_api.c +++ b/components/mlme/dispatcher/src/wlan_mlme_api.c @@ -3432,3 +3432,20 @@ wlan_mlme_get_4way_hs_offload(struct wlan_objmgr_psoc *psoc, bool *value) return QDF_STATUS_SUCCESS; } + +QDF_STATUS mlme_get_peer_phymode(struct wlan_objmgr_psoc *psoc, uint8_t *mac, + enum wlan_phymode *peer_phymode) +{ + struct wlan_objmgr_peer *peer; + + peer = wlan_objmgr_get_peer_by_mac(psoc, mac, WLAN_MLME_NB_ID); + if (!peer) { + mlme_legacy_err("peer object is null"); + return QDF_STATUS_E_NULL_VALUE; + } + + *peer_phymode = wlan_peer_get_phymode(peer); + wlan_objmgr_peer_release_ref(peer, WLAN_MLME_NB_ID); + + return QDF_STATUS_SUCCESS; +} diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index 66761c3763..629d0d0843 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -4766,6 +4766,10 @@ static int hdd_we_set_11n_rate(struct hdd_adapter *adapter, int rate_code) { uint8_t preamble = 0, nss = 0, rix = 0; int errno; + QDF_STATUS status; + struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); + enum wlan_phymode peer_phymode; + uint8_t *peer_mac = adapter->session.station.conn_info.bssid.bytes; hdd_debug("Rate code %d", rate_code); @@ -4775,6 +4779,18 @@ static int hdd_we_set_11n_rate(struct hdd_adapter *adapter, int rate_code) preamble = WMI_RATE_PREAMBLE_HT; nss = HT_RC_2_STREAMS(rate_code) - 1; } else { + status = ucfg_mlme_get_peer_phymode(hdd_ctx->psoc, + peer_mac, + &peer_phymode); + if (QDF_IS_STATUS_ERROR(status)) { + hdd_err("Failed to set rate"); + return 0; + } + if (IS_WLAN_PHYMODE_HE(peer_phymode)) { + hdd_err("Do not set legacy rate %d in HE mode", + rate_code); + return 0; + } nss = 0; rix = RC_2_RATE_IDX(rate_code); if (rate_code & 0x10) { diff --git a/core/wma/src/wma_mgmt.c b/core/wma/src/wma_mgmt.c index fe2b1c7c72..38249c3dfa 100644 --- a/core/wma/src/wma_mgmt.c +++ b/core/wma/src/wma_mgmt.c @@ -1056,38 +1056,36 @@ static void wma_mask_tx_ht_rate(tp_wma_handle wma, uint8_t *mcs_set) #if SUPPORT_11AX /** - * wma_fw_to_host_phymode_11ac() - convert fw to host phymode for 11ax phymodes + * wma_fw_to_host_phymode_11ax() - convert fw to host phymode for 11ax phymodes * @wma: wma handle * @phymode: phymode to convert * * Return: None */ -static enum wlan_phymode wma_fw_to_host_phymode_11ac(WLAN_PHY_MODE phymode) +static enum wlan_phymode wma_fw_to_host_phymode_11ax(WLAN_PHY_MODE phymode) { switch (phymode) { default: return WLAN_PHYMODE_AUTO; case MODE_11AX_HE20: - return WLAN_PHYMODE_11AC_VHT20; + return WLAN_PHYMODE_11AXA_HE20; case MODE_11AX_HE40: - return WLAN_PHYMODE_11AC_VHT40; + return WLAN_PHYMODE_11AXA_HE40; case MODE_11AX_HE80: - return WLAN_PHYMODE_11AC_VHT80; + return WLAN_PHYMODE_11AXA_HE80; case MODE_11AX_HE80_80: - return WLAN_PHYMODE_11AC_VHT80_80; + return WLAN_PHYMODE_11AXA_HE80_80; case MODE_11AX_HE160: - return WLAN_PHYMODE_11AC_VHT160; + return WLAN_PHYMODE_11AXA_HE160; case MODE_11AX_HE20_2G: - return WLAN_PHYMODE_11AC_VHT20; + return WLAN_PHYMODE_11AXG_HE20; case MODE_11AX_HE40_2G: - return WLAN_PHYMODE_11AC_VHT40; - case MODE_11AX_HE80_2G: - return WLAN_PHYMODE_11AC_VHT80; + return WLAN_PHYMODE_11AXG_HE40; } return WLAN_PHYMODE_AUTO; } #else -static enum wlan_phymode wma_fw_to_host_phymode_11ac(WLAN_PHY_MODE phymode) +static enum wlan_phymode wma_fw_to_host_phymode_11ax(WLAN_PHY_MODE phymode) { return WLAN_PHYMODE_AUTO; } @@ -1134,7 +1132,7 @@ static enum wlan_phymode wma_fw_to_host_phymode(WLAN_PHY_MODE phymode) host_phymode = wma_fw_to_host_phymode_160(phymode); if (host_phymode != WLAN_PHYMODE_AUTO) return host_phymode; - return wma_fw_to_host_phymode_11ac(phymode); + return wma_fw_to_host_phymode_11ax(phymode); case MODE_11A: return WLAN_PHYMODE_11A; case MODE_11G: @@ -1363,12 +1361,14 @@ QDF_STATUS wma_send_peer_assoc(tp_wma_handle wma, #ifdef FEATURE_WLAN_TDLS || (STA_ENTRY_TDLS_PEER == params->staType) #endif /* FEATURE_WLAN_TDLS */ - ) + ) { qdf_mem_copy(cmd->peer_mac, params->staMac, sizeof(cmd->peer_mac)); - else + } else { qdf_mem_copy(cmd->peer_mac, params->bssId, sizeof(cmd->peer_mac)); + wma_objmgr_set_peer_mlme_phymode(wma, params->bssId, phymode); + } cmd->vdev_id = params->smesessionId; cmd->peer_new_assoc = 1;