CHROMIUM: ath10k: Add power_save_duration in the debugfs for each
client.

This patch adds support to get the below power_save information
of each connected peer to AP. With WMI_10_4_PEER_STA_PS_STATECHG_EVENTID
event, below power save information is reported to user space via
debugfs.

1.power_save_duration
2.time_since_station_in_power_save and
3.PS timekeeper to show a timeline about all PS state changes coming to AP,
with each event having information about MAC address of the peer connected,
Timestamp (real system time to milli seconds granularity) and
power save state.

Use the below commands in AP DUT to get the above power_save information.

To know the time_since_station_in_power_save:
cat /sys/kernel/debug/ieee80211/phyX/netdev:wlanX/stations/
XX:XX:XX:XX:XX:XX/current_ps_duration

To know power_save_duration:
cat /sys/kernel/debug/ieee80211/phyX/netdev:wlanX/stations/
XX:XX:XX:XX:XX:XX/total_ps_duration

To reset the power_save_duration of all stations connected to AP:
echo 1 > /sys/kernel/debug/ieee80211/phyX/ath10k/reset_ps_duration

To enable/disable the ps_timekeeper:
echo Y > /sys/kernel/debug/ieee80211/phyX/ath10k/ps_timekeeper_enable
Y = 1 to enable and Y = 0 to disable.

To record PS timekeeer logs after enabling ps_timekeeper:
trace-cmd record -e ath10k_ps_timekeeper

BUG=b:168663869
TEST=brought up AP interface and measured the power save duration of the connected clients

Signed-off-by: Nishant Pandey <quic_nishpand@quicinc.com>
Change-Id: Id9667801f39e3266031e740bad79cb3cc5dae67c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2329712
Reviewed-by: Srinivasa duvvuri <sduvvuri@google.com>
Commit-Queue: Srinivasa duvvuri <sduvvuri@google.com>
Tested-by: Srinivasa duvvuri <sduvvuri@google.com>
6 files changed