1
/* Copyright (c) 1996-2004, Adaptec Corporation
4
* Redistribution and use in source and binary forms, with or without
5
* modification, are permitted provided that the following conditions are met:
7
* - Redistributions of source code must retain the above copyright notice, this
8
* list of conditions and the following disclaimer.
9
* - Redistributions in binary form must reproduce the above copyright notice,
10
* this list of conditions and the following disclaimer in the documentation
11
* and/or other materials provided with the distribution.
12
* - Neither the name of the Adaptec Corporation nor the names of its
13
* contributors may be used to endorse or promote products derived from this
14
* software without specific prior written permission.
16
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26
* POSSIBILITY OF SUCH DAMAGE.
30
//***************************************************************************
34
// This file contains the function definitions for the dptHBAlog_C
37
//Author: Doug Anderson
45
//***************************************************************************
48
//Include Files -------------------------------------------------------------
50
#include "hba_log.hpp"
52
//Function - dptHBAlog_C::dptHBAlog_C() - start
53
//===========================================================================
57
// This function is called to initialize the new object.
63
//Global Variables Affected:
65
//Remarks: (Side effects, Assumptions, Warnings...)
68
//---------------------------------------------------------------------------
70
dptHBAlog_C::dptHBAlog_C()
72
param_P = (logParam_S *)(header_P = (logHeader_S *)NULL);
73
validBytes = paramBytes = 0;
76
//dptHBAlog_C::dptHBAlog_C() - end
79
//Function - dptHBAlog_C::reverseParam() - start
80
//===========================================================================
84
// This function is called from reverseAllParams() to provide an
85
//opportunity to reverse the data portion of the log parameters.
91
//Global Variables Affected:
93
//Remarks: (Side effects, Assumptions, Warnings...)
96
//---------------------------------------------------------------------------
98
void dptHBAlog_C::reverseParam()
101
// Reverse the first long word (All parameter codes - usually event time)
103
// Ignore the severity level, reverse parameter specific fields
104
switch (code() & 0x0fff) {
105
case 0x001: ((hl_Header_S *)(param_P->getData()))->scsiSwap();
107
case 0x002: ((hl_Overflow_S *)(param_P->getData()))->scsiSwap();
109
case 0x003: ((hl_SCSIstat_S *)(param_P->getData()))->scsiSwap();
111
case 0x004: ((hl_ReqSense_S *)(param_P->getData()))->scsiSwap();
113
case 0x005: ((hl_HBAerr_S *)(param_P->getData()))->scsiSwap();
115
case 0x006: ((hl_Reassign_S *)(param_P->getData()))->scsiSwap();
117
case 0x007: ((hl_RAMerr_S *)(param_P->getData()))->scsiSwap();
119
case 0x008: ((hl_Time_S *)(param_P->getData()))->scsiSwap();
121
case 0x009: ((hl_ArrayCfg_S *)(param_P->getData()))->scsiSwap();
123
case 0x00b: ((hl_MajorStat_S *)(param_P->getData()))->scsiSwap();
125
case 0x00c: ((hl_DataIC_S *)(param_P->getData()))->scsiSwap();
127
case 0x00d: ((hl_HCrcved_S *)(param_P->getData()))->scsiSwap();
129
case 0x00e: ((hl_SCSIcmd_S *)(param_P->getData()))->scsiSwap();
131
case 0x00f: ((hl_Lock_S *)(param_P->getData()))->scsiSwap();
133
case 0x010: ((hl_decArray_S *)(param_P->getData()))->scsiSwap();
135
case 0x012: ((hl_driveFailure_S *)(param_P->getData()))->scsiSwap();
139
case 0x015: ((hl_voltage_S *)(param_P->getData()))->scsiSwap();
143
case 0x018: ((hl_temperature_S *)(param_P->getData()))->scsiSwap();
145
case 0x01a: ((hl_diagStartStop_S *)(param_P->getData()))->scsiSwap();
147
case 0x01b: ((hl_smartThreshold_S *)(param_P->getData()))->scsiSwap();
149
case 0x01c: ((hl_scheduledDiag_S *)(param_P->getData()))->scsiSwap();
151
case 0x01d: ((hl_debug_S *)(param_P->getData()))->scsiSwap();
153
case 0x01f: ((hl_expandArray_S *)(param_P->getData()))->scsiSwap();
156
case 0x021: ((hl_serverStatus_S *)(param_P->getData()))->scsiSwap();
158
case 0x022: ((hl_formatDone_S *)(param_P->getData()))->scsiSwap();
161
case 0x025: ((SafTe_S *)(param_P->getData()))->scsiSwap();
164
case 0x027: ((Ses_S *)(param_P->getData()))->scsiSwap();
166
case 0x028: ((SesTemp_S *)(param_P->getData()))->scsiSwap();
168
case 0x031: ((ResetDataRetention_S *)(param_P->getData()))->scsiSwap();
173
case 0x041: ((BlockList_S *)(param_P->getData()))->scsiSwap();
175
case 0x042: ((WriteBackFailue_S *)(param_P->getData()))->scsiSwap();
177
case 0x043: ((BatteryEvent_S *)(param_P->getData()))->scsiSwap();
179
case 0x044: ((CacheChangeEvent_S *)(param_P->getData()))->scsiSwap();
181
case 0x045: ((BusReset_S *)(param_P->getData()))->scsiSwap();
183
case 0x046: ((FibreLoop_S *)(param_P->getData()))->scsiSwap();
185
case 0x050: ((BatteryCalibrate_S *)(param_P->getData()))->scsiSwap();
187
case 0x051: ((HdmIspChannel_S *)(param_P->getData()))->scsiSwap();
189
case 0x052: ((SpcDownSpeed_S *)(param_P->getData()))->scsiSwap();
191
case 0x053: ((EnclosureExist_S *)(param_P->getData()))->scsiSwap();
193
default: ((hl_Standard_S *)(param_P->getData()))->scsiSwap();
198
//dptHBAlog_C::reverseParam() - end
201
//Function - dptHBAlog_C::calcInit() - start
202
//===========================================================================
206
// This function Initialize log page specific variables
212
//Global Variables Affected:
214
//Remarks: (Side effects, Assumptions, Warnings...)
216
//---------------------------------------------------------------------------
218
void dptHBAlog_C::calcInit()
224
//dptHBAlog_C::calcInit() - end
227
//Function - dptHBAlog_C::calcInfo() - start
228
//===========================================================================
232
// This function calculates the # of FW event bytes read from the
239
//Global Variables Affected:
241
//Remarks: (Side effects, Assumptions, Warnings...)
243
//---------------------------------------------------------------------------
245
void dptHBAlog_C::calcInfo()
248
if ((code() & 0xf000)!=0xf000)
249
fwEventBytes += 4 + param_P->getLength();
252
//dptHBAlog_C::calcInfo() - end
255
//Function - dptHBAlog_C::curOffsetInit() - start
256
//===========================================================================
260
// This function initializes the current offset.
267
//Global Variables Affected:
269
//Remarks: (Side effects, Assumptions, Warnings...)
271
//---------------------------------------------------------------------------
273
void dptHBAlog_C::curOffsetInit()
279
//dptHBAlog_C::curOffsetInit() - end
282
//Function - dptHBAlog_C::calcCurOffset() - start
283
//===========================================================================
287
// This function calculates the byte offset of the current parameter.
293
//Global Variables Affected:
295
//Remarks: (Side effects, Assumptions, Warnings...)
297
//---------------------------------------------------------------------------
299
void dptHBAlog_C::calcCurOffset()
302
if ((code() & 0xf000)!=0xf000)
303
curEventBytes += 4 + param_P->getLength();
306
//dptHBAlog_C::calcCurOffset() - end