VOL-336 : Add Channel Termination Name in ONU device proxy address
Add Channel Termination Name and channel group ID in ONU device proxy address to
identify ONU device on actual ranged channel termination.
Change-Id: I67d31176807c4475d5d78ac46733aafb4a2625b7
diff --git a/voltha/core/xpon_agent.py b/voltha/core/xpon_agent.py
index a599be3..127760a 100644
--- a/voltha/core/xpon_agent.py
+++ b/voltha/core/xpon_agent.py
@@ -661,6 +661,15 @@
return port.port_no
return 0
+ def get_channel_group_for_vont_ani(self, v_ont_ani):
+ _cp = self.core.get_proxy('/').get('/channel_partitions/{}'.format(
+ v_ont_ani.data.parent_ref))
+ assert _cp is not None
+ _cg = self.core.get_proxy('/').get('/channel_groups/{}'.format(
+ _cp.data.channelgroup_ref))
+ assert _cg is not None
+ return _cg.cg_index
+
def create_onu_device(self, device, v_ont_ani):
log.info('create-onu-device', device_id=device.id, v_ont_ani=v_ont_ani)
adapter_agent = self.get_device_adapter_agent(device)
@@ -670,7 +679,9 @@
vendor_id = v_ont_ani.data.expected_serial_number[:4]
proxy_address = Device.ProxyAddress(
device_id=device.id,
+ channel_group_id=self.get_channel_group_for_vont_ani(v_ont_ani),
channel_id=parent_chnl_pair_id,
+ channel_termination=v_ont_ani.data.preferred_chanpair,
onu_id=v_ont_ani.data.onu_id, onu_session_id=v_ont_ani.data.onu_id)
adapter_agent.add_onu_device(
parent_device_id=device.id, parent_port_no=parent_chnl_pair_id,
diff --git a/voltha/protos/device.proto b/voltha/protos/device.proto
index bc0139b..15db1f1 100644
--- a/voltha/protos/device.proto
+++ b/voltha/protos/device.proto
@@ -238,6 +238,8 @@
message ProxyAddress {
string device_id = 1; // Which device to use as proxy to this device
uint32 channel_id = 2; // Sub-address within proxy
+ uint32 channel_group_id = 5; // Channel Group index
+ string channel_termination = 6; // Channel Termination name
uint32 onu_id = 3; // onu identifier; optional
uint32 onu_session_id = 4; // session identifier for the ONU; optional
};