aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex/pcie.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/mwifiex/pcie.h')
-rw-r--r--drivers/net/wireless/mwifiex/pcie.h33
1 files changed, 29 insertions, 4 deletions
diff --git a/drivers/net/wireless/mwifiex/pcie.h b/drivers/net/wireless/mwifiex/pcie.h
index 2f218f9a3fd3..37eeb2ca6b29 100644
--- a/drivers/net/wireless/mwifiex/pcie.h
+++ b/drivers/net/wireless/mwifiex/pcie.h
@@ -114,11 +114,12 @@ struct pcie_service_card {
114 struct pci_dev *dev; 114 struct pci_dev *dev;
115 struct mwifiex_adapter *adapter; 115 struct mwifiex_adapter *adapter;
116 116
117 u8 txbd_flush;
117 u32 txbd_wrptr; 118 u32 txbd_wrptr;
118 u32 txbd_rdptr; 119 u32 txbd_rdptr;
119 u32 txbd_ring_size; 120 u32 txbd_ring_size;
120 u8 *txbd_ring_vbase; 121 u8 *txbd_ring_vbase;
121 phys_addr_t txbd_ring_pbase; 122 dma_addr_t txbd_ring_pbase;
122 struct mwifiex_pcie_buf_desc *txbd_ring[MWIFIEX_MAX_TXRX_BD]; 123 struct mwifiex_pcie_buf_desc *txbd_ring[MWIFIEX_MAX_TXRX_BD];
123 struct sk_buff *tx_buf_list[MWIFIEX_MAX_TXRX_BD]; 124 struct sk_buff *tx_buf_list[MWIFIEX_MAX_TXRX_BD];
124 125
@@ -126,7 +127,7 @@ struct pcie_service_card {
126 u32 rxbd_rdptr; 127 u32 rxbd_rdptr;
127 u32 rxbd_ring_size; 128 u32 rxbd_ring_size;
128 u8 *rxbd_ring_vbase; 129 u8 *rxbd_ring_vbase;
129 phys_addr_t rxbd_ring_pbase; 130 dma_addr_t rxbd_ring_pbase;
130 struct mwifiex_pcie_buf_desc *rxbd_ring[MWIFIEX_MAX_TXRX_BD]; 131 struct mwifiex_pcie_buf_desc *rxbd_ring[MWIFIEX_MAX_TXRX_BD];
131 struct sk_buff *rx_buf_list[MWIFIEX_MAX_TXRX_BD]; 132 struct sk_buff *rx_buf_list[MWIFIEX_MAX_TXRX_BD];
132 133
@@ -134,15 +135,39 @@ struct pcie_service_card {
134 u32 evtbd_rdptr; 135 u32 evtbd_rdptr;
135 u32 evtbd_ring_size; 136 u32 evtbd_ring_size;
136 u8 *evtbd_ring_vbase; 137 u8 *evtbd_ring_vbase;
137 phys_addr_t evtbd_ring_pbase; 138 dma_addr_t evtbd_ring_pbase;
138 struct mwifiex_pcie_buf_desc *evtbd_ring[MWIFIEX_MAX_EVT_BD]; 139 struct mwifiex_pcie_buf_desc *evtbd_ring[MWIFIEX_MAX_EVT_BD];
139 struct sk_buff *evt_buf_list[MWIFIEX_MAX_EVT_BD]; 140 struct sk_buff *evt_buf_list[MWIFIEX_MAX_EVT_BD];
140 141
141 struct sk_buff *cmd_buf; 142 struct sk_buff *cmd_buf;
142 struct sk_buff *cmdrsp_buf; 143 struct sk_buff *cmdrsp_buf;
143 struct sk_buff *sleep_cookie; 144 u8 *sleep_cookie_vbase;
145 dma_addr_t sleep_cookie_pbase;
144 void __iomem *pci_mmap; 146 void __iomem *pci_mmap;
145 void __iomem *pci_mmap1; 147 void __iomem *pci_mmap1;
146}; 148};
147 149
150static inline int
151mwifiex_pcie_txbd_empty(struct pcie_service_card *card, u32 rdptr)
152{
153 if (((card->txbd_wrptr & MWIFIEX_TXBD_MASK) ==
154 (rdptr & MWIFIEX_TXBD_MASK)) &&
155 ((card->txbd_wrptr & MWIFIEX_BD_FLAG_ROLLOVER_IND) !=
156 (rdptr & MWIFIEX_BD_FLAG_ROLLOVER_IND)))
157 return 1;
158
159 return 0;
160}
161
162static inline int
163mwifiex_pcie_txbd_not_full(struct pcie_service_card *card)
164{
165 if (((card->txbd_wrptr & MWIFIEX_TXBD_MASK) !=
166 (card->txbd_rdptr & MWIFIEX_TXBD_MASK)) ||
167 ((card->txbd_wrptr & MWIFIEX_BD_FLAG_ROLLOVER_IND) !=
168 (card->txbd_rdptr & MWIFIEX_BD_FLAG_ROLLOVER_IND)))
169 return 1;
170
171 return 0;
172}
148#endif /* _MWIFIEX_PCIE_H */ 173#endif /* _MWIFIEX_PCIE_H */