Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-7]: src/sys/dev/usb Pull up following revision(s) (requested by m...



details:   https://anonhg.NetBSD.org/src/rev/14845f8cb39d
branches:  netbsd-7
changeset: 798321:14845f8cb39d
user:      riz <riz%NetBSD.org@localhost>
date:      Sun Aug 31 17:18:15 2014 +0000

description:
Pull up following revision(s) (requested by martin in ticket #58):
        sys/dev/usb/umcs.c: revision 1.8
Fix a few logical vs. physical port number confusions to make this
driver work with two port variants.

diffstat:

 sys/dev/usb/umcs.c |  21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diffs (80 lines):

diff -r 39aee74f506e -r 14845f8cb39d sys/dev/usb/umcs.c
--- a/sys/dev/usb/umcs.c        Sun Aug 31 07:39:12 2014 +0000
+++ b/sys/dev/usb/umcs.c        Sun Aug 31 17:18:15 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: umcs.c,v 1.7 2014/05/05 20:56:15 joerg Exp $ */
+/* $NetBSD: umcs.c,v 1.7.6.1 2014/08/31 17:18:15 riz Exp $ */
 /* $FreeBSD: head/sys/dev/usb/serial/umcs.c 260559 2014-01-12 11:44:28Z hselasky $ */
 
 /*-
@@ -41,7 +41,7 @@
  *
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: umcs.c,v 1.7 2014/05/05 20:56:15 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umcs.c,v 1.7.6.1 2014/08/31 17:18:15 riz Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -420,7 +420,8 @@
 }
 
 static int
-umcs7840_set_baudrate(struct umcs7840_softc *sc, uint8_t portno, uint32_t rate)
+umcs7840_set_baudrate(struct umcs7840_softc *sc, uint8_t portno,
+       uint32_t rate)
 {
        int err;
        uint16_t divisor;
@@ -434,7 +435,8 @@
                return (-1);
        }
        if (divisor == 0 || (clk & MCS7840_DEV_SPx_CLOCK_MASK) != clk) {
-               DPRINTF(("Port %d bad speed calculation: %d\n", portno, rate));
+               DPRINTF(("Port %d bad speed calculation: %d\n", portno,
+                   rate));
                return (-1);
        }
        DPRINTF(("Port %d set speed: %d (%02x / %d)\n", portno, rate, clk, divisor));
@@ -585,20 +587,19 @@
 umcs7840_set(void *self, int portno, int reg, int onoff)
 {
        struct umcs7840_softc *sc = self;
-       int pn = sc->sc_ports[portno].sc_port_phys;
 
        if (sc->sc_dying)
                return;
 
        switch (reg) {
        case UCOM_SET_DTR:
-               umcs7840_dtr(sc, pn, onoff);
+               umcs7840_dtr(sc, portno, onoff);
                break;
        case UCOM_SET_RTS:
-               umcs7840_rts(sc, pn, onoff);
+               umcs7840_rts(sc, portno, onoff);
                break;
        case UCOM_SET_BREAK:
-               umcs7840_break(sc, pn, onoff);
+               umcs7840_break(sc, portno, onoff);
                break;
        default:
                break;
@@ -665,7 +666,7 @@
        umcs7840_set_UART_reg(sc, pn, MCS7840_UART_REG_MCR,
            sc->sc_ports[pn].sc_port_mcr);
 
-       if (umcs7840_set_baudrate(sc, pn, t->c_ospeed))
+       if (umcs7840_set_baudrate(sc, portno, t->c_ospeed))
                return EIO;
 
        return 0;
@@ -804,7 +805,7 @@
                return EIO;
 
        /* Set speed 9600 */
-       if (umcs7840_set_baudrate(sc, pn, 9600))
+       if (umcs7840_set_baudrate(sc, portno, 9600))
                return EIO;
 
 



Home | Main Index | Thread Index | Old Index