summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorNick Hibma <n_hibma@FreeBSD.org>2002-04-11 10:34:15 +0000
committerNick Hibma <n_hibma@FreeBSD.org>2002-04-11 10:34:15 +0000
commitb2f485ca0dbfca064f32eb7788c5177384dc2238 (patch)
tree7e4f3351f48b817d9f9bfe04b74dc83b6e9b42f1 /sys/dev
parent31c41f1b1ed0fb9c6d469d084f680bf34ee3ab0e (diff)
Notes
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/umass.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/sys/dev/usb/umass.c b/sys/dev/usb/umass.c
index c458daef2517..4a4df6a478b4 100644
--- a/sys/dev/usb/umass.c
+++ b/sys/dev/usb/umass.c
@@ -517,7 +517,7 @@ Static void umass_cam_quirk_cb (struct umass_softc *sc, void *priv,
Static void umass_cam_rescan_callback
(struct cam_periph *periph,union ccb *ccb);
-Static void umass_cam_rescan (struct umass_softc *sc);
+Static void umass_cam_rescan (void *addr);
Static int umass_cam_attach_sim (void);
Static int umass_cam_attach (struct umass_softc *sc);
@@ -2097,8 +2097,13 @@ umass_cam_rescan_callback(struct cam_periph *periph, union ccb *ccb)
}
Static void
-umass_cam_rescan(struct umass_softc *sc)
+umass_cam_rescan(void *addr)
{
+ /* Note: The sc is only passed in for debugging prints. If the device
+ * is disconnected before umass_cam_rescan has been able to run the
+ * driver might bomb.
+ */
+ struct umass_softc *sc = (struct umass_softc *) addr;
struct cam_path *path;
union ccb *ccb = malloc(sizeof(union ccb), M_USBDEV, M_WAITOK);
@@ -2155,7 +2160,11 @@ umass_cam_attach(struct umass_softc *sc)
* after booting has completed, when interrupts have been
* enabled.
*/
- umass_cam_rescan(sc);
+
+ /* XXX This will bomb if the driver is unloaded between attach
+ * and execution of umass_cam_rescan.
+ */
+ timeout(umass_cam_rescan, sc, MS_TO_TICKS(200));
}
return(0); /* always succesfull */