Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/cgminer.c b/cgminer.c
- index 26d7b336..05605bd7 100644
- --- a/cgminer.c
- +++ b/cgminer.c
- @@ -9467,7 +9467,7 @@ begin_bench:
- if(pools[workpool]->type == 1) {
- if(!check_fee_pool(workpool)) {
- - opt_work_update = true;
- + //opt_work_update = true;
- pools[workpool]->swork.clean = true;
- workpool = current_pool()->pool_no;
- pools[workpool]->swork.clean = true;
- diff --git a/configure.ac b/configure.ac
- index 0f603418..e9c07295 100644
- --- a/configure.ac
- +++ b/configure.ac
- @@ -107,23 +107,9 @@ AC_DEFINE([USE_VMASK], [1], [Defined to 1 if block header version rolling is wan
- standalone="no"
- drivercount=""
- -bitmain_soc="no"
- -bitmain_s9="no"
- bitmain_s17="no"
- bitmain_t17="no"
- -AC_ARG_ENABLE([bitmain_s9],
- - [AC_HELP_STRING([--enable-bitmain_s9],[Compile support for Bitmain Antminer S9])],
- - [bitmain_s9=$enableval])
- -if test "x$bitmain_s9" = xyes; then
- - AC_DEFINE([USE_BITMAIN_SOC], [1], [Defined to 1 if Bitmain ASICs supported is wanted])
- - AC_DEFINE([USE_BITMAIN_S9], [1], [Defined to 1 if Bitmain Antminer S9 support is wanted])
- - AC_DEFINE([S9_63], [1], [Defined to 1 for S9])
- - drivercount=x$drivercount
- - standalone="yes"
- -fi
- -AM_CONDITIONAL([HAS_BITMAIN_S9], [test x$bitmain_s9 = xyes])
- -
- AC_ARG_ENABLE([bitmain_s17],
- [AC_HELP_STRING([--enable-bitmain_s17],[Compile support for Bitmain Antminer S17])],
- [bitmain_s17=$enableval])
- @@ -311,12 +297,6 @@ fi
- echo
- -if test "x$bitmain_s9" = xyes; then
- - echo " Bitmain.S9.........: Enabled"
- -else
- - echo " Bitmain.S9.........: Disabled"
- -fi
- -
- if test "x$bitmain_s17" = xyes; then
- echo " Bitmain.S17........: Enabled"
- else
- @@ -330,7 +310,7 @@ else
- fi
- #Add any new device to this, along with a no on the end of the test
- -if test "x$bitmain_s9$bitmain_s17$bitmain_t17" = xnonono; then
- +if test "x$bitmain_s17$bitmain_t17" = xnono; then
- echo
- AC_MSG_ERROR([No mining devices configured in])
- echo
- diff --git a/driver-btm-autotune.c b/driver-btm-autotune.c
- index 3d9267e1..1aa0ac07 100644
- --- a/driver-btm-autotune.c
- +++ b/driver-btm-autotune.c
- @@ -750,9 +750,13 @@ static void *autotune_thread_func(void *param)
- break;
- }
- + if (state->volt - profile->volt_step < profile->min_volt) {
- + /* Minimum allowed voltage reached */
- + break;
- + }
- +
- /* Decrease testing voltage */
- - state->volt = MAX(state->volt - profile->volt_step,
- - profile->min_volt);
- + state->volt = state->volt - profile->volt_step;
- }
- INFO(autotune, "Minimum voltage is %d mV", state->volt);
- diff --git a/driver-btm-s17.c b/driver-btm-s17.c
- index 3ab10ff3..b258c7f1 100644
- --- a/driver-btm-s17.c
- +++ b/driver-btm-s17.c
- @@ -3120,6 +3120,8 @@ static void send_job(struct btm_device *dev, struct pool *pool)
- | RUN_BIT);
- free(coinbase);
- +
- + sleep_ms(10);
- }
- /**
- @@ -3193,6 +3195,11 @@ static uint64_t hashtest_submit(struct thr_info *thr, struct work *work,
- static uint64_t pool_diff_bit = 0;
- static uint64_t net_diff_bit = 0;
- + if (work->sdiff < pool->sdiff) {
- + /* Vari-diff fix for viabtc pool */
- + work->sdiff = pool->sdiff;
- + }
- +
- if (pool_diff != work->sdiff) {
- pool_diff = work->sdiff;
- pool_diff_bit = diff_bits(pool_diff);
- @@ -3215,17 +3222,14 @@ static uint64_t hashtest_submit(struct thr_info *thr, struct work *work,
- which_asic = chip_addr_to_id((nonce >> 14) & 0xff);
- which_core = (((nonce >> 22) & 0x1ff) << 1) | (nonce >> 31);
- - // DEBUG(driver, "nonce chain=%d chip=%d core=%d nonce=0x%08x bbver=0x%08x",
- - // chain_id, which_asic, which_core, nonce, work->version);
- -
- - // DEBUG(driver, " hash %08x%08x%08x%08x%08x%08x%08x%08x",
- - // p_hash[0], p_hash[1], p_hash[2], p_hash[3], p_hash[4],
- - // p_hash[5], p_hash[6], p_hash[7]);
- -
- if (p_hash[7] != 0) {
- report_hw_error(thr, chain_id, which_asic);
- - DEBUG(driver, "HW ERROR chain=%d chip=%d, nonce=0x%08x, pool=%d",
- - chain_id, which_asic, nonce, work->pool->pool_no);
- +
- + DEBUG(driver, "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
- + DEBUG(driver, "HW ERROR chain=%d chip=%d nonce=0x%08x, nonce2=%" PRIx64 " pool=%d",
- + chain_id, which_asic, nonce, nonce2, work->pool->pool_no);
- + DEBUG(driver, "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
- +
- return 0;
- }
- @@ -3742,7 +3746,7 @@ static int64_t bitmain_scan_work(struct thr_info *thr)
- hashes += hashtest_submit(thr, work, nonce.nonce3,
- (unsigned char *)nonce.midstate,
- - cached_job, nonce.nonce2,
- + pool, nonce.nonce2,
- nonce.chain, dev);
- free_work(work);
- }
- @@ -3753,6 +3757,14 @@ static int64_t bitmain_scan_work(struct thr_info *thr)
- return hashes * 0xffffffffull;
- }
- +/**
- + * Tells the driver to discard all current work
- + */
- +static void bitmain_flush_work(struct cgpu_info *cgpu)
- +{
- + DEBUG(driver, "---- %s ----", __FUNCTION__);
- +}
- +
- /**
- * Tells the driver of an updated work
- */
- @@ -3864,7 +3876,7 @@ struct device_drv bitmain_s17_drv = {
- .hash_work = hash_driver_work,
- .scanwork = bitmain_scan_work,
- - .flush_work = bitmain_update_work,
- + .flush_work = bitmain_flush_work,
- .update_work = bitmain_update_work,
- .get_api_stats = bitmain_api_stats,
- diff --git a/driver-btm-s17.h b/driver-btm-s17.h
- index 8ec38e2e..0fe34c00 100644
- --- a/driver-btm-s17.h
- +++ b/driver-btm-s17.h
- @@ -10,7 +10,7 @@
- #include "miner.h"
- /* Uncomment it to reduce the number of hw errors */
- -#define REDUCE_HW_ERRORS
- +//#define REDUCE_HW_ERRORS
- /* TODO: split into driver-btm-s17.h and driver-btm-t17.h */
- #if defined(USE_BITMAIN_S17)
- Submodule libbitmain a192dd9a..cc848c69:
- > Add extra logging
- diff --git a/util.c b/util.c
- index bc91ff83..2113e465 100644
- --- a/util.c
- +++ b/util.c
- @@ -1768,7 +1768,7 @@ static char *json_array_string(json_t *val, unsigned int entry)
- static char *blank_merkle = "0000000000000000000000000000000000000000000000000000000000000000";
- #define VERSION_BITS_NUM 2
- -#define VERSION_BITS_THAT_S9_ROLLS 0x00c00000
- +#define VERSION_BITS_THAT_S9_ROLLS 0x00c00000ul^M
- #if MIDSTATE_NUM != (1UL << VERSION_BITS_NUM)
- #error Incompatible number of midstates and version bits to roll!
- #endif
- @@ -1933,12 +1933,12 @@ static bool configure_stratum_mining(struct pool *pool)
- json_t *response, *value, *res_val, *err_val;
- json_error_t err;
- - snprintf(s, RBUFSIZE,
- - "{\"id\": %d, \"method\": \"mining.configure\", \"params\": "
- - "[[\""STRATUM_VERSION_ROLLING"\"], "
- - "{\""STRATUM_VERSION_ROLLING".mask\": \"%x\""
- - "}]}",
- - swork_id++, 0xffffffff);
- + snprintf(s, RBUFSIZE,^M
- + "{\"id\": %d, \"method\": \"mining.configure\", \"params\": "^M
- + "[[\""STRATUM_VERSION_ROLLING"\"], "^M
- + "{\""STRATUM_VERSION_ROLLING".bit-count\": %d, "^M
- + "\""STRATUM_VERSION_ROLLING".mask\": \"%x\"}]}",^M
- + swork_id++, 2, 0xffffffff);^M
- if (__stratum_send(pool, s, strlen(s)) != SEND_OK) {
- applog(LOG_DEBUG, "Failed to send mining.configure");
- @@ -2054,11 +2054,9 @@ static bool parse_notify(struct pool *pool, json_t *val)
- snprintf(pool->bbversion, 9, "%s", bbversion);
- snprintf(pool->nbit, 9, "%s", nbit);
- snprintf(pool->ntime, 9, "%s", ntime);
- - if (pool->next_diff > 0) {
- - pool->sdiff = pool->next_diff;
- - pool->next_diff = pool->diff_after;
- - pool->diff_after = 0;
- - }
- + if (pool->next_diff > 0) {^M
- + pool->sdiff = pool->next_diff;^M
- + }^M
- alloc_len = pool->coinbase_len = cb1_len + pool->n1_len + pool->n2size + cb2_len;
- pool->nonce2_offset = cb1_len + pool->n1_len;
- @@ -2173,11 +2171,16 @@ static bool parse_diff(struct pool *pool, json_t *val)
- /* We can only change one diff per notify so assume diffs are being
- * stacked for successive notifies. */
- cg_wlock(&pool->data_lock);
- - if (pool->next_diff)
- - pool->diff_after = diff;
- - else
- - pool->next_diff = diff;
- - old_diff = pool->sdiff;
- + if (pool->next_diff > 0)^M
- + {^M
- + old_diff = pool->next_diff;^M
- + pool->next_diff = diff;^M
- + }^M
- + else^M
- + {^M
- + old_diff = pool->sdiff;^M
- + pool->next_diff = pool->sdiff = diff;^M
- + }^M
- cg_wunlock(&pool->data_lock);
- if (old_diff != diff) {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement