| .. | .. |
|---|
| 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 | | - * 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. |
|---|
| 16 | 5 | */ |
|---|
| 17 | 6 | |
|---|
| 18 | 7 | #ifndef _PCI_H_ |
|---|
| 19 | 8 | #define _PCI_H_ |
|---|
| 20 | 9 | |
|---|
| 21 | 10 | #include <linux/interrupt.h> |
|---|
| 11 | +#include <linux/mutex.h> |
|---|
| 22 | 12 | |
|---|
| 23 | 13 | #include "hw.h" |
|---|
| 24 | 14 | #include "ce.h" |
|---|
| .. | .. |
|---|
| 128 | 118 | |
|---|
| 129 | 119 | /* Copy Engine used for Diagnostic Accesses */ |
|---|
| 130 | 120 | struct ath10k_ce_pipe *ce_diag; |
|---|
| 121 | + /* For protecting ce_diag */ |
|---|
| 122 | + struct mutex ce_diag_mutex; |
|---|
| 123 | + |
|---|
| 124 | + struct work_struct dump_work; |
|---|
| 131 | 125 | |
|---|
| 132 | 126 | struct ath10k_ce ce; |
|---|
| 133 | 127 | struct timer_list rx_post_retry; |
|---|
| .. | .. |
|---|
| 184 | 178 | */ |
|---|
| 185 | 179 | u32 (*targ_cpu_to_ce_addr)(struct ath10k *ar, u32 addr); |
|---|
| 186 | 180 | |
|---|
| 181 | + struct ce_attr *attr; |
|---|
| 182 | + struct ce_pipe_config *pipe_config; |
|---|
| 183 | + struct ce_service_to_pipe *serv_to_pipe; |
|---|
| 184 | + |
|---|
| 187 | 185 | /* Keep this entry in the last, memory for struct ath10k_ahb is |
|---|
| 188 | 186 | * allocated (ahb support enabled case) in the continuation of |
|---|
| 189 | 187 | * this struct. |
|---|
| 190 | 188 | */ |
|---|
| 191 | | - struct ath10k_ahb ahb[0]; |
|---|
| 189 | + struct ath10k_ahb ahb[]; |
|---|
| 190 | + |
|---|
| 192 | 191 | }; |
|---|
| 193 | 192 | |
|---|
| 194 | 193 | static inline struct ath10k_pci *ath10k_pci_priv(struct ath10k *ar) |
|---|
| .. | .. |
|---|
| 207 | 206 | #define CDC_WAR_DATA_CE 4 |
|---|
| 208 | 207 | |
|---|
| 209 | 208 | /* 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 |
|---|
| 211 | 211 | |
|---|
| 212 | 212 | void ath10k_pci_write32(struct ath10k *ar, u32 offset, u32 value); |
|---|
| 213 | 213 | void ath10k_pci_soc_write32(struct ath10k *ar, u32 addr, u32 val); |
|---|