FreeBSD kernel pms device code
saphy.c File Reference

The file implements the functions to Start, Stop a phy. More...

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

Go to the source code of this file.

Functions

 __FBSDID ("$FreeBSD$")
 
GLOBAL bit32 saPhyStart (agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 queueNum, bit32 phyId, agsaPhyConfig_t *agPhyConfig, agsaSASIdentify_t *agSASIdentify)
 Start a Phy. More...
 
GLOBAL bit32 saPhyStop (agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 queueNum, bit32 phyId)
 Stop a Phy. More...
 
GLOBAL bit32 siPhyStopCB (agsaRoot_t *agRoot, bit32 phyId, bit32 status, agsaContext_t *agContext, bit32 portId, bit32 npipps)
 CallBack Routine to stop a Phy. More...
 
GLOBAL bit32 saLocalPhyControl (agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 queueNum, bit32 phyId, bit32 phyOperation, ossaLocalPhyControlCB_t agCB)
 Initiate a Local PHY control command. More...
 
GLOBAL bit32 saGetPhyProfile (agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 queueNum, bit32 ppc, bit32 phyId)
 
GLOBAL bit32 saSetPhyProfile (agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 queueNum, bit32 ppc, bit32 length, void *buffer, bit32 phyID)
 
GLOBAL bit32 saHwEventAck (agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 queueNum, agsaEventSource_t *eventSource, bit32 param0, bit32 param1)
 Initiate a HW Event Ack command. More...
 
GLOBAL bit32 saVhistCapture (agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 queueNum, bit32 Channel, bit32 NumBitLo, bit32 NumBitHi, bit32 PcieAddrLo, bit32 PcieAddrHi, bit32 ByteCount)
 

Variables

bit32 gFPGA_TEST
 

Detailed Description

The file implements the functions to Start, Stop a phy.

Definition in file saphy.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ saGetPhyProfile()

◆ saHwEventAck()

GLOBAL bit32 saHwEventAck ( agsaRoot_t agRoot,
agsaContext_t agContext,
bit32  queueNum,
agsaEventSource_t eventSource,
bit32  param0,
bit32  param1 
)

Initiate a HW Event Ack command.

This function is called to initiate a HW Event Ack command to the SPC. The completion of this function is reported in ossaHwEventAckCB().

Parameters
agRoothandles for this instance of SAS/SATA hardware
agContextthe context of this API
queueNumqueue number
eventSourcepoint to the event source structure
param0
param1
Returns
  • none

Definition at line 1004 of file saphy.c.

References agsaIOMap_s::agContext, agFALSE, agNULL, agsaEventSource_s::agPortContext, AGSA_RC_BUSY, AGSA_RC_FAILURE, AGSA_RC_SUCCESS, agTRUE, agsaEventSource_s::event, agsaLLRoot_s::freeIORequests, agsaLLRoot_s::freeReservedRequests, hpDBG_VERY_LOUD, agsaIORequestDesc_s::HTag, agsaIORequestDesc_s::HwAckType, agsaLLRoot_s::IOMap, IOMB_SIZE64, agsaIOMap_s::IORequest, agsaIORequestDesc_s::linkNode, LL_IOREQ_LOCKEQ_LOCK, MARK_OFF, MPI_CATEGORY_SAS_SATA, mpiBuildCmd(), OPC_INB_SAS_HW_EVENT_ACK, OPC_INB_SPC_SAS_HW_EVENT_ACK, OSSA_HW_EVENT_PHY_DOWN, OSSA_OFFSET_OF, ossaSingleThreadedEnter(), ossaSingleThreadedLeave(), agsaEventSource_s::param, agsaPort_s::portId, agsaIORequestDesc_s::pPort, SA_ASSERT, SA_DBG1, SA_DBG2, SA_DBG3, SA_RESERVED_REQUEST_COUNT, saLlistIOAdd, saLlistIOGetCount, saLlistIOGetHead, saLlistIORemove, agsaContext_s::sdkData, SHIFT24, SHIFT8, si_memset(), smIS_SPC(), smTraceFuncEnter, smTraceFuncExit, agsaIOMap_s::Tag, agsaPort_s::tobedeleted, and agsaIORequestDesc_s::valid.

Referenced by ossaDeregisterDeviceHandleCB(), and ossaHwCB().

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

◆ saLocalPhyControl()

