Browse Source

Add API Notify counter 'Comms Error'

nfactor-troky
Kano 13 years ago
parent
commit
ff0afb94ec
  1. 1
      API-README
  2. 4
      api.c
  3. 4
      driver-bitforce.c
  4. 3
      miner.h

1
API-README

@ -313,6 +313,7 @@ API V1.14
Modified API commands: Modified API commands:
'stats' - more icarus timing stats added 'stats' - more icarus timing stats added
'notify' - include new device comms error counter
The internal code for handling data was rewritten (~25% of the code) The internal code for handling data was rewritten (~25% of the code)
Completely backward compatible Completely backward compatible

4
api.c

@ -2419,6 +2419,9 @@ void notifystatus(int device, struct cgpu_info *cgpu, bool isjson, __maybe_unuse
case REASON_DEV_THERMAL_CUTOFF: case REASON_DEV_THERMAL_CUTOFF:
reason = REASON_DEV_THERMAL_CUTOFF_STR; reason = REASON_DEV_THERMAL_CUTOFF_STR;
break; break;
case REASON_DEV_COMMS_ERROR:
reason = REASON_DEV_COMMS_ERROR_STR;
break;
default: default:
reason = REASON_UNKNOWN_STR; reason = REASON_UNKNOWN_STR;
break; break;
@ -2440,6 +2443,7 @@ void notifystatus(int device, struct cgpu_info *cgpu, bool isjson, __maybe_unuse
root = api_add_int(root, "*Dev Nostart", &(cgpu->dev_nostart_count), false); root = api_add_int(root, "*Dev Nostart", &(cgpu->dev_nostart_count), false);
root = api_add_int(root, "*Dev Over Heat", &(cgpu->dev_over_heat_count), false); root = api_add_int(root, "*Dev Over Heat", &(cgpu->dev_over_heat_count), false);
root = api_add_int(root, "*Dev Thermal Cutoff", &(cgpu->dev_thermal_cutoff_count), false); root = api_add_int(root, "*Dev Thermal Cutoff", &(cgpu->dev_thermal_cutoff_count), false);
root = api_add_int(root, "*Dev Comms Error", &(cgpu->dev_comms_error_count), false);
if (isjson && (device > 0)) if (isjson && (device > 0))
strcat(io_buffer, COMMA); strcat(io_buffer, COMMA);

4
driver-bitforce.c

@ -412,8 +412,8 @@ static uint64_t bitforce_scanhash(struct thr_info *thr, struct work *work, uint6
ret = 1; ret = 1;
applog(LOG_ERR, "BFL%i: Comms error", bitforce->device_id); applog(LOG_ERR, "BFL%i: Comms error", bitforce->device_id);
bitforce->device_last_not_well = time(NULL); bitforce->device_last_not_well = time(NULL);
bitforce->device_not_well_reason = REASON_DEV_NOSTART; bitforce->device_not_well_reason = REASON_DEV_COMMS_ERROR;
bitforce->dev_nostart_count++; bitforce->dev_comms_error_count++;
/* empty read buffer */ /* empty read buffer */
biforce_clear_buffer(bitforce); biforce_clear_buffer(bitforce);
} }

3
miner.h

@ -272,6 +272,7 @@ enum dev_reason {
REASON_DEV_NOSTART, REASON_DEV_NOSTART,
REASON_DEV_OVER_HEAT, REASON_DEV_OVER_HEAT,
REASON_DEV_THERMAL_CUTOFF, REASON_DEV_THERMAL_CUTOFF,
REASON_DEV_COMMS_ERROR,
}; };
#define REASON_NONE "None" #define REASON_NONE "None"
@ -283,6 +284,7 @@ enum dev_reason {
#define REASON_DEV_NOSTART_STR "Device failed to start" #define REASON_DEV_NOSTART_STR "Device failed to start"
#define REASON_DEV_OVER_HEAT_STR "Device over heated" #define REASON_DEV_OVER_HEAT_STR "Device over heated"
#define REASON_DEV_THERMAL_CUTOFF_STR "Device reached thermal cutoff" #define REASON_DEV_THERMAL_CUTOFF_STR "Device reached thermal cutoff"
#define REASON_DEV_COMMS_ERROR_STR "Device comms error"
#define REASON_UNKNOWN_STR "Unknown reason - code bug" #define REASON_UNKNOWN_STR "Unknown reason - code bug"
#define MIN_SEC_UNSET 99999999 #define MIN_SEC_UNSET 99999999
@ -386,6 +388,7 @@ struct cgpu_info {
int dev_nostart_count; int dev_nostart_count;
int dev_over_heat_count; // It's a warning but worth knowing int dev_over_heat_count; // It's a warning but worth knowing
int dev_thermal_cutoff_count; int dev_thermal_cutoff_count;
int dev_comms_error_count;
struct cgminer_stats cgminer_stats; struct cgminer_stats cgminer_stats;
}; };

Loading…
Cancel
Save