[VOL-5374] go version upgrade to 1.23.1 and few other package versions upgrade

Signed-off-by: akashreddyk <akash.kankanala@radisys.com>
Change-Id: I50531e8febdc00b335ebbe5a4b1099fc3bf6d5b4
diff --git a/internal/pkg/core/device_handler.go b/internal/pkg/core/device_handler.go
index 8daca76..bab59ef 100755
--- a/internal/pkg/core/device_handler.go
+++ b/internal/pkg/core/device_handler.go
@@ -142,27 +142,20 @@
 // FlowCb is the flow control block containing flow add/delete information along with a response channel
 type FlowCb struct {
 	ctx          context.Context // Flow handler context
-	addFlow      bool            // if true flow to be added, else removed
 	flowItem     *of.OfpFlowStats
 	uniPort      *cmn.OnuUniPort
 	flowMetaData *of.FlowMetadata
 	respChan     *chan error // channel to report the Flow handling error
+	addFlow      bool        // if true flow to be added, else removed
 }
 
 // deviceHandler will interact with the ONU ? device.
 type deviceHandler struct {
-	DeviceID         string
-	DeviceType       string
-	adminState       string
-	device           *voltha.Device
-	logicalDeviceID  string
-	ProxyAddressID   string
-	ProxyAddressType string
-	parentID         string
-	ponPortNumber    uint32
+	EventProxy eventif.EventProxy
+
+	device *voltha.Device
 
 	coreClient *vgrpc.Client
-	EventProxy eventif.EventProxy
 
 	pmConfigs *voltha.PmConfigs
 	config    *config.AdapterFlags
@@ -170,19 +163,61 @@
 	pOpenOnuAc      *OpenONUAC
 	pDeviceStateFsm *fsm.FSM
 	//pPonPort        *voltha.Port
-	deviceEntrySet    chan bool //channel for DeviceEntry set event
-	pOnuOmciDevice    *mib.OnuDeviceEntry
-	pOnuTP            *avcfg.OnuUniTechProf
-	pOnuMetricsMgr    *pmmgr.OnuMetricsManager
-	pAlarmMgr         *almgr.OnuAlarmManager
-	pSelfTestHdlr     *otst.SelfTestControlBlock
-	exitChannel       chan int
-	lockDevice        sync.RWMutex
-	pOnuIndication    *oop.OnuIndication
-	deviceReason      uint8
-	mutexDeviceReason sync.RWMutex
-	pLockStateFsm     *uniprt.LockStateFsm
-	pUnlockStateFsm   *uniprt.LockStateFsm
+	deviceEntrySet  chan bool //channel for DeviceEntry set event
+	pOnuOmciDevice  *mib.OnuDeviceEntry
+	pOnuTP          *avcfg.OnuUniTechProf
+	pOnuMetricsMgr  *pmmgr.OnuMetricsManager
+	pAlarmMgr       *almgr.OnuAlarmManager
+	pSelfTestHdlr   *otst.SelfTestControlBlock
+	exitChannel     chan int
+	pOnuIndication  *oop.OnuIndication
+	pLockStateFsm   *uniprt.LockStateFsm
+	pUnlockStateFsm *uniprt.LockStateFsm
+
+	stopCollector                  chan bool
+	stopAlarmManager               chan bool
+	stopHeartbeatCheck             chan bool
+	uniEntityMap                   cmn.OnuUniPortMap
+	UniVlanConfigFsmMap            map[uint8]*avcfg.UniVlanConfigFsm
+	pOnuUpradeFsm                  *swupg.OnuUpgradeFsm
+	chUniVlanConfigReconcilingDone chan uint16 //channel to indicate that VlanConfig reconciling for a specific UNI has been finished
+	chReconcilingFinished          chan bool   //channel to indicate that reconciling has been finished
+	pLastUpgradeImageState         *voltha.ImageState
+	upgradeFsmChan                 chan struct{}
+
+	deviceDeleteCommChan chan bool
+	DeviceID             string
+	DeviceType           string
+	adminState           string
+	logicalDeviceID      string
+	ProxyAddressID       string
+	ProxyAddressType     string
+	parentID             string
+
+	flowCbChan                     []chan FlowCb
+	stopFlowMonitoringRoutine      []chan bool // length of slice equal to number of uni ports
+	isFlowMonitoringRoutineActive  []bool      // length of slice equal to number of uni ports
+	reconcileExpiryComplete        time.Duration
+	reconcileExpiryVlanConfig      time.Duration
+	lockDevice                     sync.RWMutex
+	mutexDeviceReason              sync.RWMutex
+	mutexCollectorFlag             sync.RWMutex
+	mutextAlarmManagerFlag         sync.RWMutex
+	lockVlanConfig                 sync.RWMutex
+	lockVlanAdd                    sync.RWMutex
+	lockUpgradeFsm                 sync.RWMutex
+	mutexReconcilingFlag           sync.RWMutex
+	mutexReconcilingFirstPassFlag  sync.RWMutex
+	mutexReconcilingReasonUpdate   sync.RWMutex
+	mutexReadyForOmciConfig        sync.RWMutex
+	mutexDeletionInProgressFlag    sync.RWMutex
+	mutexFlowMonitoringRoutineFlag sync.RWMutex
+	mutexForDisableDeviceRequested sync.RWMutex
+	mutexOltAvailable              sync.RWMutex
+	mutexKvStoreContext            sync.Mutex
+	ponPortNumber                  uint32
+
+	deviceReason uint8
 
 	//flowMgr       *OpenOltFlowMgr
 	//eventMgr      *OpenOltEventMgr
@@ -191,47 +226,16 @@
 	//discOnus sync.Map
 	//onus     sync.Map
 	//portStats          *OpenOltStatisticsMgr
-	collectorIsRunning             bool
-	mutexCollectorFlag             sync.RWMutex
-	stopCollector                  chan bool
-	alarmManagerIsRunning          bool
-	mutextAlarmManagerFlag         sync.RWMutex
-	stopAlarmManager               chan bool
-	stopHeartbeatCheck             chan bool
-	uniEntityMap                   cmn.OnuUniPortMap
-	mutexKvStoreContext            sync.Mutex
-	lockVlanConfig                 sync.RWMutex
-	lockVlanAdd                    sync.RWMutex
-	UniVlanConfigFsmMap            map[uint8]*avcfg.UniVlanConfigFsm
-	lockUpgradeFsm                 sync.RWMutex
-	pOnuUpradeFsm                  *swupg.OnuUpgradeFsm
-	upgradeCanceled                bool
-	reconciling                    uint8
-	mutexReconcilingFlag           sync.RWMutex
-	reconcilingFirstPass           bool
-	mutexReconcilingFirstPassFlag  sync.RWMutex
-	reconcilingReasonUpdate        bool
-	mutexReconcilingReasonUpdate   sync.RWMutex
-	chUniVlanConfigReconcilingDone chan uint16 //channel to indicate that VlanConfig reconciling for a specific UNI has been finished
-	chReconcilingFinished          chan bool   //channel to indicate that reconciling has been finished
-	reconcileExpiryComplete        time.Duration
-	reconcileExpiryVlanConfig      time.Duration
-	mutexReadyForOmciConfig        sync.RWMutex
-	readyForOmciConfig             bool
-	deletionInProgress             bool
-	mutexDeletionInProgressFlag    sync.RWMutex
-	pLastUpgradeImageState         *voltha.ImageState
-	upgradeFsmChan                 chan struct{}
-
-	flowCbChan                     []chan FlowCb
-	mutexFlowMonitoringRoutineFlag sync.RWMutex
-	mutexForDisableDeviceRequested sync.RWMutex
-	mutexOltAvailable              sync.RWMutex
-	stopFlowMonitoringRoutine      []chan bool // length of slice equal to number of uni ports
-	isFlowMonitoringRoutineActive  []bool      // length of slice equal to number of uni ports
-	disableDeviceRequested         bool        // this flag identify ONU received disable request or not
-	oltAvailable                   bool
-	deviceDeleteCommChan           chan bool
+	collectorIsRunning      bool
+	alarmManagerIsRunning   bool
+	upgradeCanceled         bool
+	reconciling             uint8
+	reconcilingFirstPass    bool
+	reconcilingReasonUpdate bool
+	readyForOmciConfig      bool
+	deletionInProgress      bool
+	disableDeviceRequested  bool // this flag identify ONU received disable request or not
+	oltAvailable            bool
 }
 
 // newDeviceHandler creates a new device handler
