FreeBSD kernel pms device code
saport.c File Reference

The file implements the functions to handle port. More...

#include <sys/cdefs.h>
#include <dev/pms/config.h>
#include <dev/pms/RefTisa/sallsdk/spc/saglobal.h>
Include dependency graph for saport.c:

Go to the source code of this file.

Functions

 __FBSDID ("$FreeBSD$")
 
GLOBAL agsaDeviceDesc_tsiPortSASDeviceAdd (agsaRoot_t *agRoot, agsaPort_t *pPort, agsaSASIdentify_t sasIdentify, bit32 sasInitiator, bit32 smpTimeout, bit32 itNexusTimeout, bit32 firstBurstSize, bit8 dTypeSRate, bit32 flag)
 Add a SAS device to the discovery list of the port. More...
 
GLOBAL void siPortDeviceRemove (agsaRoot_t *agRoot, agsaPort_t *pPort, agsaDeviceDesc_t *pDevice, bit32 unmap)
 The function to remove a device descriptor. More...
 
GLOBAL agsaDeviceDesc_tsiPortSATADeviceAdd (agsaRoot_t *agRoot, agsaPort_t *pPort, agsaDeviceDesc_t *pSTPBridge, bit8 *pSignature, bit8 pm, bit8 pmField, bit32 smpReqTimeout, bit32 itNexusTimeout, bit32 firstBurstSize, bit8 dTypeSRate, bit32 flag)
 Add a SATA device to the discovery list of the port. More...
 
GLOBAL void siPortInvalid (agsaRoot_t *agRoot, agsaPort_t *pPort)
 Invalid a port. More...
 
GLOBAL void siPortDeviceListRemove (agsaRoot_t *agRoot, agsaPort_t *pPort, agsaDeviceDesc_t *pDevice)
 The function to remove a device descriptor. More...
 
GLOBAL bit32 saPortControl (agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 queueNum, agsaPortContext_t *agPortContext, bit32 portOperation, bit32 param0, bit32 param1)
 Initiate a Port COntrol IOMB command. More...
 
GLOBAL bit32 saEncryptGetMode (agsaRoot_t *agRoot, agsaContext_t *agContext, agsaEncryptInfo_t *encryptInfo)
 
GLOBAL bit32 saEncryptSetMode (agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 queueNum, agsaEncryptInfo_t *mode)
 
GLOBAL bit32 saEncryptKekUpdate (agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 queueNum, bit32 flags, bit32 newKekIndex, bit32 wrapperKekIndex, bit32 blobFormat, agsaEncryptKekBlob_t *encryptKekBlob)
 
GLOBAL bit32 saEncryptKekInvalidate (agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 queueNum, bit32 kekIndex)
 
GLOBAL bit32 saEncryptDekCacheUpdate (agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 queueNum, bit32 kekIndex, bit32 dekTableSelect, bit32 dekAddrHi, bit32 dekAddrLo, bit32 dekIndex, bit32 dekNumberOfEntries, bit32 dekBlobFormat, bit32 dekTableKeyEntrySize)
 
GLOBAL bit32 saEncryptDekCacheInvalidate (agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 queueNum, bit32 dekTable, bit32 dekIndex)
 
GLOBAL bit32 saDIFEncryptionOffloadStart (agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 queueNum, bit32 op, agsaDifEncPayload_t *agsaDifEncPayload, ossaDIFEncryptionOffloadStartCB_t agCB)
 
GLOBAL bit32 saSetControllerConfig (agsaRoot_t *agRoot, bit32 queueNum, bit32 modePage, bit32 length, void *buffer, agsaContext_t *agContext)
 
GLOBAL bit32 saGetControllerConfig (agsaRoot_t *agRoot, bit32 queueNum, bit32 modePage, bit32 flag0, bit32 flag1, agsaContext_t *agContext)
 
GLOBAL bit32 saEncryptSelftestExecute (agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 queueNum, bit32 type, bit32 length, void *TestDescriptor)
 
GLOBAL bit32 saOperatorManagement (agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 queueNum, bit32 flag, bit8 role, agsaID_t *id, agsaEncryptKekBlob_t *kblob)
 
GLOBAL bit32 saSetOperator (agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 queueNum, bit32 flag, void *cert)
 
GLOBAL bit32 saGetOperator (agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 queueNum, bit32 option, bit32 AddrHi, bit32 AddrLo)
 

Variables

bit32 gFPGA_TEST
 

Detailed Description

The file implements the functions to handle port.