GLOBAL bit32 saLocalPhyControl ( agsaRoot_t agRoot,
agsaContext_t agContext,
bit32  queueNum,
bit32  phyId,
bit32  phyOperation,
ossaLocalPhyControlCB_t  agCB 
)

Initiate a Local PHY control command.

This function is called to initiate a PHY control command to the local PHY. The completion of this function is reported in ossaLocalPhyControlCB()

Parameters
agRoothandles for this instance of SAS/SATA hardware
agContextthe context of this API
phyIdphy number
phyOperationone of AGSA_PHY_LINK_RESET, AGSA_PHY_HARD_RESET, AGSA_PHY_ENABLE_SPINUP
Returns
  • none

Definition at line 420 of file saphy.c.

References agsaIOMap_s::agContext, agFALSE, agNULL, AGSA_PHY_BROADCAST_ASYNCH_EVENT, AGSA_PHY_CLEAR_ERROR_COUNTS, AGSA_PHY_COMINIT_OOB, AGSA_PHY_GET_BW_COUNTS, AGSA_PHY_GET_ERROR_COUNTS, AGSA_PHY_HARD_RESET, AGSA_PHY_LINK_RESET, AGSA_PHY_NOTIFY_ENABLE_SPINUP, AGSA_RC_BUSY, AGSA_RC_FAILURE, AGSA_RC_SUCCESS, agTRUE, agsaPhyErrCounters_s::codeViolation, agsaIORequestDesc_s::completionCB, DEVICE_LCLK_CLEAR, agsaPhyErrCounters_s::elasticityBufferOverflow, agsaLLRoot_s::freeIORequests, agsaLLRoot_s::freeReservedRequests, hpDBG_VERY_LOUD, agsaIORequestDesc_s::HTag, agsaPhyErrCounters_s::inboundCRCError, agsaPhyErrCounters_s::invalidDword, agsaLLRoot_s::IOMap, agsaIOMap_s::IORequest, LCLK, LCLK_CLEAR, agsaIORequestDesc_s::linkNode, LL_IOREQ_LOCKEQ_LOCK, agsaPhyErrCounters_s::lossOfDwordSynch, MARK_OFF, mpiLocalPhyControlCmd(), OSSA_FAILURE, OSSA_SUCCESS, ossaHwRegReadExt(), ossaHwRegWriteExt(), ossaLocalPhyControlCB(), ossaSingleThreadedEnter(), ossaSingleThreadedLeave(), PCIBAR2, agsaLLRoot_s::phyCount, agsaPhyErrCounters_s::phyResetProblem, agsaPhyErrCounters_s::receivedErrorPrimitive, agsaPhyErrCounters_s::runningDisparityError, SA_ASSERT, SA_DBG1, SA_DBG2, SA_DBG3, SA_RESERVED_REQUEST_COUNT, saLlistIOAdd, saLlistIOGetCount, saLlistIOGetHead, saLlistIORemove, agsaContext_s::sdkData, si_memset(), siBar4Shift(), smIS_SPC(), smIS_SPCV(), smTraceFuncEnter, smTraceFuncExit, SPC_READ_CODE_VIO_COUNT, SPC_READ_COUNTER_CNTL, SPC_READ_DISP_ERR_COUNT, SPC_READ_INV_DW_COUNT, SPC_READ_LOSS_DW_COUNT, SPC_READ_PHY_RESET_COUNT, SPC_REG_DEVICE_LCLK, SPC_WRITE_COUNTER_CNTL, agsaIOMap_s::Tag, and agsaIORequestDesc_s::valid.

Referenced by itdssIOSuccessHandler(), ossaHwCB(), smTaskManagement(), tdsaPhyProfileIoctl(), and tiCOMPortStop().

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

◆ saPhyStart()

GLOBAL bit32 saPhyStart ( agsaRoot_t agRoot,
agsaContext_t agContext,
bit32  queueNum,
bit32  phyId,
agsaPhyConfig_t agPhyConfig,
agsaSASIdentify_t agSASIdentify 
)

Start a Phy.

Start a Phy

Parameters
agRoothandles for this instance of SAS/SATA hardware
agContext
phyIdthe phy id of the link will be started
agPhyConfigthe phy configuration
agSASIdentifythe SAS identify frame will be sent by the phy
Returns
If phy is started successfully
  • AGSA_RC_SUCCESS phy is started successfully
  • AGSA_RC_BUSY phy is already started or starting
  • AGSA_RC_FAILURE phy is not started successfully

