From d547ca4c8cc5638669b9942ad7284ebf7106f708 Mon Sep 17 00:00:00 2001 From: Anilkumar Kolli Date: Tue, 16 Jun 2020 17:00:47 +0300 Subject: ath11k: add hw_ops for pdev id to hw_mac mapping pdev_id to hw_mac is different for ipq8074 and ipq6018 Below table has the mapping pdev_id ipq8074 ipq6018 ------- ------- ------- 0 0 0 1 2 1 2 1 Not applicable No functional changes. Compile tested only. Signed-off-by: Anilkumar Kolli Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1592316055-24958-5-git-send-email-kvalo@codeaurora.org --- drivers/net/wireless/ath/ath11k/hw.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'drivers/net/wireless/ath/ath11k/hw.h') diff --git a/drivers/net/wireless/ath/ath11k/hw.h b/drivers/net/wireless/ath/ath11k/hw.h index ba897d186cf5..2fb986b9a6cb 100644 --- a/drivers/net/wireless/ath/ath11k/hw.h +++ b/drivers/net/wireless/ath/ath11k/hw.h @@ -104,6 +104,10 @@ enum ath11k_bus { ATH11K_BUS_PCI, }; +struct ath11k_hw_ops { + u8 (*get_hw_mac_from_pdev_id)(int pdev_id); +}; + struct ath11k_hw_params { const char *name; u16 hw_rev; @@ -113,8 +117,23 @@ struct ath11k_hw_params { size_t board_size; size_t cal_size; } fw; + + const struct ath11k_hw_ops *hw_ops; }; +extern const struct ath11k_hw_ops ipq8074_ops; +extern const struct ath11k_hw_ops ipq6018_ops; + +static inline +int ath11k_hw_get_mac_from_pdev_id(struct ath11k_hw_params *hw, + int pdev_idx) +{ + if (hw->hw_ops->get_hw_mac_from_pdev_id) + return hw->hw_ops->get_hw_mac_from_pdev_id(pdev_idx); + + return 0; +} + struct ath11k_fw_ie { __le32 id; __le32 len; -- cgit v1.2.3