summaryrefslogtreecommitdiff
path: root/sys/dev/usb/usbdi.h
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2005-08-01 05:36:50 +0000
committerBrad Smith <brad@cvs.openbsd.org>2005-08-01 05:36:50 +0000
commit2e4c19f779ce48faaf5abcaa186def74956a6981 (patch)
tree2a7d441b21de326c5a27b994bce0b47dcb3dd0e7 /sys/dev/usb/usbdi.h
parent0fd85d9caed3489931a1fa9c2b7520960293653d (diff)
Don't keep the devinfo string on the stack, instead use malloc/free.
This should cure some rare stack overflows. From augustss NetBSD ok dlg@ pascoe@
Diffstat (limited to 'sys/dev/usb/usbdi.h')
-rw-r--r--sys/dev/usb/usbdi.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/usb/usbdi.h b/sys/dev/usb/usbdi.h
index 23f0b29868f..11bc0d8e150 100644
--- a/sys/dev/usb/usbdi.h
+++ b/sys/dev/usb/usbdi.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: usbdi.h,v 1.23 2004/12/12 06:13:15 dlg Exp $ */
+/* $OpenBSD: usbdi.h,v 1.24 2005/08/01 05:36:49 brad Exp $ */
/* $NetBSD: usbdi.h,v 1.62 2002/07/11 21:14:35 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usbdi.h,v 1.18 1999/11/17 22:33:49 n_hibma Exp $ */
@@ -93,6 +93,8 @@ typedef void (*usbd_callback)(usbd_xfer_handle, usbd_private_handle,
#define USB_CDEV_MAJOR 108
#endif
+#define DEVINFOSIZE 1024
+
usbd_status usbd_open_pipe(usbd_interface_handle iface, u_int8_t address,
u_int8_t flags, usbd_pipe_handle *pipe);
usbd_status usbd_close_pipe(usbd_pipe_handle pipe);
@@ -169,7 +171,9 @@ const char *usbd_errstr(usbd_status err);
void usbd_add_dev_event(int, usbd_device_handle);
void usbd_add_drv_event(int, usbd_device_handle, device_ptr_t);
-void usbd_devinfo(usbd_device_handle, int, char *, size_t);
+char *usbd_devinfo_alloc(usbd_device_handle dev, int showclass);
+void usbd_devinfo_free(char *devinfop);
+
const struct usbd_quirks *usbd_get_quirks(usbd_device_handle);
usb_endpoint_descriptor_t *usbd_get_endpoint_descriptor
(usbd_interface_handle iface, u_int8_t address);