VOL-1194 Get device info from device (vendor, versions, resource manager parameters)
Change-Id: I24f6a205000ea747e479bfc5ca994e28df4bd231
diff --git a/voltha/adapters/openolt/openolt_device.py b/voltha/adapters/openolt/openolt_device.py
index 644a036..d607b70 100644
--- a/voltha/adapters/openolt/openolt_device.py
+++ b/voltha/adapters/openolt/openolt_device.py
@@ -181,6 +181,15 @@
device = self.adapter_agent.get_device(self.device_id)
self.stub = openolt_pb2_grpc.OpenoltStub(self.channel)
+
+ device_info = self.stub.GetDeviceInfo(openolt_pb2.Empty())
+ self.log.info('Device connected', device_info=device_info)
+
+ device.vendor = device_info.vendor
+ device.model = device_info.model
+ device.hardware_version = device_info.hardware_version
+ device.firmware_version = device_info.firmware_version
+
self.flow_mgr = OpenOltFlowMgr(self.log, self.stub, self.device_id,
self.logical_device_id)
self.alarm_mgr = OpenOltAlarmMgr(self.log, self.adapter_agent,
@@ -189,6 +198,8 @@
self.stats_mgr = OpenOltStatisticsMgr(self, self.log)
self.bw_mgr = OpenOltBW(self.log, self.proxy)
+ # TODO: use content of device_info for Resource manager (VOL-948)
+
# TODO: check for uptime and reboot if too long (VOL-1192)
diff --git a/voltha/adapters/openolt/protos/openolt.proto b/voltha/adapters/openolt/protos/openolt.proto
index 00509f6..8187faf 100644
--- a/voltha/adapters/openolt/protos/openolt.proto
+++ b/voltha/adapters/openolt/protos/openolt.proto
@@ -109,6 +109,13 @@
};
}
+ rpc GetDeviceInfo(Empty) returns (DeviceInfo) {
+ option (google.api.http) = {
+ post: "/v1/GetDeviceInfo"
+ body: "*"
+ };
+ }
+
rpc Reboot(Empty) returns (Empty) {
option (google.api.http) = {
post: "/v1/Reboot"
@@ -223,6 +230,21 @@
bytes pkt = 2;
}
+message DeviceInfo {
+ string vendor = 1;
+ string model = 2;
+ string hardware_version = 3;
+ string firmware_version = 4;
+ string technology = 5;
+ fixed32 onu_id_start = 6;
+ fixed32 onu_id_end = 7;
+ fixed32 alloc_id_start = 8;
+ fixed32 alloc_id_end = 9;
+ fixed32 gemport_id_start = 10;
+ fixed32 gemport_id_end = 11;
+ fixed32 pon_ports = 12;
+}
+
message Classifier {
fixed32 o_tpid = 1;
fixed32 o_vid = 2;