Commit 140d1214 authored by Rakesh Pillai's avatar Rakesh Pillai Committed by Kalle Valo

ath10k: add support to get target info from hif ops

wcn3990 does not use bmi.
Add support to get target info from hif ops.
Signed-off-by: default avatarRakesh Pillai <pillair@codeaurora.org>
Signed-off-by: default avatarGovind Singh <govinds@codeaurora.org>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 546d407c
...@@ -2472,6 +2472,14 @@ static int ath10k_core_probe_fw(struct ath10k *ar) ...@@ -2472,6 +2472,14 @@ static int ath10k_core_probe_fw(struct ath10k *ar)
ar->hw->wiphy->hw_version = target_info.version; ar->hw->wiphy->hw_version = target_info.version;
break; break;
case ATH10K_BUS_SNOC: 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; break;
default: default:
ath10k_err(ar, "incorrect hif bus type: %d\n", ar->hif.bus); ath10k_err(ar, "incorrect hif bus type: %d\n", ar->hif.bus);
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include "core.h" #include "core.h"
#include "bmi.h"
#include "debug.h" #include "debug.h"
struct ath10k_hif_sg_item { struct ath10k_hif_sg_item {
...@@ -93,6 +94,9 @@ struct ath10k_hif_ops { ...@@ -93,6 +94,9 @@ struct ath10k_hif_ops {
/* fetch calibration data from target eeprom */ /* fetch calibration data from target eeprom */
int (*fetch_cal_eeprom)(struct ath10k *ar, void **data, int (*fetch_cal_eeprom)(struct ath10k *ar, void **data,
size_t *data_len); 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, 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, ...@@ -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); 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_ */ #endif /* _HIF_H_ */
...@@ -528,6 +528,15 @@ static int ath10k_snoc_hif_tx_sg(struct ath10k *ar, u8 pipe_id, ...@@ -528,6 +528,15 @@ static int ath10k_snoc_hif_tx_sg(struct ath10k *ar, u8 pipe_id,
return err; 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) static u16 ath10k_snoc_hif_get_free_queue_number(struct ath10k *ar, u8 pipe)
{ {
struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar);
...@@ -787,6 +796,7 @@ static const struct ath10k_hif_ops ath10k_snoc_hif_ops = { ...@@ -787,6 +796,7 @@ static const struct ath10k_hif_ops ath10k_snoc_hif_ops = {
.tx_sg = ath10k_snoc_hif_tx_sg, .tx_sg = ath10k_snoc_hif_tx_sg,
.send_complete_check = ath10k_snoc_hif_send_complete_check, .send_complete_check = ath10k_snoc_hif_send_complete_check,
.get_free_queue_number = ath10k_snoc_hif_get_free_queue_number, .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 = { static const struct ath10k_bus_ops ath10k_snoc_bus_ops = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment