@@ -34,6 +34,8 @@ extern void _bfg_register_driver(const struct device_drv *);
} \
// END BFG_REGISTER_DRIVER
+extern bool bfg_need_detect_rescan;
+
extern void request_work(struct thr_info *);
extern struct work *get_work(struct thr_info *);
extern bool hashes_done(struct thr_info *, int64_t hashes, struct timeval *tvp_hashes, uint32_t *max_nonce);
@@ -10112,9 +10112,14 @@ extern void setup_pthread_cancel_workaround();
extern struct sigaction pcwm_orig_term_handler;
#endif
+bool bfg_need_detect_rescan;
static
void drv_detect_all()
{
+rescan:
+ bfg_need_detect_rescan = false;
#ifdef HAVE_BFG_LOWLEVEL
lowlevel_scan();
@@ -10134,6 +10139,12 @@ void drv_detect_all()
lowlevel_scan_free();
+ if (bfg_need_detect_rescan)
+ {
+ applog(LOG_DEBUG, "Device rescan requested");
+ goto rescan;
+ }
}