summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/ath11k/hw.c
diff options
context:
space:
mode:
authorAnilkumar Kolli <akolli@codeaurora.org>2020-06-16 17:00:47 +0300
committerKalle Valo <kvalo@codeaurora.org>2020-06-23 10:51:42 +0300
commitd547ca4c8cc5638669b9942ad7284ebf7106f708 (patch)
tree8ac5670aeb61709a1f6ee68beb9acaa70ba90a2e /drivers/net/wireless/ath/ath11k/hw.c
parentb1cc29e97d1b96dfd3a7437083f7ba4aa5f32b88 (diff)
downloadlinux-d547ca4c8cc5638669b9942ad7284ebf7106f708.tar.xz
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 <akolli@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/1592316055-24958-5-git-send-email-kvalo@codeaurora.org
Diffstat (limited to 'drivers/net/wireless/ath/ath11k/hw.c')
-rw-r--r--drivers/net/wireless/ath/ath11k/hw.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath11k/hw.c b/drivers/net/wireless/ath/ath11k/hw.c
new file mode 100644
index 000000000000..7cc5f36509c0
--- /dev/null
+++ b/drivers/net/wireless/ath/ath11k/hw.c
@@ -0,0 +1,34 @@
+// SPDX-License-Identifier: BSD-3-Clause-Clear
+/*
+ * Copyright (c) 2018-2020 The Linux Foundation. All rights reserved.
+ */
+
+#include "core.h"
+
+/* Map from pdev index to hw mac index */
+static u8 ath11k_hw_ipq8074_mac_from_pdev_id(int pdev_idx)
+{
+ switch (pdev_idx) {
+ case 0:
+ return 0;
+ case 1:
+ return 2;
+ case 2:
+ return 1;
+ default:
+ return ATH11K_INVALID_HW_MAC_ID;
+ }
+}
+
+static u8 ath11k_hw_ipq6018_mac_from_pdev_id(int pdev_idx)
+{
+ return pdev_idx;
+}
+
+const struct ath11k_hw_ops ipq8074_ops = {
+ .get_hw_mac_from_pdev_id = ath11k_hw_ipq8074_mac_from_pdev_id,
+};
+
+const struct ath11k_hw_ops ipq6018_ops = {
+ .get_hw_mac_from_pdev_id = ath11k_hw_ipq6018_mac_from_pdev_id,
+};