Changes for L1 V20.03 onwards
[o-du/l2.git] / src / mt / mt_ss.c
index dc3c0b3..3c12a8d 100644 (file)
@@ -183,7 +183,6 @@ char            my_buffer[4096] = { 0 };
 int             my_buffer_idx = 0;
 
 
-
 #define sigsegv_print(x, ...)    my_buffer_idx += sprintf(&my_buffer[my_buffer_idx], x "\n", ##__VA_ARGS__)
 
 struct sigcontext my_uc_mcontext = { 0 };
@@ -888,10 +887,16 @@ S8 gWrWlsDeviceName[MAX_WLS_DEVICE_NAME_LEN];
 S16 smWrReadWlsConfigParams (Void);
 #endif
 
+/*WLS Memory Size variables*/
+#ifdef INTEL_L1_V20_03_ONWARDS
+uint64_t        nWlsMacMemorySize = 0;
+uint64_t        nWlsPhyMemorySize = 0;
+#endif
+
 static int SOpenWlsIntf()
 {
    uint8_t i;
-   void *hdl;
+   void *hdl = NULLP;
 #define WLS_DEVICE_NAME "wls0"
 
    char *my_argv[] = {"gnodeb", "-c3", "--proc-type=auto", "--file-prefix", WLS_DEVICE_NAME, "--iova-mode=pa"};
@@ -912,8 +917,18 @@ static int SOpenWlsIntf()
 #else
    hdl = WLS_Open(WLS_DEVICE_NAME, 1);
 #endif
+#else
+
+#ifdef INTEL_L1_V20_03_ONWARDS
+   hdl = WLS_Open(WLS_DEVICE_NAME, WLS_MASTER_CLIENT, &nWlsMacMemorySize, &nWlsPhyMemorySize);
+   if(hdl == NULL)
+   {
+      printf("\nERROR: WLS_Open > DEVICE_NAME mismatch. WLS Device Name should be same as 'wls_dev_name' parameter in 'phycfg_xran.xml' file");
+   }
 #else
    hdl = WLS_Open(WLS_DEVICE_NAME, WLS_MASTER_CLIENT, WLS_MEM_SIZE);
+#endif /*INTEL_L1_V20_03_ONWARDS*/
+
 #endif
 
    osCp.wls.intf = hdl;
@@ -1582,7 +1597,9 @@ static S16 SAllocateWlsDynMem()
       mtDynMemSz[i].reqdSz += (mtGlobMemoCfg.bkt[i].blkSize * mtGlobMemoCfg.bkt[i].numBlks);
    }
    osCp.wls.allocAddr = WLS_Alloc(osCp.wls.intf,
-#ifdef INTEL_L1_V19_10
+#ifdef INTEL_L1_V20_03_ONWARDS
+    nWlsMacMemorySize+nWlsPhyMemorySize);   
+#elif INTEL_L1_V19_10
         WLS_MEMORY_SIZE);
 #else
    (reqdMemSz + (4 * 1024 * 1024)));