blob: 6525a5e62d27eac813514e23178e5e898d976f14 [file] [log] [blame]
James Smart858c9f62007-06-17 19:56:39 -05001/*******************************************************************
2 * This file is part of the Emulex Linux Device Driver for *
3 * Fibre Channel Host Bus Adapters. *
James Smart2a622bf2011-02-16 12:40:06 -05004 * Copyright (C) 2007-2011 Emulex. All rights reserved. *
James Smart858c9f62007-06-17 19:56:39 -05005 * EMULEX and SLI are trademarks of Emulex. *
6 * www.emulex.com *
7 * *
8 * This program is free software; you can redistribute it and/or *
9 * modify it under the terms of version 2 of the GNU General *
10 * Public License as published by the Free Software Foundation. *
11 * This program is distributed in the hope that it will be useful. *
12 * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND *
13 * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, *
14 * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE *
15 * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD *
16 * TO BE LEGALLY INVALID. See the GNU General Public License for *
17 * more details, a copy of which can be found in the file COPYING *
18 * included with this package. *
19 *******************************************************************/
20
21#ifndef _H_LPFC_DEBUG_FS
22#define _H_LPFC_DEBUG_FS
23
James Smart923e4b62008-12-04 22:40:07 -050024#ifdef CONFIG_SCSI_LPFC_DEBUG_FS
James Smart2a622bf2011-02-16 12:40:06 -050025
26/* size of output line, for discovery_trace and slow_ring_trace */
27#define LPFC_DEBUG_TRC_ENTRY_SIZE 100
28
29/* nodelist output buffer size */
30#define LPFC_NODELIST_SIZE 8192
31#define LPFC_NODELIST_ENTRY_SIZE 120
32
33/* dumpHBASlim output buffer size */
34#define LPFC_DUMPHBASLIM_SIZE 4096
35
36/* dumpHostSlim output buffer size */
37#define LPFC_DUMPHOSTSLIM_SIZE 4096
38
39/* hbqinfo output buffer size */
40#define LPFC_HBQINFO_SIZE 8192
41
James Smart86a80842011-04-16 11:03:04 -040042/* pciConf */
43#define LPFC_PCI_CFG_BROWSE 0xffff
44#define LPFC_PCI_CFG_RD_CMD_ARG 2
45#define LPFC_PCI_CFG_WR_CMD_ARG 3
James Smart2a622bf2011-02-16 12:40:06 -050046#define LPFC_PCI_CFG_SIZE 4096
47#define LPFC_PCI_CFG_RD_BUF_SIZE (LPFC_PCI_CFG_SIZE/2)
48#define LPFC_PCI_CFG_RD_SIZE (LPFC_PCI_CFG_SIZE/4)
49
James Smart86a80842011-04-16 11:03:04 -040050/* queue info */
51#define LPFC_QUE_INFO_GET_BUF_SIZE 4096
52
53/* queue acc */
54#define LPFC_QUE_ACC_BROWSE 0xffff
55#define LPFC_QUE_ACC_RD_CMD_ARG 4
56#define LPFC_QUE_ACC_WR_CMD_ARG 6
57#define LPFC_QUE_ACC_BUF_SIZE 4096
58#define LPFC_QUE_ACC_SIZE (LPFC_QUE_ACC_BUF_SIZE/2)
59
60#define LPFC_IDIAG_EQ 1
61#define LPFC_IDIAG_CQ 2
62#define LPFC_IDIAG_MQ 3
63#define LPFC_IDIAG_WQ 4
64#define LPFC_IDIAG_RQ 5
65
66/* doorbell acc */
67#define LPFC_DRB_ACC_ALL 0xffff
68#define LPFC_DRB_ACC_RD_CMD_ARG 1
69#define LPFC_DRB_ACC_WR_CMD_ARG 2
70#define LPFC_DRB_ACC_BUF_SIZE 256
71
72#define LPFC_DRB_EQCQ 1
73#define LPFC_DRB_MQ 2
74#define LPFC_DRB_WQ 3
75#define LPFC_DRB_RQ 4
76
77#define LPFC_DRB_MAX 4
James Smart2a622bf2011-02-16 12:40:06 -050078
79#define SIZE_U8 sizeof(uint8_t)
80#define SIZE_U16 sizeof(uint16_t)
81#define SIZE_U32 sizeof(uint32_t)
82
83struct lpfc_debug {
84 char *i_private;
85 char op;
86#define LPFC_IDIAG_OP_RD 1
87#define LPFC_IDIAG_OP_WR 2
88 char *buffer;
89 int len;
90};
91
James Smarta58cbd52007-08-02 11:09:43 -040092struct lpfc_debugfs_trc {
James Smart858c9f62007-06-17 19:56:39 -050093 char *fmt;
94 uint32_t data1;
95 uint32_t data2;
96 uint32_t data3;
97 uint32_t seq_cnt;
98 unsigned long jif;
99};
James Smart2a622bf2011-02-16 12:40:06 -0500100
101struct lpfc_idiag_offset {
102 uint32_t last_rd;
103};
104
James Smart86a80842011-04-16 11:03:04 -0400105#define LPFC_IDIAG_CMD_DATA_SIZE 8
James Smart2a622bf2011-02-16 12:40:06 -0500106struct lpfc_idiag_cmd {
107 uint32_t opcode;
108#define LPFC_IDIAG_CMD_PCICFG_RD 0x00000001
109#define LPFC_IDIAG_CMD_PCICFG_WR 0x00000002
110#define LPFC_IDIAG_CMD_PCICFG_ST 0x00000003
111#define LPFC_IDIAG_CMD_PCICFG_CL 0x00000004
James Smart86a80842011-04-16 11:03:04 -0400112
113#define LPFC_IDIAG_CMD_QUEACC_RD 0x00000011
114#define LPFC_IDIAG_CMD_QUEACC_WR 0x00000012
115#define LPFC_IDIAG_CMD_QUEACC_ST 0x00000013
116#define LPFC_IDIAG_CMD_QUEACC_CL 0x00000014
117
118#define LPFC_IDIAG_CMD_DRBACC_RD 0x00000021
119#define LPFC_IDIAG_CMD_DRBACC_WR 0x00000022
120#define LPFC_IDIAG_CMD_DRBACC_ST 0x00000023
121#define LPFC_IDIAG_CMD_DRBACC_CL 0x00000024
James Smart2a622bf2011-02-16 12:40:06 -0500122 uint32_t data[LPFC_IDIAG_CMD_DATA_SIZE];
123};
124
125struct lpfc_idiag {
126 uint32_t active;
127 struct lpfc_idiag_cmd cmd;
128 struct lpfc_idiag_offset offset;
James Smart86a80842011-04-16 11:03:04 -0400129 void *ptr_private;
James Smart2a622bf2011-02-16 12:40:06 -0500130};
James Smart858c9f62007-06-17 19:56:39 -0500131#endif
132
133/* Mask for discovery_trace */
134#define LPFC_DISC_TRC_ELS_CMD 0x1 /* Trace ELS commands */
135#define LPFC_DISC_TRC_ELS_RSP 0x2 /* Trace ELS response */
136#define LPFC_DISC_TRC_ELS_UNSOL 0x4 /* Trace ELS rcv'ed */
137#define LPFC_DISC_TRC_ELS_ALL 0x7 /* Trace ELS */
138#define LPFC_DISC_TRC_MBOX_VPORT 0x8 /* Trace vport MBOXs */
139#define LPFC_DISC_TRC_MBOX 0x10 /* Trace other MBOXs */
140#define LPFC_DISC_TRC_MBOX_ALL 0x18 /* Trace all MBOXs */
141#define LPFC_DISC_TRC_CT 0x20 /* Trace disc CT requests */
142#define LPFC_DISC_TRC_DSM 0x40 /* Trace DSM events */
143#define LPFC_DISC_TRC_RPORT 0x80 /* Trace rport events */
144#define LPFC_DISC_TRC_NODE 0x100 /* Trace ndlp state changes */
145
146#define LPFC_DISC_TRC_DISCOVERY 0xef /* common mask for general
147 * discovery */
148#endif /* H_LPFC_DEBUG_FS */