]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - keystone-rtos/sa-lld.git/blobdiff - src/proto/datamode/sallddm.c
Replace SOC_AM65XX with NSS_LITE2
[keystone-rtos/sa-lld.git] / src / proto / datamode / sallddm.c
index 4dff4f28e9b94089c351537a4fbc045a1bf8fcd2..55cac6b91d52e10674a061a9841709878bbd9ed6 100644 (file)
@@ -116,14 +116,14 @@ static uint16_t salld_dm_verify_config_params(Sa_CipherMode_e cipherMode, Sa_Aut
     
     /* Common Check */
     if((pDataModeConfig->sessionEncKeySize > 32) ||
-#if defined (SOC_AM65XX)
+#if defined (NSS_LITE2)
        (pDataModeConfig->sessionMacKeySize > 64))
 #else
        (pDataModeConfig->sessionMacKeySize > 32))
 #endif
         return (FALSE);
 
-#ifdef NSS_LITE
+#if defined(NSS_LITE) || defined(NSS_LITE2)
     /* NSS LITE devices do not have Air Cipher Engines */
     if ((pDataModeConfig->ctrlBitMap & sa_DM_CONFIG_SELECT_AIR_CIPHER_ENG) == sa_DM_CONFIG_SELECT_AIR_CIPHER_ENG)
       return (FALSE);
@@ -163,7 +163,7 @@ static uint16_t salld_dm_verify_config_params(Sa_CipherMode_e cipherMode, Sa_Aut
                 return (FALSE);    
             break;
             
-#ifndef NSS_LITE            
+#if !defined(NSS_LITE) && !defined(NSS_LITE2)
         case sa_CipherMode_KASUMI_F8:
             if((pDataModeConfig->ivSize != 8))
                 return (FALSE);    
@@ -528,7 +528,7 @@ int16_t salld_data_mode_set_sc(salldDataModeInst_t *inst)
   Sa_ScReqInfo_t* pScInfo = &txInst->scInfo;
   int16_t encCmdlSize, encScSize, encScOffset;
   int16_t authCmdlSize, authScSize, authScOffset;
-#ifndef NSS_LITE   
+#if !defined(NSS_LITE) && !defined(NSS_LITE2)
   int16_t acAlgorithm = SA_AC_ALGORITHM_GSM_A53;
 #endif
   saDMAReqInfo_t dmaReqInfo;
@@ -536,7 +536,7 @@ int16_t salld_data_mode_set_sc(salldDataModeInst_t *inst)
   uint16_t fRandomIV;
   uint8_t firstEngId;
   uint8_t tagSize;
-#ifdef SOC_AM65XX
+#ifdef NSS_LITE2
   uint32_t ctxAttrCtrlBitMap;
 #endif
 
@@ -560,7 +560,7 @@ int16_t salld_data_mode_set_sc(salldDataModeInst_t *inst)
     }
   }
 
-#ifndef NSS_LITE
+#if !defined(NSS_LITE) && !defined(NSS_LITE2)
   if (pComInfo->authEngId == SALLD_CMDL_ENGINE_ID_ES1)
   {
     if ((pConfig->ctrlBitMap & sa_DM_CONFIG_SELECT_AIR_CIPHER_ENG) == sa_DM_CONFIG_SELECT_AIR_CIPHER_ENG)
@@ -616,7 +616,7 @@ int16_t salld_data_mode_set_sc(salldDataModeInst_t *inst)
   
   dmaReqInfo.phpEvictSize =  SA_CTX_DMA_SIZE_64;
 
-#ifdef SOC_AM65XX
+#ifdef NSS_LITE2
   if (pConfig->ctrlBitMap & sa_DM_CONFIG_PROMOTE_CHANNEL)
   {
      ctxAttrCtrlBitMap = SA_CTX_SA2UL_ALLOW_PROMOTE | SA_CTX_SA2UL_SECURE;
@@ -646,7 +646,7 @@ int16_t salld_data_mode_set_sc(salldDataModeInst_t *inst)
   /* Prepare Security Context for the encryption Engine */
   if (encScSize)
   {
-    #ifndef NSS_LITE 
+    #if !defined(NSS_LITE) && !defined(NSS_LITE2)
     if (pComInfo->encEngId == SALLD_CMDL_ENGINE_ID_ACS1)
     {
         salld_set_sc_acEnc(txInst->cipherMode, pConfig->sessionEncKeySize, 
@@ -667,7 +667,7 @@ int16_t salld_data_mode_set_sc(salldDataModeInst_t *inst)
   /* Prepare Security Context for the authentication Engine */
   if (authScSize)
   {
-    #ifndef NSS_LITE
+    #if !defined(NSS_LITE) && !defined(NSS_LITE2)
     if (pComInfo->authEngId == SALLD_CMDL_ENGINE_ID_ACS1)
     {
         salld_set_sc_acAuth(txInst->authMode, pConfig->sessionMacKeySize, 
@@ -733,23 +733,20 @@ int16_t salld_data_mode_set_sc(salldDataModeInst_t *inst)
   
   /* Prepare the SW Info Words */
   #ifndef SALLD_DATA_MODE_USE_PHP
-  if (SALLD_TEST_SASS_UL_GEN2(sysInst))
-  {
-    salld_set_swInfo2(firstEngId, 0,
-                     &txInst->destInfo,
-                     pScInfo, &txInst->swInfo, tagSize);
-  }
-  else
-  {
-    salld_set_swInfo(firstEngId, 0,
-                   &txInst->destInfo,
-                   pScInfo, &txInst->swInfo, tagSize);
-  }
+      #if defined(NSS_LITE2)
+        salld_set_swInfo2(firstEngId, 0,
+                         &txInst->destInfo,
+                         pScInfo, &txInst->swInfo, tagSize);
+      #else
+        salld_set_swInfo(firstEngId, 0,
+                       &txInst->destInfo,
+                       pScInfo, &txInst->swInfo, tagSize);
+      #endif
   #else
-  /* Data packets enter PHP engine */
-  salld_set_swInfo(SALLD_CMDL_ENGINE_SRTP_AC_HPS1, 0, 
-                   &txInst->destInfo,
-                   pScInfo, &txInst->swInfo, 0);
+      /* Data packets enter PHP engine */
+      salld_set_swInfo(SALLD_CMDL_ENGINE_SRTP_AC_HPS1, 0, 
+                       &txInst->destInfo,
+                       pScInfo, &txInst->swInfo, 0);
   #endif
   /* Store the scBuf internally as offset to suppor multiprocess */
   pScInfo->scBuf = (uintptr_t) sa_CONV_ADDR_TO_OFFSET(salldLObj.scPoolBaseAddr, pScInfo->scBuf);