Perform basic displaying of hfa notices received.
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
diff --git a/driver-hashfast.c b/driver-hashfast.c
index 7d3ba10..6c63e4a 100644
--- a/driver-hashfast.c
+++ b/driver-hashfast.c
@@ -686,8 +686,21 @@ static void hfa_update_stats1(struct cgpu_info *hashfast, struct hashfast_info *
#endif
applog(LOG_DEBUG, " max_tx_buffers: %6d", sd->max_tx_buffers);
applog(LOG_DEBUG, " max_rx_buffers: %6d", sd->max_rx_buffers);
+}
+
+static void hfa_parse_notice(struct cgpu_info *hashfast, struct hf_header *h)
+{
+ struct hf_usb_notice_data *d;
- }
+ if (h->data_length == 0) {
+ applog(LOG_DEBUG, "HFA %d: Received OP_USB_NOTICE with zero data length",
+ hashfast->device_id);
+ return;
+ }
+ d = (struct hf_usb_notice_data *)(h + 1);
+ /* FIXME Do something with the notification code d->extra_data here */
+ applog(LOG_NOTICE, "HFA %d NOTICE: %s", hashfast->device_id, d->message);
+}
static void *hfa_read(void *arg)
{
@@ -723,6 +736,9 @@ static void *hfa_read(void *arg)
case OP_USB_STATS1:
hfa_update_stats1(hashfast, info, h);
break;
+ case OP_USB_NOTICE:
+ hfa_parse_notice(hashfast, h);
+ break;
default:
applog(LOG_WARNING, "HFA %d: Unhandled operation code %d",
hashfast->device_id, h->operation_code);