Perform remainder of hashfast_detect_common setup.
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 48 49 50 51
diff --git a/driver-hashfast.c b/driver-hashfast.c
index d71686e..d19e486 100644
--- a/driver-hashfast.c
+++ b/driver-hashfast.c
@@ -303,12 +303,24 @@ static bool hashfast_detect_common(struct cgpu_info *hashfast)
ret = hashfast_reset(hashfast, info);
if (!ret) {
free(info);
+ hashfast->device_data = NULL;
return false;
}
+ // The per-die status array
+ info->die_status = calloc(info->asic_count, sizeof(struct hf_g1_die_data));
+ if (unlikely(!(info->die_status)))
+ quit(1, "Failed to calloc die_status");
+
+ // The per-die statistics array
+ info->die_statistics = calloc(info->asic_count, sizeof(struct hf_long_statistics));
+ if (unlikely(!(info->die_statistics)))
+ quit(1, "Failed to calloc die_statistics");
+
info->works = calloc(sizeof(struct work *), HF_NUM_SEQUENCE);
if (!info->works)
quit(1, "Failed to calloc info works in hashfast_detect_common");
+
return true;
}
diff --git a/driver-hashfast.h b/driver-hashfast.h
index 867e6ad..4bd89f5 100644
--- a/driver-hashfast.h
+++ b/driver-hashfast.h
@@ -19,6 +19,17 @@
#define HASHFAST_MINER_THREADS 1
#define HF_NUM_SEQUENCE 256
+// Matching fields for hf_statistics, but large #'s for local accumulation, per-die
+struct hf_long_statistics {
+ uint64_t rx_header_crc; // Header CRC's
+ uint64_t rx_body_crc; // Data CRC's
+ uint64_t rx_header_timeouts; // Header timeouts
+ uint64_t rx_body_timeouts; // Data timeouts
+ uint64_t core_nonce_fifo_full; // Core nonce Q overrun events
+ uint64_t array_nonce_fifo_full; // System nonce Q overrun events
+ uint64_t stats_overrun; // Overrun in statistics reporting
+} __attribute__((packed,aligned(4)));
+
struct hashfast_info {
int asic_count; // # of chips in the chain
int core_count; // # of cores per chip