@@ -408,8 +412,8 @@
 	defer dh.pOnuTP.UnlockTpProcMutex()
 
 	if techProfMsg.UniId >= platform.MaxUnisPerOnu {
-		return fmt.Errorf(fmt.Sprintf("received UniId value exceeds range: %d, device-id: %s",
-			techProfMsg.UniId, dh.DeviceID))
+		return fmt.Errorf("received UniId value exceeds range: %d, device-id: %s",
+			techProfMsg.UniId, dh.DeviceID)
 	}
 	uniID := uint8(techProfMsg.UniId)
 	tpID, err := cmn.GetTpIDFromTpPath(techProfMsg.TpInstancePath)
@@ -495,8 +499,8 @@
 	if delGemPortMsg.UniId >= platform.MaxUnisPerOnu {
 		logger.Errorw(ctx, "delete-gem-port UniId exceeds range", log.Fields{
 			"device-id": dh.DeviceID, "uni-id": delGemPortMsg.UniId})
-		return fmt.Errorf(fmt.Sprintf("received UniId value exceeds range: %d, device-id: %s",
-			delGemPortMsg.UniId, dh.DeviceID))
+		return fmt.Errorf("received UniId value exceeds range: %d, device-id: %s",
+			delGemPortMsg.UniId, dh.DeviceID)
 	}
 	uniID := uint8(delGemPortMsg.UniId)
 	tpID, err := cmn.GetTpIDFromTpPath(delGemPortMsg.TpInstancePath)
