Commit | Line | Data |
---|---|---|
f92363d1 SR |
1 | /* |
2 | * This is the Fusion MPT base driver providing common API layer interface | |
3 | * to set Diagnostic triggers for MPT (Message Passing Technology) based | |
4 | * controllers | |
5 | * | |
6 | * This code is based on drivers/scsi/mpt3sas/mpt3sas_base.h | |
48e3b985 | 7 | * Copyright (C) 2012-2013 LSI Corporation |
f92363d1 SR |
8 | * (mailto:DL-MPTFusionLinux@lsi.com) |
9 | * | |
10 | * This program is free software; you can redistribute it and/or | |
11 | * modify it under the terms of the GNU General Public License | |
12 | * as published by the Free Software Foundation; either version 2 | |
13 | * of the License, or (at your option) any later version. | |
14 | * | |
15 | * This program is distributed in the hope that it will be useful, | |
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | * GNU General Public License for more details. | |
19 | * | |
20 | * NO WARRANTY | |
21 | * THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR | |
22 | * CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT | |
23 | * LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, | |
24 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is | |
25 | * solely responsible for determining the appropriateness of using and | |
26 | * distributing the Program and assumes all risks associated with its | |
27 | * exercise of rights under this Agreement, including but not limited to | |
28 | * the risks and costs of program errors, damage to or loss of data, | |
29 | * programs or equipment, and unavailability or interruption of operations. | |
30 | ||
31 | * DISCLAIMER OF LIABILITY | |
32 | * NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY | |
33 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
34 | * DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND | |
35 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR | |
36 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | |
37 | * USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED | |
38 | * HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES | |
39 | ||
40 | * You should have received a copy of the GNU General Public License | |
41 | * along with this program; if not, write to the Free Software | |
42 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, | |
43 | * USA. | |
44 | */ | |
45 | /* Diagnostic Trigger Configuration Data Structures */ | |
46 | ||
47 | #ifndef MPT3SAS_TRIGGER_DIAG_H_INCLUDED | |
48 | #define MPT3SAS_TRIGGER_DIAG_H_INCLUDED | |
49 | ||
50 | /* limitation on number of entries */ | |
51 | #define NUM_VALID_ENTRIES (20) | |
52 | ||
53 | /* trigger types */ | |
54 | #define MPT3SAS_TRIGGER_MASTER (1) | |
55 | #define MPT3SAS_TRIGGER_EVENT (2) | |
56 | #define MPT3SAS_TRIGGER_SCSI (3) | |
57 | #define MPT3SAS_TRIGGER_MPI (4) | |
58 | ||
59 | /* trigger names */ | |
60 | #define MASTER_TRIGGER_FILE_NAME "diag_trigger_master" | |
61 | #define EVENT_TRIGGERS_FILE_NAME "diag_trigger_event" | |
62 | #define SCSI_TRIGGERS_FILE_NAME "diag_trigger_scsi" | |
63 | #define MPI_TRIGGER_FILE_NAME "diag_trigger_mpi" | |
64 | ||
65 | /* master trigger bitmask */ | |
66 | #define MASTER_TRIGGER_FW_FAULT (0x00000001) | |
67 | #define MASTER_TRIGGER_ADAPTER_RESET (0x00000002) | |
68 | #define MASTER_TRIGGER_TASK_MANAGMENT (0x00000004) | |
69 | #define MASTER_TRIGGER_DEVICE_REMOVAL (0x00000008) | |
70 | ||
71 | /* fake firmware event for tigger */ | |
72 | #define MPI3_EVENT_DIAGNOSTIC_TRIGGER_FIRED (0x6E) | |
73 | ||
74 | /** | |
75 | * MasterTrigger is a single U32 passed to/from sysfs. | |
76 | * | |
77 | * Bit Flags (enables) include: | |
78 | * 1. FW Faults | |
79 | * 2. Adapter Reset issued by driver | |
80 | * 3. TMs | |
81 | * 4. Device Remove Event sent by FW | |
82 | */ | |
83 | ||
84 | struct SL_WH_MASTER_TRIGGER_T { | |
85 | uint32_t MasterData; | |
86 | }; | |
87 | ||
88 | /** | |
89 | * struct SL_WH_EVENT_TRIGGER_T - Definition of an event trigger element | |
90 | * @EventValue: Event Code to trigger on | |
91 | * @LogEntryQualifier: Type of FW event that logged (Log Entry Added Event only) | |
92 | * | |
93 | * Defines an event that should induce a DIAG_TRIGGER driver event if observed. | |
94 | */ | |
95 | struct SL_WH_EVENT_TRIGGER_T { | |
96 | uint16_t EventValue; | |
97 | uint16_t LogEntryQualifier; | |
98 | }; | |
99 | ||
100 | /** | |
101 | * struct SL_WH_EVENT_TRIGGERS_T - Structure passed to/from sysfs containing a | |
102 | * list of Event Triggers to be monitored for. | |
103 | * @ValidEntries: Number of _SL_WH_EVENT_TRIGGER_T structures contained in this | |
104 | * structure. | |
105 | * @EventTriggerEntry: List of Event trigger elements. | |
106 | * | |
107 | * This binary structure is transferred via sysfs to get/set Event Triggers | |
108 | * in the Linux Driver. | |
109 | */ | |
110 | ||
111 | struct SL_WH_EVENT_TRIGGERS_T { | |
112 | uint32_t ValidEntries; | |
113 | struct SL_WH_EVENT_TRIGGER_T EventTriggerEntry[NUM_VALID_ENTRIES]; | |
114 | }; | |
115 | ||
116 | /** | |
117 | * struct SL_WH_SCSI_TRIGGER_T - Definition of a SCSI trigger element | |
118 | * @ASCQ: Additional Sense Code Qualifier. Can be specific or 0xFF for | |
119 | * wildcard. | |
120 | * @ASC: Additional Sense Code. Can be specific or 0xFF for wildcard | |
121 | * @SenseKey: SCSI Sense Key | |
122 | * | |
123 | * Defines a sense key (single or many variants) that should induce a | |
124 | * DIAG_TRIGGER driver event if observed. | |
125 | */ | |
126 | struct SL_WH_SCSI_TRIGGER_T { | |
127 | U8 ASCQ; | |
128 | U8 ASC; | |
129 | U8 SenseKey; | |
130 | U8 Reserved; | |
131 | }; | |
132 | ||
133 | /** | |
134 | * struct SL_WH_SCSI_TRIGGERS_T - Structure passed to/from sysfs containing a | |
135 | * list of SCSI sense codes that should trigger a DIAG_SERVICE event when | |
136 | * observed. | |
137 | * @ValidEntries: Number of _SL_WH_SCSI_TRIGGER_T structures contained in this | |
138 | * structure. | |
139 | * @SCSITriggerEntry: List of SCSI Sense Code trigger elements. | |
140 | * | |
141 | * This binary structure is transferred via sysfs to get/set SCSI Sense Code | |
142 | * Triggers in the Linux Driver. | |
143 | */ | |
144 | struct SL_WH_SCSI_TRIGGERS_T { | |
145 | uint32_t ValidEntries; | |
146 | struct SL_WH_SCSI_TRIGGER_T SCSITriggerEntry[NUM_VALID_ENTRIES]; | |
147 | }; | |
148 | ||
149 | /** | |
150 | * struct SL_WH_MPI_TRIGGER_T - Definition of an MPI trigger element | |
151 | * @IOCStatus: MPI IOCStatus | |
152 | * @IocLogInfo: MPI IocLogInfo. Can be specific or 0xFFFFFFFF for wildcard | |
153 | * | |
154 | * Defines a MPI IOCStatus/IocLogInfo pair that should induce a DIAG_TRIGGER | |
155 | * driver event if observed. | |
156 | */ | |
157 | struct SL_WH_MPI_TRIGGER_T { | |
158 | uint16_t IOCStatus; | |
159 | uint16_t Reserved; | |
160 | uint32_t IocLogInfo; | |
161 | }; | |
162 | ||
163 | /** | |
164 | * struct SL_WH_MPI_TRIGGERS_T - Structure passed to/from sysfs containing a | |
165 | * list of MPI IOCStatus/IocLogInfo pairs that should trigger a DIAG_SERVICE | |
166 | * event when observed. | |
167 | * @ValidEntries: Number of _SL_WH_MPI_TRIGGER_T structures contained in this | |
168 | * structure. | |
169 | * @MPITriggerEntry: List of MPI IOCStatus/IocLogInfo trigger elements. | |
170 | * | |
171 | * This binary structure is transferred via sysfs to get/set MPI Error Triggers | |
172 | * in the Linux Driver. | |
173 | */ | |
174 | struct SL_WH_MPI_TRIGGERS_T { | |
175 | uint32_t ValidEntries; | |
176 | struct SL_WH_MPI_TRIGGER_T MPITriggerEntry[NUM_VALID_ENTRIES]; | |
177 | }; | |
178 | ||
179 | /** | |
180 | * struct SL_WH_TRIGGERS_EVENT_DATA_T - event data for trigger | |
181 | * @trigger_type: trigger type (see MPT3SAS_TRIGGER_XXXX) | |
182 | * @u: trigger condition that caused trigger to be sent | |
183 | */ | |
184 | struct SL_WH_TRIGGERS_EVENT_DATA_T { | |
185 | uint32_t trigger_type; | |
186 | union { | |
187 | struct SL_WH_MASTER_TRIGGER_T master; | |
188 | struct SL_WH_EVENT_TRIGGER_T event; | |
189 | struct SL_WH_SCSI_TRIGGER_T scsi; | |
190 | struct SL_WH_MPI_TRIGGER_T mpi; | |
191 | } u; | |
192 | }; | |
193 | #endif /* MPT3SAS_TRIGGER_DIAG_H_INCLUDED */ |