ipq806x: kernel ramoops storage for C2600/AD7200
[openwrt/staging/ansuel.git] / package / kernel / mac80211 / patches / ath10k / 081-02-ath10k-turn-rawmode-into-frame-mode.patch
1 From a09740548275a74b897654b3aca5af589289b57a Mon Sep 17 00:00:00 2001
2 From: Sergey Ryazanov <ryazanov.s.a@gmail.com>
3 Date: Mon, 16 May 2022 13:26:00 +0300
4 Subject: ath10k: turn rawmode into frame_mode
5
6 Turn boolean rawmode module param into integer frame_mode param that
7 contains value from ath10k_hw_txrx_mode enum. As earlier the default
8 param value is non-RAW (native Wi-Fi) encapsulation. The param name
9 is selected to be consistent with the similar ath11k param.
10
11 This is a preparation step for upcoming encapsulation offloading
12 support.
13
14 Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
15 Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
16 Link: https://lore.kernel.org/r/20220516032519.29831-4-ryazanov.s.a@gmail.com
17 ---
18 drivers/net/wireless/ath/ath10k/core.c | 11 +++++++----
19 drivers/net/wireless/ath/ath10k/core.h | 1 +
20 2 files changed, 8 insertions(+), 4 deletions(-)
21
22 --- a/drivers/net/wireless/ath/ath10k/core.c
23 +++ b/drivers/net/wireless/ath/ath10k/core.c
24 @@ -32,9 +32,11 @@ EXPORT_SYMBOL(ath10k_debug_mask);
25 static unsigned int ath10k_cryptmode_param;
26 static bool uart_print;
27 static bool skip_otp;
28 -static bool rawmode;
29 static bool fw_diag_log;
30
31 +/* frame mode values are mapped as per enum ath10k_hw_txrx_mode */
32 +unsigned int ath10k_frame_mode = ATH10K_HW_TXRX_NATIVE_WIFI;
33 +
34 unsigned long ath10k_coredump_mask = BIT(ATH10K_FW_CRASH_DUMP_REGISTERS) |
35 BIT(ATH10K_FW_CRASH_DUMP_CE_DATA);
36
37 @@ -43,15 +45,16 @@ module_param_named(debug_mask, ath10k_de
38 module_param_named(cryptmode, ath10k_cryptmode_param, uint, 0644);
39 module_param(uart_print, bool, 0644);
40 module_param(skip_otp, bool, 0644);
41 -module_param(rawmode, bool, 0644);
42 module_param(fw_diag_log, bool, 0644);
43 +module_param_named(frame_mode, ath10k_frame_mode, uint, 0644);
44 module_param_named(coredump_mask, ath10k_coredump_mask, ulong, 0444);
45
46 MODULE_PARM_DESC(debug_mask, "Debugging mask");
47 MODULE_PARM_DESC(uart_print, "Uart target debugging");
48 MODULE_PARM_DESC(skip_otp, "Skip otp failure for calibration in testmode");
49 MODULE_PARM_DESC(cryptmode, "Crypto mode: 0-hardware, 1-software");
50 -MODULE_PARM_DESC(rawmode, "Use raw 802.11 frame datapath");
51 +MODULE_PARM_DESC(frame_mode,
52 + "Datapath frame mode (0: raw, 1: native wifi (default))");
53 MODULE_PARM_DESC(coredump_mask, "Bitfield of what to include in firmware crash file");
54 MODULE_PARM_DESC(fw_diag_log, "Diag based fw log debugging");
55
56 @@ -2487,7 +2490,7 @@ static int ath10k_core_init_firmware_fea
57 ar->htt.max_num_amsdu = ATH10K_HTT_MAX_NUM_AMSDU_DEFAULT;
58 ar->htt.max_num_ampdu = ATH10K_HTT_MAX_NUM_AMPDU_DEFAULT;
59
60 - if (rawmode) {
61 + if (ath10k_frame_mode == ATH10K_HW_TXRX_RAW) {
62 if (!test_bit(ATH10K_FW_FEATURE_RAW_MODE_SUPPORT,
63 fw_file->fw_features)) {
64 ath10k_err(ar, "rawmode = 1 requires support from firmware");
65 --- a/drivers/net/wireless/ath/ath10k/core.h
66 +++ b/drivers/net/wireless/ath/ath10k/core.h
67 @@ -1311,6 +1311,7 @@ static inline bool ath10k_peer_stats_ena
68 return false;
69 }
70
71 +extern unsigned int ath10k_frame_mode;
72 extern unsigned long ath10k_coredump_mask;
73
74 void ath10k_core_napi_sync_disable(struct ath10k *ar);