1 /*******************************************************************************
2 *Copyright (c) 2014 PMC-Sierra, Inc. All rights reserved.
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
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.
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
23 ********************************************************************************/
24 /*******************************************************************************/
27 * The file defines data structures for SAS/SATA TD layer
33 #include <dev/pms/freebsd/driver/common/osenv.h>
34 #include <dev/pms/freebsd/driver/common/ostypes.h>
35 #include <dev/pms/freebsd/driver/common/osdebug.h>
37 #include <dev/pms/RefTisa/sallsdk/api/sa.h>
38 #include <dev/pms/RefTisa/sallsdk/api/saapi.h>
39 #include <dev/pms/RefTisa/sallsdk/api/saosapi.h>
42 #include <dev/pms/RefTisa/sat/api/sm.h>
43 #include <dev/pms/RefTisa/sat/src/smtypes.h>
47 #include <dev/pms/RefTisa/discovery/api/dm.h>
50 #include <dev/pms/RefTisa/tisa/sassata/common/tddefs.h>
51 #include <dev/pms/RefTisa/tisa/sassata/common/tdlist.h>
52 #include <dev/pms/RefTisa/tisa/api/tiscsi.h>
55 /* function definitions */
56 typedef void (*tdssSSPReqReceived_t) (
64 typedef void (*tdssSMPReqReceived_t) (
67 agsaSMPFrameHeader_t *,
73 typedef bit32 (*tdssGetSGLChunk_t) (agsaRoot_t *agRoot,
74 agsaIORequest_t *agIORequest,
76 bit32 *agChunkUpper32,
77 bit32 *agChunkLower32,
80 typedef void (*tdssIOCompleted_t) (agsaRoot_t *,
87 typedef void (*tdssSMPCompleted_t) (
96 /** \brief data structure for callback function jumptableESLG page
98 * This data structure defines callback fucntions for SSP, SMP and SATA
99 * This is used for jump table used for instance specific function callback jump
102 typedef struct tdsaJumpTable_s {
103 /**< function that called to process received SSP frame */
104 tdssSSPReqReceived_t pSSPReqReceived;
105 /**< function that called to process received SSP frame */
106 tdssSMPReqReceived_t pSMPReqReceived;
107 /**< SSP IO completion callback function eg) ossaSSPcompleted() */
108 tdssIOCompleted_t pSSPIOCompleted;
109 /**< SMP IO completion callback function eg) ossaSMPcompleted() */
110 tdssSMPCompleted_t pSMPCompleted;
111 /* callback function for LL getSGL. Simple place holder for now */
112 tdssGetSGLChunk_t pGetSGLChunk;
115 /* timer functions ; both I and T */
116 typedef void (*tdsaTimerCBFunc_t)(tiRoot_t *tiRoot, void *timerData1, void *timerData2, void *timerData3);
118 /** \brief data structure for timer request
119 * Timer requests are enqueued and dequeued using tdList_t
120 * and have a callback function
122 typedef struct tdsaTimerRequest_s {
123 /* the number of ticks */
128 tdsaTimerCBFunc_t timerCBFunc;
131 } tdsaTimerRequest_t;
134 /** \brief data structure for IO request data
135 * used at target only in ttdtxchg_t structure
136 * just a place holder for now
138 typedef struct tdssIORequestData_s {
139 /* jump table has to be the first */
140 tdsaJumpTable_t *pJumpTable; /* this is just a pointer */
141 } tdssIORequestData_t;
145 /** \brief data structure OS root from the view of lower layer.
146 * TD Layer interrupt/non-interrupt context support structure for agsaRoot_t.
147 * The osData part of agsaRoot points to this tdsaRootOsData_t structure.
148 * In other words, agsaRoot_t->osData points to this structure and used for
151 typedef struct tdsaRootOsData_s {
152 tiRoot_t *tiRoot; /**< Pointer back to tiRoot */
153 void *tdsaAllShared; /**< Pointer to tdsaContext_t */
154 void *itdsaIni; /**< Pointer to SAS/SATA initiator */
155 void *ttdsaTgt; /**< Pointer to SAS/SATA target */
157 void *tdstHost; /**< Pointer to SATA Host */
158 void *tdstDevice; /**< Pointer to SATA Device */
159 agBOOLEAN IntContext; /**< Interrupt context */
162 /** \brief data structure for port/phy related flags
163 * Some fields are just place holders and not used yet
165 typedef struct tdssPortFlags_s {
166 /**< port started flag */
167 agBOOLEAN portStarted;
169 /**< port initialized flag */
170 agBOOLEAN portInitialized;
172 agBOOLEAN portReadyForDiscoverySent;
174 /**< port stopped by oslayer */
175 agBOOLEAN portStoppedByOSLayer;
177 /**< fail portinit/start */
178 agBOOLEAN failPortInit;
180 agBOOLEAN pseudoPortInitDone;
181 agBOOLEAN pseudoPortStartDone;
184 /** \brief data structure for both SAS/SATA related flags
185 * Some fields are just place holders and not used yet
188 typedef struct tdsaComMemFlags_s {
189 /**< current interrupt setting */
190 agBOOLEAN sysIntsActive;
192 /**< reset in progress */
193 agBOOLEAN resetInProgress;
196 agBOOLEAN resetFailed;
202 * SAT related structure
204 typedef struct satInternalIo_s
206 tdList_t satIntIoLink;
207 tiIORequest_t satIntTiIORequest;
208 void *satIntRequestBody;
209 tiScsiInitiatorRequest_t satIntTiScsiXchg;
210 tiMem_t satIntDmaMem;
211 tiMem_t satIntReqBodyMem;
213 tiIORequest_t *satOrgTiIORequest;
220 * SAT specific structure per SATA drive
222 #define SAT_NONNCQ_MAX 1
223 #define SAT_NCQ_MAX 32
224 #define SAT_MAX_INT_IO 16
226 typedef struct TDSASAddressID_s
228 bit32 sasAddressLo; /**< HOST SAS address lower part */
229 bit32 sasAddressHi; /**< HOST SAS address higher part */
230 bit8 phyIdentifier; /**< PHY IDENTIFIER of the PHY */
234 struct tdsaExpander_s;
237 typedef struct tdsaDiscovery_s
239 tdList_t discoveringExpanderList;
240 tdList_t UpdiscoveringExpanderList;
241 // tdList_t freeExpanderList;
243 TDSASAddressID_t sasAddressIDDiscoverError;
244 agsaSATAIdentifyData_t *pSataIdentifyData;
245 struct tdsaExpander_s *RootExp; /* Root expander of discovery */
247 bit32 type; /* discovery type: TDSA_DISCOVERY_OPTION_FULL_START
248 or TDSA_DISCOVERY_OPTION_INCREMENTAL_START*/
250 bit32 configureRouteRetries;
251 bit32 deviceRetistrationRetries;
252 tdsaTimerRequest_t discoveryTimer;
253 tdsaTimerRequest_t configureRouteTimer;
254 tdsaTimerRequest_t deviceRegistrationTimer;
255 tdsaTimerRequest_t BCTimer; /* Broadcast Change timer for ResetTriggerred */
256 smpRespDiscover_t SMPDiscoverResp;
257 bit32 pendingSMP; /* the number of pending SMP for this discovery */
258 bit32 SeenBC; /* received Broadcast change */
259 bit32 forcedOK; /* report DiscOK when chance is missed */
260 tdsaTimerRequest_t SMPBusyTimer; /* SMP retry timer for saSMPStart busy */
261 bit32 SMPRetries; /* number of SMP retries when LL returns busy for saSMPStart*/
262 bit32 ResetTriggerred; /* Hard/Link reset triggerred by discovery */
263 tdsaTimerRequest_t DiscoverySMPTimer; /* discovery-related SMP application Timer */
269 tdList_t satIoLinkList; /* Normal I/O from TISA */
270 tdList_t satFreeIntIoLinkList; /* SAT internal I/O free list */
271 tdList_t satActiveIntIoLinkList; /* SAT internal I/O active list */
272 satInternalIo_t satIntIo[SAT_MAX_INT_IO]; /* Internal I/O resource */
273 agsaSATAIdentifyData_t satIdentifyData; /* Copy of SATA Id Dev data */
274 bit8 SN_id_limit[25]; /* temporary serial number id info */
275 bit32 satNCQ; /* Flag for NCQ support */
276 bit32 sat48BitSupport; /* Flag for 48-bit addressing */
277 bit32 satSMARTSelfTest; /* Flag for SMART self test */
278 bit32 satSMARTFeatureSet; /* Flag for SMART feature set */
279 bit32 satSMARTEnabled; /* Flag for SMART enabled */
280 bit32 satRemovableMedia; /* Flag for Removable Media */
281 bit32 satRemovableMediaEnabled; /* Flag for Removable Media Enabled */
282 bit32 satDMASupport; /* Flag for DMA Support */
283 bit32 satDMAEnabled; /* Flag for DMA Enabled */
284 bit32 satDMADIRSupport; /* Flag in PACKET command for DMA transfer */
285 bit32 satWWNSupport; /* Flag for DMA Enabled */
286 bit32 satPendingIO; /* Number of pending I/O */
287 bit32 satPendingNCQIO; /* Number of pending NCQ I/O */
288 bit32 satPendingNONNCQIO; /* Number of pending NON NCW I/O*/
289 bit32 satNCQMaxIO; /* Max NCQ I/O in SAT or drive */
290 bit32 satDriveState; /* State of SAT/drive */
291 bit32 satAbortAfterReset; /* Flag: abort after SATA reset */
292 bit32 satAbortCalled; /* Flag: abort called indication*/
293 bit32 satVerifyState; /* Flag: Read Vrf state for diag*/
294 bit32 satMaxUserAddrSectors; /* max user addressable setctors*/
295 bit32 satWriteCacheEnabled; /* Flag for write cache enabled */
296 bit32 satLookAheadEnabled; /* Flag for look ahead enabled */
297 bit32 satDeviceFaultState; /* State of DF */
298 bit32 satStopState; /* State of Start and Stop */
299 bit32 satFormatState; /* State of format */
300 bit32 satPMField; /* PM field, first 4 bits */
301 bit8 satSignature[8]; /* Signature */
302 bit32 satDeviceType; /* ATA device type */
303 bit32 satSectorDone; /* Number of Sector done by Cmnd*/
304 bit32 freeSATAFDMATagBitmap; /* SATA NCQ tag bit map */
305 bit32 IDDeviceValid; /* ID DeviceData valid bit */
306 bit8 satMaxLBA[8]; /* MAXLBA is from read capacity */
307 bit32 satBGPendingDiag; /* Pending Diagnostic in backgound */
308 bit32 NumOfFCA; /* number of SMP HARD RESET on this device */
309 bit32 NumOfIDRetries; /* number of SMP HARD RESET after ID retries */
310 tiIORequest_t *satTmTaskTag; /* TM Task Tag */
311 void *satSaDeviceData; /* Pointer back to sa dev data */
312 bit32 ID_Retries; /* identify device data retries */
313 bit32 IDPending; /* number of pending identify device data */
317 /** \brief data structure for SAS device list
318 * This structure maintains the device as a list and information about
319 * the device such as the device type and ID address frame.
320 * agsaDeviceHandle_t->osData points to this structure.
322 typedef struct tdsaDeviceData_s {
324 tdsaJumpTable_t *pJumpTable; /**< a pointer to callback function jumptable */
325 tiDeviceHandle_t tiDeviceHandle;
327 tdList_t FreeLink; /* free dev list */
328 tdList_t MainLink; /* main(in use) dev list */
329 tdList_t IncDisLink; /* Used for incremental Discovery only */
330 bit32 id; /* for debugging only */
331 bit32 InQID; /* Inbound queue ID */
332 bit32 OutQID; /* Outbound queue ID */
334 /* used in tiINIIOStart() */
336 agsaDevHandle_t *agDevHandle;
338 /* for SAS; remote device */
339 // agsaSASDeviceInfo_t agSASDeviceInfo;
340 /* device's sas address */
341 TDSASAddressID_t SASAddressID;
342 bit8 initiator_ssp_stp_smp;
343 bit8 target_ssp_stp_smp;
345 /* SATA specific data */
346 satDeviceData_t satDevData;
348 /**< pointer to tdsaPortcontext which the device belongs to */
349 struct tdsaPortContext_s *tdPortContext;
350 /* validity of device */
353 bit8 processed; /* used in TD discovery */
357 agsaDeviceInfo_t agDeviceInfo;
358 agsaContext_t agContext; /* used in saRegisterNewDevice()*/
359 /**< pointer to tdsaExpander if Device is expander */
360 struct tdsaExpander_s *tdExpander;
361 struct tdsaDeviceData_s *ExpDevice; /* Expander device which this device is attached to */
363 bit8 phyID; /* PhyID this device is attached to SPC or expander */
364 agsaSASIdentify_t sasIdentify; /* used only in TD discovery */
367 bit8 directlyAttached;
368 bit8 SASSpecDeviceType; /* 0 - 3; SAS_NO_DEVICE - SAS_FANOUT_EXPANDER_DEVICE */
371 agsaContext_t agDeviceResetContext; /* used in saLocalPhyControl() */
372 tiIORequest_t TransportRecoveryIO;
373 bit32 TRflag; /* transport recovery flag; used only for tiINITransportRecovery */
374 bit32 ResetCnt; /* number of reset to the device */
375 tdsaTimerRequest_t SATAIDDeviceTimer; /* ID Device Data timer for SATA device */
378 bit32 devMCN; /* MCN reported by DM */
379 bit32 finalMCN; /* final MCN using devMCN and local MCN */
382 smDeviceHandle_t smDeviceHandle; /* for SATM */
385 tdsaTimerRequest_t tdIDTimer; /* ID Device Data timer for SATA device */
390 this field is used to add or remove SAS device from sharedcontext
392 typedef struct tdsaSASSubID_s
396 bit8 initiator_ssp_stp_smp;
397 bit8 target_ssp_stp_smp;
402 struct tdsaDeviceData_s;
403 //struct itdssDiscoveryData_s;
405 /** \brief data structure for TD port context
406 * This structure maintains information about the port such as ID address frame
407 * and the discovery status and the list of devices discovered by this port.
408 * itdsaIni_t->PortContext[] points to this structure.
409 * agsaPortContext->osData points to this structure, too.
411 typedef struct tdsaPortContext_s
413 /**< current number of devices in this PortContext */
416 bit32 DiscoveryState;
418 bit32 discoveryOptions;
419 /* Discovery ready is given? */
420 bit32 DiscoveryRdyGiven;
421 /* Port has received link up */
424 bit32 numAvailableTargets;
425 /* flag: indicates that discovery is trigggered by tiINIDiscoverTargets */
426 bit32 osInitiatedDiscovery;
428 bit32 id; /* for debugging only */
429 tdList_t FreeLink; /**< free portcontext list */
430 tdList_t MainLink; /**< in-use portcontext list */
431 /**< SAS address of the remote device */
432 bit32 sasRemoteAddressHi; /**< SAS address high part */
433 bit32 sasRemoteAddressLo; /**< SAS address low part */
434 /**< SAS ID frame of the remote device */
435 agsaSASIdentify_t sasIDframe;
437 /**< SAS address of the local device*/
438 bit32 sasLocalAddressHi; /**< SAS address high part */
439 bit32 sasLocalAddressLo; /**< SAS address low part */
441 /**< the list of PhyID belonging to this port */
442 bit8 PhyIDList[TD_MAX_NUM_PHYS];
443 tiPortalContext_t *tiPortalContext;
444 /* used in tiINIDiscoverTarget() */
446 agsaPortContext_t *agPortContext;
447 /* maybe needs timers for saPhyStart() */
449 bit8 nativeSATAMode; /* boolean flag: whether the port is in Native SATA mode */
450 bit8 remoteSignature[8]; /* the remote signature of the port is the port is in native SATA mode */
451 bit8 directAttatchedSAS; /* boolean flag: whether the port connected directly to SAS end device*/
452 /* SAS/SATA discovery information such as discoveringExpanderList */
453 tdsaDiscovery_t discovery;
456 bit32 RegisteredDevNums; /* registered number of devices */
457 bit32 eventPhyID; /* used for saHwEventAck() */
458 bit32 Transient; /* transient period between link up and link down/port recovery */
459 agsaContext_t agContext; /* used in tiCOMPortStop()*/
460 bit32 PortRecoverPhyID; /* used to remember PhyID in Port_Recover event; used in ossaDeviceRegistrationCB() */
461 bit32 DiscFailNSeenBC; /* used to remember broadcast change after discovery failure */
464 dmPortContext_t dmPortContext;
465 bit32 DMDiscoveryState; /* DM discovery state returned by tddmDiscoverCB or tddmQueryDiscoveryCB */
466 bit32 UseDM; /* set only when the directly attached target is SMP target(expander) */
467 bit32 UpdateMCN; /* flag for inidicating update MCN */
471 /** \brief data structure for TD port information
472 * This structure contains information in order to start the port
473 * The most of fields are filled in by OS layer and there can be up to
474 * 8 of these structures
475 * tiPortalContext_t->tdData points to this structure.
477 typedef struct tdsaPortStartInfo_s {
478 tiPortalContext_t *tiPortalContext;
479 tdsaPortContext_t *portContext; /* tdsaportcontext */
480 agsaSASIdentify_t SASID; /* SAS ID of the local */
481 tdssPortFlags_t flags;
482 agsaPhyConfig_t agPhyConfig;
483 } tdsaPortStartInfo_t;
485 expander data structure
488 #define REPORT_LUN_LEN 16
489 #define REPORT_LUN_OPCODE 0xa0
490 typedef struct tdDeviceLUNInfo_s
492 unsigned long tiDeviceHandle;
494 }tdDeviceLUNInfoIOCTL_t;
496 typedef struct tdsaExpander_s
498 tdList_t linkNode; /**< the link node data structure of the expander */
499 tdList_t upNode; /**< the link node data structure of the expander */
500 tdsaDeviceData_t *tdDevice; /**< the pointer to the device */
501 struct tdsaExpander_s *tdUpStreamExpander; /**< the pointer to the upstream expander device */
502 bit8 hasUpStreamDevice;
503 bit8 discoveringPhyId;
504 bit16 routingIndex; /* maximum routing table index reported by expander */
505 bit16 currentIndex[TD_MAX_EXPANDER_PHYS]; /* routing table index in use */
506 tdsaDeviceData_t *tdDeviceToProcess; /* on some callbacks, this is a link to the device of interest */
507 bit32 configSASAddressHi;
508 bit32 configSASAddressLo;
509 struct tdsaExpander_s *tdCurrentDownStreamExpander;
510 bit8 upStreamPhys[TD_MAX_EXPANDER_PHYS];
511 bit16 numOfUpStreamPhys;
512 bit16 currentUpStreamPhyIndex;
513 bit32 upStreamSASAddressHi;
514 bit32 upStreamSASAddressLo;
515 bit32 underDiscovering;
516 bit32 configRouteTable: 1;
517 bit32 configuring: 1;
518 bit32 configReserved: 30;
519 bit32 id; /* for debugging */
520 struct tdsaExpander_s *tdReturnginExpander;
521 bit8 downStreamPhys[TD_MAX_EXPANDER_PHYS];
522 bit16 numOfDownStreamPhys;
523 bit16 currentDownStreamPhyIndex;
524 bit32 discoverSMPAllowed; /* used only for configurable routers */
525 bit8 routingAttribute[TD_MAX_EXPANDER_PHYS];
526 bit32 configSASAddressHiTable[DEFAULT_MAX_DEV];
527 bit32 configSASAddressLoTable[DEFAULT_MAX_DEV];
528 bit32 configSASAddrTableIndex;
533 * SATA SAT specific function pointer for SATA completion for SAT commands.
535 typedef void (*satCompleteCbPtr_t )(
537 agsaIORequest_t *agIORequest,
539 agsaFisHeader_t *agFirstDword,
541 agsaFrameHandle_t agFrameHandle,
546 * SATA SAT specific function for I/O context
548 typedef struct satIOContext_s
550 tdList_t satIoContextLink;
551 satDeviceData_t *pSatDevData;
552 agsaFisRegHostToDevice_t *pFis;
553 tiIniScsiCmnd_t *pScsiCmnd;
554 scsiRspSense_t *pSense;
555 tiSenseData_t *pTiSenseData;
557 void *tiScsiXchg; /* for writesame10() */
559 bit32 interruptContext;
560 satCompleteCbPtr_t satCompleteCB;
561 satInternalIo_t *satIntIoContext;
562 tiDeviceHandle_t *ptiDeviceHandle;
564 bit8 superIOFlag;/* Flag indicating type for tiScsiXchg */
565 bit8 reserved1; /* Padding for allignment */
566 bit8 reserved2; /* Padding for allignment */
567 bit32 currentLBA; /* current LBA for read and write */
568 bit32 ATACmd; /* ATA command */
569 bit32 OrgTL; /* original tranfer length(tl) */
570 bit32 LoopNum; /* denominator tl */
571 bit32 LoopNum2; /* denominator tl */
572 bit8 LBA[8]; /* for reassign blocks; current LBA */
573 bit32 ParmIndex; /* for reassign blocks;current idx in defective LBA LIST */
574 bit32 ParmLen; /* for reassign blocks; defective LBA list length */
575 bit32 NotifyOS; /* only for task management */
576 bit32 TMF; /* task management function */
577 struct satIOContext_s *satToBeAbortedIOContext;
578 struct satIOContext_s *satOrgIOContext;
579 bit32 pid; /* port id; used to protect double completion */
583 /** \brief data structure for SAS SSP IO reuqest body
584 * This structure contains IO related fields.
585 * agsaIORequest->osData points to this
587 typedef struct tdIORequestBody_s {
588 tdssIOCompleted_t IOCompletionFunc;
589 tiDeviceHandle_t *tiDevHandle;
590 tiIORequest_t *tiIORequest; /* for ini */
591 agsaIORequest_t agIORequest; /* for command and task and tm response and response */
592 tiIORequest_t *tiIOToBeAbortedRequest; /* IO to be aborted */
593 agsaContext_t agContext;
595 smIORequestBody_t smIORequestBody; /*SATA IO request body*/
596 smIORequest_t smIORequest; /* for SATM */
597 void *osMemHandle; /* for ID data */
598 bit32 pid; /* port id for SATA completion */
599 bit32 superIOFlag; /* Super IO or not */
601 smScsiInitiatorRequest_t smSCSIRequest;
602 smSuperScsiInitiatorRequest_t smSuperSCSIRequest;
607 agsaSASRequestBody_t agSASRequestBody;
608 // agsaSASRequestBody_t agSASResponseBody;
610 // agsaSSPResponseInfoUnit_t agSSPRspIU;
613 agsaSATAInitiatorRequest_t agSATARequestBody;
614 scsiRspSense_t sensePayload;
615 tiSenseData_t tiSenseData;
616 satIOContext_t satIOContext;
623 tdList_t EsglPageList;
630 void *sglVirtualAddr;
631 } InitiatorRegIO; /* regular IO */
634 tiIORequest_t *CurrentTaskTag;
635 tiIORequest_t *TaskTag;
636 } InitiatorTMIO; /* task management */
639 tiIORequest_t tiIORequest; /* for target */
644 void * sglVirtualAddr;
649 void * sglVirtualAddr;
651 void * sglMirrorVirtualAddr;
652 tdList_t EsglMirrorPageList;
657 } TargetIO; /* target regular IO */
663 /** \brief data structure for SAS SMP reuqest body
664 * This structure contains IO related fields.
665 * agsaIORequest->osData points to this
668 typedef struct tdssSMPRequestBody_s {
669 tdIORequestBody_t IORequestBody; /* for combo, must be the first */
670 tdssSMPCompleted_t SMPCompletionFunc;/* must be the second */
672 tiDeviceHandle_t *tiDevHandle; /* not used for TD generated SMP */
673 agsaIORequest_t agIORequest;
674 agsaSASRequestBody_t agSASRequestBody;
675 agsaSATAInitiatorRequest_t agSATARequestBody;
677 tdsaDeviceData_t *tdDevice;
678 tiIORequest_t *CurrentTaskTag; /* SMP is used for simulate target reset */
679 tdsaPortContext_t *tdPortContext; /* portcontext where SMP is sent from */
680 bit8 smpPayload[SMP_DIRECT_PAYLOAD_LIMIT]; /* for smp retries;
681 only for direct SMP */
682 bit32 retries; /* number of retries */
683 bit32 queueNumber; /* number of retries */
684 /* for indirect SMP req/rsp */
685 void *IndirectSMPReqosMemHandle;
686 void *IndirectSMPReq;
687 bit32 IndirectSMPReqLen;
688 void *IndirectSMPResposMemHandle;
689 void *IndirectSMPResp;
690 bit32 IndirectSMPRespLen;
692 } tdssSMPRequestBody_t;
695 typedef struct tdIORequest_s
697 tiIORequest_t tiIORequest;
698 tdIORequestBody_t tdIORequestBody;
706 tiIntrEventType_t eventType;
712 /* this is allocated by OS layer but used in TD layer just like tdIORequestBody */
713 typedef struct tdPassthroughCmndBody_s
715 ostiPassthroughCmndEvent_t EventCB;
716 tiPassthroughRequest_t *tiPassthroughRequest;
717 tiDeviceHandle_t *tiDevHandle;
718 bit32 tiPassthroughCmndType; /* used in local abort */
722 tiSMPFunction_t SMPFn;
723 tiSMPFunctionResult_t SMPFnResult; /* for SMP target only */
724 bit32 IT; /* 0: initiator 1: target */
725 tiSMPFrameHeader_t SMPHeader;
727 tdssSMPRequestBody_t SMPBody;
730 tiDataDirection_t dataDirection;
733 } tdPassthroughCmndBody_t;
737 #endif /* __TDTYPES_H__ */