FreeBSD kernel pms device code
tdsatypes.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/*******************************************************************************/
32#ifndef __TDSATYPES_H
33#define __TDSATYPES_H
34
35#define ESGL_PAGES_SIZE sizeof(agsaEsgl_t)
36#define NUM_ESGL_PAGES 0 /* old value 512 */
40#define TD_DEFAULT_DEVICE 0
41#define TD_SAS_DEVICE 1
42#define TD_SATA_DEVICE 2
43
45
46
52typedef struct itdstHost_s
53{
54 int i;
56
62typedef struct ttdstDevice_s
63{
64 int i;
66
67#ifdef INITIATOR_DRIVER
68typedef struct itdsaIni_s {
70 struct tdsaContext_s *tdsaAllShared;
71 itdssOperatingOption_t OperatingOption;
72 tdSCSIStatusCount_t ScsiStatusCounts;
73 tdSenseKeyCount_t SenseKeyCounter;
74 bit32 NumIOsActive;
75 /* the list of initiator timer; upon expiration timer CB fn is called
76 eg) itdProcessTimers()
77 */
79} itdsaIni_t;
80#endif
81
82struct ttdsaXchgAllocFreeInfoList_s;
83
84#ifdef TARGET_DRIVER
85typedef struct ttdsaTgt_s {
86 /* point to the shared across SAS and SATA */
87 struct tdsaContext_s *tdsaAllShared;
88 ttdssOperatingOption_t OperatingOption;
89 tiTargetOption_t tiOperatingOption;
90 ttdsaXchgData_t ttdsaXchgData;
91#ifdef PASSTHROUGH
92 /* registered passthrough CB */
93 ostiProcessPassthroughCmnd_t PasthroughCB;
94#endif
95} ttdsaTgt_t;
96#endif
97
98
104typedef struct tdHardwareInfo_s {
111
112
123typedef struct tdsaEsglPageInfo_s {
131
137typedef struct tdsaEsglPagePool_s {
140
141
149typedef struct tdsaEsglAllInfo_s {
150 /*
151 used in tdGetEsglPages()
152 */
153 tdList_t mainlist; /* not used */
160 void *virtPtr;
163
165{
166 bit8 exp_sas_addr[8]; //Storing the 16 digit expander SAS-address
167 bit32 smp_req_len; //Length of the request frame
168 bit32 smp_resp_len; //Length of the response frame
169 bit8 smp_req_resp[1]; //Pointer to the request-response frame
171
172#ifdef TD_INT_COALESCE
173typedef struct tdsaIntCoalesceContext_s {
174 tdList_t MainLink; /* free */
175 tdList_t FreeLink; /* in use */
176 struct tdsaContext_s *tdsaAllShared;
177#ifdef OS_INT_COALESCE
178 tiIntCoalesceContext_t *tiIntCoalesceCxt;
179#endif
180 agsaIntCoalesceContext_t agIntCoalCxt;
181 /* for debug */
182 bit32 id;
183
184} tdsaIntCoalesceContext_t;
185#endif
186
187typedef struct tdsaHwEventSource_s {
191
199typedef struct tdsaContext_s {
201
203 struct tdsaRootOsData_s agRootOsDataForInt; /* for interrupt */
204 struct tdsaRootOsData_s agRootOsDataForNonInt; /* for non-interrupt */
205
206 agsaRoot_t agRootInt; /* for interrupt */
207 agsaRoot_t agRootNonInt; /* for non-interrupt */
208
209 /* flags values commonly used for both SAS and SATA */
211
212
215
218
221
222
225
226 /* information of ESGL pages allocated
227 tdsaEsglAllInfo_t EsglAllInfo;
228 */
229
230 /* hardware information; just place holder
231 tdHardwareInfo_t hwInfo;
232 */
233
235
238 /***********************************************************************/
239 /* used to be in tdssContext_t tdssSASShared;*/
240 struct itdsaIni_s *itdsaIni; /* Initiator; */
241 struct ttdsaTgt_s *ttdsaTgt; /* Target */
246
251
256 /***********************************************************************/
259#ifdef SPC_ENABLE_PROFILE
260 tdFWProfileEx_t tdFWProfileEx;
261#endif
262#ifdef TD_INT_COALESCE
263 tdsaIntCoalesceContext_t *IntCoalesce;
264#endif
265
266 /* first time a card is processed set this true */
268
269 /* expander list */
271 // tdList_t discoveringExpanderList;
287 /* instance number */
290#ifdef VPD_TESTING
291 /* temp; for testing VPD indirect */
292 bit32 addrUpper;
293 bit32 addrLower;
294#endif
295
298 bit32 portTMO; /* in 100ms */
299 bit32 phyCalibration; /* enables or disables phy calibration */
300 bit32 FCA; /* force to clear affiliation by sending SMP HARD RESET */
301 bit32 SMPQNum; /* first high priority queue number for SMP */
302 bit32 ResetInDiscovery; /* hard/link reset in discovery */
304 bit32 IDRetry; /* SATA ID failurs are retired */
305 bit32 RateAdjust; /* allow retry open with lower connection rate */
306#ifdef AGTIAPI_CTL
307 bit16 SASConnectTimeLimit; /* used by tdsaCTLSet() */
308#endif
309 bit32 MaxNumOSLocks; /* max number of OS layer locks */
310 bit32 MaxNumLLLocks; /* max num of LL locks */
311 bit32 MaxNumLocks; /* max num of locks for layers and modules (LL, TDM, SATM, DM) */
312#ifdef FDS_DM
313 bit32 MaxNumDMLocks; /* max num of DM locks */
314 dmRoot_t dmRoot; /* discovery root */
315 dmSwConfig_t dmSwConfig;
316#endif
317#ifdef FDS_SM
318 bit32 MaxNumSMLocks; /* max num of SM locks */
319 smRoot_t smRoot; /* SATM root */
320 smSwConfig_t smSwConfig;
321#endif
322 bit32 MCN; /* temp; only for testing and to be set by registry or adj file */
323 bit32 sflag; /* Sflag bit */
324#ifdef CCFLAGS_PHYCONTROL_COUNTS
326#endif /* CCFLAGS_PHYCONTROL_COUNTS */
327 bit32 stp_idle_time; /* stp idle time for agsaSASProtocolTimerConfigurationPage_t; set by registry or adj file */
328 bit32 STP_MCT_TMO; /* for agsaSASProtocolTimerConfigurationPage_t; set by registry or adj file */
329 bit32 SSP_MCT_TMO; /* for agsaSASProtocolTimerConfigurationPage_t; set by registry or adj file */
330 bit32 MAX_OPEN_TIME; /* for agsaSASProtocolTimerConfigurationPage_t; set by registry or adj file */
331 bit32 SMP_MAX_CONN_TIMER; /* for agsaSASProtocolTimerConfigurationPage_t; set by registry or adj file */
332 bit32 STP_FRM_TMO; /* for agsaSASProtocolTimerConfigurationPage_t; set by registry or adj file */
333 bit32 MFD; /* for agsaSASProtocolTimerConfigurationPage_t; set by registry or adj file */
334 bit32 OPNRJT_RTRY_INTVL; /* for agsaSASProtocolTimerConfigurationPage_t; set by registry or adj file */
335 bit32 DOPNRJT_RTRY_TMO; /* for agsaSASProtocolTimerConfigurationPage_t; set by registry or adj file */
336 bit32 COPNRJT_RTRY_TMO; /* for agsaSASProtocolTimerConfigurationPage_t; set by registry or adj file */
337 bit32 DOPNRJT_RTRY_THR; /* for agsaSASProtocolTimerConfigurationPage_t; set by registry or adj file */
338 bit32 COPNRJT_RTRY_THR; /* for agsaSASProtocolTimerConfigurationPage_t; set by registry or adj file */
339 bit32 itNexusTimeout; /* set by registry */
340 bit32 MAX_AIP; /* for agsaSASProtocolTimerConfigurationPage_t; set by registry or adj file */
342#ifdef TI_GETFOR_ONRESET
343 bit8 FatalErrorData[(5 * (1024 * 1024))];
344#endif /* TI_GETFOR_ONRESET */
345 bit32 sgpioResponseSet; /*Used to sync between SGPIO Req and Resp */
348
349#ifdef FAST_IO_TEST
350#define CMDS_PER_IO_IOPS 1
351#define CMDS_PER_IO_DUP 1 //4
352#endif
353
361typedef struct tdsaRoot_s
362{
366#ifdef INITIATOR_DRIVER
367 itdsaIni_t *itdsaIni;
368#endif
369#ifdef TARGET_DRIVER
370 ttdsaTgt_t *ttdsaTgt;
371#endif
373
375{
380
381/* Context Field accessors */
382#define TD_GET_TIROOT(sa_root) (((tdsaRootOsData_t *)(sa_root)->osData)->tiRoot)
383#define TD_GET_TDROOT(ti_root) ((tdsaRoot_t *)(ti_root)->tdData)
384#define TD_GET_TICONTEXT(ti_root) ((tdsaContext_t *)&TD_GET_TDROOT(ti_root)->tdsaAllShared)
385#define TD_GET_TIINI_CONTEXT(ti_root) ((itdsaIni_t *)TD_GET_TICONTEXT(ti_root)->itdsaIni)
386#define TD_GET_TITGT_CONTEXT(ti_root) ((ttdsaTgt_t *)TD_GET_TICONTEXT(ti_root)->ttdsaTgt)
387#endif /* __TDSATYPES_H */
unsigned short bit16
Definition: ostypes.h:98
unsigned int bit32
Definition: ostypes.h:99
unsigned char bit8
Definition: ostypes.h:97
#define AGSA_MAX_OUTBOUND_Q
Definition: sa.h:828
#define AGSA_MAX_INBOUND_Q
Definition: sa.h:827
data structure stores OS specific and LL specific context
Definition: sa.h:1658
data structure is used to pass information about the extended scatter-gather list (ESGL) to the LL La...
Definition: sa.h:2777
describe a information for a Event in the SAS/SATA hardware
Definition: sa.h:2033
structure describe hardware configuration
Definition: sa.h:2301
data structure for set fields in MPI table. The agsaMPIContext_t data structure is used to set fields...
Definition: sa.h:3433
describe a Phy Analog Setup registers for a Controller in the SAS/SATA hardware
Definition: sa.h:1750
structure describe software configuration
Definition: sa.h:2319
Definition: dm.h:91
data structure for the options of SAS initiator
Definition: itdtypes.h:48
data structure for SATA Host
Definition: tdsatypes.h:53
data structure for SATA Device
Definition: tdsatypes.h:104
bit32 PciFunctionNumber
Definition: tdsatypes.h:108
bit32 FlashRomPresent
Definition: tdsatypes.h:109
data structure for both SAS/SATA related flags Some fields are just place holders and not used yet
Definition: tdtypes.h:188
data structure for SAS/SATA context at TD layer
Definition: tdsatypes.h:199
bit32 phyCalibration
Definition: tdsatypes.h:299
bit32 DOPNRJT_RTRY_THR
Definition: tdsatypes.h:337
agsaRoot_t agRootNonInt
Definition: tdsatypes.h:207
agsaHwConfig_t HwConfig
Definition: tdsatypes.h:220
agsaQueueConfig_t QueueConfig
Definition: tdsatypes.h:217
bit32 portTMO
Definition: tdsatypes.h:298
bit8 CardIDString[TD_CARD_ID_LEN]
Definition: tdsatypes.h:288
bit32 InboundQueuePriority[AGSA_MAX_INBOUND_Q]
Definition: tdsatypes.h:283
volatile NvmdResponseSet
Definition: tdsatypes.h:346
bit32 QueueOption
Definition: tdsatypes.h:284
tdList_t MainPortContextList
Definition: tdsatypes.h:248
tdsaJumpTable_t tdJumpTable
Definition: tdsatypes.h:253
tdsaDeviceData_t * DeviceMem
Definition: tdsatypes.h:245
struct tdsaRootOsData_s agRootOsDataForNonInt
Definition: tdsatypes.h:204
bit32 ResetInDiscovery
Definition: tdsatypes.h:302
tdsaExpander_t * ExpanderHead
Definition: tdsatypes.h:270
bit32 DOPNRJT_RTRY_TMO
Definition: tdsatypes.h:335
bit32 InboundQueueEleSize[AGSA_MAX_OUTBOUND_Q]
Definition: tdsatypes.h:277
agsaRoot_t agRootInt
Definition: tdsatypes.h:206
bit32 InboundQueueSize[AGSA_MAX_OUTBOUND_Q]
Definition: tdsatypes.h:276
bit32 tdSubVendorId
Definition: tdsatypes.h:286
bit32 CardID
Definition: tdsatypes.h:289
bit32 STP_FRM_TMO
Definition: tdsatypes.h:332
bit32 sgpioResponseSet
Definition: tdsatypes.h:345
tdList_t FreePortContextList
Definition: tdsatypes.h:247
bit32 OutboundQueueInterruptCount[AGSA_MAX_OUTBOUND_Q]
Definition: tdsatypes.h:281
tiLoLevelResource_t loResource
Definition: tdsatypes.h:224
bit32 itNexusTimeout
Definition: tdsatypes.h:339
bit32 OutboundQueueInterruptEnable[AGSA_MAX_OUTBOUND_Q]
Definition: tdsatypes.h:282
bit32 tdDeviceIdVendId
Definition: tdsatypes.h:285
struct tdsaRootOsData_s agRootOsDataForInt
Definition: tdsatypes.h:203
bit32 first_process
Definition: tdsatypes.h:267
tdFWControlEx_t tdFWControlEx
Definition: tdsatypes.h:258
bit32 OPNRJT_RTRY_INTVL
Definition: tdsatypes.h:334
bit32 SMPQNum
Definition: tdsatypes.h:301
bit32 IDRetry
Definition: tdsatypes.h:304
bit32 RateAdjust
Definition: tdsatypes.h:305
bit32 resetCount
Definition: tdsatypes.h:296
tdsaHwEventSource_t eventSource[TD_MAX_NUM_PHYS]
Definition: tdsatypes.h:297
bit32 MAX_OPEN_TIME
Definition: tdsatypes.h:330
bit32 currentInterruptDelay
Definition: tdsatypes.h:234
tdList_t MainDeviceList
Definition: tdsatypes.h:250
tdList_t FreeDeviceList
Definition: tdsatypes.h:249
bit32 IBQnumber
Definition: tdsatypes.h:274
agsaSwConfig_t SwConfig
Definition: tdsatypes.h:214
bit32 MaxNumLLLocks
Definition: tdsatypes.h:310
bit32 MaxNumLocks
Definition: tdsatypes.h:311
tdsaPortStartInfo_t Ports[TD_MAX_NUM_PHYS]
Definition: tdsatypes.h:255
bit32 stp_idle_time
Definition: tdsatypes.h:327
bit32 OutboundQueueInterruptDelay[AGSA_MAX_OUTBOUND_Q]
Definition: tdsatypes.h:280
bit32 COPNRJT_RTRY_THR
Definition: tdsatypes.h:338
bit32 FWMaxPorts
Definition: tdsatypes.h:303
struct tdsaComMemFlags_s flags
Definition: tdsatypes.h:210
agsaMPIContext_t MpiOverride
Definition: tdsatypes.h:341
struct itdsaIni_s * itdsaIni
Definition: tdsatypes.h:240
bit32 MaxNumOSLocks
Definition: tdsatypes.h:309
bit32 currentOperation
Definition: tdsatypes.h:200
bit32 SSP_MCT_TMO
Definition: tdsatypes.h:329
bit32 OutboundQueueSize[AGSA_MAX_OUTBOUND_Q]
Definition: tdsatypes.h:278
struct ttdsaTgt_s * ttdsaTgt
Definition: tdsatypes.h:241
bit32 MAX_AIP
Definition: tdsatypes.h:340
bit32 OutboundQueueEleSize[AGSA_MAX_OUTBOUND_Q]
Definition: tdsatypes.h:279
bit32 COPNRJT_RTRY_TMO
Definition: tdsatypes.h:336
bit32 phyCount
Definition: tdsatypes.h:273
tdList_t freeExpanderList
Definition: tdsatypes.h:272
tdsaPortContext_t * PortContextMem
Definition: tdsatypes.h:243
bit32 SMP_MAX_CONN_TIMER
Definition: tdsatypes.h:331
tdList_t timerlist
Definition: tdsatypes.h:237
bit32 STP_MCT_TMO
Definition: tdsatypes.h:328
bit32 OBQnumber
Definition: tdsatypes.h:275
data structure for SAS device list This structure maintains the device as a list and information abou...
Definition: tdtypes.h:322
data structure for ESGL pool information
Definition: tdsatypes.h:149
tdList_t freelist
Definition: tdsatypes.h:154
tdsaEsglPagePool_t * EsglPagePool
Definition: tdsatypes.h:161
bit32 NumFreeEsglPages
Definition: tdsatypes.h:156
tdList_t mainlist
Definition: tdsatypes.h:153
data structure for ESLG page
Definition: tdsatypes.h:123
bit32 physAddressUpper
Definition: tdsatypes.h:125
agsaEsgl_t * agEsgl
Definition: tdsatypes.h:128
bit32 physAddressLower
Definition: tdsatypes.h:126
data structure for ESLG page pool
Definition: tdsatypes.h:137
tdsaEsglPageInfo_t EsglPages[1]
Definition: tdsatypes.h:138
agsaEventSource_t Source
Definition: tdsatypes.h:189
data structure for callback function jumptableESLG page
Definition: tdtypes.h:102
data structure for TD port context This structure maintains information about the port such as ID add...
Definition: tdtypes.h:412
data structure for TD port information This structure contains information in order to start the port...
Definition: tdtypes.h:477
data structure OS root from the view of lower layer. TD Layer interrupt/non-interrupt context support...
Definition: tdtypes.h:151
the root data structure for TD layer
Definition: tdsatypes.h:362
tdsaContext_t tdsaAllShared
Definition: tdsatypes.h:364
bit32 autoGoodRSP
Definition: tdsatypes.h:365
data structure for SATA Device
Definition: tdsatypes.h:63
#define TD_MAX_NUM_PHYS
Definition: tddefs.h:108
#define TD_CARD_ID_LEN
Definition: tddefs.h:114
struct tdsaEsglPagePool_s tdsaEsglPagePool_t
data structure for ESLG page pool
struct smp_pass_through_req smp_pass_through_req_t
struct tdHardwareInfo_s tdHardwareInfo_t
data structure for SATA Device
struct tdsaEsglAllInfo_s tdsaEsglAllInfo_t
data structure for ESGL pool information
struct tdsaHwEventSource_s tdsaHwEventSource_t
struct tdsaContext_s tdsaContext_t
data structure for SAS/SATA context at TD layer
struct tdsaEsglPageInfo_s tdsaEsglPageInfo_t
data structure for ESLG page
struct ttdstDevice_s ttdstDevice_t
data structure for SATA Device
struct tdsaRoot_s tdsaRoot_t
the root data structure for TD layer
struct itdstHost_s itdstHost_t
data structure for SATA Host
struct tmf_pass_through_req tmf_pass_through_req_t