VOL-3202: Include port capability in the port create message.
Change-Id: I7d8fbafb2db2834def1903f13a1af25eb57500e3
diff --git a/internal/pkg/core/device_handler.go b/internal/pkg/core/device_handler.go
index a5b131d..2cda872 100644
--- a/internal/pkg/core/device_handler.go
+++ b/internal/pkg/core/device_handler.go
@@ -289,12 +289,23 @@
}
}
}
+ capacity := uint32(of.OfpPortFeatures_OFPPF_1GB_FD | of.OfpPortFeatures_OFPPF_FIBER)
// Now create Port
port := &voltha.Port{
PortNo: portNum,
Label: label,
Type: portType,
OperStatus: operStatus,
+ OfpPort: &of.OfpPort{
+ HwAddr: macAddressToUint32Array(dh.device.MacAddress),
+ Config: 0,
+ State: uint32(of.OfpPortState_OFPPS_LIVE),
+ Curr: capacity,
+ Advertised: capacity,
+ Peer: capacity,
+ CurrSpeed: uint32(of.OfpPortFeatures_OFPPF_1GB_FD),
+ MaxSpeed: uint32(of.OfpPortFeatures_OFPPF_1GB_FD),
+ },
}
logger.Debugw("sending-port-update-to-core", log.Fields{"port": port})
// Synchronous call to update device - this method is run in its own go routine
@@ -848,27 +859,6 @@
}, nil
}
-//GetOfpPortInfo Get Ofp port information
-func (dh *DeviceHandler) GetOfpPortInfo(device *voltha.Device, portNo int64) (*ic.PortCapability, error) {
- capacity := uint32(of.OfpPortFeatures_OFPPF_1GB_FD | of.OfpPortFeatures_OFPPF_FIBER)
- return &ic.PortCapability{
- Port: &voltha.LogicalPort{
- OfpPort: &of.OfpPort{
- HwAddr: macAddressToUint32Array(dh.device.MacAddress),
- Config: 0,
- State: uint32(of.OfpPortState_OFPPS_LIVE),
- Curr: capacity,
- Advertised: capacity,
- Peer: capacity,
- CurrSpeed: uint32(of.OfpPortFeatures_OFPPF_1GB_FD),
- MaxSpeed: uint32(of.OfpPortFeatures_OFPPF_1GB_FD),
- },
- DeviceId: dh.device.Id,
- DevicePortNo: uint32(portNo),
- },
- }, nil
-}
-
func (dh *DeviceHandler) omciIndication(omciInd *oop.OmciIndication) error {
logger.Debugw("omci-indication", log.Fields{"intfID": omciInd.IntfId, "onuID": omciInd.OnuId, "device-id": dh.device.Id})
var deviceType string