FreeBSD kernel pms device code
tdinit.c File Reference
Include dependency graph for tdinit.c:

Go to the source code of this file.

Functions

 __FBSDID ("$FreeBSD$")
 
LOCAL bit32 tdsaGetCardID (tiRoot_t *tiRoot)
 
osGLOBAL void tdsaFreeCardID (tiRoot_t *tiRoot, bit32 CardID)
 
bit32 tdsaGetCardIDString (tiRoot_t *tiRoot)
 
osGLOBAL void tiCOMGetResource (tiRoot_t *tiRoot, tiLoLevelResource_t *loResource, tiInitiatorResource_t *initiatorResource, tiTargetResource_t *targetResource, tiTdSharedMem_t *tdSharedMem)
 
osGLOBAL bit32 tiCOMInit (tiRoot_t *tiRoot, tiLoLevelResource_t *loResource, tiInitiatorResource_t *initiatorResource, tiTargetResource_t *targetResource, tiTdSharedMem_t *tdSharedMem)
 
osGLOBAL void tdsaLoLevelGetResource (tiRoot_t *tiRoot, tiLoLevelResource_t *loResource)
 
osGLOBAL void tdsaSharedMemCalculate (tiRoot_t *tiRoot, tiLoLevelResource_t *loResource, tiTdSharedMem_t *tdSharedMem)
 
osGLOBAL void tdsaResetComMemFlags (tiRoot_t *tiRoot)
 
osGLOBAL void tdssInitSASPortStartInfo (tiRoot_t *tiRoot)
 
osGLOBAL void tdsaInitTimers (tiRoot_t *tiRoot)
 
osGLOBAL void tdsaJumpTableInit (tiRoot_t *tiRoot)
 
osGLOBAL void tdsaPortContextInit (tiRoot_t *tiRoot)
 
osGLOBAL void tdsaPortContextReInit (tiRoot_t *tiRoot, tdsaPortContext_t *onePortContext)
 
osGLOBAL void tdsaDeviceDataInit (tiRoot_t *tiRoot)
 
osGLOBAL void tdsaDeviceDataReInit (tiRoot_t *tiRoot, tdsaDeviceData_t *oneDeviceData)
 
osGLOBAL void tdsaExpanderInit (tiRoot_t *tiRoot)
 
osGLOBAL void tdsaQueueConfigInit (tiRoot_t *tiRoot)
 
osGLOBAL void tdssGetMaxTargetsParams (tiRoot_t *tiRoot, bit32 *pMaxTargets)
 
osGLOBAL void tdssGetSATAOnlyModeParams (tiRoot_t *tiRoot, bit32 *pSATAOnlyMode)
 

Variables

bit32 tdCardIDList [TD_MAX_CARD_NUM]
 

Detailed Description

This file contains the SAS/SATA TD layer initialization functions

Definition in file tdinit.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ tdsaDeviceDataInit()

◆ tdsaDeviceDataReInit()

osGLOBAL void tdsaDeviceDataReInit ( tiRoot_t tiRoot,
tdsaDeviceData_t oneDeviceData 
)

Definition at line 3071 of file tdinit.c.

