1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-11 15:27:53 +00:00
Commit Graph

191 Commits

Author SHA1 Message Date
Luke Dashjr
fa3a25f876 Bugfix: bitforce: Allocate enough space for FTDI description pointers
Con's uglify of the FTDI autodetect replaced a standard C99 array with non-standard alloca that needs the developer to specify the size in bytes rather than elements, but he didn't account for pointer size at all
2012-08-10 22:19:17 +00:00
Con Kolivas
0adbcd5d07 Fix windows bitforce build. 2012-08-07 21:21:01 +10:00
Con Kolivas
0a79de9375 Convert the serial autodetect functions to use int instead of char to enumerate devices. 2012-08-07 20:55:55 +10:00
Con Kolivas
9cae9a9d7f Make the serial open timeout for BFL generically 1 second on windows. 2012-08-07 20:49:47 +10:00
Con Kolivas
7dffa07ed9 Deuglify windows autodetect code for BFL. 2012-08-07 20:47:18 +10:00
Con Kolivas
e52762c57a There is no point zeroing temperature in BFL if we fail to get a response, and we should register it as a HW error, suggesting throttling. 2012-08-07 20:26:24 +10:00
Con Kolivas
4443895f77 Count likely throttling episodes on bitforce devices as hardware errors. 2012-08-05 17:55:35 +10:00
Con Kolivas
0d6763462b Style cleanups. 2012-08-05 16:15:32 +10:00
Con Kolivas
31b01c8ac5 Author: Luke Dashjr <luke-jr+git@utopios.org>
Date:   Thu Jul 12 16:49:26 2012 +0000

    Use FTD2XX.DLL on Windows to autodetect BitFORCE SHA256 devices
2012-08-05 16:13:53 +10:00
Con Kolivas
245552c5b5 Clear the bitforce buffer whenever we get an unexpected result as it has likely throttled and we are getting cached responses out of order, and use the temperature monitoring as a kind of watchdog to flush unexpected results. 2012-08-03 09:49:14 +10:00
Con Kolivas
7fa794a499 It is not critical getting the temperature response in bitforce so don't mandatorily wait on the mutex lock. 2012-08-03 09:26:43 +10:00
Con Kolivas
5118e3ee7c Check there is a cutoff temp actually set in bitforce before using it as a cut off value otherwise it may think it's set to zero degrees. 2012-08-03 08:12:05 +10:00
Con Kolivas
efba82fb56 Print the 3 parameters that are passed to applog for a debug line in bitforce.c 2012-08-01 20:39:12 +10:00
Con Kolivas
7f8250132a Clear bitforce buffer on init as previously. 2012-08-01 20:08:37 +10:00
Con Kolivas
7aa809ca24 Revert "Revert "Change BFL driver thread initialising to a constant 100ms delay between devices instead of a random arrangement.""
This reverts commit 89e613b943.

Leave the delay between each device initialising.
2012-08-01 19:38:28 +10:00
Con Kolivas
a688951d37 Revert "Remove bitforce_thread_init"
This reverts commit 2dfe0d628e.