@@ -536,8 +540,8 @@
 	if delTcontMsg.UniId >= platform.MaxUnisPerOnu {
 		logger.Errorw(ctx, "delete-tcont UniId exceeds range", log.Fields{
 			"device-id": dh.DeviceID, "uni-id": delTcontMsg.UniId})
-		return fmt.Errorf(fmt.Sprintf("received UniId value exceeds range: %d, device-id: %s",
-			delTcontMsg.UniId, dh.DeviceID))
+		return fmt.Errorf("received UniId value exceeds range: %d, device-id: %s",
+			delTcontMsg.UniId, dh.DeviceID)
 	}
 	uniID := uint8(delTcontMsg.UniId)
 	tpPath := delTcontMsg.TpInstancePath
@@ -1666,7 +1670,7 @@
 
 	if !dh.IsReconciling() {
 		logger.Infow(ctx, "DeviceUpdate", log.Fields{"deviceReason": dh.device.Reason, "device-id": dh.DeviceID})
-		if err := dh.updateDeviceInCore(ctx, dh.device); err != nil {
+		if err = dh.updateDeviceInCore(ctx, dh.device); err != nil {
 			logger.Errorw(ctx, "device-update-failed", log.Fields{"device-id": dh.device.Id, "error": err})
 		}
 		//TODO Need to Update Device Reason To CORE as part of device update userstory
@@ -1927,6 +1931,8 @@
 }
 
 // addOnuDeviceEntry creates a new ONU device or returns the existing
+//
+//nolint:unparam
 func (dh *deviceHandler) addOnuDeviceEntry(ctx context.Context) error {
 	logger.Debugw(ctx, "adding-deviceEntry", log.Fields{"device-id": dh.DeviceID})
 
@@ -2331,6 +2337,7 @@
 	return nil
 }
 
+//nolint:unparam
 func (dh *deviceHandler) processMibDatabaseSyncEvent(ctx context.Context, devEvent cmn.OnuDeviceEvent) {
 	logger.Debugw(ctx, "MibInSync event received, adding uni ports and locking the ONU interfaces", log.Fields{"device-id": dh.DeviceID})
 
@@ -2362,6 +2369,7 @@
 	}
 }
 