References tdsaDeviceData_s::agDevHandle, tdsaDeviceData_s::agDeviceResetContext, agFALSE, agNULL, agTRUE, tdsaDeviceData_s::DeviceType, tdsaDeviceData_s::directlyAttached, tdsaDeviceData_s::ExpDevice, satDeviceData_t::freeSATAFDMATagBitmap, satInternalIo_s::id, satDeviceData_t::ID_Retries, satDeviceData_t::IDDeviceValid, satDeviceData_t::IDPending, tdsaDeviceData_s::initiator_ssp_stp_smp, tdsaDeviceData_s::InQID, tdsaDeviceData_s::IOResponse, tdsaDeviceData_s::IOStart, satDeviceData_t::NumOfFCA, satDeviceData_t::NumOfIDRetries, tdsaDeviceData_s::numOfPhys, tdsaDeviceData_s::OSAbortAll, agsaContext_s::osData, tiDeviceHandle::osData, osti_memset, tdsaDeviceData_s::OutQID, tdsaDeviceData_s::phyID, tdsaDeviceData_s::pJumpTable, tdsaDeviceData_s::processed, tdsaDeviceData_s::registered, tdsaDeviceData_s::ResetCnt, TDSASAddressID_s::sasAddressHi, tdsaDeviceData_s::SASAddressID, TDSASAddressID_s::sasAddressLo, tdsaDeviceData_s::SASSpecDeviceType, SAT_DEV_STATE_NORMAL, SAT_MAX_INT_IO, SAT_NCQ_MAX, tdsaDeviceData_s::satDevData, satDeviceData_t::satDriveState, satDeviceData_t::satIdentifyData, satDeviceData_t::satIntIo, satDeviceData_t::satMaxLBA, satDeviceData_t::satNCQMaxIO, satDeviceData_t::satPendingIO, satDeviceData_t::satPendingNCQIO, satDeviceData_t::satPendingNONNCQIO, satDeviceData_t::satSaDeviceData, agsaContext_s::sdkData, tdsaDeviceData_s::target_ssp_stp_smp, TD_DEFAULT_DEVICE, tiDeviceHandle::tdData, tiRoot::tdData, tdsaDeviceData_s::tdExpander, tdsaDeviceData_s::tdPortContext, tdsaRoot_s::tdsaAllShared, tdsaKillTimer(), TI_DBG3, tdsaDeviceData_s::tiDeviceHandle, tdsaDeviceData_s::TRflag, tdsaDeviceData_s::valid, and tdsaDeviceData_s::valid2.

Referenced by ossaDeregisterDeviceHandleCB(), and ossaDeviceRegistrationCB().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tdsaExpanderInit()

◆ tdsaFreeCardID()

osGLOBAL void tdsaFreeCardID ( tiRoot_t tiRoot,
bit32  CardID 
)

Definition at line 143 of file tdinit.c.

References OS_ASSERT, TD_CARD_ID_FREE, TD_MAX_CARD_NUM, and tdCardIDList.

Referenced by tiCOMShutDown().

Here is the caller graph for this function:

◆ tdsaGetCardID()

bit32 tdsaGetCardID ( tiRoot_t tiRoot)

Definition at line 108 of file tdinit.c.

References TD_CARD_ID_ALLOC, TD_CARD_ID_FREE, TD_MAX_CARD_NUM, and tdCardIDList.

Referenced by tdsaGetCardIDString().

Here is the caller graph for this function:

◆ tdsaGetCardIDString()

bit32 tdsaGetCardIDString ( tiRoot_t tiRoot)

Definition at line 168 of file tdinit.c.

References osti_sprintf, osti_strcpy, tiRoot::tdData, tdsaRoot_s::tdsaAllShared, tdsaGetCardID(), TI_DBG1, TI_DBG3, tiError, and tiSuccess.

Referenced by tiCOMInit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tdsaInitTimers()

osGLOBAL void tdsaInitTimers ( tiRoot_t tiRoot)

Definition at line 2623 of file tdinit.c.

References tiRoot::tdData, TDLIST_INIT_HDR, tdsaRoot_s::tdsaAllShared, and TI_DBG6.

Referenced by tiCOMInit().

Here is the caller graph for this function:

◆ tdsaJumpTableInit()

osGLOBAL void tdsaJumpTableInit ( tiRoot_t tiRoot)

Definition at line 2657 of file tdinit.c.

References agNULL, tiRoot::tdData, tdsaRoot_s::tdsaAllShared, TI_DBG6, ttdsaSMPReqReceived(), and ttdsaSSPReqReceived().

Referenced by tiCOMInit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tdsaLoLevelGetResource()

osGLOBAL void tdsaLoLevelGetResource ( tiRoot_t tiRoot,
tiLoLevelResource_t loResource 
)

Definition at line 727 of file tdinit.c.

