Browse Source

Perform remainder of hashfast_detect_common setup.

nfactor-troky
Con Kolivas 11 years ago
parent
commit
93d1f93fdd
  1. 12
      driver-hashfast.c
  2. 11
      driver-hashfast.h

12
driver-hashfast.c

@ -303,12 +303,24 @@ static bool hashfast_detect_common(struct cgpu_info *hashfast) @@ -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;
}

11
driver-hashfast.h

@ -19,6 +19,17 @@ @@ -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

Loading…
Cancel
Save