summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorps <ps@FreeBSD.org>2004-06-21 21:56:57 +0000
committerps <ps@FreeBSD.org>2004-06-21 21:56:57 +0000
commitf0bec239ac00b9fbe9ceb1c27f1ebe4376ccc076 (patch)
tree0fd7eced49f7629f6f0b2339cbac2591b8d72b0a /sys
parent545024cdd961696ed1a368de74a2f90d74e2e92c (diff)
downloadFreeBSD-src-f0bec239ac00b9fbe9ceb1c27f1ebe4376ccc076.zip
FreeBSD-src-f0bec239ac00b9fbe9ceb1c27f1ebe4376ccc076.tar.gz
There is no need to call ciss_media_accept async anymore since all
notify events are handled in a kthread.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ciss/ciss.c58
1 files changed, 16 insertions, 42 deletions
diff --git a/sys/dev/ciss/ciss.c b/sys/dev/ciss/ciss.c
index 37adb2c..ae2f61d 100644
--- a/sys/dev/ciss/ciss.c
+++ b/sys/dev/ciss/ciss.c
@@ -129,9 +129,7 @@ static int ciss_filter_physical(struct ciss_softc *sc, struct ciss_lun_report *c
static int ciss_identify_logical(struct ciss_softc *sc, struct ciss_ldrive *ld);
static int ciss_get_ldrive_status(struct ciss_softc *sc, struct ciss_ldrive *ld);
static int ciss_update_config(struct ciss_softc *sc);
-static int ciss_accept_media(struct ciss_softc *sc, struct ciss_ldrive *ld,
- int async);
-static void ciss_accept_media_complete(struct ciss_request *cr);
+static int ciss_accept_media(struct ciss_softc *sc, struct ciss_ldrive *ld);
static void ciss_free(struct ciss_softc *sc);
static void ciss_spawn_notify_thread(struct ciss_softc *sc);
static void ciss_kill_notify_thread(struct ciss_softc *sc);
@@ -1114,7 +1112,7 @@ ciss_init_logical(struct ciss_softc *sc)
* If the drive has had media exchanged, we should bring it online.
*/
if (ld->cl_lstatus->media_exchanged)
- ciss_accept_media(sc, ld, 0);
+ ciss_accept_media(sc, ld);
}
}
@@ -1536,17 +1534,17 @@ ciss_update_config(struct ciss_softc *sc)
* could make sure it's not open right now.
*/
static int
-ciss_accept_media(struct ciss_softc *sc, struct ciss_ldrive *ld, int async)
+ciss_accept_media(struct ciss_softc *sc, struct ciss_ldrive *ld)
{
struct ciss_request *cr;
struct ciss_command *cc;
struct ciss_bmic_cdb *cbc;
- int error, ldrive;
+ int command_status;
+ int error = 0, ldrive;
ldrive = CISS_LUN_TO_TARGET(ld->cl_address.logical.lun);
- debug(0, "bringing logical drive %d back online %ssynchronously",
- ldrive, async ? "a" : "");
+ debug(0, "bringing logical drive %d back online");
/*
* Build a CISS BMIC command to bring the drive back online.
@@ -1560,42 +1558,14 @@ ciss_accept_media(struct ciss_softc *sc, struct ciss_ldrive *ld, int async)
cbc->log_drive = ldrive;
/*
- * Dispatch the request asynchronously if we can't sleep waiting
- * for it to complete.
+ * Submit the request and wait for it to complete.
*/
- if (async) {
- cr->cr_complete = ciss_accept_media_complete;
- if ((error = ciss_start(cr)) != 0)
- goto out;
- return(0);
- } else {
- /*
- * Submit the request and wait for it to complete.
- */
- if ((error = ciss_synch_request(cr, 60 * 1000)) != 0) {
- ciss_printf(sc, "error sending BMIC LSTATUS command (%d)\n", error);
- goto out;
- }
+ if ((error = ciss_synch_request(cr, 60 * 1000)) != 0) {
+ ciss_printf(sc, "error sending BMIC ACCEPT MEDIA command (%d)\n", error);
+ goto out;
}
/*
- * Call the completion callback manually.
- */
- ciss_accept_media_complete(cr);
- return(0);
-
-out:
- if (cr != NULL)
- ciss_release_request(cr);
- return(error);
-}
-
-static void
-ciss_accept_media_complete(struct ciss_request *cr)
-{
- int command_status;
-
- /*
* Check response.
*/
ciss_report_request(cr, &command_status, NULL);
@@ -1608,7 +1578,11 @@ ciss_accept_media_complete(struct ciss_request *cr)
ciss_name_command_status(command_status));
break;
}
- ciss_release_request(cr);
+
+out:
+ if (cr != NULL)
+ ciss_release_request(cr);
+ return(error);
}
/************************************************************************
@@ -3502,7 +3476,7 @@ ciss_notify_logical(struct ciss_softc *sc, struct ciss_notify *cn)
ciss_name_device(sc, bus, target);
ciss_printf(sc, "logical drive %d (%s) media exchanged, ready to go online\n",
cn->data.logical_status.logical_drive, ld->cl_name);
- ciss_accept_media(sc, ld, 1);
+ ciss_accept_media(sc, ld);
break;
case 2:
OpenPOWER on IntegriCloud