References agFALSE, agsaMemoryRequirement_s::agMemory, agNULL, AGSA_CACHED_DMA_MEM, AGSA_CACHED_MEM, AGSA_DMA_MEM, AGSA_MAX_INBOUND_Q, AGSA_MAX_OUTBOUND_Q, dmMem_t::alignment, agsaMem_s::alignment, smMem_t::alignment, tiMem::alignment, dmMemoryRequirement_t::count, agsaMemoryRequirement_s::count, smMemoryRequirement_t::count, tiLoLevelMem::count, DEFAULT_EVENT_LOG_OPTION, DEFAULT_INBOUND_QUEUE_ELE_SIZE, DEFAULT_INBOUND_QUEUE_PRIORITY, DEFAULT_INBOUND_QUEUE_SIZE, DEFAULT_KEY_BUFFER_SIZE, DEFAULT_MAX_ACTIVE_IOS, DEFAULT_MAX_DEV, DEFAULT_NUM_INBOUND_QUEUE, DEFAULT_NUM_OUTBOUND_QUEUE, DEFAULT_NUM_REG_CLIENTS, DEFAULT_OUTBOUND_INTERRUPT_ENABLE, DEFAULT_OUTBOUND_QUEUE_ELE_SIZE, DEFAULT_OUTBOUND_QUEUE_INTERRUPT_COUNT, DEFAULT_OUTBOUND_QUEUE_INTERRUPT_DELAY, DEFAULT_OUTBOUND_QUEUE_SIZE, DEFAULT_SMP_TIMEOUT, agsaSwConfig_s::disableMDF, dmGetRequirements(), dmMemoryRequirement_t::dmMemory, agsaQueueInbound_s::elementCount, agsaQueueOutbound_s::elementCount, agsaQueueInbound_s::elementSize, agsaQueueOutbound_s::elementSize, agsaSwConfig_s::enableDIF, agsaSwConfig_s::enableEncryption, agsaSwConfig_s::eventLog1Option, agsaSwConfig_s::eventLog2Option, agsaSwConfig_s::fatalErrorInterruptEnable, agsaSwConfig_s::fatalErrorInterruptVector, tiLoLevelOption::flag, agsaSwConfig_s::FWConfig, agsaQueueConfig_s::generalEventQueue, HOST_EVENT_LOG_SIZE, agsaSwConfig_s::hostDirectAccessMode, agsaSwConfig_s::hostDirectAccessSupport, agsaQueueConfig_s::inboundQueues, agsaQueueOutbound_s::interruptCount, agsaQueueOutbound_s::interruptDelay, agsaQueueOutbound_s::interruptEnable, agsaQueueConfig_s::iqHighPriorityProcessingDepth, agsaQueueConfig_s::iqNormalPriorityProcessingDepth, agsaSwConfig_s::legacyInt_X, tiLoLevelResource::loLevelMem, tiLoLevelResource::loLevelOption, MAX_LL_LAYER_MEM_DESCRIPTORS, agsaSwConfig_s::max_MSI_InterruptVectors, tiLoLevelOption::max_MSI_InterruptVectors, agsaSwConfig_s::max_MSIX_InterruptVectors, agsaSwConfig_s::maxActiveIOs, smSwConfig_t::maxActiveIOs, tiLoLevelOption::maxInterruptVectors, tiLoLevelOption::maxNumOSLocks, tiLoLevelMem::mem, MIN, agsaSwConfig_s::mpiContextTable, agsaSwConfig_s::mpiContextTablelen, tiLoLevelOption::mutexLockUsage, agsaSwConfig_s::numberOfEventRegClients, dmSwConfig_t::numDevHandles, agsaSwConfig_s::numDevHandles, smSwConfig_t::numDevHandles, dmMem_t::numElements, agsaMem_s::numElements, smMem_t::numElements, tiMem::numElements, agsaQueueConfig_s::numInboundQueues, tiLoLevelOption::numOfQueuesPerPort, agsaQueueConfig_s::numOutboundQueues, tiMem::osHandle, osti_memset, osti_sprintf, osti_strncmp, osti_strtoul, ostiGetTransportParam(), agsaQueueConfig_s::outboundQueues, agsaSwConfig_s::param3, tiMem::physAddrLower, tiMem::physAddrUpper, agsaQueueInbound_s::priority, tiMem::reserved, saGetRequirements(), agsaQueueConfig_s::sasHwEventQueue, agsaQueueConfig_s::sataNCQErrorEventQueue, dmMem_t::singleElementLength, agsaMem_s::singleElementLength, smMem_t::singleElementLength, tiMem::singleElementLength, agsaSwConfig_s::sizefEventLog1, agsaSwConfig_s::sizefEventLog2, smGetRequirements(), smMemoryRequirement_t::smMemory, agsaSwConfig_s::smpReqTimeout, TD_MAX_LOCKS, tdsaPrintSwConfig(), agsaQueueConfig_s::tgtITNexusEventQueue, agsaQueueConfig_s::tgtSMPEventQueue, agsaQueueConfig_s::tgtSSPEventQueue, TI_CACHED_DMA_MEM, TI_CACHED_MEM, TI_DBG1, TI_DBG2, TI_DBG6, TI_DMA_MEM, tiOneMutexLockPerQueue, tiSuccess, dmMem_t::totalLength, agsaMem_s::totalLength, smMem_t::totalLength, tiMem::totalLength, dmMem_t::type, agsaMem_s::type, smMem_t::type, tiMem::type, tiLoLevelOption::usecsPerTick, and tiMem::virtPtr.

