Browse Source

bitmain: Remove baud/flush, as the fake VCOM kernel driver ignores (and complains about) both

Luke Dashjr 10 years ago
parent
commit
e94dba581e
2 changed files with 1 additions and 17 deletions
  1. 1 15
      driver-bitmain.c
  2. 0 2
      driver-bitmain.h

+ 1 - 15
driver-bitmain.c

@@ -72,7 +72,6 @@ struct cgpu_info *btm_alloc_cgpu(struct device_drv *drv, int threads)
 	cgpu->device_data = info;
 	
 	*info = (struct bitmain_info){
-		.baud = BITMAIN_IO_SPEED,
 		.chain_num = BITMAIN_DEFAULT_CHAIN_NUM,
 		.asic_num = BITMAIN_DEFAULT_ASIC_NUM,
 		.timeout = BITMAIN_DEFAULT_TIMEOUT,
@@ -132,7 +131,7 @@ bool btm_init(struct cgpu_info *cgpu, const char * devpath)
 		info->device_curl = curl;
 		return true;
 	}
-	fd = serial_open(devpath, info->baud, 1, true);
+	fd = serial_open(devpath, 0, 1, false);
 	if(fd == -1) {
 		applog(LOG_DEBUG, "%s open %s error %d",
 				cgpu->drv->dname, devpath, errno);
@@ -1543,7 +1542,6 @@ static struct api_data *bitmain_api_stats(struct cgpu_info *cgpu)
 	double hwp = (cgpu->hw_errors + cgpu->diff1) ?
 			(double)(cgpu->hw_errors) / (double)(cgpu->hw_errors + cgpu->diff1) : 0;
 
-	root = api_add_int(root, "baud", &(info->baud), false);
 	root = api_add_int(root, "miner_count", &(info->chain_num), false);
 	root = api_add_int(root, "asic_count", &(info->asic_num), false);
 	root = api_add_int(root, "timeout", &(info->timeout), false);
@@ -1649,17 +1647,6 @@ static void bitmain_shutdown(struct thr_info *thr)
 	do_bitmain_close(thr);
 }
 
-static
-const char *bitmain_set_baud(struct cgpu_info * const proc, const char * const optname, const char * const newvalue, char * const replybuf, enum bfg_set_device_replytype * const out_success)
-{
-	struct bitmain_info *info = proc->device_data;
-	const int baud = atoi(newvalue);
-	if (!valid_baud(baud))
-		return "Invalid baud setting";
-	info->baud = baud;
-	return NULL;
-}
-
 static
 const char *bitmain_set_layout(struct cgpu_info * const proc, const char * const optname, const char * const newvalue, char * const replybuf, enum bfg_set_device_replytype * const out_success)
 {
@@ -1758,7 +1745,6 @@ voltage_usage:
 }
 
 static const struct bfg_set_device_definition bitmain_set_device_funcs_init[] = {
-	{"baud", bitmain_set_baud, "serial baud rate"},
 	{"layout", bitmain_set_layout, "number of chains ':' number of ASICs per chain (eg: 32:8)"},
 	{"timeout", bitmain_set_timeout, "timeout"},
 	{"clock", bitmain_set_clock, "clock frequency"},

+ 0 - 2
driver-bitmain.h

@@ -24,7 +24,6 @@
 
 #define BITMAIN_MINER_THREADS 1
 
-#define BITMAIN_IO_SPEED		115200
 #define BITMAIN_RESET_PITCH	(300*1000*1000)
 
 #define BITMAIN_TOKEN_TYPE_TXCONFIG 0x51
@@ -216,7 +215,6 @@ struct bitmain_info {
 	void *device_curl;
 	SOCKETTYPE curl_sock;
 	
-	int baud;
 	int chain_num;
 	int asic_num;
 	int chain_asic_num[BITMAIN_MAX_CHAIN_NUM];