diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-11-09 22:10:24 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-11-09 22:10:24 -0500 |
commit | 69b7290e51e558e1e9c1c9ee4d5d31a3809f0f03 (patch) | |
tree | f4ad376b3aaf2b68e9066df3885ee8dd297251cb /drivers/usb/class | |
parent | 35a27eab6f94e15fa30f7662af00fbec50526f4a (diff) | |
parent | 206c5f60a3d902bc4b56dab2de3e88de5eb06108 (diff) |
Merge 3.18-rc4 into usb-next.
This resolves a conflict in drivers/usb/host/Kconfig
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/class')
-rw-r--r-- | drivers/usb/class/cdc-acm.c | 25 | ||||
-rw-r--r-- | drivers/usb/class/cdc-acm.h | 2 |
2 files changed, 23 insertions, 4 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index a78a7a4560c8..c74fd3a3f657 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
@@ -60,6 +60,9 @@ static struct acm *acm_table[ACM_TTY_MINORS]; | |||
60 | 60 | ||
61 | static DEFINE_MUTEX(acm_table_lock); | 61 | static DEFINE_MUTEX(acm_table_lock); |
62 | 62 | ||
63 | static void acm_tty_set_termios(struct tty_struct *tty, | ||
64 | struct ktermios *termios_old); | ||
65 | |||
63 | /* | 66 | /* |
64 | * acm_table accessors | 67 | * acm_table accessors |
65 | */ | 68 | */ |
@@ -145,8 +148,15 @@ static int acm_ctrl_msg(struct acm *acm, int request, int value, | |||
145 | /* devices aren't required to support these requests. | 148 | /* devices aren't required to support these requests. |
146 | * the cdc acm descriptor tells whether they do... | 149 | * the cdc acm descriptor tells whether they do... |
147 | */ | 150 | */ |
148 | #define acm_set_control(acm, control) \ | 151 | static inline int acm_set_control(struct acm *acm, int control) |
149 | acm_ctrl_msg(acm, USB_CDC_REQ_SET_CONTROL_LINE_STATE, control, NULL, 0) | 152 | { |
153 | if (acm->quirks & QUIRK_CONTROL_LINE_STATE) | ||
154 | return -EOPNOTSUPP; | ||
155 | |||
156 | return acm_ctrl_msg(acm, USB_CDC_REQ_SET_CONTROL_LINE_STATE, | ||
157 | control, NULL, 0); | ||
158 | } | ||
159 | |||
150 | #define acm_set_line(acm, line) \ | 160 | #define acm_set_line(acm, line) \ |
151 | acm_ctrl_msg(acm, USB_CDC_REQ_SET_LINE_CODING, 0, line, sizeof *(line)) | 161 | acm_ctrl_msg(acm, USB_CDC_REQ_SET_LINE_CODING, 0, line, sizeof *(line)) |
152 | #define acm_send_break(acm, ms) \ | 162 | #define acm_send_break(acm, ms) \ |
@@ -554,6 +564,8 @@ static int acm_port_activate(struct tty_port *port, struct tty_struct *tty) | |||
554 | goto error_submit_urb; | 564 | goto error_submit_urb; |
555 | } | 565 | } |
556 | 566 | ||
567 | acm_tty_set_termios(tty, NULL); | ||
568 | |||
557 | /* | 569 | /* |
558 | * Unthrottle device in case the TTY was closed while throttled. | 570 | * Unthrottle device in case the TTY was closed while throttled. |
559 | */ | 571 | */ |
@@ -980,11 +992,12 @@ static void acm_tty_set_termios(struct tty_struct *tty, | |||
980 | /* FIXME: Needs to clear unsupported bits in the termios */ | 992 | /* FIXME: Needs to clear unsupported bits in the termios */ |
981 | acm->clocal = ((termios->c_cflag & CLOCAL) != 0); | 993 | acm->clocal = ((termios->c_cflag & CLOCAL) != 0); |
982 | 994 | ||
983 | if (!newline.dwDTERate) { | 995 | if (C_BAUD(tty) == B0) { |
984 | newline.dwDTERate = acm->line.dwDTERate; | 996 | newline.dwDTERate = acm->line.dwDTERate; |
985 | newctrl &= ~ACM_CTRL_DTR; | 997 | newctrl &= ~ACM_CTRL_DTR; |
986 | } else | 998 | } else if (termios_old && (termios_old->c_cflag & CBAUD) == B0) { |
987 | newctrl |= ACM_CTRL_DTR; | 999 | newctrl |= ACM_CTRL_DTR; |
1000 | } | ||
988 | 1001 | ||
989 | if (newctrl != acm->ctrlout) | 1002 | if (newctrl != acm->ctrlout) |
990 | acm_set_control(acm, acm->ctrlout = newctrl); | 1003 | acm_set_control(acm, acm->ctrlout = newctrl); |
@@ -1312,6 +1325,7 @@ made_compressed_probe: | |||
1312 | tty_port_init(&acm->port); | 1325 | tty_port_init(&acm->port); |
1313 | acm->port.ops = &acm_port_ops; | 1326 | acm->port.ops = &acm_port_ops; |
1314 | init_usb_anchor(&acm->delayed); | 1327 | init_usb_anchor(&acm->delayed); |
1328 | acm->quirks = quirks; | ||
1315 | 1329 | ||
1316 | buf = usb_alloc_coherent(usb_dev, ctrlsize, GFP_KERNEL, &acm->ctrl_dma); | 1330 | buf = usb_alloc_coherent(usb_dev, ctrlsize, GFP_KERNEL, &acm->ctrl_dma); |
1317 | if (!buf) { | 1331 | if (!buf) { |
@@ -1679,6 +1693,9 @@ static const struct usb_device_id acm_ids[] = { | |||
1679 | { USB_DEVICE(0x0572, 0x1328), /* Shiro / Aztech USB MODEM UM-3100 */ | 1693 | { USB_DEVICE(0x0572, 0x1328), /* Shiro / Aztech USB MODEM UM-3100 */ |
1680 | .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ | 1694 | .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ |
1681 | }, | 1695 | }, |
1696 | { USB_DEVICE(0x20df, 0x0001), /* Simtec Electronics Entropy Key */ | ||
1697 | .driver_info = QUIRK_CONTROL_LINE_STATE, }, | ||
1698 | { USB_DEVICE(0x2184, 0x001c) }, /* GW Instek AFG-2225 */ | ||
1682 | { USB_DEVICE(0x22b8, 0x6425), /* Motorola MOTOMAGX phones */ | 1699 | { USB_DEVICE(0x22b8, 0x6425), /* Motorola MOTOMAGX phones */ |
1683 | }, | 1700 | }, |
1684 | /* Motorola H24 HSPA module: */ | 1701 | /* Motorola H24 HSPA module: */ |
diff --git a/drivers/usb/class/cdc-acm.h b/drivers/usb/class/cdc-acm.h index 8cd2c4b0b8ff..ffeb3c83941f 100644 --- a/drivers/usb/class/cdc-acm.h +++ b/drivers/usb/class/cdc-acm.h | |||
@@ -121,6 +121,7 @@ struct acm { | |||
121 | unsigned int throttle_req:1; /* throttle requested */ | 121 | unsigned int throttle_req:1; /* throttle requested */ |
122 | u8 bInterval; | 122 | u8 bInterval; |
123 | struct usb_anchor delayed; /* writes queued for a device about to be woken */ | 123 | struct usb_anchor delayed; /* writes queued for a device about to be woken */ |
124 | unsigned long quirks; | ||
124 | }; | 125 | }; |
125 | 126 | ||
126 | #define CDC_DATA_INTERFACE_TYPE 0x0a | 127 | #define CDC_DATA_INTERFACE_TYPE 0x0a |
@@ -131,3 +132,4 @@ struct acm { | |||
131 | #define NO_CAP_LINE BIT(2) | 132 | #define NO_CAP_LINE BIT(2) |
132 | #define NO_DATA_INTERFACE BIT(4) | 133 | #define NO_DATA_INTERFACE BIT(4) |
133 | #define IGNORE_DEVICE BIT(5) | 134 | #define IGNORE_DEVICE BIT(5) |
135 | #define QUIRK_CONTROL_LINE_STATE BIT(6) | ||