|
|
|
@ -64,6 +64,7 @@ typedef struct klondike_status {
@@ -64,6 +64,7 @@ typedef struct klondike_status {
|
|
|
|
|
uint8_t errorcount; |
|
|
|
|
uint16_t hashcount; |
|
|
|
|
uint16_t maxcount; |
|
|
|
|
uint8_t noise; |
|
|
|
|
} WORKSTATUS; |
|
|
|
|
|
|
|
|
|
typedef struct _worktask { |
|
|
|
@ -109,6 +110,8 @@ struct klondike_info {
@@ -109,6 +110,8 @@ struct klondike_info {
|
|
|
|
|
int nextreply; |
|
|
|
|
int noncecount; |
|
|
|
|
uint64_t hashcount; |
|
|
|
|
uint64_t errorcount; |
|
|
|
|
uint64_t noisecount; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
IDENTITY KlondikeID; |
|
|
|
@ -341,6 +344,7 @@ static void *klondike_get_replies(void *userdata)
@@ -341,6 +344,7 @@ static void *klondike_get_replies(void *userdata)
|
|
|
|
|
{ |
|
|
|
|
struct cgpu_info *klncgpu = (struct cgpu_info *)userdata; |
|
|
|
|
struct klondike_info *klninfo = (struct klondike_info *)(klncgpu->device_data); |
|
|
|
|
struct klondike_status *ks; |
|
|
|
|
char *replybuf; |
|
|
|
|
int err, recd; |
|
|
|
|
|
|
|
|
@ -364,8 +368,23 @@ static void *klondike_get_replies(void *userdata)
@@ -364,8 +368,23 @@ static void *klondike_get_replies(void *userdata)
|
|
|
|
|
klninfo->nextreply = 0; |
|
|
|
|
|
|
|
|
|
replybuf[0] = replybuf[1]; |
|
|
|
|
if (replybuf[0] == '=') |
|
|
|
|
klondike_check_nonce(klncgpu, (WORKRESULT *)replybuf); |
|
|
|
|
switch (replybuf[0]) { |
|
|
|
|
case '=': |
|
|
|
|
klondike_check_nonce(klncgpu, (WORKRESULT *)replybuf); |
|
|
|
|
break; |
|
|
|
|
case 'S': |
|
|
|
|
case 'W': |
|
|
|
|
case 'A': |
|
|
|
|
case 'E': |
|
|
|
|
ks = (struct klondike_status *)(replybuf+1); |
|
|
|
|
wr_lock(&(klninfo->stat_lock)); |
|
|
|
|
klninfo->errorcount += ks->errorcount; |
|
|
|
|
klninfo->noisecount += ks->noise; |
|
|
|
|
wr_unlock(&(klninfo->stat_lock)); |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return NULL; |
|
|
|
@ -607,6 +626,8 @@ static struct api_data *klondike_api_stats(struct cgpu_info *klncgpu)
@@ -607,6 +626,8 @@ static struct api_data *klondike_api_stats(struct cgpu_info *klncgpu)
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
root = api_add_uint64(root, "Hash Count", &(klninfo->hashcount), true); |
|
|
|
|
root = api_add_uint64(root, "Error Count", &(klninfo->errorcount), true); |
|
|
|
|
root = api_add_uint64(root, "Noise Count", &(klninfo->noisecount), true); |
|
|
|
|
|
|
|
|
|
rd_unlock(&(klninfo->stat_lock)); |
|
|
|
|
|
|
|
|
|