/* Broadcom NetXtreme-C/E network driver. * * Copyright (c) 2023 Broadcom Limited * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation.
*/
switch (attr) { case hwmon_temp_input: return 0444; case hwmon_temp_max: case hwmon_temp_crit: case hwmon_temp_emergency: case hwmon_temp_max_alarm: case hwmon_temp_crit_alarm: case hwmon_temp_emergency_alarm: if (!(bp->fw_cap & BNXT_FW_CAP_THRESHOLD_TEMP_SUPPORTED)) return 0; return 0444; default: return 0;
}
}
staticint bnxt_hwmon_read(struct device *dev, enum hwmon_sensor_types type, u32 attr, int channel, long *val)
{ struct bnxt *bp = dev_get_drvdata(dev);
u8 temp = 0; int rc;
switch (attr) { case hwmon_temp_input:
rc = bnxt_hwrm_temp_query(bp, &temp); if (!rc)
*val = temp * 1000; return rc; case hwmon_temp_max:
*val = bp->warn_thresh_temp * 1000; return 0; case hwmon_temp_crit:
*val = bp->crit_thresh_temp * 1000; return 0; case hwmon_temp_emergency:
*val = bp->fatal_thresh_temp * 1000; return 0; case hwmon_temp_max_alarm:
rc = bnxt_hwrm_temp_query(bp, &temp); if (!rc)
*val = temp >= bp->warn_thresh_temp; return rc; case hwmon_temp_crit_alarm:
rc = bnxt_hwrm_temp_query(bp, &temp); if (!rc)
*val = temp >= bp->crit_thresh_temp; return rc; case hwmon_temp_emergency_alarm:
rc = bnxt_hwrm_temp_query(bp, &temp); if (!rc)
*val = temp >= bp->fatal_thresh_temp; return rc; default: return -EOPNOTSUPP;
}
}
/* temp1_xxx is only sensor, ensure not registered if it will fail */
rc = bnxt_hwrm_temp_query(bp, NULL); if (rc == -EACCES || rc == -EOPNOTSUPP) {
bnxt_hwmon_uninit(bp); return;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.