linux/drivers/net/wireless/ath/ath10k
Christian Lamparter 05e7ba24b1 ath10k: implement set_base_macaddr to fix rx-bssid mask in multiple APs conf
Many integrated QCA9984 WiFis in various IPQ806x platform routers
from various vendors (Netgear R7800, ZyXEL NBG6817, TP-LINK C2600,
etc.) have either blank, bogus or non-unique MAC-addresses in
their calibration data.

As a result, OpenWrt utilizes a discouraged binary calibration data
patching method that allows to modify the device's MAC-addresses right
at the source. This is because the ath10k' firmware extracts the MAC
address from the supplied radio/calibration data and issues a response
to the ath10k linux driver. Which was designed to take the main MAC in
ath10k_wmi_event_ready().

Part of the "setting an alternate MAC" issue was already tackled by a
patch from Brian Norris:
commit 9d5804662c
("ath10k: retrieve MAC address from system firmware if provided")
by allowing the option to specify an alternate MAC-address with the
established device_get_mac_address() function which extracts the right
address from DeviceTree/fwnode mac-address or local-mac-address
properties and saves it for later.

However, Ben Greear noted that the Qualcomm's ath10k firmware is liable
to not properly calculate its rx-bssid mask in this case. This can cause
issues in the popluar "multiple AP with a single ath10k instance"
configurations.

To improve MAC address handling, Felix Fietkau suggested to call
pdev_set_base_macaddr_cmdid before bringing up the first vif and
use the first vif MAC address there. Which is in ath10k_core_start().

This patch implement Felix Fietkau's request to
"call pdev_set_base_macaddr_cmdid before bringing up the first vif".
The pdev_set_base_macaddr_cmdid is already declared for all devices
and version. The driver just needed the support code for this
function.

Tested on:
QCA9880/CUS223, firmwares: 10.2.4.13-2, 10.2.4.70.44, 10.2.4-1.0-00041
QCA9887/MR33 firmware:10.2.4-1.0-00033
QCA4019/RT-AC58U firmware: 10.4-3.4-00104, 10.4-3.5.3-00057
QCA9984/R7800 firmware: Candela Technologies (CT) Firmware

