[VOL-4899] Avoid ONUs being set to unreachable after multiple unsuccessful OMCI communication attempts

Change-Id: I866e223def2c22e1c997f6ffe17d434383803fb0
diff --git a/VERSION b/VERSION
index a6333e4..0d3ad67 100755
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.2.9
+2.2.10
diff --git a/internal/pkg/common/defines.go b/internal/pkg/common/defines.go
index 9cb4ba8..c2eecbd 100755
--- a/internal/pkg/common/defines.go
+++ b/internal/pkg/common/defines.go
@@ -361,12 +361,6 @@
 	OnuOmciCommunicationFailureConfig     = "ONU_OMCI_COMMUNICATION_FAILURE_CONFIG"
 	OnuOmciCommunicationFailureConfigDesc = "OMCI communication during ONU configuration failed"
 
-	OnuOmciCommunicationAbortConfig     = "ONU_OMCI_COMMUNICATION_ABORT_CONFIG"
-	OnuOmciCommunicationAbortConfigDesc = "OMCI communication during ONU configuration aborted - max failures reached: stopping device"
-
 	OnuOmciCommunicationFailureSwUpgrade     = "ONU_OMCI_COMMUNICATION_FAILURE_SW_UPGRADE"
 	OnuOmciCommunicationFailureSwUpgradeDesc = "OMCI communication during ONU SW upgrade failed"
-
-	OnuOmciCommunicationAbortSwUpgrade     = "ONU_OMCI_COMMUNICATION_ABORT_SW_UPGRADE"
-	OnuOmciCommunicationAbortSwUpgradeDesc = "OMCI communication during ONU SW upgrade aborted - max failures reached: stopping device"
 )
diff --git a/internal/pkg/common/interfaces.go b/internal/pkg/common/interfaces.go
index 69fa26f..98f644c 100755
--- a/internal/pkg/common/interfaces.go
+++ b/internal/pkg/common/interfaces.go
@@ -124,8 +124,6 @@
 	CreatePortInCore(context.Context, *voltha.Port) error
 
 	PerOnuFlowHandlerRoutine(uniID uint8)
-
-	UpdateInterface(context.Context) error
 }
 
 // IonuDeviceEntry interface to onuDeviceEntry
diff --git a/internal/pkg/common/omci_cc.go b/internal/pkg/common/omci_cc.go
index 08ee189..e49e50f 100755
--- a/internal/pkg/common/omci_cc.go
+++ b/internal/pkg/common/omci_cc.go
@@ -72,8 +72,6 @@
 // CDefaultRetries - TODO: add comment
 const CDefaultRetries = 2
 
-const cMaxConsecutiveOmciTimeouts = 3
-
 // ### OMCI related definitions - end
 
 //CallbackPairEntry to be used for OMCI send/receive correlation
@@ -123,19 +121,15 @@
 	UploadSequNo   uint16
 	UploadNoOfCmds uint16
 
-	mutexSendQueuedRequests      sync.Mutex
-	mutexLowPrioTxQueue          sync.Mutex
-	lowPrioTxQueue               *list.List
-	mutexHighPrioTxQueue         sync.Mutex
-	highPrioTxQueue              *list.List
-	mutexRxSchedMap              sync.Mutex
-	rxSchedulerMap               map[uint16]CallbackPairEntry
-	mutexMonReq                  sync.RWMutex
-	monitoredRequests            map[uint16]OmciTransferStructure
-	mutexConsecutiveOmciTimeouts sync.RWMutex
-	consecutiveOmciTimeouts      uint8
-	mutexOmciAbortInProgress     sync.RWMutex
-	omciAbortInProgress          bool
+	mutexSendQueuedRequests sync.Mutex
+	mutexLowPrioTxQueue     sync.Mutex
+	lowPrioTxQueue          *list.List
+	mutexHighPrioTxQueue    sync.Mutex
+	highPrioTxQueue         *list.List
+	mutexRxSchedMap         sync.Mutex
+	rxSchedulerMap          map[uint16]CallbackPairEntry
+	mutexMonReq             sync.RWMutex
+	monitoredRequests       map[uint16]OmciTransferStructure
 }
 
 var responsesWithMibDataSync = []omci.MessageType{
@@ -176,8 +170,6 @@
 	omciCC.highPrioTxQueue = list.New()
 	omciCC.rxSchedulerMap = make(map[uint16]CallbackPairEntry)
 	omciCC.monitoredRequests = make(map[uint16]OmciTransferStructure)
-	omciCC.consecutiveOmciTimeouts = 0
-	omciCC.omciAbortInProgress = false
 	return &omciCC
 }
 