Definition in file saport.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ saDIFEncryptionOffloadStart()

GLOBAL bit32 saDIFEncryptionOffloadStart ( agsaRoot_t agRoot,
agsaContext_t agContext,
bit32  queueNum,
bit32  op,
agsaDifEncPayload_t agsaDifEncPayload,
ossaDIFEncryptionOffloadStartCB_t  agCB 
)

saDIFEncryptionOffloadStart()

initiate the SPCv controller offload function 
Parameters
saRoot
agContext
queueNum
op
agsaDifEncPayload
agCB
Returns

Definition at line 1111 of file saport.c.

References AGSA_RC_FAILURE, hpDBG_VERY_LOUD, mpiDIFEncryptionOffloadCmd(), SA_DBG1, smIS_SPCV(), smTraceFuncEnter, and smTraceFuncExit.

Here is the call graph for this function:

◆ saEncryptDekCacheInvalidate()

GLOBAL bit32 saEncryptDekCacheInvalidate ( agsaRoot_t agRoot,
agsaContext_t agContext,
bit32  queueNum,
bit32  dekTable,
bit32  dekIndex 
)

saEncryptDekCacheInvalidate()

Remove a DEK from the controller cache
Parameters
saRoot
kekIndex
dekTable
dekAddrHi
dekAddrLo
dekIndex
dekNumberOfEntries
Returns

Definition at line 1057 of file saport.c.

References DEK_MGMT_SUBOP_INVALIDATE, dekIndex, dekTable, hpDBG_VERY_LOUD, mpiDekManagementCmd(), OSSA_OFFSET_OF, SA_DBG2, SHIFT8, si_memset(), smTraceFuncEnter, and smTraceFuncExit.

Referenced by tiCOMEncryptDekInvalidate().

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

◆ saEncryptDekCacheUpdate()

GLOBAL bit32 saEncryptDekCacheUpdate ( agsaRoot_t agRoot,
agsaContext_t agContext,
bit32  queueNum,
bit32  kekIndex,
bit32  dekTableSelect,
bit32  dekAddrHi,
bit32  dekAddrLo,
bit32  dekIndex,
bit32  dekNumberOfEntries,
bit32  dekBlobFormat,
bit32  dekTableKeyEntrySize 
)

saEncryptDekCacheUpdate()

Replace a DEK within the controller cache
Parameters
saRoot
kekIndex
dekTableSelect
dekAddrHi
dekAddrLo
dekIndex
dekNumberOfEntries
Returns

Definition at line 973 of file saport.c.

References DEK_MGMT_SUBOP_UPDATE, dekBlobFormat, dekIndex, dekTableKeyEntrySize, hpDBG_VERY_LOUD, kekIndex, mpiDekManagementCmd(), OSSA_OFFSET_OF, SA_DBG2, SHIFT24, SHIFT8, si_memset(), smTraceFuncEnter, and smTraceFuncExit.

Referenced by tiCOMEncryptDekAdd().

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

◆ saEncryptGetMode()

◆ saEncryptKekInvalidate()

GLOBAL bit32 saEncryptKekInvalidate ( agsaRoot_t agRoot,
agsaContext_t agContext,
bit32  queueNum,
bit32  kekIndex 
)

saEncryptKekInvalidate()

Remove a KEK from the controller
Parameters
saRoot
flags
newKekIndex
wrapperKekIndex
encryptKekBlob
Returns

Definition at line 929 of file saport.c.

References hpDBG_VERY_LOUD, KEK_MGMT_SUBOP_INVALIDATE, kekIndex, mpiKekManagementCmd(), OSSA_OFFSET_OF, SA_DBG2, SHIFT16, si_memset(), smTraceFuncEnter, and smTraceFuncExit.

Here is the call graph for this function:

◆ saEncryptKekUpdate()

GLOBAL bit32 saEncryptKekUpdate ( agsaRoot_t agRoot,
agsaContext_t agContext,
bit32  queueNum,
bit32  flags,
bit32  newKekIndex,
bit32  wrapperKekIndex,
bit32  blobFormat,
agsaEncryptKekBlob_t encryptKekBlob 
)

saEncryptKekUpdate()

Replace a KEK within the controller
Parameters
saRoot
flags
newKekIndex
wrapperKekIndex
encryptKekBlob
Returns

Definition at line 808 of file saport.c.

References blobFormat, flags, hpDBG_VERY_LOUD, KEK_MGMT_SUBOP_UPDATE, agsaEncryptKekBlob_s::kekBlob, mpiKekManagementCmd(), OSSA_OFFSET_OF, SA_DBG2, SHIFT14, SHIFT16, SHIFT24, SHIFT8, si_memset(), smTraceFuncEnter, smTraceFuncExit, and wrapperKekIndex.

