FreeBSD kernel pms device code
satypes.h
Go to the documentation of this file.
1/*******************************************************************************
2*Copyright (c) 2014 PMC-Sierra, Inc. All rights reserved.
3*
4*Redistribution and use in source and binary forms, with or without modification, are permitted provided
5*that the following conditions are met:
6*1. Redistributions of source code must retain the above copyright notice, this list of conditions and the
7*following disclaimer.
8*2. Redistributions in binary form must reproduce the above copyright notice,
9*this list of conditions and the following disclaimer in the documentation and/or other materials provided
10*with the distribution.
11*
12*THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED
13*WARRANTIES,INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
14*FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
15*FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
16*NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
17*BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
18*LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
19*SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
20*
21* $FreeBSD$
22*
23********************************************************************************/
24/*******************************************************************************/
29/*******************************************************************************/
30
31#ifndef __SATYPES_H__
32
33#define __SATYPES_H__
34
39typedef bit32 (* agsaCallback_t) (agsaRoot_t *agRoot,
40 bit32 Event,
41 void *Parm);
42
48typedef struct agsaTimerDesc_s
49{
55 void * pParm;
57
63typedef struct agsaPort_s
64{
75
81typedef struct agsaPhy_s
82{
90#if defined(SALLSDK_DEBUG)
91 bit8 remoteSignature[8]; /* the remote signature of the phy is the phy is in native SATA mode */
92#endif
94
101{
105
111typedef struct agsaDeviceDesc_s
112{
125
132{
147#ifdef FAST_IO_TEST
148 SALINK fastLink; /* Fast I/O's chain */
149#endif
151
157typedef struct agsaSMPRspFrame_s
158{
162
168typedef struct agsaIOMap_s
169{
174
180typedef struct agsaPortMap_s
181{
186
192typedef struct agsaDeviceMap_s
193{
197
198#ifdef FAST_IO_TEST
199/* interleaved Fast IO's are not allowed */
200#define LL_FAST_IO_SIZE 1
201#endif
202
208typedef struct agsaLLRoot_s
209{
235 bit32 ResetStartTick; /* Reset StartTick */
242 bit32 ChipId; /* Subversion PCI ID */
243
253 agsaQueueConfig_t QueueConfig; /* copy of MPI IBQ/OBQ configuration */
254
267 EnadDisabHandler_t DisableInterrupts; /*Interrupt type dependant function pointer to disable interrupts */
268 EnadDisabHandler_t ReEnableInterrupts; /*Interrupt type dependant reenable */
269 InterruptOurs_t OurInterrupt; /*Interrupt type dependant check for our interrupt */
270
271#ifdef SA_FW_TEST_BUNCH_STARTS
284 bit32 BunchStarts_Enable; // enables/disables whole feature
285 bit32 BunchStarts_Threshold; // global min number of IOs to bunch per queue.
286 bit32 BunchStarts_Pending; // global counter collects all Q->BunchStarts_QPending
287 bit32 BunchStarts_TimeoutTicks; // global time out value beyond which bunched IOs will be started even below BunchStarts_Threshold.
288#endif /* SA_FW_TEST_BUNCH_STARTS */
289
290#ifdef SA_FW_TIMER_READS_STATUS
291 spc_GSTableDescriptor_t mpiGSTable;
292 bit32 MsguTcnt_last;
293 bit32 IopTcnt_last;
294 bit32 Iop1Tcnt_last;
296#endif /* SA_FW_TIMER_READS_STATUS */
297
301
303 //bit32 FatalDone;
305 //bit32 FatalAccumLen;
306 //bit32 NonFatalForensicLastOffset;
307 //bit32 FatalCurrentLength;
311
312#ifdef HIALEAH_ENCRYPTION
313 agsaEncryptGeneralPage_t EncGenPage;
314#endif /* HIALEAH_ENCRYPTION */
315#ifdef SA_ENABLE_TRACE_FUNCTIONS
316 bit8 traceBuffLookup[16];
317
318 bit32 TraceDestination;
319 bit32 TraceMask;
320
321 bit32 TraceBufferLength;
322 bit32 CurrentTraceIndexWrapCount;
323 bit32 CurrentTraceIndex;
324 bit32 traceLineFeedCnt;
325 bit8 *TraceBuffer;
326 bit32 TraceBlockReInit;
327
328#endif /*SA_ENABLE_TRACE_FUNCTIONS*/
329
334
335#ifdef SA_FW_TEST_INTERRUPT_REASSERT
336 bit32 CheckAll;
337 bit32 OldPi[64];
338 bit32 OldCi[64];
339 bit32 OldFlag[64];
340#endif /* SA_FW_TEST_INTERRUPT_REASSERT */
341
342
343#ifdef SALL_API_TEST
344 agsaLLCountInfo_t LLCounters;
345#endif
346#ifdef FAST_IO_TEST
347 void *freeFastReq[LL_FAST_IO_SIZE]; /* saFastRequest_t* */
348 int freeFastIdx;
349#endif
351
352#ifdef FAST_IO_TEST
353/*
354 one struct per all prepared Fast IO's;
355 freed after all IO's are posted to FW and interrupt is triggered;
356 maintained for error rollback or cancel functionality
357*/
358typedef struct saFastRequest_s
359{
360 bit32 beforePI[AGSA_MAX_INBOUND_Q];
361 bit32 inqList[AGSA_MAX_INBOUND_Q];
362 bit32 inqMax;
363 SALINK_LIST requests; /* List of all Fast IORequests */
364 void *agRoot; /* agsaRoot_t * */
365 bit8 valid; /* to avoid usage when the struct is freed */
366} saFastRequest_t;
367#endif
368
369#endif /*__SATYPES_H__ */
unsigned short bit16
Definition: ostypes.h:98
unsigned int bit32
Definition: ostypes.h:99
unsigned char bit8
Definition: ostypes.h:97
void(* ossaDeviceRegistrationCB_t)(agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 status, agsaDevHandle_t *agDevHandle, bit32 deviceID)
Callback definition for .ossaDeviceRegistration.
Definition: sa.h:3469
void(* ossaDeregisterDeviceHandleCB_t)(agsaRoot_t *agRoot, agsaContext_t *agContext, agsaDevHandle_t *agDevHandle, bit32 status)
Callback definition for.
Definition: sa.h:3480
#define AGSA_MAX_VALID_PHYS
Definition: sa.h:817
#define AGSA_MAX_OUTBOUND_Q
Definition: sa.h:828
void(* ossaSSPCompletedCB_t)(agsaRoot_t *agRoot, agsaIORequest_t *agIORequest, bit32 agIOStatus, bit32 agIOInfoLen, void *agParam, bit16 sspTag, bit32 agOtherInfo)
Callback definition for.
Definition: sa.h:3542
#define AGSA_MAX_INBOUND_Q
Definition: sa.h:827
#define MAX_IO_DEVICE_ENTRIES
Definition: sa.h:3791
#define AGSA_MAX_VALID_PORTS
Definition: sadefs.h:37
#define REGISTER_DUMP_BUFF_SIZE
Definition: sadefs.h:44
#define MAX_ACTIVE_IO_REQUESTS
Definition: sadefs.h:41
#define MAX_NUM_VECTOR
Definition: sadefs.h:43
struct agsaPortMap_s agsaPortMap_t
the agsaPortMap_t
struct agsaPhy_s agsaPhy_t
the phy
union agsaSASSATADevInfo_s agsaSASSATADevInfo_t
the LL defined SAS/SATA device information
struct agsaLLRoot_s agsaLLRoot_t
the LLRoot
bit32(* agsaCallback_t)(agsaRoot_t *agRoot, bit32 Event, void *Parm)
the callback function of an timer
Definition: satypes.h:39
struct agsaIORequestDesc_s agsaIORequestDesc_t
the LL defined IO request descriptor
struct agsaIOMap_s agsaIOMap_t
the agsaIOMap_t
struct agsaDeviceMap_s agsaDeviceMap_t
the agsaDeviceMap_t
struct agsaSMPRspFrame_s agsaSMPRspFrame_t
the LL defined SMP Response Frame header and payload
struct agsaDeviceDesc_s agsaDeviceDesc_t
the LL defined device descriptor
struct agsaPort_s agsaPort_t
the port
struct agsaTimerDesc_s agsaTimerDesc_t
the data structure of a timer
bit32(* InterruptOurs_t)(agsaRoot_t *agRoot, bit32 interruptVectorIndex)
Definition: spcdefs.h:549
void(* EnadDisabHandler_t)(agsaRoot_t *agRoot, bit32 interruptVectorIndex)
Definition: spcdefs.h:544
describe an element of SPC-SPCV converter
Definition: sa.h:3619
data structure stores OS specific and LL specific context
Definition: sa.h:1658
describe a information for a Controller in the SAS/SATA hardware
Definition: sa.h:2045
the LL defined device descriptor
Definition: satypes.h:112
bit8 reserved[3]
Definition: satypes.h:119
agsaDevHandle_t targetDevHandle
Definition: satypes.h:115
agsaDevHandle_t initiatorDevHandle
Definition: satypes.h:114
SALINK linkNode
Definition: satypes.h:113
agsaPort_t * pPort
Definition: satypes.h:117
bit32 DeviceMapIndex
Definition: satypes.h:123
agsaSASSATADevInfo_t devInfo
Definition: satypes.h:122
SALINK_LIST pendingIORequests
Definition: satypes.h:116
the agsaDeviceMap_t
Definition: satypes.h:193
void * DeviceHandle
Definition: satypes.h:195
bit32 DeviceIdFromFW
Definition: satypes.h:194
structure describe hardware configuration
Definition: sa.h:2301
the agsaIOMap_t
Definition: satypes.h:169
agsaIORequestDesc_t * IORequest
Definition: satypes.h:171
bit32 Tag
Definition: satypes.h:170
agsaContext_t * agContext
Definition: satypes.h:172
the LL defined IO request descriptor
Definition: satypes.h:132
agsaPort_t * pPort
Definition: satypes.h:136
agsaIORequest_t * pIORequestContext
Definition: satypes.h:134
ossaSSPCompletedCB_t completionCB
Definition: satypes.h:137
bit8 DeviceInfoCmdOption
Definition: satypes.h:146
agsaDeviceDesc_t * pDevice
Definition: satypes.h:135
the LLRoot
Definition: satypes.h:209
agsaDeviceMap_t DeviceMap[MAX_IO_DEVICE_ENTRIES]
Definition: satypes.h:245
bit32 usecsPerTick
Definition: satypes.h:232
bit8 portCount
Definition: satypes.h:228
bit32 interruptVecIndexBitMap1[MAX_NUM_VECTOR]
Definition: satypes.h:239
agsaMem_t IORequestMem
Definition: satypes.h:213
SALINK_LIST freeIORequests
Definition: satypes.h:214
bit32 ResetStartTick
Definition: satypes.h:235
SALINK_LIST freeTimers
Definition: satypes.h:218
agsaMem_t deviceLinkMem
Definition: satypes.h:210
EnadDisabHandler_t ReEnableInterrupts
Definition: satypes.h:268
bit32 autoDeregDeviceflag[AGSA_MAX_VALID_PORTS]
Definition: satypes.h:333
bit32 ForensicLastOffset
Definition: satypes.h:304
SALINK_LIST freeReservedRequests
Definition: satypes.h:215
bit32 registerDump1[REGISTER_DUMP_BUFF_SIZE/4]
Definition: satypes.h:331
agsaPhy_t phys[AGSA_MAX_VALID_PHYS]
Definition: satypes.h:221
bit32 FatalForensicShiftOffset
Definition: satypes.h:309
agsaIOMap_t IOMap[MAX_ACTIVE_IO_REQUESTS]
Definition: satypes.h:246
bit32 ChipId
Definition: satypes.h:242
agsaIOErrorEventStats_t IoErrorCount
Definition: satypes.h:299
bit32 registerDump0[REGISTER_DUMP_BUFF_SIZE/4]
Definition: satypes.h:330
bit8 phyCount
Definition: satypes.h:227
ossaDeviceRegistrationCB_t DeviceRegistrationCB
Definition: satypes.h:261
bit32 FatalForensicStep
Definition: satypes.h:308
bit32 numInterruptVectors
Definition: satypes.h:264
bit32 timeTick
Definition: satypes.h:234
mpiHostLLConfigDescriptor_t mainConfigTable
Definition: satypes.h:259
SALINK_LIST freeDevicesList
Definition: satypes.h:211
agsaMem_t timerLinkMem
Definition: satypes.h:217
bit32 Use64bit
Definition: satypes.h:265
agsaMemoryRequirement_t memoryAllocated
Definition: satypes.h:250
SALINK_LIST validPorts
Definition: satypes.h:225
SALINK_LIST validTimers
Definition: satypes.h:219
bit8 sysIntsActive
Definition: satypes.h:229
agsaBarOffset_t SpcBarOffset[60]
Definition: satypes.h:241
EnadDisabHandler_t DisableInterrupts
Definition: satypes.h:267
ossaDeregisterDeviceHandleCB_t DeviceDeregistrationCB
Definition: satypes.h:262
agsaSwConfig_t swConfig
Definition: satypes.h:252
bit32 interruptVecIndexBitMap[MAX_NUM_VECTOR]
Definition: satypes.h:238
bit32 FatalBarLoc
Definition: satypes.h:310
agsaControllerInfo_t ControllerInfo
Definition: satypes.h:298
agsaHwConfig_t hwConfig
Definition: satypes.h:251
agsaDevHandle_t * DeviceHandle[MAX_IO_DEVICE_ENTRIES]
Definition: satypes.h:247
bit8 reserved
Definition: satypes.h:230
bit32 chipStatus
Definition: satypes.h:236
bit32 ResetFailed
Definition: satypes.h:302
SALINK_LIST freePorts
Definition: satypes.h:224
agsaIOErrorEventStats_t IoEventCount
Definition: satypes.h:300
bit32 minStallusecs
Definition: satypes.h:233
mpiMemReq_t mpiMemoryAllocated
Definition: satypes.h:256
agsaPortMap_t PortMap[AGSA_MAX_VALID_PORTS]
Definition: satypes.h:244
agsaDevHandle_t * pDeviceHandle
Definition: satypes.h:248
InterruptOurs_t OurInterrupt
Definition: satypes.h:269
mpiConfig_t mpiConfig
Definition: satypes.h:255
agsaPort_t ports[AGSA_MAX_VALID_PORTS]
Definition: satypes.h:223
mpiOCQueue_t outboundQueue[AGSA_MAX_OUTBOUND_Q]
Definition: satypes.h:258
mpiICQueue_t inboundQueue[AGSA_MAX_INBOUND_Q]
Definition: satypes.h:257
agsaQueueConfig_t QueueConfig
Definition: satypes.h:253
generic memory descriptor
Definition: sa.h:2464
specify the memory allocation requirement for the SAS/SATA LL Layer
Definition: sa.h:2534
the phy
Definition: satypes.h:82
agsaSASIdentify_t sasIdentify
Definition: satypes.h:84
bit8 phyId
Definition: satypes.h:87
agsaContext_t * agContext
Definition: satypes.h:85
bit8 reserved[2]
Definition: satypes.h:89
agsaPort_t * pPort
Definition: satypes.h:83
bit32 status
Definition: satypes.h:86
bit8 linkstatus
Definition: satypes.h:88
the agsaPortMap_t
Definition: satypes.h:181
bit32 PortStatus
Definition: satypes.h:183
bit32 PortID
Definition: satypes.h:182
void * PortContext
Definition: satypes.h:184
the port
Definition: satypes.h:64
bit32 status
Definition: satypes.h:69
SALINK_LIST listSASATADevices
Definition: satypes.h:67
bit8 portIdx
Definition: satypes.h:72
bit32 phyMap[AGSA_MAX_VALID_PHYS]
Definition: satypes.h:68
bit32 tobedeleted
Definition: satypes.h:70
agsaPortContext_t portContext
Definition: satypes.h:66
bit8 reserved[3]
Definition: satypes.h:73
bit32 portId
Definition: satypes.h:71
SALINK linkNode
Definition: satypes.h:65
data structure provides some information about a SAS device
Definition: sa.h:2682
describe SAS IDENTIFY address frame
Definition: sa_spec.h:448
data structure provides some information about a SATA device
Definition: sa.h:2649
data structure describes the first four bytes of the SMP frame.
Definition: sa_spec.h:921
the LL defined SMP Response Frame header and payload
Definition: satypes.h:158
bit8 smpPayload[1020]
Definition: satypes.h:160
agsaSMPFrameHeader_t smpHeader
Definition: satypes.h:159
structure describe software configuration
Definition: sa.h:2319
the data structure of a timer
Definition: satypes.h:49
bit32 Event
Definition: satypes.h:54
SALINK linkNode
Definition: satypes.h:50
bit32 timeoutTick
Definition: satypes.h:52
agsaCallback_t pfnTimeout
Definition: satypes.h:53
void * pParm
Definition: satypes.h:55
bit32 valid
Definition: satypes.h:51
MPI layer configuration parameters.
Definition: mpi.h:413
Circular Queue descriptor.
Definition: mpi.h:178
Describes MPI memory requirements.
Definition: mpi.h:136
This structure is used for SPC MPI General Status Table.
Definition: spcdefs.h:387
the LL defined SAS/SATA device information
Definition: satypes.h:101
agsaSATADeviceInfo_t sataDeviceInfo
Definition: satypes.h:103
agsaSASDeviceInfo_t sasDeviceInfo
Definition: satypes.h:102