@@ -408,11 +400,6 @@
 	rxCallbackEntry, ok := oo.rxSchedulerMap[omciMsg.TransactionID]
 	if ok && rxCallbackEntry.CbFunction != nil {
 
-		// valid OMCI Response Message received - reset counter of consecutive OMCI timeouts
-		oo.mutexConsecutiveOmciTimeouts.Lock()
-		oo.consecutiveOmciTimeouts = 0
-		oo.mutexConsecutiveOmciTimeouts.Unlock()
-
 		if rxCallbackEntry.FramePrint {
 			oo.printRxMessage(ctx, rxMsg)
 		}
@@ -4405,31 +4392,6 @@
 				logger.Errorw(ctx, "reqMon: timeout waiting for response - no of max retries reached - send ONU device event!",
 					log.Fields{"tid": tid, "retries": retryCounter, "device-id": oo.deviceID})
 				oo.pOnuDeviceEntry.SendOnuDeviceEvent(ctx, OnuOmciCommunicationFailureSwUpgrade, OnuOmciCommunicationFailureSwUpgradeDesc)
-				oo.mutexConsecutiveOmciTimeouts.Lock()
-				if oo.consecutiveOmciTimeouts < cMaxConsecutiveOmciTimeouts {
-					oo.consecutiveOmciTimeouts++
-					oo.mutexConsecutiveOmciTimeouts.Unlock()
-				} else {
-					oo.consecutiveOmciTimeouts = 0
-					oo.mutexConsecutiveOmciTimeouts.Unlock()
-					oo.mutexOmciAbortInProgress.Lock()
-					if !oo.omciAbortInProgress {
-						oo.omciAbortInProgress = true
-						oo.mutexOmciAbortInProgress.Unlock()
-						logger.Errorw(ctx, "reqMon: communication aborted - no of max consecutive timeouts reached - stopping device and send ONU device event!",
-							log.Fields{"tid": tid, "device-id": oo.deviceID})
-						oo.pOnuDeviceEntry.SendOnuDeviceEvent(ctx, OnuOmciCommunicationAbortSwUpgrade, OnuOmciCommunicationAbortSwUpgradeDesc)
-						// stop all running FSM processing
-						_ = oo.pBaseDeviceHandler.UpdateInterface(ctx)
-						oo.mutexOmciAbortInProgress.Lock()
-						oo.omciAbortInProgress = false
-						oo.mutexOmciAbortInProgress.Unlock()
-					} else {
-						oo.mutexOmciAbortInProgress.Unlock()
-						logger.Infow(ctx, "reqMon: communication aborted - corresponding processing already running",
-							log.Fields{"tid": tid, "device-id": oo.deviceID})
-					}
-				}
 				break loop
 			} else {
 				logger.Infow(ctx, "reqMon: timeout waiting for response - retry",
@@ -4917,31 +4879,6 @@
 				logger.Errorw(ctx, "reqMon: timeout waiting for response - no of max retries reached - send ONU device event!",
 					log.Fields{"tid": tid, "retries": retryCounter, "device-id": oo.deviceID})
 				oo.pOnuDeviceEntry.SendOnuDeviceEvent(ctx, OnuOmciCommunicationFailureConfig, OnuOmciCommunicationFailureConfigDesc)
-				oo.mutexConsecutiveOmciTimeouts.Lock()
-				if oo.consecutiveOmciTimeouts < cMaxConsecutiveOmciTimeouts {
-					oo.consecutiveOmciTimeouts++
-					oo.mutexConsecutiveOmciTimeouts.Unlock()
-				} else {
-					oo.consecutiveOmciTimeouts = 0
-					oo.mutexConsecutiveOmciTimeouts.Unlock()
-					oo.mutexOmciAbortInProgress.Lock()
-					if !oo.omciAbortInProgress {
-						oo.omciAbortInProgress = true
-						oo.mutexOmciAbortInProgress.Unlock()
-						logger.Errorw(ctx, "reqMon: communication aborted - no of max consecutive timeouts reached - stopping device and send ONU device event!",
-							log.Fields{"tid": tid, "device-id": oo.deviceID})
-						oo.pOnuDeviceEntry.SendOnuDeviceEvent(ctx, OnuOmciCommunicationAbortConfig, OnuOmciCommunicationAbortConfigDesc)
-						// stop all running FSM processing
-						_ = oo.pBaseDeviceHandler.UpdateInterface(ctx)
-						oo.mutexOmciAbortInProgress.Lock()
-						oo.omciAbortInProgress = false
-						oo.mutexOmciAbortInProgress.Unlock()
-					} else {
-						oo.mutexOmciAbortInProgress.Unlock()
-						logger.Infow(ctx, "reqMon: communication aborted - corresponding processing already running",
-							log.Fields{"tid": tid, "device-id": oo.deviceID})
-					}
-				}
 				break loop
 			} else {
 				logger.Infow(ctx, "reqMon: timeout waiting for response - retry",