Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/mpt/mpt_raid.c
Show First 20 Lines • Show All 290 Lines • ▼ Show 20 Lines | mpt_raid_attach(struct mpt_softc *mpt) | ||||
handler.reply_handler = mpt_raid_reply_handler; | handler.reply_handler = mpt_raid_reply_handler; | ||||
error = mpt_register_handler(mpt, MPT_HANDLER_REPLY, handler, | error = mpt_register_handler(mpt, MPT_HANDLER_REPLY, handler, | ||||
&raid_handler_id); | &raid_handler_id); | ||||
if (error != 0) { | if (error != 0) { | ||||
mpt_prt(mpt, "Unable to register RAID haandler!\n"); | mpt_prt(mpt, "Unable to register RAID haandler!\n"); | ||||
goto cleanup; | goto cleanup; | ||||
} | } | ||||
xpt_setup_ccb(&csa.ccb_h, mpt->path, 5); | xpt_setup_stack_ccb(&csa.ccb_h, sizeof(csa), mpt->path, 5); | ||||
csa.ccb_h.func_code = XPT_SASYNC_CB; | csa.ccb_h.func_code = XPT_SASYNC_CB; | ||||
csa.event_enable = AC_FOUND_DEVICE; | csa.event_enable = AC_FOUND_DEVICE; | ||||
csa.callback = mpt_raid_async; | csa.callback = mpt_raid_async; | ||||
csa.callback_arg = mpt; | csa.callback_arg = mpt; | ||||
xpt_action((union ccb *)&csa); | xpt_action((union ccb *)&csa); | ||||
if (csa.ccb_h.status != CAM_REQ_CMP) { | if (csa.ccb_h.status != CAM_REQ_CMP) { | ||||
mpt_prt(mpt, "mpt_raid_attach: Unable to register " | mpt_prt(mpt, "mpt_raid_attach: Unable to register " | ||||
"CAM async handler.\n"); | "CAM async handler.\n"); | ||||
Show All 23 Lines | mpt_raid_detach(struct mpt_softc *mpt) | ||||
mpt_callout_drain(mpt, &mpt->raid_timer); | mpt_callout_drain(mpt, &mpt->raid_timer); | ||||
MPT_LOCK(mpt); | MPT_LOCK(mpt); | ||||
mpt_terminate_raid_thread(mpt); | mpt_terminate_raid_thread(mpt); | ||||
handler.reply_handler = mpt_raid_reply_handler; | handler.reply_handler = mpt_raid_reply_handler; | ||||
mpt_deregister_handler(mpt, MPT_HANDLER_REPLY, handler, | mpt_deregister_handler(mpt, MPT_HANDLER_REPLY, handler, | ||||
raid_handler_id); | raid_handler_id); | ||||
xpt_setup_ccb(&csa.ccb_h, mpt->path, /*priority*/5); | xpt_setup_stack_ccb(&csa.ccb_h, sizeof(csa), mpt->path, 5); | ||||
csa.ccb_h.func_code = XPT_SASYNC_CB; | csa.ccb_h.func_code = XPT_SASYNC_CB; | ||||
csa.event_enable = 0; | csa.event_enable = 0; | ||||
csa.callback = mpt_raid_async; | csa.callback = mpt_raid_async; | ||||
csa.callback_arg = mpt; | csa.callback_arg = mpt; | ||||
xpt_action((union ccb *)&csa); | xpt_action((union ccb *)&csa); | ||||
MPT_UNLOCK(mpt); | MPT_UNLOCK(mpt); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 718 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
static void | static void | ||||
mpt_adjust_queue_depth(struct mpt_softc *mpt, struct mpt_raid_volume *mpt_vol, | mpt_adjust_queue_depth(struct mpt_softc *mpt, struct mpt_raid_volume *mpt_vol, | ||||
struct cam_path *path) | struct cam_path *path) | ||||
{ | { | ||||
struct ccb_relsim crs; | struct ccb_relsim crs; | ||||
xpt_setup_ccb(&crs.ccb_h, path, /*priority*/5); | xpt_setup_stack_ccb(&crs.ccb_h, sizeof(crs), path, 5); | ||||
crs.ccb_h.func_code = XPT_REL_SIMQ; | crs.ccb_h.func_code = XPT_REL_SIMQ; | ||||
crs.ccb_h.flags = CAM_DEV_QFREEZE; | crs.ccb_h.flags = CAM_DEV_QFREEZE; | ||||
crs.release_flags = RELSIM_ADJUST_OPENINGS; | crs.release_flags = RELSIM_ADJUST_OPENINGS; | ||||
crs.openings = mpt->raid_queue_depth; | crs.openings = mpt->raid_queue_depth; | ||||
xpt_action((union ccb *)&crs); | xpt_action((union ccb *)&crs); | ||||
if (crs.ccb_h.status != CAM_REQ_CMP) | if (crs.ccb_h.status != CAM_REQ_CMP) | ||||
mpt_vol_prt(mpt, mpt_vol, "mpt_adjust_queue_depth failed " | mpt_vol_prt(mpt, mpt_vol, "mpt_adjust_queue_depth failed " | ||||
"with CAM status %#x\n", crs.ccb_h.status); | "with CAM status %#x\n", crs.ccb_h.status); | ||||
▲ Show 20 Lines • Show All 756 Lines • Show Last 20 Lines |