PERFORCE change 184622 for review
Hans Petter Selasky
hselasky at FreeBSD.org
Tue Oct 12 14:52:26 UTC 2010
http://p4web.freebsd.org/@@184622?ac=10
Change 184622 by hselasky at hselasky_laptop001 on 2010/10/12 14:51:38
IFC - Remove USB wait enumeration patch.
Recommend use of devd events instead.
Affected files ...
.. //depot/projects/usb/src/lib/libusb/libusb20.3#12 edit
.. //depot/projects/usb/src/lib/libusb/libusb20.c#20 edit
.. //depot/projects/usb/src/lib/libusb/libusb20.h#13 edit
.. //depot/projects/usb/src/lib/libusb/libusb20_int.h#13 edit
.. //depot/projects/usb/src/lib/libusb/libusb20_ugen20.c#16 edit
Differences ...
==== //depot/projects/usb/src/lib/libusb/libusb20.3#12 (text+ko) ====
@@ -177,8 +177,6 @@
.Ft int
.Fn libusb20_be_set_template "struct libusb20_backend *pbe" "int temp"
.Ft int
-.Fn libusb20_be_wait_enumeration "struct libusb20_backend *pbe" "int timeout" "int flag"
-.Ft int
.Fn libusb20_be_get_dev_quirk "struct libusb20_backend *pber" "uint16_t index" "struct libusb20_quirk *pq"
.Ft int
.Fn libusb20_be_get_quirk_name "struct libusb20_backend *pbe" "uint16_t index" "struct libusb20_quirk *pq"
@@ -833,23 +831,6 @@
.
.Pp
.
-.Fn libusb20_be_wait_enumeration
-will block until a new USB device is enumerated or an existing USB
-device is detached. All devices belonging to the backend will be
-dequeued and freed, but not the backend itself.
-If the
-.Fa timeout
-argument is non-zero the function will return after the given number
-of milliseconds.
-A timeout is not regarded like an error.
-The
-.Fa flag
-argument is current reserved and must be set to zero.
-This function returns zero on success else a LIBUSB20_ERROR value is
-returned.
-.
-.Pp
-.
.Fn libusb20_be_get_dev_quirk
This function will return the device quirk according to
.Fa index
==== //depot/projects/usb/src/lib/libusb/libusb20.c#20 (text+ko) ====
@@ -1114,21 +1114,6 @@
return (pbe->methods->root_get_template(pbe, ptemp));
}
-int
-libusb20_be_wait_enumeration(struct libusb20_backend *pbe, int timeout, int flag)
-{
- struct libusb20_device *pdev;
-
- /* clean up all existing devices */
-
- while ((pdev = libusb20_be_device_foreach(pbe, NULL))) {
- libusb20_be_dequeue_device(pbe, pdev);
- libusb20_dev_free(pdev);
- }
-
- return (pbe->methods->root_wait_enumeration(pbe, timeout, flag));
-}
-
struct libusb20_device *
libusb20_be_device_foreach(struct libusb20_backend *pbe, struct libusb20_device *pdev)
{
==== //depot/projects/usb/src/lib/libusb/libusb20.h#13 (text+ko) ====
@@ -277,7 +277,6 @@
int libusb20_be_remove_dev_quirk(struct libusb20_backend *pbe, struct libusb20_quirk *pq);
int libusb20_be_get_template(struct libusb20_backend *pbe, int *ptemp);
int libusb20_be_set_template(struct libusb20_backend *pbe, int temp);
-int libusb20_be_wait_enumeration(struct libusb20_backend *pbe, int, int);
/* USB backend operations */
==== //depot/projects/usb/src/lib/libusb/libusb20_int.h#13 (text+ko) ====
@@ -62,7 +62,6 @@
typedef void (libusb20_exit_backend_t)(struct libusb20_backend *pbe);
typedef int (libusb20_root_set_template_t)(struct libusb20_backend *pbe, int temp);
typedef int (libusb20_root_get_template_t)(struct libusb20_backend *pbe, int *ptemp);
-typedef int (libusb20_root_wait_enumeration_t)(struct libusb20_backend *pbe, int, int);
#define LIBUSB20_DEFINE(n,field) \
libusb20_##field##_t *field;
@@ -84,7 +83,6 @@
m(n, root_remove_dev_quirk) \
m(n, root_set_template) \
m(n, root_get_template) \
- m(n, root_wait_enumeration) \
/* mandatory device methods */ \
m(n, open_device) \
m(n, close_device) \
==== //depot/projects/usb/src/lib/libusb/libusb20_ugen20.c#16 (text+ko) ====
@@ -55,7 +55,6 @@
static libusb20_root_remove_dev_quirk_t ugen20_root_remove_dev_quirk;
static libusb20_root_set_template_t ugen20_root_set_template;
static libusb20_root_get_template_t ugen20_root_get_template;
-static libusb20_root_wait_enumeration_t ugen20_root_wait_enumeration;
const struct libusb20_backend_methods libusb20_ugen20_backend = {
LIBUSB20_BACKEND(LIBUSB20_DECLARE, ugen20)
@@ -1014,26 +1013,3 @@
return (ugen20_be_ioctl(USB_GET_TEMPLATE, ptemp));
}
-static int
-ugen20_root_wait_enumeration(struct libusb20_backend *pbe, int timeout, int flag)
-{
- struct usb_wait_enumeration info;
- int error;
-
- if (timeout < 0)
- timeout = 0;
- else if (timeout > 65535)
- timeout = 65535;
-
- memset(&info, 0, sizeof(info));
-
- info.timeout = timeout;
- info.flag = flag;
-
- error = ugen20_be_ioctl(USB_WAIT_ENUMERATION, &info);
-
- if (error)
- usleep(25000); /* nice it */
-
- return (error);
-}
More information about the p4-projects
mailing list