Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Nov 2007 15:13:22 +0100
From:      Bengt Ahlgren <bengta@sics.se>
To:        Peter Schuller <peter.schuller@infidyne.com>
Cc:        freebsd-mobile@freebsd.org
Subject:   Re: Option HSDPA USB dongle and mode switching
Message-ID:  <uh77ikkoqyl.fsf@P142.sics.se>
In-Reply-To: <200708312056.12233.peter.schuller@infidyne.com> (Peter Schuller's message of "Fri, 31 Aug 2007 20:56:11 %2B0200")
References:  <200708311820.08340.peter.schuller@infidyne.com> <200708312056.12233.peter.schuller@infidyne.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--=-=-=

Peter Schuller <peter.schuller@infidyne.com> writes:

>> % gcc -L/usr/local/lib -lusb -lusbpp -I/usr/local/include -o ttt
>> icon_switch.c prometheus:/tmp(1)
>>
>> /var/tmp//ccCnzzjn.o(.text+0x26e): In function `main':
>> : undefined reference to `usb_get_driver_np'
>>
>> /var/tmp//ccCnzzjn.o(.text+0x2a7): In function `main':
>> : undefined reference to `usb_detach_kernel_driver_np'
>>
>> Would anyone know of a way to make such USB dongles work, other than
>> properly looking into this stuff and making the necessary code changes?
>
> Simply eliminating the driver attach/detach attemps makes the tool compile and 
> run, though it complains that it cannot find the device (even though the 
> product/vendor matches the config file). I guess it's not visible to the API 
> when the driver is attached or some such.

I got an Option Globesurfer iCON 7.2 last week.  I tried the similar
usb_modeswitch program:

http://www.draisberghof.de/usb_modeswitch/

I found out that the driver detach is not needed on FreeBSD, so I just
ifdef:ed out that part of the code (including both *_np calls - see
attached patch).

It however seems that the ugen driver has to be attached to the device
for libusb to find it.  No driver or the umass driver results in the
device not being found.  I am working on another variant which uses
the method for finding the device Rui Paulo wrote in his reply to your
mail to make the program independent of loaded drivers.

Then you need to add the vendor/product id:s to ubsa.c and usbdevs
(second patch - apply in /usr/src/sys/dev/usb & make all install in
/usr/src/sys/modules/{usb,ubsa}, or rebuild kernel if you have it
built-in).

Regards,

Bengt


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=usb_modesw.patch

--- usb_modeswitch.c~	Wed Nov  7 23:36:08 2007
+++ usb_modeswitch.c	Tue Nov 13 14:26:12 2007
@@ -234,6 +234,7 @@
     
     signal(SIGTERM, release_usb_device);
 
+#if 0
     if ( !HuaweiMode ) {
 	    printf("Looking for active default driver to detach it\n");
 	    ret = usb_get_driver_np(devh, 0, buf, sizeof(buf));
@@ -257,6 +258,7 @@
 				printf(" No driver found. Device probably not initialized. Trying to continue ...\n");
 	    }
 	}
+#endif
     if (!DetachStorageOnly && !HuaweiMode ) {
         ret = usb_claim_interface(devh, 0);
 		if (ret != 0) {

--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline; filename=usb-icon.patch

*** ubsa.c	2007/11/13 13:55:27	1.1
--- ubsa.c	2007/11/13 13:56:04
***************
*** 226,231 ****
--- 226,233 ----
  	{ USB_VENDOR_PERACOM, USB_PRODUCT_PERACOM_SERIAL1 },
  	/* Vodafone */
  	{ USB_VENDOR_VODAFONE, USB_PRODUCT_VODAFONE_MC3G },
+ 	/* Option */
+ 	{ USB_VENDOR_OPTION, USB_PRODUCT_OPTION_ICON72 },
  	{ 0, 0 }
  };
  
*** usbdevs	2007/11/13 13:50:28	1.1
--- usbdevs	2007/11/13 13:55:00
***************
*** 453,458 ****
--- 453,459 ----
  vendor GEOCAST		0x0a79	Geocast
  vendor NEODIO		0x0aec	Neodio
  vendor VODAFONE		0x0af0	Vodafone
+ vendor OPTION		0x0af0	Option N.V.
  vendor ASUS		0x0b05	ASUS
  vendor TODOS		0x0b0c	Todos Data System
  vendor SIIG2		0x0b39	SIIG
***************
*** 1344,1349 ****
--- 1345,1353 ----
  
  /* OnSpec Electronic, Inc. */
  product ONSPEC UCF100		0xa400	FlashLink UCF-100 CompactFlash Reader
+ 
+ /* Option N.V. */
+ product OPTION ICON72		0x6901	GlobeSurfer iCON 7.2
  
  /* Palm Computing, Inc. product */
  product PALM SERIAL		0x0080	USB Serial

--=-=-=--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?uh77ikkoqyl.fsf>