Merge tag 'ceph-for-4.14-rc4' of git://github.com/ceph/ceph-client
[sfrench/cifs-2.6.git] / drivers / net / wireless / quantenna / qtnfmac / pearl / pcie_bus_priv.h
1 /*
2  * Copyright (c) 2015-2016 Quantenna Communications, Inc.
3  * All rights reserved.
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  */
16
17 #ifndef _QTN_FMAC_PCIE_H_
18 #define _QTN_FMAC_PCIE_H_
19
20 #include <linux/dma-mapping.h>
21 #include <linux/io.h>
22
23 #include "pcie_regs_pearl.h"
24 #include "pcie_ipc.h"
25 #include "shm_ipc.h"
26
27 struct bus;
28
29 struct qtnf_pcie_bus_priv {
30         struct pci_dev  *pdev;
31
32         /* lock for irq configuration changes */
33         spinlock_t irq_lock;
34
35         /* lock for tx reclaim operations */
36         spinlock_t tx_reclaim_lock;
37         /* lock for tx0 operations */
38         spinlock_t tx0_lock;
39         u8 msi_enabled;
40         int mps;
41
42         struct workqueue_struct *workqueue;
43         struct tasklet_struct reclaim_tq;
44
45         void __iomem *sysctl_bar;
46         void __iomem *epmem_bar;
47         void __iomem *dmareg_bar;
48
49         struct qtnf_shm_ipc shm_ipc_ep_in;
50         struct qtnf_shm_ipc shm_ipc_ep_out;
51
52         struct qtnf_pcie_bda __iomem *bda;
53         void __iomem *pcie_reg_base;
54
55         u16 tx_bd_num;
56         u16 rx_bd_num;
57
58         struct sk_buff **tx_skb;
59         struct sk_buff **rx_skb;
60
61         struct qtnf_tx_bd *tx_bd_vbase;
62         dma_addr_t tx_bd_pbase;
63
64         struct qtnf_rx_bd *rx_bd_vbase;
65         dma_addr_t rx_bd_pbase;
66
67         dma_addr_t bd_table_paddr;
68         void *bd_table_vaddr;
69         u32 bd_table_len;
70
71         u32 rx_bd_w_index;
72         u32 rx_bd_r_index;
73
74         u32 tx_bd_w_index;
75         u32 tx_bd_r_index;
76
77         u32 pcie_irq_mask;
78
79         /* diagnostics stats */
80         u32 pcie_irq_count;
81         u32 pcie_irq_rx_count;
82         u32 pcie_irq_tx_count;
83         u32 pcie_irq_uf_count;
84         u32 tx_full_count;
85         u32 tx_done_count;
86         u32 tx_reclaim_done;
87         u32 tx_reclaim_req;
88 };
89
90 #endif /* _QTN_FMAC_PCIE_H_ */