Author: n_hibma
Date: Fri Nov  5 09:06:23 2010
New Revision: 214831
URL: http://svn.freebsd.org/changeset/base/214831

Log:
  - Remove an unused entry from the softc (only used in a debugging printf).
  - Fix the loop count on detach (causing a panic on detaching a serial
    dongle).
  - Increase a buffer in case some driver want extra long tty device names
    (postfixing the purpose of the tty for example, e.g. u3g.ppp).

Modified:
  head/sys/dev/usb/serial/usb_serial.c
  head/sys/dev/usb/serial/usb_serial.h

Modified: head/sys/dev/usb/serial/usb_serial.c
==============================================================================
--- head/sys/dev/usb/serial/usb_serial.c        Fri Nov  5 08:30:16 2010        
(r214830)
+++ head/sys/dev/usb/serial/usb_serial.c        Fri Nov  5 09:06:23 2010        
(r214831)
@@ -255,7 +255,7 @@ ucom_attach(struct ucom_super_softc *ssc
        }
        ssc->sc_subunits = subunits;
 
-       for (subunit = 0; subunit != ssc->sc_subunits; subunit++) {
+       for (subunit = 0; subunit < ssc->sc_subunits; subunit++) {
                sc[subunit].sc_subunit = subunit;
                sc[subunit].sc_super = ssc;
                sc[subunit].sc_mtx = mtx;
@@ -270,8 +270,8 @@ ucom_attach(struct ucom_super_softc *ssc
                sc[subunit].sc_flag |= UCOM_FLAG_ATTACHED;
        }
 
-       DPRINTF("tp = %p, unit = %d, subunits = %d, device name subunit 0 = 
%s\n",
-               sc->sc_tty, ssc->sc_unit, ssc->sc_subunits, sc[0].sc_devname);
+       DPRINTF("tp = %p, unit = %d, subunits = %d\n",
+               sc->sc_tty, ssc->sc_unit, ssc->sc_subunits);
 
        return (0);
 }
@@ -287,7 +287,7 @@ ucom_detach(struct ucom_super_softc *ssc
 
        usb_proc_drain(&ssc->sc_tq);
 
-       for (subunit = 0; subunit <= ssc->sc_subunits; subunit++) {
+       for (subunit = 0; subunit < ssc->sc_subunits; subunit++) {
                if (sc[subunit].sc_flag & UCOM_FLAG_ATTACHED) {
 
                        ucom_detach_tty(&sc[subunit]);
@@ -304,7 +304,7 @@ static int
 ucom_attach_tty(struct ucom_super_softc *ssc, struct ucom_softc *sc)
 {
        struct tty *tp;
-       char buf[10];                   /* temporary TTY device name buffer */
+       char buf[32];                   /* temporary TTY device name buffer */
 
        tp = tty_alloc_mutex(&ucom_class, sc, sc->sc_mtx);
        if (tp == NULL)

Modified: head/sys/dev/usb/serial/usb_serial.h
==============================================================================
--- head/sys/dev/usb/serial/usb_serial.h        Fri Nov  5 08:30:16 2010        
(r214830)
+++ head/sys/dev/usb/serial/usb_serial.h        Fri Nov  5 09:06:23 2010        
(r214831)
@@ -160,7 +160,6 @@ struct ucom_softc {
        const struct ucom_callback *sc_callback;
        struct ucom_super_softc *sc_super;
        struct tty *sc_tty;
-       char sc_devname[10];
        struct mtx *sc_mtx;
        void   *sc_parent;
        uint32_t sc_subunit;
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to