summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cb16050)
raw | patch | inline | side by side (parent: cb16050)
author | Tinku Mannan <tmannan@ti.com> | |
Sat, 20 Jul 2013 12:19:34 +0000 (08:19 -0400) | ||
committer | Tinku Mannan <tmannan@ti.com> | |
Sat, 20 Jul 2013 12:19:34 +0000 (08:19 -0400) |
ti/runtime/netapi/src/netapi.c | patch | blob | history | |
ti/runtime/netapi/src/netapi_init.c | patch | blob | history | |
ti/runtime/netapi/src/netapi_loc.h | patch | blob | history |
index fb583e5064754bab584b685c7484135b538826a5..ed4baa1fab5681fa4e69d32f48fe08eba9054b1b 100755 (executable)
if (!p) return NULL;
p->master = master;
+ /* The following segment should be done 1 Time per system boot by global master process */
if (master == NETAPI_SYS_MASTER)
{
pBase = hplib_shmCreate(HPLIB_SHM_SIZE);
- //pshmBase = (hplib_shmInfo_T*)hplib_shmOpen();
if (pBase == NULL)
{
printf("netapi_init: hplib_shmCreate failure\n");
else
printf("netapi_init: hplib_shmCreate sucess\n");
-#if 0
- pBase = hplib_shmOpen();
- if(pBase == NULL)
- {
- printf("netapi_init: shared memory handle is NULL\n");
- return NULL;
- }
-#endif
if (hplib_shmAddEntry(pBase, sizeof(NETAPI_SHM_T), NETAPI_ENTRY) !=
hplib_OK)
{
- printf("netapi_init: hplib_shmAddEntry failed for NETAPI_ENTRY\n");
+ netapi_Log("netapi_init: hplib_shmAddEntry failed for NETAPI_ENTRY\n");
return NULL;
}
else
{
- printf("netapi_init: hplib_shmAddEntry sucess for NETAPI_ENTRY\n");
+ netapi_Log("netapi_init: hplib_shmAddEntry sucess for NETAPI_ENTRY\n");
}
+ Osal_create(first_time);
}
/* create space for our local pktios */
}
#endif
- /* Global init for SYS_MATER */
+ /* The following segment should be done 1 Time per system boot by global master process */
if (master==NETAPI_SYS_MASTER)
{
pnetapiShm = (NETAPI_SHM_T*)hplib_shmGetEntry(pBase, NETAPI_ENTRY);
//this goes to shared memory eventually
p->global = (void *) &netapi_global;
- //save master's handle back in global; else for slave retrieve p_master
+ /* The following segment should be done 1 Time per system boot by global master process
+ save master's handle back in global; else for slave retrieve p_master */
if (master==NETAPI_SYS_MASTER)
{
netapi_global.p_master = p;
p_master=(NETAPI_HANDLE_T *)netapi_global.p_master;
}
+ /* The following segment should be done 1 Time per system boot by global master process */
/* system init */
if(master==NETAPI_SYS_MASTER)
{
- err = netapip_systemInit(p);
+ err = netapip_systemInit(p, TRUE);
netapi_netcpCfgExceptions(p, NETCP_CFG_ALL_EXCEPTIONS, NETCP_CFG_ACTION_TO_SW, (NETCP_CFG_ROUTE_HANDLE_T) NULL);
if (err<0)
{
}
netapip_cleanupAtStart(); //clear 1st 50 not-specified queues
-#if 0
- hplib_mod_fd = hplib_utilModOpen();
- if (hplib_mod_fd == -1)
- {
- netapi_Log("netapi_shutdown:: failed to open /dev/netapi: '%s'\n",
- strerror(errno));
- return;
- }
-#endif
map_base = (void *) hplib_utilGetVaOfBufferArea(HPLIBMOD_MMAP_DMA_MEM_OFFSET, 0);
if (map_base)
{
index ed223f55929cad215766685a1c783c4b64220926..8840ac348c1e8f48f24efe3cdd903acf4b7864dc 100755 (executable)
}
+
/********************************************************************
* FUNCTION PURPOSE: NETAPI internal function system initialization
********************************************************************
* DESCRIPTION: NETAPI internal function system initialization
********************************************************************/
-int netapip_systemInit(NETAPI_HANDLE_T * handle)
+int netapip_systemInit(NETAPI_HANDLE_T * handle, Bool global_master_process)
{
int32_t result;
Pktlib_HeapHandle sharedHeapHandle;
- memory mapped peripherals we use, such as QMSS, PA, etc */
result = hplib_vmInit(&netapi_VM_VirtAddr[0], 2, &netapi_VM_MempoolAttr[0]);
+ if (global_master_process == TRUE)
+ {
+ hplibp_initMallocArea(0);
+ hplibp_initMallocArea(1);
+ }
+ else
+ {
+ if (hplibp_checkMallocArea(0) != hplib_OK)
+ return -1;
+ if (hplibp_checkMallocArea(1) != hplib_OK)
+ return -1;
+ }
if (result == hplib_OK) netapi_Log("netapip_systemInit: - memory set up OK\n");
else {netapi_Log("netapip_systemInit: - memory set up failed\n"); return -1;}
if(result <0) {netapi_Log("netapip_systemInit: can't setup QM shared region\n"); return -1;}
netapi_Log("netapip_systemInit: returned from netapip_qmSetupMemRegion\n");
-#if 0 //todo setup 2nd region
-/* Initialize the local memory region configuration. */
- result= netapip_qmSetupMemRegion(
- NUM_HOST_DESC,
- SIZE_LOCAL_DESC,
- netapi_VM_QMemLocalDescRam,
- NETAPI_LOCAL_REGION);
- if(result <0) {netapi_Log("can't setup local region\n"); return -1;}
-#endif
/* Initialize CPPI CPDMA */
result = netapip_initCppi ();
index 635d422cb4b6520ea91e576cbd08fc9392697cc3..52a53b0063aa4bc02f664c8e215903baa5b3f492 100755 (executable)
uint32_t *swInfo0,
uint32_t *swInfo1);
-int netapip_systemInit(NETAPI_HANDLE_T *);
+int netapip_systemInit(NETAPI_HANDLE_T *, Bool);
void netapip_cleanupAtStart(void);
#endif