All of lore.kernel.org
 help / color / mirror / Atom feed
From: Govind Singh <govinds@codeaurora.org>
To: ath10k@lists.infradead.org
Cc: Rakesh Pillai <pillair@codeaurora.org>,
	Govind Singh <govinds@codeaurora.org>,
	linux-wireless@vger.kernel.org
Subject: [PATCH v2 10/13] ath10k: Add support to get target info from hif ops
Date: Fri, 23 Mar 2018 10:33:41 +0530	[thread overview]
Message-ID: <1521781424-24972-11-git-send-email-govinds@codeaurora.org> (raw)
In-Reply-To: <1521781424-24972-1-git-send-email-govinds@codeaurora.org>

From: Rakesh Pillai <pillair@codeaurora.org>

wcn3990 does not use bmi.
Add support to get target info from hif ops.

Signed-off-by: Rakesh Pillai <pillair@codeaurora.org>
Signed-off-by: Govind Singh <govinds@codeaurora.org>
---
 drivers/net/wireless/ath/ath10k/core.c |  8 ++++++++
 drivers/net/wireless/ath/ath10k/hif.h  | 13 +++++++++++++
 drivers/net/wireless/ath/ath10k/snoc.c | 10 ++++++++++
 3 files changed, 31 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 830b7fe..61443f5 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -2468,6 +2468,14 @@ static int ath10k_core_probe_fw(struct ath10k *ar)
 		ar->hw->wiphy->hw_version = target_info.version;
 		break;
 	case ATH10K_BUS_SNOC:
+		memset(&target_info, 0, sizeof(target_info));
+		ret = ath10k_hif_get_target_info(ar, &target_info);
+		if (ret) {
+			ath10k_err(ar, "could not get target info (%d)\n", ret);
+			goto err_power_down;
+		}
+		ar->target_version = target_info.version;
+		ar->hw->wiphy->hw_version = target_info.version;
 		break;
 	default:
 		ath10k_err(ar, "incorrect hif bus type: %d\n", ar->hif.bus);
diff --git a/drivers/net/wireless/ath/ath10k/hif.h b/drivers/net/wireless/ath/ath10k/hif.h
index 7abb13c..1a59ea0 100644
--- a/drivers/net/wireless/ath/ath10k/hif.h
+++ b/drivers/net/wireless/ath/ath10k/hif.h
@@ -20,6 +20,7 @@
 
 #include <linux/kernel.h>
 #include "core.h"
