txc_envoy_database.c

来自「TranSwitch Envoy CE2 & Envoy CE4 设备驱动及编程」· C语言 代码 · 共 416 行 · 第 1/2 页

C
416 行
字号
  REVISION HISTORY:

    Rev       Date          Author               Description
   -----    -------      ------------         -----------------
   0.5.0    6/03/04      F. Giannella         Initial release (beta)
 *--------------------------------------------------------------------------*/

TXC_U16BIT ENVOY_DbGetMaxMacPortBlocks (TXC_U16BIT handle)
{
    TXC_U16BIT deviceType;

    /* First, get the device type. */
    deviceType = ENVOY_DbGetDeviceType (handle);

    if (deviceType == ENVOY_CE2)
    {
        return ENVOY_CE2_MAX_MAC_PORT_BLOCKS;
    }
    else if (deviceType == ENVOY_CE4)
    {
        return ENVOY_CE4_MAX_MAC_PORT_BLOCKS;
    }
    else
        return 0;
}

/*--------------------------------------------------------------------------*

  FUNCTION: ENVOY_DbGetMaxSpi3Ports

  DESCRIPTION: This function returns the maximum allowable SPI-3 ports.

  INPUTS: handle

  RETURNS: maximum allowable SPI-3 ports.

  CAVEATS: None

  REVISION HISTORY:

    Date        Author           Description
  -------    ------------     -----------------
   0.5.0    6/03/04      F. Giannella         Initial release (beta)
 *--------------------------------------------------------------------------*/

TXC_U16BIT ENVOY_DbGetMaxSpi3Ports (TXC_U16BIT handle)
{
    TXC_U16BIT deviceType;

    /* First, get the device type. */
    deviceType = ENVOY_DbGetDeviceType (handle);
        if (deviceType == ENVOY_CE2)
    {
        return ENVOY_CE2_MAX_SPI3_PORTS;
    }
    else if (deviceType == ENVOY_CE4)
    {
        return ENVOY_CE4_MAX_SPI3_PORTS;
    }
    else
        return 0;


}

/*--------------------------------------------------------------------------*
                                                                           
  FUNCTION: ENVOY_DbGetMaxFifoBports                                                  
                                                                           
  DESCRIPTION: This function returns the maximum allowable PBCB ports.                                        
                                                                           
  INPUTS: handle                                                           
                                                                           
  RETURNS: maximum allowable PBCB ports.                                                         
                                                                           
  CAVEATS: None                                                         
                                                                           
  REVISION HISTORY:                                                        
                                                                           
    Date        Author           Description
  -------    ------------     -----------------
   0.5.0    6/03/04      F. Giannella         Initial release (beta)
  *--------------------------------------------------------------------------*/

TXC_U16BIT ENVOY_DbGetMaxFifoBports (TXC_U16BIT handle)
{
    TXC_U16BIT deviceType;

    /* First, get the device type. */
    deviceType = ENVOY_DbGetDeviceType (handle);

    if (deviceType == ENVOY_CE2)
    {
        return ENVOY_CE2_MAX_FIFO_PORTS;
    }
    else if (deviceType == ENVOY_CE4)
    {
        return ENVOY_CE4_MAX_FIFO_PORTS;
    }
    else
        return 0;


}

/*--------------------------------------------------------------------------*
                                                                           
  FUNCTION: ENVOY_DbGetMaxMacTerms                                                  
                                                                           
  DESCRIPTION: This function returns the maximum allowable terminals.                                        
                                                                           
  INPUTS: handle                                                           
                                                                           
  RETURNS: maximum allowable terms.                                                         
                                                                           
  CAVEATS: None                                                         
                                                                           
  REVISION HISTORY:

    Rev       Date          Author               Description
   -----    -------      ------------         -----------------
   0.5.0    6/03/04      F. Giannella         Initial release (beta)
 *--------------------------------------------------------------------------*/
TXC_U16BIT ENVOY_DbGetMaxMacTerms (TXC_U16BIT handle)
{
    return ENVOY_MAX_MAC_TERMS;
}

/*--------------------------------------------------------------------------*
                                                                           
  FUNCTION: ENVOY_DbGetDeviceType                                                  
                                                                           
  DESCRIPTION: This function retrieves the device type from the database for
               the given handle.                                        
                                                                           
  INPUTS: handle                                                           
                                                                           
  RETURNS: device type for given handle                                                         
                                                                           
  CAVEATS: None                                                         
                                                                           
  REVISION HISTORY:

    Rev       Date          Author               Description
   -----    -------      ------------         -----------------
   0.5.0    6/03/04      F. Giannella         Initial release (beta)
 *--------------------------------------------------------------------------*/

TXC_U16BIT ENVOY_DbGetDeviceType (TXC_U16BIT handle)
{
    return envoyDatabase.envoyDeviceData[handle].deviceType;
}


/*--------------------------------------------------------------------------*
                                                                           
  FUNCTION: ENVOY_DbGetDeviceAddr                                                  
                                                                           
  DESCRIPTION: returns the device base address supplied by the user                                     
                                                                           
  INPUTS: handle                                                           
                                                                           
  RETURNS: void pointer to the device base addr                                                         
                                                                           
  CAVEATS: None                                                         
                                                                           
  REVISION HISTORY:

    Rev       Date          Author               Description
   -----    -------      ------------         -----------------
   0.5.0    6/03/04      F. Giannella         Initial release (beta)
 *--------------------------------------------------------------------------*/

TXC_VOID_PTR ENVOY_DbGetDeviceAddr (TXC_U16BIT handle)
{
    return envoyDatabase.envoyDeviceData[handle].baseAddr;
}


/*--------------------------------------------------------------------------*
                                                                           
  FUNCTION: ENVOY_DbGetSemId                                                  
                                                                           
  DESCRIPTION: returns the driver semaphore ID                                     
                                                                           
  INPUTS: none                                                           
                                                                           
  RETURNS: sem Id                                                         
                                                                           
  CAVEATS: None                                                         
                                                                           
  REVISION HISTORY:

    Rev       Date          Author               Description
   -----    -------      ------------         -----------------
   0.5.0    6/03/04      F. Giannella         Initial release (beta)
 *--------------------------------------------------------------------------*/

TXC_SEM_ID ENVOY_DbGetSemId (void)
{
    return envoyDatabase.semId;
}


/****************************************************************************
 **                              End of Module                             **
 ****************************************************************************/

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?