aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2009-06-11 07:27:50 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-11 11:50:57 -0400
commit739e0285cbb162c8ddd0061fda581ee54a34c19a (patch)
tree2749034b5c611ad0b2bdbec1196383bb80548688 /drivers/usb
parent335f8514f200e63d689113d29cb7253a5c282967 (diff)
tty: Update cdc_acm
The CDC ACM driver uses the tty layer correctly so needs conversion. Start by adding and initializing the port structures. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/class/cdc-acm.c5
-rw-r--r--drivers/usb/class/cdc-acm.h3
2 files changed, 7 insertions, 1 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 7a1164dd1d37..41d4ca527f82 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -89,6 +89,9 @@ static DEFINE_MUTEX(open_mutex);
89 89
90#define ACM_READY(acm) (acm && acm->dev && acm->used) 90#define ACM_READY(acm) (acm && acm->dev && acm->used)
91 91
92static const struct tty_port_operations acm_port_ops = {
93};
94
92#ifdef VERBOSE_DEBUG 95#ifdef VERBOSE_DEBUG
93#define verbose 1 96#define verbose 1
94#else 97#else
@@ -1082,6 +1085,8 @@ skip_normal_probe:
1082 spin_lock_init(&acm->read_lock); 1085 spin_lock_init(&acm->read_lock);
1083 mutex_init(&acm->mutex); 1086 mutex_init(&acm->mutex);
1084 acm->rx_endpoint = usb_rcvbulkpipe(usb_dev, epread->bEndpointAddress); 1087 acm->rx_endpoint = usb_rcvbulkpipe(usb_dev, epread->bEndpointAddress);
1088 tty_port_init(&acm->port);
1089 acm->port.ops = &acm_port_ops;
1085 1090
1086 buf = usb_buffer_alloc(usb_dev, ctrlsize, GFP_KERNEL, &acm->ctrl_dma); 1091 buf = usb_buffer_alloc(usb_dev, ctrlsize, GFP_KERNEL, &acm->ctrl_dma);
1087 if (!buf) { 1092 if (!buf) {
diff --git a/drivers/usb/class/cdc-acm.h b/drivers/usb/class/cdc-acm.h
index 1f95e7aa1b66..19967cdb2691 100644
--- a/drivers/usb/class/cdc-acm.h
+++ b/drivers/usb/class/cdc-acm.h
@@ -90,7 +90,8 @@ struct acm {
90 struct usb_interface *control; /* control interface */ 90 struct usb_interface *control; /* control interface */
91 struct usb_interface *data; /* data interface */ 91 struct usb_interface *data; /* data interface */
92 struct tty_struct *tty; /* the corresponding tty */ 92 struct tty_struct *tty; /* the corresponding tty */
93 struct urb *ctrlurb; /* urbs */ 93 struct tty_port port; /* our tty port data */
94 struct urb *ctrlurb; /* urbs */
94 u8 *ctrl_buffer; /* buffers of urbs */ 95 u8 *ctrl_buffer; /* buffers of urbs */
95 dma_addr_t ctrl_dma; /* dma handles of buffers */ 96 dma_addr_t ctrl_dma; /* dma handles of buffers */
96 u8 *country_codes; /* country codes from device */ 97 u8 *country_codes; /* country codes from device */