VOL-1236: BAL upgrade for 2.6 and support for Traffic Shaping
Change-Id: If12f914e5981b2eabfca90a70dbb0f0750a76c4b
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 2065572..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,23 +0,0 @@
-# Prerequisites
-*.d
-
-# Object files
-*.o
-*.ko
-*.obj
-*.elf
-
-# Linker output
-*.ilk
-*.map
-*.exp
-
-# Precompiled Headers
-*.gch
-*.pch
-
-# Libraries
-*.lib
-*.a
-*.la
-*.lo
diff --git a/.gitmodules b/.gitmodules
deleted file mode 100644
index 167cb51..0000000
--- a/.gitmodules
+++ /dev/null
@@ -1,13 +0,0 @@
-[submodule "third_party/grpc"]
- path = third_party/grpc
- url = https://github.com/grpc/grpc.git
-[submodule "third_party/protobuf"]
- path = third_party/protobuf
- url = https://github.com/google/protobuf.git
-[submodule "third_party/grpc-c"]
- path = third_party/grpc-c
- url = https://github.com/Juniper/grpc-c.git
-[submodule "third_party/protobuf-c"]
- path = third_party/protobuf-c
- url = https://github.com/shadansari/protobuf-c.git
- branch = master
diff --git a/.gitreview b/.gitreview
deleted file mode 100644
index f19fab9..0000000
--- a/.gitreview
+++ /dev/null
@@ -1,6 +0,0 @@
-[gerrit]
-host=gerrit.opencord.org
-port=29418
-project=asfvolt16-driver.git
-defaultremote=origin
-defaultbranch=master
diff --git a/README.md b/README.md
old mode 100644
new mode 100755
index e6bfee3..a0ba43d
--- a/README.md
+++ b/README.md
@@ -1,9 +1,236 @@
-## Build
+# Building ONL Environment for ASFvOLT16
+ Requirements:
+ ```
+ Hardware:
+ CPU: Dual-core (4 Threads) up.
+ Memory: 6G bytes.
+ Hard Disk: 40G of disk free space.
+ Software:
+ A. docker # to grab the build workspace
+ B. binfmt-support # kernel support for ppc builds
+ C. At least 4G of ram and 4G of swap # compilation is memory intensive
+ D. All of the testing is done with Debian, other Linux distributions may
+ work, but we suggest using Debian 8.
+ # apt-get install binfmt-support then follow the instructions at:
+ https://docs.docker.com/engine/installation/debian/
-```sh
-autoreconf --install
-git submodule update --init --recursive
-./configure
-make
-sudo make install
+ ```
+ Download source code:
+ ```
+ Download ONL source code with Kernel 3.7.10.
+ #> git clone https://github.com/Lewis-Kang/OpenNetworkLinux.git -b kernel_3.7.10
+ ```
+
+ Build system:
+ ```
+ #> cd OpenNetworkLinux
+ #> sudo docker/tools/onlbuilder -8 # enter the docker workspace
+ #> apt-cacher-ng
+ #> source setup.env # pull in necessary environment variables
+ #> make amd64
+ ```
+
+ ONL Installer:
+ ```
+ You can find the installer file in
+ #> OpenNetworkLinux/RELEASE/jessie/amd64/ONL-<VERSION>_AMD64_INSTALLED_INSTALLER
+ ```
+
+# ASFvOLT16 vOLTHA BAL DRIVER
+
+This is an executable (voltha_bal_driver), which will receive asfvolt16_olt adapter grpc-c messages and call the respective BAL API.
+It will send received responses/asynchronous indications from BAL running in the ASFvOLT16 to the asfvolt16_olt adapter in VOLTHA.
+This driver requires the Broadcom proprietary
+BAL/Maple SDK for the PON MAC and the Qumran switching SDK. These components are available from Broadcom.
+
+
+## GETTING STARTED
+
+The following **proprietary** components are required to build the voltha_bal_driver.
+Contact Dave Baron at Broadcom for details on accessing these files. dave.baronATbroadcomDOTcom Reference Case: CS3233745
+
+| Component | Version | Filename |
+| ------------- |-------- | ------------------------|
+| BAL/Maple SDK | 2_6_0_1 | SW-BCM68620_2_6_0_1.zip |
+| Qumran SDK | 6.5.7 | sdk-all-6.5.7.tar.gz |
+
+| Component | Filename |
+| ------------- | ----- |
+| ASFvOLT16 BAL patch| ACCTON_BAL_2.6.0.1-V201804301043.patch |
+
+The following **open-source** components are required to build the voltha_bal_driver.
+
+| Component/Package | Version | Name | From | Git Repo|
+| ------------- |--------- | ----- | ---------| ----|
+| VOLTHA asfvolt16_olt adapter | voltha-1.3 | voltha | Opencord | git clone https://github.com/opencord/voltha.git
+| ASFvOLT16 Driver | voltha-1.3 | asfvolt16-driver| Opencord | git clone https://userid@gerrit.opencord.org/asfvolt16-driver
+
+### Clone asfvolt16-driver repo
+
```
+cd /home/<user>/OpenNetworkLinux
+git clone https://github.com/opencord/voltha.git
+git clone https://userid@gerrit.opencord.org/asfvolt16-driver
+```
+
+Build helper scripts are available in `asfvolt16-driver/scripts` to automate the steps for building BAL/Maple SDK and the `voltha_bal_driver`.
+
+| Helper Script | Purpose |
+| ------------- |---------|
+| asfvolt-bal-prepare.sh |Prepare BAL/Maple SDK build workspace (outside of docker)|
+| asfvolt-bal-buildall.sh |Build BAL/Maple SDK|
+| asfvolt-driver-build.sh |Build `voltha_bal_driver`|
+| asfvolt-driver-package.sh |Repackage BAL/Maple release with `voltha_bal_driver`|
+
+The helper scripts contain default shell variable values for component directory locations and file names for the build.
+
+### Prepare workspace for BAL
+
+These below variables MUST be overridden to suit the local build environment.
+
+```
+### Directory where OpenNetworkLinux is present
+ONL_TOPDIR=/home/<user>/OpenNetworkLinux
+BALSRC_RELEASE=bal_src_release
+BALSRC_ZIPNAME=SW-BCM68620_2_6_0_1.zip
+SWISDK_TARNAME=sdk-all-6.5.7
+PATCH_FILENAME=ACCTON_BAL_2.6.0.1-V201804301043.patch
+BROADCOM_DOWNLOAD_DIR=/home/<user>/OpenNetworkLinux
+EDGECORE_DOWNLOAD_DIR=/home/<user>/OpenNetworkLinux
+```
+
+Prepare the BAL/Maple build workspace from *outside* of the docker environment. This allows access to network and device resources
+that may not be available in the docker.
+```
+ > cd ${ONL_TOPDIR}
+ > ## Copy all the artifacts from Broadcom under the folder brcm_code and then execute the next script
+ > BROADCOM_DOWNLOAD_DIR=/home/<user>/OpenNetworkLinux EDGECORE_DOWNLOAD_DIR=/home/<user>/OpenNetworkLinux ./asfvolt16-driver/scripts/asfvolt-bal-prepare.sh
+```
+
+### Build BAL/Maple SDK
+
+All of the remaining steps are done *inside* the ONL build docker. Start ONL build docker workspace:
+```
+ > docker/tools/onlbuilder -8 # enter the docker workspace
+ > BROADCOM_DOWNLOAD_DIR=/home/<user>/OpenNetworkLinux ./asfvolt16-driver/scripts/asfvolt-bal-buildall.sh
+```
+
+### Build `voltha_bal_driver`
+
+This step requires access to the voltha source tree so it can find the protobuf definitions used by the
+asfvolt16_olt adapter. Be sure to use matching version of the voltha tree because asfvolt16_olt adapter
+and the voltha_bal_driver need to share the same grpc protobuf definitions.
+
+```
+ONL_TOPDIR=/home/<user>/OpenNetworkLinux
+MAKE_JOBS=4
+BALSRC_RELEASE=bal_src_release
+VOLTHA_TOPDIR=/home/<user>/voltha
+BALSRC_TOPDIR=<BROADCOM_DOWNLOAD_DIR>/bal_src_release/bal_release
+ASFSRC_TOPDIR=<EDGECORE_DOWNLOAD_DIR>/asfvolt16-driver/src
+PATCHF_TOPDIR=<EDGECORE_DOWNLOAD_DIR>/asfvolt16-driver/patches
+```
+From the ONL build docker workspace:
+
+```
+ > BROADCOM_DOWNLOAD_DIR=/home/<user>/OpenNetworkLinux EDGECORE_DOWNLOAD_DIR=/home/<user>/OpenNetworkLinux VOLTHA_TOPDIR=/home/<user>/voltha ./asfvolt16-driver/scripts/asfvolt-driver-build.sh
+```
+
+### Package `voltha_bal_driver` into BAL release tarball
+
+From the ONL build docker workspace:
+
+```
+ > BROADCOM_DOWNLOAD_DIR=/home/<user>/OpenNetworkLinux EDGECORE_DOWNLOAD_DIR=/home/<user>/OpenNetworkLinux ./asfvolt16-driver/scripts/asfvolt-driver-package.sh
+```
+
+The tarball containing the packaged voltha_bal_driver can be found in ${ASFDRVR_PKGDIR}:
+
+```
+ > ls ${EDGECORE_DOWNLOAD_DIR}/asfdrvr-package-dir/
+asfvolt16-voltha-bal-<timestamp>.tgz broadcom opt
+```
+
+### Install `voltha_bal_driver` BAL release tarball
+
+Transfer BAL release tarball to ASFvOLT16:
+
+```
+ > scp ${EDGECORE_DOWNLOAD_DIR}/asfdrvr-package-dir/asfvolt16-voltha-bal-<timestamp>.tgz root@<ASFvOLT16_IP>:.
+```
+
+Install release tarball on ASFvOLT16:
+
+```
+ > ssh root@<ASFvOLT16_IP>
+ root@<ASFvOLT16_IP>'s password: onl
+
+ root@localhost:~# ls
+ asfvolt16-voltha-bal-<timestamp>.tgz
+ root@localhost:~# cd /
+ root@localhost:/# mv /broadcom /broadcom.prev
+ root@localhost:/# mv /opt/bcm68620/ /opt/bcm68620.prev
+ root@localhost:/# tar zxf ~/asfvolt16-voltha-bal-<timestamp>.tgz
+ root@localhost:/# shutdown -r now
+```
+
+To set OLT NNI Port speed:
+
+```
+ The OLT NNI speed can be changed as below in /broadcom/config.bcm in OLT as below:
+ If the config is changed, the OLT needs a reboot for the changes to take effect
+
+ Default config in /broadcom/config.bcm:
+ #100G
+ ucode_port_128.BCM88470=CGE3:core_0.128
+ ucode_port_129.BCM88470=CGE2:core_0.129
+ ucode_port_130.BCM88470=CGE1:core_0.130
+ ucode_port_131.BCM88470=CGE0:core_0.131
+
+ #40G(Comment the config for 100G if set)
+ ucode_port_128.BCM88470=XLGE3:core_0.128
+ ucode_port_129.BCM88470=XLGE2:core_0.129
+ ucode_port_130.BCM88470=XLGE1:core_0.130
+ ucode_port_131.BCM88470=XLGE0:core_0.131
+
+ #4*10G(Comment the config for 100G/40G if set)
+ ucode_port_128.BCM88470=10GBase-R12:core_0.128
+ ucode_port_129.BCM88470=10GBase-R13:core_0.129
+ ucode_port_130.BCM88470=10GBase-R14:core_0.130
+ ucode_port_131.BCM88470=10GBase-R15:core_0.131
+ ucode_port_132.BCM88470=10GBase-R8:core_0.132
+ ucode_port_133.BCM88470=10GBase-R9:core_0.133
+ ucode_port_134.BCM88470=10GBase-R10:core_0.134
+ ucode_port_135.BCM88470=10GBase-R11:core_0.135
+ ucode_port_136.BCM88470=10GBase-R4:core_0.136
+ ucode_port_137.BCM88470=10GBase-R5:core_0.137
+ ucode_port_138.BCM88470=10GBase-R6:core_0.138
+ ucode_port_139.BCM88470=10GBase-R7:core_0.139
+ ucode_port_140.BCM88470=10GBase-R0:core_0.140
+ ucode_port_141.BCM88470=10GBase-R1:core_0.141
+ ucode_port_142.BCM88470=10GBase-R2:core_0.142
+ ucode_port_143.BCM88470=10GBase-R3:core_0.143
+```
+
+USAGE(if executing in foreground):
+```
+ ./voltha_bal_driver "serverIP:port1" -C "serverIP:port2"
+ ./bal_core_dist -C "serverIP:port2"
+```
+
+NOTE: bal_core_dist is a broadcom executable
+
+CONTRIBUTING
+ <TBD>
+
+VERSIONING
+ <TBD>
+
+AUTHORS
+ Radisys Adapter Team
+
+Licence
+ <TBD>
+
+Acknowledgments
+ <TBD>
diff --git a/device_simulator/README.md b/device_simulator/README.md
deleted file mode 100644
index cbc648f..0000000
--- a/device_simulator/README.md
+++ /dev/null
@@ -1,86 +0,0 @@
-GRPC_C DEVICE SIMULATOR
-
- This is a executable(bal_server), which will receive asfvolt16 adapter grpc-c messages and call respective device stub.
- It will send received responses/asynchronous indications from Device stub to Adapter.
-
-GETTING STARTED
-
-prerequisites to install grpc
- - sudo apt-get install build-essential libxml2-dev libgeos++-dev libpq-dev libbz2-dev libtool automake openssl libssl-dev golang-goprotobuf-dev
-
-
-INSTALLATION
-
-steps to install grpc
- - Download as zip "grpc", "grpc-c", "protobuf" and "protobuf-c" from "https://github.com/opennetworkinglab/asfvolt16-driver/tree/master/third_party"
- - place downloaded protobuf folder at grpc/thirdparty
- - place downloaded protobuf-c folder at grpc-c/thirdparty
- - cd grpc/thirdparty/protobuf
- - ./autogen.sh
- - ./configure
- - make
- - sudo make install
- - cd grpc/
- - make
- - sudo make install
-
-steps to install grpc-c
- - cd grpc-c/thirdparty/protobuf-c
- - ./autogen.sh
- - ./configure
- - export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/protobuf
- - export LD_LIBRARY_PATH=/usr/local/lib
- - make
- - sudo make install
-
-Apply grpc-c patch
- - cd grpc-c/
- Patch 1:
- Apply patch in following link for grpc-c/lib - "https://github.com/Juniper/grpc-c/commit/353b40cd920cd749ed6cf71f8df17f1d5cf2c89d"
- Note:
- (This patch is having very few changes in two files(grpc-c/lib/client.c, grpc-c/lib/service.c.
- Download these two files from above link and replace at grpc-c/lib or merge these changes manually.)
- Patch 2:
- Apply patch in service.c.patch and client.c.patch
- - cp Makefile.am grpc-c/examples/
- - cp bal_server.c grpc-c/examples/
- - cp bal_stub.c grpc-c/examples/
- - cp bal_stub.h grpc-c/examples/
- - Note: Update voltha adaptor IP in bal_stub.c
- - autoreconf --install
- - mkdir build && cd build
- - ../configure
- - make
- - sudo make install
-
-To obtain proto files - Have a repo sync of opencord code base:
- - cp opencord/incubator/voltha/voltha/adapters/asfvolt16_olt/protos/* examples/
-
-To autogenerate code from proto files:
- - make autogen
-
-Build bal_server:
- - Note: Remove "-O2" from Makefile
- - make clean_all;make
-
-The ultimate executable bal_server can be found under ~/grpc-c/build/examples/.libs/
-
-USAGE:
- ./bal_server "serverIP:port"
-
-CONTRIBUTING
- <TBD>
-
-VERSIONING
- <TBD>
-
-AUTHORS
- Radisys Adapter Team
-
-Licence
- <TBD>
-
-Acknowledgments
- <TBD>
-
-
diff --git a/device_simulator/bal_stub.c b/device_simulator/bal_stub.c
deleted file mode 100644
index d89a37c..0000000
--- a/device_simulator/bal_stub.c
+++ /dev/null
@@ -1,374 +0,0 @@
-/*
-** Copyright 2017-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.
-*/
-
-#ifdef BAL_STUB
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <signal.h>
-#include "bal_stub.h"
-#include "bal_msg_type.grpc-c.h"
-#include "bal_osmsg.grpc-c.h"
-#include "bal_model_ids.grpc-c.h"
-#include "bal_obj.grpc-c.h"
-#include "bal_model_types.grpc-c.h"
-#include "bal_errno.grpc-c.h"
-#include "bal_indications.grpc-c.h"
-#include "bal.grpc-c.h"
-
-char *voltha_ip_and_port = NULL;
-
-void *stub_thread(void *v)
-{
- int status;
- pthread_mutex_lock(&lock);
- pthread_cond_wait(&cv, &lock);
- while(NULL != shared_queue->front)
- {
- BalErr *output;
- BalObjId prevObjType;
- char vendor_id[20];
- char vendor_specific[20];
- struct QNode *front = deQueue(shared_queue);
- /* prepare and send rpc response */
- BalIndications balIndCfg;
- memset(&balIndCfg, 0, sizeof(BalIndications));
- bal_indications__init(&balIndCfg);
- balIndCfg.has_objtype = 1;
- balIndCfg.objtype = front->obj_type;
- balIndCfg.device_id = front->device_id;
- printf("Device Id = %s\n", front->device_id);
- switch(front->obj_type)
- {
- case BAL_OBJ_ID__BAL_OBJ_ID_ACCESS_TERMINAL:
- {
- printf("***************************************************\n");
- printf("Successful Indication sent for ACCESS_TERMINAL\n");
- printf("***************************************************\n");
- balIndCfg.u_case = BAL_INDICATIONS__U_ACCESS_TERM_IND;
- prevObjType = front->obj_type;
- BalAccessTerminalKey accTermKey;
- memset(&accTermKey, 0, sizeof(BalAccessTerminalKey));
- bal_access_terminal_key__init(&accTermKey);
- accTermKey.has_access_term_id = 1;
- accTermKey.access_term_id = 1;
-
- BalAccessTerminalIndData data;
- memset(&data, 0, sizeof(BalAccessTerminalIndData));
- bal_access_terminal_ind_data__init(&data);
- data.has_admin_state = 1;
- data.admin_state = BAL_STATE__BAL_STATE_UP;
-
- BalAccessTerminalInd access_term_ind;
- memset(&access_term_ind, 0, sizeof(BalAccessTerminalInd));
- bal_access_terminal_ind__init(&access_term_ind);
- access_term_ind.data = &data;
- access_term_ind.key = &accTermKey;
- balIndCfg.access_term_ind = &access_term_ind;
- status = bal_ind__bal_acc_term_ind(client, NULL, &balIndCfg, &output, NULL, 0);
- if(GRPC_C_FAIL == status)
- {
- printf("\n Failed To Send Access Terminal Indication: Please verify the VOLTHA IP Address configured\n");
- }
- is_stub_reboot = 1;
- }
- break;
- case BAL_OBJ_ID__BAL_OBJ_ID_INTERFACE:
- {
- printf("***************************************************\n");
- printf("Successful Indication sent for PON INTERFACE UP\n");
- printf("***************************************************\n");
- balIndCfg.u_case = BAL_INDICATIONS__U_INTERFACE_IND;
- prevObjType = front->obj_type;
- status = bal_ind__bal_iface_ind(client, NULL, &balIndCfg, &output, NULL, 0);
- if(GRPC_C_FAIL == status)
- {
- printf("\n Failed To Send Interface Indication: Please verify the VOLTHA IP Address configured\n");
- }
- }
- break;
- case BAL_OBJ_ID__BAL_OBJ_ID_SUBSCRIBER_TERMINAL:
- {
- BalSubscriberTerminalKey subTermKey;
- memset(&subTermKey, 0, sizeof(BalSubscriberTerminalKey));
- bal_subscriber_terminal_key__init(&subTermKey);
-
- BalSerialNumber serial_number;
- memset(&serial_number, 0, sizeof(BalSerialNumber));
- bal_serial_number__init(&serial_number);
-
-/*
- char vendor_id[20];
- memset(&vendor_id, 0, 20);
- strcpy(vendor_id,"4252434D");
- char vendor_specific[20];
- memset(&vendor_specific, 0, 20);
- strcpy(vendor_specific,"12345678");
-
- if(BAL_OBJ_ID__BAL_OBJ_ID_INTERFACE == prevObjType)
- {
- balIndCfg.u_case = BAL_INDICATIONS__U_TERMINAL_DISC;
- BalSubscriberTerminalSubTermDisc terminal_disc;
- memset(&terminal_disc, 0, sizeof(BalSubscriberTerminalSubTermDisc));
- bal_subscriber_terminal_sub_term_disc__init(&terminal_disc);
- balIndCfg.terminal_disc = &terminal_disc;
-
- balIndCfg.terminal_disc->key = &subTermKey;
- balIndCfg.terminal_disc->key->has_sub_term_id = 1;
- balIndCfg.terminal_disc->key->sub_term_id = front->onu_id;
- balIndCfg.terminal_disc->key->has_intf_id = 1;
- balIndCfg.terminal_disc->key->intf_id = front->intf_id;
-
- BalSubscriberTerminalSubTermDiscData subTermCfgData;
- memset(&subTermCfgData, 0, sizeof(BalSubscriberTerminalSubTermDiscData));
- bal_subscriber_terminal_sub_term_disc_data__init(&subTermCfgData);
- balIndCfg.terminal_disc->data = &subTermCfgData;
- balIndCfg.terminal_disc->data->serial_number = &serial_number;
- balIndCfg.terminal_disc->data->serial_number->vendor_id = vendor_id;
- printf("\n***************************************************\n");
- printf("Sending ONU discovery message\n");
- printf("***************************************************\n");
- status = bal_ind__bal_subs_term_discovery_ind(client, NULL, &balIndCfg, &output, NULL, 0);
- }
- else
- {
-*/
- balIndCfg.u_case = BAL_INDICATIONS__U_TERMINAL_DISC;
- balIndCfg.has_sub_group = 1;
- balIndCfg.sub_group = BAL_SUBSCRIBER_TERMINAL_AUTO_ID__BAL_SUBSCRIBER_TERMINAL_AUTO_ID_SUB_TERM_DISC;
- BalSubscriberTerminalSubTermDisc terminal_disc;
- memset(&terminal_disc, 0, sizeof(BalSubscriberTerminalSubTermDisc));
- bal_subscriber_terminal_sub_term_disc__init(&terminal_disc);
- balIndCfg.terminal_disc = &terminal_disc;
-
- balIndCfg.terminal_disc->key = &subTermKey;
- balIndCfg.terminal_disc->key->has_sub_term_id = 1;
- balIndCfg.terminal_disc->key->sub_term_id = front->onu_id;
- balIndCfg.terminal_disc->key->has_intf_id = 1;
- balIndCfg.terminal_disc->key->intf_id = front->intf_id;
-
- BalSubscriberTerminalSubTermDiscData subTermDiscCfgData;
- memset(&subTermDiscCfgData, 0, sizeof(BalSubscriberTerminalSubTermDiscData));
- bal_subscriber_terminal_sub_term_disc_data__init(&subTermDiscCfgData);
- balIndCfg.terminal_disc->data = &subTermDiscCfgData;
- balIndCfg.terminal_disc->data->serial_number = &serial_number;
- balIndCfg.terminal_disc->data->serial_number->vendor_id = front->vendor_id;
- balIndCfg.terminal_disc->data->serial_number->vendor_specific = front->vendor_specific;
- printf("\n***************************************************\n");
- printf("Sending ONU discovery message\n");
- printf("***************************************************\n");
- status = bal_ind__bal_subs_term_discovery_ind(client, NULL, &balIndCfg, &output, NULL, 0);
-
-
- balIndCfg.u_case = BAL_INDICATIONS__U_TERMINAL_IND;
- balIndCfg.has_sub_group = 1;
- balIndCfg.sub_group = BAL_SUBSCRIBER_TERMINAL_AUTO_ID__BAL_SUBSCRIBER_TERMINAL_AUTO_ID_IND;
- BalSubscriberTerminalInd terminal_ind;
- memset(&terminal_ind, 0, sizeof(BalSubscriberTerminalInd));
- bal_subscriber_terminal_ind__init(&terminal_ind);
- balIndCfg.terminal_ind = &terminal_ind;
-
- balIndCfg.terminal_ind->key = &subTermKey;
- balIndCfg.terminal_ind->key->has_sub_term_id = 1;
- balIndCfg.terminal_ind->key->sub_term_id = front->onu_id;
- balIndCfg.terminal_ind->key->has_intf_id = 1;
- balIndCfg.terminal_ind->key->intf_id = front->intf_id;
-
- BalSubscriberTerminalIndData subTermCfgData;
- memset(&subTermCfgData, 0, sizeof(BalSubscriberTerminalIndData));
- bal_subscriber_terminal_ind_data__init(&subTermCfgData);
- balIndCfg.terminal_ind->data = &subTermCfgData;
- balIndCfg.terminal_ind->data->has_admin_state = 1;
- balIndCfg.terminal_ind->data->admin_state = BAL_STATE__BAL_STATE_UP;
- balIndCfg.terminal_ind->data->has_oper_status = 1;
- balIndCfg.terminal_ind->data->oper_status = BAL_STATUS__BAL_STATUS_UP;
- balIndCfg.terminal_ind->data->serial_number = &serial_number;
- balIndCfg.terminal_ind->data->serial_number->vendor_id = front->vendor_id;
- balIndCfg.terminal_ind->data->serial_number->vendor_specific = front->vendor_specific;
- printf("***************************************************\n");
- printf("ONU Activation Successful %s\n", balIndCfg.terminal_ind->data->serial_number->vendor_specific);
- printf("***************************************************\n");
- status = bal_ind__bal_subs_term_ind(client, NULL, &balIndCfg, &output, NULL, 0);
-/*
- }
-*/
- prevObjType = front->obj_type;
- }
- break;
- case BAL_OBJ_ID__BAL_OBJ_ID_PACKET:
- {
- balIndCfg.u_case = BAL_INDICATIONS__U_BAL_OMCI_RESP;
- BalPacketItuOmciChannelRx balomciresp;
- memset(&balomciresp, 0, sizeof(BalPacketItuOmciChannelRx));
- bal_packet_itu_omci_channel_rx__init(&balomciresp);
-
- BalPacketKey balomcirespkey;
- memset(&balomcirespkey, 0, sizeof(BalPacketKey));
- bal_packet_key__init(&balomcirespkey);
- balomciresp.key = &balomcirespkey;
- balIndCfg.balomciresp = &balomciresp;
-
- BalDest balomcirespkeydest;
- memset(&balomcirespkeydest, 0, sizeof(BalDest));
- bal_dest__init(&balomcirespkeydest);
- balomciresp.key->packet_send_dest = &balomcirespkeydest;
- balomciresp.key->packet_send_dest->has_type = 1;
- balomciresp.key->packet_send_dest->type = BAL_DEST_TYPE__BAL_DEST_TYPE_ITU_OMCI_CHANNEL;
- balomciresp.key->packet_send_dest->u_case = BAL_DEST__U_ITU_OMCI_CHANNEL;
-
- BalItuOmciChannel itu_omci_channel;
- memset(&itu_omci_channel, 0, sizeof(BalItuOmciChannel));
- bal_itu_omci_channel__init(&itu_omci_channel);
- balomciresp.key->packet_send_dest->itu_omci_channel = &itu_omci_channel;
- balomciresp.key->packet_send_dest->itu_omci_channel->has_sub_term_id = 1;
- balomciresp.key->packet_send_dest->itu_omci_channel->sub_term_id = front->onu_id;
- balomciresp.key->packet_send_dest->itu_omci_channel->has_intf_id = 1;
- balomciresp.key->packet_send_dest->itu_omci_channel->intf_id = front->intf_id;
- status = bal_ind__bal_pkt_omci_channel_rx_ind(client, NULL, &balIndCfg, &output, NULL, 0);
- }
- break;
- default:
- {
- balIndCfg.u_case = BAL_INDICATIONS__U__NOT_SET;
- prevObjType = front->obj_type;
- }
- break;
- }
- free(front);
- pthread_mutex_unlock(&lock);
- pthread_mutex_lock(&lock);
- pthread_cond_wait(&cv, &lock);
- }
- return NULL;
-}
-
-void create_stub_thread()
-{
- pthread_t threadId = 0;
-
- /* create shared queue */
- shared_queue = createQueue();
-
- pthread_create(&threadId, NULL, stub_thread, NULL);
-
-}
-
-/* A utility function to create an empty queue */
-bal_queue *createQueue()
-{
- shared_queue = (struct Queue*)malloc(sizeof(struct Queue));
- shared_queue->front = shared_queue->rear = NULL;
- return shared_queue;
-}
-
-/* A utility function to create a new linked list node */
-struct QNode* newNode(int objKey, int status, char *device_id)
-{
- struct QNode *temp = (struct QNode*)malloc(sizeof(struct QNode));
- temp->obj_type = objKey;
- temp->status = status;
- if(device_id != NULL)
- {
- memset(temp->device_id, 0, BAL_DEVICE_STR_LEN);
- memcpy(temp->device_id, device_id, strlen(device_id));
- }
- temp->next = NULL;
- return temp;
-}
-
-/* The function to add data to shared_queue - Add end of the queue */
-void enQueue(int objKey, struct QNode *temp)
-{
- /* Create a new LL node */
-
- /* If queue is empty, then new node is front and rear both */
- if (shared_queue->rear == NULL)
- {
- shared_queue->front = shared_queue->rear = temp;
- return;
- }
-
- /* Add the new node at the end of queue and change rear */
- shared_queue->rear->next = temp;
- shared_queue->rear = temp;
-}
-
-/* Function to remove data from shared_queue - FIFO */
-struct QNode *deQueue()
-{
- /* If queue is empty, return NULL */
- if (shared_queue->front == NULL)
- {
- return NULL;
- }
-
- /* Store previous front and move front one node ahead */
- struct QNode *temp = shared_queue->front;
- shared_queue->front = shared_queue->front->next;
-
- /* If front becomes NULL, then change rear also as NULL */
- if (shared_queue->front == NULL)
- {
- shared_queue->rear = NULL;
- }
-
- return temp;
-}
-
-void stub_bal_init(BalInit *bal_init)
-{
- char *ip_and_port = NULL;
- ip_and_port = bal_init->voltha_adapter_ip_port;
- client = grpc_c_client_init(ip_and_port, "bal_client", NULL);
-}
-
-void stub_bal_stats_get(BalInterfaceStatData *statData)
-{
- printf("Bal Stub - Get Stats In BalStubs : Got all the statistics\n");
- statData->has_rx_bytes = 1;
- statData->has_rx_packets=1;
- statData->has_rx_ucast_packets=1;
- statData->has_rx_mcast_packets=1;
- statData->has_rx_bcast_packets=1;
- statData->has_rx_error_packets=1;
- statData->has_rx_unknown_protos=1;
- statData->has_tx_bytes = 1;
- statData->has_tx_packets=1;
- statData->has_tx_ucast_packets=1;
- statData->has_tx_mcast_packets=1;
- statData->has_tx_bcast_packets=1;
- statData->has_tx_error_packets=1;
- statData->has_rx_crc_errors=1;
- statData->has_bip_errors=1;
-
- statData->rx_bytes = 1000; /**< RFC 2233 */
- statData->rx_packets = 100; /**< RFC 1213 ucast + none-ucast */
- statData->rx_ucast_packets = 5; /**< RFC 2233 */
- statData->rx_mcast_packets = 10; /**< RFC 2233 */
- statData->rx_bcast_packets = 15; /**< RFC 2233 */
- statData->rx_error_packets = 20; /**< RFC 1213 */
- statData->rx_unknown_protos = 45; /**< RFC 1213 */
- statData->tx_bytes = 2000; /**< RFC 2233 */
- statData->tx_packets = 190; /**< RFC 1213 ucast + none-ucast */
- statData->tx_ucast_packets = 30; /**< RFC 2233 */
- statData->tx_mcast_packets = 50; /**< RFC 2233 */
- statData->tx_bcast_packets = 80; /**< RFC 2233 */
- statData->tx_error_packets = 40; /**< RFC 1213 */
- statData->rx_crc_errors = 5; /**< Received packets with CRC error. */
- statData->bip_errors = 15;
-}
-
-#endif
diff --git a/device_simulator/bal_stub.h b/device_simulator/bal_stub.h
deleted file mode 100644
index c5e7d7b..0000000
--- a/device_simulator/bal_stub.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
-** Copyright 2017-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 "bal_msg_type.grpc-c.h"
-#include "bal_osmsg.grpc-c.h"
-#include "bal_model_ids.grpc-c.h"
-#include "bal_obj.grpc-c.h"
-#include "bal_model_types.grpc-c.h"
-#include "bal_errno.grpc-c.h"
-#include "bal_indications.grpc-c.h"
-#include "bal.grpc-c.h"
-
-/* Global definations */
-pthread_cond_t cv;
-pthread_mutex_t lock;
-unsigned int is_stub_reboot;
-
-#define IND_USR_DAT_LEN 8
-#define IND_USR_DAT_VAL "brcmOLT"
-#define BALCLIENT "bal_client"
-#define BALSERVER "bal_server"
-#define BAL_DEVICE_STR_LEN 20
-#define ASFVOLT_ERROR 1
-#define ASFVOLT_INFO 2
-#define ASFVOLT_DEBUG 3
-
-typedef struct BalCoreIpInfo
-{
- char bal_core_arg1[4];
- char bal_core_ip_port[24];
- char bal_core_arg2[4];
- char bal_shared_lib_ip_port[24];
-}balCoreIpInfo;
-
-/* A linked list (LL) node to store a queue entry */
-struct QNode
-{
- int obj_type;
- char device_id[BAL_DEVICE_STR_LEN];
- int status;
- int intf_id;
- int onu_id;
- char vendor_id[BAL_DEVICE_STR_LEN];
- char vendor_specific[BAL_DEVICE_STR_LEN];
- struct QNode *next;
-};
-
-
-/* The queue, front stores the front node of LL and rear stores ths
- last node of LL */
-typedef struct Queue
-{
- struct QNode *front, *rear;
-}bal_queue;
-
-#define ASFVOLT_LOG(log_type, format, args...) \
- if(log_type) \
- {\
- printf("File(%s): Line(%d): ", __FUNCTION__, __LINE__);\
- printf(format, ## args);\
- }
-
-/* shared queue */
-bal_queue *shared_queue;
-
-void create_stub_thread();
-bal_queue *createQueue();
-struct QNode* newNode(int objKey, int status, char *device_id);
-void enQueue(int objKey, struct QNode *temp);
-struct QNode *deQueue();
-grpc_c_client_t *client;
-void stub_bal_init(BalInit *bal_init);
diff --git a/device_simulator/client.c.patch b/device_simulator/client.c.patch
deleted file mode 100644
index c77a281..0000000
--- a/device_simulator/client.c.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-*** grpc-c_orig/lib/client.c 2017-07-03 16:52:30.467488835 +0530
---- grpc-c/lib/client.c 2017-07-12 15:34:28.904950001 +0530
-***************
-*** 134,141 ****
- }
-
- bzero(buf, BUFSIZ);
-! snprintf_safe(buf, sizeof(buf), "%s%s", PATH_GRPC_C_DAEMON_SOCK,
-! server_name);
- if (buf[0] == '\0') {
- return NULL;
- }
---- 134,141 ----
- }
-
- bzero(buf, BUFSIZ);
-! /*snprintf_safe(buf, sizeof(buf), "%s%s", PATH_GRPC_C_DAEMON_SOCK, server_name);*/
-! snprintf_safe(buf, sizeof(buf), "%s", server_name);
- if (buf[0] == '\0') {
- return NULL;
- }
-***************
-*** 1039,1049 ****
---- 1039,1051 ----
- gpr_timespec tout;
- grpc_c_context_t *context;
-
-+ #if 0
- if (context == NULL) {
- gpr_log(GPR_ERROR, "Invalid context pointer provided");
- rc = GRPC_C_FAIL;
- goto cleanup;
- }
-+ #endif
-
- context = gc_client_prepare_ops(client, mdarray, 1, input, NULL,
- client_streaming, server_streaming, NULL,
-***************
---- grpc-c_orig/lib/client.c 2017-09-19 21:08:29.506546198 +0530
-+++ grpc-c/lib/client.c 2017-09-19 21:10:52.137702783 +0530
-@@ -967,7 +967,6 @@
-
- if (*output == NULL) {
- grpc_c_context_free(context);
-- gpr_log(GPR_ERROR, "No output to return");
- rc = GRPC_C_FAIL;
- goto cleanup;
- }
-
diff --git a/device_simulator/service.c.patch b/device_simulator/service.c.patch
deleted file mode 100644
index da8ebd8..0000000
--- a/device_simulator/service.c.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-*** grpc-c_orig/lib/service.c 2017-07-03 16:52:38.239488835 +0530
---- grpc-c/lib/service.c 2017-07-12 15:34:43.408198001 +0530
-***************
-*** 1224,1230 ****
- return NULL;
- }
-
-! snprintf_safe(buf, sizeof(buf), "%s%s", PATH_GRPC_C_DAEMON_SOCK, name);
-
- if (buf[0] == '\0') {
- return NULL;
---- 1224,1231 ----
- return NULL;
- }
-
-! /*snprintf_safe(buf, sizeof(buf), "%s%s", PATH_GRPC_C_DAEMON_SOCK, name);*/
-! snprintf_safe(buf, sizeof(buf), "%s", name);
-
- if (buf[0] == '\0') {
- return NULL;
diff --git a/scripts/asfvolt-bal-buildall.sh b/scripts/asfvolt-bal-buildall.sh
index 29bcbcf..7107f69 100755
--- a/scripts/asfvolt-bal-buildall.sh
+++ b/scripts/asfvolt-bal-buildall.sh
@@ -22,7 +22,7 @@
# override shell variables to match custom local build environment
: ${ONL_TOPDIR:=`pwd`}
: ${MAKE_JOBS:=1}
-: ${BALSRC_RELEASE:=bal_src_release}
+: ${BALSRC_RELEASE:=${BROADCOM_DOWNLOAD_DIR}/bal_src_release}
: ${SWISDK_TARNAME:=sdk-all-6.5.7}
echo ONL_TOPDIR=${ONL_TOPDIR}
diff --git a/scripts/asfvolt-bal-prepare.sh b/scripts/asfvolt-bal-prepare.sh
index 14bbd6d..f847fa6 100755
--- a/scripts/asfvolt-bal-prepare.sh
+++ b/scripts/asfvolt-bal-prepare.sh
@@ -22,36 +22,45 @@
# override shell variables to match custom local build environment
: ${ONL_TOPDIR:=`pwd`}
: ${BALSRC_RELEASE:=bal_src_release}
-: ${BALSRC_ZIPNAME:=SW-BCM68620_2_4_7_12.zip}
+: ${BALSRC_ZIPNAME:=SW-BCM68620_2_6_0_1.zip}
: ${SWISDK_TARNAME:=sdk-all-6.5.7}
-: ${BROADCOM_DOWNLOAD_DIR:=${HOME}/broadcom/download} # directory containing SW-BCM68620_2_4_x.zip
-: ${EDGECORE_DOWNLOAD_DIR:=${HOME}/edgecore/download} # directory containing ASFvOLT16 patch file for BAL
+: ${BROADCOM_DOWNLOAD_DIR:=${HOME}/OpenNetworkLinux} # directory containing SW-BCM68620_2_4_x.zip
+: ${EDGECORE_DOWNLOAD_DIR:=${HOME}/OpenNetworkLinux} # directory containing ASFvOLT16 patch file for BAL
-: ${PATCH_FILENAME:=ACCTON_BAL_2.4.7.12-V201712061142.patch} # use latest known ASFvOLT16 patch file as default
+: ${PATCH_FILENAME_1:=ACCTON_BAL_2.6.0.1-V201804301043.patch} # use latest known ASFvOLT16 patch file as default
+: ${PATCH_FILENAME_2:=bal_2_6_0_1_5_18_2018.patch} # Transparent double tag fix
+: ${PATCH_FILENAME_3:=bal_2_6_0_1_23_07_2018_rsys.patch} # Flow deactivate and delete fix
echo ONL_TOPDIR=${ONL_TOPDIR}
echo BALSRC_RELEASE=${BALSRC_RELEASE}
echo BALSRC_ZIPNAME=${BALSRC_ZIPNAME}
echo SWISDK_TARNAME=${SWISDK_TARNAME}
-echo PATCH_FILENAME=${PATCH_FILENAME}
+echo PATCH_FILENAME_1=${PATCH_FILENAME_1}
+echo PATCH_FILENAME_2=${PATCH_FILENAME_2}
+echo PATCH_FILENAME_3=${PATCH_FILENAME_3}
echo BROADCOM_DOWNLOAD_DIR=${BROADCOM_DOWNLOAD_DIR}
echo EDGECORE_DOWNLOAD_DIR=${EDGECORE_DOWNLOAD_DIR}
-mkdir -p $ONL_TOPDIR/${BALSRC_RELEASE}
-cd $ONL_TOPDIR/${BALSRC_RELEASE}
+cp -rf $EDGECORE_DOWNLOAD_DIR/asfvolt16-driver/brcm_code/* ${BROADCOM_DOWNLOAD_DIR}/
+mkdir -p ${BROADCOM_DOWNLOAD_DIR}/${BALSRC_RELEASE}
+cd ${BROADCOM_DOWNLOAD_DIR}/${BALSRC_RELEASE}
unzip ${BROADCOM_DOWNLOAD_DIR}/${BALSRC_ZIPNAME}
cp $BROADCOM_DOWNLOAD_DIR/${SWISDK_TARNAME}.tar.gz bal_release/3rdparty/bcm-sdk/
-cp $EDGECORE_DOWNLOAD_DIR/${PATCH_FILENAME} .
+cp $EDGECORE_DOWNLOAD_DIR/${PATCH_FILENAME_1} .
+cp $EDGECORE_DOWNLOAD_DIR/${PATCH_FILENAME_2} .
+cp $EDGECORE_DOWNLOAD_DIR/${PATCH_FILENAME_3} .
chmod -R 744 .
-patch -p1 < ${PATCH_FILENAME}
+patch -p1 < ${PATCH_FILENAME_1}
+patch -p1 < ${PATCH_FILENAME_2}
+patch -p1 < ${PATCH_FILENAME_3}
mkdir -p bcm68620_release/asfvolt16/kernels
cd bcm68620_release/asfvolt16/kernels
-ln -s ../../../../packages/base/amd64/kernels/kernel-3.7-x86-64-all/builds/linux-3.7.10 linux-3.7.10
-ln -s ../../../../packages/base/any/kernels/archives/linux-3.7.10.tar.xz linux-3.7.10.tar.xz
-ln -s ../../../../packages/base/any/kernels/3.7/configs/x86_64-all/x86_64-all.config x86_64-all.config
+ln -s ${ONL_TOPDIR}/packages/base/amd64/kernels/kernel-3.7-x86-64-all/builds/linux-3.7.10 linux-3.7.10
+ln -s ${ONL_TOPDIR}/packages/base/any/kernels/archives/linux-3.7.10.tar.xz linux-3.7.10.tar.xz
+ln -s ${ONL_TOPDIR}/packages/base/any/kernels/3.7/configs/x86_64-all/x86_64-all.config x86_64-all.config
echo "BAL build area prepared"
diff --git a/scripts/asfvolt-driver-build.sh b/scripts/asfvolt-driver-build.sh
index 7995fd6..b4b1551 100755
--- a/scripts/asfvolt-driver-build.sh
+++ b/scripts/asfvolt-driver-build.sh
@@ -23,12 +23,12 @@
# override shell variables to match custom local build environment
: ${ONL_TOPDIR:=`pwd`}
-: ${BALSRC_RELEASE=bal_src_release}
-: ${VOLTHA_TOPDIR:=${HOME}/voltha/incubator/voltha}
-: ${BALSRC_TOPDIR:=${ONL_TOPDIR}/${BALSRC_RELEASE}/bal_release}
-: ${ASFSRC_TOPDIR:=${ONL_TOPDIR}/${ASFVOLT_REPO_NAME}/src}
-: ${DEVSIM_TOPDIR:=${ONL_TOPDIR}/${ASFVOLT_REPO_NAME}/device_simulator}
-: ${PATCHF_TOPDIR:=${ONL_TOPDIR}/${ASFVOLT_REPO_NAME}/patches}
+: ${BALSRC_RELEASE=${BROADCOM_DOWNLOAD_DIR}/bal_src_release}
+: ${VOLTHA_TOPDIR:=${HOME}/voltha}
+: ${BALSRC_TOPDIR:=${BALSRC_RELEASE}/bal_release}
+: ${ASFSRC_TOPDIR:=${EDGECORE_DOWNLOAD_DIR}/${ASFVOLT_REPO_NAME}/src}
+: ${PATCHF_TOPDIR:=${EDGECORE_DOWNLOAD_DIR}/${ASFVOLT_REPO_NAME}/patches}
+: ${GRPC_C_PATH:=${EDGECORE_DOWNLOAD_DIR}/grpc-c}
echo ONL_TOPDIR=${ONL_TOPDIR}
echo MAKE_JOBS=${MAKE_JOBS}
@@ -36,7 +36,6 @@
echo VOLTHA_TOPDIR=${VOLTHA_TOPDIR}
echo BALSRC_TOPDIR=${BALSRC_TOPDIR}
echo ASFSRC_TOPDIR=${ASFSRC_TOPDIR}
-echo DEVSIM_TOPDIR=${DEVSIM_TOPDIR}
echo PATCHF_TOPDIR=${PATCHF_TOPDIR}
# archived ZIP files from "https://github.com/opennetworkinglab/asfvolt16-driver/tree/master/third_party"
@@ -45,6 +44,8 @@
PROTOBUF_ARCH=703cd8e11c8d34283d4c8bf869c61866e8211c9d
PROTOBUF_C_ARCH=6a4f9a9a67c06769aaa9f65e8f89a56483271f5a
+cd ${EDGECORE_DOWNLOAD_DIR}
+
# Note: removes existing directories: grpc, protobuf
rm -rf grpc protobuf grpc-* protobuf-*
@@ -56,6 +57,7 @@
#steps to install grpc
# - Download as zip "grpc", "grpc-c", "protobuf" and "protobuf-c" from "https://github.com/opennetworkinglab/asfvolt16-driver/tree/master/third_party"
+#comment the below 4 lines and download manually in case of errors
wget https://github.com/grpc/grpc/archive/${GRPC_ARCH}.zip
wget https://github.com/Juniper/grpc-c/archive/${GRPC_C_ARCH}.zip
wget https://github.com/google/protobuf/archive/${PROTOBUF_ARCH}.zip
@@ -86,7 +88,7 @@
# - ./configure
# - make
# - sudo make install
-cd ${ONL_TOPDIR}/grpc/thirdparty/protobuf
+cd ${EDGECORE_DOWNLOAD_DIR}/grpc/thirdparty/protobuf
./autogen.sh
./configure
make --jobs=${MAKE_JOBS}
@@ -97,7 +99,7 @@
# - make
# - sudo make install
-cd ${ONL_TOPDIR}/grpc
+cd ${EDGECORE_DOWNLOAD_DIR}/grpc
export LD_LIBRARY_PATH=/usr/local/lib
make --jobs=${MAKE_JOBS}
sudo make install
@@ -109,7 +111,7 @@
#- make
#- sudo make install
-cd ${ONL_TOPDIR}/grpc-c/third_party/protobuf-c
+cd ${EDGECORE_DOWNLOAD_DIR}/grpc-c/third_party/protobuf-c
./autogen.sh
./configure
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/protobuf
@@ -118,7 +120,7 @@
#Apply grpc-c patch
# - cd ${HOME}/OpenNetworkLinux/grpc-c/
-cd ${ONL_TOPDIR}/grpc-c
+cd ${EDGECORE_DOWNLOAD_DIR}/grpc-c
# Patch 1:
# Apply patch in following link for grpc-c/lib - "https://github.com/Juniper/grpc-c/commit/353b40cd920cd749ed6cf71f8df17f1d5cf2c89d"
# Note:
@@ -130,18 +132,9 @@
# Apply patch in service.c.patch and client.c.patch
patch -p1 -i ${PATCHF_TOPDIR}/grpc-c_asfvolt16.patch
-#
-# - cd ${HOME}/OpenNetworkLinux
-# - cp asfvolt16-driver/device_simulator/Makefile.am grpc-c/examples/
-# - cp asfvolt16-driver/device_simulator/voltha_bal_driver.c grpc-c/examples/
-# - cp asfvolt16-driver/device_simulator/bal_stub.c grpc-c/examples/
-# - cp asfvolt16-driver/device_simulator/bal_stub.h grpc-c/examples/
-# - Note: Update voltha adaptor IP in bal_stub.c (Is this required? Not clear which variable needs to be updated).
cd ${ONL_TOPDIR}
-cp ${DEVSIM_TOPDIR}/Makefile.am grpc-c/examples/
-cp ${DEVSIM_TOPDIR}/voltha_bal_driver.c grpc-c/examples/
-cp ${DEVSIM_TOPDIR}/bal_stub.c grpc-c/examples/
-cp ${DEVSIM_TOPDIR}/bal_stub.h grpc-c/examples/
+cp ${ASFSRC_TOPDIR}/Makefile.am ${EDGECORE_DOWNLOAD_DIR}/grpc-c/examples/
+cp ${ASFSRC_TOPDIR}/voltha_bal_driver.c ${EDGECORE_DOWNLOAD_DIR}/grpc-c/examples/
#
# - cd ${HOME}/OpenNetworkLinux/grpc-c
@@ -150,7 +143,7 @@
# - ../configure
# - make
# - sudo make install
-cd ${ONL_TOPDIR}/grpc-c
+cd ${EDGECORE_DOWNLOAD_DIR}/grpc-c
autoreconf --install
mkdir build && cd build
../configure
@@ -162,13 +155,13 @@
# - cd ${HOME}/OpenNetworkLinux/grpc-c/
# - cp ${HOME}/voltha/voltha/adapters/asfvolt16_olt/protos/* examples/
#
-cd ${ONL_TOPDIR}/grpc-c
+cd ${EDGECORE_DOWNLOAD_DIR}/grpc-c
cp ${VOLTHA_TOPDIR}/voltha/adapters/asfvolt16_olt/protos/* examples
#To autogenerate code from proto files:
# - cd ${HOME}/OpenNetworkLinux/grpc-c/build/examples
# - make autogen
-cd ${ONL_TOPDIR}/grpc-c/build/examples
+cd ${EDGECORE_DOWNLOAD_DIR}/grpc-c/build/examples
make autogen
#
@@ -176,7 +169,7 @@
# - cd ${HOME}/OpenNetworkLinux/grpc-c/build/examples
# - Note: Remove "-O2" from Makefile
# - Note: Set EDGECORE and BRCM_PATH in Makefile
-cd ${ONL_TOPDIR}/grpc-c/build/examples
+cd ${EDGECORE_DOWNLOAD_DIR}/grpc-c/build/examples
sed -i -e 's/-O2/-O0/g' \
-e "s:^EDGECORE = /home/asfvolt/shared.*:#&\nEDGECORE = ${ASFSRC_TOPDIR}:" \
-e "s:^BRCM_PATH = /home/asfvolt/shared.*:#&\nBRCM_PATH = ${BALSRC_TOPDIR}:" \
@@ -184,12 +177,13 @@
pushd ${ASFSRC_TOPDIR}
sed -i -e "s:^BRDCM_SRC=/home/asfvolt/shared.*:#&\nBRDCM_SRC = ${BALSRC_TOPDIR}:" \
- -e "s:^GRPC_C_PATH= /home/asfvolt/shared.*:#&\nGRPC_C_PATH = ${ONL_TOPDIR}/grpc-c:" \
- Makefile
+ -e "s:^GRPC_C_PATH=/home/asfvolt/shared.*:#&\nGRPC_C_PATH = ${GRPC_C_PATH}:" \
+ Makefile
popd
+
#```
-# EDGECORE = ${HOME}/OpenNetworkLinux/asfvolt16-driver/src/
-# BRCM_PATH = ${HOME}/OpenNetworkLinux/bal_src_release/bal_release
+# EDGECORE = ${EDGECORE_DOWNLOAD_DIR}asfvolt16-driver/src/
+# BRCM_PATH = ${BROADCOM_DOWNLOAD_DIR}/bal_src_release/bal_release
#```
# - make clean_all;make
make clean_all
diff --git a/scripts/asfvolt-driver-package.sh b/scripts/asfvolt-driver-package.sh
index b6f7d62..7555191 100755
--- a/scripts/asfvolt-driver-package.sh
+++ b/scripts/asfvolt-driver-package.sh
@@ -24,10 +24,10 @@
# override shell variables to match custom local build environment
: ${ONL_TOPDIR:=`pwd`}
: ${BALSRC_RELEASE:=bal_src_release}
-: ${BALREL_TOPDIR:=${ONL_TOPDIR}/${BALSRC_RELEASE}}
-: ${BALSRC_TOPDIR:=${ONL_TOPDIR}/${BALSRC_RELEASE}/bal_release}
-: ${ASFSCR_TOPDIR:=${ONL_TOPDIR}/${ASFVOLT_REPO_NAME}/scripts}
-: ${ASFDRVR_PKGDIR:=${ONL_TOPDIR}/asfdrvr-package-dir}
+: ${BALREL_TOPDIR:=${BROADCOM_DOWNLOAD_DIR}/${BALSRC_RELEASE}}
+: ${BALSRC_TOPDIR:=${EDGECORE_DOWNLOAD_DIR}/${BALSRC_RELEASE}/bal_release}
+: ${ASFSCR_TOPDIR:=${EDGECORE_DOWNLOAD_DIR}/${ASFVOLT_REPO_NAME}/scripts}
+: ${ASFDRVR_PKGDIR:=${EDGECORE_DOWNLOAD_DIR}/asfdrvr-package-dir}
: ${ASFDVR_TARBALL_NAME:=asfvolt16-voltha-bal}
: ${BUILD_FILENAME_TAG:=`date +%Y%m%d%H%M`}
: ${ASFDVR_TARBALL_FNAME:=${ASFDVR_TARBALL_NAME}-${BUILD_FILENAME_TAG}.tgz}
@@ -42,7 +42,8 @@
echo BUILD_FILENAME_TAG=${BUILD_FILENAME_TAG}
echo ASFDVR_TARBALL_FNAME=${ASFDVR_TARBALL_FNAME}
-# Note: removes existing directories: asfvolt16-driver, grpc, protobuf
+# Note: removes existing directories: asfvolt16-driver
+cd ${EDGECORE_DOWNLOAD_DIR}
rm -rf ${ASFDRVR_PKGDIR}
@@ -56,25 +57,25 @@
cd broadcom
# add grpc-c libs
-cp -pR ${ONL_TOPDIR}/grpc-c/build/lib/.libs/libgrpc-c.so.0.0.0 .
+cp -pR ${EDGECORE_DOWNLOAD_DIR}/grpc-c/build/lib/.libs/libgrpc-c.so.0.0.0 .
ln -s /broadcom/libgrpc-c.so.0.0.0 libgrpc-c.so.0
ln -s /broadcom/libgrpc-c.so.0.0.0 libgrpc-c.so
# add grpc libs
-cp -pR ${ONL_TOPDIR}/grpc/libs/opt/libgrp*.so* .
-cp -pR ${ONL_TOPDIR}/grpc/libs/opt/libgpr*.so* .
+cp -pR ${EDGECORE_DOWNLOAD_DIR}/grpc/libs/opt/libgrp*.so* .
+cp -pR ${EDGECORE_DOWNLOAD_DIR}/grpc/libs/opt/libgpr*.so* .
# add protobuf-c libs
-cp -pR ${ONL_TOPDIR}/grpc-c/third_party/protobuf-c/protobuf-c/.libs/libprotobuf-c.so* .
+cp -pR ${EDGECORE_DOWNLOAD_DIR}/grpc-c/third_party/protobuf-c/protobuf-c/.libs/libprotobuf-c.so* .
# add protobuf libs
-cp -pR ${ONL_TOPDIR}/grpc/thirdparty/protobuf/src/.libs/libprotobuf.so* .
-cp -pR ${ONL_TOPDIR}/grpc/thirdparty/protobuf/src/.libs/libprotobuf-lite.so* .
-cp -pR ${ONL_TOPDIR}/grpc/thirdparty/protobuf/src/.libs/libprotoc.so* .
+cp -pR ${EDGECORE_DOWNLOAD_DIR}/grpc/thirdparty/protobuf/src/.libs/libprotobuf.so* .
+cp -pR ${EDGECORE_DOWNLOAD_DIR}/grpc/thirdparty/protobuf/src/.libs/libprotobuf-lite.so* .
+cp -pR ${EDGECORE_DOWNLOAD_DIR}/grpc/thirdparty/protobuf/src/.libs/libprotoc.so* .
rm *.0T
# add voltha_bal_driver
-cp -pR ${ONL_TOPDIR}/grpc-c/build/examples/.libs/voltha_bal_driver .
+cp -pR ${EDGECORE_DOWNLOAD_DIR}/grpc-c/build/examples/.libs/voltha_bal_driver .
# add voltha driver startup scripts
cp -p ${ASFSCR_TOPDIR}/voltha_init_sh voltha_init.sh
diff --git a/scripts/asfvolt-voltha_bal_driver-build.sh b/scripts/asfvolt-voltha_bal_driver-build.sh
new file mode 100755
index 0000000..19ce328
--- /dev/null
+++ b/scripts/asfvolt-voltha_bal_driver-build.sh
@@ -0,0 +1,83 @@
+#
+# Copyright 2017-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.
+#
+#
+# Run from OpenNetworkLinux top directory
+#
+#cd /aux/OpenNetworkLinux
+set -e
+ASFVOLT_REPO_NAME=asfvolt16-driver
+: ${MAKE_JOBS:=4}
+
+# override shell variables to match custom local build environment
+: ${ONL_TOPDIR:=`pwd`}
+: ${BALSRC_RELEASE=${BROADCOM_DOWNLOAD_DIR}/bal_src_release}
+: ${VOLTHA_TOPDIR:=${HOME}/voltha}
+: ${BALSRC_TOPDIR:=${BALSRC_RELEASE}/bal_release}
+: ${ASFSRC_TOPDIR:=${EDGECORE_DOWNLOAD_DIR}/${ASFVOLT_REPO_NAME}/src}
+: ${PATCHF_TOPDIR:=${EDGECORE_DOWNLOAD_DIR}/${ASFVOLT_REPO_NAME}/patches}
+: ${GRPC_C_PATH:=${EDGECORE_DOWNLOAD_DIR}/grpc-c}
+
+echo ONL_TOPDIR=${ONL_TOPDIR}
+echo MAKE_JOBS=${MAKE_JOBS}
+echo BALSRC_RELEASE=${BALSRC_RELEASE}
+echo VOLTHA_TOPDIR=${VOLTHA_TOPDIR}
+echo BALSRC_TOPDIR=${BALSRC_TOPDIR}
+echo ASFSRC_TOPDIR=${ASFSRC_TOPDIR}
+echo PATCHF_TOPDIR=${PATCHF_TOPDIR}
+
+#To obtain proto files - Have a repo sync of opencord voltha code base:
+# - git clone https://github.com/opencord/voltha.git ${HOME}/voltha
+# - cd ${HOME}/OpenNetworkLinux/grpc-c/
+# - cp ${HOME}/voltha/voltha/adapters/asfvolt16_olt/protos/* examples/
+#
+cd ${EDGECORE_DOWNLOAD_DIR}/grpc-c
+cp ${VOLTHA_TOPDIR}/voltha/adapters/asfvolt16_olt/protos/* examples/
+
+#To autogenerate code from proto files:
+# - cd ${HOME}/OpenNetworkLinux/grpc-c/build/examples
+# - make autogen
+cd ${EDGECORE_DOWNLOAD_DIR}/grpc-c/build/examples
+cp ${ASFSRC_TOPDIR}/voltha_bal_driver.c ${EDGECORE_DOWNLOAD_DIR}/grpc-c/examples/
+make autogen
+
+#
+#Build voltha_bal_driver:
+# - cd ${HOME}/OpenNetworkLinux/grpc-c/build/examples
+# - Note: Remove "-O2" from Makefile
+# - Note: Set EDGECORE and BRCM_PATH in Makefile
+cd ${EDGECORE_DOWNLOAD_DIR}/grpc-c/build/examples
+sed -i -e 's/-O2/-O0/g' \
+ -e "s:^EDGECORE = /home/asfvolt/shared.*:#&\nEDGECORE = ${ASFSRC_TOPDIR}:" \
+ -e "s:^BRCM_PATH = /home/asfvolt/shared.*:#&\nBRCM_PATH = ${BALSRC_TOPDIR}:" \
+ Makefile
+
+pushd ${ASFSRC_TOPDIR}
+sed -i -e "s:^BRDCM_SRC=/home/asfvolt/shared.*:#&\nBRDCM_SRC = ${BALSRC_TOPDIR}:" \
+ -e "s:^GRPC_C_PATH=/home/asfvolt/shared.*:#&\nGRPC_C_PATH = ${GRPC_C_PATH}:" \
+ Makefile
+popd
+
+#```
+# EDGECORE = ${EDGECORE_DOWNLOAD_DIR}/asfvolt16-driver/src/
+# BRCM_PATH = ${BROADCOM_DOWNLOAD_DIR}/bal_src_release/bal_release
+#```
+# - make clean_all;make
+make clean_all
+make
+#
+#The ultimate executable voltha_bal_driver can be found under ~/grpc-c/build/examples/.libs/
+
+echo "${ASFVOLT_REPO_NAME} build complete"
diff --git a/scripts/voltha_init_sh b/scripts/voltha_init_sh
index daa465f..8759b55 100755
--- a/scripts/voltha_init_sh
+++ b/scripts/voltha_init_sh
@@ -43,7 +43,7 @@
echo "${FAN_RATE}" > /sys/devices/pci0000:00/0000:00:1f.3/i2c-0/i2c-1/i2c-9/9-0066/fan_duty_cycle_percentage
echo Starting distributed BAL server
-./bal_core_dist -ne -C ${VOLTHA_LOCIP}:40000 -A ${VOLTHA_LOCIP}:50000 2>${CONSOLE_DEVOUT} <${CONSOLE_DEVINP} &
+./bal_core_dist -ne -C ${VOLTHA_LOCIP}:40000 2>${CONSOLE_DEVOUT} <${CONSOLE_DEVINP} &
sleep 1
echo Starting VOLTHA BAL driver
-./voltha_bal_driver ${VOLTHA_LOCIP}:50060 -C ${VOLTHA_LOCIP}:40000 -A ${VOLTHA_LOCIP}:50000 2>${CONSOLE_DEVOUT} <${CONSOLE_DEVINP} &
+./voltha_bal_driver ${VOLTHA_LOCIP}:50060 -C ${VOLTHA_LOCIP}:40000 2>${CONSOLE_DEVOUT} <${CONSOLE_DEVINP} &
diff --git a/src/Makefile b/src/Makefile
index dce86eb..a7a27e6 100755
--- a/src/Makefile
+++ b/src/Makefile
@@ -4,8 +4,8 @@
LIB=libEdgecoreDriver.a
-BRDCM_SRC=/home/asfvolt/shared/OpenNetworkLinux/bal_src_release_2.4.3.6/bal_release
-GRPC_C_PATH= /home/asfvolt/shared/OpenNetworkLinux/grpc-c/
+BRDCM_SRC=/home/asfvolt/shared/OpenNetworkLinux/bal_src_release/bal_release
+GRPC_C_PATH=/home/asfvolt/shared/OpenNetworkLinux/grpc-c
GRPC_C_INC= -I$(GRPC_C_PATH)/build/ \
-I$(GRPC_C_PATH)/build/examples/ \
diff --git a/device_simulator/Makefile.am b/src/Makefile.am
old mode 100644
new mode 100755
similarity index 96%
rename from device_simulator/Makefile.am
rename to src/Makefile.am
index 5bd2c54..c0980d6
--- a/device_simulator/Makefile.am
+++ b/src/Makefile.am
@@ -4,11 +4,8 @@
HOSTPROG=yes
-DEFS += -UBAL_STUB
-
voltha_bal_driver_SOURCES = \
voltha_bal_driver.c \
- bal_stub.c \
grpc-c.h \
bal_errno.grpc-c.h bal_indications.grpc-c.h bal_model_types.grpc-c.h \
bal_obj.grpc-c.h bal.grpc-c.h bal_model_ids.grpc-c.h \
@@ -65,7 +62,7 @@
-I${EDGECORE}/.
$(BRCM_BAL_LIB):
- @cp $(BRCM_PATH)/build/core/lib/libbal_api_dist.so .
+ @cp $(BRCM_PATH)/3rdparty/maple/cur/asfvolt16/release/broadcom/libbal_api_dist.so .
$(EDGECORE_DRIV_LIB):
@cd $(EDGECORE);make
diff --git a/src/README.md b/src/README.md
deleted file mode 100644
index 55601b7..0000000
--- a/src/README.md
+++ /dev/null
@@ -1,172 +0,0 @@
-# ASFvOLT16 vOLTHA BAL DRIVER
-
-This is an executable (voltha_bal_driver), which will receive asfvolt16_olt adapter grpc-c messages and call the respective BAL API.
-It will send received responses/asynchronous indications from BAL running in the ASFvOLT16 to the asfvolt16_olt adapter in VOLTHA.
-This driver requires the Broadcom proprietary
-BAL/Maple SDK for the PON MAC and the Qumran switching SDK. These components are available from Broadcom.
-
-
-## GETTING STARTED
-
-The following **proprietary** components are required to build the voltha_bal_driver.
-Contact Dave Baron at Broadcom for details on accessing these files. dave.baronATbroadcomDOTcom Reference Case: CS3233745
-
-| Component | Version | Filename |
-| ------------- |-------- | ----- |
-| BAL/Maple SDK | 2.4.7.12 | SW-BCM68620_2_4_7_12.zip |
-| Qumran SDK | 6.5.7 | sdk-all-6.5.7.tar.gz |
-
-| Component | Filename |SHA1|
-| ------------- | ----- |---|
-| ASFvOLT16 BAL patch| ACCTON_BAL_2.4.7.12-V201712061142.patch | e2d2e7924cbc73e60d29262f4b905cbe982758ae |
-
-The following **open-source** components are required to build the voltha_bal_driver.
-
-| Component/Package | Version | Name | From | Git Repo|
-| ------------- |--------- | ----- | ---------| ----|
-| VOLTHA asfvolt16_olt adapter | voltha-1.1 | voltha | Opencord | git clone https://gerrit.opencord.org/voltha
-| ASFvOLT16 Driver | voltha-1.1 | asfvolt16-driver| Opencord | git clone https://gerrit.opencord.org/asfvolt16-driver
-
-## Open Network Linux
-This guide assumes that Open Network Linux (ONL) build environment for ASFvOLT16 has been installed
-and the build was successful. Refer to ONL build instructions
-[here](https://wiki.opencord.org/download/attachments/2556712/ONL_Build_Environment_Installation_Guide.pdf?api=v2).
-
-### Clone asfvolt16-driver repo
-
-```
-cd OpenNetworkLinux
-git clone https://gerrit.opencord.org/asfvolt16-driver
-```
-
-Build helper scripts are available in `asfvolt16-driver/scripts` to automate the steps for building BAL/Maple SDK and the `voltha_bal_driver`.
-
-| Helper Script | Purpose |
-| ------------- |---------|
-| asfvolt-bal-prepare.sh |Prepare BAL/Maple SDK build workspace (outside of docker)|
-| asfvolt-bal-buildall.sh |Build BAL/Maple SDK|
-| asfvolt-driver-build.sh |Build `voltha_bal_driver`|
-| asfvolt-driver-package.sh |Repackage BAL/Maple release with `voltha_bal_driver`|
-
-The helper scripts contain default shell variable values for component directory locations and file names for the build.
-
-### Prepare workspace for BAL
-
-Any of the following variables can be overridden to suit the local build environment.
-
-```
-ONL_TOPDIR=/aux/OpenNetworkLinux
-BALSRC_RELEASE=bal_src_release
-BALSRC_ZIPNAME=SW-BCM68620_2_4_7_12.zip
-SWISDK_TARNAME=sdk-all-6.5.7
-PATCH_FILENAME=ACCTON_BAL_2.4.7.12-V201712061142.patch
-BROADCOM_DOWNLOAD_DIR=/home/user/broadcom/download
-EDGECORE_DOWNLOAD_DIR=/home/user/edgecore/download
-```
-
-Prepare the BAL/Maple build workspace from *outside* of the docker environment. This allows access to network and device resources
-that may not be available in the docker.
-```
- > cd ${ONL_TOPDIR}
- > BROADCOM_DOWNLOAD_DIR=/aux/brcm_download EDGECORE_DOWNLOAD_DIR=/aux/brcm_download ./asfvolt16-driver/scripts/asfvolt-bal-prepare.sh
-```
-
-### Build BAL/Maple SDK
-
-All of the remaining steps are done *inside* the ONL build docker. Start ONL build docker workspace:
-```
- > docker/tools/onlbuilder -8 # enter the docker workspace
- > ./asfvolt16-driver/scripts/asfvolt-bal-buildall.sh
-```
-
-### Build `voltha_bal_driver`
-
-This step requires access to the voltha source tree so it can find the protobuf definitions used by the
-asfvolt16_olt adapter. Be sure to use matching version of the voltha tree because asfvolt16_olt adapter
-and the voltha_bal_driver need to share the same grpc protobuf definitions.
-
-```
-ONL_TOPDIR=/aux/OpenNetworkLinux
-MAKE_JOBS=4
-BALSRC_RELEASE=bal_src_release
-VOLTHA_TOPDIR=/home/<user>/voltha/incubator/voltha
-BALSRC_TOPDIR=/aux/OpenNetworkLinux/bal_src_release/bal_release
-ASFSRC_TOPDIR=/aux/OpenNetworkLinux/asfvolt16-driver/src
-DEVSIM_TOPDIR=/aux/OpenNetworkLinux/asfvolt16-driver/device_simulator
-PATCHF_TOPDIR=/aux/OpenNetworkLinux/asfvolt16-driver/patches
-```
-From the ONL build docker workspace:
-
-```
- > VOLTHA_TOPDIR=/home/<user>/voltha/incubator/voltha ./asfvolt16-driver/scripts/asfvolt-driver-build.sh
-```
-
-### Package `voltha_bal_driver` into BAL release tarball
-
-From the ONL build docker workspace:
-
-```
- > ./asfvolt16-driver/scripts/asfvolt-driver-package.sh
-```
-
-The tarball containing the packaged voltha_bal_driver can be found in ${ASFDRVR_PKGDIR}:
-
-```
- > ls ${ONL_TOPDIR}/asfdrvr-package-dir/
-asfvolt16-voltha-bal-<timestamp>.tgz broadcom opt
-```
-
-### Install `voltha_bal_driver` BAL release tarball
-
-Transfer BAL release tarball to ASFvOLT16:
-
-```
- > cp asfdrvr-package-dir/asfvolt16-voltha-bal-<timestamp>.tgz root@<ASFvOLT16_IP>:.
-```
-
-Install release tarball on ASFvOLT16:
-
-```
- > ssh root@<ASFvOLT16_IP>
- Enter passphrase for key '/home/kimk/.ssh/id_rsa':
- root@192.168.140.72's password: onl
- Last login: Tue Oct 24 11:00:48 2017 from 192.168.140.32
-
- root@localhost:~# ls
- asfvolt16-voltha-bal-201710231906.tgz
- root@localhost:~# cd /
- root@localhost:/# mv /broadcom /broadcom.prev
- root@localhost:/# mv /opt/bcm68620/ /opt/bcm68620.prev
- root@localhost:/# tar zxf ~/asfvolt16-voltha-bal-<timestamp>.tgz
- root@localhost:/# tail -5 /etc/rc.local # ensure rc.local has the following lines
- # By default this script does nothing.
-
- /opt/bcm68620/svk_init.sh
- /broadcom/voltha_init.sh
- exit 0
-
- root@localhost:/# shutdown -r now
-```
-
-USAGE:
- ./voltha_bal_driver "serverIP:port1" -C "serverIP:port2" -A "serverIP:port3"
- ./bal_core_dist -C "serverIP:port2" -A "serverIP:port3"
-
-NOTE: bal_core_dist is a broadcom executable
-
-CONTRIBUTING
- <TBD>
-
-VERSIONING
- <TBD>
-
-AUTHORS
- Radisys Adapter Team
-
-Licence
- <TBD>
-
-Acknowledgments
- <TBD>
-
-
diff --git a/src/asfvolt16_driver.c b/src/asfvolt16_driver.c
index 14cd505..3d824af 100755
--- a/src/asfvolt16_driver.c
+++ b/src/asfvolt16_driver.c
@@ -54,13 +54,33 @@
cb_cfg.module = BCMOS_MODULE_ID_NONE;
- /* Access Terminal Operational State Change */
+ /* Register to get indications for access terminal objects
+ */
cb_cfg.obj_type = BCMBAL_OBJ_ID_ACCESS_TERMINAL;
- cb_cfg.ind_cb_hdlr = (f_bcmbal_ind_handler)bal_acc_term_osc_indication_cb;
- ind_subgroup = bcmbal_access_terminal_auto_id_oper_status_change;
+
+
+ /* Access Terminal processing error */
+ cb_cfg.ind_cb_hdlr = (f_bcmbal_ind_handler)bal_acc_term_processing_error_indication_cb;
+ ind_subgroup = bcmbal_access_terminal_auto_id_processing_error;
cb_cfg.p_subgroup = &ind_subgroup;
err = err ? err : bcmbal_subscribe_ind(access_term_id, &cb_cfg);
+ /* Register to get indication callbacks for flow objects
+ */
+ cb_cfg.obj_type = BCMBAL_OBJ_ID_FLOW;
+
+ /* Flow Operational State Change */
+ cb_cfg.ind_cb_hdlr = (f_bcmbal_ind_handler)bal_flow_osc_indication_cb;
+ ind_subgroup = bcmbal_flow_auto_id_oper_status_change;
+ cb_cfg.p_subgroup = &ind_subgroup;
+ err = bcmbal_subscribe_ind(access_term_id, &cb_cfg);
+
+ /* Flow processing error */
+ cb_cfg.ind_cb_hdlr = (f_bcmbal_ind_handler)bal_flow_processing_error_indication_cb;
+ ind_subgroup = bcmbal_flow_auto_id_processing_error;
+ cb_cfg.p_subgroup = &ind_subgroup;
+ err = bcmbal_subscribe_ind(access_term_id, &cb_cfg);
+
/* Register to get indications for interface objects
*/
cb_cfg.obj_type = BCMBAL_OBJ_ID_INTERFACE;
@@ -71,52 +91,12 @@
cb_cfg.p_subgroup = &ind_subgroup;
err = err ? err : bcmbal_subscribe_ind(access_term_id, &cb_cfg);
- /* Interface Indication */
- cb_cfg.ind_cb_hdlr = (f_bcmbal_ind_handler)bal_interface_indication_cb;
- ind_subgroup = bcmbal_interface_auto_id_ind;
- cb_cfg.p_subgroup = &ind_subgroup;
- err = err ? err : bcmbal_subscribe_ind(access_term_id, &cb_cfg);
-
/* Interface Operational State Change */
cb_cfg.ind_cb_hdlr = (f_bcmbal_ind_handler)bal_interface_osc_indication_cb;
ind_subgroup = bcmbal_interface_auto_id_oper_status_change;
cb_cfg.p_subgroup = &ind_subgroup;
err = err ? err : bcmbal_subscribe_ind(access_term_id, &cb_cfg);
- /* Register to get indications for subscriber terminal objects
- */
- cb_cfg.obj_type = BCMBAL_OBJ_ID_SUBSCRIBER_TERMINAL;
-
- /* Subscriber Terminal Alarm */
- cb_cfg.ind_cb_hdlr = (f_bcmbal_ind_handler)bal_sub_term_alarm_indication_cb;
- ind_subgroup = bcmbal_subscriber_terminal_auto_id_sub_term_alarm;
- cb_cfg.p_subgroup = &ind_subgroup;
- err = err ? err : bcmbal_subscribe_ind(access_term_id, &cb_cfg);
-
- /* Subscriber Terminal dgi */
- cb_cfg.ind_cb_hdlr = (f_bcmbal_ind_handler)bal_sub_term_dgi_indication_cb;
- ind_subgroup = bcmbal_subscriber_terminal_auto_id_dgi;
- cb_cfg.p_subgroup = &ind_subgroup;
- err = err ? err : bcmbal_subscribe_ind(access_term_id, &cb_cfg);
-
- /* Subscriber Terminal Discovery */
- cb_cfg.ind_cb_hdlr = (f_bcmbal_ind_handler)bal_sub_term_disc_indication_cb;
- ind_subgroup = bcmbal_subscriber_terminal_auto_id_sub_term_disc;
- cb_cfg.p_subgroup = &ind_subgroup;
- err = err ? err : bcmbal_subscribe_ind(access_term_id, &cb_cfg);
-
- /* Subscriber Terminal Indication */
- cb_cfg.ind_cb_hdlr = (f_bcmbal_ind_handler)bal_sub_term_indication_cb;
- ind_subgroup = bcmbal_subscriber_terminal_auto_id_ind;
- cb_cfg.p_subgroup = &ind_subgroup;
- err = err ? err : bcmbal_subscribe_ind(access_term_id, &cb_cfg);
-
- /* Subscriber Terminal Operational State Change */
- cb_cfg.ind_cb_hdlr = (f_bcmbal_ind_handler)bal_sub_term_osc_indication_cb;
- ind_subgroup = bcmbal_subscriber_terminal_auto_id_oper_status_change;
- cb_cfg.p_subgroup = &ind_subgroup;
- err = err ? err : bcmbal_subscribe_ind(access_term_id, &cb_cfg);
-
/* Register to get indication callbacks for OMCI objects
*/
cb_cfg.obj_type = BCMBAL_OBJ_ID_PACKET;
@@ -132,6 +112,9 @@
ind_subgroup = bcmbal_packet_auto_id_bearer_channel_rx;
cb_cfg.p_subgroup = &ind_subgroup;
err = err ? err : bcmbal_subscribe_ind(access_term_id, &cb_cfg);
+
+ // On registering for OAM Channel Data, voltha_bal_driver crashes.
+ // This is not important/necessary right now, hence bypassing this.
#if 0
/* OAM Channel Data - oam response indication */
cb_cfg.ind_cb_hdlr = (f_bcmbal_ind_handler)bal_oam_data_indication_cb;
@@ -139,45 +122,95 @@
cb_cfg.p_subgroup = &ind_subgroup;
err = err ? err : bcmbal_subscribe_ind(access_term_id, &cb_cfg);
#endif
- /* Register to get indication callbacks for flow objects
+
+ /* Register to get indications for subscriber terminal objects
*/
- cb_cfg.obj_type = BCMBAL_OBJ_ID_FLOW;
+ cb_cfg.obj_type = BCMBAL_OBJ_ID_SUBSCRIBER_TERMINAL;
- /* Flow Operational State Change */
- cb_cfg.ind_cb_hdlr = (f_bcmbal_ind_handler)bal_flow_osc_indication_cb;
- ind_subgroup = bcmbal_flow_auto_id_oper_status_change;
- cb_cfg.p_subgroup = &ind_subgroup;
- err = bcmbal_subscribe_ind(access_term_id, &cb_cfg);
-
- /* Flow Indication */
- cb_cfg.ind_cb_hdlr = (f_bcmbal_ind_handler)bal_flow_indication_cb;
- ind_subgroup = bcmbal_flow_auto_id_ind;
- cb_cfg.p_subgroup = &ind_subgroup;
- err = bcmbal_subscribe_ind(access_term_id, &cb_cfg);
-
- /* Register to get indication callbacks for tm queue objects
- */
- cb_cfg.obj_type = BCMBAL_OBJ_ID_TM_QUEUE;
- cb_cfg.ind_cb_hdlr = (f_bcmbal_ind_handler)bal_tm_queue_indication_cb;
- ind_subgroup = bcmbal_tm_queue_auto_id_ind;
+ /* Subscriber Terminal dgi */
+ cb_cfg.ind_cb_hdlr = (f_bcmbal_ind_handler)bal_sub_term_dgi_indication_cb;
+ ind_subgroup = bcmbal_subscriber_terminal_auto_id_dgi;
cb_cfg.p_subgroup = &ind_subgroup;
err = err ? err : bcmbal_subscribe_ind(access_term_id, &cb_cfg);
- /* Register to get indication callbacks for tm sched objects
+ /* Subscriber Terminal dowi*/
+ cb_cfg.ind_cb_hdlr = (f_bcmbal_ind_handler)bal_sub_term_dowi_indication_cb;
+ ind_subgroup = bcmbal_subscriber_terminal_auto_id_dowi;
+ cb_cfg.p_subgroup = &ind_subgroup;
+ err = err ? err : bcmbal_subscribe_ind(access_term_id, &cb_cfg);
+
+ /* Subscriber Terminal looci*/
+ cb_cfg.ind_cb_hdlr = (f_bcmbal_ind_handler)bal_sub_term_looci_indication_cb;
+ ind_subgroup = bcmbal_subscriber_terminal_auto_id_looci;
+ cb_cfg.p_subgroup = &ind_subgroup;
+ err = err ? err : bcmbal_subscribe_ind(access_term_id, &cb_cfg);
+
+ /* Subscriber Terminal Operational State Change */
+ cb_cfg.ind_cb_hdlr = (f_bcmbal_ind_handler)bal_sub_term_osc_indication_cb;
+ ind_subgroup = bcmbal_subscriber_terminal_auto_id_oper_status_change;
+ cb_cfg.p_subgroup = &ind_subgroup;
+ err = err ? err : bcmbal_subscribe_ind(access_term_id, &cb_cfg);
+
+ /* Subscriber Terminal processing error*/
+ cb_cfg.ind_cb_hdlr = \
+ (f_bcmbal_ind_handler)bal_sub_term_processing_error_indication_cb;
+ ind_subgroup = bcmbal_subscriber_terminal_auto_id_processing_error;
+ cb_cfg.p_subgroup = &ind_subgroup;
+ err = err ? err : bcmbal_subscribe_ind(access_term_id, &cb_cfg);
+
+ /* Subscriber Terminal sdi */
+ cb_cfg.ind_cb_hdlr = (f_bcmbal_ind_handler)bal_sub_term_sdi_indication_cb;
+ ind_subgroup = bcmbal_subscriber_terminal_auto_id_sdi;
+ cb_cfg.p_subgroup = &ind_subgroup;
+ err = err ? err : bcmbal_subscribe_ind(access_term_id, &cb_cfg);
+
+ /* Subscriber Terminal sfi */
+ cb_cfg.ind_cb_hdlr = (f_bcmbal_ind_handler)bal_sub_term_sfi_indication_cb;
+ ind_subgroup = bcmbal_subscriber_terminal_auto_id_sfi;
+ cb_cfg.p_subgroup = &ind_subgroup;
+ err = err ? err : bcmbal_subscribe_ind(access_term_id, &cb_cfg);
+
+ /* Subscriber Terminal activation fail */
+ cb_cfg.ind_cb_hdlr = (f_bcmbal_ind_handler)bal_sub_term_act_fail_indication_cb;
+ ind_subgroup = bcmbal_subscriber_terminal_auto_id_sub_term_act_fail;
+ cb_cfg.p_subgroup = &ind_subgroup;
+ err = err ? err : bcmbal_subscribe_ind(access_term_id, &cb_cfg);
+
+ /* Subscriber Terminal Alarm */
+ cb_cfg.ind_cb_hdlr = (f_bcmbal_ind_handler)bal_sub_term_alarm_indication_cb;
+ ind_subgroup = bcmbal_subscriber_terminal_auto_id_sub_term_alarm;
+ cb_cfg.p_subgroup = &ind_subgroup;
+ err = err ? err : bcmbal_subscribe_ind(access_term_id, &cb_cfg);
+
+ /* Subscriber Terminal Discovery */
+ cb_cfg.ind_cb_hdlr = (f_bcmbal_ind_handler)bal_sub_term_disc_indication_cb;
+ ind_subgroup = bcmbal_subscriber_terminal_auto_id_sub_term_disc;
+ cb_cfg.p_subgroup = &ind_subgroup;
+ err = err ? err : bcmbal_subscribe_ind(access_term_id, &cb_cfg);
+
+ /* Subscriber Terminal sufi */
+ cb_cfg.ind_cb_hdlr = (f_bcmbal_ind_handler)bal_sub_term_sufi_indication_cb;
+ ind_subgroup = bcmbal_subscriber_terminal_auto_id_sufi;
+ cb_cfg.p_subgroup = &ind_subgroup;
+ err = err ? err : bcmbal_subscribe_ind(access_term_id, &cb_cfg);
+
+ /* Subscriber Terminal tiwi */
+ cb_cfg.ind_cb_hdlr = (f_bcmbal_ind_handler)bal_sub_term_tiwi_indication_cb;
+ ind_subgroup = bcmbal_subscriber_terminal_auto_id_tiwi;
+ cb_cfg.p_subgroup = &ind_subgroup;
+ err = err ? err : bcmbal_subscribe_ind(access_term_id, &cb_cfg);
+
+ /* Register to get indication callbacks for Tm Sched Objects
*/
cb_cfg.obj_type = BCMBAL_OBJ_ID_TM_SCHED;
- cb_cfg.ind_cb_hdlr = (f_bcmbal_ind_handler)bal_tm_sched_indication_cb;
- ind_subgroup = bcmbal_tm_sched_auto_id_ind;
+
+ /* TM Sched operation status change */
+ cb_cfg.ind_cb_hdlr = \
+ (f_bcmbal_ind_handler)bal_tm_sched_auto_id_oper_status_change_cb;
+ ind_subgroup = bcmbal_tm_sched_auto_id_oper_status_change;
cb_cfg.p_subgroup = &ind_subgroup;
err = err ? err : bcmbal_subscribe_ind(access_term_id, &cb_cfg);
- /* Register to get indication callbacks for group objects
- */
- cb_cfg.obj_type = BCMBAL_OBJ_ID_GROUP;
- cb_cfg.ind_cb_hdlr = (f_bcmbal_ind_handler)bal_group_indication_cb;
- ind_subgroup = bcmbal_group_auto_id_ind;
- cb_cfg.p_subgroup = &ind_subgroup;
- err = err ? err : bcmbal_subscribe_ind(access_term_id, &cb_cfg);
return err;
}
@@ -208,17 +241,15 @@
ip_and_port = bal_init->voltha_adapter_ip_port;
ASFVOLT_LOG(ASFVOLT_DEBUG,"Received Adapter IP and Port from VOLTHA is %s",ip_and_port);
}
- char *argv[6];
+ char *argv[4];
/* Initialize BAL */
argv[1] = coreInfo->bal_core_arg1;
argv[2] = coreInfo->bal_core_ip_port;
- argv[3] = coreInfo->bal_core_arg2;
- argv[4] = coreInfo->bal_shared_lib_ip_port;
- int argc = 5;
+ int argc = 3;
client = grpc_c_client_init(ip_and_port, "bal_client", NULL);
/* Init BAL */
- err = bcmbal_apiend_init_all(argc, argv, NULL,3);
+ err = bcmbal_apiend_init_all(argc, argv, NULL, 3);
if(err != BCM_ERR_OK)
{
printf("\n Failed in bcmbal_init \n");
@@ -236,26 +267,26 @@
}
#endif
- /* Register the call back functions to handle any
- * indications from the BAL */
- bcmbal_cb_cfg cb_cfg = {};
- uint16_t ind_subgroup;
+ /* Register the call back functions to handle access term oper change
+ * indications from the BAL */
+ bcmbal_cb_cfg cb_cfg = {};
+ uint16_t ind_subgroup;
- cb_cfg.module = BCMOS_MODULE_ID_NONE;
- /* Register to get indications for access terminal objects
- */
- cb_cfg.obj_type = BCMBAL_OBJ_ID_ACCESS_TERMINAL;
+ cb_cfg.module = BCMOS_MODULE_ID_NONE;
+ /* Register to get indications for access terminal objects
+ */
+ cb_cfg.obj_type = BCMBAL_OBJ_ID_ACCESS_TERMINAL;
- /* Access Terminal Indication */
- cb_cfg.ind_cb_hdlr = (f_bcmbal_ind_handler)bal_acc_term_indication_cb;
- ind_subgroup = bcmbal_access_terminal_auto_id_ind;
+ /* Access Terminal Operational State Change */
+ cb_cfg.ind_cb_hdlr = (f_bcmbal_ind_handler)bal_acc_term_osc_indication_cb;
+ ind_subgroup = bcmbal_access_terminal_auto_id_oper_status_change;
cb_cfg.p_subgroup = &ind_subgroup;
err = err ? err : bcmbal_subscribe_ind(access_term_id, &cb_cfg);
- if (err)
- {
- ASFVOLT_LOG(ASFVOLT_ERROR, "failed to register call back functions to BAL");
- }
+ if (err)
+ {
+ ASFVOLT_LOG(ASFVOLT_ERROR, "failed to register call back functions to BAL");
+ }
return err;
}
@@ -421,51 +452,45 @@
* 4) Flow Cfg *
* 5) Group Cfg (In case of Multicast) *
********************************************************************/
-uint32_t asfvolt16_bal_cfg_get(BalKey *key, BalCfg *cfg)
+uint32_t asfvolt16_bal_cfg_get(BalCfg *cfg)
{
bcmos_errno err = BCM_ERR_OK;
- if(!key->hdr->has_obj_type)
- {
- ASFVOLT_LOG(ASFVOLT_ERROR, "object type is not present for get");
- return BAL_ERRNO__BAL_ERR_INVALID_OP;
- }
-
- switch(key->hdr->obj_type)
+ switch(cfg->hdr->obj_type)
{
case BAL_OBJ_ID__BAL_OBJ_ID_ACCESS_TERMINAL:
{
- err = bal_access_terminal_cfg_get(key->access_term_key, cfg->cfg );
+ err = bal_access_terminal_cfg_get(cfg->cfg);
break;
}
case BAL_OBJ_ID__BAL_OBJ_ID_INTERFACE:
{
- err = bal_interface_cfg_get(key->interface_key, cfg->interface);
+ err = bal_interface_cfg_get(cfg->interface);
break;
}
case BAL_OBJ_ID__BAL_OBJ_ID_SUBSCRIBER_TERMINAL:
{
- err = bal_subscriber_terminal_cfg_get(key->terminal_key, cfg->terminal);
+ err = bal_subscriber_terminal_cfg_get(cfg->terminal);
break;
}
case BAL_OBJ_ID__BAL_OBJ_ID_FLOW:
{
- err = bal_flow_cfg_get(key->flow_key, cfg->flow);
+ err = bal_flow_cfg_get(cfg->flow);
break;
}
case BAL_OBJ_ID__BAL_OBJ_ID_GROUP:
{
- err = bal_group_cfg_get(key->group_key, cfg->group);
+ err = bal_group_cfg_get(cfg->group);
break;
}
case BAL_OBJ_ID__BAL_OBJ_ID_TM_QUEUE:
{
- err = bal_tm_queue_cfg_get(key->tm_queue_key, cfg->tm_queue_cfg);
+ err = bal_tm_queue_cfg_get(cfg->tm_queue_cfg);
break;
}
case BAL_OBJ_ID__BAL_OBJ_ID_TM_SCHED:
{
- err = bal_tm_sched_cfg_get(key->tm_sched_key, cfg->tm_sched_cfg);
+ err = bal_tm_sched_cfg_get(cfg->tm_sched_cfg);
break;
}
case BAL_OBJ_ID__BAL_OBJ_ID_PACKET:
diff --git a/src/asfvolt16_driver.h b/src/asfvolt16_driver.h
index 76c99e3..1633eca 100755
--- a/src/asfvolt16_driver.h
+++ b/src/asfvolt16_driver.h
@@ -36,8 +36,11 @@
#define ASFVOLT_MAX_PKT_SIZE 500
#define ASFVOLT_MAX_DEVICE_ID_SIZE 50
#define MAX_CHAR_LENGTH 20
+#define MAX_REGID_LENGTH 36
#define MAX_OMCI_MSG_LENGTH 44
+#define BAL_ELEMENT_PRES 1
+
char voltha_device_id[ASFVOLT_MAX_DEVICE_ID_SIZE];
unsigned int is_reboot;
@@ -97,7 +100,7 @@
extern uint32_t bal_register_indication_cbs(void);
extern uint32_t asfvolt16_bal_cfg_set(BalCfg *cfg);
extern uint32_t asfvolt16_bal_cfg_clear(BalKey *key);
-extern uint32_t asfvolt16_bal_cfg_get(BalKey *key, BalCfg *cfg);
+extern uint32_t asfvolt16_bal_cfg_get(BalCfg *cfg);
extern void asfvolt16_send_omci_msg(uint16_t olt_no, uint32_t onu_nu, char* packet_to_send);
extern uint32_t asfvolt16_bal_stats_get(BalIntfType intf_type, uint32_t intf_id, BalInterfaceStatData *statData,
BalInterfaceKey *statKey);
diff --git a/src/bal_access_terminal_hdlr.c b/src/bal_access_terminal_hdlr.c
index 153fcf9..05eb7dd 100755
--- a/src/bal_access_terminal_hdlr.c
+++ b/src/bal_access_terminal_hdlr.c
@@ -110,14 +110,16 @@
* Function : bal_access_terminal_cfg_get *
* Description : Handles the clear/Delete of access terminal *
********************************************************************/
-uint32_t bal_access_terminal_cfg_get (BalAccessTerminalKey *access_term_key,
- BalAccessTerminalCfg *access_term_cfg)
+uint32_t bal_access_terminal_cfg_get (BalAccessTerminalCfg *access_term_cfg)
{
bcmos_errno err = BCM_ERR_OK;
bcmbal_access_terminal_cfg cfg; /**< declare main API struct */
bcmbal_access_terminal_key key = { }; /**< declare key */
ASFVOLT_LOG(ASFVOLT_INFO, "processing the get request on access terminal");
+
+ key.access_term_id = access_term_cfg->key->access_term_id;
+
/* init the API struct */
BCMBAL_CFG_INIT(&cfg, access_terminal, key);
@@ -131,8 +133,56 @@
return BAL_ERRNO__BAL_ERR_INTERNAL;
}
- ASFVOLT_LOG(ASFVOLT_INFO,
- "To-Do. Send access terminal details to Adapter");
+ access_term_cfg->key->has_access_term_id = BAL_ELEMENT_PRES;
+ access_term_cfg->key->access_term_id = cfg.key.access_term_id;
- return BAL_ERRNO__BAL_ERR_OK;
+ access_term_cfg->data->has_admin_state = BAL_ELEMENT_PRES;
+ access_term_cfg->data->admin_state = cfg.data.admin_state;
+
+ access_term_cfg->data->has_oper_status = BAL_ELEMENT_PRES;
+ access_term_cfg->data->oper_status = cfg.data.oper_status;
+
+ access_term_cfg->data->has_iwf_mode = BAL_ELEMENT_PRES;
+ access_term_cfg->data->iwf_mode = cfg.data.iwf_mode;
+
+ access_term_cfg->data->topology->has_num_of_nni_ports = BAL_ELEMENT_PRES;
+ access_term_cfg->data->topology->num_of_nni_ports = cfg.data.topology.num_of_nni_ports;
+
+ access_term_cfg->data->topology->has_num_of_pon_ports = BAL_ELEMENT_PRES;
+ access_term_cfg->data->topology->num_of_pon_ports = cfg.data.topology.num_of_pon_ports;
+
+ access_term_cfg->data->topology->has_num_of_mac_devs = BAL_ELEMENT_PRES;
+ access_term_cfg->data->topology->num_of_mac_devs = cfg.data.topology.num_of_mac_devs;
+
+ access_term_cfg->data->topology->has_num_of_pons_per_mac_dev = BAL_ELEMENT_PRES;
+ access_term_cfg->data->topology->num_of_pons_per_mac_dev = cfg.data.topology.num_of_pons_per_mac_dev;
+
+ access_term_cfg->data->topology->has_pon_family = BAL_ELEMENT_PRES;
+ access_term_cfg->data->topology->pon_family = cfg.data.topology.pon_family;
+
+ access_term_cfg->data->topology->has_pon_sub_family = BAL_ELEMENT_PRES;
+ access_term_cfg->data->topology->pon_sub_family = cfg.data.topology.pon_sub_family;
+
+ access_term_cfg->data->sw_version->has_version_type = BAL_ELEMENT_PRES;
+ access_term_cfg->data->sw_version->version_type = cfg.data.sw_version.version_type;
+
+ access_term_cfg->data->sw_version->has_major_rev = BAL_ELEMENT_PRES;
+ access_term_cfg->data->sw_version->major_rev = cfg.data.sw_version.major_rev;
+
+ access_term_cfg->data->sw_version->has_minor_rev = BAL_ELEMENT_PRES;
+ access_term_cfg->data->sw_version->minor_rev = cfg.data.sw_version.minor_rev;
+
+ access_term_cfg->data->sw_version->has_release_rev = BAL_ELEMENT_PRES;
+ access_term_cfg->data->sw_version->release_rev = cfg.data.sw_version.release_rev;
+
+ access_term_cfg->data->sw_version->has_om_version = BAL_ELEMENT_PRES;
+ access_term_cfg->data->sw_version->om_version = cfg.data.sw_version.om_version;
+
+ access_term_cfg->data->sw_version->has_dev_point = BAL_ELEMENT_PRES;
+ access_term_cfg->data->sw_version->dev_point = cfg.data.sw_version.dev_point;
+
+ access_term_cfg->data->has_conn_id = BAL_ELEMENT_PRES;
+ access_term_cfg->data->conn_id = cfg.data.conn_id;
+
+ return BAL_ERRNO__BAL_ERR_OK;
}
diff --git a/src/bal_access_terminal_hdlr.h b/src/bal_access_terminal_hdlr.h
index 3b0cc49..025fb3c 100755
--- a/src/bal_access_terminal_hdlr.h
+++ b/src/bal_access_terminal_hdlr.h
@@ -16,5 +16,5 @@
extern uint32_t bal_access_terminal_cfg_set(BalAccessTerminalCfg *access_term_cfg);
extern uint32_t bal_access_terminal_cfg_clear(BalAccessTerminalKey *access_term_key);
-extern uint32_t bal_access_terminal_cfg_get (BalAccessTerminalKey *access_term_key, BalAccessTerminalCfg *access_term_cfg);
+extern uint32_t bal_access_terminal_cfg_get (BalAccessTerminalCfg *access_term_cfg);
extern bcmos_errno bal_access_term_indication_cb(bcmbal_obj *obj);
diff --git a/src/bal_flow_hdlr.c b/src/bal_flow_hdlr.c
index adaba1a..75a1962 100755
--- a/src/bal_flow_hdlr.c
+++ b/src/bal_flow_hdlr.c
@@ -272,8 +272,14 @@
return BAL_ERRNO__BAL_ERR_PARM;
}
-
- ASFVOLT_LOG(ASFVOLT_INFO, "Adding the flow to OLT. FlowID(%d)", flow_cfg->key->flow_id);
+ if (flow_cfg->data->admin_state == BAL_STATE__BAL_STATE_UP )
+ {
+ ASFVOLT_LOG(ASFVOLT_INFO, "Adding the flow to OLT. FlowID(%d)", flow_cfg->key->flow_id);
+ }
+ else
+ {
+ ASFVOLT_LOG(ASFVOLT_INFO, "Deleting the flow at OLT. FlowID(%d)", flow_cfg->key->flow_id);
+ }
if (!flow_cfg->key->has_flow_type &&
((flow_cfg->key->flow_type < BAL_FLOW_TYPE__BAL_FLOW_TYPE_UPSTREAM) ||
@@ -294,7 +300,7 @@
/* decode API parameters from grpc-c */
/* Admin State */
ASFVOLT_CFG_PROP_SET(cfg, flow, admin_state,
- flow_cfg->data->has_admin_state,
+ BCMOS_TRUE,
flow_cfg->data->admin_state);
ASFVOLT_LOG(ASFVOLT_DEBUG, "admin state = %d", flow_cfg->data->admin_state);
@@ -302,7 +308,7 @@
ASFVOLT_CFG_PROP_SET(cfg, flow, oper_status,
flow_cfg->data->has_oper_status,
flow_cfg->data->oper_status);
- ASFVOLT_LOG(ASFVOLT_DEBUG, "Oper. status = %d", flow_cfg->data->oper_status);
+ ASFVOLT_LOG(ASFVOLT_DEBUG, "Oper.status = %d", flow_cfg->data->oper_status);
/* Access Side interface ID */
ASFVOLT_CFG_PROP_SET(cfg, flow, access_int_id,
@@ -333,12 +339,6 @@
ASFVOLT_LOG(ASFVOLT_DEBUG, "group_id = %d", flow_cfg->data->group_id);
}
- /*Subscriber Terminal UNI index*/
- ASFVOLT_CFG_PROP_SET(cfg, flow, sub_term_uni_idx,
- flow_cfg->data->has_sub_term_uni_idx,
- flow_cfg->data->sub_term_uni_idx);
- ASFVOLT_LOG(ASFVOLT_DEBUG, "sub_term_uni_idx = %d", flow_cfg->data->sub_term_uni_idx);
-
/*Resolve MAC*/
ASFVOLT_CFG_PROP_SET(cfg, flow, resolve_mac,
flow_cfg->data->has_resolve_mac,
@@ -402,7 +402,7 @@
ASFVOLT_CFG_PROP_SET(cfg, flow, cookie,
flow_cfg->data->has_cookie,
flow_cfg->data->cookie);
- ASFVOLT_LOG(ASFVOLT_DEBUG, "priority = %lx",flow_cfg->data->cookie);
+ ASFVOLT_LOG(ASFVOLT_DEBUG, "cookie = %lx",flow_cfg->data->cookie);
/*Egress queue*/
BalTmQueueRef *tmp_que = (BalTmQueueRef*)(flow_cfg->data->queue);
@@ -486,17 +486,17 @@
* Function : bal_flow_cfg_get *
* Description : Get flow information from BAL. *
********************************************************************/
-uint32_t bal_flow_cfg_get(BalFlowKey *flow_key, BalFlowCfg *flow_cfg)
+uint32_t bal_flow_cfg_get(BalFlowCfg *flow_cfg)
{
bcmos_errno err = BCM_ERR_OK;
bcmbal_flow_cfg cfg; /**< declare main API struct */
bcmbal_flow_key key = { }; /**< declare key */
- if (flow_key->has_flow_id && flow_key->has_flow_type)
+ if (flow_cfg->key->has_flow_id && flow_cfg->key->has_flow_type)
{
- key.flow_id = flow_key->flow_id;
- key.flow_type = flow_key->flow_type;
+ key.flow_id = flow_cfg->key->flow_id;
+ key.flow_type = flow_cfg->key->flow_type;
}
else
{
@@ -520,8 +520,11 @@
return BAL_ERRNO__BAL_ERR_INTERNAL;
}
- ASFVOLT_LOG(ASFVOLT_INFO,
- "To-Do. Send Flow details to Adapter");
+ ASFVOLT_LOG(ASFVOLT_INFO, "Get Group cfg sent to OLT for Flow Id(%d)",
+ key.flow_id);
+
+ memcpy(flow_cfg->key, &key, sizeof(BalFlowKey));
+ memcpy(flow_cfg->data, &cfg, sizeof(BalFlowCfgData));
return BAL_ERRNO__BAL_ERR_OK;
}
diff --git a/src/bal_flow_hdlr.h b/src/bal_flow_hdlr.h
index 1b6cfc6..638fc00 100755
--- a/src/bal_flow_hdlr.h
+++ b/src/bal_flow_hdlr.h
@@ -16,6 +16,6 @@
extern uint32_t bal_flow_cfg_set(BalFlowCfg *flow_cfg);
extern uint32_t bal_flow_cfg_clear(BalFlowKey *flow_key);
-extern uint32_t bal_flow_cfg_get(BalFlowKey *flow_key, BalFlowCfg *flow_cfg);
+extern uint32_t bal_flow_cfg_get(BalFlowCfg *flow_cfg);
extern uint32_t bal_fill_classifier_cfg(BalClassifier *tmp_classifier,
bcmbal_classifier *classifier_val);
diff --git a/src/bal_group_hdlr.c b/src/bal_group_hdlr.c
index c00b1a3..c1886e2 100755
--- a/src/bal_group_hdlr.c
+++ b/src/bal_group_hdlr.c
@@ -80,11 +80,11 @@
(balFlows->n_val)*sizeof(bcmbal_flow_id));
ASFVOLT_CFG_PROP_SET(grp_cfg_obj, group, flows, BCMOS_TRUE, valFlows);
- if(tm_group_cfg->data->has_owner)
+ if(tm_group_cfg->data->has_type)
{
- ASFVOLT_CFG_PROP_SET(grp_cfg_obj, group, owner,
- tm_group_cfg->data->has_owner,
- tm_group_cfg->data->owner);
+ ASFVOLT_CFG_PROP_SET(grp_cfg_obj, group, type,
+ tm_group_cfg->data->has_type,
+ tm_group_cfg->data->type);
}
BalGroupMemberInfoList *balMembers =
@@ -114,45 +114,10 @@
valMembers.val[grp_mem_idx].svc_port_id
= balMembers->val[grp_mem_idx]->svc_port_id;
}
- if(balMembers->val[grp_mem_idx]->action->has_presence_mask)
+ if(balMembers->val[grp_mem_idx]->has_intf_type)
{
- valMembers.val[grp_mem_idx].action.presence_mask
- = balMembers->val[grp_mem_idx]->action->presence_mask;
- }
- if(balMembers->val[grp_mem_idx]->action->has_cmds_bitmask)
- {
- valMembers.val[grp_mem_idx].action.cmds_bitmask
- = balMembers->val[grp_mem_idx]->action->cmds_bitmask;
- }
- if(balMembers->val[grp_mem_idx]->action->has_o_vid)
- {
- valMembers.val[grp_mem_idx].action.o_vid
- = balMembers->val[grp_mem_idx]->action->o_vid;
- }
- if(balMembers->val[grp_mem_idx]->action->has_o_pbits)
- {
- valMembers.val[grp_mem_idx].action.o_pbits
- = balMembers->val[grp_mem_idx]->action->o_pbits;
- }
- if(balMembers->val[grp_mem_idx]->action->has_o_tpid)
- {
- valMembers.val[grp_mem_idx].action.o_tpid
- = balMembers->val[grp_mem_idx]->action->o_tpid;
- }
- if(balMembers->val[grp_mem_idx]->action->has_i_vid)
- {
- valMembers.val[grp_mem_idx].action.i_vid
- = balMembers->val[grp_mem_idx]->action->i_vid;
- }
- if(balMembers->val[grp_mem_idx]->action->has_i_pbits)
- {
- valMembers.val[grp_mem_idx].action.i_pbits
- = balMembers->val[grp_mem_idx]->action->i_pbits;
- }
- if(balMembers->val[grp_mem_idx]->action->has_i_tpid)
- {
- valMembers.val[grp_mem_idx].action.i_tpid
- = balMembers->val[grp_mem_idx]->action->i_tpid;
+ valMembers.val[grp_mem_idx].intf_type
+ = balMembers->val[grp_mem_idx]->intf_type;
}
if(balMembers->val[grp_mem_idx]->queue->has_sched_id)
{
@@ -183,20 +148,19 @@
/********************************************************************\
- * Function : bal_group_get_req *
- * Description : get the OLT device group cfg *
+ * Function : bal_group_cfg_get *
+ * Description : get the OLT device group cfg *
********************************************************************/
-uint32_t bal_group_cfg_get(BalGroupKey *tm_group_cfg_key,
- BalGroupCfg *tm_group_cfg)
+uint32_t bal_group_cfg_get(BalGroupCfg *group_cfg)
{
bcmos_errno err = BCM_ERR_OK;
bcmbal_group_cfg grp_cfg_obj; /**< declare main API struct */
bcmbal_group_key key = { }; /**< declare key */
- if(tm_group_cfg_key->has_group_id)
+ if(group_cfg->key->has_group_id)
{
- key.group_id = tm_group_cfg_key->group_id;
+ key.group_id = group_cfg->key->group_id;
}
else
{
@@ -222,6 +186,10 @@
ASFVOLT_LOG(ASFVOLT_INFO, "Get Group cfg sent to OLT for Group Id(%d)",
key.group_id);
+
+ memcpy(group_cfg->key, &key, sizeof(BalFlowKey));
+ memcpy(group_cfg->data, &grp_cfg_obj, sizeof(BalFlowCfgData));
+
return err;
}
diff --git a/src/bal_group_hdlr.h b/src/bal_group_hdlr.h
index 9e046fb..fa410c2 100755
--- a/src/bal_group_hdlr.h
+++ b/src/bal_group_hdlr.h
@@ -15,7 +15,6 @@
*/
extern uint32_t bal_group_cfg_set(BalGroupCfg *tm_group_cfg);
-extern uint32_t bal_group_cfg_get(BalGroupKey *tm_group_cfg_key,
- BalGroupCfg *tm_group_cfg);
+extern uint32_t bal_group_cfg_get(BalGroupCfg *tm_group_cfg);
extern uint32_t bal_group_cfg_clear(BalGroupKey *tm_group_cfg_key);
extern bcmos_errno bal_group_cfg_indication_cb(bcmbal_obj *obj);
diff --git a/src/bal_indications_hdlr.c b/src/bal_indications_hdlr.c
index fdd9bf3..a633b0d 100755
--- a/src/bal_indications_hdlr.c
+++ b/src/bal_indications_hdlr.c
@@ -22,136 +22,6 @@
/*extern variables*/
-/*static bcmos_mutex bal_ind_lock; - Need to define bcm independent mutex*/
-/********************************************************************\
- * Function : bal_acc_term_indication_cb *
- * Description : This function will handle the indications for *
- * Access Terminal Indication *
- * *
- ********************************************************************/
-bcmos_errno bal_acc_term_indication_cb(bcmbal_obj *obj)
-{
- bcmos_errno result = BCM_ERR_OK;
-
- if(BCMBAL_OBJ_ID_ACCESS_TERMINAL != obj->obj_type ||
- bcmbal_access_terminal_auto_id_ind != obj->subgroup)
- {
- ASFVOLT_LOG(ASFVOLT_ERROR, "Processing BAL API '%s' IND callback (status is %s)",
- bcmbal_objtype_str(obj->obj_type), bcmos_strerror(obj->status));
- result = BCM_ERR_INTERNAL;
- }
- else
- {
- ASFVOLT_LOG(ASFVOLT_DEBUG, "Processing BAL API '%s' IND callback (status is %s)",
- bcmbal_objtype_str(obj->obj_type), bcmos_strerror(obj->status));
- BalIndications *balIndCfg;
- balIndCfg = malloc(sizeof(BalIndications));
- memset(balIndCfg, 0, sizeof(BalIndications));
- bal_indications__init(balIndCfg);
- balIndCfg->u_case = BAL_INDICATIONS__U_ACCESS_TERM_IND;
- balIndCfg->has_objtype = BAL_GRPC_PRES;
- balIndCfg->objtype = obj->obj_type;
- balIndCfg->has_sub_group = BAL_GRPC_PRES;
- balIndCfg->sub_group = obj->subgroup;
- balIndCfg->device_id = voltha_device_id;
-
- bcmbal_access_terminal_ind *acc_term_ind = (bcmbal_access_terminal_ind *)obj;
-
- balIndCfg->access_term_ind = malloc(sizeof(BalAccessTerminalInd));
- memset(balIndCfg->access_term_ind, 0, sizeof(BalAccessTerminalInd));
- bal_access_terminal_ind__init(balIndCfg->access_term_ind);
-
- BalObj *hdr;
- hdr = malloc(sizeof(BalObj));
- memset(hdr, 0, sizeof(BalObj));
- bal_obj__init(hdr);
- balIndCfg->access_term_ind->hdr = hdr;
-
- BalAccessTerminalKey *accessTermkey;
- accessTermkey = malloc(sizeof(BalAccessTerminalKey));
- memset(accessTermkey, 0, sizeof(BalAccessTerminalKey));
- bal_access_terminal_key__init(accessTermkey);
- balIndCfg->access_term_ind->key = accessTermkey;
- balIndCfg->access_term_ind->key->has_access_term_id = BAL_GRPC_PRES;
- balIndCfg->access_term_ind->key->access_term_id = acc_term_ind->key.access_term_id;
-
- BalAccessTerminalIndData *accessTermIndData;
- accessTermIndData = malloc(sizeof(BalAccessTerminalIndData));
- memset(accessTermIndData, 0, sizeof(BalAccessTerminalIndData));
- bal_access_terminal_ind_data__init(accessTermIndData);
- balIndCfg->access_term_ind->data = accessTermIndData;
- balIndCfg->access_term_ind->data->has_admin_state = BAL_GRPC_PRES;
- balIndCfg->access_term_ind->data->admin_state = acc_term_ind->data.admin_state;
- balIndCfg->access_term_ind->data->has_oper_status = BAL_GRPC_PRES;
- balIndCfg->access_term_ind->data->oper_status = acc_term_ind->data.oper_status;
- balIndCfg->access_term_ind->data->has_iwf_mode = BAL_GRPC_PRES;
- balIndCfg->access_term_ind->data->iwf_mode = acc_term_ind->data.iwf_mode;
-
- BalTopology *balTop;
- balTop = malloc(sizeof(BalTopology));
- memset(balTop, 0, sizeof(BalTopology));
- bal_topology__init(balTop);
- balIndCfg->access_term_ind->data->topology = balTop;
-
- balIndCfg->access_term_ind->data->topology->has_num_of_nni_ports = BAL_GRPC_PRES;
- balIndCfg->access_term_ind->data->topology->num_of_nni_ports =
- acc_term_ind->data.topology.num_of_nni_ports;
- balIndCfg->access_term_ind->data->topology->has_num_of_pon_ports = BAL_GRPC_PRES;
- balIndCfg->access_term_ind->data->topology->num_of_pon_ports =
- acc_term_ind->data.topology.num_of_pon_ports;
- balIndCfg->access_term_ind->data->topology->has_num_of_mac_devs = BAL_GRPC_PRES;
- balIndCfg->access_term_ind->data->topology->num_of_mac_devs =
- acc_term_ind->data.topology.num_of_mac_devs;
- balIndCfg->access_term_ind->data->topology->has_num_of_pons_per_mac_dev = BAL_GRPC_PRES;
- balIndCfg->access_term_ind->data->topology->num_of_pons_per_mac_dev =
- acc_term_ind->data.topology.num_of_pons_per_mac_dev;
- balIndCfg->access_term_ind->data->topology->has_pon_family = BAL_GRPC_PRES;
- balIndCfg->access_term_ind->data->topology->pon_family =
- acc_term_ind->data.topology.pon_family;
- balIndCfg->access_term_ind->data->topology->has_pon_sub_family = BAL_GRPC_PRES;
- balIndCfg->access_term_ind->data->topology->pon_sub_family =
- acc_term_ind->data.topology.pon_sub_family;
-
- BalSwVersion *balsv;
- balsv = malloc(sizeof(BalSwVersion));
- memset(balsv, 0, sizeof(BalSwVersion));
- bal_sw_version__init(balsv);
- balIndCfg->access_term_ind->data->sw_version = balsv;
-
- balIndCfg->access_term_ind->data->sw_version->has_version_type = BAL_GRPC_PRES;
- balIndCfg->access_term_ind->data->sw_version->version_type =
- acc_term_ind->data.sw_version.version_type;
- balIndCfg->access_term_ind->data->sw_version->has_major_rev = BAL_GRPC_PRES;
- balIndCfg->access_term_ind->data->sw_version->major_rev =
- acc_term_ind->data.sw_version.major_rev;
- balIndCfg->access_term_ind->data->sw_version->has_minor_rev = BAL_GRPC_PRES;
- balIndCfg->access_term_ind->data->sw_version->minor_rev =
- acc_term_ind->data.sw_version.minor_rev;
- balIndCfg->access_term_ind->data->sw_version->has_patch_rev = BAL_GRPC_PRES;
- balIndCfg->access_term_ind->data->sw_version->patch_rev =
- acc_term_ind->data.sw_version.patch_rev;
- balIndCfg->access_term_ind->data->sw_version->has_om_version = BAL_GRPC_PRES;
- balIndCfg->access_term_ind->data->sw_version->om_version =
- acc_term_ind->data.sw_version.om_version;
- balIndCfg->access_term_ind->data->sw_version->has_dev_point = BAL_GRPC_PRES;
- balIndCfg->access_term_ind->data->sw_version->dev_point =
- acc_term_ind->data.sw_version.dev_point;
-
- bal_register_indication_cbs();
-
- list_node *bal_indication_node = malloc(sizeof(list_node));
- bal_indication_node->bal_indication = balIndCfg;
-
- pthread_mutex_lock(&bal_ind_queue_lock);
- add_bal_indication_node(bal_indication_node);
- pthread_mutex_unlock(&bal_ind_queue_lock);
-
- is_reboot = BAL_REBOOT_STATUS__BAL_OLT_UP_AFTER_ACTIVATION;
- }
-
- return result;
-}
-
/********************************************************************\
* Function : bal_acc_term_osc_indication_cb *
* Description : This function will handle the indications for *
@@ -191,11 +61,7 @@
bal_access_terminal_oper_status_change__init(acessTermOSC);
balIndCfg->access_term_ind_op_state = acessTermOSC;
- BalObj *hdr;
- hdr = malloc(sizeof(BalObj));
- memset(hdr, 0, sizeof(BalObj));
- bal_obj__init(hdr);
- balIndCfg->access_term_ind_op_state->hdr = hdr;
+ /*'hdr' field is not parsed by voltha adapter, hence not filled */
BalAccessTerminalKey *accessTermkey;
accessTermkey = malloc(sizeof(BalAccessTerminalKey));
@@ -221,6 +87,70 @@
balIndCfg->access_term_ind_op_state->data->admin_state =
acc_term_osc->data.admin_state;
+ bal_register_indication_cbs();
+
+ list_node *bal_indication_node = malloc(sizeof(list_node));
+ bal_indication_node->bal_indication = balIndCfg;
+
+ pthread_mutex_lock(&bal_ind_queue_lock);
+ add_bal_indication_node(bal_indication_node);
+ pthread_mutex_unlock(&bal_ind_queue_lock);
+ is_reboot = BAL_REBOOT_STATUS__BAL_OLT_UP_AFTER_ACTIVATION;
+ }
+
+ return result;
+}
+
+/********************************************************************\
+ * Function : bal_acc_term_processing_error_indication_cb *
+ * Description : This function will handle the error indications *
+ * for Access Terminal *
+ * *
+ ********************************************************************/
+bcmos_errno bal_acc_term_processing_error_indication_cb(bcmbal_obj *obj)
+{
+ bcmos_errno result = BCM_ERR_OK;
+
+ if(BCMBAL_OBJ_ID_ACCESS_TERMINAL != obj->obj_type ||
+ bcmbal_access_terminal_auto_id_processing_error != obj->subgroup)
+ {
+ ASFVOLT_LOG(ASFVOLT_ERROR, "Processing BAL API '%s' IND callback (status is %s)",
+ bcmbal_objtype_str(obj->obj_type), bcmos_strerror(obj->status));
+ result = BCM_ERR_INTERNAL;
+ }
+ else
+ {
+ BalIndications *balIndCfg;
+ balIndCfg = malloc(sizeof(BalIndications));
+ memset(balIndCfg, 0, sizeof(BalIndications));
+ bal_indications__init(balIndCfg);
+ balIndCfg->has_objtype = BAL_GRPC_PRES;
+ balIndCfg->objtype = obj->obj_type;
+ balIndCfg->has_sub_group = BAL_GRPC_PRES;
+ balIndCfg->sub_group = obj->subgroup;
+ balIndCfg->u_case = BAL_INDICATIONS__U_ACCESS_TERM_PROC_ERR;
+ balIndCfg->device_id = voltha_device_id;
+
+ bcmbal_access_terminal_processing_error *acc_term_err =
+ (bcmbal_access_terminal_processing_error *)obj;
+
+ BalAccessTerminalProcessingError *acessTermError;
+ acessTermError = malloc(sizeof(BalAccessTerminalProcessingError));
+ memset(acessTermError, 0, sizeof(BalAccessTerminalProcessingError));
+ bal_access_terminal_processing_error__init(acessTermError);
+ balIndCfg->access_term_proc_err = acessTermError;
+
+ /*'hdr' field is not parsed by voltha adapter, hence not filled */
+
+ BalAccessTerminalKey *accessTermkey;
+ accessTermkey = malloc(sizeof(BalAccessTerminalKey));
+ memset(accessTermkey, 0, sizeof(BalAccessTerminalKey));
+ bal_access_terminal_key__init(accessTermkey);
+ balIndCfg->access_term_proc_err->key = accessTermkey;
+ balIndCfg->access_term_proc_err->key->has_access_term_id = BAL_GRPC_PRES;
+ balIndCfg->access_term_proc_err->key->access_term_id =
+ acc_term_err->key.access_term_id;
+
list_node *bal_indication_node = malloc(sizeof(list_node));
bal_indication_node->bal_indication = balIndCfg;
@@ -270,11 +200,7 @@
bal_flow_oper_status_change__init(flowOscInd);
balIndCfg->flow_op_state = flowOscInd;
- BalObj *hdr;
- hdr = malloc(sizeof(BalObj));
- memset(hdr, 0, sizeof(BalObj));
- bal_obj__init(hdr);
- balIndCfg->flow_op_state->hdr = hdr;
+ /*'hdr' field is not parsed by voltha adapter, hence not filled */
BalFlowKey *flowkey;
flowkey = malloc(sizeof(BalFlowKey));
@@ -318,17 +244,16 @@
}
/********************************************************************\
- * Function : bal_flow_indication_cb *
- * Description : This function will handle the indications for *
- * Flow Indication *
+ * Function : bal_flow_processing_error_indication_cb *
+ * Description : This function will handle flow processing errors *
* *
********************************************************************/
-bcmos_errno bal_flow_indication_cb(bcmbal_obj *obj)
+bcmos_errno bal_flow_processing_error_indication_cb(bcmbal_obj *obj)
{
- bcmos_errno result = BCM_ERR_OK;
+ bcmos_errno result = BCM_ERR_OK;
if(BCMBAL_OBJ_ID_FLOW != obj->obj_type ||
- bcmbal_flow_auto_id_ind != obj->subgroup)
+ bcmbal_flow_auto_id_processing_error != obj->subgroup)
{
ASFVOLT_LOG(ASFVOLT_ERROR, "Processing BAL API '%s' IND callback (status is %s)",
bcmbal_objtype_str(obj->obj_type), bcmos_strerror(obj->status));
@@ -340,136 +265,38 @@
balIndCfg = malloc(sizeof(BalIndications));
memset(balIndCfg, 0, sizeof(BalIndications));
bal_indications__init(balIndCfg);
- balIndCfg->u_case = BAL_INDICATIONS__U_FLOW_IND;
balIndCfg->has_objtype = BAL_GRPC_PRES;
balIndCfg->objtype = obj->obj_type;
balIndCfg->has_sub_group = BAL_GRPC_PRES;
balIndCfg->sub_group = obj->subgroup;
+ balIndCfg->u_case = BAL_INDICATIONS__U_FLOW_PROC_ERR;
balIndCfg->device_id = voltha_device_id;
- bcmbal_flow_ind *flow_ind = (bcmbal_flow_ind *)obj;
+ bcmbal_flow_processing_error *flow_proc_error =
+ (bcmbal_flow_processing_error *)obj;
- BalFlowInd *flowInd;
- flowInd = malloc(sizeof(BalFlowInd));
- memset(flowInd, 0, sizeof(BalFlowInd));
- bal_flow_ind__init(flowInd);
- balIndCfg->flow_ind = flowInd;
+ BalFlowProcessingError *flowProcError;
+ flowProcError = malloc(sizeof(BalFlowProcessingError));
+ memset(flowProcError, 0, sizeof(BalFlowProcessingError));
+ bal_flow_processing_error__init(flowProcError);
+ balIndCfg->flow_proc_err = flowProcError;
- BalObj *hdr;
- hdr = malloc(sizeof(BalObj));
- memset(hdr, 0, sizeof(BalObj));
- bal_obj__init(hdr);
- balIndCfg->flow_ind->hdr = hdr;
+ /*'hdr' field is not parsed by voltha adapter, hence not filled */
- BalFlowKey *flowkey;
- flowkey = malloc(sizeof(BalFlowKey));
- memset(flowkey, 0, sizeof(BalFlowKey));
- bal_flow_key__init(flowkey);
- balIndCfg->flow_ind->key = flowkey;
+ BalFlowKey *flowKey;
+ flowKey = malloc(sizeof(BalFlowKey));
+ memset(flowKey, 0, sizeof(BalFlowKey));
+ bal_flow_key__init(flowKey);
- balIndCfg->flow_ind->key->has_flow_id = BAL_GRPC_PRES;
- balIndCfg->flow_ind->key->flow_id = flow_ind->key.flow_id;
- balIndCfg->flow_ind->key->has_flow_type = BAL_GRPC_PRES;
- balIndCfg->flow_ind->key->flow_type = flow_ind->key.flow_type;
+ balIndCfg->flow_proc_err->key = flowKey;
- BalFlowIndData *flowIndData;
- flowIndData = malloc(sizeof(BalFlowIndData));
- memset(flowIndData, 0, sizeof(BalFlowIndData));
- bal_flow_ind_data__init(flowIndData);
- balIndCfg->flow_ind->data = flowIndData;
+ balIndCfg->flow_proc_err->key->has_flow_id = BAL_GRPC_PRES;
+ balIndCfg->flow_proc_err->key->flow_id =
+ flow_proc_error->key.flow_id;
- balIndCfg->flow_ind->data->has_admin_state = BAL_GRPC_PRES;
- balIndCfg->flow_ind->data->admin_state = flow_ind->data.admin_state;
- balIndCfg->flow_ind->data->has_oper_status= BAL_GRPC_PRES;
- balIndCfg->flow_ind->data->oper_status= flow_ind->data.oper_status;
- balIndCfg->flow_ind->data->has_access_int_id = BAL_GRPC_PRES;
- balIndCfg->flow_ind->data->access_int_id = flow_ind->data.access_int_id;
- balIndCfg->flow_ind->data->has_network_int_id = BAL_GRPC_PRES;
- balIndCfg->flow_ind->data->network_int_id = flow_ind->data.network_int_id;
- balIndCfg->flow_ind->data->has_sub_term_id = BAL_GRPC_PRES;
- balIndCfg->flow_ind->data->sub_term_id = flow_ind->data.sub_term_id;
- balIndCfg->flow_ind->data->has_sub_term_uni_idx = BAL_GRPC_PRES;
- balIndCfg->flow_ind->data->sub_term_uni_idx = flow_ind->data.sub_term_uni_idx;
- balIndCfg->flow_ind->data->has_svc_port_id = BAL_GRPC_PRES;
- balIndCfg->flow_ind->data->svc_port_id = flow_ind->data.svc_port_id;
- balIndCfg->flow_ind->data->has_resolve_mac = BAL_GRPC_PRES;
- balIndCfg->flow_ind->data->resolve_mac = flow_ind->data.resolve_mac;
- balIndCfg->flow_ind->data->has_cookie = BAL_GRPC_PRES;
- balIndCfg->flow_ind->data->cookie = flow_ind->data.cookie;
-
- BalClassifier *balClassifier;
- balClassifier = malloc(sizeof(BalClassifier));
- memset(balClassifier, 0, sizeof(BalClassifier));
- bal_classifier__init(balClassifier);
- balIndCfg->flow_ind->data->classifier = balClassifier;
-
- balIndCfg->flow_ind->data->classifier->has_presence_mask = BAL_GRPC_PRES;
- balIndCfg->flow_ind->data->classifier->presence_mask = flow_ind->data.classifier.presence_mask;
- balIndCfg->flow_ind->data->classifier->has_o_tpid = BAL_GRPC_PRES;
- balIndCfg->flow_ind->data->classifier->o_tpid = flow_ind->data.classifier.o_tpid;
- balIndCfg->flow_ind->data->classifier->has_o_vid = BAL_GRPC_PRES;
- balIndCfg->flow_ind->data->classifier->o_vid = flow_ind->data.classifier.o_vid;
- balIndCfg->flow_ind->data->classifier->has_i_tpid = BAL_GRPC_PRES;
- balIndCfg->flow_ind->data->classifier->i_tpid = flow_ind->data.classifier.i_tpid;
- balIndCfg->flow_ind->data->classifier->has_i_vid = BAL_GRPC_PRES;
- balIndCfg->flow_ind->data->classifier->i_vid = flow_ind->data.classifier.i_vid;
- balIndCfg->flow_ind->data->classifier->has_o_pbits = BAL_GRPC_PRES;
- balIndCfg->flow_ind->data->classifier->o_pbits = flow_ind->data.classifier.o_pbits;
- balIndCfg->flow_ind->data->classifier->has_i_pbits = BAL_GRPC_PRES;
- balIndCfg->flow_ind->data->classifier->i_pbits = flow_ind->data.classifier.i_pbits;
- balIndCfg->flow_ind->data->classifier->has_ether_type = BAL_GRPC_PRES;
- balIndCfg->flow_ind->data->classifier->ether_type = flow_ind->data.classifier.ether_type;
- balIndCfg->flow_ind->data->classifier->has_dst_mac = BAL_GRPC_PRES;
- balIndCfg->flow_ind->data->classifier->dst_mac.len =
- (BCMOS_ETH_ALEN)*sizeof(flow_ind->data.classifier.dst_mac.u8);
- balIndCfg->flow_ind->data->classifier->dst_mac.data =
- (uint8_t *)malloc((balIndCfg->flow_ind->data->classifier->dst_mac.len)*sizeof(uint8_t));
- memcpy(balIndCfg->flow_ind->data->classifier->dst_mac.data,
- flow_ind->data.classifier.dst_mac.u8,
- balIndCfg->flow_ind->data->classifier->dst_mac.len);
- balIndCfg->flow_ind->data->classifier->has_src_mac = BAL_GRPC_PRES;
- balIndCfg->flow_ind->data->classifier->src_mac.len =
- (BCMOS_ETH_ALEN)*sizeof(flow_ind->data.classifier.src_mac.u8);
- balIndCfg->flow_ind->data->classifier->src_mac.data =
- (uint8_t *)malloc((balIndCfg->flow_ind->data->classifier->src_mac.len)*sizeof(uint8_t));
- memcpy(balIndCfg->flow_ind->data->classifier->src_mac.data,
- flow_ind->data.classifier.src_mac.u8,
- balIndCfg->flow_ind->data->classifier->src_mac.len);
- balIndCfg->flow_ind->data->classifier->has_ip_proto = BAL_GRPC_PRES;
- balIndCfg->flow_ind->data->classifier->ip_proto = flow_ind->data.classifier.ip_proto;
- balIndCfg->flow_ind->data->classifier->has_dst_ip = BAL_GRPC_PRES;
- balIndCfg->flow_ind->data->classifier->dst_ip = flow_ind->data.classifier.dst_ip.u32;
- balIndCfg->flow_ind->data->classifier->has_src_ip = BAL_GRPC_PRES;
- balIndCfg->flow_ind->data->classifier->src_ip = flow_ind->data.classifier.src_ip.u32;
- balIndCfg->flow_ind->data->classifier->has_src_port = BAL_GRPC_PRES;
- balIndCfg->flow_ind->data->classifier->src_port = flow_ind->data.classifier.src_port;
- balIndCfg->flow_ind->data->classifier->has_dst_port = BAL_GRPC_PRES;
- balIndCfg->flow_ind->data->classifier->dst_port = flow_ind->data.classifier.dst_port;
- balIndCfg->flow_ind->data->classifier->has_pkt_tag_type = BAL_GRPC_PRES;
- balIndCfg->flow_ind->data->classifier->pkt_tag_type = flow_ind->data.classifier.pkt_tag_type;
-
- BalAction *balAction;
- balAction = malloc(sizeof(BalAction));
- memset(balAction, 0, sizeof(BalAction));
- bal_action__init(balAction);
- balIndCfg->flow_ind->data->action = balAction;
-
- balIndCfg->flow_ind->data->action->has_presence_mask = BAL_GRPC_PRES;
- balIndCfg->flow_ind->data->action->presence_mask = flow_ind->data.action.presence_mask;
- balIndCfg->flow_ind->data->action->has_cmds_bitmask = BAL_GRPC_PRES;
- balIndCfg->flow_ind->data->action->cmds_bitmask = flow_ind->data.action.cmds_bitmask;
- balIndCfg->flow_ind->data->action->has_o_vid = BAL_GRPC_PRES;
- balIndCfg->flow_ind->data->action->o_vid = flow_ind->data.action.o_vid;
- balIndCfg->flow_ind->data->action->has_o_pbits = BAL_GRPC_PRES;
- balIndCfg->flow_ind->data->action->o_pbits = flow_ind->data.action.o_pbits;
- balIndCfg->flow_ind->data->action->has_o_tpid = BAL_GRPC_PRES;
- balIndCfg->flow_ind->data->action->o_tpid = flow_ind->data.action.o_tpid;
- balIndCfg->flow_ind->data->action->has_i_vid = BAL_GRPC_PRES;
- balIndCfg->flow_ind->data->action->i_vid = flow_ind->data.action.i_vid;
- balIndCfg->flow_ind->data->action->has_i_pbits = BAL_GRPC_PRES;
- balIndCfg->flow_ind->data->action->i_pbits = flow_ind->data.action.i_pbits;
- balIndCfg->flow_ind->data->action->has_i_tpid = BAL_GRPC_PRES;
- balIndCfg->flow_ind->data->action->i_tpid = flow_ind->data.action.i_tpid;
+ balIndCfg->flow_proc_err->key->has_flow_type = BAL_GRPC_PRES;
+ balIndCfg->flow_proc_err->key->flow_type =
+ flow_proc_error->key.flow_type;
list_node *bal_indication_node = malloc(sizeof(list_node));
bal_indication_node->bal_indication = balIndCfg;
@@ -479,156 +306,10 @@
pthread_mutex_unlock(&bal_ind_queue_lock);
}
- return result;
+
+ return result;
}
-/********************************************************************\
- * Function : bal_group_indication_cb *
- * Description : This function will handle the indications for *
- * Group Indication *
- * *
- ********************************************************************/
-bcmos_errno bal_group_indication_cb(bcmbal_obj *obj)
-{
- bcmos_errno result = BCM_ERR_OK;
- unsigned int i = 0;
-
- if(BCMBAL_OBJ_ID_GROUP != obj->obj_type ||
- bcmbal_group_auto_id_ind != obj->subgroup)
- {
- ASFVOLT_LOG(ASFVOLT_ERROR, "Processing BAL API '%s' IND callback (status is %s)",
- bcmbal_objtype_str(obj->obj_type), bcmos_strerror(obj->status));
- result = BCM_ERR_INTERNAL;
- }
- else
- {
- BalIndications *balIndCfg;
- balIndCfg = malloc(sizeof(BalIndications));
- memset(balIndCfg, 0, sizeof(BalIndications));
- bal_indications__init(balIndCfg);
- balIndCfg->u_case = BAL_INDICATIONS__U_GROUP_IND;
- balIndCfg->has_objtype = BAL_GRPC_PRES;
- balIndCfg->objtype = obj->obj_type;
- balIndCfg->has_sub_group = BAL_GRPC_PRES;
- balIndCfg->sub_group = obj->subgroup;
- balIndCfg->device_id = voltha_device_id;
-
- bcmbal_group_ind *group_ind = (bcmbal_group_ind *)obj;
-
- BalGroupInd *groupInd;
- groupInd = malloc(sizeof(BalGroupInd));
- memset(groupInd, 0, sizeof(BalGroupInd));
- bal_group_ind__init(groupInd);
- balIndCfg->group_ind = groupInd;
-
- BalObj *hdr;
- hdr = malloc(sizeof(BalObj));
- memset(hdr, 0, sizeof(BalObj));
- bal_obj__init(hdr);
- balIndCfg->group_ind->hdr = hdr;
-
- BalGroupKey *groupkey;
- groupkey = malloc(sizeof(BalGroupKey));
- memset(groupkey, 0, sizeof(BalGroupKey));
- bal_group_key__init(groupkey);
- balIndCfg->group_ind->key = groupkey;
-
- balIndCfg->group_ind->key->has_group_id = BAL_GRPC_PRES;
- balIndCfg->group_ind->key->group_id = group_ind->key.group_id;
-
- BalGroupIndData *groupIndData;
- groupIndData = malloc(sizeof(BalGroupIndData));
- memset(groupIndData, 0, sizeof(BalGroupIndData));
- bal_group_ind_data__init(groupIndData);
- balIndCfg->group_ind->data = groupIndData;
-
- balIndCfg->group_ind->data->has_members_cmd = BAL_GRPC_PRES;
- balIndCfg->group_ind->data->members_cmd = group_ind->data.members_cmd;
- balIndCfg->group_ind->data->has_cookie = BAL_GRPC_PRES;
- balIndCfg->group_ind->data->cookie = group_ind->data.cookie;
- balIndCfg->group_ind->data->has_owner = BAL_GRPC_PRES;
- balIndCfg->group_ind->data->owner = group_ind->data.owner;
-
- BalGroupMemberInfoList *balMembers;
- balMembers = malloc(sizeof(BalGroupMemberInfoList));
- memset(balMembers, 0, sizeof(BalGroupMemberInfoList));
- bal_group_member_info_list__init(balMembers);
- balIndCfg->group_ind->data->members = balMembers;
-
- balIndCfg->group_ind->data->members->n_val = group_ind->data.members.len;
-
- BalGroupMemberInfo *balMemberInfo;
- BalAction *balAction;
- BalTmQueueRef *balQueue;
- for (i = 0; i < balIndCfg->group_ind->data->members->n_val; i++)
- {
- balMemberInfo = malloc(sizeof(BalGroupMemberInfo));
- memset(balMemberInfo, 0, sizeof(BalGroupMemberInfo));
- bal_group_member_info__init(balMemberInfo);
-
- balMemberInfo->has_intf_id = BAL_GRPC_PRES;
- balMemberInfo->intf_id = group_ind->data.members.val->intf_id;
- balMemberInfo->has_svc_port_id = BAL_GRPC_PRES;
- balMemberInfo->svc_port_id = group_ind->data.members.val->svc_port_id;
-
- balAction = malloc(sizeof(BalAction));
- memset(balAction, 0, sizeof(BalAction));
- bal_action__init(balAction);
- balMemberInfo->action = balAction;
-
- balMemberInfo->action->has_presence_mask = BAL_GRPC_PRES;
- balMemberInfo->action->presence_mask = group_ind->data.members.val->action.presence_mask;
- balMemberInfo->action->has_cmds_bitmask = BAL_GRPC_PRES;
- balMemberInfo->action->cmds_bitmask = group_ind->data.members.val->action.cmds_bitmask;
- balMemberInfo->action->has_o_vid = BAL_GRPC_PRES;
- balMemberInfo->action->o_vid = group_ind->data.members.val->action.o_vid;
- balMemberInfo->action->has_o_pbits = BAL_GRPC_PRES;
- balMemberInfo->action->o_pbits = group_ind->data.members.val->action.o_pbits;
- balMemberInfo->action->has_o_tpid = BAL_GRPC_PRES;
- balMemberInfo->action->o_tpid = group_ind->data.members.val->action.o_tpid;
- balMemberInfo->action->has_i_vid = BAL_GRPC_PRES;
- balMemberInfo->action->i_vid = group_ind->data.members.val->action.i_vid;
- balMemberInfo->action->has_i_pbits = BAL_GRPC_PRES;
- balMemberInfo->action->i_pbits = group_ind->data.members.val->action.i_pbits;
- balMemberInfo->action->has_i_tpid = BAL_GRPC_PRES;
- balMemberInfo->action->i_tpid = group_ind->data.members.val->action.i_tpid;
-
- balQueue = malloc(sizeof(BalTmQueueRef));
- memset(balQueue, 0, sizeof(BalTmQueueRef));
- bal_tm_queue_ref__init(balQueue);
- balMemberInfo->queue = balQueue;
-
- balMemberInfo->queue->has_sched_id = BAL_GRPC_PRES;
- balMemberInfo->queue->sched_id = group_ind->data.members.val->queue.sched_id;
- balMemberInfo->queue->has_queue_id = BAL_GRPC_PRES;
- balMemberInfo->queue->queue_id = group_ind->data.members.val->queue.queue_id;
-
- balIndCfg->group_ind->data->members->val[i] = balMemberInfo;
- }
-
-
- BalIdList *balFlows;
- balFlows = malloc(sizeof(BalIdList));
- memset(balFlows, 0, sizeof(BalIdList));
- bal_id_list__init(balFlows);
- balIndCfg->group_ind->data->flows = balFlows;
-
- balIndCfg->group_ind->data->flows->n_val = group_ind->data.flows.len;
- balIndCfg->group_ind->data->flows->val =
- (uint32_t *)malloc((balIndCfg->group_ind->data->flows->n_val)*sizeof(uint32_t));
- memcpy(balIndCfg->group_ind->data->flows->val, group_ind->data.flows.val,
- balIndCfg->group_ind->data->flows->n_val);
-
- list_node *bal_indication_node = malloc(sizeof(list_node));
- bal_indication_node->bal_indication = balIndCfg;
-
- pthread_mutex_lock(&bal_ind_queue_lock);
- add_bal_indication_node(bal_indication_node);
- pthread_mutex_unlock(&bal_ind_queue_lock);
- }
-
- return result;
-}
/********************************************************************\
* Function : bal_interface_osc_indication_cb *
@@ -669,11 +350,7 @@
bal_interface_oper_status_change__init(ifOsc);
balIndCfg->interface_op_state = ifOsc;
- BalObj *hdr;
- hdr = malloc(sizeof(BalObj));
- memset(hdr, 0, sizeof(BalObj));
- bal_obj__init(hdr);
- balIndCfg->interface_op_state->hdr = hdr;
+ /*'hdr' field is not parsed by voltha adapter, hence not filled */
BalInterfaceKey *ifkey;
ifkey = malloc(sizeof(BalInterfaceKey));
@@ -749,11 +426,7 @@
bal_interface_los__init(ifLos);
balIndCfg->interface_los = ifLos;
- BalObj *hdr;
- hdr = malloc(sizeof(BalObj));
- memset(hdr, 0, sizeof(BalObj));
- bal_obj__init(hdr);
- balIndCfg->interface_los->hdr = hdr;
+ /*'hdr' field is not parsed by voltha adapter, hence not filled */
BalInterfaceKey *ifkey;
ifkey = malloc(sizeof(BalInterfaceKey));
@@ -787,111 +460,6 @@
}
/********************************************************************\
- * Function : bal_interface_indication_cb *
- * Description : This function will handle the indications for *
- * Interface Indication *
- * *
- ********************************************************************/
-bcmos_errno bal_interface_indication_cb(bcmbal_obj *obj)
-{
- bcmos_errno result = BCM_ERR_OK;
-
- if(BCMBAL_OBJ_ID_INTERFACE != obj->obj_type ||
- bcmbal_interface_auto_id_ind != obj->subgroup)
- {
- ASFVOLT_LOG(ASFVOLT_ERROR, "Processing BAL API '%s' IND callback (status is %s)",
- bcmbal_objtype_str(obj->obj_type), bcmos_strerror(obj->status));
- result = BCM_ERR_INTERNAL;
- }
- else
- {
- BalIndications *balIndCfg;
- balIndCfg = malloc(sizeof(BalIndications));
- memset(balIndCfg, 0, sizeof(BalIndications));
- bal_indications__init(balIndCfg);
- balIndCfg->u_case = BAL_INDICATIONS__U_INTERFACE_IND;
- balIndCfg->has_objtype = BAL_GRPC_PRES;
- balIndCfg->objtype = obj->obj_type;
- balIndCfg->has_sub_group = BAL_GRPC_PRES;
- balIndCfg->sub_group = obj->subgroup;
- balIndCfg->device_id = voltha_device_id;
-
- bcmbal_interface_ind *interface_ind = (bcmbal_interface_ind *)obj;
-
- BalInterfaceInd *ifInd;
- ifInd = malloc(sizeof(BalInterfaceInd));
- memset(ifInd, 0, sizeof(BalInterfaceInd));
- bal_interface_ind__init(ifInd);
- balIndCfg->interface_ind = ifInd;
-
- BalObj *hdr;
- hdr = malloc(sizeof(BalObj));
- memset(hdr, 0, sizeof(BalObj));
- bal_obj__init(hdr);
- balIndCfg->interface_ind->hdr = hdr;
-
- BalInterfaceKey *ifkey;
- ifkey = malloc(sizeof(BalInterfaceKey));
- memset(ifkey, 0, sizeof(BalInterfaceKey));
- bal_interface_key__init(ifkey);
- balIndCfg->interface_ind->key = ifkey;
-
- balIndCfg->interface_ind->key->has_intf_id = BAL_GRPC_PRES;
- balIndCfg->interface_ind->key->intf_id = interface_ind->key.intf_id;
- balIndCfg->interface_ind->key->has_intf_type = BAL_GRPC_PRES;
- balIndCfg->interface_ind->key->intf_type = interface_ind->key.intf_type;
-
- BalInterfaceIndData *ifIndData;
- ifIndData = malloc(sizeof(BalInterfaceIndData));
- memset(ifIndData, 0, sizeof(BalInterfaceIndData));
- bal_interface_ind_data__init(ifIndData);
- balIndCfg->interface_ind->data = ifIndData;
-
- balIndCfg->interface_ind->data->has_admin_state = BAL_GRPC_PRES;
- balIndCfg->interface_ind->data->admin_state = interface_ind->data.admin_state;
- balIndCfg->interface_ind->data->has_oper_status = BAL_GRPC_PRES;
- balIndCfg->interface_ind->data->oper_status = interface_ind->data.oper_status;
- balIndCfg->interface_ind->data->has_min_data_agg_port_id = BAL_GRPC_PRES;
- balIndCfg->interface_ind->data->min_data_agg_port_id = interface_ind->data.min_data_agg_port_id;
- balIndCfg->interface_ind->data->has_min_data_svc_port_id = BAL_GRPC_PRES;
- balIndCfg->interface_ind->data->min_data_svc_port_id = interface_ind->data.min_data_svc_port_id;
- balIndCfg->interface_ind->data->has_transceiver_type = BAL_GRPC_PRES;
- balIndCfg->interface_ind->data->transceiver_type = interface_ind->data.transceiver_type;
- balIndCfg->interface_ind->data->has_ds_miss_mode = BAL_GRPC_PRES;
- balIndCfg->interface_ind->data->ds_miss_mode = interface_ind->data.ds_miss_mode;
- balIndCfg->interface_ind->data->has_mtu = BAL_GRPC_PRES;
- balIndCfg->interface_ind->data->mtu = interface_ind->data.mtu;
- balIndCfg->interface_ind->data->has_flow_control = BAL_GRPC_PRES;
- balIndCfg->interface_ind->data->flow_control = interface_ind->data.flow_control;
- balIndCfg->interface_ind->data->has_ds_tm = BAL_GRPC_PRES;
- balIndCfg->interface_ind->data->ds_tm = interface_ind->data.ds_tm;
- balIndCfg->interface_ind->data->has_us_tm = BAL_GRPC_PRES;
- balIndCfg->interface_ind->data->us_tm = interface_ind->data.us_tm;
-
- BalIdList *balFlows;
- balFlows = malloc(sizeof(BalIdList));
- memset(balFlows, 0, sizeof(BalIdList));
- bal_id_list__init(balFlows);
- balIndCfg->interface_ind->data->sub_term_id_list = balFlows;
-
- balIndCfg->interface_ind->data->sub_term_id_list->n_val = interface_ind->data.sub_term_id_list.len;
- balIndCfg->interface_ind->data->sub_term_id_list->val =
- (uint32_t *)malloc((balIndCfg->interface_ind->data->sub_term_id_list->n_val)*sizeof(uint32_t));
- memcpy(balIndCfg->interface_ind->data->sub_term_id_list->val, interface_ind->data.sub_term_id_list.val,
- balIndCfg->interface_ind->data->sub_term_id_list->n_val);
-
- list_node *bal_indication_node = malloc(sizeof(list_node));
- bal_indication_node->bal_indication = balIndCfg;
-
- pthread_mutex_lock(&bal_ind_queue_lock);
- add_bal_indication_node(bal_indication_node);
- pthread_mutex_unlock(&bal_ind_queue_lock);
- }
-
- return result;
-}
-
-/********************************************************************\
* Function : bal_sub_term_osc_indication_cb *
* Description : This function will handle the indications for *
* Subscriber term Operational State Change *
@@ -930,11 +498,7 @@
bal_subscriber_terminal_oper_status_change__init(subOscInd);
balIndCfg->terminal_op_state = subOscInd;
- BalObj *hdr;
- hdr = malloc(sizeof(BalObj));
- memset(hdr, 0, sizeof(BalObj));
- bal_obj__init(hdr);
- balIndCfg->terminal_op_state->hdr = hdr;
+ /*'hdr' field is not parsed by voltha adapter, hence not filled */
BalSubscriberTerminalKey *subkey;
subkey = malloc(sizeof(BalSubscriberTerminalKey));
@@ -1015,11 +579,7 @@
bal_subscriber_terminal_sub_term_disc__init(subDiscInd);
balIndCfg->terminal_disc = subDiscInd;
- BalObj *hdr;
- hdr = malloc(sizeof(BalObj));
- memset(hdr, 0, sizeof(BalObj));
- bal_obj__init(hdr);
- balIndCfg->terminal_disc->hdr = hdr;
+ /*'hdr' field is not parsed by voltha adapter, hence not filled */
BalSubscriberTerminalKey *subkey;
subkey = malloc(sizeof(BalSubscriberTerminalKey));
@@ -1132,11 +692,7 @@
bal_subscriber_terminal_sub_term_alarm__init(subTermAlarm);
balIndCfg->terminal_alarm = subTermAlarm;
- BalObj *hdr;
- hdr = malloc(sizeof(BalObj));
- memset(hdr, 0, sizeof(BalObj));
- bal_obj__init(hdr);
- balIndCfg->terminal_alarm->hdr = hdr;
+ /*'hdr' field is not parsed by voltha adapter, hence not filled */
BalSubscriberTerminalKey *subkey;
subkey = malloc(sizeof(BalSubscriberTerminalKey));
@@ -1220,11 +776,7 @@
bal_subscriber_terminal_dgi__init(subDgiInd);
balIndCfg->terminal_dgi= subDgiInd;
- BalObj *hdr;
- hdr = malloc(sizeof(BalObj));
- memset(hdr, 0, sizeof(BalObj));
- bal_obj__init(hdr);
- balIndCfg->terminal_dgi->hdr = hdr;
+ /*'hdr' field is not parsed by voltha adapter, hence not filled */
BalSubscriberTerminalKey *subkey;
subkey = malloc(sizeof(BalSubscriberTerminalKey));
@@ -1258,17 +810,16 @@
}
/********************************************************************\
- * Function : bal_sub_term_indication_cb *
- * Description : This function will handle the indications for *
- * Subscriber term indication *
+ * Function : bal_sub_term_dowi_indication_cb *
+ * Description : This function will handle dowi indication *
* *
********************************************************************/
-bcmos_errno bal_sub_term_indication_cb(bcmbal_obj *obj)
+bcmos_errno bal_sub_term_dowi_indication_cb(bcmbal_obj *obj)
{
- bcmos_errno result = BCM_ERR_OK;
+bcmos_errno result = BCM_ERR_OK;
if(BCMBAL_OBJ_ID_SUBSCRIBER_TERMINAL != obj->obj_type ||
- bcmbal_subscriber_terminal_auto_id_ind != obj->subgroup)
+ bcmbal_subscriber_terminal_auto_id_dowi != obj->subgroup)
{
ASFVOLT_LOG(ASFVOLT_ERROR, "Processing BAL API '%s' IND callback (status is %s)",
bcmbal_objtype_str(obj->obj_type), bcmos_strerror(obj->status));
@@ -1280,124 +831,49 @@
balIndCfg = malloc(sizeof(BalIndications));
memset(balIndCfg, 0, sizeof(BalIndications));
bal_indications__init(balIndCfg);
- balIndCfg->u_case = BAL_INDICATIONS__U_TERMINAL_IND;
+ balIndCfg->u_case = BAL_INDICATIONS__U_TERMINAL_DOWI;
balIndCfg->has_objtype = BAL_GRPC_PRES;
balIndCfg->objtype = obj->obj_type;
balIndCfg->has_sub_group = BAL_GRPC_PRES;
balIndCfg->sub_group = obj->subgroup;
balIndCfg->device_id = voltha_device_id;
- bcmbal_subscriber_terminal_ind *sub_ind = (bcmbal_subscriber_terminal_ind *)obj;
+ bcmbal_subscriber_terminal_dowi *sub_dowi_ind =
+ (bcmbal_subscriber_terminal_dowi *)obj;
- BalSubscriberTerminalInd *subInd;
- subInd = malloc(sizeof(BalSubscriberTerminalInd));
- memset(subInd, 0, sizeof(BalSubscriberTerminalInd));
- bal_subscriber_terminal_ind__init(subInd);
- balIndCfg->terminal_ind = subInd;
+ BalSubscriberTerminalDowi *subDowiInd;
+ subDowiInd = malloc(sizeof(BalSubscriberTerminalDowi));
+ memset(subDowiInd, 0, sizeof(BalSubscriberTerminalDowi));
+ bal_subscriber_terminal_dowi__init(subDowiInd);
+ balIndCfg->terminal_dowi= subDowiInd;
- BalObj *hdr;
- hdr = malloc(sizeof(BalObj));
- memset(hdr, 0, sizeof(BalObj));
- bal_obj__init(hdr);
- balIndCfg->terminal_ind->hdr = hdr;
+ /*'hdr' field is not parsed by voltha adapter, hence not filled */
BalSubscriberTerminalKey *subkey;
subkey = malloc(sizeof(BalSubscriberTerminalKey));
memset(subkey, 0, sizeof(BalSubscriberTerminalKey));
bal_subscriber_terminal_key__init(subkey);
- balIndCfg->terminal_ind->key = subkey;
+ balIndCfg->terminal_dowi->key = subkey;
- balIndCfg->terminal_ind->key->has_intf_id = BAL_GRPC_PRES;
- balIndCfg->terminal_ind->key->intf_id = sub_ind->key.intf_id;
- balIndCfg->terminal_ind->key->has_sub_term_id = BAL_GRPC_PRES;
- balIndCfg->terminal_ind->key->sub_term_id = sub_ind->key.sub_term_id;
+ balIndCfg->terminal_dowi->key->has_intf_id = BAL_GRPC_PRES;
+ balIndCfg->terminal_dowi->key->intf_id = sub_dowi_ind->key.intf_id;
+ balIndCfg->terminal_dowi->key->has_sub_term_id = BAL_GRPC_PRES;
+ balIndCfg->terminal_dowi->key->sub_term_id = sub_dowi_ind->key.sub_term_id;
- BalSubscriberTerminalIndData *subIndData;
- subIndData = malloc(sizeof(BalSubscriberTerminalIndData));
- memset(subIndData, 0, sizeof(BalSubscriberTerminalIndData));
- bal_subscriber_terminal_ind_data__init(subIndData);
- balIndCfg->terminal_ind->data = subIndData;
+ BalSubscriberTerminalDowiData *subDowiIndData;
+ subDowiIndData = malloc(sizeof(BalSubscriberTerminalDowiData));
+ memset(subDowiIndData, 0, sizeof(BalSubscriberTerminalDowiData));
+ bal_subscriber_terminal_dowi_data__init(subDowiIndData);
+ balIndCfg->terminal_dowi->data = subDowiIndData;
- balIndCfg->terminal_ind->data->has_admin_state = BAL_GRPC_PRES;
- balIndCfg->terminal_ind->data->admin_state = sub_ind->data.admin_state;
- balIndCfg->terminal_ind->data->has_oper_status = BAL_GRPC_PRES;
- balIndCfg->terminal_ind->data->oper_status = sub_ind->data.oper_status;
- balIndCfg->terminal_ind->data->has_svc_port_id = BAL_GRPC_PRES;
- balIndCfg->terminal_ind->data->svc_port_id = sub_ind->data.svc_port_id;
- balIndCfg->terminal_ind->data->has_ds_tm = BAL_GRPC_PRES;
- balIndCfg->terminal_ind->data->ds_tm = sub_ind->data.ds_tm;
- balIndCfg->terminal_ind->data->has_us_tm = BAL_GRPC_PRES;
- balIndCfg->terminal_ind->data->us_tm = sub_ind->data.us_tm;
- balIndCfg->terminal_ind->data->has_sub_term_rate = BAL_GRPC_PRES;
- balIndCfg->terminal_ind->data->sub_term_rate = sub_ind->data.sub_term_rate;
- char *password = malloc(sizeof(char)*MAX_CHAR_LENGTH*2);
- memset(password, 0, MAX_CHAR_LENGTH*2);
- strcpy(password,(const char *)sub_ind->data.password.arr);
- balIndCfg->terminal_ind->data->password = password;
- char *registration_id = malloc(sizeof(char)*MAX_CHAR_LENGTH*8);
- memset(registration_id, 0, MAX_CHAR_LENGTH*8);
- strcpy(registration_id,(const char *)sub_ind->data.registration_id.arr);
- balIndCfg->terminal_ind->data->registration_id = registration_id;
+ balIndCfg->terminal_dowi->data->has_dowi_status = BAL_GRPC_PRES;
+ balIndCfg->terminal_dowi->data->dowi_status = sub_dowi_ind->data.dowi_status;
-#if 0
- balIndCfg->terminal_ind->data->has_mac_address = BAL_GRPC_PRES;
- balIndCfg->terminal_ind->data->mac_address.len =
- (BCMOS_ETH_ALEN)*sizeof(sub_ind->data.mac_address.u8);
- uint8_t mac_address[balIndCfg->terminal_ind->data->mac_address.len];
- memset(&mac_address, 0 ,balIndCfg->terminal_ind->data->mac_address.len);
- strcpy((char *)mac_address,(const char *)sub_ind->data.mac_address.u8);
- balIndCfg->terminal_ind->data->mac_address.data = mac_address;
-#endif
+ balIndCfg->terminal_dowi->data->has_drift_value = BAL_GRPC_PRES;
+ balIndCfg->terminal_dowi->data->drift_value = sub_dowi_ind->data.drift_value;
- BalSerialNumber *serialNum;
- serialNum = malloc(sizeof(BalSerialNumber));
- memset(serialNum, 0, sizeof(BalSerialNumber));
- bal_serial_number__init(serialNum);
- balIndCfg->terminal_ind->data->serial_number = serialNum;
-
- //ASFVOLT_LOG(ASFVOLT_ERROR, "ONU Activation:Before decoding:Vendor id is %s", sub_ind->data.serial_number.vendor_id);
- //ASFVOLT_LOG(ASFVOLT_ERROR, "ONU Activation:Before decoding:Vendor specific is %s", sub_ind->data.serial_number.vendor_specific);
-
- char *vendor_id = malloc(sizeof(char)*MAX_CHAR_LENGTH);
- memset(vendor_id, 0, MAX_CHAR_LENGTH);
- sprintf(vendor_id,"%c%c%c%c",
- sub_ind->data.serial_number.vendor_id[0],
- sub_ind->data.serial_number.vendor_id[1],
- sub_ind->data.serial_number.vendor_id[2],
- sub_ind->data.serial_number.vendor_id[3]);
- balIndCfg->terminal_ind->data->serial_number->vendor_id = vendor_id;
- ASFVOLT_LOG(ASFVOLT_DEBUG, "ONU Activation:After decoding:Vendor id is %s",
- balIndCfg->terminal_ind->data->serial_number->vendor_id);
- char *vendor_specific = malloc(sizeof(char)*MAX_CHAR_LENGTH);
- memset(vendor_specific, 0, MAX_CHAR_LENGTH);
- sprintf(vendor_specific,"%1X%1X%1X%1X%1X%1X%1X%1X",
- sub_ind->data.serial_number.vendor_specific[0]>>4 & 0x0f,
- sub_ind->data.serial_number.vendor_specific[0] & 0x0f,
- sub_ind->data.serial_number.vendor_specific[1]>>4 & 0x0f,
- sub_ind->data.serial_number.vendor_specific[1] & 0x0f,
- sub_ind->data.serial_number.vendor_specific[2]>>4 & 0x0f,
- sub_ind->data.serial_number.vendor_specific[2] & 0x0f,
- sub_ind->data.serial_number.vendor_specific[3]>>4 & 0x0f,
- sub_ind->data.serial_number.vendor_specific[3] & 0x0f);
- balIndCfg->terminal_ind->data->serial_number->vendor_specific = vendor_specific;
- ASFVOLT_LOG(ASFVOLT_DEBUG, "ONU Activation:After decoding:Vendor specific is %s",
- balIndCfg->terminal_ind->data->serial_number->vendor_specific);
- ASFVOLT_LOG(ASFVOLT_DEBUG, "ONU Activation:After decoding:Registration ID is %s",
- balIndCfg->terminal_ind->data->registration_id);
-
- BalIdList *balAggportList;
- balAggportList = malloc(sizeof(BalIdList));
- memset(balAggportList, 0, sizeof(BalIdList));
- bal_id_list__init(balAggportList);
- balIndCfg->terminal_ind->data->agg_port_id_list = balAggportList;
-
-#if 0
- balIndCfg->terminal_ind->data->agg_port_id_list->n_val = sub_ind->data.agg_port_id_list.len;
- uint32_t agg_port_id_list[balIndCfg->terminal_ind->data->agg_port_id_list->n_val];
- memset(&agg_port_id_list, 0, balIndCfg->terminal_ind->data->agg_port_id_list->n_val);
- strcpy((char *)agg_port_id_list,(const char *)sub_ind->data.agg_port_id_list.val);
- balIndCfg->terminal_ind->data->agg_port_id_list->val = agg_port_id_list;
-#endif
+ balIndCfg->terminal_dowi->data->has_new_eqd = BAL_GRPC_PRES;
+ balIndCfg->terminal_dowi->data->new_eqd = sub_dowi_ind->data.new_eqd;
list_node *bal_indication_node = malloc(sizeof(list_node));
bal_indication_node->bal_indication = balIndCfg;
@@ -1406,39 +882,20 @@
add_bal_indication_node(bal_indication_node);
pthread_mutex_unlock(&bal_ind_queue_lock);
}
-
return result;
}
/********************************************************************\
- * Function : fill_bal_tm_red *
- * Description : This function will fill grpc-BalTmred struture *
- * from bal-bcmbal_tm_red structure *
+ * Function : bal_sub_term_looci_indication_cb *
+ * Description : This function will handle looci indication *
* *
********************************************************************/
-void fill_bal_tm_red(BalTmred *grpc_red, bcmbal_tm_red *bal_red)
+bcmos_errno bal_sub_term_looci_indication_cb(bcmbal_obj *obj)
{
- grpc_red->has_min_threshold = BAL_GRPC_PRES;
- grpc_red->min_threshold = bal_red->min_threshold;
- grpc_red->has_max_threshold = BAL_GRPC_PRES;
- grpc_red->max_threshold = bal_red->max_threshold;
- grpc_red->has_max_probability = BAL_GRPC_PRES;
- grpc_red->max_probability = bal_red->max_probability;
- return;
-}
+bcmos_errno result = BCM_ERR_OK;
-/********************************************************************\
- * Function : bal_tm_queue_indication_cb *
- * Description : This function will handle the indications for *
- * TM Queue indication *
- * *
- ********************************************************************/
-bcmos_errno bal_tm_queue_indication_cb(bcmbal_obj *obj)
-{
- bcmos_errno result = BCM_ERR_OK;
-
- if(BCMBAL_OBJ_ID_TM_QUEUE != obj->obj_type ||
- bcmbal_tm_queue_auto_id_ind != obj->subgroup)
+ if(BCMBAL_OBJ_ID_SUBSCRIBER_TERMINAL != obj->obj_type ||
+ bcmbal_subscriber_terminal_auto_id_looci != obj->subgroup)
{
ASFVOLT_LOG(ASFVOLT_ERROR, "Processing BAL API '%s' IND callback (status is %s)",
bcmbal_objtype_str(obj->obj_type), bcmos_strerror(obj->status));
@@ -1450,148 +907,390 @@
balIndCfg = malloc(sizeof(BalIndications));
memset(balIndCfg, 0, sizeof(BalIndications));
bal_indications__init(balIndCfg);
- balIndCfg->u_case = BAL_INDICATIONS__U_TM_QUEUE__IND;
+ balIndCfg->u_case = BAL_INDICATIONS__U_TERMINAL_LOOCI;
balIndCfg->has_objtype = BAL_GRPC_PRES;
balIndCfg->objtype = obj->obj_type;
balIndCfg->has_sub_group = BAL_GRPC_PRES;
balIndCfg->sub_group = obj->subgroup;
balIndCfg->device_id = voltha_device_id;
- bcmbal_tm_queue_ind *tm_que_ind = (bcmbal_tm_queue_ind *)obj;
+ bcmbal_subscriber_terminal_looci *sub_looci_ind =
+ (bcmbal_subscriber_terminal_looci *)obj;
- BalTmQueueInd *tmQueInd;
- tmQueInd = malloc(sizeof(BalTmQueueInd));
- memset(tmQueInd, 0, sizeof(BalTmQueueInd));
- bal_tm_queue_ind__init(tmQueInd);
- balIndCfg->tm_queue_ind = tmQueInd;
+ BalSubscriberTerminalLooci *subLoociInd;
+ subLoociInd = malloc(sizeof(BalSubscriberTerminalLooci));
+ memset(subLoociInd, 0, sizeof(BalSubscriberTerminalLooci));
+ bal_subscriber_terminal_looci__init(subLoociInd);
+ balIndCfg->terminal_looci= subLoociInd;
- BalTmQueueKey *tmQkey;
- tmQkey = malloc(sizeof(BalTmQueueKey));
- memset(tmQkey, 0, sizeof(BalTmQueueKey));
- bal_tm_queue_key__init(tmQkey);
- balIndCfg->tm_queue_ind->key = tmQkey;
+ /*'hdr' field is not parsed by voltha adapter, hence not filled */
- balIndCfg->tm_queue_ind->key->has_sched_id = BAL_GRPC_PRES;
- balIndCfg->tm_queue_ind->key->sched_id = tm_que_ind->key.sched_id;
- balIndCfg->tm_queue_ind->key->has_sched_dir = BAL_GRPC_PRES;
- balIndCfg->tm_queue_ind->key->sched_dir = tm_que_ind->key.sched_dir;
- balIndCfg->tm_queue_ind->key->has_id = BAL_GRPC_PRES;
- balIndCfg->tm_queue_ind->key->id = tm_que_ind->key.id;
+ BalSubscriberTerminalKey *subkey;
+ subkey = malloc(sizeof(BalSubscriberTerminalKey));
+ memset(subkey, 0, sizeof(BalSubscriberTerminalKey));
+ bal_subscriber_terminal_key__init(subkey);
+ balIndCfg->terminal_looci->key = subkey;
- BalTmQueueIndData *tmQIndData;
- tmQIndData = malloc(sizeof(BalTmQueueIndData));
- memset(tmQIndData, 0, sizeof(BalTmQueueIndData));
- bal_tm_queue_ind_data__init(tmQIndData);
- balIndCfg->tm_queue_ind->data = tmQIndData;
+ balIndCfg->terminal_looci->key->has_intf_id = BAL_GRPC_PRES;
+ balIndCfg->terminal_looci->key->intf_id = sub_looci_ind->key.intf_id;
+ balIndCfg->terminal_looci->key->has_sub_term_id = BAL_GRPC_PRES;
+ balIndCfg->terminal_looci->key->sub_term_id = sub_looci_ind->key.sub_term_id;
- balIndCfg->tm_queue_ind->data->has_priority = BAL_GRPC_PRES;
- balIndCfg->tm_queue_ind->data->priority = tm_que_ind->data.priority;
- balIndCfg->tm_queue_ind->data->has_weight = BAL_GRPC_PRES;
- balIndCfg->tm_queue_ind->data->weight = tm_que_ind->data.weight;
- balIndCfg->tm_queue_ind->data->has_create_mode = BAL_GRPC_PRES;
- balIndCfg->tm_queue_ind->data->create_mode = tm_que_ind->data.create_mode;
- balIndCfg->tm_queue_ind->data->has_ref_count = BAL_GRPC_PRES;
- balIndCfg->tm_queue_ind->data->ref_count = tm_que_ind->data.ref_count;
+ BalSubscriberTerminalLoociData *subLoociIndData;
+ subLoociIndData = malloc(sizeof(BalSubscriberTerminalLoociData));
+ memset(subLoociIndData, 0, sizeof(BalSubscriberTerminalLoociData));
+ bal_subscriber_terminal_looci_data__init(subLoociIndData);
+ balIndCfg->terminal_looci->data = subLoociIndData;
- BalTmShaping *balShape;
- balShape = malloc(sizeof(BalTmShaping));
- memset(balShape, 0, sizeof(BalTmShaping));
- bal_tm_shaping__init(balShape);
- balIndCfg->tm_queue_ind->data->rate = balShape;
+ balIndCfg->terminal_looci->data->has_looci_status = BAL_GRPC_PRES;
+ balIndCfg->terminal_looci->data->looci_status = sub_looci_ind->data.looci_status;
- balIndCfg->tm_queue_ind->data->rate->has_presence_mask = BAL_GRPC_PRES;
- balIndCfg->tm_queue_ind->data->rate->presence_mask = tm_que_ind->data.rate.presence_mask;
- balIndCfg->tm_queue_ind->data->rate->has_cir = BAL_GRPC_PRES;
- balIndCfg->tm_queue_ind->data->rate->cir = tm_que_ind->data.rate.cir;
- balIndCfg->tm_queue_ind->data->rate->has_pir = BAL_GRPC_PRES;
- balIndCfg->tm_queue_ind->data->rate->pir = tm_que_ind->data.rate.pir;
- balIndCfg->tm_queue_ind->data->rate->has_burst = BAL_GRPC_PRES;
- balIndCfg->tm_queue_ind->data->rate->burst = tm_que_ind->data.rate.burst;
+ list_node *bal_indication_node = malloc(sizeof(list_node));
+ bal_indication_node->bal_indication = balIndCfg;
- BalTmBac *balBac;
- balBac = malloc(sizeof(BalTmBac));
- memset(balBac, 0, sizeof(BalTmBac));
- bal_tm_bac__init(balBac);
- balIndCfg->tm_queue_ind->data->bac = balBac;
+ pthread_mutex_lock(&bal_ind_queue_lock);
+ add_bal_indication_node(bal_indication_node);
+ pthread_mutex_unlock(&bal_ind_queue_lock);
+ }
+ return result;
+}
- balIndCfg->tm_queue_ind->data->bac->has_type = BAL_GRPC_PRES;
- balIndCfg->tm_queue_ind->data->bac->type = tm_que_ind->data.bac.type;
- switch(tm_que_ind->data.bac.type)
- {
- case BCMBAL_TM_BAC_TYPE_TAILDROP:
- {
- balIndCfg->tm_queue_ind->data->bac->u_case = BAL_TM_BAC__U_TAILDROP;
- BalTMBacTaildrop *balTaildrop;
- balTaildrop = malloc(sizeof(BalTMBacTaildrop));
- memset(balTaildrop, 0, sizeof(BalTMBacTaildrop));
- bal_tmbac_taildrop__init(balTaildrop);
- balIndCfg->tm_queue_ind->data->bac->taildrop = balTaildrop;
+/********************************************************************\
+ * Function : bal_sub_term_processing_error_indication_cb *
+ * Description : This function will handle sub term processing error*
+ * *
+ ********************************************************************/
+bcmos_errno bal_sub_term_processing_error_indication_cb(bcmbal_obj *obj)
+{
+bcmos_errno result = BCM_ERR_OK;
- balIndCfg->tm_queue_ind->data->bac->taildrop->has_max_size = BAL_GRPC_PRES;
- balIndCfg->tm_queue_ind->data->bac->taildrop->max_size =
- tm_que_ind->data.bac.u.taildrop.max_size;
- }
- break;
- case BCMBAL_TM_BAC_TYPE_WTAILDROP:
- {
- /* No bal/grpc structure was defined */
- }
- break;
- case BCMBAL_TM_BAC_TYPE_RED:
- {
- balIndCfg->tm_queue_ind->data->bac->u_case = BAL_TM_BAC__U_RED;
- BalTMBacRed *balBacRed;
- balBacRed = malloc(sizeof(BalTMBacRed));
- memset(balBacRed, 0, sizeof(BalTMBacRed));
- bal_tmbac_red__init(balBacRed);
- balIndCfg->tm_queue_ind->data->bac->red = balBacRed;
+ if(BCMBAL_OBJ_ID_SUBSCRIBER_TERMINAL != obj->obj_type ||
+ bcmbal_subscriber_terminal_auto_id_processing_error != obj->subgroup)
+ {
+ ASFVOLT_LOG(ASFVOLT_ERROR, "Processing BAL API '%s' IND callback (status is %s)",
+ bcmbal_objtype_str(obj->obj_type), bcmos_strerror(obj->status));
+ result = BCM_ERR_INTERNAL;
+ }
+ else
+ {
+ BalIndications *balIndCfg;
+ balIndCfg = malloc(sizeof(BalIndications));
+ memset(balIndCfg, 0, sizeof(BalIndications));
+ bal_indications__init(balIndCfg);
+ balIndCfg->u_case = BAL_INDICATIONS__U_TERMINAL_PROC_ERR;
+ balIndCfg->has_objtype = BAL_GRPC_PRES;
+ balIndCfg->objtype = obj->obj_type;
+ balIndCfg->has_sub_group = BAL_GRPC_PRES;
+ balIndCfg->sub_group = obj->subgroup;
+ balIndCfg->device_id = voltha_device_id;
- BalTmred *balRed;
- balRed = malloc(sizeof(BalTmred));
- memset(balRed, 0, sizeof(BalTmred));
- bal_tmred__init(balRed);
- balIndCfg->tm_queue_ind->data->bac->red->red = balRed;
- fill_bal_tm_red(balIndCfg->tm_queue_ind->data->bac->red->red, &tm_que_ind->data.bac.u.red.red);
- }
- break;
- case BCMBAL_TM_BAC_TYPE_WRED:
- {
- balIndCfg->tm_queue_ind->data->bac->u_case = BAL_TM_BAC__U_WRED;
- BalTMBacWred *balBacWred;
- balBacWred = malloc(sizeof(BalTMBacWred));
- memset(balBacWred, 0, sizeof(BalTMBacWred));
- bal_tmbac_wred__init(balBacWred);
- balIndCfg->tm_queue_ind->data->bac->wred = balBacWred;
+ bcmbal_subscriber_terminal_processing_error *sub_proc_err_ind =
+ (bcmbal_subscriber_terminal_processing_error *)obj;
- BalTmred *balGreen;
- balGreen = malloc(sizeof(BalTmred));
- memset(balGreen, 0, sizeof(BalTmred));
- bal_tmred__init(balGreen);
- balIndCfg->tm_queue_ind->data->bac->wred->green = balGreen;
- fill_bal_tm_red(balIndCfg->tm_queue_ind->data->bac->wred->green, &tm_que_ind->data.bac.u.wred.green);
+ BalSubscriberTerminalProcessingError *subProcErrInd;
+ subProcErrInd = malloc(sizeof(BalSubscriberTerminalProcessingError));
+ memset(subProcErrInd, 0, sizeof(BalSubscriberTerminalProcessingError));
+ bal_subscriber_terminal_processing_error__init(subProcErrInd);
+ balIndCfg->terminal_proc_err= subProcErrInd;
- BalTmred *balYellow;
- balYellow = malloc(sizeof(BalTmred));
- memset(balYellow, 0, sizeof(BalTmred));
- bal_tmred__init(balYellow);
- balIndCfg->tm_queue_ind->data->bac->wred->yellow = balYellow;
- fill_bal_tm_red(balIndCfg->tm_queue_ind->data->bac->wred->yellow, &tm_que_ind->data.bac.u.wred.yellow);
+ /*'hdr' field is not parsed by voltha adapter, hence not filled */
- BalTmred *balRed;
- balRed = malloc(sizeof(BalTmred));
- memset(balRed, 0, sizeof(BalTmred));
- bal_tmred__init(balRed);
- balIndCfg->tm_queue_ind->data->bac->wred->red = balRed;
- fill_bal_tm_red(balIndCfg->tm_queue_ind->data->bac->wred->red, &tm_que_ind->data.bac.u.wred.red);
- }
- break;
- default:
- {
- balIndCfg->tm_queue_ind->data->bac->u_case = BAL_TM_BAC__U__NOT_SET;
- }
- break;
+ BalSubscriberTerminalKey *subkey;
+ subkey = malloc(sizeof(BalSubscriberTerminalKey));
+ memset(subkey, 0, sizeof(BalSubscriberTerminalKey));
+ bal_subscriber_terminal_key__init(subkey);
+ balIndCfg->terminal_proc_err->key = subkey;
- }
+ balIndCfg->terminal_proc_err->key->has_intf_id = BAL_GRPC_PRES;
+ balIndCfg->terminal_proc_err->key->intf_id = sub_proc_err_ind->key.intf_id;
+ balIndCfg->terminal_proc_err->key->has_sub_term_id = BAL_GRPC_PRES;
+ balIndCfg->terminal_proc_err->key->sub_term_id = sub_proc_err_ind->key.sub_term_id;
+
+ list_node *bal_indication_node = malloc(sizeof(list_node));
+ bal_indication_node->bal_indication = balIndCfg;
+
+ pthread_mutex_lock(&bal_ind_queue_lock);
+ add_bal_indication_node(bal_indication_node);
+ pthread_mutex_unlock(&bal_ind_queue_lock);
+ }
+ return result;
+}
+
+/********************************************************************\
+ * Function : bal_sub_term_sdi_indication_cb *
+ * Description : This function will handle sdi indication *
+ * *
+ ********************************************************************/
+bcmos_errno bal_sub_term_sdi_indication_cb(bcmbal_obj *obj)
+{
+bcmos_errno result = BCM_ERR_OK;
+
+ if(BCMBAL_OBJ_ID_SUBSCRIBER_TERMINAL != obj->obj_type ||
+ bcmbal_subscriber_terminal_auto_id_sdi != obj->subgroup)
+ {
+ ASFVOLT_LOG(ASFVOLT_ERROR, "Processing BAL API '%s' IND callback (status is %s)",
+ bcmbal_objtype_str(obj->obj_type), bcmos_strerror(obj->status));
+ result = BCM_ERR_INTERNAL;
+ }
+ else
+ {
+ BalIndications *balIndCfg;
+ balIndCfg = malloc(sizeof(BalIndications));
+ memset(balIndCfg, 0, sizeof(BalIndications));
+ bal_indications__init(balIndCfg);
+ balIndCfg->u_case = BAL_INDICATIONS__U_TERMINAL_SDI;
+ balIndCfg->has_objtype = BAL_GRPC_PRES;
+ balIndCfg->objtype = obj->obj_type;
+ balIndCfg->has_sub_group = BAL_GRPC_PRES;
+ balIndCfg->sub_group = obj->subgroup;
+ balIndCfg->device_id = voltha_device_id;
+
+ bcmbal_subscriber_terminal_sdi *sub_sdi_ind =
+ (bcmbal_subscriber_terminal_sdi *)obj;
+
+ BalSubscriberTerminalSdi *subSdiInd;
+ subSdiInd = malloc(sizeof(BalSubscriberTerminalSdi));
+ memset(subSdiInd, 0, sizeof(BalSubscriberTerminalSdi));
+ bal_subscriber_terminal_sdi__init(subSdiInd);
+ balIndCfg->terminal_sdi= subSdiInd;
+
+ /*'hdr' field is not parsed by voltha adapter, hence not filled */
+
+ BalSubscriberTerminalKey *subkey;
+ subkey = malloc(sizeof(BalSubscriberTerminalKey));
+ memset(subkey, 0, sizeof(BalSubscriberTerminalKey));
+ bal_subscriber_terminal_key__init(subkey);
+ balIndCfg->terminal_sdi->key = subkey;
+
+ balIndCfg->terminal_sdi->key->has_intf_id = BAL_GRPC_PRES;
+ balIndCfg->terminal_sdi->key->intf_id = sub_sdi_ind->key.intf_id;
+ balIndCfg->terminal_sdi->key->has_sub_term_id = BAL_GRPC_PRES;
+ balIndCfg->terminal_sdi->key->sub_term_id = sub_sdi_ind->key.sub_term_id;
+
+ BalSubscriberTerminalSdiData *subSdiIndData;
+ subSdiIndData = malloc(sizeof(BalSubscriberTerminalSdiData));
+ memset(subSdiIndData, 0, sizeof(BalSubscriberTerminalSdiData));
+ bal_subscriber_terminal_sdi_data__init(subSdiIndData);
+ balIndCfg->terminal_sdi->data = subSdiIndData;
+
+ balIndCfg->terminal_sdi->data->has_sdi_status = BAL_GRPC_PRES;
+ balIndCfg->terminal_sdi->data->sdi_status = sub_sdi_ind->data.sdi_status;
+
+ balIndCfg->terminal_sdi->data->has_ber = BAL_GRPC_PRES;
+ balIndCfg->terminal_sdi->data->ber = sub_sdi_ind->data.ber;
+
+ list_node *bal_indication_node = malloc(sizeof(list_node));
+ bal_indication_node->bal_indication = balIndCfg;
+
+ pthread_mutex_lock(&bal_ind_queue_lock);
+ add_bal_indication_node(bal_indication_node);
+ pthread_mutex_unlock(&bal_ind_queue_lock);
+ }
+ return result;
+}
+
+/********************************************************************\
+ * Function : bal_sub_term_sfi_indication_cb *
+ * Description : This function will handle sfi indication *
+ * *
+ ********************************************************************/
+bcmos_errno bal_sub_term_sfi_indication_cb(bcmbal_obj *obj)
+{
+bcmos_errno result = BCM_ERR_OK;
+
+ if(BCMBAL_OBJ_ID_SUBSCRIBER_TERMINAL != obj->obj_type ||
+ bcmbal_subscriber_terminal_auto_id_sfi != obj->subgroup)
+ {
+ ASFVOLT_LOG(ASFVOLT_ERROR, "Processing BAL API '%s' IND callback (status is %s)",
+ bcmbal_objtype_str(obj->obj_type), bcmos_strerror(obj->status));
+ result = BCM_ERR_INTERNAL;
+ }
+ else
+ {
+ BalIndications *balIndCfg;
+ balIndCfg = malloc(sizeof(BalIndications));
+ memset(balIndCfg, 0, sizeof(BalIndications));
+ bal_indications__init(balIndCfg);
+ balIndCfg->u_case = BAL_INDICATIONS__U_TERMINAL_SFI;
+ balIndCfg->has_objtype = BAL_GRPC_PRES;
+ balIndCfg->objtype = obj->obj_type;
+ balIndCfg->has_sub_group = BAL_GRPC_PRES;
+ balIndCfg->sub_group = obj->subgroup;
+ balIndCfg->device_id = voltha_device_id;
+
+ bcmbal_subscriber_terminal_sfi *sub_sfi_ind =
+ (bcmbal_subscriber_terminal_sfi *)obj;
+
+ BalSubscriberTerminalSfi *subSfiInd;
+ subSfiInd = malloc(sizeof(BalSubscriberTerminalSfi));
+ memset(subSfiInd, 0, sizeof(BalSubscriberTerminalSfi));
+ bal_subscriber_terminal_sfi__init(subSfiInd);
+ balIndCfg->terminal_sfi= subSfiInd;
+
+ /*'hdr' field is not parsed by voltha adapter, hence not filled */
+
+ BalSubscriberTerminalKey *subkey;
+ subkey = malloc(sizeof(BalSubscriberTerminalKey));
+ memset(subkey, 0, sizeof(BalSubscriberTerminalKey));
+ bal_subscriber_terminal_key__init(subkey);
+ balIndCfg->terminal_sfi->key = subkey;
+
+ balIndCfg->terminal_sfi->key->has_intf_id = BAL_GRPC_PRES;
+ balIndCfg->terminal_sfi->key->intf_id = sub_sfi_ind->key.intf_id;
+ balIndCfg->terminal_sfi->key->has_sub_term_id = BAL_GRPC_PRES;
+ balIndCfg->terminal_sfi->key->sub_term_id = sub_sfi_ind->key.sub_term_id;
+
+ BalSubscriberTerminalSfiData *subSfiIndData;
+ subSfiIndData = malloc(sizeof(BalSubscriberTerminalSfiData));
+ memset(subSfiIndData, 0, sizeof(BalSubscriberTerminalSfiData));
+ bal_subscriber_terminal_sfi_data__init(subSfiIndData);
+ balIndCfg->terminal_sfi->data = subSfiIndData;
+
+ balIndCfg->terminal_sfi->data->has_sfi_status = BAL_GRPC_PRES;
+ balIndCfg->terminal_sfi->data->sfi_status = sub_sfi_ind->data.sfi_status;
+
+ balIndCfg->terminal_sfi->data->has_ber = BAL_GRPC_PRES;
+ balIndCfg->terminal_sfi->data->ber = sub_sfi_ind->data.ber;
+
+ list_node *bal_indication_node = malloc(sizeof(list_node));
+ bal_indication_node->bal_indication = balIndCfg;
+
+ pthread_mutex_lock(&bal_ind_queue_lock);
+ add_bal_indication_node(bal_indication_node);
+ pthread_mutex_unlock(&bal_ind_queue_lock);
+ }
+ return result;
+}
+
+/********************************************************************\
+ * Function : bal_sub_term_act_fail_indication_cb *
+ * Description : This function will handle sub term activation fail *
+ * indication *
+ * *
+ ********************************************************************/
+bcmos_errno bal_sub_term_act_fail_indication_cb(bcmbal_obj *obj)
+{
+bcmos_errno result = BCM_ERR_OK;
+
+ if(BCMBAL_OBJ_ID_SUBSCRIBER_TERMINAL != obj->obj_type ||
+ bcmbal_subscriber_terminal_auto_id_sub_term_act_fail != obj->subgroup)
+ {
+ ASFVOLT_LOG(ASFVOLT_ERROR, "Processing BAL API '%s' IND callback (status is %s)",
+ bcmbal_objtype_str(obj->obj_type), bcmos_strerror(obj->status));
+ result = BCM_ERR_INTERNAL;
+ }
+ else
+ {
+ BalIndications *balIndCfg;
+ balIndCfg = malloc(sizeof(BalIndications));
+ memset(balIndCfg, 0, sizeof(BalIndications));
+ bal_indications__init(balIndCfg);
+ balIndCfg->u_case = BAL_INDICATIONS__U_TERMINAL_SUB_TERM_ACT_FAIL;
+ balIndCfg->has_objtype = BAL_GRPC_PRES;
+ balIndCfg->objtype = obj->obj_type;
+ balIndCfg->has_sub_group = BAL_GRPC_PRES;
+ balIndCfg->sub_group = obj->subgroup;
+ balIndCfg->device_id = voltha_device_id;
+
+ bcmbal_subscriber_terminal_sub_term_act_fail *sub_term_act_fail_ind =
+ (bcmbal_subscriber_terminal_sub_term_act_fail *)obj;
+
+ BalSubscriberTerminalSubTermActFail *subTermActFailInd;
+ subTermActFailInd = malloc(sizeof(BalSubscriberTerminalSubTermActFail));
+ memset(subTermActFailInd, 0, sizeof(BalSubscriberTerminalSubTermActFail));
+ bal_subscriber_terminal_sub_term_act_fail__init(subTermActFailInd);
+ balIndCfg->terminal_sub_term_act_fail= subTermActFailInd;
+
+ /*'hdr' field is not parsed by voltha adapter, hence not filled */
+
+ BalSubscriberTerminalKey *subkey;
+ subkey = malloc(sizeof(BalSubscriberTerminalKey));
+ memset(subkey, 0, sizeof(BalSubscriberTerminalKey));
+ bal_subscriber_terminal_key__init(subkey);
+ balIndCfg->terminal_sub_term_act_fail->key = subkey;
+
+ balIndCfg->terminal_sub_term_act_fail->key->has_intf_id = BAL_GRPC_PRES;
+ balIndCfg->terminal_sub_term_act_fail->key->intf_id = sub_term_act_fail_ind->key.intf_id;
+ balIndCfg->terminal_sub_term_act_fail->key->has_sub_term_id = BAL_GRPC_PRES;
+ balIndCfg->terminal_sub_term_act_fail->key->sub_term_id = sub_term_act_fail_ind->key.sub_term_id;
+
+ BalSubscriberTerminalSubTermActFailData *subTermActFailIndData;
+ subTermActFailIndData = malloc(sizeof(BalSubscriberTerminalSubTermActFailData));
+ memset(subTermActFailIndData, 0, sizeof(BalSubscriberTerminalSubTermActFailData));
+ bal_subscriber_terminal_sub_term_act_fail_data__init(subTermActFailIndData);
+ balIndCfg->terminal_sub_term_act_fail->data = subTermActFailIndData;
+
+ balIndCfg->terminal_sub_term_act_fail->data->has_fail_reason = BAL_GRPC_PRES;
+ balIndCfg->terminal_sub_term_act_fail->data->fail_reason = sub_term_act_fail_ind->data.fail_reason;
+
+ list_node *bal_indication_node = malloc(sizeof(list_node));
+ bal_indication_node->bal_indication = balIndCfg;
+
+ pthread_mutex_lock(&bal_ind_queue_lock);
+ add_bal_indication_node(bal_indication_node);
+ pthread_mutex_unlock(&bal_ind_queue_lock);
+ }
+ return result;
+}
+
+/********************************************************************\
+ * Function : bal_sub_term_sufi_indication_cb *
+ * Description : This function will handle sufi indication *
+ * *
+ ********************************************************************/
+bcmos_errno bal_sub_term_sufi_indication_cb(bcmbal_obj *obj)
+{
+ bcmos_errno result = BCM_ERR_OK;
+ if(BCMBAL_OBJ_ID_SUBSCRIBER_TERMINAL != obj->obj_type ||
+ bcmbal_subscriber_terminal_auto_id_sufi != obj->subgroup)
+ {
+ ASFVOLT_LOG(ASFVOLT_ERROR, "Processing BAL API '%s' IND callback (status is %s)",
+ bcmbal_objtype_str(obj->obj_type), bcmos_strerror(obj->status));
+ result = BCM_ERR_INTERNAL;
+ }
+ else
+ {
+ BalIndications *balIndCfg;
+ balIndCfg = malloc(sizeof(BalIndications));
+ memset(balIndCfg, 0, sizeof(BalIndications));
+ bal_indications__init(balIndCfg);
+ balIndCfg->u_case = BAL_INDICATIONS__U_TERMINAL_SUFI;
+ balIndCfg->has_objtype = BAL_GRPC_PRES;
+ balIndCfg->objtype = obj->obj_type;
+ balIndCfg->has_sub_group = BAL_GRPC_PRES;
+ balIndCfg->sub_group = obj->subgroup;
+ balIndCfg->device_id = voltha_device_id;
+
+ bcmbal_subscriber_terminal_sufi *sub_sufi_ind =
+ (bcmbal_subscriber_terminal_sufi *)obj;
+
+ BalSubscriberTerminalSufi *subSufiInd;
+ subSufiInd = malloc(sizeof(BalSubscriberTerminalSufi));
+ memset(subSufiInd, 0, sizeof(BalSubscriberTerminalSufi));
+ bal_subscriber_terminal_sufi__init(subSufiInd);
+ balIndCfg->terminal_sufi= subSufiInd;
+
+ /*'hdr' field is not parsed by voltha adapter, hence not filled */
+
+ BalSubscriberTerminalKey *subkey;
+ subkey = malloc(sizeof(BalSubscriberTerminalKey));
+ memset(subkey, 0, sizeof(BalSubscriberTerminalKey));
+ bal_subscriber_terminal_key__init(subkey);
+ balIndCfg->terminal_sufi->key = subkey;
+
+ balIndCfg->terminal_sufi->key->has_intf_id = BAL_GRPC_PRES;
+ balIndCfg->terminal_sufi->key->intf_id = sub_sufi_ind->key.intf_id;
+ balIndCfg->terminal_sufi->key->has_sub_term_id = BAL_GRPC_PRES;
+ balIndCfg->terminal_sufi->key->sub_term_id = sub_sufi_ind->key.sub_term_id;
+
+ BalSubscriberTerminalSufiData *subSufiIndData;
+ subSufiIndData = malloc(sizeof(BalSubscriberTerminalSufiData));
+ memset(subSufiIndData, 0, sizeof(BalSubscriberTerminalSufiData));
+ bal_subscriber_terminal_sufi_data__init(subSufiIndData);
+ balIndCfg->terminal_sufi->data = subSufiIndData;
+
+ balIndCfg->terminal_sufi->data->has_sufi_status = BAL_GRPC_PRES;
+ balIndCfg->terminal_sufi->data->sufi_status = sub_sufi_ind->data.sufi_status;
list_node *bal_indication_node = malloc(sizeof(list_node));
bal_indication_node->bal_indication = balIndCfg;
@@ -1605,17 +1304,90 @@
}
/********************************************************************\
- * Function : bal_tm_sched_indication_cb *
- * Description : This function will handle the indications for *
- * TM Sched indication *
+ * Function : bal_sub_term_tiwi_indication_cb *
+ * Description : This function will handle tiwi indication *
* *
********************************************************************/
-bcmos_errno bal_tm_sched_indication_cb(bcmbal_obj *obj)
+bcmos_errno bal_sub_term_tiwi_indication_cb(bcmbal_obj *obj)
+{
+ bcmos_errno result = BCM_ERR_OK;
+ if(BCMBAL_OBJ_ID_SUBSCRIBER_TERMINAL != obj->obj_type ||
+ BCMBAL_SUBSCRIBER_TERMINAL_AUTO_ID_TIWI != obj->subgroup)
+ {
+ ASFVOLT_LOG(ASFVOLT_ERROR, "Processing BAL API '%s' IND callback (status is %s)",
+ bcmbal_objtype_str(obj->obj_type), bcmos_strerror(obj->status));
+ result = BCM_ERR_INTERNAL;
+ }
+ else
+ {
+ BalIndications *balIndCfg;
+ balIndCfg = malloc(sizeof(BalIndications));
+ memset(balIndCfg, 0, sizeof(BalIndications));
+ bal_indications__init(balIndCfg);
+ balIndCfg->u_case = BAL_INDICATIONS__U_TERMINAL_TIWI;
+ balIndCfg->has_objtype = BAL_GRPC_PRES;
+ balIndCfg->objtype = obj->obj_type;
+ balIndCfg->has_sub_group = BAL_GRPC_PRES;
+ balIndCfg->sub_group = obj->subgroup;
+ balIndCfg->device_id = voltha_device_id;
+
+ bcmbal_subscriber_terminal_tiwi *sub_term_tiwi =
+ (bcmbal_subscriber_terminal_tiwi *)obj;
+
+ BalSubscriberTerminalTiwi *subTermTiwi;
+ subTermTiwi = malloc(sizeof(BalSubscriberTerminalTiwi));
+ memset(subTermTiwi, 0, sizeof(BalSubscriberTerminalTiwi));
+ bal_subscriber_terminal_tiwi__init(subTermTiwi);
+ balIndCfg->terminal_tiwi = subTermTiwi;
+
+ /*'hdr' field is not parsed by voltha adapter, hence not filled */
+
+ BalSubscriberTerminalKey *sub_term_key;
+ sub_term_key = malloc(sizeof(BalSubscriberTerminalKey));
+ memset(sub_term_key, 0, sizeof(BalSubscriberTerminalKey));
+ bal_subscriber_terminal_key__init(sub_term_key);
+ balIndCfg->terminal_tiwi->key = sub_term_key;
+
+ balIndCfg->terminal_tiwi->key->has_sub_term_id = BAL_GRPC_PRES;
+ balIndCfg->terminal_tiwi->key->sub_term_id = sub_term_tiwi->key.sub_term_id;
+ balIndCfg->terminal_tiwi->key->has_intf_id = BAL_GRPC_PRES;
+ balIndCfg->terminal_tiwi->key->intf_id = sub_term_tiwi->key.intf_id;
+
+ BalSubscriberTerminalTiwiData *sub_term_tiwi_data;
+ sub_term_tiwi_data = malloc(sizeof(BalSubscriberTerminalTiwiData));
+ memset(sub_term_tiwi_data, 0, sizeof(BalSubscriberTerminalTiwiData));
+ bal_subscriber_terminal_tiwi_data__init(sub_term_tiwi_data);
+ balIndCfg->terminal_tiwi->data = sub_term_tiwi_data;
+
+ balIndCfg->terminal_tiwi->data->has_tiwi_status = BAL_GRPC_PRES;
+ balIndCfg->terminal_tiwi->data->tiwi_status = sub_term_tiwi->data.tiwi_status;
+
+ balIndCfg->terminal_tiwi->data->has_drift_value = BAL_GRPC_PRES;
+ balIndCfg->terminal_tiwi->data->drift_value = sub_term_tiwi->data.drift_value;
+
+ list_node *bal_indication_node = malloc(sizeof(list_node));
+ bal_indication_node->bal_indication = balIndCfg;
+
+ pthread_mutex_lock(&bal_ind_queue_lock);
+ add_bal_indication_node(bal_indication_node);
+ pthread_mutex_unlock(&bal_ind_queue_lock);
+ }
+
+ return result;
+}
+
+/********************************************************************\
+ * Function : bal_tm_sched_auto_id_oper_status_change_cb *
+ * Description : This function will handle tm sched operation status*
+ * change indication *
+ * *
+ ********************************************************************/
+bcmos_errno bal_tm_sched_auto_id_oper_status_change_cb(bcmbal_obj *obj)
{
bcmos_errno result = BCM_ERR_OK;
if(BCMBAL_OBJ_ID_TM_SCHED != obj->obj_type ||
- bcmbal_tm_sched_auto_id_ind != obj->subgroup)
+ bcmbal_tm_sched_auto_id_oper_status_change != obj->subgroup)
{
ASFVOLT_LOG(ASFVOLT_ERROR, "Processing BAL API '%s' IND callback (status is %s)",
bcmbal_objtype_str(obj->obj_type), bcmos_strerror(obj->status));
@@ -1627,38 +1399,47 @@
balIndCfg = malloc(sizeof(BalIndications));
memset(balIndCfg, 0, sizeof(BalIndications));
bal_indications__init(balIndCfg);
- balIndCfg->u_case = BAL_INDICATIONS__U_TM_SCHED__IND;
+ balIndCfg->u_case = BAL_INDICATIONS__U_TM_SCHED_OPER_STATS_CHANGE;
balIndCfg->has_objtype = BAL_GRPC_PRES;
balIndCfg->objtype = obj->obj_type;
balIndCfg->has_sub_group = BAL_GRPC_PRES;
balIndCfg->sub_group = obj->subgroup;
balIndCfg->device_id = voltha_device_id;
- bcmbal_tm_sched_ind *tm_sched_ind = (bcmbal_tm_sched_ind *)obj;
+ bcmbal_tm_sched_oper_status_change *tm_sched_osc =
+ (bcmbal_tm_sched_oper_status_change *)obj;
- BalTmSchedInd *tmSchedInd;
- tmSchedInd = malloc(sizeof(BalTmSchedInd));
- memset(tmSchedInd, 0, sizeof(BalTmSchedInd));
- bal_tm_sched_ind__init(tmSchedInd);
- balIndCfg->tm_sched_ind = tmSchedInd;
+ BalTmSchedOperStatusChange *tmSchedOsc;
+ tmSchedOsc = malloc(sizeof(BalTmSchedOperStatusChange));
+ memset(tmSchedOsc, 0, sizeof(BalTmSchedOperStatusChange));
+ bal_tm_sched_oper_status_change__init(tmSchedOsc);
+ balIndCfg->tm_sched_oper_stats_change = tmSchedOsc;
- BalTmSchedKey *tmSchedkey;
- tmSchedkey = malloc(sizeof(BalTmSchedKey));
- memset(tmSchedkey, 0, sizeof(BalTmSchedKey));
- bal_tm_sched_key__init(tmSchedkey);
- balIndCfg->tm_sched_ind->key = tmSchedkey;
+ /*'hdr' field is not parsed by voltha adapter, hence not filled */
- balIndCfg->tm_sched_ind->key->has_dir = BAL_GRPC_PRES;
- balIndCfg->tm_sched_ind->key->dir = tm_sched_ind->key.dir;
- balIndCfg->tm_sched_ind->key->has_id = BAL_GRPC_PRES;
- balIndCfg->tm_sched_ind->key->id = tm_sched_ind->key.id;
+ BalTmSchedKey *tmSchedKey;
+ tmSchedKey = malloc(sizeof(BalTmSchedKey));
+ memset(tmSchedKey, 0, sizeof(BalTmSchedKey));
+ bal_tm_sched_key__init(tmSchedKey);
+ balIndCfg->tm_sched_oper_stats_change->key = tmSchedKey;
- BalTmSchedIndData *tmSIndData;
- tmSIndData = malloc(sizeof(BalTmSchedIndData));
- memset(tmSIndData, 0, sizeof(BalTmSchedIndData));
- bal_tm_sched_ind_data__init(tmSIndData);
- balIndCfg->tm_sched_ind->data = tmSIndData;
- /* TODO: data should be populate */
+ balIndCfg->tm_sched_oper_stats_change->key->has_dir = BAL_GRPC_PRES;
+ balIndCfg->tm_sched_oper_stats_change->key->dir = tm_sched_osc->key.dir;
+ balIndCfg->tm_sched_oper_stats_change->key->has_id = BAL_GRPC_PRES;
+ balIndCfg->tm_sched_oper_stats_change->key->id = tm_sched_osc->key.id;
+
+ BalTmSchedOperStatusChangeData *tmschedOscData;
+ tmschedOscData = malloc(sizeof(BalTmSchedOperStatusChangeData));
+ memset(tmschedOscData, 0, sizeof(BalTmSchedOperStatusChangeData));
+ bal_tm_sched_oper_status_change_data__init(tmschedOscData);
+ balIndCfg->tm_sched_oper_stats_change->data = tmschedOscData;
+
+ balIndCfg->tm_sched_oper_stats_change->data->has_new_oper_status = BAL_GRPC_PRES;
+ balIndCfg->tm_sched_oper_stats_change->data->new_oper_status =
+ tm_sched_osc->data.new_oper_status;
+ balIndCfg->tm_sched_oper_stats_change->data->has_old_oper_status = BAL_GRPC_PRES;
+ balIndCfg->tm_sched_oper_stats_change->data->old_oper_status =
+ tm_sched_osc->data.old_oper_status;
list_node *bal_indication_node = malloc(sizeof(list_node));
bal_indication_node->bal_indication = balIndCfg;
@@ -1709,11 +1490,7 @@
bal_packet_bearer_channel_rx__init(rxChannel);
balIndCfg->pktdata = rxChannel;
- BalObj *hdr;
- hdr = malloc(sizeof(BalObj));
- memset(hdr, 0, sizeof(BalObj));
- bal_obj__init(hdr);
- balIndCfg->pktdata->hdr = hdr;
+ /*'hdr' field is not parsed by voltha adapter, hence not filled */
BalPacketKey *packetkey;
packetkey = malloc(sizeof(BalPacketKey));
@@ -1763,10 +1540,6 @@
BAL_GRPC_PRES;
balIndCfg->pktdata->key->packet_send_dest->sub_term->sub_term_id =
rx_channel->key.packet_send_dest.u.sub_term.sub_term_id;
- balIndCfg->pktdata->key->packet_send_dest->sub_term->has_sub_term_uni =
- BAL_GRPC_PRES;
- balIndCfg->pktdata->key->packet_send_dest->sub_term->sub_term_uni =
- rx_channel->key.packet_send_dest.u.sub_term.sub_term_uni;
balIndCfg->pktdata->key->packet_send_dest->sub_term->has_intf_id =
BAL_GRPC_PRES;
balIndCfg->pktdata->key->packet_send_dest->sub_term->intf_id =
@@ -1871,11 +1644,7 @@
bal_packet_itu_omci_channel_rx__init(omciChannel);
balIndCfg->balomciresp = omciChannel;
- BalObj *hdr;
- hdr = malloc(sizeof(BalObj));
- memset(hdr, 0, sizeof(BalObj));
- bal_obj__init(hdr);
- balIndCfg->balomciresp->hdr = hdr;
+ /*'hdr' field is not parsed by voltha adapter, hence not filled */
BalPacketKey *packetkey;
packetkey = malloc(sizeof(BalPacketKey));
@@ -1992,11 +1761,7 @@
bal_packet_ieee_oam_channel_rx__init(oamChannel);
balIndCfg->baloamresp = oamChannel;
- BalObj *hdr;
- hdr = malloc(sizeof(BalObj));
- memset(hdr, 0, sizeof(BalObj));
- bal_obj__init(hdr);
- balIndCfg->baloamresp->hdr = hdr;
+ /*'hdr' field is not parsed by voltha adapter, hence not filled */
BalPacketKey *packetkey;
packetkey = malloc(sizeof(BalPacketKey));
diff --git a/src/bal_indications_hdlr.h b/src/bal_indications_hdlr.h
index 84b8e27..563fff9 100755
--- a/src/bal_indications_hdlr.h
+++ b/src/bal_indications_hdlr.h
@@ -36,20 +36,24 @@
extern bcmos_errno bal_indication_cb(bcmbal_obj *obj);
extern bcmos_errno bal_acc_term_osc_indication_cb(bcmbal_obj *obj);
-extern bcmos_errno bal_acc_term_indication_cb(bcmbal_obj *obj);
+extern bcmos_errno bal_acc_term_processing_error_indication_cb(bcmbal_obj *obj);
extern bcmos_errno bal_flow_osc_indication_cb(bcmbal_obj *obj);
-extern bcmos_errno bal_flow_indication_cb(bcmbal_obj *obj);
-extern bcmos_errno bal_group_indication_cb(bcmbal_obj *obj);
+extern bcmos_errno bal_flow_processing_error_indication_cb(bcmbal_obj *obj);
extern bcmos_errno bal_interface_osc_indication_cb(bcmbal_obj *obj);
extern bcmos_errno bal_interface_los_indication_cb(bcmbal_obj *obj);
-extern bcmos_errno bal_interface_indication_cb(bcmbal_obj *obj);
extern bcmos_errno bal_sub_term_osc_indication_cb(bcmbal_obj *obj);
extern bcmos_errno bal_sub_term_disc_indication_cb(bcmbal_obj *obj);
extern bcmos_errno bal_sub_term_alarm_indication_cb(bcmbal_obj *obj);
extern bcmos_errno bal_sub_term_dgi_indication_cb(bcmbal_obj *obj);
-extern bcmos_errno bal_sub_term_indication_cb(bcmbal_obj *obj);
-extern bcmos_errno bal_tm_queue_indication_cb(bcmbal_obj *obj);
-extern bcmos_errno bal_tm_sched_indication_cb(bcmbal_obj *obj);
+extern bcmos_errno bal_sub_term_dowi_indication_cb(bcmbal_obj *obj);
+extern bcmos_errno bal_sub_term_looci_indication_cb(bcmbal_obj *obj);
+extern bcmos_errno bal_sub_term_processing_error_indication_cb(bcmbal_obj *obj);
+extern bcmos_errno bal_sub_term_sdi_indication_cb(bcmbal_obj *obj);
+extern bcmos_errno bal_sub_term_sfi_indication_cb(bcmbal_obj *obj);
+extern bcmos_errno bal_sub_term_act_fail_indication_cb(bcmbal_obj *obj);
+extern bcmos_errno bal_sub_term_sufi_indication_cb(bcmbal_obj *obj);
+extern bcmos_errno bal_sub_term_tiwi_indication_cb(bcmbal_obj *obj);
+extern bcmos_errno bal_tm_sched_auto_id_oper_status_change_cb(bcmbal_obj *obj);
extern bcmos_errno bal_packet_data_indication_cb(bcmbal_obj *obj);
extern bcmos_errno bal_omci_data_indication_cb(bcmbal_obj *obj);
extern bcmos_errno bal_oam_data_indication_cb(bcmbal_obj *obj);
diff --git a/src/bal_interface_hdlr.c b/src/bal_interface_hdlr.c
index f59be37..ea70c08 100755
--- a/src/bal_interface_hdlr.c
+++ b/src/bal_interface_hdlr.c
@@ -61,18 +61,10 @@
interface_cfg->data->transceiver_type);
ASFVOLT_LOG(ASFVOLT_INFO, "Setting transceiver_type to : %d", interface_cfg->data->transceiver_type);
- ASFVOLT_CFG_PROP_SET(interface_obj, interface, ds_miss_mode,
- interface_cfg->data->has_ds_miss_mode,
- interface_cfg->data->ds_miss_mode);
-
ASFVOLT_CFG_PROP_SET(interface_obj, interface, mtu,
interface_cfg->data->has_mtu,
interface_cfg->data->mtu);
- ASFVOLT_CFG_PROP_SET(interface_obj, interface, flow_control,
- interface_cfg->data->has_flow_control,
- interface_cfg->data->flow_control);
-
ASFVOLT_CFG_PROP_SET(interface_obj, interface, ds_tm,
interface_cfg->data->has_ds_tm,
interface_cfg->data->ds_tm);
@@ -101,25 +93,14 @@
* Description : get the PON and NNI interfaces *
* of OLT Device *
********************************************************************/
-uint32_t bal_interface_cfg_get(BalInterfaceKey *interface_cfg_key,
- BalInterfaceCfg *interface_cfg)
+uint32_t bal_interface_cfg_get(BalInterfaceCfg *interface_cfg)
{
bcmos_errno err = BCM_ERR_OK;
bcmbal_interface_cfg interface_obj;
bcmbal_interface_key intf_key;
- if((interface_cfg_key->has_intf_id) && (interface_cfg_key->has_intf_type))
- {
- intf_key.intf_id = interface_cfg_key->intf_id;
- intf_key.intf_type = interface_cfg_key->intf_type;
- }
- else
- {
- ASFVOLT_LOG(ASFVOLT_ERROR, "Failed to get the interface cfg(OLT): Missing Key values "
- "Received key values intf-id(%d), intf-type(%d)",
- interface_cfg_key->intf_id, interface_cfg_key->intf_type);
- return BAL_ERRNO__BAL_ERR_NOENT;
- }
+ intf_key.intf_id = interface_cfg->key->intf_id;
+ intf_key.intf_type = interface_cfg->key->intf_type;
ASFVOLT_LOG(ASFVOLT_DEBUG, "Get interface cfg(for OLT) starts");
/*
@@ -141,7 +122,8 @@
ASFVOLT_LOG(ASFVOLT_INFO, "Get Interface cfg sent to OLT. "
"Interface ID(%d) Interface Type(%d)",
intf_key.intf_id, intf_key.intf_type);
- /* TODO - Add code to call grpc */
+
+ memcpy(interface_cfg->data, &interface_obj, sizeof(bcmbal_interface_cfg_data));
return BAL_ERRNO__BAL_ERR_OK;
}
diff --git a/src/bal_interface_hdlr.h b/src/bal_interface_hdlr.h
index 98d3079..1a40db2 100755
--- a/src/bal_interface_hdlr.h
+++ b/src/bal_interface_hdlr.h
@@ -15,7 +15,6 @@
*/
extern uint32_t bal_interface_cfg_set(BalInterfaceCfg *interface_cfg);
-extern uint32_t bal_interface_cfg_get(BalInterfaceKey *interface_cfg_key,
- BalInterfaceCfg *interface_cfg);
+extern uint32_t bal_interface_cfg_get(BalInterfaceCfg *interface_cfg);
extern uint32_t bal_interface_cfg_clear(BalInterfaceKey *interface_cfg_key);
extern bcmos_errno bal_interface_indication_cb(bcmbal_obj *obj);
diff --git a/src/bal_stats_hdlr.c b/src/bal_stats_hdlr.c
index 7865c7c..ee89d29 100755
--- a/src/bal_stats_hdlr.c
+++ b/src/bal_stats_hdlr.c
@@ -16,8 +16,6 @@
#include "bal_stats_hdlr.h"
-#define BAL_STAT_PRES 1
-
/********************************************************************\
* Function : asfvolt16_bal_stats_get *
* Description : Function to get stats based on *
@@ -53,47 +51,107 @@
* NOTE: When a CLEAR is specified during a NNI stats GET operation,
* all of the NNI stats are cleared, even the ones that are not retrieved.
*/
- err = bcmbal_stat_get(DEFAULT_ATERM_ID, &interface_stats.hdr, BCMOS_TRUE);
+ err = bcmbal_stat_get(DEFAULT_ATERM_ID, &interface_stats.hdr, BCMOS_FALSE);
if(err == BCM_ERR_OK)
{
/*interface key*/
- statKey->has_intf_id = BAL_STAT_PRES;
+ statKey->has_intf_id = BAL_ELEMENT_PRES;
statKey->intf_id = interface_stats.key.intf_id;
- statKey->has_intf_type = BAL_STAT_PRES;
+ statKey->has_intf_type = BAL_ELEMENT_PRES;
statKey->intf_type = interface_stats.key.intf_type;
/*interface stat data*/
- statData->has_rx_bytes = BAL_STAT_PRES;
+ statData->has_rx_bytes = BAL_ELEMENT_PRES;
statData->rx_bytes = interface_stats.data.rx_bytes;
- statData->has_rx_packets = BAL_STAT_PRES;
+ statData->has_rx_packets = BAL_ELEMENT_PRES;
statData->rx_packets = interface_stats.data.rx_packets;
- statData->has_rx_ucast_packets = BAL_STAT_PRES;
+ statData->has_rx_data_bytes = BAL_ELEMENT_PRES;
+ statData->rx_data_bytes = interface_stats.data.rx_data_bytes;
+ statData->has_rx_ucast_packets = BAL_ELEMENT_PRES;
statData->rx_ucast_packets = interface_stats.data.rx_ucast_packets;
- statData->has_rx_mcast_packets = BAL_STAT_PRES;
+ statData->has_rx_mcast_packets = BAL_ELEMENT_PRES;
statData->rx_mcast_packets = interface_stats.data.rx_mcast_packets;
- statData->has_rx_bcast_packets = BAL_STAT_PRES;
+ statData->has_rx_bcast_packets = BAL_ELEMENT_PRES;
statData->rx_bcast_packets = interface_stats.data.rx_bcast_packets;
- statData->has_rx_error_packets = BAL_STAT_PRES;
+ statData->rx_64_packets = BAL_ELEMENT_PRES;
+ statData->rx_64_packets = interface_stats.data.rx_64_packets;
+ statData->has_rx_65_127_packets = BAL_ELEMENT_PRES;
+ statData->rx_65_127_packets = interface_stats.data.rx_65_127_packets;
+ statData->has_rx_128_255_packets = BAL_ELEMENT_PRES;
+ statData->rx_128_255_packets = interface_stats.data.rx_128_255_packets;
+ statData->has_rx_256_511_packets = BAL_ELEMENT_PRES;
+ statData->rx_256_511_packets = interface_stats.data.rx_256_511_packets;
+ statData->has_rx_512_1023_packets = BAL_ELEMENT_PRES;
+ statData->rx_512_1023_packets = interface_stats.data.rx_512_1023_packets;
+ statData->has_rx_1024_1518_packets = BAL_ELEMENT_PRES;
+ statData->rx_1024_1518_packets = interface_stats.data.rx_1024_1518_packets;
+ statData->has_rx_1519_2047_packets = BAL_ELEMENT_PRES;
+ statData->rx_1519_2047_packets = interface_stats.data.rx_1519_2047_packets;
+ statData->has_rx_2048_4095_packets = BAL_ELEMENT_PRES;
+ statData->rx_2048_4095_packets = interface_stats.data.rx_2048_4095_packets;
+ statData->has_rx_4096_9216_packets = BAL_ELEMENT_PRES;
+ statData->rx_4096_9216_packets = interface_stats.data.rx_4096_9216_packets;
+ statData->has_rx_9217_16383_packets = BAL_ELEMENT_PRES;
+ statData->rx_9217_16383_packets = interface_stats.data.rx_9217_16383_packets;
+ statData->has_rx_error_packets = BAL_ELEMENT_PRES;
statData->rx_error_packets = interface_stats.data.rx_error_packets;
- statData->has_rx_unknown_protos = BAL_STAT_PRES;
+ statData->has_rx_unknown_protos = BAL_ELEMENT_PRES;
statData->rx_unknown_protos = interface_stats.data.rx_unknown_protos;
- statData->has_tx_bytes = BAL_STAT_PRES;
- statData->tx_bytes = interface_stats.data.tx_bytes;
- statData->has_tx_packets = BAL_STAT_PRES;
- statData->tx_packets = interface_stats.data.tx_packets;
- statData->has_tx_ucast_packets = BAL_STAT_PRES;
- statData->tx_ucast_packets = interface_stats.data.tx_ucast_packets;
- statData->has_tx_mcast_packets = BAL_STAT_PRES;
- statData->tx_mcast_packets = interface_stats.data.tx_mcast_packets;
- statData->has_tx_bcast_packets = BAL_STAT_PRES;
- statData->tx_bcast_packets = interface_stats.data.tx_bcast_packets;
- statData->has_tx_error_packets = BAL_STAT_PRES;
- statData->tx_error_packets = interface_stats.data.tx_error_packets;
- statData->has_rx_crc_errors = BAL_STAT_PRES;
+ statData->has_rx_crc_errors = BAL_ELEMENT_PRES;
statData->rx_crc_errors = interface_stats.data.rx_crc_errors;
- statData->has_bip_errors = BAL_STAT_PRES;
+ statData->has_bip_errors = BAL_ELEMENT_PRES;
statData->bip_errors = interface_stats.data.bip_errors;
+ statData->has_rx_mpcp = BAL_ELEMENT_PRES;
+ statData->rx_mpcp = interface_stats.data.rx_mpcp;
+ statData->has_rx_report = BAL_ELEMENT_PRES;
+ statData->rx_report = interface_stats.data.rx_report;
+ statData->has_rx_oam_bytes = BAL_ELEMENT_PRES;
+ statData->rx_oam_bytes = interface_stats.data.rx_oam_bytes;
+ statData->has_rx_oam_packets = BAL_ELEMENT_PRES;
+ statData->rx_oam_packets = interface_stats.data.rx_oam_packets;
+ statData->has_tx_bytes = BAL_ELEMENT_PRES;
+ statData->tx_bytes = interface_stats.data.tx_bytes;
+ statData->has_tx_packets = BAL_ELEMENT_PRES;
+ statData->tx_packets = interface_stats.data.tx_packets;
+ statData->has_tx_data_bytes = BAL_ELEMENT_PRES;
+ statData->tx_data_bytes = interface_stats.data.tx_data_bytes;
+ statData->has_tx_ucast_packets = BAL_ELEMENT_PRES;
+ statData->tx_ucast_packets = interface_stats.data.tx_ucast_packets;
+ statData->has_tx_mcast_packets = BAL_ELEMENT_PRES;
+ statData->tx_mcast_packets = interface_stats.data.tx_mcast_packets;
+ statData->has_tx_bcast_packets = BAL_ELEMENT_PRES;
+ statData->tx_bcast_packets = interface_stats.data.tx_bcast_packets;
+ statData->has_tx_64_packets = BAL_ELEMENT_PRES;
+ statData->tx_64_packets = interface_stats.data.tx_64_packets;
+ statData->has_tx_65_127_packets = BAL_ELEMENT_PRES;
+ statData->tx_65_127_packets = interface_stats.data.tx_65_127_packets;
+ statData->has_tx_128_255_packets = BAL_ELEMENT_PRES;
+ statData->tx_128_255_packets = interface_stats.data.tx_128_255_packets;
+ statData->has_tx_256_511_packets = BAL_ELEMENT_PRES;
+ statData->tx_256_511_packets = interface_stats.data.tx_256_511_packets;
+ statData->has_tx_512_1023_packets = BAL_ELEMENT_PRES;
+ statData->tx_512_1023_packets = interface_stats.data.tx_512_1023_packets;
+ statData->has_tx_1024_1518_packets = BAL_ELEMENT_PRES;
+ statData->tx_1024_1518_packets = interface_stats.data.tx_1024_1518_packets;
+ statData->has_tx_1519_2047_packets = BAL_ELEMENT_PRES;
+ statData->tx_1519_2047_packets = interface_stats.data.tx_1519_2047_packets;
+ statData->has_tx_2048_4095_packets = BAL_ELEMENT_PRES;
+ statData->tx_2048_4095_packets = interface_stats.data.tx_2048_4095_packets;
+ statData->has_tx_4096_9216_packets = BAL_ELEMENT_PRES;
+ statData->tx_4096_9216_packets = interface_stats.data.tx_4096_9216_packets;
+ statData->has_tx_9217_16383_packets = BAL_ELEMENT_PRES;
+ statData->tx_9217_16383_packets = interface_stats.data.tx_9217_16383_packets;
+ statData->has_tx_error_packets = BAL_ELEMENT_PRES;
+ statData->tx_error_packets = interface_stats.data.tx_error_packets;
+ statData->has_tx_mpcp = BAL_ELEMENT_PRES;
+ statData->tx_mpcp = interface_stats.data.tx_mpcp;
+ statData->has_tx_gate = BAL_ELEMENT_PRES;
+ statData->tx_gate = interface_stats.data.tx_gate;
+ statData->has_tx_oam_bytes = BAL_ELEMENT_PRES;
+ statData->tx_oam_bytes = interface_stats.data.tx_oam_bytes;
+ statData->has_tx_oam_packets = BAL_ELEMENT_PRES;
+ statData->tx_oam_packets = interface_stats.data.tx_oam_packets;
}
return err;
diff --git a/src/bal_subscriber_terminal_hdlr.c b/src/bal_subscriber_terminal_hdlr.c
index 91fcfac..42dccc2 100755
--- a/src/bal_subscriber_terminal_hdlr.c
+++ b/src/bal_subscriber_terminal_hdlr.c
@@ -49,18 +49,11 @@
{
bcmbal_serial_number serial_num = {} ;
bcmbal_serial_number zero_serial_num = {};
- bcmbal_registration_id registration_id = {};
int has_serial_num = BCMOS_FALSE;
- int has_registration_id = BCMOS_FALSE;
char two_digit_buf[3];
two_digit_buf[2] = 0;
- ASFVOLT_LOG(ASFVOLT_DEBUG, "Before encoding,Vendor Id(%s),Vendor Specific Id(%s), Registration Id(%s)",
- onu_cfg->data->serial_number->vendor_id,
- onu_cfg->data->serial_number->vendor_specific,
- onu_cfg->data->registration_id);
-
char vendor_id[20];
memset(&vendor_id, 0, 20);
sprintf(vendor_id,"%2X%2X%2X%2X",
@@ -69,11 +62,6 @@
onu_cfg->data->serial_number->vendor_id[2],
onu_cfg->data->serial_number->vendor_id[3]);
onu_cfg->data->serial_number->vendor_id = vendor_id;
- ASFVOLT_LOG(ASFVOLT_DEBUG, "After encoding,Vendor Id(%s),Vendor Specific Id(%s), Registration Id(%s)",
- onu_cfg->data->serial_number->vendor_id,
- onu_cfg->data->serial_number->vendor_specific,
- onu_cfg->data->registration_id);
-
/* Vendor Id is totally 16 byte string and should be
send in hexadecimmal format */
for(idx=0; idx<2*sizeof(serial_num.vendor_id); idx+=2)
@@ -91,17 +79,6 @@
ASFVOLT_CFG_PROP_SET(sub_term_obj, subscriber_terminal, serial_number,
has_serial_num, serial_num);
- /* Registration ID is a string and should be given in hexadecimal format */
- for(idx=0; idx<strlen(onu_cfg->data->registration_id) && idx<2*sizeof(registration_id.arr); idx+=2)
- {
- memcpy(two_digit_buf, &onu_cfg->data->registration_id[idx], 2);
- registration_id.arr[idx>>1] = strtol(two_digit_buf, NULL, 16);
- has_registration_id = BCMOS_TRUE;
- }
-
- ASFVOLT_CFG_PROP_SET(sub_term_obj, subscriber_terminal, registration_id,
- has_registration_id, registration_id);
-
if (!memcmp(&serial_num, &zero_serial_num, sizeof(serial_num)))
skip_onu = BCMOS_TRUE;
}
@@ -111,14 +88,6 @@
if (!skip_onu)
{
-
- /*ASFVOLT_LOG(ASFVOLT_DEBUG, "Onu's(%d) Serial number %02x%02x%02x%2x%02x%02x%02x%02x",
- onu_cfg->key->sub_term_id,
- sub_term_obj.data->serial_number.vendor_id[0], sub_term_obj.data->serial_number.vendor_id[1],
- sub_term_obj.data->serial_number.vendor_id[2], sub_term_obj.data->serial_number.vendor_id[3],
- sub_term_obj.data->serial_number.vendor_specific[0], sub_term_obj.data->serial_number.vendor_specific[1],
- sub_term_obj.data->serial_number.vendor_specific[2], sub_term_obj.data->serial_number.vendor_specific[3]);*/
-
err = bcmbal_cfg_set(DEFAULT_ATERM_ID, &(sub_term_obj.hdr));
ASFVOLT_LOG(ASFVOLT_DEBUG,
@@ -255,8 +224,7 @@
* Function : bal_subscriber_terminal_cfg_get *
* Description : Get the subscriber terminal(ONU) configuration *
********************************************************************/
-uint32_t bal_subscriber_terminal_cfg_get(BalSubscriberTerminalKey *terminal_key,
- BalSubscriberTerminalCfg *onu_cfg)
+uint32_t bal_subscriber_terminal_cfg_get(BalSubscriberTerminalCfg *onu_cfg)
{
bcmos_errno err = BCM_ERR_OK;
@@ -268,20 +236,8 @@
"Processing subscriber terminal cfg get: %d",
onu_cfg->key->sub_term_id);
- if (terminal_key->has_sub_term_id &&
- terminal_key->has_intf_id)
- {
- key.sub_term_id = terminal_key->sub_term_id ;
- key.intf_id = terminal_key->intf_id ;
- }
- else
- {
- ASFVOLT_LOG(ASFVOLT_ERROR,
- "Invalid Key to handle subscriber terminal Cfg Get subscriber_terminal_id(%d), Interface ID(%d)",
- key.sub_term_id, key.intf_id);
-
- return BAL_ERRNO__BAL_ERR_PARM;
- }
+ key.sub_term_id = onu_cfg->key->sub_term_id ;
+ key.intf_id = onu_cfg->key->intf_id ;
/* init the API struct */
BCMBAL_CFG_INIT(&cfg, subscriber_terminal, key);
@@ -312,7 +268,73 @@
return BAL_ERRNO__BAL_ERR_INTERNAL;
}
- ASFVOLT_LOG(ASFVOLT_INFO,
- "To-Do. Send subscriber terminal details to Adapter");
+ ASFVOLT_LOG(ASFVOLT_INFO, "Get Subscriber cfg sent to OLT for Subscriber Id(%d) on Interface(%d)",
+ key.sub_term_id, key.intf_id);
+
+ onu_cfg->key->has_sub_term_id = BAL_ELEMENT_PRES;
+ onu_cfg->key->sub_term_id = cfg.key.sub_term_id;
+
+ onu_cfg->key->has_intf_id = BAL_ELEMENT_PRES;
+ onu_cfg->key->intf_id = cfg.key.intf_id;
+
+ onu_cfg->data->has_admin_state = BAL_ELEMENT_PRES;
+ onu_cfg->data->admin_state = cfg.data.admin_state;
+
+ onu_cfg->data->has_oper_status = BAL_ELEMENT_PRES;
+ onu_cfg->data->oper_status = cfg.data.oper_status;
+
+ onu_cfg->data->has_svc_port_id = BAL_ELEMENT_PRES;
+ onu_cfg->data->svc_port_id = cfg.data.svc_port_id;
+
+ onu_cfg->data->has_ds_tm = BAL_ELEMENT_PRES;
+ onu_cfg->data->ds_tm = cfg.data.ds_tm;
+
+ onu_cfg->data->has_us_tm = BAL_ELEMENT_PRES;
+ onu_cfg->data->us_tm = cfg.data.us_tm;
+
+ onu_cfg->data->has_sub_term_rate = BAL_ELEMENT_PRES;
+ onu_cfg->data->sub_term_rate = cfg.data.sub_term_rate;
+
+ char *password = malloc(sizeof(char)*MAX_CHAR_LENGTH*2);
+ memset(password, 0, MAX_CHAR_LENGTH*2);
+ strcpy(password,(const char *)cfg.data.password.arr);
+ onu_cfg->data->password = password;
+
+ char *registration_id = malloc(sizeof(char)*MAX_REGID_LENGTH);
+ memset(registration_id, 0, MAX_REGID_LENGTH);
+ strcpy(registration_id,(const char *)cfg.data.registration_id.arr);
+ onu_cfg->data->registration_id = registration_id;
+
+ BalSerialNumber *serialNum;
+ serialNum = malloc(sizeof(BalSerialNumber));
+ memset(serialNum, 0, sizeof(BalSerialNumber));
+ bal_serial_number__init(serialNum);
+ onu_cfg->data->serial_number = serialNum;
+
+ char *vendor_id = malloc(sizeof(char)*MAX_CHAR_LENGTH);
+ memset(vendor_id, 0, MAX_CHAR_LENGTH);
+ sprintf(vendor_id,"%c%c%c%c",
+ cfg.data.serial_number.vendor_id[0],
+ cfg.data.serial_number.vendor_id[1],
+ cfg.data.serial_number.vendor_id[2],
+ cfg.data.serial_number.vendor_id[3]);
+
+ onu_cfg->data->serial_number->vendor_id = vendor_id;
+
+ char *vendor_specific = malloc(sizeof(char)*MAX_CHAR_LENGTH);
+ memset(vendor_specific, 0, MAX_CHAR_LENGTH);
+ sprintf(vendor_specific,"%1X%1X%1X%1X%1X%1X%1X%1X",
+ cfg.data.serial_number.vendor_specific[0]>>4 & 0x0f,
+ cfg.data.serial_number.vendor_specific[0] & 0x0f,
+ cfg.data.serial_number.vendor_specific[1]>>4 & 0x0f,
+ cfg.data.serial_number.vendor_specific[1] & 0x0f,
+ cfg.data.serial_number.vendor_specific[2]>>4 & 0x0f,
+ cfg.data.serial_number.vendor_specific[2] & 0x0f,
+ cfg.data.serial_number.vendor_specific[3]>>4 & 0x0f,
+ cfg.data.serial_number.vendor_specific[3] & 0x0f);
+ onu_cfg->data->serial_number->vendor_specific = vendor_specific;
+
+ free(list_mem);
+
return BAL_ERRNO__BAL_ERR_OK;
}
diff --git a/src/bal_subscriber_terminal_hdlr.h b/src/bal_subscriber_terminal_hdlr.h
index 94989cd..17236d8 100755
--- a/src/bal_subscriber_terminal_hdlr.h
+++ b/src/bal_subscriber_terminal_hdlr.h
@@ -17,7 +17,6 @@
extern uint32_t bal_subscriber_terminal_cfg_set(BalSubscriberTerminalCfg *onu_cfg);
extern bcmos_errno bal_subscriber_terminal_indication_cb(bcmbal_obj *obj);
extern uint32_t bal_subscriber_terminal_cfg_clear(BalSubscriberTerminalKey *terminal_key);
-extern uint32_t bal_subscriber_terminal_cfg_get(BalSubscriberTerminalKey *terminal_key,
- BalSubscriberTerminalCfg *onu_cfg);
+extern uint32_t bal_subscriber_terminal_cfg_get(BalSubscriberTerminalCfg *onu_cfg);
#define BAL_DYNAMIC_LIST_BUFFER_SIZE (32 * 1024)
diff --git a/src/bal_tmqueue_hdlr.c b/src/bal_tmqueue_hdlr.c
index eb52db9..31cab15 100755
--- a/src/bal_tmqueue_hdlr.c
+++ b/src/bal_tmqueue_hdlr.c
@@ -228,25 +228,15 @@
* Description : Get the OLT device tm queue configuration *
********************************************************************/
-uint32_t bal_tm_queue_cfg_get(BalTmQueueKey *tm_queue_key, BalTmQueueCfg *tm_queue_cfg)
+uint32_t bal_tm_queue_cfg_get(BalTmQueueCfg *tm_queue_cfg)
{
bcmos_errno err = BCM_ERR_OK;
bcmbal_tm_queue_cfg tm_queue_obj; /**< declare main API struct */
bcmbal_tm_queue_key key = { }; /**< declare key */
- if((tm_queue_key->has_id) && (tm_queue_key->has_sched_id) && (tm_queue_key->has_sched_dir))
- {
- key.id = tm_queue_key->id;
- key.sched_id = tm_queue_key->sched_id;
- key.sched_dir = tm_queue_key->sched_dir;
- }
- else
- {
- ASFVOLT_LOG(ASFVOLT_ERROR, "Failed to get the tm queue cfg(OLT): Missing Key values "
- "Received key values Id(%d), Sched-Dir(%d), Sched-Id(%d)",
- tm_queue_key->sched_id, tm_queue_key->sched_dir, tm_queue_key->id);
- return BAL_ERRNO__BAL_ERR_NOENT;
- }
+ key.id = tm_queue_cfg->key->id;
+ key.sched_id = tm_queue_cfg->key->sched_id;
+ key.sched_dir = tm_queue_cfg->key->sched_dir;
ASFVOLT_LOG(ASFVOLT_DEBUG, "Get tm queue cfg(for OLT) starts");
@@ -267,6 +257,10 @@
ASFVOLT_LOG(ASFVOLT_INFO, "Get tm Queue sent to OLT. "
"Queue ID(%d) Sched ID(%d) Sched Dir(%d)",
key.id, key.sched_id, key.sched_dir );
+
+ memcpy(tm_queue_cfg->key, &key, sizeof(BalTmQueueKey));
+ memcpy(tm_queue_cfg->data, &tm_queue_obj, sizeof(BalTmQueueCfgData));
+
return err;
}
diff --git a/src/bal_tmqueue_hdlr.h b/src/bal_tmqueue_hdlr.h
index 1ba5196..fdec188 100755
--- a/src/bal_tmqueue_hdlr.h
+++ b/src/bal_tmqueue_hdlr.h
@@ -16,5 +16,5 @@
extern uint32_t bal_tm_queue_cfg_set(BalTmQueueCfg *tm_queue_cfg);
extern uint32_t bal_tm_queue_cfg_clear(BalTmQueueKey *tm_queue_key);
-extern uint32_t bal_tm_queue_cfg_get(BalTmQueueKey *tm_queue_key, BalTmQueueCfg *tm_queue_cfg);
+extern uint32_t bal_tm_queue_cfg_get(BalTmQueueCfg *tm_queue_cfg);
extern bcmos_errno bal_tm_queue_cfg_indication_cb(bcmbal_obj *obj);
diff --git a/src/bal_tmsched_hdlr.c b/src/bal_tmsched_hdlr.c
index 73c738b..a0a92ac 100755
--- a/src/bal_tmsched_hdlr.c
+++ b/src/bal_tmsched_hdlr.c
@@ -98,20 +98,6 @@
}
}
break;
- case BCMBAL_TM_SCHED_OWNER_TYPE_UNI:
- if(tmScOwn->uni->has_intf_id)
- {
- valtmScOwn.u.uni.intf_id = tmScOwn->uni->intf_id;
- }
- if(tmScOwn->uni->has_sub_term_id)
- {
- valtmScOwn.u.uni.sub_term_id = tmScOwn->uni->sub_term_id;
- }
- if(tmScOwn->uni->has_idx)
- {
- valtmScOwn.u.uni.idx = tmScOwn->uni->idx;
- }
- break;
case BCMBAL_TM_SCHED_OWNER_TYPE_VIRTUAL:
if(tmScOwn->virtual_->has_idx)
{
@@ -149,10 +135,6 @@
ASFVOLT_CFG_PROP_SET(tm_sched_obj, tm_sched, sched_parent, BCMOS_TRUE, valSchedPar);
}
- ASFVOLT_CFG_PROP_SET(tm_sched_obj, tm_sched, sched_child_type,
- tm_sched_cfg->data->has_sched_child_type,
- tm_sched_cfg->data->sched_child_type);
-
/* rating/shaping */
BalTmShaping *balShaping = (BalTmShaping *)tm_sched_cfg->data->rate;
bcmbal_tm_shaping val = {};
@@ -250,7 +232,7 @@
}
/* Subsidiary queues */
- BalIdList *balQueues = (BalIdList *)tm_sched_cfg->data->queues;
+ BalTmQueueIdList *balQueues = (BalTmQueueIdList *)tm_sched_cfg->data->queues;
bcmbal_tm_queue_id_list_u8 valQueues = {};
if(balQueues != NULL && balQueues->n_val)
{
@@ -264,11 +246,11 @@
}
memcpy((void *)valQueues.val, (const void *)balQueues->val,
(balQueues->n_val)*sizeof(uint32_t));
- ASFVOLT_CFG_PROP_SET(tm_sched_obj, tm_sched, queues, BCMOS_TRUE, valQueues);
+ ASFVOLT_CFG_PROP_SET(tm_sched_obj, tm_sched, queue_list, BCMOS_TRUE, valQueues);
}
/* Subsidiary schedulers */
- BalIdList *balSubScheds = (BalIdList *)tm_sched_cfg->data->sub_scheds;
+ BalTmSchedIdList *balSubScheds = (BalTmSchedIdList *)tm_sched_cfg->data->sub_scheds;
bcmbal_tm_sched_id_list_u8 valSubScheds = {};
if(balSubScheds != NULL && balSubScheds->n_val)
{
@@ -282,7 +264,7 @@
}
memcpy((void *)valSubScheds.val, (const void *)balSubScheds->val,
(balSubScheds->n_val)*sizeof(uint32_t));
- ASFVOLT_CFG_PROP_SET(tm_sched_obj, tm_sched, sub_scheds, BCMOS_TRUE, valSubScheds);
+ ASFVOLT_CFG_PROP_SET(tm_sched_obj, tm_sched, sub_sched_list, BCMOS_TRUE, valSubScheds);
}
ASFVOLT_CFG_PROP_SET(tm_sched_obj, tm_sched, num_priorities,
@@ -308,25 +290,14 @@
* Description : get the OLT device tm queue configuration *
********************************************************************/
-uint32_t bal_tm_sched_cfg_get(BalTmSchedKey *tm_sched_key, BalTmSchedCfg *tm_sched_cfg)
+uint32_t bal_tm_sched_cfg_get(BalTmSchedCfg *tm_sched_cfg)
{
bcmos_errno err = BCM_ERR_OK;
bcmbal_tm_sched_cfg tm_sched_obj; /**< declare main API struct */
bcmbal_tm_sched_key key = { }; /**< declare key */
- if((tm_sched_cfg->key->has_dir) && (tm_sched_cfg->key->has_id))
- {
- key.dir = tm_sched_cfg->key->dir;
- key.id = tm_sched_cfg->key->id;
- }
- else
- {
- ASFVOLT_LOG(ASFVOLT_ERROR, "Failed to get the tm schedule cfg(OLT): Missing Key values "
- "Received key values Sched-Dir(%d), Sched-Id(%d)",
- tm_sched_cfg->key->dir, tm_sched_cfg->key->id);
- return BAL_ERRNO__BAL_ERR_NOENT;
- }
-
+ key.dir = tm_sched_cfg->key->dir;
+ key.id = tm_sched_cfg->key->id;
ASFVOLT_LOG(ASFVOLT_DEBUG, "Gem tm scheduler cfg (for OLT) starts");
@@ -346,6 +317,10 @@
ASFVOLT_LOG(ASFVOLT_INFO, "Get tm scheduler cfg sent to OLT. "
"Sched ID(%d) Sched Dir(%d)", key.id, key.dir);
+
+ memcpy(tm_sched_cfg->key, &key, sizeof(BalTmSchedKey));
+ memcpy(tm_sched_cfg->data, &tm_sched_obj, sizeof(BalTmSchedCfgData));
+
return err;
}
diff --git a/src/bal_tmsched_hdlr.h b/src/bal_tmsched_hdlr.h
index a625bee..eba3d1f 100755
--- a/src/bal_tmsched_hdlr.h
+++ b/src/bal_tmsched_hdlr.h
@@ -15,7 +15,7 @@
*/
extern uint32_t bal_tm_sched_cfg_set(BalTmSchedCfg *tm_sched_cfg);
-extern uint32_t bal_tm_sched_cfg_get(BalTmSchedKey *tm_sched_key, BalTmSchedCfg *tm_sched_cfg);
+extern uint32_t bal_tm_sched_cfg_get(BalTmSchedCfg *tm_sched_cfg);
extern uint32_t bal_tm_sched_cfg_clear(BalTmSchedKey *tm_sched_key);
extern bcmos_errno bal_tm_sched_cfg_indication_cb(bcmbal_obj *obj);
diff --git a/device_simulator/voltha_bal_driver.c b/src/voltha_bal_driver.c
similarity index 67%
rename from device_simulator/voltha_bal_driver.c
rename to src/voltha_bal_driver.c
index 2ada1bc..12b7fcf 100755
--- a/device_simulator/voltha_bal_driver.c
+++ b/src/voltha_bal_driver.c
@@ -19,6 +19,7 @@
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
+#include <stdbool.h>
#include <sys/time.h>
#include "bal_msg_type.grpc-c.h"
#include "bal_osmsg.grpc-c.h"
@@ -29,11 +30,7 @@
#include "bal.grpc-c.h"
#include "asfvolt.grpc-c.h"
-#ifdef BAL_STUB
-#include "bal_stub.h"
-#else
#include "asfvolt16_driver.h"
-#endif
#include <sys/reboot.h>
#include "bal_indications_queue.h"
@@ -53,6 +50,7 @@
grpc_c_server_destroy(test_server);
exit(0);
}
+static bool is_init_done = false;
/*MACRO Definitions*/
#define ASFVOLT_FIELD_LEN 200
@@ -93,11 +91,7 @@
bal_reboot_state__init(&bal_reboot);
bal_reboot.has_is_reboot = 1;
-#ifndef BAL_STUB
bal_reboot.is_reboot = is_reboot;
-#else
- bal_reboot.is_reboot = is_stub_reboot;
-#endif
/*
* Write reply back to the client
@@ -132,9 +126,9 @@
if (context->gcc_payload)
{
context->gcc_stream->read(context, (void **)&read_device, 0);
+ ASFVOLT_LOG(ASFVOLT_INFO, "Bal Server - Reboot : Device ID is %s",read_device->device_id);
}
- ASFVOLT_LOG(ASFVOLT_INFO, "Bal Server - Reboot : Device ID is %s",read_device->device_id);
/*
* send it to BAL
@@ -178,7 +172,7 @@
/* Prepare the command*/
char command[150];
- snprintf(command, sizeof command, "onlpdump -o | perl -ne 'print $1 if /%s: (\\S+)/'", field_name);
+ snprintf(command, sizeof command, "bash -l -c \"onlpdump -s\" | perl -ne 'print $1 if /%s: (\\S+)/'", field_name);
/* Open the command for reading. */
fp = popen(command, "r");
if (fp == NULL) {
@@ -267,7 +261,7 @@
char delim[2] = " ";
char *field = NULL;
FILE *fp;
- snprintf(command, sizeof command, "onlpdump -p | perl -ne 'print $1 if /Presence: ([0-9 ]+)/'");
+ snprintf(command, sizeof command, "bash -l -c \"onlpdump -p\" | perl -ne 'print $1 if /Presence: ([0-9 ]+)/'");
/* Open the command for reading. */
fp = popen(command, "r");
if (fp == NULL) {
@@ -330,7 +324,7 @@
*/
void bal__bal_cfg_stat_get_cb(grpc_c_context_t *context)
{
- BalInterfaceKey *read_stats;
+ BalInterfaceKey *read_stats = 0;
int ret_val;
/*
@@ -338,9 +332,9 @@
*/
if (context->gcc_payload) {
context->gcc_stream->read(context, (void **)&read_stats, 0);
+ ASFVOLT_LOG(ASFVOLT_DEBUG, "Bal Server - Get Stats :NNI port is %d",read_stats->intf_id);
}
- ASFVOLT_LOG(ASFVOLT_DEBUG, "Bal Server - Get Stats :NNI port is %d",read_stats->intf_id);
BalInterfaceStat get_stats;
memset(&get_stats, 0, sizeof(BalInterfaceStat));
@@ -354,14 +348,11 @@
memset(&stat_key, 0, sizeof(BalInterfaceKey));
bal_interface_key__init(&stat_key);
-#ifndef BAL_STUB
/* Interface Type, Interface ID
stat_data - Statistics Data */
- asfvolt16_bal_stats_get(read_stats->intf_type, read_stats->intf_id, &stat_data, &stat_key);
-#else
- stub_bal_stats_get(&stat_data);
- ASFVOLT_LOG(ASFVOLT_DEBUG, "Bal Server - Get Stats In BalStubs : Got all the statistics");
-#endif
+ if ((read_stats) && (is_init_done == true)) {
+ asfvolt16_bal_stats_get(read_stats->intf_type, read_stats->intf_id, &stat_data, &stat_key);
+ }
get_stats.data = &stat_data;
get_stats.key = &stat_key;
@@ -381,23 +372,195 @@
}
}
+void bal_cfg_get__free_mem_sub_term_cfg_get(BalCfg *balCfgRsp)
+{
+ free(balCfgRsp->terminal->data->password);
+ free(balCfgRsp->terminal->data->registration_id);
+ free(balCfgRsp->terminal->data->serial_number->vendor_id);
+ free(balCfgRsp->terminal->data->serial_number->vendor_specific);
+ free(balCfgRsp->terminal->data->serial_number);
+}
+
+void bal_cfg_get__free_mem(BalCfg *balCfgRsp)
+{
+ switch (balCfgRsp->hdr->obj_type)
+ {
+ case BAL_OBJ_ID__BAL_OBJ_ID_ACCESS_TERMINAL:
+ break;
+
+ case BAL_OBJ_ID__BAL_OBJ_ID_INTERFACE:
+ break;
+
+ case BAL_OBJ_ID__BAL_OBJ_ID_SUBSCRIBER_TERMINAL:
+ bal_cfg_get__free_mem_sub_term_cfg_get(balCfgRsp);
+ break;
+
+ default:
+ break;
+ }
+}
+
/*
* This functions gets invoked whenever bal RPC gets called
*/
void bal__bal_cfg_get_cb(grpc_c_context_t *context)
{
- BalCfg *get_cfg;
+ BalKey *bal_key = 0;
+ int ret_val;
/*
- * Read incoming message into get_cfg
+ * Read incoming message into bal_key
*/
if (context->gcc_payload) {
- context->gcc_stream->read(context, (void **)&get_cfg, 0);
+ context->gcc_stream->read(context, (void **)&bal_key, 0);
}
-#ifndef BAL_STUB
- //asfvolt16_bal_cfg_get(key, get_cfg);
-#endif
+ /*
+ * send it to BAL
+ */
+ BalCfg get_cfg_resp;
+ memset(&get_cfg_resp, 0, sizeof(BalCfg));
+ bal_cfg__init(&get_cfg_resp);
+
+ BalObj hdr_cfg;
+ memset(&hdr_cfg, 0, sizeof(BalObj));
+ bal_obj__init(&hdr_cfg);
+ get_cfg_resp.hdr = &hdr_cfg;
+
+ BalCommMsgHdr comm_hdr;
+ memset(&comm_hdr, 0, sizeof(BalCommMsgHdr));
+ bal_comm_msg_hdr__init(&comm_hdr);
+ get_cfg_resp.hdr->comm_hdr = &comm_hdr;
+
+ if (bal_key) {
+ switch(bal_key->hdr->obj_type)
+ {
+ case BAL_OBJ_ID__BAL_OBJ_ID_ACCESS_TERMINAL:
+ {
+ ASFVOLT_LOG(ASFVOLT_ERROR, "Bal Get For Access Terminal Received\n");
+
+ get_cfg_resp.obj_case = BAL_CFG__OBJ_CFG;
+
+ get_cfg_resp.hdr->obj_type = BAL_OBJ_ID__BAL_OBJ_ID_ACCESS_TERMINAL;
+
+ BalAccessTerminalCfg access_term_cfg;
+ memset(&access_term_cfg, 0, sizeof(BalAccessTerminalCfg));
+ bal_access_terminal_cfg__init(&access_term_cfg);
+ get_cfg_resp.cfg = &access_term_cfg;
+
+ BalAccessTerminalCfgData access_term_cfg_data;
+ memset(&access_term_cfg_data, 0, sizeof(BalAccessTerminalCfgData));
+ bal_access_terminal_cfg_data__init(&access_term_cfg_data);
+ get_cfg_resp.cfg->data = &access_term_cfg_data;
+
+ BalTopology access_term_cfg_data_topology;
+ memset(&access_term_cfg_data_topology, 0, sizeof(BalTopology));
+ bal_topology__init(&access_term_cfg_data_topology);
+ get_cfg_resp.cfg->data->topology = &access_term_cfg_data_topology;
+
+ BalSwVersion access_term_cfg_data_sw_version;
+ memset(&access_term_cfg_data_sw_version, 0, sizeof(BalSwVersion));
+ bal_sw_version__init(&access_term_cfg_data_sw_version);
+ get_cfg_resp.cfg->data->sw_version = &access_term_cfg_data_sw_version;
+
+ BalAccessTerminalKey access_term_key;
+ memset(&access_term_key, 0, sizeof(BalAccessTerminalKey));
+ bal_access_terminal_key__init(&access_term_key);
+ get_cfg_resp.cfg->key = &access_term_key;
+
+ if (is_init_done == true) {
+ asfvolt16_bal_cfg_get(&get_cfg_resp);
+ }
+ }
+ break;
+
+ case BAL_OBJ_ID__BAL_OBJ_ID_INTERFACE:
+ {
+ BalInterfaceCfg intf_cfg;
+ memset(&intf_cfg, 0, sizeof(BalInterfaceCfg));
+ bal_interface_cfg__init(&intf_cfg);
+ get_cfg_resp.interface = &intf_cfg;
+
+ BalInterfaceCfgData intf_cfg_data;
+ memset(&intf_cfg_data, 0, sizeof(BalInterfaceCfgData));
+ bal_interface_cfg_data__init(&intf_cfg_data);
+ get_cfg_resp.interface->data = &intf_cfg_data;
+
+ BalInterfaceKey intf_key;
+ memset(&intf_key, 0, sizeof(BalInterfaceKey));
+ bal_interface_key__init(&intf_key);
+ get_cfg_resp.interface->key = &intf_key;
+
+ if (is_init_done == true) {
+ asfvolt16_bal_cfg_get(&get_cfg_resp);
+ }
+ }
+ break;
+
+ case BAL_OBJ_ID__BAL_OBJ_ID_SUBSCRIBER_TERMINAL:
+ {
+ ASFVOLT_LOG(ASFVOLT_ERROR, "Bal Get For Subscriber Terminal Received\n");
+
+ get_cfg_resp.obj_case = BAL_CFG__OBJ_TERMINAL;
+
+ get_cfg_resp.hdr->obj_type = BAL_OBJ_ID__BAL_OBJ_ID_SUBSCRIBER_TERMINAL;
+
+ BalSubscriberTerminalCfg sub_term_cfg;
+ memset(&sub_term_cfg, 0, sizeof(BalSubscriberTerminalCfg));
+ bal_subscriber_terminal_cfg__init(&sub_term_cfg);
+ get_cfg_resp.terminal = &sub_term_cfg;
+
+ BalSubscriberTerminalCfgData sub_term_cfg_data;
+ memset(&sub_term_cfg_data, 0, sizeof(BalSubscriberTerminalCfgData));
+ bal_subscriber_terminal_cfg_data__init(&sub_term_cfg_data);
+ get_cfg_resp.terminal->data = &sub_term_cfg_data;
+
+ BalSerialNumber serial_number;
+ memset(&serial_number, 0, sizeof(BalSerialNumber));
+ bal_serial_number__init(&serial_number);
+ get_cfg_resp.terminal->data->serial_number = &serial_number;
+
+ BalSubscriberTerminalKey sub_term_key;
+ memset(&sub_term_key, 0, sizeof(BalSubscriberTerminalKey));
+ bal_subscriber_terminal_key__init(&sub_term_key);
+ get_cfg_resp.terminal->key = &sub_term_key;
+
+ get_cfg_resp.terminal->key->has_sub_term_id = true;
+ get_cfg_resp.terminal->key->sub_term_id = bal_key->terminal_key->sub_term_id;
+
+ get_cfg_resp.terminal->key->has_intf_id = true;
+ get_cfg_resp.terminal->key->intf_id = bal_key->terminal_key->intf_id;
+
+ if (is_init_done == true) {
+ asfvolt16_bal_cfg_get(&get_cfg_resp);
+ }
+ }
+ break;
+ default:
+ {
+ ASFVOLT_LOG(ASFVOLT_ERROR, "Bal Get not implemented for %d object type", bal_key->hdr->obj_type);
+ }
+ break;
+ }
+ }
+
+ /*
+ * Write reply back to the client
+ */
+ ret_val = context->gcc_stream->write(context, &get_cfg_resp, -1);
+ is_grpc_write_pending(ret_val);
+
+ grpc_c_status_t status;
+ status.gcs_code = 0;
+
+ /*
+ * Finish response for RPC
+ */
+ if (context->gcc_stream->finish(context, &status))
+ {
+ ASFVOLT_LOG(ASFVOLT_ERROR, "Failed to write status");
+ }
+ bal_cfg_get__free_mem(&get_cfg_resp);
}
/*
@@ -405,7 +568,7 @@
*/
void bal__bal_cfg_set_cb(grpc_c_context_t *context)
{
- BalCfg *set_cfg;
+ BalCfg *set_cfg = 0;
BalErr bal_err;
int ret_val = 0;
@@ -442,85 +605,16 @@
ASFVOLT_LOG(ASFVOLT_ERROR, "Failed to write status");
}
-#ifdef BAL_STUB
- pthread_mutex_lock(&lock);
+ if (set_cfg) {
- struct QNode *temp = newNode(set_cfg->hdr->obj_type,
- BAL_ERRNO__BAL_ERR_OK,
- set_cfg->device_id);
+ if(BAL_OBJ_ID__BAL_OBJ_ID_ACCESS_TERMINAL == set_cfg->hdr->obj_type)
+ {
+ sleep(5); /* enable this if running with gdb */
+ }
+
- switch(set_cfg->hdr->obj_type)
- {
- case BAL_OBJ_ID__BAL_OBJ_ID_ACCESS_TERMINAL:
- {
- ASFVOLT_LOG(ASFVOLT_INFO, "Received Access Terminal Configuration msg");
- }
- break;
- case BAL_OBJ_ID__BAL_OBJ_ID_INTERFACE:
- {
- ASFVOLT_LOG(ASFVOLT_INFO, "Received PON Interface Configuration msg");
- temp->intf_id = set_cfg->interface->key->intf_id;
- ASFVOLT_LOG(ASFVOLT_INFO, "Pon ID = %d", temp->intf_id);
- }
- break;
- case BAL_OBJ_ID__BAL_OBJ_ID_SUBSCRIBER_TERMINAL:
- {
- ASFVOLT_LOG(ASFVOLT_INFO, "Received ONU Activation msg");
- temp->intf_id = set_cfg->terminal->key->intf_id;
- temp->onu_id = set_cfg->terminal->key->sub_term_id;
- memset(temp->vendor_id, 0, BAL_DEVICE_STR_LEN);
- memcpy(temp->vendor_id,
- set_cfg->terminal->data->serial_number->vendor_id,
- strlen(set_cfg->terminal->data->serial_number->vendor_id));
- memset(temp->vendor_specific, 0, BAL_DEVICE_STR_LEN);
- memcpy(temp->vendor_specific,
- set_cfg->terminal->data->serial_number->vendor_specific,
- strlen(set_cfg->terminal->data->serial_number->vendor_specific));
- }
- break;
- case BAL_OBJ_ID__BAL_OBJ_ID_TM_SCHED:
- {
- ASFVOLT_LOG(ASFVOLT_INFO, "Received TM schedule msg");
- }
- break;
- case BAL_OBJ_ID__BAL_OBJ_ID_PACKET:
- {
- switch(set_cfg->packet->key->packet_send_dest->type)
- {
- case BAL_DEST_TYPE__BAL_DEST_TYPE_ITU_OMCI_CHANNEL:
- {
- ASFVOLT_LOG(ASFVOLT_INFO, "Received OMCI msg");
- temp->intf_id = set_cfg->terminal->key->intf_id;
- temp->onu_id = set_cfg->terminal->key->sub_term_id;
- }
- break;
- default:
- {
- ASFVOLT_LOG(ASFVOLT_INFO, "Dest type invalid");
- }
- break;
- }
- }
- break;
- default:
- {
- ASFVOLT_LOG(ASFVOLT_INFO, "Received Invalid msg type === %d", set_cfg->hdr->obj_type);
- pthread_mutex_unlock(&lock);
- return;
- }
- break;
+ asfvolt16_bal_cfg_set(set_cfg);
}
- enQueue(set_cfg->hdr->obj_type, temp);
- pthread_mutex_unlock(&lock);
- sleep(2);
- pthread_cond_signal(&cv);
-#else
- if(BAL_OBJ_ID__BAL_OBJ_ID_ACCESS_TERMINAL == set_cfg->hdr->obj_type)
- {
- sleep(5); /* enable this if running with gdb */
- }
- asfvolt16_bal_cfg_set(set_cfg);
-#endif
}
@@ -529,7 +623,7 @@
*/
void bal__bal_cfg_clear_cb(grpc_c_context_t *context)
{
- BalKey *clear_key;
+ BalKey *clear_key = 0;
BalErr bal_err;
int ret_val = 0;
@@ -566,9 +660,9 @@
ASFVOLT_LOG(ASFVOLT_ERROR, "Failed to write status");
}
-#ifndef BAL_STUB
- asfvolt16_bal_cfg_clear(clear_key);
-#endif
+ if (clear_key) {
+ asfvolt16_bal_cfg_clear(clear_key);
+ }
}
@@ -577,7 +671,7 @@
*/
void bal__bal_api_init_cb(grpc_c_context_t *context)
{
- BalInit *bal_init;
+ BalInit *bal_init = 0;
BalErr bal_err;
int ret_val;
@@ -616,73 +710,40 @@
ASFVOLT_LOG(ASFVOLT_ERROR, "Failed to write status");
}
-#ifndef BAL_STUB
- asfvolt16_bal_init(bal_init, &coreIpPortInfo);
-#else
- ASFVOLT_LOG(ASFVOLT_INFO, "Received IP Address == %s", bal_init->voltha_adapter_ip_port);
- stub_bal_init(bal_init);
-#endif
-
+ if (bal_init) {
+ asfvolt16_bal_init(bal_init, &coreIpPortInfo);
+ }
+ is_init_done = true;
}
-void bal_get_ind__free_mem_access_term_ind(BalIndications *balIndCfg)
-{
- free(balIndCfg->access_term_ind->data->sw_version);
- free(balIndCfg->access_term_ind->data->topology);
- free(balIndCfg->access_term_ind->data);
- free(balIndCfg->access_term_ind->key);
- free(balIndCfg->access_term_ind->hdr);
- free(balIndCfg->access_term_ind);
- free(balIndCfg);
-}
void bal_get_ind__free_mem_access_term_ind_op_state(BalIndications *balIndCfg)
{
free(balIndCfg->access_term_ind_op_state->data);
free(balIndCfg->access_term_ind_op_state->key);
- free(balIndCfg->access_term_ind_op_state->hdr);
free(balIndCfg->access_term_ind_op_state);
free(balIndCfg);
}
+void bal_get_ind__free_mem_access_term_proc_err(BalIndications *balIndCfg)
+{
+ free(balIndCfg->access_term_proc_err->key);
+ free(balIndCfg->access_term_proc_err);
+ free(balIndCfg);
+}
+
void bal_get_ind__free_mem_flow_op_state(BalIndications *balIndCfg)
{
free(balIndCfg->flow_op_state->data);
free(balIndCfg->flow_op_state->key);
- free(balIndCfg->flow_op_state->hdr);
free(balIndCfg->flow_op_state);
free(balIndCfg);
}
-void bal_get_ind__free_mem_flow_ind(BalIndications *balIndCfg)
+void bal_get_ind__free_mem_flow_proc_err(BalIndications *balIndCfg)
{
- free(balIndCfg->flow_ind->data->action);
- free(balIndCfg->flow_ind->data->classifier->src_mac.data);
- free(balIndCfg->flow_ind->data->classifier->dst_mac.data);
- free(balIndCfg->flow_ind->data->classifier);
- free(balIndCfg->flow_ind->data);
- free(balIndCfg->flow_ind->key);
- free(balIndCfg->flow_ind->hdr);
- free(balIndCfg->flow_ind);
- free(balIndCfg);
-}
-
-void bal_get_ind__free_mem_group_ind(BalIndications *balIndCfg)
-{
- unsigned int i = 0;
- free(balIndCfg->group_ind->data->flows->val);
- free(balIndCfg->group_ind->data->flows);
- for (i = 0; i < balIndCfg->group_ind->data->members->n_val; i++)
- {
- free(balIndCfg->group_ind->data->members->val[i]->queue);
- free(balIndCfg->group_ind->data->members->val[i]->action);
- free(balIndCfg->group_ind->data->members->val[i]);
- }
- free(balIndCfg->group_ind->data->members);
- free(balIndCfg->group_ind->data);
- free(balIndCfg->group_ind->key);
- free(balIndCfg->group_ind->hdr);
- free(balIndCfg->group_ind);
+ free(balIndCfg->flow_proc_err->key);
+ free(balIndCfg->flow_proc_err);
free(balIndCfg);
}
@@ -690,7 +751,6 @@
{
free(balIndCfg->interface_op_state->data);
free(balIndCfg->interface_op_state->key);
- free(balIndCfg->interface_op_state->hdr);
free(balIndCfg->interface_op_state);
free(balIndCfg);
}
@@ -698,27 +758,14 @@
void bal_get_ind__free_mem_interface_los(BalIndications *balIndCfg)
{
free(balIndCfg->interface_los->data);
- free(balIndCfg->interface_los->hdr);
free(balIndCfg->interface_los);
free(balIndCfg);
}
-void bal_get_ind__free_mem_interface_ind(BalIndications *balIndCfg)
-{
- free(balIndCfg->interface_ind->data->sub_term_id_list->val);
- free(balIndCfg->interface_ind->data->sub_term_id_list);
- free(balIndCfg->interface_ind->data);
- free(balIndCfg->interface_ind->key);
- free(balIndCfg->interface_ind->hdr);
- free(balIndCfg->interface_ind);
- free(balIndCfg);
-}
-
void bal_get_ind__free_mem_terminal_op_state(BalIndications *balIndCfg)
{
free(balIndCfg->terminal_op_state->data);
free(balIndCfg->terminal_op_state->key);
- free(balIndCfg->terminal_op_state->hdr);
free(balIndCfg->terminal_op_state);
free(balIndCfg);
}
@@ -730,7 +777,6 @@
free(balIndCfg->terminal_disc->data->serial_number);
free(balIndCfg->terminal_disc->data);
free(balIndCfg->terminal_disc->key);
- free(balIndCfg->terminal_disc->hdr);
free(balIndCfg->terminal_disc);
free(balIndCfg);
}
@@ -740,7 +786,6 @@
free(balIndCfg->terminal_alarm->data->alarm);
free(balIndCfg->terminal_alarm->data);
free(balIndCfg->terminal_alarm->key);
- free(balIndCfg->terminal_alarm->hdr);
free(balIndCfg->terminal_alarm);
free(balIndCfg);
}
@@ -749,62 +794,78 @@
{
free(balIndCfg->terminal_dgi->data);
free(balIndCfg->terminal_dgi->key);
- free(balIndCfg->terminal_dgi->hdr);
free(balIndCfg->terminal_dgi);
free(balIndCfg);
}
-void bal_get_ind__free_mem_terminal_ind(BalIndications *balIndCfg)
+void bal_get_ind__free_mem_terminal_dowi(BalIndications *balIndCfg)
{
- free(balIndCfg->terminal_ind->data->agg_port_id_list);
- free(balIndCfg->terminal_ind->data->serial_number->vendor_specific);
- free(balIndCfg->terminal_ind->data->serial_number->vendor_id);
- free(balIndCfg->terminal_ind->data->serial_number);
- free(balIndCfg->terminal_ind->data->registration_id);
- free(balIndCfg->terminal_ind->data->password);
- free(balIndCfg->terminal_ind->data);
- free(balIndCfg->terminal_ind->key);
- free(balIndCfg->terminal_ind->hdr);
- free(balIndCfg->terminal_ind);
+ free(balIndCfg->terminal_dowi->data);
+ free(balIndCfg->terminal_dowi->key);
+ free(balIndCfg->terminal_dowi);
free(balIndCfg);
}
-void bal_get_ind__free_mem_tm_queue_ind(BalIndications *balIndCfg)
+void bal_get_ind__free_mem_terminal_looci(BalIndications *balIndCfg)
{
- switch (balIndCfg->tm_queue_ind->data->bac->type)
- {
- case BAL_TM_BAC_TYPE__BAL_TM_BAC_TYPE_TAILDROP:
- free(balIndCfg->tm_queue_ind->data->bac->taildrop);
- break;
- case BAL_TM_BAC_TYPE__BAL_TM_BAC_TYPE_WTAILDROP:
- /*Nothing to do*/
- break;
- case BAL_TM_BAC_TYPE__BAL_TM_BAC_TYPE_RED:
- free(balIndCfg->tm_queue_ind->data->bac->red->red);
- free(balIndCfg->tm_queue_ind->data->bac->red);
- break;
- case BAL_TM_BAC_TYPE__BAL_TM_BAC_TYPE_WRED:
- free(balIndCfg->tm_queue_ind->data->bac->wred->red);
- free(balIndCfg->tm_queue_ind->data->bac->wred->yellow);
- free(balIndCfg->tm_queue_ind->data->bac->wred->green);
- free(balIndCfg->tm_queue_ind->data->bac->wred);
- default:
- /*Nothing to do*/
- break;
- }
- free(balIndCfg->tm_queue_ind->data->bac);
- free(balIndCfg->tm_queue_ind->data->rate);
- free(balIndCfg->tm_queue_ind->data);
- free(balIndCfg->tm_queue_ind->key);
- free(balIndCfg->tm_queue_ind);
+ free(balIndCfg->terminal_looci->data);
+ free(balIndCfg->terminal_looci->key);
+ free(balIndCfg->terminal_looci);
free(balIndCfg);
}
-void bal_get_ind__free_mem_u_tm_sched_ind(BalIndications *balIndCfg)
+void bal_get_ind__free_mem_terminal_proc_err(BalIndications *balIndCfg)
{
- free(balIndCfg->tm_sched_ind->data);
- free(balIndCfg->tm_sched_ind->key);
- free(balIndCfg->tm_sched_ind);
+ free(balIndCfg->terminal_proc_err->key);
+ free(balIndCfg->terminal_proc_err);
+ free(balIndCfg);
+}
+
+void bal_get_ind__free_mem_terminal_sdi(BalIndications *balIndCfg)
+{
+ free(balIndCfg->terminal_sdi->data);
+ free(balIndCfg->terminal_sdi->key);
+ free(balIndCfg->terminal_sdi);
+ free(balIndCfg);
+}
+
+void bal_get_ind__free_mem_terminal_sfi(BalIndications *balIndCfg)
+{
+ free(balIndCfg->terminal_sfi->data);
+ free(balIndCfg->terminal_sfi->key);
+ free(balIndCfg->terminal_sfi);
+ free(balIndCfg);
+}
+
+void bal_get_ind__free_mem_terminal_sufi(BalIndications *balIndCfg)
+{
+ free(balIndCfg->terminal_sufi->data);
+ free(balIndCfg->terminal_sufi->key);
+ free(balIndCfg->terminal_sufi);
+ free(balIndCfg);
+}
+
+void bal_get_ind__free_mem_terminal_sub_term_act_fail(BalIndications *balIndCfg)
+{
+ free(balIndCfg->terminal_sub_term_act_fail->data);
+ free(balIndCfg->terminal_sub_term_act_fail->key);
+ free(balIndCfg->terminal_sub_term_act_fail);
+ free(balIndCfg);
+}
+
+void bal_get_ind__free_mem_terminal_tiwi(BalIndications *balIndCfg)
+{
+ free(balIndCfg->terminal_tiwi->data);
+ free(balIndCfg->terminal_tiwi->key);
+ free(balIndCfg->terminal_tiwi);
+ free(balIndCfg);
+}
+
+void bal_get_ind__free_mem_tm_sched_osc(BalIndications *balIndCfg)
+{
+ free(balIndCfg->tm_sched_oper_stats_change->data);
+ free(balIndCfg->tm_sched_oper_stats_change->key);
+ free(balIndCfg->tm_sched_oper_stats_change);
free(balIndCfg);
}
@@ -829,7 +890,6 @@
}
free(balIndCfg->pktdata->key->packet_send_dest);
free(balIndCfg->pktdata->key);
- free(balIndCfg->pktdata->hdr);
free(balIndCfg->pktdata);
free(balIndCfg);
}
@@ -849,7 +909,6 @@
free(balIndCfg->balomciresp->data->pkt.data);
free(balIndCfg->balomciresp->data);
free(balIndCfg->balomciresp->key);
- free(balIndCfg->balomciresp->hdr);
free(balIndCfg->balomciresp);
free(balIndCfg);
}
@@ -869,7 +928,6 @@
}
free(balIndCfg->baloamresp->key->packet_send_dest);
free(balIndCfg->baloamresp->key);
- free(balIndCfg->baloamresp->hdr);
free(balIndCfg->baloamresp);
free(balIndCfg);
}
@@ -878,24 +936,20 @@
{
switch (balIndCfg->u_case)
{
- case BAL_INDICATIONS__U_ACCESS_TERM_IND:
- bal_get_ind__free_mem_access_term_ind(balIndCfg);
- break;
-
case BAL_INDICATIONS__U_ACCESS_TERM_IND_OP_STATE:
bal_get_ind__free_mem_access_term_ind_op_state(balIndCfg);
break;
+ case BAL_INDICATIONS__U_ACCESS_TERM_PROC_ERR:
+ bal_get_ind__free_mem_access_term_proc_err(balIndCfg);
+ break;
+
case BAL_INDICATIONS__U_FLOW_OP_STATE:
bal_get_ind__free_mem_flow_op_state(balIndCfg);
break;
- case BAL_INDICATIONS__U_FLOW_IND:
- bal_get_ind__free_mem_flow_ind(balIndCfg);
- break;
-
- case BAL_INDICATIONS__U_GROUP_IND:
- bal_get_ind__free_mem_group_ind(balIndCfg);
+ case BAL_INDICATIONS__U_FLOW_PROC_ERR:
+ bal_get_ind__free_mem_flow_proc_err(balIndCfg);
break;
case BAL_INDICATIONS__U_INTERFACE_OP_STATE:
@@ -906,10 +960,6 @@
bal_get_ind__free_mem_interface_los(balIndCfg);
break;
- case BAL_INDICATIONS__U_INTERFACE_IND:
- bal_get_ind__free_mem_interface_ind(balIndCfg);
- break;
-
case BAL_INDICATIONS__U_TERMINAL_OP_STATE:
bal_get_ind__free_mem_terminal_op_state(balIndCfg);
break;
@@ -926,16 +976,40 @@
bal_get_ind__free_mem_terminal_dgi(balIndCfg);
break;
- case BAL_INDICATIONS__U_TERMINAL_IND:
- bal_get_ind__free_mem_terminal_ind(balIndCfg);
+ case BAL_INDICATIONS__U_TERMINAL_DOWI:
+ bal_get_ind__free_mem_terminal_dowi(balIndCfg);
break;
- case BAL_INDICATIONS__U_TM_QUEUE__IND:
- bal_get_ind__free_mem_tm_queue_ind(balIndCfg);
+ case BAL_INDICATIONS__U_TERMINAL_LOOCI:
+ bal_get_ind__free_mem_terminal_looci(balIndCfg);
break;
- case BAL_INDICATIONS__U_TM_SCHED__IND:
- bal_get_ind__free_mem_u_tm_sched_ind(balIndCfg);
+ case BAL_INDICATIONS__U_TERMINAL_PROC_ERR:
+ bal_get_ind__free_mem_terminal_proc_err(balIndCfg);
+ break;
+
+ case BAL_INDICATIONS__U_TERMINAL_SDI:
+ bal_get_ind__free_mem_terminal_sdi(balIndCfg);
+ break;
+
+ case BAL_INDICATIONS__U_TERMINAL_SFI:
+ bal_get_ind__free_mem_terminal_sfi(balIndCfg);
+ break;
+
+ case BAL_INDICATIONS__U_TERMINAL_SUFI:
+ bal_get_ind__free_mem_terminal_sufi(balIndCfg);
+ break;
+
+ case BAL_INDICATIONS__U_TERMINAL_SUB_TERM_ACT_FAIL:
+ bal_get_ind__free_mem_terminal_sub_term_act_fail(balIndCfg);
+ break;
+
+ case BAL_INDICATIONS__U_TERMINAL_TIWI:
+ bal_get_ind__free_mem_terminal_tiwi(balIndCfg);
+ break;
+
+ case BAL_INDICATIONS__U_TM_SCHED_OPER_STATS_CHANGE:
+ bal_get_ind__free_mem_tm_sched_osc(balIndCfg);
break;
case BAL_INDICATIONS__U_PKT_DATA:
@@ -1031,19 +1105,19 @@
}
-void bal_ind__bal_acc_term_ind_cb(grpc_c_context_t *context)
+void bal_ind__bal_acc_term_oper_sts_cng_ind_cb(grpc_c_context_t *context)
{
}
-void bal_ind__bal_acc_term_oper_sts_cng_ind_cb(grpc_c_context_t *context)
+void bal_ind__bal_acc_term_cfg_cb(grpc_c_context_t *context)
+{
+}
+void bal_ind__bal_acc_term_proc_err_cb(grpc_c_context_t *context)
{
}
void bal_ind__bal_flow_oper_sts_cng_cb(grpc_c_context_t *context)
{
}
-void bal_ind__bal_flow_ind_cb(grpc_c_context_t *context)
-{
-}
-void bal_ind__bal_group_ind_cb(grpc_c_context_t *context)
+void bal_ind__bal_flow_proc_err_cb(grpc_c_context_t *context)
{
}
void bal_ind__bal_iface_oper_sts_cng_cb(grpc_c_context_t *context)
@@ -1052,9 +1126,6 @@
void bal_ind__bal_iface_los_cb(grpc_c_context_t *context)
{
}
-void bal_ind__bal_iface_ind_cb(grpc_c_context_t *context)
-{
-}
void bal_ind__bal_iface_stat_cb(grpc_c_context_t *context)
{
}
@@ -1070,13 +1141,31 @@
void bal_ind__bal_subs_term_dgi_ind_cb(grpc_c_context_t *context)
{
}
-void bal_ind__bal_subs_term_ind_cb(grpc_c_context_t *context)
+void bal_ind__bal_subs_term_proc_err_cb(grpc_c_context_t *context)
{
}
-void bal_ind__bal_tm_queue_ind_info_cb(grpc_c_context_t *context)
+void bal_ind__bal_subs_term_dowi_ind_cb(grpc_c_context_t *context)
{
}
-void bal_ind__bal_tm_sched_ind_info_cb(grpc_c_context_t *context)
+void bal_ind__bal_subs_term_looci_ind_cb(grpc_c_context_t *context)
+{
+}
+void bal_ind__bal_subs_term_sdi_ind_cb(grpc_c_context_t *context)
+{
+}
+void bal_ind__bal_subs_term_sfi_ind_cb(grpc_c_context_t *context)
+{
+}
+void bal_ind__bal_subs_term_sufi_ind_cb(grpc_c_context_t *context)
+{
+}
+void bal_ind__bal_subs_term_tiwi_ind_cb(grpc_c_context_t *context)
+{
+}
+void bal_ind__bal_sub_term_act_fail_ind_cb(grpc_c_context_t *context)
+{
+}
+void bal_ind__bal_tm_sched_oper_stats_change_cb(grpc_c_context_t *context)
{
}
void bal_ind__bal_pkt_bearer_channel_rx_ind_cb(grpc_c_context_t *context)
@@ -1088,6 +1177,9 @@
void bal_ind__bal_pkt_ieee_oam_channel_rx_ind_cb(grpc_c_context_t *context)
{
}
+void bal_ind__bal_sys_profile_ind_cb(grpc_c_context_t *context)
+{
+}
/*
** ASFVOLT_HEX2LOG(ASFVOLT_DEBUG, "OMCI Response with %zd bytes is",
@@ -1116,16 +1208,14 @@
int i = 0;
grpc_c_server_t *server = NULL;
- if (argc < 6)
+ if (argc < 4)
{
- fprintf(stderr, "Missing socket path argument\n");
+ fprintf(stderr, "Missing arguments\n");
exit(1);
}
strcpy(coreIpPortInfo.bal_core_arg1, argv[2] /*, strlen(argv[2])*/);
strcpy(coreIpPortInfo.bal_core_ip_port, argv[3]/*, strlen(argv[3])*/);
- strcpy(coreIpPortInfo.bal_core_arg2, argv[4]/*, strlen(argv[4])*/);
- strcpy(coreIpPortInfo.bal_shared_lib_ip_port, argv[5]/*, strlen(argv[5])*/);
signal(SIGINT, sigint_handler);
@@ -1165,10 +1255,6 @@
*/
grpc_c_server_start(test_server);
-#ifdef BAL_STUB
- create_stub_thread();
-#endif
-
/*
* Blocks server to wait to completion
*/
diff --git a/third_party/grpc b/third_party/grpc
deleted file mode 160000
index ed7d06a..0000000
--- a/third_party/grpc
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit ed7d06af3eef1c27f10328c73b3ae3ab10d72b10
diff --git a/third_party/grpc-c b/third_party/grpc-c
deleted file mode 160000
index be82ab1..0000000
--- a/third_party/grpc-c
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit be82ab1605717f33e2e0d3038996ea46d9efe25e
diff --git a/third_party/protobuf b/third_party/protobuf
deleted file mode 160000
index 703cd8e..0000000
--- a/third_party/protobuf
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 703cd8e11c8d34283d4c8bf869c61866e8211c9d
diff --git a/third_party/protobuf-c b/third_party/protobuf-c
deleted file mode 160000
index 6a4f9a9..0000000
--- a/third_party/protobuf-c
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 6a4f9a9a67c06769aaa9f65e8f89a56483271f5a