.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: ISC */ |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (c) 2005-2011 Atheros Communications Inc. |
---|
3 | 4 | * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. |
---|
4 | 5 | * 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. |
---|
17 | 6 | */ |
---|
18 | 7 | |
---|
19 | 8 | #ifndef _DEBUG_H_ |
---|
.. | .. |
---|
44 | 33 | ATH10K_DBG_USB = 0x00040000, |
---|
45 | 34 | ATH10K_DBG_USB_BULK = 0x00080000, |
---|
46 | 35 | ATH10K_DBG_SNOC = 0x00100000, |
---|
| 36 | + ATH10K_DBG_QMI = 0x00200000, |
---|
47 | 37 | ATH10K_DBG_ANY = 0xffffffff, |
---|
48 | 38 | }; |
---|
49 | 39 | |
---|
.. | .. |
---|
75 | 65 | __le16 log_type; /* Type of log information foll this header */ |
---|
76 | 66 | __le16 size; /* Size of variable length log information in bytes */ |
---|
77 | 67 | __le32 timestamp; |
---|
78 | | - u8 payload[0]; |
---|
| 68 | + u8 payload[]; |
---|
79 | 69 | } __packed; |
---|
80 | 70 | |
---|
81 | 71 | /* FIXME: How to calculate the buffer size sanely? */ |
---|
82 | 72 | #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 |
---|
83 | 76 | |
---|
84 | 77 | extern unsigned int ath10k_debug_mask; |
---|
85 | 78 | |
---|
.. | .. |
---|
127 | 120 | { |
---|
128 | 121 | return ar->debug.fw_dbglog_level; |
---|
129 | 122 | } |
---|
| 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); |
---|
130 | 130 | |
---|
131 | 131 | #else |
---|
132 | 132 | |
---|
.. | .. |
---|
190 | 190 | return 0; |
---|
191 | 191 | } |
---|
192 | 192 | |
---|
| 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 | + |
---|
193 | 203 | #define ATH10K_DFS_STAT_INC(ar, c) do { } while (0) |
---|
194 | 204 | |
---|
195 | 205 | #define ath10k_debug_get_et_strings NULL |
---|
.. | .. |
---|
203 | 213 | void ath10k_sta_update_rx_duration(struct ath10k *ar, |
---|
204 | 214 | struct ath10k_fw_stats *stats); |
---|
205 | 215 | void ath10k_sta_update_rx_tid_stats(struct ath10k *ar, u8 *first_hdr, |
---|
206 | | - unsigned long int num_msdus, |
---|
| 216 | + unsigned long num_msdus, |
---|
207 | 217 | 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); |
---|
212 | 222 | void ath10k_sta_update_rx_tid_stats_ampdu(struct ath10k *ar, |
---|
213 | 223 | u16 peer_id, u8 tid, |
---|
214 | 224 | struct htt_rx_indication_mpdu_range *ranges, |
---|
.. | .. |
---|
222 | 232 | |
---|
223 | 233 | static inline |
---|
224 | 234 | void ath10k_sta_update_rx_tid_stats(struct ath10k *ar, u8 *first_hdr, |
---|
225 | | - unsigned long int num_msdus, |
---|
| 235 | + unsigned long num_msdus, |
---|
226 | 236 | 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) |
---|
231 | 241 | { |
---|
232 | 242 | } |
---|
233 | 243 | |
---|
.. | .. |
---|
241 | 251 | #endif /* CONFIG_MAC80211_DEBUGFS */ |
---|
242 | 252 | |
---|
243 | 253 | #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, ...); |
---|
247 | 257 | void ath10k_dbg_dump(struct ath10k *ar, |
---|
248 | 258 | enum ath10k_debug_mask mask, |
---|
249 | 259 | const char *msg, const char *prefix, |
---|
250 | 260 | const void *buf, size_t len); |
---|
251 | 261 | #else /* CONFIG_ATH10K_DEBUG */ |
---|
252 | 262 | |
---|
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, ...) |
---|
256 | 266 | { |
---|
257 | 267 | return 0; |
---|
258 | 268 | } |
---|
.. | .. |
---|
264 | 274 | { |
---|
265 | 275 | } |
---|
266 | 276 | #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) |
---|
267 | 287 | #endif /* _DEBUG_H_ */ |
---|