Commit 9d11b7bf authored by Karthikeyan Periyasamy's avatar Karthikeyan Periyasamy Committed by Kalle Valo
Browse files

ath11k: add support for spectral scan



spectral scan control interface is exposed through debugfs eentry.
Relayfs is used to collect the spectral data. These interfaces are
similar to ath10k spectral.

spectral debugfs interfaces are below,

echo background > /sys/kernel/debug/ieee80211/phy0/ath11k/spectral_scan_ctl
echo trigger > /sys/kernel/debug/ieee80211/phy0/ath11k/spectral_scan_ctl
iw dev wlan0 scan
echo disable > /sys/kernel/debug/ieee80211/phy0/ath11k/spectral_scan_ctl
cat /sys/kernel/debug/ieee80211/phy0/ath11k/spectral_scan0 > fft_samples.dump

Tested-on: IPQ8074 WLAN.HK.2.1.0.1-01228-QCAHKSWPL_SILICONZ-1

Signed-off-by: default avatarKarthikeyan Periyasamy <periyasa@codeaurora.org>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/1591688014-26441-2-git-send-email-periyasa@codeaurora.org
parent bd647855
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -34,3 +34,12 @@ config ATH11K_TRACING
	depends on ATH11K && EVENT_TRACING
	---help---
	  Select this to use ath11k tracing infrastructure.

config ATH11K_SPECTRAL
	bool "QCA ath11k spectral scan support"
	depends on ATH11K_DEBUGFS
	depends on RELAY
	help
	  Enable ath11k spectral scan support

	  Say Y to enable access to the FFT/spectral data via debugfs.
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ ath11k-$(CONFIG_ATH11K_DEBUGFS) += debug_htt_stats.o debugfs_sta.o
ath11k-$(CONFIG_NL80211_TESTMODE) += testmode.o
ath11k-$(CONFIG_ATH11K_TRACING) += trace.o
ath11k-$(CONFIG_THERMAL) += thermal.o
ath11k-$(CONFIG_ATH11K_SPECTRAL) += spectral.o

# for tracing framework to find trace.h
CFLAGS_trace.o := -I$(src)
+10 −0
Original line number Diff line number Diff line
@@ -400,8 +400,16 @@ static int ath11k_core_pdev_create(struct ath11k_base *ab)
		goto err_dp_pdev_free;
	}

	ret = ath11k_spectral_init(ab);
	if (ret) {
		ath11k_err(ab, "failed to init spectral %d\n", ret);
		goto err_thermal_unregister;
	}

	return 0;

err_thermal_unregister:
	ath11k_thermal_unregister(ab);
err_dp_pdev_free:
	ath11k_dp_pdev_free(ab);
err_mac_unregister:
@@ -414,6 +422,7 @@ static int ath11k_core_pdev_create(struct ath11k_base *ab)

static void ath11k_core_pdev_destroy(struct ath11k_base *ab)
{
	ath11k_spectral_deinit(ab);
	ath11k_thermal_unregister(ab);
	ath11k_mac_unregister(ab);
	ath11k_hif_irq_disable(ab);
@@ -582,6 +591,7 @@ static int ath11k_core_reconfigure_on_crash(struct ath11k_base *ab)
	ath11k_thermal_unregister(ab);
	ath11k_hif_irq_disable(ab);
	ath11k_dp_pdev_free(ab);
	ath11k_spectral_deinit(ab);
	ath11k_hif_stop(ab);
	ath11k_wmi_detach(ab);
	ath11k_dp_pdev_reo_cleanup(ab);
+5 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#include "reg.h"
#include "thermal.h"
#include "dbring.h"
#include "spectral.h"

#define SM(_v, _f) (((_v) << _f##_LSB) & _f##_MASK)

@@ -216,6 +217,7 @@ struct ath11k_vif {

	bool is_started;
	bool is_up;
	bool spectral_enabled;
	u32 aid;
	u8 bssid[ETH_ALEN];
	struct cfg80211_bitrate_mask bitrate_mask;
@@ -541,6 +543,9 @@ struct ath11k {
	u32 cached_ppdu_id;
#ifdef CONFIG_ATH11K_DEBUGFS
	struct ath11k_debug debug;
#endif
#ifdef CONFIG_ATH11K_SPECTRAL
	struct ath11k_spectral spectral;
#endif
	bool dfs_block_radar_events;
	struct ath11k_thermal thermal;
+3 −0
Original line number Diff line number Diff line
@@ -267,6 +267,9 @@ int ath11k_dbring_buffer_release_event(struct ath11k_base *ab,
	}

	switch (ev->fixed.module_id) {
	case WMI_DIRECT_BUF_SPECTRAL:
		ring = ath11k_spectral_get_dbring(ar);
		break;
	default:
		ring = NULL;
		ath11k_warn(ab, "Recv dma buffer release ev on unsupp module %d\n",
Loading