summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath11k
Commit message (Collapse)AuthorAgeFilesLines
* ath11k: fix up some error pathsDan Carpenter2020-01-261-11/+11
| | | | | | | | | | | | | | There are two error paths where "ret" wasn't set. Also one error path we set the error code to -EINVAL but we should just preserve the error code from ath11k_hal_srng_get_entrysize(). That function only returns -EINVAL so this doesn't change anything. I removed the "ret = 0;" initializers so that hopefully GCC will be able to detect these sorts of bugs in the future. Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: make sure to also report the RX bandwidth inside radiotapJohn Crispin2020-01-261-1/+2
| | | | | | | | | Add IEEE80211_RADIOTAP_HE_DATA1_BW_RU_ALLOC_KNOWN to the list of known fields. Not doing so will result in wireshark not calculating the bitrate correctly. Signed-off-by: John Crispin <john@phrozen.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: avoid null pointer dereference when pointer band is nullColin Ian King2020-01-261-4/+4
| | | | | | | | | | | | | In the unlikely event that cap->supported_bands has neither WMI_HOST_WLAN_2G_CAP set or WMI_HOST_WLAN_5G_CAP set then pointer band is null and a null dereference occurs when assigning band->n_iftype_data. Move the assignment to the if blocks to avoid this. Cleans up static analysis warnings. Addresses-Coverity: ("Explicit null dereference") Fixes: 9f056ed8ee01 ("ath11k: add HE support") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: Add missing pdev rx rate statsBhagavathi Perumal S2020-01-262-33/+214
| | | | | | | | | | | This adds missing rx rate info stats like pilot evm, per chain rssi, per user ul ppdu and mpdu counts and ul ofdma rate info etc. And add null checks for memory alloc failures. Signed-off-by: Bhagavathi Perumal S <bperumal@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: ensure ts.flags is initialized before bit-wise or'ing in valuesColin Ian King2020-01-261-1/+1
| | | | | | | | | | | | | Currently the structure ts is not inititalized and ts.flags contains garbage values from the stack. This is being passed into function ath11k_dp_tx_status_parse that bit-wise or'ing in settings into the ts.flags field. To avoid flags (and other fields) from containing garbage, initialize the structure to zero before use. Addresses-Coverity: ("Uninitialized scalar variable)" Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: set TxBf parameters after vdev startBhagavathi Perumal S2020-01-261-6/+5
| | | | | | | | | | The channel info parameters are required by the firmware to process TxBf parameters. Currently TxBf is passed prior to the channel info. This patch moves TxBf setup after the channel setup. Signed-off-by: John Crispin <john@phrozen.org> Signed-off-by: Bhagavathi Perumal S <bperumal@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: enable HE tlvs in ppdu stats for pktlog liteAnilkumar Kolli2020-01-262-0/+23
| | | | | | | | This patch enables HE tlvs in ppdu stats for pktlog lite mode. Signed-off-by: John Crispin <john@phrozen.org> Signed-off-by: Anilkumar Kolli <akolli@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: fix debugfs build failureArnd Bergmann2020-01-264-16/+13
| | | | | | | | | | | | | | | | | When CONFIG_ATH11K_DEBUGFS is disabled, but CONFIG_MAC80211_DEBUGFS is turned on, the driver fails to build: drivers/net/wireless/ath/ath11k/debugfs_sta.c: In function 'ath11k_dbg_sta_open_htt_peer_stats': drivers/net/wireless/ath/ath11k/debugfs_sta.c:416:4: error: 'struct ath11k' has no member named 'debug' ar->debug.htt_stats.stats_req = stats_req; ^~ It appears that just using the former symbol is sufficient here, adding a Kconfig dependency takes care of the corner cases. Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: Use sizeof_field() instead of FIELD_SIZEOF()Kees Cook2019-12-191-1/+1
| | | | | | | | | The FIELD_SIZEOF() macro was redundant, and is being removed from the kernel. Since commit c593642c8be0 ("treewide: Use sizeof_field() macro") this is one of the last users of the old macro, so replace it. Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: explicitly cast wmi commands to their correct struct typeJohn Crispin2019-12-191-3/+3
| | | | | | | | Three of the WMI command handlers were not casting to the right data type. Lets make the code consistent with the other handlers. Signed-off-by: John Crispin <john@phrozen.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: Remove unneeded semicolonzhengbin2019-12-181-1/+1
| | | | | | | | | | Fixes coccicheck warning: drivers/net/wireless/ath/ath11k/wmi.h:2570:2-3: Unneeded semicolon Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: zhengbin <zhengbin13@huawei.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: remove an unneeded NULL checkDan Carpenter2019-12-181-2/+2
| | | | | | | | | The list iterator is always non-NULL so it doesn't need to be checked. I also removed the unnecessary initializer because the list iterator is always initialized. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: checking for NULL vs IS_ERR()Dan Carpenter2019-12-181-10/+13
| | | | | | | | | | | The ath11k_ce_alloc_ring() function returns error pointers on error, not NULL. The rest of the driver assumes that "pipe->src_ring" is either valid or NULL so this patch introduces a temporary varaible to avoid leaving it as an error pointer. Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: delete a stray unlock in ath11k_dbg_htt_stats_req()Dan Carpenter2019-12-181-1/+0
| | | | | | | | The callers unlock this lock so this error path has a double unlock. Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: fix missing free of skb on error return pathColin Ian King2019-12-181-2/+4
| | | | | | | | | | | The error handling when the call to ath11k_hal_srng_get_entrysize fails leaks skb, fix this by returning via the err_free return path that will ensure the skb is free'd. Addresses-Coverity: ("Resource leak") Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: fix uninitialized variable radioupColin Ian King2019-12-181-1/+1
| | | | | | | | | | | The variable radioup is not uninitalized so it may contain a garbage value and hence the detection of a radio that is not up is buggy. Fix this by initializing it to zero. Addresses-Coverity: ("Uninitalized scalar variable") Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: fix memory leak on reg_infoColin Ian King2019-12-181-1/+1
| | | | | | | | | | | | Currently a return path is leaking the previously allocate reg_info. Fix this by exiting via the return path mem_free. Since the return value ret is defaulted to 0, there is no need to re-assign ret to the 0 before the goto. Addresses-Coverity: ("Resource leak") Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: Remove unnecessary enum scan_priorityNathan Chancellor2019-12-181-10/+1
| | | | | | | | | | | | | | | | | | | | | | Clang warns: drivers/net/wireless/ath/ath11k/wmi.c:1827:23: warning: implicit conversion from enumeration type 'enum wmi_scan_priority' to different enumeration type 'enum scan_priority' [-Wenum-conversion] arg->scan_priority = WMI_SCAN_PRIORITY_LOW; ~ ^~~~~~~~~~~~~~~~~~~~~ 1 warning generated. wmi_scan_priority and scan_priority have the same values but the wmi one has WMI prefixed to the names. Since that enum is already being used, get rid of scan_priority and switch its one use to wmi_scan_priority to fix this warning. Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") Link: https://github.com/ClangBuiltLinux/linux/issues/808 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: fix several spelling mistakesColin Ian King2019-12-183-4/+4
| | | | | | | | There are several spelling mistakes in warning and debug messages, fix them. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: add some missing __packed qualifiersJohn Crispin2019-12-181-3/+3
| | | | | | | A few of the WMI parameter structs were missing this. Signed-off-by: John Crispin <john@phrozen.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: set the BA buffer size to 256 when HE is enabledPradeep Kumar Chitrapu2019-12-182-0/+16
| | | | | | | | | This patch sets the correct BA buffer size when we are in HE mode. Without this change we are not able to receive 256 bitmapped BA frames. Signed-off-by: John Crispin <john@phrozen.org> Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: fix pdev when invoking ath11k_wmi_send_twt_enable_cmd()Pradeep Kumar Chitrapu2019-12-181-2/+2
| | | | | | | | | | The code currently uses the wrong pdev id when enabling TWT. Fix this by using the correct ones. Fixes: e65a616f4e74 ("ath11k: add TWT support") Signed-off-by: John Crispin <john@phrozen.org> Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: optimize ath11k_hal_tx_status_parseJohn Crispin2019-12-183-50/+37
| | | | | | | | Moving the function into dp_tx.c allows gcc to optimize the code better and also avoid chace invalidates and context switches. Signed-off-by: John Crispin <john@phrozen.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: optimise ath11k_dp_tx_completion_handlerJohn Crispin2019-12-185-56/+28
| | | | | | | | | | | | | | | | the current code does 4 memcpys for each completion frame. 1) duplicate the desc 2 + 3) inside kfifo insertion 4) kfifo remove The code simply drops the kfifo and uses a trivial ring buffer. This requires a single memcpy for insertion. There is no removal needed as we can simply use the inserted data for processing. As the code runs inside the NAPI context it is atomic and there is no need for most of the locking. Signed-off-by: John Crispin <john@phrozen.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: move some tx_status parsing to debugfs codeJohn Crispin2019-12-183-53/+36
| | | | | | | | Some of the fields are only used by debugfs. Move the parsing of these from the data hot path to the debugfs code. Signed-off-by: John Crispin <john@phrozen.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: rename ath11k_wmi_base instances from wmi_sc to wmi_abJohn Crispin2019-12-187-81/+81
| | | | | | | This makes the code consistent with the recent sc to ab rename. Signed-off-by: John Crispin <john@phrozen.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: drop memset when setting up a tx cmd descJohn Crispin2019-12-182-2/+1
| | | | | | | | There is no point in zero'ing out the structure if we set all values in the following line. Signed-off-by: John Crispin <john@phrozen.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: disable PS for STA interfaces by default upon bringupJohn Crispin2019-12-181-0/+7
| | | | | | | | After applying this setting the TX performance issue of STA interfaces is gone and we can see TX performance go up to ~900mbit on HE80. Signed-off-by: John Crispin <john@phrozen.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: add wmi helper for turning STA PS on/offJohn Crispin2019-12-182-0/+37
| | | | | | | Add a WMI call helper to set the powersave mode of a STA interface. Signed-off-by: John Crispin <john@phrozen.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: register HE mesh capabilitiesSven Eckelmann2019-12-171-0/+75
| | | | | | | | | | | | The capabilities for the HE mesh are generated from the capabilities reported by the fw. But the firmware only reports the overall capabilities and not the one which are specific for mesh. Some of them (TWT, MU UL/DL, TB PPDU, ...) require an infrastructure setup with a main STA (AP) controlling the operations. This is not the case for mesh and thus these capabilities are removed from the list of capabilities. Signed-off-by: Sven Eckelmann <seckelmann@datto.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: fix indentation in ath11k_mac_prepare_he_mode()John Crispin2019-11-291-5/+5
| | | | | Signed-off-by: John Crispin <john@phrozen.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: Setup REO destination ring before sending wmi_init commandVasanthakumar Thiagarajan2019-11-295-14/+67
| | | | | | | | | Firmware expects all the required REO destination rings setup while processing wmi_init command. Not doing this causes connected stations getting disconnected and not able to connect back. Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: Move mac80211 hw allocation before wmi_init commandVasanthakumar Thiagarajan2019-11-293-46/+81
| | | | | | | | | | | | | This is to prepare REO ring setup before sending wmi_init command. Firmware expects all the required REO rings to be setup while processing wmi_init command. But as per the current initialization sequence, REO ring configurations are done only after wmi_init command is sent. Also refactoring ath11k_mac_create() into ath11k_mac_alloc() and ath11k_mac_register() to it mac80211 hw structure available before sending wmi_init command. Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: Skip update peer stats for management packetsVenkateswara Naralasetty2019-11-292-14/+23
| | | | | | | | | Currently HTT_PPDU_STATS_TAG_USR_COMPLTN_ACK_BA_STATUS tag of PPDU stats doesn't have valid success bytes info of management frames. So skip update peer stats for management packets. Signed-off-by: Venkateswara Naralasetty <vnaralas@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: update tx duration in station infoVenkateswara Naralasetty2019-11-293-1/+5
| | | | | | | | Update tx duration in station info form PPDU stats so that users can dump tx duration of the station. Signed-off-by: Venkateswara Naralasetty <vnaralas@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: fix vht guard interval mappingManikanta Pubbisetty2019-11-292-3/+19
| | | | | | | | | | | | Guard interval value which comes from VHT_SIG_A TLV has a mapping where value 0 corresponds to LGI, 1 and 3 corresponds to SGI. Value 3 which is SGI(0.4us) in VHT was incorrectly mapped to a GI of 3.2us(only applicable in HE) resulting in incorrect rx GI stats. Fixing the mapping. Signed-off-by: Manikanta Pubbisetty <mpubbise@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: fix memory leak in monitor modeMiles Hu2019-11-291-2/+9
| | | | | | | | remove tail check to avoid last amsdu leak. recycle skb in ppdu id wrap around case Signed-off-by: Miles Hu <milehu@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: Advertise MPDU start spacing as no restrictionVenkateswara Naralasetty2019-11-291-1/+1
| | | | | | | | | | Adverise MPDU start spacing as no restriction in ht capabilities, Since IPQ8074 hw support all sorts of mpdu start spcing. With this observed minor uplink performance improvement in lower data frame size case with Veriwave clients. Signed-off-by: Venkateswara Naralasetty <vnaralas@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: Update tx and rx chain count properly on drv_set_antennaSriram R2019-11-291-0/+4
| | | | | | | | | Set the number of tx and rx chains properly on drv_set_antenna(). This will ensure the related ht/vht/he caps are properly recalculated based on the tx/rx chains set. Signed-off-by: Sriram R <srirrama@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: add necessary peer assoc params in wmi dbgSriram R2019-11-291-2/+11
| | | | | | | | | Add necessary peer assoc params in WMI debug message while sending the peer assoc command to firmware to aid in debugging. Signed-off-by: Sriram R <srirrama@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: unlock mutex during failure in qmi fw readyGovindaraj Saminathan2019-11-291-0/+1
| | | | | | | | | qmi firmware ready event start to initialize the core modules and the sequence executed with mutex lock. In case of any failure mutex should be unlocked otherwise it will hang during the recovery. Signed-off-by: Govindaraj Saminathan <gsamin@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: add support for controlling tx power to a stationMaharaja Kennadyrajan2019-11-292-0/+40
| | | | | | | | | | | | | | | | | | | | This patch will add the support to control the transmit power for traffic to a station associated with the AP. Underlying firmware will enforce that the maximum tx power will be based on the regulatory requirements. If the user given transmit power is greater than the allowed tx power in the given channel, then the firmware will use the maximum tx power in the same channel. Max and Min tx power values will depends on number of tx chain masks. The allowed tx power range values are from 6 to 23. When 0 is sent to the firmware as tx power, it will revert to the default tx power for the station. Signed-off-by: Maharaja Kennadyrajan <mkenna@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: update bawindow size in delba processVenkateswara Naralasetty2019-11-291-9/+19
| | | | | | | | | | | | | | Currenly in delba process calling ath11k_peer_rx_tid_delete() updates reo with desc invalid and add tid queue to the flush list. If station send data traffic without addba req and before tid flush, hw gives those packets as invalid desc reo error. Since we are dropping these invalid desc packets results in traffic stall. This patch fix this issue by updating the reo queue with bawindow size 1 instead of tid removal in delba process. Signed-off-by: Venkateswara Naralasetty <vnaralas@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: avoid use_after_free in ath11k_dp_rx_msdu_coalesce APIKarthikeyan Periyasamy2019-11-291-5/+5
| | | | | | | | | Accessing already stored first msdu data after the skb expand trigger use_after_free, since first msdu got deleted. so do the descriptor copy operation before the skb expand operation. Signed-off-by: Karthikeyan Periyasamy <periyasa@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: avoid burst time conversion logicKarthikeyan Periyasamy2019-11-291-6/+1
| | | | | | | | | | WMI_VDEV_SET_WMM_PARAMS commmand expects the txoplimit param in the units of 32 microseconds. convert the txop unit from 32 microseconds to absolute microseconds leads to the higher burst values which is incorrect. so no need to convert the txop unit from 32 microseconds to absolute microseconds. Signed-off-by: Karthikeyan Periyasamy <periyasa@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: pktlog: fix sending/using the pdev idAnilkumar Kolli2019-11-292-6/+8
| | | | | | | | Fixes sending the pdev id(0,1,2 for mac0, mac1, mac2) to FW in wmi cmd pktlog enable/disable. Signed-off-by: Anilkumar Kolli <akolli@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: qmi clean up in ath11k_qmi_wlanfw_wlan_cfg_send()Anilkumar Kolli2019-11-292-17/+20
| | | | | | | Use pipe_id id instead of ret in for loop. Signed-off-by: Anilkumar Kolli <akolli@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: qmi clean up ce and HTC service config updateAnilkumar Kolli2019-11-292-7/+6
| | | | | | | Copy CE and htc service configs for all pipes. Signed-off-by: Anilkumar Kolli <akolli@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: tracing: fix ath11k tracingAnilkumar Kolli2019-11-291-0/+3
| | | | | | | Add missing tracing subsystem define. Signed-off-by: Anilkumar Kolli <akolli@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath11k: Fix target crash due to WBM_IDLE_LINK ring desc shortageVasanthakumar Thiagarajan2019-11-291-3/+3
| | | | | | | | | | | | Make sure the number of WBM_IDLE_LINK ring descriptors is power of 2. This increases the number of descriptors to 32k from the current ~18k to fix the target assert because of the shortage in the descriptors in WBM_IDLE_LINK ring. Remove unnecessary power of 2 calculation in ath11k_dp_link_desc_setup() as it is not required after this change. Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
OpenPOWER on IntegriCloud