Parsing per station rx duration for 10.4
cover Parsing per station rx duration for 10.4
From: Mohammed Shafi Shajakhan <[email protected]>
Peer Stats for 10.4 is enabled by Extended Resource Configuration API (based on one of the earlier patch from Raja Mani), and parsing of the same is based also 'stats_id' which also provides backward compatibility with older f/w (or) ath10k by design
review help:
1. Fixed documentation related comments from Kalle / Michal
2. Fixed indentation related comments from Michal
3. Removed the check for excluding peer stats for test mode (Michal)
4. Fix checking for peer stats feature enabled
Dependency over
[PATCH v5] ath10k: Enable debugfs provision to enable Peer Stats
Mohammed Shafi Shajakhan (1):
ath10k: Enable parsing per station rx duration for 10.4
Raja Mani (1):
ath10k: Introduce Extended Resource Config support for 10.4
drivers/net/wireless/ath/ath10k/core.c | 19 +++++++++- drivers/net/wireless/ath/ath10k/wmi-ops.h | 23 ++++++++++++ drivers/net/wireless/ath/ath10k/wmi.c | 54 +++++++++++++++++++++++++---- drivers/net/wireless/ath/ath10k/wmi.h | 49 +++++++++++++++++++++++++- 4 files changed, 137 insertions(+), 8 deletions(-)
Signature · 1 line
1.7.9.5
PATCH 2/2 ath10k: Enable parsing per station rx duration for 10.4
From: Mohammed Shafi Shajakhan <[email protected]>
Rx duration support for per station is part of extended peer stats, enable provision to parse the same and provide backward compatibility based on the 'stats_id' event
--- drivers/net/wireless/ath/ath10k/core.c | 19 ++++++++++++++++++- drivers/net/wireless/ath/ath10k/wmi.c | 30 ++++++++++++++++++++++++------ drivers/net/wireless/ath/ath10k/wmi.h | 16 ++++++++++++++++ 3 files changed, 58 insertions(+), 7 deletions(-)
drivers/net/wireless/ath/ath10k/core.c +18 -1
@@ -1534,7 +1534,8 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar) ar->num_active_peers =TARGET_10_4_ACTIVE_PEERS ; ar->max_num_vdevs =TARGET_10_4_NUM_VDEVS ; ar->num_tids =TARGET_10_4_TGT_NUM_TIDS ; - ar->fw_stats_req_mask =WMI_STAT_PEER ; + ar->fw_stats_req_mask =WMI_10_4_STAT_PEER | +WMI_10_4_STAT_PEER_EXTD ; ar->max_spatial_stream = ar->hw_params.max_spatial_stream; if (test_bit(ATH10K_FW_FEATURE_PEER_FLOW_CONTROL,
@@ -1579,6 +1580,7 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)int ath10k_core_start (struct ath10k *ar,enum ath10k_firmware_mode mode) {int status; +u32 val;lockdep_assert_held (&ar->conf_mutex);
@@ -1699,6 +1701,21 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode)ath10k_dbg (ar,ATH10K_DBG_BOOT ,"firmware %s booted\n" , ar->hw->wiphy->fw_version); +if (test_bit (WMI_SERVICE_EXT_RES_CFG_SUPPORT , ar->wmi.svc_map)) { + val =0 ; +if (ath10k_peer_stats_enabled (ar)) + val =WMI_10_4_PEER_STATS ; + + status =ath10k_wmi_ext_resource_config (ar, +WMI_HOST_PLATFORM_HIGH_PERF , val); +if (status) { +ath10k_err (ar, +"failed to send ext resource cfg command : %d\n" , + status); + goto err_hif_stop; + } + } + status =ath10k_wmi_cmd_init (ar);if (status) { ath10k_err(ar, "could not send WMI init command (%d)\n",
drivers/net/wireless/ath/ath10k/wmi.c +24 -6
@@ -2632,6 +2632,16 @@ void ath10k_wmi_pull_peer_stats(const struct wmi_peer_stats *src, dst->peer_tx_rate =__le32_to_cpu (src->peer_tx_rate); } +static void +ath10k_wmi_10_4_pull_peer_stats (const struct wmi_10_4_peer_stats *src, +struct ath10k_fw_stats_peer *dst) +{ +ether_addr_copy (dst->peer_macaddr, src->peer_macaddr.addr); + dst->peer_rssi =__le32_to_cpu (src->peer_rssi); + dst->peer_tx_rate =__le32_to_cpu (src->peer_tx_rate); + dst->peer_rx_rate =__le32_to_cpu (src->peer_rx_rate); +} +static int ath10k_wmi_main_op_pull_fw_stats (struct ath10k *ar,struct sk_buff *skb,struct ath10k_fw_stats *stats)
@@ -2925,6 +2935,7 @@ static int ath10k_wmi_10_4_op_pull_fw_stats(struct ath10k *ar,u32 num_pdev_ext_stats;u32 num_vdev_stats;u32 num_peer_stats; +u32 stats_id;int i;if (!skb_pull (skb,sizeof (*ev)))
@@ -2934,6 +2945,7 @@ static int ath10k_wmi_10_4_op_pull_fw_stats(struct ath10k *ar, num_pdev_ext_stats =__le32_to_cpu (ev->num_pdev_ext_stats); num_vdev_stats =__le32_to_cpu (ev->num_vdev_stats); num_peer_stats =__le32_to_cpu (ev->num_peer_stats); + stats_id =__le32_to_cpu (ev->stats_id);for (i =0 ; i < num_pdev_stats; i++) {const struct wmi_10_4_pdev_stats *src;
@@ -2973,22 +2985,28 @@ static int ath10k_wmi_10_4_op_pull_fw_stats(struct ath10k *ar,/* fw doesn't implement vdev stats */ for (i =0 ; i < num_peer_stats; i++) { -const struct wmi_10_4_peer_stats *src; +const struct wmi_10_4_peer_extd_stats *src;struct ath10k_fw_stats_peer *dst; +int stats_len; +bool extd_peer_stats = !!(stats_id &WMI_10_4_STAT_PEER_EXTD ); + +if (extd_peer_stats) + stats_len =sizeof (struct wmi_10_4_peer_extd_stats ); +else + stats_len =sizeof (struct wmi_10_4_peer_stats ); src = (void *)skb->data; -if (!skb_pull (skb,sizeof (*src))) +if (!skb_pull (skb, stats_len))return -EPROTO ; dst =kzalloc (sizeof (*dst),GFP_ATOMIC );if (!dst)continue ; -ether_addr_copy (dst->peer_macaddr, src->peer_macaddr.addr); - dst->peer_rssi =__le32_to_cpu (src->peer_rssi); - dst->peer_tx_rate =__le32_to_cpu (src->peer_tx_rate); - dst->peer_rx_rate =__le32_to_cpu (src->peer_rx_rate); +ath10k_wmi_10_4_pull_peer_stats (&src->common, dst);/* FIXME: expose 10.4 specific values */ +if (extd_peer_stats) + dst->rx_duration = src->rx_duration;list_add_tail (&dst->list, &stats->peers); }
drivers/net/wireless/ath/ath10k/wmi.h +16 -0
@@ -4104,6 +4104,13 @@ enum wmi_stats_id { WMI_STAT_VDEV_RATE = BIT(5), }; +enum wmi_10_4_stats_id { +WMI_10_4_STAT_PEER =BIT (0 ), +WMI_10_4_STAT_AP =BIT (1 ), +WMI_10_4_STAT_INST =BIT (2 ), +WMI_10_4_STAT_PEER_EXTD =BIT (3 ), +}; +struct wlan_inst_rssi_args {__le16 cfg_retry_count;__le16 retry_count;
@@ -4303,6 +4310,15 @@ struct wmi_10_4_peer_stats {__le32 peer_rssi_changed; } __packed; +struct wmi_10_4_peer_extd_stats { +struct wmi_10_4_peer_stats common; +struct wmi_mac_addr peer_macaddr; +__le32 inactive_time; +__le32 peer_chain_rssi; +__le32 rx_duration; +__le32 reserved[10 ]; +} __packed; +struct wmi_10_2_pdev_ext_stats {__le32 rx_rssi_comb;__le32 rx_rssi[4 ];
Signature · 1 line
1.7.9.5
PATCH 1/2 ath10k: Introduce Extended Resource Config support for 10.4
In reply to Mohammed Shafi ShajakhanFrom: Raja Mani <[email protected]>
Add API support for Extended Resource Configuration for 10.4. This is useful to enable new features like Peer Stats, LTEU etc if the firmware advertises support for the service. This is also done to provide backward compatibility with older firmware. Also for clarity send default host platform type as 'WMI_HOST_PLATFORM_HIGH_PERF', though this should not make any difference in functionality
--- drivers/net/wireless/ath/ath10k/wmi-ops.h | 23 ++++++++++++++++++++ drivers/net/wireless/ath/ath10k/wmi.c | 24 +++++++++++++++++++++ drivers/net/wireless/ath/ath10k/wmi.h | 33 ++++++++++++++++++++++++++++- 3 files changed, 79 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath10k/wmi-ops.h +23 -0
@@ -186,6 +186,9 @@ struct wmi_ops {u8 enable, u32 detect_level, u32 detect_margin); +struct sk_buff *(*ext_resource_config)(struct ath10k *ar, +enum wmi_host_platform_type type, +u32 fw_feature_bitmap);int (*get_vdev_subtype)(struct ath10k *ar,enum wmi_vdev_subtype subtype); };
@@ -1330,6 +1333,26 @@ ath10k_wmi_pdev_enable_adaptive_cca(struct ath10k *ar, u8 enable, }static inline int +ath10k_wmi_ext_resource_config (struct ath10k *ar, +enum wmi_host_platform_type type, +u32 fw_feature_bitmap) +{ +struct sk_buff *skb; + +if (!ar->wmi.ops->ext_resource_config) +return -EOPNOTSUPP ; + + skb = ar->wmi.ops->ext_resource_config (ar, type, + fw_feature_bitmap); + +if (IS_ERR (skb)) +return PTR_ERR (skb); + +return ath10k_wmi_cmd_send (ar, skb, + ar->wmi.cmd->ext_resource_cfg_cmdid); +} + +static inline int ath10k_wmi_get_vdev_subtype (struct ath10k *ar,enum wmi_vdev_subtype subtype) {if (!ar->wmi.ops->get_vdev_subtype)
drivers/net/wireless/ath/ath10k/wmi.c +24 -0
@@ -705,6 +705,7 @@ static struct wmi_cmd_map wmi_10_4_cmd_map = { .set_cca_params_cmdid = WMI_10_4_SET_CCA_PARAMS_CMDID, .pdev_bss_chan_info_request_cmdid = WMI_10_4_PDEV_BSS_CHAN_INFO_REQUEST_CMDID, + .ext_resource_cfg_cmdid = WMI_10_4_EXT_RESOURCE_CFG_CMDID, };/* MAIN WMI VDEV param map */
@@ -7509,6 +7510,28 @@ static int ath10k_wmi_10_4_op_get_vdev_subtype(struct ath10k *ar,return -ENOTSUPP ; } +static struct sk_buff * +ath10k_wmi_10_4_ext_resource_config (struct ath10k *ar, +enum wmi_host_platform_type type, +u32 fw_feature_bitmap) +{ +struct wmi_ext_resource_config_10_4_cmd *cmd; +struct sk_buff *skb; + + skb =ath10k_wmi_alloc_skb (ar,sizeof (*cmd)); +if (!skb) +return ERR_PTR (-ENOMEM ); + + cmd = (struct wmi_ext_resource_config_10_4_cmd *)skb->data; + cmd->host_platform_config =__cpu_to_le32 (type); + cmd->fw_feature_bitmap =__cpu_to_le32 (fw_feature_bitmap); + +ath10k_dbg (ar,ATH10K_DBG_WMI , +"host platform type :%d firmware feature bitmap :%08x\n" , + type, fw_feature_bitmap); +return skb; +} +static const struct wmi_ops wmi_ops = { .rx = ath10k_wmi_op_rx, .map_svc = wmi_main_svc_map,
@@ -7835,6 +7858,7 @@ static const struct wmi_ops wmi_10_4_ops = { .gen_addba_set_resp = ath10k_wmi_op_gen_addba_set_resp, .gen_delba_send = ath10k_wmi_op_gen_delba_send, .fw_stats_fill = ath10k_wmi_10_4_op_fw_stats_fill, + .ext_resource_config = ath10k_wmi_10_4_ext_resource_config,/* shared with 10.2 */ .gen_request_stats = ath10k_wmi_op_gen_request_stats,
drivers/net/wireless/ath/ath10k/wmi.h +32 -1
@@ -816,6 +816,7 @@ struct wmi_cmd_map {u32 set_cca_params_cmdid;u32 pdev_bss_chan_info_request_cmdid;u32 pdev_enable_adaptive_cca_cmdid; +u32 ext_resource_cfg_cmdid; };/*
@@ -2665,7 +2666,32 @@ struct wmi_resource_config_10_4 {* 0 - This is not qwrap */ __le32 qwrap_config; -} __packed; +}__packed + +/** +* enum wmi_10_4_feature_mask - WMI 10.4 feature enable/disable flags +* @WMI_10_4_LTEU_SUPPORT: LTEU config +* @WMI_10_4_COEX_GPIO_SUPPORT: COEX GPIO config +* @WMI_10_4_AUX_RADIO_SPECTRAL_INTF: AUX Radio Enhancement for spectral scan +* @WMI_10_4_AUX_RADIO_CHAN_LOAD_INTF: AUX Radio Enhancement for chan load scan +* @WMI_10_4_BSS_CHANNEL_INFO_64: BSS channel info stats +* @WMI_10_4_PEER_STATS: Per station stats +*/ +enum wmi_10_4_feature_mask { +WMI_10_4_LTEU_SUPPORT =BIT (0 ), +WMI_10_4_COEX_GPIO_SUPPORT =BIT (1 ), +WMI_10_4_AUX_RADIO_SPECTRAL_INTF =BIT (2 ), +WMI_10_4_AUX_RADIO_CHAN_LOAD_INTF =BIT (3 ), +WMI_10_4_BSS_CHANNEL_INFO_64 =BIT (4 ), + WMI_10_4_PEER_STATS = BIT(5), +}; + +struct wmi_ext_resource_config_10_4_cmd { +/* contains enum wmi_host_platform_type */ +__le32 host_platform_config; +/* see enum wmi_10_4_feature_mask */ +__le32 fw_feature_bitmap; +};/* strucutre describing host memory chunk. */ struct host_memory_chunk {
@@ -6408,6 +6434,11 @@ struct wmi_pdev_set_adaptive_cca_params {__le32 cca_detect_margin; } __packed; +enum wmi_host_platform_type { +WMI_HOST_PLATFORM_HIGH_PERF , +WMI_HOST_PLATFORM_LOW_PERF , +}; +struct ath10k ;struct ath10k_vif ;struct ath10k_fw_stats_pdev ;
Signature · 1 line
1.7.9.5
Re: [PATCH 1/2] ath10k: Introduce Extended Resource Config support for 10.4
Quoted 11 lines · Mohammed Shafi Shajakhan
From: Raja Mani <[email protected]>
Add API support for Extended Resource Configuration for 10.4. This is useful to enable new features like Peer Stats, LTEU etc if the firmware advertises support for the service. This is also done to provide backward compatibility with older firmware. Also for clarity send default host platform type as '
WMI_HOST_PLATFORM_HIGH_PERF', though this should not make any difference in functionalitySigned-off-by Raja Mani <[email protected]>Signed-off-by Mohammed Shafi Shajakhan <[email protected]>
[...]
drivers/net/wireless/ath/ath10k/wmi.h struct wmi_resource_config_10_4 { · line 2669
Quoted 6 lines
drivers/net/wireless/ath/ath10k/wmi.h +1
-1@@ -2665,7 +2666,32 @@ struct wmi_resource_config_10_4 {* 0 - This is not qwrap */ __le32 qwrap_config; -} __packed; +} __packed
This doesn't compile:
In file included from drivers/net/wireless/ath/ath10k/core.h:32:0,
from drivers/net/wireless/ath/ath10k/htt.c:22:
drivers/net/wireless/ath/ath10k/wmi.h:2680:1: error: expected ';',
identifier or '(' before 'enum'
make[1]: *** [drivers/net/wireless/ath/ath10k/htt.o] Error 1 In file included from drivers/net/wireless/ath/ath10k/core.h:32:0,
from drivers/net/wireless/ath/ath10k/debug.c:25:drivers/net/wireless/ath/ath10k/wmi.h:2680:1: error: expected ';',
identifier or '(' before 'enum'
Signature · 1 line
Kalle Valo
Re: [PATCH 2/2] ath10k: Enable parsing per station rx duration for 10.4
In reply to Mohammed Shafi ShajakhanQuoted 7 lines · Mohammed Shafi Shajakhan
From: Mohammed Shafi Shajakhan <[email protected]>
Rx duration support for per station is part of extended peer stats, enable provision to parse the same and provide backward compatibility based on the '
stats_id' eventSigned-off-by Mohammed Shafi Shajakhan <[email protected]>
After fixing patch 1 this doesn't compile either. Please fix and resend both patches.
drivers/net/wireless/ath/ath10k/core.c: In function 'ath10k_core_start':drivers/net/wireless/ath/ath10k/core.c:1787:3: error: implicit declaration of function 'ath10k_peer_stats_enabled' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
Signature · 1 line
Kalle Valo
Re: [PATCH 1/2] ath10k: Introduce Extended Resource Config support for 10.4
In reply to Valo, KalleHi Kalle,
Quoted 16 lines · Kalle
Quoted 11 lines · Mohammed Shafi Shajakhan
From: Raja Mani <[email protected]>
Add API support for Extended Resource Configuration for 10.4. This is useful to enable new features like Peer Stats, LTEU etc if the firmware advertises support for the service. This is also done to provide backward compatibility with older firmware. Also for clarity send default host platform type as '
WMI_HOST_PLATFORM_HIGH_PERF', though this should not make any difference in functionalitySigned-off-by Raja Mani <[email protected]>Signed-off-by Mohammed Shafi Shajakhan <[email protected]>[...]
Quoted 8 lines
drivers/net/wireless/ath/ath10k/wmi.h struct wmi_resource_config_10_4 { · line 2669
Quoted 6 lines
drivers/net/wireless/ath/ath10k/wmi.h +1
-1@@ -2665,7 +2666,32 @@ struct wmi_resource_config_10_4 {* 0 - This is not qwrap */ __le32 qwrap_config; -} __packed; +} __packedThis doesn't compile:
[shafi] Very sorry, made that error while rebasing one of the review comments :-( Will avoid this in future, once again apologies
Quoted 10 lines
In file included from
drivers/net/wireless/ath/ath10k/core.h:32:0,from drivers/net/wireless/ath/ath10k/htt.c:22:
drivers/net/wireless/ath/ath10k/wmi.h:2680:1: error: expected ';',
identifier or '(' before 'enum'
make[1]: *** [drivers/net/wireless/ath/ath10k/htt.o] Error 1 In file included fromdrivers/net/wireless/ath/ath10k/core.h:32:0,
fromdrivers/net/wireless/ath/ath10k/debug.c:25:drivers/net/wireless/ath/ath10k/wmi.h:2680:1: error: expected ';',
identifier or '(' before 'enum'
thanks,
shafi
Quoted 1 line
Re: [PATCH 2/2] ath10k: Enable parsing per station rx duration for 10.4
In reply to Valo, KalleQuoted 4 lines · Kalle
Quoted 2 lines · Mohammed Shafi Shajakhan
From: Mohammed Shafi Shajakhan <[email protected]>
Quoted 8 lines
Quoted 5 lines
Rx duration support for per station is part of extended peer stats, enable provision to parse the same and provide backward compatibility based on the '
stats_id' eventSigned-off-by Mohammed Shafi Shajakhan <[email protected]>After fixing patch 1 this doesn't compile either. Please fix and resend both patches.
[shafi] sure, sorry for wasting your time, i think this dependent on the patch "[PATCH v5] ath10k: Enable debugfs provision to enable Peer Stats
feature" anyway i will resend them , with compile testing
Quoted 9 lines
drivers/net/wireless/ath/ath10k/core.c: In function 'ath10k_core_start':drivers/net/wireless/ath/ath10k/core.c:1787:3: error: implicit declaration of function 'ath10k_peer_stats_enabled' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errorsSignature · 1 line
Kalle Valo