|
@@ -176,6 +176,39 @@ static void metabank_shutdown(struct thr_info *thr)
|
|
|
tm_i2c_close();
|
|
tm_i2c_close();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+static bool metabank_get_stats(struct cgpu_info *cgpu)
|
|
|
|
|
+{
|
|
|
|
|
+ struct bitfury_device * const bitfury = cgpu->device_data;
|
|
|
|
|
+ float t;
|
|
|
|
|
+
|
|
|
|
|
+ t = tm_i2c_gettemp(bitfury->slot) * 0.1;
|
|
|
|
|
+
|
|
|
|
|
+ if (t < -27) //Sometimes tm_i2c_gettemp() returns strange result, ignoring it.
|
|
|
|
|
+ return false;
|
|
|
|
|
+
|
|
|
|
|
+ cgpu->temp = t;
|
|
|
|
|
+
|
|
|
|
|
+ return true;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+static struct api_data *metabank_api_extra_device_status(struct cgpu_info *cgpu)
|
|
|
|
|
+{
|
|
|
|
|
+ struct api_data *root = NULL;
|
|
|
|
|
+ float vc0, vc1;
|
|
|
|
|
+ struct bitfury_device * const bitfury = cgpu->device_data;
|
|
|
|
|
+
|
|
|
|
|
+ root = api_add_uint(root, "Slot", &(bitfury->slot), false);
|
|
|
|
|
+ root = api_add_int(root, "Clock Bits", (int*)&bitfury->osc6_bits, false);
|
|
|
|
|
+
|
|
|
|
|
+ vc0 = tm_i2c_getcore0(bitfury->slot);
|
|
|
|
|
+ vc1 = tm_i2c_getcore1(bitfury->slot);
|
|
|
|
|
+
|
|
|
|
|
+ root = api_add_volts(root, "Slot VC0", &vc0, true);
|
|
|
|
|
+ root = api_add_volts(root, "Slot VC1", &vc1, true);
|
|
|
|
|
+
|
|
|
|
|
+ return root;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
struct device_drv metabank_drv = {
|
|
struct device_drv metabank_drv = {
|
|
|
.dname = "metabank",
|
|
.dname = "metabank",
|
|
|
.name = "MBF",
|
|
.name = "MBF",
|
|
@@ -194,4 +227,6 @@ struct device_drv metabank_drv = {
|
|
|
.job_process_results = bitfury_job_process_results,
|
|
.job_process_results = bitfury_job_process_results,
|
|
|
|
|
|
|
|
.thread_shutdown = metabank_shutdown,
|
|
.thread_shutdown = metabank_shutdown,
|
|
|
|
|
+ .get_api_extra_device_status = metabank_api_extra_device_status,
|
|
|
|
|
+ .get_stats = metabank_get_stats,
|
|
|
};
|
|
};
|