summaryrefslogtreecommitdiff
path: root/package/kernel/mac80211/patches/937-ath10k-calibration-variant.patch
diff options
context:
space:
mode:
authorChristian Lamparter <chunkeey@gmail.com>2018-03-01 17:23:22 +0100
committerMathias Kresin <dev@kresin.me>2018-03-14 19:04:51 +0100
commite713b5ba6f28617e1db06fdaec6464d1ad7be4b4 (patch)
treeb7bde2346a36c32bd0614b172d69b3488e6a335c /package/kernel/mac80211/patches/937-ath10k-calibration-variant.patch
parent249a9b35e0937150e7557931bcdca8b95a6e274d (diff)
downloadmtk-20170518-e713b5ba6f28617e1db06fdaec6464d1ad7be4b4.zip
mtk-20170518-e713b5ba6f28617e1db06fdaec6464d1ad7be4b4.tar.gz
mtk-20170518-e713b5ba6f28617e1db06fdaec6464d1ad7be4b4.tar.bz2
mac80211: ath10k: search all IEs for variant before falling back
This patch adds the patch that was posted to ath10k-devel ML: <https://patchwork.kernel.org/patch/10233491/> |From: Thomas Hebb <tommyhebb@gmail.com> |Subject: [PATCH] ath10k: search all IEs for variant before falling back |Date: Wed, 21 Feb 2018 11:43:39 -0500 |[...] |This patch fixes the issue by first searching the entire file for the ID |with variant, and searching for the fallback ID only if that search |fails. It also includes some code cleanup in the area, as |ath10k_core_fetch_board_data_api_n() no longer does its own string |mangling to remove the variant from an ID, instead leaving that job to a |new flag passed to ath10k_core_create_board_name(). | |I've tested this patch on a QCA4019 and verified that the driver behaves |correctly for 1) both fallback and variant BDFs present, 2) only fallback |BDF present, and 3) no matching BDFs present. | |Fixes: 1657b8f84ed9 ("ath10k: search SMBIOS for OEM board file extension") |Signed-off-by: Thomas Hebb <tommyhebb@gmail.com> Note: 937-ath10k-calibration-variant.patch has been reassigned a new 081 number, as it now ships with upstream.... But also because this patch requires the change in ath10k_core_create_board_name(). Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Diffstat (limited to 'package/kernel/mac80211/patches/937-ath10k-calibration-variant.patch')
-rw-r--r--package/kernel/mac80211/patches/937-ath10k-calibration-variant.patch106
1 files changed, 0 insertions, 106 deletions
diff --git a/package/kernel/mac80211/patches/937-ath10k-calibration-variant.patch b/package/kernel/mac80211/patches/937-ath10k-calibration-variant.patch
deleted file mode 100644
index f9a830c..0000000
--- a/package/kernel/mac80211/patches/937-ath10k-calibration-variant.patch
+++ /dev/null
@@ -1,106 +0,0 @@
-From: Sven Eckelmann <sven.eckelmann@openmesh.com>
-Date: Fri, 10 Mar 2017 09:06:15 +0100
-Subject: ath10k: search DT for qcom,ath10k-calibration-variant
-
-Board Data File (BDF) is loaded upon driver boot-up procedure. The right
-board data file is identified on QCA4019 using bus, bmi-chip-id and
-bmi-board-id.
-
-The problem, however, can occur when the (default) board data file cannot
-fulfill the vendor requirements and it is necessary to use a different
-board data file.
-
-This problem was solved for SMBIOS by adding a special SMBIOS type 0xF8.
-Something similar has to be provided for systems without SMBIOS but with
-device trees. No solution was specified by QCA and therefore a new one has
-to be found for ath10k.
-
-The device tree requires addition strings to define the variant name
-
- wifi@a000000 {
- status = "okay";
- qcom,ath10k-calibration-variant = "RT-AC58U";
- };
-
- wifi@a800000 {
- status = "okay";
- qcom,ath10k-calibration-variant = "RT-AC58U";
- };
-
-This would create the boarddata identifiers for the board-2.bin search
-
- * bus=ahb,bmi-chip-id=0,bmi-board-id=16,variant=RT-AC58U
- * bus=ahb,bmi-chip-id=0,bmi-board-id=17,variant=RT-AC58U
-
-Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
-
-Origin: other, https://patchwork.kernel.org/patch/9615185/
----
-
---- a/drivers/net/wireless/ath/ath10k/core.c
-+++ b/drivers/net/wireless/ath/ath10k/core.c
-@@ -860,6 +860,25 @@ static int ath10k_core_check_smbios(stru
- return 0;
- }
-
-+static int ath10k_core_check_dt(struct ath10k *ar)
-+{
-+ struct device_node *node;
-+ const char *variant = NULL;
-+
-+ node = ar->dev->of_node;
-+ if (!node)
-+ return -ENOENT;
-+
-+ of_property_read_string(node, "qcom,ath10k-calibration-variant",
-+ &variant);
-+ if (!variant)
-+ return -ENODATA;
-+
-+ strscpy(ar->id.bdf_ext, variant, sizeof(ar->id.bdf_ext));
-+
-+ return 0;
-+}
-+
- static int ath10k_download_and_run_otp(struct ath10k *ar)
- {
- u32 result, address = ar->hw_params.patch_load_addr;
-@@ -1231,19 +1250,19 @@ static int ath10k_core_create_board_name
- /* strlen(',variant=') + strlen(ar->id.bdf_ext) */
- char variant[9 + ATH10K_SMBIOS_BDF_EXT_STR_LENGTH] = { 0 };
-
-+ if (ar->id.bdf_ext[0] != '\0')
-+ scnprintf(variant, sizeof(variant), ",variant=%s",
-+ ar->id.bdf_ext);
-+
- if (ar->id.bmi_ids_valid) {
- scnprintf(name, name_len,
-- "bus=%s,bmi-chip-id=%d,bmi-board-id=%d",
-+ "bus=%s,bmi-chip-id=%d,bmi-board-id=%d%s",
- ath10k_bus_str(ar->hif.bus),
- ar->id.bmi_chip_id,
-- ar->id.bmi_board_id);
-+ ar->id.bmi_board_id, variant);
- goto out;
- }
-
-- if (ar->id.bdf_ext[0] != '\0')
-- scnprintf(variant, sizeof(variant), ",variant=%s",
-- ar->id.bdf_ext);
--
- scnprintf(name, name_len,
- "bus=%s,vendor=%04x,device=%04x,subsystem-vendor=%04x,subsystem-device=%04x%s",
- ath10k_bus_str(ar->hif.bus),
-@@ -2343,7 +2362,11 @@ static int ath10k_core_probe_fw(struct a
-
- ret = ath10k_core_check_smbios(ar);
- if (ret)
-- ath10k_dbg(ar, ATH10K_DBG_BOOT, "bdf variant name not set.\n");
-+ ath10k_dbg(ar, ATH10K_DBG_BOOT, "SMBIOS bdf variant name not set.\n");
-+
-+ ret = ath10k_core_check_dt(ar);
-+ if (ret)
-+ ath10k_dbg(ar, ATH10K_DBG_BOOT, "DT bdf variant name not set.\n");
-
- ret = ath10k_core_fetch_board_file(ar);
- if (ret) {