1*6b627f88SBjoern A. Zeeb /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2*6b627f88SBjoern A. Zeeb /*
3*6b627f88SBjoern A. Zeeb * Copyright (C) 2003-2015, 2018-2025 Intel Corporation
4*6b627f88SBjoern A. Zeeb * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
5*6b627f88SBjoern A. Zeeb * Copyright (C) 2016-2017 Intel Deutschland GmbH
6*6b627f88SBjoern A. Zeeb */
7*6b627f88SBjoern A. Zeeb #ifndef __iwl_trans_int_pcie_h__
8*6b627f88SBjoern A. Zeeb #define __iwl_trans_int_pcie_h__
9*6b627f88SBjoern A. Zeeb
10*6b627f88SBjoern A. Zeeb #include <linux/spinlock.h>
11*6b627f88SBjoern A. Zeeb #include <linux/interrupt.h>
12*6b627f88SBjoern A. Zeeb #include <linux/skbuff.h>
13*6b627f88SBjoern A. Zeeb #include <linux/wait.h>
14*6b627f88SBjoern A. Zeeb #include <linux/pci.h>
15*6b627f88SBjoern A. Zeeb #include <linux/timer.h>
16*6b627f88SBjoern A. Zeeb #include <linux/cpu.h>
17*6b627f88SBjoern A. Zeeb
18*6b627f88SBjoern A. Zeeb #include "iwl-fh.h"
19*6b627f88SBjoern A. Zeeb #include "iwl-csr.h"
20*6b627f88SBjoern A. Zeeb #include "iwl-trans.h"
21*6b627f88SBjoern A. Zeeb #include "iwl-debug.h"
22*6b627f88SBjoern A. Zeeb #include "iwl-io.h"
23*6b627f88SBjoern A. Zeeb #include "iwl-op-mode.h"
24*6b627f88SBjoern A. Zeeb #include "iwl-drv.h"
25*6b627f88SBjoern A. Zeeb #include "pcie/iwl-context-info.h"
26*6b627f88SBjoern A. Zeeb
27*6b627f88SBjoern A. Zeeb /*
28*6b627f88SBjoern A. Zeeb * RX related structures and functions
29*6b627f88SBjoern A. Zeeb */
30*6b627f88SBjoern A. Zeeb #define RX_NUM_QUEUES 1
31*6b627f88SBjoern A. Zeeb #define RX_POST_REQ_ALLOC 2
32*6b627f88SBjoern A. Zeeb #define RX_CLAIM_REQ_ALLOC 8
33*6b627f88SBjoern A. Zeeb #define RX_PENDING_WATERMARK 16
34*6b627f88SBjoern A. Zeeb #define FIRST_RX_QUEUE 512
35*6b627f88SBjoern A. Zeeb
36*6b627f88SBjoern A. Zeeb struct iwl_host_cmd;
37*6b627f88SBjoern A. Zeeb
38*6b627f88SBjoern A. Zeeb /*This file includes the declaration that are internal to the
39*6b627f88SBjoern A. Zeeb * trans_pcie layer */
40*6b627f88SBjoern A. Zeeb
41*6b627f88SBjoern A. Zeeb /**
42*6b627f88SBjoern A. Zeeb * struct iwl_rx_mem_buffer - driver-side RX buffer descriptor
43*6b627f88SBjoern A. Zeeb * @page_dma: bus address of rxb page
44*6b627f88SBjoern A. Zeeb * @page: driver's pointer to the rxb page
45*6b627f88SBjoern A. Zeeb * @list: list entry for the membuffer
46*6b627f88SBjoern A. Zeeb * @invalid: rxb is in driver ownership - not owned by HW
47*6b627f88SBjoern A. Zeeb * @vid: index of this rxb in the global table
48*6b627f88SBjoern A. Zeeb * @offset: indicates which offset of the page (in bytes)
49*6b627f88SBjoern A. Zeeb * this buffer uses (if multiple RBs fit into one page)
50*6b627f88SBjoern A. Zeeb */
51*6b627f88SBjoern A. Zeeb struct iwl_rx_mem_buffer {
52*6b627f88SBjoern A. Zeeb dma_addr_t page_dma;
53*6b627f88SBjoern A. Zeeb struct page *page;
54*6b627f88SBjoern A. Zeeb struct list_head list;
55*6b627f88SBjoern A. Zeeb u32 offset;
56*6b627f88SBjoern A. Zeeb u16 vid;
57*6b627f88SBjoern A. Zeeb bool invalid;
58*6b627f88SBjoern A. Zeeb };
59*6b627f88SBjoern A. Zeeb
60*6b627f88SBjoern A. Zeeb /* interrupt statistics */
61*6b627f88SBjoern A. Zeeb struct isr_statistics {
62*6b627f88SBjoern A. Zeeb u32 hw;
63*6b627f88SBjoern A. Zeeb u32 sw;
64*6b627f88SBjoern A. Zeeb u32 err_code;
65*6b627f88SBjoern A. Zeeb u32 sch;
66*6b627f88SBjoern A. Zeeb u32 alive;
67*6b627f88SBjoern A. Zeeb u32 rfkill;
68*6b627f88SBjoern A. Zeeb u32 ctkill;
69*6b627f88SBjoern A. Zeeb u32 wakeup;
70*6b627f88SBjoern A. Zeeb u32 rx;
71*6b627f88SBjoern A. Zeeb u32 tx;
72*6b627f88SBjoern A. Zeeb u32 unhandled;
73*6b627f88SBjoern A. Zeeb };
74*6b627f88SBjoern A. Zeeb
75*6b627f88SBjoern A. Zeeb /**
76*6b627f88SBjoern A. Zeeb * struct iwl_rx_transfer_desc - transfer descriptor
77*6b627f88SBjoern A. Zeeb * @addr: ptr to free buffer start address
78*6b627f88SBjoern A. Zeeb * @rbid: unique tag of the buffer
79*6b627f88SBjoern A. Zeeb * @reserved: reserved
80*6b627f88SBjoern A. Zeeb */
81*6b627f88SBjoern A. Zeeb struct iwl_rx_transfer_desc {
82*6b627f88SBjoern A. Zeeb __le16 rbid;
83*6b627f88SBjoern A. Zeeb __le16 reserved[3];
84*6b627f88SBjoern A. Zeeb __le64 addr;
85*6b627f88SBjoern A. Zeeb } __packed;
86*6b627f88SBjoern A. Zeeb
87*6b627f88SBjoern A. Zeeb #define IWL_RX_CD_FLAGS_FRAGMENTED BIT(0)
88*6b627f88SBjoern A. Zeeb
89*6b627f88SBjoern A. Zeeb /**
90*6b627f88SBjoern A. Zeeb * struct iwl_rx_completion_desc - completion descriptor
91*6b627f88SBjoern A. Zeeb * @reserved1: reserved
92*6b627f88SBjoern A. Zeeb * @rbid: unique tag of the received buffer
93*6b627f88SBjoern A. Zeeb * @flags: flags (0: fragmented, all others: reserved)
94*6b627f88SBjoern A. Zeeb * @reserved2: reserved
95*6b627f88SBjoern A. Zeeb */
96*6b627f88SBjoern A. Zeeb struct iwl_rx_completion_desc {
97*6b627f88SBjoern A. Zeeb __le32 reserved1;
98*6b627f88SBjoern A. Zeeb __le16 rbid;
99*6b627f88SBjoern A. Zeeb u8 flags;
100*6b627f88SBjoern A. Zeeb u8 reserved2[25];
101*6b627f88SBjoern A. Zeeb } __packed;
102*6b627f88SBjoern A. Zeeb
103*6b627f88SBjoern A. Zeeb /**
104*6b627f88SBjoern A. Zeeb * struct iwl_rx_completion_desc_bz - Bz completion descriptor
105*6b627f88SBjoern A. Zeeb * @rbid: unique tag of the received buffer
106*6b627f88SBjoern A. Zeeb * @flags: flags (0: fragmented, all others: reserved)
107*6b627f88SBjoern A. Zeeb * @reserved: reserved
108*6b627f88SBjoern A. Zeeb */
109*6b627f88SBjoern A. Zeeb struct iwl_rx_completion_desc_bz {
110*6b627f88SBjoern A. Zeeb __le16 rbid;
111*6b627f88SBjoern A. Zeeb u8 flags;
112*6b627f88SBjoern A. Zeeb u8 reserved[1];
113*6b627f88SBjoern A. Zeeb } __packed;
114*6b627f88SBjoern A. Zeeb
115*6b627f88SBjoern A. Zeeb /**
116*6b627f88SBjoern A. Zeeb * struct iwl_rxq - Rx queue
117*6b627f88SBjoern A. Zeeb * @id: queue index
118*6b627f88SBjoern A. Zeeb * @bd: driver's pointer to buffer of receive buffer descriptors (rbd).
119*6b627f88SBjoern A. Zeeb * Address size is 32 bit in pre-9000 devices and 64 bit in 9000 devices.
120*6b627f88SBjoern A. Zeeb * In AX210 devices it is a pointer to a list of iwl_rx_transfer_desc's
121*6b627f88SBjoern A. Zeeb * @bd_dma: bus address of buffer of receive buffer descriptors (rbd)
122*6b627f88SBjoern A. Zeeb * @used_bd: driver's pointer to buffer of used receive buffer descriptors (rbd)
123*6b627f88SBjoern A. Zeeb * @used_bd_dma: physical address of buffer of used receive buffer descriptors (rbd)
124*6b627f88SBjoern A. Zeeb * @read: Shared index to newest available Rx buffer
125*6b627f88SBjoern A. Zeeb * @write: Shared index to oldest written Rx packet
126*6b627f88SBjoern A. Zeeb * @write_actual: actual write pointer written to device, since we update in
127*6b627f88SBjoern A. Zeeb * blocks of 8 only
128*6b627f88SBjoern A. Zeeb * @free_count: Number of pre-allocated buffers in rx_free
129*6b627f88SBjoern A. Zeeb * @used_count: Number of RBDs handled to allocator to use for allocation
130*6b627f88SBjoern A. Zeeb * @write_actual:
131*6b627f88SBjoern A. Zeeb * @rx_free: list of RBDs with allocated RB ready for use
132*6b627f88SBjoern A. Zeeb * @rx_used: list of RBDs with no RB attached
133*6b627f88SBjoern A. Zeeb * @need_update: flag to indicate we need to update read/write index
134*6b627f88SBjoern A. Zeeb * @rb_stts: driver's pointer to receive buffer status
135*6b627f88SBjoern A. Zeeb * @rb_stts_dma: bus address of receive buffer status
136*6b627f88SBjoern A. Zeeb * @lock: per-queue lock
137*6b627f88SBjoern A. Zeeb * @queue: actual rx queue. Not used for multi-rx queue.
138*6b627f88SBjoern A. Zeeb * @next_rb_is_fragment: indicates that the previous RB that we handled set
139*6b627f88SBjoern A. Zeeb * the fragmented flag, so the next one is still another fragment
140*6b627f88SBjoern A. Zeeb * @napi: NAPI struct for this queue
141*6b627f88SBjoern A. Zeeb * @queue_size: size of this queue
142*6b627f88SBjoern A. Zeeb *
143*6b627f88SBjoern A. Zeeb * NOTE: rx_free and rx_used are used as a FIFO for iwl_rx_mem_buffers
144*6b627f88SBjoern A. Zeeb */
145*6b627f88SBjoern A. Zeeb struct iwl_rxq {
146*6b627f88SBjoern A. Zeeb int id;
147*6b627f88SBjoern A. Zeeb void *bd;
148*6b627f88SBjoern A. Zeeb dma_addr_t bd_dma;
149*6b627f88SBjoern A. Zeeb void *used_bd;
150*6b627f88SBjoern A. Zeeb dma_addr_t used_bd_dma;
151*6b627f88SBjoern A. Zeeb u32 read;
152*6b627f88SBjoern A. Zeeb u32 write;
153*6b627f88SBjoern A. Zeeb u32 free_count;
154*6b627f88SBjoern A. Zeeb u32 used_count;
155*6b627f88SBjoern A. Zeeb u32 write_actual;
156*6b627f88SBjoern A. Zeeb u32 queue_size;
157*6b627f88SBjoern A. Zeeb struct list_head rx_free;
158*6b627f88SBjoern A. Zeeb struct list_head rx_used;
159*6b627f88SBjoern A. Zeeb bool need_update, next_rb_is_fragment;
160*6b627f88SBjoern A. Zeeb void *rb_stts;
161*6b627f88SBjoern A. Zeeb dma_addr_t rb_stts_dma;
162*6b627f88SBjoern A. Zeeb spinlock_t lock;
163*6b627f88SBjoern A. Zeeb struct napi_struct napi;
164*6b627f88SBjoern A. Zeeb struct iwl_rx_mem_buffer *queue[RX_QUEUE_SIZE];
165*6b627f88SBjoern A. Zeeb };
166*6b627f88SBjoern A. Zeeb
167*6b627f88SBjoern A. Zeeb /**
168*6b627f88SBjoern A. Zeeb * struct iwl_rb_allocator - Rx allocator
169*6b627f88SBjoern A. Zeeb * @req_pending: number of requests the allcator had not processed yet
170*6b627f88SBjoern A. Zeeb * @req_ready: number of requests honored and ready for claiming
171*6b627f88SBjoern A. Zeeb * @rbd_allocated: RBDs with pages allocated and ready to be handled to
172*6b627f88SBjoern A. Zeeb * the queue. This is a list of &struct iwl_rx_mem_buffer
173*6b627f88SBjoern A. Zeeb * @rbd_empty: RBDs with no page attached for allocator use. This is a list
174*6b627f88SBjoern A. Zeeb * of &struct iwl_rx_mem_buffer
175*6b627f88SBjoern A. Zeeb * @lock: protects the rbd_allocated and rbd_empty lists
176*6b627f88SBjoern A. Zeeb * @alloc_wq: work queue for background calls
177*6b627f88SBjoern A. Zeeb * @rx_alloc: work struct for background calls
178*6b627f88SBjoern A. Zeeb */
179*6b627f88SBjoern A. Zeeb struct iwl_rb_allocator {
180*6b627f88SBjoern A. Zeeb atomic_t req_pending;
181*6b627f88SBjoern A. Zeeb atomic_t req_ready;
182*6b627f88SBjoern A. Zeeb struct list_head rbd_allocated;
183*6b627f88SBjoern A. Zeeb struct list_head rbd_empty;
184*6b627f88SBjoern A. Zeeb spinlock_t lock;
185*6b627f88SBjoern A. Zeeb struct workqueue_struct *alloc_wq;
186*6b627f88SBjoern A. Zeeb struct work_struct rx_alloc;
187*6b627f88SBjoern A. Zeeb };
188*6b627f88SBjoern A. Zeeb
189*6b627f88SBjoern A. Zeeb /**
190*6b627f88SBjoern A. Zeeb * iwl_get_closed_rb_stts - get closed rb stts from different structs
191*6b627f88SBjoern A. Zeeb * @trans: transport pointer (for configuration)
192*6b627f88SBjoern A. Zeeb * @rxq: the rxq to get the rb stts from
193*6b627f88SBjoern A. Zeeb * Return: last closed RB index
194*6b627f88SBjoern A. Zeeb */
iwl_get_closed_rb_stts(struct iwl_trans * trans,struct iwl_rxq * rxq)195*6b627f88SBjoern A. Zeeb static inline u16 iwl_get_closed_rb_stts(struct iwl_trans *trans,
196*6b627f88SBjoern A. Zeeb struct iwl_rxq *rxq)
197*6b627f88SBjoern A. Zeeb {
198*6b627f88SBjoern A. Zeeb if (trans->mac_cfg->device_family >= IWL_DEVICE_FAMILY_AX210) {
199*6b627f88SBjoern A. Zeeb __le16 *rb_stts = rxq->rb_stts;
200*6b627f88SBjoern A. Zeeb
201*6b627f88SBjoern A. Zeeb return le16_to_cpu(READ_ONCE(*rb_stts));
202*6b627f88SBjoern A. Zeeb } else {
203*6b627f88SBjoern A. Zeeb struct iwl_rb_status *rb_stts = rxq->rb_stts;
204*6b627f88SBjoern A. Zeeb
205*6b627f88SBjoern A. Zeeb return le16_to_cpu(READ_ONCE(rb_stts->closed_rb_num)) & 0xFFF;
206*6b627f88SBjoern A. Zeeb }
207*6b627f88SBjoern A. Zeeb }
208*6b627f88SBjoern A. Zeeb
209*6b627f88SBjoern A. Zeeb #ifdef CONFIG_IWLWIFI_DEBUGFS
210*6b627f88SBjoern A. Zeeb /**
211*6b627f88SBjoern A. Zeeb * enum iwl_fw_mon_dbgfs_state - the different states of the monitor_data
212*6b627f88SBjoern A. Zeeb * debugfs file
213*6b627f88SBjoern A. Zeeb *
214*6b627f88SBjoern A. Zeeb * @IWL_FW_MON_DBGFS_STATE_CLOSED: the file is closed.
215*6b627f88SBjoern A. Zeeb * @IWL_FW_MON_DBGFS_STATE_OPEN: the file is open.
216*6b627f88SBjoern A. Zeeb * @IWL_FW_MON_DBGFS_STATE_DISABLED: the file is disabled, once this state is
217*6b627f88SBjoern A. Zeeb * set the file can no longer be used.
218*6b627f88SBjoern A. Zeeb */
219*6b627f88SBjoern A. Zeeb enum iwl_fw_mon_dbgfs_state {
220*6b627f88SBjoern A. Zeeb IWL_FW_MON_DBGFS_STATE_CLOSED,
221*6b627f88SBjoern A. Zeeb IWL_FW_MON_DBGFS_STATE_OPEN,
222*6b627f88SBjoern A. Zeeb IWL_FW_MON_DBGFS_STATE_DISABLED,
223*6b627f88SBjoern A. Zeeb };
224*6b627f88SBjoern A. Zeeb #endif
225*6b627f88SBjoern A. Zeeb
226*6b627f88SBjoern A. Zeeb /**
227*6b627f88SBjoern A. Zeeb * enum iwl_shared_irq_flags - level of sharing for irq
228*6b627f88SBjoern A. Zeeb * @IWL_SHARED_IRQ_NON_RX: interrupt vector serves non rx causes.
229*6b627f88SBjoern A. Zeeb * @IWL_SHARED_IRQ_FIRST_RSS: interrupt vector serves first RSS queue.
230*6b627f88SBjoern A. Zeeb */
231*6b627f88SBjoern A. Zeeb enum iwl_shared_irq_flags {
232*6b627f88SBjoern A. Zeeb IWL_SHARED_IRQ_NON_RX = BIT(0),
233*6b627f88SBjoern A. Zeeb IWL_SHARED_IRQ_FIRST_RSS = BIT(1),
234*6b627f88SBjoern A. Zeeb };
235*6b627f88SBjoern A. Zeeb
236*6b627f88SBjoern A. Zeeb /**
237*6b627f88SBjoern A. Zeeb * enum iwl_image_response_code - image response values
238*6b627f88SBjoern A. Zeeb * @IWL_IMAGE_RESP_DEF: the default value of the register
239*6b627f88SBjoern A. Zeeb * @IWL_IMAGE_RESP_SUCCESS: iml was read successfully
240*6b627f88SBjoern A. Zeeb * @IWL_IMAGE_RESP_FAIL: iml reading failed
241*6b627f88SBjoern A. Zeeb */
242*6b627f88SBjoern A. Zeeb enum iwl_image_response_code {
243*6b627f88SBjoern A. Zeeb IWL_IMAGE_RESP_DEF = 0,
244*6b627f88SBjoern A. Zeeb IWL_IMAGE_RESP_SUCCESS = 1,
245*6b627f88SBjoern A. Zeeb IWL_IMAGE_RESP_FAIL = 2,
246*6b627f88SBjoern A. Zeeb };
247*6b627f88SBjoern A. Zeeb
248*6b627f88SBjoern A. Zeeb #ifdef CONFIG_IWLWIFI_DEBUGFS
249*6b627f88SBjoern A. Zeeb /**
250*6b627f88SBjoern A. Zeeb * struct cont_rec: continuous recording data structure
251*6b627f88SBjoern A. Zeeb * @prev_wr_ptr: the last address that was read in monitor_data
252*6b627f88SBjoern A. Zeeb * debugfs file
253*6b627f88SBjoern A. Zeeb * @prev_wrap_cnt: the wrap count that was used during the last read in
254*6b627f88SBjoern A. Zeeb * monitor_data debugfs file
255*6b627f88SBjoern A. Zeeb * @state: the state of monitor_data debugfs file as described
256*6b627f88SBjoern A. Zeeb * in &iwl_fw_mon_dbgfs_state enum
257*6b627f88SBjoern A. Zeeb * @mutex: locked while reading from monitor_data debugfs file
258*6b627f88SBjoern A. Zeeb */
259*6b627f88SBjoern A. Zeeb struct cont_rec {
260*6b627f88SBjoern A. Zeeb u32 prev_wr_ptr;
261*6b627f88SBjoern A. Zeeb u32 prev_wrap_cnt;
262*6b627f88SBjoern A. Zeeb u8 state;
263*6b627f88SBjoern A. Zeeb /* Used to sync monitor_data debugfs file with driver unload flow */
264*6b627f88SBjoern A. Zeeb struct mutex mutex;
265*6b627f88SBjoern A. Zeeb };
266*6b627f88SBjoern A. Zeeb #endif
267*6b627f88SBjoern A. Zeeb
268*6b627f88SBjoern A. Zeeb enum iwl_pcie_fw_reset_state {
269*6b627f88SBjoern A. Zeeb FW_RESET_IDLE,
270*6b627f88SBjoern A. Zeeb FW_RESET_REQUESTED,
271*6b627f88SBjoern A. Zeeb FW_RESET_OK,
272*6b627f88SBjoern A. Zeeb FW_RESET_ERROR,
273*6b627f88SBjoern A. Zeeb FW_RESET_TOP_REQUESTED,
274*6b627f88SBjoern A. Zeeb };
275*6b627f88SBjoern A. Zeeb
276*6b627f88SBjoern A. Zeeb /**
277*6b627f88SBjoern A. Zeeb * enum iwl_pcie_imr_status - imr dma transfer state
278*6b627f88SBjoern A. Zeeb * @IMR_D2S_IDLE: default value of the dma transfer
279*6b627f88SBjoern A. Zeeb * @IMR_D2S_REQUESTED: dma transfer requested
280*6b627f88SBjoern A. Zeeb * @IMR_D2S_COMPLETED: dma transfer completed
281*6b627f88SBjoern A. Zeeb * @IMR_D2S_ERROR: dma transfer error
282*6b627f88SBjoern A. Zeeb */
283*6b627f88SBjoern A. Zeeb enum iwl_pcie_imr_status {
284*6b627f88SBjoern A. Zeeb IMR_D2S_IDLE,
285*6b627f88SBjoern A. Zeeb IMR_D2S_REQUESTED,
286*6b627f88SBjoern A. Zeeb IMR_D2S_COMPLETED,
287*6b627f88SBjoern A. Zeeb IMR_D2S_ERROR,
288*6b627f88SBjoern A. Zeeb };
289*6b627f88SBjoern A. Zeeb
290*6b627f88SBjoern A. Zeeb /**
291*6b627f88SBjoern A. Zeeb * struct iwl_pcie_txqs - TX queues data
292*6b627f88SBjoern A. Zeeb *
293*6b627f88SBjoern A. Zeeb * @queue_used: bit mask of used queues
294*6b627f88SBjoern A. Zeeb * @queue_stopped: bit mask of stopped queues
295*6b627f88SBjoern A. Zeeb * @txq: array of TXQ data structures representing the TXQs
296*6b627f88SBjoern A. Zeeb * @scd_bc_tbls: gen1 pointer to the byte count table of the scheduler
297*6b627f88SBjoern A. Zeeb * @bc_pool: bytecount DMA allocations pool
298*6b627f88SBjoern A. Zeeb * @bc_tbl_size: bytecount table size
299*6b627f88SBjoern A. Zeeb * @tso_hdr_page: page allocated (per CPU) for A-MSDU headers when doing TSO
300*6b627f88SBjoern A. Zeeb * (and similar usage)
301*6b627f88SBjoern A. Zeeb * @tfd: TFD data
302*6b627f88SBjoern A. Zeeb * @tfd.max_tbs: max number of buffers per TFD
303*6b627f88SBjoern A. Zeeb * @tfd.size: TFD size
304*6b627f88SBjoern A. Zeeb * @tfd.addr_size: TFD/TB address size
305*6b627f88SBjoern A. Zeeb */
306*6b627f88SBjoern A. Zeeb struct iwl_pcie_txqs {
307*6b627f88SBjoern A. Zeeb unsigned long queue_used[BITS_TO_LONGS(IWL_MAX_TVQM_QUEUES)];
308*6b627f88SBjoern A. Zeeb unsigned long queue_stopped[BITS_TO_LONGS(IWL_MAX_TVQM_QUEUES)];
309*6b627f88SBjoern A. Zeeb struct iwl_txq *txq[IWL_MAX_TVQM_QUEUES];
310*6b627f88SBjoern A. Zeeb struct dma_pool *bc_pool;
311*6b627f88SBjoern A. Zeeb size_t bc_tbl_size;
312*6b627f88SBjoern A. Zeeb struct iwl_tso_hdr_page __percpu *tso_hdr_page;
313*6b627f88SBjoern A. Zeeb
314*6b627f88SBjoern A. Zeeb struct {
315*6b627f88SBjoern A. Zeeb u8 max_tbs;
316*6b627f88SBjoern A. Zeeb u16 size;
317*6b627f88SBjoern A. Zeeb u8 addr_size;
318*6b627f88SBjoern A. Zeeb } tfd;
319*6b627f88SBjoern A. Zeeb
320*6b627f88SBjoern A. Zeeb struct iwl_dma_ptr scd_bc_tbls;
321*6b627f88SBjoern A. Zeeb };
322*6b627f88SBjoern A. Zeeb
323*6b627f88SBjoern A. Zeeb /**
324*6b627f88SBjoern A. Zeeb * struct iwl_trans_pcie - PCIe transport specific data
325*6b627f88SBjoern A. Zeeb * @rxq: all the RX queue data
326*6b627f88SBjoern A. Zeeb * @rx_pool: initial pool of iwl_rx_mem_buffer for all the queues
327*6b627f88SBjoern A. Zeeb * @global_table: table mapping received VID from hw to rxb
328*6b627f88SBjoern A. Zeeb * @rba: allocator for RX replenishing
329*6b627f88SBjoern A. Zeeb * @ctxt_info: context information for FW self init
330*6b627f88SBjoern A. Zeeb * @ctxt_info_v2: context information for v1 devices
331*6b627f88SBjoern A. Zeeb * @prph_info: prph info for self init
332*6b627f88SBjoern A. Zeeb * @prph_scratch: prph scratch for self init
333*6b627f88SBjoern A. Zeeb * @ctxt_info_dma_addr: dma addr of context information
334*6b627f88SBjoern A. Zeeb * @prph_info_dma_addr: dma addr of prph info
335*6b627f88SBjoern A. Zeeb * @prph_scratch_dma_addr: dma addr of prph scratch
336*6b627f88SBjoern A. Zeeb * @ctxt_info_dma_addr: dma addr of context information
337*6b627f88SBjoern A. Zeeb * @iml: image loader image virtual address
338*6b627f88SBjoern A. Zeeb * @iml_len: image loader image size
339*6b627f88SBjoern A. Zeeb * @iml_dma_addr: image loader image DMA address
340*6b627f88SBjoern A. Zeeb * @trans: pointer to the generic transport area
341*6b627f88SBjoern A. Zeeb * @scd_base_addr: scheduler sram base address in SRAM
342*6b627f88SBjoern A. Zeeb * @kw: keep warm address
343*6b627f88SBjoern A. Zeeb * @pnvm_data: holds info about pnvm payloads allocated in DRAM
344*6b627f88SBjoern A. Zeeb * @reduced_tables_data: holds info about power reduced tablse
345*6b627f88SBjoern A. Zeeb * payloads allocated in DRAM
346*6b627f88SBjoern A. Zeeb * @pci_dev: basic pci-network driver stuff
347*6b627f88SBjoern A. Zeeb * @hw_base: pci hardware address support
348*6b627f88SBjoern A. Zeeb * @ucode_write_complete: indicates that the ucode has been copied.
349*6b627f88SBjoern A. Zeeb * @ucode_write_waitq: wait queue for uCode load
350*6b627f88SBjoern A. Zeeb * @rx_page_order: page order for receive buffer size
351*6b627f88SBjoern A. Zeeb * @rx_buf_bytes: RX buffer (RB) size in bytes
352*6b627f88SBjoern A. Zeeb * @reg_lock: protect hw register access
353*6b627f88SBjoern A. Zeeb * @mutex: to protect stop_device / start_fw / start_hw
354*6b627f88SBjoern A. Zeeb * @fw_mon_data: fw continuous recording data
355*6b627f88SBjoern A. Zeeb * @cmd_hold_nic_awake: indicates NIC is held awake for APMG workaround
356*6b627f88SBjoern A. Zeeb * during commands in flight
357*6b627f88SBjoern A. Zeeb * @msix_entries: array of MSI-X entries
358*6b627f88SBjoern A. Zeeb * @msix_enabled: true if managed to enable MSI-X
359*6b627f88SBjoern A. Zeeb * @shared_vec_mask: the type of causes the shared vector handles
360*6b627f88SBjoern A. Zeeb * (see iwl_shared_irq_flags).
361*6b627f88SBjoern A. Zeeb * @alloc_vecs: the number of interrupt vectors allocated by the OS
362*6b627f88SBjoern A. Zeeb * @def_irq: default irq for non rx causes
363*6b627f88SBjoern A. Zeeb * @fh_init_mask: initial unmasked fh causes
364*6b627f88SBjoern A. Zeeb * @hw_init_mask: initial unmasked hw causes
365*6b627f88SBjoern A. Zeeb * @fh_mask: current unmasked fh causes
366*6b627f88SBjoern A. Zeeb * @hw_mask: current unmasked hw causes
367*6b627f88SBjoern A. Zeeb * @in_rescan: true if we have triggered a device rescan
368*6b627f88SBjoern A. Zeeb * @base_rb_stts: base virtual address of receive buffer status for all queues
369*6b627f88SBjoern A. Zeeb * @base_rb_stts_dma: base physical address of receive buffer status
370*6b627f88SBjoern A. Zeeb * @supported_dma_mask: DMA mask to validate the actual address against,
371*6b627f88SBjoern A. Zeeb * will be DMA_BIT_MASK(11) or DMA_BIT_MASK(12) depending on the device
372*6b627f88SBjoern A. Zeeb * @alloc_page_lock: spinlock for the page allocator
373*6b627f88SBjoern A. Zeeb * @alloc_page: allocated page to still use parts of
374*6b627f88SBjoern A. Zeeb * @alloc_page_used: how much of the allocated page was already used (bytes)
375*6b627f88SBjoern A. Zeeb * @imr_status: imr dma state machine
376*6b627f88SBjoern A. Zeeb * @imr_waitq: imr wait queue for dma completion
377*6b627f88SBjoern A. Zeeb * @rf_name: name/version of the CRF, if any
378*6b627f88SBjoern A. Zeeb * @use_ict: whether or not ICT (interrupt table) is used
379*6b627f88SBjoern A. Zeeb * @ict_index: current ICT read index
380*6b627f88SBjoern A. Zeeb * @ict_tbl: ICT table pointer
381*6b627f88SBjoern A. Zeeb * @ict_tbl_dma: ICT table DMA address
382*6b627f88SBjoern A. Zeeb * @inta_mask: interrupt (INT-A) mask
383*6b627f88SBjoern A. Zeeb * @irq_lock: lock to synchronize IRQ handling
384*6b627f88SBjoern A. Zeeb * @txq_memory: TXQ allocation array
385*6b627f88SBjoern A. Zeeb * @sx_waitq: waitqueue for Sx transitions
386*6b627f88SBjoern A. Zeeb * @sx_state: state tracking Sx transitions
387*6b627f88SBjoern A. Zeeb * @opmode_down: indicates opmode went away
388*6b627f88SBjoern A. Zeeb * @num_rx_bufs: number of RX buffers to allocate/use
389*6b627f88SBjoern A. Zeeb * @affinity_mask: IRQ affinity mask for each RX queue
390*6b627f88SBjoern A. Zeeb * @debug_rfkill: RF-kill debugging state, -1 for unset, 0/1 for radio
391*6b627f88SBjoern A. Zeeb * enable/disable
392*6b627f88SBjoern A. Zeeb * @fw_reset_state: state of FW reset handshake
393*6b627f88SBjoern A. Zeeb * @fw_reset_waitq: waitqueue for FW reset handshake
394*6b627f88SBjoern A. Zeeb * @is_down: indicates the NIC is down
395*6b627f88SBjoern A. Zeeb * @isr_stats: interrupt statistics
396*6b627f88SBjoern A. Zeeb * @napi_dev: (fake) netdev for NAPI registration
397*6b627f88SBjoern A. Zeeb * @txqs: transport tx queues data.
398*6b627f88SBjoern A. Zeeb * @me_present: WiAMT/CSME is detected as present (1), not present (0)
399*6b627f88SBjoern A. Zeeb * or unknown (-1, so can still use it as a boolean safely)
400*6b627f88SBjoern A. Zeeb * @me_recheck_wk: worker to recheck WiAMT/CSME presence
401*6b627f88SBjoern A. Zeeb * @invalid_tx_cmd: invalid TX command buffer
402*6b627f88SBjoern A. Zeeb * @wait_command_queue: wait queue for sync commands
403*6b627f88SBjoern A. Zeeb */
404*6b627f88SBjoern A. Zeeb struct iwl_trans_pcie {
405*6b627f88SBjoern A. Zeeb struct iwl_rxq *rxq;
406*6b627f88SBjoern A. Zeeb struct iwl_rx_mem_buffer *rx_pool;
407*6b627f88SBjoern A. Zeeb struct iwl_rx_mem_buffer **global_table;
408*6b627f88SBjoern A. Zeeb struct iwl_rb_allocator rba;
409*6b627f88SBjoern A. Zeeb union {
410*6b627f88SBjoern A. Zeeb struct iwl_context_info *ctxt_info;
411*6b627f88SBjoern A. Zeeb struct iwl_context_info_v2 *ctxt_info_v2;
412*6b627f88SBjoern A. Zeeb };
413*6b627f88SBjoern A. Zeeb struct iwl_prph_info *prph_info;
414*6b627f88SBjoern A. Zeeb struct iwl_prph_scratch *prph_scratch;
415*6b627f88SBjoern A. Zeeb void *iml;
416*6b627f88SBjoern A. Zeeb size_t iml_len;
417*6b627f88SBjoern A. Zeeb dma_addr_t ctxt_info_dma_addr;
418*6b627f88SBjoern A. Zeeb dma_addr_t prph_info_dma_addr;
419*6b627f88SBjoern A. Zeeb dma_addr_t prph_scratch_dma_addr;
420*6b627f88SBjoern A. Zeeb dma_addr_t iml_dma_addr;
421*6b627f88SBjoern A. Zeeb struct iwl_trans *trans;
422*6b627f88SBjoern A. Zeeb
423*6b627f88SBjoern A. Zeeb struct net_device *napi_dev;
424*6b627f88SBjoern A. Zeeb
425*6b627f88SBjoern A. Zeeb /* INT ICT Table */
426*6b627f88SBjoern A. Zeeb __le32 *ict_tbl;
427*6b627f88SBjoern A. Zeeb dma_addr_t ict_tbl_dma;
428*6b627f88SBjoern A. Zeeb int ict_index;
429*6b627f88SBjoern A. Zeeb bool use_ict;
430*6b627f88SBjoern A. Zeeb bool is_down, opmode_down;
431*6b627f88SBjoern A. Zeeb s8 debug_rfkill;
432*6b627f88SBjoern A. Zeeb struct isr_statistics isr_stats;
433*6b627f88SBjoern A. Zeeb
434*6b627f88SBjoern A. Zeeb spinlock_t irq_lock;
435*6b627f88SBjoern A. Zeeb struct mutex mutex;
436*6b627f88SBjoern A. Zeeb u32 inta_mask;
437*6b627f88SBjoern A. Zeeb u32 scd_base_addr;
438*6b627f88SBjoern A. Zeeb struct iwl_dma_ptr kw;
439*6b627f88SBjoern A. Zeeb
440*6b627f88SBjoern A. Zeeb /* pnvm data */
441*6b627f88SBjoern A. Zeeb struct iwl_dram_regions pnvm_data;
442*6b627f88SBjoern A. Zeeb struct iwl_dram_regions reduced_tables_data;
443*6b627f88SBjoern A. Zeeb
444*6b627f88SBjoern A. Zeeb struct iwl_txq *txq_memory;
445*6b627f88SBjoern A. Zeeb
446*6b627f88SBjoern A. Zeeb /* PCI bus related data */
447*6b627f88SBjoern A. Zeeb struct pci_dev *pci_dev;
448*6b627f88SBjoern A. Zeeb u8 __iomem *hw_base;
449*6b627f88SBjoern A. Zeeb
450*6b627f88SBjoern A. Zeeb bool ucode_write_complete;
451*6b627f88SBjoern A. Zeeb enum {
452*6b627f88SBjoern A. Zeeb IWL_SX_INVALID = 0,
453*6b627f88SBjoern A. Zeeb IWL_SX_WAITING,
454*6b627f88SBjoern A. Zeeb IWL_SX_ERROR,
455*6b627f88SBjoern A. Zeeb IWL_SX_COMPLETE,
456*6b627f88SBjoern A. Zeeb } sx_state;
457*6b627f88SBjoern A. Zeeb wait_queue_head_t ucode_write_waitq;
458*6b627f88SBjoern A. Zeeb wait_queue_head_t sx_waitq;
459*6b627f88SBjoern A. Zeeb
460*6b627f88SBjoern A. Zeeb u16 num_rx_bufs;
461*6b627f88SBjoern A. Zeeb
462*6b627f88SBjoern A. Zeeb u32 rx_page_order;
463*6b627f88SBjoern A. Zeeb u32 rx_buf_bytes;
464*6b627f88SBjoern A. Zeeb u32 supported_dma_mask;
465*6b627f88SBjoern A. Zeeb
466*6b627f88SBjoern A. Zeeb /* allocator lock for the two values below */
467*6b627f88SBjoern A. Zeeb spinlock_t alloc_page_lock;
468*6b627f88SBjoern A. Zeeb struct page *alloc_page;
469*6b627f88SBjoern A. Zeeb u32 alloc_page_used;
470*6b627f88SBjoern A. Zeeb
471*6b627f88SBjoern A. Zeeb /*protect hw register */
472*6b627f88SBjoern A. Zeeb spinlock_t reg_lock;
473*6b627f88SBjoern A. Zeeb bool cmd_hold_nic_awake;
474*6b627f88SBjoern A. Zeeb
475*6b627f88SBjoern A. Zeeb #ifdef CONFIG_IWLWIFI_DEBUGFS
476*6b627f88SBjoern A. Zeeb struct cont_rec fw_mon_data;
477*6b627f88SBjoern A. Zeeb #endif
478*6b627f88SBjoern A. Zeeb
479*6b627f88SBjoern A. Zeeb struct msix_entry msix_entries[IWL_MAX_RX_HW_QUEUES];
480*6b627f88SBjoern A. Zeeb bool msix_enabled;
481*6b627f88SBjoern A. Zeeb u8 shared_vec_mask;
482*6b627f88SBjoern A. Zeeb u32 alloc_vecs;
483*6b627f88SBjoern A. Zeeb u32 def_irq;
484*6b627f88SBjoern A. Zeeb u32 fh_init_mask;
485*6b627f88SBjoern A. Zeeb u32 hw_init_mask;
486*6b627f88SBjoern A. Zeeb u32 fh_mask;
487*6b627f88SBjoern A. Zeeb u32 hw_mask;
488*6b627f88SBjoern A. Zeeb cpumask_t affinity_mask[IWL_MAX_RX_HW_QUEUES];
489*6b627f88SBjoern A. Zeeb u16 tx_cmd_queue_size;
490*6b627f88SBjoern A. Zeeb bool in_rescan;
491*6b627f88SBjoern A. Zeeb
492*6b627f88SBjoern A. Zeeb void *base_rb_stts;
493*6b627f88SBjoern A. Zeeb dma_addr_t base_rb_stts_dma;
494*6b627f88SBjoern A. Zeeb
495*6b627f88SBjoern A. Zeeb enum iwl_pcie_fw_reset_state fw_reset_state;
496*6b627f88SBjoern A. Zeeb wait_queue_head_t fw_reset_waitq;
497*6b627f88SBjoern A. Zeeb enum iwl_pcie_imr_status imr_status;
498*6b627f88SBjoern A. Zeeb wait_queue_head_t imr_waitq;
499*6b627f88SBjoern A. Zeeb char rf_name[32];
500*6b627f88SBjoern A. Zeeb
501*6b627f88SBjoern A. Zeeb struct iwl_pcie_txqs txqs;
502*6b627f88SBjoern A. Zeeb
503*6b627f88SBjoern A. Zeeb s8 me_present;
504*6b627f88SBjoern A. Zeeb struct delayed_work me_recheck_wk;
505*6b627f88SBjoern A. Zeeb
506*6b627f88SBjoern A. Zeeb struct iwl_dma_ptr invalid_tx_cmd;
507*6b627f88SBjoern A. Zeeb
508*6b627f88SBjoern A. Zeeb wait_queue_head_t wait_command_queue;
509*6b627f88SBjoern A. Zeeb };
510*6b627f88SBjoern A. Zeeb
511*6b627f88SBjoern A. Zeeb static inline struct iwl_trans_pcie *
IWL_TRANS_GET_PCIE_TRANS(struct iwl_trans * trans)512*6b627f88SBjoern A. Zeeb IWL_TRANS_GET_PCIE_TRANS(struct iwl_trans *trans)
513*6b627f88SBjoern A. Zeeb {
514*6b627f88SBjoern A. Zeeb return (void *)trans->trans_specific;
515*6b627f88SBjoern A. Zeeb }
516*6b627f88SBjoern A. Zeeb
iwl_pcie_clear_irq(struct iwl_trans * trans,int queue)517*6b627f88SBjoern A. Zeeb static inline void iwl_pcie_clear_irq(struct iwl_trans *trans, int queue)
518*6b627f88SBjoern A. Zeeb {
519*6b627f88SBjoern A. Zeeb /*
520*6b627f88SBjoern A. Zeeb * Before sending the interrupt the HW disables it to prevent
521*6b627f88SBjoern A. Zeeb * a nested interrupt. This is done by writing 1 to the corresponding
522*6b627f88SBjoern A. Zeeb * bit in the mask register. After handling the interrupt, it should be
523*6b627f88SBjoern A. Zeeb * re-enabled by clearing this bit. This register is defined as
524*6b627f88SBjoern A. Zeeb * write 1 clear (W1C) register, meaning that it's being clear
525*6b627f88SBjoern A. Zeeb * by writing 1 to the bit.
526*6b627f88SBjoern A. Zeeb */
527*6b627f88SBjoern A. Zeeb iwl_write32(trans, CSR_MSIX_AUTOMASK_ST_AD, BIT(queue));
528*6b627f88SBjoern A. Zeeb }
529*6b627f88SBjoern A. Zeeb
530*6b627f88SBjoern A. Zeeb static inline struct iwl_trans *
iwl_trans_pcie_get_trans(struct iwl_trans_pcie * trans_pcie)531*6b627f88SBjoern A. Zeeb iwl_trans_pcie_get_trans(struct iwl_trans_pcie *trans_pcie)
532*6b627f88SBjoern A. Zeeb {
533*6b627f88SBjoern A. Zeeb return container_of((void *)trans_pcie, struct iwl_trans,
534*6b627f88SBjoern A. Zeeb trans_specific);
535*6b627f88SBjoern A. Zeeb }
536*6b627f88SBjoern A. Zeeb
537*6b627f88SBjoern A. Zeeb /*
538*6b627f88SBjoern A. Zeeb * Convention: trans API functions: iwl_trans_pcie_XXX
539*6b627f88SBjoern A. Zeeb * Other functions: iwl_pcie_XXX
540*6b627f88SBjoern A. Zeeb */
541*6b627f88SBjoern A. Zeeb void iwl_trans_pcie_free(struct iwl_trans *trans);
542*6b627f88SBjoern A. Zeeb void iwl_trans_pcie_free_pnvm_dram_regions(struct iwl_dram_regions *dram_regions,
543*6b627f88SBjoern A. Zeeb struct device *dev);
544*6b627f88SBjoern A. Zeeb
545*6b627f88SBjoern A. Zeeb bool __iwl_trans_pcie_grab_nic_access(struct iwl_trans *trans, bool silent);
546*6b627f88SBjoern A. Zeeb #define _iwl_trans_pcie_grab_nic_access(trans, silent) \
547*6b627f88SBjoern A. Zeeb __cond_lock(nic_access_nobh, \
548*6b627f88SBjoern A. Zeeb likely(__iwl_trans_pcie_grab_nic_access(trans, silent)))
549*6b627f88SBjoern A. Zeeb
550*6b627f88SBjoern A. Zeeb void iwl_trans_pcie_check_product_reset_status(struct pci_dev *pdev);
551*6b627f88SBjoern A. Zeeb void iwl_trans_pcie_check_product_reset_mode(struct pci_dev *pdev);
552*6b627f88SBjoern A. Zeeb
553*6b627f88SBjoern A. Zeeb /*****************************************************
554*6b627f88SBjoern A. Zeeb * RX
555*6b627f88SBjoern A. Zeeb ******************************************************/
556*6b627f88SBjoern A. Zeeb int iwl_pcie_rx_init(struct iwl_trans *trans);
557*6b627f88SBjoern A. Zeeb int iwl_pcie_gen2_rx_init(struct iwl_trans *trans);
558*6b627f88SBjoern A. Zeeb irqreturn_t iwl_pcie_msix_isr(int irq, void *data);
559*6b627f88SBjoern A. Zeeb irqreturn_t iwl_pcie_irq_handler(int irq, void *dev_id);
560*6b627f88SBjoern A. Zeeb irqreturn_t iwl_pcie_irq_msix_handler(int irq, void *dev_id);
561*6b627f88SBjoern A. Zeeb irqreturn_t iwl_pcie_irq_rx_msix_handler(int irq, void *dev_id);
562*6b627f88SBjoern A. Zeeb int iwl_pcie_rx_stop(struct iwl_trans *trans);
563*6b627f88SBjoern A. Zeeb void iwl_pcie_rx_free(struct iwl_trans *trans);
564*6b627f88SBjoern A. Zeeb void iwl_pcie_free_rbs_pool(struct iwl_trans *trans);
565*6b627f88SBjoern A. Zeeb void iwl_pcie_rx_init_rxb_lists(struct iwl_rxq *rxq);
566*6b627f88SBjoern A. Zeeb void iwl_pcie_rx_napi_sync(struct iwl_trans *trans);
567*6b627f88SBjoern A. Zeeb void iwl_pcie_rxq_alloc_rbs(struct iwl_trans *trans, gfp_t priority,
568*6b627f88SBjoern A. Zeeb struct iwl_rxq *rxq);
569*6b627f88SBjoern A. Zeeb
570*6b627f88SBjoern A. Zeeb /*****************************************************
571*6b627f88SBjoern A. Zeeb * ICT - interrupt handling
572*6b627f88SBjoern A. Zeeb ******************************************************/
573*6b627f88SBjoern A. Zeeb irqreturn_t iwl_pcie_isr(int irq, void *data);
574*6b627f88SBjoern A. Zeeb int iwl_pcie_alloc_ict(struct iwl_trans *trans);
575*6b627f88SBjoern A. Zeeb void iwl_pcie_free_ict(struct iwl_trans *trans);
576*6b627f88SBjoern A. Zeeb void iwl_pcie_reset_ict(struct iwl_trans *trans);
577*6b627f88SBjoern A. Zeeb void iwl_pcie_disable_ict(struct iwl_trans *trans);
578*6b627f88SBjoern A. Zeeb
579*6b627f88SBjoern A. Zeeb /*****************************************************
580*6b627f88SBjoern A. Zeeb * TX / HCMD
581*6b627f88SBjoern A. Zeeb ******************************************************/
582*6b627f88SBjoern A. Zeeb /* We need 2 entries for the TX command and header, and another one might
583*6b627f88SBjoern A. Zeeb * be needed for potential data in the SKB's head. The remaining ones can
584*6b627f88SBjoern A. Zeeb * be used for frags.
585*6b627f88SBjoern A. Zeeb */
586*6b627f88SBjoern A. Zeeb #define IWL_TRANS_PCIE_MAX_FRAGS(trans_pcie) ((trans_pcie)->txqs.tfd.max_tbs - 3)
587*6b627f88SBjoern A. Zeeb
588*6b627f88SBjoern A. Zeeb struct iwl_tso_hdr_page {
589*6b627f88SBjoern A. Zeeb struct page *page;
590*6b627f88SBjoern A. Zeeb u8 *pos;
591*6b627f88SBjoern A. Zeeb };
592*6b627f88SBjoern A. Zeeb
593*6b627f88SBjoern A. Zeeb /*
594*6b627f88SBjoern A. Zeeb * Note that we put this struct *last* in the page. By doing that, we ensure
595*6b627f88SBjoern A. Zeeb * that no TB referencing this page can trigger the 32-bit boundary hardware
596*6b627f88SBjoern A. Zeeb * bug.
597*6b627f88SBjoern A. Zeeb */
598*6b627f88SBjoern A. Zeeb struct iwl_tso_page_info {
599*6b627f88SBjoern A. Zeeb dma_addr_t dma_addr;
600*6b627f88SBjoern A. Zeeb struct page *next;
601*6b627f88SBjoern A. Zeeb refcount_t use_count;
602*6b627f88SBjoern A. Zeeb };
603*6b627f88SBjoern A. Zeeb
604*6b627f88SBjoern A. Zeeb #define IWL_TSO_PAGE_DATA_SIZE (PAGE_SIZE - sizeof(struct iwl_tso_page_info))
605*6b627f88SBjoern A. Zeeb #define IWL_TSO_PAGE_INFO(addr) \
606*6b627f88SBjoern A. Zeeb ((struct iwl_tso_page_info *)(((unsigned long)addr & PAGE_MASK) + \
607*6b627f88SBjoern A. Zeeb IWL_TSO_PAGE_DATA_SIZE))
608*6b627f88SBjoern A. Zeeb
609*6b627f88SBjoern A. Zeeb int iwl_pcie_tx_init(struct iwl_trans *trans);
610*6b627f88SBjoern A. Zeeb void iwl_pcie_tx_start(struct iwl_trans *trans);
611*6b627f88SBjoern A. Zeeb int iwl_pcie_tx_stop(struct iwl_trans *trans);
612*6b627f88SBjoern A. Zeeb void iwl_pcie_tx_free(struct iwl_trans *trans);
613*6b627f88SBjoern A. Zeeb bool iwl_trans_pcie_txq_enable(struct iwl_trans *trans, int queue, u16 ssn,
614*6b627f88SBjoern A. Zeeb const struct iwl_trans_txq_scd_cfg *cfg,
615*6b627f88SBjoern A. Zeeb unsigned int wdg_timeout);
616*6b627f88SBjoern A. Zeeb void iwl_trans_pcie_txq_disable(struct iwl_trans *trans, int queue,
617*6b627f88SBjoern A. Zeeb bool configure_scd);
618*6b627f88SBjoern A. Zeeb void iwl_trans_pcie_txq_set_shared_mode(struct iwl_trans *trans, u32 txq_id,
619*6b627f88SBjoern A. Zeeb bool shared_mode);
620*6b627f88SBjoern A. Zeeb int iwl_trans_pcie_tx(struct iwl_trans *trans, struct sk_buff *skb,
621*6b627f88SBjoern A. Zeeb struct iwl_device_tx_cmd *dev_cmd, int txq_id);
622*6b627f88SBjoern A. Zeeb void iwl_pcie_txq_check_wrptrs(struct iwl_trans *trans);
623*6b627f88SBjoern A. Zeeb void iwl_pcie_hcmd_complete(struct iwl_trans *trans,
624*6b627f88SBjoern A. Zeeb struct iwl_rx_cmd_buffer *rxb);
625*6b627f88SBjoern A. Zeeb void iwl_trans_pcie_tx_reset(struct iwl_trans *trans);
626*6b627f88SBjoern A. Zeeb int iwl_pcie_txq_alloc(struct iwl_trans *trans, struct iwl_txq *txq,
627*6b627f88SBjoern A. Zeeb int slots_num, bool cmd_queue);
628*6b627f88SBjoern A. Zeeb
629*6b627f88SBjoern A. Zeeb dma_addr_t iwl_pcie_get_sgt_tb_phys(struct sg_table *sgt, unsigned int offset,
630*6b627f88SBjoern A. Zeeb unsigned int len);
631*6b627f88SBjoern A. Zeeb struct sg_table *iwl_pcie_prep_tso(struct iwl_trans *trans, struct sk_buff *skb,
632*6b627f88SBjoern A. Zeeb struct iwl_cmd_meta *cmd_meta,
633*6b627f88SBjoern A. Zeeb u8 **hdr, unsigned int hdr_room,
634*6b627f88SBjoern A. Zeeb unsigned int offset);
635*6b627f88SBjoern A. Zeeb
636*6b627f88SBjoern A. Zeeb void iwl_pcie_free_tso_pages(struct iwl_trans *trans, struct sk_buff *skb,
637*6b627f88SBjoern A. Zeeb struct iwl_cmd_meta *cmd_meta);
638*6b627f88SBjoern A. Zeeb
iwl_pcie_get_tso_page_phys(void * addr)639*6b627f88SBjoern A. Zeeb static inline dma_addr_t iwl_pcie_get_tso_page_phys(void *addr)
640*6b627f88SBjoern A. Zeeb {
641*6b627f88SBjoern A. Zeeb dma_addr_t res;
642*6b627f88SBjoern A. Zeeb
643*6b627f88SBjoern A. Zeeb res = IWL_TSO_PAGE_INFO(addr)->dma_addr;
644*6b627f88SBjoern A. Zeeb res += (unsigned long)addr & ~PAGE_MASK;
645*6b627f88SBjoern A. Zeeb
646*6b627f88SBjoern A. Zeeb return res;
647*6b627f88SBjoern A. Zeeb }
648*6b627f88SBjoern A. Zeeb
649*6b627f88SBjoern A. Zeeb static inline dma_addr_t
iwl_txq_get_first_tb_dma(struct iwl_txq * txq,int idx)650*6b627f88SBjoern A. Zeeb iwl_txq_get_first_tb_dma(struct iwl_txq *txq, int idx)
651*6b627f88SBjoern A. Zeeb {
652*6b627f88SBjoern A. Zeeb return txq->first_tb_dma +
653*6b627f88SBjoern A. Zeeb sizeof(struct iwl_pcie_first_tb_buf) * idx;
654*6b627f88SBjoern A. Zeeb }
655*6b627f88SBjoern A. Zeeb
iwl_txq_get_cmd_index(const struct iwl_txq * q,u32 index)656*6b627f88SBjoern A. Zeeb static inline u16 iwl_txq_get_cmd_index(const struct iwl_txq *q, u32 index)
657*6b627f88SBjoern A. Zeeb {
658*6b627f88SBjoern A. Zeeb return index & (q->n_window - 1);
659*6b627f88SBjoern A. Zeeb }
660*6b627f88SBjoern A. Zeeb
iwl_txq_get_tfd(struct iwl_trans * trans,struct iwl_txq * txq,int idx)661*6b627f88SBjoern A. Zeeb static inline void *iwl_txq_get_tfd(struct iwl_trans *trans,
662*6b627f88SBjoern A. Zeeb struct iwl_txq *txq, int idx)
663*6b627f88SBjoern A. Zeeb {
664*6b627f88SBjoern A. Zeeb struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
665*6b627f88SBjoern A. Zeeb
666*6b627f88SBjoern A. Zeeb if (trans->mac_cfg->gen2)
667*6b627f88SBjoern A. Zeeb idx = iwl_txq_get_cmd_index(txq, idx);
668*6b627f88SBjoern A. Zeeb
669*6b627f88SBjoern A. Zeeb return (u8 *)txq->tfds + trans_pcie->txqs.tfd.size * idx;
670*6b627f88SBjoern A. Zeeb }
671*6b627f88SBjoern A. Zeeb
672*6b627f88SBjoern A. Zeeb /*
673*6b627f88SBjoern A. Zeeb * We need this inline in case dma_addr_t is only 32-bits - since the
674*6b627f88SBjoern A. Zeeb * hardware is always 64-bit, the issue can still occur in that case,
675*6b627f88SBjoern A. Zeeb * so use u64 for 'phys' here to force the addition in 64-bit.
676*6b627f88SBjoern A. Zeeb */
iwl_txq_crosses_4g_boundary(u64 phys,u16 len)677*6b627f88SBjoern A. Zeeb static inline bool iwl_txq_crosses_4g_boundary(u64 phys, u16 len)
678*6b627f88SBjoern A. Zeeb {
679*6b627f88SBjoern A. Zeeb return upper_32_bits(phys) != upper_32_bits(phys + len);
680*6b627f88SBjoern A. Zeeb }
681*6b627f88SBjoern A. Zeeb
682*6b627f88SBjoern A. Zeeb int iwl_txq_space(struct iwl_trans *trans, const struct iwl_txq *q);
683*6b627f88SBjoern A. Zeeb
iwl_txq_stop(struct iwl_trans * trans,struct iwl_txq * txq)684*6b627f88SBjoern A. Zeeb static inline void iwl_txq_stop(struct iwl_trans *trans, struct iwl_txq *txq)
685*6b627f88SBjoern A. Zeeb {
686*6b627f88SBjoern A. Zeeb struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
687*6b627f88SBjoern A. Zeeb
688*6b627f88SBjoern A. Zeeb if (!test_and_set_bit(txq->id, trans_pcie->txqs.queue_stopped)) {
689*6b627f88SBjoern A. Zeeb iwl_op_mode_queue_full(trans->op_mode, txq->id);
690*6b627f88SBjoern A. Zeeb IWL_DEBUG_TX_QUEUES(trans, "Stop hwq %d\n", txq->id);
691*6b627f88SBjoern A. Zeeb } else {
692*6b627f88SBjoern A. Zeeb IWL_DEBUG_TX_QUEUES(trans, "hwq %d already stopped\n",
693*6b627f88SBjoern A. Zeeb txq->id);
694*6b627f88SBjoern A. Zeeb }
695*6b627f88SBjoern A. Zeeb }
696*6b627f88SBjoern A. Zeeb
697*6b627f88SBjoern A. Zeeb /**
698*6b627f88SBjoern A. Zeeb * iwl_txq_inc_wrap - increment queue index, wrap back to beginning
699*6b627f88SBjoern A. Zeeb * @trans: the transport (for configuration data)
700*6b627f88SBjoern A. Zeeb * @index: current index
701*6b627f88SBjoern A. Zeeb * Return: the queue index incremented, subject to wrapping
702*6b627f88SBjoern A. Zeeb */
iwl_txq_inc_wrap(struct iwl_trans * trans,int index)703*6b627f88SBjoern A. Zeeb static inline int iwl_txq_inc_wrap(struct iwl_trans *trans, int index)
704*6b627f88SBjoern A. Zeeb {
705*6b627f88SBjoern A. Zeeb return ++index &
706*6b627f88SBjoern A. Zeeb (trans->mac_cfg->base->max_tfd_queue_size - 1);
707*6b627f88SBjoern A. Zeeb }
708*6b627f88SBjoern A. Zeeb
709*6b627f88SBjoern A. Zeeb /**
710*6b627f88SBjoern A. Zeeb * iwl_txq_dec_wrap - decrement queue index, wrap back to end
711*6b627f88SBjoern A. Zeeb * @trans: the transport (for configuration data)
712*6b627f88SBjoern A. Zeeb * @index: current index
713*6b627f88SBjoern A. Zeeb * Return: the queue index decremented, subject to wrapping
714*6b627f88SBjoern A. Zeeb */
iwl_txq_dec_wrap(struct iwl_trans * trans,int index)715*6b627f88SBjoern A. Zeeb static inline int iwl_txq_dec_wrap(struct iwl_trans *trans, int index)
716*6b627f88SBjoern A. Zeeb {
717*6b627f88SBjoern A. Zeeb return --index &
718*6b627f88SBjoern A. Zeeb (trans->mac_cfg->base->max_tfd_queue_size - 1);
719*6b627f88SBjoern A. Zeeb }
720*6b627f88SBjoern A. Zeeb
721*6b627f88SBjoern A. Zeeb void iwl_txq_log_scd_error(struct iwl_trans *trans, struct iwl_txq *txq);
722*6b627f88SBjoern A. Zeeb
723*6b627f88SBjoern A. Zeeb static inline void
iwl_trans_pcie_wake_queue(struct iwl_trans * trans,struct iwl_txq * txq)724*6b627f88SBjoern A. Zeeb iwl_trans_pcie_wake_queue(struct iwl_trans *trans, struct iwl_txq *txq)
725*6b627f88SBjoern A. Zeeb {
726*6b627f88SBjoern A. Zeeb struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
727*6b627f88SBjoern A. Zeeb
728*6b627f88SBjoern A. Zeeb if (test_and_clear_bit(txq->id, trans_pcie->txqs.queue_stopped)) {
729*6b627f88SBjoern A. Zeeb IWL_DEBUG_TX_QUEUES(trans, "Wake hwq %d\n", txq->id);
730*6b627f88SBjoern A. Zeeb iwl_op_mode_queue_not_full(trans->op_mode, txq->id);
731*6b627f88SBjoern A. Zeeb }
732*6b627f88SBjoern A. Zeeb }
733*6b627f88SBjoern A. Zeeb
734*6b627f88SBjoern A. Zeeb int iwl_txq_gen2_set_tb(struct iwl_trans *trans,
735*6b627f88SBjoern A. Zeeb struct iwl_tfh_tfd *tfd, dma_addr_t addr,
736*6b627f88SBjoern A. Zeeb u16 len);
737*6b627f88SBjoern A. Zeeb
iwl_txq_set_tfd_invalid_gen2(struct iwl_trans * trans,struct iwl_tfh_tfd * tfd)738*6b627f88SBjoern A. Zeeb static inline void iwl_txq_set_tfd_invalid_gen2(struct iwl_trans *trans,
739*6b627f88SBjoern A. Zeeb struct iwl_tfh_tfd *tfd)
740*6b627f88SBjoern A. Zeeb {
741*6b627f88SBjoern A. Zeeb struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
742*6b627f88SBjoern A. Zeeb
743*6b627f88SBjoern A. Zeeb tfd->num_tbs = 0;
744*6b627f88SBjoern A. Zeeb
745*6b627f88SBjoern A. Zeeb iwl_txq_gen2_set_tb(trans, tfd, trans_pcie->invalid_tx_cmd.dma,
746*6b627f88SBjoern A. Zeeb trans_pcie->invalid_tx_cmd.size);
747*6b627f88SBjoern A. Zeeb }
748*6b627f88SBjoern A. Zeeb
749*6b627f88SBjoern A. Zeeb void iwl_txq_gen2_tfd_unmap(struct iwl_trans *trans,
750*6b627f88SBjoern A. Zeeb struct iwl_cmd_meta *meta,
751*6b627f88SBjoern A. Zeeb struct iwl_tfh_tfd *tfd);
752*6b627f88SBjoern A. Zeeb
753*6b627f88SBjoern A. Zeeb int iwl_txq_dyn_alloc(struct iwl_trans *trans, u32 flags,
754*6b627f88SBjoern A. Zeeb u32 sta_mask, u8 tid,
755*6b627f88SBjoern A. Zeeb int size, unsigned int timeout);
756*6b627f88SBjoern A. Zeeb
757*6b627f88SBjoern A. Zeeb int iwl_txq_gen2_tx(struct iwl_trans *trans, struct sk_buff *skb,
758*6b627f88SBjoern A. Zeeb struct iwl_device_tx_cmd *dev_cmd, int txq_id);
759*6b627f88SBjoern A. Zeeb
760*6b627f88SBjoern A. Zeeb void iwl_txq_dyn_free(struct iwl_trans *trans, int queue);
761*6b627f88SBjoern A. Zeeb void iwl_txq_gen2_tx_free(struct iwl_trans *trans);
762*6b627f88SBjoern A. Zeeb int iwl_txq_init(struct iwl_trans *trans, struct iwl_txq *txq,
763*6b627f88SBjoern A. Zeeb int slots_num, bool cmd_queue);
764*6b627f88SBjoern A. Zeeb int iwl_txq_gen2_init(struct iwl_trans *trans, int txq_id,
765*6b627f88SBjoern A. Zeeb int queue_size);
766*6b627f88SBjoern A. Zeeb
iwl_txq_gen1_tfd_tb_get_len(struct iwl_trans * trans,void * _tfd,u8 idx)767*6b627f88SBjoern A. Zeeb static inline u16 iwl_txq_gen1_tfd_tb_get_len(struct iwl_trans *trans,
768*6b627f88SBjoern A. Zeeb void *_tfd, u8 idx)
769*6b627f88SBjoern A. Zeeb {
770*6b627f88SBjoern A. Zeeb struct iwl_tfd *tfd;
771*6b627f88SBjoern A. Zeeb struct iwl_tfd_tb *tb;
772*6b627f88SBjoern A. Zeeb
773*6b627f88SBjoern A. Zeeb if (trans->mac_cfg->gen2) {
774*6b627f88SBjoern A. Zeeb struct iwl_tfh_tfd *tfh_tfd = _tfd;
775*6b627f88SBjoern A. Zeeb struct iwl_tfh_tb *tfh_tb = &tfh_tfd->tbs[idx];
776*6b627f88SBjoern A. Zeeb
777*6b627f88SBjoern A. Zeeb return le16_to_cpu(tfh_tb->tb_len);
778*6b627f88SBjoern A. Zeeb }
779*6b627f88SBjoern A. Zeeb
780*6b627f88SBjoern A. Zeeb tfd = (struct iwl_tfd *)_tfd;
781*6b627f88SBjoern A. Zeeb tb = &tfd->tbs[idx];
782*6b627f88SBjoern A. Zeeb
783*6b627f88SBjoern A. Zeeb return le16_to_cpu(tb->hi_n_len) >> 4;
784*6b627f88SBjoern A. Zeeb }
785*6b627f88SBjoern A. Zeeb
786*6b627f88SBjoern A. Zeeb void iwl_pcie_reclaim(struct iwl_trans *trans, int txq_id, int ssn,
787*6b627f88SBjoern A. Zeeb struct sk_buff_head *skbs, bool is_flush);
788*6b627f88SBjoern A. Zeeb void iwl_pcie_set_q_ptrs(struct iwl_trans *trans, int txq_id, int ptr);
789*6b627f88SBjoern A. Zeeb void iwl_pcie_freeze_txq_timer(struct iwl_trans *trans,
790*6b627f88SBjoern A. Zeeb unsigned long txqs, bool freeze);
791*6b627f88SBjoern A. Zeeb int iwl_trans_pcie_wait_txq_empty(struct iwl_trans *trans, int txq_idx);
792*6b627f88SBjoern A. Zeeb int iwl_trans_pcie_wait_txqs_empty(struct iwl_trans *trans, u32 txq_bm);
793*6b627f88SBjoern A. Zeeb
794*6b627f88SBjoern A. Zeeb /*****************************************************
795*6b627f88SBjoern A. Zeeb * Error handling
796*6b627f88SBjoern A. Zeeb ******************************************************/
797*6b627f88SBjoern A. Zeeb void iwl_pcie_dump_csr(struct iwl_trans *trans);
798*6b627f88SBjoern A. Zeeb
799*6b627f88SBjoern A. Zeeb /*****************************************************
800*6b627f88SBjoern A. Zeeb * Helpers
801*6b627f88SBjoern A. Zeeb ******************************************************/
_iwl_disable_interrupts(struct iwl_trans * trans)802*6b627f88SBjoern A. Zeeb static inline void _iwl_disable_interrupts(struct iwl_trans *trans)
803*6b627f88SBjoern A. Zeeb {
804*6b627f88SBjoern A. Zeeb struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
805*6b627f88SBjoern A. Zeeb
806*6b627f88SBjoern A. Zeeb clear_bit(STATUS_INT_ENABLED, &trans->status);
807*6b627f88SBjoern A. Zeeb if (!trans_pcie->msix_enabled) {
808*6b627f88SBjoern A. Zeeb /* disable interrupts from uCode/NIC to host */
809*6b627f88SBjoern A. Zeeb iwl_write32(trans, CSR_INT_MASK, 0x00000000);
810*6b627f88SBjoern A. Zeeb
811*6b627f88SBjoern A. Zeeb /* acknowledge/clear/reset any interrupts still pending
812*6b627f88SBjoern A. Zeeb * from uCode or flow handler (Rx/Tx DMA) */
813*6b627f88SBjoern A. Zeeb iwl_write32(trans, CSR_INT, 0xffffffff);
814*6b627f88SBjoern A. Zeeb iwl_write32(trans, CSR_FH_INT_STATUS, 0xffffffff);
815*6b627f88SBjoern A. Zeeb } else {
816*6b627f88SBjoern A. Zeeb /* disable all the interrupt we might use */
817*6b627f88SBjoern A. Zeeb iwl_write32(trans, CSR_MSIX_FH_INT_MASK_AD,
818*6b627f88SBjoern A. Zeeb trans_pcie->fh_init_mask);
819*6b627f88SBjoern A. Zeeb iwl_write32(trans, CSR_MSIX_HW_INT_MASK_AD,
820*6b627f88SBjoern A. Zeeb trans_pcie->hw_init_mask);
821*6b627f88SBjoern A. Zeeb }
822*6b627f88SBjoern A. Zeeb IWL_DEBUG_ISR(trans, "Disabled interrupts\n");
823*6b627f88SBjoern A. Zeeb }
824*6b627f88SBjoern A. Zeeb
iwl_pcie_get_num_sections(const struct fw_img * fw,int start)825*6b627f88SBjoern A. Zeeb static inline int iwl_pcie_get_num_sections(const struct fw_img *fw,
826*6b627f88SBjoern A. Zeeb int start)
827*6b627f88SBjoern A. Zeeb {
828*6b627f88SBjoern A. Zeeb int i = 0;
829*6b627f88SBjoern A. Zeeb
830*6b627f88SBjoern A. Zeeb while (start < fw->num_sec &&
831*6b627f88SBjoern A. Zeeb fw->sec[start].offset != CPU1_CPU2_SEPARATOR_SECTION &&
832*6b627f88SBjoern A. Zeeb fw->sec[start].offset != PAGING_SEPARATOR_SECTION) {
833*6b627f88SBjoern A. Zeeb start++;
834*6b627f88SBjoern A. Zeeb i++;
835*6b627f88SBjoern A. Zeeb }
836*6b627f88SBjoern A. Zeeb
837*6b627f88SBjoern A. Zeeb return i;
838*6b627f88SBjoern A. Zeeb }
839*6b627f88SBjoern A. Zeeb
iwl_pcie_ctxt_info_free_fw_img(struct iwl_trans * trans)840*6b627f88SBjoern A. Zeeb static inline void iwl_pcie_ctxt_info_free_fw_img(struct iwl_trans *trans)
841*6b627f88SBjoern A. Zeeb {
842*6b627f88SBjoern A. Zeeb struct iwl_self_init_dram *dram = &trans->init_dram;
843*6b627f88SBjoern A. Zeeb int i;
844*6b627f88SBjoern A. Zeeb
845*6b627f88SBjoern A. Zeeb if (!dram->fw) {
846*6b627f88SBjoern A. Zeeb WARN_ON(dram->fw_cnt);
847*6b627f88SBjoern A. Zeeb return;
848*6b627f88SBjoern A. Zeeb }
849*6b627f88SBjoern A. Zeeb
850*6b627f88SBjoern A. Zeeb for (i = 0; i < dram->fw_cnt; i++)
851*6b627f88SBjoern A. Zeeb dma_free_coherent(trans->dev, dram->fw[i].size,
852*6b627f88SBjoern A. Zeeb dram->fw[i].block, dram->fw[i].physical);
853*6b627f88SBjoern A. Zeeb
854*6b627f88SBjoern A. Zeeb kfree(dram->fw);
855*6b627f88SBjoern A. Zeeb dram->fw_cnt = 0;
856*6b627f88SBjoern A. Zeeb dram->fw = NULL;
857*6b627f88SBjoern A. Zeeb }
858*6b627f88SBjoern A. Zeeb
iwl_disable_interrupts(struct iwl_trans * trans)859*6b627f88SBjoern A. Zeeb static inline void iwl_disable_interrupts(struct iwl_trans *trans)
860*6b627f88SBjoern A. Zeeb {
861*6b627f88SBjoern A. Zeeb struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
862*6b627f88SBjoern A. Zeeb
863*6b627f88SBjoern A. Zeeb spin_lock_bh(&trans_pcie->irq_lock);
864*6b627f88SBjoern A. Zeeb _iwl_disable_interrupts(trans);
865*6b627f88SBjoern A. Zeeb spin_unlock_bh(&trans_pcie->irq_lock);
866*6b627f88SBjoern A. Zeeb }
867*6b627f88SBjoern A. Zeeb
_iwl_enable_interrupts(struct iwl_trans * trans)868*6b627f88SBjoern A. Zeeb static inline void _iwl_enable_interrupts(struct iwl_trans *trans)
869*6b627f88SBjoern A. Zeeb {
870*6b627f88SBjoern A. Zeeb struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
871*6b627f88SBjoern A. Zeeb
872*6b627f88SBjoern A. Zeeb IWL_DEBUG_ISR(trans, "Enabling interrupts\n");
873*6b627f88SBjoern A. Zeeb set_bit(STATUS_INT_ENABLED, &trans->status);
874*6b627f88SBjoern A. Zeeb if (!trans_pcie->msix_enabled) {
875*6b627f88SBjoern A. Zeeb trans_pcie->inta_mask = CSR_INI_SET_MASK;
876*6b627f88SBjoern A. Zeeb iwl_write32(trans, CSR_INT_MASK, trans_pcie->inta_mask);
877*6b627f88SBjoern A. Zeeb } else {
878*6b627f88SBjoern A. Zeeb /*
879*6b627f88SBjoern A. Zeeb * fh/hw_mask keeps all the unmasked causes.
880*6b627f88SBjoern A. Zeeb * Unlike msi, in msix cause is enabled when it is unset.
881*6b627f88SBjoern A. Zeeb */
882*6b627f88SBjoern A. Zeeb trans_pcie->hw_mask = trans_pcie->hw_init_mask;
883*6b627f88SBjoern A. Zeeb trans_pcie->fh_mask = trans_pcie->fh_init_mask;
884*6b627f88SBjoern A. Zeeb iwl_write32(trans, CSR_MSIX_FH_INT_MASK_AD,
885*6b627f88SBjoern A. Zeeb ~trans_pcie->fh_mask);
886*6b627f88SBjoern A. Zeeb iwl_write32(trans, CSR_MSIX_HW_INT_MASK_AD,
887*6b627f88SBjoern A. Zeeb ~trans_pcie->hw_mask);
888*6b627f88SBjoern A. Zeeb }
889*6b627f88SBjoern A. Zeeb }
890*6b627f88SBjoern A. Zeeb
iwl_enable_interrupts(struct iwl_trans * trans)891*6b627f88SBjoern A. Zeeb static inline void iwl_enable_interrupts(struct iwl_trans *trans)
892*6b627f88SBjoern A. Zeeb {
893*6b627f88SBjoern A. Zeeb struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
894*6b627f88SBjoern A. Zeeb
895*6b627f88SBjoern A. Zeeb spin_lock_bh(&trans_pcie->irq_lock);
896*6b627f88SBjoern A. Zeeb _iwl_enable_interrupts(trans);
897*6b627f88SBjoern A. Zeeb spin_unlock_bh(&trans_pcie->irq_lock);
898*6b627f88SBjoern A. Zeeb }
iwl_enable_hw_int_msk_msix(struct iwl_trans * trans,u32 msk)899*6b627f88SBjoern A. Zeeb static inline void iwl_enable_hw_int_msk_msix(struct iwl_trans *trans, u32 msk)
900*6b627f88SBjoern A. Zeeb {
901*6b627f88SBjoern A. Zeeb struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
902*6b627f88SBjoern A. Zeeb
903*6b627f88SBjoern A. Zeeb iwl_write32(trans, CSR_MSIX_HW_INT_MASK_AD, ~msk);
904*6b627f88SBjoern A. Zeeb trans_pcie->hw_mask = msk;
905*6b627f88SBjoern A. Zeeb }
906*6b627f88SBjoern A. Zeeb
iwl_enable_fh_int_msk_msix(struct iwl_trans * trans,u32 msk)907*6b627f88SBjoern A. Zeeb static inline void iwl_enable_fh_int_msk_msix(struct iwl_trans *trans, u32 msk)
908*6b627f88SBjoern A. Zeeb {
909*6b627f88SBjoern A. Zeeb struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
910*6b627f88SBjoern A. Zeeb
911*6b627f88SBjoern A. Zeeb iwl_write32(trans, CSR_MSIX_FH_INT_MASK_AD, ~msk);
912*6b627f88SBjoern A. Zeeb trans_pcie->fh_mask = msk;
913*6b627f88SBjoern A. Zeeb }
914*6b627f88SBjoern A. Zeeb
iwl_enable_fw_load_int(struct iwl_trans * trans)915*6b627f88SBjoern A. Zeeb static inline void iwl_enable_fw_load_int(struct iwl_trans *trans)
916*6b627f88SBjoern A. Zeeb {
917*6b627f88SBjoern A. Zeeb struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
918*6b627f88SBjoern A. Zeeb
919*6b627f88SBjoern A. Zeeb IWL_DEBUG_ISR(trans, "Enabling FW load interrupt\n");
920*6b627f88SBjoern A. Zeeb if (!trans_pcie->msix_enabled) {
921*6b627f88SBjoern A. Zeeb trans_pcie->inta_mask = CSR_INT_BIT_FH_TX;
922*6b627f88SBjoern A. Zeeb iwl_write32(trans, CSR_INT_MASK, trans_pcie->inta_mask);
923*6b627f88SBjoern A. Zeeb } else {
924*6b627f88SBjoern A. Zeeb iwl_write32(trans, CSR_MSIX_HW_INT_MASK_AD,
925*6b627f88SBjoern A. Zeeb trans_pcie->hw_init_mask);
926*6b627f88SBjoern A. Zeeb iwl_enable_fh_int_msk_msix(trans,
927*6b627f88SBjoern A. Zeeb MSIX_FH_INT_CAUSES_D2S_CH0_NUM);
928*6b627f88SBjoern A. Zeeb }
929*6b627f88SBjoern A. Zeeb }
930*6b627f88SBjoern A. Zeeb
iwl_enable_fw_load_int_ctx_info(struct iwl_trans * trans,bool top_reset)931*6b627f88SBjoern A. Zeeb static inline void iwl_enable_fw_load_int_ctx_info(struct iwl_trans *trans,
932*6b627f88SBjoern A. Zeeb bool top_reset)
933*6b627f88SBjoern A. Zeeb {
934*6b627f88SBjoern A. Zeeb struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
935*6b627f88SBjoern A. Zeeb
936*6b627f88SBjoern A. Zeeb IWL_DEBUG_ISR(trans, "Enabling %s interrupt only\n",
937*6b627f88SBjoern A. Zeeb top_reset ? "RESET" : "ALIVE");
938*6b627f88SBjoern A. Zeeb
939*6b627f88SBjoern A. Zeeb if (!trans_pcie->msix_enabled) {
940*6b627f88SBjoern A. Zeeb /*
941*6b627f88SBjoern A. Zeeb * When we'll receive the ALIVE interrupt, the ISR will call
942*6b627f88SBjoern A. Zeeb * iwl_enable_fw_load_int_ctx_info again to set the ALIVE
943*6b627f88SBjoern A. Zeeb * interrupt (which is not really needed anymore) but also the
944*6b627f88SBjoern A. Zeeb * RX interrupt which will allow us to receive the ALIVE
945*6b627f88SBjoern A. Zeeb * notification (which is Rx) and continue the flow.
946*6b627f88SBjoern A. Zeeb */
947*6b627f88SBjoern A. Zeeb if (top_reset)
948*6b627f88SBjoern A. Zeeb trans_pcie->inta_mask = CSR_INT_BIT_RESET_DONE;
949*6b627f88SBjoern A. Zeeb else
950*6b627f88SBjoern A. Zeeb trans_pcie->inta_mask = CSR_INT_BIT_ALIVE |
951*6b627f88SBjoern A. Zeeb CSR_INT_BIT_FH_RX;
952*6b627f88SBjoern A. Zeeb iwl_write32(trans, CSR_INT_MASK, trans_pcie->inta_mask);
953*6b627f88SBjoern A. Zeeb } else {
954*6b627f88SBjoern A. Zeeb u32 val = top_reset ? MSIX_HW_INT_CAUSES_REG_RESET_DONE
955*6b627f88SBjoern A. Zeeb : MSIX_HW_INT_CAUSES_REG_ALIVE;
956*6b627f88SBjoern A. Zeeb
957*6b627f88SBjoern A. Zeeb iwl_enable_hw_int_msk_msix(trans, val);
958*6b627f88SBjoern A. Zeeb
959*6b627f88SBjoern A. Zeeb if (top_reset)
960*6b627f88SBjoern A. Zeeb return;
961*6b627f88SBjoern A. Zeeb /*
962*6b627f88SBjoern A. Zeeb * Leave all the FH causes enabled to get the ALIVE
963*6b627f88SBjoern A. Zeeb * notification.
964*6b627f88SBjoern A. Zeeb */
965*6b627f88SBjoern A. Zeeb iwl_enable_fh_int_msk_msix(trans, trans_pcie->fh_init_mask);
966*6b627f88SBjoern A. Zeeb }
967*6b627f88SBjoern A. Zeeb }
968*6b627f88SBjoern A. Zeeb
queue_name(struct device * dev,struct iwl_trans_pcie * trans_p,int i)969*6b627f88SBjoern A. Zeeb static inline const char *queue_name(struct device *dev,
970*6b627f88SBjoern A. Zeeb struct iwl_trans_pcie *trans_p, int i)
971*6b627f88SBjoern A. Zeeb {
972*6b627f88SBjoern A. Zeeb if (trans_p->shared_vec_mask) {
973*6b627f88SBjoern A. Zeeb int vec = trans_p->shared_vec_mask &
974*6b627f88SBjoern A. Zeeb IWL_SHARED_IRQ_FIRST_RSS ? 1 : 0;
975*6b627f88SBjoern A. Zeeb
976*6b627f88SBjoern A. Zeeb if (i == 0)
977*6b627f88SBjoern A. Zeeb return DRV_NAME ":shared_IRQ";
978*6b627f88SBjoern A. Zeeb
979*6b627f88SBjoern A. Zeeb return devm_kasprintf(dev, GFP_KERNEL,
980*6b627f88SBjoern A. Zeeb DRV_NAME ":queue_%d", i + vec);
981*6b627f88SBjoern A. Zeeb }
982*6b627f88SBjoern A. Zeeb if (i == 0)
983*6b627f88SBjoern A. Zeeb return DRV_NAME ":default_queue";
984*6b627f88SBjoern A. Zeeb
985*6b627f88SBjoern A. Zeeb if (i == trans_p->alloc_vecs - 1)
986*6b627f88SBjoern A. Zeeb return DRV_NAME ":exception";
987*6b627f88SBjoern A. Zeeb
988*6b627f88SBjoern A. Zeeb return devm_kasprintf(dev, GFP_KERNEL,
989*6b627f88SBjoern A. Zeeb DRV_NAME ":queue_%d", i);
990*6b627f88SBjoern A. Zeeb }
991*6b627f88SBjoern A. Zeeb
iwl_enable_rfkill_int(struct iwl_trans * trans)992*6b627f88SBjoern A. Zeeb static inline void iwl_enable_rfkill_int(struct iwl_trans *trans)
993*6b627f88SBjoern A. Zeeb {
994*6b627f88SBjoern A. Zeeb struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
995*6b627f88SBjoern A. Zeeb
996*6b627f88SBjoern A. Zeeb IWL_DEBUG_ISR(trans, "Enabling rfkill interrupt\n");
997*6b627f88SBjoern A. Zeeb if (!trans_pcie->msix_enabled) {
998*6b627f88SBjoern A. Zeeb trans_pcie->inta_mask = CSR_INT_BIT_RF_KILL;
999*6b627f88SBjoern A. Zeeb iwl_write32(trans, CSR_INT_MASK, trans_pcie->inta_mask);
1000*6b627f88SBjoern A. Zeeb } else {
1001*6b627f88SBjoern A. Zeeb iwl_write32(trans, CSR_MSIX_FH_INT_MASK_AD,
1002*6b627f88SBjoern A. Zeeb trans_pcie->fh_init_mask);
1003*6b627f88SBjoern A. Zeeb iwl_enable_hw_int_msk_msix(trans,
1004*6b627f88SBjoern A. Zeeb MSIX_HW_INT_CAUSES_REG_RF_KILL);
1005*6b627f88SBjoern A. Zeeb }
1006*6b627f88SBjoern A. Zeeb
1007*6b627f88SBjoern A. Zeeb if (trans->mac_cfg->device_family >= IWL_DEVICE_FAMILY_9000) {
1008*6b627f88SBjoern A. Zeeb /*
1009*6b627f88SBjoern A. Zeeb * On 9000-series devices this bit isn't enabled by default, so
1010*6b627f88SBjoern A. Zeeb * when we power down the device we need set the bit to allow it
1011*6b627f88SBjoern A. Zeeb * to wake up the PCI-E bus for RF-kill interrupts.
1012*6b627f88SBjoern A. Zeeb */
1013*6b627f88SBjoern A. Zeeb iwl_set_bit(trans, CSR_GP_CNTRL,
1014*6b627f88SBjoern A. Zeeb CSR_GP_CNTRL_REG_FLAG_RFKILL_WAKE_L1A_EN);
1015*6b627f88SBjoern A. Zeeb }
1016*6b627f88SBjoern A. Zeeb }
1017*6b627f88SBjoern A. Zeeb
1018*6b627f88SBjoern A. Zeeb void iwl_pcie_handle_rfkill_irq(struct iwl_trans *trans, bool from_irq);
1019*6b627f88SBjoern A. Zeeb
iwl_is_rfkill_set(struct iwl_trans * trans)1020*6b627f88SBjoern A. Zeeb static inline bool iwl_is_rfkill_set(struct iwl_trans *trans)
1021*6b627f88SBjoern A. Zeeb {
1022*6b627f88SBjoern A. Zeeb struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
1023*6b627f88SBjoern A. Zeeb
1024*6b627f88SBjoern A. Zeeb lockdep_assert_held(&trans_pcie->mutex);
1025*6b627f88SBjoern A. Zeeb
1026*6b627f88SBjoern A. Zeeb if (trans_pcie->debug_rfkill == 1)
1027*6b627f88SBjoern A. Zeeb return true;
1028*6b627f88SBjoern A. Zeeb
1029*6b627f88SBjoern A. Zeeb return !(iwl_read32(trans, CSR_GP_CNTRL) &
1030*6b627f88SBjoern A. Zeeb CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW);
1031*6b627f88SBjoern A. Zeeb }
1032*6b627f88SBjoern A. Zeeb
iwl_pcie_dbg_on(struct iwl_trans * trans)1033*6b627f88SBjoern A. Zeeb static inline bool iwl_pcie_dbg_on(struct iwl_trans *trans)
1034*6b627f88SBjoern A. Zeeb {
1035*6b627f88SBjoern A. Zeeb return (trans->dbg.dest_tlv || iwl_trans_dbg_ini_valid(trans));
1036*6b627f88SBjoern A. Zeeb }
1037*6b627f88SBjoern A. Zeeb
1038*6b627f88SBjoern A. Zeeb void iwl_trans_pcie_rf_kill(struct iwl_trans *trans, bool state, bool from_irq);
1039*6b627f88SBjoern A. Zeeb
1040*6b627f88SBjoern A. Zeeb #ifdef CONFIG_IWLWIFI_DEBUGFS
1041*6b627f88SBjoern A. Zeeb void iwl_trans_pcie_dbgfs_register(struct iwl_trans *trans);
1042*6b627f88SBjoern A. Zeeb void iwl_trans_pcie_debugfs_cleanup(struct iwl_trans *trans);
1043*6b627f88SBjoern A. Zeeb #else
iwl_trans_pcie_dbgfs_register(struct iwl_trans * trans)1044*6b627f88SBjoern A. Zeeb static inline void iwl_trans_pcie_dbgfs_register(struct iwl_trans *trans) { }
1045*6b627f88SBjoern A. Zeeb #endif
1046*6b627f88SBjoern A. Zeeb
1047*6b627f88SBjoern A. Zeeb void iwl_pcie_rx_allocator_work(struct work_struct *data);
1048*6b627f88SBjoern A. Zeeb
1049*6b627f88SBjoern A. Zeeb /* common trans ops for all generations transports */
1050*6b627f88SBjoern A. Zeeb void iwl_trans_pcie_op_mode_enter(struct iwl_trans *trans);
1051*6b627f88SBjoern A. Zeeb int _iwl_trans_pcie_start_hw(struct iwl_trans *trans);
1052*6b627f88SBjoern A. Zeeb int iwl_trans_pcie_start_hw(struct iwl_trans *trans);
1053*6b627f88SBjoern A. Zeeb void iwl_trans_pcie_op_mode_leave(struct iwl_trans *trans);
1054*6b627f88SBjoern A. Zeeb void iwl_trans_pcie_write8(struct iwl_trans *trans, u32 ofs, u8 val);
1055*6b627f88SBjoern A. Zeeb void iwl_trans_pcie_write32(struct iwl_trans *trans, u32 ofs, u32 val);
1056*6b627f88SBjoern A. Zeeb u32 iwl_trans_pcie_read32(struct iwl_trans *trans, u32 ofs);
1057*6b627f88SBjoern A. Zeeb u32 iwl_trans_pcie_read_prph(struct iwl_trans *trans, u32 reg);
1058*6b627f88SBjoern A. Zeeb void iwl_trans_pcie_write_prph(struct iwl_trans *trans, u32 addr, u32 val);
1059*6b627f88SBjoern A. Zeeb int iwl_trans_pcie_read_mem(struct iwl_trans *trans, u32 addr,
1060*6b627f88SBjoern A. Zeeb void *buf, int dwords);
1061*6b627f88SBjoern A. Zeeb int iwl_trans_pcie_sw_reset(struct iwl_trans *trans, bool retake_ownership);
1062*6b627f88SBjoern A. Zeeb struct iwl_trans_dump_data *
1063*6b627f88SBjoern A. Zeeb iwl_trans_pcie_dump_data(struct iwl_trans *trans, u32 dump_mask,
1064*6b627f88SBjoern A. Zeeb const struct iwl_dump_sanitize_ops *sanitize_ops,
1065*6b627f88SBjoern A. Zeeb void *sanitize_ctx);
1066*6b627f88SBjoern A. Zeeb int iwl_trans_pcie_d3_resume(struct iwl_trans *trans,
1067*6b627f88SBjoern A. Zeeb enum iwl_d3_status *status,
1068*6b627f88SBjoern A. Zeeb bool test, bool reset);
1069*6b627f88SBjoern A. Zeeb int iwl_trans_pcie_d3_suspend(struct iwl_trans *trans, bool test, bool reset);
1070*6b627f88SBjoern A. Zeeb void iwl_trans_pci_interrupts(struct iwl_trans *trans, bool enable);
1071*6b627f88SBjoern A. Zeeb void iwl_trans_pcie_sync_nmi(struct iwl_trans *trans);
1072*6b627f88SBjoern A. Zeeb void iwl_trans_pcie_set_bits_mask(struct iwl_trans *trans, u32 reg,
1073*6b627f88SBjoern A. Zeeb u32 mask, u32 value);
1074*6b627f88SBjoern A. Zeeb int iwl_trans_pcie_read_config32(struct iwl_trans *trans, u32 ofs,
1075*6b627f88SBjoern A. Zeeb u32 *val);
1076*6b627f88SBjoern A. Zeeb bool iwl_trans_pcie_grab_nic_access(struct iwl_trans *trans);
1077*6b627f88SBjoern A. Zeeb void __releases(nic_access_nobh)
1078*6b627f88SBjoern A. Zeeb iwl_trans_pcie_release_nic_access(struct iwl_trans *trans);
1079*6b627f88SBjoern A. Zeeb void iwl_pcie_alloc_fw_monitor(struct iwl_trans *trans, u8 max_power);
1080*6b627f88SBjoern A. Zeeb int iwl_pci_gen1_2_probe(struct pci_dev *pdev,
1081*6b627f88SBjoern A. Zeeb const struct pci_device_id *ent,
1082*6b627f88SBjoern A. Zeeb const struct iwl_mac_cfg *mac_cfg,
1083*6b627f88SBjoern A. Zeeb u8 __iomem *hw_base, u32 hw_rev);
1084*6b627f88SBjoern A. Zeeb
1085*6b627f88SBjoern A. Zeeb /* transport gen 1 exported functions */
1086*6b627f88SBjoern A. Zeeb void iwl_trans_pcie_fw_alive(struct iwl_trans *trans);
1087*6b627f88SBjoern A. Zeeb int iwl_trans_pcie_start_fw(struct iwl_trans *trans,
1088*6b627f88SBjoern A. Zeeb const struct iwl_fw *fw,
1089*6b627f88SBjoern A. Zeeb const struct fw_img *img,
1090*6b627f88SBjoern A. Zeeb bool run_in_rfkill);
1091*6b627f88SBjoern A. Zeeb void iwl_trans_pcie_stop_device(struct iwl_trans *trans);
1092*6b627f88SBjoern A. Zeeb
1093*6b627f88SBjoern A. Zeeb /* common functions that are used by gen2 transport */
1094*6b627f88SBjoern A. Zeeb void iwl_trans_pcie_gen2_op_mode_leave(struct iwl_trans *trans);
1095*6b627f88SBjoern A. Zeeb int iwl_pcie_gen2_apm_init(struct iwl_trans *trans);
1096*6b627f88SBjoern A. Zeeb void iwl_pcie_apm_config(struct iwl_trans *trans);
1097*6b627f88SBjoern A. Zeeb int iwl_pcie_prepare_card_hw(struct iwl_trans *trans);
1098*6b627f88SBjoern A. Zeeb void iwl_pcie_synchronize_irqs(struct iwl_trans *trans);
1099*6b627f88SBjoern A. Zeeb bool iwl_pcie_check_hw_rf_kill(struct iwl_trans *trans);
1100*6b627f88SBjoern A. Zeeb void iwl_trans_pcie_handle_stop_rfkill(struct iwl_trans *trans,
1101*6b627f88SBjoern A. Zeeb bool was_in_rfkill);
1102*6b627f88SBjoern A. Zeeb void iwl_pcie_apm_stop_master(struct iwl_trans *trans);
1103*6b627f88SBjoern A. Zeeb void iwl_pcie_conf_msix_hw(struct iwl_trans_pcie *trans_pcie);
1104*6b627f88SBjoern A. Zeeb int iwl_pcie_alloc_dma_ptr(struct iwl_trans *trans,
1105*6b627f88SBjoern A. Zeeb struct iwl_dma_ptr *ptr, size_t size);
1106*6b627f88SBjoern A. Zeeb void iwl_pcie_free_dma_ptr(struct iwl_trans *trans, struct iwl_dma_ptr *ptr);
1107*6b627f88SBjoern A. Zeeb void iwl_pcie_apply_destination(struct iwl_trans *trans);
1108*6b627f88SBjoern A. Zeeb
1109*6b627f88SBjoern A. Zeeb /* transport gen 2 exported functions */
1110*6b627f88SBjoern A. Zeeb int iwl_trans_pcie_gen2_start_fw(struct iwl_trans *trans,
1111*6b627f88SBjoern A. Zeeb const struct iwl_fw *fw,
1112*6b627f88SBjoern A. Zeeb const struct fw_img *img,
1113*6b627f88SBjoern A. Zeeb bool run_in_rfkill);
1114*6b627f88SBjoern A. Zeeb void iwl_trans_pcie_gen2_fw_alive(struct iwl_trans *trans);
1115*6b627f88SBjoern A. Zeeb void iwl_trans_pcie_gen2_stop_device(struct iwl_trans *trans);
1116*6b627f88SBjoern A. Zeeb int iwl_pcie_gen2_enqueue_hcmd(struct iwl_trans *trans,
1117*6b627f88SBjoern A. Zeeb struct iwl_host_cmd *cmd);
1118*6b627f88SBjoern A. Zeeb int iwl_pcie_enqueue_hcmd(struct iwl_trans *trans,
1119*6b627f88SBjoern A. Zeeb struct iwl_host_cmd *cmd);
1120*6b627f88SBjoern A. Zeeb void iwl_trans_pcie_copy_imr_fh(struct iwl_trans *trans,
1121*6b627f88SBjoern A. Zeeb u32 dst_addr, u64 src_addr, u32 byte_cnt);
1122*6b627f88SBjoern A. Zeeb int iwl_trans_pcie_copy_imr(struct iwl_trans *trans,
1123*6b627f88SBjoern A. Zeeb u32 dst_addr, u64 src_addr, u32 byte_cnt);
1124*6b627f88SBjoern A. Zeeb int iwl_trans_pcie_rxq_dma_data(struct iwl_trans *trans, int queue,
1125*6b627f88SBjoern A. Zeeb struct iwl_trans_rxq_dma_data *data);
1126*6b627f88SBjoern A. Zeeb
1127*6b627f88SBjoern A. Zeeb #endif /* __iwl_trans_int_pcie_h__ */
1128