svn commit: r234684 - head/lib/libusb

Hans Petter Selasky hselasky at FreeBSD.org
Wed Apr 25 17:54:27 UTC 2012


Author: hselasky
Date: Wed Apr 25 17:54:26 2012
New Revision: 234684
URL: http://svn.freebsd.org/changeset/base/234684

Log:
  Fix binary compatibility to the official LibUSB 1.0.
  This is useful for GNU/kFreeBSD and the libusb2debian port.
  Applications using the asynchronous API of LibUSB 1.0 needs
  to be recompiled after this update.
  
  Found by: lme @

Modified:
  head/lib/libusb/libusb.h
  head/lib/libusb/libusb10.c

Modified: head/lib/libusb/libusb.h
==============================================================================
--- head/lib/libusb/libusb.h	Wed Apr 25 12:02:06 2012	(r234683)
+++ head/lib/libusb/libusb.h	Wed Apr 25 17:54:26 2012	(r234684)
@@ -340,7 +340,7 @@ typedef void (*libusb_transfer_cb_fn) (s
 typedef struct libusb_transfer {
 	libusb_device_handle *dev_handle;
 	uint8_t	flags;
-	uint32_t endpoint;
+	uint8_t endpoint;
 	uint8_t type;
 	uint32_t timeout;
 	enum libusb_transfer_status status;
@@ -349,7 +349,6 @@ typedef struct libusb_transfer {
 	libusb_transfer_cb_fn callback;
 	void   *user_data;
 	uint8_t *buffer;
-	void *os_priv;
 	int	num_iso_packets;
 	struct libusb_iso_packet_descriptor iso_packet_desc[0];
 }	libusb_transfer __aligned(sizeof(void *));

Modified: head/lib/libusb/libusb10.c
==============================================================================
--- head/lib/libusb/libusb10.c	Wed Apr 25 12:02:06 2012	(r234683)
+++ head/lib/libusb/libusb10.c	Wed Apr 25 17:54:26 2012	(r234684)
@@ -1322,7 +1322,7 @@ libusb_submit_transfer(struct libusb_tra
 	struct libusb20_transfer *pxfer1;
 	struct libusb_super_transfer *sxfer;
 	struct libusb_device *dev;
-	uint32_t endpoint;
+	uint8_t endpoint;
 	int err;
 
 	if (uxfer == NULL)
@@ -1333,9 +1333,6 @@ libusb_submit_transfer(struct libusb_tra
 
 	endpoint = uxfer->endpoint;
 
-	if (endpoint > 255)
-		return (LIBUSB_ERROR_INVALID_PARAM);
-
 	dev = libusb_get_device(uxfer->dev_handle);
 
 	DPRINTF(dev->ctx, LIBUSB_DEBUG_FUNCTION, "libusb_submit_transfer enter");
@@ -1385,7 +1382,7 @@ libusb_cancel_transfer(struct libusb_tra
 	struct libusb20_transfer *pxfer1;
 	struct libusb_super_transfer *sxfer;
 	struct libusb_device *dev;
-	uint32_t endpoint;
+	uint8_t endpoint;
 	int retval;
 
 	if (uxfer == NULL)
@@ -1397,9 +1394,6 @@ libusb_cancel_transfer(struct libusb_tra
 
 	endpoint = uxfer->endpoint;
 
-	if (endpoint > 255)
-		return (LIBUSB_ERROR_INVALID_PARAM);
-
 	dev = libusb_get_device(uxfer->dev_handle);
 
 	DPRINTF(dev->ctx, LIBUSB_DEBUG_FUNCTION, "libusb_cancel_transfer enter");


More information about the svn-src-all mailing list