Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/pms/freebsd/driver/ini/src/agtiapi.c
Show First 20 Lines • Show All 464 Lines • ▼ Show 20 Lines | int agtiapi_getCardInfo ( struct agtiapi_softc *pCard, | ||||
pCardInfo->pciIOAddrUp = pCard->pCardInfo->pciIOAddrUp; | pCardInfo->pciIOAddrUp = pCard->pCardInfo->pciIOAddrUp; | ||||
pCardInfo->busNum =pci_get_bus(pCard->my_dev); | pCardInfo->busNum =pci_get_bus(pCard->my_dev); | ||||
return 0; | return 0; | ||||
} | } | ||||
void agtiapi_adjust_queue_depth(struct cam_path *path, bit32 QueueDepth) | void agtiapi_adjust_queue_depth(struct cam_path *path, bit32 QueueDepth) | ||||
{ | { | ||||
struct ccb_relsim crs; | struct ccb_relsim crs; | ||||
xpt_setup_ccb(&crs.ccb_h, path, 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 = QueueDepth; | crs.openings = QueueDepth; | ||||
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\n"); | printf("XPT_REL_SIMQ failed\n"); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 442 Lines • ▼ Show 20 Lines | #endif | ||||
{ | { | ||||
mtx_unlock( &thisCardInst->pmIOLock ); | mtx_unlock( &thisCardInst->pmIOLock ); | ||||
cam_sim_free( lsim, TRUE ); | cam_sim_free( lsim, TRUE ); | ||||
cam_simq_free( devq ); | cam_simq_free( devq ); | ||||
xpt_free_ccb(ccb); | xpt_free_ccb(ccb); | ||||
return( EIO ); | return( EIO ); | ||||
} | } | ||||
pmsc->path = ccb->ccb_h.path; | pmsc->path = ccb->ccb_h.path; | ||||
xpt_setup_ccb(&csa.ccb_h, pmsc->path, 5); | xpt_setup_stack_ccb(&csa.ccb_h, sizeof(csa), pmsc->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 = agtiapi_async; | csa.callback = agtiapi_async; | ||||
csa.callback_arg = pmsc; | csa.callback_arg = pmsc; | ||||
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) { | ||||
AGTIAPI_PRINTK("agtiapi_attach: Unable to register AC_FOUND_DEVICE\n" ); | AGTIAPI_PRINTK("agtiapi_attach: Unable to register AC_FOUND_DEVICE\n" ); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 5,599 Lines • ▼ Show 20 Lines | #endif | ||||
if (pCard->buffer_dmat != agNULL) | if (pCard->buffer_dmat != agNULL) | ||||
{ | { | ||||
bus_dma_tag_destroy(pCard->buffer_dmat); | bus_dma_tag_destroy(pCard->buffer_dmat); | ||||
} | } | ||||
if (pCard->sim != NULL) | if (pCard->sim != NULL) | ||||
{ | { | ||||
mtx_lock(&thisCardInst->pmIOLock); | mtx_lock(&thisCardInst->pmIOLock); | ||||
xpt_setup_ccb(&csa.ccb_h, pCard->path, 5); | xpt_setup_stack_ccb(&csa.ccb_h, sizeof(csa), pCard->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 = agtiapi_async; | csa.callback = agtiapi_async; | ||||
csa.callback_arg = pCard; | csa.callback_arg = pCard; | ||||
xpt_action((union ccb *)&csa); | xpt_action((union ccb *)&csa); | ||||
xpt_free_path(pCard->path); | xpt_free_path(pCard->path); | ||||
// if (pCard->ccbTotal == 0) | // if (pCard->ccbTotal == 0) | ||||
if (pCard->ccbTotal <= thisCard) | if (pCard->ccbTotal <= thisCard) | ||||
{ | { | ||||
/* | /* | ||||
no link up so that simq has not been released. | no link up so that simq has not been released. | ||||
In order to remove cam, we call this. | In order to remove cam, we call this. | ||||
*/ | */ | ||||
xpt_release_simq(pCard->sim, 1); | xpt_release_simq(pCard->sim, 1); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 75 Lines • Show Last 20 Lines |