blob: e705ea5b975a0e52ed38a775b2840d27fd3890e5 [file] [log] [blame]
Ron Mercerc4e84bd2008-09-18 11:56:28 -04001#include "qlge.h"
2
3#ifdef QL_REG_DUMP
4static void ql_dump_intr_states(struct ql_adapter *qdev)
5{
6 int i;
7 u32 value;
8 for (i = 0; i < qdev->intr_count; i++) {
9 ql_write32(qdev, INTR_EN, qdev->intr_context[i].intr_read_mask);
10 value = ql_read32(qdev, INTR_EN);
11 printk(KERN_ERR PFX
12 "%s: Interrupt %d is %s.\n",
13 qdev->ndev->name, i,
14 (value & INTR_EN_EN ? "enabled" : "disabled"));
15 }
16}
17
18void ql_dump_xgmac_control_regs(struct ql_adapter *qdev)
19{
20 u32 data;
21 if (ql_sem_spinlock(qdev, qdev->xg_sem_mask)) {
22 printk(KERN_ERR "%s: Couldn't get xgmac sem.\n", __func__);
23 return;
24 }
25 ql_read_xgmac_reg(qdev, PAUSE_SRC_LO, &data);
26 printk(KERN_ERR PFX "%s: PAUSE_SRC_LO = 0x%.08x.\n", qdev->ndev->name,
27 data);
28 ql_read_xgmac_reg(qdev, PAUSE_SRC_HI, &data);
29 printk(KERN_ERR PFX "%s: PAUSE_SRC_HI = 0x%.08x.\n", qdev->ndev->name,
30 data);
31 ql_read_xgmac_reg(qdev, GLOBAL_CFG, &data);
32 printk(KERN_ERR PFX "%s: GLOBAL_CFG = 0x%.08x.\n", qdev->ndev->name,
33 data);
34 ql_read_xgmac_reg(qdev, TX_CFG, &data);
35 printk(KERN_ERR PFX "%s: TX_CFG = 0x%.08x.\n", qdev->ndev->name, data);
36 ql_read_xgmac_reg(qdev, RX_CFG, &data);
37 printk(KERN_ERR PFX "%s: RX_CFG = 0x%.08x.\n", qdev->ndev->name, data);
38 ql_read_xgmac_reg(qdev, FLOW_CTL, &data);
39 printk(KERN_ERR PFX "%s: FLOW_CTL = 0x%.08x.\n", qdev->ndev->name,
40 data);
41 ql_read_xgmac_reg(qdev, PAUSE_OPCODE, &data);
42 printk(KERN_ERR PFX "%s: PAUSE_OPCODE = 0x%.08x.\n", qdev->ndev->name,
43 data);
44 ql_read_xgmac_reg(qdev, PAUSE_TIMER, &data);
45 printk(KERN_ERR PFX "%s: PAUSE_TIMER = 0x%.08x.\n", qdev->ndev->name,
46 data);
47 ql_read_xgmac_reg(qdev, PAUSE_FRM_DEST_LO, &data);
48 printk(KERN_ERR PFX "%s: PAUSE_FRM_DEST_LO = 0x%.08x.\n",
49 qdev->ndev->name, data);
50 ql_read_xgmac_reg(qdev, PAUSE_FRM_DEST_HI, &data);
51 printk(KERN_ERR PFX "%s: PAUSE_FRM_DEST_HI = 0x%.08x.\n",
52 qdev->ndev->name, data);
53 ql_read_xgmac_reg(qdev, MAC_TX_PARAMS, &data);
54 printk(KERN_ERR PFX "%s: MAC_TX_PARAMS = 0x%.08x.\n", qdev->ndev->name,
55 data);
56 ql_read_xgmac_reg(qdev, MAC_RX_PARAMS, &data);
57 printk(KERN_ERR PFX "%s: MAC_RX_PARAMS = 0x%.08x.\n", qdev->ndev->name,
58 data);
59 ql_read_xgmac_reg(qdev, MAC_SYS_INT, &data);
60 printk(KERN_ERR PFX "%s: MAC_SYS_INT = 0x%.08x.\n", qdev->ndev->name,
61 data);
62 ql_read_xgmac_reg(qdev, MAC_SYS_INT_MASK, &data);
63 printk(KERN_ERR PFX "%s: MAC_SYS_INT_MASK = 0x%.08x.\n",
64 qdev->ndev->name, data);
65 ql_read_xgmac_reg(qdev, MAC_MGMT_INT, &data);
66 printk(KERN_ERR PFX "%s: MAC_MGMT_INT = 0x%.08x.\n", qdev->ndev->name,
67 data);
68 ql_read_xgmac_reg(qdev, MAC_MGMT_IN_MASK, &data);
69 printk(KERN_ERR PFX "%s: MAC_MGMT_IN_MASK = 0x%.08x.\n",
70 qdev->ndev->name, data);
71 ql_read_xgmac_reg(qdev, EXT_ARB_MODE, &data);
72 printk(KERN_ERR PFX "%s: EXT_ARB_MODE = 0x%.08x.\n", qdev->ndev->name,
73 data);
74 ql_sem_unlock(qdev, qdev->xg_sem_mask);
75
76}
77
78static void ql_dump_ets_regs(struct ql_adapter *qdev)
79{
80}
81
82static void ql_dump_cam_entries(struct ql_adapter *qdev)
83{
84 int i;
85 u32 value[3];
86 for (i = 0; i < 4; i++) {
87 if (ql_get_mac_addr_reg(qdev, MAC_ADDR_TYPE_CAM_MAC, i, value)) {
88 printk(KERN_ERR PFX
89 "%s: Failed read of mac index register.\n",
90 __func__);
91 return;
92 } else {
93 if (value[0])
94 printk(KERN_ERR PFX
95 "%s: CAM index %d CAM Lookup Lower = 0x%.08x:%.08x, Output = 0x%.08x.\n",
96 qdev->ndev->name, i, value[1], value[0],
97 value[2]);
98 }
99 }
100 for (i = 0; i < 32; i++) {
101 if (ql_get_mac_addr_reg
102 (qdev, MAC_ADDR_TYPE_MULTI_MAC, i, value)) {
103 printk(KERN_ERR PFX
104 "%s: Failed read of mac index register.\n",
105 __func__);
106 return;
107 } else {
108 if (value[0])
109 printk(KERN_ERR PFX
110 "%s: MCAST index %d CAM Lookup Lower = 0x%.08x:%.08x.\n",
111 qdev->ndev->name, i, value[1], value[0]);
112 }
113 }
114}
115
116void ql_dump_routing_entries(struct ql_adapter *qdev)
117{
118 int i;
119 u32 value;
120 for (i = 0; i < 16; i++) {
121 value = 0;
122 if (ql_get_routing_reg(qdev, i, &value)) {
123 printk(KERN_ERR PFX
124 "%s: Failed read of routing index register.\n",
125 __func__);
126 return;
127 } else {
128 if (value)
129 printk(KERN_ERR PFX
130 "%s: Routing Mask %d = 0x%.08x.\n",
131 qdev->ndev->name, i, value);
132 }
133 }
134}
135
136void ql_dump_regs(struct ql_adapter *qdev)
137{
138 printk(KERN_ERR PFX "reg dump for function #%d.\n", qdev->func);
139 printk(KERN_ERR PFX "SYS = 0x%x.\n",
140 ql_read32(qdev, SYS));
141 printk(KERN_ERR PFX "RST_FO = 0x%x.\n",
142 ql_read32(qdev, RST_FO));
143 printk(KERN_ERR PFX "FSC = 0x%x.\n",
144 ql_read32(qdev, FSC));
145 printk(KERN_ERR PFX "CSR = 0x%x.\n",
146 ql_read32(qdev, CSR));
147 printk(KERN_ERR PFX "ICB_RID = 0x%x.\n",
148 ql_read32(qdev, ICB_RID));
149 printk(KERN_ERR PFX "ICB_L = 0x%x.\n",
150 ql_read32(qdev, ICB_L));
151 printk(KERN_ERR PFX "ICB_H = 0x%x.\n",
152 ql_read32(qdev, ICB_H));
153 printk(KERN_ERR PFX "CFG = 0x%x.\n",
154 ql_read32(qdev, CFG));
155 printk(KERN_ERR PFX "BIOS_ADDR = 0x%x.\n",
156 ql_read32(qdev, BIOS_ADDR));
157 printk(KERN_ERR PFX "STS = 0x%x.\n",
158 ql_read32(qdev, STS));
159 printk(KERN_ERR PFX "INTR_EN = 0x%x.\n",
160 ql_read32(qdev, INTR_EN));
161 printk(KERN_ERR PFX "INTR_MASK = 0x%x.\n",
162 ql_read32(qdev, INTR_MASK));
163 printk(KERN_ERR PFX "ISR1 = 0x%x.\n",
164 ql_read32(qdev, ISR1));
165 printk(KERN_ERR PFX "ISR2 = 0x%x.\n",
166 ql_read32(qdev, ISR2));
167 printk(KERN_ERR PFX "ISR3 = 0x%x.\n",
168 ql_read32(qdev, ISR3));
169 printk(KERN_ERR PFX "ISR4 = 0x%x.\n",
170 ql_read32(qdev, ISR4));
171 printk(KERN_ERR PFX "REV_ID = 0x%x.\n",
172 ql_read32(qdev, REV_ID));
173 printk(KERN_ERR PFX "FRC_ECC_ERR = 0x%x.\n",
174 ql_read32(qdev, FRC_ECC_ERR));
175 printk(KERN_ERR PFX "ERR_STS = 0x%x.\n",
176 ql_read32(qdev, ERR_STS));
177 printk(KERN_ERR PFX "RAM_DBG_ADDR = 0x%x.\n",
178 ql_read32(qdev, RAM_DBG_ADDR));
179 printk(KERN_ERR PFX "RAM_DBG_DATA = 0x%x.\n",
180 ql_read32(qdev, RAM_DBG_DATA));
181 printk(KERN_ERR PFX "ECC_ERR_CNT = 0x%x.\n",
182 ql_read32(qdev, ECC_ERR_CNT));
183 printk(KERN_ERR PFX "SEM = 0x%x.\n",
184 ql_read32(qdev, SEM));
185 printk(KERN_ERR PFX "GPIO_1 = 0x%x.\n",
186 ql_read32(qdev, GPIO_1));
187 printk(KERN_ERR PFX "GPIO_2 = 0x%x.\n",
188 ql_read32(qdev, GPIO_2));
189 printk(KERN_ERR PFX "GPIO_3 = 0x%x.\n",
190 ql_read32(qdev, GPIO_3));
191 printk(KERN_ERR PFX "XGMAC_ADDR = 0x%x.\n",
192 ql_read32(qdev, XGMAC_ADDR));
193 printk(KERN_ERR PFX "XGMAC_DATA = 0x%x.\n",
194 ql_read32(qdev, XGMAC_DATA));
195 printk(KERN_ERR PFX "NIC_ETS = 0x%x.\n",
196 ql_read32(qdev, NIC_ETS));
197 printk(KERN_ERR PFX "CNA_ETS = 0x%x.\n",
198 ql_read32(qdev, CNA_ETS));
199 printk(KERN_ERR PFX "FLASH_ADDR = 0x%x.\n",
200 ql_read32(qdev, FLASH_ADDR));
201 printk(KERN_ERR PFX "FLASH_DATA = 0x%x.\n",
202 ql_read32(qdev, FLASH_DATA));
203 printk(KERN_ERR PFX "CQ_STOP = 0x%x.\n",
204 ql_read32(qdev, CQ_STOP));
205 printk(KERN_ERR PFX "PAGE_TBL_RID = 0x%x.\n",
206 ql_read32(qdev, PAGE_TBL_RID));
207 printk(KERN_ERR PFX "WQ_PAGE_TBL_LO = 0x%x.\n",
208 ql_read32(qdev, WQ_PAGE_TBL_LO));
209 printk(KERN_ERR PFX "WQ_PAGE_TBL_HI = 0x%x.\n",
210 ql_read32(qdev, WQ_PAGE_TBL_HI));
211 printk(KERN_ERR PFX "CQ_PAGE_TBL_LO = 0x%x.\n",
212 ql_read32(qdev, CQ_PAGE_TBL_LO));
213 printk(KERN_ERR PFX "CQ_PAGE_TBL_HI = 0x%x.\n",
214 ql_read32(qdev, CQ_PAGE_TBL_HI));
215 printk(KERN_ERR PFX "COS_DFLT_CQ1 = 0x%x.\n",
216 ql_read32(qdev, COS_DFLT_CQ1));
217 printk(KERN_ERR PFX "COS_DFLT_CQ2 = 0x%x.\n",
218 ql_read32(qdev, COS_DFLT_CQ2));
219 printk(KERN_ERR PFX "SPLT_HDR = 0x%x.\n",
220 ql_read32(qdev, SPLT_HDR));
221 printk(KERN_ERR PFX "FC_PAUSE_THRES = 0x%x.\n",
222 ql_read32(qdev, FC_PAUSE_THRES));
223 printk(KERN_ERR PFX "NIC_PAUSE_THRES = 0x%x.\n",
224 ql_read32(qdev, NIC_PAUSE_THRES));
225 printk(KERN_ERR PFX "FC_ETHERTYPE = 0x%x.\n",
226 ql_read32(qdev, FC_ETHERTYPE));
227 printk(KERN_ERR PFX "FC_RCV_CFG = 0x%x.\n",
228 ql_read32(qdev, FC_RCV_CFG));
229 printk(KERN_ERR PFX "NIC_RCV_CFG = 0x%x.\n",
230 ql_read32(qdev, NIC_RCV_CFG));
231 printk(KERN_ERR PFX "FC_COS_TAGS = 0x%x.\n",
232 ql_read32(qdev, FC_COS_TAGS));
233 printk(KERN_ERR PFX "NIC_COS_TAGS = 0x%x.\n",
234 ql_read32(qdev, NIC_COS_TAGS));
235 printk(KERN_ERR PFX "MGMT_RCV_CFG = 0x%x.\n",
236 ql_read32(qdev, MGMT_RCV_CFG));
237 printk(KERN_ERR PFX "XG_SERDES_ADDR = 0x%x.\n",
238 ql_read32(qdev, XG_SERDES_ADDR));
239 printk(KERN_ERR PFX "XG_SERDES_DATA = 0x%x.\n",
240 ql_read32(qdev, XG_SERDES_DATA));
241 printk(KERN_ERR PFX "PRB_MX_ADDR = 0x%x.\n",
242 ql_read32(qdev, PRB_MX_ADDR));
243 printk(KERN_ERR PFX "PRB_MX_DATA = 0x%x.\n",
244 ql_read32(qdev, PRB_MX_DATA));
245 ql_dump_intr_states(qdev);
246 ql_dump_xgmac_control_regs(qdev);
247 ql_dump_ets_regs(qdev);
248 ql_dump_cam_entries(qdev);
249 ql_dump_routing_entries(qdev);
250}
251#endif
252
253#ifdef QL_STAT_DUMP
254void ql_dump_stat(struct ql_adapter *qdev)
255{
256 printk(KERN_ERR "%s: Enter.\n", __func__);
257 printk(KERN_ERR "tx_pkts = %ld\n",
258 (unsigned long)qdev->nic_stats.tx_pkts);
259 printk(KERN_ERR "tx_bytes = %ld\n",
260 (unsigned long)qdev->nic_stats.tx_bytes);
261 printk(KERN_ERR "tx_mcast_pkts = %ld.\n",
262 (unsigned long)qdev->nic_stats.tx_mcast_pkts);
263 printk(KERN_ERR "tx_bcast_pkts = %ld.\n",
264 (unsigned long)qdev->nic_stats.tx_bcast_pkts);
265 printk(KERN_ERR "tx_ucast_pkts = %ld.\n",
266 (unsigned long)qdev->nic_stats.tx_ucast_pkts);
267 printk(KERN_ERR "tx_ctl_pkts = %ld.\n",
268 (unsigned long)qdev->nic_stats.tx_ctl_pkts);
269 printk(KERN_ERR "tx_pause_pkts = %ld.\n",
270 (unsigned long)qdev->nic_stats.tx_pause_pkts);
271 printk(KERN_ERR "tx_64_pkt = %ld.\n",
272 (unsigned long)qdev->nic_stats.tx_64_pkt);
273 printk(KERN_ERR "tx_65_to_127_pkt = %ld.\n",
274 (unsigned long)qdev->nic_stats.tx_65_to_127_pkt);
275 printk(KERN_ERR "tx_128_to_255_pkt = %ld.\n",
276 (unsigned long)qdev->nic_stats.tx_128_to_255_pkt);
277 printk(KERN_ERR "tx_256_511_pkt = %ld.\n",
278 (unsigned long)qdev->nic_stats.tx_256_511_pkt);
279 printk(KERN_ERR "tx_512_to_1023_pkt = %ld.\n",
280 (unsigned long)qdev->nic_stats.tx_512_to_1023_pkt);
281 printk(KERN_ERR "tx_1024_to_1518_pkt = %ld.\n",
282 (unsigned long)qdev->nic_stats.tx_1024_to_1518_pkt);
283 printk(KERN_ERR "tx_1519_to_max_pkt = %ld.\n",
284 (unsigned long)qdev->nic_stats.tx_1519_to_max_pkt);
285 printk(KERN_ERR "tx_undersize_pkt = %ld.\n",
286 (unsigned long)qdev->nic_stats.tx_undersize_pkt);
287 printk(KERN_ERR "tx_oversize_pkt = %ld.\n",
288 (unsigned long)qdev->nic_stats.tx_oversize_pkt);
289 printk(KERN_ERR "rx_bytes = %ld.\n",
290 (unsigned long)qdev->nic_stats.rx_bytes);
291 printk(KERN_ERR "rx_bytes_ok = %ld.\n",
292 (unsigned long)qdev->nic_stats.rx_bytes_ok);
293 printk(KERN_ERR "rx_pkts = %ld.\n",
294 (unsigned long)qdev->nic_stats.rx_pkts);
295 printk(KERN_ERR "rx_pkts_ok = %ld.\n",
296 (unsigned long)qdev->nic_stats.rx_pkts_ok);
297 printk(KERN_ERR "rx_bcast_pkts = %ld.\n",
298 (unsigned long)qdev->nic_stats.rx_bcast_pkts);
299 printk(KERN_ERR "rx_mcast_pkts = %ld.\n",
300 (unsigned long)qdev->nic_stats.rx_mcast_pkts);
301 printk(KERN_ERR "rx_ucast_pkts = %ld.\n",
302 (unsigned long)qdev->nic_stats.rx_ucast_pkts);
303 printk(KERN_ERR "rx_undersize_pkts = %ld.\n",
304 (unsigned long)qdev->nic_stats.rx_undersize_pkts);
305 printk(KERN_ERR "rx_oversize_pkts = %ld.\n",
306 (unsigned long)qdev->nic_stats.rx_oversize_pkts);
307 printk(KERN_ERR "rx_jabber_pkts = %ld.\n",
308 (unsigned long)qdev->nic_stats.rx_jabber_pkts);
309 printk(KERN_ERR "rx_undersize_fcerr_pkts = %ld.\n",
310 (unsigned long)qdev->nic_stats.rx_undersize_fcerr_pkts);
311 printk(KERN_ERR "rx_drop_events = %ld.\n",
312 (unsigned long)qdev->nic_stats.rx_drop_events);
313 printk(KERN_ERR "rx_fcerr_pkts = %ld.\n",
314 (unsigned long)qdev->nic_stats.rx_fcerr_pkts);
315 printk(KERN_ERR "rx_align_err = %ld.\n",
316 (unsigned long)qdev->nic_stats.rx_align_err);
317 printk(KERN_ERR "rx_symbol_err = %ld.\n",
318 (unsigned long)qdev->nic_stats.rx_symbol_err);
319 printk(KERN_ERR "rx_mac_err = %ld.\n",
320 (unsigned long)qdev->nic_stats.rx_mac_err);
321 printk(KERN_ERR "rx_ctl_pkts = %ld.\n",
322 (unsigned long)qdev->nic_stats.rx_ctl_pkts);
323 printk(KERN_ERR "rx_pause_pkts = %ld.\n",
324 (unsigned long)qdev->nic_stats.rx_pause_pkts);
325 printk(KERN_ERR "rx_64_pkts = %ld.\n",
326 (unsigned long)qdev->nic_stats.rx_64_pkts);
327 printk(KERN_ERR "rx_65_to_127_pkts = %ld.\n",
328 (unsigned long)qdev->nic_stats.rx_65_to_127_pkts);
329 printk(KERN_ERR "rx_128_255_pkts = %ld.\n",
330 (unsigned long)qdev->nic_stats.rx_128_255_pkts);
331 printk(KERN_ERR "rx_256_511_pkts = %ld.\n",
332 (unsigned long)qdev->nic_stats.rx_256_511_pkts);
333 printk(KERN_ERR "rx_512_to_1023_pkts = %ld.\n",
334 (unsigned long)qdev->nic_stats.rx_512_to_1023_pkts);
335 printk(KERN_ERR "rx_1024_to_1518_pkts = %ld.\n",
336 (unsigned long)qdev->nic_stats.rx_1024_to_1518_pkts);
337 printk(KERN_ERR "rx_1519_to_max_pkts = %ld.\n",
338 (unsigned long)qdev->nic_stats.rx_1519_to_max_pkts);
339 printk(KERN_ERR "rx_len_err_pkts = %ld.\n",
340 (unsigned long)qdev->nic_stats.rx_len_err_pkts);
341};
342#endif
343
344#ifdef QL_DEV_DUMP
345void ql_dump_qdev(struct ql_adapter *qdev)
346{
347 int i;
348 printk(KERN_ERR PFX "qdev->flags = %lx.\n",
349 qdev->flags);
350 printk(KERN_ERR PFX "qdev->vlgrp = %p.\n",
351 qdev->vlgrp);
352 printk(KERN_ERR PFX "qdev->pdev = %p.\n",
353 qdev->pdev);
354 printk(KERN_ERR PFX "qdev->ndev = %p.\n",
355 qdev->ndev);
356 printk(KERN_ERR PFX "qdev->chip_rev_id = %d.\n",
357 qdev->chip_rev_id);
358 printk(KERN_ERR PFX "qdev->reg_base = %p.\n",
359 qdev->reg_base);
360 printk(KERN_ERR PFX "qdev->doorbell_area = %p.\n",
361 qdev->doorbell_area);
362 printk(KERN_ERR PFX "qdev->doorbell_area_size = %d.\n",
363 qdev->doorbell_area_size);
364 printk(KERN_ERR PFX "msg_enable = %x.\n",
365 qdev->msg_enable);
366 printk(KERN_ERR PFX "qdev->rx_ring_shadow_reg_area = %p.\n",
367 qdev->rx_ring_shadow_reg_area);
David S. Miller53159d02008-09-19 16:13:05 -0700368 printk(KERN_ERR PFX "qdev->rx_ring_shadow_reg_dma = %llx.\n",
369 (unsigned long long) qdev->rx_ring_shadow_reg_dma);
Ron Mercerc4e84bd2008-09-18 11:56:28 -0400370 printk(KERN_ERR PFX "qdev->tx_ring_shadow_reg_area = %p.\n",
371 qdev->tx_ring_shadow_reg_area);
David S. Miller53159d02008-09-19 16:13:05 -0700372 printk(KERN_ERR PFX "qdev->tx_ring_shadow_reg_dma = %llx.\n",
373 (unsigned long long) qdev->tx_ring_shadow_reg_dma);
Ron Mercerc4e84bd2008-09-18 11:56:28 -0400374 printk(KERN_ERR PFX "qdev->intr_count = %d.\n",
375 qdev->intr_count);
376 if (qdev->msi_x_entry)
377 for (i = 0; i < qdev->intr_count; i++) {
378 printk(KERN_ERR PFX
379 "msi_x_entry.[%d]vector = %d.\n", i,
380 qdev->msi_x_entry[i].vector);
381 printk(KERN_ERR PFX
382 "msi_x_entry.[%d]entry = %d.\n", i,
383 qdev->msi_x_entry[i].entry);
384 }
385 for (i = 0; i < qdev->intr_count; i++) {
386 printk(KERN_ERR PFX
387 "intr_context[%d].qdev = %p.\n", i,
388 qdev->intr_context[i].qdev);
389 printk(KERN_ERR PFX
390 "intr_context[%d].intr = %d.\n", i,
391 qdev->intr_context[i].intr);
392 printk(KERN_ERR PFX
393 "intr_context[%d].hooked = %d.\n", i,
394 qdev->intr_context[i].hooked);
395 printk(KERN_ERR PFX
396 "intr_context[%d].intr_en_mask = 0x%08x.\n", i,
397 qdev->intr_context[i].intr_en_mask);
398 printk(KERN_ERR PFX
399 "intr_context[%d].intr_dis_mask = 0x%08x.\n", i,
400 qdev->intr_context[i].intr_dis_mask);
401 printk(KERN_ERR PFX
402 "intr_context[%d].intr_read_mask = 0x%08x.\n", i,
403 qdev->intr_context[i].intr_read_mask);
404 }
405 printk(KERN_ERR PFX "qdev->tx_ring_count = %d.\n", qdev->tx_ring_count);
406 printk(KERN_ERR PFX "qdev->rx_ring_count = %d.\n", qdev->rx_ring_count);
407 printk(KERN_ERR PFX "qdev->ring_mem_size = %d.\n", qdev->ring_mem_size);
408 printk(KERN_ERR PFX "qdev->ring_mem = %p.\n", qdev->ring_mem);
409 printk(KERN_ERR PFX "qdev->intr_count = %d.\n", qdev->intr_count);
410 printk(KERN_ERR PFX "qdev->tx_ring = %p.\n",
411 qdev->tx_ring);
412 printk(KERN_ERR PFX "qdev->rss_ring_first_cq_id = %d.\n",
413 qdev->rss_ring_first_cq_id);
414 printk(KERN_ERR PFX "qdev->rss_ring_count = %d.\n",
415 qdev->rss_ring_count);
416 printk(KERN_ERR PFX "qdev->rx_ring = %p.\n", qdev->rx_ring);
417 printk(KERN_ERR PFX "qdev->default_rx_queue = %d.\n",
418 qdev->default_rx_queue);
419 printk(KERN_ERR PFX "qdev->xg_sem_mask = 0x%08x.\n",
420 qdev->xg_sem_mask);
421 printk(KERN_ERR PFX "qdev->port_link_up = 0x%08x.\n",
422 qdev->port_link_up);
423 printk(KERN_ERR PFX "qdev->port_init = 0x%08x.\n",
424 qdev->port_init);
425
426}
427#endif
428
429#ifdef QL_CB_DUMP
430void ql_dump_wqicb(struct wqicb *wqicb)
431{
432 printk(KERN_ERR PFX "Dumping wqicb stuff...\n");
433 printk(KERN_ERR PFX "wqicb->len = 0x%x.\n", le16_to_cpu(wqicb->len));
434 printk(KERN_ERR PFX "wqicb->flags = %x.\n", le16_to_cpu(wqicb->flags));
435 printk(KERN_ERR PFX "wqicb->cq_id_rss = %d.\n",
436 le16_to_cpu(wqicb->cq_id_rss));
437 printk(KERN_ERR PFX "wqicb->rid = 0x%x.\n", le16_to_cpu(wqicb->rid));
438 printk(KERN_ERR PFX "wqicb->wq_addr_lo = 0x%.08x.\n",
439 le32_to_cpu(wqicb->addr_lo));
440 printk(KERN_ERR PFX "wqicb->wq_addr_hi = 0x%.08x.\n",
441 le32_to_cpu(wqicb->addr_hi));
442 printk(KERN_ERR PFX "wqicb->wq_cnsmr_idx_addr_lo = 0x%.08x.\n",
443 le32_to_cpu(wqicb->cnsmr_idx_addr_lo));
444 printk(KERN_ERR PFX "wqicb->wq_cnsmr_idx_addr_hi = 0x%.08x.\n",
445 le32_to_cpu(wqicb->cnsmr_idx_addr_hi));
446}
447
448void ql_dump_tx_ring(struct tx_ring *tx_ring)
449{
450 if (tx_ring == NULL)
451 return;
452 printk(KERN_ERR PFX
453 "===================== Dumping tx_ring %d ===============.\n",
454 tx_ring->wq_id);
455 printk(KERN_ERR PFX "tx_ring->base = %p.\n", tx_ring->wq_base);
456 printk(KERN_ERR PFX "tx_ring->base_dma = 0x%llx.\n",
David S. Miller53159d02008-09-19 16:13:05 -0700457 (unsigned long long) tx_ring->wq_base_dma);
Ron Mercerba7cd3b2009-01-09 11:31:49 +0000458 printk(KERN_ERR PFX
459 "tx_ring->cnsmr_idx_sh_reg, addr = 0x%p, value = %d.\n",
460 tx_ring->cnsmr_idx_sh_reg,
461 tx_ring->cnsmr_idx_sh_reg
462 ? ql_read_sh_reg(tx_ring->cnsmr_idx_sh_reg) : 0);
Ron Mercerc4e84bd2008-09-18 11:56:28 -0400463 printk(KERN_ERR PFX "tx_ring->size = %d.\n", tx_ring->wq_size);
464 printk(KERN_ERR PFX "tx_ring->len = %d.\n", tx_ring->wq_len);
465 printk(KERN_ERR PFX "tx_ring->prod_idx_db_reg = %p.\n",
466 tx_ring->prod_idx_db_reg);
467 printk(KERN_ERR PFX "tx_ring->valid_db_reg = %p.\n",
468 tx_ring->valid_db_reg);
469 printk(KERN_ERR PFX "tx_ring->prod_idx = %d.\n", tx_ring->prod_idx);
470 printk(KERN_ERR PFX "tx_ring->cq_id = %d.\n", tx_ring->cq_id);
471 printk(KERN_ERR PFX "tx_ring->wq_id = %d.\n", tx_ring->wq_id);
472 printk(KERN_ERR PFX "tx_ring->q = %p.\n", tx_ring->q);
473 printk(KERN_ERR PFX "tx_ring->tx_count = %d.\n",
474 atomic_read(&tx_ring->tx_count));
475}
476
477void ql_dump_ricb(struct ricb *ricb)
478{
479 int i;
480 printk(KERN_ERR PFX
481 "===================== Dumping ricb ===============.\n");
482 printk(KERN_ERR PFX "Dumping ricb stuff...\n");
483
484 printk(KERN_ERR PFX "ricb->base_cq = %d.\n", ricb->base_cq & 0x1f);
485 printk(KERN_ERR PFX "ricb->flags = %s%s%s%s%s%s%s%s%s.\n",
486 ricb->base_cq & RSS_L4K ? "RSS_L4K " : "",
487 ricb->flags & RSS_L6K ? "RSS_L6K " : "",
488 ricb->flags & RSS_LI ? "RSS_LI " : "",
489 ricb->flags & RSS_LB ? "RSS_LB " : "",
490 ricb->flags & RSS_LM ? "RSS_LM " : "",
491 ricb->flags & RSS_RI4 ? "RSS_RI4 " : "",
492 ricb->flags & RSS_RT4 ? "RSS_RT4 " : "",
493 ricb->flags & RSS_RI6 ? "RSS_RI6 " : "",
494 ricb->flags & RSS_RT6 ? "RSS_RT6 " : "");
495 printk(KERN_ERR PFX "ricb->mask = 0x%.04x.\n", le16_to_cpu(ricb->mask));
496 for (i = 0; i < 16; i++)
497 printk(KERN_ERR PFX "ricb->hash_cq_id[%d] = 0x%.08x.\n", i,
498 le32_to_cpu(ricb->hash_cq_id[i]));
499 for (i = 0; i < 10; i++)
500 printk(KERN_ERR PFX "ricb->ipv6_hash_key[%d] = 0x%.08x.\n", i,
501 le32_to_cpu(ricb->ipv6_hash_key[i]));
502 for (i = 0; i < 4; i++)
503 printk(KERN_ERR PFX "ricb->ipv4_hash_key[%d] = 0x%.08x.\n", i,
504 le32_to_cpu(ricb->ipv4_hash_key[i]));
505}
506
507void ql_dump_cqicb(struct cqicb *cqicb)
508{
509 printk(KERN_ERR PFX "Dumping cqicb stuff...\n");
510
511 printk(KERN_ERR PFX "cqicb->msix_vect = %d.\n", cqicb->msix_vect);
512 printk(KERN_ERR PFX "cqicb->flags = %x.\n", cqicb->flags);
513 printk(KERN_ERR PFX "cqicb->len = %d.\n", le16_to_cpu(cqicb->len));
514 printk(KERN_ERR PFX "cqicb->addr_lo = %x.\n",
515 le32_to_cpu(cqicb->addr_lo));
516 printk(KERN_ERR PFX "cqicb->addr_hi = %x.\n",
517 le32_to_cpu(cqicb->addr_hi));
518 printk(KERN_ERR PFX "cqicb->prod_idx_addr_lo = %x.\n",
519 le32_to_cpu(cqicb->prod_idx_addr_lo));
520 printk(KERN_ERR PFX "cqicb->prod_idx_addr_hi = %x.\n",
521 le32_to_cpu(cqicb->prod_idx_addr_hi));
522 printk(KERN_ERR PFX "cqicb->pkt_delay = 0x%.04x.\n",
523 le16_to_cpu(cqicb->pkt_delay));
524 printk(KERN_ERR PFX "cqicb->irq_delay = 0x%.04x.\n",
525 le16_to_cpu(cqicb->irq_delay));
526 printk(KERN_ERR PFX "cqicb->lbq_addr_lo = %x.\n",
527 le32_to_cpu(cqicb->lbq_addr_lo));
528 printk(KERN_ERR PFX "cqicb->lbq_addr_hi = %x.\n",
529 le32_to_cpu(cqicb->lbq_addr_hi));
530 printk(KERN_ERR PFX "cqicb->lbq_buf_size = 0x%.04x.\n",
531 le16_to_cpu(cqicb->lbq_buf_size));
532 printk(KERN_ERR PFX "cqicb->lbq_len = 0x%.04x.\n",
533 le16_to_cpu(cqicb->lbq_len));
534 printk(KERN_ERR PFX "cqicb->sbq_addr_lo = %x.\n",
535 le32_to_cpu(cqicb->sbq_addr_lo));
536 printk(KERN_ERR PFX "cqicb->sbq_addr_hi = %x.\n",
537 le32_to_cpu(cqicb->sbq_addr_hi));
538 printk(KERN_ERR PFX "cqicb->sbq_buf_size = 0x%.04x.\n",
539 le16_to_cpu(cqicb->sbq_buf_size));
540 printk(KERN_ERR PFX "cqicb->sbq_len = 0x%.04x.\n",
541 le16_to_cpu(cqicb->sbq_len));
542}
543
544void ql_dump_rx_ring(struct rx_ring *rx_ring)
545{
546 if (rx_ring == NULL)
547 return;
548 printk(KERN_ERR PFX
549 "===================== Dumping rx_ring %d ===============.\n",
550 rx_ring->cq_id);
551 printk(KERN_ERR PFX "Dumping rx_ring %d, type = %s%s%s.\n",
552 rx_ring->cq_id, rx_ring->type == DEFAULT_Q ? "DEFAULT" : "",
553 rx_ring->type == TX_Q ? "OUTBOUND COMPLETIONS" : "",
554 rx_ring->type == RX_Q ? "INBOUND_COMPLETIONS" : "");
555 printk(KERN_ERR PFX "rx_ring->cqicb = %p.\n", &rx_ring->cqicb);
556 printk(KERN_ERR PFX "rx_ring->cq_base = %p.\n", rx_ring->cq_base);
557 printk(KERN_ERR PFX "rx_ring->cq_base_dma = %llx.\n",
David S. Miller53159d02008-09-19 16:13:05 -0700558 (unsigned long long) rx_ring->cq_base_dma);
Ron Mercerc4e84bd2008-09-18 11:56:28 -0400559 printk(KERN_ERR PFX "rx_ring->cq_size = %d.\n", rx_ring->cq_size);
560 printk(KERN_ERR PFX "rx_ring->cq_len = %d.\n", rx_ring->cq_len);
561 printk(KERN_ERR PFX
Ron Mercerba7cd3b2009-01-09 11:31:49 +0000562 "rx_ring->prod_idx_sh_reg, addr = 0x%p, value = %d.\n",
Ron Mercerc4e84bd2008-09-18 11:56:28 -0400563 rx_ring->prod_idx_sh_reg,
Ron Mercerba7cd3b2009-01-09 11:31:49 +0000564 rx_ring->prod_idx_sh_reg
565 ? ql_read_sh_reg(rx_ring->prod_idx_sh_reg) : 0);
Ron Mercerc4e84bd2008-09-18 11:56:28 -0400566 printk(KERN_ERR PFX "rx_ring->prod_idx_sh_reg_dma = %llx.\n",
David S. Miller53159d02008-09-19 16:13:05 -0700567 (unsigned long long) rx_ring->prod_idx_sh_reg_dma);
Ron Mercerc4e84bd2008-09-18 11:56:28 -0400568 printk(KERN_ERR PFX "rx_ring->cnsmr_idx_db_reg = %p.\n",
569 rx_ring->cnsmr_idx_db_reg);
570 printk(KERN_ERR PFX "rx_ring->cnsmr_idx = %d.\n", rx_ring->cnsmr_idx);
571 printk(KERN_ERR PFX "rx_ring->curr_entry = %p.\n", rx_ring->curr_entry);
572 printk(KERN_ERR PFX "rx_ring->valid_db_reg = %p.\n",
573 rx_ring->valid_db_reg);
574
575 printk(KERN_ERR PFX "rx_ring->lbq_base = %p.\n", rx_ring->lbq_base);
576 printk(KERN_ERR PFX "rx_ring->lbq_base_dma = %llx.\n",
David S. Miller53159d02008-09-19 16:13:05 -0700577 (unsigned long long) rx_ring->lbq_base_dma);
Ron Mercerc4e84bd2008-09-18 11:56:28 -0400578 printk(KERN_ERR PFX "rx_ring->lbq_base_indirect = %p.\n",
579 rx_ring->lbq_base_indirect);
580 printk(KERN_ERR PFX "rx_ring->lbq_base_indirect_dma = %llx.\n",
David S. Miller53159d02008-09-19 16:13:05 -0700581 (unsigned long long) rx_ring->lbq_base_indirect_dma);
Ron Mercerc4e84bd2008-09-18 11:56:28 -0400582 printk(KERN_ERR PFX "rx_ring->lbq = %p.\n", rx_ring->lbq);
583 printk(KERN_ERR PFX "rx_ring->lbq_len = %d.\n", rx_ring->lbq_len);
584 printk(KERN_ERR PFX "rx_ring->lbq_size = %d.\n", rx_ring->lbq_size);
585 printk(KERN_ERR PFX "rx_ring->lbq_prod_idx_db_reg = %p.\n",
586 rx_ring->lbq_prod_idx_db_reg);
587 printk(KERN_ERR PFX "rx_ring->lbq_prod_idx = %d.\n",
588 rx_ring->lbq_prod_idx);
589 printk(KERN_ERR PFX "rx_ring->lbq_curr_idx = %d.\n",
590 rx_ring->lbq_curr_idx);
591 printk(KERN_ERR PFX "rx_ring->lbq_clean_idx = %d.\n",
592 rx_ring->lbq_clean_idx);
593 printk(KERN_ERR PFX "rx_ring->lbq_free_cnt = %d.\n",
594 rx_ring->lbq_free_cnt);
595 printk(KERN_ERR PFX "rx_ring->lbq_buf_size = %d.\n",
596 rx_ring->lbq_buf_size);
597
598 printk(KERN_ERR PFX "rx_ring->sbq_base = %p.\n", rx_ring->sbq_base);
599 printk(KERN_ERR PFX "rx_ring->sbq_base_dma = %llx.\n",
David S. Miller53159d02008-09-19 16:13:05 -0700600 (unsigned long long) rx_ring->sbq_base_dma);
Ron Mercerc4e84bd2008-09-18 11:56:28 -0400601 printk(KERN_ERR PFX "rx_ring->sbq_base_indirect = %p.\n",
602 rx_ring->sbq_base_indirect);
603 printk(KERN_ERR PFX "rx_ring->sbq_base_indirect_dma = %llx.\n",
David S. Miller53159d02008-09-19 16:13:05 -0700604 (unsigned long long) rx_ring->sbq_base_indirect_dma);
Ron Mercerc4e84bd2008-09-18 11:56:28 -0400605 printk(KERN_ERR PFX "rx_ring->sbq = %p.\n", rx_ring->sbq);
606 printk(KERN_ERR PFX "rx_ring->sbq_len = %d.\n", rx_ring->sbq_len);
607 printk(KERN_ERR PFX "rx_ring->sbq_size = %d.\n", rx_ring->sbq_size);
608 printk(KERN_ERR PFX "rx_ring->sbq_prod_idx_db_reg addr = %p.\n",
609 rx_ring->sbq_prod_idx_db_reg);
610 printk(KERN_ERR PFX "rx_ring->sbq_prod_idx = %d.\n",
611 rx_ring->sbq_prod_idx);
612 printk(KERN_ERR PFX "rx_ring->sbq_curr_idx = %d.\n",
613 rx_ring->sbq_curr_idx);
614 printk(KERN_ERR PFX "rx_ring->sbq_clean_idx = %d.\n",
615 rx_ring->sbq_clean_idx);
616 printk(KERN_ERR PFX "rx_ring->sbq_free_cnt = %d.\n",
617 rx_ring->sbq_free_cnt);
618 printk(KERN_ERR PFX "rx_ring->sbq_buf_size = %d.\n",
619 rx_ring->sbq_buf_size);
620 printk(KERN_ERR PFX "rx_ring->cq_id = %d.\n", rx_ring->cq_id);
621 printk(KERN_ERR PFX "rx_ring->irq = %d.\n", rx_ring->irq);
622 printk(KERN_ERR PFX "rx_ring->cpu = %d.\n", rx_ring->cpu);
623 printk(KERN_ERR PFX "rx_ring->qdev = %p.\n", rx_ring->qdev);
624}
625
626void ql_dump_hw_cb(struct ql_adapter *qdev, int size, u32 bit, u16 q_id)
627{
628 void *ptr;
629
630 printk(KERN_ERR PFX "%s: Enter.\n", __func__);
631
632 ptr = kmalloc(size, GFP_ATOMIC);
633 if (ptr == NULL) {
634 printk(KERN_ERR PFX "%s: Couldn't allocate a buffer.\n",
635 __func__);
636 return;
637 }
638
639 if (ql_write_cfg(qdev, ptr, size, bit, q_id)) {
640 printk(KERN_ERR "%s: Failed to upload control block!\n",
641 __func__);
642 goto fail_it;
643 }
644 switch (bit) {
645 case CFG_DRQ:
646 ql_dump_wqicb((struct wqicb *)ptr);
647 break;
648 case CFG_DCQ:
649 ql_dump_cqicb((struct cqicb *)ptr);
650 break;
651 case CFG_DR:
652 ql_dump_ricb((struct ricb *)ptr);
653 break;
654 default:
655 printk(KERN_ERR PFX "%s: Invalid bit value = %x.\n",
656 __func__, bit);
657 break;
658 }
659fail_it:
660 kfree(ptr);
661}
662#endif
663
664#ifdef QL_OB_DUMP
665void ql_dump_tx_desc(struct tx_buf_desc *tbd)
666{
667 printk(KERN_ERR PFX "tbd->addr = 0x%llx\n",
668 le64_to_cpu((u64) tbd->addr));
669 printk(KERN_ERR PFX "tbd->len = %d\n",
670 le32_to_cpu(tbd->len & TX_DESC_LEN_MASK));
671 printk(KERN_ERR PFX "tbd->flags = %s %s\n",
672 tbd->len & TX_DESC_C ? "C" : ".",
673 tbd->len & TX_DESC_E ? "E" : ".");
674 tbd++;
675 printk(KERN_ERR PFX "tbd->addr = 0x%llx\n",
676 le64_to_cpu((u64) tbd->addr));
677 printk(KERN_ERR PFX "tbd->len = %d\n",
678 le32_to_cpu(tbd->len & TX_DESC_LEN_MASK));
679 printk(KERN_ERR PFX "tbd->flags = %s %s\n",
680 tbd->len & TX_DESC_C ? "C" : ".",
681 tbd->len & TX_DESC_E ? "E" : ".");
682 tbd++;
683 printk(KERN_ERR PFX "tbd->addr = 0x%llx\n",
684 le64_to_cpu((u64) tbd->addr));
685 printk(KERN_ERR PFX "tbd->len = %d\n",
686 le32_to_cpu(tbd->len & TX_DESC_LEN_MASK));
687 printk(KERN_ERR PFX "tbd->flags = %s %s\n",
688 tbd->len & TX_DESC_C ? "C" : ".",
689 tbd->len & TX_DESC_E ? "E" : ".");
690
691}
692
693void ql_dump_ob_mac_iocb(struct ob_mac_iocb_req *ob_mac_iocb)
694{
695 struct ob_mac_tso_iocb_req *ob_mac_tso_iocb =
696 (struct ob_mac_tso_iocb_req *)ob_mac_iocb;
697 struct tx_buf_desc *tbd;
698 u16 frame_len;
699
700 printk(KERN_ERR PFX "%s\n", __func__);
701 printk(KERN_ERR PFX "opcode = %s\n",
702 (ob_mac_iocb->opcode == OPCODE_OB_MAC_IOCB) ? "MAC" : "TSO");
703 printk(KERN_ERR PFX "flags1 = %s %s %s %s %s\n",
704 ob_mac_tso_iocb->flags1 & OB_MAC_TSO_IOCB_OI ? "OI" : "",
705 ob_mac_tso_iocb->flags1 & OB_MAC_TSO_IOCB_I ? "I" : "",
706 ob_mac_tso_iocb->flags1 & OB_MAC_TSO_IOCB_D ? "D" : "",
707 ob_mac_tso_iocb->flags1 & OB_MAC_TSO_IOCB_IP4 ? "IP4" : "",
708 ob_mac_tso_iocb->flags1 & OB_MAC_TSO_IOCB_IP6 ? "IP6" : "");
709 printk(KERN_ERR PFX "flags2 = %s %s %s\n",
710 ob_mac_tso_iocb->flags2 & OB_MAC_TSO_IOCB_LSO ? "LSO" : "",
711 ob_mac_tso_iocb->flags2 & OB_MAC_TSO_IOCB_UC ? "UC" : "",
712 ob_mac_tso_iocb->flags2 & OB_MAC_TSO_IOCB_TC ? "TC" : "");
713 printk(KERN_ERR PFX "flags3 = %s %s %s \n",
714 ob_mac_tso_iocb->flags3 & OB_MAC_TSO_IOCB_IC ? "IC" : "",
715 ob_mac_tso_iocb->flags3 & OB_MAC_TSO_IOCB_DFP ? "DFP" : "",
716 ob_mac_tso_iocb->flags3 & OB_MAC_TSO_IOCB_V ? "V" : "");
717 printk(KERN_ERR PFX "tid = %x\n", ob_mac_iocb->tid);
718 printk(KERN_ERR PFX "txq_idx = %d\n", ob_mac_iocb->txq_idx);
719 printk(KERN_ERR PFX "vlan_tci = %x\n", ob_mac_tso_iocb->vlan_tci);
720 if (ob_mac_iocb->opcode == OPCODE_OB_MAC_TSO_IOCB) {
721 printk(KERN_ERR PFX "frame_len = %d\n",
722 le32_to_cpu(ob_mac_tso_iocb->frame_len));
723 printk(KERN_ERR PFX "mss = %d\n",
724 le16_to_cpu(ob_mac_tso_iocb->mss));
725 printk(KERN_ERR PFX "prot_hdr_len = %d\n",
726 le16_to_cpu(ob_mac_tso_iocb->total_hdrs_len));
727 printk(KERN_ERR PFX "hdr_offset = 0x%.04x\n",
728 le16_to_cpu(ob_mac_tso_iocb->net_trans_offset));
729 frame_len = le32_to_cpu(ob_mac_tso_iocb->frame_len);
730 } else {
731 printk(KERN_ERR PFX "frame_len = %d\n",
732 le16_to_cpu(ob_mac_iocb->frame_len));
733 frame_len = le16_to_cpu(ob_mac_iocb->frame_len);
734 }
735 tbd = &ob_mac_iocb->tbd[0];
736 ql_dump_tx_desc(tbd);
737}
738
739void ql_dump_ob_mac_rsp(struct ob_mac_iocb_rsp *ob_mac_rsp)
740{
741 printk(KERN_ERR PFX "%s\n", __func__);
742 printk(KERN_ERR PFX "opcode = %d\n", ob_mac_rsp->opcode);
743 printk(KERN_ERR PFX "flags = %s %s %s %s %s %s %s\n",
744 ob_mac_rsp->flags1 & OB_MAC_IOCB_RSP_OI ? "OI" : ".",
745 ob_mac_rsp->flags1 & OB_MAC_IOCB_RSP_I ? "I" : ".",
746 ob_mac_rsp->flags1 & OB_MAC_IOCB_RSP_E ? "E" : ".",
747 ob_mac_rsp->flags1 & OB_MAC_IOCB_RSP_S ? "S" : ".",
748 ob_mac_rsp->flags1 & OB_MAC_IOCB_RSP_L ? "L" : ".",
749 ob_mac_rsp->flags1 & OB_MAC_IOCB_RSP_P ? "P" : ".",
750 ob_mac_rsp->flags2 & OB_MAC_IOCB_RSP_B ? "B" : ".");
751 printk(KERN_ERR PFX "tid = %x\n", ob_mac_rsp->tid);
752}
753#endif
754
755#ifdef QL_IB_DUMP
756void ql_dump_ib_mac_rsp(struct ib_mac_iocb_rsp *ib_mac_rsp)
757{
758 printk(KERN_ERR PFX "%s\n", __func__);
759 printk(KERN_ERR PFX "opcode = 0x%x\n", ib_mac_rsp->opcode);
760 printk(KERN_ERR PFX "flags1 = %s%s%s%s%s%s\n",
761 ib_mac_rsp->flags1 & IB_MAC_IOCB_RSP_OI ? "OI " : "",
762 ib_mac_rsp->flags1 & IB_MAC_IOCB_RSP_I ? "I " : "",
763 ib_mac_rsp->flags1 & IB_MAC_IOCB_RSP_TE ? "TE " : "",
764 ib_mac_rsp->flags1 & IB_MAC_IOCB_RSP_NU ? "NU " : "",
765 ib_mac_rsp->flags1 & IB_MAC_IOCB_RSP_IE ? "IE " : "",
766 ib_mac_rsp->flags1 & IB_MAC_IOCB_RSP_B ? "B " : "");
767
768 if (ib_mac_rsp->flags1 & IB_MAC_IOCB_RSP_M_MASK)
769 printk(KERN_ERR PFX "%s%s%s Multicast.\n",
770 (ib_mac_rsp->flags1 & IB_MAC_IOCB_RSP_M_MASK) ==
771 IB_MAC_IOCB_RSP_M_HASH ? "Hash" : "",
772 (ib_mac_rsp->flags1 & IB_MAC_IOCB_RSP_M_MASK) ==
773 IB_MAC_IOCB_RSP_M_REG ? "Registered" : "",
774 (ib_mac_rsp->flags1 & IB_MAC_IOCB_RSP_M_MASK) ==
775 IB_MAC_IOCB_RSP_M_PROM ? "Promiscuous" : "");
776
777 printk(KERN_ERR PFX "flags2 = %s%s%s%s%s\n",
778 (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_P) ? "P " : "",
779 (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_V) ? "V " : "",
780 (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_U) ? "U " : "",
781 (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_T) ? "T " : "",
782 (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_FO) ? "FO " : "");
783
784 if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_ERR_MASK)
785 printk(KERN_ERR PFX "%s%s%s%s%s error.\n",
786 (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_ERR_MASK) ==
787 IB_MAC_IOCB_RSP_ERR_OVERSIZE ? "oversize" : "",
788 (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_ERR_MASK) ==
789 IB_MAC_IOCB_RSP_ERR_UNDERSIZE ? "undersize" : "",
790 (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_ERR_MASK) ==
791 IB_MAC_IOCB_RSP_ERR_PREAMBLE ? "preamble" : "",
792 (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_ERR_MASK) ==
793 IB_MAC_IOCB_RSP_ERR_FRAME_LEN ? "frame length" : "",
794 (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_ERR_MASK) ==
795 IB_MAC_IOCB_RSP_ERR_CRC ? "CRC" : "");
796
797 printk(KERN_ERR PFX "flags3 = %s%s.\n",
798 ib_mac_rsp->flags3 & IB_MAC_IOCB_RSP_DS ? "DS " : "",
799 ib_mac_rsp->flags3 & IB_MAC_IOCB_RSP_DL ? "DL " : "");
800
801 if (ib_mac_rsp->flags3 & IB_MAC_IOCB_RSP_RSS_MASK)
802 printk(KERN_ERR PFX "RSS flags = %s%s%s%s.\n",
803 ((ib_mac_rsp->flags3 & IB_MAC_IOCB_RSP_RSS_MASK) ==
804 IB_MAC_IOCB_RSP_M_IPV4) ? "IPv4 RSS" : "",
805 ((ib_mac_rsp->flags3 & IB_MAC_IOCB_RSP_RSS_MASK) ==
806 IB_MAC_IOCB_RSP_M_IPV6) ? "IPv6 RSS " : "",
807 ((ib_mac_rsp->flags3 & IB_MAC_IOCB_RSP_RSS_MASK) ==
808 IB_MAC_IOCB_RSP_M_TCP_V4) ? "TCP/IPv4 RSS" : "",
809 ((ib_mac_rsp->flags3 & IB_MAC_IOCB_RSP_RSS_MASK) ==
810 IB_MAC_IOCB_RSP_M_TCP_V6) ? "TCP/IPv6 RSS" : "");
811
812 printk(KERN_ERR PFX "data_len = %d\n",
813 le32_to_cpu(ib_mac_rsp->data_len));
814 printk(KERN_ERR PFX "data_addr_hi = 0x%x\n",
815 le32_to_cpu(ib_mac_rsp->data_addr_hi));
816 printk(KERN_ERR PFX "data_addr_lo = 0x%x\n",
817 le32_to_cpu(ib_mac_rsp->data_addr_lo));
818 if (ib_mac_rsp->flags3 & IB_MAC_IOCB_RSP_RSS_MASK)
819 printk(KERN_ERR PFX "rss = %x\n",
820 le32_to_cpu(ib_mac_rsp->rss));
821 if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_V)
822 printk(KERN_ERR PFX "vlan_id = %x\n",
823 le16_to_cpu(ib_mac_rsp->vlan_id));
824
825 printk(KERN_ERR PFX "flags4 = %s%s%s.\n",
Ron Mercera303ce02009-01-05 18:18:22 -0800826 ib_mac_rsp->flags4 & IB_MAC_IOCB_RSP_HV ? "HV " : "",
827 ib_mac_rsp->flags4 & IB_MAC_IOCB_RSP_HS ? "HS " : "",
828 ib_mac_rsp->flags4 & IB_MAC_IOCB_RSP_HL ? "HL " : "");
Ron Mercerc4e84bd2008-09-18 11:56:28 -0400829
Ron Mercera303ce02009-01-05 18:18:22 -0800830 if (ib_mac_rsp->flags4 & IB_MAC_IOCB_RSP_HV) {
Ron Mercerc4e84bd2008-09-18 11:56:28 -0400831 printk(KERN_ERR PFX "hdr length = %d.\n",
832 le32_to_cpu(ib_mac_rsp->hdr_len));
833 printk(KERN_ERR PFX "hdr addr_hi = 0x%x.\n",
834 le32_to_cpu(ib_mac_rsp->hdr_addr_hi));
835 printk(KERN_ERR PFX "hdr addr_lo = 0x%x.\n",
836 le32_to_cpu(ib_mac_rsp->hdr_addr_lo));
837 }
838}
839#endif
840
841#ifdef QL_ALL_DUMP
842void ql_dump_all(struct ql_adapter *qdev)
843{
844 int i;
845
846 QL_DUMP_REGS(qdev);
847 QL_DUMP_QDEV(qdev);
848 for (i = 0; i < qdev->tx_ring_count; i++) {
849 QL_DUMP_TX_RING(&qdev->tx_ring[i]);
850 QL_DUMP_WQICB((struct wqicb *)&qdev->tx_ring[i]);
851 }
852 for (i = 0; i < qdev->rx_ring_count; i++) {
853 QL_DUMP_RX_RING(&qdev->rx_ring[i]);
854 QL_DUMP_CQICB((struct cqicb *)&qdev->rx_ring[i]);
855 }
856}
857#endif