VOL-4245: Migration to BAL3.10.2.2

Change-Id: I8b847660e949c91504ced760b1393e4def2300e8
diff --git a/agent/device/asfvolt16/mkdebian/debian/.debhelper/generated/asfvolt16/triggers b/agent/device/asfvolt16/mkdebian/debian/.debhelper/generated/asfvolt16/triggers
deleted file mode 100644
index 884a015..0000000
--- a/agent/device/asfvolt16/mkdebian/debian/.debhelper/generated/asfvolt16/triggers
+++ /dev/null
@@ -1,2 +0,0 @@
-# Triggers added by dh_makeshlibs
-activate-noawait ldconfig
diff --git a/agent/device/asfvolt16/mkdebian/debian/asfvolt16.postinst b/agent/device/asfvolt16/mkdebian/debian/asfvolt16.postinst
index 908ff90..351f28e 100644
--- a/agent/device/asfvolt16/mkdebian/debian/asfvolt16.postinst
+++ b/agent/device/asfvolt16/mkdebian/debian/asfvolt16.postinst
@@ -17,7 +17,7 @@
 
 rm -rf /opt/bcm68620
 rm -rf /broadcom
-tar zxf /tmp/release_asfvolt16_V3.4.9.9.202107300101.tar.gz -C / 2>&1 > /dev/null
+tar zxf /tmp/release_asfvolt16_V3.10.2.2.202111040101.tar.gz -C / 2>&1 > /dev/null
 grep -q '\/opt\/bcm68620\/svk_init.sh' /etc/rc.local || sed -i -e '$i \/opt\/bcm68620\/svk_init.sh' /etc/rc.local
 rm -f /run/bcm68620
 mkdir -p /opt/openolt && cp /tmp/watchdog/openolt_dev_mgmt_daemon_process_watchdog /opt/openolt && cp /tmp/watchdog/watchdog.config /opt/openolt
@@ -33,7 +33,7 @@
 mv /tmp/openolt /broadcom
 mv /tmp/libz.so.1 /usr/local/lib
 mv /tmp/libstdc++.so.6 /usr/local/lib
-mv /tmp/libbal_host_api.so /usr/local/lib
+mv /tmp/libbal_host_api-oss.so /usr/local/lib
 /opt/bcm68620/svk_init.sh
 [ "A`cat ~/.bashrc| grep LD_LIBRARY_PATH`" = "A" ] && echo "export LD_LIBRARY_PATH=/broadcom:\$LD_LIBRARY_PATH" >> ~/.bashrc; . ~/.bashrc
 ldconfig /broadcom
diff --git a/agent/device/asfvolt16/mkdebian/debian/asfvolt16.postrm b/agent/device/asfvolt16/mkdebian/debian/asfvolt16.postrm
index 96c91af..653eb48 100644
--- a/agent/device/asfvolt16/mkdebian/debian/asfvolt16.postrm
+++ b/agent/device/asfvolt16/mkdebian/debian/asfvolt16.postrm
@@ -21,5 +21,5 @@
 sed -i '\/opt\/bcm68620\/svk_init.sh/d' /etc/rc.local
 rm -rf /run/bcm68620
 rm -rf /usr/local/lib/libz.so.1
-rm -rf /usr/local/lib/libbal_host_api.so
+rm -rf /usr/local/lib/libbal_host_api-oss.so
 rm -rf /usr/local/lib/libstdc++.so.6
diff --git a/agent/device/asfvolt16/mkdebian/debian/asfvolt16.preinst b/agent/device/asfvolt16/mkdebian/debian/asfvolt16.preinst
index c2e0343..5bf06fb 100644
--- a/agent/device/asfvolt16/mkdebian/debian/asfvolt16.preinst
+++ b/agent/device/asfvolt16/mkdebian/debian/asfvolt16.preinst
@@ -55,6 +55,6 @@
 rm -rf  /broadcom
 
 rm -rf /usr/local/lib/libz.so.1
-rm -rf /usr/local/lib/libbal_host_api.so
+rm -rf /usr/local/lib/libbal_host_api-oss.so
 rm -rf /usr/local/lib/libstdc++.so.6
 
diff --git a/agent/device/asfvolt16/mkdebian/debian/changelog b/agent/device/asfvolt16/mkdebian/debian/changelog
index e41b18e..7605b2e 100644
--- a/agent/device/asfvolt16/mkdebian/debian/changelog
+++ b/agent/device/asfvolt16/mkdebian/debian/changelog
@@ -1,6 +1,6 @@
-asfvolt16 (3.4.9.9+edgecore-V202107300101) stable; urgency=high
+asfvolt16 (3.10.2.2+edgecore-V202111040101) stable; urgency=high
 
