forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/drivers/net/wireless/ath/ath10k/pci.h
....@@ -1,24 +1,14 @@
1
+/* SPDX-License-Identifier: ISC */
12 /*
23 * Copyright (c) 2005-2011 Atheros Communications Inc.
34 * Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
4
- *
5
- * Permission to use, copy, modify, and/or distribute this software for any
6
- * purpose with or without fee is hereby granted, provided that the above
7
- * copyright notice and this permission notice appear in all copies.
8
- *
9
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
165 */
176
187 #ifndef _PCI_H_
198 #define _PCI_H_
209
2110 #include <linux/interrupt.h>
11
+#include <linux/mutex.h>
2212
2313 #include "hw.h"
2414 #include "ce.h"
....@@ -128,6 +118,10 @@
128118
129119 /* Copy Engine used for Diagnostic Accesses */
130120 struct ath10k_ce_pipe *ce_diag;
121
+ /* For protecting ce_diag */
122
+ struct mutex ce_diag_mutex;
123
+
124
+ struct work_struct dump_work;
131125
132126 struct ath10k_ce ce;
133127 struct timer_list rx_post_retry;
....@@ -184,11 +178,16 @@
184178 */
185179 u32 (*targ_cpu_to_ce_addr)(struct ath10k *ar, u32 addr);
186180
181
+ struct ce_attr *attr;
182
+ struct ce_pipe_config *pipe_config;
183
+ struct ce_service_to_pipe *serv_to_pipe;
184
+
187185 /* Keep this entry in the last, memory for struct ath10k_ahb is
188186 * allocated (ahb support enabled case) in the continuation of
189187 * this struct.
190188 */
191
- struct ath10k_ahb ahb[0];
189
+ struct ath10k_ahb ahb[];
190
+
192191 };
193192
194193 static inline struct ath10k_pci *ath10k_pci_priv(struct ath10k *ar)
....@@ -207,7 +206,8 @@
207206 #define CDC_WAR_DATA_CE 4
208207
209208 /* Wait up to this many Ms for a Diagnostic Access CE operation to complete */
210
-#define DIAG_ACCESS_CE_TIMEOUT_MS 10
209
+#define DIAG_ACCESS_CE_TIMEOUT_US 10000 /* 10 ms */
210
+#define DIAG_ACCESS_CE_WAIT_US 50
211211
212212 void ath10k_pci_write32(struct ath10k *ar, u32 offset, u32 value);
213213 void ath10k_pci_soc_write32(struct ath10k *ar, u32 addr, u32 val);