+//nolint:unparam
 func (dh *deviceHandler) processUniLockStateDoneEvent(ctx context.Context, devEvent cmn.OnuDeviceEvent) {
 	logger.Infow(ctx, "UniLockStateDone event: Starting MIB download", log.Fields{"device-id": dh.DeviceID})
 	/*  Mib download procedure -
@@ -2399,6 +2407,7 @@
 	}
 }
 
+//nolint:unparam
 func (dh *deviceHandler) processMibDownloadDoneEvent(ctx context.Context, devEvent cmn.OnuDeviceEvent) {
 	logger.Info(ctx, "MibDownloadDone event received, unlocking the ONU interfaces", log.Fields{"device-id": dh.DeviceID})
 	pDevEntry := dh.GetOnuDeviceEntry(ctx, false)
@@ -2499,6 +2508,7 @@
 	}
 }
 
+//nolint:unparam
 func (dh *deviceHandler) processUniUnlockStateDoneEvent(ctx context.Context, devEvent cmn.OnuDeviceEvent) {
 	dh.EnableUniPortStateUpdate(ctx) //cmp python yield self.enable_ports()
 
@@ -2528,6 +2538,7 @@
 	}
 }
 
+//nolint:unparam
 func (dh *deviceHandler) processUniDisableStateDoneEvent(ctx context.Context, devEvent cmn.OnuDeviceEvent) {
 	logger.Debugw(ctx, "DeviceStateUpdate upon disable", log.Fields{
 		"OperStatus": voltha.OperStatus_UNKNOWN, "device-id": dh.DeviceID})
@@ -2563,6 +2574,7 @@
 	}
 }
 
+//nolint:unparam
 func (dh *deviceHandler) processUniEnableStateDoneEvent(ctx context.Context, devEvent cmn.OnuDeviceEvent) {
 	logger.Debugw(ctx, "DeviceStateUpdate upon re-enable", log.Fields{"ConnectStatus": voltha.ConnectStatus_REACHABLE,
 		"OperStatus": voltha.OperStatus_ACTIVE, "device-id": dh.DeviceID})
@@ -2597,6 +2609,7 @@
 	}
 }
 
+//nolint:unparam
 func (dh *deviceHandler) processUniEnableStateFailedEvent(ctx context.Context, devEvent cmn.OnuDeviceEvent) {
 	logger.Debugw(ctx, "DeviceStateUpdate upon re-enable failure. ", log.Fields{
 		"OperStatus": voltha.OperStatus_FAILED, "device-id": dh.DeviceID})
@@ -2999,13 +3012,15 @@
 
 // createOnuUpgradeFsm initializes and runs the Onu Software upgrade FSM
 // precondition: lockUpgradeFsm is already locked from caller of this function
+//
+//nolint:unparam
 func (dh *deviceHandler) createOnuUpgradeFsm(ctx context.Context, apDevEntry *mib.OnuDeviceEntry, aDevEvent cmn.OnuDeviceEvent) error {
 	chUpgradeFsm := make(chan cmn.Message, 2)
 	var sFsmName = "OnuSwUpgradeFSM"
 	logger.Debugw(ctx, "create OnuSwUpgradeFSM", log.Fields{"device-id": dh.DeviceID})
 	if apDevEntry.PDevOmciCC == nil {
 		logger.Errorw(ctx, "no valid OnuDevice or omciCC - abort", log.Fields{"device-id": dh.DeviceID})
-		return fmt.Errorf(fmt.Sprintf("no valid omciCC - abort for device-id: %s", dh.device.Id))
+		return fmt.Errorf("no valid omciCC - abort for device-id: %s", dh.device.Id)
 	}
 	dh.pOnuUpradeFsm = swupg.NewOnuUpgradeFsm(ctx, dh, apDevEntry, apDevEntry.GetOnuDB(), aDevEvent,
 		sFsmName, chUpgradeFsm)
@@ -3016,7 +3031,7 @@
 				if err := pUpgradeStatemachine.Event(swupg.UpgradeEvStart); err != nil {
 					logger.Errorw(ctx, "OnuSwUpgradeFSM: can't start", log.Fields{"device-id": dh.DeviceID, "err": err})
 					// maybe try a FSM reset and then again ... - TODO!!!
-					return fmt.Errorf(fmt.Sprintf("OnuSwUpgradeFSM could not be started for device-id: %s", dh.device.Id))
+					return fmt.Errorf("OnuSwUpgradeFSM could not be started for device-id: %s", dh.device.Id)
 				}
 				/***** Upgrade FSM started */
 				//reset the last stored upgrade states (which anyway should be don't care as long as the newly created FSM exists)
@@ -3029,16 +3044,16 @@
 				logger.Errorw(ctx, "wrong state of OnuSwUpgradeFSM to start - want: disabled", log.Fields{
 					"have": pUpgradeStatemachine.Current(), "device-id": dh.DeviceID})
 				// maybe try a FSM reset and then again ... - TODO!!!
-				return fmt.Errorf(fmt.Sprintf("OnuSwUpgradeFSM could not be started for device-id: %s, wrong internal state", dh.device.Id))
+				return fmt.Errorf("OnuSwUpgradeFSM could not be started for device-id: %s, wrong internal state", dh.device.Id)
 			}
 		} else {
 			logger.Errorw(ctx, "OnuSwUpgradeFSM internal FSM invalid - cannot be executed!!", log.Fields{"device-id": dh.DeviceID})
 			// maybe try a FSM reset and then again ... - TODO!!!
-			return fmt.Errorf(fmt.Sprintf("OnuSwUpgradeFSM internal FSM could not be created for device-id: %s", dh.device.Id))
+			return fmt.Errorf("OnuSwUpgradeFSM internal FSM could not be created for device-id: %s", dh.device.Id)
 		}
 	} else {
 		logger.Errorw(ctx, "OnuSwUpgradeFSM could not be created  - abort", log.Fields{"device-id": dh.DeviceID})
-		return fmt.Errorf(fmt.Sprintf("OnuSwUpgradeFSM could not be created - abort for device-id: %s", dh.device.Id))
+		return fmt.Errorf("OnuSwUpgradeFSM could not be created - abort for device-id: %s", dh.device.Id)
 	}
 	return nil
 }