-    * Based on code from SW-BCM686OLT_3.4.9.9.tgz.
-    * Merged the Accton's fixed to ACCTON_BAL_3.4.9.9-V202107300101.patch.
+    * Based on code from SW-BCM686OLT_3.10.2.2.tgz.
+    * Merged the Accton's fixed to ACCTON_BAL_3.10.2.2-V202111040101.patch.
 
- -- Jason Huang <jasonsc_huang@edge-core.com>  Mon, 30 NOV 2020 01:01:03 +0800
+ -- Jason Huang <jasonsc_huang@edge-core.com>  Thu, 21 Oct 2021 01:01:03 +0800
diff --git a/agent/device/asfvolt16/mkdebian/debian/control b/agent/device/asfvolt16/mkdebian/debian/control
index 66defdd..9f67c3b 100644
--- a/agent/device/asfvolt16/mkdebian/debian/control
+++ b/agent/device/asfvolt16/mkdebian/debian/control
@@ -9,5 +9,5 @@
 Architecture: amd64
 Depends: ${shlibs:Depends}
 Description: Broadcom OLT drivers,CLI
-  ported from Broadcom SDK-3.4.9.9 package
+  ported from Broadcom SDK-3.10.2.2 package
 
diff --git a/agent/device/asfvolt16/mkdebian/debian/files b/agent/device/asfvolt16/mkdebian/debian/files
index 39b81d8..fad9c5c 100644
--- a/agent/device/asfvolt16/mkdebian/debian/files
+++ b/agent/device/asfvolt16/mkdebian/debian/files
@@ -1 +1 @@
-asfvolt16_3.4.9.9+edgecore-V202107300101_amd64.deb misc optional
+asfvolt16_3.10.2.2+edgecore-V202111040101_amd64.deb misc optional
diff --git a/agent/device/asfvolt16/mkdebian/debian/rules b/agent/device/asfvolt16/mkdebian/debian/rules
index ede3cfa..6303703 100755
--- a/agent/device/asfvolt16/mkdebian/debian/rules
+++ b/agent/device/asfvolt16/mkdebian/debian/rules
@@ -26,10 +26,10 @@
 
 override_dh_auto_install:
 	mkdir -p $(DEB_DH_INSTALL_SOURCEDIR)/tmp
-	cp -a $(CURDIR)/debian/release_asfvolt16_V3.4.9.9.202107300101.tar.gz $(DEB_DH_INSTALL_SOURCEDIR)/tmp
+	cp -a $(CURDIR)/debian/release_asfvolt16_V3.10.2.2.202111040101.tar.gz $(DEB_DH_INSTALL_SOURCEDIR)/tmp
 	cp -a $(CURDIR)/debian/libz.so.1 $(DEB_DH_INSTALL_SOURCEDIR)/tmp
 	cp -a $(CURDIR)/debian/libstdc++.so.6 $(DEB_DH_INSTALL_SOURCEDIR)/tmp
-	cp -a $(CURDIR)/debian/libbal_host_api.so $(DEB_DH_INSTALL_SOURCEDIR)/tmp
+	cp -a $(CURDIR)/debian/libbal_host_api-oss.so $(DEB_DH_INSTALL_SOURCEDIR)/tmp
 	cp -a $(CURDIR)/debian/openolt $(DEB_DH_INSTALL_SOURCEDIR)/tmp
 	cp -a $(CURDIR)/debian/init.d $(DEB_DH_INSTALL_SOURCEDIR)/tmp
 	cp -a $(CURDIR)/debian/logrotate.d $(DEB_DH_INSTALL_SOURCEDIR)/tmp
diff --git a/agent/device/asgvolt64/mkdebian/debian/asgvolt64.postinst b/agent/device/asgvolt64/mkdebian/debian/asgvolt64.postinst
index 0ec400d..803413a 100644
--- a/agent/device/asgvolt64/mkdebian/debian/asgvolt64.postinst
+++ b/agent/device/asgvolt64/mkdebian/debian/asgvolt64.postinst
@@ -17,7 +17,7 @@
 
 rm -rf /opt/bcm68620
 rm -rf /broadcom
