mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-10 23:08:07 +00:00
Set BFLSC fan speed coarsely to keep it under 60 or auto as per specs saying it tries to stay below 60.
This commit is contained in:
parent
fd41eb4ef6
commit
630e7d7658
@ -116,6 +116,7 @@ struct bflsc_info {
|
||||
bool shutdown;
|
||||
bool flash_led;
|
||||
bool not_first_work; // allow ignoring the first nonce error
|
||||
bool fanauto;
|
||||
};
|
||||
|
||||
#define BFLSC_XLINKHDR '@'
|
||||
@ -1799,6 +1800,29 @@ static int64_t bflsc_scanwork(struct thr_info *thr)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void bflsc_set_fanspeed(struct cgpu_info *bflsc)
|
||||
{
|
||||
struct bflsc_info *sc_info = (struct bflsc_info *)bflsc->device_data;
|
||||
int amount, err;
|
||||
|
||||
if ((bflsc->temp <= 60 && sc_info->fanauto) ||
|
||||
(bflsc->temp > 60 && !sc_info->fanauto))
|
||||
return;
|
||||
|
||||
mutex_lock(&bflsc->device_mutex);
|
||||
if (bflsc->temp > 60) {
|
||||
write_to_dev(bflsc, 0, BFLSC_FAN4, BFLSC_FAN4_LEN, &amount,
|
||||
C_SETFAN);
|
||||
sc_info->fanauto = false;
|
||||
} else {
|
||||
write_to_dev(bflsc, 0, BFLSC_FANAUTO, BFLSC_FANOUT_LEN,
|
||||
&amount, C_SETFAN);
|
||||
sc_info->fanauto = true;
|
||||
}
|
||||
getok(bflsc, C_FANREPLY, &err, &amount);
|
||||
mutex_unlock(&bflsc->device_mutex);
|
||||
}
|
||||
|
||||
static bool bflsc_get_stats(struct cgpu_info *bflsc)
|
||||
{
|
||||
struct bflsc_info *sc_info = (struct bflsc_info *)(bflsc->device_data);
|
||||
@ -1821,6 +1845,8 @@ static bool bflsc_get_stats(struct cgpu_info *bflsc)
|
||||
nmsleep(BFLSC_TEMP_SLEEPMS);
|
||||
}
|
||||
|
||||
bflsc_set_fanspeed(bflsc);
|
||||
|
||||
return allok;
|
||||
}
|
||||
|
||||
|
@ -517,6 +517,8 @@ static const char *C_SENDTESTWORK_S = "SendTestWork";
|
||||
static const char *C_LATENCY_S = "SetLatency";
|
||||
static const char *C_SETLINE_S = "SetLine";
|
||||
static const char *C_VENDOR_S = "Vendor";
|
||||
static const char *C_SETFAN_S = "SetFan";
|
||||
static const char *C_FANREPLY_S = "GetFan";
|
||||
static const char *C_AVALON_TASK_S = "AvalonTask";
|
||||
static const char *C_AVALON_READ_S = "AvalonRead";
|
||||
static const char *C_GET_AVALON_READY_S = "AvalonReady";
|
||||
@ -1002,6 +1004,8 @@ static void cgusb_check_init()
|
||||
usb_commands[C_LATENCY] = C_LATENCY_S;
|
||||
usb_commands[C_SETLINE] = C_SETLINE_S;
|
||||
usb_commands[C_VENDOR] = C_VENDOR_S;
|
||||
usb_commands[C_SETFAN] = C_SETFAN_S;
|
||||
usb_commands[C_FANREPLY] = C_FANREPLY_S;
|
||||
usb_commands[C_AVALON_TASK] = C_AVALON_TASK_S;
|
||||
usb_commands[C_AVALON_READ] = C_AVALON_READ_S;
|
||||
usb_commands[C_GET_AVALON_READY] = C_GET_AVALON_READY_S;
|
||||
|
@ -240,6 +240,8 @@ enum usb_cmds {
|
||||
C_LATENCY,
|
||||
C_SETLINE,
|
||||
C_VENDOR,
|
||||
C_SETFAN,
|
||||
C_FANREPLY,
|
||||
C_AVALON_TASK,
|
||||
C_AVALON_READ,
|
||||
C_GET_AVALON_READY,
|
||||
|
Loading…
Reference in New Issue
Block a user