Referenced by tiCOMEncryptKekAdd().

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

◆ saEncryptSelftestExecute()

GLOBAL bit32 saEncryptSelftestExecute ( agsaRoot_t agRoot,
agsaContext_t agContext,
bit32  queueNum,
bit32  type,
bit32  length,
void *  TestDescriptor 
)

Definition at line 1271 of file saport.c.

References AGSA_RC_SUCCESS, hpDBG_VERY_LOUD, mpiEncryptBistCmd(), agsaEncryptBist_s::r_subop, SA_DBG1, si_memcpy(), si_memset(), smTraceFuncEnter, smTraceFuncExit, and agsaEncryptBist_s::testDiscption.

Referenced by tdsaSendBISTIoctl(), and tiCOMEncryptSelfTest().

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

◆ saEncryptSetMode()

◆ saGetControllerConfig()

GLOBAL bit32 saGetControllerConfig ( agsaRoot_t agRoot,
bit32  queueNum,
bit32  modePage,
bit32  flag0,
bit32  flag1,
agsaContext_t agContext 
)

saGetControllerConfig()

Retrieve the contents of a controller mode page
Parameters
saRoot
modePage
agContext
Returns

Definition at line 1234 of file saport.c.

References AGSA_INTERRUPT_CONFIGURATION_PAGE, AGSA_RC_FAILURE, hpDBG_VERY_LOUD, agsaGetControllerConfigCmd_s::INT_VEC_MSK0, agsaGetControllerConfigCmd_s::INT_VEC_MSK1, mpiGetControllerConfigCmd(), agsaGetControllerConfigCmd_s::pageCode, SA_DBG1, SA_DBG2, si_memset(), smIS_SPCV(), smTraceFuncEnter, and smTraceFuncExit.

Referenced by tiCOMGetControllerConfig(), and tiCOMMgntIOCTL().

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

◆ saGetOperator()

GLOBAL bit32 saGetOperator ( agsaRoot_t agRoot,
agsaContext_t agContext,
bit32  queueNum,
bit32  option,
bit32  AddrHi,
bit32  AddrLo 
)

Definition at line 1395 of file saport.c.

References AGSA_RC_SUCCESS, hpDBG_VERY_LOUD, mpiGetOperatorCmd(), agsaGetOperatorCmd_s::OprBufAddrHi, agsaGetOperatorCmd_s::OprBufAddrLo, agsaGetOperatorCmd_s::option, SA_DBG1, si_memset(), smTraceFuncEnter, and smTraceFuncExit.

Referenced by tiCOMGetOperator().

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

◆ saOperatorManagement()

GLOBAL bit32 saOperatorManagement ( agsaRoot_t agRoot,
agsaContext_t agContext,
bit32  queueNum,
bit32  flag,
bit8  role,
agsaID_t id,
agsaEncryptKekBlob_t kblob 
)

◆ saPortControl()

GLOBAL bit32 saPortControl ( agsaRoot_t agRoot,
agsaContext_t agContext,
bit32  queueNum,
agsaPortContext_t agPortContext,
bit32  portOperation,
bit32  param0,
bit32  param1 
)

Initiate a Port COntrol IOMB command.

This function is called to initiate a Port COntrol command to the SPC. The completion of this function is reported in ossaPortControlCB().

Parameters
agRoothandles for this instance of SAS/SATA hardware
agContextthe context of this API
queueNumqueue number
agPortContextpoint to the event source structure
param0parameter 0
param1parameter 1
Returns
- successful or failure

Definition at line 422 of file saport.c.

References agsaIOMap_s::agContext, agFALSE, agNULL, AGSA_PORT_CLEAN_UP, AGSA_PORT_HARD_RESET, AGSA_RC_BUSY, AGSA_RC_FAILURE, AGSA_RC_SUCCESS, agTRUE, AUTO_FW_CLEANUP_DEREG_FLAG, AUTO_HARD_RESET_DEREG_FLAG, agsaLLRoot_s::autoDeregDeviceflag, agsaLLRoot_s::freeIORequests, agsaLLRoot_s::freeReservedRequests, hpDBG_VERY_LOUD, agsaIORequestDesc_s::HTag, agsaLLRoot_s::IOMap, IOMB_SIZE64, agsaIOMap_s::IORequest, agsaIORequestDesc_s::linkNode, LL_IOREQ_LOCKEQ_LOCK, MARK_OFF, MPI_CATEGORY_SAS_SATA, mpiBuildCmd(), OPC_INB_PORT_CONTROL, OSSA_OFFSET_OF, ossaSingleThreadedEnter(), ossaSingleThreadedLeave(), agsaPort_s::portId, PORTID_MASK, SA_ASSERT, SA_DBG1, SA_DBG2, SA_RESERVED_REQUEST_COUNT, saLlistIOAdd, saLlistIOGetCount, saLlistIOGetHead, saLlistIORemove, agsaContext_s::sdkData, SHIFT8, si_memset(), smTraceFuncEnter, smTraceFuncExit, agsaIOMap_s::Tag, and agsaIORequestDesc_s::valid.

