Implement max temp and volt monitoring on statline for hashfast driver.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
diff --git a/driver-hashfast.c b/driver-hashfast.c
index cae796d..ffc010a 100644
--- a/driver-hashfast.c
+++ b/driver-hashfast.c
@@ -835,6 +835,34 @@ static struct api_data *hfa_api_stats(struct cgpu_info *cgpu)
return root;
}
+static void hfa_statline_before(char *buf, size_t bufsiz, struct cgpu_info *hashfast)
+{
+ struct hashfast_info *info = hashfast->device_data;
+ double max_temp, max_volt;
+ struct hf_g1_die_data *d;
+ int i;
+
+ max_temp = max_volt = 0.0;
+
+ for (i = 0; i < info->asic_count; i++) {
+ double temp;
+ int j;
+
+ d = &info->die_status[i];
+ temp = GN_DIE_TEMPERATURE(d->die.die_temperature);
+ if (temp > max_temp)
+ max_temp = temp;
+ for (j = 0; j < 6; j++) {
+ double volt = GN_CORE_VOLTAGE(d->die.core_voltage[j]);
+
+ if (volt > max_volt)
+ max_volt = volt;
+ }
+ }
+
+ tailsprintf(buf, bufsiz, " max%3.0fC %3.2fV | ", max_temp, max_volt);
+}
+
static void hfa_init(struct cgpu_info __maybe_unused *hashfast)
{
}
@@ -879,6 +907,7 @@ struct device_drv hashfast_drv = {
.hash_work = &hash_driver_work,
.scanwork = hfa_scanwork,
.get_api_stats = hfa_api_stats,
+ .get_statline_before = hfa_statline_before,
.reinit_device = hfa_init,
.thread_shutdown = hfa_shutdown,
};