Definition at line 60 of file saphy.c.

References agsaIOMap_s::agContext, agFALSE, agNULL, AGSA_RC_BUSY, AGSA_RC_FAILURE, AGSA_RC_SUCCESS, agTRUE, agsaLLRoot_s::freeIORequests, agsaLLRoot_s::freeReservedRequests, hpDBG_VERY_LOUD, agsaIORequestDesc_s::HTag, agsaLLRoot_s::IOMap, agsaIOMap_s::IORequest, agsaIORequestDesc_s::linkNode, LL_IOREQ_LOCKEQ_LOCK, MARK_OFF, mpiPhyStartCmd(), ossaSingleThreadedEnter(), ossaSingleThreadedLeave(), agsaLLRoot_s::phyCount, SA_ASSERT, SA_DBG1, SA_DBG3, SA_IDFRM_GET_SAS_ADDRESSHI, SA_IDFRM_GET_SAS_ADDRESSLO, SA_RESERVED_REQUEST_COUNT, saLlistIOAdd, saLlistIOGetCount, saLlistIOGetHead, saLlistIORemove, agsaContext_s::sdkData, smTrace, smTraceFuncEnter, smTraceFuncExit, agsaIOMap_s::Tag, and agsaIORequestDesc_s::valid.

Referenced by tiCOMPortStart().

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

◆ saPhyStop()

GLOBAL bit32 saPhyStop ( agsaRoot_t agRoot,
agsaContext_t agContext,
bit32  queueNum,
bit32  phyId 
)

◆ saSetPhyProfile()

GLOBAL bit32 saSetPhyProfile ( agsaRoot_t agRoot,
agsaContext_t agContext,
bit32  queueNum,
bit32  ppc,
bit32  length,
void *  buffer,
bit32  phyID 
)

Definition at line 936 of file saphy.c.

References agFALSE, AGSA_PHY_RATE_CONTROL_PAGE, AGSA_PHY_SNW3_PAGE, AGSA_RC_FAILURE, AGSA_RC_SUCCESS, AGSA_SAS_PHY_ANALOG_SETTINGS_PAGE, AGSA_SAS_PHY_MISC_PAGE, mpiSetPhyProfileCmd(), SA_ASSERT, and SA_DBG1.

Referenced by ossaGetPhyProfileCB().

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

◆ saVhistCapture()

◆ siPhyStopCB()

GLOBAL bit32 siPhyStopCB ( agsaRoot_t agRoot,
bit32  phyId,
bit32  status,
agsaContext_t agContext,
bit32  portId,
bit32  npipps 
)

CallBack Routine to stop a Phy.

CallBack for Stop a Phy

Parameters
agRoothandles for this instance of SAS/SATA hardware
phyIdthe phy id of the link will be stopped
statusthe status of the phy
agContextthe context of the saPhyStop
Returns
If phy is stopped successfully
  • AGSA_RC_SUCCESS phy is stopped successfully
  • AGSA_RC_FAILURE phy is not stopped successfully

Definition at line 314 of file saphy.c.

References agFALSE, agNULL, AGSA_RC_FAILURE, AGSA_RC_SUCCESS, hpDBG_VERY_LOUD, LL_PORT_LOCK, OSSA_HW_EVENT_PHY_STOP_STATUS, OSSA_PORT_INVALID, OSSA_SUCCESS, ossaHwCB(), ossaSingleThreadedEnter(), ossaSingleThreadedLeave(), PHY_STATUS_SET, PHY_STOPPED, agsaLLRoot_s::phyCount, agsaPort_s::phyMap, agsaLLRoot_s::phys, PORT_INVALIDATING, PORT_MARK_OFF, PORT_STATE_MASK, agsaPort_s::portContext, agsaPortMap_s::PortContext, agsaPort_s::portId, agsaPortMap_s::PortID, agsaLLRoot_s::PortMap, agsaPortMap_s::PortStatus, agsaPhy_s::pPort, SA_ASSERT, SA_DBG1, agsaContext_s::sdkData, SHIFT16, SHIFT8, siPortInvalid(), smTraceFuncEnter, smTraceFuncExit, status, and agsaPort_s::status.

Referenced by mpiHWevent().

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

Variable Documentation

◆ gFPGA_TEST

bit32 gFPGA_TEST
extern

Definition at line 56 of file sainit.c.