Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Nov 2009 01:11:58 GMT
From:      Robert Jenssen <robertjenssen@hotmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   usb/140259: libusb-1.0 portability/compatibility nits
Message-ID:  <200911040111.nA41Bw30098496@www.freebsd.org>
Resent-Message-ID: <200911040120.nA41K2Rv056791@freefall.freebsd.org>

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

>Number:         140259
>Category:       usb
>Synopsis:       libusb-1.0 portability/compatibility nits
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-usb
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Nov 04 01:20:01 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Robert Jenssen
>Release:        8.0RC2
>Organization:
>Environment:
FreeBSD kraken 8.0-RC2 FreeBSD 8.0-RC2 #0: Sat Oct 31 05:40:55 EST 2009     robj@kraken:/usr/obj/usr/src/sys/KRAKEN  i386
>Description:
Thankyou for porting libusb-1.0 to the FreeBSD kernel. Being new to usb programming, I tried to compile the non-trivial example program, dpfp.c,  provided with the libusb-1.0.3.tar.bz2 tarball available from "http://sourceforge.net/projects/libusb/files/libusb-1.0/libusb-1.0.3/libusb-1.0.3.tar.bz2/download" . I found two problems

1. FreeBSD libusb10 is not quite portable. Here is a diff required to get dpfp.c to compile:
[robj examples]diff dpfp.c dpfp.c.orig 
30,32c30
< #include <libusb.h>
< 
< #define LIBUSB_CONTROL_SETUP_SIZE (sizeof(struct libusb_control_setup))
---
> #include <libusb/libusb.h>
62c60
< static libusb_device_handle *devh = NULL;
---
> static struct libusb_device_handle *devh = NULL;


2. Some libusb-1.0 functions are not implemented. Here is an attempt to link dpfp.c:
[robj examples]gcc -O0 -g -o dpfp -lusb dpfp.c 
/var/tmp//ccPc8n2t.o(.text+0x4dc): In function `set_mode_async':
/home/robj/TMP/libusb-1.0.3/examples/dpfp.c:182: undefined reference to `libusb_fill_control_setup'
/var/tmp//ccPc8n2t.o(.text+0x51c):/home/robj/TMP/libusb-1.0.3/examples/dpfp.c:184: undefined reference to `libusb_fill_control_transfer'
/var/tmp//ccPc8n2t.o(.text+0xbe5): In function `alloc_transfers':
/home/robj/TMP/libusb-1.0.3/examples/dpfp.c:406: undefined reference to `libusb_fill_bulk_transfer'
/var/tmp//ccPc8n2t.o(.text+0xc2c):/home/robj/TMP/libusb-1.0.3/examples/dpfp.c:408: undefined reference to `libusb_fill_interrupt_transfer'


>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:



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