Referenced by tiCOMGetResource().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tdsaPortContextInit()

◆ tdsaPortContextReInit()

osGLOBAL void tdsaPortContextReInit ( tiRoot_t tiRoot,
tdsaPortContext_t onePortContext 
)

◆ tdsaQueueConfigInit()

◆ tdsaResetComMemFlags()

osGLOBAL void tdsaResetComMemFlags ( tiRoot_t tiRoot)

Definition at line 2536 of file tdinit.c.

References agFALSE, tiRoot::tdData, tdsaRoot_s::tdsaAllShared, and TI_DBG6.

Referenced by tiCOMInit(), and tiCOMShutDown().

Here is the caller graph for this function:

◆ tdsaSharedMemCalculate()

osGLOBAL void tdsaSharedMemCalculate ( tiRoot_t tiRoot,
tiLoLevelResource_t loResource,
tiTdSharedMem_t tdSharedMem 
)

◆ tdssGetMaxTargetsParams()

osGLOBAL void tdssGetMaxTargetsParams ( tiRoot_t tiRoot,
bit32 pMaxTargets 
)

Definition at line 3363 of file tdinit.c.

References agNULL, DEFAULT_KEY_BUFFER_SIZE, DEFAULT_MAX_DEV, osti_memset, osti_strncmp, osti_strtoul, ostiGetTransportParam(), TI_DBG2, TI_DBG6, and tiSuccess.

Referenced by tdsaDeviceDataInit(), tdsaExpanderInit(), tdsaSharedMemCalculate(), and tiCOMInit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tdssGetSATAOnlyModeParams()

osGLOBAL void tdssGetSATAOnlyModeParams ( tiRoot_t tiRoot,
bit32 pSATAOnlyMode 
)

Definition at line 3431 of file tdinit.c.

References agFALSE, agNULL, DEFAULT_KEY_BUFFER_SIZE, osti_memset, osti_strncmp, osti_strtoul, ostiGetTransportParam(), TI_DBG6, and tiSuccess.

Here is the call graph for this function:

◆ tdssInitSASPortStartInfo()

osGLOBAL void tdssInitSASPortStartInfo ( tiRoot_t tiRoot)

Definition at line 2567 of file tdinit.c.

References agFALSE, agNULL, TD_MAX_NUM_PHYS, tiRoot::tdData, tdsaRoot_s::tdsaAllShared, and TI_DBG6.

Referenced by tiCOMInit().

Here is the caller graph for this function:

◆ tiCOMGetResource()

osGLOBAL void tiCOMGetResource ( tiRoot_t tiRoot,
tiLoLevelResource_t loResource,
tiInitiatorResource_t initiatorResource,
tiTargetResource_t targetResource,
tiTdSharedMem_t tdSharedMem 
)

