1316485Sdavidcs/*
2316485Sdavidcs * Copyright (c) 2017-2018 Cavium, Inc.
3316485Sdavidcs * All rights reserved.
4316485Sdavidcs *
5316485Sdavidcs *  Redistribution and use in source and binary forms, with or without
6316485Sdavidcs *  modification, are permitted provided that the following conditions
7316485Sdavidcs *  are met:
8316485Sdavidcs *
9316485Sdavidcs *  1. Redistributions of source code must retain the above copyright
10316485Sdavidcs *     notice, this list of conditions and the following disclaimer.
11316485Sdavidcs *  2. Redistributions in binary form must reproduce the above copyright
12316485Sdavidcs *     notice, this list of conditions and the following disclaimer in the
13316485Sdavidcs *     documentation and/or other materials provided with the distribution.
14316485Sdavidcs *
15316485Sdavidcs *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16316485Sdavidcs *  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17316485Sdavidcs *  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18316485Sdavidcs *  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19316485Sdavidcs *  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20316485Sdavidcs *  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21316485Sdavidcs *  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22316485Sdavidcs *  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23316485Sdavidcs *  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24316485Sdavidcs *  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25316485Sdavidcs *  POSSIBILITY OF SUCH DAMAGE.
26316485Sdavidcs *
27316485Sdavidcs * $FreeBSD: stable/11/sys/dev/qlnx/qlnxe/mfw_hsi.h 320164 2017-06-20 19:16:06Z davidcs $
28316485Sdavidcs *
29316485Sdavidcs */
30316485Sdavidcs
31316485Sdavidcs/****************************************************************************
32316485Sdavidcs *
33316485Sdavidcs * Name:        mfw_hsi.h
34316485Sdavidcs *
35316485Sdavidcs * Description: Global definitions
36316485Sdavidcs *
37316485Sdavidcs ****************************************************************************/
38316485Sdavidcs
39316485Sdavidcs#ifndef MFW_HSI_H
40316485Sdavidcs#define MFW_HSI_H
41316485Sdavidcs
42316485Sdavidcs#define MFW_TRACE_SIGNATURE	0x25071946
43316485Sdavidcs
44316485Sdavidcs/* The trace in the buffer */
45316485Sdavidcs#define MFW_TRACE_EVENTID_MASK		0x00ffff
46316485Sdavidcs#define MFW_TRACE_PRM_SIZE_MASK		0x0f0000
47316485Sdavidcs#define MFW_TRACE_PRM_SIZE_SHIFT	16
48316485Sdavidcs#define MFW_TRACE_ENTRY_SIZE		3
49316485Sdavidcs
50316485Sdavidcsstruct mcp_trace {
51316485Sdavidcs	u32	signature;	/* Help to identify that the trace is valid */
52316485Sdavidcs	u32	size;		/* the size of the trace buffer in bytes*/
53316485Sdavidcs	u32	curr_level;	/* 2 - all will be written to the buffer
54316485Sdavidcs				 * 1 - debug trace will not be written
55316485Sdavidcs				 * 0 - just errors will be written to the buffer
56316485Sdavidcs				 */
57316485Sdavidcs	u32	modules_mask[2];/* a bit per module, 1 means write it, 0 means mask it */
58316485Sdavidcs
59316485Sdavidcs	/* Warning: the following pointers are assumed to be 32bits as they are used only in the MFW */
60316485Sdavidcs	u32	trace_prod;	/* The next trace will be written to this offset */
61316485Sdavidcs	u32	trace_oldest;	/* The oldest valid trace starts at this offset (usually very close after the current producer) */
62316485Sdavidcs};
63316485Sdavidcs
64316485Sdavidcs#endif /* MFW_HSI_H */
65316485Sdavidcs
66316485Sdavidcs
67