[platform]as5916-26xb/as7316-26xb: onlpdump get psu capabilities of DC or AC.

Signed-off-by: roy_lee <roy_lee@accton.com>
This commit is contained in:
roy_lee
2018-11-01 15:17:06 +08:00
parent 6f3598e330
commit 200f35319a
2 changed files with 34 additions and 0 deletions

View File

@@ -57,6 +57,22 @@ static onlp_psu_info_t pinfo[] =
}
};
static int
get_DCorAC_cap(char *model)
{
const char *dc_models[] = {"YM-2401U", "um400d", NULL };
int i;
i = 0;
while(dc_models[i]) {
if (!strncasecmp(model, dc_models[i], strlen(dc_models[i]))){
return ONLP_PSU_CAPS_DC12;
}
i++;
}
return ONLP_PSU_CAPS_AC;
}
int
onlp_psui_info_get(onlp_oid_t id, onlp_psu_info_t* info)
{
@@ -140,6 +156,7 @@ onlp_psui_info_get(onlp_oid_t id, onlp_psu_info_t* info)
if (string && len) {
strncpy(info->model, string, len);
aim_free(string);
info->caps |= get_DCorAC_cap (info->model);
}
/* Read serial */

View File

@@ -57,6 +57,22 @@ static onlp_psu_info_t pinfo[] =
}
};
static int
get_DCorAC_cap(char *model)
{
const char *dc_models[] = {"YM-2401U", "um400d", NULL };
int i;
i = 0;
while(dc_models[i]) {
if (!strncasecmp(model, dc_models[i], strlen(dc_models[i]))){
return ONLP_PSU_CAPS_DC12;
}
i++;
}
return ONLP_PSU_CAPS_AC;
}
int
onlp_psui_info_get(onlp_oid_t id, onlp_psu_info_t* info)
{
@@ -140,6 +156,7 @@ onlp_psui_info_get(onlp_oid_t id, onlp_psu_info_t* info)
if (string && len) {
strncpy(info->model, string, len);
aim_free(string);
info->caps |= get_DCorAC_cap (info->model);
}
/* Read serial */