Referenced by ossaHwCB().

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

◆ saSetControllerConfig()

GLOBAL bit32 saSetControllerConfig ( agsaRoot_t agRoot,
bit32  queueNum,
bit32  modePage,
bit32  length,
void *  buffer,
agsaContext_t agContext 
)

◆ saSetOperator()

GLOBAL bit32 saSetOperator ( agsaRoot_t agRoot,
agsaContext_t agContext,
bit32  queueNum,
bit32  flag,
void *  cert 
)

Definition at line 1356 of file saport.c.

References AGSA_RC_SUCCESS, agsaSetOperatorCmd_s::cert, hpDBG_VERY_LOUD, mpiSetOperatorCmd(), agsaSetOperatorCmd_s::OPRIDX_PIN_ACS, SA_DBG1, si_memcpy(), si_memset(), smTraceFuncEnter, and smTraceFuncExit.

Referenced by tiCOMSetOperator().

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

◆ siPortDeviceListRemove()

GLOBAL void siPortDeviceListRemove ( agsaRoot_t agRoot,
agsaPort_t pPort,
agsaDeviceDesc_t pDevice 
)

The function to remove a device descriptor.

The function to remove a device descriptor

Parameters
agRoothandles for this instance of SAS/SATA hardware
pPortThe pointer to the port
pDeviceThe pointer to the device
Returns
-void-

Definition at line 370 of file saport.c.

References agNULL, agsaDeviceDesc_s::deviceType, agsaLLRoot_s::freeDevicesList, hpDBG_VERY_LOUD, agsaDeviceDesc_s::initiatorDevHandle, agsaDeviceDesc_s::linkNode, agsaPort_s::listSASATADevices, LL_DEVICE_LOCK, agsaContext_s::osData, ossaSingleThreadedEnter(), ossaSingleThreadedLeave(), agsaPort_s::portId, agsaDeviceDesc_s::pPort, SA_ASSERT, SA_DBG3, saLlistAdd, saLlistRemove, SAS_SATA_UNKNOWN_DEVICE, agsaContext_s::sdkData, smTraceFuncEnter, smTraceFuncExit, and agsaDeviceDesc_s::targetDevHandle.

Referenced by mpiDeviceRegRsp().

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

◆ siPortDeviceRemove()

GLOBAL void siPortDeviceRemove ( agsaRoot_t agRoot,
agsaPort_t pPort,
agsaDeviceDesc_t pDevice,
bit32  unmap 
)

The function to remove a device descriptor.

The function to remove a device descriptor

Parameters
agRoothandles for this instance of SAS/SATA hardware
pPortThe pointer to the port
pDeviceThe pointer to the device
Returns
-void-

Definition at line 169 of file saport.c.

References agNULL, DEVICE_ID_BITS, agsaDeviceMap_s::DeviceHandle, agsaDeviceMap_s::DeviceIdFromFW, agsaLLRoot_s::DeviceMap, agsaDeviceDesc_s::DeviceMapIndex, agsaDeviceDesc_s::deviceType, agsaLLRoot_s::freeDevicesList, hpDBG_VERY_LOUD, agsaDeviceDesc_s::initiatorDevHandle, agsaDeviceDesc_s::linkNode, agsaPort_s::listSASATADevices, LL_DEVICE_LOCK, MAX_IO_DEVICE_ENTRIES, OS_ASSERT, agsaContext_s::osData, ossaSingleThreadedEnter(), ossaSingleThreadedLeave(), agsaDeviceDesc_s::pPort, SA_ASSERT, SA_DBG3, saLlistAdd, saLlistRemove, SAS_SATA_UNKNOWN_DEVICE, agsaContext_s::sdkData, smTraceFuncEnter, smTraceFuncExit, and agsaDeviceDesc_s::targetDevHandle.

