|
|
@ -13,7 +13,11 @@ |
|
|
|
#include <sys/time.h> |
|
|
|
#include <sys/time.h> |
|
|
|
#include <sys/types.h> |
|
|
|
#include <sys/types.h> |
|
|
|
#include <dirent.h> |
|
|
|
#include <dirent.h> |
|
|
|
|
|
|
|
#ifndef WIN32 |
|
|
|
#include <termios.h> |
|
|
|
#include <termios.h> |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
#define NAME_MAX 255 |
|
|
|
|
|
|
|
#endif |
|
|
|
#include <unistd.h> |
|
|
|
#include <unistd.h> |
|
|
|
|
|
|
|
|
|
|
|
#include "elist.h" |
|
|
|
#include "elist.h" |
|
|
@ -46,7 +50,7 @@ static bool bitforce_detect_one(const char *devpath) |
|
|
|
fclose(fileDev); |
|
|
|
fclose(fileDev); |
|
|
|
if (unlikely(!strstr(pdevbuf, "SHA256"))) |
|
|
|
if (unlikely(!strstr(pdevbuf, "SHA256"))) |
|
|
|
{ |
|
|
|
{ |
|
|
|
applog(LOG_DEBUG, "BitForce Detect: Didn't recognize BitForce on %s", devpath); |
|
|
|
applog(LOG_DEBUG, "BitForce Detect: Didn't recognise BitForce on %s", devpath); |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -110,9 +114,11 @@ static bool bitforce_thread_prepare(struct thr_info *thr) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef WIN32 |
|
|
|
{ |
|
|
|
{ |
|
|
|
int nDevFD = fileno(fileDev); |
|
|
|
int nDevFD = fileno(fileDev); |
|
|
|
struct termios pattr; |
|
|
|
struct termios pattr; |
|
|
|
|
|
|
|
|
|
|
|
tcgetattr(nDevFD, &pattr); |
|
|
|
tcgetattr(nDevFD, &pattr); |
|
|
|
pattr.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON); |
|
|
|
pattr.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON); |
|
|
|
pattr.c_oflag &= ~OPOST; |
|
|
|
pattr.c_oflag &= ~OPOST; |
|
|
@ -121,6 +127,7 @@ static bool bitforce_thread_prepare(struct thr_info *thr) |
|
|
|
pattr.c_cflag |= CS8; |
|
|
|
pattr.c_cflag |= CS8; |
|
|
|
tcsetattr(nDevFD, TCSANOW, &pattr); |
|
|
|
tcsetattr(nDevFD, TCSANOW, &pattr); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#endif |
|
|
|
setbuf(fileDev, NULL); |
|
|
|
setbuf(fileDev, NULL); |
|
|
|
bitforce->device_file = fileDev; |
|
|
|
bitforce->device_file = fileDev; |
|
|
|
|
|
|
|
|
|
|
|