driver-drillbit.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639
  1. /*
  2. * Copyright 2013 Luke Dashjr
  3. * Copyright 2013 Angus Gratton
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of the GNU General Public License as published by the Free
  7. * Software Foundation; either version 3 of the License, or (at your option)
  8. * any later version. See COPYING for more details.
  9. */
  10. #include <stdbool.h>
  11. #include <stdint.h>
  12. #include <stdio.h>
  13. #include <string.h>
  14. #include "deviceapi.h"
  15. #include "logging.h"
  16. #include "lowlevel.h"
  17. #include "lowl-vcom.h"
  18. BFG_REGISTER_DRIVER(drillbit_drv)
  19. #define DRILLBIT_MIN_VERSION 2
  20. #define DRILLBIT_MAX_VERSION 3
  21. #define DRILLBIT_MAX_WORK_RESULTS 0x400
  22. #define DRILLBIT_MAX_RESULT_NONCES 0x10
  23. enum drillbit_capability {
  24. DBC_TEMP = 1,
  25. DBC_EXT_CLOCK = 2,
  26. };
  27. enum drillbit_voltagecfg {
  28. DBV_650mV = 0,
  29. DBV_750mV = 2,
  30. DBV_850mV = 1,
  31. DBV_950mV = 3,
  32. };
  33. struct drillbit_board {
  34. enum drillbit_voltagecfg core_voltage_cfg;
  35. unsigned clock_level;
  36. bool clock_div2;
  37. bool use_ext_clock;
  38. unsigned ext_clock_freq;
  39. bool need_reinit;
  40. };
  41. static
  42. bool drillbit_lowl_match(const struct lowlevel_device_info * const info)
  43. {
  44. if (!lowlevel_match_id(info, &lowl_vcom, 0, 0))
  45. return false;
  46. return (info->manufacturer && strstr(info->manufacturer, "Drillbit"));
  47. }
  48. static
  49. bool drillbit_detect_one(const char * const devpath)
  50. {
  51. uint8_t buf[0x10];
  52. const int fd = serial_open(devpath, 0, 1, true);
  53. if (fd == -1)
  54. applogr(false, LOG_DEBUG, "%s: %s: Failed to open", __func__, devpath);
  55. if (1 != write(fd, "I", 1))
  56. {
  57. applog(LOG_DEBUG, "%s: %s: Error writing 'I'", __func__, devpath);
  58. err:
  59. serial_close(fd);
  60. return false;
  61. }
  62. if (sizeof(buf) != serial_read(fd, buf, sizeof(buf)))
  63. {
  64. applog(LOG_DEBUG, "%s: %s: Short read in response to 'I'",
  65. __func__, devpath);
  66. goto err;
  67. }
  68. serial_close(fd);
  69. const unsigned protover = buf[0];
  70. const unsigned long serialno = (uint32_t)buf[9] | ((uint32_t)buf[0xa] << 8) | ((uint32_t)buf[0xb] << 16) | ((uint32_t)buf[0xc] << 24);
  71. char * const product = (void*)&buf[1];
  72. buf[9] = '\0'; // Ensure it is null-terminated (clobbers serial, but we already parsed it)
  73. unsigned chips = buf[0xd];
  74. uint16_t caps = (uint16_t)buf[0xe] | ((uint16_t)buf[0xf] << 8);
  75. if (!product[0])
  76. applogr(false, LOG_DEBUG, "%s: %s: Null product name", __func__, devpath);
  77. if (!serialno)
  78. applogr(false, LOG_DEBUG, "%s: %s: Serial number is zero", __func__, devpath);
  79. if (!chips)
  80. applogr(false, LOG_DEBUG, "%s: %s: No chips found", __func__, devpath);
  81. int loglev = LOG_WARNING;
  82. if (!strcmp(product, "DRILLBIT"))
  83. {
  84. // Hack: first production firmwares all described themselves as DRILLBIT, so fill in the gaps
  85. if (chips == 1)
  86. strcpy(product, "Thumb");
  87. else
  88. strcpy(product, "Eight");
  89. }
  90. else
  91. if (chips == 8 && !strcmp(product, "Eight"))
  92. {} // Known device
  93. else
  94. if (chips == 1 && !strcmp(product, "Thumb"))
  95. {} // Known device
  96. else
  97. loglev = LOG_DEBUG;
  98. if (protover < DRILLBIT_MIN_VERSION || (loglev == LOG_DEBUG && protover > DRILLBIT_MAX_VERSION))
  99. applogr(false, loglev, "%s: %s: Unknown device protocol version %u.",
  100. __func__, devpath, protover);
  101. if (protover > DRILLBIT_MAX_VERSION)
  102. applogr(false, loglev, "%s: %s: Device firmware uses newer Drillbit protocol %u. We only support up to %u. Find a newer BFGMiner!",
  103. __func__, devpath, protover, (unsigned)DRILLBIT_MAX_VERSION);
  104. if (protover == 2 && chips == 1)
  105. // Production firmware Thumbs don't set any capability bits, so fill in the EXT_CLOCK one
  106. caps |= DBC_EXT_CLOCK;
  107. char *serno = malloc(9);
  108. snprintf(serno, 9, "%08lx", serialno);
  109. if (chips > 0x100)
  110. {
  111. applog(LOG_WARNING, "%s: %s: %u chips reported, but driver only supports up to 256",
  112. __func__, devpath, chips);
  113. chips = 0x100;
  114. }
  115. struct cgpu_info * const cgpu = malloc(sizeof(*cgpu));
  116. *cgpu = (struct cgpu_info){
  117. .drv = &drillbit_drv,
  118. .device_path = strdup(devpath),
  119. .dev_product = strdup(product),
  120. .dev_serial = serno,
  121. .deven = DEV_ENABLED,
  122. .procs = chips,
  123. .threads = 1,
  124. //.device_data = ,
  125. };
  126. return add_cgpu(cgpu);
  127. }
  128. static
  129. bool drillbit_lowl_probe(const struct lowlevel_device_info * const info)
  130. {
  131. return vcom_lowl_probe_wrapper(info, drillbit_detect_one);
  132. }
  133. static
  134. bool drillbit_check_response(const char * const repr, const int fd, struct cgpu_info * const dev, const char expect)
  135. {
  136. uint8_t ack;
  137. if (1 != serial_read(fd, &ack, 1))
  138. applogr(false, LOG_ERR, "%s: Short read in response to '%c'",
  139. repr, expect);
  140. if (ack != expect)
  141. applogr(false, LOG_ERR, "%s: Wrong response to '%c': %u",
  142. dev->dev_repr, expect, (unsigned)ack);
  143. return true;
  144. }
  145. static
  146. bool drillbit_reset(struct cgpu_info * const dev)
  147. {
  148. const int fd = dev->device_fd;
  149. if (unlikely(fd == -1))
  150. return false;
  151. if (1 != write(fd, "R", 1))
  152. applogr(false, LOG_ERR, "%s: Error writing reset command", dev->dev_repr);
  153. return drillbit_check_response(dev->dev_repr, fd, dev, 'R');
  154. }
  155. static
  156. bool drillbit_send_config(struct cgpu_info * const dev)
  157. {
  158. const int fd = dev->device_fd;
  159. if (unlikely(fd == -1))
  160. return false;
  161. const struct drillbit_board * const board = dev->device_data;
  162. const uint8_t buf[7] = {'C', board->core_voltage_cfg, board->clock_level, (board->clock_div2 ? 1 : 0), (board->use_ext_clock ? 1 : 0), board->ext_clock_freq};
  163. if (sizeof(buf) != write(fd, buf, sizeof(buf)))
  164. applogr(false, LOG_ERR, "%s: Error sending config", dev->dev_repr);
  165. return drillbit_check_response(dev->dev_repr, fd, dev, 'C');
  166. }
  167. static
  168. bool drillbit_init(struct thr_info * const master_thr)
  169. {
  170. struct cgpu_info * const dev = master_thr->cgpu;
  171. const int fd = serial_open(dev->device_path, 0, 10, true);
  172. if (fd == -1)
  173. return false;
  174. struct drillbit_board * const board = malloc(sizeof(*board));
  175. dev->device_fd = fd;
  176. dev->device_data = board;
  177. *board = (struct drillbit_board){
  178. .core_voltage_cfg = DBV_850mV,
  179. .clock_level = 40,
  180. .clock_div2 = false,
  181. .use_ext_clock = false,
  182. .ext_clock_freq = 200,
  183. };
  184. if (!(drillbit_reset(dev) && drillbit_send_config(dev)))
  185. {
  186. serial_close(fd);
  187. return false;
  188. }
  189. timer_set_delay_from_now(&master_thr->tv_poll, 10000);
  190. return true;
  191. }
  192. static
  193. bool drillbit_job_prepare(struct thr_info * const thr, struct work * const work, __maybe_unused const uint64_t max_nonce)
  194. {
  195. struct cgpu_info * const proc = thr->cgpu;
  196. const int chipid = proc->proc_id;
  197. struct cgpu_info * const dev = proc->device;
  198. const int fd = dev->device_fd;
  199. uint8_t buf[0x31];
  200. buf[0] = 'W';
  201. buf[1] = chipid;
  202. buf[2] = 0; // high bits of chipid
  203. memcpy(&buf[3], work->midstate, 0x20);
  204. memcpy(&buf[0x23], &work->data[0x40], 0xc);
  205. if (sizeof(buf) != write(fd, buf, sizeof(buf)))
  206. applogr(false, LOG_ERR, "%"PRIpreprv": Error sending work %d",
  207. proc->proc_repr, work->id);
  208. if (!drillbit_check_response(proc->proc_repr, fd, dev, 'W'))
  209. applogr(false, LOG_ERR, "%"PRIpreprv": Error queuing work %d",
  210. proc->proc_repr, work->id);
  211. applog(LOG_DEBUG, "%"PRIpreprv": Queued work %d",
  212. proc->proc_repr, work->id);
  213. work->blk.nonce = 0xffffffff;
  214. return true;
  215. }
  216. static
  217. bool drillbit_resend_jobs(struct cgpu_info * const proc)
  218. {
  219. struct thr_info * const thr = proc->thr[0];
  220. bool rv;
  221. if (thr->work)
  222. if (!drillbit_job_prepare(thr, thr->work, 0))
  223. {
  224. applog(LOG_WARNING, "%"PRIpreprv": Failed to resend %s work",
  225. proc->proc_repr, "current");
  226. rv = false;
  227. }
  228. if (thr->next_work)
  229. {
  230. if (!drillbit_job_prepare(thr, thr->next_work, 0))
  231. {
  232. applog(LOG_WARNING, "%"PRIpreprv": Failed to resend %s work",
  233. proc->proc_repr, "next");
  234. rv = false;
  235. }
  236. if (!rv)
  237. {
  238. // Fake transition so we kinda recover eventually
  239. mt_job_transition(thr);
  240. job_start_complete(thr);
  241. timer_set_now(&thr->tv_morework);
  242. }
  243. }
  244. return rv;
  245. }
  246. static
  247. void drillbit_first_job_start(struct thr_info __maybe_unused * const thr)
  248. {
  249. struct cgpu_info * const proc = thr->cgpu;
  250. if (unlikely(!thr->work))
  251. {
  252. applog(LOG_DEBUG, "%"PRIpreprv": No current work, assuming immediate start",
  253. proc->proc_repr);
  254. mt_job_transition(thr);
  255. job_start_complete(thr);
  256. timer_set_now(&thr->tv_morework);
  257. }
  258. }
  259. static
  260. int64_t drillbit_job_process_results(struct thr_info *thr, struct work *work, bool stopping)
  261. {
  262. return 0xbd000000;
  263. }
  264. static
  265. struct cgpu_info *drillbit_find_proc(struct cgpu_info * const dev, int chipid)
  266. {
  267. struct cgpu_info *proc = dev;
  268. for (int i = 0; i < chipid; ++i)
  269. {
  270. proc = proc->next_proc;
  271. if (unlikely(!proc))
  272. return NULL;
  273. }
  274. return proc;
  275. }
  276. static
  277. bool bitfury_fudge_nonce2(struct work * const work, uint32_t * const nonce_p)
  278. {
  279. if (!work)
  280. return false;
  281. const uint32_t m7 = *((uint32_t *)&work->data[64]);
  282. const uint32_t ntime = *((uint32_t *)&work->data[68]);
  283. const uint32_t nbits = *((uint32_t *)&work->data[72]);
  284. return bitfury_fudge_nonce(work->midstate, m7, ntime, nbits, nonce_p);
  285. }
  286. static
  287. bool drillbit_get_work_results(struct cgpu_info * const dev)
  288. {
  289. const int fd = dev->device_fd;
  290. if (fd == -1)
  291. return false;
  292. uint8_t buf[4 + (4 * DRILLBIT_MAX_RESULT_NONCES)];
  293. uint32_t total;
  294. int i, j;
  295. if (1 != write(fd, "E", 1))
  296. applogr(false, LOG_ERR, "%s: Error sending request for work results", dev->dev_repr);
  297. if (sizeof(total) != serial_read(fd, &total, sizeof(total)))
  298. applogr(false, LOG_ERR, "%s: Short read in response to 'E'", dev->dev_repr);
  299. total = le32toh(total);
  300. if (total > DRILLBIT_MAX_WORK_RESULTS)
  301. applogr(false, LOG_ERR, "%s: Impossible number of total work: %lu",
  302. dev->dev_repr, (unsigned long)total);
  303. for (i = 0; i < total; ++i)
  304. {
  305. if (sizeof(buf) != serial_read(fd, buf, sizeof(buf)))
  306. applogr(false, LOG_ERR, "%s: Short read on %dth total work",
  307. dev->dev_repr, i);
  308. const int chipid = buf[0];
  309. struct cgpu_info * const proc = drillbit_find_proc(dev, chipid);
  310. struct thr_info * const thr = proc->thr[0];
  311. if (unlikely(!proc))
  312. {
  313. applog(LOG_ERR, "%s: Unknown chip id %d", dev->dev_repr, chipid);
  314. continue;
  315. }
  316. const bool is_idle = buf[3];
  317. int nonces = buf[2];
  318. if (nonces > DRILLBIT_MAX_RESULT_NONCES)
  319. {
  320. applog(LOG_ERR, "%"PRIpreprv": More than %d nonces claimed, impossible",
  321. proc->proc_repr, (int)DRILLBIT_MAX_RESULT_NONCES);
  322. nonces = DRILLBIT_MAX_RESULT_NONCES;
  323. }
  324. applog(LOG_DEBUG, "%"PRIpreprv": Handling completion of %d nonces. is_idle=%d work=%p next_work=%p",
  325. proc->proc_repr, nonces, is_idle, thr->work, thr->next_work);
  326. const uint32_t *nonce_p = (void*)&buf[4];
  327. for (j = 0; j < nonces; ++j, ++nonce_p)
  328. {
  329. uint32_t nonce = bitfury_decnonce(*nonce_p);
  330. if (bitfury_fudge_nonce2(thr->work, &nonce))
  331. submit_nonce(thr, thr->work, nonce);
  332. else
  333. if (bitfury_fudge_nonce2(thr->next_work, &nonce))
  334. {
  335. applog(LOG_DEBUG, "%"PRIpreprv": Result for next work, transitioning",
  336. proc->proc_repr);
  337. submit_nonce(thr, thr->next_work, nonce);
  338. mt_job_transition(thr);
  339. job_start_complete(thr);
  340. }
  341. else
  342. if (bitfury_fudge_nonce2(thr->prev_work, &nonce))
  343. {
  344. applog(LOG_DEBUG, "%"PRIpreprv": Result for PREVIOUS work",
  345. proc->proc_repr);
  346. submit_nonce(thr, thr->prev_work, nonce);
  347. }
  348. else
  349. inc_hw_errors(thr, thr->work, nonce);
  350. }
  351. if (is_idle && thr->next_work)
  352. {
  353. applog(LOG_DEBUG, "%"PRIpreprv": Chip went idle without any results for next work",
  354. proc->proc_repr);
  355. mt_job_transition(thr);
  356. job_start_complete(thr);
  357. }
  358. if (!thr->next_work)
  359. timer_set_now(&thr->tv_morework);
  360. }
  361. return true;
  362. }
  363. static
  364. void drillbit_poll(struct thr_info * const master_thr)
  365. {
  366. struct cgpu_info * const dev = master_thr->cgpu;
  367. struct drillbit_board * const board = dev->device_data;
  368. drillbit_get_work_results(dev);
  369. if (board->need_reinit)
  370. {
  371. applog(LOG_NOTICE, "%s: Reinitialisation needed for configuration changes",
  372. dev->dev_repr);
  373. drillbit_reset(dev);
  374. drillbit_send_config(dev);
  375. for (struct cgpu_info *proc = dev; proc; proc = proc->next_proc)
  376. drillbit_resend_jobs(proc);
  377. board->need_reinit = false;
  378. }
  379. timer_set_delay_from_now(&master_thr->tv_poll, 10000);
  380. }
  381. static
  382. bool drillbit_get_stats(struct cgpu_info * const dev)
  383. {
  384. if (dev != dev->device)
  385. return true;
  386. const int fd = dev->device_fd;
  387. if (fd == -1)
  388. return false;
  389. if (1 != write(fd, "T", 1))
  390. applogr(false, LOG_ERR, "%s: Error requesting temperature", dev->dev_repr);
  391. uint8_t buf[2];
  392. if (sizeof(buf) != serial_read(fd, buf, sizeof(buf)))
  393. applogr(false, LOG_ERR, "%s: Short read in response to 'T'", dev->dev_repr);
  394. float temp = ((uint16_t)buf[0]) | ((uint16_t)buf[1] << 8);
  395. temp /= 10.;
  396. for (struct cgpu_info *proc = dev; proc; proc = proc->next_proc)
  397. proc->temp = temp;
  398. return true;
  399. }
  400. static
  401. float drillbit_voltagecfg_volts(const enum drillbit_voltagecfg vcfg)
  402. {
  403. switch (vcfg)
  404. {
  405. case DBV_650mV: return 0.65;
  406. case DBV_750mV: return 0.75;
  407. case DBV_850mV: return 0.85;
  408. case DBV_950mV: return 0.95;
  409. }
  410. return 0;
  411. }
  412. static
  413. void drillbit_clockcfg_str(char * const buf, size_t bufsz, struct drillbit_board * const board)
  414. {
  415. if (board->use_ext_clock)
  416. snprintf(buf, bufsz, "%u", board->ext_clock_freq);
  417. else
  418. snprintf(buf, bufsz, "L%u", board->clock_level);
  419. if (board->clock_div2)
  420. tailsprintf(buf, bufsz, ":2");
  421. }
  422. static
  423. struct api_data *drillbit_api_stats(struct cgpu_info * const proc)
  424. {
  425. struct cgpu_info * const dev = proc->device;
  426. struct drillbit_board * const board = dev->device_data;
  427. struct api_data *root = NULL;
  428. char buf[0x100];
  429. drillbit_clockcfg_str(buf, sizeof(buf), board);
  430. root = api_add_string(root, "ClockCfg", buf, true);
  431. float volts = drillbit_voltagecfg_volts(board->core_voltage_cfg);
  432. root = api_add_volts(root, "Voltage", &volts, true);
  433. return root;
  434. }
  435. static
  436. char *drillbit_set_device(struct cgpu_info * const proc, char * const option, char *setting, char * const replybuf)
  437. {
  438. struct cgpu_info * const dev = proc->device;
  439. struct drillbit_board * const board = dev->device_data;
  440. if (!strcasecmp(option, "help"))
  441. {
  442. sprintf(replybuf,
  443. "voltage: 0.65, 0.75, 0.85, or 0.95 (volts)\n"
  444. "clock: 80-230 (MHz) using external clock, or L0-L63 for internal clock levels; append :2 to activate div2"
  445. );
  446. return replybuf;
  447. }
  448. if (!strcasecmp(option, "voltage"))
  449. {
  450. // NOTE: Do not use replybuf in here without implementing it in drillbit_tui_handle_choice
  451. if (!setting || !*setting)
  452. return "Missing voltage setting";
  453. const int val = atof(setting) * 1000;
  454. enum drillbit_voltagecfg vcfg;
  455. switch (val)
  456. {
  457. case 650: case 649:
  458. vcfg = DBV_650mV;
  459. break;
  460. case 750: case 749:
  461. vcfg = DBV_750mV;
  462. break;
  463. case 850: case 849:
  464. vcfg = DBV_850mV;
  465. break;
  466. case 950: case 949:
  467. vcfg = DBV_950mV;
  468. break;
  469. default:
  470. return "Invalid voltage value";
  471. }
  472. board->core_voltage_cfg = vcfg;
  473. board->need_reinit = true;
  474. return NULL;
  475. }
  476. if (!strcasecmp(option, "clock"))
  477. {
  478. // NOTE: Do not use replybuf in here without implementing it in drillbit_tui_handle_choice
  479. const bool use_ext_clock = !(setting[0] == 'L');
  480. char *end = &setting[use_ext_clock ? 0 : 1];
  481. const unsigned num = strtol(end, &end, 0);
  482. const bool div2 = (end[0] == ':' && end[1] == '2');
  483. // NOTE: board assignments are ordered such that it is safe to race
  484. if (use_ext_clock)
  485. {
  486. if (num < 80 || num > 230)
  487. return "External clock frequency out of range (80-230)";
  488. board->clock_div2 = div2;
  489. board->ext_clock_freq = num;
  490. board->use_ext_clock = true;
  491. }
  492. else
  493. {
  494. if (num < 0 || num > 63)
  495. return "Internal clock level out of range (0-63)";
  496. board->clock_div2 = div2;
  497. board->clock_level = num;
  498. board->use_ext_clock = false;
  499. }
  500. board->need_reinit = true;
  501. return NULL;
  502. }
  503. sprintf(replybuf, "Unknown option: %s", option);
  504. return replybuf;
  505. }
  506. #ifdef HAVE_CURSES
  507. static
  508. void drillbit_tui_wlogprint_choices(struct cgpu_info * const proc)
  509. {
  510. wlogprint("[C]lock [V]oltage ");
  511. }
  512. static
  513. const char *drillbit_tui_handle_choice(struct cgpu_info * const proc, const int input)
  514. {
  515. char *val;
  516. switch (input)
  517. {
  518. case 'c': case 'C':
  519. val = curses_input("Set clock (80-230 MHz using external clock, or L0-L63 for internal clock levels; append :2 to activate div2");
  520. return drillbit_set_device(proc, "clock", val, NULL) ?: "Requesting clock change";
  521. case 'v': case 'V':
  522. val = curses_input("Set voltage (0.65, 0.75, 0.85, or 0.95)");
  523. return drillbit_set_device(proc, "voltage", val, NULL) ?: "Requesting voltage change";
  524. }
  525. return NULL;
  526. }
  527. static
  528. void drillbit_wlogprint_status(struct cgpu_info * const proc)
  529. {
  530. struct cgpu_info * const dev = proc->device;
  531. struct drillbit_board * const board = dev->device_data;
  532. char buf[0x100];
  533. drillbit_clockcfg_str(buf, sizeof(buf), board);
  534. wlogprint("Clock: %s\n", buf);
  535. wlogprint("Voltage: %.2f\n", drillbit_voltagecfg_volts(board->core_voltage_cfg));
  536. }
  537. #endif
  538. struct device_drv drillbit_drv = {
  539. .dname = "drillbit",
  540. .name = "DRB",
  541. .lowl_match = drillbit_lowl_match,
  542. .lowl_probe = drillbit_lowl_probe,
  543. .thread_init = drillbit_init,
  544. .minerloop = minerloop_async,
  545. .job_prepare = drillbit_job_prepare,
  546. .job_start = drillbit_first_job_start,
  547. .job_process_results = drillbit_job_process_results,
  548. .poll = drillbit_poll,
  549. .get_stats = drillbit_get_stats,
  550. .get_api_stats = drillbit_api_stats,
  551. .set_device = drillbit_set_device,
  552. #ifdef HAVE_CURSES
  553. .proc_wlogprint_status = drillbit_wlogprint_status,
  554. .proc_tui_wlogprint_choices = drillbit_tui_wlogprint_choices,
  555. .proc_tui_handle_choice = drillbit_tui_handle_choice,
  556. #endif
  557. };