21,600
社区成员
发帖
与我相关
我的任务
分享
/*****************************************************************************/
static t_Error SrioEnumNeighbor(t_SrioPort *p_SrioPort,
uint16_t hostDevId,
uint8_t hopCount)
{
t_SrioDeviceDesc *p_DeviceDesc;
uint32_t delay = 0, status, i,portsel=0;
uint16_t hostLockId, currDevId, devId = 0;
t_Error retVal = E_OK;
uint8_t numOfPorts, currentPortId, portId;
uint16_t neighborId = (uint16_t)(SRIO_DEFAULT_AGENT_DEV_ID & p_SrioPort->devIdMask);
printf("%s: %d\n", __FUNCTION__, __LINE__);
retVal = AcquireDeviceLock (p_SrioPort,
neighborId,
hopCount,
hostDevId,
&hostLockId);
printf("\nAcquireDeviceLock is OK,hostLockId=0x%x,hostDevId=0x%x \n",hostLockId,hostDevId);
/* If some error occured */
if (retVal != E_OK)
{
RETURN_ERROR(MAJOR, retVal, NO_MSG);
}
. . . . . . .
static t_Error AcquireDeviceLock(t_SrioPort *p_SrioPort,
uint16_t destDevId,
uint8_t hopCount,
uint16_t hostDevId,
uint16_t *p_HostLockId)
{
uint32_t tmpVal;
t_Error retVal;
printf("\nAcquireDeviceLock:%d destDevId:0x%x,hopCount:0x%x,hostDevId:0x%x p_HostLockId:0x%x\r\n",__LINE__, destDevId,hopCount ,hostDevId , *p_HostLockId);
/* Checking if the device was already locked and by whom */
retVal = ConfigurationRead(p_SrioPort,
destDevId,
hopCount,
HBDIDLCSR_REG_OFFSET,
&tmpVal);
printf("%s: %d\n", __FUNCTION__, __LINE__);
if (retVal != E_OK)
RETURN_ERROR(MAJOR, E_READ_FAILED, NO_MSG);
. . . . . .