  struct avalon2_pkg {
  	uint8_t head[2];
  	uint8_t type;
-@@ -91,9 +102,19 @@ struct avalon2_pkg {
+@@ -91,9 +103,19 @@ struct avalon2_pkg {
  #define avalon2_ret avalon2_pkg
  
  struct avalon2_info {

 	if (!modular[0] && !modular[1] && !modular[2] && !modular[3])
 		return false;
 
@@ -595,28 +662,27 @@ static bool avalon2_detect_one(const char *devpath)
 
 	info = avalon2->device_data;
 

 
 			while (avalon2_send_pkg(info->fd, &send_pkg, thr) != AVA2_SEND_OK)
 				;
@@ -684,9 +767,58 @@ static int polling(struct thr_info *thr)
 	return 0;
 }
 
