|
@@ -167,6 +167,7 @@ static const char *SICK = "Sick";
|
|
|
static const char *NOSTART = "NoStart";
|
|
static const char *NOSTART = "NoStart";
|
|
|
static const char *DISABLED = "Disabled";
|
|
static const char *DISABLED = "Disabled";
|
|
|
static const char *ALIVE = "Alive";
|
|
static const char *ALIVE = "Alive";
|
|
|
|
|
+static const char *IDLE = "Idle";
|
|
|
static const char *REJECTING = "Rejecting";
|
|
static const char *REJECTING = "Rejecting";
|
|
|
static const char *UNKNOWN = "Unknown";
|
|
static const char *UNKNOWN = "Unknown";
|
|
|
#define _DYNAMIC "D"
|
|
#define _DYNAMIC "D"
|
|
@@ -879,7 +880,7 @@ static void pgastatus(int pga, bool isjson)
|
|
|
|
|
|
|
|
cgpu->utility = cgpu->accepted / ( total_secs ? total_secs : 1 ) * 60;
|
|
cgpu->utility = cgpu->accepted / ( total_secs ? total_secs : 1 ) * 60;
|
|
|
|
|
|
|
|
- if (cgpu->deven != DEV_DISABLED)
|
|
|
|
|
|
|
+ if (cgpu->deven == DEV_ENABLED)
|
|
|
enabled = (char *)YES;
|
|
enabled = (char *)YES;
|
|
|
else
|
|
else
|
|
|
enabled = (char *)NO;
|
|
enabled = (char *)NO;
|
|
@@ -890,6 +891,8 @@ static void pgastatus(int pga, bool isjson)
|
|
|
status = (char *)SICK;
|
|
status = (char *)SICK;
|
|
|
else if (cgpu->status == LIFE_NOSTART)
|
|
else if (cgpu->status == LIFE_NOSTART)
|
|
|
status = (char *)NOSTART;
|
|
status = (char *)NOSTART;
|
|
|
|
|
+ else if (cgpu->deven == DEV_IDLE)
|
|
|
|
|
+ status = (char *)IDLE;
|
|
|
else
|
|
else
|
|
|
status = (char *)ALIVE;
|
|
status = (char *)ALIVE;
|
|
|
|
|
|
|
@@ -1092,7 +1095,7 @@ static void pgaenable(__maybe_unused SOCKETTYPE c, char *param, bool isjson)
|
|
|
|
|
|
|
|
struct cgpu_info *cgpu = devices[dev];
|
|
struct cgpu_info *cgpu = devices[dev];
|
|
|
|
|
|
|
|
- if (cgpu->deven != DEV_DISABLED) {
|
|
|
|
|
|
|
+ if (cgpu->deven == DEV_ENABLED) {
|
|
|
strcpy(io_buffer, message(MSG_PGALRENA, id, NULL, isjson));
|
|
strcpy(io_buffer, message(MSG_PGALRENA, id, NULL, isjson));
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -1143,12 +1146,12 @@ static void pgadisable(__maybe_unused SOCKETTYPE c, char *param, bool isjson)
|
|
|
|
|
|
|
|
struct cgpu_info *cgpu = devices[dev];
|
|
struct cgpu_info *cgpu = devices[dev];
|
|
|
|
|
|
|
|
- if (cgpu->deven == DEV_DISABLED) {
|
|
|
|
|
|
|
+ if (cgpu->deven != DEV_ENABLED) {
|
|
|
strcpy(io_buffer, message(MSG_PGALRDIS, id, NULL, isjson));
|
|
strcpy(io_buffer, message(MSG_PGALRDIS, id, NULL, isjson));
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- cgpu->deven = DEV_DISABLED;
|
|
|
|
|
|
|
+ cgpu->deven = DEV_IDLE;
|
|
|
|
|
|
|
|
strcpy(io_buffer, message(MSG_PGADIS, id, NULL, isjson));
|
|
strcpy(io_buffer, message(MSG_PGADIS, id, NULL, isjson));
|
|
|
}
|
|
}
|