summaryrefslogtreecommitdiffstats
path: root/sys/dev/aac/aac_cam.c
diff options
context:
space:
mode:
authorscottl <scottl@FreeBSD.org>2003-02-06 03:31:02 +0000
committerscottl <scottl@FreeBSD.org>2003-02-06 03:31:02 +0000
commit6fd61c14bdaabd0dd53881ba3efe6bc68a8c479a (patch)
tree3d89609d113c56c4e3d009ce7becf17276907d01 /sys/dev/aac/aac_cam.c
parent5ae8784f591a10e3b022a4ffacdfdcbd6af17e32 (diff)
downloadFreeBSD-src-6fd61c14bdaabd0dd53881ba3efe6bc68a8c479a.zip
FreeBSD-src-6fd61c14bdaabd0dd53881ba3efe6bc68a8c479a.tar.gz
Teach the CAM module how to deregister itself so it can be unloaded.
Diffstat (limited to 'sys/dev/aac/aac_cam.c')
-rw-r--r--sys/dev/aac/aac_cam.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/dev/aac/aac_cam.c b/sys/dev/aac/aac_cam.c
index 92bb5e8..e1874be 100644
--- a/sys/dev/aac/aac_cam.c
+++ b/sys/dev/aac/aac_cam.c
@@ -104,7 +104,6 @@ MALLOC_DEFINE(M_AACCAM, "aaccam", "AAC CAM info");
static int
aac_cam_probe(device_t dev)
{
-
debug_called(2);
return (0);
@@ -113,9 +112,17 @@ aac_cam_probe(device_t dev)
static int
aac_cam_detach(device_t dev)
{
+ struct aac_cam *camsc;
debug_called(2);
- return (EBUSY);
+ camsc = (struct aac_cam *)device_get_softc(dev);
+
+ xpt_async(AC_LOST_DEVICE, camsc->path, NULL);
+ xpt_free_path(camsc->path);
+ xpt_bus_deregister(cam_sim_path(camsc->sim));
+ cam_sim_free(camsc->sim, /*free_devq*/TRUE);
+
+ return (0);
}
/*
OpenPOWER on IntegriCloud