BugLink: https://lists.openwrt.org/pipermail/openwrt-devel/2018-November/014595.html
Fixes: 9d5804662c ("ath10k: retrieve MAC address from system firmware if provided")
Cc: Brian Norris <briannorris@chromium.org>
Cc: Ben Greear <greearb@candelatech.com>
Cc: Felix Fietkau <nbd@nbd.name>
Cc: Mathias Kresin <dev@kresin.me>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-02-11 18:27:49 +02:00
..
ahb.c ath10k: add device type enum to ath10k_bus_params 2018-09-06 19:13:58 +03:00
ahb.h
bmi.c ath10k: download firmware via diag Copy Engine for QCA6174 and QCA9377. 2018-09-06 19:10:05 +03:00
bmi.h ath10k: download firmware via diag Copy Engine for QCA6174 and QCA9377. 2018-09-06 19:10:05 +03:00
ce.c Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git 2019-02-08 14:10:35 +02:00
ce.h ath10k: Set DMA address mask to 35 bit for WCN3990 2019-02-04 17:49:11 +02:00
core.c ath10k: implement set_base_macaddr to fix rx-bssid mask in multiple APs conf 2019-02-11 18:27:49 +02:00
core.h ath10k: update GCMP & GCMP-256 cipher suite number for WCN3990 2019-02-11 18:26:04 +02:00
coredump.c ath10k: assign proper firmware crash dump structure 2018-11-05 12:10:55 +02:00
coredump.h ath10k: assign proper firmware crash dump structure 2018-11-05 12:10:55 +02:00
debug.c ath10k: skip sending quiet mode cmd for WCN3990 2018-12-19 15:37:01 +02:00
debug.h ath10k: add debug mask for QMI layer 2018-10-13 20:31:47 +03:00
debugfs_sta.c ath10k: fix peer stats null pointer dereference 2018-12-20 19:08:35 +02:00
hif.h ath10k: change swap mail box check after htc ready 2019-02-07 16:51:58 +02:00
htc.c ath10k: DMA related fixes for high latency devices 2018-09-06 19:14:37 +03:00
htc.h ath10k: sdio: allocate correct size for RECV_1MORE_BLOCK rx packets 2018-07-02 17:21:37 +03:00
htt.c ath10k: Add support for extended HTT aggr msg support 2019-02-04 17:51:39 +02:00
htt.h ath10k: Add support for extended HTT aggr msg support 2019-02-04 17:51:39 +02:00
htt_rx.c ath10k: fill tx_duration for each peer in Tx stats per STA 2019-02-07 16:58:16 +02:00
htt_tx.c ath10k: Add support for extended HTT aggr msg support 2019-02-04 17:51:39 +02:00
hw.c ath10k: Set DMA address mask to 35 bit for WCN3990 2019-02-04 17:49:11 +02:00
hw.h ath10k: reduce transmit msdu count 2019-02-07 16:56:09 +02:00
Kconfig ath10k: remove work in progress logs from snoc driver 2018-12-20 19:03:15 +02:00
mac.c ath10k: update GCMP & GCMP-256 cipher suite number for WCN3990 2019-02-11 18:26:04 +02:00
mac.h ath10k: add waiting htt tx complete before wow enable 2018-09-03 19:57:03 +03:00
Makefile ath10k: add QMI message handshake for wcn3990 client 2018-10-13 20:31:56 +03:00
p2p.c
p2p.h
pci.c Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git 2019-02-08 14:10:35 +02:00
pci.h ath10k: optimize pci diag mem read & write operations 2018-09-06 19:09:44 +03:00
qmi.c ath10k: fix a NULL vs IS_ERR() check 2018-12-20 19:05:19 +02:00
qmi.h ath10k: add QMI message handshake for wcn3990 client 2018-10-13 20:31:56 +03:00
qmi_wlfw_v01.c ath10k: update HOST capability qmi message 2019-02-07 16:27:20 +02:00
qmi_wlfw_v01.h ath10k: update HOST capability qmi message 2019-02-07 16:27:20 +02:00
rx_desc.h ath10k: fix warning due to msdu limit error 2018-12-20 19:02:18 +02:00
sdio.c ath10k: sdio: add .owner field 2019-02-07 16:53:01 +02:00
sdio.h ath10k: rename HTC_HOST_MAX_MSG_PER_BUNDLE define 2018-06-28 12:56:05 +03:00
snoc.c ath10k: snoc: remove set but not used variable 'ar_snoc' 2019-02-07 16:54:21 +02:00
snoc.h ath10k: ath10k_snoc_{read,write}32() should be static 2018-11-06 18:18:24 +02:00
spectral.c ath10k: do not return invalid pointers as a *dentry 2019-02-07 16:55:12 +02:00
spectral.h
swap.c
swap.h
targaddrs.h ath10k: support extended board data download for dual-band QCA9984 2018-09-06 18:54:11 +03:00
testmode.c
testmode.h
testmode_i.h
thermal.c ath10k: skip sending quiet mode cmd for WCN3990 2018-12-19 15:37:01 +02:00
thermal.h
trace.c
trace.h
txrx.c ath10k: DMA related fixes for high latency devices 2018-09-06 19:14:37 +03:00
txrx.h
usb.c ath10k: add device type enum to ath10k_bus_params 2018-09-06 19:13:58 +03:00
usb.h
wmi-ops.h ath10k: implement set_base_macaddr to fix rx-bssid mask in multiple APs conf 2019-02-11 18:27:49 +02:00
wmi-tlv.c ath10k: update GCMP & GCMP-256 cipher suite number for WCN3990 2019-02-11 18:26:04 +02:00
wmi-tlv.h ath10k: Enable bundle tx compl for management frames in WCN3990 2019-02-07 16:36:59 +02:00
wmi.c ath10k: implement set_base_macaddr to fix rx-bssid mask in multiple APs conf 2019-02-11 18:27:49 +02:00
wmi.h ath10k: implement set_base_macaddr to fix rx-bssid mask in multiple APs conf 2019-02-11 18:27:49 +02:00
wow.c ath10k: fix some typo 2018-11-06 18:00:40 +02:00
wow.h