[VOL-3774] Remove hardcording of NNI port speed
Change-Id: I1c1e50403ac0faabed31ed11be2b59a863c62cb9
diff --git a/agent/common/core.h b/agent/common/core.h
index 09ff890..6dba610 100644
--- a/agent/common/core.h
+++ b/agent/common/core.h
@@ -212,6 +212,7 @@
Status EnablePonIf_(uint32_t intf_id);
Status DisablePonIf_(uint32_t intf_id);
Status SetStateUplinkIf_(uint32_t intf_id, bool set_state);
+uint32_t GetNniSpeed_(uint32_t intf_id);
unsigned NumNniIf_();
unsigned NumPonIf_();
Status OmciMsgOut_(uint32_t intf_id, uint32_t onu_id, const std::string pkt);
@@ -246,7 +247,7 @@
Status GetPonRxPower_(uint32_t intf_id, uint32_t onu_id, openolt::PonRxPowerData* response);
int get_status_bcm_cli_quit(void);
uint16_t get_dev_id(void);
-Status pushOltOperInd(uint32_t intf_id, const char *type, const char *state);
+Status pushOltOperInd(uint32_t intf_id, const char *type, const char *state, uint32_t speed);
uint64_t get_flow_status(uint16_t flow_id, uint16_t flow_type, uint16_t data_id);
void stats_collection();
diff --git a/agent/common/main.cc b/agent/common/main.cc
index 549bd59..ce55e4d 100644
--- a/agent/common/main.cc
+++ b/agent/common/main.cc
@@ -112,10 +112,10 @@
status = EnablePonIf_(i);
if (!status.ok()) {
// raise alarm to report error in enabling PON
- pushOltOperInd(i, "pon", "down");
+ pushOltOperInd(i, "pon", "down", 0 /*Speed will be ignored in the adapter for PONs*/ );
}
else
- pushOltOperInd(i, "pon", "up");
+ pushOltOperInd(i, "pon", "up", 0 /*Speed will be ignored in the adapter for PONs*/);
}
sleep(2);
// Enable all NNI interfaces.
@@ -131,13 +131,15 @@
}
#endif
//only for nni-65536 mapping to intf_id 0
+ uint32_t nni_speed = GetNniSpeed_(0);
status = SetStateUplinkIf_(0, true);
if (!status.ok()) {
// raise alarm to report error in enabling NNI
- pushOltOperInd(0, "nni", "down");
+ pushOltOperInd(0, "nni", "down", nni_speed);
}
- else
- pushOltOperInd(0, "nni", "up");
+ else{
+ pushOltOperInd(0, "nni", "up", nni_speed);
+ }
for (int i = 1; i < argc; ++i) {
if(strcmp(argv[i-1], "--interface") == 0 || (strcmp(argv[i-1], "--intf") == 0)) {