Cope with older hfa firmware not even responding to op_name.
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 50 51 52
diff --git a/driver-hashfast.c b/driver-hashfast.c
index cf053d5..c7a9b69 100644
--- a/driver-hashfast.c
+++ b/driver-hashfast.c
@@ -650,26 +650,27 @@ static bool hfa_detect_common(struct cgpu_info *hashfast)
if (!ret) {
/* We should receive a valid header even if OP_NAME isn't
* supported by the firmware. */
- applog(LOG_WARNING, "%s: Failed to receive OP_NAME response", hashfast->drv->name);
- goto out;
- }
-
- /* Only try to parse the name if the firmware supports OP_NAME */
- if (h->operation_code == OP_NAME) {
- if (!hfa_get_data(hashfast, info->op_name, 32 / 4)) {
- applog(LOG_WARNING, "%s %d: OP_NAME failed! Failure to get op_name data",
- hashfast->drv->name, hashfast->device_id);
- goto out;
- }
- info->has_opname = info->opname_valid = true;
- applog(LOG_DEBUG, "%s: Returned an OP_NAME", hashfast->drv->name);
- for (i = 0; i < 32; i++) {
- if (i > 0 && info->op_name[i] == '\0')
- break;
- /* Make sure the op_name is valid ascii only */
- if (info->op_name[i] < 32 || info->op_name[i] > 126) {
- info->opname_valid = false;
- break;
+ applog(LOG_NOTICE, "%s %d: Firmware upgrade required to support module Naming.",
+ hashfast->drv->name, hashfast->device_id);
+ ret = true;
+ } else {
+ /* Only try to parse the name if the firmware supports OP_NAME */
+ if (h->operation_code == OP_NAME) {
+ if (!hfa_get_data(hashfast, info->op_name, 32 / 4)) {
+ applog(LOG_WARNING, "%s %d: OP_NAME failed! Failure to get op_name data",
+ hashfast->drv->name, hashfast->device_id);
+ goto out;
+ }
+ info->has_opname = info->opname_valid = true;
+ applog(LOG_DEBUG, "%s: Returned an OP_NAME", hashfast->drv->name);
+ for (i = 0; i < 32; i++) {
+ if (i > 0 && info->op_name[i] == '\0')
+ break;
+ /* Make sure the op_name is valid ascii only */
+ if (info->op_name[i] < 32 || info->op_name[i] > 126) {
+ info->opname_valid = false;
+ break;
+ }
}
}
}