--- ./source/private_module/mp/mp_lun.c	2018-04-22 08:45:38.000000000 +0000
+++ ./source/private_module/mp/mp_lun.c.hotpatch	2019-02-14 12:37:29.000000000 +0000
@@ -34,7 +34,7 @@
 extern MP_ARRAY_MGR_S g_mpArrayMgr;
 /* end  x00279118@2015/3/6 DTS2015030603559 */
 extern MP_DISK_DEBUG_PS_MODE g_mpDbgDiskPsMode;
-
+#define MP_ARRAY_EMC_CLARIION_SPH012    3
 #define CASE_MP_SET_STATUS \
         case MP_DEV_UA: \
         case MP_DEV_DEL: \
@@ -120,19 +120,22 @@
     memset(lun, 0, sizeof(LOGICAL_CAMO_UNIT_S));
     FREE_STRUCTURE(lun, g_mpCamoLun.memCamoLunPool);
 }
+#define ORIGIN_VPID_LEN 25
+typedef struct tagMP_PATH_INQUIRY_DATA_SPH012_S
+{
+    MP_PATH_INQUIRY_DATA_S aslInfo;//lint -e754
+    uint8_t originVPID[ORIGIN_VPID_LEN];              /*·Ӧеĳ*/
+} MP_PATH_INQUIRY_DATA_SPH012_S;
 
