FreeBSD kernel pms device code
|
#include <sys/cdefs.h>
#include <dev/pms/config.h>
#include <dev/pms/freebsd/driver/common/osenv.h>
#include <dev/pms/freebsd/driver/common/ostypes.h>
#include <dev/pms/freebsd/driver/common/osdebug.h>
#include <dev/pms/RefTisa/sallsdk/api/sa.h>
#include <dev/pms/RefTisa/sallsdk/api/saapi.h>
#include <dev/pms/RefTisa/sallsdk/api/saosapi.h>
#include <dev/pms/RefTisa/tisa/api/titypes.h>
#include <dev/pms/RefTisa/tisa/api/ostiapi.h>
#include <dev/pms/RefTisa/tisa/api/tiapi.h>
#include <dev/pms/RefTisa/tisa/api/tiglobal.h>
#include <dev/pms/RefTisa/tisa/sassata/sas/common/tdtypes.h>
#include <dev/pms/freebsd/driver/common/osstring.h>
#include <dev/pms/RefTisa/tisa/sassata/common/tdutil.h>
#include <dev/pms/RefTisa/tisa/sassata/common/tdsatypes.h>
#include <dev/pms/RefTisa/tisa/sassata/common/tdproto.h>
Go to the source code of this file.
Variables | |
bit32 | tdCardIDList [TD_MAX_CARD_NUM] |
This file contains the SAS/SATA TD layer initialization functions
Definition in file tdinit.c.
__FBSDID | ( | "$FreeBSD$" | ) |
Definition at line 2928 of file tdinit.c.
References agFALSE, agNULL, satInternalIo_s::id, osti_memset, SAT_DEV_STATE_NORMAL, SAT_MAX_INT_IO, SAT_NCQ_MAX, satInternalIo_s::satIntIoLink, satInternalIo_s::satOrgTiIORequest, TD_DEFAULT_DEVICE, tiRoot::tdData, TDLIST_ENQUEUE_AT_TAIL, TDLIST_INIT_ELEMENT, TDLIST_INIT_HDR, tdsaRoot_s::tdsaAllShared, tdsaInitTimerRequest(), tdssGetMaxTargetsParams(), and TI_DBG6.
Referenced by tiCOMInit().
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().
Definition at line 3238 of file tdinit.c.
References agFALSE, agNULL, agTRUE, tdsaExpander_s::configSASAddrTableIndex, tdsaExpander_s::currentDownStreamPhyIndex, tdsaExpander_s::currentUpStreamPhyIndex, tdsaExpander_s::discoveringPhyId, tdsaExpander_s::discoverSMPAllowed, tdsaExpander_s::hasUpStreamDevice, tdsaExpander_s::id, tdsaExpander_s::numOfDownStreamPhys, tdsaExpander_s::numOfUpStreamPhys, osti_memset, tdsaExpander_s::tdCurrentDownStreamExpander, tiRoot::tdData, tdsaExpander_s::tdDevice, tdsaExpander_s::tdDeviceToProcess, TDLIST_ENQUEUE_AT_TAIL, TDLIST_INIT_ELEMENT, TDLIST_INIT_HDR, tdsaExpander_s::tdReturnginExpander, tdsaRoot_s::tdsaAllShared, tdssGetMaxTargetsParams(), tdsaExpander_s::tdUpStreamExpander, TI_DBG6, and tdsaExpander_s::underDiscovering.
Referenced by tiCOMInit().
Definition at line 143 of file tdinit.c.
References OS_ASSERT, TD_CARD_ID_FREE, TD_MAX_CARD_NUM, and tdCardIDList.
Referenced by tiCOMShutDown().
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().
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().
Definition at line 2623 of file tdinit.c.
References tiRoot::tdData, TDLIST_INIT_HDR, tdsaRoot_s::tdsaAllShared, and TI_DBG6.
Referenced by tiCOMInit().
Definition at line 2657 of file tdinit.c.
References agNULL, tiRoot::tdData, tdsaRoot_s::tdsaAllShared, TI_DBG6, ttdsaSMPReqReceived(), and ttdsaSSPReqReceived().
Referenced by tiCOMInit().
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().
Definition at line 2708 of file tdinit.c.
References agFALSE, agNULL, tdsaPortContext_s::agPortContext, tdsaDiscovery_s::configureRouteRetries, tdsaPortContext_s::Count, tdsaDiscovery_s::deviceRetistrationRetries, tdsaPortContext_s::directAttatchedSAS, tdsaPortContext_s::DiscFailNSeenBC, tdsaPortContext_s::discovery, tdsaPortContext_s::DiscoveryRdyGiven, tdsaPortContext_s::DiscoveryState, dmDiscCompleted, tdsaPortContext_s::eventPhyID, tdsaDiscovery_s::forcedOK, tdsaPortContext_s::id, ITD_DSTATE_NOT_STARTED, tdsaPortContext_s::LinkRate, tdsaPortContext_s::nativeSATAMode, tdsaDiscovery_s::pendingSMP, tdsaPortContext_s::PhyIDList, tdsaPortContext_s::PortRecoverPhyID, tdsaPortContext_s::RegisteredDevNums, tdsaDiscovery_s::ResetTriggerred, tdsaDiscovery_s::retries, tdsaDiscovery_s::SeenBC, tdsaPortContext_s::SeenLinkUp, tdsaDiscovery_s::SMPRetries, TD_MAX_NUM_PHYS, TD_MAX_PORT_CONTEXT, tiRoot::tdData, TDLIST_ENQUEUE_AT_TAIL, TDLIST_INIT_ELEMENT, TDLIST_INIT_HDR, tdsaRoot_s::tdsaAllShared, tdsaInitTimerRequest(), TI_DBG6, tdsaPortContext_s::Transient, tdsaDiscovery_s::type, and tdsaPortContext_s::valid.
Referenced by tiCOMInit().
osGLOBAL void tdsaPortContextReInit | ( | tiRoot_t * | tiRoot, |
tdsaPortContext_t * | onePortContext | ||
) |
Definition at line 2811 of file tdinit.c.
References agFALSE, agNULL, tdsaPortContext_s::agPortContext, tdsaPortContext_s::agRoot, agTRUE, tdsaDiscovery_s::BCTimer, tdsaDiscovery_s::configureRouteRetries, tdsaDiscovery_s::configureRouteTimer, tdsaPortContext_s::Count, tdsaDiscovery_s::deviceRegistrationTimer, tdsaDiscovery_s::deviceRetistrationRetries, tdsaPortContext_s::directAttatchedSAS, tdsaPortContext_s::DiscFailNSeenBC, tdsaPortContext_s::discovery, tdsaPortContext_s::DiscoveryRdyGiven, tdsaDiscovery_s::DiscoverySMPTimer, tdsaPortContext_s::DiscoveryState, tdsaDiscovery_s::discoveryTimer, dmDiscCompleted, tdsaPortContext_s::eventPhyID, tdsaDiscovery_s::forcedOK, ITD_DSTATE_NOT_STARTED, tdsaPortContext_s::LinkRate, tdsaPortContext_s::nativeSATAMode, agsaContext_s::osData, tdsaDiscovery_s::pendingSMP, tdsaPortContext_s::PhyIDList, tdsaPortContext_s::PortRecoverPhyID, tdsaPortContext_s::RegisteredDevNums, tdsaDiscovery_s::ResetTriggerred, tdsaDiscovery_s::retries, tdsaDiscovery_s::SeenBC, tdsaPortContext_s::SeenLinkUp, tdsaDiscovery_s::SMPBusyTimer, tdsaDiscovery_s::SMPRetries, TD_MAX_NUM_PHYS, tdsaKillTimer(), TI_DBG3, tdsaTimerRequest_s::timerRunning, tdsaPortContext_s::tiPortalContext, tdsaPortContext_s::Transient, tdsaDiscovery_s::type, and tdsaPortContext_s::valid.
Referenced by ossaDeregisterDeviceHandleCB().
Definition at line 3293 of file tdinit.c.
References agsaQueueInbound_s::elementCount, agsaQueueOutbound_s::elementCount, agsaQueueInbound_s::elementSize, agsaQueueOutbound_s::elementSize, agsaQueueConfig_s::generalEventQueue, agsaQueueConfig_s::inboundQueues, agsaQueueOutbound_s::interruptCount, agsaQueueOutbound_s::interruptDelay, agsaQueueOutbound_s::interruptEnable, agsaQueueOutbound_s::interruptVectorIndex, agsaQueueConfig_s::iqHighPriorityProcessingDepth, agsaQueueConfig_s::iqNormalPriorityProcessingDepth, agsaQueueConfig_s::numInboundQueues, agsaQueueConfig_s::numOutboundQueues, agsaQueueConfig_s::outboundQueues, agsaQueueInbound_s::priority, agsaQueueInbound_s::reserved, agsaQueueConfig_s::sasHwEventQueue, agsaQueueConfig_s::sataNCQErrorEventQueue, tiRoot::tdData, tdsaRoot_s::tdsaAllShared, tdsaGetSwConfigParams(), agsaQueueConfig_s::tgtITNexusEventQueue, agsaQueueConfig_s::tgtSMPEventQueue, agsaQueueConfig_s::tgtSSPEventQueue, and TI_DBG2.
Referenced by tiCOMInit().
Definition at line 2536 of file tdinit.c.
References agFALSE, tiRoot::tdData, tdsaRoot_s::tdsaAllShared, and TI_DBG6.
Referenced by tiCOMInit(), and tiCOMShutDown().
osGLOBAL void tdsaSharedMemCalculate | ( | tiRoot_t * | tiRoot, |
tiLoLevelResource_t * | loResource, | ||
tiTdSharedMem_t * | tdSharedMem | ||
) |
Definition at line 2472 of file tdinit.c.
References agNULL, tiMem::alignment, tiMem::numElements, tiMem::osHandle, tiMem::physAddrLower, tiMem::physAddrUpper, tiMem::reserved, tiMem::singleElementLength, TD_MAX_INT_COALESCE, TD_MAX_PORT_CONTEXT, tiTdSharedMem::tdSharedCachedMem1, tdssGetMaxTargetsParams(), TI_CACHED_MEM, TI_DBG6, tiMem::totalLength, tiMem::type, and tiMem::virtPtr.
Referenced by tiCOMGetResource().
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().
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.
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().
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().
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().
bit32 tdCardIDList[TD_MAX_CARD_NUM] |
Definition at line 80 of file tdinit.c.
Referenced by tdsaFreeCardID(), and tdsaGetCardID().