blob: a5095343eb1130d0a50581b187d78c0f5fffe7c0 [file] [log] [blame]
Ron Mercerc4e84bd2008-09-18 11:56:28 -04001/*
2 * QLogic QLA41xx NIC HBA Driver
3 * Copyright (c) 2003-2006 QLogic Corporation
4 *
5 * See LICENSE.qlge for copyright and licensing details.
6 */
7#ifndef _QLGE_H_
8#define _QLGE_H_
9
10#include <linux/pci.h>
11#include <linux/netdevice.h>
12
13/*
14 * General definitions...
15 */
16#define DRV_NAME "qlge"
17#define DRV_STRING "QLogic 10 Gigabit PCI-E Ethernet Driver "
18#define DRV_VERSION "v1.00.00-b3"
19
20#define PFX "qlge: "
21#define QPRINTK(qdev, nlevel, klevel, fmt, args...) \
22 do { \
23 if (!((qdev)->msg_enable & NETIF_MSG_##nlevel)) \
24 ; \
25 else \
26 dev_printk(KERN_##klevel, &((qdev)->pdev->dev), \
27 "%s: " fmt, __func__, ##args); \
28 } while (0)
29
30#define QLGE_VENDOR_ID 0x1077
Ron Mercer697cdc42009-01-09 11:31:51 +000031#define QLGE_DEVICE_ID 0x8012
Ron Mercerc4e84bd2008-09-18 11:56:28 -040032
33#define MAX_RX_RINGS 128
34#define MAX_TX_RINGS 128
35
36#define NUM_TX_RING_ENTRIES 256
37#define NUM_RX_RING_ENTRIES 256
38
39#define NUM_SMALL_BUFFERS 512
40#define NUM_LARGE_BUFFERS 512
41
42#define SMALL_BUFFER_SIZE 256
43#define LARGE_BUFFER_SIZE PAGE_SIZE
44#define MAX_SPLIT_SIZE 1023
45#define QLGE_SB_PAD 32
46
47#define DFLT_COALESCE_WAIT 100 /* 100 usec wait for coalescing */
48#define MAX_INTER_FRAME_WAIT 10 /* 10 usec max interframe-wait for coalescing */
49#define DFLT_INTER_FRAME_WAIT (MAX_INTER_FRAME_WAIT/2)
50#define UDELAY_COUNT 3
51#define UDELAY_DELAY 10
52
53
54#define TX_DESC_PER_IOCB 8
55/* The maximum number of frags we handle is based
56 * on PAGE_SIZE...
57 */
58#if (PAGE_SHIFT == 12) || (PAGE_SHIFT == 13) /* 4k & 8k pages */
59#define TX_DESC_PER_OAL ((MAX_SKB_FRAGS - TX_DESC_PER_IOCB) + 2)
Ron Mercer48501372008-10-13 22:55:59 -070060#else /* all other page sizes */
Ron Mercerc4e84bd2008-09-18 11:56:28 -040061#define TX_DESC_PER_OAL 0
62#endif
63
64#define DB_PAGE_SIZE 4096
65
66/*
67 * Processor Address Register (PROC_ADDR) bit definitions.
68 */
69enum {
70
71 /* Misc. stuff */
72 MAILBOX_COUNT = 16,
73
74 PROC_ADDR_RDY = (1 << 31),
75 PROC_ADDR_R = (1 << 30),
76 PROC_ADDR_ERR = (1 << 29),
77 PROC_ADDR_DA = (1 << 28),
78 PROC_ADDR_FUNC0_MBI = 0x00001180,
79 PROC_ADDR_FUNC0_MBO = (PROC_ADDR_FUNC0_MBI + MAILBOX_COUNT),
80 PROC_ADDR_FUNC0_CTL = 0x000011a1,
81 PROC_ADDR_FUNC2_MBI = 0x00001280,
82 PROC_ADDR_FUNC2_MBO = (PROC_ADDR_FUNC2_MBI + MAILBOX_COUNT),
83 PROC_ADDR_FUNC2_CTL = 0x000012a1,
84 PROC_ADDR_MPI_RISC = 0x00000000,
85 PROC_ADDR_MDE = 0x00010000,
86 PROC_ADDR_REGBLOCK = 0x00020000,
87 PROC_ADDR_RISC_REG = 0x00030000,
88};
89
90/*
91 * System Register (SYS) bit definitions.
92 */
93enum {
94 SYS_EFE = (1 << 0),
95 SYS_FAE = (1 << 1),
96 SYS_MDC = (1 << 2),
97 SYS_DST = (1 << 3),
98 SYS_DWC = (1 << 4),
99 SYS_EVW = (1 << 5),
100 SYS_OMP_DLY_MASK = 0x3f000000,
101 /*
102 * There are no values defined as of edit #15.
103 */
104 SYS_ODI = (1 << 14),
105};
106
107/*
108 * Reset/Failover Register (RST_FO) bit definitions.
109 */
110enum {
111 RST_FO_TFO = (1 << 0),
112 RST_FO_RR_MASK = 0x00060000,
113 RST_FO_RR_CQ_CAM = 0x00000000,
114 RST_FO_RR_DROP = 0x00000001,
115 RST_FO_RR_DQ = 0x00000002,
116 RST_FO_RR_RCV_FUNC_CQ = 0x00000003,
117 RST_FO_FRB = (1 << 12),
118 RST_FO_MOP = (1 << 13),
119 RST_FO_REG = (1 << 14),
120 RST_FO_FR = (1 << 15),
121};
122
123/*
124 * Function Specific Control Register (FSC) bit definitions.
125 */
126enum {
127 FSC_DBRST_MASK = 0x00070000,
128 FSC_DBRST_256 = 0x00000000,
129 FSC_DBRST_512 = 0x00000001,
130 FSC_DBRST_768 = 0x00000002,
131 FSC_DBRST_1024 = 0x00000003,
132 FSC_DBL_MASK = 0x00180000,
133 FSC_DBL_DBRST = 0x00000000,
134 FSC_DBL_MAX_PLD = 0x00000008,
135 FSC_DBL_MAX_BRST = 0x00000010,
136 FSC_DBL_128_BYTES = 0x00000018,
137 FSC_EC = (1 << 5),
138 FSC_EPC_MASK = 0x00c00000,
139 FSC_EPC_INBOUND = (1 << 6),
140 FSC_EPC_OUTBOUND = (1 << 7),
141 FSC_VM_PAGESIZE_MASK = 0x07000000,
142 FSC_VM_PAGE_2K = 0x00000100,
143 FSC_VM_PAGE_4K = 0x00000200,
144 FSC_VM_PAGE_8K = 0x00000300,
145 FSC_VM_PAGE_64K = 0x00000600,
146 FSC_SH = (1 << 11),
147 FSC_DSB = (1 << 12),
148 FSC_STE = (1 << 13),
149 FSC_FE = (1 << 15),
150};
151
152/*
153 * Host Command Status Register (CSR) bit definitions.
154 */
155enum {
156 CSR_ERR_STS_MASK = 0x0000003f,
157 /*
158 * There are no valued defined as of edit #15.
159 */
160 CSR_RR = (1 << 8),
161 CSR_HRI = (1 << 9),
162 CSR_RP = (1 << 10),
163 CSR_CMD_PARM_SHIFT = 22,
164 CSR_CMD_NOP = 0x00000000,
165 CSR_CMD_SET_RST = 0x1000000,
166 CSR_CMD_CLR_RST = 0x20000000,
167 CSR_CMD_SET_PAUSE = 0x30000000,
168 CSR_CMD_CLR_PAUSE = 0x40000000,
169 CSR_CMD_SET_H2R_INT = 0x50000000,
170 CSR_CMD_CLR_H2R_INT = 0x60000000,
171 CSR_CMD_PAR_EN = 0x70000000,
172 CSR_CMD_SET_BAD_PAR = 0x80000000,
173 CSR_CMD_CLR_BAD_PAR = 0x90000000,
174 CSR_CMD_CLR_R2PCI_INT = 0xa0000000,
175};
176
177/*
178 * Configuration Register (CFG) bit definitions.
179 */
180enum {
181 CFG_LRQ = (1 << 0),
182 CFG_DRQ = (1 << 1),
183 CFG_LR = (1 << 2),
184 CFG_DR = (1 << 3),
185 CFG_LE = (1 << 5),
186 CFG_LCQ = (1 << 6),
187 CFG_DCQ = (1 << 7),
188 CFG_Q_SHIFT = 8,
189 CFG_Q_MASK = 0x7f000000,
190};
191
192/*
193 * Status Register (STS) bit definitions.
194 */
195enum {
196 STS_FE = (1 << 0),
197 STS_PI = (1 << 1),
198 STS_PL0 = (1 << 2),
199 STS_PL1 = (1 << 3),
200 STS_PI0 = (1 << 4),
201 STS_PI1 = (1 << 5),
202 STS_FUNC_ID_MASK = 0x000000c0,
203 STS_FUNC_ID_SHIFT = 6,
204 STS_F0E = (1 << 8),
205 STS_F1E = (1 << 9),
206 STS_F2E = (1 << 10),
207 STS_F3E = (1 << 11),
208 STS_NFE = (1 << 12),
209};
210
211/*
212 * Interrupt Enable Register (INTR_EN) bit definitions.
213 */
214enum {
215 INTR_EN_INTR_MASK = 0x007f0000,
216 INTR_EN_TYPE_MASK = 0x03000000,
217 INTR_EN_TYPE_ENABLE = 0x00000100,
218 INTR_EN_TYPE_DISABLE = 0x00000200,
219 INTR_EN_TYPE_READ = 0x00000300,
220 INTR_EN_IHD = (1 << 13),
221 INTR_EN_IHD_MASK = (INTR_EN_IHD << 16),
222 INTR_EN_EI = (1 << 14),
223 INTR_EN_EN = (1 << 15),
224};
225
226/*
227 * Interrupt Mask Register (INTR_MASK) bit definitions.
228 */
229enum {
230 INTR_MASK_PI = (1 << 0),
231 INTR_MASK_HL0 = (1 << 1),
232 INTR_MASK_LH0 = (1 << 2),
233 INTR_MASK_HL1 = (1 << 3),
234 INTR_MASK_LH1 = (1 << 4),
235 INTR_MASK_SE = (1 << 5),
236 INTR_MASK_LSC = (1 << 6),
237 INTR_MASK_MC = (1 << 7),
238 INTR_MASK_LINK_IRQS = INTR_MASK_LSC | INTR_MASK_SE | INTR_MASK_MC,
239};
240
241/*
242 * Register (REV_ID) bit definitions.
243 */
244enum {
245 REV_ID_MASK = 0x0000000f,
246 REV_ID_NICROLL_SHIFT = 0,
247 REV_ID_NICREV_SHIFT = 4,
248 REV_ID_XGROLL_SHIFT = 8,
249 REV_ID_XGREV_SHIFT = 12,
250 REV_ID_CHIPREV_SHIFT = 28,
251};
252
253/*
254 * Force ECC Error Register (FRC_ECC_ERR) bit definitions.
255 */
256enum {
257 FRC_ECC_ERR_VW = (1 << 12),
258 FRC_ECC_ERR_VB = (1 << 13),
259 FRC_ECC_ERR_NI = (1 << 14),
260 FRC_ECC_ERR_NO = (1 << 15),
261 FRC_ECC_PFE_SHIFT = 16,
262 FRC_ECC_ERR_DO = (1 << 18),
263 FRC_ECC_P14 = (1 << 19),
264};
265
266/*
267 * Error Status Register (ERR_STS) bit definitions.
268 */
269enum {
270 ERR_STS_NOF = (1 << 0),
271 ERR_STS_NIF = (1 << 1),
272 ERR_STS_DRP = (1 << 2),
273 ERR_STS_XGP = (1 << 3),
274 ERR_STS_FOU = (1 << 4),
275 ERR_STS_FOC = (1 << 5),
276 ERR_STS_FOF = (1 << 6),
277 ERR_STS_FIU = (1 << 7),
278 ERR_STS_FIC = (1 << 8),
279 ERR_STS_FIF = (1 << 9),
280 ERR_STS_MOF = (1 << 10),
281 ERR_STS_TA = (1 << 11),
282 ERR_STS_MA = (1 << 12),
283 ERR_STS_MPE = (1 << 13),
284 ERR_STS_SCE = (1 << 14),
285 ERR_STS_STE = (1 << 15),
286 ERR_STS_FOW = (1 << 16),
287 ERR_STS_UE = (1 << 17),
288 ERR_STS_MCH = (1 << 26),
289 ERR_STS_LOC_SHIFT = 27,
290};
291
292/*
293 * RAM Debug Address Register (RAM_DBG_ADDR) bit definitions.
294 */
295enum {
296 RAM_DBG_ADDR_FW = (1 << 30),
297 RAM_DBG_ADDR_FR = (1 << 31),
298};
299
300/*
301 * Semaphore Register (SEM) bit definitions.
302 */
303enum {
304 /*
305 * Example:
306 * reg = SEM_XGMAC0_MASK | (SEM_SET << SEM_XGMAC0_SHIFT)
307 */
308 SEM_CLEAR = 0,
309 SEM_SET = 1,
310 SEM_FORCE = 3,
311 SEM_XGMAC0_SHIFT = 0,
312 SEM_XGMAC1_SHIFT = 2,
313 SEM_ICB_SHIFT = 4,
314 SEM_MAC_ADDR_SHIFT = 6,
315 SEM_FLASH_SHIFT = 8,
316 SEM_PROBE_SHIFT = 10,
317 SEM_RT_IDX_SHIFT = 12,
318 SEM_PROC_REG_SHIFT = 14,
319 SEM_XGMAC0_MASK = 0x00030000,
320 SEM_XGMAC1_MASK = 0x000c0000,
321 SEM_ICB_MASK = 0x00300000,
322 SEM_MAC_ADDR_MASK = 0x00c00000,
323 SEM_FLASH_MASK = 0x03000000,
324 SEM_PROBE_MASK = 0x0c000000,
325 SEM_RT_IDX_MASK = 0x30000000,
326 SEM_PROC_REG_MASK = 0xc0000000,
327};
328
329/*
330 * 10G MAC Address Register (XGMAC_ADDR) bit definitions.
331 */
332enum {
333 XGMAC_ADDR_RDY = (1 << 31),
334 XGMAC_ADDR_R = (1 << 30),
335 XGMAC_ADDR_XME = (1 << 29),
336
337 /* XGMAC control registers */
338 PAUSE_SRC_LO = 0x00000100,
339 PAUSE_SRC_HI = 0x00000104,
340 GLOBAL_CFG = 0x00000108,
341 GLOBAL_CFG_RESET = (1 << 0),
342 GLOBAL_CFG_JUMBO = (1 << 6),
343 GLOBAL_CFG_TX_STAT_EN = (1 << 10),
344 GLOBAL_CFG_RX_STAT_EN = (1 << 11),
345 TX_CFG = 0x0000010c,
346 TX_CFG_RESET = (1 << 0),
347 TX_CFG_EN = (1 << 1),
348 TX_CFG_PREAM = (1 << 2),
349 RX_CFG = 0x00000110,
350 RX_CFG_RESET = (1 << 0),
351 RX_CFG_EN = (1 << 1),
352 RX_CFG_PREAM = (1 << 2),
353 FLOW_CTL = 0x0000011c,
354 PAUSE_OPCODE = 0x00000120,
355 PAUSE_TIMER = 0x00000124,
356 PAUSE_FRM_DEST_LO = 0x00000128,
357 PAUSE_FRM_DEST_HI = 0x0000012c,
358 MAC_TX_PARAMS = 0x00000134,
359 MAC_TX_PARAMS_JUMBO = (1 << 31),
360 MAC_TX_PARAMS_SIZE_SHIFT = 16,
361 MAC_RX_PARAMS = 0x00000138,
362 MAC_SYS_INT = 0x00000144,
363 MAC_SYS_INT_MASK = 0x00000148,
364 MAC_MGMT_INT = 0x0000014c,
365 MAC_MGMT_IN_MASK = 0x00000150,
366 EXT_ARB_MODE = 0x000001fc,
367
368 /* XGMAC TX statistics registers */
369 TX_PKTS = 0x00000200,
370 TX_BYTES = 0x00000208,
371 TX_MCAST_PKTS = 0x00000210,
372 TX_BCAST_PKTS = 0x00000218,
373 TX_UCAST_PKTS = 0x00000220,
374 TX_CTL_PKTS = 0x00000228,
375 TX_PAUSE_PKTS = 0x00000230,
376 TX_64_PKT = 0x00000238,
377 TX_65_TO_127_PKT = 0x00000240,
378 TX_128_TO_255_PKT = 0x00000248,
379 TX_256_511_PKT = 0x00000250,
380 TX_512_TO_1023_PKT = 0x00000258,
381 TX_1024_TO_1518_PKT = 0x00000260,
382 TX_1519_TO_MAX_PKT = 0x00000268,
383 TX_UNDERSIZE_PKT = 0x00000270,
384 TX_OVERSIZE_PKT = 0x00000278,
385
386 /* XGMAC statistics control registers */
387 RX_HALF_FULL_DET = 0x000002a0,
388 TX_HALF_FULL_DET = 0x000002a4,
389 RX_OVERFLOW_DET = 0x000002a8,
390 TX_OVERFLOW_DET = 0x000002ac,
391 RX_HALF_FULL_MASK = 0x000002b0,
392 TX_HALF_FULL_MASK = 0x000002b4,
393 RX_OVERFLOW_MASK = 0x000002b8,
394 TX_OVERFLOW_MASK = 0x000002bc,
395 STAT_CNT_CTL = 0x000002c0,
396 STAT_CNT_CTL_CLEAR_TX = (1 << 0),
397 STAT_CNT_CTL_CLEAR_RX = (1 << 1),
398 AUX_RX_HALF_FULL_DET = 0x000002d0,
399 AUX_TX_HALF_FULL_DET = 0x000002d4,
400 AUX_RX_OVERFLOW_DET = 0x000002d8,
401 AUX_TX_OVERFLOW_DET = 0x000002dc,
402 AUX_RX_HALF_FULL_MASK = 0x000002f0,
403 AUX_TX_HALF_FULL_MASK = 0x000002f4,
404 AUX_RX_OVERFLOW_MASK = 0x000002f8,
405 AUX_TX_OVERFLOW_MASK = 0x000002fc,
406
407 /* XGMAC RX statistics registers */
408 RX_BYTES = 0x00000300,
409 RX_BYTES_OK = 0x00000308,
410 RX_PKTS = 0x00000310,
411 RX_PKTS_OK = 0x00000318,
412 RX_BCAST_PKTS = 0x00000320,
413 RX_MCAST_PKTS = 0x00000328,
414 RX_UCAST_PKTS = 0x00000330,
415 RX_UNDERSIZE_PKTS = 0x00000338,
416 RX_OVERSIZE_PKTS = 0x00000340,
417 RX_JABBER_PKTS = 0x00000348,
418 RX_UNDERSIZE_FCERR_PKTS = 0x00000350,
419 RX_DROP_EVENTS = 0x00000358,
420 RX_FCERR_PKTS = 0x00000360,
421 RX_ALIGN_ERR = 0x00000368,
422 RX_SYMBOL_ERR = 0x00000370,
423 RX_MAC_ERR = 0x00000378,
424 RX_CTL_PKTS = 0x00000380,
425 RX_PAUSE_PKTS = 0x00000384,
426 RX_64_PKTS = 0x00000390,
427 RX_65_TO_127_PKTS = 0x00000398,
428 RX_128_255_PKTS = 0x000003a0,
429 RX_256_511_PKTS = 0x000003a8,
430 RX_512_TO_1023_PKTS = 0x000003b0,
431 RX_1024_TO_1518_PKTS = 0x000003b8,
432 RX_1519_TO_MAX_PKTS = 0x000003c0,
433 RX_LEN_ERR_PKTS = 0x000003c8,
434
435 /* XGMAC MDIO control registers */
436 MDIO_TX_DATA = 0x00000400,
437 MDIO_RX_DATA = 0x00000410,
438 MDIO_CMD = 0x00000420,
439 MDIO_PHY_ADDR = 0x00000430,
440 MDIO_PORT = 0x00000440,
441 MDIO_STATUS = 0x00000450,
442
443 /* XGMAC AUX statistics registers */
444};
445
446/*
447 * Enhanced Transmission Schedule Registers (NIC_ETS,CNA_ETS) bit definitions.
448 */
449enum {
450 ETS_QUEUE_SHIFT = 29,
451 ETS_REF = (1 << 26),
452 ETS_RS = (1 << 27),
453 ETS_P = (1 << 28),
454 ETS_FC_COS_SHIFT = 23,
455};
456
457/*
458 * Flash Address Register (FLASH_ADDR) bit definitions.
459 */
460enum {
461 FLASH_ADDR_RDY = (1 << 31),
462 FLASH_ADDR_R = (1 << 30),
463 FLASH_ADDR_ERR = (1 << 29),
464};
465
466/*
467 * Stop CQ Processing Register (CQ_STOP) bit definitions.
468 */
469enum {
470 CQ_STOP_QUEUE_MASK = (0x007f0000),
471 CQ_STOP_TYPE_MASK = (0x03000000),
472 CQ_STOP_TYPE_START = 0x00000100,
473 CQ_STOP_TYPE_STOP = 0x00000200,
474 CQ_STOP_TYPE_READ = 0x00000300,
475 CQ_STOP_EN = (1 << 15),
476};
477
478/*
479 * MAC Protocol Address Index Register (MAC_ADDR_IDX) bit definitions.
480 */
481enum {
482 MAC_ADDR_IDX_SHIFT = 4,
483 MAC_ADDR_TYPE_SHIFT = 16,
484 MAC_ADDR_TYPE_MASK = 0x000f0000,
485 MAC_ADDR_TYPE_CAM_MAC = 0x00000000,
486 MAC_ADDR_TYPE_MULTI_MAC = 0x00010000,
487 MAC_ADDR_TYPE_VLAN = 0x00020000,
488 MAC_ADDR_TYPE_MULTI_FLTR = 0x00030000,
489 MAC_ADDR_TYPE_FC_MAC = 0x00040000,
490 MAC_ADDR_TYPE_MGMT_MAC = 0x00050000,
491 MAC_ADDR_TYPE_MGMT_VLAN = 0x00060000,
492 MAC_ADDR_TYPE_MGMT_V4 = 0x00070000,
493 MAC_ADDR_TYPE_MGMT_V6 = 0x00080000,
494 MAC_ADDR_TYPE_MGMT_TU_DP = 0x00090000,
495 MAC_ADDR_ADR = (1 << 25),
496 MAC_ADDR_RS = (1 << 26),
497 MAC_ADDR_E = (1 << 27),
498 MAC_ADDR_MR = (1 << 30),
499 MAC_ADDR_MW = (1 << 31),
500 MAX_MULTICAST_ENTRIES = 32,
501};
502
503/*
504 * MAC Protocol Address Index Register (SPLT_HDR) bit definitions.
505 */
506enum {
507 SPLT_HDR_EP = (1 << 31),
508};
509
510/*
511 * FCoE Receive Configuration Register (FC_RCV_CFG) bit definitions.
512 */
513enum {
514 FC_RCV_CFG_ECT = (1 << 15),
515 FC_RCV_CFG_DFH = (1 << 20),
516 FC_RCV_CFG_DVF = (1 << 21),
517 FC_RCV_CFG_RCE = (1 << 27),
518 FC_RCV_CFG_RFE = (1 << 28),
519 FC_RCV_CFG_TEE = (1 << 29),
520 FC_RCV_CFG_TCE = (1 << 30),
521 FC_RCV_CFG_TFE = (1 << 31),
522};
523
524/*
525 * NIC Receive Configuration Register (NIC_RCV_CFG) bit definitions.
526 */
527enum {
528 NIC_RCV_CFG_PPE = (1 << 0),
529 NIC_RCV_CFG_VLAN_MASK = 0x00060000,
530 NIC_RCV_CFG_VLAN_ALL = 0x00000000,
531 NIC_RCV_CFG_VLAN_MATCH_ONLY = 0x00000002,
532 NIC_RCV_CFG_VLAN_MATCH_AND_NON = 0x00000004,
533 NIC_RCV_CFG_VLAN_NONE_AND_NON = 0x00000006,
534 NIC_RCV_CFG_RV = (1 << 3),
535 NIC_RCV_CFG_DFQ_MASK = (0x7f000000),
536 NIC_RCV_CFG_DFQ_SHIFT = 8,
537 NIC_RCV_CFG_DFQ = 0, /* HARDCODE default queue to 0. */
538};
539
540/*
541 * Mgmt Receive Configuration Register (MGMT_RCV_CFG) bit definitions.
542 */
543enum {
544 MGMT_RCV_CFG_ARP = (1 << 0),
545 MGMT_RCV_CFG_DHC = (1 << 1),
546 MGMT_RCV_CFG_DHS = (1 << 2),
547 MGMT_RCV_CFG_NP = (1 << 3),
548 MGMT_RCV_CFG_I6N = (1 << 4),
549 MGMT_RCV_CFG_I6R = (1 << 5),
550 MGMT_RCV_CFG_DH6 = (1 << 6),
551 MGMT_RCV_CFG_UD1 = (1 << 7),
552 MGMT_RCV_CFG_UD0 = (1 << 8),
553 MGMT_RCV_CFG_BCT = (1 << 9),
554 MGMT_RCV_CFG_MCT = (1 << 10),
555 MGMT_RCV_CFG_DM = (1 << 11),
556 MGMT_RCV_CFG_RM = (1 << 12),
557 MGMT_RCV_CFG_STL = (1 << 13),
558 MGMT_RCV_CFG_VLAN_MASK = 0xc0000000,
559 MGMT_RCV_CFG_VLAN_ALL = 0x00000000,
560 MGMT_RCV_CFG_VLAN_MATCH_ONLY = 0x00004000,
561 MGMT_RCV_CFG_VLAN_MATCH_AND_NON = 0x00008000,
562 MGMT_RCV_CFG_VLAN_NONE_AND_NON = 0x0000c000,
563};
564
565/*
566 * Routing Index Register (RT_IDX) bit definitions.
567 */
568enum {
569 RT_IDX_IDX_SHIFT = 8,
570 RT_IDX_TYPE_MASK = 0x000f0000,
571 RT_IDX_TYPE_RT = 0x00000000,
572 RT_IDX_TYPE_RT_INV = 0x00010000,
573 RT_IDX_TYPE_NICQ = 0x00020000,
574 RT_IDX_TYPE_NICQ_INV = 0x00030000,
575 RT_IDX_DST_MASK = 0x00700000,
576 RT_IDX_DST_RSS = 0x00000000,
577 RT_IDX_DST_CAM_Q = 0x00100000,
578 RT_IDX_DST_COS_Q = 0x00200000,
579 RT_IDX_DST_DFLT_Q = 0x00300000,
580 RT_IDX_DST_DEST_Q = 0x00400000,
581 RT_IDX_RS = (1 << 26),
582 RT_IDX_E = (1 << 27),
583 RT_IDX_MR = (1 << 30),
584 RT_IDX_MW = (1 << 31),
585
586 /* Nic Queue format - type 2 bits */
587 RT_IDX_BCAST = (1 << 0),
588 RT_IDX_MCAST = (1 << 1),
589 RT_IDX_MCAST_MATCH = (1 << 2),
590 RT_IDX_MCAST_REG_MATCH = (1 << 3),
591 RT_IDX_MCAST_HASH_MATCH = (1 << 4),
592 RT_IDX_FC_MACH = (1 << 5),
593 RT_IDX_ETH_FCOE = (1 << 6),
594 RT_IDX_CAM_HIT = (1 << 7),
595 RT_IDX_CAM_BIT0 = (1 << 8),
596 RT_IDX_CAM_BIT1 = (1 << 9),
597 RT_IDX_VLAN_TAG = (1 << 10),
598 RT_IDX_VLAN_MATCH = (1 << 11),
599 RT_IDX_VLAN_FILTER = (1 << 12),
600 RT_IDX_ETH_SKIP1 = (1 << 13),
601 RT_IDX_ETH_SKIP2 = (1 << 14),
602 RT_IDX_BCAST_MCAST_MATCH = (1 << 15),
603 RT_IDX_802_3 = (1 << 16),
604 RT_IDX_LLDP = (1 << 17),
605 RT_IDX_UNUSED018 = (1 << 18),
606 RT_IDX_UNUSED019 = (1 << 19),
607 RT_IDX_UNUSED20 = (1 << 20),
608 RT_IDX_UNUSED21 = (1 << 21),
609 RT_IDX_ERR = (1 << 22),
610 RT_IDX_VALID = (1 << 23),
611 RT_IDX_TU_CSUM_ERR = (1 << 24),
612 RT_IDX_IP_CSUM_ERR = (1 << 25),
613 RT_IDX_MAC_ERR = (1 << 26),
614 RT_IDX_RSS_TCP6 = (1 << 27),
615 RT_IDX_RSS_TCP4 = (1 << 28),
616 RT_IDX_RSS_IPV6 = (1 << 29),
617 RT_IDX_RSS_IPV4 = (1 << 30),
618 RT_IDX_RSS_MATCH = (1 << 31),
619
620 /* Hierarchy for the NIC Queue Mask */
621 RT_IDX_ALL_ERR_SLOT = 0,
622 RT_IDX_MAC_ERR_SLOT = 0,
623 RT_IDX_IP_CSUM_ERR_SLOT = 1,
624 RT_IDX_TCP_UDP_CSUM_ERR_SLOT = 2,
625 RT_IDX_BCAST_SLOT = 3,
626 RT_IDX_MCAST_MATCH_SLOT = 4,
627 RT_IDX_ALLMULTI_SLOT = 5,
628 RT_IDX_UNUSED6_SLOT = 6,
629 RT_IDX_UNUSED7_SLOT = 7,
630 RT_IDX_RSS_MATCH_SLOT = 8,
631 RT_IDX_RSS_IPV4_SLOT = 8,
632 RT_IDX_RSS_IPV6_SLOT = 9,
633 RT_IDX_RSS_TCP4_SLOT = 10,
634 RT_IDX_RSS_TCP6_SLOT = 11,
635 RT_IDX_CAM_HIT_SLOT = 12,
636 RT_IDX_UNUSED013 = 13,
637 RT_IDX_UNUSED014 = 14,
638 RT_IDX_PROMISCUOUS_SLOT = 15,
639 RT_IDX_MAX_SLOTS = 16,
640};
641
642/*
643 * Control Register Set Map
644 */
645enum {
646 PROC_ADDR = 0, /* Use semaphore */
647 PROC_DATA = 0x04, /* Use semaphore */
648 SYS = 0x08,
649 RST_FO = 0x0c,
650 FSC = 0x10,
651 CSR = 0x14,
652 LED = 0x18,
653 ICB_RID = 0x1c, /* Use semaphore */
654 ICB_L = 0x20, /* Use semaphore */
655 ICB_H = 0x24, /* Use semaphore */
656 CFG = 0x28,
657 BIOS_ADDR = 0x2c,
658 STS = 0x30,
659 INTR_EN = 0x34,
660 INTR_MASK = 0x38,
661 ISR1 = 0x3c,
662 ISR2 = 0x40,
663 ISR3 = 0x44,
664 ISR4 = 0x48,
665 REV_ID = 0x4c,
666 FRC_ECC_ERR = 0x50,
667 ERR_STS = 0x54,
668 RAM_DBG_ADDR = 0x58,
669 RAM_DBG_DATA = 0x5c,
670 ECC_ERR_CNT = 0x60,
671 SEM = 0x64,
672 GPIO_1 = 0x68, /* Use semaphore */
673 GPIO_2 = 0x6c, /* Use semaphore */
674 GPIO_3 = 0x70, /* Use semaphore */
675 RSVD2 = 0x74,
676 XGMAC_ADDR = 0x78, /* Use semaphore */
677 XGMAC_DATA = 0x7c, /* Use semaphore */
678 NIC_ETS = 0x80,
679 CNA_ETS = 0x84,
680 FLASH_ADDR = 0x88, /* Use semaphore */
681 FLASH_DATA = 0x8c, /* Use semaphore */
682 CQ_STOP = 0x90,
683 PAGE_TBL_RID = 0x94,
684 WQ_PAGE_TBL_LO = 0x98,
685 WQ_PAGE_TBL_HI = 0x9c,
686 CQ_PAGE_TBL_LO = 0xa0,
687 CQ_PAGE_TBL_HI = 0xa4,
688 MAC_ADDR_IDX = 0xa8, /* Use semaphore */
689 MAC_ADDR_DATA = 0xac, /* Use semaphore */
690 COS_DFLT_CQ1 = 0xb0,
691 COS_DFLT_CQ2 = 0xb4,
692 ETYPE_SKIP1 = 0xb8,
693 ETYPE_SKIP2 = 0xbc,
694 SPLT_HDR = 0xc0,
695 FC_PAUSE_THRES = 0xc4,
696 NIC_PAUSE_THRES = 0xc8,
697 FC_ETHERTYPE = 0xcc,
698 FC_RCV_CFG = 0xd0,
699 NIC_RCV_CFG = 0xd4,
700 FC_COS_TAGS = 0xd8,
701 NIC_COS_TAGS = 0xdc,
702 MGMT_RCV_CFG = 0xe0,
703 RT_IDX = 0xe4,
704 RT_DATA = 0xe8,
705 RSVD7 = 0xec,
706 XG_SERDES_ADDR = 0xf0,
707 XG_SERDES_DATA = 0xf4,
708 PRB_MX_ADDR = 0xf8, /* Use semaphore */
709 PRB_MX_DATA = 0xfc, /* Use semaphore */
710};
711
712/*
713 * CAM output format.
714 */
715enum {
716 CAM_OUT_ROUTE_FC = 0,
717 CAM_OUT_ROUTE_NIC = 1,
718 CAM_OUT_FUNC_SHIFT = 2,
719 CAM_OUT_RV = (1 << 4),
720 CAM_OUT_SH = (1 << 15),
721 CAM_OUT_CQ_ID_SHIFT = 5,
722};
723
724/*
725 * Mailbox definitions
726 */
727enum {
728 /* Asynchronous Event Notifications */
729 AEN_SYS_ERR = 0x00008002,
730 AEN_LINK_UP = 0x00008011,
731 AEN_LINK_DOWN = 0x00008012,
732 AEN_IDC_CMPLT = 0x00008100,
733 AEN_IDC_REQ = 0x00008101,
734 AEN_FW_INIT_DONE = 0x00008400,
735 AEN_FW_INIT_FAIL = 0x00008401,
736
737 /* Mailbox Command Opcodes. */
738 MB_CMD_NOP = 0x00000000,
739 MB_CMD_EX_FW = 0x00000002,
740 MB_CMD_MB_TEST = 0x00000006,
741 MB_CMD_CSUM_TEST = 0x00000007, /* Verify Checksum */
742 MB_CMD_ABOUT_FW = 0x00000008,
743 MB_CMD_LOAD_RISC_RAM = 0x0000000b,
744 MB_CMD_DUMP_RISC_RAM = 0x0000000c,
745 MB_CMD_WRITE_RAM = 0x0000000d,
746 MB_CMD_READ_RAM = 0x0000000f,
747 MB_CMD_STOP_FW = 0x00000014,
748 MB_CMD_MAKE_SYS_ERR = 0x0000002a,
749 MB_CMD_INIT_FW = 0x00000060,
750 MB_CMD_GET_INIT_CB = 0x00000061,
751 MB_CMD_GET_FW_STATE = 0x00000069,
752 MB_CMD_IDC_REQ = 0x00000100, /* Inter-Driver Communication */
753 MB_CMD_IDC_ACK = 0x00000101, /* Inter-Driver Communication */
754 MB_CMD_SET_WOL_MODE = 0x00000110, /* Wake On Lan */
755 MB_WOL_DISABLE = 0x00000000,
756 MB_WOL_MAGIC_PKT = 0x00000001,
757 MB_WOL_FLTR = 0x00000002,
758 MB_WOL_UCAST = 0x00000004,
759 MB_WOL_MCAST = 0x00000008,
760 MB_WOL_BCAST = 0x00000010,
761 MB_WOL_LINK_UP = 0x00000020,
762 MB_WOL_LINK_DOWN = 0x00000040,
763 MB_CMD_SET_WOL_FLTR = 0x00000111, /* Wake On Lan Filter */
764 MB_CMD_CLEAR_WOL_FLTR = 0x00000112, /* Wake On Lan Filter */
765 MB_CMD_SET_WOL_MAGIC = 0x00000113, /* Wake On Lan Magic Packet */
766 MB_CMD_CLEAR_WOL_MAGIC = 0x00000114, /* Wake On Lan Magic Packet */
767 MB_CMD_PORT_RESET = 0x00000120,
768 MB_CMD_SET_PORT_CFG = 0x00000122,
769 MB_CMD_GET_PORT_CFG = 0x00000123,
770 MB_CMD_SET_ASIC_VOLTS = 0x00000130,
771 MB_CMD_GET_SNS_DATA = 0x00000131, /* Temp and Volt Sense data. */
772
773 /* Mailbox Command Status. */
774 MB_CMD_STS_GOOD = 0x00004000, /* Success. */
775 MB_CMD_STS_INTRMDT = 0x00001000, /* Intermediate Complete. */
776 MB_CMD_STS_ERR = 0x00004005, /* Error. */
777};
778
779struct mbox_params {
780 u32 mbox_in[MAILBOX_COUNT];
781 u32 mbox_out[MAILBOX_COUNT];
782 int in_count;
783 int out_count;
784};
785
786struct flash_params {
787 u8 dev_id_str[4];
788 u16 size;
789 u16 csum;
790 u16 ver;
791 u16 sub_dev_id;
792 u8 mac_addr[6];
793 u16 res;
794};
795
796
797/*
798 * doorbell space for the rx ring context
799 */
800struct rx_doorbell_context {
801 u32 cnsmr_idx; /* 0x00 */
802 u32 valid; /* 0x04 */
803 u32 reserved[4]; /* 0x08-0x14 */
804 u32 lbq_prod_idx; /* 0x18 */
805 u32 sbq_prod_idx; /* 0x1c */
806};
807
808/*
809 * doorbell space for the tx ring context
810 */
811struct tx_doorbell_context {
812 u32 prod_idx; /* 0x00 */
813 u32 valid; /* 0x04 */
814 u32 reserved[4]; /* 0x08-0x14 */
815 u32 lbq_prod_idx; /* 0x18 */
816 u32 sbq_prod_idx; /* 0x1c */
817};
818
819/* DATA STRUCTURES SHARED WITH HARDWARE. */
Ron Mercerc4e84bd2008-09-18 11:56:28 -0400820struct tx_buf_desc {
821 __le64 addr;
822 __le32 len;
823#define TX_DESC_LEN_MASK 0x000fffff
824#define TX_DESC_C 0x40000000
825#define TX_DESC_E 0x80000000
826} __attribute((packed));
827
828/*
829 * IOCB Definitions...
830 */
831
832#define OPCODE_OB_MAC_IOCB 0x01
833#define OPCODE_OB_MAC_TSO_IOCB 0x02
834#define OPCODE_IB_MAC_IOCB 0x20
835#define OPCODE_IB_MPI_IOCB 0x21
836#define OPCODE_IB_AE_IOCB 0x3f
837
838struct ob_mac_iocb_req {
839 u8 opcode;
840 u8 flags1;
841#define OB_MAC_IOCB_REQ_OI 0x01
842#define OB_MAC_IOCB_REQ_I 0x02
843#define OB_MAC_IOCB_REQ_D 0x08
844#define OB_MAC_IOCB_REQ_F 0x10
845 u8 flags2;
846 u8 flags3;
847#define OB_MAC_IOCB_DFP 0x02
848#define OB_MAC_IOCB_V 0x04
849 __le32 reserved1[2];
850 __le16 frame_len;
851#define OB_MAC_IOCB_LEN_MASK 0x3ffff
852 __le16 reserved2;
Ron Mercer3537d542009-01-05 18:19:59 -0800853 u32 tid;
854 u32 txq_idx;
Ron Mercerc4e84bd2008-09-18 11:56:28 -0400855 __le32 reserved3;
856 __le16 vlan_tci;
857 __le16 reserved4;
858 struct tx_buf_desc tbd[TX_DESC_PER_IOCB];
859} __attribute((packed));
860
861struct ob_mac_iocb_rsp {
862 u8 opcode; /* */
863 u8 flags1; /* */
864#define OB_MAC_IOCB_RSP_OI 0x01 /* */
865#define OB_MAC_IOCB_RSP_I 0x02 /* */
866#define OB_MAC_IOCB_RSP_E 0x08 /* */
867#define OB_MAC_IOCB_RSP_S 0x10 /* too Short */
868#define OB_MAC_IOCB_RSP_L 0x20 /* too Large */
869#define OB_MAC_IOCB_RSP_P 0x40 /* Padded */
870 u8 flags2; /* */
871 u8 flags3; /* */
872#define OB_MAC_IOCB_RSP_B 0x80 /* */
Ron Mercer3537d542009-01-05 18:19:59 -0800873 u32 tid;
874 u32 txq_idx;
Ron Mercerc4e84bd2008-09-18 11:56:28 -0400875 __le32 reserved[13];
876} __attribute((packed));
877
878struct ob_mac_tso_iocb_req {
879 u8 opcode;
880 u8 flags1;
881#define OB_MAC_TSO_IOCB_OI 0x01
882#define OB_MAC_TSO_IOCB_I 0x02
883#define OB_MAC_TSO_IOCB_D 0x08
884#define OB_MAC_TSO_IOCB_IP4 0x40
885#define OB_MAC_TSO_IOCB_IP6 0x80
886 u8 flags2;
887#define OB_MAC_TSO_IOCB_LSO 0x20
888#define OB_MAC_TSO_IOCB_UC 0x40
889#define OB_MAC_TSO_IOCB_TC 0x80
890 u8 flags3;
891#define OB_MAC_TSO_IOCB_IC 0x01
892#define OB_MAC_TSO_IOCB_DFP 0x02
893#define OB_MAC_TSO_IOCB_V 0x04
894 __le32 reserved1[2];
895 __le32 frame_len;
Ron Mercer3537d542009-01-05 18:19:59 -0800896 u32 tid;
897 u32 txq_idx;
Ron Mercerc4e84bd2008-09-18 11:56:28 -0400898 __le16 total_hdrs_len;
899 __le16 net_trans_offset;
900#define OB_MAC_TRANSPORT_HDR_SHIFT 6
901 __le16 vlan_tci;
902 __le16 mss;
903 struct tx_buf_desc tbd[TX_DESC_PER_IOCB];
904} __attribute((packed));
905
906struct ob_mac_tso_iocb_rsp {
907 u8 opcode;
908 u8 flags1;
909#define OB_MAC_TSO_IOCB_RSP_OI 0x01
910#define OB_MAC_TSO_IOCB_RSP_I 0x02
911#define OB_MAC_TSO_IOCB_RSP_E 0x08
912#define OB_MAC_TSO_IOCB_RSP_S 0x10
913#define OB_MAC_TSO_IOCB_RSP_L 0x20
914#define OB_MAC_TSO_IOCB_RSP_P 0x40
915 u8 flags2; /* */
916 u8 flags3; /* */
917#define OB_MAC_TSO_IOCB_RSP_B 0x8000
Ron Mercer3537d542009-01-05 18:19:59 -0800918 u32 tid;
919 u32 txq_idx;
Ron Mercerc4e84bd2008-09-18 11:56:28 -0400920 __le32 reserved2[13];
921} __attribute((packed));
922
923struct ib_mac_iocb_rsp {
924 u8 opcode; /* 0x20 */
925 u8 flags1;
926#define IB_MAC_IOCB_RSP_OI 0x01 /* Overide intr delay */
927#define IB_MAC_IOCB_RSP_I 0x02 /* Disble Intr Generation */
928#define IB_MAC_IOCB_RSP_TE 0x04 /* Checksum error */
929#define IB_MAC_IOCB_RSP_NU 0x08 /* No checksum rcvd */
930#define IB_MAC_IOCB_RSP_IE 0x10 /* IPv4 checksum error */
931#define IB_MAC_IOCB_RSP_M_MASK 0x60 /* Multicast info */
932#define IB_MAC_IOCB_RSP_M_NONE 0x00 /* Not mcast frame */
933#define IB_MAC_IOCB_RSP_M_HASH 0x20 /* HASH mcast frame */
934#define IB_MAC_IOCB_RSP_M_REG 0x40 /* Registered mcast frame */
935#define IB_MAC_IOCB_RSP_M_PROM 0x60 /* Promiscuous mcast frame */
936#define IB_MAC_IOCB_RSP_B 0x80 /* Broadcast frame */
937 u8 flags2;
938#define IB_MAC_IOCB_RSP_P 0x01 /* Promiscuous frame */
939#define IB_MAC_IOCB_RSP_V 0x02 /* Vlan tag present */
940#define IB_MAC_IOCB_RSP_ERR_MASK 0x1c /* */
941#define IB_MAC_IOCB_RSP_ERR_CODE_ERR 0x04
942#define IB_MAC_IOCB_RSP_ERR_OVERSIZE 0x08
943#define IB_MAC_IOCB_RSP_ERR_UNDERSIZE 0x10
944#define IB_MAC_IOCB_RSP_ERR_PREAMBLE 0x14
945#define IB_MAC_IOCB_RSP_ERR_FRAME_LEN 0x18
946#define IB_MAC_IOCB_RSP_ERR_CRC 0x1c
947#define IB_MAC_IOCB_RSP_U 0x20 /* UDP packet */
948#define IB_MAC_IOCB_RSP_T 0x40 /* TCP packet */
949#define IB_MAC_IOCB_RSP_FO 0x80 /* Failover port */
950 u8 flags3;
951#define IB_MAC_IOCB_RSP_RSS_MASK 0x07 /* RSS mask */
952#define IB_MAC_IOCB_RSP_M_NONE 0x00 /* No RSS match */
953#define IB_MAC_IOCB_RSP_M_IPV4 0x04 /* IPv4 RSS match */
954#define IB_MAC_IOCB_RSP_M_IPV6 0x02 /* IPv6 RSS match */
955#define IB_MAC_IOCB_RSP_M_TCP_V4 0x05 /* TCP with IPv4 */
956#define IB_MAC_IOCB_RSP_M_TCP_V6 0x03 /* TCP with IPv6 */
957#define IB_MAC_IOCB_RSP_V4 0x08 /* IPV4 */
958#define IB_MAC_IOCB_RSP_V6 0x10 /* IPV6 */
959#define IB_MAC_IOCB_RSP_IH 0x20 /* Split after IP header */
960#define IB_MAC_IOCB_RSP_DS 0x40 /* data is in small buffer */
961#define IB_MAC_IOCB_RSP_DL 0x80 /* data is in large buffer */
962 __le32 data_len; /* */
Ron Mercer97345522009-01-09 11:31:50 +0000963 __le64 data_addr; /* */
Ron Mercerc4e84bd2008-09-18 11:56:28 -0400964 __le32 rss; /* */
965 __le16 vlan_id; /* 12 bits */
966#define IB_MAC_IOCB_RSP_C 0x1000 /* VLAN CFI bit */
967#define IB_MAC_IOCB_RSP_COS_SHIFT 12 /* class of service value */
968
969 __le16 reserved1;
970 __le32 reserved2[6];
Ron Mercera303ce02009-01-05 18:18:22 -0800971 u8 reserved3[3];
972 u8 flags4;
973#define IB_MAC_IOCB_RSP_HV 0x20
974#define IB_MAC_IOCB_RSP_HS 0x40
975#define IB_MAC_IOCB_RSP_HL 0x80
Ron Mercerc4e84bd2008-09-18 11:56:28 -0400976 __le32 hdr_len; /* */
Ron Mercer97345522009-01-09 11:31:50 +0000977 __le64 hdr_addr; /* */
Ron Mercerc4e84bd2008-09-18 11:56:28 -0400978} __attribute((packed));
979
980struct ib_ae_iocb_rsp {
981 u8 opcode;
982 u8 flags1;
983#define IB_AE_IOCB_RSP_OI 0x01
984#define IB_AE_IOCB_RSP_I 0x02
985 u8 event;
986#define LINK_UP_EVENT 0x00
987#define LINK_DOWN_EVENT 0x01
988#define CAM_LOOKUP_ERR_EVENT 0x06
989#define SOFT_ECC_ERROR_EVENT 0x07
990#define MGMT_ERR_EVENT 0x08
991#define TEN_GIG_MAC_EVENT 0x09
992#define GPI0_H2L_EVENT 0x10
993#define GPI0_L2H_EVENT 0x20
994#define GPI1_H2L_EVENT 0x11
995#define GPI1_L2H_EVENT 0x21
996#define PCI_ERR_ANON_BUF_RD 0x40
997 u8 q_id;
998 __le32 reserved[15];
999} __attribute((packed));
1000
1001/*
1002 * These three structures are for generic
1003 * handling of ib and ob iocbs.
1004 */
1005struct ql_net_rsp_iocb {
1006 u8 opcode;
1007 u8 flags0;
1008 __le16 length;
1009 __le32 tid;
1010 __le32 reserved[14];
1011} __attribute((packed));
1012
1013struct net_req_iocb {
1014 u8 opcode;
1015 u8 flags0;
1016 __le16 flags1;
1017 __le32 tid;
1018 __le32 reserved1[30];
1019} __attribute((packed));
1020
1021/*
1022 * tx ring initialization control block for chip.
1023 * It is defined as:
1024 * "Work Queue Initialization Control Block"
1025 */
1026struct wqicb {
1027 __le16 len;
1028#define Q_LEN_V (1 << 4)
1029#define Q_LEN_CPP_CONT 0x0000
1030#define Q_LEN_CPP_16 0x0001
1031#define Q_LEN_CPP_32 0x0002
1032#define Q_LEN_CPP_64 0x0003
1033 __le16 flags;
1034#define Q_PRI_SHIFT 1
1035#define Q_FLAGS_LC 0x1000
1036#define Q_FLAGS_LB 0x2000
1037#define Q_FLAGS_LI 0x4000
1038#define Q_FLAGS_LO 0x8000
1039 __le16 cq_id_rss;
1040#define Q_CQ_ID_RSS_RV 0x8000
1041 __le16 rid;
Ron Mercer97345522009-01-09 11:31:50 +00001042 __le64 addr;
1043 __le64 cnsmr_idx_addr;
Ron Mercerc4e84bd2008-09-18 11:56:28 -04001044} __attribute((packed));
1045
1046/*
1047 * rx ring initialization control block for chip.
1048 * It is defined as:
1049 * "Completion Queue Initialization Control Block"
1050 */
1051struct cqicb {
1052 u8 msix_vect;
1053 u8 reserved1;
1054 u8 reserved2;
1055 u8 flags;
1056#define FLAGS_LV 0x08
1057#define FLAGS_LS 0x10
1058#define FLAGS_LL 0x20
1059#define FLAGS_LI 0x40
1060#define FLAGS_LC 0x80
1061 __le16 len;
1062#define LEN_V (1 << 4)
1063#define LEN_CPP_CONT 0x0000
1064#define LEN_CPP_32 0x0001
1065#define LEN_CPP_64 0x0002
1066#define LEN_CPP_128 0x0003
1067 __le16 rid;
Ron Mercer97345522009-01-09 11:31:50 +00001068 __le64 addr;
1069 __le64 prod_idx_addr;
Ron Mercerc4e84bd2008-09-18 11:56:28 -04001070 __le16 pkt_delay;
1071 __le16 irq_delay;
Ron Mercer97345522009-01-09 11:31:50 +00001072 __le64 lbq_addr;
Ron Mercerc4e84bd2008-09-18 11:56:28 -04001073 __le16 lbq_buf_size;
1074 __le16 lbq_len; /* entry count */
Ron Mercer97345522009-01-09 11:31:50 +00001075 __le64 sbq_addr;
Ron Mercerc4e84bd2008-09-18 11:56:28 -04001076 __le16 sbq_buf_size;
1077 __le16 sbq_len; /* entry count */
1078} __attribute((packed));
1079
1080struct ricb {
1081 u8 base_cq;
1082#define RSS_L4K 0x80
1083 u8 flags;
1084#define RSS_L6K 0x01
1085#define RSS_LI 0x02
1086#define RSS_LB 0x04
1087#define RSS_LM 0x08
1088#define RSS_RI4 0x10
1089#define RSS_RT4 0x20
1090#define RSS_RI6 0x40
1091#define RSS_RT6 0x80
1092 __le16 mask;
1093 __le32 hash_cq_id[256];
1094 __le32 ipv6_hash_key[10];
1095 __le32 ipv4_hash_key[4];
1096} __attribute((packed));
1097
1098/* SOFTWARE/DRIVER DATA STRUCTURES. */
1099
1100struct oal {
1101 struct tx_buf_desc oal[TX_DESC_PER_OAL];
1102};
1103
1104struct map_list {
1105 DECLARE_PCI_UNMAP_ADDR(mapaddr);
1106 DECLARE_PCI_UNMAP_LEN(maplen);
1107};
1108
1109struct tx_ring_desc {
1110 struct sk_buff *skb;
1111 struct ob_mac_iocb_req *queue_entry;
Ron Mercer3537d542009-01-05 18:19:59 -08001112 u32 index;
Ron Mercerc4e84bd2008-09-18 11:56:28 -04001113 struct oal oal;
1114 struct map_list map[MAX_SKB_FRAGS + 1];
1115 int map_cnt;
1116 struct tx_ring_desc *next;
1117};
1118
1119struct bq_desc {
1120 union {
1121 struct page *lbq_page;
1122 struct sk_buff *skb;
1123 } p;
Ron Mercer2c9a0d42009-01-05 18:19:20 -08001124 __le64 *addr;
Ron Mercer3537d542009-01-05 18:19:59 -08001125 u32 index;
Ron Mercerc4e84bd2008-09-18 11:56:28 -04001126 DECLARE_PCI_UNMAP_ADDR(mapaddr);
1127 DECLARE_PCI_UNMAP_LEN(maplen);
1128};
1129
1130#define QL_TXQ_IDX(qdev, skb) (smp_processor_id()%(qdev->tx_ring_count))
1131
1132struct tx_ring {
1133 /*
1134 * queue info.
1135 */
1136 struct wqicb wqicb; /* structure used to inform chip of new queue */
1137 void *wq_base; /* pci_alloc:virtual addr for tx */
1138 dma_addr_t wq_base_dma; /* pci_alloc:dma addr for tx */
Ron Mercerba7cd3b2009-01-09 11:31:49 +00001139 __le32 *cnsmr_idx_sh_reg; /* shadow copy of consumer idx */
Ron Mercerc4e84bd2008-09-18 11:56:28 -04001140 dma_addr_t cnsmr_idx_sh_reg_dma; /* dma-shadow copy of consumer */
1141 u32 wq_size; /* size in bytes of queue area */
1142 u32 wq_len; /* number of entries in queue */
1143 void __iomem *prod_idx_db_reg; /* doorbell area index reg at offset 0x00 */
1144 void __iomem *valid_db_reg; /* doorbell area valid reg at offset 0x04 */
1145 u16 prod_idx; /* current value for prod idx */
1146 u16 cq_id; /* completion (rx) queue for tx completions */
1147 u8 wq_id; /* queue id for this entry */
1148 u8 reserved1[3];
1149 struct tx_ring_desc *q; /* descriptor list for the queue */
1150 spinlock_t lock;
1151 atomic_t tx_count; /* counts down for every outstanding IO */
1152 atomic_t queue_stopped; /* Turns queue off when full. */
1153 struct delayed_work tx_work;
1154 struct ql_adapter *qdev;
1155};
1156
1157/*
1158 * Type of inbound queue.
1159 */
1160enum {
1161 DEFAULT_Q = 2, /* Handles slow queue and chip/MPI events. */
1162 TX_Q = 3, /* Handles outbound completions. */
1163 RX_Q = 4, /* Handles inbound completions. */
1164};
1165
1166struct rx_ring {
1167 struct cqicb cqicb; /* The chip's completion queue init control block. */
1168
1169 /* Completion queue elements. */
1170 void *cq_base;
1171 dma_addr_t cq_base_dma;
1172 u32 cq_size;
1173 u32 cq_len;
1174 u16 cq_id;
Ron Mercerba7cd3b2009-01-09 11:31:49 +00001175 __le32 *prod_idx_sh_reg; /* Shadowed producer register. */
Ron Mercerc4e84bd2008-09-18 11:56:28 -04001176 dma_addr_t prod_idx_sh_reg_dma;
1177 void __iomem *cnsmr_idx_db_reg; /* PCI doorbell mem area + 0 */
1178 u32 cnsmr_idx; /* current sw idx */
1179 struct ql_net_rsp_iocb *curr_entry; /* next entry on queue */
1180 void __iomem *valid_db_reg; /* PCI doorbell mem area + 0x04 */
1181
1182 /* Large buffer queue elements. */
1183 u32 lbq_len; /* entry count */
1184 u32 lbq_size; /* size in bytes of queue */
1185 u32 lbq_buf_size;
1186 void *lbq_base;
1187 dma_addr_t lbq_base_dma;
1188 void *lbq_base_indirect;
1189 dma_addr_t lbq_base_indirect_dma;
1190 struct bq_desc *lbq; /* array of control blocks */
1191 void __iomem *lbq_prod_idx_db_reg; /* PCI doorbell mem area + 0x18 */
1192 u32 lbq_prod_idx; /* current sw prod idx */
1193 u32 lbq_curr_idx; /* next entry we expect */
1194 u32 lbq_clean_idx; /* beginning of new descs */
1195 u32 lbq_free_cnt; /* free buffer desc cnt */
1196
1197 /* Small buffer queue elements. */
1198 u32 sbq_len; /* entry count */
1199 u32 sbq_size; /* size in bytes of queue */
1200 u32 sbq_buf_size;
1201 void *sbq_base;
1202 dma_addr_t sbq_base_dma;
1203 void *sbq_base_indirect;
1204 dma_addr_t sbq_base_indirect_dma;
1205 struct bq_desc *sbq; /* array of control blocks */
1206 void __iomem *sbq_prod_idx_db_reg; /* PCI doorbell mem area + 0x1c */
1207 u32 sbq_prod_idx; /* current sw prod idx */
1208 u32 sbq_curr_idx; /* next entry we expect */
1209 u32 sbq_clean_idx; /* beginning of new descs */
1210 u32 sbq_free_cnt; /* free buffer desc cnt */
1211
1212 /* Misc. handler elements. */
1213 u32 type; /* Type of queue, tx, rx, or default. */
1214 u32 irq; /* Which vector this ring is assigned. */
1215 u32 cpu; /* Which CPU this should run on. */
1216 char name[IFNAMSIZ + 5];
1217 struct napi_struct napi;
1218 struct delayed_work rx_work;
1219 u8 reserved;
1220 struct ql_adapter *qdev;
1221};
1222
1223/*
1224 * RSS Initialization Control Block
1225 */
1226struct hash_id {
1227 u8 value[4];
1228};
1229
1230struct nic_stats {
1231 /*
1232 * These stats come from offset 200h to 278h
1233 * in the XGMAC register.
1234 */
1235 u64 tx_pkts;
1236 u64 tx_bytes;
1237 u64 tx_mcast_pkts;
1238 u64 tx_bcast_pkts;
1239 u64 tx_ucast_pkts;
1240 u64 tx_ctl_pkts;
1241 u64 tx_pause_pkts;
1242 u64 tx_64_pkt;
1243 u64 tx_65_to_127_pkt;
1244 u64 tx_128_to_255_pkt;
1245 u64 tx_256_511_pkt;
1246 u64 tx_512_to_1023_pkt;
1247 u64 tx_1024_to_1518_pkt;
1248 u64 tx_1519_to_max_pkt;
1249 u64 tx_undersize_pkt;
1250 u64 tx_oversize_pkt;
1251
1252 /*
1253 * These stats come from offset 300h to 3C8h
1254 * in the XGMAC register.
1255 */
1256 u64 rx_bytes;
1257 u64 rx_bytes_ok;
1258 u64 rx_pkts;
1259 u64 rx_pkts_ok;
1260 u64 rx_bcast_pkts;
1261 u64 rx_mcast_pkts;
1262 u64 rx_ucast_pkts;
1263 u64 rx_undersize_pkts;
1264 u64 rx_oversize_pkts;
1265 u64 rx_jabber_pkts;
1266 u64 rx_undersize_fcerr_pkts;
1267 u64 rx_drop_events;
1268 u64 rx_fcerr_pkts;
1269 u64 rx_align_err;
1270 u64 rx_symbol_err;
1271 u64 rx_mac_err;
1272 u64 rx_ctl_pkts;
1273 u64 rx_pause_pkts;
1274 u64 rx_64_pkts;
1275 u64 rx_65_to_127_pkts;
1276 u64 rx_128_255_pkts;
1277 u64 rx_256_511_pkts;
1278 u64 rx_512_to_1023_pkts;
1279 u64 rx_1024_to_1518_pkts;
1280 u64 rx_1519_to_max_pkts;
1281 u64 rx_len_err_pkts;
1282};
1283
1284/*
1285 * intr_context structure is used during initialization
1286 * to hook the interrupts. It is also used in a single
1287 * irq environment as a context to the ISR.
1288 */
1289struct intr_context {
1290 struct ql_adapter *qdev;
1291 u32 intr;
1292 u32 hooked;
1293 u32 intr_en_mask; /* value/mask used to enable this intr */
1294 u32 intr_dis_mask; /* value/mask used to disable this intr */
1295 u32 intr_read_mask; /* value/mask used to read this intr */
1296 char name[IFNAMSIZ * 2];
1297 atomic_t irq_cnt; /* irq_cnt is used in single vector
1298 * environment. It's incremented for each
1299 * irq handler that is scheduled. When each
1300 * handler finishes it decrements irq_cnt and
1301 * enables interrupts if it's zero. */
1302 irq_handler_t handler;
1303};
1304
1305/* adapter flags definitions. */
1306enum {
1307 QL_ADAPTER_UP = (1 << 0), /* Adapter has been brought up. */
1308 QL_LEGACY_ENABLED = (1 << 3),
1309 QL_MSI_ENABLED = (1 << 3),
1310 QL_MSIX_ENABLED = (1 << 4),
1311 QL_DMA64 = (1 << 5),
1312 QL_PROMISCUOUS = (1 << 6),
1313 QL_ALLMULTI = (1 << 7),
1314};
1315
1316/* link_status bit definitions */
1317enum {
1318 LOOPBACK_MASK = 0x00000700,
1319 LOOPBACK_PCS = 0x00000100,
1320 LOOPBACK_HSS = 0x00000200,
1321 LOOPBACK_EXT = 0x00000300,
1322 PAUSE_MASK = 0x000000c0,
1323 PAUSE_STD = 0x00000040,
1324 PAUSE_PRI = 0x00000080,
1325 SPEED_MASK = 0x00000038,
1326 SPEED_100Mb = 0x00000000,
1327 SPEED_1Gb = 0x00000008,
1328 SPEED_10Gb = 0x00000010,
1329 LINK_TYPE_MASK = 0x00000007,
1330 LINK_TYPE_XFI = 0x00000001,
1331 LINK_TYPE_XAUI = 0x00000002,
1332 LINK_TYPE_XFI_BP = 0x00000003,
1333 LINK_TYPE_XAUI_BP = 0x00000004,
1334 LINK_TYPE_10GBASET = 0x00000005,
1335};
1336
1337/*
1338 * The main Adapter structure definition.
1339 * This structure has all fields relevant to the hardware.
1340 */
1341struct ql_adapter {
1342 struct ricb ricb;
1343 unsigned long flags;
1344 u32 wol;
1345
1346 struct nic_stats nic_stats;
1347
1348 struct vlan_group *vlgrp;
1349
1350 /* PCI Configuration information for this device */
1351 struct pci_dev *pdev;
1352 struct net_device *ndev; /* Parent NET device */
1353
1354 /* Hardware information */
1355 u32 chip_rev_id;
1356 u32 func; /* PCI function for this adapter */
1357
1358 spinlock_t adapter_lock;
1359 spinlock_t hw_lock;
1360 spinlock_t stats_lock;
Ron Mercerc4e84bd2008-09-18 11:56:28 -04001361
1362 /* PCI Bus Relative Register Addresses */
1363 void __iomem *reg_base;
1364 void __iomem *doorbell_area;
1365 u32 doorbell_area_size;
1366
1367 u32 msg_enable;
1368
1369 /* Page for Shadow Registers */
1370 void *rx_ring_shadow_reg_area;
1371 dma_addr_t rx_ring_shadow_reg_dma;
1372 void *tx_ring_shadow_reg_area;
1373 dma_addr_t tx_ring_shadow_reg_dma;
1374
1375 u32 mailbox_in;
1376 u32 mailbox_out;
1377
1378 int tx_ring_size;
1379 int rx_ring_size;
1380 u32 intr_count;
1381 struct msix_entry *msi_x_entry;
1382 struct intr_context intr_context[MAX_RX_RINGS];
1383
Ron Mercerc4e84bd2008-09-18 11:56:28 -04001384 int tx_ring_count; /* One per online CPU. */
1385 u32 rss_ring_first_cq_id;/* index of first inbound (rss) rx_ring */
1386 u32 rss_ring_count; /* One per online CPU. */
1387 /*
1388 * rx_ring_count =
1389 * one default queue +
1390 * (CPU count * outbound completion rx_ring) +
1391 * (CPU count * inbound (RSS) completion rx_ring)
1392 */
1393 int rx_ring_count;
1394 int ring_mem_size;
1395 void *ring_mem;
1396 struct rx_ring *rx_ring;
1397 int rx_csum;
1398 struct tx_ring *tx_ring;
1399 u32 default_rx_queue;
1400
1401 u16 rx_coalesce_usecs; /* cqicb->int_delay */
1402 u16 rx_max_coalesced_frames; /* cqicb->pkt_int_delay */
1403 u16 tx_coalesce_usecs; /* cqicb->int_delay */
1404 u16 tx_max_coalesced_frames; /* cqicb->pkt_int_delay */
1405
1406 u32 xg_sem_mask;
1407 u32 port_link_up;
1408 u32 port_init;
1409 u32 link_status;
1410
1411 struct flash_params flash;
1412
1413 struct net_device_stats stats;
1414 struct workqueue_struct *q_workqueue;
1415 struct workqueue_struct *workqueue;
1416 struct delayed_work asic_reset_work;
1417 struct delayed_work mpi_reset_work;
1418 struct delayed_work mpi_work;
1419};
1420
1421/*
1422 * Typical Register accessor for memory mapped device.
1423 */
1424static inline u32 ql_read32(const struct ql_adapter *qdev, int reg)
1425{
1426 return readl(qdev->reg_base + reg);
1427}
1428
1429/*
1430 * Typical Register accessor for memory mapped device.
1431 */
1432static inline void ql_write32(const struct ql_adapter *qdev, int reg, u32 val)
1433{
1434 writel(val, qdev->reg_base + reg);
1435}
1436
1437/*
1438 * Doorbell Registers:
1439 * Doorbell registers are virtual registers in the PCI memory space.
1440 * The space is allocated by the chip during PCI initialization. The
1441 * device driver finds the doorbell address in BAR 3 in PCI config space.
1442 * The registers are used to control outbound and inbound queues. For
1443 * example, the producer index for an outbound queue. Each queue uses
1444 * 1 4k chunk of memory. The lower half of the space is for outbound
1445 * queues. The upper half is for inbound queues.
1446 */
1447static inline void ql_write_db_reg(u32 val, void __iomem *addr)
1448{
1449 writel(val, addr);
1450 mmiowb();
1451}
1452
Ron Mercerba7cd3b2009-01-09 11:31:49 +00001453/*
1454 * Shadow Registers:
1455 * Outbound queues have a consumer index that is maintained by the chip.
1456 * Inbound queues have a producer index that is maintained by the chip.
1457 * For lower overhead, these registers are "shadowed" to host memory
1458 * which allows the device driver to track the queue progress without
1459 * PCI reads. When an entry is placed on an inbound queue, the chip will
1460 * update the relevant index register and then copy the value to the
1461 * shadow register in host memory.
1462 */
1463static inline u32 ql_read_sh_reg(__le32 *addr)
1464{
1465 u32 reg;
1466 reg = le32_to_cpu(*addr);
1467 rmb();
1468 return reg;
1469}
1470
Ron Mercerc4e84bd2008-09-18 11:56:28 -04001471extern char qlge_driver_name[];
1472extern const char qlge_driver_version[];
1473extern const struct ethtool_ops qlge_ethtool_ops;
1474
1475extern int ql_sem_spinlock(struct ql_adapter *qdev, u32 sem_mask);
1476extern void ql_sem_unlock(struct ql_adapter *qdev, u32 sem_mask);
1477extern int ql_read_xgmac_reg(struct ql_adapter *qdev, u32 reg, u32 *data);
1478extern int ql_get_mac_addr_reg(struct ql_adapter *qdev, u32 type, u16 index,
1479 u32 *value);
1480extern int ql_get_routing_reg(struct ql_adapter *qdev, u32 index, u32 *value);
1481extern int ql_write_cfg(struct ql_adapter *qdev, void *ptr, int size, u32 bit,
1482 u16 q_id);
1483void ql_queue_fw_error(struct ql_adapter *qdev);
1484void ql_mpi_work(struct work_struct *work);
1485void ql_mpi_reset_work(struct work_struct *work);
1486int ql_wait_reg_rdy(struct ql_adapter *qdev, u32 reg, u32 bit, u32 ebit);
1487void ql_queue_asic_error(struct ql_adapter *qdev);
Ron Mercerbb0d2152008-10-20 10:30:26 -07001488u32 ql_enable_completion_interrupt(struct ql_adapter *qdev, u32 intr);
Ron Mercerc4e84bd2008-09-18 11:56:28 -04001489void ql_set_ethtool_ops(struct net_device *ndev);
1490int ql_read_xgmac_reg64(struct ql_adapter *qdev, u32 reg, u64 *data);
1491
1492#if 1
1493#define QL_ALL_DUMP
1494#define QL_REG_DUMP
1495#define QL_DEV_DUMP
1496#define QL_CB_DUMP
1497/* #define QL_IB_DUMP */
1498/* #define QL_OB_DUMP */
1499#endif
1500
1501#ifdef QL_REG_DUMP
1502extern void ql_dump_xgmac_control_regs(struct ql_adapter *qdev);
1503extern void ql_dump_routing_entries(struct ql_adapter *qdev);
1504extern void ql_dump_regs(struct ql_adapter *qdev);
1505#define QL_DUMP_REGS(qdev) ql_dump_regs(qdev)
1506#define QL_DUMP_ROUTE(qdev) ql_dump_routing_entries(qdev)
1507#define QL_DUMP_XGMAC_CONTROL_REGS(qdev) ql_dump_xgmac_control_regs(qdev)
1508#else
1509#define QL_DUMP_REGS(qdev)
1510#define QL_DUMP_ROUTE(qdev)
1511#define QL_DUMP_XGMAC_CONTROL_REGS(qdev)
1512#endif
1513
1514#ifdef QL_STAT_DUMP
1515extern void ql_dump_stat(struct ql_adapter *qdev);
1516#define QL_DUMP_STAT(qdev) ql_dump_stat(qdev)
1517#else
1518#define QL_DUMP_STAT(qdev)
1519#endif
1520
1521#ifdef QL_DEV_DUMP
1522extern void ql_dump_qdev(struct ql_adapter *qdev);
1523#define QL_DUMP_QDEV(qdev) ql_dump_qdev(qdev)
1524#else
1525#define QL_DUMP_QDEV(qdev)
1526#endif
1527
1528#ifdef QL_CB_DUMP
1529extern void ql_dump_wqicb(struct wqicb *wqicb);
1530extern void ql_dump_tx_ring(struct tx_ring *tx_ring);
1531extern void ql_dump_ricb(struct ricb *ricb);
1532extern void ql_dump_cqicb(struct cqicb *cqicb);
1533extern void ql_dump_rx_ring(struct rx_ring *rx_ring);
1534extern void ql_dump_hw_cb(struct ql_adapter *qdev, int size, u32 bit, u16 q_id);
1535#define QL_DUMP_RICB(ricb) ql_dump_ricb(ricb)
1536#define QL_DUMP_WQICB(wqicb) ql_dump_wqicb(wqicb)
1537#define QL_DUMP_TX_RING(tx_ring) ql_dump_tx_ring(tx_ring)
1538#define QL_DUMP_CQICB(cqicb) ql_dump_cqicb(cqicb)
1539#define QL_DUMP_RX_RING(rx_ring) ql_dump_rx_ring(rx_ring)
1540#define QL_DUMP_HW_CB(qdev, size, bit, q_id) \
1541 ql_dump_hw_cb(qdev, size, bit, q_id)
1542#else
1543#define QL_DUMP_RICB(ricb)
1544#define QL_DUMP_WQICB(wqicb)
1545#define QL_DUMP_TX_RING(tx_ring)
1546#define QL_DUMP_CQICB(cqicb)
1547#define QL_DUMP_RX_RING(rx_ring)
1548#define QL_DUMP_HW_CB(qdev, size, bit, q_id)
1549#endif
1550
1551#ifdef QL_OB_DUMP
1552extern void ql_dump_tx_desc(struct tx_buf_desc *tbd);
1553extern void ql_dump_ob_mac_iocb(struct ob_mac_iocb_req *ob_mac_iocb);
1554extern void ql_dump_ob_mac_rsp(struct ob_mac_iocb_rsp *ob_mac_rsp);
1555#define QL_DUMP_OB_MAC_IOCB(ob_mac_iocb) ql_dump_ob_mac_iocb(ob_mac_iocb)
1556#define QL_DUMP_OB_MAC_RSP(ob_mac_rsp) ql_dump_ob_mac_rsp(ob_mac_rsp)
1557#else
1558#define QL_DUMP_OB_MAC_IOCB(ob_mac_iocb)
1559#define QL_DUMP_OB_MAC_RSP(ob_mac_rsp)
1560#endif
1561
1562#ifdef QL_IB_DUMP
1563extern void ql_dump_ib_mac_rsp(struct ib_mac_iocb_rsp *ib_mac_rsp);
1564#define QL_DUMP_IB_MAC_RSP(ib_mac_rsp) ql_dump_ib_mac_rsp(ib_mac_rsp)
1565#else
1566#define QL_DUMP_IB_MAC_RSP(ib_mac_rsp)
1567#endif
1568
1569#ifdef QL_ALL_DUMP
1570extern void ql_dump_all(struct ql_adapter *qdev);
1571#define QL_DUMP_ALL(qdev) ql_dump_all(qdev)
1572#else
1573#define QL_DUMP_ALL(qdev)
1574#endif
1575
1576#endif /* _QLGE_H_ */