  			info->get_voltage[modular_id] = be32toh(info->get_voltage[modular_id]);
  			info->local_work[modular_id] = be32toh(info->local_work[modular_id]);
  			info->hw_work[modular_id] = be32toh(info->hw_work[modular_id]);
-@@ -395,6 +470,7 @@ static int avalon2_stratum_pkgs(int fd, struct pool *pool, struct thr_info *thr)
+@@ -408,6 +470,7 @@ static int avalon2_stratum_pkgs(int fd, struct pool *pool, struct thr_info *thr)
  	int i, a, b, tmp;
  	unsigned char target[32];
  	int job_id_len;

+#define AVA2_AVA3_MINERS	5
+#define AVA2_AVA3_VOLTAGE	6625 /* 0.6625v */
+#define AVA2_AVA3_FREQUENCY	400  /* MHz * 11.8 = MHs: 400MHz means ~4.7GHs */
+
 /* Avalon2 protocol package type */
 #define AVA2_H1	'A'
 #define AVA2_H2	'V'
@@ -67,6 +76,21 @@
 #define AVA2_P_TEST_RET		26
 /* Avalon2 protocol package type */
 
+/* Avalon2/3 firmware prefix */
+#define AVA2_FW2_PREFIXSTR	"20"
+#define AVA2_FW3_PREFIXSTR	"33"
+
+#define AVA2_MM_VERNULL		"NONE"
+
+#define AVA2_ID_AVA2		3255
+#define AVA2_ID_AVA3		3233
+#define AVA2_ID_AVAX		3200
+
+enum avalon2_fan_fixed {
+	FAN_FIXED,
+	FAN_AUTO,

 	int set_frequency;
 	int set_voltage;
 
@@ -102,30 +123,19 @@ struct avalon2_info {
 	int power_good[AVA2_DEFAULT_MODULARS];
 
 	int fan_pwm;
