Ejemplo n.º 1
0
GT_STATUS gprtGetPhyIntPortSummary
(
IN  GT_QD_DEV  *dev,
OUT GT_U16     *intPortMask
)
{
    GT_STATUS       retVal;      
    GT_U8           hwPort;         /* the physical port number     */
    GT_U16            portVec;

#ifdef GT_USE_MAD
    if (dev->use_mad==GT_TRUE)
        return gprtGetPhyIntPortSummary_mad(dev, intPortMask);
#endif

    DBG_INFO(("gprtGetPhyIntPortSummary Called.\n"));
   
    /* translate LPORT 0 to hardware port */
    hwPort = GT_LPORT_2_PORT(0);

    *intPortMask=0;

    if (IS_IN_DEV_GROUP(dev,DEV_DEV_PHY_INTERRUPT))
    {
        return GT_NOT_SUPPORTED;
    }

    if (IS_IN_DEV_GROUP(dev,DEV_INTERNAL_GPHY))
    {
        /* get the interrupt port summary from global register */
        retVal = hwGetGlobal2RegField(dev,QD_REG_PHYINT_SOURCE,0,dev->maxPorts,&portVec);
        GT_GIG_PHY_INT_MASK(dev,portVec);
        *intPortMask = (GT_U16)GT_PORTVEC_2_LPORTVEC(portVec);
    }
    else
    {
        /* get the interrupt port summary from phy */
        retVal = hwReadPhyReg(dev,hwPort, QD_PHY_INT_PORT_SUMMARY_REG, &portVec);
        *intPortMask = (GT_U16)GT_PORTVEC_2_LPORTVEC(portVec);
    }

    if(retVal != GT_OK)
    {
        DBG_INFO(("Failed.\n"));
    }
    else
    {
        DBG_INFO(("OK.\n"));
    }

    return retVal;

}
Ejemplo n.º 2
0
GT_STATUS geventGetDevIntStatus
(
    IN  GT_QD_DEV 			*dev,
    OUT GT_DEV_INT_STATUS	*devIntStatus
)
{
    GT_STATUS       retVal;
    GT_U16			data, hwPort;

    DBG_INFO(("geventGetDevIntStatus Called.\n"));

    /* check if device supports this feature */
    if (!IS_IN_DEV_GROUP(dev,DEV_DEVICE_INTERRUPT))
    {
        DBG_INFO(("GT_NOT_SUPPORTED\n"));
        return GT_NOT_SUPPORTED;
    }

    devIntStatus->devIntCause = 0;

    retVal = hwReadGlobal2Reg(dev,QD_REG_DEVINT_SOURCE,&data);
    if(retVal != GT_OK)
    {
        DBG_INFO(("Failed.\n"));
        return retVal;
    }

    /* check SERDES Link Int and Phy Int, if applicable */
    if (IS_IN_DEV_GROUP(dev,DEV_DEVICE_INT_TYPE1))
    {
        /* check SERDES Link Int */
        if (data & (0x7 << 8))
        {
            devIntStatus->devIntCause |= GT_DEV_INT_SERDES_LINK;
            devIntStatus->linkInt = GT_PORTVEC_2_LPORTVEC((data & (7<<8)));
        }
    }
    else	/* DEV_DEVICE_INT_TYPE2 */
    {
        if (data & (0x3 << 11))
        {
            devIntStatus->devIntCause |= GT_DEV_INT_SERDES_LINK;
            devIntStatus->linkInt = GT_PORTVEC_2_LPORTVEC((data & (0x3 << 11)) >> 7);
        }

        if (data & 0x1F)
        {
            devIntStatus->devIntCause |= GT_DEV_INT_PHY;
            devIntStatus->phyInt = GT_PORTVEC_2_LPORTVEC((data & 0x1F));
        }
    }
Ejemplo n.º 3
0
/*******************************************************************************
* gpavGetPAV
*
* DESCRIPTION:
*       This routine gets the Port Association Vector
*
* INPUTS:
*       port    - logical port number.
*
* OUTPUTS:
*       pav     - Port Association Vector
*
* RETURNS:
*       GT_OK               - on success
*       GT_FAIL             - on error
*       GT_BAD_PARAM        - on bad parameters
*
* GalTis:
*
*******************************************************************************/
GT_STATUS gpavGetPAV
(
    IN GT_QD_DEV *dev,
    IN  GT_LPORT port,
    OUT GT_U16   *pav
)
{
    GT_STATUS       retVal;         /* Functions return value.      */
    GT_U16          data;           /* The register's read data.    */
    GT_U8           phyPort;        /* Physical port.               */

    DBG_INFO(("gpavGetPAV Called.\n"));

    phyPort = GT_LPORT_2_PORT(port);

    /* check if device supports this feature */
    if((retVal = IS_VALID_API_CALL(dev,phyPort, DEV_PORT_MONITORING)) != GT_OK )
        return retVal;

    if(pav == NULL)
    {
        DBG_INFO(("Failed.\n"));
        return GT_BAD_PARAM;
    }

    retVal = hwGetPortRegField(dev,phyPort,(GT_U8)QD_REG_PORT_ASSOCIATION,0,dev->maxPorts,&data );
    if(retVal != GT_OK)
    {
        DBG_INFO(("Failed.\n"));
        return retVal;
    }

    /*
     * translate Physical Port Vector to Logical Port Vector.
     */
    *pav = (GT_U16)GT_PORTVEC_2_LPORTVEC(data);

    DBG_INFO(("OK.\n"));
    return GT_OK;
}