1250963Sachim/*-
2250963Sachim * Copyright (c) 2010 Adaptec, Inc.
3250963Sachim * Copyright (c) 2010-2012 PMC-Sierra, Inc.
4250963Sachim * All rights reserved.
5250963Sachim *
6250963Sachim * Redistribution and use in source and binary forms, with or without
7250963Sachim * modification, are permitted provided that the following conditions
8250963Sachim * are met:
9250963Sachim * 1. Redistributions of source code must retain the above copyright
10250963Sachim *    notice, this list of conditions and the following disclaimer.
11250963Sachim * 2. Redistributions in binary form must reproduce the above copyright
12250963Sachim *    notice, this list of conditions and the following disclaimer in the
13250963Sachim *    documentation and/or other materials provided with the distribution.
14250963Sachim *
15250963Sachim * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16250963Sachim * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17250963Sachim * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18250963Sachim * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19250963Sachim * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20250963Sachim * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21250963Sachim * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22250963Sachim * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23250963Sachim * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24250963Sachim * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25250963Sachim * SUCH DAMAGE.
26250963Sachim *
27250963Sachim *	$FreeBSD: releng/10.3/sys/dev/aacraid/aacraid_debug.h 250963 2013-05-24 09:22:43Z achim $
28250963Sachim */
29250963Sachim
30250963Sachim#ifndef PRINT_BUFFER_SIZE
31250963Sachim
32250963Sachim#define PRINT_BUFFER_SIZE 512
33250963Sachim
34250963Sachim#define HBA_FLAGS_DBG_FLAGS_MASK 	0x0000ffff
35250963Sachim#define HBA_FLAGS_DBG_KERNEL_PRINT_B 	0x00000001
36250963Sachim#define HBA_FLAGS_DBG_FW_PRINT_B 	0x00000002
37250963Sachim#define HBA_FLAGS_DBG_FUNCTION_ENTRY_B 	0x00000004
38250963Sachim#define HBA_FLAGS_DBG_FUNCTION_EXIT_B 	0x00000008
39250963Sachim#define HBA_FLAGS_DBG_ERROR_B 		0x00000010
40250963Sachim#define HBA_FLAGS_DBG_INIT_B 		0x00000020
41250963Sachim#define HBA_FLAGS_DBG_OS_COMMANDS_B 	0x00000040
42250963Sachim#define HBA_FLAGS_DBG_SCAN_B 		0x00000080
43250963Sachim#define HBA_FLAGS_DBG_COALESCE_B 	0x00000100
44250963Sachim#define HBA_FLAGS_DBG_IOCTL_COMMANDS_B 	0x00000200
45250963Sachim#define HBA_FLAGS_DBG_SYNC_COMMANDS_B 	0x00000400
46250963Sachim#define HBA_FLAGS_DBG_COMM_B 		0x00000800
47250963Sachim#define HBA_FLAGS_DBG_CSMI_COMMANDS_B 	0x00001000
48250963Sachim#define HBA_FLAGS_DBG_AIF_B 		0x00001000
49250963Sachim#define HBA_FLAGS_DBG_DEBUG_B 		0x00002000
50250963Sachim
51250963Sachim#define FW_DEBUG_STR_LENGTH_OFFSET 	0x00
52250963Sachim#define FW_DEBUG_FLAGS_OFFSET 		0x04
53250963Sachim#define FW_DEBUG_BLED_OFFSET 		0x08
54250963Sachim#define FW_DEBUG_FLAGS_NO_HEADERS_B 	0x01
55250963Sachim
56250963Sachimstruct aac_softc;
57250963Sachimextern int aacraid_get_fw_debug_buffer(struct aac_softc *);
58250963Sachimextern void aacraid_fw_printf(struct aac_softc *, unsigned long, const char *, ...);
59250963Sachimextern void aacraid_fw_print_mem(struct aac_softc *, unsigned long, u_int8_t *,int);
60250963Sachimextern int aacraid_sync_command(struct aac_softc *sc, u_int32_t command,
61250963Sachim				 u_int32_t arg0, u_int32_t arg1, u_int32_t arg2,
62250963Sachim				 u_int32_t arg3, u_int32_t *sp, u_int32_t *r1);
63250963Sachim
64250963Sachim#endif
65