@@ -3170,6 +3185,8 @@
 
 	return kvbackend
 }
+
+//nolint:unparam
 func (dh *deviceHandler) getFlowOfbFields(ctx context.Context, apFlowItem *of.OfpFlowStats, loMatchVlan *uint16,
 	loMatchPcp *uint8, loIPProto *uint32) {
 
@@ -3891,6 +3908,7 @@
 	}
 }
 
+//nolint:unparam
 func (dh *deviceHandler) setOnuOffloadStats(ctx context.Context, config *extension.AppOffloadOnuConfig) *extension.SingleSetValueResponse {
 
 	singleValResp := extension.SingleSetValueResponse{
@@ -3947,6 +3965,7 @@
 	return pDevOmciCC.GetOmciCounters(), nil
 }
 
+//nolint:unparam
 func (dh *deviceHandler) isFsmInOmciIdleState(ctx context.Context, PFsm *fsm.FSM, wantedState string) bool {
 	if PFsm == nil {
 		return true //FSM not active - so there is no activity on omci
@@ -4030,6 +4049,7 @@
 	return true
 }
 
+//nolint:unparam
 func (dh *deviceHandler) isUniVlanConfigFsmInOmciIdleState(ctx context.Context, omciFsm cmn.UsedOmciConfigFsms, idleState string) bool {
 	dh.lockVlanConfig.RLock()
 	defer dh.lockVlanConfig.RUnlock()
@@ -4041,6 +4061,7 @@
 	return true //FSM not active - so there is no activity on omci
 }
 
+//nolint:unparam
 func (dh *deviceHandler) checkUserServiceExists(ctx context.Context) bool {
 	dh.lockVlanConfig.RLock()
 	defer dh.lockVlanConfig.RUnlock()
@@ -4538,7 +4559,7 @@
 			logger.Errorw(ctx, "configuration exceeds ONU capabilities - running out of TCONT instances: send ONU device event!",
 				log.Fields{"device-id": dh.device.Id})
 			pDevEntry.SendOnuDeviceEvent(ctx, cmn.OnuConfigFailureMissingTcont, cmn.OnuConfigFailureMissingTcontDesc)
-			return fmt.Errorf(fmt.Sprintf("configuration exceeds ONU capabilities - running out of TCONT instances: device-id: %s", dh.DeviceID))
+			return fmt.Errorf("configuration exceeds ONU capabilities - running out of TCONT instances: device-id: %s", dh.DeviceID)
 		}
 	} else {
 		pDevEntry.MutexPersOnuConfig.Unlock()
@@ -4549,7 +4570,7 @@
 
 		queueInstKeys := pDevEntry.GetOnuDB().GetSortedInstKeys(ctx, me.PriorityQueueClassID)
 		for _, mgmtEntityID := range queueInstKeys {
-			if mgmtEntityID >= 0x8000 && mgmtEntityID <= 0xFFFF {
+			if mgmtEntityID >= 0x8000 {
 				numberOfUsPrioQueueDbInsts++
 			}
 		}
@@ -4565,7 +4586,7 @@
 			logger.Errorw(ctx, "configuration exceeds ONU capabilities - running out of upstream PrioQueue instances: send ONU device event!",
 				log.Fields{"device-id": dh.device.Id})
 			pDevEntry.SendOnuDeviceEvent(ctx, cmn.OnuConfigFailureMissingUsPriorityQueue, cmn.OnuConfigFailureMissingUsPriorityQueueDesc)
-			return fmt.Errorf(fmt.Sprintf("configuration exceeds ONU capabilities - running out of upstream PrioQueue instances: device-id: %s", dh.DeviceID))
+			return fmt.Errorf("configuration exceeds ONU capabilities - running out of upstream PrioQueue instances: device-id: %s", dh.DeviceID)
 		}
 		// Downstream PrioQueue instances are evaluated in accordance with ONU MIB upload data in function UniPonAniConfigFsm::prepareAndEnterConfigState().
 		// In case of missing downstream PrioQueues the attribute "Priority queue pointer for downstream" of ME "GEM port network CTP" will be set to "0",
diff --git a/internal/pkg/core/openonu.go b/internal/pkg/core/openonu.go
index 9e46c54..4d68e8f 100755
--- a/internal/pkg/core/openonu.go
+++ b/internal/pkg/core/openonu.go
@@ -64,44 +64,44 @@
 
 // OpenONUAC structure holds the ONU core information
 type OpenONUAC struct {
-	deviceHandlers              map[string]*deviceHandler
-	deviceHandlersCreateChan    map[string]chan bool //channels for deviceHandler create events
-	mutexDeviceHandlersMap      sync.RWMutex
-	coreClient                  *vgrpc.Client
-	parentAdapterClients        map[string]*vgrpc.Client
-	lockParentAdapterClients    sync.RWMutex
-	reachableFromRemote         map[string]*reachabilityFromRemote
-	lockReachableFromRemote     sync.RWMutex
 	eventProxy                  eventif.EventProxy
 	kvClient                    kvstore.Client
+	deviceHandlers              map[string]*deviceHandler
+	deviceHandlersCreateChan    map[string]chan bool //channels for deviceHandler create events
+	coreClient                  *vgrpc.Client
+	parentAdapterClients        map[string]*vgrpc.Client
+	reachableFromRemote         map[string]*reachabilityFromRemote
 	cm                          *conf.ConfigManager
 	config                      *config.AdapterFlags
-	numOnus                     int
-	KVStoreAddress              string
-	KVStoreType                 string
-	KVStoreTimeout              time.Duration
 	mibTemplatesGenerated       map[string]bool
-	mutexMibTemplateGenerated   sync.RWMutex
 	exitChannel                 chan int
-	HeartbeatCheckInterval      time.Duration
-	HeartbeatFailReportInterval time.Duration
-	AcceptIncrementalEvto       bool
 	pSupportedFsms              *cmn.OmciDeviceFsms
-	maxTimeoutInterAdapterComm  time.Duration
-	maxTimeoutReconciling       time.Duration
 	pDownloadManager            *swupg.AdapterDownloadManager
 	pFileManager                *swupg.FileDownloadManager //let coexist 'old and new' DownloadManager as long as 'old' does not get obsolete
-	MetricsEnabled              bool
-	ExtendedOmciSupportEnabled  bool
+	MibDatabaseMap              devdb.OnuMCmnMEDBMap
+	KVStoreAddress              string
+	KVStoreType                 string
+	numOnus                     int
+	KVStoreTimeout              time.Duration
+	HeartbeatCheckInterval      time.Duration
+	HeartbeatFailReportInterval time.Duration
+	maxTimeoutInterAdapterComm  time.Duration
+	maxTimeoutReconciling       time.Duration
 	mibAuditInterval            time.Duration
 	omciTimeout                 int // in seconds
 	alarmAuditInterval          time.Duration
 	dlToOnuTimeout4M            time.Duration
 	rpcTimeout                  time.Duration
 	maxConcurrentFlowsPerUni    int
-	skipOnuConfig               bool
+	mutexDeviceHandlersMap      sync.RWMutex
+	lockParentAdapterClients    sync.RWMutex
+	lockReachableFromRemote     sync.RWMutex
+	mutexMibTemplateGenerated   sync.RWMutex
 	mutexMibDatabaseMap         sync.RWMutex
-	MibDatabaseMap              devdb.OnuMCmnMEDBMap
+	AcceptIncrementalEvto       bool
+	MetricsEnabled              bool
+	ExtendedOmciSupportEnabled  bool
+	skipOnuConfig               bool
 }
 
 // NewOpenONUAC returns a new instance of OpenONU_AC
@@ -142,7 +142,7 @@
 	openOnuAc.maxConcurrentFlowsPerUni = cfg.MaxConcurrentFlowsPerUni
 
 	openOnuAc.pSupportedFsms = &cmn.OmciDeviceFsms{
-		"mib-synchronizer": {
+		"mib-synchronizer": cmn.ActivityDescr{
 			//mibSyncFsm,        // Implements the MIB synchronization state machine
 			DatabaseClass: mibDbVolatileDictImpl, // Implements volatile ME MIB database
 			//true,                  // Advertise events on OpenOMCI event bus
@@ -301,7 +301,7 @@
 		return &empty.Empty{}, nil
 	}
 	logger.Warnw(ctx, "no handler found for device-disable", log.Fields{"device-id": device.Id})
-	return nil, fmt.Errorf(fmt.Sprintf("handler-not-found-%s", device.Id))
+	return nil, fmt.Errorf("handler-not-found-%s", device.Id)
 }
 
 // ReEnableDevice enables the onu device after disable
@@ -312,7 +312,7 @@
 		return &empty.Empty{}, nil
 	}
 	logger.Warnw(ctx, "no handler found for device-reenable", log.Fields{"device-id": device.Id})
-	return nil, fmt.Errorf(fmt.Sprintf("handler-not-found-%s", device.Id))
+	return nil, fmt.Errorf("handler-not-found-%s", device.Id)
 }
 
 // RebootDevice reboots the given device
@@ -401,7 +401,7 @@
 		return &empty.Empty{}, nil
 	}
 	logger.Warnw(ctx, "no handler found for incremental flow update", log.Fields{"device-id": incrFlows.Device.Id})
