From owner-freebsd-mobile@FreeBSD.ORG Wed Nov 14 14:58:03 2007 Return-Path: Delivered-To: freebsd-mobile@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A21BD16A46B for ; Wed, 14 Nov 2007 14:58:03 +0000 (UTC) (envelope-from bengta@P142.sics.se) Received: from brev.sics.se (brev.sics.se [193.10.64.200]) by mx1.freebsd.org (Postfix) with ESMTP id 2CCBF13C459 for ; Wed, 14 Nov 2007 14:58:02 +0000 (UTC) (envelope-from bengta@P142.sics.se) Received: from P142.sics.se (77.195-78-194.adsl-fix.skynet.be [194.78.195.77]) by brev.sics.se (8.12.8/8.12.8) with ESMTP id lAEEDKVF018783 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 14 Nov 2007 15:13:20 +0100 Received: from P142.sics.se (localhost [127.0.0.1]) by P142.sics.se (8.13.8/8.13.8) with ESMTP id lAEEDOmX002356; Wed, 14 Nov 2007 15:13:24 +0100 (CET) (envelope-from bengta@P142.sics.se) Received: (from bengta@localhost) by P142.sics.se (8.13.8/8.13.8/Submit) id lAEEDN40002355; Wed, 14 Nov 2007 15:13:23 +0100 (CET) (envelope-from bengta@P142.sics.se) To: Peter Schuller From: Bengt Ahlgren In-Reply-To: <200708312056.12233.peter.schuller@infidyne.com> (Peter Schuller's message of "Fri, 31 Aug 2007 20:56:11 +0200") References: <200708311820.08340.peter.schuller@infidyne.com> <200708312056.12233.peter.schuller@infidyne.com> Date: Wed, 14 Nov 2007 15:13:22 +0100 Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Virus-Scanned: by amavisd-new Cc: freebsd-mobile@freebsd.org Subject: Re: Option HSDPA USB dongle and mode switching X-BeenThere: freebsd-mobile@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2007 14:58:03 -0000 --=-=-= 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 --=-=-=--