bab - add info about number of boards/chips to each Dead Chain
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
diff --git a/driver-bab.c b/driver-bab.c
index 4a7fe6a..0081443 100644
--- a/driver-bab.c
+++ b/driver-bab.c
@@ -2284,7 +2284,8 @@ static struct api_data *bab_api_stats(struct cgpu_info *babcgpu)
struct api_data *root = NULL;
char data[2048];
char buf[32];
- int spi_work, chip_work, i, to, j, sp, chip, bank, chip_off, k, board;
+ int spi_work, chip_work, sp, chip, bank, chip_off, board, last_board;
+ int i, to, j, k;
bool dead;
struct timeval now;
double elapsed, ghs;
@@ -2723,15 +2724,32 @@ static struct api_data *bab_api_stats(struct cgpu_info *babcgpu)
if (ghs > 0.0)
break;
}
+ /*
+ * The output here is: a/b+c/d
+ * a/b is the SPI/board that starts the Dead Chain
+ * c is the number of boards after a
+ * d is the total number of chips in the Dead Chain
+ * A Dead Chain is a continous set of dead chips that
+ * finish at the end of an SPI chain of boards
+ * This might be caused by the first board, or the cables attached
+ * to the first board, in the Dead Chain i.e. a/b
+ * If c is zero, it's just the last board, so it's the same as any
+ * other board having dead chips
+ */
if (chip < babinfo->bank_last_chip[bank]) {
board = (int)((float)(chip - babinfo->bank_first_chip[bank]) /
BAB_BOARDCHIPS) + 1;
+ last_board = (int)((float)(babinfo->bank_last_chip[bank] -
+ babinfo->bank_first_chip[bank]) /
+ BAB_BOARDCHIPS) + 1;
snprintf(buf, sizeof(buf),
- "%s%d/%d%s",
+ "%s%d/%d%s+%d/%d",
data[0] ? " " : "",
bank, board,
babinfo->missing_chips_per_bank[bank] ?
- "?" : "");
+ "?" : "",
+ last_board - board,
+ babinfo->bank_last_chip[bank] - chip);
strcat(data, buf);
}
}