-tar zxf /tmp/release_asgvolt64_V3.4.9.9.202107300101.tar.gz -C / 2>&1 > /dev/null
+tar zxf /tmp/release_asgvolt64_V3.10.2.2.202111040101.tar.gz -C / 2>&1 > /dev/null
 grep -q '\/opt\/bcm68620\/svk_init.sh' /etc/rc.local || sed -i -e '$i \/opt\/bcm68620\/svk_init.sh' /etc/rc.local
 rm -f /run/bcm68620
 mkdir -p /opt/openolt && cp /tmp/watchdog/openolt_dev_mgmt_daemon_process_watchdog /opt/openolt && cp /tmp/watchdog/watchdog.config /opt/openolt
@@ -33,7 +33,7 @@
 mv /tmp/openolt /broadcom
 mv /tmp/libz.so.1 /usr/local/lib
 mv /tmp/libstdc++.so.6 /usr/local/lib
-mv /tmp/libbal_host_api.so /usr/local/lib
+mv /tmp/libbal_host_api-oss.so /usr/local/lib
 /opt/bcm68620/svk_init.sh
 [ "A`cat ~/.bashrc| grep LD_LIBRARY_PATH`" = "A" ] && echo "export LD_LIBRARY_PATH=/broadcom:\$LD_LIBRARY_PATH" >> ~/.bashrc; . ~/.bashrc
 ldconfig /broadcom
diff --git a/agent/device/asgvolt64/mkdebian/debian/asgvolt64.postrm b/agent/device/asgvolt64/mkdebian/debian/asgvolt64.postrm
index 96c91af..653eb48 100644
--- a/agent/device/asgvolt64/mkdebian/debian/asgvolt64.postrm
+++ b/agent/device/asgvolt64/mkdebian/debian/asgvolt64.postrm
@@ -21,5 +21,5 @@
 sed -i '\/opt\/bcm68620\/svk_init.sh/d' /etc/rc.local
 rm -rf /run/bcm68620
 rm -rf /usr/local/lib/libz.so.1
-rm -rf /usr/local/lib/libbal_host_api.so
+rm -rf /usr/local/lib/libbal_host_api-oss.so
 rm -rf /usr/local/lib/libstdc++.so.6
diff --git a/agent/device/asgvolt64/mkdebian/debian/asgvolt64.preinst b/agent/device/asgvolt64/mkdebian/debian/asgvolt64.preinst
index c2e0343..5bf06fb 100644
--- a/agent/device/asgvolt64/mkdebian/debian/asgvolt64.preinst
+++ b/agent/device/asgvolt64/mkdebian/debian/asgvolt64.preinst
@@ -55,6 +55,6 @@
 rm -rf  /broadcom
 
 rm -rf /usr/local/lib/libz.so.1
-rm -rf /usr/local/lib/libbal_host_api.so
+rm -rf /usr/local/lib/libbal_host_api-oss.so
 rm -rf /usr/local/lib/libstdc++.so.6
 
diff --git a/agent/device/asgvolt64/mkdebian/debian/changelog b/agent/device/asgvolt64/mkdebian/debian/changelog
index 0565235..531eb3d 100644
--- a/agent/device/asgvolt64/mkdebian/debian/changelog
+++ b/agent/device/asgvolt64/mkdebian/debian/changelog
@@ -1,6 +1,6 @@
-asgvolt64 (3.4.9.9+edgecore-V202107300101) stable; urgency=high
+asgvolt64 (3.10.2.2+edgecore-V202111040101) stable; urgency=high
 
-    * Based on code from SW-BCM686OLT_3.4.9.9.tgz.
-    * Merged the Accton's fixed to ACCTON_BAL_3.4.9.9-V202107300101.patch.
+    * Based on code from SW-BCM686OLT_3.10.2.2.tgz.
+    * Merged the Accton's fixed to ACCTON_BAL_3.10.2.2-V202111040101.patch.
 
- -- Jason Huang <jasonsc_huang@edge-core.com>  Mon, 30 NOV 2020 01:01:03 +0800
+ -- Jason Huang <jasonsc_huang@edge-core.com>  Thu, 21 Oct 2021 01:01:03 +0800
diff --git a/agent/device/asgvolt64/mkdebian/debian/control b/agent/device/asgvolt64/mkdebian/debian/control
index 71d2075..f0c889d 100644
--- a/agent/device/asgvolt64/mkdebian/debian/control
+++ b/agent/device/asgvolt64/mkdebian/debian/control
@@ -9,5 +9,5 @@
 Architecture: amd64
 Depends: ${shlibs:Depends}
 Description: Broadcom OLT drivers,CLI
-  ported from Broadcom SDK-3.4.9.9 package
+  ported from Broadcom SDK-3.10.2.2 package
 
