diff options
author | David Kubicek <dave@awk.cz> | 2005-11-01 12:51:34 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-01-04 16:48:29 -0500 |
commit | 61a87adf2e7b410da8e41799c61c21a7b8c8b001 (patch) | |
tree | b4d09ce45dadd78cd2b92848a96c508f44d12f88 /drivers/usb/class/cdc-acm.h | |
parent | 2e1dcc1600c1d83b26479edd076866595bbd3523 (diff) |
[PATCH] USB: Converting cdc acm to a ring queue
this patch by David converts the sending queue of the CDC ACM driver
to a queue of URBs. This is needed for quicker devices. Please apply.
Signed-Off-By: Oliver Neukum <oliver@neukum.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/class/cdc-acm.c | 229 ++++++++++++++++++++++++++++++--------------
drivers/usb/class/cdc-acm.h | 33 +++++-
2 files changed, 185 insertions(+), 77 deletions(-)
Diffstat (limited to 'drivers/usb/class/cdc-acm.h')
-rw-r--r-- | drivers/usb/class/cdc-acm.h | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/drivers/usb/class/cdc-acm.h b/drivers/usb/class/cdc-acm.h index 963a5dfd2096..fd2aaccdcbac 100644 --- a/drivers/usb/class/cdc-acm.h +++ b/drivers/usb/class/cdc-acm.h | |||
@@ -59,6 +59,9 @@ | |||
59 | * when processing onlcr, so we only need 2 buffers. | 59 | * when processing onlcr, so we only need 2 buffers. |
60 | */ | 60 | */ |
61 | #define ACM_NWB 2 | 61 | #define ACM_NWB 2 |
62 | #define ACM_NRU 16 | ||
63 | #define ACM_NRB 16 | ||
64 | |||
62 | struct acm_wb { | 65 | struct acm_wb { |
63 | unsigned char *buf; | 66 | unsigned char *buf; |
64 | dma_addr_t dmah; | 67 | dma_addr_t dmah; |
@@ -66,22 +69,43 @@ struct acm_wb { | |||
66 | int use; | 69 | int use; |
67 | }; | 70 | }; |
68 | 71 | ||
72 | struct acm_rb { | ||
73 | struct list_head list; | ||
74 | int size; | ||
75 | unsigned char *base; | ||
76 | dma_addr_t dma; | ||
77 | }; | ||
78 | |||
79 | struct acm_ru { | ||
80 | struct list_head list; | ||
81 | struct acm_rb *buffer; | ||
82 | struct urb *urb; | ||
83 | struct acm *instance; | ||
84 | }; | ||
85 | |||
69 | struct acm { | 86 | struct acm { |
70 | struct usb_device *dev; /* the corresponding usb device */ | 87 | struct usb_device *dev; /* the corresponding usb device */ |
71 | struct usb_interface *control; /* control interface */ | 88 | struct usb_interface *control; /* control interface */ |
72 | struct usb_interface *data; /* data interface */ | 89 | struct usb_interface *data; /* data interface */ |
73 | struct tty_struct *tty; /* the corresponding tty */ | 90 | struct tty_struct *tty; /* the corresponding tty */ |
74 | struct urb *ctrlurb, *readurb, *writeurb; /* urbs */ | 91 | struct urb *ctrlurb, *writeurb; /* urbs */ |
75 | u8 *ctrl_buffer, *read_buffer; /* buffers of urbs */ | 92 | u8 *ctrl_buffer; /* buffers of urbs */ |
76 | dma_addr_t ctrl_dma, read_dma; /* dma handles of buffers */ | 93 | dma_addr_t ctrl_dma; /* dma handles of buffers */ |
77 | struct acm_wb wb[ACM_NWB]; | 94 | struct acm_wb wb[ACM_NWB]; |
95 | struct acm_ru ru[ACM_NRU]; | ||
96 | struct acm_rb rb[ACM_NRB]; | ||
97 | int rx_endpoint; | ||
98 | spinlock_t read_lock; | ||
99 | struct list_head spare_read_urbs; | ||
100 | struct list_head spare_read_bufs; | ||
101 | struct list_head filled_read_bufs; | ||
78 | int write_current; /* current write buffer */ | 102 | int write_current; /* current write buffer */ |
79 | int write_used; /* number of non-empty write buffers */ | 103 | int write_used; /* number of non-empty write buffers */ |
80 | int write_ready; /* write urb is not running */ | 104 | int write_ready; /* write urb is not running */ |
81 | spinlock_t write_lock; | 105 | spinlock_t write_lock; |
82 | struct usb_cdc_line_coding line; /* bits, stop, parity */ | 106 | struct usb_cdc_line_coding line; /* bits, stop, parity */ |
83 | struct work_struct work; /* work queue entry for line discipline waking up */ | 107 | struct work_struct work; /* work queue entry for line discipline waking up */ |
84 | struct tasklet_struct bh; /* rx processing */ | 108 | struct tasklet_struct urb_task; /* rx processing */ |
85 | spinlock_t throttle_lock; /* synchronize throtteling and read callback */ | 109 | spinlock_t throttle_lock; /* synchronize throtteling and read callback */ |
86 | unsigned int ctrlin; /* input control lines (DCD, DSR, RI, break, overruns) */ | 110 | unsigned int ctrlin; /* input control lines (DCD, DSR, RI, break, overruns) */ |
87 | unsigned int ctrlout; /* output control lines (DTR, RTS) */ | 111 | unsigned int ctrlout; /* output control lines (DTR, RTS) */ |
@@ -91,7 +115,6 @@ struct acm { | |||
91 | unsigned int minor; /* acm minor number */ | 115 | unsigned int minor; /* acm minor number */ |
92 | unsigned char throttle; /* throttled by tty layer */ | 116 | unsigned char throttle; /* throttled by tty layer */ |
93 | unsigned char clocal; /* termios CLOCAL */ | 117 | unsigned char clocal; /* termios CLOCAL */ |
94 | unsigned char resubmit_to_unthrottle; /* throtteling has disabled the read urb */ | ||
95 | unsigned int ctrl_caps; /* control capabilities from the class specific header */ | 118 | unsigned int ctrl_caps; /* control capabilities from the class specific header */ |
96 | }; | 119 | }; |
97 | 120 | ||