Subject: Incompatibilities between <=3.0 & current: USB_DEVICEINFO ioctl
To: None <current-users@netbsd.org>
From: Stephan Thesing <thesing@cs.uni-sb.de>
List: current-users
Date: 03/19/2006 21:21:31
Hello,

[ sorry if this has been discussed before, a quick search of the mailinglist
    archive didn't give any results... ]

it seems that the binary compatibility between <=3.0 and -current is broken 
w.r.t. the usb(4) USB_DEVICEINFO ioctl.
In revision 1.72 of sys/dev/usb/usb.h the udi_product, udi_vendor and 
udi_serial members of struct usb_device_info were changed.
Previously, they were arrays for USB_MAX_STRING_LEN chars, now they are 
arrays for USB_MAX_ENCODED_STRING_LEN (==3*USB_MAX_STRING_LEN) to hold 
encoded UTF8 strings.

I.e. sizeof(struct usb_device_info) changed between <=3.0 and current and now a 
3.0 binary (e.g. using devel/libusb from pkgsrc) will get EINVAL for the ioctl
USB_DEVICEINFO under -current.

As a struct usb_device_info is part in the union usb_event, this should also 
affect compatibility for the event interface via poll/read.

Is this accepted behavior and I should just live with having to compile a 
libusb under -current (which fixed my problem for digikam) or should a compat 
ioctl be added to -current in order to mimic the old behavior?
(It will be difficult to mimic the right behavior for reads of events...)

Best regards....
 	Stephan

-- 
=  Tel.: +49-681-302-5571      = Universitaet des Saarlandes =
=  Fax.: +49-681-302-3065      = Postfach 15 11 50           =
=  Compiler Research Group     = 66041 Saarbruecken          =
=  FR 6.2 - Informatik         = GERMANY                     =