linux/drivers/net/wireless
Thomas Hebb c848966806 ath10k: search all IEs for variant before falling back
commit f2593cb1b2 ("ath10k: Search SMBIOS for OEM board file
extension") added a feature to ath10k that allows Board Data File
(BDF) conflicts between multiple devices that use the same device IDs
but have different calibration requirements to be resolved by allowing
a "variant" string to be stored in SMBIOS [and later device tree, added
by commit d06f26c5c8 ("ath10k: search DT for qcom,ath10k-calibration-
variant")] that gets appended to the ID stored in board-2.bin.

This original patch had a regression, however. Namely that devices with
a variant present in SMBIOS that didn't need custom BDFs could no longer
find the default BDF, which has no variant appended. The patch was
reverted and re-applied with a fix for this issue in commit 1657b8f84e
("search SMBIOS for OEM board file extension").

But the fix to fall back to a default BDF introduced another issue: the
driver currently parses IEs in board-2.bin one by one, and for each one
it first checks to see if it matches the ID with the variant appended.
If it doesn't, it checks to see if it matches the "fallback" ID with no
variant. If a matching BDF is found at any point during this search, the
search is terminated and that BDF is used. The issue is that it's very
possible (and is currently the case for board-2.bin files present in the
ath10k-firmware repository) for the default BDF to occur in an earlier
IE than the variant-specific BDF. In this case, the current code will
happily choose the default BDF even though a better-matching BDF is
present later in the file.

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: 1657b8f84e ("ath10k: search SMBIOS for OEM board file extension")
Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-04-19 19:18:15 +03:00
..
admtek net/wireless: fix spaces and grammar copy/paste in vendor Kconfig help text 2018-03-13 18:52:25 +02:00
ath ath10k: search all IEs for variant before falling back 2018-04-19 19:18:15 +03:00
atmel net/wireless: fix spaces and grammar copy/paste in vendor Kconfig help text 2018-03-13 18:52:25 +02:00
broadcom wireless: Use octal not symbolic permissions 2018-03-27 11:01:13 +03:00
cisco wireless: Use octal not symbolic permissions 2018-03-27 11:01:13 +03:00
intel wireless: Use octal not symbolic permissions 2018-03-27 11:01:13 +03:00
intersil wireless: Use octal not symbolic permissions 2018-03-27 11:01:13 +03:00
marvell mwifiex: remove warnings in mwifiex_cmd_append_11n_tlv() 2018-03-27 11:03:24 +03:00
mediatek wireless: Use octal not symbolic permissions 2018-03-27 11:01:13 +03:00
quantenna net/wireless: fix spaces and grammar copy/paste in vendor Kconfig help text 2018-03-13 18:52:25 +02:00
ralink wireless: Use octal not symbolic permissions 2018-03-27 11:01:13 +03:00
realtek wireless-drivers-next patches for 4.17 2018-03-25 21:27:38 -04:00
rsi rsi: Remove stack VLA usage 2018-03-27 11:04:32 +03:00
st wireless: Use octal not symbolic permissions 2018-03-27 11:01:13 +03:00
ti wireless: Use octal not symbolic permissions 2018-03-27 11:01:13 +03:00
zydas net/wireless: fix spaces and grammar copy/paste in vendor Kconfig help text 2018-03-13 18:52:25 +02:00
Kconfig
mac80211_hwsim.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-03-23 11:31:58 -04:00
mac80211_hwsim.h mac80211_hwsim: add permanent mac address option for new radios 2018-01-31 12:45:35 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ray_cs.c wireless: Use octal not symbolic permissions 2018-03-27 11:01:13 +03:00
ray_cs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rayctl.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rndis_wlan.c
wl3501.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
wl3501_cs.c wl3501_cs: fix spelling mistake: "Insupported" -> "Unsupported" 2017-07-28 18:06:31 +03:00