aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/usb-serial.h
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2005-04-23 15:49:16 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-06-27 17:43:47 -0400
commit507ca9bc0476662f3463888d583864834eab1e11 (patch)
tree421a373de235fcb4cb46a4723a1e9f00a71f709a /drivers/usb/serial/usb-serial.h
parentf4df0e334a9fc731689e8ba4f42a0d72a7491348 (diff)
[PATCH] USB: add ability for usb-serial drivers to determine if their write urb is currently being used.
This removes a lot of racy and buggy code by trying to check the status of the urb. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial/usb-serial.h')
-rw-r--r--drivers/usb/serial/usb-serial.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/serial/usb-serial.h b/drivers/usb/serial/usb-serial.h
index d1f0c4057fa6..57f92f054c75 100644
--- a/drivers/usb/serial/usb-serial.h
+++ b/drivers/usb/serial/usb-serial.h
@@ -69,6 +69,7 @@
69 * usb_serial_port: structure for the specific ports of a device. 69 * usb_serial_port: structure for the specific ports of a device.
70 * @serial: pointer back to the struct usb_serial owner of this port. 70 * @serial: pointer back to the struct usb_serial owner of this port.
71 * @tty: pointer to the corresponding tty for this port. 71 * @tty: pointer to the corresponding tty for this port.
72 * @lock: spinlock to grab when updating portions of this structure.
72 * @number: the number of the port (the minor number). 73 * @number: the number of the port (the minor number).
73 * @interrupt_in_buffer: pointer to the interrupt in buffer for this port. 74 * @interrupt_in_buffer: pointer to the interrupt in buffer for this port.
74 * @interrupt_in_urb: pointer to the interrupt in struct urb for this port. 75 * @interrupt_in_urb: pointer to the interrupt in struct urb for this port.
@@ -98,6 +99,7 @@
98struct usb_serial_port { 99struct usb_serial_port {
99 struct usb_serial * serial; 100 struct usb_serial * serial;
100 struct tty_struct * tty; 101 struct tty_struct * tty;
102 spinlock_t lock;
101 unsigned char number; 103 unsigned char number;
102 104
103 unsigned char * interrupt_in_buffer; 105 unsigned char * interrupt_in_buffer;
@@ -117,6 +119,7 @@ struct usb_serial_port {
117 unsigned char * bulk_out_buffer; 119 unsigned char * bulk_out_buffer;
118 int bulk_out_size; 120 int bulk_out_size;
119 struct urb * write_urb; 121 struct urb * write_urb;
122 int write_urb_busy;
120 __u8 bulk_out_endpointAddress; 123 __u8 bulk_out_endpointAddress;
121 124
122 wait_queue_head_t write_wait; 125 wait_queue_head_t write_wait;