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"
47 uint32_t dbg_level = 0 ;
49 * Name: qla_dump_buf32
50 * Function: dumps a buffer as 32 bit words
52 void qla_dump_buf32(qla_host_t *ha, char *msg, void *dbuf32, uint32_t len32)
61 device_printf(dev, "%s: %s dump start\n", __func__, msg);
64 device_printf(dev,"0x%08x: 0x%08x 0x%08x 0x%08x 0x%08x\n",
65 i, buf[0], buf[1], buf[2], buf[3]);
72 device_printf(dev,"0x%08x: 0x%08x\n", i, buf[0]);
75 device_printf(dev,"0x%08x: 0x%08x 0x%08x\n", i, buf[0], buf[1]);
78 device_printf(dev,"0x%08x: 0x%08x 0x%08x 0x%08x\n",
79 i, buf[0], buf[1], buf[2]);
84 device_printf(dev, "%s: %s dump end\n", __func__, msg);
88 * Name: qla_dump_buf16
89 * Function: dumps a buffer as 16 bit words
91 void qla_dump_buf16(qla_host_t *ha, char *msg, void *dbuf16, uint32_t len16)
100 device_printf(dev, "%s: %s dump start\n", __func__, msg);
103 device_printf(dev,"0x%08x: 0x%04x 0x%04x 0x%04x 0x%04x"
104 " 0x%04x 0x%04x 0x%04x 0x%04x\n", i, buf[0],
105 buf[1], buf[2], buf[3], buf[4], buf[5], buf[6], buf[7]);
112 device_printf(dev,"0x%08x: 0x%04x\n", i, buf[0]);
115 device_printf(dev,"0x%08x: 0x%04x 0x%04x\n", i, buf[0], buf[1]);
118 device_printf(dev,"0x%08x: 0x%04x 0x%04x 0x%04x\n",
119 i, buf[0], buf[1], buf[2]);
122 device_printf(dev,"0x%08x: 0x%04x 0x%04x 0x%04x 0x%04x\n", i,
123 buf[0], buf[1], buf[2], buf[3]);
126 device_printf(dev,"0x%08x:"
127 " 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x\n", i,
128 buf[0], buf[1], buf[2], buf[3], buf[4]);
131 device_printf(dev,"0x%08x:"
132 " 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x\n", i,
133 buf[0], buf[1], buf[2], buf[3], buf[4], buf[5]);
136 device_printf(dev,"0x%04x: 0x%04x 0x%04x 0x%04x 0x%04x"
137 " 0x%04x 0x%04x 0x%04x\n", i, buf[0], buf[1],
138 buf[2], buf[3], buf[4], buf[5], buf[6]);
143 device_printf(dev, "%s: %s dump end\n", __func__, msg);
147 * Name: qla_dump_buf8
148 * Function: dumps a buffer as bytes
150 void qla_dump_buf8(qla_host_t *ha, char *msg, void *dbuf, uint32_t len)
159 device_printf(dev, "%s: %s 0x%x dump start\n", __func__, msg, len);
162 device_printf(dev,"0x%08x:"
163 " %02x %02x %02x %02x %02x %02x %02x %02x"
164 " %02x %02x %02x %02x %02x %02x %02x %02x\n", i,
165 buf[0], buf[1], buf[2], buf[3],
166 buf[4], buf[5], buf[6], buf[7],
167 buf[8], buf[9], buf[10], buf[11],
168 buf[12], buf[13], buf[14], buf[15]);
175 device_printf(dev,"0x%08x: %02x\n", i, buf[0]);
178 device_printf(dev,"0x%08x: %02x %02x\n", i, buf[0], buf[1]);
181 device_printf(dev,"0x%08x: %02x %02x %02x\n",
182 i, buf[0], buf[1], buf[2]);
185 device_printf(dev,"0x%08x: %02x %02x %02x %02x\n", i,
186 buf[0], buf[1], buf[2], buf[3]);
189 device_printf(dev,"0x%08x:"
190 " %02x %02x %02x %02x %02x\n", i,
191 buf[0], buf[1], buf[2], buf[3], buf[4]);
194 device_printf(dev,"0x%08x:"
195 " %02x %02x %02x %02x %02x %02x\n", i,
196 buf[0], buf[1], buf[2], buf[3], buf[4], buf[5]);
199 device_printf(dev,"0x%08x:"
200 " %02x %02x %02x %02x %02x %02x %02x\n", i,
201 buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6]);
204 device_printf(dev,"0x%08x:"
205 " %02x %02x %02x %02x %02x %02x %02x %02x\n", i,
206 buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6],
210 device_printf(dev,"0x%08x:"
211 " %02x %02x %02x %02x %02x %02x %02x %02x"
213 buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6],
217 device_printf(dev,"0x%08x:"
218 " %02x %02x %02x %02x %02x %02x %02x %02x"
220 buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6],
221 buf[7], buf[8], buf[9]);
224 device_printf(dev,"0x%08x:"
225 " %02x %02x %02x %02x %02x %02x %02x %02x"
226 " %02x %02x %02x\n", i,
227 buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6],
228 buf[7], buf[8], buf[9], buf[10]);
231 device_printf(dev,"0x%08x:"
232 " %02x %02x %02x %02x %02x %02x %02x %02x"
233 " %02x %02x %02x %02x\n", i,
234 buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6],
235 buf[7], buf[8], buf[9], buf[10], buf[11]);
238 device_printf(dev,"0x%08x:"
239 " %02x %02x %02x %02x %02x %02x %02x %02x"
240 " %02x %02x %02x %02x %02x\n", i,
241 buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6],
242 buf[7], buf[8], buf[9], buf[10], buf[11], buf[12]);
245 device_printf(dev,"0x%08x:"
246 " %02x %02x %02x %02x %02x %02x %02x %02x"
247 " %02x %02x %02x %02x %02x %02x\n", i,
248 buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6],
249 buf[7], buf[8], buf[9], buf[10], buf[11], buf[12],
253 device_printf(dev,"0x%08x:"
254 " %02x %02x %02x %02x %02x %02x %02x %02x"
255 " %02x %02x %02x %02x %02x %02x %02x\n", i,
256 buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6],
257 buf[7], buf[8], buf[9], buf[10], buf[11], buf[12],
264 device_printf(dev, "%s: %s dump end\n", __func__, msg);