rds-make-rds_sock_lock-bh-rather-than-irq-safe.patch
tcp-fix-tcp_trim_head-to-adjust-segment-count-with-skb-mss.patch
tcp-md5-using-remote-adress-for-md5-lookup-in-rst-packet.patch
+usb-serial-cp210x-added-usb-id-for-the-link-instruments-mso-19.patch
+usb-cp210x-call-generic-open-last-in-open.patch
+usb-cp210x-fix-cp2104-baudrate-usage.patch
+usb-cp210x-do-not-map-baud-rates-to-b0.patch
+usb-cp210x-fix-up-set_termios-variables.patch
+usb-cp210x-clean-up-refactor-and-document-speed-handling.patch
+usb-cp210x-initialise-baud-rate-at-open.patch
+usb-cp210x-allow-more-baud-rates-above-1mbaud.patch
--- /dev/null
+From d1620ca9e7bb0030068c3b45b653defde8839dac Mon Sep 17 00:00:00 2001
+From: Johan Hovold <jhovold@gmail.com>
+Date: Mon, 16 Jan 2012 00:36:53 +0100
+Subject: USB: cp210x: allow more baud rates above 1Mbaud
+
+From: Johan Hovold <jhovold@gmail.com>
+
+commit d1620ca9e7bb0030068c3b45b653defde8839dac upstream.
+
+Allow more baud rates to be set in [1M,2M] baud.
+
+Signed-off-by: Johan Hovold <jhovold@gmail.com>
+Cc: Preston Fick <preston.fick@silabs.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/serial/cp210x.c | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+--- a/drivers/usb/serial/cp210x.c
++++ b/drivers/usb/serial/cp210x.c
+@@ -388,10 +388,10 @@ static unsigned int cp210x_quantise_baud
+ else if (baud <= 491520) baud = 460800;
+ else if (baud <= 567138) baud = 500000;
+ else if (baud <= 670254) baud = 576000;
+- else if (baud <= 1053257) baud = 921600;
+- else if (baud <= 1474560) baud = 1228800;
+- else if (baud <= 2457600) baud = 1843200;
+- else baud = 3686400;
++ else if (baud < 1000000)
++ baud = 921600;
++ else if (baud > 2000000)
++ baud = 2000000;
+ return baud;
+ }
+
+@@ -611,7 +611,8 @@ static void cp210x_change_speed(struct t
+
+ baud = tty->termios->c_ospeed;
+
+- /* This maps the requested rate to a rate valid on cp2102 or cp2103.
++ /* This maps the requested rate to a rate valid on cp2102 or cp2103,
++ * or to an arbitrary rate in [1M,2M].
+ *
+ * NOTE: B0 is not implemented.
+ */
--- /dev/null
+From 55b2afbb92ad92e9f6b0aa4354eb1c94589280c3 Mon Sep 17 00:00:00 2001
+From: Johan Hovold <jhovold@gmail.com>
+Date: Mon, 16 Jan 2012 00:36:48 +0100
+Subject: USB: cp210x: call generic open last in open
+
+From: Johan Hovold <jhovold@gmail.com>
+
+commit 55b2afbb92ad92e9f6b0aa4354eb1c94589280c3 upstream.
+
+Make sure port is fully initialised before calling generic open.
+
+Signed-off-by: Johan Hovold <jhovold@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/serial/cp210x.c | 9 ++-------
+ 1 file changed, 2 insertions(+), 7 deletions(-)
+
+--- a/drivers/usb/serial/cp210x.c
++++ b/drivers/usb/serial/cp210x.c
+@@ -393,8 +393,6 @@ static unsigned int cp210x_quantise_baud
+
+ static int cp210x_open(struct tty_struct *tty, struct usb_serial_port *port)
+ {
+- int result;
+-
+ dbg("%s - port %d", __func__, port->number);
+
+ if (cp210x_set_config_single(port, CP210X_IFC_ENABLE, UART_ENABLE)) {
+@@ -403,13 +401,10 @@ static int cp210x_open(struct tty_struct
+ return -EPROTO;
+ }
+
+- result = usb_serial_generic_open(tty, port);
+- if (result)
+- return result;
+-
+ /* Configure the termios structure */
+ cp210x_get_termios(tty, port);
+- return 0;
++
++ return usb_serial_generic_open(tty, port);
+ }
+
+ static void cp210x_close(struct usb_serial_port *port)
--- /dev/null
+From e5990874e511d5bbca23b3396419480cb2ca0ee7 Mon Sep 17 00:00:00 2001
+From: Johan Hovold <jhovold@gmail.com>
+Date: Mon, 16 Jan 2012 00:36:51 +0100
+Subject: USB: cp210x: clean up, refactor and document speed handling
+
+From: Johan Hovold <jhovold@gmail.com>
+
+commit e5990874e511d5bbca23b3396419480cb2ca0ee7 upstream.
+
+Clean up and refactor speed handling.
+Document baud rate handling for CP210{1,2,4,5,10}.
+
+Signed-off-by: Johan Hovold <jhovold@gmail.com>
+Cc: Preston Fick <preston.fick@silabs.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/serial/cp210x.c | 69 +++++++++++++++++++++++++++++++++++---------
+ 1 file changed, 56 insertions(+), 13 deletions(-)
+
+--- a/drivers/usb/serial/cp210x.c
++++ b/drivers/usb/serial/cp210x.c
+@@ -39,6 +39,8 @@ static void cp210x_get_termios(struct tt
+ struct usb_serial_port *port);
+ static void cp210x_get_termios_port(struct usb_serial_port *port,
+ unsigned int *cflagp, unsigned int *baudp);
++static void cp210x_change_speed(struct tty_struct *, struct usb_serial_port *,
++ struct ktermios *);
+ static void cp210x_set_termios(struct tty_struct *, struct usb_serial_port *,
+ struct ktermios*);
+ static int cp210x_tiocmget(struct tty_struct *);
+@@ -572,11 +574,62 @@ static void cp210x_get_termios_port(stru
+ *cflagp = cflag;
+ }
+
++/*
++ * CP2101 supports the following baud rates:
++ *
++ * 300, 600, 1200, 1800, 2400, 4800, 7200, 9600, 14400, 19200, 28800,
++ * 38400, 56000, 57600, 115200, 128000, 230400, 460800, 921600
++ *
++ * CP2102 and CP2103 support the following additional rates:
++ *
++ * 4000, 16000, 51200, 64000, 76800, 153600, 250000, 256000, 500000,
++ * 576000
++ *
++ * The device will map a requested rate to a supported one, but the result
++ * of requests for rates greater than 1053257 is undefined (see AN205).
++ *
++ * CP2104, CP2105 and CP2110 support most rates up to 2M, 921k and 1M baud,
++ * respectively, with an error less than 1%. The actual rates are determined
++ * by
++ *
++ * div = round(freq / (2 x prescale x request))
++ * actual = freq / (2 x prescale x div)
++ *
++ * For CP2104 and CP2105 freq is 48Mhz and prescale is 4 for request <= 365bps
++ * or 1 otherwise.
++ * For CP2110 freq is 24Mhz and prescale is 4 for request <= 300bps or 1
++ * otherwise.
++ */
++static void cp210x_change_speed(struct tty_struct *tty,
++ struct usb_serial_port *port, struct ktermios *old_termios)
++{
++ u32 baud;
++
++ baud = tty->termios->c_ospeed;
++
++ /* This maps the requested rate to a rate valid on cp2102 or cp2103.
++ *
++ * NOTE: B0 is not implemented.
++ */
++ baud = cp210x_quantise_baudrate(baud);
++
++ dbg("%s - setting baud rate to %u", __func__, baud);
++ if (cp210x_set_config(port, CP210X_SET_BAUDRATE, &baud,
++ sizeof(baud))) {
++ dev_warn(&port->dev, "failed to set baud rate to %u\n", baud);
++ if (old_termios)
++ baud = old_termios->c_ospeed;
++ else
++ baud = 9600;
++ }
++
++ tty_encode_baud_rate(tty, baud, baud);
++}
++
+ static void cp210x_set_termios(struct tty_struct *tty,
+ struct usb_serial_port *port, struct ktermios *old_termios)
+ {
+ unsigned int cflag, old_cflag;
+- u32 baud;
+ unsigned int bits;
+ unsigned int modem_ctl[4];
+
+@@ -588,19 +641,9 @@ static void cp210x_set_termios(struct tt
+ tty->termios->c_cflag &= ~CMSPAR;
+ cflag = tty->termios->c_cflag;
+ old_cflag = old_termios->c_cflag;
+- baud = cp210x_quantise_baudrate(tty_get_baud_rate(tty));
+
+- /* If the baud rate is to be updated*/
+- if (baud != tty_termios_baud_rate(old_termios) && baud != 0) {
+- dbg("%s - Setting baud rate to %d baud", __func__,
+- baud);
+- if (cp210x_set_config(port, CP210X_SET_BAUDRATE, &baud, sizeof(baud))) {
+- dbg("Baud rate requested not supported by device");
+- baud = tty_termios_baud_rate(old_termios);
+- }
+- }
+- /* Report back the resulting baud rate */
+- tty_encode_baud_rate(tty, baud, baud);
++ if (tty->termios->c_ospeed != old_termios->c_ospeed)
++ cp210x_change_speed(tty, port, old_termios);
+
+ /* If the number of data bits is to be updated */
+ if ((cflag & CSIZE) != (old_cflag & CSIZE)) {
--- /dev/null
+From be125d9c8d59560e7cc2d6e2b65c8fd233498ab7 Mon Sep 17 00:00:00 2001
+From: Johan Hovold <jhovold@gmail.com>
+Date: Mon, 16 Jan 2012 00:36:50 +0100
+Subject: USB: cp210x: do not map baud rates to B0
+
+From: Johan Hovold <jhovold@gmail.com>
+
+commit be125d9c8d59560e7cc2d6e2b65c8fd233498ab7 upstream.
+
+We do not implement B0 hangup yet so map low baudrates to 300bps.
+
+Signed-off-by: Johan Hovold <jhovold@gmail.com>
+Cc: Preston Fick <preston.fick@silabs.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/serial/cp210x.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/usb/serial/cp210x.c
++++ b/drivers/usb/serial/cp210x.c
+@@ -357,8 +357,8 @@ static inline int cp210x_set_config_sing
+ * Quantises the baud rate as per AN205 Table 1
+ */
+ static unsigned int cp210x_quantise_baudrate(unsigned int baud) {
+- if (baud <= 56) baud = 0;
+- else if (baud <= 300) baud = 300;
++ if (baud <= 300)
++ baud = 300;
+ else if (baud <= 600) baud = 600;
+ else if (baud <= 1200) baud = 1200;
+ else if (baud <= 1800) baud = 1800;
--- /dev/null
+From 7f482fc88ac47662228d6b1f05759797c8936a30 Mon Sep 17 00:00:00 2001
+From: Preston Fick <preston.fick@silabs.com>
+Date: Mon, 16 Jan 2012 18:14:09 -0600
+Subject: USB: cp210x: fix CP2104 baudrate usage
+
+From: Preston Fick <preston.fick@silabs.com>
+
+commit 7f482fc88ac47662228d6b1f05759797c8936a30 upstream.
+
+This fix changes the way baudrates are set on the CP210x devices from
+Silicon Labs. The CP2101/2/3 will respond to both a GET/SET_BAUDDIV
+command, and GET/SET_BAUDRATE command, while CP2104 and higher devices
+only respond to GET/SET_BAUDRATE. The current cp210x.ko driver in
+kernel version 3.2.0 only implements the GET/SET_BAUDDIV command.
+
+This patch implements the two new codes for the GET/SET_BAUDRATE
+commands. Then there is a change in the way that the baudrate is
+assigned or retrieved. This is done according to the CP210x USB
+specification in AN571. This document can be found here:
+http://www.silabs.com/pages/DownloadDoc.aspx?FILEURL=Support%20Documents/TechnicalDocs/AN571.pdf&src=DocumentationWebPart
+
+Sections 5.3/5.4 describe the USB packets for the old baudrate method.
+Sections 5.5/5.6 describe the USB packets for the new method. This
+patch also implements the new request scheme, and eliminates the
+unnecessary baudrate calculations since it uses the "actual baudrate"
+method.
+
+This patch solves the problem reported for the CP2104 in bug 42586,
+and also keeps support for all other devices (CP2101/2/3).
+
+This patchfile is also attached to the bug report on
+bugzilla.kernel.org. This patch has been developed and test on the
+3.2.0 mainline kernel version under Ubuntu 10.11.
+
+Signed-off-by: Preston Fick <preston.fick@silabs.com>
+[duplicate patch also sent by Johan - gregkh]
+Signed-off-by: Johan Hovold <jhovold@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/serial/cp210x.c | 10 ++++------
+ 1 file changed, 4 insertions(+), 6 deletions(-)
+
+--- a/drivers/usb/serial/cp210x.c
++++ b/drivers/usb/serial/cp210x.c
+@@ -202,6 +202,8 @@ static struct usb_serial_driver cp210x_d
+ #define CP210X_EMBED_EVENTS 0x15
+ #define CP210X_GET_EVENTSTATE 0x16
+ #define CP210X_SET_CHARS 0x19
++#define CP210X_GET_BAUDRATE 0x1D
++#define CP210X_SET_BAUDRATE 0x1E
+
+ /* CP210X_IFC_ENABLE */
+ #define UART_ENABLE 0x0001
+@@ -456,10 +458,7 @@ static void cp210x_get_termios_port(stru
+
+ dbg("%s - port %d", __func__, port->number);
+
+- cp210x_get_config(port, CP210X_GET_BAUDDIV, &baud, 2);
+- /* Convert to baudrate */
+- if (baud)
+- baud = cp210x_quantise_baudrate((BAUD_RATE_GEN_FREQ + baud/2)/ baud);
++ cp210x_get_config(port, CP210X_GET_BAUDRATE, &baud, 4);
+
+ dbg("%s - baud rate = %d", __func__, baud);
+ *baudp = baud;
+@@ -594,8 +593,7 @@ static void cp210x_set_termios(struct tt
+ if (baud != tty_termios_baud_rate(old_termios) && baud != 0) {
+ dbg("%s - Setting baud rate to %d baud", __func__,
+ baud);
+- if (cp210x_set_config_single(port, CP210X_SET_BAUDDIV,
+- ((BAUD_RATE_GEN_FREQ + baud/2) / baud))) {
++ if (cp210x_set_config(port, CP210X_SET_BAUDRATE, &baud, 4)) {
+ dbg("Baud rate requested not supported by device");
+ baud = tty_termios_baud_rate(old_termios);
+ }
--- /dev/null
+From 34b76fcaee574017862ea3fa0efdcd77a9d0e57d Mon Sep 17 00:00:00 2001
+From: Johan Hovold <jhovold@gmail.com>
+Date: Mon, 16 Jan 2012 00:36:49 +0100
+Subject: USB: cp210x: fix up set_termios variables
+
+From: Johan Hovold <jhovold@gmail.com>
+
+commit 34b76fcaee574017862ea3fa0efdcd77a9d0e57d upstream.
+
+[Based on a patch from Johan, mangled by gregkh to keep things in line]
+
+Fix up the variable usage in the set_termios call.
+
+Signed-off-by: Johan Hovold <jhovold@gmail.com>
+Cc: Preston Fick <preston.fick@silabs.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/serial/cp210x.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/drivers/usb/serial/cp210x.c
++++ b/drivers/usb/serial/cp210x.c
+@@ -576,7 +576,8 @@ static void cp210x_set_termios(struct tt
+ struct usb_serial_port *port, struct ktermios *old_termios)
+ {
+ unsigned int cflag, old_cflag;
+- unsigned int baud = 0, bits;
++ u32 baud;
++ unsigned int bits;
+ unsigned int modem_ctl[4];
+
+ dbg("%s - port %d", __func__, port->number);
+@@ -593,7 +594,7 @@ static void cp210x_set_termios(struct tt
+ if (baud != tty_termios_baud_rate(old_termios) && baud != 0) {
+ dbg("%s - Setting baud rate to %d baud", __func__,
+ baud);
+- if (cp210x_set_config(port, CP210X_SET_BAUDRATE, &baud, 4)) {
++ if (cp210x_set_config(port, CP210X_SET_BAUDRATE, &baud, sizeof(baud))) {
+ dbg("Baud rate requested not supported by device");
+ baud = tty_termios_baud_rate(old_termios);
+ }
--- /dev/null
+From cdc32fd6f7b2b2580d7f1b74563f888e4dd9eb8a Mon Sep 17 00:00:00 2001
+From: Johan Hovold <jhovold@gmail.com>
+Date: Mon, 16 Jan 2012 00:36:52 +0100
+Subject: USB: cp210x: initialise baud rate at open
+
+From: Johan Hovold <jhovold@gmail.com>
+
+commit cdc32fd6f7b2b2580d7f1b74563f888e4dd9eb8a upstream.
+
+The newer cp2104 devices require the baud rate to be initialised after
+power on. Make sure it is set when port is opened.
+
+Signed-off-by: Johan Hovold <jhovold@gmail.com>
+Cc: Preston Fick <preston.fick@silabs.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/serial/cp210x.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/drivers/usb/serial/cp210x.c
++++ b/drivers/usb/serial/cp210x.c
+@@ -408,6 +408,10 @@ static int cp210x_open(struct tty_struct
+ /* Configure the termios structure */
+ cp210x_get_termios(tty, port);
+
++ /* The baud rate must be initialised on cp2104 */
++ if (tty)
++ cp210x_change_speed(tty, port, NULL);
++
+ return usb_serial_generic_open(tty, port);
+ }
+
--- /dev/null
+From 791b7d7cf69de11275e4dccec2f538eec02cbff6 Mon Sep 17 00:00:00 2001
+From: Renato Caldas <rmsc@fe.up.pt>
+Date: Fri, 6 Jan 2012 15:20:51 +0000
+Subject: USB: serial: CP210x: Added USB-ID for the Link Instruments MSO-19
+
+From: Renato Caldas <rmsc@fe.up.pt>
+
+commit 791b7d7cf69de11275e4dccec2f538eec02cbff6 upstream.
+
+This device is a Oscilloscope/Logic Analizer/Pattern Generator/TDR,
+using a Silabs CP2103 USB to UART Bridge.
+
+Signed-off-by: Renato Caldas <rmsc@fe.up.pt>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/serial/cp210x.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/usb/serial/cp210x.c
++++ b/drivers/usb/serial/cp210x.c
+@@ -138,6 +138,7 @@ static const struct usb_device_id id_tab
+ { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */
+ { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */
+ { USB_DEVICE(0x1BE3, 0x07A6) }, /* WAGO 750-923 USB Service Cable */
++ { USB_DEVICE(0x3195, 0xF190) }, /* Link Instruments MSO-19 */
+ { USB_DEVICE(0x413C, 0x9500) }, /* DW700 GPS USB interface */
+ { } /* Terminating Entry */
+ };