aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/wil6210/wmi.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2024-04-04wifi: wil6210: wmi: Use __counted_by() in struct wmi_set_link_monitor_cmd and avoid -Wfamnae warningGustavo A. R. Silva1-12/+7
Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). Also, -Wflex-array-member-not-at-end is coming in GCC-14, and we are getting ready to enable it globally. So, use the `DEFINE_FLEX()` helper for an on-stack definition of a flexible structure where the size of the flexible-array member is known at compile-time, and refactor the rest of the code, accordingly. So, with these changes, fix the following warning: drivers/net/wireless/ath/wil6210/wmi.c:4018:49: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] Link: https://github.com/KSPP/linux/issues/202 Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Reviewed-by: Jeff Johnson <quic_jjohnson@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://msgid.link/ZgSTCmdP+omePvWg@neat
2023-09-13wifi: cfg80211: remove scan_width supportJohannes Berg1-2/+0
There really isn't any support for scanning at different channel widths than 20 MHz since there's no way to set it. Remove this support for now, if somebody wants to maintain this whole thing later we can revisit how it should work. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2022-09-02wifi: move from strlcpy with unused retval to strscpyWolfram Sang1-1/+1
Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20220830201457.7984-2-wsa+renesas@sang-engineering.com
2022-06-20cfg80211: Indicate MLO connection info in connect and roam callbacksVeerendranath Jakkam1-2/+2
The MLO links used for connection with an MLD AP are decided by the driver in case of SME offloaded to driver. Add support for the drivers to indicate the information of links used for MLO connection in connect and roam callbacks, update the connected links information in wdev from connect/roam result sent by driver. Also, send the connected links information to userspace. Add a netlink flag attribute to indicate that userspace supports handling of MLO connection. Drivers must not do MLO connection when this flag is not set. This is to maintain backwards compatibility with older supplicant versions which doesn't have support for MLO connection. Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2022-03-06wireless: Atheros: Use netif_rx().Sebastian Andrzej Siewior1-1/+1
Since commit baebdf48c3600 ("net: dev: Makes sure netif_rx() can be invoked in any context.") the function netif_rx() can be used in preemptible/thread context as well as in interrupt context. Use netif_rx(). Cc: Kalle Valo <kvalo@kernel.org> Cc: Maya Erez <merez@codeaurora.org> Cc: linux-wireless@vger.kernel.org Cc: wil6210@qti.qualcomm.com Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-10-20wil6210: use eth_hw_addr_set()Jakub Kicinski1-1/+1
Commit 406f42fa0d3c ("net-next: When a bond have a massive amount of VLANs...") introduced a rbtree for faster Ethernet address look up. To maintain netdev->dev_addr in this tree we need to make all the writes to it got through appropriate helpers. Do the special encoding on the stack, then copy the address. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20211018235021.1279697-6-kuba@kernel.org
2021-06-15wil6210: Fix wrong function name in commentsYang Shen1-3/+3
Fixes the following W=1 kernel build warning(s): drivers/net/wireless/ath/wil6210/interrupt.c:28: warning: expecting prototype for Theory of operation(). Prototype was for WIL6210_IRQ_DISABLE() instead drivers/net/wireless/ath/wil6210/wmi.c:227: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst drivers/net/wireless/ath/wil6210/wmi.c:245: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst drivers/net/wireless/ath/wil6210/wmi.c:263: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst Cc: Maya Erez <merez@codeaurora.org> Signed-off-by: Yang Shen <shenyang39@huawei.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20210517050141.61488-4-shenyang39@huawei.com
2021-04-18wil6210: wmi: Remove useless codeJiapeng Chong1-1/+1
Fix the following whitescan warning: An unsigned value can never be less than 0. Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/1617788766-91433-1-git-send-email-jiapeng.chong@linux.alibaba.com
2021-02-09wil6210: Add Support for Extended DMG MCS 12.1Max Chen1-5/+6
FW reports Tx/Rx extended MCS 12.1 to driver as "26". Driver will convert this into base MCS 7 + EXTENDED_SC_DMG flag so kernel can do the correct phy rate conversion. Also add log prints to print "12.1" instead of "26" for extended MCS. Signed-off-by: Max Chen <mxchen@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/1609977050-7089-3-git-send-email-mxchen@codeaurora.org
2020-11-07wil6210: wmi: Correct misnamed function parameter 'ptr_'Lee Jones1-1/+1
Fixes the following W=1 kernel build warning(s): drivers/net/wireless/ath/wil6210/wmi.c:279: warning: Function parameter or member 'ptr_' not described in 'wmi_buffer_block' drivers/net/wireless/ath/wil6210/wmi.c:279: warning: Excess function parameter 'ptr' description in 'wmi_buffer_block' Cc: Maya Erez <merez@codeaurora.org> Cc: Kalle Valo <kvalo@codeaurora.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: Jakub Kicinski <kuba@kernel.org> Cc: linux-wireless@vger.kernel.org Cc: wil6210@qti.qualcomm.com Cc: netdev@vger.kernel.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20201102112410.1049272-2-lee.jones@linaro.org
2020-08-31wil6210: wmi: Fix formatting and demote non-conforming function headersLee Jones1-21/+15
Fixes the following W=1 kernel build warning(s): drivers/net/wireless/ath/wil6210/wmi.c:52: warning: Incorrect use of kernel-doc format: * Addressing - theory of operations drivers/net/wireless/ath/wil6210/wmi.c:70: warning: Incorrect use of kernel-doc format: * @sparrow_fw_mapping provides memory remapping table for sparrow drivers/net/wireless/ath/wil6210/wmi.c:80: warning: cannot understand function prototype: 'const struct fw_map sparrow_fw_mapping[] = ' drivers/net/wireless/ath/wil6210/wmi.c:107: warning: Cannot understand * @sparrow_d0_mac_rgf_ext - mac_rgf_ext section for Sparrow D0 drivers/net/wireless/ath/wil6210/wmi.c:115: warning: Cannot understand * @talyn_fw_mapping provides memory remapping table for Talyn drivers/net/wireless/ath/wil6210/wmi.c:158: warning: Cannot understand * @talyn_mb_fw_mapping provides memory remapping table for Talyn-MB drivers/net/wireless/ath/wil6210/wmi.c:236: warning: Function parameter or member 'x' not described in 'wmi_addr_remap' drivers/net/wireless/ath/wil6210/wmi.c:255: warning: Function parameter or member 'section' not described in 'wil_find_fw_mapping' drivers/net/wireless/ath/wil6210/wmi.c:278: warning: Function parameter or member 'wil' not described in 'wmi_buffer_block' drivers/net/wireless/ath/wil6210/wmi.c:278: warning: Function parameter or member 'ptr_' not described in 'wmi_buffer_block' drivers/net/wireless/ath/wil6210/wmi.c:278: warning: Function parameter or member 'size' not described in 'wmi_buffer_block' drivers/net/wireless/ath/wil6210/wmi.c:307: warning: Function parameter or member 'wil' not described in 'wmi_addr' drivers/net/wireless/ath/wil6210/wmi.c:307: warning: Function parameter or member 'ptr' not described in 'wmi_addr' drivers/net/wireless/ath/wil6210/wmi.c:1589: warning: Function parameter or member 'wil' not described in 'wil_find_cid_ringid_sta' drivers/net/wireless/ath/wil6210/wmi.c:1589: warning: Function parameter or member 'vif' not described in 'wil_find_cid_ringid_sta' drivers/net/wireless/ath/wil6210/wmi.c:1589: warning: Function parameter or member 'cid' not described in 'wil_find_cid_ringid_sta' drivers/net/wireless/ath/wil6210/wmi.c:1589: warning: Function parameter or member 'ringid' not described in 'wil_find_cid_ringid_sta' drivers/net/wireless/ath/wil6210/wmi.c:1876: warning: Function parameter or member 'vif' not described in 'wmi_evt_ignore' drivers/net/wireless/ath/wil6210/wmi.c:1876: warning: Function parameter or member 'id' not described in 'wmi_evt_ignore' drivers/net/wireless/ath/wil6210/wmi.c:1876: warning: Function parameter or member 'd' not described in 'wmi_evt_ignore' drivers/net/wireless/ath/wil6210/wmi.c:1876: warning: Function parameter or member 'len' not described in 'wmi_evt_ignore' drivers/net/wireless/ath/wil6210/wmi.c:2588: warning: Function parameter or member 'wil' not described in 'wmi_rxon' Cc: Maya Erez <merez@codeaurora.org> Cc: Kalle Valo <kvalo@codeaurora.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: Jakub Kicinski <kuba@kernel.org> Cc: linux-wireless@vger.kernel.org Cc: wil6210@qti.qualcomm.com Cc: netdev@vger.kernel.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20200827073201.GR3248864@dell
2020-05-12wil6210: Replace zero-length array with flexible-arrayGustavo A. R. Silva1-1/+1
The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20200507151120.GA4469@embeddedor
2020-01-26wil6210: use true,false for bool variablezhengbin1-4/+4
Fixes coccicheck warning: drivers/net/wireless/ath/wil6210/main.c:765:1-14: WARNING: Assignment of 0/1 to bool variable drivers/net/wireless/ath/wil6210/txrx.c:1143:1-19: WARNING: Assignment of 0/1 to bool variable drivers/net/wireless/ath/wil6210/wmi.c:1516:4-23: WARNING: Assignment of 0/1 to bool variable drivers/net/wireless/ath/wil6210/wmi.c:1523:4-23: WARNING: Assignment of 0/1 to bool variable drivers/net/wireless/ath/wil6210/wmi.c:1538:4-30: WARNING: Assignment of 0/1 to bool variable drivers/net/wireless/ath/wil6210/wmi.c:1545:4-30: WARNING: Assignment of 0/1 to bool variable Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: zhengbin <zhengbin13@huawei.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-12-19wil6210: add support for set_cqm_rssi_configDedy Lansky1-0/+76
set_cqm_rssi_config() is used by the kernel to configure connection quality monitor RSSI threshold. wil6210 uses WMI_SET_LINK_MONITOR_CMDID to set the RSSI threshold to FW which in turn reports RSSI threshold changes with WMI_LINK_MONITOR_EVENTID. Signed-off-by: Dedy Lansky <dlansky@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-12-19wil6210: reduce ucode_debug memory regionDedy Lansky1-2/+2
ucode_debug memory region defined as 4K bytes. Fix this according to Talyn device memory map. Signed-off-by: Dedy Lansky <dlansky@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-10-31wil6210: add SPDX license identifiersLior David1-12/+1
Change all files to add SPDX license identifiers and remove license text. This is only an administrative change, there is no change in actual license or copyright for any file. Signed-off-by: Lior David <liord@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-10-02wil6210: check len before memcpy() callsDenis Efremov1-2/+4
memcpy() in wmi_set_ie() and wmi_update_ft_ies() is called with src == NULL and len == 0. This is an undefined behavior. Fix it by checking "ie_len > 0" before the memcpy() calls. As suggested by GCC documentation: "The pointers passed to memmove (and similar functions in <string.h>) must be non-null even when nbytes==0, so GCC can use that information to remove the check after the memmove call." [1] [1] https://gcc.gnu.org/gcc-4.9/porting_to.html Cc: Maya Erez <merez@codeaurora.org> Cc: Kalle Valo <kvalo@codeaurora.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: stable@vger.kernel.org Signed-off-by: Denis Efremov <efremov@linux.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-09-23ath: fix various spelling mistakesColin Ian King1-1/+1
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>
2019-09-12wil6210: report boottime_ns in scan resultsMaya Erez1-4/+17
Call cfg80211_inform_bss_frame_data to report cfg80211 on the boottime_ns in order to prevent the scan results filtering due to aging. Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-09-12wil6210: verify cid value is validAlexei Avshalom Lazar1-0/+6
cid value is not being verified in wmi_evt_delba(), verification is added. Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-09-12wil6210: fix PTK re-key raceAhmad Masri1-2/+9
Fix a race between cfg80211 add_key call and transmitting of 4/4 EAP packet. In case the transmit is delayed until after the add key takes place, message 4/4 will be encrypted with the new key, and the receiver side (AP) will drop it due to MIC error. Wil6210 will monitor and look for the transmitted packet 4/4 eap key. In case add_key takes place before the transmission completed, then wil6210 will let the FW store the key and wil6210 will notify the FW to use the PTK key only after 4/4 eap packet transmission was completed. Signed-off-by: Ahmad Masri <amasri@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-09-04wil6210: Add EDMG channel supportAlexei Avshalom Lazar1-2/+3
Add support for Enhanced Directional Multi-Gigabit (EDMG) channels 9-11. wil6210 reports it's EDMG capabilities (that are also based on FW capability) to cfg80211 by filling wiphy->bands[NL80211_BAND_60GHZ]->edmg_cap. wil6210 handles edmg.channels and edmg.bw_config requested in connect and start_ap operations. Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-06-27wil6210: drop old event after wmi_call timeoutAhmad Masri1-1/+12
This change fixes a rare race condition of handling WMI events after wmi_call expires. wmi_recv_cmd immediately handles an event when reply_buf is defined and a wmi_call is waiting for the event. However, in case the wmi_call has already timed-out, there will be no waiting/running wmi_call and the event will be queued in WMI queue and will be handled later in wmi_event_handle. Meanwhile, a new similar wmi_call for the same command and event may be issued. In this case, when handling the queued event we got WARN_ON printed. Fixing this case as a valid timeout and drop the unexpected event. Signed-off-by: Ahmad Masri <amasri@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-06-27wil6210: set WIL_WMI_CALL_GENERAL_TO_MS as wmi_call timeoutAhmad Masri1-13/+19
Replace all wmi_call timeouts that are less than 100 msec to use WIL_WMI_CALL_GENERAL_TO_MS (100 msec) as a default. Some of the current wmi_call timeouts are too short and fails to receive its waiting events. Signed-off-by: Ahmad Masri <amasri@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-06-27wil6210: add support for reading multiple RFs temperature via debugfsTzahi Sabo1-0/+42
Base-band chips support multi RFs chips. Add support for reading multiple RFs temperature via debugfs. Signed-off-by: Tzahi Sabo <stzahi@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-06-27wil6210: publish max_msdu_size to FW on BCAST ringMaya Erez1-0/+1
Set max_msdu_size in WMI_BCAST_DESC_RING_ADD_CMD to allow FW to optimize the buffers allocation for bcast packets. Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-06-27wil6210: Add support for setting RBUFCAP configurationAlexei Avshalom Lazar1-2/+37
RBUFCAP support added in FW. The RBUFCAP feature is amendment to the block ack mechanism to prevent overloading of the recipient’s memory space, which may happen in case the link speed is higher than STA’s capability to process or consume incoming data. The block ack policy (ba_policy) is now controlled by FW so driver should ignore this field. Add new debugfs "rbufcap" to configure RBUFCAP. Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-05-03wil6210: fix overwriting max_assoc_sta module paramAhmad Masri1-7/+7
Save the parameter of max_assoc_sta per device. On fw_ready event calculate the max_assoc_sta and save it per device, do not overwrite the max_assoc_sta module param. Signed-off-by: Ahmad Masri <amasri@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-03wil6210: fix return code of wmi_mgmt_tx and wmi_mgmt_tx_extLior David1-5/+6
The functions that send management TX frame have 3 possible results: success and other side acknowledged receive (ACK=1), success and other side did not acknowledge receive(ACK=0) and failure to send the frame. The current implementation incorrectly reports the ACK=0 case as failure. Signed-off-by: Lior David <liord@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-03wil6210: check mid is validAhmad Masri1-1/+1
Check that the mid is valid and that it does not exceed the memory size allocated to vifs array. Signed-off-by: Ahmad Masri <amasri@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-03wil6210: increase PCP stop command timeoutMaya Erez1-1/+3
In case there are connected stations, FW needs to disconnect them before handling PCP stop. This flow can take several seconds. Increasing PCP stop timeout to 5 seconds to allow that. Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-03wil6210: align to latest auto generated wmi.hAlexei Avshalom Lazar1-0/+7
Align to latest version of the auto generated wmi file describing the interface with FW. Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-02-28wil6210: support up to 20 stations in AP modeAhmad Masri1-16/+63
New FW added support for upto 20 clients in AP mode. Change the driver to support this as well. FW reports it's max supported associations in WMI_READY_EVENT. Some WMI commands/events use cidxtid field which is limited to 16 cids. Use new cid/tid fields instead. For Rx packets cid from rx descriptor is limited to 3 bits (0..7), to find the real cid, compare transmitter address with the stored stations mac address in the driver sta array. EDMA FW still supports 8 stations. Extending the support to 20 stations will come later. Signed-off-by: Ahmad Masri <amasri@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-02-28wil6210: remove rtap_include_phy_info module paramMaya Erez1-2/+2
Due to a HW issue in PHY info collection rtap_include_phy_info is not in use, hence can be removed. Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-11-06wil6210: fix locking in wmi_callLior David1-4/+5
Switch from spin_lock to spin_lock_irqsave, because wmi_ev_lock is used inside interrupt handler. Signed-off-by: Lior David <liord@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-11-06wil6210: add general initialization/size checksAlexei Avshalom Lazar1-1/+1
Initialize unset variable, and verify that mid is valid. Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-11-06wil6210: notify cqm packet loss on disable_ap_smeAhmad Masri1-0/+17
wil6210 used to notify cfg80211_del_sta on every fw disconnect event. In disable_ap_sme mode the userspace manages the protocol SME and FW sends disconnect event only due to link loss. In disable_ap_sme mode, indicate CQM packet loss to let the host control the connection and disconnect the link if needed. Signed-off-by: Ahmad Masri <amasri@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-11-06wil6210: refactor disconnect flowAhmad Masri1-21/+7
Separate sending command to the fw from the event handling function to simplify the disconnect flow and track the from_event flag correctly. Signed-off-by: Ahmad Masri <amasri@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-09-06wil6210: fix unsigned cid comparison with >= 0Gustavo A. R. Silva1-1/+1
The comparison of cid >= 0 is always true because cid is of type u8 (8 bits, unsigned). Fix this by removing such comparison and updating the type of variable cid to u8 in the caller function. Addresses-Coverity-ID: 1473079 ("Unsigned compared against 0") Fixes: b9010f105f21 ("wil6210: add FT roam support for AP and station") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-08-28wil6210: add FT roam support for AP and stationAhmad Masri1-3/+347
This feature is needed for enterprise APs and clients to enable fast roaming as defined in 802.11r between APs in the same ESS. On AP side, this feature is supported only when disable_ap_sme is enabled. Signed-off-by: Ahmad Masri <amasri@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-07-31wil6210: off channel transmit management frames in AP modeAhmad Masri1-0/+56
Currently wil6210 ignores the channel field in the cfg80211_mgmt_tx_params struct for wil_cfg80211_ops mgmt_tx operation and sends all management frames on the serving channel. Add support for off-channel transmission of management frames (WIPHY_FLAG_OFFCHAN_TX) in AP mode. This is useful in enterprise APs for sending custom probe request frames. Signed-off-by: Ahmad Masri <amasri@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-07-31wil6210: add support for link statisticsDedy Lansky1-0/+165
Driver can request FW to report link statistics using WMI_LINK_STATS_CMDID. FW will report statistics with WMI_LINK_STATS_EVENTID. Two categories of statistics defined: basic and global. New "link_stats" debugfs is used for requesting basic statistics report (write) and for reading the basic statistics (read). "link_stats_global" debugfs is used for requesting and reading the global statistics. Signed-off-by: Dedy Lansky <dlansky@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-07-02wil6210: remove crash dump collection from OTP sectionMaya Erez1-43/+43
In some cases where the device is stuck, reading from OTP can timeout. As OTP section is known there is no need to read it during device crash dump collection. Adding a new field to struct fw_map to indicate if to include this section in crash dump collection. Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-07-02wil6210: add support for enhanced DMA RX data flowsGidon Studinski1-3/+56
Enhanced DMA RX data path is handled using a single RX descriptor ring for all VIFs. Multiple RX status rings are supported, to allow RSS and multi MSI support. The driver gets the RX completions via the RX status rings. The RX status message includes the completed RX buffer ID, which points to the allocated SKB. The enhanced DMA RX data flow supports RX chaining, where multiple SKBs are merged into a single packet. Enhanced DMA HW supports RX HW reorder offload, enabled by default for Talyn-MB. amsdu_en debugfs entry was added to allow control MSDU aggregation. Use the following command to disable AMSDU (enabled by default): echo 0 > amsdu_en Signed-off-by: Gidon Studinski <gidons@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-07-02wil6210: initialize TX and RX enhanced DMA ringsGidon Studinski1-17/+299
Enhanced DMA design includes the following rings: - Single RX descriptor ring is used for all VIFs - Multiple RX status rings are supported, to allow RSS - TX descriptor ring is allocated per connection - A single TX status ring is used for all TX descriptor rings This patch initializes and frees the above descriptor and status rings. The RX SKBs are handled by a new entity of RX buffers manager, which handles RX buffers, each one points to an allocated SKB. During Rx completion processing, the driver extracts a buffer ID which is used as an index to the buffers array. After the SKB is freed the buffer is moved from the 'active' list to the 'free' list, indicating it can be used for another descriptor. During Rx refill, SKBs are allocated and attached to 'free' buffers. Those buffers are attached to new descriptors and moved to the 'active' list. New debugfs entries were added to allow edma configuration: Run the following command to configure the number of status rings: echo NUM_OF_STATUS_RINGS > num_rx_status_rings Run the following command to use extended RX status message for additional debug fields from HW: echo 0 > compressed_rx_status Run the following command to control the size of the TX status ring: echo TX_STATUS_RING_ORDER > tx_status_ring_order The status ring size will be 1 << tx_status_ring_order Run the following command to control the size of the RX status ring: echo RX_STATUS_RING_ORDER > rx_status_ring_order Due to HW constrains RX sring order should be bigger than RX ring order The status ring size will be 1 << rx_status_ring_order Run the following command to change the number of RX buffer IDs: echo RX_BUFF_ID_COUNT > rx_buff_id_count Signed-off-by: Gidon Studinski <gidons@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-07-02wil6210: add support for enhanced DMA structuresGidon Studinski1-12/+12
In enhanced DMA the vrings are handled internally by the FW and are not exposed to the driver. Instead, the driver handles descriptor rings, which are mapped by the FW to vrings. The completions of the TX and RX descriptors are notified to the driver using status rings. Each status ring descriptor includes information of the completed descriptors and the ring id of their descriptor ring. This patch changes struct vring to generic wil_ring to allow its reuse for enhanced DMA descriptor rings and adds the descriptor and status rings specific descriptors. The vring debugfs entries have changed as follows: - dbg_vring_index has changed to dbg_ring_index - vrings has changed to rings - vring_idle_trsh has changed to ring_idle_trsh - vring_index has changed to ring_index Signed-off-by: Gidon Studinski <gidons@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-07-02wil6210: add support for Talyn-MB (Talyn ver 2.0) deviceMaya Erez1-0/+55
Add changes to support initialization of Talyn-MB wil6210 device: - Add definition for Talyn-MB new JTAG id - Define talyn_mb_fw_mapping array - Add Talyn-MB reset sequence Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-05-23Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.gitKalle Valo1-39/+113
ath.git patches for 4.18. Major changes: ath10k * add quiet mode support for QCA6174/QCA9377 wil6210 * disable WIL6210_TRACING kconfig option by default
2018-05-12wil6210: Initialize reply struct of the WMI commandsAlexei Avshalom Lazar1-36/+61
WMI command reply saved in uninitialized struct. In order to avoid accessing unset values from FW initialize the reply struct. Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-05-12wil6210: move WMI functionality out of wil_cfg80211_mgmt_txDedy Lansky1-0/+47
Rearrange the code by having new function wmi_mgmt_tx() to take care of the WMI part of wil_cfg80211_mgmt_tx(). Signed-off-by: Dedy Lansky <dlansky@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>