--- ./source/private_module/adapter/ba/ba_drv.c	2018-04-19 02:57:01.000000000 +0000
+++ ./source/private_module/adapter/ba/ba_drv.c.hotpatch	2018-12-06 03:49:32.000000000 +0000
@@ -66,6 +66,10 @@
 
 /*·¼Ľṹ*/
 BA_DRVLINK_MANAGE_S g_baLinkMgr;
+/*Begin Modified by l00456189 DTS2018092910057 20181026*/
+BA_DRV_LINK_S g_baSessionEventHandling = {0};
+uint32_t  g_countUpEvent = 0;  /*¼ǰ·up ¼ռԴĸ*/
+/*end Modified by l00456189 DTS2018092910057 20181026*/
 /*IODл̵߳CMD*/
 LVOS_SCHED_WORK_S g_baworkThread;    /*BD̶߳*/
 /*ʱϱEPL·ϢĻ*/
@@ -75,14 +79,10 @@
 /*Begin Modified by cwx283789@20171102 ɶλ*/
 BA_EVENT_COUNT_S g_baEventCount;
 /*End Modified by cwx283789@20171102 ɶλ*/
-
 BA_HOST_MGR_S g_baHostMgr;
-
 extern uint64_t g_baSkipDiskIn[];
-
 extern uint32_t g_baDrvEvent;
 
-
 /*Begin Modified by y00378818 CR2016112210947147 20170223*/
 typedef struct tagBA_SAS_PORT_INFO{
     uint32_t portId; /*sas port˿ں*/
@@ -729,7 +729,7 @@
     return canHandle;
 }
 
-
+void baSaveHandlingEvent(BA_DRV_EVENT_S *event);
 /*Begin Modified by y00378818 CR2016112210947147 20170223*/
 /**************************************************************************
 *     : BAϱDISK·¼
@@ -745,21 +745,24 @@
     BA_DRV_EVENT_S *event = NULL;
     /*Begin Modified by l90005948 DTS2016030909360 20160310*/
     unsigned long flags = 0;
-
     spin_lock_irqsave(&g_baLinkMgr.eventLock, flags);
     if (!list_empty(&g_baLinkMgr.drvEventHead))
     {
         next = g_baLinkMgr.drvEventHead.next;
         event = list_entry(next, BA_DRV_EVENT_S, sibling);
         list_del(next);
+        if(BA_EVENT_DRV_SESSION == event->type)/*Begin Modified by l00456189 DTS2018092910057 20181026*/
+        {
+            spin_lock(&g_baLinkMgr.linkLock);
+            baSaveHandlingEvent(event);
+            spin_unlock(&g_baLinkMgr.linkLock);
+        }/*ڴ·¼ȫֱend*/        
     }
     spin_unlock_irqrestore(&g_baLinkMgr.eventLock, flags);
-
     if (NULL == event)
     {
         return;
     }
-
     switch (event->type)
     {
         case BA_EVENT_DRV_DISK:
@@ -772,24 +775,21 @@
             
         case BA_EVENT_INI_READY:
             baEplHandleEvent(event);
-            break;
-            
+            break;           
         case BA_EVENT_EPL_DOWN:
             baSessionNotifyEplDown(event);
             break;
-
         case BA_EVENT_DRV_PORT_OUT:
             baPortHandleEvent(event);
             break;
         default:
             break;
     }
-    
+   
     spin_lock_irqsave(&g_baLinkMgr.eventLock, flags);
     g_baLinkMgr.isHandling = FALSE;
     spin_unlock_irqrestore(&g_baLinkMgr.eventLock, flags);
     /*End Modified by l90005948 DTS2016030909360 20160310*/
-
     baReportEvent();
     UNREFERENCE_PARAM(argv);
 }
