VOL-1253 OpenOLT - fix port info in packet-in

Change-Id: Ide62c7b2745c4e0b2248b55162aa33a51a0129d0
diff --git a/voltha/adapters/openolt/openolt_device.py b/voltha/adapters/openolt/openolt_device.py
index dc56c94..0255901 100644
--- a/voltha/adapters/openolt/openolt_device.py
+++ b/voltha/adapters/openolt/openolt_device.py
@@ -628,18 +628,31 @@
 
     def packet_indication(self, pkt_indication):
 
-        self.log.debug("packet indication", intf_id=pkt_indication.intf_id,
+        self.log.debug("packet indication",
+                       intf_type=pkt_indication.intf_type,
+                       intf_id=pkt_indication.intf_id,
                        gemport_id=pkt_indication.gemport_id,
                        flow_id=pkt_indication.flow_id)
 
-        onu_id = platform.onu_id_from_gemport_id(pkt_indication.gemport_id)
-        logical_port_num = platform.mk_uni_port_num(pkt_indication.intf_id,
-                                                    onu_id)
+        if pkt_indication.intf_type == "pon":
+            onu_id = platform.onu_id_from_gemport_id(pkt_indication.gemport_id)
+            logical_port_num = platform.mk_uni_port_num(pkt_indication.intf_id,
+                                                        onu_id)
+        elif pkt_indication.intf_type == "nni":
+            logical_port_num = platform.intf_id_to_port_no(
+                pkt_indication.intf_id,
+                Port.ETHERNET_NNI)
 
         pkt = Ether(pkt_indication.pkt)
-        kw = dict(logical_device_id=self.logical_device_id,
-                  logical_port_no=logical_port_num)
-        self.adapter_agent.send_packet_in(packet=str(pkt), **kw)
+
+        self.log.debug("packet indication",
+                       logical_device_id=self.logical_device_id,
+                       logical_port_no=logical_port_num)
+
+        self.adapter_agent.send_packet_in(
+            logical_device_id=self.logical_device_id,
+            logical_port_no=logical_port_num,
+            packet=str(pkt))
 
     def packet_out(self, egress_port, msg):
         pkt = Ether(msg)
diff --git a/voltha/adapters/openolt/protos/openolt.proto b/voltha/adapters/openolt/protos/openolt.proto
index 6c36de4..d357334 100644
--- a/voltha/adapters/openolt/protos/openolt.proto
+++ b/voltha/adapters/openolt/protos/openolt.proto
@@ -199,6 +199,7 @@
 }
 
 message PacketIndication {
+    string intf_type = 5;		// nni, pon, unknown
     fixed32 intf_id = 1;
     fixed32 gemport_id = 2;
     fixed32 flow_id = 3;
@@ -218,9 +219,7 @@
     fixed32 onu_id = 2;
     SerialNumber serial_number = 3;
     fixed32 pir = 4;   // peak information rate assigned to onu
-    fixed32 agg_port_id = 5;
-    fixed32 sched_id = 6;
-
+    fixed32 alloc_id = 5;
 }
 
 message OmciMsg {