summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/usb_dev.h
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2009-06-02 19:28:26 +0000
committerthompsa <thompsa@FreeBSD.org>2009-06-02 19:28:26 +0000
commitbe537b69f0c50e8b20f6d1711ae04899914aa683 (patch)
tree155f9cc54096d86e8ea1c35ce6ac242b259dcd16 /sys/dev/usb/usb_dev.h
parent9bb9aeed7f4aae60f4e8a69cf41cf99e5b363d08 (diff)
downloadFreeBSD-src-be537b69f0c50e8b20f6d1711ae04899914aa683.zip
FreeBSD-src-be537b69f0c50e8b20f6d1711ae04899914aa683.tar.gz
Place the fifo and ref counting variables on the stack to prevent races.
Submitted by: Hans Petter Selasky
Diffstat (limited to 'sys/dev/usb/usb_dev.h')
-rw-r--r--sys/dev/usb/usb_dev.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/dev/usb/usb_dev.h b/sys/dev/usb/usb_dev.h
index 3f21542..fb41e5a 100644
--- a/sys/dev/usb/usb_dev.h
+++ b/sys/dev/usb/usb_dev.h
@@ -88,13 +88,19 @@ struct usb_cdev_privdata {
struct usb_bus *bus;
struct usb_device *udev;
struct usb_interface *iface;
- struct usb_fifo *rxfifo;
- struct usb_fifo *txfifo;
int bus_index; /* bus index */
int dev_index; /* device index */
int ep_addr; /* endpoint address */
int fflags;
uint8_t fifo_index; /* FIFO index */
+};
+
+/*
+ * Private per-device and per-thread reference information
+ */
+struct usb_cdev_refdata {
+ struct usb_fifo *rxfifo;
+ struct usb_fifo *txfifo;
uint8_t is_read; /* location has read access */
uint8_t is_write; /* location has write access */
uint8_t is_uref; /* USB refcount decr. needed */
OpenPOWER on IntegriCloud