update klondike driver
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 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
diff --git a/cgminer/driver-klondike.c b/cgminer/driver-klondike.c
index 39c55d3..29634ca 100644
--- a/cgminer/driver-klondike.c
+++ b/cgminer/driver-klondike.c
@@ -36,22 +36,35 @@
struct device_drv klondike_drv;
+struct klondike_info {
+ bool shutdown;
+};
+
struct klondike_id {
- char id[8];
uint8_t version;
uint32_t serial;
- char product[16];
+ char product[8];
};
struct klondike_status {
-
+ uint8_t state;
+ uint8_t chipcount;
+ uint8_t slavecount;
+ uint8_t workqc;
+ uint8_t workid;
+ uint8_t temp;
+ uint8_t fanspeed;
+ uint16_t hashcount;
+ uint16_t errorcount;
};
struct kondike_cfg {
-
+ uint16_t hashclock;
+ uint8_t temptarget;
+ uint8_t tempcritical;
+ uint8_t fantarget;
};
-
static bool klondike_detect_one(struct libusb_device *dev, struct usb_find_devices *found)
{
struct cgpu_info *klninfo = calloc(1, sizeof(*klninfo));
@@ -103,6 +116,107 @@ static void klondike_detect(void)
usb_detect(&klondike_drv, klondike_detect_one);
}
+static void klondike_identify(struct cgpu_info *klninfo)
+{
+ struct klondike_info *k_info = (struct klondike_info *)(klninfo->device_file);
+
+}
+
+static bool klondike_thread_prepare(struct thr_info *thr)
+{
+ struct cgpu_info *klninfo = thr->cgpu;
+ struct klondike_info *k_info = (struct klondike_info *)(klninfo->device_file);
+
+ return true;
+}
+
+static bool klondike_thread_init(struct thr_info *thr)
+{
+ struct cgpu_info *klninfo = thr->cgpu;
+
+ if (klninfo->usbinfo.nodev)
+ return false;
+
+ //klondike_initialise(klninfo);
+
+ return true;
+}
+
+static void klondike_flush_work(struct cgpu_info *klninfo)
+{
+ struct klondike_info *k_info = (struct klondike_info *)(klninfo->device_file);
+
+}
+
+static void klondike_shutdown(struct thr_info *thr)
+{
+ struct cgpu_info *klninfo = thr->cgpu;
+ struct klondike_info *k_info = (struct klondike_info *)(klninfo->device_file);
+
+ klondike_flush_work(klninfo);
+ k_info->shutdown = true;
+}
+
+static void klondike_thread_enable(struct thr_info *thr)
+{
+ struct cgpu_info *klninfo = thr->cgpu;
+
+ if (klninfo->usbinfo.nodev)
+ return;
+
+ //klondike_initialise(bflsc);
+}
+
+static bool klondike_send_work(struct cgpu_info *klninfo, int dev, struct work *work)
+{
+ struct klondike_info *k_info = (struct klondike_info *)(klninfo->device_file);
+
+ // Device is gone
+ if (klninfo->usbinfo.nodev)
+ return false;
+
+}
+
+static bool klondike_queue_full(struct cgpu_info *klninfo)
+{
+ struct klondike_info *sc_info = (struct klondike_info *)(klninfo->device_file);
+
+
+}
+
+static int64_t klondike_scanwork(struct thr_info *thr)
+{
+ struct cgpu_info *klninfo = thr->cgpu;
+ struct klondike_info *sc_info = (struct klondike_info *)(klninfo->device_file);
+
+ // Device is gone
+ if (klninfo->usbinfo.nodev)
+ return -1;
+
+}
+
+static bool klondike_get_stats(struct cgpu_info *klninfo)
+{
+ struct klondike_info *k_info = (struct klondike_info *)(klninfo->device_file);
+ bool allok = true;
+ int i;
+
+ // Device is gone
+ if (klninfo->usbinfo.nodev)
+ return false;
+
+ return allok;
+}
+
+static void get_klondike_statline_before(char *buf, struct cgpu_info *klninfo)
+{
+
+}
+
+static struct api_data *klondike_api_stats(struct cgpu_info *klninfo)
+{
+
+}
struct device_drv klondike_drv = {
.drv_id = DRIVER_KLONDIKE,