--- eciadsl-pppoeci.c.orig	2004-12-01 12:33:09.000000000 +0000
+++ eciadsl-pppoeci.c	2004-12-01 12:37:19.000000000 +0000
@@ -238,6 +238,8 @@
 int pusb_set_interface_alt = -1;
 char* chipset="GSNONE";
 
+char* procbusdevice="/proc/bus/usb/000/000";
+
 int syncHDLC = 1;
 
 #define synclen 2
@@ -1395,6 +1397,8 @@
 					"       -h or --help         display this message then exit\n"
 					"       -V or --version      display the version number then exit\n"
 					"       --modes              display a list of the supported modes (to use with -mode)\n"
+                                        "       -d /proc/bus/usb/x/y or\n"
+                                        "       --device /proc/bus/usb/x/y    specify device to use (defaults to searching)\n"
 					"\n");
 	fprintf(stderr, "vpi value must be between 0 and %u\n", 0xfff);
 	fprintf(stderr, "vci value must be between 0 and %u\n", 0xffff);
@@ -1499,6 +1503,9 @@
 		if (((strcmp(argv[i], "-mc") == 0) || (strcmp(argv[i], "--modem_chipset") == 0) ) && (i + 1 < argc))
 			strDup(&chipset, argv[++i]);
 		else				
+                if (((strcmp(argv[i], "-d") == 0) || (strcmp(argv[i], "--device") ==0) ) && (i + 1 < argc))
+                        strDup(&procbusdevice, argv[++i]);
+                else
 		if ((strcmp(argv[i], "-dto") == 0) && (i + 1 < argc))
 			get_signed_value(argv[++i], &data_timeout);
 		else
@@ -1836,7 +1843,11 @@
 	 *  here, according to your config
 	 */
 
-	fdusb = pusb_search_open(vendor, product);
+        if (strcmp(procbusdevice,"/proc/bus/usb/000/000")!=0){
+                fdusb = pusb_open(procbusdevice);
+        } else {
+        	fdusb = pusb_search_open(vendor, product);
+        }
 
 	if (fdusb == NULL)
 		fatal_error(ERR_FOUNDING_MODEM, "where is this crappy modem?!");
--- eciadsl-firmware.c.orig	2004-12-01 12:33:15.000000000 +0000
+++ eciadsl-firmware.c	2004-12-01 12:39:14.000000000 +0000
@@ -152,6 +152,7 @@
 #define ECILOAD_TIMEOUT 20
 
 char* exec_filename;
+char* procbusdevice="/proc/bus/usb/000/000";
 
 /* just for testing without USB */
 /*#define TESTECI*/
@@ -233,7 +234,12 @@
 
 	/* open the USB device */
 #ifndef TESTECI
-	dev = pusb_search_open(vid1, pid1);
+        if (strcmp(procbusdevice,"/proc/bus/usb/000/000")!=0){
+	        dev = pusb_open(procbusdevice);
+	} else {
+	        dev = pusb_search_open(vid1, pid1);
+	}
+
 	if (dev == NULL)
 	{
 		printf("can't find your " EZUSB_NAME "\n");
@@ -378,6 +384,8 @@
 			"       -h or --help                  show this help message then exit\n"
 			"       -V or --version               show version information then exit\n"
 			"       -t <num> or --timeout <num>   override the default timeout value (in sec)\n"
+			"       -d /proc/bus/usb/x/y or\n"
+                        "       --device /proc/bus/usb/x/y    specify device to use (default to searching)\n"
 			"\n");
 	printf(	"If ALL parameters but switches are omitted, the ones from " CONF_PATH CONF_DIR "/eciadsl.conf\n"
 			"are assumed.\n"
@@ -431,6 +439,9 @@
 		if ((strcmp(argv[i], "-v") == 0) || (strcmp(argv[i], "--verbose") == 0))
 			option_verbose = 1;
 		else
+                if (((strcmp(argv[i], "-d") == 0) || (strcmp(argv[i], "--device") == 0)) && (i + 1 < argc))
+		        strDup(&procbusdevice, argv[++i]);
+		else
 		if (((strcmp(argv[i], "-t") == 0) || (strcmp(argv[i], "--timeout") == 0) ) && (i + 1 < argc))
 			get_unsigned_value(argv[++i], &option_timeout);
 		else
--- eciadsl-synch.c.orig	2004-12-01 12:33:19.000000000 +0000
+++ eciadsl-synch.c	2004-12-01 12:41:40.000000000 +0000
@@ -92,6 +92,9 @@
 /* alt interface value */
 unsigned int altInterface=0;
 char* chipset="GSNONE";
+
+char* procbusdevice="/proc/bus/usb/000/000";
+
 
 /* ep int handler child process */
 pid_t pidEpIntChild=0;
@@ -608,7 +611,12 @@
 
 	/* open the USB device */
 #ifndef TESTECI
-	dev = pusb_search_open(vid2, pid2);
+	if (strcmp(procbusdevice,"/proc/bus/usb/000/000")!=0){
+		dev = pusb_open(procbusdevice);
+	} else {
+		dev = pusb_search_open(vid2, pid2);
+        }
+
 	if (dev == NULL){
 		printf("\rERROR can't find your GlobeSpan %s USB ADSL WAN Modem \n", get_chipset_descr(eci_device.eci_modem_chipset));
 		fclose(fp);
@@ -730,6 +738,8 @@
 			"       -r <num> or --retries <num>   number of retries for an invalid ep response (0 = infinite)\n"
 			"       -alt <num> or --alt_interface <string>   override the default modem chipset value (could be GS7070[default] or GS7470)\n"			
 			"       -mc <num> or --modem_chipset <string>   override the default altInterface value\n"
+			"       -d /proc/bus/usb/x/y or\n"
+			"       --device /proc/bus/usb/x/y    specify device to use (default to searching)\n"
 			"\n");
 	printf(	"If ALL other parameters are omitted, the ones from " CONF_PATH CONF_DIR "/eciadsl.conf\n"
 			"are assumed.\n"
@@ -778,6 +788,9 @@
 		else
 		if (((strcmp(argv[i], "-mc") == 0) || (strcmp(argv[i], "--modem_chipset") == 0) ) && (i + 1 < argc))
 			strDup(&chipset, argv[++i]);
+		else
+		if (((strcmp(argv[i], "-d") == 0) || (strcmp(argv[i], "--device") ==0) ) && (i + 1 < argc))
+                        strDup(&procbusdevice, argv[++i]);
 		else		
 			argv[j++] = argv[i];
 	}
