34#ifdef SA_ENABLE_TRACE_FUNCTIONS
38#define siTraceFileID 'K'
80 SA_DBG3((
"saPhyStart: phy%d started with ID %08X:%08X\n",
104 SA_DBG1((
"saPhyStart, using saRoot->freeReservedRequests\n"));
109 SA_DBG1((
"saPhyStart, No request from free list Not using saRoot->freeReservedRequests\n"));
138 ret =
mpiPhyStartCmd(agRoot, pRequest->
HTag, phyId, agPhyConfig, agSASIdentify, queueNum);
151 SA_DBG1((
"saPhyStart: saving pRequest (%p) for later use\n", pRequest));
160 SA_DBG1((
"saPhyStart, sending IOMB failed\n" ));
200 SA_DBG2((
"saPhyStop: phy%d stop\n", phyId));
223 if ( (phyId & 0xF) >= saRoot->
phyCount )
226 SA_DBG1((
"saPhyStop: phy%d - failure with phyId\n", phyId));
242 SA_DBG1((
"saPhyStop: using saRoot->freeReservedRequests\n"));
247 SA_DBG1((
"saPhyStop, No request from free list Not using saRoot->freeReservedRequests\n"));
281 SA_DBG2((
"saPhyStop: saving pRequest (%p) for later use\n", pRequest));
290 SA_DBG1((
"saPhyStop, sending IOMB failed\n" ));
338 SA_DBG1((
"siPhyStopCB: phy%d - failure with phyId\n", phyId));
347 pPhy = &(saRoot->
phys[phyId]);
360 SA_DBG1((
"siPhyStopCB: phy%d invalidating port\n", phyId));
375 SA_DBG1((
"siPhyStopCB: phy%d - Port is not established\n", phyId));
433 bit32 value, value1, value2, copyPhyId;
442 SA_DBG1((
"saLocalPhyControl: saRoot == agNULL\n"));
448 SA_DBG2((
"saLocalPhyControl: phy%d operation %08X\n", phyId, phyOperation));
470 SA_DBG1((
"saLocalPhyControl, using saRoot->freeReservedRequests\n"));
475 SA_DBG1((
"saLocalPhyControl, No request from free list Not using saRoot->freeReservedRequests\n"));
512 SA_DBG1((
"saLocalPhyControl: saving pRequest (%p) for later use\n", pRequest));
520 SA_DBG1((
"saLocalPhyControl, sending IOMB failed\n" ));
532 SA_DBG1((
"saLocalPhyControl: V AGSA_PHY_GET_ERROR_COUNTS\n" ));
541 SA_DBG1((
"saLocalPhyControl: phy%d - failure with phyId\n", phyId));
550 agCB(agRoot, agContext, phyId, phyOperation,
OSSA_FAILURE, (
void *)&errorParam);
573 SA_DBG3((
"saLocalPhyControl: TOP DEVICE LCLK Register value = %08X\n", value1));
578 SA_DBG3((
"saLocalPhyControl: TOP DEVICE LCLK value = %08X\n", (value1 & 0xFFFFFFBF)));
583 SA_DBG1((
"saLocalPhyControl:Shift Bar4 to 0x%x failed\n", value));
593 agCB(agRoot, agContext, phyId, phyOperation,
OSSA_FAILURE, (
void *)&errorParam);
608 SA_DBG1((
"saLocalPhyControl: Timeout,SPC_COUNTER_CNTL value = %08X\n", value));
615 SA_DBG3((
"saLocalPhyControl: SPC_COUNTER_CNTL value = %08X\n", value));
641 SA_DBG1((
"saLocalPhyControl:Shift Bar4 to 0x%x failed\n", 0x0));
660 agCB(agRoot, agContext, copyPhyId, phyOperation,
OSSA_SUCCESS, (
void *)&errorParam);
671 agCB(agRoot, agContext, phyId, phyOperation,
OSSA_FAILURE, (
void *)&errorParam);
682 SA_DBG1((
"saLocalPhyControl: V AGSA_PHY_CLEAR_ERROR_COUNTS\n" ));
690 SA_DBG3((
"saLocalPhyControl(CLEAR): phy%d - failure with phyId\n", phyId));
698 agCB(agRoot, agContext, phyId, phyOperation,
OSSA_FAILURE, (
void *)&errorParam);
720 SA_DBG3((
"saLocalPhyControl: TOP DEVICE LCLK Register value = %08X\n", value2));
725 SA_DBG3((
"saLocalPhyControl: TOP DEVICE LCLK value = %08X\n", (value2 & 0xFFFFFFBF)));
730 SA_DBG1((
"saLocalPhyControl(CLEAR):Shift Bar4 to 0x%x failed\n", value));
739 agCB(agRoot, agContext, phyId, phyOperation,
OSSA_FAILURE, (
void *)&errorParam);
747 SA_DBG3((
"saLocalPhyControl(CLEAR): SPC_COUNTER_CNTL value = %08X\n", value1));
756 SA_DBG1((
"saLocalPhyControl: Timeout,SPC_COUNTER_CNTL value = %08X\n", value));
763 SA_DBG3((
"saLocalPhyControl(CLEAR): SPC_COUNTER_CNTL value = %08X\n", value));
771 SA_DBG1((
"saLocalPhyControl:Shift Bar4 to 0x%x failed\n", 0x0));
800 agCB(agRoot, agContext, phyId, phyOperation,
OSSA_FAILURE, (
void *)&errorParam);
808 SA_DBG1((
"saLocalPhyControl: AGSA_PHY_GET_BW_COUNTS\n" ));
845 SA_DBG3((
"saGetPhyProfile : saRoot is NULL"));
849 SA_DBG1((
"saGetPhyProfile: ppc 0x%x phyID %d\n", ppc,phyId));
858 SA_DBG1((
"saGetPhyProfile: V AGSA_SAS_PHY_ERR_COUNTERS_PAGE\n" ));
871 SA_DBG3((
"saGetPhyProfile(CLEAR): phy%d - failure with phyId\n", phyId));
879 SA_DBG1((
"saGetPhyProfile: V AGSA_SAS_PHY_ERR_COUNTERS_CLR_PAGE\n" ));
889 SA_DBG1((
"saGetPhyProfile: AGSA_SAS_PHY_BW_COUNTERS_PAGE\n" ));
895 SA_DBG1((
"saGetPhyProfile: AGSA_SAS_PHY_ANALOG_SETTINGS_PAGE\n" ));
902 SA_DBG1((
"saGetPhyProfile: AGSA_SAS_PHY_GENERAL_STATUS_PAGE\n" ));
908 SA_DBG1((
"saGetPhyProfile: AGSA_PHY_SNW3_PAGE\n" ));
914 SA_DBG1((
"saGetPhyProfile: AGSA_PHY_RATE_CONTROL_PAGE\n" ));
920 SA_DBG1((
"saGetPhyProfile: AGSA_SAS_PHY_OPEN_REJECT_RETRY_BACKOFF_THRESHOLD_PAGE\n" ));
926 SA_DBG1((
"saGetPhyProfile: Unknown operation 0x%X\n",ppc ));
948 SA_DBG1((
"saSetPhyProfile: ppc 0x%x length 0x%x phyID %d\n", ppc,length,phyID));
954 SA_DBG1((
"saSetPhyProfile: AGSA_SAS_PHY_ANALOG_SETTINGS_PAGE\n" ));
960 SA_DBG1((
"saSetPhyProfile: AGSA_PHY_SNW3_PAGE\n" ));
966 SA_DBG1((
"saSetPhyProfile: AGSA_PHY_RATE_CONTROL_PAGE\n" ));
972 SA_DBG1((
"saSetPhyProfile: AGSA_SAS_PHY_MISC_PAGE\n"));
978 SA_DBG1((
"saSetPhyProfile: Unknown operation 0x%X\n",ppc ));
1028 SA_DBG1((
"saHwEventAck: saRoot == agNULL\n"));
1032 SA_DBG2((
"saHwEventAck: agContext %p eventSource %p\n", agContext, eventSource));
1033 SA_DBG1((
"saHwEventAck: event 0x%x param0 0x%x param1 0x%x\n", eventSource->
event, param0, param1));
1042 if (
agNULL == pRequest )
1048 SA_DBG1((
"saHwEventAck, using saRoot->freeReservedRequests\n"));
1054 SA_DBG1((
"saHwEventAck, No request from free list Not using saRoot->freeReservedRequests\n"));
1059 if( using_reserved )
1071 SA_DBG2((
"saHwEventAck: queueNum 0x%x HTag 0x%x\n",queueNum ,pRequest->
HTag));
1097 phyportid = pPort->
portId & 0xF;
1102 phyportid = pPort->
portId & 0xFF;
1132 pRequest->
pPort = pPort;
1134 SA_DBG3((
"saHwEventAck,eventSource->param 0x%X\n",eventSource->
param));
1135 SA_DBG3((
"saHwEventAck,eventSource->event 0x%X\n",eventSource->
event));
1140 phyportid |= ((eventSource->
param & 0x0000000F) << 4);
1142 phyportid |= (eventSource->
event & 0x0000FFFF) << 8;
1143 SA_DBG3((
"saHwEventAck: portId 0x%x phyId 0x%x SEA 0x%x\n", phyportid & 0xF,
1144 eventSource->
param & 0x0000000F, eventSource->
event & 0x0000FFFF));
1149 phyportid |= ((eventSource->
param & 0x000000FF) <<
SHIFT24);
1151 phyportid |= (eventSource->
event & 0x00FFFFFF) <<
SHIFT8;
1152 SA_DBG3((
"saHwEventAck: portId 0x%x phyId 0x%x SEA 0x%x\n", phyportid & 0xFF,
1153 eventSource->
param & 0x0000000F, eventSource->
event & 0x0000FFFF));
1158 SA_DBG1((
"saHwEventAck,phyportid 0x%X HwAckType 0x%X\n",phyportid,pRequest->
HwAckType));
1188 SA_DBG1((
"saHwEventAck: saving pRequest (%p) for later use\n", pRequest));
1197 SA_DBG1((
"saHwEventAck, sending IOMB failed\n" ));
1227 SA_DBG1((
"saVhistCapture:Channel 0x%08X 0x%08X%08X 0x%08X%08X count 0x%X\n",Channel, NumBitHi, NumBitLo ,PcieAddrHi,PcieAddrLo,ByteCount));
1234 if (
agNULL == pRequest )
1241 SA_DBG1((
", using saRoot->freeReservedRequests\n"));
1246 SA_DBG1((
"saVhistCapture: No request from free list Not using saRoot->freeReservedRequests\n"));
1254 if( using_reserved )
1272 ret =
mpiVHistCapCmd(agRoot,agContext, queueNum, Channel, NumBitLo, NumBitHi ,PcieAddrLo, PcieAddrHi, ByteCount);
1285 SA_DBG1((
"saPhyStart: saving pRequest (%p) for later use\n", pRequest));
1294 SA_DBG1((
"saVhistCapture: sending IOMB failed\n" ));
#define smTraceFuncEnter(L, I)
#define smTraceFuncExit(L, S, I)
#define AGSA_PHY_HARD_RESET
#define SA_RESERVED_REQUEST_COUNT
#define OSSA_OFFSET_OF(STRUCT_TYPE, FEILD)
#define AGSA_SAS_PHY_BW_COUNTERS_PAGE
#define AGSA_PHY_SNW3_PAGE
#define AGSA_SAS_PHY_MISC_PAGE
#define AGSA_PHY_CLEAR_ERROR_COUNTS
#define AGSA_SAS_PHY_ANALOG_SETTINGS_PAGE
#define AGSA_PHY_RATE_CONTROL_PAGE
#define AGSA_SAS_PHY_GENERAL_STATUS_PAGE
#define AGSA_PHY_LINK_RESET
#define OSSA_PORT_INVALID
#define AGSA_PHY_GET_BW_COUNTS
#define AGSA_SAS_PHY_ERR_COUNTERS_PAGE
void(* ossaLocalPhyControlCB_t)(agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 phyId, bit32 phyOperation, bit32 status, void *parm)
#define AGSA_PHY_NOTIFY_ENABLE_SPINUP
#define OSSA_HW_EVENT_PHY_DOWN
#define AGSA_PHY_BROADCAST_ASYNCH_EVENT
#define AGSA_SAS_PHY_ERR_COUNTERS_CLR_PAGE
#define AGSA_PHY_GET_ERROR_COUNTS
#define OSSA_HW_EVENT_PHY_STOP_STATUS
#define AGSA_SAS_PHY_OPEN_REJECT_RETRY_BACKOFF_THRESHOLD_PAGE
#define AGSA_PHY_COMINIT_OOB
#define SA_IDFRM_GET_SAS_ADDRESSLO(identFrame)
#define SA_IDFRM_GET_SAS_ADDRESSHI(identFrame)
#define LL_IOREQ_LOCKEQ_LOCK
#define PORT_INVALIDATING
This file defines global types.
GLOBAL bit32 siBar4Shift(agsaRoot_t *agRoot, bit32 shiftValue)
Function to do BAR shifting.
#define SPC_WRITE_COUNTER_CNTL(phyId, value)
#define SPC_READ_DISP_ERR_COUNT(phyId)
#define SPC_READ_LOSS_DW_COUNT(phyId)
#define SPC_READ_COUNTER_CNTL(phyId)
#define SPC_READ_PHY_RESET_COUNT(phyId)
#define DEVICE_LCLK_CLEAR
#define SPC_READ_CODE_VIO_COUNT(phyId)
#define SPC_REG_DEVICE_LCLK
#define SPC_READ_INV_DW_COUNT(phyId)
#define saLlistIOAdd(pList, pLink)
#define saLlistIORemove(pList, pLink)
#define saLlistIOGetHead(pList)
#define saLlistIOGetCount(pList)
#define PHY_STATUS_SET(pPhy, value)
PHY_STATUS_SET macro.
GLOBAL bit32 mpiLocalPhyControlCmd(agsaRoot_t *agRoot, bit32 tag, bit32 phyId, bit32 operation, bit32 queueNum)
SPC MPI LOCAL PHY CONTROL Command.
GLOBAL bit32 mpiPhyStopCmd(agsaRoot_t *agRoot, bit32 tag, bit32 phyId, bit32 queueNum)
SPC MPI Phy Stop Command.
GLOBAL bit32 mpiGetPhyProfileCmd(agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 Operation, bit32 PhyId, void *agCB)
Get Phy Profile Command SPCv.
GLOBAL bit32 mpiVHistCapCmd(agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 queueNum, bit32 Channel, bit32 NumBitLo, bit32 NumBitHi, bit32 PcieAddrLo, bit32 PcieAddrHi, bit32 ByteCount)
GLOBAL bit32 mpiPhyStartCmd(agsaRoot_t *agRoot, bit32 tag, bit32 phyId, agsaPhyConfig_t *agPhyConfig, agsaSASIdentify_t *agSASIdentify, bit32 queueNum)
SPC MPI Phy Start Command.
GLOBAL bit32 mpiSetPhyProfileCmd(agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 Operation, bit32 PhyId, bit32 length, void *buffer)
GLOBAL bit32 mpiBuildCmd(agsaRoot_t *agRoot, bit32 *payload, mpiMsgCategory_t category, bit16 opcode, bit16 size, bit32 queueNum)
Build a IOMB command and send to SPC.
#define OPC_INB_SAS_HW_EVENT_ACK
#define OPC_INB_SPC_SAS_HW_EVENT_ACK
GLOBAL FORCEINLINE void ossaSingleThreadedEnter(agsaRoot_t *agRoot, bit32 syncLockId)
ossaSingleThreadedEnter
GLOBAL FORCEINLINE bit32 ossaHwRegReadExt(agsaRoot_t *agRoot, bit32 busBaseNumber, bit32 regOffset)
GLOBAL void ossaLocalPhyControlCB(agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 phyId, bit32 phyOperation, bit32 status, void *parm)
ossaLocalPhyControlCB
GLOBAL void ossaHwCB(agsaRoot_t *agRoot, agsaPortContext_t *agPortContext, bit32 event, bit32 eventParm1, void *eventParm2, void *eventParm3)
GLOBAL FORCEINLINE void ossaSingleThreadedLeave(agsaRoot_t *agRoot, bit32 syncLockId)
ossaSingleThreadedLeave
GLOBAL FORCEINLINE void ossaHwRegWriteExt(agsaRoot_t *agRoot, bit32 busBaseNumber, bit32 regOffset, bit32 regValue)
GLOBAL void ossaGetPhyProfileCB(agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 status, bit32 ppc, bit32 phyID, void *parm)
GLOBAL bit32 siPhyStopCB(agsaRoot_t *agRoot, bit32 phyId, bit32 status, agsaContext_t *agContext, bit32 portId, bit32 npipps)
CallBack Routine to stop a Phy.
GLOBAL bit32 saSetPhyProfile(agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 queueNum, bit32 ppc, bit32 length, void *buffer, bit32 phyID)
GLOBAL bit32 saPhyStop(agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 queueNum, bit32 phyId)
Stop a Phy.
GLOBAL bit32 saGetPhyProfile(agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 queueNum, bit32 ppc, bit32 phyId)
GLOBAL bit32 saLocalPhyControl(agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 queueNum, bit32 phyId, bit32 phyOperation, ossaLocalPhyControlCB_t agCB)
Initiate a Local PHY control command.
GLOBAL bit32 saVhistCapture(agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 queueNum, bit32 Channel, bit32 NumBitLo, bit32 NumBitHi, bit32 PcieAddrLo, bit32 PcieAddrHi, bit32 ByteCount)
GLOBAL bit32 saHwEventAck(agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 queueNum, agsaEventSource_t *eventSource, bit32 param0, bit32 param1)
Initiate a HW Event Ack command.
GLOBAL bit32 saPhyStart(agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 queueNum, bit32 phyId, agsaPhyConfig_t *agPhyConfig, agsaSASIdentify_t *agSASIdentify)
Start a Phy.
GLOBAL void siPortInvalid(agsaRoot_t *agRoot, agsaPort_t *pPort)
Invalid a port.
GLOBAL bit32 smIS_SPC(agsaRoot_t *agRoot)
GLOBAL FORCEINLINE void * si_memset(void *s, int c, bit32 n)
memset
GLOBAL bit32 smIS_SPCV(agsaRoot_t *agRoot)
data structure stores OS specific and LL specific context