mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
wifi: ath12k: correctly update bw for ofdma packets
Currently, arsta->txrate.bw is filled from ath12k_mac_bw_to_mac80211_bw(bw) during ath12k_update_per_peer_tx_stats(). But in tx_completion path bw is filled differently if ppdu_type is ofdma for HE/EHT rates. Hence, update arsta->txrate.bw correctly if packet is ofdma for HE and EHT rate. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1 Signed-off-by: Sarika Sharma <quic_sarishar@quicinc.com> Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com> Link: https://patch.msgid.link/20250701105927.803342-5-quic_sarishar@quicinc.com Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
This commit is contained in:
committed by
Jeff Johnson
parent
ebde0514b4
commit
e0618fca1a
@@ -1559,6 +1559,8 @@ enum HTT_PPDU_STATS_PPDU_TYPE {
|
||||
#define HTT_PPDU_STATS_USER_RATE_FLAGS_DCM_M BIT(28)
|
||||
#define HTT_PPDU_STATS_USER_RATE_FLAGS_LDPC_M BIT(29)
|
||||
|
||||
#define HTT_USR_RATE_PPDU_TYPE(_val) \
|
||||
le32_get_bits(_val, HTT_PPDU_STATS_USER_RATE_INFO1_PPDU_TYPE_M)
|
||||
#define HTT_USR_RATE_PREAMBLE(_val) \
|
||||
le32_get_bits(_val, HTT_PPDU_STATS_USER_RATE_FLAGS_PREAMBLE_M)
|
||||
#define HTT_USR_RATE_BW(_val) \
|
||||
|
||||
@@ -1423,12 +1423,12 @@ ath12k_update_per_peer_tx_stats(struct ath12k *ar,
|
||||
struct htt_ppdu_user_stats *usr_stats = &ppdu_stats->user_stats[user];
|
||||
struct htt_ppdu_stats_common *common = &ppdu_stats->common;
|
||||
int ret;
|
||||
u8 flags, mcs, nss, bw, sgi, dcm, rate_idx = 0;
|
||||
u8 flags, mcs, nss, bw, sgi, dcm, ppdu_type, rate_idx = 0;
|
||||
u32 v, succ_bytes = 0;
|
||||
u16 tones, rate = 0, succ_pkts = 0;
|
||||
u32 tx_duration = 0;
|
||||
u8 tid = HTT_PPDU_STATS_NON_QOS_TID;
|
||||
bool is_ampdu = false;
|
||||
bool is_ampdu = false, is_ofdma;
|
||||
|
||||
if (!(usr_stats->tlv_flags & BIT(HTT_PPDU_STATS_TAG_USR_RATE)))
|
||||
return;
|
||||
@@ -1457,6 +1457,10 @@ ath12k_update_per_peer_tx_stats(struct ath12k *ar,
|
||||
sgi = HTT_USR_RATE_GI(user_rate->rate_flags);
|
||||
dcm = HTT_USR_RATE_DCM(user_rate->rate_flags);
|
||||
|
||||
ppdu_type = HTT_USR_RATE_PPDU_TYPE(user_rate->info1);
|
||||
is_ofdma = (ppdu_type == HTT_PPDU_STATS_PPDU_TYPE_MU_OFDMA) ||
|
||||
(ppdu_type == HTT_PPDU_STATS_PPDU_TYPE_MU_MIMO_OFDMA);
|
||||
|
||||
/* Note: If host configured fixed rates and in some other special
|
||||
* cases, the broadcast/management frames are sent in different rates.
|
||||
* Firmware rate's control to be skipped for this?
|
||||
@@ -1506,6 +1510,8 @@ ath12k_update_per_peer_tx_stats(struct ath12k *ar,
|
||||
|
||||
memset(&arsta->txrate, 0, sizeof(arsta->txrate));
|
||||
|
||||
arsta->txrate.bw = ath12k_mac_bw_to_mac80211_bw(bw);
|
||||
|
||||
switch (flags) {
|
||||
case WMI_RATE_PREAMBLE_OFDM:
|
||||
arsta->txrate.legacy = rate;
|
||||
@@ -1534,6 +1540,8 @@ ath12k_update_per_peer_tx_stats(struct ath12k *ar,
|
||||
le16_to_cpu(user_rate->ru_start) + 1;
|
||||
v = ath12k_he_ru_tones_to_nl80211_he_ru_alloc(tones);
|
||||
arsta->txrate.he_ru_alloc = v;
|
||||
if (is_ofdma)
|
||||
arsta->txrate.bw = RATE_INFO_BW_HE_RU;
|
||||
break;
|
||||
case WMI_RATE_PREAMBLE_EHT:
|
||||
arsta->txrate.mcs = mcs;
|
||||
@@ -1544,11 +1552,12 @@ ath12k_update_per_peer_tx_stats(struct ath12k *ar,
|
||||
le16_to_cpu(user_rate->ru_start) + 1;
|
||||
v = ath12k_mac_eht_ru_tones_to_nl80211_eht_ru_alloc(tones);
|
||||
arsta->txrate.eht_ru_alloc = v;
|
||||
if (is_ofdma)
|
||||
arsta->txrate.bw = RATE_INFO_BW_EHT_RU;
|
||||
break;
|
||||
}
|
||||
|
||||
arsta->txrate.nss = nss;
|
||||
arsta->txrate.bw = ath12k_mac_bw_to_mac80211_bw(bw);
|
||||
arsta->tx_duration += tx_duration;
|
||||
memcpy(&arsta->last_txrate, &arsta->txrate, sizeof(struct rate_info));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user