2 * Copyright (c) 2011-2013 Qlogic Corporation
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 * POSSIBILITY OF SUCH DAMAGE.
29 * Author : David C Somayajulu, Qlogic Corporation, Aliso Viejo, CA 92656.
32 #include <sys/cdefs.h>
33 __FBSDID("$FreeBSD$");
39 #include "qla_inline.h"
45 uint32_t dbg_level = 0 ;
47 * Name: qla_dump_buf32
48 * Function: dumps a buffer as 32 bit words
50 void qla_dump_buf32(qla_host_t *ha, char *msg, void *dbuf32, uint32_t len32)
59 device_printf(dev, "%s: %s dump start\n", __func__, msg);
62 device_printf(dev,"0x%08x: 0x%08x 0x%08x 0x%08x 0x%08x\n",
63 i, buf[0], buf[1], buf[2], buf[3]);
70 device_printf(dev,"0x%08x: 0x%08x\n", i, buf[0]);
73 device_printf(dev,"0x%08x: 0x%08x 0x%08x\n", i, buf[0], buf[1]);
76 device_printf(dev,"0x%08x: 0x%08x 0x%08x 0x%08x\n",
77 i, buf[0], buf[1], buf[2]);
82 device_printf(dev, "%s: %s dump end\n", __func__, msg);
86 * Name: qla_dump_buf16
87 * Function: dumps a buffer as 16 bit words
89 void qla_dump_buf16(qla_host_t *ha, char *msg, void *dbuf16, uint32_t len16)
98 device_printf(dev, "%s: %s dump start\n", __func__, msg);
101 device_printf(dev,"0x%08x: 0x%04x 0x%04x 0x%04x 0x%04x"
102 " 0x%04x 0x%04x 0x%04x 0x%04x\n", i, buf[0],
103 buf[1], buf[2], buf[3], buf[4], buf[5], buf[6], buf[7]);
110 device_printf(dev,"0x%08x: 0x%04x\n", i, buf[0]);
113 device_printf(dev,"0x%08x: 0x%04x 0x%04x\n", i, buf[0], buf[1]);
116 device_printf(dev,"0x%08x: 0x%04x 0x%04x 0x%04x\n",
117 i, buf[0], buf[1], buf[2]);
120 device_printf(dev,"0x%08x: 0x%04x 0x%04x 0x%04x 0x%04x\n", i,
121 buf[0], buf[1], buf[2], buf[3]);
124 device_printf(dev,"0x%08x:"
125 " 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x\n", i,
126 buf[0], buf[1], buf[2], buf[3], buf[4]);
129 device_printf(dev,"0x%08x:"
130 " 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x\n", i,
131 buf[0], buf[1], buf[2], buf[3], buf[4], buf[5]);
134 device_printf(dev,"0x%04x: 0x%04x 0x%04x 0x%04x 0x%04x"
135 " 0x%04x 0x%04x 0x%04x\n", i, buf[0], buf[1],
136 buf[2], buf[3], buf[4], buf[5], buf[6]);
141 device_printf(dev, "%s: %s dump end\n", __func__, msg);
145 * Name: qla_dump_buf8
146 * Function: dumps a buffer as bytes
148 void qla_dump_buf8(qla_host_t *ha, char *msg, void *dbuf, uint32_t len)
157 device_printf(dev, "%s: %s 0x%x dump start\n", __func__, msg, len);
160 device_printf(dev,"0x%08x:"
161 " %02x %02x %02x %02x %02x %02x %02x %02x"
162 " %02x %02x %02x %02x %02x %02x %02x %02x\n", i,
163 buf[0], buf[1], buf[2], buf[3],
164 buf[4], buf[5], buf[6], buf[7],
165 buf[8], buf[9], buf[10], buf[11],
166 buf[12], buf[13], buf[14], buf[15]);
173 device_printf(dev,"0x%08x: %02x\n", i, buf[0]);
176 device_printf(dev,"0x%08x: %02x %02x\n", i, buf[0], buf[1]);
179 device_printf(dev,"0x%08x: %02x %02x %02x\n",
180 i, buf[0], buf[1], buf[2]);
183 device_printf(dev,"0x%08x: %02x %02x %02x %02x\n", i,
184 buf[0], buf[1], buf[2], buf[3]);
187 device_printf(dev,"0x%08x:"
188 " %02x %02x %02x %02x %02x\n", i,
189 buf[0], buf[1], buf[2], buf[3], buf[4]);
192 device_printf(dev,"0x%08x:"
193 " %02x %02x %02x %02x %02x %02x\n", i,
194 buf[0], buf[1], buf[2], buf[3], buf[4], buf[5]);
197 device_printf(dev,"0x%08x:"
198 " %02x %02x %02x %02x %02x %02x %02x\n", i,
199 buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6]);
202 device_printf(dev,"0x%08x:"
203 " %02x %02x %02x %02x %02x %02x %02x %02x\n", i,
204 buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6],
208 device_printf(dev,"0x%08x:"
209 " %02x %02x %02x %02x %02x %02x %02x %02x"
211 buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6],
215 device_printf(dev,"0x%08x:"
216 " %02x %02x %02x %02x %02x %02x %02x %02x"
218 buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6],
219 buf[7], buf[8], buf[9]);
222 device_printf(dev,"0x%08x:"
223 " %02x %02x %02x %02x %02x %02x %02x %02x"
224 " %02x %02x %02x\n", i,
225 buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6],
226 buf[7], buf[8], buf[9], buf[10]);
229 device_printf(dev,"0x%08x:"
230 " %02x %02x %02x %02x %02x %02x %02x %02x"
231 " %02x %02x %02x %02x\n", i,
232 buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6],
233 buf[7], buf[8], buf[9], buf[10], buf[11]);
236 device_printf(dev,"0x%08x:"
237 " %02x %02x %02x %02x %02x %02x %02x %02x"
238 " %02x %02x %02x %02x %02x\n", i,
239 buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6],
240 buf[7], buf[8], buf[9], buf[10], buf[11], buf[12]);
243 device_printf(dev,"0x%08x:"
244 " %02x %02x %02x %02x %02x %02x %02x %02x"
245 " %02x %02x %02x %02x %02x %02x\n", i,
246 buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6],
247 buf[7], buf[8], buf[9], buf[10], buf[11], buf[12],
251 device_printf(dev,"0x%08x:"
252 " %02x %02x %02x %02x %02x %02x %02x %02x"
253 " %02x %02x %02x %02x %02x %02x %02x\n", i,
254 buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6],
255 buf[7], buf[8], buf[9], buf[10], buf[11], buf[12],
262 device_printf(dev, "%s: %s dump end\n", __func__, msg);