driver-titan.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597
  1. /*
  2. * Copyright 2014 Vitalii Demianets
  3. * Copyright 2014 KnCMiner
  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 <fcntl.h>
  11. #include <sys/ioctl.h>
  12. #include "deviceapi.h"
  13. #include "logging.h"
  14. #include "miner.h"
  15. #include "util.h"
  16. #include "titan-asic.h"
  17. #define KNC_TITAN_DEFAULT_FREQUENCY 275
  18. #define KNC_TITAN_HWERR_DISABLE_SECS 10
  19. #define KNC_POLL_INTERVAL_US 10000
  20. /* Specify here minimum number of leading zeroes in hash */
  21. #define DEFAULT_DIFF_FILTERING_ZEROES 24
  22. #define DEFAULT_DIFF_FILTERING_FLOAT (1. / ((double)(0x00000000FFFFFFFF >> DEFAULT_DIFF_FILTERING_ZEROES)))
  23. #define DEFAULT_DIFF_HASHES_PER_NONCE (1 << DEFAULT_DIFF_FILTERING_ZEROES)
  24. BFG_REGISTER_DRIVER(knc_titan_drv)
  25. static const struct bfg_set_device_definition knc_titan_set_device_funcs[];
  26. struct knc_titan_core {
  27. int asicno;
  28. int dieno; /* inside asic */
  29. int coreno; /* inside die */
  30. struct knc_titan_die *die;
  31. struct cgpu_info *proc;
  32. int hwerr_in_row;
  33. int hwerr_disable_time;
  34. struct timeval enable_at;
  35. struct timeval first_hwerr;
  36. struct nonce_report last_nonce;
  37. };
  38. struct knc_titan_die {
  39. int asicno;
  40. int dieno; /* inside asic */
  41. int cores;
  42. struct cgpu_info *first_proc;
  43. int freq;
  44. };
  45. struct knc_titan_info {
  46. void *ctx;
  47. struct cgpu_info *cgpu;
  48. int cores;
  49. struct knc_titan_die dies[KNC_TITAN_MAX_ASICS][KNC_TITAN_DIES_PER_ASIC];
  50. /* Per-ASIC data */
  51. bool need_flush[KNC_TITAN_MAX_ASICS];
  52. int next_slot[KNC_TITAN_MAX_ASICS];
  53. /* First slot after flush. If next_slot reaches this, then
  54. * we need to re-flush all the cores to avoid duplicating slot numbers
  55. * for different works */
  56. int first_slot[KNC_TITAN_MAX_ASICS];
  57. struct work *workqueue;
  58. int workqueue_size;
  59. int workqueue_max;
  60. int next_id;
  61. struct work *devicework;
  62. };
  63. static bool knc_titan_detect_one(const char *devpath)
  64. {
  65. static struct cgpu_info *prev_cgpu = NULL;
  66. struct cgpu_info *cgpu;
  67. void *ctx;
  68. struct knc_titan_info *knc;
  69. int cores = 0, asic, die;
  70. struct knc_die_info die_info;
  71. char repr[6];
  72. cgpu = malloc(sizeof(*cgpu));
  73. if (unlikely(!cgpu))
  74. quit(1, "Failed to alloc cgpu_info");
  75. if (!prev_cgpu) {
  76. if (NULL == (ctx = knc_trnsp_new(NULL))) {
  77. free(cgpu);
  78. return false;
  79. }
  80. knc = calloc(1, sizeof(*knc));
  81. if (unlikely(!knc))
  82. quit(1, "Failed to alloc knc_titan_info");
  83. knc->ctx = ctx;
  84. knc->cgpu = cgpu;
  85. knc->workqueue_max = KNC_TITAN_WORKSLOTS_PER_CORE + 1;
  86. } else {
  87. knc = prev_cgpu->device_data;
  88. ctx = knc->ctx;
  89. }
  90. snprintf(repr, sizeof(repr), "%s %s", knc_titan_drv.name, devpath);
  91. asic = atoi(devpath);
  92. for (die = 0; die < KNC_TITAN_DIES_PER_ASIC; ++die) {
  93. die_info.cores = KNC_TITAN_CORES_PER_DIE; /* core hint */
  94. die_info.version = KNC_VERSION_TITAN;
  95. if (!knc_titan_get_info(repr, ctx, asic, die, &die_info))
  96. continue;
  97. if (0 < die_info.cores) {
  98. knc->dies[asic][die] = (struct knc_titan_die) {
  99. .asicno = asic,
  100. .dieno = die,
  101. .cores = die_info.cores,
  102. .first_proc = cgpu,
  103. .freq = KNC_TITAN_DEFAULT_FREQUENCY,
  104. };
  105. cores += die_info.cores;
  106. } else {
  107. knc->dies[asic][die] = (struct knc_titan_die) {
  108. .asicno = -INT_MAX,
  109. .dieno = -INT_MAX,
  110. .cores = 0,
  111. .first_proc = NULL,
  112. };
  113. }
  114. }
  115. if (0 == cores) {
  116. free(cgpu);
  117. if (!prev_cgpu) {
  118. free(knc);
  119. knc_trnsp_free(ctx);
  120. }
  121. return false;
  122. }
  123. applog(LOG_NOTICE, "%s: Found ASIC with %d cores", repr, cores);
  124. *cgpu = (struct cgpu_info) {
  125. .drv = &knc_titan_drv,
  126. .device_path = strdup(devpath),
  127. .set_device_funcs = knc_titan_set_device_funcs,
  128. .deven = DEV_ENABLED,
  129. .procs = cores,
  130. .threads = prev_cgpu ? 0 : 1,
  131. .device_data = knc,
  132. };
  133. const bool rv = add_cgpu_slave(cgpu, prev_cgpu);
  134. prev_cgpu = cgpu;
  135. return rv;
  136. }
  137. static int knc_titan_detect_auto(void)
  138. {
  139. const int first = 0, last = KNC_TITAN_MAX_ASICS - 1;
  140. char devpath[256];
  141. int found = 0, i;
  142. for (i = first; i <= last; ++i) {
  143. sprintf(devpath, "%d", i);
  144. if (knc_titan_detect_one(devpath))
  145. ++found;
  146. }
  147. return found;
  148. }
  149. static void knc_titan_detect(void)
  150. {
  151. generic_detect(&knc_titan_drv, knc_titan_detect_one, knc_titan_detect_auto, GDF_REQUIRE_DNAME | GDF_DEFAULT_NOAUTO);
  152. }
  153. static void knc_titan_clean_flush(const char *repr, void * const ctx, int asic, int die)
  154. {
  155. struct knc_report report;
  156. bool unused;
  157. knc_titan_set_work(repr, ctx, asic, die, 0xFFFF, 0, NULL, true, &unused, &report);
  158. }
  159. static bool knc_titan_init(struct thr_info * const thr)
  160. {
  161. const int max_cores = KNC_TITAN_CORES_PER_ASIC;
  162. struct thr_info *mythr;
  163. struct cgpu_info * const cgpu = thr->cgpu, *proc;
  164. struct knc_titan_core *knccore;
  165. struct knc_titan_info *knc;
  166. int i, asic, die, core_base;
  167. int total_cores = 0;
  168. for (proc = cgpu; proc; ) {
  169. proc->min_nonce_diff = DEFAULT_DIFF_FILTERING_FLOAT;
  170. if (proc->device != proc) {
  171. applog(LOG_WARNING, "%"PRIpreprv": Extra processor?", proc->proc_repr);
  172. proc = proc->next_proc;
  173. continue;
  174. }
  175. asic = atoi(proc->device_path);
  176. knc = proc->device_data;
  177. die = 0;
  178. core_base = 0;
  179. for (i = 0; i < max_cores; ++i) {
  180. while (i >= (core_base + knc->dies[asic][die].cores)) {
  181. core_base += knc->dies[asic][die].cores;
  182. if (++die >= KNC_TITAN_DIES_PER_ASIC)
  183. break;
  184. }
  185. if (die >= KNC_TITAN_DIES_PER_ASIC)
  186. break;
  187. mythr = proc->thr[0];
  188. mythr->cgpu_data = knccore = malloc(sizeof(*knccore));
  189. if (unlikely(!knccore))
  190. quit(1, "Failed to alloc knc_titan_core");
  191. *knccore = (struct knc_titan_core) {
  192. .asicno = asic,
  193. .dieno = die,
  194. .coreno = i - core_base,
  195. .die = &(knc->dies[asic][die]),
  196. .proc = proc,
  197. .hwerr_in_row = 0,
  198. .hwerr_disable_time = KNC_TITAN_HWERR_DISABLE_SECS,
  199. };
  200. timer_set_now(&knccore->enable_at);
  201. proc->device_data = knc;
  202. ++total_cores;
  203. applog(LOG_DEBUG, "%s Allocated core %d:%d:%d", proc->device->dev_repr, asic, die, (i - core_base));
  204. if (0 == knccore->coreno) {
  205. knc->dies[asic][die].first_proc = proc;
  206. knc_titan_clean_flush(proc->device->dev_repr, knc->ctx, knccore->asicno, knccore->dieno);
  207. }
  208. proc = proc->next_proc;
  209. if ((!proc) || proc->device == proc)
  210. break;
  211. }
  212. knc->cores = total_cores;
  213. }
  214. cgpu_set_defaults(cgpu);
  215. if (0 >= total_cores)
  216. return false;
  217. /* Init nonce ranges for cores */
  218. double nonce_step = 4294967296.0 / total_cores;
  219. double nonce_f = 0.0;
  220. struct titan_setup_core_params setup_params = {
  221. .bad_address_mask = {0, 0},
  222. .bad_address_match = {0x3FF, 0x3FF},
  223. .difficulty = DEFAULT_DIFF_FILTERING_ZEROES - 1,
  224. .thread_enable = 0xFF,
  225. .thread_base_address = {0, 1, 2, 3, 4, 5, 6, 7},
  226. .lookup_gap_mask = {0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0x7},
  227. .N_mask = {0, 0, 0, 0, 0, 0, 0, 0},
  228. .N_shift = {0, 0, 0, 0, 0, 0, 0, 0},
  229. .nonce_bottom = 0,
  230. .nonce_top = 0xFFFFFFFF,
  231. };
  232. /* Use 2 threads per core */
  233. fill_in_thread_params(2, &setup_params);
  234. for (proc = cgpu; proc; proc = proc->next_proc) {
  235. nonce_f += nonce_step;
  236. setup_params.nonce_bottom = setup_params.nonce_top + 1;
  237. if (NULL != proc->next_proc)
  238. setup_params.nonce_top = nonce_f;
  239. else
  240. setup_params.nonce_top = 0xFFFFFFFF;
  241. knc = proc->device_data;
  242. mythr = proc->thr[0];
  243. knccore = mythr->cgpu_data;
  244. applog(LOG_DEBUG, "%s Setup core %d:%d:%d, nonces 0x%08X - 0x%08X", proc->device->dev_repr, knccore->asicno, knccore->dieno, knccore->coreno, setup_params.nonce_bottom, setup_params.nonce_top);
  245. knc_titan_setup_core_local(proc->device->dev_repr, knc->ctx, knccore->asicno, knccore->dieno, knccore->coreno, &setup_params);
  246. }
  247. for (asic = 0; asic < KNC_TITAN_MAX_ASICS; ++asic) {
  248. knc->next_slot[asic] = KNC_TITAN_MIN_WORK_SLOT_NUM;
  249. knc->first_slot[asic] = KNC_TITAN_MIN_WORK_SLOT_NUM;
  250. knc->need_flush[asic] = true;
  251. }
  252. timer_set_now(&thr->tv_poll);
  253. return true;
  254. }
  255. static bool knc_titan_prepare_work(struct thr_info *thr, struct work *work)
  256. {
  257. struct cgpu_info * const cgpu = thr->cgpu;
  258. work->nonce_diff = cgpu->min_nonce_diff;
  259. return true;
  260. }
  261. static void knc_titan_set_queue_full(struct knc_titan_info * const knc)
  262. {
  263. const bool full = (knc->workqueue_size >= knc->workqueue_max);
  264. struct cgpu_info *proc;
  265. for (proc = knc->cgpu; proc; proc = proc->next_proc) {
  266. struct thr_info * const thr = proc->thr[0];
  267. thr->queue_full = full;
  268. }
  269. }
  270. static void knc_titan_remove_local_queue(struct knc_titan_info * const knc, struct work * const work)
  271. {
  272. DL_DELETE(knc->workqueue, work);
  273. free_work(work);
  274. --knc->workqueue_size;
  275. }
  276. static void knc_titan_prune_local_queue(struct thr_info *thr)
  277. {
  278. struct cgpu_info * const cgpu = thr->cgpu;
  279. struct knc_titan_info * const knc = cgpu->device_data;
  280. struct work *work, *tmp;
  281. DL_FOREACH_SAFE(knc->workqueue, work, tmp) {
  282. if (stale_work(work, false))
  283. knc_titan_remove_local_queue(knc, work);
  284. }
  285. knc_titan_set_queue_full(knc);
  286. }
  287. static bool knc_titan_queue_append(struct thr_info * const thr, struct work * const work)
  288. {
  289. struct cgpu_info * const cgpu = thr->cgpu;
  290. struct knc_titan_info * const knc = cgpu->device_data;
  291. if (knc->workqueue_size >= knc->workqueue_max) {
  292. knc_titan_prune_local_queue(thr);
  293. if (thr->queue_full)
  294. return false;
  295. }
  296. DL_APPEND(knc->workqueue, work);
  297. ++knc->workqueue_size;
  298. knc_titan_set_queue_full(knc);
  299. if (thr->queue_full)
  300. knc_titan_prune_local_queue(thr);
  301. return true;
  302. }
  303. #define HASH_LAST_ADDED(head, out) \
  304. (out = (head) ? (ELMT_FROM_HH((head)->hh.tbl, (head)->hh.tbl->tail)) : NULL)
  305. static void knc_titan_queue_flush(struct thr_info * const thr)
  306. {
  307. struct cgpu_info * const cgpu = thr->cgpu;
  308. struct knc_titan_info * const knc = cgpu->device_data;
  309. struct work *work, *tmp;
  310. if (knc->cgpu != cgpu)
  311. return;
  312. DL_FOREACH_SAFE(knc->workqueue, work, tmp){
  313. knc_titan_remove_local_queue(knc, work);
  314. }
  315. knc_titan_set_queue_full(knc);
  316. HASH_LAST_ADDED(knc->devicework, work);
  317. if (work && stale_work(work, true)) {
  318. int asic;
  319. for (asic = 0; asic < KNC_TITAN_MAX_ASICS; ++asic)
  320. knc->need_flush[asic] = true;
  321. timer_set_now(&thr->tv_poll);
  322. }
  323. }
  324. static void knc_titan_poll(struct thr_info * const thr)
  325. {
  326. struct thr_info *mythr;
  327. struct cgpu_info * const cgpu = thr->cgpu, *proc;
  328. struct knc_titan_info * const knc = cgpu->device_data;
  329. struct knc_titan_core *knccore, *core1;
  330. struct work *work, *tmp;
  331. int workaccept = 0;
  332. unsigned long delay_usecs = KNC_POLL_INTERVAL_US;
  333. struct knc_report report;
  334. struct knc_die_info die_info;
  335. int asic;
  336. int die;
  337. int i, tmp_int;
  338. knc_titan_prune_local_queue(thr);
  339. for (asic = 0; asic < KNC_TITAN_MAX_ASICS; ++asic) {
  340. DL_FOREACH_SAFE(knc->workqueue, work, tmp) {
  341. bool work_accepted = false;
  342. bool need_replace;
  343. if (knc->first_slot[asic] > KNC_TITAN_MIN_WORK_SLOT_NUM)
  344. need_replace = ((knc->next_slot[asic] + 1) == knc->first_slot[asic]);
  345. else
  346. need_replace = (knc->next_slot[asic] == KNC_TITAN_MAX_WORK_SLOT_NUM);
  347. knccore = NULL;
  348. for (die = 0; die < KNC_TITAN_DIES_PER_ASIC; ++die) {
  349. if (0 >= knc->dies[asic][die].cores)
  350. continue;
  351. struct cgpu_info *first_proc = knc->dies[asic][die].first_proc;
  352. /* knccore is the core data of the first core in this asic */
  353. if (NULL == knccore)
  354. knccore = first_proc->thr[0]->cgpu_data;
  355. bool die_work_accepted = false;
  356. if (knc->need_flush[asic]) {
  357. for (proc = first_proc; proc; proc = proc->next_proc) {
  358. mythr = proc->thr[0];
  359. core1 = mythr->cgpu_data;
  360. bool unused;
  361. if ((core1->dieno != die) || (core1->asicno != asic))
  362. break;
  363. if (knc_titan_set_work(proc->proc_repr, knc->ctx, asic, die, core1->coreno, knc->next_slot[asic], work, true, &unused, &report)) {
  364. core1->last_nonce.slot = report.nonce[0].slot;
  365. core1->last_nonce.nonce = report.nonce[0].nonce;
  366. die_work_accepted = true;
  367. }
  368. }
  369. } else {
  370. if (!knc_titan_set_work(first_proc->dev_repr, knc->ctx, asic, die, 0xFFFF, knc->next_slot[asic], work, need_replace, &die_work_accepted, &report))
  371. die_work_accepted = false;
  372. }
  373. if (die_work_accepted)
  374. work_accepted = true;
  375. }
  376. if ((!work_accepted) || (NULL == knccore))
  377. break;
  378. if (knc->need_flush[asic] || need_replace) {
  379. struct work *work1, *tmp1;
  380. applog(LOG_NOTICE, "%s: Flushing stale works (%s)", knccore->proc->dev_repr,
  381. knc->need_flush[asic] ? "New work" : "Slot collision");
  382. knc->need_flush[asic] = false;
  383. knc->first_slot[asic] = knc->next_slot[asic];
  384. HASH_ITER(hh, knc->devicework, work1, tmp1) {
  385. if (asic == ((work1->device_id >> 8) & 0xFF)) {
  386. HASH_DEL(knc->devicework, work1);
  387. free_work(work1);
  388. }
  389. }
  390. delay_usecs = 0;
  391. }
  392. --knc->workqueue_size;
  393. DL_DELETE(knc->workqueue, work);
  394. work->device_id = (asic << 8) | knc->next_slot[asic];
  395. HASH_ADD(hh, knc->devicework, device_id, sizeof(work->device_id), work);
  396. if (++(knc->next_slot[asic]) > KNC_TITAN_MAX_WORK_SLOT_NUM)
  397. knc->next_slot[asic] = KNC_TITAN_MIN_WORK_SLOT_NUM;
  398. ++workaccept;
  399. }
  400. }
  401. applog(LOG_DEBUG, "%s: %d jobs accepted to queue (max=%d)", knc_titan_drv.dname, workaccept, knc->workqueue_max);
  402. for (asic = 0; asic < KNC_TITAN_MAX_ASICS; ++asic) {
  403. for (die = 0; die < KNC_TITAN_DIES_PER_ASIC; ++die) {
  404. if (0 >= knc->dies[asic][die].cores)
  405. continue;
  406. die_info.cores = knc->dies[asic][die].cores; /* core hint */
  407. die_info.version = KNC_VERSION_TITAN;
  408. if (!knc_titan_get_info(cgpu->dev_repr, knc->ctx, asic, die, &die_info))
  409. continue;
  410. for (proc = knc->dies[asic][die].first_proc; proc; proc = proc->next_proc) {
  411. mythr = proc->thr[0];
  412. knccore = mythr->cgpu_data;
  413. if ((knccore->dieno != die) || (knccore->asicno != asic))
  414. break;
  415. if (!die_info.has_report[knccore->coreno])
  416. continue;
  417. if (!knc_titan_get_report(proc->proc_repr, knc->ctx, asic, die, knccore->coreno, &report))
  418. continue;
  419. for (i = 0; i < KNC_TITAN_NONCES_PER_REPORT; ++i) {
  420. if ((report.nonce[i].slot == knccore->last_nonce.slot) &&
  421. (report.nonce[i].nonce == knccore->last_nonce.nonce))
  422. break;
  423. tmp_int = (asic << 8) | report.nonce[i].slot;
  424. HASH_FIND_INT(knc->devicework, &tmp_int, work);
  425. if (!work) {
  426. applog(LOG_WARNING, "%"PRIpreprv": Got nonce for unknown work in slot %u (asic %d)", proc->proc_repr, (unsigned)report.nonce[i].slot, asic);
  427. continue;
  428. }
  429. if (submit_nonce(mythr, work, report.nonce[i].nonce)) {
  430. hashes_done2(mythr, DEFAULT_DIFF_HASHES_PER_NONCE, NULL);
  431. knccore->hwerr_in_row = 0;
  432. }
  433. }
  434. knccore->last_nonce.slot = report.nonce[0].slot;
  435. knccore->last_nonce.nonce = report.nonce[0].nonce;
  436. }
  437. }
  438. }
  439. if (workaccept) {
  440. if (workaccept >= knc->workqueue_max) {
  441. knc->workqueue_max = workaccept;
  442. delay_usecs = 0;
  443. }
  444. knc_titan_set_queue_full(knc);
  445. }
  446. timer_set_delay_from_now(&thr->tv_poll, delay_usecs);
  447. }
  448. /*
  449. * specify settings / options via RPC or command line
  450. */
  451. /* support for --set-device
  452. * must be set before probing the device
  453. */
  454. static void knc_titan_set_clock_freq(struct cgpu_info * const device, int const val)
  455. {
  456. }
  457. static const char *knc_titan_set_clock(struct cgpu_info * const device, const char * const option, const char * const setting, char * const replybuf, enum bfg_set_device_replytype * const success)
  458. {
  459. knc_titan_set_clock_freq(device, atoi(setting));
  460. return NULL;
  461. }
  462. static const struct bfg_set_device_definition knc_titan_set_device_funcs[] = {
  463. { "clock", knc_titan_set_clock, NULL },
  464. { NULL },
  465. };
  466. /*
  467. * specify settings / options via TUI
  468. */
  469. #ifdef HAVE_CURSES
  470. static void knc_titan_tui_wlogprint_choices(struct cgpu_info * const proc)
  471. {
  472. wlogprint("[C]lock speed ");
  473. }
  474. static const char *knc_titan_tui_handle_choice(struct cgpu_info * const proc, const int input)
  475. {
  476. static char buf[0x100]; /* Static for replies */
  477. switch (input)
  478. {
  479. case 'c': case 'C':
  480. {
  481. sprintf(buf, "Set clock speed");
  482. char * const setting = curses_input(buf);
  483. knc_titan_set_clock_freq(proc->device, atoi(setting));
  484. return "Clock speed changed\n";
  485. }
  486. }
  487. return NULL;
  488. }
  489. static void knc_titan_wlogprint_status(struct cgpu_info * const proc)
  490. {
  491. wlogprint("Clock speed: N/A\n");
  492. }
  493. #endif
  494. struct device_drv knc_titan_drv =
  495. {
  496. /* metadata */
  497. .dname = "titan",
  498. .name = "KNC",
  499. .supported_algos = POW_SCRYPT,
  500. .drv_detect = knc_titan_detect,
  501. .thread_init = knc_titan_init,
  502. /* specify mining type - queue */
  503. .minerloop = minerloop_queue,
  504. .queue_append = knc_titan_queue_append,
  505. .queue_flush = knc_titan_queue_flush,
  506. .poll = knc_titan_poll,
  507. .prepare_work = knc_titan_prepare_work,
  508. /* TUI support - e.g. setting clock via UI */
  509. #ifdef HAVE_CURSES
  510. .proc_wlogprint_status = knc_titan_wlogprint_status,
  511. .proc_tui_wlogprint_choices = knc_titan_tui_wlogprint_choices,
  512. .proc_tui_handle_choice = knc_titan_tui_handle_choice,
  513. #endif
  514. };