hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/drivers/net/wireless/ath/ath10k/debug.h
....@@ -1,19 +1,8 @@
1
+/* SPDX-License-Identifier: ISC */
12 /*
23 * Copyright (c) 2005-2011 Atheros Communications Inc.
34 * Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
45 * Copyright (c) 2018, The Linux Foundation. All rights reserved.
5
- *
6
- * Permission to use, copy, modify, and/or distribute this software for any
7
- * purpose with or without fee is hereby granted, provided that the above
8
- * copyright notice and this permission notice appear in all copies.
9
- *
10
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
176 */
187
198 #ifndef _DEBUG_H_
....@@ -44,6 +33,7 @@
4433 ATH10K_DBG_USB = 0x00040000,
4534 ATH10K_DBG_USB_BULK = 0x00080000,
4635 ATH10K_DBG_SNOC = 0x00100000,
36
+ ATH10K_DBG_QMI = 0x00200000,
4737 ATH10K_DBG_ANY = 0xffffffff,
4838 };
4939
....@@ -75,11 +65,14 @@
7565 __le16 log_type; /* Type of log information foll this header */
7666 __le16 size; /* Size of variable length log information in bytes */
7767 __le32 timestamp;
78
- u8 payload[0];
68
+ u8 payload[];
7969 } __packed;
8070
8171 /* FIXME: How to calculate the buffer size sanely? */
8272 #define ATH10K_FW_STATS_BUF_SIZE (1024 * 1024)
73
+
74
+#define ATH10K_TX_POWER_MAX_VAL 70
75
+#define ATH10K_TX_POWER_MIN_VAL 0
8376
8477 extern unsigned int ath10k_debug_mask;
8578
....@@ -127,6 +120,13 @@
127120 {
128121 return ar->debug.fw_dbglog_level;
129122 }
123
+
124
+static inline int ath10k_debug_is_extd_tx_stats_enabled(struct ath10k *ar)
125
+{
126
+ return ar->debug.enable_extd_tx_stats;
127
+}
128
+
129
+int ath10k_debug_fw_stats_request(struct ath10k *ar);
130130
131131 #else
132132
....@@ -190,6 +190,16 @@
190190 return 0;
191191 }
192192
193
+static inline int ath10k_debug_is_extd_tx_stats_enabled(struct ath10k *ar)
194
+{
195
+ return 0;
196
+}
197
+
198
+static inline int ath10k_debug_fw_stats_request(struct ath10k *ar)
199
+{
200
+ return 0;
201
+}
202
+
193203 #define ATH10K_DFS_STAT_INC(ar, c) do { } while (0)
194204
195205 #define ath10k_debug_get_et_strings NULL
....@@ -203,12 +213,12 @@
203213 void ath10k_sta_update_rx_duration(struct ath10k *ar,
204214 struct ath10k_fw_stats *stats);
205215 void ath10k_sta_update_rx_tid_stats(struct ath10k *ar, u8 *first_hdr,
206
- unsigned long int num_msdus,
216
+ unsigned long num_msdus,
207217 enum ath10k_pkt_rx_err err,
208
- unsigned long int unchain_cnt,
209
- unsigned long int drop_cnt,
210
- unsigned long int drop_cnt_filter,
211
- unsigned long int queued_msdus);
218
+ unsigned long unchain_cnt,
219
+ unsigned long drop_cnt,
220
+ unsigned long drop_cnt_filter,
221
+ unsigned long queued_msdus);
212222 void ath10k_sta_update_rx_tid_stats_ampdu(struct ath10k *ar,
213223 u16 peer_id, u8 tid,
214224 struct htt_rx_indication_mpdu_range *ranges,
....@@ -222,12 +232,12 @@
222232
223233 static inline
224234 void ath10k_sta_update_rx_tid_stats(struct ath10k *ar, u8 *first_hdr,
225
- unsigned long int num_msdus,
235
+ unsigned long num_msdus,
226236 enum ath10k_pkt_rx_err err,
227
- unsigned long int unchain_cnt,
228
- unsigned long int drop_cnt,
229
- unsigned long int drop_cnt_filter,
230
- unsigned long int queued_msdus)
237
+ unsigned long unchain_cnt,
238
+ unsigned long drop_cnt,
239
+ unsigned long drop_cnt_filter,
240
+ unsigned long queued_msdus)
231241 {
232242 }
233243
....@@ -241,18 +251,18 @@
241251 #endif /* CONFIG_MAC80211_DEBUGFS */
242252
243253 #ifdef CONFIG_ATH10K_DEBUG
244
-__printf(3, 4) void ath10k_dbg(struct ath10k *ar,
245
- enum ath10k_debug_mask mask,
246
- const char *fmt, ...);
254
+__printf(3, 4) void __ath10k_dbg(struct ath10k *ar,
255
+ enum ath10k_debug_mask mask,
256
+ const char *fmt, ...);
247257 void ath10k_dbg_dump(struct ath10k *ar,
248258 enum ath10k_debug_mask mask,
249259 const char *msg, const char *prefix,
250260 const void *buf, size_t len);
251261 #else /* CONFIG_ATH10K_DEBUG */
252262
253
-static inline int ath10k_dbg(struct ath10k *ar,
254
- enum ath10k_debug_mask dbg_mask,
255
- const char *fmt, ...)
263
+static inline int __ath10k_dbg(struct ath10k *ar,
264
+ enum ath10k_debug_mask dbg_mask,
265
+ const char *fmt, ...)
256266 {
257267 return 0;
258268 }
....@@ -264,4 +274,14 @@
264274 {
265275 }
266276 #endif /* CONFIG_ATH10K_DEBUG */
277
+
278
+/* Avoid calling __ath10k_dbg() if debug_mask is not set and tracing
279
+ * disabled.
280
+ */
281
+#define ath10k_dbg(ar, dbg_mask, fmt, ...) \
282
+do { \
283
+ if ((ath10k_debug_mask & dbg_mask) || \
284
+ trace_ath10k_log_dbg_enabled()) \
285
+ __ath10k_dbg(ar, dbg_mask, fmt, ##__VA_ARGS__); \
286
+} while (0)
267287 #endif /* _DEBUG_H_ */