aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaja Mani <rmani@qti.qualcomm.com>2016-03-16 08:43:33 -0400
committerKalle Valo <kvalo@qca.qualcomm.com>2016-04-04 09:34:02 -0400
commit47771902a9beb23859805721f1d98d03dee5da7c (patch)
treea2d8f1e1290758c7e9032d3e747d725c0f372e83
parentcc61a1bbbc0ebbda3cc155bcbe164f4609fd62f6 (diff)
ath10k: introduce Extended Resource Config support for 10.4
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 Signed-off-by: Raja Mani <rmani@qti.qualcomm.com> Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
-rw-r--r--drivers/net/wireless/ath/ath10k/wmi-ops.h23
-rw-r--r--drivers/net/wireless/ath/ath10k/wmi.c24
-rw-r--r--drivers/net/wireless/ath/ath10k/wmi.h31
3 files changed, 78 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath10k/wmi-ops.h b/drivers/net/wireless/ath/ath10k/wmi-ops.h
index 32ab34edceb5..7fb00dcc03b8 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-ops.h
+++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h
@@ -186,6 +186,9 @@ struct wmi_ops {
186 u8 enable, 186 u8 enable,
187 u32 detect_level, 187 u32 detect_level,
188 u32 detect_margin); 188 u32 detect_margin);
189 struct sk_buff *(*ext_resource_config)(struct ath10k *ar,
190 enum wmi_host_platform_type type,
191 u32 fw_feature_bitmap);
189 int (*get_vdev_subtype)(struct ath10k *ar, 192 int (*get_vdev_subtype)(struct ath10k *ar,
190 enum wmi_vdev_subtype subtype); 193 enum wmi_vdev_subtype subtype);
191}; 194};
@@ -1330,6 +1333,26 @@ ath10k_wmi_pdev_enable_adaptive_cca(struct ath10k *ar, u8 enable,
1330} 1333}
1331 1334
1332static inline int 1335static inline int
1336ath10k_wmi_ext_resource_config(struct ath10k *ar,
1337 enum wmi_host_platform_type type,
1338 u32 fw_feature_bitmap)
1339{
1340 struct sk_buff *skb;
1341
1342 if (!ar->wmi.ops->ext_resource_config)
1343 return -EOPNOTSUPP;
1344
1345 skb = ar->wmi.ops->ext_resource_config(ar, type,
1346 fw_feature_bitmap);
1347
1348 if (IS_ERR(skb))
1349 return PTR_ERR(skb);
1350
1351 return ath10k_wmi_cmd_send(ar, skb,
1352 ar->wmi.cmd->ext_resource_cfg_cmdid);
1353}
1354
1355static inline int
1333ath10k_wmi_get_vdev_subtype(struct ath10k *ar, enum wmi_vdev_subtype subtype) 1356ath10k_wmi_get_vdev_subtype(struct ath10k *ar, enum wmi_vdev_subtype subtype)
1334{ 1357{
1335 if (!ar->wmi.ops->get_vdev_subtype) 1358 if (!ar->wmi.ops->get_vdev_subtype)
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index afed9dab74f4..3af1af74e84d 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -705,6 +705,7 @@ static struct wmi_cmd_map wmi_10_4_cmd_map = {
705 .set_cca_params_cmdid = WMI_10_4_SET_CCA_PARAMS_CMDID, 705 .set_cca_params_cmdid = WMI_10_4_SET_CCA_PARAMS_CMDID,
706 .pdev_bss_chan_info_request_cmdid = 706 .pdev_bss_chan_info_request_cmdid =
707 WMI_10_4_PDEV_BSS_CHAN_INFO_REQUEST_CMDID, 707 WMI_10_4_PDEV_BSS_CHAN_INFO_REQUEST_CMDID,
708 .ext_resource_cfg_cmdid = WMI_10_4_EXT_RESOURCE_CFG_CMDID,
708}; 709};
709 710
710/* MAIN WMI VDEV param map */ 711/* MAIN WMI VDEV param map */
@@ -7479,6 +7480,28 @@ static int ath10k_wmi_10_4_op_get_vdev_subtype(struct ath10k *ar,
7479 return -ENOTSUPP; 7480 return -ENOTSUPP;
7480} 7481}
7481 7482
7483static struct sk_buff *
7484ath10k_wmi_10_4_ext_resource_config(struct ath10k *ar,
7485 enum wmi_host_platform_type type,
7486 u32 fw_feature_bitmap)
7487{
7488 struct wmi_ext_resource_config_10_4_cmd *cmd;
7489 struct sk_buff *skb;
7490
7491 skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd));
7492 if (!skb)
7493 return ERR_PTR(-ENOMEM);
7494
7495 cmd = (struct wmi_ext_resource_config_10_4_cmd *)skb->data;
7496 cmd->host_platform_config = __cpu_to_le32(type);
7497 cmd->fw_feature_bitmap = __cpu_to_le32(fw_feature_bitmap);
7498
7499 ath10k_dbg(ar, ATH10K_DBG_WMI,
7500 "wmi ext resource config host type %d firmware feature bitmap %08x\n",
7501 type, fw_feature_bitmap);
7502 return skb;
7503}
7504
7482static const struct wmi_ops wmi_ops = { 7505static const struct wmi_ops wmi_ops = {
7483 .rx = ath10k_wmi_op_rx, 7506 .rx = ath10k_wmi_op_rx,
7484 .map_svc = wmi_main_svc_map, 7507 .map_svc = wmi_main_svc_map,
@@ -7805,6 +7828,7 @@ static const struct wmi_ops wmi_10_4_ops = {
7805 .gen_addba_set_resp = ath10k_wmi_op_gen_addba_set_resp, 7828 .gen_addba_set_resp = ath10k_wmi_op_gen_addba_set_resp,
7806 .gen_delba_send = ath10k_wmi_op_gen_delba_send, 7829 .gen_delba_send = ath10k_wmi_op_gen_delba_send,
7807 .fw_stats_fill = ath10k_wmi_10_4_op_fw_stats_fill, 7830 .fw_stats_fill = ath10k_wmi_10_4_op_fw_stats_fill,
7831 .ext_resource_config = ath10k_wmi_10_4_ext_resource_config,
7808 7832
7809 /* shared with 10.2 */ 7833 /* shared with 10.2 */
7810 .gen_request_stats = ath10k_wmi_op_gen_request_stats, 7834 .gen_request_stats = ath10k_wmi_op_gen_request_stats,
diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
index bb42f7a6ba23..bd29f271524d 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -816,6 +816,7 @@ struct wmi_cmd_map {
816 u32 set_cca_params_cmdid; 816 u32 set_cca_params_cmdid;
817 u32 pdev_bss_chan_info_request_cmdid; 817 u32 pdev_bss_chan_info_request_cmdid;
818 u32 pdev_enable_adaptive_cca_cmdid; 818 u32 pdev_enable_adaptive_cca_cmdid;
819 u32 ext_resource_cfg_cmdid;
819}; 820};
820 821
821/* 822/*
@@ -2667,6 +2668,31 @@ struct wmi_resource_config_10_4 {
2667 __le32 qwrap_config; 2668 __le32 qwrap_config;
2668} __packed; 2669} __packed;
2669 2670
2671/**
2672 * enum wmi_10_4_feature_mask - WMI 10.4 feature enable/disable flags
2673 * @WMI_10_4_LTEU_SUPPORT: LTEU config
2674 * @WMI_10_4_COEX_GPIO_SUPPORT: COEX GPIO config
2675 * @WMI_10_4_AUX_RADIO_SPECTRAL_INTF: AUX Radio Enhancement for spectral scan
2676 * @WMI_10_4_AUX_RADIO_CHAN_LOAD_INTF: AUX Radio Enhancement for chan load scan
2677 * @WMI_10_4_BSS_CHANNEL_INFO_64: BSS channel info stats
2678 * @WMI_10_4_PEER_STATS: Per station stats
2679 */
2680enum wmi_10_4_feature_mask {
2681 WMI_10_4_LTEU_SUPPORT = BIT(0),
2682 WMI_10_4_COEX_GPIO_SUPPORT = BIT(1),
2683 WMI_10_4_AUX_RADIO_SPECTRAL_INTF = BIT(2),
2684 WMI_10_4_AUX_RADIO_CHAN_LOAD_INTF = BIT(3),
2685 WMI_10_4_BSS_CHANNEL_INFO_64 = BIT(4),
2686 WMI_10_4_PEER_STATS = BIT(5),
2687};
2688
2689struct wmi_ext_resource_config_10_4_cmd {
2690 /* contains enum wmi_host_platform_type */
2691 __le32 host_platform_config;
2692 /* see enum wmi_10_4_feature_mask */
2693 __le32 fw_feature_bitmap;
2694};
2695
2670/* strucutre describing host memory chunk. */ 2696/* strucutre describing host memory chunk. */
2671struct host_memory_chunk { 2697struct host_memory_chunk {
2672 /* id of the request that is passed up in service ready */ 2698 /* id of the request that is passed up in service ready */
@@ -6408,6 +6434,11 @@ struct wmi_pdev_set_adaptive_cca_params {
6408 __le32 cca_detect_margin; 6434 __le32 cca_detect_margin;
6409} __packed; 6435} __packed;
6410 6436
6437enum wmi_host_platform_type {
6438 WMI_HOST_PLATFORM_HIGH_PERF,
6439 WMI_HOST_PLATFORM_LOW_PERF,
6440};
6441
6411struct ath10k; 6442struct ath10k;
6412struct ath10k_vif; 6443struct ath10k_vif;
6413struct ath10k_fw_stats_pdev; 6444struct ath10k_fw_stats_pdev;