- static const struct rte_memzone *mng_memzone;
- mng_memzone = rte_memzone_lookup(temp);
- if ((mng_memzone == NULL)&&(RTE_PROC_PRIMARY==rte_eal_process_type())) {
- wls_initialize(temp, nWlsMemorySize);
+ mng_memzone = (struct rte_memzone *)rte_memzone_lookup(temp);
+ if (mng_memzone == NULL)
+ {
+ if (mode == WLS_SLAVE_CLIENT)
+ {
+ wls_initialize(temp, *nWlsMacMemorySize+*nWlsPhyMemorySize);
+ mng_memzone = (struct rte_memzone *)rte_memzone_lookup(temp);
+ if (mng_memzone == NULL)
+ {
+ PLIB_ERR("Cannot initialize wls shared memory: %s\n", temp);
+ return NULL;
+ }
+ }
+ else
+ {
+ PLIB_ERR("Cannot locate memory zone: %s. Is the Primary Process running?\n", temp);
+ return NULL;
+ }