--=-=-=

Peter Schuller 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

--=-=-=
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
freebsd-mobile@freebsd.org mailing list
http://lists.freebsd.org/mailman/lis...freebsd-mobile
To unsubscribe, send any mail to "freebsd-mobile-unsubscribe@freebsd.org"
--=-=-=--