Commit 93d1f93fdd33b3b462bc47a004cfe93a1ca6a6d2

Con Kolivas 2013-10-13T22:34:16

Perform remainder of hashfast_detect_common setup.

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