aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/mpt
diff options
context:
space:
mode:
authorMatt Jacob <mjacob@FreeBSD.org>2006-09-27 15:30:46 +0000
committerMatt Jacob <mjacob@FreeBSD.org>2006-09-27 15:30:46 +0000
commit4797dec88c288194a7e8a42af50afea804f50805 (patch)
tree36291aab0be8c97db0020d4cd915b50972b77abd /sys/dev/mpt
parentcc39792119638c91f072a44f78746d777b53bc30 (diff)
Notes
Diffstat (limited to 'sys/dev/mpt')
-rw-r--r--sys/dev/mpt/mpt_cam.c34
1 files changed, 32 insertions, 2 deletions
diff --git a/sys/dev/mpt/mpt_cam.c b/sys/dev/mpt/mpt_cam.c
index 4b25fdacd6ef..8beaa408fa68 100644
--- a/sys/dev/mpt/mpt_cam.c
+++ b/sys/dev/mpt/mpt_cam.c
@@ -2148,10 +2148,40 @@ mpt_cam_event(struct mpt_softc *mpt, request_t *req,
break;
case MPI_EVENT_QUEUE_FULL:
{
+ struct cam_sim *sim;
+ struct cam_path *tmppath;
+ struct ccb_relsim crs;
PTR_EVENT_DATA_QUEUE_FULL pqf =
(PTR_EVENT_DATA_QUEUE_FULL) msg->Data;
- mpt_prt(mpt, "QUEUE_FULL: Bus 0x%02x Target 0x%02x Depth %d\n",
- pqf->Bus, pqf->TargetID, pqf->CurrentDepth);
+ lun_id_t lun_id;
+
+ mpt_prt(mpt, "QUEUE FULL EVENT: Bus 0x%02x Target 0x%02x Depth "
+ "%d\n", pqf->Bus, pqf->TargetID, pqf->CurrentDepth);
+ if (mpt->phydisk_sim) {
+ sim = mpt->phydisk_sim;
+ } else {
+ sim = mpt->sim;
+ }
+ MPTLOCK_2_CAMLOCK(mpt);
+ for (lun_id = 0; lun_id < MPT_MAX_LUNS; lun_id++) {
+ if (xpt_create_path(&tmppath, NULL, cam_sim_path(sim),
+ pqf->TargetID, lun_id) != CAM_REQ_CMP) {
+ mpt_prt(mpt, "unable to create a path to send "
+ "XPT_REL_SIMQ");
+ CAMLOCK_2_MPTLOCK(mpt);
+ break;
+ }
+ xpt_setup_ccb(&crs.ccb_h, tmppath, 5);
+ crs.ccb_h.func_code = XPT_REL_SIMQ;
+ crs.release_flags = RELSIM_ADJUST_OPENINGS;
+ crs.openings = pqf->CurrentDepth - 1;
+ xpt_action((union ccb *)&crs);
+ if (crs.ccb_h.status != CAM_REQ_CMP) {
+ mpt_prt(mpt, "XPT_REL_SIMQ failed\n");
+ }
+ xpt_free_path(tmppath);
+ }
+ CAMLOCK_2_MPTLOCK(mpt);
break;
}
case MPI_EVENT_SAS_DEVICE_STATUS_CHANGE: