Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2289188c authored by Janusz Dziedzic's avatar Janusz Dziedzic Committed by Kalle Valo
Browse files

ath10k: fix rssi and rate reporting



RSSI and RATES fields are valid only when START_VALID
bit is set. So, in current implementation we have to
remember/caclulate them when START_VALID and report the same
when only END_VALID is set.
Currently during heavy traffic we could have:
- 10 packets with START_VALID - correct RSSI and RATES
- 10 packets with END_VALID
- 10 packets with START_VALID - correct RSSI and RATES
- 10 packets with END_VALID
...
Next using monitor interface we will see:
- 10 packets with correct rssi/rates
- 10 packets with rssi=-95/rate=6Mbps

Signed-off-by: default avatarJanusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent 6df92a3d
Loading
Loading
Loading
Loading
+5 −4
Original line number Original line Diff line number Diff line
@@ -1154,8 +1154,6 @@ static void ath10k_htt_rx_handler(struct ath10k_htt *htt,


	lockdep_assert_held(&htt->rx_ring.lock);
	lockdep_assert_held(&htt->rx_ring.lock);


	memset(rx_status, 0, sizeof(*rx_status));

	fw_desc_len = __le16_to_cpu(rx->prefix.fw_rx_desc_bytes);
	fw_desc_len = __le16_to_cpu(rx->prefix.fw_rx_desc_bytes);
	fw_desc = (u8 *)&rx->fw_desc;
	fw_desc = (u8 *)&rx->fw_desc;


@@ -1164,8 +1162,11 @@ static void ath10k_htt_rx_handler(struct ath10k_htt *htt,
	mpdu_ranges = htt_rx_ind_get_mpdu_ranges(rx);
	mpdu_ranges = htt_rx_ind_get_mpdu_ranges(rx);


	/* Fill this once, while this is per-ppdu */
	/* Fill this once, while this is per-ppdu */
	rx_status->signal  = ATH10K_DEFAULT_NOISE_FLOOR;
	if (rx->ppdu.info0 & HTT_RX_INDICATION_INFO0_START_VALID) {
	rx_status->signal += rx->ppdu.combined_rssi;
		memset(rx_status, 0, sizeof(*rx_status));
		rx_status->signal  = ATH10K_DEFAULT_NOISE_FLOOR +
				     rx->ppdu.combined_rssi;
	}


	if (rx->ppdu.info0 & HTT_RX_INDICATION_INFO0_END_VALID) {
	if (rx->ppdu.info0 & HTT_RX_INDICATION_INFO0_END_VALID) {
		/* TSF available only in 32-bit */
		/* TSF available only in 32-bit */