PERFORCE change 102863 for review
Hans Petter Selasky
hselasky at FreeBSD.org
Mon Jul 31 17:00:46 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=102863
Change 102863 by hselasky at hselasky_mini_itx on 2006/07/31 17:00:40
Factorize "ural_cfg_sleep()" into "usbd_config_td_sleep()".
Affected files ...
.. //depot/projects/usb/src/sys/dev/usb/if_ural.c#6 edit
.. //depot/projects/usb/src/sys/dev/usb/usb_subr.c#11 edit
.. //depot/projects/usb/src/sys/dev/usb/usb_subr.h#16 edit
Differences ...
==== //depot/projects/usb/src/sys/dev/usb/if_ural.c#6 (text+ko) ====
@@ -178,9 +178,6 @@
ural_newstate_cb(struct ieee80211com *ic, enum ieee80211_state nstate, int arg);
static void
-ural_cfg_sleep(struct ural_softc *sc, u_int32_t timeout);
-
-static void
ural_tx_bcn_complete(struct ural_softc *sc);
static void
@@ -1917,23 +1914,6 @@
*========================================================================*/
static void
-ural_cfg_sleep(struct ural_softc *sc, u_int32_t timeout)
-{
- int error;
-
- if (timeout == 0) {
- timeout = 1;
- }
-
- error = msleep(sc, &(sc->sc_mtx), 0,
- "ural delay sleep", timeout);
-
- usbd_config_td_check_gone(&(sc->sc_config_td));
-
- return;
-}
-
-static void
ural_tx_bcn_complete(struct ural_softc *sc)
{
if (sc->sc_bcn_mbuf) {
@@ -2107,7 +2087,7 @@
ural_cfg_read(sc, RAL_STA_CSR0);
/* wait a little */
- ural_cfg_sleep(sc, hz/100);
+ usbd_config_td_sleep(&(sc->sc_config_td), hz/100);
ural_cfg_disable_rf_tune(sc);
}
@@ -2489,7 +2469,7 @@
if (ural_cfg_bbp_read(sc, RAL_BBP_VERSION) != 0) {
break;
}
- ural_cfg_sleep(sc, hz/100);
+ usbd_config_td_sleep(&(sc->sc_config_td), hz/100);
} else {
printf("%s: timeout waiting for BBP\n",
sc->sc_name);
@@ -2574,7 +2554,7 @@
(RAL_BBP_AWAKE | RAL_RF_AWAKE)) {
break;
}
- ural_cfg_sleep(sc, hz/100);
+ usbd_config_td_sleep(&(sc->sc_config_td), hz/100);
} else {
printf("%s: timeout waiting for "
"BBP/RF to wakeup\n", sc->sc_name);
==== //depot/projects/usb/src/sys/dev/usb/usb_subr.c#11 (text+ko) ====
@@ -2612,3 +2612,29 @@
}
return;
}
+
+/*------------------------------------------------------------------------*
+ * usbd_config_td_sleep
+ *
+ * NOTE: this function can only be called from the config thread
+ *------------------------------------------------------------------------*/
+void
+usbd_config_td_sleep(struct usbd_config_td *ctd, u_int32_t timeout)
+{
+ register int error;
+
+ if (timeout == 0) {
+ /* zero means no timeout,
+ * so avoid that by setting
+ * timeout to one:
+ */
+ timeout = 1;
+ }
+
+ error = msleep(ctd, ctd->p_mtx, 0,
+ "config td sleep", timeout);
+
+ usbd_config_td_check_gone(ctd);
+
+ return;
+}
==== //depot/projects/usb/src/sys/dev/usb/usb_subr.h#16 (text+ko) ====
@@ -772,6 +772,9 @@
void
usbd_config_td_check_gone(struct usbd_config_td *ctd);
+void
+usbd_config_td_sleep(struct usbd_config_td *ctd, u_int32_t timeout);
+
/* routines from usb.c */
#if 0
More information about the p4-projects
mailing list