Browse Source

icarus: Support for custom driver initialisation function

Luke Dashjr 12 years ago
parent
commit
ce033a72c2
2 changed files with 6 additions and 0 deletions
  1. 3 0
      driver-icarus.c
  2. 3 0
      icarus-common.h

+ 3 - 0
driver-icarus.c

@@ -502,6 +502,9 @@ bool icarus_detect_custom(const char *devpath, struct device_drv *api, struct IC
 		info->golden_nonce = "000187a2";
 	}
 
+	if (info->detect_init_func)
+		info->detect_init_func(devpath, fd, info);
+	
 	int ob_size = strlen(info->golden_ob) / 2;
 	unsigned char ob_bin[ob_size];
 	

+ 3 - 0
icarus-common.h

@@ -113,6 +113,9 @@ struct ICARUS_INFO {
 	const char *golden_ob;
 	const char *golden_nonce;
 	bool nonce_littleendian;
+	
+	// Custom driver function
+	bool (*detect_init_func)(const char *devpath, int fd, struct ICARUS_INFO *);
 };
 
 struct icarus_state {