summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/ath11k/wmi.h
AgeCommit message (Collapse)AuthorFilesLines
2024-03-21wifi: ath11k: remove duplicate definitions in wmi.hKang Yang1-6/+0
There are some duplicate definitions in wmi.h, remove them. No functional changes, compile tested only. Signed-off-by: Kang Yang <quic_kangyang@quicinc.com> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://msgid.link/20240314021654.304451-1-quic_kangyang@quicinc.com
2024-03-14wifi: ath11k: change WLAN_SCAN_PARAMS_MAX_IE_LEN from 256 to 512Kang Yang1-1/+1
Mac80211 needs more space for P2P scan ie in P2P mode, 256 is not enough, resize it to 512. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.37 Tested-on: QCA2066 hw2.1 PCI WLAN.HSP.1.1-03926.13-QCAHSPSWPL_V2_SILICONZ_CE-2.52297.2 Signed-off-by: Kang Yang <quic_kangyang@quicinc.com> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://msgid.link/20240228093537.25052-5-quic_kangyang@quicinc.com
2024-03-14wifi: ath11k: implement handling of P2P NoA eventKang Yang1-0/+31
The NoA(Notice of Absence) attribute is used by the P2P Group Owner to signal its absence due to power save timing, concurrent operation, or off-channel scanning. It is also used in the P2P Presence Request-Response mechanism. The NoA attribute shall be present in the P2P IE in the beacon frames transmitted by a P2P Group Owner when a NoA schedule is being advertised, or when the CTWindow is non-zero. So add support to update P2P information after P2P GO is up through event WMI_P2P_NOA_EVENTID, and always put it in probe resp. Create p2p.c and p2p.h for P2P related functions and definitions. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.37 Tested-on: QCA2066 hw2.1 PCI WLAN.HSP.1.1-03926.13-QCAHSPSWPL_V2_SILICONZ_CE-2.52297.2 Signed-off-by: Kang Yang <quic_kangyang@quicinc.com> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://msgid.link/20240228093537.25052-4-quic_kangyang@quicinc.com
2024-03-14wifi: ath11k: add P2P IE in beacon templateKang Yang1-0/+9
P2P Element is a necessary component of P2P protocol communication. It contains the Vendor Specific Information Element which includes the WFA OUI and an OUI Type indicating P2P. Add P2P IE in beacon template, and implement WMI interface for it. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.37 Tested-on: QCA2066 hw2.1 PCI WLAN.HSP.1.1-03926.13-QCAHSPSWPL_V2_SILICONZ_CE-2.52297.2 Signed-off-by: Kang Yang <quic_kangyang@quicinc.com> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://msgid.link/20240228093537.25052-3-quic_kangyang@quicinc.com
2024-03-08wifi: ath11k: remove obsolete struct wmi_start_scan_argJeff Johnson1-29/+1
ath11k inherited struct wmi_start_scan_arg from ath10k. However, in ath11k, this struct is unused -- struct scan_req_params is used for this functionality. So remove the unused struct. No functional changes, compile tested only. Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://msgid.link/20240226-ath11k-obsolete-wmi_start_scan_arg-v1-1-c0b94c6e191d@quicinc.com
2024-02-15wifi: ath11k: remove unused scan_events from struct scan_req_paramsNicolas Escande1-18/+13
As discussed lets remove the unused scan_events field from struct scan_req_params. Also, as it is not needed anymore, remove the underlying union wrapping too. No functionnal changes. Link: https://lore.kernel.org/all/4be7d62e-cb59-462d-aac2-94e27efc22ff@quicinc.com/ Signed-off-by: Nicolas Escande <nico.escande@gmail.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://msgid.link/20240211151036.1950292-1-nico.escande@gmail.com
2024-02-14wifi: ath11k: Remove scan_flags union from struct scan_req_paramsNicolas Escande1-30/+25
Now that we do not use scan_flags directly with WMI_SCAN_XXX macros anymore but only the bitfield scan_f_xxx, lets remove the scan_flags & the underlying union. This will prevent further problems as some entries in the scan_f_xxx bitfield don't match their corresponding WMI_SCAN_XXX flags as seen in [1] [1] https://lore.kernel.org/all/20231127180559.1696041-1-nico.escande@gmail.com/ Signed-off-by: Nicolas Escande <nico.escande@gmail.com> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://msgid.link/20240209113536.266822-3-nico.escande@gmail.com
2024-01-14wifi: ath11k: add handler for WMI_VDEV_SET_TPC_POWER_CMDIDWen Gong1-0/+57
Add the handler for WMI_VDEV_SET_TPC_POWER_CMDID, it is for 6 GHz band. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 Signed-off-by: Wen Gong <quic_wgong@quicinc.com> Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://msgid.link/20231218085844.2658-12-quic_bqiang@quicinc.com
2024-01-14wifi: ath11k: add WMI_TLV_SERVICE_EXT_TPC_REG_SUPPORT service bitWen Gong1-0/+1
Firmware advertises support for SERVICE_EXT_TPC_REG via a WMI service bit. Add the definition of this service bit so that a subsequent patch can check whether or not firmware supports this service. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 Signed-off-by: Wen Gong <quic_wgong@quicinc.com> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com> Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://msgid.link/20231218085844.2658-11-quic_bqiang@quicinc.com
2024-01-14wifi: ath11k: save max transmit power in vdev start response event from firmwareWen Gong1-0/+1
Save the max transmit power received in the vdev start response event from firmware. A subsequent patch will use this to calculate the final power value for WMI_VDEV_SET_TPC_POWER_CMDID. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 Signed-off-by: Wen Gong <quic_wgong@quicinc.com> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com> Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://msgid.link/20231218085844.2658-9-quic_bqiang@quicinc.com
2024-01-14wifi: ath11k: update regulatory rules when interface addedWen Gong1-0/+1
There are two power types for 6 GHz regulatory, one is AP, another is client. When firmware boots up, WMI_REG_CHAN_LIST_CC_EXT_EVENTID is sent from firmware at an early stage, the interface mode is not decided at this point, then ath11k select reg rules of AP type as default. After interface is created, it is exactly decided the interface type such as AP/mesh point/station. Then ath11k need to update reg rules to the exact power type matched to the interface type. The client power type is used for station interface, and AP power type is used for AP/mesh point interface. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 Signed-off-by: Wen Gong <quic_wgong@quicinc.com> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com> Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://msgid.link/20231218085844.2658-5-quic_bqiang@quicinc.com
2024-01-14wifi: ath11k: store cur_regulatory_info for each radioWen Gong1-0/+1
The regulatory info of WMI_REG_CHAN_LIST_CC_EXT_EVENTID is not saved in ath11k now, the info should be saved in ath11k. Save the info for each radio and support switch regulatory rules dynamically. As mac.c will also call ath11k_reg_handle_chan_list() in next patches move the function to reg.c. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 Signed-off-by: Wen Gong <quic_wgong@quicinc.com> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com> Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://msgid.link/20231218085844.2658-3-quic_bqiang@quicinc.com
2023-12-18wifi: ath11k: refactor ath11k_wmi_tlv_parse_alloc()Dmitry Antipov1-2/+2
Since 'ath11k_wmi_tlv_parse_alloc()' always operates on 'skb->data, skb->len' tuple, it may be simplified to pass the only 'skb' argument instead (which also implies refactoring of 'ath11k_pull_bcn_tx_status_ev()' and 'ath11k_pull_chan_info_ev()' in the same way). Compile tested only. Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://msgid.link/20231214161117.75145-1-dmantipov@yandex.ru
2023-11-30wifi: ath11k: Update Qualcomm Innovation Center, Inc. copyrightsJeff Johnson1-1/+1
Update the copyright for all ath11k files modified on behalf of Qualcomm Innovation Center, Inc. in 2021 through 2023. Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/20231128-ath12kcopyrights-v1-2-be0b7408cbac@quicinc.com
2023-11-22wifi: ath11k: Consolidate WMI peer flagsJeff Johnson1-41/+18
Currently wmi.h has two separate set of definitions for peer flags. One set of flags is defined in enum wmi_tlv_peer_flags, and, except for the last three, are named WMI_TLV_PEER_*. The other set of flags are defined as macros, and are named WMI_PEER_*. The last three macros have the same name as the last three wmi_tlv_peer_flags enumerators. The code only uses the WMI_PEER_* names; the WMI_TLV_PEER_* names are unused. So as a first step in consolidation, remove all the WMI_TLV_PEER_* names. But since having an enum to define all the flags is actually a good thing since that provides a handle by which to refer to the entire set of flags, recast the WMI_PEER_* macros into enumerators. Compile tested only. Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/20231106-ath-peer-flags-v1-3-781e83b7e8e8@quicinc.com
2023-11-22wifi: ath11k: Remove obsolete struct wmi_peer_flags_map *peer_flagsJeff Johnson1-2/+0
Currently both struct ath11k_pdev_wmi and struct ath11k_wmi_base define: const struct wmi_peer_flags_map *peer_flags; But that member is not used, and in fact, struct wmi_peer_flags_map is not defined within ath11k; these are obsolete remnants inherited from ath10k. So remove them. Compile tested only. Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/20231106-ath-peer-flags-v1-1-781e83b7e8e8@quicinc.com
2023-06-01wifi: ath11k: factory test mode supportGovindaraj Saminathan1-0/+22
Add support to process factory test mode commands (FTM) for calibration. By default firmware start with NORMAL mode and to process the FTM commands firmware needs to be restarted in FTM mode using module parameter ftm_mode. The pre-request is all the radios should be down before starting the test. When start command ATH11K_TM_CMD_TESTMODE_START is received, ar->state is set to Test Mode. If the FTM command or event length is greater than 256 bytes, it will be broken down into multiple segments and encoded with TLV header if it is segmented commands, else it is sent to firmware as it is. On receiving UTF event from firmware, if it is segmented event, the driver will wait until it receives all the segments and notify the complete data to user application. In case the segmented sequence are missed or lost from the firmware, driver will skip the already received partial data. In case of unsegmented UTF event from firmware, driver notifies the data to the user application as it comes. Applications handles the data further. Command to boot in ftm mode: insmod ath11k ftm_mode=1 Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Signed-off-by: Govindaraj Saminathan <quic_gsaminat@quicinc.com> Co-developed-by: Sowmiya Sree Elavalagan <quic_ssreeela@quicinc.com> Signed-off-by: Sowmiya Sree Elavalagan <quic_ssreeela@quicinc.com> Signed-off-by: Raj Kumar Bhagat <quic_rajkbhag@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/20230517135934.16408-4-quic_rajkbhag@quicinc.com
2023-05-09wifi: ath11k: EMA beacon supportAloka Dixit1-1/+10
Add new function ath11k_mac_setup_bcn_tmpl_ema() which invokes the new API provided by MAC80211 to retrieve EMA beacons. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com> Co-developed-by: John Crispin <john@phrozen.org> Signed-off-by: John Crispin <john@phrozen.org> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/20230405221648.17950-8-quic_alokad@quicinc.com
2023-05-09wifi: ath11k: MBSSID parameter configuration in AP modeAloka Dixit1-1/+2
Include MBSSID parameters in WMI vdev up operation. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com> Co-developed-by: John Crispin <john@phrozen.org> Signed-off-by: John Crispin <john@phrozen.org> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/20230405221648.17950-5-quic_alokad@quicinc.com
2023-05-09wifi: ath11k: rename MBSSID fields in wmi_vdev_up_cmdAloka Dixit1-3/+3
Rename trans_bssid to tx_vdev_bssid to make it similar to vdev_bssid. Rename profile_num to nontx_profile_cnt, and profile_idx to nontx_profile_idx which makes it clear that these store configurations related to MBSSID non-transmitting profiles. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/20230405221648.17950-4-quic_alokad@quicinc.com
2023-05-09wifi: ath11k: MBSSID configuration during vdev create/startAloka Dixit1-0/+19
Configure multiple BSSID flags and index of the transmitting interface in vdev create/start commands depending on the service bit WMI_TLV_SERVICE_MBSS_PARAM_IN_VDEV_START_SUPPORT. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com> Co-developed-by: John Crispin <john@phrozen.org> Signed-off-by: John Crispin <john@phrozen.org> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/20230405221648.17950-3-quic_alokad@quicinc.com
2023-05-09wifi: ath11k: driver settings for MBSSID and EMAAloka Dixit1-0/+6
Advertise the driver support for multiple BSSID (MBSSID) and enhanced multi-BSSID advertisements (EMA) by setting extended capabilities. Configure mbssid_max_interfaces and ema_max_profile_periodicity fields in structure wiphy which are used to advertise maximum number of interfaces and profile periodicity supported by the driver. Add new WMI fields to configure maximum vdev count supported for MBSSID and profile periodicity in case of EMA. Setting WMI_RSRC_CFG_FLAG2_CALC_NEXT_DTIM_COUNT_SET flag indicates that the firmware should track and update the DTIM counts for each non-transmitted profile. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com> Co-developed-by: John Crispin <john@phrozen.org> Signed-off-by: John Crispin <john@phrozen.org> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/20230405221648.17950-2-quic_alokad@quicinc.com
2023-05-05wifi: ath11k: Use list_count_nodes()Christophe JAILLET1-3/+0
ath11k_wmi_fw_stats_num_vdevs() and ath11k_wmi_fw_stats_num_bcn() really look the same as list_count_nodes(), so use the latter instead of hand writing it. The first ones use list_for_each_entry() and the other list_for_each(), but they both count the number of nodes in the list. While at it, also remove to prototypes of non-existent functions. Based on the names and prototypes, it is likely that they should be equivalent to list_count_nodes(). Compile tested only. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/941484caae24b89d20524b1a5661dd1fd7025492.1682542084.git.christophe.jaillet@wanadoo.fr
2023-04-12wifi: ath11k: Send 11d scan start before WMI_START_SCAN_CMDIDManikanta Pubbisetty1-0/+1
Firmwares advertising the support of triggering 11d algorithm on the scan results of a regular scan expects driver to send WMI_11D_SCAN_START_CMDID before sending WMI_START_SCAN_CMDID. Triggering 11d algorithm on the scan results of a normal scan helps in completely avoiding a separate 11d scan for determining regdomain. This indirectly helps in speeding up connections on station interfaces on the chipsets supporting 11D scan. To enable this feature, send WMI_11D_SCAN_START_CMDID just before sending WMI_START_SCAN_CMDID if the firmware advertises WMI_TLV_SERVICE_SUPPORT_11D_FOR_HOST_SCAN service flag. WCN6750 & WCN6855 supports this feature. Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-01160-QCAMSLSWPLZ-1 Tested-on: WCN6855 hw2.1 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 Signed-off-by: Manikanta Pubbisetty <quic_mpubbise@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/20230315161817.29627-1-quic_mpubbise@quicinc.com
2023-04-12wifi: ath11k: Optimize 6 GHz scan timeManikanta Pubbisetty1-0/+4
Currently, time taken to scan all supported channels on WCN6750 is ~8 seconds and connection time is almost 10 seconds. WCN6750 supports three Wi-Fi bands (i.e., 2.4/5/6 GHz) and the numbers of channels for scan come around ~100 channels (default case). Since the chip doesn't have support for DBS (Dual Band Simultaneous), scans cannot be parallelized resulting in longer scan times. Among the 100 odd channels, ~60 channels are in 6 GHz band. Therefore, optimizing the scan for 6 GHz channels will bring down the overall scan time. WCN6750 firmware has support to scan a 6 GHz channel based on co-located AP information i.e., RNR IE which is found in the legacy 2.4/5 GHz scan results. When a scan request with all supported channel list is enqueued to the firmware, then based on WMI_SCAN_CHAN_FLAG_SCAN_ONLY_IF_RNR_FOUND scan channel flag, firmware will scan only those 6 GHz channels for which RNR IEs are found in the legacy scan results. In the proposed design, based on NL80211_SCAN_FLAG_COLOCATED_6GHZ scan flag, driver will set the WMI_SCAN_CHAN_FLAG_SCAN_ONLY_IF_RNR_FOUND flag for non-PSC channels. Since there is high probability to find 6 GHz APs on PSC channels, these channels are always scanned. Only non-PSC channels are selectively scanned based on cached RNR information from the legacy scan results. If NL80211_SCAN_FLAG_COLOCATED_6GHZ is not set in the scan flags, then scan will happen on all supported channels (default behavior). With these optimizations, scan time is improved by 1.5-1.8 seconds on WCN6750. Similar savings have been observed on WCN6855. Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1 Tested-on: WCN6855 hw2.1 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.16 Signed-off-by: Manikanta Pubbisetty <quic_mpubbise@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/20230323060913.10097-1-quic_mpubbise@quicinc.com
2023-03-13wifi: ath11k: add debug prints in regulatory WMI event processingAditya Kumar Singh1-0/+142
Add some more debug prints in processing regulatory WMI event in order to increase more debuggability. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/20230110121024.14051-4-quic_adisi@quicinc.com
2023-03-13wifi: ath11k: add support to parse new WMI event for 6 GHzAditya Kumar Singh1-11/+152
In order to support different power levels of 6 GHz AP and client, new WMI event for regulatory - WMI_REG_CHAN_LIST_CC_EXT_EVENTID is added in firmware. This event provides new parameters required for 6 GHz regulatory rules. Add support for parsing 2.4 GHz, 5 GHz and 6 GHz reg rules and other parameters from WMI_REG_CHAN_LIST_CC_EXT_EVENTID. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 Signed-off-by: Lavanya Suresh <quic_lavaks@quicinc.com> Signed-off-by: Wen Gong <quic_wgong@quicinc.com> Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/20230110121024.14051-3-quic_adisi@quicinc.com
2023-03-13wifi: ath11k: use proper regulatory reference for bandsAditya Kumar Singh1-14/+14
Currently, during regulatory event, 2 GHz/5 GHz is referred to as 2G/5G including variable names. However, there is no such entity as 2G or 5G. Re-name such occurences to its proper name. No functional changes. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/20230110121024.14051-2-quic_adisi@quicinc.com
2023-03-01wifi: ath11k: Add tx ack signal support for management packetsAbinaya Kalaiselvan1-0/+3
Add support to notify tx ack signal values for management packets to userspace through nl80211 interface. Advertise NL80211_EXT_FEATURE_ACK_SIGNAL_SUPPORT flag to enable this feature and it will be used for data packets as well. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Signed-off-by: Abinaya Kalaiselvan <quic_akalaise@quicinc.com> Signed-off-by: Maharaja Kennadyrajan <quic_mkenna@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/20221219053844.4084486-1-quic_mkenna@quicinc.com
2023-02-27wifi: ath11k: push MU-MIMO params from hostapd to hardwareMuna Sinada1-0/+3
In the previous behaviour only HE IE in management frames are changed regarding MU-MIMO configurations and not in hardware. Adding push of MU-MIMO configurations to the hardware as well. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00356-QCAHKSWPL_SILICONZ-1 Co-developed-by: Anilkumar Kolli <quic_akolli@quicinc.com> Signed-off-by: Anilkumar Kolli <quic_akolli@quicinc.com> Signed-off-by: Muna Sinada <quic_msinada@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/1666128501-12364-3-git-send-email-quic_msinada@quicinc.com
2023-02-27wifi: ath11k: modify accessor macros to match index sizeMuna Sinada1-11/+13
HE PHY is only 11 bytes, therefore it should be using byte indexes instead of dword. Change corresponding macros to reflect this. Signed-off-by: Muna Sinada <quic_msinada@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/1666128501-12364-2-git-send-email-quic_msinada@quicinc.com
2023-02-17wifi: ath11k: Set ext passive scan flag to adjust passive scan start timeTamizh Chelvam Raja1-0/+3
Set the WMI_SCAN_FLAG_EXT_PASSIVE_SCAN_START_TIME_ENHANCE flag while sending the scan command. If this flag is enabled when the incoming scan request comes with a strict start time and its duration overlaps with next TBTT, then target adjust the start time accordingly for passive scan. Target supporting this feature will advertise WMI_TLV_SERVICE_PASSIVE_SCAN_START_TIME_ENHANCE. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-01467-QCAHKSWPL_SILICONZ-1 Signed-off-by: Tamizh Chelvam Raja <quic_tamizhr@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/20221222131720.11368-1-quic_tamizhr@quicinc.com
2023-01-17wifi: ath11k: Add support to configure FTM responder roleSowmiya Sree Elavalagan1-0/+1
Fine Timing Measurement(FTM) support is used to measure round trip time between two nodes. Enable FTM responder feature using hw_params on supported device. Since FTM functionality is offloaded to firmware, adding the interface allows user space to enable or disable FTM responder. Also add support for advertising the same in extended capabilities. QCA6390, WCN6855 and WCN6750 do not support this feature. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Signed-off-by: Sowmiya Sree Elavalagan <quic_ssreeela@quicinc.com> Signed-off-by: Raj Kumar Bhagat <quic_rajkbhag@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/20221220044435.10506-1-quic_rajkbhag@quicinc.com
2022-09-26wifi: ath11k: Add support to get power save duration for each clientVenkateswara Naralasetty1-0/+21
Add support to get the following power save information through debugfs interface, * Current ps state of the peer * Time duration since the peer is in power save * Total duration of the peer spent in power save Above information is helpful in debugging the issues with power save clients. This patch also add trace log support for PS timekeeper to track the PS state change of the peers alongs with the peer MAC address and timestamp. Use the below commands to get the above power save information, To know the time_since_station_in_power_save: cat /sys/kernel/debug/ieee80211/phyX/netdev:wlanX/stations/ XX:XX:XX:XX:XX:XX/current_ps_duration To know power_save_duration: cat /sys/kernel/debug/ieee80211/phyX/netdev:wlanX/stations/ XX:XX:XX:XX:XX:XX/total_ps_duration To reset the power_save_duration of all stations connected to AP: echo 1 > /sys/kernel/debug/ieee80211/phyX/ath11k/reset_ps_duration To enable/disable the ps_timekeeper: echo Y > /sys/kernel/debug/ieee80211/phyX/ath11k/ps_timekeeper_enable Y = 1 to enable and Y = 0 to disable. To record PS timekeeer logs after enabling ps_timekeeper: trace-cmd record -e ath11k_ps_timekeeper Tested-on: Tested-on: IPQ8074 WLAN.HK.2.5.0.1-00991-QCAHKSWPL_SILICONZ-1 Signed-off-by: Venkateswara Naralasetty <quic_vnaralas@quicinc.com> Signed-off-by: Tamizh Chelvam Raja <quic_tamizhr@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/20220725054601.14719-1-quic_tamizhr@quicinc.com
2022-09-19wifi: ath11k: Include STA_KEEPALIVE_ARP_RESPONSE TLV header by defaultBaochen Qiang1-1/+1
In current code STA_KEEPALIVE_ARP_RESPONSE TLV header is included only when ARP method is used, this causes firmware always to crash when wowlan is enabled because firmware needs it to be present no matter ARP method is used or not. Fix this issue by including STA_KEEPALIVE_ARP_RESPONSE TLV header by default. Also fix below typo: s/WMI_TAG_STA_KEEPALVE_ARP_RESPONSE/WMI_TAG_STA_KEEPALIVE_ARP_RESPONSE/ Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3 Fixes: 0f84a156aa3b ("ath11k: Handle keepalive during WoWLAN suspend and resume") Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/20220913044358.2037-1-quic_bqiang@quicinc.com
2022-09-16wifi: ath11k: Fix kernel-doc issuesJeff Johnson1-10/+10
Fix documentation issues reported by kernel-doc: - Incorrect use of /** for non-kernel-doc comments - Mismatch between documented and actual identifiers - Incorrect identifier syntax Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/20220909151246.22961-1-quic_jjohnson@quicinc.com
2022-09-16wifi: ath11k: Fix miscellaneous spelling errorsJeff Johnson1-3/+3
Fix misspellings flagged by 'codespell'. Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/20220909145535.20437-1-quic_jjohnson@quicinc.com
2022-09-02wifi: ath11k: Add TWT debugfs support for STA interfaceManikanta Pubbisetty1-1/+22
Currently TWT debugfs files required for manually testing the TWT feature are created only for the AP interfaces; these debugfs hooks are also required for the station interfaces in order to test the TWT feature manually, therefore create these debugfs hooks for station iftype as well. In the case of station interfaces, TWT is entirely handled in the firmware based on input parameters passed to it during association via TWT enable WMI command. In order to manually test this feature, firmware expects to first disable the TWT feature and then send the enable command with sta_cong_timer_ms parameter set to 0. This is true for WCN6750, QCA6390 & WCN6855 hardwares. Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1 Signed-off-by: Manikanta Pubbisetty <quic_mpubbise@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/20220720135150.22193-2-quic_mpubbise@quicinc.com
2022-07-27Revert "ath11k: add support for hardware rfkill for QCA6390"Kalle Valo1-25/+0
This reverts commit ec038c6127fa772d2c5604e329f22371830d5fa6. Tyler reported that on L390 Yoga Thinkpad with QCA6390 the suspend was failing because of this commit. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.9 Link: https://bugzilla.kernel.org/show_bug.cgi?id=215881 Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/20220708164656.29549-1-kvalo@kernel.org
2022-05-10ath11k: Handle keepalive during WoWLAN suspend and resumeBaochen Qiang1-0/+46
With WoWLAN enabled and after sleeping for a rather long time, we are seeing that with some APs, it is not able to wake up the STA though the correct wake up pattern has been configured. This is because the host doesn't send keepalive command to firmware, thus firmware will not send any packet to the AP and after a specific time the AP kicks out the STA. Fix this issue by enabling keepalive before going to suspend and disabling it after resume back. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/20220506012540.1579604-1-quic_bqiang@quicinc.com
2022-04-23ath11k: Add support for SARBaochen Qiang1-0/+27
Add ath11k_mac_op_set_bios_sar_specs() to ath11k_ops, this function is called when user space application calls NL80211_CMD_SET_SAR_SPECS. ath11k also registers SAR type and frequency ranges to wiphy so user space can query SAR capabilities. This feature is currently enabled for WCN6855. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-02431-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/20220401120948.1312956-3-quic_bqiang@quicinc.com
2022-04-23ath11k: add support for extended wmi service bitWen Gong1-2/+7
When the WMI service bits are reported from firmware they are divided into multiple segments, with 128 bits in each segment. The first segment is processed by ath11k_wmi_service_bitmap_copy(), the second segment is processed by ath11k_service_available_event() with WMI_TAG_SERVICE_AVAILABLE_EVENT. When the service bit exceed 256 bits, then firmware reports it by tag WMI_TAG_ARRAY_UINT32 in WMI_SERVICE_AVAILABLE_EVENTID. Currently ath11k does not process the third segment. Upcoming features need to know if firmware support is available for the features, so add processing of the third segment. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Signed-off-by: Wen Gong <quic_wgong@quicinc.com> Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/20220401120948.1312956-2-quic_bqiang@quicinc.com
2022-04-05ath11k: Change max no of active probe SSID and BSSID to fw capabilityKarthikeyan Kathirvel1-10/+2
The maximum number of SSIDs in a for active probe requests is currently reported as 16 (WLAN_SCAN_PARAMS_MAX_SSID) when registering the driver. The scan_req_params structure only has the capacity to hold 10 SSIDs. This leads to a buffer overflow which can be triggered from wpa_supplicant in userspace. When copying the SSIDs into the scan_req_params structure in the ath11k_mac_op_hw_scan route, it can overwrite the extraie pointer. Firmware supports 16 ssid * 4 bssid, for each ssid 4 bssid combo probe request will be sent, so totally 64 probe requests supported. So set both max ssid and bssid to 16 and 4 respectively. Remove the redundant macros of ssid and bssid. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01300-QCAHKSWPL_SILICONZ-1 Signed-off-by: Karthikeyan Kathirvel <quic_kathirve@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/20220329150221.21907-1-quic_kathirve@quicinc.com
2022-03-18ath11k: support GTK rekey offloadCarl Huang1-0/+49
Host sets GTK related info to firmware before WoW is enabled, and gets rekey replay_count and then disables GTK rekey when WoW quits. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Carl Huang <quic_cjhuang@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/1644308006-22784-7-git-send-email-quic_cjhuang@quicinc.com
2022-03-18ath11k: support ARP and NS offloadCarl Huang1-0/+47
Support ARP and NS offload in WoW state. Tested this way: put machine A with QCA6390 to WoW state, ping/ping6 machine A from another machine B, check sniffer to see any ARP response and Neighbour advertisement from machine A. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Carl Huang <quic_cjhuang@quicinc.com> Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/1644308006-22784-6-git-send-email-quic_cjhuang@quicinc.com
2022-03-18ath11k: implement hardware data filterCarl Huang1-0/+15
Host needs to set hardware data filter before entering WoW to let firmware drop needless broadcast/mulitcast frames to avoid frequent wakeup. Host clears hardware data filter when leaving WoW. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Carl Huang <quic_cjhuang@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/1644308006-22784-4-git-send-email-quic_cjhuang@quicinc.com
2022-03-18ath11k: Add WoW net-detect functionalityCarl Huang1-0/+169
Implement net-detect feature by setting flag WIPHY_WOWLAN_NET_DETECT if firmware supports this feature. Driver sets the related PNO configuration to firmware before entering WoW and firmware then scans periodically and wakes up host if a specific SSID is found. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Carl Huang <quic_cjhuang@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/1644308006-22784-3-git-send-email-quic_cjhuang@quicinc.com
2022-03-18ath11k: Add basic WoW functionalitiesCarl Huang1-3/+73
Implement basic WoW functionalities such as magic-packet, disconnect and pattern. The logic is very similar to ath10k. When WoW is configured, ath11k_core_suspend and ath11k_core_resume are skipped as WoW configuration and hif suspend/resume are done in ath11k_wow_op_suspend() and ath11k_wow_op_resume(). Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Carl Huang <quic_cjhuang@quicinc.com> Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com> Signed-off-by: Wen Gong <quic_wgong@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/1644308006-22784-2-git-send-email-quic_cjhuang@quicinc.com
2022-02-01ath11k: add WMI calls to manually add/del/pause/resume TWT dialogsJohn Crispin1-0/+114
These calls are used for debugging and will be required for WFA certification tests. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-01179-QCAHKSWPL_SILICONZ-1 Signed-off-by: John Crispin <john@phrozen.org> Signed-off-by: Aloka Dixit <alokad@codeaurora.org> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/20220131031043.1295-1-alokad@codeaurora.org
2022-02-01ath11k: Add debugfs interface to configure firmware debug log levelSeevalamuthu Mariappan1-0/+18
Add debugfs interface "fw_dbglog_config" to configure firmware log level. Configuration is done via WMI command WMI_DBGLOG_CFG_CMDID. Command to configure, echo "<dbglog_param> <values>" > /sys/kernel/debug/ath11k/<hw>/macX/fw_dbglog_config where dbglog_param can be, 1) WMI_DEBUG_LOG_PARAM_LOG_LEVEL - configure log level for a given module here, <values> = <0xaaaa00bb>, 'aaaa' - module id and 'bb' - loglevel 2) WMI_DEBUG_LOG_PARAM_VDEV_ENABLE - enable debug log for a given vdev here, <values> = vdev_id 3) WMI_DEBUG_LOG_PARAM_VDEV_DISABLE - disable debug log for a given vdev except ERROR logs here, <values> = vdev_id 4) WMI_DEBUG_LOG_PARAM_VDEV_ENABLE_BITMAP - set vdev enable bitmap here, <values> = vdev_enable_bitmap 5) WMI_DEBUG_LOG_PARAM_MOD_ENABLE_BITMAP - set a given log level to all the modules specified in the module bitmap. Command to configure for this log param, $ echo "5 <values> <module_id_index> <is_end>" > /sys/kernel/debug/ath11k/<hw>/macX/fw_dbglog_config here, <values> = <0xaaaaaaaa000000bb>, 'aaaaaaaa' - module bitmap and 'bb' - loglevel <module_id_index> = index of module bitmap. Max module id is 512. So, module_id_index is 0-15. <is_end> = to indicate if more configuration to follow. 6) WMI_DEBUG_LOG_PARAM_WOW_MOD_ENABLE_BITMAP - Wow mode specific logging enable. Command to configure for this log param, $ echo "6 <values> <module_id_index> <is_end>" > /sys/kernel/debug/ath11k/<hw>/macX/fw_dbglog_config here, <values> = <0xaaaaaaaa000000bb>, 'aaaaaaaa' - module bitmap and 'bb' - loglevel <module_id_index> = index of module bitmap. Max module id is 512. So, module_id_index is 0-15. <is_end> = to indicate if more configuration to follow. Sample command usage, To enable module WLAN_MODULE_WMI and log level ATH11K_FW_DBGLOG_VERBOSE, echo "1 0x10001" > /sys/kernel/debug/ath11k/<hw>/macX/fw_dbglog_config To enable module bit map from 32 to 63 and log level ATH11K_FW_DBGLOG_VERBOSE, echo "5 0xffffffff00000001 1 1" > /sys/kernel/debug/ath11k/<hw>/macX/fw_dbglog_config Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.4.0.1-01734-QCAHKSWPL_SILICONZ-1 Signed-off-by: Seevalamuthu Mariappan <quic_seevalam@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/1642405103-32302-1-git-send-email-quic_seevalam@quicinc.com