@@ -1975,8 +1975,7 @@
 {
     uint16_t index = 0;
     bool match = FALSE;
-    uint32_t linkId = 0;
-    
+    uint32_t linkId = 0;   
     spin_lock(&g_baLinkMgr.linkLock);
     for (index = 0; index < MAX_SUPPORT_LINK; index++)
     {
@@ -2001,8 +2000,9 @@
         return INVALID_VALUE32;
     }
     linkId = baSessionNewMgrNode(session);
+    memset(&g_baSessionEventHandling, 0, sizeof(BA_DRV_LINK_S) );//l00456189 DTS2018092910057
     spin_unlock(&g_baLinkMgr.linkLock);
-    
+   
     return linkId;
 }
 
@@ -2901,7 +2901,7 @@
 
     BA_PUT_DRVLINK(linkId);
 }
-
+void baInitHandlingEvent(void);//modify l00456189 DTS2018092910057 20181026
 /**************************************************************************
 *     :ȡһdrvLink
 * : session:¼
@@ -2915,14 +2915,13 @@
     uint32_t linkId = INVALID_VALUE32;
     bool isExist = FALSE;
     uint32_t hostId = INVALID_VALUE32;
-
-    hostId = session->hostId;
-    
+    hostId = session->hostId;   
     linkId = baSessionAddNewNode(session, &isExist);
     if (INVALID_VALUE32 == linkId)
     {
         /*ûUP¼ֱDOWNֱͷ*/
         baSessionHandleBadEvent(session);
+        baInitHandlingEvent();//modify l00456189 DTS2018092910057 20181026
         return;
     }
     
@@ -2961,6 +2960,7 @@
             break;
     }
     baSessionDelLink(session);
+    baInitHandlingEvent();//modify l00456189 DTS2018092910057 20181026
 }
 
 /*Modified by c00271321 DTS2014101900762 20141021 Begin*/
@@ -3292,7 +3292,7 @@
     }
 }
 /*End Modified by cwx283789@20171102 ɶλ*/
-
+bool baCheckDrvEventInterface(DRV_SESSION_S *drvInfo);
 /**************************************************************************
 *     : BAϱ·߼ӵĽӿ
 * : v_eEvtType:ϱ¼
@@ -3306,9 +3306,13 @@
 {
     DRV_SNDEVT_DATA_S *drvEvent = NULL;
     DRV_SESSION_S *drvInfo = NULL;
-    BA_DRV_EVENT_S *session = NULL;
+    //BA_DRV_EVENT_S *session = NULL;
     int32_t ret = RETURN_ERROR;
-
+    
+    /*Begin Modified by l00456189 DTS2018092910057 20181026*/
+    bool eventCanHandle = TRUE;
+    /*End Modified by l00456189 DTS2018092910057 20181026*/
+    
     UNREFERENCE_PARAM(v_eEvtType);
     drvEvent = (DRV_SNDEVT_DATA_S *)v_pvEvtData;
     drvInfo = &drvEvent->uDat.stSessionEvent;
@@ -3322,22 +3326,18 @@
     /*Begin Modified by cwx283789@20171102 ɶλ*/
     baSessionCalSessionEvent(drvInfo);
     /*End Modified by cwx283789@20171102 ɶλ*/
-
-    session = baSessionNewNode();
-    if (NULL == session)
+    
+    /*Begin Modified by l00456189 DTS2018092910057 20181026*/
+    /*Ϊϱ¼Դ͹ŵ˺*/
+    eventCanHandle = baCheckDrvEventInterface(drvInfo);
+    if (TRUE != eventCanHandle)
     {
-        DBG_LogError(LOG_ID_BA_00D0, "Drive link(%d:%d:%d) new node fail.",
-                        drvInfo->uiScsiHostId, 
-                        drvInfo->uiChannelId,
-                        drvInfo->uiScsiId);
-        return; 
+        return;
     }
-
-    session->type = BA_EVENT_DRV_SESSION;
-    baSessionCopyDrvInfo(drvInfo, (BA_DRV_LINK_S *)(void *)session->data);    
-    baSessionSetLinkStatus(drvInfo, (BA_DRV_LINK_S *)(void *)session->data);
-
-    baInsertEventNode(session);
+    /*End Modified by l00456189 DTS2018092910057 20181026*/
+	
+	
+    
     baReportEvent();
 }
 
