diff --git a/core/wma/inc/wma_internal.h b/core/wma/inc/wma_internal.h index 936a6db91b..ea634fd237 100644 --- a/core/wma/inc/wma_internal.h +++ b/core/wma/inc/wma_internal.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2021 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -951,6 +951,22 @@ void wma_set_bss_rate_flags(tp_wma_handle wma, uint8_t vdev_id, */ enum tx_rate_info wma_get_vht_rate_flags(enum phy_ch_width ch_width); +/** + * wma_get_ht_rate_flags() - Return the HT rate flags corresponding to the BW + * @ch_width: BW for which rate flags is required + * + * Return: Rate flags corresponding to ch_width + */ +enum tx_rate_info wma_get_ht_rate_flags(enum phy_ch_width ch_width); + +/** + * wma_get_he_rate_flags() - Return the HE rate flags corresponding to the BW + * @ch_width: BW for which rate flags is required + * + * Return: Rate flags corresponding to ch_width + */ +enum tx_rate_info wma_get_he_rate_flags(enum phy_ch_width ch_width); + int32_t wmi_unified_send_txbf(tp_wma_handle wma, tpAddStaParams params); /** diff --git a/core/wma/src/wma_data.c b/core/wma/src/wma_data.c index 37b13228be..f3dee4f76a 100644 --- a/core/wma/src/wma_data.c +++ b/core/wma/src/wma_data.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2021 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -771,16 +771,7 @@ static QDF_STATUS wma_set_bss_rate_flags_he(enum tx_rate_info *rate_flags, if (!add_bss->he_capable) return QDF_STATUS_E_NOSUPPORT; - /*extend TX_RATE_HE160 in future*/ - if (add_bss->ch_width == CH_WIDTH_160MHZ || - add_bss->ch_width == CH_WIDTH_80P80MHZ) - *rate_flags |= TX_RATE_HE160; - else if (add_bss->ch_width == CH_WIDTH_80MHZ) - *rate_flags |= TX_RATE_HE80; - else if (add_bss->ch_width) - *rate_flags |= TX_RATE_HE40; - else - *rate_flags |= TX_RATE_HE20; + *rate_flags |= wma_get_he_rate_flags(add_bss->ch_width); wma_debug("he_capable %d rate_flags 0x%x", add_bss->he_capable, *rate_flags); @@ -823,6 +814,36 @@ enum tx_rate_info wma_get_vht_rate_flags(enum phy_ch_width ch_width) return rate_flags; } +enum tx_rate_info wma_get_ht_rate_flags(enum phy_ch_width ch_width) +{ + enum tx_rate_info rate_flags = 0; + + if (ch_width) + rate_flags |= TX_RATE_HT40 | TX_RATE_HT20; + else + rate_flags |= TX_RATE_HT20; + + return rate_flags; +} + +enum tx_rate_info wma_get_he_rate_flags(enum phy_ch_width ch_width) +{ + enum tx_rate_info rate_flags = 0; + + if (ch_width == CH_WIDTH_160MHZ || + ch_width == CH_WIDTH_80P80MHZ) + rate_flags |= TX_RATE_HE160 | TX_RATE_HE80 | TX_RATE_HE40 | + TX_RATE_HE20; + else if (ch_width == CH_WIDTH_80MHZ) + rate_flags |= TX_RATE_HE80 | TX_RATE_HE40 | TX_RATE_HE20; + else if (ch_width) + rate_flags |= TX_RATE_HE40 | TX_RATE_HE20; + else + rate_flags |= TX_RATE_HE20; + + return rate_flags; +} + void wma_set_bss_rate_flags(tp_wma_handle wma, uint8_t vdev_id, struct bss_params *add_bss) { @@ -846,10 +867,7 @@ void wma_set_bss_rate_flags(tp_wma_handle wma, uint8_t vdev_id, } /* avoid to conflict with htCapable flag */ else if (add_bss->htCapable) { - if (add_bss->ch_width) - *rate_flags |= TX_RATE_HT40; - else - *rate_flags |= TX_RATE_HT20; + *rate_flags |= wma_get_ht_rate_flags(add_bss->ch_width); } } diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c index 2bafd3fbb8..cc0361257e 100644 --- a/core/wma/src/wma_dev_if.c +++ b/core/wma/src/wma_dev_if.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2021 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -971,22 +971,11 @@ void wma_update_rate_flags_after_vdev_restart(tp_wma_handle wma, bss_phymode = des_chan->ch_phymode; if (IS_WLAN_PHYMODE_HE(bss_phymode)) { - if (des_chan->ch_width == CH_WIDTH_160MHZ || - des_chan->ch_width == CH_WIDTH_80P80MHZ) - rate_flags |= TX_RATE_HE160; - else if (des_chan->ch_width == CH_WIDTH_80MHZ) - rate_flags |= TX_RATE_HE80; - else if (des_chan->ch_width) - rate_flags |= TX_RATE_HE40; - else - rate_flags |= TX_RATE_HE20; + rate_flags = wma_get_he_rate_flags(des_chan->ch_width); } else if (IS_WLAN_PHYMODE_VHT(bss_phymode)) { - rate_flags |= wma_get_vht_rate_flags(des_chan->ch_width); + rate_flags = wma_get_vht_rate_flags(des_chan->ch_width); } else if (IS_WLAN_PHYMODE_HT(bss_phymode)) { - if (des_chan->ch_width) - rate_flags |= TX_RATE_HT40; - else - rate_flags |= TX_RATE_HT20; + rate_flags = wma_get_ht_rate_flags(des_chan->ch_width); } else { rate_flags = TX_RATE_LEGACY; } diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c index 38356eb84c..cc712ae068 100644 --- a/core/wma/src/wma_utils.c +++ b/core/wma/src/wma_utils.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2021 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -421,7 +421,8 @@ static uint16_t wma_match_he_rate(uint16_t raw_rate, guard_interval); if (match_rate) { - *mcs_rate_flag &= ~TX_RATE_HE80; + *mcs_rate_flag &= ~(TX_RATE_HE80 | + TX_RATE_HE160); goto rate_found; } }