summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/ath11k/ahb.c
diff options
context:
space:
mode:
authorGovindaraj Saminathan <quic_gsaminat@quicinc.com>2023-05-26 12:41:07 +0300
committerKalle Valo <quic_kvalo@quicinc.com>2023-06-01 13:30:49 +0300
commitb43310e44edc823a7f02af1e1e2b4e8a9abc7d91 (patch)
treeb28fadff6883d0d90ef2214e9eddb2088de4048b /drivers/net/wireless/ath/ath11k/ahb.c
parent86f85575a3f6a20cef1c8bb98e78585fe3a53ccc (diff)
downloadlinux-b43310e44edc823a7f02af1e1e2b4e8a9abc7d91.tar.xz
wifi: ath11k: factory test mode support
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
Diffstat (limited to 'drivers/net/wireless/ath/ath11k/ahb.c')
-rw-r--r--drivers/net/wireless/ath/ath11k/ahb.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c
index 5cbba9a8b6ba..32911fa6e505 100644
--- a/drivers/net/wireless/ath/ath11k/ahb.c
+++ b/drivers/net/wireless/ath/ath11k/ahb.c
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: BSD-3-Clause-Clear
/*
* Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#include <linux/module.h>
@@ -1155,6 +1155,7 @@ static int ath11k_ahb_probe(struct platform_device *pdev)
ab->hif.ops = hif_ops;
ab->pdev = pdev;
ab->hw_rev = hw_rev;
+ ab->fw_mode = ATH11K_FIRMWARE_MODE_NORMAL;
platform_set_drvdata(pdev, ab);
ret = ath11k_pcic_register_pci_ops(ab, pci_ops);