Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/smartpqi/smartpqi_cam.c
Show First 20 Lines • Show All 1,134 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
void | void | ||||
smartpqi_adjust_queue_depth(struct cam_path *path, uint32_t queue_depth) | smartpqi_adjust_queue_depth(struct cam_path *path, uint32_t queue_depth) | ||||
{ | { | ||||
struct ccb_relsim crs; | struct ccb_relsim crs; | ||||
DBG_INFO("IN\n"); | DBG_INFO("IN\n"); | ||||
memset(&crs, 0, sizeof(crs)); | |||||
xpt_setup_ccb(&crs.ccb_h, path, 5); | xpt_setup_ccb(&crs.ccb_h, 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 = queue_depth; | crs.openings = 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) { | ||||
printf("XPT_REL_SIMQ failed stat=%d\n", crs.ccb_h.status); | printf("XPT_REL_SIMQ failed stat=%d\n", crs.ccb_h.status); | ||||
▲ Show 20 Lines • Show All 106 Lines • ▼ Show 20 Lines | if (xpt_create_path(&ccb->ccb_h.path, NULL, | ||||
mtx_unlock(&softs->os_specific.cam_lock); | mtx_unlock(&softs->os_specific.cam_lock); | ||||
return ENXIO; | return ENXIO; | ||||
} | } | ||||
/* | /* | ||||
* Callback to set the queue depth per target which is | * Callback to set the queue depth per target which is | ||||
* derived from the FW. | * derived from the FW. | ||||
*/ | */ | ||||
softs->os_specific.path = ccb->ccb_h.path; | softs->os_specific.path = ccb->ccb_h.path; | ||||
memset(&csa, 0, sizeof(csa)); | |||||
xpt_setup_ccb(&csa.ccb_h, softs->os_specific.path, 5); | xpt_setup_ccb(&csa.ccb_h, softs->os_specific.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 = smartpqi_async; | csa.callback = smartpqi_async; | ||||
csa.callback_arg = softs; | csa.callback_arg = softs; | ||||
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) { | ||||
DBG_ERR("Unable to register smartpqi_aysnc handler: %d!\n", | DBG_ERR("Unable to register smartpqi_aysnc handler: %d!\n", | ||||
Show All 16 Lines | deregister_sim(struct pqisrc_softstate *softs) | ||||
DBG_FUNC("IN\n"); | DBG_FUNC("IN\n"); | ||||
if (softs->os_specific.mtx_init) { | if (softs->os_specific.mtx_init) { | ||||
mtx_lock(&softs->os_specific.cam_lock); | mtx_lock(&softs->os_specific.cam_lock); | ||||
} | } | ||||
memset(&csa, 0, sizeof(csa)); | |||||
xpt_setup_ccb(&csa.ccb_h, softs->os_specific.path, 5); | xpt_setup_ccb(&csa.ccb_h, softs->os_specific.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 = smartpqi_async; | csa.callback = smartpqi_async; | ||||
csa.callback_arg = softs; | csa.callback_arg = softs; | ||||
xpt_action((union ccb *)&csa); | xpt_action((union ccb *)&csa); | ||||
xpt_free_path(softs->os_specific.path); | xpt_free_path(softs->os_specific.path); | ||||
▲ Show 20 Lines • Show All 47 Lines • Show Last 20 Lines |