Referenced by mpiDeviceRegRsp(), and siRemoveDevHandle().

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

◆ siPortInvalid()

GLOBAL void siPortInvalid ( agsaRoot_t agRoot,
agsaPort_t pPort 
)

Invalid a port.

Invalid a port

Parameters
agRoothandles for this instance of SAS/SATA hardware
pPort
Returns
-void-

Definition at line 331 of file saport.c.

References agFALSE, agNULL, agsaLLRoot_s::freePorts, hpDBG_VERY_LOUD, agsaPort_s::linkNode, LL_PORT_LOCK, ossaSingleThreadedEnter(), ossaSingleThreadedLeave(), PORT_INVALIDATING, SA_ASSERT, saLlistAdd, saLlistRemove, agsaContext_s::sdkData, smTraceFuncEnter, smTraceFuncExit, agsaPort_s::status, agsaPort_s::tobedeleted, and agsaLLRoot_s::validPorts.

Referenced by mpiPhyStopEvent(), mpiSASHwEventAckRsp(), and siPhyStopCB().

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

◆ siPortSASDeviceAdd()

GLOBAL agsaDeviceDesc_t * siPortSASDeviceAdd ( agsaRoot_t agRoot,
agsaPort_t pPort,
agsaSASIdentify_t  sasIdentify,
bit32  sasInitiator,
bit32  smpTimeout,
bit32  itNexusTimeout,
bit32  firstBurstSize,
bit8  dTypeSRate,
bit32  flag 
)

Add a SAS device to the discovery list of the port.

Add a SAS device from the discovery list of the port

Parameters
agRoothandles for this instance of SAS/SATA LLL
pPort
sasIdentify
sasInitiator
smpTimeout
itNexusTimeout
firstBurstSize
dTypeSRate– device type and link rate
flag
Returns
-the device descriptor-

Definition at line 60 of file saport.c.

References agNULL, agTRUE, agsaSASDeviceInfo_s::commonDevInfo, agsaDeviceDesc_s::deviceType, agsaDeviceDesc_s::devInfo, agsaDeviceInfo_s::devType_S_Rate, agsaDeviceInfo_s::firstBurstSize, agsaDeviceInfo_s::flag, agsaLLRoot_s::freeDevicesList, hpDBG_VERY_LOUD, agsaSASDeviceInfo_s::initiator_ssp_stp_smp, agsaSASIdentify_s::initiator_ssp_stp_smp, agsaDeviceDesc_s::initiatorDevHandle, agsaDeviceInfo_s::it_NexusTimeout, agsaDeviceDesc_s::linkNode, agsaPort_s::listSASATADevices, LL_DEVICE_LOCK, agsaContext_s::osData, ossaSingleThreadedEnter(), ossaSingleThreadedLeave(), agsaDeviceDesc_s::pendingIORequests, agsaSASDeviceInfo_s::phyIdentifier, agsaSASIdentify_s::phyIdentifier, agsaDeviceDesc_s::pPort, SA_ASSERT, SA_DBG1, SA_DBG3, SA_IDFRM_GET_SAS_ADDRESSHI, SA_IDFRM_GET_SAS_ADDRESSLO, saLlistAdd, saLlistGetHead, saLlistInitialize, saLlistRemove, agsaDeviceInfo_s::sasAddressHi, agsaSASIdentify_s::sasAddressHi, agsaDeviceInfo_s::sasAddressLo, agsaSASIdentify_s::sasAddressLo, agsaSASSATADevInfo_s::sasDeviceInfo, agsaContext_s::sdkData, SHIFT4, agsaDeviceInfo_s::smpTimeout, smTraceFuncEnter, smTraceFuncExit, agsaSASDeviceInfo_s::target_ssp_stp_smp, agsaSASIdentify_s::target_ssp_stp_smp, and agsaDeviceDesc_s::targetDevHandle.

Referenced by mpiDeviceHandleArrived(), and saRegisterNewDevice().

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

◆ siPortSATADeviceAdd()

GLOBAL agsaDeviceDesc_t * siPortSATADeviceAdd ( agsaRoot_t agRoot,
agsaPort_t pPort,
agsaDeviceDesc_t pSTPBridge,
bit8 pSignature,
bit8  pm,
bit8  pmField,
bit32  smpReqTimeout,
bit32  itNexusTimeout,
bit32  firstBurstSize,
bit8  dTypeSRate,
bit32  flag 
)

Variable Documentation

◆ gFPGA_TEST

bit32 gFPGA_TEST
extern

Definition at line 56 of file sainit.c.