@@ -4137,3 +4137,507 @@
     spin_lock_destroy(&g_baLinkMgr.eventLock);
 }
 
+/*Begin Modified by l00456189 DTS2018092910057 20181026*/
+/**************************************************************************
+*     : ȡ¼
+* : session
+* :  
+* ֵ  : ¼ֵ
+*     : һ·߼ɵú֤
+**************************************************************************/
+uint8_t baGetDrvSessionType(DRV_SESSION_S* session)
+{
+    /*INI ¼UP Down*/
+    if(BA_LINK_INI == session->ucLgnType)
+    {
+        if(BA_DRV_UP == session->ucStatus)
+        {
+            return BA_SESSION_INI_UP;
+        }
+	else
+	{
+	    return BA_SESSION_INI_DOWN;
+	}
+    }
+    /*TGT ¼UP Down*/
+    if(BA_DRV_UP == session->ucStatus)
+    {
+        return BA_SESSION_TGT_UP;
+    }
+    else
+    {
+        return BA_SESSION_TGT_DOWN;
+    }
+}
+
+/**************************************************************************
+*     : Ƿͬһ·¼
+* : drvInfo:ϱ¼; oldLink:¼
+* :  
+* ֵ  : TURE or FALSE
+*     : һ·߼ɵú֤
+**************************************************************************/
+bool baLinkCheckIsMatch(DRV_SESSION_S *drvInfo, BA_DRV_LINK_S *oldLink)
+{
+    char  rmTgtName[BDM_ISCSI_NAME] = {0};
+
+    switch (drvInfo->ucType)
+    {
+        /*FC */
+        case DRV_TYPE_FC_UNF:
+        case DRV_TYPE_FC:
+            if((drvInfo->ullLocalWWPN == oldLink->localWwpn)
+                && (drvInfo->ullRemoteWWPN == oldLink->remoteWwpn))
+            {
+                return TRUE;
+            }
+            return FALSE;  
+        /* ISCSI */
+        case DRV_TYPE_NIC:
+            /*칹֧ISCSIWWNǷ*/
+            if (INVALID_VALUE64 != oldLink->arrayWwn)
+            {
+                if ((drvInfo->uiLocalPortId == oldLink->newLocalPortId)
+                    && (drvInfo->ucLocalControllerId == oldLink->localCtrl)
+                    && (drvInfo->ucRemoteControllerId == oldLink->remoteCtrl)
+                    && (drvInfo->uiRemotePortId == oldLink->newRemotePortId)
+                    && (drvInfo->ullRemoteArrayWWN == oldLink->arrayWwn))
+                {
+                    return TRUE;
+                }
+                return FALSE;
+            }
+
+            memcpy(rmTgtName, drvInfo->acTgtName, BDM_ISCSI_NAME - 1);
+            rmTgtName[BDM_ISCSI_NAME - 1] = '\0';
+            if ((drvInfo->uiLocalPortId == oldLink->newLocalPortId)
+                && (drvInfo->ucLocalControllerId == oldLink->localCtrl)
+                && (0 == strncmp(rmTgtName, oldLink->rmTgtName, BDM_ISCSI_NAME)))
+            {
+                return TRUE;
+            }
+            return FALSE;
+        default:
+            return FALSE;
+    }
+    
+}
+
+/**************************************************************************
+*     : ·UPǷԱ
+* : 
+* : 
+* ֵ  : TURE or FALSE
+*     : 
+**************************************************************************/ 
+bool baCheckIsDrvUpEventCanHandle(void)
+{
+    /*ǰѾuplink¼дup¼ܺͲܳԤԴBA_LINK_POOL һ*/
+    if( MAX_SUPPORT_LINK > g_countUpEvent)
+    {
+        return TRUE;
+    }
+
+    BDM_PRINT_LIMIT_PERIOD(BDM_LOG_INTERVAL_DEFULT, 2, DBG_LOG_WARNING, LOG_ID_BA_00D0,
+                          "Event event count(%u).", g_countUpEvent);
+    
+    return FALSE;
+}
+
+/**************************************************************************
+*     : ·DOWNǷԱ
+* : drvInfo
+* : 
+* ֵ  : TURE or FALSE
+*     : һ·߼ɵú֤
+**************************************************************************/ 
+bool baCheckIsDrvDownEventCanHandle(DRV_SESSION_S *drvInfo)
+{
+    uint16_t index = 0;
+    bool match = FALSE;
+    uint64_t logKey = ((uint64_t)drvInfo->uiScsiHostId | (uint64_t)drvInfo->uiChannelId |
+	((uint64_t)drvInfo->uiScsiId << 32)); 
+
+    /*Ѵ¼ǷжӦup ¼*/
+    spin_lock(&g_baLinkMgr.linkLock);
+    for (index = 0; index < MAX_SUPPORT_LINK; index++)
+    {
+        if (NULL == g_baLinkMgr.link[index]) 
+        {
+            continue;
+        }
+        match = baLinkCheckIsMatch(drvInfo, g_baLinkMgr.link[index]);
+        if (match)
+        {
+            spin_unlock(&g_baLinkMgr.linkLock);
+            return TRUE;
+        }
+    }
+
+    /*ڴ¼ǷΪӦup¼*/
+    /*wwnΪ㣬ڴ¼*/
+    if(0 != g_baSessionEventHandling.arrayWwn)
+    {
+        switch(baSessionGetStat(&g_baSessionEventHandling))
+        {
+            case BA_SESSION_INI_UP:
+            case BA_SESSION_TGT_UP:
+                if(baLinkCheckIsMatch(drvInfo, &g_baSessionEventHandling))
+                {
+                     spin_unlock(&g_baLinkMgr.linkLock);
+                     return TRUE;
+                }
+                break;
+            default:
+                break;
+        }
+    }
+    
+    spin_unlock(&g_baLinkMgr.linkLock);
+    
+    BDM_LOG_ERR_CAN_PRINT(LOG_ID_BA_0167,
+                            3600 * HZ, logKey,
+                            "DEVICE: invalid link H:C:T(%d:%d:%d) event is in list, remove new event.",
+                            drvInfo->uiScsiHostId,
+                            drvInfo->uiChannelId,
+                            drvInfo->uiScsiId);
+            
+    return FALSE;
+}
+
+/**************************************************************************
+*     : ¼ǷԴ
+* : drvInfo
+* : 
+* ֵ  : TURE or FALSE
+*     : һ·߼ɵú֤
+**************************************************************************/ 
+bool baCheckIsDrvEventCanHandle(DRV_SESSION_S *drvInfo)
+{
+    bool canHandle = FALSE;
+
+    /*յUP ¼*/
+    if (1 == drvInfo->ucStatus)
+    {
+        canHandle = baCheckIsDrvUpEventCanHandle();
+    }
+    else
+    {
+        canHandle = baCheckIsDrvDownEventCanHandle(drvInfo);
+    }   
+	
+    return canHandle;
+}
+
+/**************************************************************************
+*     : Ƿظ¼
+* : drvInfo
+* : 
+* ֵ  : TURE or FALSE
+*     : һ·߼ɵú֤
+**************************************************************************/ 
+bool baCheckIsReduplicateDrvEvent(DRV_SESSION_S* drvInfo, BA_DRV_EVENT_S* tmpEvent)
+ {
+    if (NULL == drvInfo || NULL == tmpEvent)
+    {
+        return FALSE;//ϲжϣ߲
+    }
+    
+    BA_DRV_LINK_S* tmpSession = NULL;
+     
+    if (BA_EVENT_DRV_SESSION != tmpEvent->type)
+    {
+        return FALSE;
+    }	 
+    tmpSession = (BA_DRV_LINK_S*)(void*)tmpEvent->data;
+     
+    /*Ƿͬһ·¼*/
+    if(TRUE != baLinkCheckIsMatch(drvInfo, tmpSession))
+     {
+        return FALSE;
+    }
+
+    /*һ·¼жǷͬΪINI TGT ¼*/
+    switch (baGetDrvSessionType(drvInfo))
+    {
+        case BA_SESSION_INI_UP:
+        case BA_SESSION_INI_DOWN:
+            if (BA_SESSION_INI_DOWN == baSessionGetStat(tmpSession)
+                || BA_SESSION_INI_UP == baSessionGetStat(tmpSession))
+            {
+                return TRUE;     
+            }
+            break;
+        case BA_SESSION_TGT_UP:
+        case BA_SESSION_TGT_DOWN:
+            if (BA_SESSION_TGT_DOWN == baSessionGetStat(tmpSession)
+                || BA_SESSION_TGT_UP == baSessionGetStat(tmpSession))
+            {
+                return TRUE;
+            }
+            break;
+        default:
+            break;
+    }
+	
+    return FALSE;
+}
+
+/**************************************************************************
+*     : жǷҪ¼ɾ¼
+* : drvInfo:ϱ¼
+*                         tmpEvent:Ѿڵ¼
+*
+* : 
+* ֵ  : Ƿƥ
+*     : һ·߼ɵú֤
+**************************************************************************/
+bool baDrvCheckDelLinkEvent(DRV_SESSION_S* drvInfo, BA_DRV_EVENT_S* tmpEvent)
+ {
+    if (NULL == drvInfo || NULL == tmpEvent)
+    {
+        return FALSE;//ϲжϣ߲
+    }
+    
+    BA_DRV_LINK_S* tmpSession = (BA_DRV_LINK_S*)(void*)tmpEvent->data; 
+    uint64_t logKey = ((uint64_t)drvInfo->uiScsiHostId | (uint64_t)drvInfo->uiChannelId |
+		((uint64_t)drvInfo->uiScsiId << 32)); 
+	
+    /*ͬȥ¼*/ 
+    if (baGetDrvSessionType(drvInfo) == baSessionGetStat(tmpSession))
+    { 
+        BDM_LOG_ERR_CAN_PRINT(LOG_ID_BA_0167,
+                                3600 * HZ, logKey,  
+                                "DEVICE: same link H:C:T(%d:%d:%d) event is in list, remove new event.", 
+                                drvInfo->uiScsiHostId,  
+                                drvInfo->uiChannelId, 
+                                drvInfo->uiScsiId); 
+        return TRUE; 
+    }  
+    
+    /*¼ͬͬΪһ·INI/TGT¼Ϊ෴¼*/ 
+    switch (baGetDrvSessionType(drvInfo)) 
+    { 
+        case BA_SESSION_INI_UP: 
+        case BA_SESSION_TGT_UP://UP¼Ҫ˳ 
+            return FALSE;  
+        case BA_SESSION_INI_DOWN:
+        case BA_SESSION_TGT_DOWN://DOWN¼ȥǰUP¼,տܻᵼͬһ·DOWN¼ 
+                BDM_LOG_ERR_CAN_PRINT(LOG_ID_BA_0168,
+                            3600 * HZ, (uint64_t)logKey, 
+                            "DEVICE_OUT: link H:C:T(%d:%d:%d) down event, remove new and link up events.", 
+                            drvInfo->uiScsiHostId,  
+                            drvInfo->uiChannelId, 
+                            drvInfo->uiScsiId);
+            //baSessionDelNode(event);  
+            list_del(&tmpEvent->sibling); 
+            baSessionDelNode(tmpEvent); 
+            return FALSE; 
+        default: 
+            BDM_LOG_ERR_CAN_PRINT(LOG_ID_BA_0167,
+                                    3600 * HZ, logKey,
+                                    "DEVICE: invalid link H:C:T(%d:%d:%d) event is in list, remove new event.",
+                                    drvInfo->uiScsiHostId,
+                                    drvInfo->uiChannelId,
+                                    drvInfo->uiScsiId);
+            return TRUE;
+    } 
+}
+
+/**************************************************************************
+*     : ·¼ȥ
+* : drvInfo
+*
+* : 
+* ֵ  : TRUE:ҪȥأѾȥشFALSEҪȥ
+*     : һ·߼ɵú֤
+**************************************************************************/ 
+bool baHandleReduplicateEvent(DRV_SESSION_S *drvInfo)
+{
+    struct list_head* pos = NULL;
+    struct list_head* n = NULL;
+    BA_DRV_EVENT_S* tmpEvent = NULL;
+    bool needDel = FALSE;
+
+    /*·¼ԵĽȥش*/
+    list_for_each_prev_safe(pos, n, &g_baLinkMgr.drvEventHead)
+    {
+        tmpEvent = list_entry(pos, BA_DRV_EVENT_S, sibling);
+        
+        //жǷͬһ·INI/TGT¼
+        if (baCheckIsReduplicateDrvEvent(drvInfo, tmpEvent))
+        {
+            //жǷҪɾǰϱ¼
+            needDel = baDrvCheckDelLinkEvent(drvInfo, tmpEvent);
+        }
+        
+    }
+
+    return needDel;
+}
+
+/**************************************************************************
+*     : ¼ڴģ·¼
+* : drvInfo
+*
+* : 
+* ֵ  : TRUE:ҪȥأѾȥشFALSEҪȥ
+*     : úж
+**************************************************************************/ 
+void baSaveHandlingEvent(BA_DRV_EVENT_S *event)
+{
+    BA_DRV_LINK_S *session = NULL;
+    if (NULL == event)
+    {
+        return;
+    }   
+    session = (BA_DRV_LINK_S *)(void *)event->data;
+    memset(&g_baSessionEventHandling, 0, sizeof(BA_DRV_LINK_S));
+    g_baSessionEventHandling.drvType = session->drvType;
+    g_baSessionEventHandling.status = session->status;
+    g_baSessionEventHandling.localCtrl = session->localCtrl;
+    g_baSessionEventHandling.remoteCtrl = session->remoteCtrl;
+    g_baSessionEventHandling.arrayWwn = session->arrayWwn;
+    g_baSessionEventHandling.localWwpn = session->localWwpn;
+    g_baSessionEventHandling.remoteWwpn = session->remoteWwpn;
+    g_baSessionEventHandling.newLocalPortId = session->newLocalPortId;
+    g_baSessionEventHandling.newRemotePortId = session->newRemotePortId;
+    memcpy(g_baSessionEventHandling.rmTgtName, session->rmTgtName, BDM_ISCSI_NAME - 1);
+    g_baSessionEventHandling.rmTgtName[BDM_ISCSI_NAME - 1] = '\0';
+
+    return;
+}
+
+/**************************************************************************
+*     : ¼򲹶֮ǰ·UP
+* : 
+*
+* : 
+* ֵ  : ·UP
+*     :ڳʼȫֱg_countUpEvent
+**************************************************************************/
+uint32_t baCountUpLinkInit(void)
+{
+    uint16_t index = 0;
+    uint32_t upLinkcount = 0;
+    BA_DRV_LINK_S *session = NULL;
+    struct list_head* pos = NULL;
+    struct list_head* n = NULL;
+    BA_DRV_EVENT_S* tmpEvent = NULL;
+    uint8_t tmpType = BA_SESSION_BUTT;
+    
+    //ͳ·еup¼
+    spin_lock(&g_baLinkMgr.linkLock);
+    for (index = 0; index < MAX_SUPPORT_LINK; index++)
+    {
+        if (NULL == g_baLinkMgr.link[index])
+        {
+            continue;
+        }
+
+        tmpType = baSessionGetStat(g_baLinkMgr.link[index]);
+        if ( BA_SESSION_UP == tmpType
+                || BA_SESSION_INI_UP == tmpType 
+                || BA_SESSION_TGT_UP == tmpType)
+        {
+            upLinkcount++;
+        }
+        
+    }
+    spin_unlock(&g_baLinkMgr.linkLock);
+
+    //ͳƴ¼е·up¼
+    list_for_each_prev_safe(pos, n, &g_baLinkMgr.drvEventHead)
+    {
+        tmpEvent = list_entry(pos, BA_DRV_EVENT_S, sibling);        
+        session = (BA_DRV_LINK_S *)(void *)tmpEvent->data;
+
+        if (BA_SESSION_INI_UP == baSessionGetStat(session)
+            || BA_SESSION_TGT_UP == baSessionGetStat(session))
+        {
+            upLinkcount++;
+        }
+        
+    }
+
+    return upLinkcount;
+}
+
+/**************************************************************************
+*     : ϱ¼ԤԴӿ
+* : drvInfo:ϱ¼
+*
+* : 
+* ֵ  : TUREЧ¼FALSEЧ¼
+*     : һ·߼ɵú֤
+**************************************************************************/
+bool baCheckDrvEventInterface(DRV_SESSION_S *drvInfo)
+{
+    bool canHandle = FALSE;
+    bool needDel = FALSE;
+    uint64_t flags = 0;
+    BA_DRV_EVENT_S  *session = NULL;
+ 
+    /*ֻ·¼ȥش*/
+    /*жϵǰ¼ǷظҪɾǰϱ¼*/
+    spin_lock_irqsave(&g_baLinkMgr.eventLock, flags);
+    if (BA_DRV_UP == drvInfo->ucStatus)
+    {
+         g_countUpEvent = baCountUpLinkInit();   
+    }
+
+    DBG_LogDebug(LOG_ID_BA_00D0, "current upLink count(%u).", g_countUpEvent);
+   
+    needDel = baHandleReduplicateEvent(drvInfo);
+    if (needDel)
+    {
+        /*ǰ¼Ϊظ¼Ҫ*/
+	    spin_unlock_irqrestore(&g_baLinkMgr.eventLock, flags);
+	    return FALSE;
+    }
+    
+	/*жup ·Ƿ񳬹Down¼ǷжӦup·*/
+    canHandle = baCheckIsDrvEventCanHandle(drvInfo);
+    if (TRUE != canHandle)
+    {
+        spin_unlock_irqrestore(&g_baLinkMgr.eventLock, flags);
+        return FALSE; 
+    }
+
+    session = baSessionNewNode();
+    if (NULL == session)
+    {
+        spin_unlock_irqrestore(&g_baLinkMgr.eventLock, flags);
+        DBG_LogError(LOG_ID_BA_00D0, "Drive link(%d:%d:%d) new node fail.",
+                drvInfo->uiScsiHostId, 
+                drvInfo->uiChannelId,
+                drvInfo->uiScsiId);
+        return FALSE; 
+    }
+    
+    session->type = BA_EVENT_DRV_SESSION;
+    baSessionCopyDrvInfo(drvInfo, (BA_DRV_LINK_S *)(void *)session->data);    
+    baSessionSetLinkStatus(drvInfo, (BA_DRV_LINK_S *)(void *)session->data);
+    
+    list_add_tail(&session->sibling, &g_baLinkMgr.drvEventHead);
+    spin_unlock_irqrestore(&g_baLinkMgr.eventLock, flags);
+      
+    return TRUE;
+}
+
+/**************************************************************************
+*     :¼Ѵ,ȫֱı
+* : 
+*
+* : 
+* ֵ  :
+*     : 
+**************************************************************************/
+void baInitHandlingEvent(void)
+{
+    spin_lock(&g_baLinkMgr.linkLock);   
+    memset(&g_baSessionEventHandling, 0, sizeof(BA_DRV_LINK_S) );
+    spin_unlock(&g_baLinkMgr.linkLock);   
+}
+/*end Modified by l00456189 DTS2018092910057 20181026*/
+