-/* begin y00325094@20150929 DTS2015092800540 ְ֧ʱ·ϵCamoLun Ϣ*/
 /**************************************************************************
 *     : aslInfoϢ䵽αװLUN 
 * : 
-*
-* : 
-* ֵ  : 
-*           
-*     : 
 **************************************************************************/
 void mpCamoLunFillInfo(MP_PATH_INQUIRY_DATA_S* aslInfo, LOGICAL_CAMO_UNIT_S* camolun)
 {
+    MP_ASM_EVENT_CONTEXT_S vendorArg;
+    uint32_t aslId = INVALID_VALUE32;
+    MP_PATH_INQUIRY_DATA_SPH012_S* tmpAslInfo = NULL;
     /*begin y00325094@20170711 ߽ӹ*/
     /*ϢǻΪαװLUN ͬϢ*/
     camolun->isThin = aslInfo->isThin;                  /* αװLUN ǷthinLUN */
@@ -144,7 +147,15 @@
     memcpy(camolun->lunSn, aslInfo->arraySn, MP_MAX_LUN_SN_LENGTH);/*еSN*/
     memcpy(camolun->descriptor, aslInfo->descriptor, MP_LUN_UUID_DESCRIPTOR_LEN);
     mpSetDevFlag(&(camolun->lun)->ctrlFlag, MP_CAMO_LUN_FLAG); /*LUN*/
-    
+    vendorArg.vendor = camolun->lun->vendor;
+    vendorArg.product =  camolun->lun->product;
+    vendorArg.version = NULL;
+    aslId = mpGetDriverIdFromWl(&vendorArg);
+    if (aslId == MP_ARRAY_EMC_CLARIION_SPH012)
+    {
+         tmpAslInfo = (MP_PATH_INQUIRY_DATA_SPH012_S*)aslInfo;
+         memcpy(camolun->lunSn, tmpAslInfo->originVPID, ORIGIN_VPID_LEN);
+    }
     /*ΪαװϢ*/
     if (MP_CAMO_LUN_ENABLE == aslInfo->camoFlag)
     {
@@ -174,17 +185,6 @@
     /*end y00325094@20170711 ߽ӹ*/
     return;
 }
-/* end y00325094@20150929 DTS2015092800540 */
-
-/**************************************************************************
-*     : ʼһαװLUN
-* : 
-*
-* : 
-* ֵ  : NULL:LUNʧ
-*           !NULL:LUNݽṹ
-*     : 
-**************************************************************************/
 void mpCamoLunInitDev(MP_PATH_INQUIRY_DATA_S* aslInfo, LOGICAL_CAMO_UNIT_S* camolun)
 {
     SMART_TP_CALL(MP_GET_REG_FAIL_LUN_IN, &(aslInfo->prInfo.regStatus));
@@ -362,7 +362,7 @@
      :
 **************************************************************************/
 static int32_t mpFillCamoLunInfo(LOGICAL_CAMO_UNIT_S* camoLun,
-                                 ADM_LUN_OVER_CTRL_INFO_S* camoLunDbInfo, uint32_t availIndex)
+                                 ADM_LUN_OVER_CTRL_INFO_S* camoLunDbInfo, uint32_t availIndex)/*lint -e528*/
 {
     int32_t ret = RETURN_ERROR;
     uint32_t index = 0;
@@ -534,14 +534,14 @@
     /* end   x00279118 20150310 DTS2015030407611 */
     return RETURN_OK;
 }
-
+int32_t mpGetAvailLunUuidIndex_SPH012(LOGICAL_UNIT_S* lun, uint32_t* preIndex);
+int32_t mpFillCamoLunInfo_SPH012(LOGICAL_CAMO_UNIT_S* camoLun,
+                                 ADM_LUN_OVER_CTRL_INFO_S* camoLunDbInfo, uint32_t availIndex);
 /**************************************************************************
    : mpGetAvailLunUuidIndex
      : ȡuuid Чindex 
  : LUN WWN
  : int32_t
-   ֵ: RETURN_ERROR RETURN_OK
-     :
 **************************************************************************/
 int32_t mpGetAvailLunUuidIndex(LOGICAL_UNIT_S* lun, uint32_t* preIndex, uint32_t* afterIndex)
 {
@@ -591,7 +591,7 @@
     int32_t ret = RETURN_ERROR;
     uint8_t uuidStr[2 * MP_MAX_UUID_LEN + 1] = {0};
     uint32_t forIndex = 0;
-    uint32_t backIndex = 0;
+
     
     spin_lock(&g_mpCamoLun.lock);
     list_for_each(lunList, &g_mpCamoLun.lunHead)
@@ -601,10 +601,10 @@
         /*begin y00325094@20170713 ЭȡLUNWWN descriptor */
         if (NULL != camoLun->lun)
         {   /* begin lwx227025@20180110 ȡαװWWNʧ DTS2017121211074*/
-            ret = mpGetAvailLunUuidIndex(camoLun->lun, &forIndex, &backIndex);
+            ret = mpGetAvailLunUuidIndex_SPH012(camoLun->lun, &forIndex);
             if (RETURN_ERROR != ret)
             {
-                if (0 == memcmp(wwn, &camoLun->wwn[forIndex],backIndex - forIndex + 1))
+                if (0 == memcmp(wwn, &camoLun->wwn[forIndex], MP_MAX_UUID_LEN - forIndex))
                 {
                     isCamoLunExist = TRUE;
                     break;
@@ -623,7 +623,7 @@
         return ret;
     }
 
-    ret = mpFillCamoLunInfo(camoLun, camoLunDbInfo, forIndex);
+    ret = mpFillCamoLunInfo_SPH012(camoLun, camoLunDbInfo, forIndex);
 
     spin_unlock(&g_mpCamoLun.lock);
     BDM_LOG_INFO_CAN_PRINT(LOG_ID_MP_0286, MP_PRINT_INTERVAL_LOG, 1ULL,
@@ -6453,4 +6453,104 @@
 }
 EXPORT_SYMBOL(mpLunCheckLunIsInvalid);
 
+/* begin DTS2018111404790 hwx469378@201181112 αװeDevLUNeDevLUNӳʧ */
+/**************************************************************************
+  : mpGetAvailLunUuidIndex
+    : ȡuuid Чindex
+: LUN WWN
+: int32_t
+  ֵ: RETURN_ERROR RETURN_OK
+    :
+**************************************************************************/
+int32_t mpGetAvailLunUuidIndex_SPH012(LOGICAL_UNIT_S* lun, uint32_t* preIndex)
+{
+    uint32_t forIndex = 0;
+
+    for (forIndex = 0; forIndex < MP_MAX_UUID_LEN; forIndex++)
+    {
+        if (0 != lun->uuid[forIndex])
+        {
+            break;
+        }
+    }
 
+
+    if (forIndex >= MP_MAX_UUID_LEN)
+    {
+        return RETURN_ERROR;
+    }
+
+    *preIndex = forIndex;
+
+    return RETURN_OK;
+}
+ /* end DTS2018111404790 hwx469378@201181112 αװeDevLUNeDevLUNӳʧ */
+
+ /**************************************************************************
+   : mpFillCamoLunInfo
+     : ṩADMӿڲѯαװLUNϢǰݺ
+ : camoLun  lun
+ : camoLunInfo
+   ֵ: NA
+     :
+**************************************************************************/
+int32_t mpFillCamoLunInfo_SPH012(LOGICAL_CAMO_UNIT_S* camoLun,
+                                 ADM_LUN_OVER_CTRL_INFO_S* camoLunDbInfo, uint32_t availIndex)
+{
+    int32_t ret = RETURN_ERROR;
+    uint32_t index = 0;
+    MP_ASM_EVENT_CONTEXT_S vendorArg;
+    uint32_t aslId = INVALID_VALUE32;
+
+    if ((NULL == camoLun) || (NULL == camoLun->lun))
+    {
+        return MP_LUN_RET_ARRAY_DEFAULT_OR_UNSUPPORT;
+    }
+    if (MP_MAX_UUID_LEN >= camoLun->descriptor[MP_LUN_UUID_LEN_INDEX])
+    {
+        index = MP_MAX_UUID_LEN - camoLun->descriptor[MP_LUN_UUID_LEN_INDEX];
+    }
+    memcpy(camoLunDbInfo->lunWwn, &camoLun->wwn[availIndex], MP_MAX_UUID_LEN - availIndex);
+    memcpy(camoLunDbInfo->lunUuid, &camoLun->wwn[index], camoLun->descriptor[MP_LUN_UUID_LEN_INDEX]);
+    memcpy(camoLunDbInfo->descriptor, camoLun->descriptor, MP_LUN_UUID_DESCRIPTOR_LEN);
+    camoLunDbInfo->curVerMajor = camoLun->curVerMajor;
+    camoLunDbInfo->curVerMinor = camoLun->curVerMinor;
+    camoLunDbInfo->cptVerMajor = camoLun->cptVerMajor;
+    camoLunDbInfo->cptVerMinor = camoLun->cptVerMinor;
+    camoLunDbInfo->workMode = camoLun->workMode;
+    camoLunDbInfo->lunSn = camoLun->devLunId;
+    camoLunDbInfo->scsiVersion = camoLun->scsiVersion;
+    camoLunDbInfo->tmvByte = camoLun->lun->tmvByte;
+    camoLunDbInfo->prTypeMask = camoLun->lun->prTypeMask;
+    if ((NULL != camoLun->lun->currentTpg) && (NULL != camoLun->lun->currentTpg->currentPath))
+    {
+        camoLunDbInfo->hostLunId = camoLun->lun->currentTpg->currentPath->pathData.lunId;
+        camoLunDbInfo->tpgs = camoLun->lun->currentTpg->currentPath->pathData.alua;
+    }
+    else
+    {
+        return RETURN_SYSTEM_BUSY;
+    }
+    memcpy(camoLunDbInfo->arraySn, camoLun->lunSn, MP_MAX_LUN_SN_LENGTH);  
+    vendorArg.vendor = camoLun->lun->vendor;
+    vendorArg.product =  camoLun->lun->product;
+    vendorArg.version = NULL;
+    aslId = mpGetDriverIdFromWl(&vendorArg);
+    if (aslId != MP_ARRAY_EMC_CLARIION_SPH012)
+    {
+        memcpy(camoLunDbInfo->vendor, camoLun->lun->vendor, MP_VENDOR_LEN);
+        memcpy(camoLunDbInfo->product, camoLun->lun->product, MP_PRODUCT_LEN);
+    }
+    else
+    {
+        memcpy(camoLunDbInfo->vendor, camoLun->lunSn, MP_VENDOR_LEN-1);
+        camoLunDbInfo->vendor[MP_VENDOR_LEN - 1] = '\0';
+        memcpy(camoLunDbInfo->product, &camoLun->lunSn[8], MP_PRODUCT_LEN-1);
+        camoLunDbInfo->product[MP_PRODUCT_LEN - 1] = '\0';
+    }
+    memcpy(camoLunDbInfo->productRevLevel, camoLun->productRevLevel, MAX_SCSI_PRO_REV_LEN);
+    ret = mpGetCamoLunArrayWwn(camoLun->lun, camoLunDbInfo);
+    return ret;
+}
+ 
+ 