+#include "bmi.h"
 #include "debug.h"
 
 struct ath10k_hif_sg_item {
@@ -93,6 +94,9 @@ struct ath10k_hif_ops {
 	/* fetch calibration data from target eeprom */
 	int (*fetch_cal_eeprom)(struct ath10k *ar, void **data,
 				size_t *data_len);
+
+	int (*get_target_info)(struct ath10k *ar,
+			       struct bmi_target_info *target_info);
 };
 
 static inline int ath10k_hif_tx_sg(struct ath10k *ar, u8 pipe_id,
@@ -218,4 +222,13 @@ static inline int ath10k_hif_fetch_cal_eeprom(struct ath10k *ar,
 	return ar->hif.ops->fetch_cal_eeprom(ar, data, data_len);
 }
 
+static inline int ath10k_hif_get_target_info(struct ath10k *ar,
+					     struct bmi_target_info *tgt_info)
+{
+	if (!ar->hif.ops->get_target_info)
+		return -EOPNOTSUPP;
+
+	return ar->hif.ops->get_target_info(ar, tgt_info);
+}
+
 #endif /* _HIF_H_ */
diff --git a/drivers/net/wireless/ath/ath10k/snoc.c b/drivers/net/wireless/ath/ath10k/snoc.c
index 6d9ccce..1ef0d3b 100644
--- a/drivers/net/wireless/ath/ath10k/snoc.c
+++ b/drivers/net/wireless/ath/ath10k/snoc.c
@@ -528,6 +528,15 @@ static int ath10k_snoc_hif_tx_sg(struct ath10k *ar, u8 pipe_id,
 	return err;
 }
 
+static int ath10k_snoc_hif_get_target_info(struct ath10k *ar,
+					   struct bmi_target_info *target_info)
+{
+	target_info->version = ATH10K_HW_WCN3990;
+	target_info->type = ATH10K_HW_WCN3990;
+
+	return 0;
+}
+
 static u16 ath10k_snoc_hif_get_free_queue_number(struct ath10k *ar, u8 pipe)
 {
 	struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar);
@@ -787,6 +796,7 @@ static int ath10k_snoc_hif_power_up(struct ath10k *ar)
 	.tx_sg			= ath10k_snoc_hif_tx_sg,
 	.send_complete_check	= ath10k_snoc_hif_send_complete_check,
 	.get_free_queue_number	= ath10k_snoc_hif_get_free_queue_number,
+	.get_target_info	= ath10k_snoc_hif_get_target_info,
 };
 
 static const struct ath10k_bus_ops ath10k_snoc_bus_ops = {
-- 
1.9.1


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

WARNING: multiple messages have this Message-ID (diff)
From: Govind Singh <govinds@codeaurora.org>
To: ath10k@lists.infradead.org
Cc: linux-wireless@vger.kernel.org,
	Rakesh Pillai <pillair@codeaurora.org>,
	Govind Singh <govinds@codeaurora.org>
Subject: [PATCH v2 10/13] ath10k: Add support to get target info from hif ops
Date: Fri, 23 Mar 2018 10:33:41 +0530	[thread overview]
Message-ID: <1521781424-24972-11-git-send-email-govinds@codeaurora.org> (raw)
In-Reply-To: <1521781424-24972-1-git-send-email-govinds@codeaurora.org>

From: Rakesh Pillai <pillair@codeaurora.org>

wcn3990 does not use bmi.
Add support to get target info from hif ops.

Signed-off-by: Rakesh Pillai <pillair@codeaurora.org>
Signed-off-by: Govind Singh <govinds@codeaurora.org>
---
 drivers/net/wireless/ath/ath10k/core.c |  8 ++++++++
 drivers/net/wireless/ath/ath10k/hif.h  | 13 +++++++++++++
 drivers/net/wireless/ath/ath10k/snoc.c | 10 ++++++++++
 3 files changed, 31 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 830b7fe..61443f5 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -2468,6 +2468,14 @@ static int ath10k_core_probe_fw(struct ath10k *ar)
 		ar->hw->wiphy->hw_version = target_info.version;
 		break;
 	case ATH10K_BUS_SNOC:
+		memset(&target_info, 0, sizeof(target_info));
+		ret = ath10k_hif_get_target_info(ar, &target_info);
+		if (ret) {
+			ath10k_err(ar, "could not get target info (%d)\n", ret);
+			goto err_power_down;
+		}
+		ar->target_version = target_info.version;
+		ar->hw->wiphy->hw_version = target_info.version;
 		break;
 	default:
 		ath10k_err(ar, "incorrect hif bus type: %d\n", ar->hif.bus);
diff --git a/drivers/net/wireless/ath/ath10k/hif.h b/drivers/net/wireless/ath/ath10k/hif.h
index 7abb13c..1a59ea0 100644
--- a/drivers/net/wireless/ath/ath10k/hif.h
+++ b/drivers/net/wireless/ath/ath10k/hif.h
@@ -20,6 +20,7 @@
 
 #include <linux/kernel.h>
 #include "core.h"
+#include "bmi.h"
 #include "debug.h"
 
 struct ath10k_hif_sg_item {
@@ -93,6 +94,9 @@ struct ath10k_hif_ops {
 	/* fetch calibration data from target eeprom */
 	int (*fetch_cal_eeprom)(struct ath10k *ar, void **data,
 				size_t *data_len);
+
+	int (*get_target_info)(struct ath10k *ar,
+			       struct bmi_target_info *target_info);
 };
 
 static inline int ath10k_hif_tx_sg(struct ath10k *ar, u8 pipe_id,
@@ -218,4 +222,13 @@ static inline int ath10k_hif_fetch_cal_eeprom(struct ath10k *ar,
 	return ar->hif.ops->fetch_cal_eeprom(ar, data, data_len);
 }
 
+static inline int ath10k_hif_get_target_info(struct ath10k *ar,
+					     struct bmi_target_info *tgt_info)
+{
+	if (!ar->hif.ops->get_target_info)
+		return -EOPNOTSUPP;
+
+	return ar->hif.ops->get_target_info(ar, tgt_info);
+}
+
 #endif /* _HIF_H_ */
diff --git a/drivers/net/wireless/ath/ath10k/snoc.c b/drivers/net/wireless/ath/ath10k/snoc.c
index 6d9ccce..1ef0d3b 100644
--- a/drivers/net/wireless/ath/ath10k/snoc.c
+++ b/drivers/net/wireless/ath/ath10k/snoc.c
@@ -528,6 +528,15 @@ static int ath10k_snoc_hif_tx_sg(struct ath10k *ar, u8 pipe_id,
 	return err;
 }
 
+static int ath10k_snoc_hif_get_target_info(struct ath10k *ar,
+					   struct bmi_target_info *target_info)
+{
+	target_info->version = ATH10K_HW_WCN3990;
+	target_info->type = ATH10K_HW_WCN3990;
+
+	return 0;
+}
+
 static u16 ath10k_snoc_hif_get_free_queue_number(struct ath10k *ar, u8 pipe)
 {
 	struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar);
@@ -787,6 +796,7 @@ static int ath10k_snoc_hif_power_up(struct ath10k *ar)
 	.tx_sg			= ath10k_snoc_hif_tx_sg,
 	.send_complete_check	= ath10k_snoc_hif_send_complete_check,
 	.get_free_queue_number	= ath10k_snoc_hif_get_free_queue_number,
+	.get_target_info	= ath10k_snoc_hif_get_target_info,
 };
 
 static const struct ath10k_bus_ops ath10k_snoc_bus_ops = {
-- 
1.9.1

  parent reply	other threads:[~2018-03-23  5:04 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-23  5:03 [PATCH v2 00/13] ***Set4: Add support of WCN3990 bus layer support *** Govind Singh
2018-03-23  5:03 ` Govind Singh
2018-03-23  5:03 ` [PATCH v2 01/13] ath10k: platform driver for WCN3990 SNOC WLAN module Govind Singh
2018-03-23  5:03   ` Govind Singh
2018-04-19 15:55   ` [v2,01/13] " Kalle Valo
2018-04-19 15:55   ` Kalle Valo
2018-03-23  5:03 ` [PATCH v2 02/13] ath10k: add resource init and deinit for WCN3990 Govind Singh
2018-03-23  5:03   ` Govind Singh
2018-03-23  5:03 ` [PATCH v2 03/13] ath10k: Add hif start/stop methods for wcn3990 snoc layer Govind Singh
2018-03-23  5:03   ` Govind Singh
2018-03-23  5:03 ` [PATCH v2 04/13] ath10k: Add HTC services for WCN3990 Govind Singh
2018-03-23  5:03   ` Govind Singh
2018-03-23  5:03 ` [PATCH v2 05/13] ath10k: Map HTC services to tx/rx pipes for wcn3990 Govind Singh
2018-03-23  5:03   ` Govind Singh
2018-03-23  5:03 ` [PATCH v2 06/13] ath10k: Add hif power-up/power-down methods Govind Singh
2018-03-23  5:03   ` Govind Singh
2018-03-23  5:03 ` [PATCH v2 07/13] ath10k: Add hif tx methods for wcn3990 Govind Singh
2018-03-23  5:03   ` Govind Singh
2018-03-23  5:03 ` [PATCH v2 08/13] ath10k: Add hif rx " Govind Singh
2018-03-23  5:03   ` Govind Singh
2018-03-23  5:03 ` [PATCH v2 09/13] ath10k: Modify hif tx paddr to dma_addr_t type Govind Singh
2018-03-23  5:03   ` Govind Singh
2018-03-23  5:03 ` Govind Singh [this message]
2018-03-23  5:03   ` [PATCH v2 10/13] ath10k: Add support to get target info from hif ops Govind Singh
2018-03-23  5:03 ` [PATCH v2 11/13] ath10k: Check all CE for data if irq summary is not retained Govind Singh
2018-03-23  5:03   ` Govind Singh
2018-03-23  5:03 ` [PATCH v2 12/13] ath10k: Vote for hardware resources for WCN3990 Govind Singh
2018-03-23  5:03   ` Govind Singh
2018-03-23  5:03 ` [PATCH v2 13/13] dt: bindings: add bindings for wcn3990 wifi block Govind Singh
2018-03-23  5:03   ` Govind Singh
2018-04-10 14:25   ` [v2,13/13] " Kalle Valo
2018-04-10 14:25   ` Kalle Valo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1521781424-24972-11-git-send-email-govinds@codeaurora.org \
    --to=govinds@codeaurora.org \
    --cc=ath10k@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=pillair@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.