Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb Add usbd_get_bos_desc{, _full} from Takahiro HAYASHI
details: https://anonhg.NetBSD.org/src/rev/504363714f60
branches: trunk
changeset: 807068:504363714f60
user: skrll <skrll%NetBSD.org@localhost>
date: Fri Mar 27 12:46:51 2015 +0000
description:
Add usbd_get_bos_desc{,_full} from Takahiro HAYASHI
diffstat:
sys/dev/usb/usbdi_util.c | 31 +++++++++++++++++++++++++++++--
sys/dev/usb/usbdi_util.h | 5 ++++-
2 files changed, 33 insertions(+), 3 deletions(-)
diffs (71 lines):
diff -r e3625d874ae8 -r 504363714f60 sys/dev/usb/usbdi_util.c
--- a/sys/dev/usb/usbdi_util.c Fri Mar 27 12:45:00 2015 +0000
+++ b/sys/dev/usb/usbdi_util.c Fri Mar 27 12:46:51 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: usbdi_util.c,v 1.63 2014/09/12 16:40:38 skrll Exp $ */
+/* $NetBSD: usbdi_util.c,v 1.64 2015/03/27 12:46:51 skrll Exp $ */
/*
* Copyright (c) 1998, 2012 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usbdi_util.c,v 1.63 2014/09/12 16:40:38 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbdi_util.c,v 1.64 2015/03/27 12:46:51 skrll Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -105,6 +105,33 @@
}
usbd_status
+usbd_get_bos_desc(usbd_device_handle dev, int confidx,
+ usb_bos_descriptor_t *d)
+{
+ usbd_status err;
+
+ DPRINTFN(3,("usbd_get_bos_desc: confidx=%d\n", confidx));
+ err = usbd_get_desc(dev, UDESC_BOS, confidx,
+ USB_BOS_DESCRIPTOR_SIZE, d);
+ if (err)
+ return (err);
+ if (d->bDescriptorType != UDESC_BOS) {
+ DPRINTFN(-1,("usbd_get_bos_desc: confidx=%d, bad desc "
+ "len=%d type=%d\n",
+ confidx, d->bLength, d->bDescriptorType));
+ return (USBD_INVAL);
+ }
+ return (USBD_NORMAL_COMPLETION);
+}
+
+usbd_status
+usbd_get_bos_desc_full(usbd_device_handle dev, int conf, void *d, int size)
+{
+ DPRINTFN(3,("usbd_get_bos_desc_full: conf=%d\n", conf));
+ return (usbd_get_desc(dev, UDESC_BOS, conf, size, d));
+}
+
+usbd_status
usbd_get_device_desc(usbd_device_handle dev, usb_device_descriptor_t *d)
{
DPRINTFN(3,("usbd_get_device_desc:\n"));
diff -r e3625d874ae8 -r 504363714f60 sys/dev/usb/usbdi_util.h
--- a/sys/dev/usb/usbdi_util.h Fri Mar 27 12:45:00 2015 +0000
+++ b/sys/dev/usb/usbdi_util.h Fri Mar 27 12:46:51 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: usbdi_util.h,v 1.45 2013/09/26 07:25:31 skrll Exp $ */
+/* $NetBSD: usbdi_util.h,v 1.46 2015/03/27 12:46:51 skrll Exp $ */
/*
* Copyright (c) 1998, 2004 The NetBSD Foundation, Inc.
@@ -40,6 +40,9 @@
usbd_status usbd_get_config_desc(usbd_device_handle, int,
usb_config_descriptor_t *);
usbd_status usbd_get_config_desc_full(usbd_device_handle, int, void *, int);
+usbd_status usbd_get_bos_desc(usbd_device_handle, int,
+ usb_bos_descriptor_t *);
+usbd_status usbd_get_bos_desc_full(usbd_device_handle, int, void *, int);
usbd_status usbd_get_device_desc(usbd_device_handle dev,
usb_device_descriptor_t *d);
usbd_status usbd_set_address(usbd_device_handle dev, int addr);
Home |
Main Index |
Thread Index |
Old Index