diff --git a/agent/device/asgvolt64/mkdebian/debian/files b/agent/device/asgvolt64/mkdebian/debian/files
index 4030926..f622278 100644
--- a/agent/device/asgvolt64/mkdebian/debian/files
+++ b/agent/device/asgvolt64/mkdebian/debian/files
@@ -1 +1 @@
-asgvolt64_3.4.9.9+edgecore-V202107300101_amd64.deb misc optional
+asgvolt64_3.10.2.2+edgecore-V202111090101_amd64.deb misc optional
diff --git a/agent/device/asgvolt64/mkdebian/debian/rules b/agent/device/asgvolt64/mkdebian/debian/rules
index 3fa5527..846675c 100755
--- a/agent/device/asgvolt64/mkdebian/debian/rules
+++ b/agent/device/asgvolt64/mkdebian/debian/rules
@@ -26,10 +26,10 @@
 
 override_dh_auto_install:
 	mkdir -p $(DEB_DH_INSTALL_SOURCEDIR)/tmp
-	cp -a $(CURDIR)/debian/release_asgvolt64_V3.4.9.9.202107300101.tar.gz $(DEB_DH_INSTALL_SOURCEDIR)/tmp
+	cp -a $(CURDIR)/debian/release_asgvolt64_V3.10.2.2.202111040101.tar.gz $(DEB_DH_INSTALL_SOURCEDIR)/tmp
 	cp -a $(CURDIR)/debian/libz.so.1 $(DEB_DH_INSTALL_SOURCEDIR)/tmp
 	cp -a $(CURDIR)/debian/libstdc++.so.6 $(DEB_DH_INSTALL_SOURCEDIR)/tmp
-	cp -a $(CURDIR)/debian/libbal_host_api.so $(DEB_DH_INSTALL_SOURCEDIR)/tmp
+	cp -a $(CURDIR)/debian/libbal_host_api-oss.so $(DEB_DH_INSTALL_SOURCEDIR)/tmp
 	cp -a $(CURDIR)/debian/openolt $(DEB_DH_INSTALL_SOURCEDIR)/tmp
 	cp -a $(CURDIR)/debian/init.d $(DEB_DH_INSTALL_SOURCEDIR)/tmp
 	cp -a $(CURDIR)/debian/logrotate.d $(DEB_DH_INSTALL_SOURCEDIR)/tmp
diff --git a/agent/device/sim/vendor.cc b/agent/device/sim/vendor.cc
new file mode 100644
index 0000000..86836ff
--- /dev/null
+++ b/agent/device/sim/vendor.cc
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+
+ * http://www.apache.org/licenses/LICENSE-2.0
+
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "vendor.h"
+
+void vendor_init()
+{
+}
diff --git a/agent/device/sim/vendor.h b/agent/device/sim/vendor.h
new file mode 100644
index 0000000..3cecd88
--- /dev/null
+++ b/agent/device/sim/vendor.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+
+ * http://www.apache.org/licenses/LICENSE-2.0
+
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __VENDOR_H__
+#define __VENDOR_H__
+#define VENDOR_ID "ONF"
+#define SIM
+#define MODEL_ID  "sim"
+#define MAX_SUPPORTED_PON 16
+#define ONU_BIT_TRANSMISSION_DELAY 0.1004823/1000 /* unit: ns to us */
+#define MINIMUM_ONU_RESPONSE_RANGING_TIME 1572135 /* hardcore: this is ranging time for the shortest distance, typically 35us */
+
+// DeviceInfo definitions
+
+#define ONU_ID_START 1
+#define ONU_ID_END 32
+#define MAX_ONUS_PER_PON (ONU_ID_END - ONU_ID_START + 1)
+
+#define MAX_ALLOC_ID_PER_ONU 4
+#define ALLOC_ID_START 1024
+#define ALLOC_ID_END (ALLOC_ID_START + MAX_ONUS_PER_PON * MAX_ALLOC_ID_PER_ONU)
+
+#define GEM_PORT_ID_PER_ALLOC_ID 8
+#define GEM_PORT_ID_START 1024
+#define GEM_PORT_ID_END (GEM_PORT_ID_START + MAX_ONUS_PER_PON * MAX_ALLOC_ID_PER_ONU * GEM_PORT_ID_PER_ALLOC_ID)
+
+#define FLOW_ID_START 1
+#define FLOW_ID_END 65535
+#define MAX_FLOW_ID FLOW_ID_END
+#define INVALID_FLOW_ID 0
+
+#endif