Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ _onlp_get_fan_direction_on_psu(void)
continue;
}

if (PSU_TYPE_AC_F2B == psu_type) {
if (PSU_TYPE_AC_F2B == psu_type || PSU_TYPE_DC_F2B == psu_type) {
return ONLP_FAN_STATUS_F2B;
}
else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ psu_type_t get_psu_type(int id, char* modelname, int modelname_len)

AIM_FREE_IF_PTR(fd);
}
else if (strncmp(mn, "YM-2401HCR", 10) == 0) {
ptype = PSU_TYPE_DC_F2B;
}
else if (strncmp(mn, "YM-2401HDR", 10) == 0) {
ptype = PSU_TYPE_DC_B2F;
}
else if (strncmp(mn, "DPS400AB33A", PSU_MODEL_NAME_LEN) == 0) {
ptype = PSU_TYPE_AC_F2B;
}
Expand Down Expand Up @@ -152,4 +158,4 @@ int psu_ym1401_pmbus_info_set(int id, char *node, int value)
}

return ONLP_STATUS_OK;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,16 @@ enum onlp_thermal_id
typedef enum psu_type {
PSU_TYPE_UNKNOWN,
PSU_TYPE_AC_F2B,
PSU_TYPE_AC_B2F
PSU_TYPE_AC_B2F,
PSU_TYPE_DC_F2B,
PSU_TYPE_DC_B2F
} psu_type_t;

psu_type_t get_psu_type(int id, char* modelname, int modelname_len);
int get_psu_serial_number(int id, char *serial, int serial_len);

#define IS_DC_INPUT(psu_type) (PSU_TYPE_DC_F2B == psu_type || PSU_TYPE_DC_B2F == psu_type)

#define DEBUG_MODE 0

#if (DEBUG_MODE == 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,18 @@ onlp_psui_init(void)
}

static int
psu_ym1401_info_get(onlp_psu_info_t* info)
psu_ym1401_info_get(onlp_psu_info_t* info, bool is_dc_input)
{
int val = 0;
int index = ONLP_OID_ID_GET(info->hdr.id);

/* Set capability
*/
info->caps = ONLP_PSU_CAPS_AC;
info->caps = (is_dc_input)? ONLP_PSU_CAPS_DC48 : ONLP_PSU_CAPS_AC;

if (info->status & ONLP_PSU_STATUS_FAILED) {
return ONLP_STATUS_OK;
}
if (info->status & ONLP_PSU_STATUS_FAILED) {
return ONLP_STATUS_OK;
}

/* Set the associated oid_table */
info->hdr.coids[0] = ONLP_FAN_ID_CREATE(index + CHASSIS_FAN_COUNT);
Expand Down Expand Up @@ -162,7 +162,9 @@ onlp_psui_info_get(onlp_oid_t id, onlp_psu_info_t* info)
switch (psu_type) {
case PSU_TYPE_AC_F2B:
case PSU_TYPE_AC_B2F:
ret = psu_ym1401_info_get(info);
case PSU_TYPE_DC_F2B:
case PSU_TYPE_DC_B2F:
ret = psu_ym1401_info_get(info, IS_DC_INPUT(psu_type));
break;
case PSU_TYPE_UNKNOWN: /* User insert a unknown PSU or unplugged.*/
info->status |= ONLP_PSU_STATUS_UNPLUGGED;
Expand Down