Skip to content

Commit

Permalink
Merge pull request #984 from muthukumars-arrcus/sfp_softselect_multirate
Browse files Browse the repository at this point in the history
Enhanced the ONLP_SFP_CONTROL for 'Soft Rate_Select Select' in Optional Status/Control Bits as per SFF-8472  Specification for Management Interface for SFP+
  • Loading branch information
sonoble authored Jun 28, 2024
2 parents 800e123 + 83b4174 commit ad40508
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
5 changes: 4 additions & 1 deletion packages/base/any/onlp/src/onlp/module/inc/onlp/sfp.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ typedef enum onlp_sfp_control_e {
ONLP_SFP_CONTROL_TX_DISABLE,
ONLP_SFP_CONTROL_TX_DISABLE_CHANNEL,
ONLP_SFP_CONTROL_LP_MODE,
ONLP_SFP_CONTROL_SOFT_RATE_SELECT,
ONLP_SFP_CONTROL_POWER_OVERRIDE,
ONLP_SFP_CONTROL_LAST = ONLP_SFP_CONTROL_POWER_OVERRIDE,
ONLP_SFP_CONTROL_COUNT,
Expand All @@ -58,7 +59,8 @@ typedef enum onlp_sfp_control_flag_e {
ONLP_SFP_CONTROL_FLAG_TX_DISABLE = (1 << 4),
ONLP_SFP_CONTROL_FLAG_TX_DISABLE_CHANNEL = (1 << 5),
ONLP_SFP_CONTROL_FLAG_LP_MODE = (1 << 6),
ONLP_SFP_CONTROL_FLAG_POWER_OVERRIDE = (1 << 7),
ONLP_SFP_CONTROL_FLAG_SOFT_RATE_SELECT = (1 << 7),
ONLP_SFP_CONTROL_FLAG_POWER_OVERRIDE = (1 << 8),
} onlp_sfp_control_flag_t;
/* <auto.end.enum(tag:sfp2).define> */

Expand Down Expand Up @@ -242,6 +244,7 @@ int onlp_sfp_control_flags_get(int port, uint32_t* flags);
"TX_DISABLE", \
"TX_DISABLE_CHANNEL", \
"LP_MODE", \
"SOFT_RATE_SELECT", \
"POWER_OVERRIDE", \
}
/** Enum names. */
Expand Down
5 changes: 4 additions & 1 deletion packages/base/any/onlp/src/onlp/module/src/onlp_enums.c
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,7 @@ aim_map_si_t onlp_sfp_control_map[] =
{ "TX_DISABLE", ONLP_SFP_CONTROL_TX_DISABLE },
{ "TX_DISABLE_CHANNEL", ONLP_SFP_CONTROL_TX_DISABLE_CHANNEL },
{ "LP_MODE", ONLP_SFP_CONTROL_LP_MODE },
{ "SOFT_RATE_SELECT", ONLP_SFP_CONTROL_SOFT_RATE_SELECT},
{ "POWER_OVERRIDE", ONLP_SFP_CONTROL_POWER_OVERRIDE },
{ NULL, 0 }
};
Expand All @@ -869,6 +870,7 @@ aim_map_si_t onlp_sfp_control_desc_map[] =
{ "None", ONLP_SFP_CONTROL_TX_DISABLE },
{ "None", ONLP_SFP_CONTROL_TX_DISABLE_CHANNEL },
{ "None", ONLP_SFP_CONTROL_LP_MODE },
{ "None", ONLP_SFP_CONTROL_SOFT_RATE_SELECT },
{ "None", ONLP_SFP_CONTROL_POWER_OVERRIDE },
{ NULL, 0 }
};
Expand Down Expand Up @@ -922,6 +924,7 @@ aim_map_si_t onlp_sfp_control_flag_map[] =
{ "TX_DISABLE", ONLP_SFP_CONTROL_FLAG_TX_DISABLE },
{ "TX_DISABLE_CHANNEL", ONLP_SFP_CONTROL_FLAG_TX_DISABLE_CHANNEL },
{ "LP_MODE", ONLP_SFP_CONTROL_FLAG_LP_MODE },
{ "SOFT_RATE_SELECT", ONLP_SFP_CONTROL_FLAG_SOFT_RATE_SELECT},
{ "POWER_OVERRIDE", ONLP_SFP_CONTROL_FLAG_POWER_OVERRIDE },
{ NULL, 0 }
};
Expand All @@ -935,6 +938,7 @@ aim_map_si_t onlp_sfp_control_flag_desc_map[] =
{ "None", ONLP_SFP_CONTROL_FLAG_TX_DISABLE },
{ "None", ONLP_SFP_CONTROL_FLAG_TX_DISABLE_CHANNEL },
{ "None", ONLP_SFP_CONTROL_FLAG_LP_MODE },
{ "None", ONLP_SFP_CONTROL_FLAG_SOFT_RATE_SELECT },
{ "None", ONLP_SFP_CONTROL_FLAG_POWER_OVERRIDE },
{ NULL, 0 }
};
Expand Down Expand Up @@ -1243,4 +1247,3 @@ onlp_thermal_threshold_valid(onlp_thermal_threshold_t e)
}

/* <auto.end.enum(ALL).source> */

3 changes: 3 additions & 0 deletions packages/base/any/onlp/src/onlp/module/src/onlp_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ show_inventory__(aim_pvs_t* pvs, int database)
if(status & ONLP_SFP_CONTROL_FLAG_LP_MODE) {
*cp++ = 'L';
}
if(status & ONLP_SFP_CONTROL_FLAG_SOFT_RATE_SELECT) {
*cp++ = 'M';
}
aim_printf(pvs, "%4d %-14s %-6s %-6.6s %-5.5s %-16.16s %-16.16s %16.16s\n",
port,
sff.info.module_type_name,
Expand Down
3 changes: 2 additions & 1 deletion packages/base/any/onlp/src/onlp/module/src/sfp.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,8 @@ onlp_sfp_control_flags_get(int port, uint32_t* flags)
ONLP_SFP_CONTROL_RESET_STATE,
ONLP_SFP_CONTROL_RX_LOS,
ONLP_SFP_CONTROL_TX_DISABLE,
ONLP_SFP_CONTROL_LP_MODE
ONLP_SFP_CONTROL_LP_MODE,
ONLP_SFP_CONTROL_SOFT_RATE_SELECT
};

if(flags) {
Expand Down

0 comments on commit ad40508

Please sign in to comment.