Skip to contentSkip to conversation

ath10k: fix rssi reporting.

PATCH In review [email protected] 3 participants 7 messages May 15, 2014 – May 23, 2014 Qualcomm Atheros ATH10K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath10k: fix rssi reporting.

From: Ben Greear <[email protected]>

When the driver cannot provide proper rssi, mark
status with RX_FLAG_NO_SIGNAL_VAL so that stack
properly ignores it.

---

Patch is against my tree, hopefully will apply OK against upstream but have not tested that yet.

 drivers/net/wireless/ath/ath10k/htt_rx.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath10k/htt_rx.c +4 -3
index 0c83ffb..d8ec8dd 100644
@@ -1216,11 +1216,12 @@ static void ath10k_htt_rx_handler(struct ath10k_htt *htt,
 	mpdu_ranges = htt_rx_ind_get_mpdu_ranges(rx);
 
 	/* Fill this once, while this is per-ppdu */
-	if (rx->ppdu.info0 & HTT_RX_INDICATION_INFO0_START_VALID) {
-		memset(rx_status, 0, sizeof(*rx_status));
+	memset(rx_status, 0, sizeof(*rx_status));
+	if (rx->ppdu.info0 & HTT_RX_INDICATION_INFO0_START_VALID)
 		rx_status->signal  = ATH10K_DEFAULT_NOISE_FLOOR +
 				     rx->ppdu.combined_rssi;
-	}
+	else
+		rx_status->flag |= RX_FLAG_NO_SIGNAL_VAL;
 
 	if (rx->ppdu.info0 & HTT_RX_INDICATION_INFO0_END_VALID) {
 		/* TSF available only in 32-bit */
Signature · 7 lines
1.7.11.7


_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k
#1 lore raw
Quoted 6 lines · On 15 May 2014 20:34, <[email protected]> wrote:

From: Ben Greear <[email protected]>

When the driver cannot provide proper rssi, mark
status with RX_FLAG_NO_SIGNAL_VAL so that stack
properly ignores it.

I think we should skip this one while we know rssi/rates. They are correct for all packets between START_VALID and END_VALID flags.

BR
Janusz

Quoted 33 lines

---

Patch is against my tree, hopefully will apply OK against upstream but have not tested that yet.

 drivers/net/wireless/ath/ath10k/htt_rx.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath10k/htt_rx.c +4 -4
index 0c83ffb..d8ec8dd 100644
@@ -1216,11 +1216,12 @@ static void ath10k_htt_rx_handler(struct ath10k_htt *htt,
        mpdu_ranges = htt_rx_ind_get_mpdu_ranges(rx);
 
        /* Fill this once, while this is per-ppdu */
-       if (rx->ppdu.info0 & HTT_RX_INDICATION_INFO0_START_VALID) {
-               memset(rx_status, 0, sizeof(*rx_status));
+       memset(rx_status, 0, sizeof(*rx_status));
+       if (rx->ppdu.info0 & HTT_RX_INDICATION_INFO0_START_VALID)
                rx_status->signal  = ATH10K_DEFAULT_NOISE_FLOOR +
                                     rx->ppdu.combined_rssi;
-       }
+       else
+               rx_status->flag |= RX_FLAG_NO_SIGNAL_VAL;
 
        if (rx->ppdu.info0 & HTT_RX_INDICATION_INFO0_END_VALID) {
                /* TSF available only in 32-bit */
--

1.7.11.7

Quoted 4 lines

_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k

_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k

author
#2 lore raw
Quoted 9 lines · Janusz Dziedzic
Quoted 6 lines · On 15 May 2014 20:34, <[email protected]> wrote:

From: Ben Greear <[email protected]>

When the driver cannot provide proper rssi, mark
status with RX_FLAG_NO_SIGNAL_VAL so that stack
properly ignores it.

I think we should skip this one while we know rssi/rates. They are correct for all packets between START_VALID and END_VALID flags.

Skip what, the patch? With current code, you are sending packets up the tree without signal being set and yet without the flag set that says to ignore the (unset) signal value.

Thanks,
Ben

Quoted 42 lines

BR
Janusz

Quoted 37 lines

---

Patch is against my tree, hopefully will apply OK against upstream but have not tested that yet.

  drivers/net/wireless/ath/ath10k/htt_rx.c | 7 ++++---
  1 file changed, 4 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath10k/htt_rx.c +4 -4
index 0c83ffb..d8ec8dd 100644
@@ -1216,11 +1216,12 @@ static void ath10k_htt_rx_handler(struct ath10k_htt *htt,
         mpdu_ranges = htt_rx_ind_get_mpdu_ranges(rx);
 
         /* Fill this once, while this is per-ppdu */
-       if (rx->ppdu.info0 & HTT_RX_INDICATION_INFO0_START_VALID) {
-               memset(rx_status, 0, sizeof(*rx_status));
+       memset(rx_status, 0, sizeof(*rx_status));
+       if (rx->ppdu.info0 & HTT_RX_INDICATION_INFO0_START_VALID)
                 rx_status->signal  = ATH10K_DEFAULT_NOISE_FLOOR +
                                      rx->ppdu.combined_rssi;
-       }
+       else
+               rx_status->flag |= RX_FLAG_NO_SIGNAL_VAL;
 
         if (rx->ppdu.info0 & HTT_RX_INDICATION_INFO0_END_VALID) {
                 /* TSF available only in 32-bit */
--

1.7.11.7

_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k

Signature · 7 lines
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com

_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k
#3 lore raw
Quoted 12 lines · Ben Greear
Quoted 9 lines · Janusz Dziedzic
Quoted 7 lines · On 15 May 2014 20:34, <[email protected]> wrote:

From: Ben Greear <[email protected]>

When the driver cannot provide proper rssi, mark
status with RX_FLAG_NO_SIGNAL_VAL so that stack
properly ignores it.

Quoted 8 lines
Quoted 2 lines

I think we should skip this one while we know rssi/rates. They are correct for all packets between START_VALID and END_VALID flags.

Skip what, the patch? With current code, you are sending packets up the tree without signal being set and yet without the flag set that says to ignore the (unset) signal value.

Didn't reproduce this yet, while we have this values saved when START_VALID - rx status is an template in htt structure.

struct ieee80211_rx_status *rx_status = &htt->rx_status;

Are you sure you have all patches?
This could be passible if we will get first packet with only flag END_VALID (not sure this is even possible). In case we get packets with START valid before, we will use template correctly. In case we will get packets with flags START and END valid we will also reports this correctly.
Did you reproduce this with official firmware?

BTW
your patch break rates info based also on htt->rx_status template.

BR
Janusz

Quoted 43 lines
Quoted 36 lines
Quoted 36 lines

---

Patch is against my tree, hopefully will apply OK against upstream but have not tested that yet.

  drivers/net/wireless/ath/ath10k/htt_rx.c | 7 ++++---
  1 file changed, 4 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath10k/htt_rx.c +4 -3
index 0c83ffb..d8ec8dd 100644
@@ -1216,11 +1216,12 @@ static void ath10k_htt_rx_handler(struct
 ath10k_htt *htt,
         mpdu_ranges = htt_rx_ind_get_mpdu_ranges(rx);
 
         /* Fill this once, while this is per-ppdu */
-       if (rx->ppdu.info0 & HTT_RX_INDICATION_INFO0_START_VALID) {
-               memset(rx_status, 0, sizeof(*rx_status));
+       memset(rx_status, 0, sizeof(*rx_status));
+       if (rx->ppdu.info0 & HTT_RX_INDICATION_INFO0_START_VALID)
                 rx_status->signal  = ATH10K_DEFAULT_NOISE_FLOOR +
                                      rx->ppdu.combined_rssi;
-       }
+       else
+               rx_status->flag |= RX_FLAG_NO_SIGNAL_VAL;
 
         if (rx->ppdu.info0 & HTT_RX_INDICATION_INFO0_END_VALID) {
                 /* TSF available only in 32-bit */

--
1.7.11.7

Quoted 6 lines
Quoted 4 lines

_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k

Quoted 3 lines

--
Ben Greear <[email protected]>
Candela Technologies Inc http://www.candelatech.com

_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k

author
#4 lore raw
Quoted 34 lines · Janusz Dziedzic
Quoted 12 lines · Ben Greear
Quoted 9 lines · Janusz Dziedzic
Quoted 7 lines · On 15 May 2014 20:34, <[email protected]> wrote:

From: Ben Greear <[email protected]>

When the driver cannot provide proper rssi, mark
status with RX_FLAG_NO_SIGNAL_VAL so that stack
properly ignores it.

Quoted 8 lines
Quoted 2 lines

I think we should skip this one while we know rssi/rates. They are correct for all packets between START_VALID and END_VALID flags.

Skip what, the patch? With current code, you are sending packets up the tree without signal being set and yet without the flag set that says to ignore the (unset) signal value.

Didn't reproduce this yet, while we have this values saved when START_VALID - rx status is an template in htt structure.

struct ieee80211_rx_status *rx_status = &htt->rx_status;

Are you sure you have all patches?
This could be passible if we will get first packet with only flag END_VALID (not sure this is even possible). In case we get packets with START valid before, we will use template correctly. In case we will get packets with flags START and END valid we will also reports this correctly.
Did you reproduce this with official firmware?

Quoted 5 lines

BTW
your patch break rates info based also on htt->rx_status template.

BR
Janusz

I will test again without my patch, and if you think current code is correct, then just drop this patch and I'll retest everything when I move back to testing on kalle's tree.

Thanks,
Ben

Signature · 7 lines
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com

_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k
author
#5 lore raw
Quoted 40 lines · Ben Greear
Quoted 37 lines · Janusz Dziedzic
Quoted 12 lines · Ben Greear
Quoted 9 lines · Janusz Dziedzic
Quoted 7 lines · On 15 May 2014 20:34, <[email protected]> wrote:

From: Ben Greear <[email protected]>

When the driver cannot provide proper rssi, mark
status with RX_FLAG_NO_SIGNAL_VAL so that stack
properly ignores it.

Quoted 8 lines
Quoted 2 lines

I think we should skip this one while we know rssi/rates. They are correct for all packets between START_VALID and END_VALID flags.

Skip what, the patch? With current code, you are sending packets up the tree without signal being set and yet without the flag set that says to ignore the (unset) signal value.

Didn't reproduce this yet, while we have this values saved when START_VALID - rx status is an template in htt structure.

struct ieee80211_rx_status *rx_status = &htt->rx_status;

Are you sure you have all patches?
This could be passible if we will get first packet with only flag END_VALID (not sure this is even possible). In case we get packets with START valid before, we will use template correctly. In case we will get packets with flags START and END valid we will also reports this correctly.
Did you reproduce this with official firmware?

BTW
your patch break rates info based also on htt->rx_status template.

Quoted 6 lines
Quoted 2 lines

BR
Janusz

I will test again without my patch, and if you think current code is correct, then just drop this patch and I'll retest everything when I move back to testing on kalle's tree.

I tested again without my patch, and the graph looks smooth against my attenuator's settings, so looks like my patch is not needed.

Thanks,
Ben

Signature · 8 lines
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com


_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k
#6 lore raw
In reply to [email protected]
Quoted 7 lines · [email protected] writes:

From: Ben Greear <[email protected]>

When the driver cannot provide proper rssi, mark
status with RX_FLAG_NO_SIGNAL_VAL so that stack
properly ignores it.

Based on the discussion I'm dropping this patch.

Signature · 6 lines
Kalle Valo

_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k