From owner-freebsd-usb@FreeBSD.ORG Tue Aug 31 13:24:38 2010 Return-Path: Delivered-To: usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1E9110656BE for ; Tue, 31 Aug 2010 13:24:38 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de [217.11.53.44]) by mx1.freebsd.org (Postfix) with ESMTP id 73E108FC1C for ; Tue, 31 Aug 2010 13:24:38 +0000 (UTC) Received: from outgoing.leidinger.net (p57B3A176.dip.t-dialin.net [87.179.161.118]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id E00148452F2; Tue, 31 Aug 2010 15:24:35 +0200 (CEST) Received: from webmail.leidinger.net (webmail.leidinger.net [192.168.1.102]) by outgoing.leidinger.net (Postfix) with ESMTP id 161DE122B; Tue, 31 Aug 2010 15:24:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=Leidinger.net; s=outgoing-alex; t=1283261073; bh=9CzdFC5Q6vEoZwDFaHzBAFjwBHakEfM4IYHlr1ggxhw=; h=Message-ID:Date:From:To:Cc:Subject:References:In-Reply-To: MIME-Version:Content-Type:Content-Transfer-Encoding; b=rE4LE5DOwn7mmLjcjW4Ze/HiiPjewfI8ao2zB6qeVta9y1dOlLUSuxIiIzFjgGcmH Tm9FLeDJsXxrRzcNxk4lTzV/OHZGbZyUy5weZZ0yyQ9Kil9926+L9hptliK90RFne8 s1VnirnkOKtEYhaBdMtRzqZo0F5r+E8/nIU12b4y/JG6MLODz2RoxptgTftQ0j9FHg wU/PFKXnMfxhtFH3qMJ5RZLZtJpiHJOf2CH59E2c2UyCYmvdguQb4eMVfnmTrzdrJE pXsMLJQipu2mqOL8u9PzBqm8O0qkKfDj+QRmwLtm+XSMWFLw/6fvl3W5aTfp0b+sBq NsJG+/L2leHow== Received: (from www@localhost) by webmail.leidinger.net (8.14.4/8.13.8/Submit) id o7VDOWQm076218; Tue, 31 Aug 2010 15:24:32 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Received: from pslux.ec.europa.eu (pslux.ec.europa.eu [158.169.9.14]) by webmail.leidinger.net (Horde Framework) with HTTP; Tue, 31 Aug 2010 15:24:32 +0200 Message-ID: <20100831152432.1145726oycad08w0@webmail.leidinger.net> Date: Tue, 31 Aug 2010 15:24:32 +0200 From: Alexander Leidinger To: Jim Bryant References: <20100830174232.56765zlyg2rhuhgc@webmail.leidinger.net> <4C7C4B59.3090207@gmail.com> In-Reply-To: <4C7C4B59.3090207@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Dynamic Internet Messaging Program (DIMP) H3 (1.1.4) X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: E00148452F2.A3F48 X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=-1.1, required 6, autolearn=disabled, ALL_TRUSTED -1.00, DKIM_SIGNED 0.10, DKIM_VALID -0.10, DKIM_VALID_AU -0.10) X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1283865876.30365@Hw46cP5y05OnbHpyMgCe/g X-EBL-Spam-Status: No Cc: usb@FreeBSD.org Subject: Re: Porting an USB software from linux (libusb) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Aug 2010 13:24:39 -0000 Quoting Jim Bryant (from Mon, 30 Aug 2010 19:22:49 -0500): > easy fix. just drop the _np > > the functions are there under legacy naming. Not in my revision of FreeBSD-current. I commented it out like HPS suggested (the right way, with the correct macros to enable automatically when those functions are merged from P4 to SVN) and the linker doesn't complain anymore. Bye, Alexander. > Alexander Leidinger wrote: >> Hi, >> >> I try to port a linux userland USB program and I get the following >> error message when trying to link to libusb (current as of r210105): >> ---snip--- >> cc -lusb -lm -o fowsr fowsr.o >> fowsr.o(.text+0x1546): In function `CUSB_Open': >> : undefined reference to `usb_get_driver_np' >> fowsr.o(.text+0x1710): In function `CUSB_Open': >> : undefined reference to `usb_detach_kernel_driver_np' >> gmake: *** [fowsr] Fehler 1 >> ---snip--- >> >> Do I need those functions on FreeBSD (the device may show up as a >> HID device, I hadn't a chance to attach it to a FreeBSD box yet), >> or can I just remove them (I could make sure the HID driver is not >> loaded in the kernel)? >> >> Here is the related source: >> ---snip--- >> devh = usb_open(dev); >> assert(devh); >> >> signal(SIGTERM, release_usb_device); >> >> ret = usb_get_driver_np(devh, 0, buf, sizeof(buf)); >> printf("usb_get_driver_np returned %d\n", ret); >> if (ret == 0) { >> printf("interface 0 already claimed by driver >> \\'%s\\', attempting to detach it\n", buf); >> ret = usb_detach_kernel_driver_np(devh, 0); >> printf("usb_detach_kernel_driver_np returned %d\n", ret); >> } >> ret = usb_claim_interface(devh, 0); >> if (ret != 0) { >> printf("claim failed with error %d\n", ret); >> exit(1); >> } >> >> ret = usb_set_altinterface(devh, 0); >> ---snip--- >> >> Bye, >> Alexander. >> > > -- Star Trek Lives! http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137