Definition at line 224 of file tdinit.c.

References agNULL, itdssGetResource(), tdsaLoLevelGetResource(), tdsaSharedMemCalculate(), TI_DBG1, TI_DBG6, and ttdssGetResource().

Referenced by agtiapi_attach().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tiCOMInit()

osGLOBAL bit32 tiCOMInit ( tiRoot_t tiRoot,
tiLoLevelResource_t loResource,
tiInitiatorResource_t initiatorResource,
tiTargetResource_t targetResource,
tiTdSharedMem_t tdSharedMem 
)

< Initialize the OS data part of the interrupt context agRoot

< Initialize the OS data part of the non-interrupt context agRoot

< initializes tdsaPortStartInfo_s including flags

< initializes timers

< initializes tdsaPortContext_t

< initializes devicelist in tdsaPortContext_t

Definition at line 294 of file tdinit.c.

References agFALSE, agNULL, agsaEventSource_s::agPortContext, tdsaContext_s::agRootInt, tdsaContext_s::agRootNonInt, tdsaContext_s::agRootOsDataForInt, tdsaContext_s::agRootOsDataForNonInt, tdsaContext_s::CardIDString, tdsaContext_s::currentOperation, tdsaContext_s::DeviceMem, dmGetRequirements(), agsaEventSource_s::event, tdsaContext_s::eventSource, tdsaHwEventSource_s::EventValid, tdsaContext_s::ExpanderHead, tdsaEsglAllInfo_s::freelist, tdsaContext_s::IBQnumber, tdsaEsglPageInfo_s::id, tiInitiatorResource::initiatorMem, tdsaRootOsData_s::IntContext, tdsaContext_s::itdsaIni, tdsaRootOsData_s::itdsaIni, itdssInit(), tiLoLevelResource::loLevelOption, tdsaContext_s::loResource, tdsaContext_s::MaxNumLLLocks, tdsaContext_s::MaxNumLocks, tiLoLevelOption::maxNumOSLocks, tdsaContext_s::MaxNumOSLocks, tiLoLevelOption::numOfQueuesPerPort, tdsaContext_s::OBQnumber, agsaContext_s::osData, osti_strcpy, agsaEventSource_s::param, tdsaContext_s::PortContextMem, tdsaContext_s::resetCount, agsaContext_s::sdkData, smGetRequirements(), tdsaHwEventSource_s::Source, status, tiTargetResource_t::targetMem, TD_MAX_INT_COALESCE, TD_MAX_LOCKS, TD_MAX_NUM_PHYS, TD_MAX_PORT_CONTEXT, TD_OPERATION_INITIATOR, TD_OPERATION_TARGET, tiInitiatorMem::tdCachedMem, tiRoot::tdData, TDLIST_DEQUEUE_FROM_HEAD, TDLIST_ENQUEUE_AT_HEAD, TDLIST_OBJECT_BASE, tiTargetMem::tdMem, tdsaRoot_s::tdsaAllShared, tdsaRootOsData_s::tdsaAllShared, tdsaDeviceDataInit(), tdsaExpanderInit(), tdsaGetCardIDString(), tdsaInitTimers(), tdsaJumpTableInit(), tdsaPortContextInit(), tdsaQueueConfigInit(), tdsaResetComMemFlags(), tiTdSharedMem::tdSharedCachedMem1, tdssGetMaxTargetsParams(), tdssInitSASPortStartInfo(), tdsaRootOsData_s::tdstDevice, tdsaRootOsData_s::tdstHost, TI_DBG1, TI_DBG2, TI_DBG3, TI_DBG5, TI_DBG6, tiError, tiInterruptContext, tiNonInterruptContext, tdsaRootOsData_s::tiRoot, tiSuccess, tdsaContext_s::ttdsaTgt, tdsaRootOsData_s::ttdsaTgt, ttdssInit(), and tiMem::virtPtr.

Referenced by agtiapi_InitCardSW().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ tdCardIDList