driver-bitmain.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592
  1. /*
  2. * Copyright 2013 BitMain project
  3. * Copyright 2013 BitMain <xlc1985@126.com>
  4. * Copyright 2014-2015 Andrew Smith
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License as published by the Free
  8. * Software Foundation; either version 3 of the License, or (at your option)
  9. * any later version. See COPYING for more details.
  10. */
  11. #ifndef BITMAIN_H
  12. #define BITMAIN_H
  13. // S3 is a USB S2 with other minor changes (search for USE_ANT_S3)
  14. #if defined(USE_ANT_S3)
  15. #define USE_ANT_S2 1
  16. #endif
  17. #if (defined(USE_ANT_S1) || defined(USE_ANT_S2))
  18. #include "util.h"
  19. #include "klist.h"
  20. #define BITMAIN_RESET_FAULT_DECISECONDS 1
  21. #define BITMAIN_MINER_THREADS 1
  22. #define BITMAIN_IO_SPEED 115200
  23. #define BITMAIN_HASH_TIME_FACTOR ((float)1.67/0x32)
  24. #define BITMAIN_RESET_PITCH (300*1000*1000)
  25. #define BITMAIN_TOKEN_TYPE_TXCONFIG 0x51
  26. #define BITMAIN_TOKEN_TYPE_TXTASK 0x52
  27. #define BITMAIN_TOKEN_TYPE_RXSTATUS 0x53
  28. #define BITMAIN_DATA_TYPE_RXSTATUS 0xa1
  29. #define BITMAIN_DATA_TYPE_RXNONCE 0xa2
  30. #define BITMAIN_FAN_FACTOR 60
  31. #define BITMAIN_PWM_MAX 0xA0
  32. #define BITMAIN_DEFAULT_FAN_MIN 20
  33. #define BITMAIN_DEFAULT_FAN_MAX 100
  34. #define BITMAIN_DEFAULT_FAN_MAX_PWM 0xA0 /* 100% */
  35. #define BITMAIN_DEFAULT_FAN_MIN_PWM 0x20 /* 20% */
  36. #define BITMAIN_TEMP_TARGET 50
  37. #define BITMAIN_TEMP_HYSTERESIS 3
  38. #define BITMAIN_TEMP_OVERHEAT 75
  39. #define BITMAIN_DEFAULT_TIMEOUT 0x2D
  40. #define BITMAIN_MIN_FREQUENCY 10
  41. #define BITMAIN_MAX_FREQUENCY 1000000
  42. #define BITMAIN_TIMEOUT_FACTOR 12690
  43. #define BITMAIN_DEFAULT_FREQUENCY 282
  44. #define BITMAIN_DEFAULT_CHAIN_NUM 8
  45. #define BITMAIN_DEFAULT_ASIC_NUM 32
  46. #define BITMAIN_DEFAULT_REG_DATA 0
  47. #define BITMAIN_AUTO_CYCLE 1024
  48. #ifdef USE_ANT_S1
  49. #define BITMAIN_FTDI_READSIZE 510
  50. #define BITMAIN_DEFAULT_VOLTAGE 5
  51. #define BITMAIN_WORK_DELAY 1
  52. #else // S2 or S3
  53. #ifdef USE_ANT_S3 // S3
  54. #define BITMAIN_FTDI_READSIZE 510
  55. #define BITMAIN_VOLTAGE_DEF "0000"
  56. #define BITMAIN_VOLTAGE0_DEF 0x00
  57. #define BITMAIN_VOLTAGE1_DEF 0x00
  58. #define BITMAIN_WORK_DELAY 1
  59. #else // S2
  60. #define BITMAIN_FTDI_READSIZE 2048
  61. #define BITMAIN_VOLTAGE_DEF "0725"
  62. #define BITMAIN_VOLTAGE0_DEF 0x07
  63. #define BITMAIN_VOLTAGE1_DEF 0x25
  64. #define BITMAIN_WORK_DELAY 1
  65. #endif
  66. #endif
  67. #define BITMAIN_USB_PACKETSIZE 512
  68. #define BITMAIN_SENDBUF_SIZE 8192
  69. #define BITMAIN_READBUF_SIZE 8192
  70. #define BITMAIN_RESET_TIMEOUT 100
  71. #define BITMAIN_LATENCY 1
  72. #ifdef USE_ANT_S1
  73. #define BITMAIN_READ_TIMEOUT 18 /* Enough to only half fill the buffer */
  74. #define BITMAIN_MAX_WORK_NUM 8
  75. #define BITMAIN_MAX_WORK_QUEUE_NUM 64
  76. #define BITMAIN_MAX_DEAL_QUEUE_NUM 1
  77. #define BITMAIN_MAX_NONCE_NUM 8
  78. #define BITMAIN_MAX_CHAIN_NUM 8
  79. #else // S2 or S3
  80. #ifdef USE_ANT_S3
  81. #define BITMAIN_READ_TIMEOUT 100
  82. #define BITMAIN_MAX_WORK_NUM 8
  83. #define BITMAIN_MAX_WORK_QUEUE_NUM 1024
  84. #define BITMAIN_MAX_DEAL_QUEUE_NUM 2
  85. #define BITMAIN_MAX_NONCE_NUM 128
  86. #define BITMAIN_MAX_CHAIN_NUM 8
  87. #else // S2
  88. #define BITMAIN_READ_TIMEOUT 0 // Ignored
  89. #define BITMAIN_MAX_WORK_NUM 64
  90. #define BITMAIN_MAX_WORK_QUEUE_NUM 4096
  91. #define BITMAIN_MAX_DEAL_QUEUE_NUM 32
  92. #define BITMAIN_MAX_NONCE_NUM 128
  93. #define BITMAIN_MAX_CHAIN_NUM 16
  94. #endif
  95. #endif
  96. #define BITMAIN_MAX_TEMP_NUM 32
  97. #define BITMAIN_MAX_FAN_NUM 32
  98. #ifdef USE_ANT_S1
  99. #define BITMAIN_SEND_STATUS_TIME 10 //s
  100. #define BITMAIN_SEND_FULL_SPACE 128
  101. #else // S2 or S3
  102. #define BITMAIN_SEND_STATUS_TIME 15 //s
  103. #ifdef USE_ANT_S3
  104. #define BITMAIN_SEND_FULL_SPACE 256
  105. #else
  106. #define BITMAIN_SEND_FULL_SPACE 512
  107. #endif
  108. #endif
  109. #define BITMAIN_OVERHEAT_SLEEP_MS_MAX 10000
  110. #define BITMAIN_OVERHEAT_SLEEP_MS_MIN 200
  111. #define BITMAIN_OVERHEAT_SLEEP_MS_DEF 600
  112. #define BITMAIN_OVERHEAT_SLEEP_MS_STEP 200
  113. #ifdef USE_ANT_S2
  114. struct bitmain_packet_head {
  115. uint8_t token_type;
  116. uint8_t version;
  117. uint16_t length;
  118. } __attribute__((packed, aligned(4)));
  119. #endif
  120. struct bitmain_txconfig_token {
  121. uint8_t token_type;
  122. #ifdef USE_ANT_S1
  123. uint8_t length;
  124. #else // S2
  125. uint8_t version;
  126. uint16_t length;
  127. #endif
  128. uint8_t reset :1;
  129. uint8_t fan_eft :1;
  130. uint8_t timeout_eft :1;
  131. uint8_t frequency_eft :1;
  132. uint8_t voltage_eft :1;
  133. uint8_t chain_check_time_eft :1;
  134. uint8_t chip_config_eft :1;
  135. uint8_t hw_error_eft :1;
  136. uint8_t beeper_ctrl :1;
  137. uint8_t temp_over_ctrl :1;
  138. uint8_t fan_home_mode :1;
  139. uint8_t reserved1 :5;
  140. #ifndef USE_ANT_S1
  141. uint8_t chain_check_time;
  142. uint8_t reserved2;
  143. #endif
  144. uint8_t chain_num;
  145. uint8_t asic_num;
  146. uint8_t fan_pwm_data;
  147. uint8_t timeout_data;
  148. uint16_t frequency;
  149. #ifdef USE_ANT_S1
  150. uint8_t voltage;
  151. uint8_t chain_check_time;
  152. #else
  153. uint8_t voltage[2];
  154. #endif
  155. uint8_t reg_data[4];
  156. uint8_t chip_address;
  157. uint8_t reg_address;
  158. uint16_t crc;
  159. } __attribute__((packed, aligned(4)));
  160. struct bitmain_txtask_work {
  161. uint32_t work_id;
  162. uint8_t midstate[32];
  163. uint8_t data2[12];
  164. } __attribute__((packed, aligned(4)));
  165. struct bitmain_txtask_token {
  166. #ifdef USE_ANT_S1
  167. uint8_t token_type;
  168. uint8_t reserved1;
  169. uint16_t length;
  170. uint8_t new_block :1;
  171. uint8_t reserved2 :7;
  172. uint8_t reserved3[3];
  173. struct bitmain_txtask_work works[BITMAIN_MAX_WORK_NUM];
  174. uint16_t crc;
  175. #else // S2
  176. uint8_t token_type;
  177. uint8_t version;
  178. uint16_t length;
  179. uint8_t new_block :1;
  180. uint8_t reserved1 :7;
  181. uint8_t diff;
  182. uint8_t reserved2[2];
  183. struct bitmain_txtask_work works[BITMAIN_MAX_WORK_NUM];
  184. uint16_t crc;
  185. #endif
  186. } __attribute__((packed, aligned(4)));
  187. struct bitmain_rxstatus_token {
  188. #ifdef USE_ANT_S1
  189. uint8_t token_type;
  190. uint8_t length;
  191. uint8_t chip_status_eft :1;
  192. uint8_t detect_get :1;
  193. uint8_t reserved1 :6;
  194. uint8_t reserved2;
  195. uint8_t chip_address;
  196. uint8_t reg_address;
  197. uint16_t crc;
  198. #else // S2
  199. uint8_t token_type;
  200. uint8_t version;
  201. uint16_t length;
  202. uint8_t chip_status_eft :1;
  203. uint8_t detect_get :1;
  204. uint8_t reserved1 :6;
  205. uint8_t reserved2[3];
  206. uint8_t chip_address;
  207. uint8_t reg_address;
  208. uint16_t crc;
  209. #endif
  210. } __attribute__((packed, aligned(4)));
  211. struct bitmain_rxstatus_data {
  212. #ifdef USE_ANT_S1
  213. uint8_t data_type;
  214. uint8_t length;
  215. uint8_t chip_value_eft :1;
  216. uint8_t reserved1 :7;
  217. uint8_t version;
  218. uint32_t fifo_space;
  219. uint32_t reg_value;
  220. uint32_t nonce_error;
  221. uint8_t chain_num;
  222. uint8_t temp_num;
  223. uint8_t fan_num;
  224. uint8_t reserved2;
  225. uint32_t chain_asic_status[BITMAIN_MAX_CHAIN_NUM];
  226. uint8_t chain_asic_num[BITMAIN_MAX_CHAIN_NUM];
  227. uint8_t temp[BITMAIN_MAX_TEMP_NUM];
  228. uint8_t fan[BITMAIN_MAX_FAN_NUM];
  229. uint16_t crc;
  230. #else // S2
  231. uint8_t data_type;
  232. uint8_t version;
  233. uint16_t length;
  234. uint8_t chip_value_eft :1;
  235. uint8_t reserved1 :7;
  236. uint8_t chain_num;
  237. uint16_t fifo_space;
  238. uint8_t hw_version[4];
  239. uint8_t fan_num;
  240. uint8_t temp_num;
  241. uint16_t fan_exist;
  242. uint32_t temp_exist;
  243. uint32_t nonce_error;
  244. uint32_t reg_value;
  245. uint32_t chain_asic_exist[BITMAIN_MAX_CHAIN_NUM*8];
  246. uint32_t chain_asic_status[BITMAIN_MAX_CHAIN_NUM*8];
  247. uint8_t chain_asic_num[BITMAIN_MAX_CHAIN_NUM];
  248. uint8_t temp[BITMAIN_MAX_TEMP_NUM];
  249. uint8_t fan[BITMAIN_MAX_FAN_NUM];
  250. uint16_t crc;
  251. #endif
  252. } __attribute__((packed, aligned(4)));
  253. struct bitmain_rxnonce_nonce {
  254. uint32_t work_id;
  255. uint32_t nonce;
  256. } __attribute__((packed, aligned(4)));
  257. struct bitmain_rxnonce_data {
  258. #ifdef USE_ANT_S1
  259. uint8_t data_type;
  260. uint8_t length;
  261. uint8_t fifo_space;
  262. uint8_t nonce_num;
  263. struct bitmain_rxnonce_nonce nonces[BITMAIN_MAX_NONCE_NUM];
  264. uint16_t crc;
  265. #else
  266. uint8_t data_type;
  267. uint8_t version;
  268. uint16_t length;
  269. uint16_t fifo_space;
  270. uint16_t diff;
  271. uint64_t total_nonce_num;
  272. struct bitmain_rxnonce_nonce nonces[BITMAIN_MAX_NONCE_NUM];
  273. uint16_t crc;
  274. #endif
  275. } __attribute__((packed, aligned(4)));
  276. /* how many usec stats ranges
  277. * [0] for a call that didn't process
  278. * [1] to [PROFILE_STATS] for less than NxPROFILE_STEP_USEC
  279. * [PROFILE_STATS+1] for > PROFILE_STATSxPROFILE_STEP_USEC */
  280. #define PROFILE_STATS 10
  281. #define PROFILE_STEP_USEC 200
  282. // set to 0/1 to disable/enable updating the stats
  283. #if 1
  284. #define PROFILE_START(_stt) cgtime(&(_stt))
  285. #define PROFILE_ZERO(_ranges) (_ranges)[0]++
  286. #define PROFILE_FINISH(_stt, _count, _total, _ranges) do { \
  287. struct timeval _fin; \
  288. int64_t _tot, _range; \
  289. cgtime(&(_fin)); \
  290. (_count)++; \
  291. _tot = _fin.tv_usec - (_stt).tv_usec; \
  292. _tot += ((_fin.tv_sec - (_stt).tv_sec) * 1000000); \
  293. (_total) += _tot; \
  294. _range = _tot / PROFILE_STEP_USEC; \
  295. if (_range < 0) \
  296. _range = 0; \
  297. else if (_range > PROFILE_STATS) \
  298. _range = PROFILE_STATS; \
  299. (_ranges)[(int)(_range+1)]++; \
  300. } while(0)
  301. #define PROFILE_FINISH2(_stt, _count, _total, _total2, _ranges, _ranges2, _delta) do { \
  302. struct timeval _fin; \
  303. int64_t _tot, _range; \
  304. cgtime(&(_fin)); \
  305. (_count)++; \
  306. _tot = _fin.tv_usec - (_stt).tv_usec; \
  307. _tot += ((_fin.tv_sec - (_stt).tv_sec) * 1000000); \
  308. (_total) += _tot; \
  309. _range = _tot / PROFILE_STEP_USEC; \
  310. if (_range < 0) \
  311. _range = 0; \
  312. else if (_range > PROFILE_STATS) \
  313. _range = PROFILE_STATS; \
  314. (_ranges)[(int)(_range+1)]++; \
  315. _tot -= _delta; \
  316. (_total2) += _tot; \
  317. _range = _tot / PROFILE_STEP_USEC; \
  318. if (_range < 0) \
  319. _range = 0; \
  320. else if (_range > PROFILE_STATS) \
  321. _range = PROFILE_STATS; \
  322. (_ranges2)[(int)(_range+1)]++; \
  323. } while(0)
  324. #else
  325. // Avoid gcc warnings
  326. #define PROFILE_START(_stt) do { \
  327. if ((_stt).tv_sec != 0L) \
  328. (_stt).tv_sec = 0L; \
  329. } while (0)
  330. #define PROFILE_ZERO(_ranges) (_ranges)[0] = 0L
  331. #define PROFILE_FINISH(_stt, _count, _total, _ranges) _count = 0L
  332. #define PROFILE_FINISH2(_stt, _count, _total, _total2, _ranges, _ranges2, _delta) _count = 0L
  333. #endif
  334. struct bitmain_info {
  335. int queued;
  336. int results;
  337. #ifdef USE_ANT_S1
  338. int baud;
  339. int chain_num;
  340. int asic_num;
  341. int chain_asic_num[BITMAIN_MAX_CHAIN_NUM];
  342. uint32_t chain_asic_status[BITMAIN_MAX_CHAIN_NUM];
  343. char chain_asic_status_t[BITMAIN_MAX_CHAIN_NUM][40];
  344. #else // S2 or S3
  345. #ifndef USE_ANT_S3
  346. int device_fd;
  347. #endif
  348. int baud;
  349. int chain_num;
  350. int asic_num;
  351. int chain_asic_num[BITMAIN_MAX_CHAIN_NUM];
  352. uint32_t chain_asic_exist[BITMAIN_MAX_CHAIN_NUM*8];
  353. uint32_t chain_asic_status[BITMAIN_MAX_CHAIN_NUM*8];
  354. char chain_asic_status_t[BITMAIN_MAX_CHAIN_NUM][320];
  355. #endif
  356. int timeout;
  357. int errorcount;
  358. uint32_t nonce_error;
  359. uint32_t last_nonce_error;
  360. uint8_t reg_data[4];
  361. int fan_num;
  362. int fan[BITMAIN_MAX_FAN_NUM];
  363. int temp_num;
  364. int temp[BITMAIN_MAX_TEMP_NUM];
  365. int temp_max;
  366. int temp_avg;
  367. int temp_history_count;
  368. int temp_history_index;
  369. int temp_sum;
  370. int fan_pwm;
  371. int frequency;
  372. int temp_hi;
  373. #ifdef USE_ANT_S1
  374. int voltage;
  375. #else
  376. uint8_t voltage[2];
  377. uint64_t total_nonce_num;
  378. int diff;
  379. #endif
  380. int no_matching_work;
  381. //int matching_work[BITMAIN_DEFAULT_CHAIN_NUM];
  382. struct thr_info *thr;
  383. pthread_t read_thr;
  384. pthread_t write_thr;
  385. pthread_mutex_t lock;
  386. pthread_mutex_t qlock;
  387. pthread_cond_t qcond;
  388. cgsem_t write_sem;
  389. int nonces;
  390. int fifo_space;
  391. unsigned int last_work_block;
  392. struct timeval last_status_time;
  393. int send_full_space;
  394. #ifdef USE_ANT_S2
  395. int hw_version[4];
  396. #endif
  397. int auto_queued;
  398. int auto_hw;
  399. int idle;
  400. bool reset;
  401. bool optimal;
  402. #ifdef USE_ANT_S1
  403. bool overheat;
  404. int overheat_temp;
  405. uint32_t overheat_count;
  406. uint32_t overheat_sleep_ms;
  407. uint32_t overheat_sleeps;
  408. uint32_t overheat_slept;
  409. uint64_t overheat_total_sleep;
  410. uint32_t overheat_recovers;
  411. #endif
  412. // Work
  413. K_LIST *work_list;
  414. K_STORE *work_ready;
  415. #ifdef USE_ANT_S2
  416. K_STORE *wbuild;
  417. #endif
  418. uint32_t last_wid;
  419. uint64_t work_search;
  420. uint64_t tot_search;
  421. uint64_t min_search;
  422. uint64_t max_search;
  423. uint64_t failed_search;
  424. uint64_t tot_failed;
  425. uint64_t min_failed;
  426. uint64_t max_failed;
  427. uint64_t fill_calls;
  428. uint64_t fill_loop_count[BITMAIN_MAX_WORK_NUM+1];
  429. int64_t fill_usec_count;
  430. int64_t fill_usec;
  431. int64_t fill_usec_ranges[PROFILE_STATS+2];
  432. uint64_t fill_nospace;
  433. uint64_t fifo_checks;
  434. uint64_t fill_neededless;
  435. uint64_t fill_totalneeded;
  436. uint64_t fill_need[BITMAIN_MAX_WORK_NUM+1];
  437. uint64_t fill_want;
  438. bool got_work;
  439. uint64_t fill_start_nowork;
  440. uint64_t fill_nowork;
  441. uint64_t fill_roll;
  442. int fill_rollmin;
  443. int fill_rollmax;
  444. uint64_t fill_rolltot;
  445. uint64_t fill_rolllimit;
  446. uint64_t fill_toosmall;
  447. uint64_t fill_less;
  448. uint64_t fill_sends;
  449. uint64_t fill_totalsend;
  450. uint64_t fill_send[BITMAIN_MAX_WORK_NUM+1];
  451. uint64_t fill_sendless[BITMAIN_MAX_WORK_NUM+1];
  452. uint64_t fill_seterr;
  453. uint64_t fill_senderr;
  454. uint64_t fill_sleepsa;
  455. uint64_t fill_sleepsb;
  456. uint64_t need_over;
  457. uint64_t need_nowork[BITMAIN_MAX_WORK_NUM+1];
  458. uint64_t fill_sendstatus;
  459. int64_t fill_stat_usec_count;
  460. int64_t fill_stat_usec;
  461. int64_t fill_stat_usec_ranges[PROFILE_STATS+2];
  462. uint64_t read_good;
  463. uint64_t read_size;
  464. uint64_t read_0s;
  465. uint64_t read_18s;
  466. int read_sizemin;
  467. int read_sizemax;
  468. uint64_t read_bad;
  469. uint64_t readbuf_over;
  470. uint64_t get_results;
  471. uint64_t get_sleepsa;
  472. uint64_t get_sleepsb;
  473. uint64_t get_sleepsc;
  474. int64_t get_usec_count;
  475. int64_t get_usec;
  476. int64_t get_usec_ranges[PROFILE_STATS+2];
  477. int64_t get_usec2;
  478. int64_t get_usec2_ranges[PROFILE_STATS+2];
  479. };
  480. // Work
  481. typedef struct witem {
  482. struct work *work;
  483. uint32_t wid;
  484. } WITEM;
  485. #ifdef USE_ANT_S1
  486. #define ALLOC_WITEMS 4096
  487. #else
  488. #ifdef USE_ANT_S3
  489. #define ALLOC_WITEMS 4096
  490. #else // S2
  491. #define ALLOC_WITEMS 32768
  492. #endif
  493. #endif
  494. /*
  495. * The limit doesn't matter since we simply take the tail item
  496. * every time, optionally free it, and then put it on the head
  497. */
  498. #define LIMIT_WITEMS ALLOC_WITEMS
  499. #define DATAW(_item) ((WITEM *)(_item->data))
  500. #define BITMAIN_READ_SIZE 12
  501. #ifdef USE_ANT_S2
  502. #define BITMAIN_ARRAY_SIZE 16384
  503. #endif
  504. #define BTM_GETS_ERROR -1
  505. #define BTM_GETS_OK 0
  506. #define BTM_SEND_ERROR -1
  507. #define BTM_SEND_OK 0
  508. #define BITMAIN_READ_TIME(baud) ((double)BITMAIN_READ_SIZE * (double)8.0 / (double)(baud))
  509. #define ASSERT1(condition) __maybe_unused static char sizeof_uint32_t_must_be_4[(condition)?1:-1]
  510. ASSERT1(sizeof(uint32_t) == 4);
  511. // All command options
  512. extern char *opt_bitmain_options;
  513. extern char *opt_bitmain_freq;
  514. #ifdef USE_ANT_S2
  515. extern bool opt_bitmain_checkall;
  516. extern bool opt_bitmain_checkn2diff;
  517. #ifndef USE_ANT_S3
  518. extern char *opt_bitmain_dev;
  519. #endif
  520. #endif
  521. extern struct bitmain_info **bitmain_info;
  522. extern bool opt_bitmain_hwerror;
  523. #ifdef USE_ANT_S2
  524. extern bool opt_bitmain_checkall;
  525. extern bool opt_bitmain_checkn2diff;
  526. #endif
  527. extern bool opt_bitmain_beeper;
  528. extern bool opt_bitmain_tempoverctrl;
  529. extern int opt_bitmain_temp;
  530. extern int opt_bitmain_workdelay;
  531. extern int opt_bitmain_overheat;
  532. extern int opt_bitmain_fan_min;
  533. extern int opt_bitmain_fan_max;
  534. extern bool opt_bitmain_auto;
  535. extern char *set_bitmain_fan(char *arg);
  536. #endif /* USE_ANT_S1 || USE_ANT_S2 */
  537. #endif /* BITMAIN_H */