driver-bifury.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655
  1. /*
  2. * Copyright 2013 Luke Dashjr
  3. *
  4. * This program is free software; you can redistribute it and/or modify it
  5. * under the terms of the GNU General Public License as published by the Free
  6. * Software Foundation; either version 3 of the License, or (at your option)
  7. * any later version. See COPYING for more details.
  8. */
  9. #include "config.h"
  10. #include <ctype.h>
  11. #include <limits.h>
  12. #include <stdbool.h>
  13. #include <stdint.h>
  14. #include <stdio.h>
  15. #include <stdlib.h>
  16. #include <string.h>
  17. #include <unistd.h>
  18. #include <uthash.h>
  19. #include "deviceapi.h"
  20. #include "logging.h"
  21. #include "lowlevel.h"
  22. #include "lowl-vcom.h"
  23. #include "miner.h"
  24. #include "util.h"
  25. #define BIFURY_MAX_QUEUED 0x10
  26. BFG_REGISTER_DRIVER(bifury_drv)
  27. static const struct bfg_set_device_definition bifury_set_device_funcs[];
  28. const char bifury_init_cmds[] = "flush\ntarget ffffffff\nmaxroll 0\n";
  29. static
  30. ssize_t bifury_write(const struct cgpu_info * const dev, const void * const buf, const size_t count)
  31. {
  32. const int fd = dev->device_fd;
  33. if (opt_dev_protocol)
  34. {
  35. const int psz = (((const char*)buf)[count-1] == '\n') ? (count - 1) : count;
  36. applog(LOG_DEBUG, "%s: DEVPROTO: SEND %.*s", dev->dev_repr, psz, (const char*)buf);
  37. }
  38. return write(fd, buf, count);
  39. }
  40. static
  41. void *bifury_readln(int fd, bytes_t *leftover)
  42. {
  43. uint8_t buf[0x40];
  44. ssize_t r;
  45. parse:
  46. if ( (r = bytes_find(leftover, '\n')) >= 0)
  47. {
  48. uint8_t *ret = malloc(r+1);
  49. if (r)
  50. memcpy(ret, bytes_buf(leftover), r);
  51. ret[r] = '\0';
  52. bytes_shift(leftover, r + 1);
  53. return ret;
  54. }
  55. if ( (r = read(fd, buf, sizeof(buf))) > 0)
  56. {
  57. bytes_append(leftover, buf, r);
  58. goto parse;
  59. }
  60. return NULL;
  61. }
  62. struct bifury_state {
  63. bytes_t buf;
  64. uint32_t last_work_id;
  65. int needwork;
  66. bool has_needwork;
  67. uint8_t *osc6_bits;
  68. bool send_clock;
  69. unsigned max_queued;
  70. bool free_after_job;
  71. };
  72. static
  73. bool bifury_lowl_match(const struct lowlevel_device_info * const info)
  74. {
  75. return lowlevel_match_product(info, "bi\xe2\x80\xa2""fury");
  76. }
  77. const char *bifury_init_chips(struct cgpu_info * const proc, const char * const option, const char * const setting, char * const replybuf, enum bfg_set_device_replytype * const success)
  78. {
  79. int *procs_p = proc->device_data;
  80. if (!setting || !*setting)
  81. return "missing setting";
  82. const int val = atoi(setting);
  83. if (val < 1)
  84. return "invalid setting";
  85. *procs_p = val;
  86. return NULL;
  87. }
  88. static const struct bfg_set_device_definition bifury_set_device_funcs_probe[] = {
  89. {"chips", bifury_init_chips, NULL},
  90. {NULL},
  91. };
  92. static
  93. bool bifury_detect_one(const char * const devpath)
  94. {
  95. char buf[0x40], *p, *q, *s;
  96. bytes_t reply = BYTES_INIT;
  97. int major, minor, hwrev, chips;
  98. struct cgpu_info *cgpu;
  99. struct timeval tv_timeout;
  100. const int fd = serial_open(devpath, 0, 10, true);
  101. applog(LOG_DEBUG, "%s: %s %s",
  102. bifury_drv.dname,
  103. ((fd == -1) ? "Failed to open" : "Successfully opened"),
  104. devpath);
  105. if (unlikely(fd == -1))
  106. return false;
  107. while (read(fd, buf, sizeof(buf)) == sizeof(buf))
  108. {}
  109. if (opt_dev_protocol)
  110. applog(LOG_DEBUG, "%s fd=%d: DEVPROTO: SEND %s", bifury_drv.dname, fd, "version");
  111. if (8 != write(fd, "version\n", 8))
  112. {
  113. applog(LOG_DEBUG, "%s: Error sending version request", bifury_drv.dname);
  114. goto err;
  115. }
  116. timer_set_delay_from_now(&tv_timeout, 1000000);
  117. while (true)
  118. {
  119. p = bifury_readln(fd, &reply);
  120. if (p)
  121. {
  122. if (opt_dev_protocol)
  123. applog(LOG_DEBUG, "%s fd=%d: DEVPROTO: RECV %s",
  124. bifury_drv.dname, fd, p);
  125. if (!strncmp("version ", p, 8))
  126. break;
  127. free(p);
  128. }
  129. if (timer_passed(&tv_timeout, NULL))
  130. {
  131. applog(LOG_DEBUG, "%s: Timed out waiting for response to version request",
  132. bifury_drv.dname);
  133. goto err;
  134. }
  135. }
  136. bytes_free(&reply);
  137. serial_close(fd);
  138. s = p;
  139. major = strtol(&p[8], &p, 10);
  140. if (p == &buf[8] || p[0] != '.')
  141. goto parseerr;
  142. minor = strtol(&p[1], &q, 10);
  143. if (p == q || strncmp(" rev ", q, 5))
  144. goto parseerr;
  145. hwrev = strtol(&q[5], &p, 10);
  146. if (p == q || strncmp(" chips ", p, 7))
  147. goto parseerr;
  148. chips = strtol(&p[7], &q, 10);
  149. if (p == q || chips < 1)
  150. goto parseerr;
  151. free(s);
  152. applog(LOG_DEBUG, "%s: Found firmware %d.%d on hardware rev %d with %d chips",
  153. bifury_drv.dname, major, minor, hwrev, chips);
  154. if (serial_claim_v(devpath, &bifury_drv))
  155. return false;
  156. drv_set_defaults(&bifury_drv, bifury_set_device_funcs_probe, &chips, devpath, detectone_meta_info.serial, 1);
  157. cgpu = malloc(sizeof(*cgpu));
  158. *cgpu = (struct cgpu_info){
  159. .drv = &bifury_drv,
  160. .device_path = strdup(devpath),
  161. .set_device_funcs = bifury_set_device_funcs,
  162. .deven = DEV_ENABLED,
  163. .procs = chips,
  164. .threads = 1,
  165. .cutofftemp = 75,
  166. };
  167. // NOTE: Xcode's clang has a bug where it cannot find fields inside anonymous unions (more details in fpgautils)
  168. cgpu->device_fd = -1;
  169. return add_cgpu(cgpu);
  170. parseerr:
  171. applog(LOG_DEBUG, "%s: Error parsing version response", bifury_drv.dname);
  172. free(s);
  173. return false;
  174. err:
  175. bytes_free(&reply);
  176. serial_close(fd);
  177. return false;
  178. }
  179. static
  180. bool bifury_lowl_probe(const struct lowlevel_device_info * const info)
  181. {
  182. return vcom_lowl_probe_wrapper(info, bifury_detect_one);
  183. }
  184. static
  185. bool bifury_set_queue_full(const struct cgpu_info * const dev, int needwork)
  186. {
  187. struct bifury_state * const state = dev->device_data;
  188. struct thr_info * const master_thr = dev->thr[0];
  189. const int fd = dev->device_fd;
  190. if (needwork != -1)
  191. state->needwork = needwork;
  192. const bool full = (fd == -1 || !state->needwork);
  193. if (full == master_thr->queue_full)
  194. return full;
  195. for (const struct cgpu_info *proc = dev; proc; proc = proc->next_proc)
  196. {
  197. struct thr_info * const thr = proc->thr[0];
  198. thr->queue_full = full;
  199. }
  200. return full;
  201. }
  202. void bifury_send_clock(const struct cgpu_info * const dev)
  203. {
  204. struct bifury_state * const state = dev->device_data;
  205. const struct cgpu_info *proc;
  206. size_t clockbufsz = 5 + (3 * dev->procs) + 1 + 1;
  207. char clockbuf[clockbufsz];
  208. strcpy(clockbuf, "clock");
  209. proc = dev;
  210. for (int i = 0; i < dev->procs; ++i, (proc = proc->next_proc))
  211. {
  212. const struct thr_info * const thr = proc->thr[0];
  213. int clk;
  214. if (proc->deven == DEV_ENABLED && !thr->pause)
  215. clk = state->osc6_bits[i];
  216. else
  217. clk = 0;
  218. tailsprintf(clockbuf, clockbufsz, " %d", clk);
  219. }
  220. tailsprintf(clockbuf, clockbufsz, "\n");
  221. --clockbufsz;
  222. if (clockbufsz != bifury_write(dev, clockbuf, clockbufsz))
  223. {
  224. state->send_clock = true;
  225. applog(LOG_ERR, "%s: Failed to send clock assignments",
  226. dev->dev_repr);
  227. }
  228. else
  229. state->send_clock = false;
  230. }
  231. static
  232. bool bifury_thread_init(struct thr_info *master_thr)
  233. {
  234. struct cgpu_info * const dev = master_thr->cgpu, *proc;
  235. struct bifury_state * const state = malloc(sizeof(*state));
  236. if (!state)
  237. return false;
  238. *state = (struct bifury_state){
  239. .buf = BYTES_INIT,
  240. .osc6_bits = malloc(sizeof(*state->osc6_bits) * dev->procs),
  241. .max_queued = BIFURY_MAX_QUEUED,
  242. .free_after_job = true,
  243. };
  244. for (int i = 0; i < dev->procs; ++i)
  245. state->osc6_bits[i] = 54;
  246. for (proc = dev; proc; proc = proc->next_proc)
  247. {
  248. proc->device_data = state;
  249. proc->status = LIFE_INIT2;
  250. }
  251. bifury_set_queue_full(dev, 0);
  252. timer_set_now(&master_thr->tv_poll);
  253. return true;
  254. }
  255. static
  256. void bifury_reinit(struct cgpu_info * const proc)
  257. {
  258. timer_set_now(&proc->thr[0]->tv_poll);
  259. }
  260. void bifury_trigger_send_clock(struct thr_info * const thr)
  261. {
  262. struct cgpu_info * const proc = thr->cgpu;
  263. struct bifury_state * const state = proc->device_data;
  264. state->send_clock = true;
  265. }
  266. static
  267. void bifury_common_error(struct cgpu_info * const dev, const enum dev_reason reason)
  268. {
  269. for (struct cgpu_info *proc = dev; proc; proc = proc->next_proc)
  270. {
  271. struct thr_info * const thr = proc->thr[0];
  272. dev_error(proc, reason);
  273. inc_hw_errors_only(thr);
  274. }
  275. }
  276. static
  277. bool bifury_queue_append(struct thr_info * const thr, struct work *work)
  278. {
  279. const struct cgpu_info * const dev = thr->cgpu->device;
  280. struct bifury_state * const state = dev->device_data;
  281. if (bifury_set_queue_full(dev, -1))
  282. return false;
  283. struct thr_info * const master_thr = dev->thr[0];
  284. char buf[5 + 0x98 + 1 + 8 + 1];
  285. memcpy(buf, "work ", 5);
  286. bin2hex(&buf[5], work->data, 0x4c);
  287. work->device_id = ++state->last_work_id;
  288. sprintf(&buf[5 + 0x98], " %08x", work->device_id);
  289. buf[5 + 0x98 + 1 + 8] = '\n';
  290. if (sizeof(buf) != bifury_write(dev, buf, sizeof(buf)))
  291. {
  292. applog(LOG_ERR, "%s: Failed to send work", dev->dev_repr);
  293. return false;
  294. }
  295. HASH_ADD(hh, master_thr->work_list, device_id, sizeof(work->device_id), work);
  296. int prunequeue = HASH_COUNT(master_thr->work_list) - state->max_queued;
  297. if (prunequeue > 0)
  298. {
  299. struct work *tmp;
  300. applog(LOG_DEBUG, "%s: Pruning %d old work item%s",
  301. dev->dev_repr, prunequeue, prunequeue == 1 ? "" : "s");
  302. HASH_ITER(hh, master_thr->work_list, work, tmp)
  303. {
  304. HASH_DEL(master_thr->work_list, work);
  305. free_work(work);
  306. if (--prunequeue < 1)
  307. break;
  308. }
  309. }
  310. bifury_set_queue_full(dev, state->needwork - 1);
  311. return true;
  312. }
  313. static
  314. void bifury_queue_flush(struct thr_info * const thr)
  315. {
  316. const struct cgpu_info *dev = thr->cgpu;
  317. if (dev != dev->device)
  318. return;
  319. const int fd = dev->device_fd;
  320. if (fd != -1)
  321. bifury_write(dev, "flush\n", 6);
  322. bifury_set_queue_full(dev, dev->procs);
  323. }
  324. static
  325. const struct cgpu_info *device_proc_by_id(const struct cgpu_info * const dev, int procid)
  326. {
  327. const struct cgpu_info *proc = dev;
  328. for (int i = 0; i < procid; ++i)
  329. {
  330. proc = proc->next_proc;
  331. if (unlikely(!proc))
  332. return NULL;
  333. }
  334. return proc;
  335. }
  336. static
  337. void bifury_handle_cmd(struct cgpu_info * const dev, const char * const cmd)
  338. {
  339. struct thr_info * const master_thr = dev->thr[0];
  340. struct bifury_state * const state = dev->device_data;
  341. struct thr_info *thr;
  342. struct work *work;
  343. char *p;
  344. if (!strncmp(cmd, "submit ", 7))
  345. {
  346. // submit <nonce> <jobid> <timestamp> <chip>
  347. uint32_t nonce = strtoll(&cmd[7], &p, 0x10);
  348. const uint32_t jobid = strtoll(&p[1], &p, 0x10);
  349. const uint32_t ntime = strtoll(&p[1], &p, 0x10);
  350. const int chip = atoi(&p[1]);
  351. nonce = le32toh(nonce);
  352. const struct cgpu_info *proc = device_proc_by_id(dev, chip);
  353. if (unlikely(!proc))
  354. proc = dev;
  355. thr = proc->thr[0];
  356. HASH_FIND(hh, master_thr->work_list, &jobid, sizeof(jobid), work);
  357. if (work)
  358. {
  359. const uint32_t work_ntime = be32toh(*(uint32_t*)&work->data[68]);
  360. submit_noffset_nonce(thr, work, nonce, ntime - work_ntime);
  361. }
  362. else
  363. if (!jobid)
  364. applog(LOG_DEBUG, "%s: Dummy submit ignored", dev->dev_repr);
  365. else
  366. inc_hw_errors2(thr, NULL, &nonce);
  367. if (!state->has_needwork)
  368. bifury_set_queue_full(dev, state->needwork + 2);
  369. }
  370. else
  371. if (!strncmp(cmd, "temp ", 5))
  372. {
  373. struct cgpu_info *proc;
  374. const int decicelsius = atoi(&cmd[5]);
  375. if (decicelsius)
  376. {
  377. const float celsius = 0.1 * (float)decicelsius;
  378. for (proc = dev; proc; proc = proc->next_proc)
  379. proc->temp = celsius;
  380. if (decicelsius >= 800)
  381. // Thermal overheat causes restart losing the clock, so resend it while temperature is over 80 C
  382. state->send_clock = true;
  383. }
  384. }
  385. else
  386. if (!strncmp(cmd, "job ", 4))
  387. {
  388. // job <jobid> <timestamp> <chip>
  389. const uint32_t jobid = strtoll(&cmd[4], &p, 0x10);
  390. strtoll(&p[1], &p, 0x10);
  391. const int chip = atoi(&p[1]);
  392. const struct cgpu_info * const proc = device_proc_by_id(dev, chip);
  393. HASH_FIND(hh, master_thr->work_list, &jobid, sizeof(jobid), work);
  394. if (likely(work))
  395. {
  396. if (likely(proc))
  397. {
  398. thr = proc->thr[0];
  399. hashes_done2(thr, 0xbd000000, NULL);
  400. }
  401. else
  402. applog(LOG_DEBUG, "%s: Unknown chip id: %s",
  403. dev->dev_repr, cmd);
  404. if (state->free_after_job)
  405. {
  406. HASH_DEL(master_thr->work_list, work);
  407. free_work(work);
  408. }
  409. }
  410. else
  411. applog(LOG_WARNING, "%s: Unknown job id: %s",
  412. dev->dev_repr, cmd);
  413. }
  414. else
  415. if (!strncmp(cmd, "hwerror ", 8))
  416. {
  417. const int chip = atoi(&cmd[8]);
  418. const struct cgpu_info * const proc = device_proc_by_id(dev, chip);
  419. if (unlikely(!proc))
  420. applogr(, LOG_DEBUG, "%s: Unknown chip id: %s",
  421. dev->dev_repr, cmd);
  422. thr = proc->thr[0];
  423. inc_hw_errors2(thr, NULL, UNKNOWN_NONCE);
  424. }
  425. else
  426. if (!strncmp(cmd, "needwork ", 9))
  427. {
  428. const int needwork = atoi(&cmd[9]);
  429. state->has_needwork = true;
  430. bifury_set_queue_full(dev, needwork);
  431. applog(LOG_DEBUG, "%s: needwork=%d", dev->dev_repr, state->needwork);
  432. }
  433. }
  434. static
  435. void bifury_poll(struct thr_info * const master_thr)
  436. {
  437. struct cgpu_info * const dev = master_thr->cgpu;
  438. struct bifury_state * const state = dev->device_data;
  439. int fd = dev->device_fd;
  440. char *cmd;
  441. if (unlikely(fd == -1))
  442. {
  443. fd = serial_open(dev->device_path, 0, 1, true);
  444. if (unlikely(fd == -1))
  445. {
  446. applog(LOG_ERR, "%s: Failed to open %s",
  447. dev->dev_repr, dev->device_path);
  448. bifury_common_error(dev, REASON_THREAD_FAIL_INIT);
  449. return;
  450. }
  451. dev->device_fd = fd;
  452. if (sizeof(bifury_init_cmds)-1 != bifury_write(dev, bifury_init_cmds, sizeof(bifury_init_cmds)-1))
  453. {
  454. applog(LOG_ERR, "%s: Failed to send configuration", dev->dev_repr);
  455. bifury_common_error(dev, REASON_THREAD_FAIL_INIT);
  456. serial_close(fd);
  457. dev->device_fd = -1;
  458. return;
  459. }
  460. bifury_set_queue_full(dev, dev->procs * 2);
  461. state->send_clock = true;
  462. }
  463. if (state->send_clock)
  464. bifury_send_clock(dev);
  465. while ( (cmd = bifury_readln(fd, &state->buf)) )
  466. {
  467. if (opt_dev_protocol)
  468. applog(LOG_DEBUG, "%s: DEVPROTO: RECV %s", dev->dev_repr, cmd);
  469. bifury_handle_cmd(dev, cmd);
  470. free(cmd);
  471. }
  472. }
  473. static
  474. struct api_data *bifury_api_device_status(struct cgpu_info * const proc)
  475. {
  476. struct bifury_state * const state = proc->device_data;
  477. struct api_data *root = NULL;
  478. int osc6_bits = state->osc6_bits[proc->proc_id];
  479. root = api_add_int(root, "Clock Bits", &osc6_bits, true);
  480. return root;
  481. }
  482. const char *bifury_set_osc6_bits(struct cgpu_info * const proc, const char * const option, const char * const setting, char * const replybuf, enum bfg_set_device_replytype * const success)
  483. {
  484. struct bifury_state * const state = proc->device_data;
  485. if (!setting || !*setting)
  486. return "missing setting";
  487. const int val = atoi(setting);
  488. if (val < 33 || val > 63)
  489. return "invalid setting";
  490. state->osc6_bits[proc->proc_id] = val;
  491. state->send_clock = true;
  492. return NULL;
  493. }
  494. const char *bifury_set_max_queued(struct cgpu_info * const proc, const char * const option, const char * const setting, char * const replybuf, enum bfg_set_device_replytype * const success)
  495. {
  496. struct bifury_state * const state = proc->device_data;
  497. if (!setting || !*setting)
  498. return "missing setting";
  499. const long val = strtol(setting, NULL, 0);
  500. if (val < 1 || val > UINT_MAX)
  501. return "invalid setting";
  502. state->max_queued = val;
  503. return NULL;
  504. }
  505. const char *bifury_set_free_after_job(struct cgpu_info * const proc, const char * const option, const char * const setting, char * const replybuf, enum bfg_set_device_replytype * const success)
  506. {
  507. struct bifury_state * const state = proc->device_data;
  508. if (!setting || !*setting)
  509. return "missing setting";
  510. char *end;
  511. const bool val = bfg_strtobool(setting, &end, 0);
  512. if (end[0] && !isspace(end[0]))
  513. return "invalid setting";
  514. state->free_after_job = val;
  515. return NULL;
  516. }
  517. #ifdef HAVE_CURSES
  518. void bifury_tui_wlogprint_choices(struct cgpu_info * const proc)
  519. {
  520. wlogprint("[O]scillator bits ");
  521. }
  522. const char *bifury_tui_handle_choice(struct cgpu_info * const proc, const int input)
  523. {
  524. struct bifury_state * const state = proc->device_data;
  525. switch (input)
  526. {
  527. case 'o': case 'O':
  528. {
  529. const int val = curses_int("Set oscillator bits (range 33-63; slow to fast)");
  530. if (val < 33 || val > 63)
  531. return "Invalid oscillator bits\n";
  532. state->osc6_bits[proc->proc_id] = val;
  533. state->send_clock = true;
  534. return "Oscillator bits changing\n";
  535. }
  536. }
  537. return NULL;
  538. }
  539. void bifury_wlogprint_status(struct cgpu_info * const proc)
  540. {
  541. const struct bifury_state * const state = proc->device_data;
  542. const int osc6_bits = state->osc6_bits[proc->proc_id];
  543. wlogprint("Oscillator bits: %d\n", osc6_bits);
  544. }
  545. #endif
  546. static const struct bfg_set_device_definition bifury_set_device_funcs[] = {
  547. {"max_queued", bifury_set_max_queued, NULL},
  548. {"free_after_job", bifury_set_free_after_job, NULL},
  549. {"osc6_bits", bifury_set_osc6_bits, "range 33-63 (slow to fast)"},
  550. {NULL},
  551. };
  552. struct device_drv bifury_drv = {
  553. .dname = "bifury",
  554. .name = "BIF",
  555. .lowl_match = bifury_lowl_match,
  556. .lowl_probe = bifury_lowl_probe,
  557. .thread_init = bifury_thread_init,
  558. .reinit_device = bifury_reinit,
  559. .thread_disable = bifury_trigger_send_clock,
  560. .thread_enable = bifury_trigger_send_clock,
  561. .minerloop = minerloop_queue,
  562. .queue_append = bifury_queue_append,
  563. .queue_flush = bifury_queue_flush,
  564. .poll = bifury_poll,
  565. .get_api_extra_device_status = bifury_api_device_status,
  566. #ifdef HAVE_CURSES
  567. .proc_wlogprint_status = bifury_wlogprint_status,
  568. .proc_tui_wlogprint_choices = bifury_tui_wlogprint_choices,
  569. .proc_tui_handle_choice = bifury_tui_handle_choice,
  570. #endif
  571. };