-	return nil, fmt.Errorf(fmt.Sprintf("handler-not-found-%s", incrFlows.Device.Id))
+	return nil, fmt.Errorf("handler-not-found-%s", incrFlows.Device.Id)
 }
 
 // UpdatePmConfig returns PmConfigs nil or error
@@ -414,7 +414,7 @@
 		return &empty.Empty{}, nil
 	}
 	logger.Warnw(ctx, "no handler found for update-pm-config", log.Fields{"device-id": configs.DeviceId})
-	return nil, fmt.Errorf(fmt.Sprintf("handler-not-found-%s", configs.DeviceId))
+	return nil, fmt.Errorf("handler-not-found-%s", configs.DeviceId)
 }
 
 // DownloadImage requests downloading some image according to indications as given in request
@@ -459,10 +459,10 @@
 				return imageInfo.Image, nil
 			}
 			logger.Warnw(ctx, "no handler found for image activation", log.Fields{"device-id": imageInfo.Device.Id})
-			return nil, fmt.Errorf(fmt.Sprintf("handler-not-found - device-id: %s", imageInfo.Device.Id))
+			return nil, fmt.Errorf("handler-not-found - device-id: %s", imageInfo.Device.Id)
 		}
 		logger.Debugw(ctx, "image not yet downloaded on activate request", log.Fields{"image-description": imageInfo.Image})
