summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/quantenna/qtnfmac/event.c
Commit message (Collapse)AuthorAgeFilesLines
* wifi: cfg80211: handle DFS per linkAditya Kumar Singh2024-09-061-3/+3
| | | | | | | | | | | | | | | | | | | Currently, during starting a radar detection, no link id information is parsed and passed down. In order to support starting radar detection during Multi Link Operation, it is required to pass link id as well. Add changes to first parse and then pass link id in the start radar detection path. Additionally, update notification APIs to allow drivers/mac80211 to pass the link ID. However, everything is handled at link 0 only until all API's are ready to handle it per link. Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com> Link: https://patch.msgid.link/20240906064426.2101315-6-quic_adisi@quicinc.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: move DFS related members to links[] in wireless_devAditya Kumar Singh2024-09-061-3/+3
| | | | | | | | | | | | | | | | A few members related to DFS handling are currently under per wireless device data structure. However, in order to support DFS with MLO, there is a need to have them on a per-link manner. Hence, as a preliminary step, move members cac_started, cac_start_time and cac_time_ms to be on a per-link basis. Since currently, link ID is not known at all places, use default value of 0 for now. Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com> Link: https://patch.msgid.link/20240906064426.2101315-5-quic_adisi@quicinc.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211/mac80211: move puncturing into chandefJohannes Berg2024-02-081-1/+1
| | | | | | | | | | | | | | | | | | Aloka originally suggested that puncturing should be part of the chandef, so that it's treated correctly. At the time, I disagreed and it ended up not part of the chandef, but I've now realized that this was wrong. Even for clients, the RX, and perhaps more importantly, CCA configuration needs to take puncturing into account. Move puncturing into the chandef, and adjust all the code accordingly. Also add a few tests for puncturing in chandef compatibility checking. Link: https://lore.kernel.org/linux-wireless/20220214223051.3610-1-quic_alokad@quicinc.com/ Suggested-by: Aloka Dixit <quic_alokad@quicinc.com> Link: https://msgid.link/20240129194108.307183a5d2e5.I4d7fe2f126b2366c1312010e2900dfb2abffa0f6@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: remove wdev mutexJohannes Berg2023-09-111-2/+2
| | | | | | | | | Since we're now protecting everything with the wiphy mutex (and were really using it for almost everything before), there's no longer any real reason to have a separate wdev mutex. It may feel better, but really has no value. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: include puncturing bitmap in channel switch eventsAloka Dixit2023-02-141-1/+1
| | | | | | | | | | Add puncturing bitmap in channel switch notifications and corresponding trace functions. Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com> Link: https://lore.kernel.org/r/20230131001227.25014-4-quic_alokad@quicinc.com [fix qtnfmac] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: Extend cfg80211_update_owe_info_event() for MLD APVeerendranath Jakkam2023-02-141-0/+1
| | | | | | | | | | | | | | | | | Add support to offload OWE processing to user space for MLD AP when driver's SME in use. Add new parameters in struct cfg80211_update_owe_info to provide below information in cfg80211_update_owe_info_event() call: - MLO link ID of the AP, with which station requested (re)association. This is applicable for both MLO and non-MLO station connections when the AP affiliated with an MLD. - Station's MLD address if the connection is MLO capable. Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com> Link: https://lore.kernel.org/r/20230126143256.960563-3-quic_vjakkam@quicinc.com [reformat the trace event macro] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: do some rework towards MLO link APIsJohannes Berg2022-06-201-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | In order to support multi-link operation with multiple links, start adding some APIs. The notable addition here is to have the link ID in a new nl80211 attribute, that will be used to differentiate the links in many nl80211 operations. So far, this patch adds the netlink NL80211_ATTR_MLO_LINK_ID attribute (as well as the NL80211_ATTR_MLO_LINKS attribute) and plugs it through the system in some places, checking the validity etc. along with other infrastructure needed for it. For now, I've decided to include only the over-the-air link ID in the API. I know we discussed that we eventually need to have to have other ways of identifying a link, but for local AP mode and auth/assoc commands as well as set_key etc. we'll use the OTA ID. Also included in this patch is some refactoring of the data structures in struct wireless_dev, splitting for the first time the data into type dependent pieces, to make reasoning about these things easier. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* qtnfmac: Fix possible buffer overflow in qtnf_event_handle_external_authLee Gibson2021-04-221-2/+4
| | | | | | | | | | | Function qtnf_event_handle_external_auth calls memcpy without checking the length. A user could control that length and trigger a buffer overflow. Fix by checking the length is within the maximum allowed size. Signed-off-by: Lee Gibson <leegib@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20210419145842.345787-1-leegib@gmail.com
* qtnfmac: support WPA3 OWE in AP modeSergey Matyukevich2020-03-121-0/+48
| | | | | | | | | | | | Enable WPA3 OWE support in AP mode. Driver currently supports cards that offload OWE processing to userspace. This patch adds all the required tools for such offloading. Firmware requests OWE processing sending new UPDATE_OWE event to driver, which uses cfg80211_update_owe_info_event to notify userspace software. After OWE processing is completed, userspace sends calculated IEs to firmware using update_owe_info cfg80211 callback. Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* qtnfmac: support WPA3 SAE in AP modeSergey Matyukevich2020-03-121-3/+3
| | | | | | | | | | Enable WPA3 SAE support in AP mode. Driver currently supports cards that offload SAE authentication to userspace. So allow userspace software to subscribe and to send AUTH frames. Besides, enable AP mode support in external_auth cfg80211 callback. Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* qtnfmac: fix potential Spectre vulnerabilitiesSergey Matyukevich2020-02-121-3/+6
| | | | | | | | | | | | | Fix potential Spectre vulnerabilities and other warnings reported by smatch: drivers/net/wireless/quantenna/qtnfmac/core.c:49 qtnf_core_get_mac() warn: potential spectre issue 'bus->mac' [r] (local cap) drivers/net/wireless/quantenna/qtnfmac/core.c:51 qtnf_core_get_mac() warn: possible spectre second half. 'mac' drivers/net/wireless/quantenna/qtnfmac/event.c:671 qtnf_event_parse() warn: potential spectre issue 'mac->iflist' [r] (local cap) drivers/net/wireless/quantenna/qtnfmac/pcie/pearl_pcie.c:912 qtnf_pcie_skb_send() warn: variable dereferenced before check 'skb' (see line 881) Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* qtnfmac: cleanup alignment in firmware communication protocolIgor Mitsyanko2020-02-121-44/+14
| | | | | | | | | | | | Make sure that all elements in QLINK protocol message are aligned to 4 bytes. For this purpose add necessary amount of padding bytes to each message. Besides, add padding for non-aligned variable length fields, e.g. SSID, so that the first byte of the next variable length element is aligned. to 4 bytes. Finally, introduce TLV parsing helpers to reduce boilerplate TLV parsing code. Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* qtnfmac: handle MIC failure event from firmwareSergey Matyukevich2019-11-141-0/+40
| | | | | | | | Report MIC failure from firmware to cfg80211 subsystem using dedicated callback cfg80211_michael_mic_failure. Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* qtnfmac: fix invalid channel information outputSergey Matyukevich2019-11-141-3/+4
| | | | | | | | Do not attempt to print frequency for an invalid channel provided by firmware. That channel may simply not exist. Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* qtnfmac: handle channel switch events for connected stations onlySergey Matyukevich2019-04-261-5/+11
| | | | | | | | | Channel switch events from firmware should be processed only when STA is already connected to BSS. On connect this notification is not needed since full BSS info will be supplied by cfg80211_connect_result. Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* qtnfmac: enable WPA3 SAE supportSergey Matyukevich2019-02-081-0/+41
| | | | | | | | | | | | | | | | In the case of SAE AP, drivers offload authentication to user-space software, e.g. hostapd. For FullMAC drivers the procedure is as follows. If auth_type is SAE and user space indicates external authentication capability, then driver requests authentication offload to user-space software using cfg80211_external_auth_request call. From that point, auth frame exchange is performed transparently for driver: user-space software sends/receives mgmt frames using mgmt_tx/mgmt_frame_register cfg80211 callbacks. As soon as authenitcation is completed, user-space software notifies driver about its status using external_auth cfg80211 callback. Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* qtnfmac: enable WPA3 OWE supportSergey Matyukevich2019-02-081-43/+101
| | | | | | | | | | | In the case of OWE, STA should be able to pass DH IEs from AP assoc responses to wpa_s for processing. For this purpose DH IEs are received from firmware in BSS_JOIN events and passed to wireless core and then to wpa_s as additional optional rsp_ies parameter for cfg80211_connect_result. Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* qtnfmac: add missing bss record to host scan cacheSergey Matyukevich2019-02-011-4/+75
| | | | | | | | Make sure that valid BSS entry exists in wireless core record even in the case of successful connect reported by firmware. Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* qtnfmac: convert to SPDX license identifiersSergey Matyukevich2019-02-011-15/+2
| | | | | | | | Replace textual license with SPDX-License-Identifier. Add an SPDX-License-Identifier for the Makefile. Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* qtnfmac: do not track STA states in driverSergey Matyukevich2018-10-051-17/+1
| | | | | | | | Remove STA connection states tracking from driver. Leave it wireless core on host and to firmware. Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* qtnfmac: fix invalid STA state on EAPOL failureSergey Matyukevich2018-05-301-5/+3
| | | | | | | | | | | | | | | | | Driver switches vif sta_state into QTNF_STA_CONNECTING when cfg80211 core initiates connect procedure. Further this state is changed either to QTNF_STA_CONNECTED or to QTNF_STA_DISCONNECTED by BSS_JOIN and BSS_LEAVE events from firmware. However it is possible that no such events will be sent by firmware, e.g. if EAPOL timed out. In this case vif sta_mode will remain in QTNF_STA_CONNECTING state and all subsequent connection attempts will fail with -EBUSY error code. Fix this by perfroming STA state transition from QTNF_STA_CONNECTING to QTNF_STA_DISCONNECTED in cfg80211 disconnect callback. No need to rely upon firmware events in this case. Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* wireless-drivers: Dynamically allocate struct station_infoToke Høiland-Jørgensen2018-05-121-14/+27
| | | | | | | | | | | Since the addition of the TXQ stats to cfg80211, the station_info struct has grown to be quite large, which results in warnings when allocated on the stack. Fix the affected places to do dynamic allocations instead. Fixes: 52539ca89f36 ("cfg80211: Expose TXQ stats and parameters to userspace") Reviewed-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* qtnfmac: add DFS offload supportDmitry Lebed2018-04-241-0/+11
| | | | | | | | | | | DFS offload support implemented: - DFS_OFFLOAD feature is advertised depending on HW capabilities - CAC_STARTED event forwarding from HW implemented - start_radar_detection() callback now returning -ENOTSUPP if DFS_OFFLOAD is enabled Signed-off-by: Dmitry Lebed <dlebed@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* qtnfmac: do not use bus mutex for events processingIgor Mitsyanko2018-01-241-2/+2
| | | | | | | | | | | | | Events processing requires locking of bus mutex, which is also used by cfg80211 layer before calling several of cfg80211 callbacks. Since all cfg80211 callbacks in qtnfmac driver also lock bus mutex, this potentially may lead to a deadlock. Do not use bus lock for event processing. Use RTNL lock instead to serialize events and commands processing threads. Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* qtnfmac: keeping track of "generation" for STA infoIgor Mitsyanko2018-01-091-2/+3
| | | | | | | | | Keep generation in per-VIF data structure and increment it whenever STA list is changed. Use generation value to fill struct station_info when required. Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* qtnfmac: fix rssi data passed to wireless coreSergey Matyukevich2018-01-091-4/+3
| | | | | | | | | | | | Fix RSSI values passed to wireless core by qtnfmac driver: - fix RSSI values in scan results: driver registers wiphy with CFG80211_SIGNAL_TYPE_MBM signal type, so mBm should be passed using DBM_TO_MBM macro - accompany firmware changes fixing RSSI values in received mgmt frames update qlink message format and pass correct signed values to core Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* qtnfmac: add support for radar detection and CACIgor Mitsyanko2018-01-091-0/+61
| | | | | | | | | Implement two parts of radar handling logic: - cfg80211 .start_radar_detect callback to allow nl80211 to initiate CAC - radar event to allow wlan device to advertize CAC and radar events Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* qtnfmac: pass complete channel data between driver and firmwareSergey Matyukevich2018-01-091-1/+2
| | | | | | | | | | Center frequency is not enough to describe the channel in HT and VHT modes. For 40MHz and 80MHz channels both primary channel and center frequency should be specified in order to qualify channel completely. This change adds primary channel info into qlink_chandef structure. Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* qtnfmac: SCAN results: retreive frame type information from "IE set" TLVIgor Mitsyanko2017-11-101-13/+12
| | | | | | | | | | "IE set" TLV carries the same information as qlink_event_scan_result::frame_type. Convert the event to make use of TLV and drop frame_type member. While at it, make qlink_event_scan_result structure alignement-safe. Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* qtnfmac: extend "IE set" TLV to include frame type infoIgor Mitsyanko2017-11-101-24/+34
| | | | | | | | | Specifying frame type for "IE set" TLV will allow to use several TLVs in a single message. Modify users accordingly. Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers.gitKalle Valo2017-10-161-2/+0
|\ | | | | | | | | Mark Brown reported that there are conflicts in iwlwifi between the two trees so fix those now.
| * qtnfmac: cancel scans on wireless interface changesSergey Matyukevich2017-09-201-2/+0
| | | | | | | | | | | | | | | | | | | | Cancel active scans and deactivate firmware scan watchdog timer when wireless interface configuration is changed. The usecases include wireless interface mode change, interface down, AP stop, virtual interface removal. Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | qtnfmac: do not cache current channel info in driver's stateIgor Mitsyanko2017-10-131-2/+0
| | | | | | | | | | | | | | | | | | Linux Wireless device structure already has current channel information that can be used when needed. Start using it. Since driver's channel info is not used anymore, remove it. Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | qtnfmac: get rid of QTNF_STATE_AP_START flagIgor Mitsyanko2017-10-131-12/+0
| | | | | | | | | | | | | | | | | | QTNF_STATE_AP_START usage is redundant and imposes additional state synchronization maintenance. We may as well leave state checking to network card and upper layers (cfg80211, nl80211 and userspace). Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | qtnfmac: do not report channel changes until wiphy is registeredIgor Mitsyanko2017-09-251-0/+3
| | | | | | | | | | | | | | | | | | | | | | Wireless device may send "channel changed" event before driver registered this device with wireless core, which will result in warnings. Once device is registered, higher layer will query channel info manually using .get_channel callback. Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | qtnfmac: remove unused mac::status fieldIgor Mitsyanko2017-09-251-2/+0
| | | | | | | | | | | | | | There are no users of this field and it can safely be removed. Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | qtnfmac: do not cache CSA chandef infoIgor Mitsyanko2017-09-251-7/+1
| | | | | | | | | | | | | | | | It is never used for anything useful, and all logic is handled by either WiFi card or higher layers. Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | qtnfmac: make "Channel change" event report full channel infoIgor Mitsyanko2017-09-251-16/+13
|/ | | | | | | | | | Specifically, it has to report center frequency, secondary center frequency (for 80+80) and BW. Introduce channel definition structure to qlink and modify channel change event processing function accordingly. Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* qtnfmac: implement scan timeoutSergey Matyukevich2017-08-031-0/+2
| | | | | | | | | | | Userspace tools may hang on scan in the case when scan completion event is not returned by firmware. This patch implements the scan timeout to avoid such situation. Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com> Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Avinash Patil <avinashp@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* qtnfmac: implement cfg80211 channel_switch handlerSergey Matyukevich2017-08-031-0/+61
| | | | | | | | | | | | | | This patch implements cfg80211 channel_switch handler enabling CSA channel-switch procedure. Driver performs only basic validation of the requested new channel and then sends command to firmware. Beacon IEs are not sent since beacon update is handled by firmware. Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com> Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Avinash Patil <avinashp@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* qtnfmac: fix station leave reason endiannessSergey Matyukevich2017-08-031-2/+2
| | | | | | | | | Use proper endianness conversion for client station leave reason. Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com> Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Avinash Patil <avinashp@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* qtnfmac: introduce new FullMAC driver for Quantenna chipsetsIgor Mitsyanko2017-05-241-0/+452
This patch adds support for new FullMAC WiFi driver for Quantenna QSR10G chipsets. QSR10G (aka Pearl) is Quantenna's 8x8, 160M, 11ac offering. QSR10G supports 2 simultaneous WMACs - one 5G and one 2G. 5G WMAC supports 160M, 8x8 configuration. FW supports up to 8 concurrent virtual interfaces on each WMAC. Patch introduces 2 new drivers: - qtnfmac.ko for interfacing with kernel wireless core - qtnfmac_pearl_pcie.ko for interfacing with hardware over PCIe interface Signed-off-by: Dmitrii Lebed <dlebed@quantenna.com> Signed-off-by: Sergei Maksimenko <smaksimenko@quantenna.com> Signed-off-by: Sergey Matyukevich <smatyukevich@quantenna.com> Signed-off-by: Bindu Therthala <btherthala@quantenna.com> Signed-off-by: Huizhao Wang <hwang@quantenna.com> Signed-off-by: Kamlesh Rath <krath@quantenna.com> Signed-off-by: Avinash Patil <avinashp@quantenna.com> Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>