2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
4 * Copyright (c) 2011-2013 Qlogic Corporation
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 * POSSIBILITY OF SUCH DAMAGE.
31 * Author : David C Somayajulu, Qlogic Corporation, Aliso Viejo, CA 92656.
34 #include <sys/cdefs.h>
35 __FBSDID("$FreeBSD$");
41 #include "qla_inline.h"
46 uint32_t dbg_level = 0 ;
48 * Name: qla_dump_buf32
49 * Function: dumps a buffer as 32 bit words
51 void qla_dump_buf32(qla_host_t *ha, char *msg, void *dbuf32, uint32_t len32)
60 device_printf(dev, "%s: %s dump start\n", __func__, msg);
63 device_printf(dev,"0x%08x: 0x%08x 0x%08x 0x%08x 0x%08x\n",
64 i, buf[0], buf[1], buf[2], buf[3]);
71 device_printf(dev,"0x%08x: 0x%08x\n", i, buf[0]);
74 device_printf(dev,"0x%08x: 0x%08x 0x%08x\n", i, buf[0], buf[1]);
77 device_printf(dev,"0x%08x: 0x%08x 0x%08x 0x%08x\n",
78 i, buf[0], buf[1], buf[2]);
83 device_printf(dev, "%s: %s dump end\n", __func__, msg);
87 * Name: qla_dump_buf16
88 * Function: dumps a buffer as 16 bit words
90 void qla_dump_buf16(qla_host_t *ha, char *msg, void *dbuf16, uint32_t len16)
99 device_printf(dev, "%s: %s dump start\n", __func__, msg);
102 device_printf(dev,"0x%08x: 0x%04x 0x%04x 0x%04x 0x%04x"
103 " 0x%04x 0x%04x 0x%04x 0x%04x\n", i, buf[0],
104 buf[1], buf[2], buf[3], buf[4], buf[5], buf[6], buf[7]);
111 device_printf(dev,"0x%08x: 0x%04x\n", i, buf[0]);
114 device_printf(dev,"0x%08x: 0x%04x 0x%04x\n", i, buf[0], buf[1]);
117 device_printf(dev,"0x%08x: 0x%04x 0x%04x 0x%04x\n",
118 i, buf[0], buf[1], buf[2]);
121 device_printf(dev,"0x%08x: 0x%04x 0x%04x 0x%04x 0x%04x\n", i,
122 buf[0], buf[1], buf[2], buf[3]);
125 device_printf(dev,"0x%08x:"
126 " 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x\n", i,
127 buf[0], buf[1], buf[2], buf[3], buf[4]);
130 device_printf(dev,"0x%08x:"
131 " 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x\n", i,
132 buf[0], buf[1], buf[2], buf[3], buf[4], buf[5]);
135 device_printf(dev,"0x%04x: 0x%04x 0x%04x 0x%04x 0x%04x"
136 " 0x%04x 0x%04x 0x%04x\n", i, buf[0], buf[1],
137 buf[2], buf[3], buf[4], buf[5], buf[6]);
142 device_printf(dev, "%s: %s dump end\n", __func__, msg);
146 * Name: qla_dump_buf8
147 * Function: dumps a buffer as bytes
149 void qla_dump_buf8(qla_host_t *ha, char *msg, void *dbuf, uint32_t len)
158 device_printf(dev, "%s: %s 0x%x dump start\n", __func__, msg, len);
161 device_printf(dev,"0x%08x:"
162 " %02x %02x %02x %02x %02x %02x %02x %02x"
163 " %02x %02x %02x %02x %02x %02x %02x %02x\n", i,
164 buf[0], buf[1], buf[2], buf[3],
165 buf[4], buf[5], buf[6], buf[7],
166 buf[8], buf[9], buf[10], buf[11],
167 buf[12], buf[13], buf[14], buf[15]);
174 device_printf(dev,"0x%08x: %02x\n", i, buf[0]);
177 device_printf(dev,"0x%08x: %02x %02x\n", i, buf[0], buf[1]);
180 device_printf(dev,"0x%08x: %02x %02x %02x\n",
181 i, buf[0], buf[1], buf[2]);
184 device_printf(dev,"0x%08x: %02x %02x %02x %02x\n", i,
185 buf[0], buf[1], buf[2], buf[3]);
188 device_printf(dev,"0x%08x:"
189 " %02x %02x %02x %02x %02x\n", i,
190 buf[0], buf[1], buf[2], buf[3], buf[4]);
193 device_printf(dev,"0x%08x:"
194 " %02x %02x %02x %02x %02x %02x\n", i,
195 buf[0], buf[1], buf[2], buf[3], buf[4], buf[5]);
198 device_printf(dev,"0x%08x:"
199 " %02x %02x %02x %02x %02x %02x %02x\n", i,
200 buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6]);
203 device_printf(dev,"0x%08x:"
204 " %02x %02x %02x %02x %02x %02x %02x %02x\n", i,
205 buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6],
209 device_printf(dev,"0x%08x:"
210 " %02x %02x %02x %02x %02x %02x %02x %02x"
212 buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6],
216 device_printf(dev,"0x%08x:"
217 " %02x %02x %02x %02x %02x %02x %02x %02x"
219 buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6],
220 buf[7], buf[8], buf[9]);
223 device_printf(dev,"0x%08x:"
224 " %02x %02x %02x %02x %02x %02x %02x %02x"
225 " %02x %02x %02x\n", i,
226 buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6],
227 buf[7], buf[8], buf[9], buf[10]);
230 device_printf(dev,"0x%08x:"
231 " %02x %02x %02x %02x %02x %02x %02x %02x"
232 " %02x %02x %02x %02x\n", i,
233 buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6],
234 buf[7], buf[8], buf[9], buf[10], buf[11]);
237 device_printf(dev,"0x%08x:"
238 " %02x %02x %02x %02x %02x %02x %02x %02x"
239 " %02x %02x %02x %02x %02x\n", i,
240 buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6],
241 buf[7], buf[8], buf[9], buf[10], buf[11], buf[12]);
244 device_printf(dev,"0x%08x:"
245 " %02x %02x %02x %02x %02x %02x %02x %02x"
246 " %02x %02x %02x %02x %02x %02x\n", i,
247 buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6],
248 buf[7], buf[8], buf[9], buf[10], buf[11], buf[12],
252 device_printf(dev,"0x%08x:"
253 " %02x %02x %02x %02x %02x %02x %02x %02x"
254 " %02x %02x %02x %02x %02x %02x %02x\n", i,
255 buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6],
256 buf[7], buf[8], buf[9], buf[10], buf[11], buf[12],
263 device_printf(dev, "%s: %s dump end\n", __func__, msg);