aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/class/cdc-acm.h
diff options
context:
space:
mode:
authorOliver Neukum <oliver@neukum.org>2005-04-21 15:28:02 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-06-27 17:43:45 -0400
commit884b600f63dc7c646f415a5d8f356df1f66ff6f2 (patch)
tree64f843dc70a12a6d9f7bd3181b3f5c99daab12b0 /drivers/usb/class/cdc-acm.h
parentd5926ae7a827bdd06b588ffbc56fd4525cd9214a (diff)
[PATCH] USB: fix acm trouble with terminals
This patch fixes lost LF when ACM device is used with getty/login/bash, in case of a modem which takes calls. Signed-off-by: Pete Zaitcev <zaitcev@redhat.com> Signed-off-by: Oliver Neukum <oliver@neukum.name> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/class/cdc-acm.h')
-rw-r--r--drivers/usb/class/cdc-acm.h25
1 files changed, 22 insertions, 3 deletions
diff --git a/drivers/usb/class/cdc-acm.h b/drivers/usb/class/cdc-acm.h
index 9009114e311b..963a5dfd2096 100644
--- a/drivers/usb/class/cdc-acm.h
+++ b/drivers/usb/class/cdc-acm.h
@@ -51,14 +51,34 @@
51 * Internal driver structures. 51 * Internal driver structures.
52 */ 52 */
53 53
54/*
55 * The only reason to have several buffers is to accomodate assumptions
56 * in line disciplines. They ask for empty space amount, receive our URB size,
57 * and proceed to issue several 1-character writes, assuming they will fit.
58 * The very first write takes a complete URB. Fortunately, this only happens
59 * when processing onlcr, so we only need 2 buffers.
60 */
61#define ACM_NWB 2
62struct acm_wb {
63 unsigned char *buf;
64 dma_addr_t dmah;
65 int len;
66 int use;
67};
68
54struct acm { 69struct acm {
55 struct usb_device *dev; /* the corresponding usb device */ 70 struct usb_device *dev; /* the corresponding usb device */
56 struct usb_interface *control; /* control interface */ 71 struct usb_interface *control; /* control interface */
57 struct usb_interface *data; /* data interface */ 72 struct usb_interface *data; /* data interface */
58 struct tty_struct *tty; /* the corresponding tty */ 73 struct tty_struct *tty; /* the corresponding tty */
59 struct urb *ctrlurb, *readurb, *writeurb; /* urbs */ 74 struct urb *ctrlurb, *readurb, *writeurb; /* urbs */
60 u8 *ctrl_buffer, *read_buffer, *write_buffer; /* buffers of urbs */ 75 u8 *ctrl_buffer, *read_buffer; /* buffers of urbs */
61 dma_addr_t ctrl_dma, read_dma, write_dma; /* dma handles of buffers */ 76 dma_addr_t ctrl_dma, read_dma; /* dma handles of buffers */
77 struct acm_wb wb[ACM_NWB];
78 int write_current; /* current write buffer */
79 int write_used; /* number of non-empty write buffers */
80 int write_ready; /* write urb is not running */
81 spinlock_t write_lock;
62 struct usb_cdc_line_coding line; /* bits, stop, parity */ 82 struct usb_cdc_line_coding line; /* bits, stop, parity */
63 struct work_struct work; /* work queue entry for line discipline waking up */ 83 struct work_struct work; /* work queue entry for line discipline waking up */
64 struct tasklet_struct bh; /* rx processing */ 84 struct tasklet_struct bh; /* rx processing */
@@ -71,7 +91,6 @@ struct acm {
71 unsigned int minor; /* acm minor number */ 91 unsigned int minor; /* acm minor number */
72 unsigned char throttle; /* throttled by tty layer */ 92 unsigned char throttle; /* throttled by tty layer */
73 unsigned char clocal; /* termios CLOCAL */ 93 unsigned char clocal; /* termios CLOCAL */
74 unsigned char ready_for_write; /* write urb can be used */
75 unsigned char resubmit_to_unthrottle; /* throtteling has disabled the read urb */ 94 unsigned char resubmit_to_unthrottle; /* throtteling has disabled the read urb */
76 unsigned int ctrl_caps; /* control capabilities from the class specific header */ 95 unsigned int ctrl_caps; /* control capabilities from the class specific header */
77}; 96};