qcacld-3.0: Update beacon Tx rate configuration implementation

Update beacon Tx rate configuration implementation
for lithium onwards targets

Change-Id: I864b7eedb36b8f4a4804baf42f2b4c762d6868dc
CRs-Fixed: 3593181
This commit is contained in:
Prasanna JS
2023-07-18 05:10:37 -07:00
committed by Rahul Choudhary
parent 0ed9d7c8cc
commit 8f12b73f1d
3 changed files with 48 additions and 2 deletions

View File

@@ -31,6 +31,25 @@
#define ASSEMBLE_RATECODE_V1(_pream, _nss, _rate) \ #define ASSEMBLE_RATECODE_V1(_pream, _nss, _rate) \
(((1) << 28) | ((_pream) << 8) | ((_nss) << 5) | (_rate)) (((1) << 28) | ((_pream) << 8) | ((_nss) << 5) | (_rate))
/* This macro is used to extract the rate from the rate_code as first four bits
* in rate_code represents the rate, next 3 bits represents the nss and
* next 2 bits represents preamble.
*/
#define RATECODE_V1_RIX_MASK 0xf
/* This macro is used to extract preamble from the rate_code as first 4 bits
* in rate_code represents the rate, next 3 bits represents the nss and
* next 2 bits represents preamble.
*/
#define RATECODE_V1_PREAMBLE_OFFSET (4 + 3)
/* This macro is used to extract NSS from the rate_code as first 4 bits
* in rate_code represents the rate, next 3 bits represents the NSS and
* next 2 bits represents preamble.
*/
#define RATECODE_V1_NSS_OFFSET 0x4
#define RATECODE_V1_NSS_MASK 0x7
#ifdef FEATURE_SET #ifdef FEATURE_SET
/** /**
* wlan_mlme_get_feature_info() - Get mlme features * wlan_mlme_get_feature_info() - Get mlme features

View File

@@ -7316,8 +7316,7 @@ static uint16_t hdd_get_data_rate_from_rate_mask(struct wiphy *wiphy,
sband_bitrates = sband->bitrates; sband_bitrates = sband->bitrates;
sband_n_bitrates = sband->n_bitrates; sband_n_bitrates = sband->n_bitrates;
for (i = 0; i < sband_n_bitrates; i++) { for (i = 0; i < sband_n_bitrates; i++) {
if (bit_rate_mask->control[band].legacy == if (bit_rate_mask->control[band].legacy == (1 << i))
sband_bitrates[i].hw_value)
return sband_bitrates[i].bitrate; return sband_bitrates[i].bitrate;
} }
} }

View File

@@ -3223,6 +3223,33 @@ enum mlme_bcn_tx_rate_code wma_get_bcn_rate_code(uint16_t rate)
} }
} }
#ifdef WLAN_BCN_RATECODE_ENABLE
/**
* wma_update_beacon_tx_rate_code() - Update bcn_tx_rate_code
* @mlme_obj: pointer to mlme object
*
* Return: none
*/
static void wma_update_beacon_tx_rate_code(struct vdev_mlme_obj *mlme_obj)
{
uint8_t preamble, nss, rix;
uint32_t rate_code;
rate_code = mlme_obj->mgmt.rate_info.bcn_tx_rate;
rix = rate_code & RATECODE_V1_RIX_MASK;
nss = (rate_code >> RATECODE_V1_NSS_OFFSET) & RATECODE_V1_NSS_MASK;
preamble = rate_code >> RATECODE_V1_PREAMBLE_OFFSET;
mlme_obj->mgmt.rate_info.bcn_tx_rate_code =
wlan_mlme_assemble_rate_code(preamble, nss, rix);
}
#else
static void wma_update_beacon_tx_rate_code(struct vdev_mlme_obj *mlme_obj)
{
}
#endif
QDF_STATUS wma_vdev_pre_start(uint8_t vdev_id, bool restart) QDF_STATUS wma_vdev_pre_start(uint8_t vdev_id, bool restart)
{ {
tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA); tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA);
@@ -3313,6 +3340,7 @@ QDF_STATUS wma_vdev_pre_start(uint8_t vdev_id, bool restart)
*/ */
mlme_obj->mgmt.rate_info.bcn_tx_rate = mlme_obj->mgmt.rate_info.bcn_tx_rate =
wma_get_bcn_rate_code(mlme_obj->mgmt.rate_info.bcn_tx_rate); wma_get_bcn_rate_code(mlme_obj->mgmt.rate_info.bcn_tx_rate);
wma_update_beacon_tx_rate_code(mlme_obj);
} }
if (!restart) { if (!restart) {