Browse Source

now buad as parameter now

Xiangfu 13 years ago
parent
commit
bdd4fa5a75
2 changed files with 9 additions and 10 deletions
  1. 8 9
      driver-avalon.c
  2. 1 1
      driver-avalon.h

+ 8 - 9
driver-avalon.c

@@ -365,8 +365,8 @@ static void get_options(int this_option_offset, int *baud, int *miner_count,
 				} else {
 				} else {
 					sprintf(err_buf,
 					sprintf(err_buf,
 						"Invalid avalon-options for "
 						"Invalid avalon-options for "
-						"miner_count (%s) must be 1 ~ 32",
-						colon);
+						"miner_count (%s) must be 1 ~ %d",
+						colon, AVALON_DEFAULT_MINER_NUM);
 					quit(1, err_buf);
 					quit(1, err_buf);
 				}
 				}
 			}
 			}
@@ -378,8 +378,8 @@ static void get_options(int this_option_offset, int *baud, int *miner_count,
 				else {
 				else {
 					sprintf(err_buf,
 					sprintf(err_buf,
 						"Invalid avalon-options for "
 						"Invalid avalon-options for "
-						"asic_count (%s) must be 1 ~ 10 ",
-						colon2);
+						"asic_count (%s) must be 1 ~ %d",
+						colon2, AVALON_DEFAULT_CHIP_NUM);
 					quit(1, err_buf);
 					quit(1, err_buf);
 				}
 				}
 			}
 			}
@@ -396,7 +396,10 @@ static bool avalon_detect_one(const char *devpath)
 	int this_option_offset = ++option_offset;
 	int this_option_offset = ++option_offset;
 	get_options(this_option_offset, &baud, &miner_count, &asic_count);
 	get_options(this_option_offset, &baud, &miner_count, &asic_count);
 
 
-	applog(LOG_DEBUG, "Avalon Detect: Attempting to open %s", devpath);
+	applog(LOG_DEBUG, "Avalon Detect: Attempting to open %s "
+	       "(baud=%d miner_count=%d asic_count=%d)",
+		devpath, baud, miner_count, asic_count);
+
 	fd = avalon_open2(devpath, baud, true);
 	fd = avalon_open2(devpath, baud, true);
 	if (unlikely(fd == -1)) {
 	if (unlikely(fd == -1)) {
 		applog(LOG_ERR, "Avalon Detect: Failed to open %s", devpath);
 		applog(LOG_ERR, "Avalon Detect: Failed to open %s", devpath);
@@ -424,10 +427,6 @@ static bool avalon_detect_one(const char *devpath)
 	applog(LOG_INFO, "Avalon Detect: Found at %s, mark as %d",
 	applog(LOG_INFO, "Avalon Detect: Found at %s, mark as %d",
 	       devpath, avalon->device_id);
 	       devpath, avalon->device_id);
 
 
-	applog(LOG_DEBUG,
-	       "Avalon: Init: %d baud=%d miner_count=%d asic_count=%d",
-		avalon->device_id, baud, miner_count, asic_count);
-
 	avalon_info[avalon->device_id] = (struct avalon_info *)
 	avalon_info[avalon->device_id] = (struct avalon_info *)
 		malloc(sizeof(struct avalon_info));
 		malloc(sizeof(struct avalon_info));
 	if (unlikely(!(avalon_info[avalon->device_id])))
 	if (unlikely(!(avalon_info[avalon->device_id])))

+ 1 - 1
driver-avalon.h

@@ -54,7 +54,7 @@ struct avalon_info {
 
 
 #define AVALON_MINER_THREADS 1
 #define AVALON_MINER_THREADS 1
 
 
-#define AVALON_IO_SPEED 19200 // 115200
+#define AVALON_IO_SPEED 115200
 #define AVALON_SEND_WORK_PITCH (32*1000*1000)
 #define AVALON_SEND_WORK_PITCH (32*1000*1000)
 #define AVALON_RESET_PITCH     (80*1000*1000)
 #define AVALON_RESET_PITCH     (80*1000*1000)