[VOL-4176] Expose uniPortMask as a parameter
Change-Id: I0c1c20d16f777121a163cc71e2a38d9618d65061
diff --git a/internal/pkg/onuadaptercore/device_handler.go b/internal/pkg/onuadaptercore/device_handler.go
index 929964c..1a541c7 100644
--- a/internal/pkg/onuadaptercore/device_handler.go
+++ b/internal/pkg/onuadaptercore/device_handler.go
@@ -2438,7 +2438,7 @@
for uniNo, uniPort := range dh.uniEntityMap {
// only if this port is validated for operState transfer
- if (1<<uniPort.uniID)&activeUniPortStateUpdateMask == (1 << uniPort.uniID) {
+ if (1<<uniPort.uniID)&dh.pOpenOnuAc.config.UniPortMask == (1 << uniPort.uniID) {
logger.Infow(ctx, "onuUniPort-forced-OperState-ACTIVE", log.Fields{"for PortNo": uniNo, "device-id": dh.deviceID})
uniPort.setOperState(vc.OperStatus_ACTIVE)
if !dh.isReconciling() {
@@ -2457,7 +2457,8 @@
// -> use current restriction to operate only on first UNI port as inherited from actual Py code
for uniNo, uniPort := range dh.uniEntityMap {
// only if this port is validated for operState transfer
- if (1<<uniPort.uniID)&activeUniPortStateUpdateMask == (1 << uniPort.uniID) {
+
+ if (1<<uniPort.uniID)&dh.pOpenOnuAc.config.UniPortMask == (1 << uniPort.uniID) {
logger.Infow(ctx, "onuUniPort-forced-OperState-UNKNOWN", log.Fields{"for PortNo": uniNo, "device-id": dh.deviceID})
uniPort.setOperState(vc.OperStatus_UNKNOWN)
if !dh.isReconciling() {
diff --git a/internal/pkg/onuadaptercore/platform.go b/internal/pkg/onuadaptercore/platform.go
index 1f9898f..6ad3e7b 100644
--- a/internal/pkg/onuadaptercore/platform.go
+++ b/internal/pkg/onuadaptercore/platform.go
@@ -115,11 +115,6 @@
*/
)
-//Mask to indicate which possibly active ONU UNI state is really reported to the core
-// compare python code - at the moment restrict active state to the first ONU UNI port
-// check is limited to max 16 uni ports - cmp above UNI limit!!!
-var activeUniPortStateUpdateMask = 0x0001
-
/*
//MinUpstreamPortID value
var minUpstreamPortID = 0xfffd
diff --git a/internal/pkg/onuadaptercore/uniportadmin.go b/internal/pkg/onuadaptercore/uniportadmin.go
index 57a1b58..fea1838 100644
--- a/internal/pkg/onuadaptercore/uniportadmin.go
+++ b/internal/pkg/onuadaptercore/uniportadmin.go
@@ -416,7 +416,8 @@
for uniNo, uniPort := range oFsm.pOmciCC.pBaseDeviceHandler.uniEntityMap {
// only unlock the UniPort in case it is defined for usage (R2.6 limit only one port),
// compare also limitation for logical voltha port in dh.enableUniPortStateUpdate()
- if (omciAdminState == 1) || (1<<uniPort.uniID)&activeUniPortStateUpdateMask == (1<<uniPort.uniID) {
+
+ if (omciAdminState == 1) || (1<<uniPort.uniID)&oFsm.pDeviceHandler.pOpenOnuAc.config.UniPortMask == (1<<uniPort.uniID) {
var meInstance *me.ManagedEntity
if uniPort.portType == uniPPTP {
logger.Debugw(ctx, "Setting PPTP admin state", log.Fields{