mirror of
https://github.com/Telecominfraproject/OpenNetworkLinux.git
synced 2025-12-25 09:17:08 +00:00
[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:
17
packages/platforms/accton/x86-64/x86-64-accton-as5916-26xb/onlp/builds/src/module/src/psui.c
Normal file → Executable file
17
packages/platforms/accton/x86-64/x86-64-accton-as5916-26xb/onlp/builds/src/module/src/psui.c
Normal file → Executable 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 */
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user