DeviceInfo that makes voltha rsrc mgr happy
diff --git a/core/grpc_service.go b/core/grpc_service.go
index 41da7f0..e1866b8 100644
--- a/core/grpc_service.go
+++ b/core/grpc_service.go
@@ -51,12 +51,63 @@
}
func (s *Server) GetDeviceInfo(c context.Context, empty *openolt.Empty) (*openolt.DeviceInfo, error) {
- logger.Info("OLT receives GetDeviceInfo()\n")
- devinfo := new(openolt.DeviceInfo)
- devinfo.Vendor = "CORD"
- devinfo.OnuIdStart = 0
- devinfo.OnuIdEnd = 3
- devinfo.PonPorts = 4
+ logger.Info("OLT receives GetDeviceInfo()\n")
+ devinfo := new(openolt.DeviceInfo)
+ devinfo.Vendor = "EdgeCore"
+ devinfo.Model = "asfvolt16"
+ devinfo.HardwareVersion = ""
+ devinfo.FirmwareVersion = ""
+ devinfo.Technology = "xgspon"
+ devinfo.PonPorts = 1
+ devinfo.OnuIdStart = 1
+ devinfo.OnuIdEnd = 255
+ devinfo.AllocIdStart = 1024
+ devinfo.AllocIdEnd = 16383
+ devinfo.GemportIdStart = 1024
+ devinfo.GemportIdEnd = 65535
+ devinfo.FlowIdStart = 1
+ devinfo.FlowIdEnd = 16383
+
+ /*
+ for intf_id := 0; intf_id < 16; intf_id++ {
+ r := new(openolt.DeviceInfo_DeviceResourceRanges)
+
+ r.IntfIds = append(r.IntfIds, uint32(intf_id))
+
+ r.Technology = "xgspon"
+
+ p := new(openolt.DeviceInfo_DeviceResourceRanges_Pool)
+ p.Type = openolt.DeviceInfo_DeviceResourceRanges_Pool_ONU_ID
+ p.Sharing = openolt.DeviceInfo_DeviceResourceRanges_Pool_DEDICATED_PER_INTF
+ p.Start = 1
+ p.End = 255
+ r.Pools = append(r.Pools, p)
+
+ p = new(openolt.DeviceInfo_DeviceResourceRanges_Pool)
+ p.Type = openolt.DeviceInfo_DeviceResourceRanges_Pool_ALLOC_ID
+ p.Sharing = openolt.DeviceInfo_DeviceResourceRanges_Pool_SHARED_BY_ALL_INTF_SAME_TECH
+ p.Start = 1024
+ p.End = 16383
+ r.Pools = append(r.Pools, p)
+
+ p = new(openolt.DeviceInfo_DeviceResourceRanges_Pool)
+ p.Type = openolt.DeviceInfo_DeviceResourceRanges_Pool_GEMPORT_ID
+ p.Sharing = openolt.DeviceInfo_DeviceResourceRanges_Pool_SHARED_BY_ALL_INTF_ALL_TECH
+ p.Start = 1024
+ p.End = 65535
+ r.Pools = append(r.Pools, p)
+
+ p = new(openolt.DeviceInfo_DeviceResourceRanges_Pool)
+ p.Type = openolt.DeviceInfo_DeviceResourceRanges_Pool_FLOW_ID
+ p.Sharing = openolt.DeviceInfo_DeviceResourceRanges_Pool_SHARED_BY_ALL_INTF_ALL_TECH
+ p.Start = 1
+ p.End = 16383
+ r.Pools = append(r.Pools, p)
+
+ devinfo.Ranges = append(devinfo.Ranges, r)
+ }
+ */
+
return devinfo, nil
}