Roll back to init'ing bitforce devices at regular intervals. They may reinit more than previously thought.
2012-08-01 19:38:18 +10:00
Con Kolivas
ddcf3d20ca Differentiate between the send return value being a bool and the get return value when managing them in bitforce scanhash. 2012-07-31 22:19:39 +10:00
ckolivas
23a8c60420 Revert "bitforce: Skip out of sending work if work restart requested"
This reverts commit cf36331d81.
2012-07-31 10:28:48 +10:00
Con Kolivas
2fb95c0057 Merge pull request #276 from luke-jr/bf_send_restart
bitforce: Skip out of sending work if work restart requested
2012-07-29 03:50:26 -07:00
Con Kolivas
150b29d445 Merge pull request #268 from luke-jr/bf_generic_kname
bitforce: Use "full work" vs "nonce range" for kernel name
2012-07-29 03:44:07 -07:00
Luke Dashjr
cf36331d81 bitforce: Skip out of sending work if work restart requested 2012-07-29 06:42:40 +00:00
Kano
c55830502a BFL force all code to timeout to avoid hanging 2012-07-24 02:19:23 +10:00
Luke Dashjr
b347a178f6 bitforce: Use "full work" vs "nonce range" for kernel name
Also move these string constants to #defines
2012-07-13 16:26:55 +00:00
Con Kolivas
b6a23d0027 bitforce_get_result returns -1 on error now. 2012-07-13 11:39:34 +10:00
Con Kolivas
761bd77288 Merge pull request #267 from luke-jr/bugfix_winsleep
Fix Windows build
2012-07-12 18:12:00 -07:00
Con Kolivas
aa723e7102 Check return value of read in BFgets 2012-07-13 10:54:06 +10:00
Luke Dashjr
68111323b3 Bugfix: Make our Windows nanosleep/sleep replacements standards-compliant (which fixes nmsleep) and include compat.h for bitforce (for sleep) 2012-07-12 18:24:42 +00:00
Con Kolivas
ac55cec60b Fix whitespace mangling. 2012-07-12 23:13:35 +10:00
Con Kolivas
c1c99f1dd2 Merge https://github.com/pshep/cgminer into pshep 2012-07-12 23:09:05 +10:00
Con Kolivas
89e613b943 Revert "Change BFL driver thread initialising to a constant 100ms delay between devices instead of a random arrangement."
This reverts commit 0785886b53.
2012-07-12 21:29:30 +10:00
Paul Sheppard
d4d5b28e5f Abbrv. correction 2012-07-11 14:46:09 -07:00
Paul Sheppard
c37a3f3007 Put kname change for broken nonce-range back in 2012-07-11 08:30:56 -07:00
Paul Sheppard
2c54522d7d Add average wait time to api stats 2012-07-11 08:11:53 -07:00
Paul Sheppard
01a69ee45e Revert "Merge branch 'ave_time' of https://github.com/pshep/cgminer.git"
This reverts commit 242e52cdf9, reversing
changes made to 4dc1bf2319.
2012-07-11 08:07:39 -07:00
ckolivas
0785886b53 Change BFL driver thread initialising to a constant 100ms delay between devices instead of a random arrangement. 2012-07-11 23:17:23 +10:00
ckolivas
9eaac43982 Spelling typo. 2012-07-11 23:12:00 +10:00
ckolivas
5c7e03084a Modify te scanhash API to use an int64_t and return -1 on error, allowing zero to be a valid return value. 2012-07-11 22:59:58 +10:00
Paul Sheppard
242e52cdf9 Merge branch 'ave_time' of https://github.com/pshep/cgminer.git 2012-07-10 22:09:32 -07:00
Paul Sheppard
4dc1bf2319 Missed one nonce-range disabling. 2012-07-10 15:40:45 -07:00
Paul Sheppard
3cc0aa76ad Add average return time to api stats 2012-07-10 15:34:01 -07:00
Paul Sheppard
2dfe0d628e Remove bitforce_thread_init
The delay thing does nothing useful... when long poll comes around, all threads restart at the same time anyway.
2012-07-09 17:36:06 -07:00
Paul Sheppard
953ecd9e6a Change timeouts to time-vals for accuracy. 2012-07-08 23:25:02 -07:00
Paul Sheppard
6c3d331869 Merge branch 'master' of git://github.com/ckolivas/cgminer.git 2012-07-08 22:36:42 -07:00
Con Kolivas
2ce7f28bbc Merge pull request #254 from luke-jr/work_restart2
Turn work_restart array into a bool in thr_info
2012-07-08 04:24:55 -07:00
Paul Sheppard
19b4d2b9de More BFL tweaks.
Add delay between closing and reopening port.
Remove buffer clear in re-init
Add kernel type (mini-rig or single)
2012-07-06 11:57:53 -07:00
Con Kolivas
957d196180 Make long timeout 10seconds on bitforce for when usleep or nanosleep just can't be accurate... 2012-07-06 20:23:26 +10:00
Con Kolivas
57e38d059e Make disabling BFL nonce range support a warning since it has to be explicitly enabled on the command line now. 2012-07-06 18:41:25 +10:00
Con Kolivas
fd55fab96a Make bitforce nonce range support a command line option --bfl-range since enabling it decrease hashrate by 1%. 2012-07-06 16:54:00 +10:00
Con Kolivas
b8484956e6 Add sanity checking to make sure we don't make sleep_ms less than 0 in bitforce. 2012-07-06 16:46:39 +10:00
Luke Dashjr
d4af2d0535 Turn work_restart array into a bool in thr_info 2012-07-06 05:13:05 +00:00
Con Kolivas
e97adc91c3 The fastest minirig devices need a significantly smaller starting sleep time. 2012-07-06 15:09:39 +10:00
Con Kolivas
74b96d4b3f Use a much shorter initial sleep time to account for faster devices and nonce range working, and increase it if nonce range fails to work. 2012-07-06 15:05:38 +10:00
Con Kolivas
13cf568961 Use nmsleep instead of usleep in bitforce. 2012-07-06 15:03:31 +10:00
Con Kolivas
390d77a202 Add more comments explaining how sleep time equals wait time and simplify the
comparison.
2012-07-06 10:41:08 +10:00
Con Kolivas
69a11508a4 delay_time_ms is always set so need not be initialised in bitforce. 2012-07-06 10:35:18 +10:00
Con Kolivas
9e8726b109 Increase bitforce timeout to 10 seconds. 2012-07-06 10:09:02 +10:00
Con Kolivas
a3faf63c96 Add more hysteresis and poll ~5 times to allow for timer delays in bitforce devices. 2012-07-06 09:54:27 +10:00
Con Kolivas
afc6ae58a5 Change message about broken nonce range support to verbose level instead of debug. 2012-07-05 22:42:04 +10:00
Con Kolivas
86ba7d79df Display the actual duration of wait when it is greater than the cutoff. 2012-07-05 22:39:41 +10:00
Con Kolivas
5a096c1c13 Set nonce to maximum once we determine nonce range support is broken. 2012-07-05 22:39:11 +10:00
Con Kolivas
88dd599f34 Initial wait time is always known so no need to zero it beforehand in bitforce. 2012-07-05 22:33:21 +10:00
Con Kolivas
1b0a0ac5db No point counting wait time until the work is actually sent to bitforce devices. 2012-07-05 22:32:05 +10:00
Con Kolivas
c0c480609d Use string comparison functions elsewhere in bitforce code. 2012-07-05 21:51:42 +10:00
Con Kolivas
d4e526c9fe Use string comparison functions instead of explicit comparisons. 2012-07-05 21:29:06 +10:00
Con Kolivas
23841337dc Show device id in debug when disabling nonce range. 2012-07-05 20:47:43 +10:00
Con Kolivas
9e10a6c016 Account for wait_ms time when nonce_range is in use on BFL. 2012-07-05 20:42:19 +10:00
Con Kolivas
9d9963b088 Split nonces up into 1/5 chunks when nonce range is supported. 2012-07-05 17:15:18 +10:00
Con Kolivas
274a40115e Merge branch 'master' into mr 2012-07-05 16:45:05 +10:00
Paul Sheppard
1ee191a726 limit clear buffer iterations. 2012-07-04 23:31:42 -07:00
Paul Sheppard
2aa95ab812 Merge branch 'master' of git://github.com/ckolivas/cgminer.git 2012-07-04 18:48:27 -07:00
Paul Sheppard
54f8554af4 Ad fd check to clear buffer. 2012-07-04 18:46:41 -07:00
Con Kolivas
72777f1f38 Disable nonce range support in BFL when broken support is detected. 2012-07-05 09:34:20 +10:00
Con Kolivas
96183bbdf4 Minor bfl tidy. 2012-07-05 09:21:46 +10:00
Con Kolivas
75eca07823 Restart_wait is only called with a ms value so incorporate that into the function. 2012-07-05 09:15:21 +10:00
Con Kolivas
e5aba76042 Fix off-by-one error in nonce increment in bfl. 2012-07-05 00:40:01 +10:00
Con Kolivas
ba5c1fc07d Use BE when setting nonce in bitforce nonce range work. 2012-07-05 00:22:42 +10:00
Con Kolivas
d6a6d70f4b Set work blk nonce after work is queued to prevent duplicates. 2012-07-05 00:18:58 +10:00
Con Kolivas
870ba0c70e Revert "Loop in bitforce scanhash till end nonce reaches full nonce range."
This reverts commit e10aa2092b.
2012-07-05 00:17:35 +10:00
Con Kolivas
e10aa2092b Loop in bitforce scanhash till end nonce reaches full nonce range. 2012-07-05 00:14:04 +10:00
Con Kolivas
1f2e9a49f4 Enable nonce range in the normal init sequence for bfl. 2012-07-05 00:08:33 +10:00
Con Kolivas
8766bca4d4 Queue extra work at 2/3 differently depending on whether we're using nonce range or not. 2012-07-04 23:57:54 +10:00
Con Kolivas
6314a12b31 Initially enable support for nonce range support on bfl, splitting nonces up into 3/4 size and only disable it if it fails on work submit. 2012-07-04 23:53:55 +10:00
Con Kolivas
96fba30b6b Attempt to detect nonce range support in BFL by sending work requring its support. 2012-07-04 17:31:02 +10:00
Con Kolivas
a9746b9f5e Limit retrying on busy for up to BITFORCE_TIMEOUT_MS 2012-07-04 16:58:08 +10:00
Con Kolivas
7046c976bc Attempt to initialise while bitforce device returns BUSY. 2012-07-04 16:51:55 +10:00
Con Kolivas
ac8db06e46 Extend length of string that can be passed to BFL devices. 2012-07-04 16:41:28 +10:00
Con Kolivas
8b3c20bc06 Abstract out ms to timeval as a function. 2012-07-04 16:28:51 +10:00
Con Kolivas
93a7967ecb Fix signedness warning. 2012-07-04 15:22:05 +10:00
Paul Sheppard
c4870676c4 Add api stats (sleep time) 2012-07-03 10:40:02 -07:00
Paul Sheppard
6e6029de99 Timing tweaks
Added long and short timeouts, short for detecting throttling, long to give up totally.
Reset sleep time when device re-initialised
Still check results after timeout
Back up a larger time if result on first poll.
2012-07-03 10:22:11 -07:00
Kano
ff0afb94ec Add API Notify counter 'Comms Error' 2012-07-03 13:14:30 +10:00
Con Kolivas
44726324c2 More style police on bitforce. 2012-07-03 11:09:33 +10:00
Con Kolivas
8783db0dc3 Do all logging outside of the bitforce mutex locking to avoid deadlocks. 2012-07-03 11:01:57 +10:00
Con Kolivas
0f405c7c18 Remove applog call from bfwrite to prevent grabbing nested mutexes. 2012-07-03 10:59:37 +10:00
Con Kolivas
978ec0d805 Bitforce style changes. 2012-07-03 10:58:30 +10:00
Paul Sheppard
ad5b470b04 Fine-tune timing adjustment.
Also remove old work_restart timing.
2012-07-02 14:27:19 -07:00
Paul Sheppard
ce850883e7 Merge branch 'master' of git://github.com/ckolivas/cgminer.git
Conflicts:
	driver-bitforce.c
2012-07-01 23:39:09 -07:00
Paul Sheppard
cc0ad5eaa7 Merge branch 'master' of git://github.com/ckolivas/cgminer.git
Conflicts:
	driver-bitforce.c
2012-07-01 23:35:06 -07:00
ckolivas
391e1f7eb1 Restart is zeroed in the mining thread so no need to do it inside the bitforce code. 2012-07-02 16:13:53 +10:00
Paul Sheppard
04a6c3b188 More improvements to comms.
BFL return nothing when throttling, so should not be considered an error. Instead repeat with a longer delay.
2012-07-01 21:47:18 -07:00