-		return nil, fmt.Errorf(fmt.Sprintf("image-not-yet-downloaded - device-id: %s", imageInfo.Device.Id))
+		return nil, fmt.Errorf("image-not-yet-downloaded - device-id: %s", imageInfo.Device.Id)
 	}
 	return nil, errors.New("invalid image definition")
 }
@@ -773,10 +773,10 @@
 		if err == nil {
 			return images, nil
 		}
-		return nil, fmt.Errorf(fmt.Sprintf("%s-%s", err, id.Id))
+		return nil, fmt.Errorf("%s-%s", err, id.Id)
 	}
 	logger.Warnw(ctx, "no handler found for Get_onu_images", log.Fields{"device-id": id.Id})
-	return nil, fmt.Errorf(fmt.Sprintf("handler-not-found-%s", id.Id))
+	return nil, fmt.Errorf("handler-not-found-%s", id.Id)
 }
 
 // ActivateOnuImage initiates the activation of the image for the requested ONU(s)
@@ -927,7 +927,7 @@
 	}
 	logger.Warnw(ctx, "no handler found for received onu-ind-request", log.Fields{
 		"msgToDeviceId": onuInd.DeviceId})
-	return nil, fmt.Errorf(fmt.Sprintf("handler-not-found-%s", onuInd.DeviceId))
+	return nil, fmt.Errorf("handler-not-found-%s", onuInd.DeviceId)
 }
 
 // OmciIndication is part of the ONU Inter-adapter service API.
@@ -940,7 +940,7 @@
 		}
 		return &empty.Empty{}, nil
 	}
-	return nil, fmt.Errorf(fmt.Sprintf("handler-not-found-%s", msg.ChildDeviceId))
+	return nil, fmt.Errorf("handler-not-found-%s", msg.ChildDeviceId)
 }
 
 // DownloadTechProfile is part of the ONU Inter-adapter service API.
@@ -953,7 +953,7 @@
 			logger.Warnw(ctx, "Device deletion  in progress - avoid processing Tech Profile", log.Fields{"device-id": tProfile.DeviceId})
 
 			handler.RUnlockMutexDeletionInProgressFlag()
-			return nil, fmt.Errorf(fmt.Sprintf("Can't proceed, device  deletion is in progress-%s", tProfile.DeviceId))
+			return nil, fmt.Errorf("Can't proceed, device  deletion is in progress-%s", tProfile.DeviceId)
 		}
 		handler.RUnlockMutexDeletionInProgressFlag()
 		if err := handler.handleTechProfileDownloadRequest(log.WithSpanFromContext(context.Background(), ctx), tProfile); err != nil {
@@ -961,7 +961,7 @@
 		}
 		return &empty.Empty{}, nil
 	}
-	return nil, fmt.Errorf(fmt.Sprintf("handler-not-found-%s", tProfile.DeviceId))
+	return nil, fmt.Errorf("handler-not-found-%s", tProfile.DeviceId)
 }
 
 // DeleteGemPort is part of the ONU Inter-adapter service API.
@@ -1010,6 +1010,7 @@
 	return string(h)
 }
 
+// nolint:unparam
 func (oo *OpenONUAC) updateReachabilityFromRemote(ctx context.Context, remote *common.Connection) {
 	logger.Debugw(context.Background(), "updating-remote-connection-status", log.Fields{"remote": remote})
 	oo.lockReachableFromRemote.Lock()