aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath10k (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-12-17ath10k: Fix some typo in some warning messagesChristophe JAILLET2-3/+3
Fix some typo: s/to to/to/ s/even/event/ Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-12-02ath10k: change bundle count for max rx bundle for sdioWen Gong3-9/+13
For max bundle size 32, the bundle mask is not same with 8/16. Change it to match the max bundle size of htc. Otherwise it will not match with firmware, for example, when bundle count is 17, then flags of ath10k_htc_hdr is 0x4, if without this patch, it will be considered as non-bundled packet because it does not have mask 0xF0, then trigger error message later: payload length 56747 exceeds max htc length: 4088. htc->max_msgs_per_htc_bundle is the min value of HTC_HOST_MAX_MSG_PER_RX_BUNDLE and msg->ready_ext.max_msgs_per_htc_bundle of ath10k_htc_wait_target, it will be sent to firmware later in ath10k_htc_start, then firmware will use it as the final max rx bundle count, in WLAN.RMH.4.4.1-00029, msg->ready_ext.max_msgs_per_htc_bundle is 32, it is same with HTC_HOST_MAX_MSG_PER_RX_BUNDLE, so the final max rx bundle count will be set to 32 in firmware. This patch only effect sdio chips. Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00029. Signed-off-by: Wen Gong <wgong@codeaurora.org> Fixes: 224776520ead69e ("ath10k: change max RX bundle size from 8 to 32 for sdio") Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-12-02ath10k: enable napi on RX path for sdioWen Gong4-8/+73
For tcp RX, the quantity of tcp acks to remote is 1/2 of the quantity of tcp data from remote, then it will have many small length packets on TX path of sdio bus, then it reduce the RX packets's bandwidth of tcp. This patch enable napi on RX path, then the RX packet of tcp will not feed to tcp stack immeditely from mac80211 since GRO is enabled by default, it will feed to tcp stack after napi complete, if rx bundle is enabled, then it will feed to tcp stack one time for each bundle of RX. For example, RX bundle size is 32, then tcp stack will receive one large length packet, its length is neary 1500*32, then tcp stack will send a tcp ack for this large packet, this will reduce the tcp acks ratio from 1/2 to 1/32. This results in significant performance improvement for tcp RX. Tcp rx throughout is 240Mbps without this patch, and it arrive 390Mbps with this patch. The cpu usage has no obvious difference with and without NAPI. call stack for each RX packet on GRO path: (skb length is about 1500 bytes) skb_gro_receive ([kernel.kallsyms]) tcp4_gro_receive ([kernel.kallsyms]) inet_gro_receive ([kernel.kallsyms]) dev_gro_receive ([kernel.kallsyms]) napi_gro_receive ([kernel.kallsyms]) ieee80211_deliver_skb ([mac80211]) ieee80211_rx_handlers ([mac80211]) ieee80211_prepare_and_rx_handle ([mac80211]) ieee80211_rx_napi ([mac80211]) ath10k_htt_rx_proc_rx_ind_hl ([ath10k_core]) ath10k_htt_rx_pktlog_completion_handler ([ath10k_core]) ath10k_sdio_napi_poll ([ath10k_sdio]) net_rx_action ([kernel.kallsyms]) softirqentry_text_start ([kernel.kallsyms]) do_softirq ([kernel.kallsyms]) call stack for napi complete and send tcp ack from tcp stack: (skb length is about 1500*32 bytes) _tcp_ack_snd_check ([kernel.kallsyms]) tcp_v4_do_rcv ([kernel.kallsyms]) tcp_v4_rcv ([kernel.kallsyms]) local_deliver_finish ([kernel.kallsyms]) ip_local_deliver ([kernel.kallsyms]) ip_rcv_finish ([kernel.kallsyms]) ip_rcv ([kernel.kallsyms]) netif_receive_skb_core ([kernel.kallsyms]) netif_receive_skb_one_core([kernel.kallsyms]) netif_receive_skb ([kernel.kallsyms]) netif_receive_skb_internal ([kernel.kallsyms]) napi_gro_complete ([kernel.kallsyms]) napi_gro_flush ([kernel.kallsyms]) napi_complete_done ([kernel.kallsyms]) ath10k_sdio_napi_poll ([ath10k_sdio]) net_rx_action ([kernel.kallsyms]) __softirqentry_text_start ([kernel.kallsyms]) do_softirq ([kernel.kallsyms]) Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00017-QCARMSWP-1. Signed-off-by: Wen Gong <wgong@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-11-29ath10k: enable wow feature for sdio chipWen Gong1-2/+21
sdio does not support wow, this patch is to enable it. When system enter sleep state, if wowlan is enabled, then sdio chip will keep power if platform support keep power, after resume, it will not need to re-load firmware again. Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00029. Signed-off-by: Wen Gong <wgong@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-11-29ath10k: change log level for mpdu status of sdio chipWen Gong1-2/+2
Change log level from warn to dbg level of mpdu status of sdio chip. Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00007-QCARMSWP-1. Signed-off-by: Wen Gong <wgong@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-11-29ath10k: set WMI_PEER_AUTHORIZE after a firmware crashWen Gong1-0/+3
After the firmware crashes ath10k recovers via ieee80211_reconfig(), which eventually leads to firmware configuration and including the encryption keys. However, because there is no new auth/assoc and 4-way-handshake, and firmware set the authorize flag after 4-way-handshake, so the authorize flag in firmware is not set in firmware without 4-way-handshake. This will lead to a failure of data transmission after recovery done when using encrypted connections like WPA-PSK. Set authorize flag after installing keys to firmware will fix the issue. This was noticed by testing firmware crashing using simulate_fw_crash debugfs file. Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00007-QCARMSWP-1. Signed-off-by: Wen Gong <wgong@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-11-29ath10k: set max mtu to 1500 for sdio chipWen Gong1-0/+2
For sdio chip, the max credit size in firmware is 1556, the 1556 include payload, ieee80211 header, htt header, htc header. So it need to set the max mtu to 1500 to forbidden TX packet which exceed 1500 form application. Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00017-QCARMSWP-1. Signed-off-by: Wen Gong <wgong@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-11-29ath10k: enable firmware log by default for sdioWen Gong1-12/+0
On SDIO chips the firmware log does not impact performance. To make it easier to debug firmware problems keep it enabled on the firmware. Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00029. Signed-off-by: Wen Gong <wgong@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-11-27ath10k: move non-fatal warn logs to dbg levelGovind Singh1-4/+4
During driver load below warn logs are printed in the console if firmware doesn't support some optional HTC services, ex:pktlog. It is likely some older fw version may not support PKTLOG HTC service as legacy fw uses HTC DATA service for pktlog. Move this log to debug level to remove un-necessary warn message on console. htc.c:803: ath10k_warn(ar, "unsupported HTC service id: %d\n", htc.c:881: ath10k_warn(ar, "unsupported HTC service id: %d\n", Signed-off-by: Govind Singh <govinds@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-11-25ath10k: fix RX of frames with broken FCS in monitor modeLinus Lüssing3-0/+10
So far, frames were forwarded regardless of the FCS correctness leading to userspace applications listening on the monitor mode interface to receive potentially broken frames, even with the "fcsfail" flag unset. By default, with the "fcsfail" flag of a monitor mode interface unset, frames with FCS errors should be dropped. With this patch, the fcsfail flag is taken into account correctly. Tested-on: QCA4019 firmware-5-ct-full-community-12.bin-lede.011 Cc: Simon Wunderlich <sw@simonwunderlich.de> Signed-off-by: Linus Lüssing <ll@simonwunderlich.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-11-25ath10k: report rssi of each chain to mac80211 for sdioWen Gong4-4/+22
iw command only show rssi without each chain's rssi on sdio iw wlan0 station dump Station a0:40:a0:93:3e:de (on wlan0) signal: -82 dBm signal avg: -82 dBm after this patch, it will show each chain's rssi on sdio Station a0:40:a0:93:3e:de (on wlan0) signal: -82 [-84, -88] dBm signal avg: -82 [-84, -87] dBm For QCA6174 PCIe, the ppdu have the correct rssi of each chain, it indicate rssi of rx data by ath10k_htt_rx_h_signal. For sdio chip, the rssi of each chain stored in rx management reported by firmware, the ath10k_wmi_tlv_op_pull_mgmt_rx_ev which used for tlv wmi will get the rssi of each chain and stored them in wmi_mgmt_rx_ev_arg, then indicate them to mac80211. For non-tlv wmi chip, it will not get the rssi of each chain and not indicate to mac80211, for non-tlv wmi chip, this patch will not have impact. For tlv wmi chip, if the rssi of chain in mgmt is valid, it will be indicate to mac80211, tested with QCA6174 PCIe/SDIO, the rssi of 2 chain in mgmt is valid. rssi of chains in mgmt of QCA6174 SDIO: 92096.652780: ath10k:ath10k_log_warn: ath10k_sdio mmc1:0001:1 rssi[0]:70 92096.657324: ath10k:ath10k_log_warn: ath10k_sdio mmc1:0001:1 rssi[1]:68 92096.662009: ath10k:ath10k_log_warn: ath10k_sdio mmc1:0001:1 rssi[2]:128 92096.666647: ath10k:ath10k_log_warn: ath10k_sdio mmc1:0001:1 rssi[3]:128 rssi of chains in mgmt of QCA6174 PCIe: [ 1581.049816] ath10k_pci 0000:02:00.0: mgmt rssi[0]:17 [ 1581.049818] ath10k_pci 0000:02:00.0: mgmt rssi[1]:22 [ 1581.049821] ath10k_pci 0000:02:00.0: mgmt rssi[2]:128 [ 1581.049823] ath10k_pci 0000:02:00.0: mgmt rssi[3]:128 after apply this patch, the iw's rssi of PCIe do not changed, result is same with before. iw wlan0 station dump of QCA6174 PCIe: Station 6c:e8:73:b8:92:dc (on wlan0) signal: -70 [-77, -72] dBm signal avg: -69 [-78, -72] dBm iw wlan-5000mhz station dump of QCA9984 PCIe connected with 2 client which has 2 chain: Station 70:48:0f:1f:1a:b2 (on wlan-5000mhz) signal: -47 [-55, -48, -87, -88] dBm signal avg: -42 [-50, -43, -83, -86] dBm Station ac:c1:ee:39:e3:83 (on wlan-5000mhz) signal: -43 [-46, -45, -79, -84] dBm signal avg: -43 [-46, -46, -82, -83] dBm Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00017-QCARMSWP-1. Tested with QCA6174 PCIe with firmware WLAN.RM.4.4.1-00110-QCARMSWP-1. Tested with QCA9984 PCIe with firmware 10.4-3.9.0.2-00040. Signed-off-by: Wen Gong <wgong@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-11-25ath10k: Handle "invalid" BDFs for msm8998 devicesJeffrey Hugo1-1/+9
When the BDF download QMI message has the end field set to 1, it signals the end of the transfer, and triggers the firmware to do a CRC check. The BDFs for msm8998 devices fail this check, yet the firmware is happy to still use the BDF. It appears that this error is not caught by the downstream drive by concidence, therefore there are production devices in the field where this issue needs to be handled otherwise we cannot support wifi on them. So, attempt to detect this scenario as best we can and treat it as non-fatal. Signed-off-by: Jeffrey Hugo <jeffrey.l.hugo@gmail.com> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-11-25ath10k: Fix qmi init error handlingJeffrey Hugo1-1/+4
When ath10k_qmi_init() fails, the error handling does not free the irq resources, which causes an issue if we EPROBE_DEFER as we'll attempt to (re-)register irqs which are already registered. Fix this by doing a power off since we just powered on the hardware, and freeing the irqs as error handling. Fixes: ba94c753ccb4 ("ath10k: add QMI message handshake for wcn3990 client") Signed-off-by: Jeffrey Hugo <jeffrey.l.hugo@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-11-25ath10k: add NL80211_FEATURE_ND_RANDOM_MAC_ADDR for NLOWen Gong1-0/+1
Add NL80211_FEATURE_ND_RANDOM_MAC_ADDR for NLO will enable the random mac address for netdetect case. iw command: iw phy0 wowlan enable net-detect net-detect randomize=AA:7B:A1:AC:B2:41/FF:FF:FF:FF:FF:FF interval 5000 delay 30 freqs 2412 matches ssid foo. After suspend, DUT will send probe request with mac AA:7B:A1:AC:B2:41. WCN3990, QCA9377, QCA6174 PCI also support this feature. Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00029. Signed-off-by: Wen Gong <wgong@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-11-25ath10k: Handle when FW doesn't support QMI_WLFW_HOST_CAP_REQ_V01Jeffrey Hugo1-1/+3
Firmware with the build id QC_IMAGE_VERSION_STRING=WLAN.HL.1.0.2-XXXX does not support the QMI_WLFW_HOST_CAP_REQ_V01 message and will return the QMI not supported error to the ath10k driver. Since not supporting this message is not fatal to the firmware nor the ath10k driver, lets catch this particular scenario and ignore it so that we can still bring up wifi services successfully. Signed-off-by: Jeffrey Hugo <jeffrey.l.hugo@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-11-25ath10k: add large size for BMI download data for SDIOWen Gong5-2/+66
Download firmware time cost of SDIO is too long, it is about 480ms, add large size 2048 bytes for BMI download for SDIO chip, its time cost will reduced to 240ms. This will optimize the download firmware time cost. Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00017-QCARMSWP-1. Signed-off-by: Wen Gong <wgong@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-11-25ath10k: correct the tlv len of ath10k_wmi_tlv_op_gen_config_pno_startWen Gong1-1/+4
the tlv len is set to the total len of the wmi cmd, it will trigger firmware crash, correct the tlv len. Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00017-QCARMSWP-1 and QCA6174 PCIE with firmware WLAN.RM.4.4.1-00110-QCARMSWPZ-1. Fixes: ce834e280f2f875 ("ath10k: support NET_DETECT WoWLAN feature") Signed-off-by: Wen Gong <wgong@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-11-25ath10k: sdio: remove struct ath10k_sdio_rx_data::statusKalle Valo2-3/+0
It seems to be unused. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-11-25ath10k: sdio: cosmetic cleanupKalle Valo1-12/+9
Do some cosmetic cleanup while reviewing the files. No functional changes. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-11-25ath10k: add workqueue for RX path of sdioWen Gong4-3/+44
For RX, it has two parts, one is to read data from sdio, another is to indicate the packets to upper stack. Recently it has only one thread to do all RX things, it results that it is sequential for RX and low throughout, change RX to parallel for the two parts will increase throughout. This patch move the indication to a workqueue, it results in significant performance improvement on RX path. Udp rx throughout is 200Mbps without this patch, and it arrives 400Mbps with this patch. Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00017-QCARMSWPZ-1 Signed-off-by: Wen Gong <wgong@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-11-25ath10k: change max RX bundle size from 8 to 32 for sdioWen Gong3-6/+23
The max bundle size support by firmware is 32, change it from 8 to 32 will help performance. This results in significant performance improvement on RX path. The real max rx bundle is decided in ath10k_htc_wait_target(), it is the min value of HTC_HOST_MAX_MSG_PER_RX_BUNDLE and the value reported from firmware. So this change shouldn't cause any regressions with other hardware supported by ath10k. Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00017-QCARMSWPZ-1. Signed-off-by: Wen Gong <wgong@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-11-25ath10k: enable RX bundle receive for sdioAlagu Sankar2-42/+79
The existing implementation of initiating multiple sdio transfers for receive bundling is slowing down the receive speed. Combining the transfers using a bundle method would be ideal. The transmission utilization ratio for sdio bus for small packet is slow, because the space and time cost for sdio bus is same for large length packet and small length packet. So the speed of data for large length packet is higher than small length. Test result of different length of data: data packet(byte) cost time(us) calculated rate(Mbps) 256 28 73 512 33 124 1024 35 234 1792 45 318 14336 168 682 28672 333 688 57344 660 695 Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00017-QCARMSWPZ-1 Signed-off-by: Alagu Sankar <alagusankar@silex-india.com> Signed-off-by: Wen Gong <wgong@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-11-15ath10k: qmi: Sleep for a while before assigning MSA memoryBjorn Andersson1-0/+7
Unless we sleep for a while before transitioning the MSA memory to WLAN the MPSS.AT.4.0.c2-01184-SDM845_GEN_PACK-1 firmware triggers a security violation fairly reliably. Unforutnately recovering from this failure always results in the entire system freezing. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-11-15ath10k: Revert "ath10k: add cleanup in ath10k_sta_state()"Bjorn Andersson1-5/+1
This reverts commit 334f5b61a6f29834e881923b98d1e27e5ce9620d. This caused ath10k_snoc on Qualcomm MSM8998, SDM845 and QCS404 platforms to trigger an assert in the firmware: err_qdi.c:456:EF:wlan_process:1:cmnos_thread.c:3900:Asserted in wlan_vdev.c:_wlan_vdev_up:3219 Revert the offending commit for now. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-11-08ath10k: disable cpuidle during downloading firmwareIkjoon Jang1-2/+10
Downloading ath10k firmware needs a large number of IOs and cpuidle's miss predictions make it worse. In the worst case, resume time can be three times longer than the average on sdio. This patch disables cpuidle during firmware downloading by applying PM_QOS_CPU_DMA_LATENCY in ath10k_download_fw(). Tested-on: QCA9880 Tested-on: QCA6174 hw3.2 SDIO WLAN.RMH.4.4.1-00029 Signed-off-by: Ikjoon Jang <ikjn@chromium.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-11-08ath10k: fix potential issue of peer stats allocationZhi Chen1-0/+1
STA number was not restored if OOM happened. Tested: QCA9984 with firmware ver 10.4-3.9.0.1-00018 Signed-off-by: Zhi Chen <zhichen@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-11-08ath10k: fix get invalid tx rate for Mesh metricMiaoqing Pan1-0/+2
ath10k does not provide transmit rate info per MSDU in tx completion, mark that as -1 so mac80211 will ignore the rates. This fixes mac80211 update Mesh link metric with invalid transmit rate info. Tested HW: QCA9984 Tested FW: 10.4-3.9.0.2-00035 Signed-off-by: Hou Bao Hou <houbao@codeaurora.org> Signed-off-by: Anilkumar Kolli <akolli@codeaurora.org> Signed-off-by: Miaoqing Pan <miaoqing@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-11-06Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.gitKalle Valo7-22/+47
ath.git patches for 5.5. Major changes: wil6210 * add SPDX license identifiers
2019-10-31ath10k: remove unneeded semicolonYueHaibing1-1/+1
remove unneeded semicolon. Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-10-22ath10k: Fix a NULL-ptr-deref bug in ath10k_usb_alloc_urb_from_pipeHui Peng1-0/+8
The `ar_usb` field of `ath10k_usb_pipe_usb_pipe` objects are initialized to point to the containing `ath10k_usb` object according to endpoint descriptors read from the device side, as shown below in `ath10k_usb_setup_pipe_resources`: for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) { endpoint = &iface_desc->endpoint[i].desc; // get the address from endpoint descriptor pipe_num = ath10k_usb_get_logical_pipe_num(ar_usb, endpoint->bEndpointAddress, &urbcount); ...... // select the pipe object pipe = &ar_usb->pipes[pipe_num]; // initialize the ar_usb field pipe->ar_usb = ar_usb; } The driver assumes that the addresses reported in endpoint descriptors from device side to be complete. If a device is malicious and does not report complete addresses, it may trigger NULL-ptr-deref `ath10k_usb_alloc_urb_from_pipe` and `ath10k_usb_free_urb_to_pipe`. This patch fixes the bug by preventing potential NULL-ptr-deref. Signed-off-by: Hui Peng <benquike@gmail.com> Reported-by: Hui Peng <benquike@gmail.com> Reported-by: Mathias Payer <mathias.payer@nebelwelt.net> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> [groeck: Add driver tag to subject, fix build warning] Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-10-15net/wireless: Delete unnecessary checks before the macro call “dev_kfree_skb”Markus Elfring1-3/+1
The dev_kfree_skb() function performs also input parameter validation. Thus the test around the shown calls is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-10-15wireless: Remove call to memset after dma_alloc_coherentFuqian Huang1-5/+0
In commit 518a2f1925c3 ("dma-mapping: zero memory returned from dma_alloc_*"), dma_alloc_coherent has already zeroed the memory. So memset is not needed. Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-10-14ath10k: Correct error handling of dma_map_single()Bjorn Andersson1-1/+3
The return value of dma_map_single() should be checked for errors using dma_mapping_error() and the skb has been dequeued so it needs to be freed. This was found when enabling CONFIG_DMA_API_DEBUG and it warned about the missing dma_mapping_error() call. Fixes: 1807da49733e ("ath10k: wmi: add management tx by reference support over wmi") Reported-by: Niklas Cassel <niklas.cassel@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-10-14ath10k: fix memory leak for tpc_stats_finalMiaoqing Pan1-0/+1
The memory of ar->debug.tpc_stats_final is reallocated every debugfs reading, it should be freed in ath10k_debug_destroy() for the last allocation. Tested HW: QCA9984 Tested FW: 10.4-3.9.0.2-00035 Signed-off-by: Miaoqing Pan <miaoqing@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-10-14ath10k: fix array out-of-bounds accessMiaoqing Pan2-19/+32
If firmware reports rate_max > WMI_TPC_RATE_MAX(WMI_TPC_FINAL_RATE_MAX) or num_tx_chain > WMI_TPC_TX_N_CHAIN, it will cause array out-of-bounds access, so print a warning and reset to avoid memory corruption. Tested HW: QCA9984 Tested FW: 10.4-3.9.0.2-00035 Signed-off-by: Miaoqing Pan <miaoqing@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-10-11ath10k: fix null dereference on pointer crash_dataColin Ian King1-1/+1
Currently when pointer crash_data is null the present null check will also check that crash_data->ramdump_buf is null and will cause a null pointer dereference on crash_data. Fix this by using the || operator instead of &&. Fixes: 3f14b73c3843 ("ath10k: Enable MSA region dump support for WCN3990") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-10-11ath10k: enable transmit data ack RSSI for QCA9884Abhishek Ambure1-0/+1
For all data packets transmitted, host gets htt tx completion event. Some QCA9984 firmware releases support WMI_SERVICE_TX_DATA_ACK_RSSI, which gives data ack rssi values to host through htt event of data tx completion. Data ack rssi values are valid if A0 bit is set in HTT rx message. So enable the feature also for QCA9884. Tested HW: QCA9984 Tested FW: 10.4-3.9.0.2-00044 Signed-off-by: Abhishek Ambure <aambure@codeaurora.org> Signed-off-by: Balaji Pothunoori <bpothuno@codeaurora.org> [kvalo@codeaurora.org: improve commit log] Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-10-02ath10k: add support for hardware rfkillWen Gong9-1/+178
When hardware rfkill is enabled in the firmware it will report the capability via using WMI_TLV_SYS_CAP_INFO_RFKILL bit in the WMI_SERVICE_READY event to the host. ath10k will check the capability, and if it is enabled then ath10k will set the GPIO information to firmware using WMI_PDEV_SET_PARAM. When the firmware detects hardware rfkill is enabled by the user, it will report it via WMI_RFKILL_STATE_CHANGE_EVENTID. Once ath10k receives the event it will send wmi command WMI_PDEV_SET_PARAM to the firmware to enable/disable the radio and also notifies cfg80211. We can't power off the device when rfkill is enabled, as otherwise the firmware would not be able to detect GPIO changes and report them to the host. So when rfkill is enabled, we need to keep the firmware running. Tested with QCA6174 PCI with firmware WLAN.RM.4.4.1-00109-QCARMSWPZ-1. Signed-off-by: Alan Liu <alanliu@codeaurora.org> Signed-off-by: Wen Gong <wgong@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-10-02ath10k: restore QCA9880-AR1A (v1) detectionChristian Lamparter1-11/+25
This patch restores the old behavior that read the chip_id on the QCA988x before resetting the chip. This needs to be done in this order since the unsupported QCA988x AR1A chips fall off the bus when resetted. Otherwise the next MMIO Op after the reset causes a BUS ERROR and panic. Cc: stable@vger.kernel.org Fixes: 1a7fecb766c8 ("ath10k: reset chip before reading chip_id in probe") Signed-off-by: Christian Lamparter <chunkeey@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-10-02ath10k: fix offchannel tx failure when no ath10k_mac_tx_frm_has_freqBen Greear1-11/+11
Offchannel management frames were failing: [18099.253732] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e3780 [18102.293686] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e3780 [18105.333653] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e3780 [18108.373712] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e3780 [18111.413687] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e36c0 [18114.453726] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e3f00 [18117.493773] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e36c0 [18120.533631] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e3f00 This bug appears to have been added between 4.0 (which works for us), and 4.4, which does not work. I think this is because the tx-offchannel logic gets in a loop when ath10k_mac_tx_frm_has_freq(ar) is false, so pkt is never actually sent to the firmware for transmit. This patch fixes the problem on 4.9 for me, and now HS20 clients can work again with my firmware. Antonio: tested with 10.4-3.5.3-00057 on QCA4019 and QCA9888 Signed-off-by: Ben Greear <greearb@candelatech.com> Tested-by: Antonio Quartulli <antonio.quartulli@kaiwoo.ai> [kvalo@codeaurora.org: improve commit log, remove unneeded parenthesis] Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-10-01ath10k: fix backtrace on coredumpAnilkumar Kolli1-3/+8
In a multiradio board with one QCA9984 and one AR9987 after enabling the crashdump with module parameter coredump_mask=7, below backtrace is seen. vmalloc: allocation failure: 0 bytes kworker/u4:0: page allocation failure: order:0, mode:0x80d2 CPU: 0 PID: 6 Comm: kworker/u4:0 Not tainted 3.14.77 #130 Workqueue: ath10k_wq ath10k_core_register_work [ath10k_core] (unwind_backtrace) from [<c021abf8>] (show_stack+0x10/0x14) (dump_stack+0x80/0xa0) (warn_alloc_failed+0xd0/0xfc) (__vmalloc_node_range+0x1b4/0x1d8) (__vmalloc_node+0x34/0x40) (vzalloc+0x24/0x30) (ath10k_coredump_register+0x6c/0x88 [ath10k_core]) (ath10k_core_register_work+0x350/0xb34 [ath10k_core]) (process_one_work+0x20c/0x32c) (worker_thread+0x228/0x360) This is due to ath10k_hw_mem_layout is not defined for AR9987. For coredump undefined hw ramdump_size is 0. Check for the ramdump_size before allocation memory. Tested on: AR9987, QCA9984 FW version: 10.4-3.9.0.2-00044 Signed-off-by: Anilkumar Kolli <akolli@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-10-01ath10k: coredump: fix IRAM addr for QCA9984, QCA4019, QCA9888 and QCA99x0Anilkumar Kolli1-3/+3
The IRAM start address in coredump was wrong for QCA9984, QCA4019, QCA9888 and QCA99x0. Tested on: QCA9984, QCA4019 FW version: 10.4-3.9.0.2-00044 Signed-off-by: Anilkumar Kolli <akolli@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-10-01ath10k: switch to ieee80211_tx_dequeue_niErik Stromdahl1-1/+1
Since ath10k_mac_tx_push_txq() can be called from process context, we must explicitly disable softirqs before the call into mac80211. By calling ieee80211_tx_dequeue_ni() instead of ieee80211_tx_dequeue() we make sure softirqs are always disabled even in the case when ath10k_mac_tx_push_txq() is called from process context. Calling ieee80211_tx_dequeue_ni() with softirq's already disabled (e.g., from softirq context) should be safe as the local_bh_disable() and local_bh_enable() functions (called from ieee80211_tx_dequeue_ni) are fully reentrant. Signed-off-by: Erik Stromdahl <erik.stromdahl@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-10-01ath10k: change sw version print format to hexTomislav Požega1-1/+1
Software version within WMI event ready message was displayed in a not very useful decimal format. Change this info to be shown in a hexadecimal format instead. Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-10-01ath10k: print supported MCS rates within service ready eventTomislav Požega4-1/+8
Add vht_supp_mcs argument to service ready structure and print supported MCS rates in WMI service ready debug message. Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-10-01ath10k: print service ready returned channel rangeTomislav Požega1-1/+5
Displays lowest/highest supported channels for both 2ghz and 5ghz bands as they're fetched within WMI service ready event. These are shown in a frequency format. Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-10-01ath10k: add 2ghz channel arguments to service ready structureTomislav Požega4-0/+12
Add lowest/highest 2ghz channel arguments for use within WMI service ready structure. Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-09-23ath10k: fix memory leakNavid Emamdoost1-0/+1
In ath10k_usb_hif_tx_sg the allocated urb should be released if usb_submit_urb fails. Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-09-23ath10k: remove the warning of sdio not full supportWen Gong1-3/+0
Recently, it has the basic feature of sdio tested success, so remove it. Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00017-QCARMSWP-1. Signed-off-by: Wen Gong <wgong@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-09-23ath: fix various spelling mistakesColin Ian King2-3/+3
There are a bunch of spelling mistakes in two ath drivers, fix these. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>