Skip to contentSkip to conversation

ath10k: Fix getting stats from firmware.

PATCH Superseded [email protected] 4 participants 11 messages Mar 21, 2014 Qualcomm Atheros ATH10K wireless driver

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath10k: Fix getting stats from firmware.

From: Ben Greear <[email protected]>

Make the request command object the right size so that firmware will not just throw it away.
Tested customized and upstream firmware.

---
 drivers/net/wireless/ath/ath10k/wmi.h | 11 +++++++++++
 1 file changed, 11 insertions(+)
drivers/net/wireless/ath/ath10k/wmi.h +11 -0
index fa1b9e0..4946471 100644
@@ -2766,6 +2766,11 @@ enum wmi_stats_id {
 	WMI_REQUEST_AP_STAT	= 0x02
 };
 
+struct wlan_inst_rssi_args {
+	__le16 cfg_retry_count;
+	__le16 retry_count;
+};
+
 struct wmi_request_stats_cmd {
 	__le32 stats_id;
 
@@ -2773,6 +2778,12 @@ struct wmi_request_stats_cmd {
 	 * Space to add parameters like
 	 * peer mac addr
 	 */
+	__le32 vdev_id;
+	/* peer MAC address */
+	struct wmi_mac_addr peer_macaddr;
+
+	/* Instantaneous RSSI arguments */
+	struct wlan_inst_rssi_args inst_rssi_args;
 } __packed;
 
 /* Suspend option */
Signature · 7 lines
1.7.11.7


_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k
#1 lore raw
Quoted 5 lines · On 21 March 2014 01:05, <[email protected]> wrote:

From: Ben Greear <[email protected]>

Make the request command object the right size so that firmware will not just throw it away.
Tested customized and upstream firmware.

Did you test 636 as well? 636 doesn't seem to support more than just stats_id.

Quoted 22 lines
---
 drivers/net/wireless/ath/ath10k/wmi.h | 11 +++++++++++
 1 file changed, 11 insertions(+)
drivers/net/wireless/ath/ath10k/wmi.h +5 -0
index fa1b9e0..4946471 100644
@@ -2766,6 +2766,11 @@ enum wmi_stats_id {
        WMI_REQUEST_AP_STAT     = 0x02
 };
 
+struct wlan_inst_rssi_args {
+       __le16 cfg_retry_count;
+       __le16 retry_count;
+};
+
 struct wmi_request_stats_cmd {
        __le32 stats_id;
 

drivers/net/wireless/ath/ath10k/wmi.h struct wmi_request_stats_cmd { · line 2780

Quoted 3 lines
drivers/net/wireless/ath/ath10k/wmi.h +0 -0
@@ -2773,6 +2778,12 @@ struct wmi_request_stats_cmd {
         * Space to add parameters like
         * peer mac addr
         */

You can probably remove the comment now :-)

drivers/net/wireless/ath/ath10k/wmi.h struct wmi_request_stats_cmd { · line 2787

Quoted 7 lines
drivers/net/wireless/ath/ath10k/wmi.h +6 -0
+       __le32 vdev_id;
+       /* peer MAC address */
+       struct wmi_mac_addr peer_macaddr;
+
+       /* Instantaneous RSSI arguments */
+       struct wlan_inst_rssi_args inst_rssi_args;
 } __packed;

Michał

#2 lore raw
Quoted 3 lines

Did you test 636 as well? 636 doesn't seem to support more than just stats_id.

Nope. Tested with 636 not working.

----
Chun-Yeow

author
#3 lore raw
Quoted 4 lines · Yeoh Chun-Yeow
Quoted 3 lines

Did you test 636 as well? 636 doesn't seem to support more than just stats_id.

Nope. Tested with 636 not working.

Does the existing code work with 636? If so, we can add two different cmd structs and use the smaller one with 636, and the one I modified with 10.x firmware?

Thanks,
Ben

Quoted 4 lines

----
Chun-Yeow

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
#4 lore raw
Quoted 9 lines · Ben Greear
Quoted 4 lines · Yeoh Chun-Yeow
Quoted 3 lines

Did you test 636 as well? 636 doesn't seem to support more than just stats_id.

Nope. Tested with 636 not working.

Does the existing code work with 636? If so, we can add two different cmd structs and use the smaller one with 636, and the one I modified with 10.x firmware?

For this issue that would be the best approach. See Marek P's patch "ath10k: update regulatory domain settings for 10.x firmware" (not yet applied, still in ath-next-test branch) as an example how this can be done.

Signature · 1 line
Kalle Valo
#5 lore raw

Hi, Ben

I did a quick check again on STA mode. With or without your patch, the printed peer stats are both identical but both wrong. See below:

ath10k PEER stats
=================

Peer MAC address 00:00:00:00:00:00
Peer RSSI 256
Peer TX rate 0

Peer MAC address 00:00:00:00:04:f0
Peer RSSI 17317
Peer TX rate 73

So I think that your patch makes no difference but do indeed providing "correct" peer stats on latest AP firmware.

After applying the "ath10k: add the Rx rate in FW stats", I am able to get the Tx and Rx Rate for all connected STAs to my AP.

---
Chun-Yeow

Quoted 19 lines · Kalle Valo
Quoted 9 lines · Ben Greear
Quoted 4 lines · Yeoh Chun-Yeow
Quoted 3 lines

Did you test 636 as well? 636 doesn't seem to support more than just stats_id.

Nope. Tested with 636 not working.

Does the existing code work with 636? If so, we can add two different cmd structs and use the smaller one with 636, and the one I modified with 10.x firmware?

For this issue that would be the best approach. See Marek P's patch "ath10k: update regulatory domain settings for 10.x firmware" (not yet applied, still in ath-next-test branch) as an example how this can be done.

--
Kalle Valo

#6 lore raw

BTW, is anyone ever tested the get stats for firmware 636 before your patch and getting positive results?

---
Chun-Yeow

Quoted 45 lines · Yeoh Chun-Yeow

Hi, Ben

I did a quick check again on STA mode. With or without your patch, the printed peer stats are both identical but both wrong. See below:

ath10k PEER stats
=================

Peer MAC address 00:00:00:00:00:00
Peer RSSI 256
Peer TX rate 0

Peer MAC address 00:00:00:00:04:f0
Peer RSSI 17317
Peer TX rate 73

So I think that your patch makes no difference but do indeed providing "correct" peer stats on latest AP firmware.

After applying the "ath10k: add the Rx rate in FW stats", I am able to get the Tx and Rx Rate for all connected STAs to my AP.

---
Chun-Yeow

Quoted 19 lines · Kalle Valo
Quoted 9 lines · Ben Greear
Quoted 4 lines · Yeoh Chun-Yeow
Quoted 3 lines

Did you test 636 as well? 636 doesn't seem to support more than just stats_id.

Nope. Tested with 636 not working.

Does the existing code work with 636? If so, we can add two different cmd structs and use the smaller one with 636, and the one I modified with 10.x firmware?

For this issue that would be the best approach. See Marek P's patch "ath10k: update regulatory domain settings for 10.x firmware" (not yet applied, still in ath-next-test branch) as an example how this can be done.

--
Kalle Valo

author
#7 lore raw
Quoted 10 lines · Yeoh Chun-Yeow
Quoted 10 lines

I did a quick check again on STA mode. With or without your patch, the printed peer stats are both identical but both wrong. See below:

ath10k PEER stats
=================

Peer MAC address 00:00:00:00:00:00
Peer RSSI 256
Peer TX rate 0

Quoted 6 lines
Quoted 6 lines
              Peer MAC address 00:00:00:00:04:f0
                     Peer RSSI 17317
                  Peer TX rate 73

So I think that your patch makes no difference but do indeed providing "correct" peer stats on latest AP firmware.

It looks like the peer stats are broken on my 10.x firmware as well. Other pdev tx/rx stats look like they are at least possibly correct.

Since ath10k supports more than one vdev, we also will want to extend it to get peer for the rest of the vdevs some day.

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
author
#8 lore raw
In reply to Yeoh Chun-Yeow
Quoted 4 lines · Yeoh Chun-Yeow

Hi, Ben

I did a quick check again on STA mode. With or without your patch, the printed peer stats are both identical but both wrong. See below:

Ok, it's unlikely my patch would have changed it one way or another.

I'll leave my patch mostly as it was (ie, no special handling for older v/s newer firmware).

I am just starting to look at stats, and since 10.x was completely broken and has been for some time, probably no one else has paid much attention to it yet either.

Thanks for testing.

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
author
#9 lore raw
In reply to Michal Kazior
Quoted 8 lines · Michal Kazior
Quoted 5 lines · On 21 March 2014 01:05, <[email protected]> wrote:

From: Ben Greear <[email protected]>

Make the request command object the right size so that firmware will not just throw it away.
Tested customized and upstream firmware.

Did you test 636 as well? 636 doesn't seem to support more than just stats_id.

The firmware source I have checks in such a way that sending too large of a cmd should be fine, only too small of a command packet causes it to be ignored.

I do not have the 636 firmware to test against.

Quoted 21 lines
Quoted 21 lines
---
 drivers/net/wireless/ath/ath10k/wmi.h | 11 +++++++++++
 1 file changed, 11 insertions(+)
drivers/net/wireless/ath/ath10k/wmi.h +5 -0
index fa1b9e0..4946471 100644
@@ -2766,6 +2766,11 @@ enum wmi_stats_id {
        WMI_REQUEST_AP_STAT     = 0x02
 };
 
+struct wlan_inst_rssi_args {
+       __le16 cfg_retry_count;
+       __le16 retry_count;
+};
+
 struct wmi_request_stats_cmd {
        __le32 stats_id;
 
Quoted 6 lines

drivers/net/wireless/ath/ath10k/wmi.h struct wmi_request_stats_cmd { · line 2780

Quoted 4 lines
drivers/net/wireless/ath/ath10k/wmi.h +0 -0
@@ -2773,6 +2778,12 @@ struct wmi_request_stats_cmd {
         * Space to add parameters like
         * peer mac addr
         */

You can probably remove the comment now :-)

Ok, I can do that.

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
#10 lore raw
Quoted 8 lines · Ben Greear
Quoted 7 lines · Michal Kazior
Quoted 5 lines · On 21 March 2014 01:05, <[email protected]> wrote:

From: Ben Greear <[email protected]>

Make the request command object the right size so that firmware will not just throw it away.
Tested customized and upstream firmware.

Quoted 7 lines
Quoted 1 line

Did you test 636 as well? 636 doesn't seem to support more than just stats_id.

The firmware source I have checks in such a way that sending too large of a cmd should be fine, only too small of a command packet causes it to be ignored.

I do not have the 636 firmware to test against.

The firmare image is here:

https://github.com/kvalo/ath10k-firmware/tree/master/main

Signature · 1 line
Kalle Valo