163 lines
5.4 KiB
C
163 lines
5.4 KiB
C
/*
|
|
******************************************************************************
|
|
* INTERPEAK CONFIGURATION SOURCE FILE
|
|
*
|
|
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipfreescale_config.c,v $ $Revision: 1.8.10.1 $
|
|
* $Source: /home/interpeak/CVSRoot/ipfreescale/config/ipfreescale_config.c,v $
|
|
* $Author: svc-cmnet $
|
|
* $State: Exp $ $Locker: $
|
|
*
|
|
* INTERPEAK_COPYRIGHT_STRING
|
|
* Design and implementation by Markus Carlstedt <markus@interpeak.se>
|
|
******************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 1 DESCRIPTION
|
|
****************************************************************************
|
|
* IPFREESCALE - Hardware crypto support product - configuration.
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 2 INCLUDE FILES
|
|
****************************************************************************
|
|
*/
|
|
|
|
#include "ipfreescale_config.h"
|
|
|
|
#include <ipcom_type.h>
|
|
#include <ipcom_cstyle.h>
|
|
#include <ipcom_err.h>
|
|
#include <ipcom_shell.h>
|
|
#include <ipcom_sysvar.h>
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 3 DEFINES
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 4 TYPES
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 5 EXTERN PROTOTYPES
|
|
****************************************************************************
|
|
*/
|
|
|
|
IP_EXTERN int ipfreescale_cmd_freescale(int argc, char **argv);
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 6 LOCAL PROTOTYPES
|
|
****************************************************************************
|
|
*/
|
|
|
|
IP_PUBLIC Ip_err ipfreescale_configure(void);
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 7 DATA
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipfreescale_conf_sysvar
|
|
*===========================================================================
|
|
* Freescale configuration Variables
|
|
*/
|
|
#ifdef _WRS_CONFIG_BSP_SUPPORTS_IPFREESCALE_SEC4
|
|
IP_CONST Ipcom_sysvar ipfreescale_conf_sysvar[] =
|
|
{
|
|
/* SEC4 job queue interrupt coalescing count threshold */
|
|
IP_SYSVAR("ipfreescale.sec4.IrqCoalescingCount", "1", IPCOM_MAKE_STR(SEC4_IRQ_COALESCING_COUNT)),
|
|
|
|
/* SEC4 job queue interrupt coalescing time threshold */
|
|
IP_SYSVAR("ipfreescale.sec4.IrqCoalescingTime", "0", IPCOM_MAKE_STR(SEC4_IRQ_COALESCING_TIME)),
|
|
|
|
/* SEC4 job queue input ring size */
|
|
IP_SYSVAR("ipfreescale.sec4.JobQueueInputRingSize", "256", IPCOM_MAKE_STR(SEC4_JOBQUEUE_INPUT_RING_SIZE)),
|
|
|
|
/* SEC4 job queue output ring size */
|
|
IP_SYSVAR("ipfreescale.sec4.JobQueueOutputRingSize", "256", IPCOM_MAKE_STR(SEC4_JOBQUEUE_OUTPUT_RING_SIZE)),
|
|
|
|
{ IP_NULL, IP_NULL }
|
|
};
|
|
#else
|
|
IP_CONST Ipcom_sysvar ipfreescale_conf_sysvar[] =
|
|
{
|
|
/* SEC core version: 2.0, 2.1, 2.2 or 2.4 */
|
|
IP_SYSVAR("ipfreescale.sec2.core_version", "2.0", SEC2_CORE_VERSION),
|
|
|
|
/* Device family: PowerQUICC II Pro (2) or PowerQUICC III (3) */
|
|
IP_SYSVAR("ipfreescale.sec2.device_family", "3", SEC2_DEVICE_FAMILY),
|
|
|
|
{ IP_NULL, IP_NULL }
|
|
};
|
|
#endif
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 8 STATIC FUNCTIONS
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 9 GLOBAL FUNCTIONS
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 10 PUBLIC FUNCTIONS
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipfreescale_configure
|
|
*===========================================================================
|
|
* Description: Product configure hook. Called by IPCOM at startup.
|
|
* Parameters: none.
|
|
* Returns: IPCOM_SUCCESS = ok
|
|
* IPCOM_ERR_FAILED = error
|
|
*
|
|
*/
|
|
IP_PUBLIC Ip_err
|
|
ipfreescale_configure(void)
|
|
{
|
|
Ip_err ret;
|
|
|
|
ret = ipcom_sysvar_setv(ipfreescale_conf_sysvar, 0);
|
|
if(ret != IPCOM_SUCCESS)
|
|
return ret;
|
|
|
|
#if defined(INCLUDE_IPFREESCALE_CMD) || !defined(IP_PORT_VXWORKS)
|
|
ret = ipcom_shell_add_cmd("freescale", "freescale [cmd] <modifier...>", "Test Freescale hardware crypto",
|
|
(Ipcom_shell_cmd_type)ipfreescale_cmd_freescale,
|
|
IPCOM_PRIORITY_DEFAULT, IPCOM_PROC_STACK_DEFAULT);
|
|
if(ret != IPCOM_SUCCESS)
|
|
return ret;
|
|
#endif /* defined(INCLUDE_IPFREESCALE_CMD) || !defined(IP_PORT_VXWORKS) */
|
|
|
|
return IPCOM_SUCCESS;
|
|
}
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* END OF FILE
|
|
****************************************************************************
|
|
*/
|