PERFORCE change 149720 for review

Hans Petter Selasky hselasky at FreeBSD.org
Sat Sep 13 18:04:54 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=149720

Change 149720 by hselasky at hselasky_laptop001 on 2008/09/13 18:04:00

	
	Fix some issues popping up while testing.
	1) Need to call rint_done in the TTY layer.
	2) The config TD check gone needs to be called locked.

Affected files ...

.. //depot/projects/usb/src/sys/dev/usb2/serial/usb2_serial.c#11 edit
.. //depot/projects/usb/src/sys/dev/usb2/wlan/if_rum2.c#11 edit
.. //depot/projects/usb/src/sys/dev/usb2/wlan/if_ural2.c#11 edit
.. //depot/projects/usb/src/sys/dev/usb2/wlan/if_zyd2.c#12 edit

Differences ...

==== //depot/projects/usb/src/sys/dev/usb2/serial/usb2_serial.c#11 (text+ko) ====

@@ -1048,6 +1048,9 @@
 	    (!(sc->sc_flag & UCOM_FLAG_GP_DATA))) {
 		return;			/* multiport device polling */
 	}
+	if (len == 0)
+		return;			/* no data */
+
 	/* set a flag to prevent recursation ? */
 
 	while (len > 0) {
@@ -1084,6 +1087,7 @@
 			}
 		}
 	}
+	ttydisc_rint_done(tp);
 	return;
 }
 

==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_rum2.c#11 (text+ko) ====

@@ -1535,15 +1535,16 @@
 
 	DPRINTF("setting new state: %d\n", nstate);
 
+	mtx_lock(&sc->sc_mtx);
 	if (usb2_config_td_is_gone(&sc->sc_config_td)) {
+		mtx_unlock(&sc->sc_mtx);
+
 		/* Special case which happens at detach. */
 		if (nstate == IEEE80211_S_INIT) {
 			(uvp->newstate) (vap, nstate, arg);
 		}
 		return (0);		/* nothing to do */
 	}
-	mtx_lock(&sc->sc_mtx);
-
 	/* store next state */
 	sc->sc_ns_state = nstate;
 	sc->sc_ns_arg = arg;

==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_ural2.c#11 (text+ko) ====

@@ -1526,15 +1526,16 @@
 
 	DPRINTF("setting new state: %d\n", nstate);
 
+	mtx_lock(&sc->sc_mtx);
 	if (usb2_config_td_is_gone(&sc->sc_config_td)) {
+		mtx_unlock(&sc->sc_mtx);
+
 		/* Special case which happens at detach. */
 		if (nstate == IEEE80211_S_INIT) {
 			(uvp->newstate) (vap, nstate, arg);
 		}
 		return (0);		/* nothing to do */
 	}
-	mtx_lock(&sc->sc_mtx);
-
 	/* store next state */
 	sc->sc_ns_state = nstate;
 	sc->sc_ns_arg = arg;

==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_zyd2.c#12 (text+ko) ====

@@ -2140,15 +2140,15 @@
 
 	DPRINTF("setting new state: %d\n", nstate);
 
+	mtx_lock(&sc->sc_mtx);
 	if (usb2_config_td_is_gone(&sc->sc_config_td)) {
+		mtx_unlock(&sc->sc_mtx);
 		/* Special case which happens at detach. */
 		if (nstate == IEEE80211_S_INIT) {
 			(uvp->newstate) (vap, nstate, arg);
 		}
 		return (0);		/* nothing to do */
 	}
-	mtx_lock(&sc->sc_mtx);
-
 	/* store next state */
 	sc->sc_ns_state = nstate;
 	sc->sc_ns_arg = arg;


More information about the p4-projects mailing list