From a091d2a5259cbf29e34745516e64b04e30245894 Mon Sep 17 00:00:00 2001 From: Andrew Thompson Date: Mon, 9 Mar 2009 17:05:31 +0000 Subject: Install libusb20.so.1 as libusb.so.1, there will be a followup commit to the ports tree so that programs use libusb from the base by default. Thanks to Stanislav Sedov for sorting out the ports build. Bump __FreeBSD_version to 800069 Help and testing by: stas --- ObsoleteFiles.inc | 3 + UPDATING | 6 + lib/libusb20/Makefile | 7 +- lib/libusb20/libusb20_compat01.c | 2 +- lib/libusb20/libusb20_compat01.h | 310 --------------------------------------- lib/libusb20/usb.h | 310 +++++++++++++++++++++++++++++++++++++++ release/amd64/boot_crunch.conf | 2 +- release/i386/boot_crunch.conf | 2 +- release/ia64/boot_crunch.conf | 2 +- release/powerpc/boot_crunch.conf | 2 +- release/sparc64/boot_crunch.conf | 2 +- release/sun4v/boot_crunch.conf | 2 +- sys/sys/param.h | 2 +- usr.sbin/usbconfig/Makefile | 2 +- 14 files changed, 332 insertions(+), 322 deletions(-) delete mode 100644 lib/libusb20/libusb20_compat01.h create mode 100644 lib/libusb20/usb.h diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index fcc117a69a8d..60687d513c4b 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -14,6 +14,9 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20090308: libusb.so.1 renamed +OLD_LIBS+=usr/lib/libusb20.so.1 +OLD_FILES+=usr/include/libusb20_compat01.h # 20090226: libmp(3) functions renamed OLD_LIBS+=usr/lib/libmp.so.6 # 20090223: changeover of USB stacks diff --git a/UPDATING b/UPDATING index 33665b000d3b..4b673efbd067 100644 --- a/UPDATING +++ b/UPDATING @@ -22,6 +22,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.x IS SLOW: to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20090309: + libusb20.so.1 is now installed as libusb.so.1 and the ports system + updated to use it. This requires a buildworld/installworld in order to + update the library and dependencies (usbconfig, etc). Its advisable to + update your ports as the affected programs have had a revision bump. + 20090302: A workaround is committed to allow the creation of System V shared memory segment of size > 2 GB on the 64-bit architectures. diff --git a/lib/libusb20/Makefile b/lib/libusb20/Makefile index 0c0f18f1bfec..3eb437886022 100644 --- a/lib/libusb20/Makefile +++ b/lib/libusb20/Makefile @@ -4,7 +4,7 @@ # Makefile for the FreeBSD specific LibUSB 2.0 # -LIB= usb20 +LIB= usb SHLIB_MAJOR= 1 SHLIB_MINOR= 0 SRCS= libusb20.c @@ -14,11 +14,12 @@ SRCS+= libusb20_compat01.c SRCS+= libusb20_compat10.c INCS+= libusb20.h INCS+= libusb20_desc.h -INCS+= libusb20_compat01.h -INCS+= libusb20_compat10.h MAN= libusb20.3 MKLINT= no NOGCCERROR= +# libusb 0.1 compat +INCS+= usb.h + .include diff --git a/lib/libusb20/libusb20_compat01.c b/lib/libusb20/libusb20_compat01.c index 5d3f0d31584a..5e1e8e181f88 100644 --- a/lib/libusb20/libusb20_compat01.c +++ b/lib/libusb20/libusb20_compat01.c @@ -37,7 +37,7 @@ #include "libusb20.h" #include "libusb20_desc.h" #include "libusb20_int.h" -#include "libusb20_compat01.h" +#include "usb.h" /* * The two following macros were taken from the original LibUSB v0.1 diff --git a/lib/libusb20/libusb20_compat01.h b/lib/libusb20/libusb20_compat01.h deleted file mode 100644 index 3963a9f0355c..000000000000 --- a/lib/libusb20/libusb20_compat01.h +++ /dev/null @@ -1,310 +0,0 @@ -/* $FreeBSD$ */ -/*- - * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef _LIBUSB20_COMPAT_01_H_ -#define _LIBUSB20_COMPAT_01_H_ - -#include -#include -#include -#include - -/* USB interface class codes */ - -#define USB_CLASS_PER_INTERFACE 0 -#define USB_CLASS_AUDIO 1 -#define USB_CLASS_COMM 2 -#define USB_CLASS_HID 3 -#define USB_CLASS_PRINTER 7 -#define USB_CLASS_PTP 6 -#define USB_CLASS_MASS_STORAGE 8 -#define USB_CLASS_HUB 9 -#define USB_CLASS_DATA 10 -#define USB_CLASS_VENDOR_SPEC 0xff - -/* USB descriptor types */ - -#define USB_DT_DEVICE 0x01 -#define USB_DT_CONFIG 0x02 -#define USB_DT_STRING 0x03 -#define USB_DT_INTERFACE 0x04 -#define USB_DT_ENDPOINT 0x05 - -#define USB_DT_HID 0x21 -#define USB_DT_REPORT 0x22 -#define USB_DT_PHYSICAL 0x23 -#define USB_DT_HUB 0x29 - -/* USB descriptor type sizes */ - -#define USB_DT_DEVICE_SIZE 18 -#define USB_DT_CONFIG_SIZE 9 -#define USB_DT_INTERFACE_SIZE 9 -#define USB_DT_ENDPOINT_SIZE 7 -#define USB_DT_ENDPOINT_AUDIO_SIZE 9 -#define USB_DT_HUB_NONVAR_SIZE 7 - -/* USB descriptor header */ -struct usb_descriptor_header { - uint8_t bLength; - uint8_t bDescriptorType; -}; - -/* USB string descriptor */ -struct usb_string_descriptor { - uint8_t bLength; - uint8_t bDescriptorType; - uint16_t wData[1]; -}; - -/* USB HID descriptor */ -struct usb_hid_descriptor { - uint8_t bLength; - uint8_t bDescriptorType; - uint16_t bcdHID; - uint8_t bCountryCode; - uint8_t bNumDescriptors; - /* uint8_t bReportDescriptorType; */ - /* uint16_t wDescriptorLength; */ - /* ... */ -}; - -/* USB endpoint descriptor */ -#define USB_MAXENDPOINTS 32 -struct usb_endpoint_descriptor { - uint8_t bLength; - uint8_t bDescriptorType; - uint8_t bEndpointAddress; -#define USB_ENDPOINT_ADDRESS_MASK 0x0f -#define USB_ENDPOINT_DIR_MASK 0x80 - uint8_t bmAttributes; -#define USB_ENDPOINT_TYPE_MASK 0x03 -#define USB_ENDPOINT_TYPE_CONTROL 0 -#define USB_ENDPOINT_TYPE_ISOCHRONOUS 1 -#define USB_ENDPOINT_TYPE_BULK 2 -#define USB_ENDPOINT_TYPE_INTERRUPT 3 - uint16_t wMaxPacketSize; - uint8_t bInterval; - uint8_t bRefresh; - uint8_t bSynchAddress; - - uint8_t *extra; /* Extra descriptors */ - int extralen; -}; - -/* USB interface descriptor */ -#define USB_MAXINTERFACES 32 -struct usb_interface_descriptor { - uint8_t bLength; - uint8_t bDescriptorType; - uint8_t bInterfaceNumber; - uint8_t bAlternateSetting; - uint8_t bNumEndpoints; - uint8_t bInterfaceClass; - uint8_t bInterfaceSubClass; - uint8_t bInterfaceProtocol; - uint8_t iInterface; - - struct usb_endpoint_descriptor *endpoint; - - uint8_t *extra; /* Extra descriptors */ - int extralen; -}; - -#define USB_MAXALTSETTING 128 /* Hard limit */ -struct usb_interface { - struct usb_interface_descriptor *altsetting; - - int num_altsetting; -}; - -/* USB configuration descriptor */ -#define USB_MAXCONFIG 8 -struct usb_config_descriptor { - uint8_t bLength; - uint8_t bDescriptorType; - uint16_t wTotalLength; - uint8_t bNumInterfaces; - uint8_t bConfigurationValue; - uint8_t iConfiguration; - uint8_t bmAttributes; - uint8_t MaxPower; - - struct usb_interface *interface; - - uint8_t *extra; /* Extra descriptors */ - int extralen; -}; - -/* USB device descriptor */ -struct usb_device_descriptor { - uint8_t bLength; - uint8_t bDescriptorType; - uint16_t bcdUSB; - uint8_t bDeviceClass; - uint8_t bDeviceSubClass; - uint8_t bDeviceProtocol; - uint8_t bMaxPacketSize0; - uint16_t idVendor; - uint16_t idProduct; - uint16_t bcdDevice; - uint8_t iManufacturer; - uint8_t iProduct; - uint8_t iSerialNumber; - uint8_t bNumConfigurations; -}; - -/* USB setup packet */ -struct usb_ctrl_setup { - uint8_t bRequestType; -#define USB_RECIP_DEVICE 0x00 -#define USB_RECIP_INTERFACE 0x01 -#define USB_RECIP_ENDPOINT 0x02 -#define USB_RECIP_OTHER 0x03 -#define USB_TYPE_STANDARD (0x00 << 5) -#define USB_TYPE_CLASS (0x01 << 5) -#define USB_TYPE_VENDOR (0x02 << 5) -#define USB_TYPE_RESERVED (0x03 << 5) -#define USB_ENDPOINT_IN 0x80 -#define USB_ENDPOINT_OUT 0x00 - uint8_t bRequest; -#define USB_REQ_GET_STATUS 0x00 -#define USB_REQ_CLEAR_FEATURE 0x01 -#define USB_REQ_SET_FEATURE 0x03 -#define USB_REQ_SET_ADDRESS 0x05 -#define USB_REQ_GET_DESCRIPTOR 0x06 -#define USB_REQ_SET_DESCRIPTOR 0x07 -#define USB_REQ_GET_CONFIGURATION 0x08 -#define USB_REQ_SET_CONFIGURATION 0x09 -#define USB_REQ_GET_INTERFACE 0x0A -#define USB_REQ_SET_INTERFACE 0x0B -#define USB_REQ_SYNCH_FRAME 0x0C - uint16_t wValue; - uint16_t wIndex; - uint16_t wLength; -}; - -/* Error codes */ -#define USB_ERROR_BEGIN 500000 - -/* Byte swapping */ -#define USB_LE16_TO_CPU(x) le16toh(x) - -/* Data types */ -struct usb_device; -struct usb_bus; - -/* - * To maintain compatibility with applications already built with libusb, - * we must only add entries to the end of this structure. NEVER delete or - * move members and only change types if you really know what you're doing. - */ -struct usb_device { - struct usb_device *next; - struct usb_device *prev; - - char filename[PATH_MAX + 1]; - - struct usb_bus *bus; - - struct usb_device_descriptor descriptor; - struct usb_config_descriptor *config; - - void *dev; - - uint8_t devnum; - - uint8_t num_children; - struct usb_device **children; -}; - -struct usb_bus { - struct usb_bus *next; - struct usb_bus *prev; - - char dirname[PATH_MAX + 1]; - - struct usb_device *devices; - uint32_t location; - - struct usb_device *root_dev; -}; - -struct usb_dev_handle; -typedef struct usb_dev_handle usb_dev_handle; - -/* Variables */ -extern struct usb_bus *usb_busses; - -#ifdef __cplusplus -extern "C" { -#endif -#if 0 -} /* style */ - -#endif - -/* Function prototypes from "libusb20_compat01.c" */ - -usb_dev_handle *usb_open(struct usb_device *dev); -int usb_close(usb_dev_handle * dev); -int usb_get_string(usb_dev_handle * dev, int index, int langid, char *buf, size_t buflen); -int usb_get_string_simple(usb_dev_handle * dev, int index, char *buf, size_t buflen); -int usb_get_descriptor_by_endpoint(usb_dev_handle * udev, int ep, uint8_t type, uint8_t index, void *buf, int size); -int usb_get_descriptor(usb_dev_handle * udev, uint8_t type, uint8_t index, void *buf, int size); -int usb_parse_descriptor(uint8_t *source, char *description, void *dest); -int usb_parse_configuration(struct usb_config_descriptor *config, uint8_t *buffer); -void usb_destroy_configuration(struct usb_device *dev); -void usb_fetch_and_parse_descriptors(usb_dev_handle * udev); -int usb_bulk_write(usb_dev_handle * dev, int ep, char *bytes, int size, int timeout); -int usb_bulk_read(usb_dev_handle * dev, int ep, char *bytes, int size, int timeout); -int usb_interrupt_write(usb_dev_handle * dev, int ep, char *bytes, int size, int timeout); -int usb_interrupt_read(usb_dev_handle * dev, int ep, char *bytes, int size, int timeout); -int usb_control_msg(usb_dev_handle * dev, int requesttype, int request, int value, int index, char *bytes, int size, int timeout); -int usb_set_configuration(usb_dev_handle * dev, int configuration); -int usb_claim_interface(usb_dev_handle * dev, int interface); -int usb_release_interface(usb_dev_handle * dev, int interface); -int usb_set_altinterface(usb_dev_handle * dev, int alternate); -int usb_resetep(usb_dev_handle * dev, unsigned int ep); -int usb_clear_halt(usb_dev_handle * dev, unsigned int ep); -int usb_reset(usb_dev_handle * dev); -const char *usb_strerror(void); -void usb_init(void); -void usb_set_debug(int level); -int usb_find_busses(void); -int usb_find_devices(void); -struct usb_device *usb_device(usb_dev_handle * dev); -struct usb_bus *usb_get_busses(void); - -#if 0 -{ /* style */ -#endif -#ifdef __cplusplus -} - -#endif - -#endif /* _LIBUSB20_COMPAT01_H_ */ diff --git a/lib/libusb20/usb.h b/lib/libusb20/usb.h new file mode 100644 index 000000000000..3963a9f0355c --- /dev/null +++ b/lib/libusb20/usb.h @@ -0,0 +1,310 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _LIBUSB20_COMPAT_01_H_ +#define _LIBUSB20_COMPAT_01_H_ + +#include +#include +#include +#include + +/* USB interface class codes */ + +#define USB_CLASS_PER_INTERFACE 0 +#define USB_CLASS_AUDIO 1 +#define USB_CLASS_COMM 2 +#define USB_CLASS_HID 3 +#define USB_CLASS_PRINTER 7 +#define USB_CLASS_PTP 6 +#define USB_CLASS_MASS_STORAGE 8 +#define USB_CLASS_HUB 9 +#define USB_CLASS_DATA 10 +#define USB_CLASS_VENDOR_SPEC 0xff + +/* USB descriptor types */ + +#define USB_DT_DEVICE 0x01 +#define USB_DT_CONFIG 0x02 +#define USB_DT_STRING 0x03 +#define USB_DT_INTERFACE 0x04 +#define USB_DT_ENDPOINT 0x05 + +#define USB_DT_HID 0x21 +#define USB_DT_REPORT 0x22 +#define USB_DT_PHYSICAL 0x23 +#define USB_DT_HUB 0x29 + +/* USB descriptor type sizes */ + +#define USB_DT_DEVICE_SIZE 18 +#define USB_DT_CONFIG_SIZE 9 +#define USB_DT_INTERFACE_SIZE 9 +#define USB_DT_ENDPOINT_SIZE 7 +#define USB_DT_ENDPOINT_AUDIO_SIZE 9 +#define USB_DT_HUB_NONVAR_SIZE 7 + +/* USB descriptor header */ +struct usb_descriptor_header { + uint8_t bLength; + uint8_t bDescriptorType; +}; + +/* USB string descriptor */ +struct usb_string_descriptor { + uint8_t bLength; + uint8_t bDescriptorType; + uint16_t wData[1]; +}; + +/* USB HID descriptor */ +struct usb_hid_descriptor { + uint8_t bLength; + uint8_t bDescriptorType; + uint16_t bcdHID; + uint8_t bCountryCode; + uint8_t bNumDescriptors; + /* uint8_t bReportDescriptorType; */ + /* uint16_t wDescriptorLength; */ + /* ... */ +}; + +/* USB endpoint descriptor */ +#define USB_MAXENDPOINTS 32 +struct usb_endpoint_descriptor { + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bEndpointAddress; +#define USB_ENDPOINT_ADDRESS_MASK 0x0f +#define USB_ENDPOINT_DIR_MASK 0x80 + uint8_t bmAttributes; +#define USB_ENDPOINT_TYPE_MASK 0x03 +#define USB_ENDPOINT_TYPE_CONTROL 0 +#define USB_ENDPOINT_TYPE_ISOCHRONOUS 1 +#define USB_ENDPOINT_TYPE_BULK 2 +#define USB_ENDPOINT_TYPE_INTERRUPT 3 + uint16_t wMaxPacketSize; + uint8_t bInterval; + uint8_t bRefresh; + uint8_t bSynchAddress; + + uint8_t *extra; /* Extra descriptors */ + int extralen; +}; + +/* USB interface descriptor */ +#define USB_MAXINTERFACES 32 +struct usb_interface_descriptor { + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bInterfaceNumber; + uint8_t bAlternateSetting; + uint8_t bNumEndpoints; + uint8_t bInterfaceClass; + uint8_t bInterfaceSubClass; + uint8_t bInterfaceProtocol; + uint8_t iInterface; + + struct usb_endpoint_descriptor *endpoint; + + uint8_t *extra; /* Extra descriptors */ + int extralen; +}; + +#define USB_MAXALTSETTING 128 /* Hard limit */ +struct usb_interface { + struct usb_interface_descriptor *altsetting; + + int num_altsetting; +}; + +/* USB configuration descriptor */ +#define USB_MAXCONFIG 8 +struct usb_config_descriptor { + uint8_t bLength; + uint8_t bDescriptorType; + uint16_t wTotalLength; + uint8_t bNumInterfaces; + uint8_t bConfigurationValue; + uint8_t iConfiguration; + uint8_t bmAttributes; + uint8_t MaxPower; + + struct usb_interface *interface; + + uint8_t *extra; /* Extra descriptors */ + int extralen; +}; + +/* USB device descriptor */ +struct usb_device_descriptor { + uint8_t bLength; + uint8_t bDescriptorType; + uint16_t bcdUSB; + uint8_t bDeviceClass; + uint8_t bDeviceSubClass; + uint8_t bDeviceProtocol; + uint8_t bMaxPacketSize0; + uint16_t idVendor; + uint16_t idProduct; + uint16_t bcdDevice; + uint8_t iManufacturer; + uint8_t iProduct; + uint8_t iSerialNumber; + uint8_t bNumConfigurations; +}; + +/* USB setup packet */ +struct usb_ctrl_setup { + uint8_t bRequestType; +#define USB_RECIP_DEVICE 0x00 +#define USB_RECIP_INTERFACE 0x01 +#define USB_RECIP_ENDPOINT 0x02 +#define USB_RECIP_OTHER 0x03 +#define USB_TYPE_STANDARD (0x00 << 5) +#define USB_TYPE_CLASS (0x01 << 5) +#define USB_TYPE_VENDOR (0x02 << 5) +#define USB_TYPE_RESERVED (0x03 << 5) +#define USB_ENDPOINT_IN 0x80 +#define USB_ENDPOINT_OUT 0x00 + uint8_t bRequest; +#define USB_REQ_GET_STATUS 0x00 +#define USB_REQ_CLEAR_FEATURE 0x01 +#define USB_REQ_SET_FEATURE 0x03 +#define USB_REQ_SET_ADDRESS 0x05 +#define USB_REQ_GET_DESCRIPTOR 0x06 +#define USB_REQ_SET_DESCRIPTOR 0x07 +#define USB_REQ_GET_CONFIGURATION 0x08 +#define USB_REQ_SET_CONFIGURATION 0x09 +#define USB_REQ_GET_INTERFACE 0x0A +#define USB_REQ_SET_INTERFACE 0x0B +#define USB_REQ_SYNCH_FRAME 0x0C + uint16_t wValue; + uint16_t wIndex; + uint16_t wLength; +}; + +/* Error codes */ +#define USB_ERROR_BEGIN 500000 + +/* Byte swapping */ +#define USB_LE16_TO_CPU(x) le16toh(x) + +/* Data types */ +struct usb_device; +struct usb_bus; + +/* + * To maintain compatibility with applications already built with libusb, + * we must only add entries to the end of this structure. NEVER delete or + * move members and only change types if you really know what you're doing. + */ +struct usb_device { + struct usb_device *next; + struct usb_device *prev; + + char filename[PATH_MAX + 1]; + + struct usb_bus *bus; + + struct usb_device_descriptor descriptor; + struct usb_config_descriptor *config; + + void *dev; + + uint8_t devnum; + + uint8_t num_children; + struct usb_device **children; +}; + +struct usb_bus { + struct usb_bus *next; + struct usb_bus *prev; + + char dirname[PATH_MAX + 1]; + + struct usb_device *devices; + uint32_t location; + + struct usb_device *root_dev; +}; + +struct usb_dev_handle; +typedef struct usb_dev_handle usb_dev_handle; + +/* Variables */ +extern struct usb_bus *usb_busses; + +#ifdef __cplusplus +extern "C" { +#endif +#if 0 +} /* style */ + +#endif + +/* Function prototypes from "libusb20_compat01.c" */ + +usb_dev_handle *usb_open(struct usb_device *dev); +int usb_close(usb_dev_handle * dev); +int usb_get_string(usb_dev_handle * dev, int index, int langid, char *buf, size_t buflen); +int usb_get_string_simple(usb_dev_handle * dev, int index, char *buf, size_t buflen); +int usb_get_descriptor_by_endpoint(usb_dev_handle * udev, int ep, uint8_t type, uint8_t index, void *buf, int size); +int usb_get_descriptor(usb_dev_handle * udev, uint8_t type, uint8_t index, void *buf, int size); +int usb_parse_descriptor(uint8_t *source, char *description, void *dest); +int usb_parse_configuration(struct usb_config_descriptor *config, uint8_t *buffer); +void usb_destroy_configuration(struct usb_device *dev); +void usb_fetch_and_parse_descriptors(usb_dev_handle * udev); +int usb_bulk_write(usb_dev_handle * dev, int ep, char *bytes, int size, int timeout); +int usb_bulk_read(usb_dev_handle * dev, int ep, char *bytes, int size, int timeout); +int usb_interrupt_write(usb_dev_handle * dev, int ep, char *bytes, int size, int timeout); +int usb_interrupt_read(usb_dev_handle * dev, int ep, char *bytes, int size, int timeout); +int usb_control_msg(usb_dev_handle * dev, int requesttype, int request, int value, int index, char *bytes, int size, int timeout); +int usb_set_configuration(usb_dev_handle * dev, int configuration); +int usb_claim_interface(usb_dev_handle * dev, int interface); +int usb_release_interface(usb_dev_handle * dev, int interface); +int usb_set_altinterface(usb_dev_handle * dev, int alternate); +int usb_resetep(usb_dev_handle * dev, unsigned int ep); +int usb_clear_halt(usb_dev_handle * dev, unsigned int ep); +int usb_reset(usb_dev_handle * dev); +const char *usb_strerror(void); +void usb_init(void); +void usb_set_debug(int level); +int usb_find_busses(void); +int usb_find_devices(void); +struct usb_device *usb_device(usb_dev_handle * dev); +struct usb_bus *usb_get_busses(void); + +#if 0 +{ /* style */ +#endif +#ifdef __cplusplus +} + +#endif + +#endif /* _LIBUSB20_COMPAT01_H_ */ diff --git a/release/amd64/boot_crunch.conf b/release/amd64/boot_crunch.conf index bdb3f8a99a77..858fe0948bb6 100644 --- a/release/amd64/boot_crunch.conf +++ b/release/amd64/boot_crunch.conf @@ -42,4 +42,4 @@ progs usbconfig libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs -ldevinfo -libs -lbsdxml -larchive -lbz2 -lusb20 +libs -lbsdxml -larchive -lbz2 -lusb diff --git a/release/i386/boot_crunch.conf b/release/i386/boot_crunch.conf index bdb3f8a99a77..858fe0948bb6 100644 --- a/release/i386/boot_crunch.conf +++ b/release/i386/boot_crunch.conf @@ -42,4 +42,4 @@ progs usbconfig libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs -ldevinfo -libs -lbsdxml -larchive -lbz2 -lusb20 +libs -lbsdxml -larchive -lbz2 -lusb diff --git a/release/ia64/boot_crunch.conf b/release/ia64/boot_crunch.conf index f7c883356559..1857d3019d74 100644 --- a/release/ia64/boot_crunch.conf +++ b/release/ia64/boot_crunch.conf @@ -46,4 +46,4 @@ progs usbconfig libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph libs -ldialog -lncurses -ldisk -lcam -lkiconv -lsbuf -lufs -ldevinfo -libs -lgeom -lbsdxml -larchive -lbz2 -lusb20 +libs -lgeom -lbsdxml -larchive -lbz2 -lusb diff --git a/release/powerpc/boot_crunch.conf b/release/powerpc/boot_crunch.conf index 23a3c8e3c2bd..12c5a3b5f91f 100644 --- a/release/powerpc/boot_crunch.conf +++ b/release/powerpc/boot_crunch.conf @@ -44,4 +44,4 @@ progs usbconfig libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph libs -ldialog -lncurses -ldisk -lcam -lkiconv -lsbuf -lufs -libs -lbsdxml -larchive -lbz2 -lusb20 +libs -lbsdxml -larchive -lbz2 -lusb diff --git a/release/sparc64/boot_crunch.conf b/release/sparc64/boot_crunch.conf index 4f84bc486ff0..520d75c0aebb 100644 --- a/release/sparc64/boot_crunch.conf +++ b/release/sparc64/boot_crunch.conf @@ -42,4 +42,4 @@ progs usbconfig libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs -lbsdxml -libs -larchive -lbz2 -lusb20 +libs -larchive -lbz2 -lusb diff --git a/release/sun4v/boot_crunch.conf b/release/sun4v/boot_crunch.conf index 4f84bc486ff0..520d75c0aebb 100644 --- a/release/sun4v/boot_crunch.conf +++ b/release/sun4v/boot_crunch.conf @@ -42,4 +42,4 @@ progs usbconfig libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs -lbsdxml -libs -larchive -lbz2 -lusb20 +libs -larchive -lbz2 -lusb diff --git a/sys/sys/param.h b/sys/sys/param.h index 665b8dfd2074..21e54336795e 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -57,7 +57,7 @@ * is created, otherwise 1. */ #undef __FreeBSD_version -#define __FreeBSD_version 800068 /* Master, propagated to newvers */ +#define __FreeBSD_version 800069 /* Master, propagated to newvers */ #ifndef LOCORE #include diff --git a/usr.sbin/usbconfig/Makefile b/usr.sbin/usbconfig/Makefile index 6356963498db..1cd0928b8a91 100644 --- a/usr.sbin/usbconfig/Makefile +++ b/usr.sbin/usbconfig/Makefile @@ -4,6 +4,6 @@ PROG= usbconfig MAN= usbconfig.8 SRCS= usbconfig.c dump.c -LDADD+= -lusb20 +LDADD+= -lusb .include -- cgit v1.2.3