本文整理汇总了C++中xpt_free_path函数的典型用法代码示例。如果您正苦于以下问题:C++ xpt_free_path函数的具体用法?C++ xpt_free_path怎么用?C++ xpt_free_path使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了xpt_free_path函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ptinit
static void
ptinit(void)
{
cam_status status;
struct cam_path *path;
/*
* Install a global async callback. This callback will
* receive async callbacks like "new device found".
*/
status = xpt_create_path(&path, /*periph*/NULL, CAM_XPT_PATH_ID,
CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD);
if (status == CAM_REQ_CMP) {
struct ccb_setasync csa;
xpt_setup_ccb(&csa.ccb_h, path, /*priority*/5);
csa.ccb_h.func_code = XPT_SASYNC_CB;
csa.event_enable = AC_FOUND_DEVICE;
csa.callback = ptasync;
csa.callback_arg = NULL;
xpt_action((union ccb *)&csa);
status = csa.ccb_h.status;
xpt_free_path(path);
}
if (status != CAM_REQ_CMP) {
printf("pt: Failed to attach master async callback "
"due to status 0x%x!\n", status);
}
}
示例2: mpt_cam_detach
void
mpt_cam_detach(mpt_softc_t *mpt)
{
if (mpt->sim != NULL) {
xpt_free_path(mpt->path);
xpt_bus_deregister(cam_sim_path(mpt->sim));
cam_sim_free(mpt->sim, TRUE);
mpt->sim = NULL;
}
}
示例3: mrsas_cam_detach
/**
* mrsas_cam_detach: De-allocates and teardown CAM
* input: Adapter instance soft state
*
* De-registers and frees the paths and SIMs.
*/
void mrsas_cam_detach(struct mrsas_softc *sc)
{
if (sc->ev_tq != NULL)
taskqueue_free(sc->ev_tq);
mtx_lock(&sc->sim_lock);
if (sc->path_0)
xpt_free_path(sc->path_0);
if (sc->sim_0) {
xpt_bus_deregister(cam_sim_path(sc->sim_0));
cam_sim_free(sc->sim_0, FALSE);
}
if (sc->path_1)
xpt_free_path(sc->path_1);
if (sc->sim_1) {
xpt_bus_deregister(cam_sim_path(sc->sim_1));
cam_sim_free(sc->sim_1, TRUE);
}
mtx_unlock(&sc->sim_lock);
}
示例4: mrsas_cam_detach
/**
* mrsas_cam_detach: De-allocates and teardown CAM
* input: Adapter instance soft state
*
* De-registers and frees the paths and SIMs.
*/
void mrsas_cam_detach(struct mrsas_softc *sc)
{
if (sc->ev_tq != NULL)
taskqueue_free(sc->ev_tq);
lockmgr(&sc->sim_lock, LK_EXCLUSIVE);
if (sc->path_0)
xpt_free_path(sc->path_0);
if (sc->sim_0) {
xpt_bus_deregister(cam_sim_path(sc->sim_0));
cam_sim_free(sc->sim_0);
}
if (sc->path_1)
xpt_free_path(sc->path_1);
if (sc->sim_1) {
xpt_bus_deregister(cam_sim_path(sc->sim_1));
cam_sim_free(sc->sim_1);
}
lockmgr(&sc->sim_lock, LK_RELEASE);
}
示例5: twa_cam_detach
/*
* Function name: twa_cam_detach
* Description: Detaches the driver from CAM.
*
* Input: sc -- ptr to per ctlr structure
* Output: None
* Return value: None
*/
void
twa_cam_detach(struct twa_softc *sc)
{
if (sc->twa_path)
xpt_free_path(sc->twa_path);
if (sc->twa_sim) {
xpt_bus_deregister(cam_sim_path(sc->twa_sim));
cam_sim_free(sc->twa_sim, TRUE); /* passing TRUE will free the devq as well */
}
}
示例6: aha_detach
int
aha_detach(struct aha_softc *aha)
{
mtx_lock(&aha->lock);
xpt_async(AC_LOST_DEVICE, aha->path, NULL);
xpt_free_path(aha->path);
xpt_bus_deregister(cam_sim_path(aha->sim));
cam_sim_free(aha->sim, /*free_devq*/TRUE);
mtx_unlock(&aha->lock);
/* XXX: Drain all timers? */
return (0);
}
示例7: twa_bus_scan_cb
/*
* Function name: twa_bus_scan_cb
* Description: Callback from CAM on a bus scan request.
*
* Input: periph -- we don't use this
* ccb -- bus scan request ccb that we sent to CAM
* Output: None
* Return value: None
*/
static void
twa_bus_scan_cb(struct cam_periph *periph, union ccb *ccb)
{
twa_dbg_print(3, "ccb = %p\n", ccb);
if (ccb->ccb_h.status != CAM_REQ_CMP)
printf("cam_scan_callback: failure status = %x\n",
ccb->ccb_h.status);
else
twa_dbg_print(3, "success");
xpt_free_path(ccb->ccb_h.path);
free(ccb, M_TEMP);
}
示例8: tws_cam_detach
void
tws_cam_detach(struct tws_softc *sc)
{
TWS_TRACE_DEBUG(sc, "entry", 0, 0);
mtx_lock(&sc->sim_lock);
if (sc->path)
xpt_free_path(sc->path);
if (sc->sim) {
xpt_bus_deregister(cam_sim_path(sc->sim));
cam_sim_free(sc->sim, TRUE);
}
mtx_unlock(&sc->sim_lock);
}
示例9: tws_cam_detach
void
tws_cam_detach(struct tws_softc *sc)
{
TWS_TRACE_DEBUG(sc, "entry", 0, 0);
lockmgr(&sc->sim_lock, LK_EXCLUSIVE);
if (sc->path)
xpt_free_path(sc->path);
if (sc->sim) {
xpt_bus_deregister(cam_sim_path(sc->sim));
cam_sim_free(sc->sim);
}
lockmgr(&sc->sim_lock, LK_RELEASE);
}
示例10: ic_lost_target
void
ic_lost_target(isc_session_t *sp, int target)
{
debug_called(8);
sdebug(2, "lost target=%d", target);
if(sp->cam_path != NULL) {
mtx_lock(&sp->cam_mtx);
xpt_async(AC_LOST_DEVICE, sp->cam_path, NULL);
xpt_free_path(sp->cam_path);
mtx_unlock(&sp->cam_mtx);
sp->cam_path = 0; // XXX
}
}
示例11: twa_bus_scan_cb
/*
* Function name: twa_bus_scan_cb
* Description: Callback from CAM on a bus scan request.
*
* Input: periph -- we don't use this
* ccb -- bus scan request ccb that we sent to CAM
* Output: None
* Return value: None
*/
static TW_VOID
twa_bus_scan_cb(struct cam_periph *periph, union ccb *ccb)
{
tw_osli_dbg_printf(3, "entering");
if (ccb->ccb_h.status != CAM_REQ_CMP)
kprintf("cam_scan_callback: failure status = %x\n",
ccb->ccb_h.status);
else
tw_osli_dbg_printf(3, "success");
xpt_free_path(ccb->ccb_h.path);
kfree(ccb, M_TEMP);
}
示例12: nvme_sim_controller_fail
static void
nvme_sim_controller_fail(void *ctrlr_arg)
{
struct nvme_sim_softc *sc = ctrlr_arg;
struct nvme_controller *ctrlr = sc->s_ctrlr;
mtx_lock(&ctrlr->lock);
xpt_async(AC_LOST_DEVICE, sc->s_path, NULL);
xpt_free_path(sc->s_path);
xpt_bus_deregister(cam_sim_path(sc->s_sim));
cam_sim_free(sc->s_sim, /*free_devq*/TRUE);
mtx_unlock(&ctrlr->lock);
free(sc, M_NVME);
}
示例13: isci_remote_device_release_lun_queue
void
isci_remote_device_release_lun_queue(struct ISCI_REMOTE_DEVICE *remote_device,
lun_id_t lun)
{
if (remote_device->frozen_lun_mask & (1 << lun)) {
struct cam_path *path;
remote_device->frozen_lun_mask &= ~(1 << lun);
xpt_create_path(&path, NULL,
cam_sim_path(remote_device->domain->controller->sim),
remote_device->index, lun);
xpt_release_devq(path, 1, TRUE);
xpt_free_path(path);
}
}
示例14: mly_find_periph
/********************************************************************************
* Find a peripheral attahed at (bus),(target)
*/
static struct cam_periph *
mly_find_periph(struct mly_softc *sc, int bus, int target)
{
struct cam_periph *periph;
struct cam_path *path;
int status;
status = xpt_create_path(&path, NULL, cam_sim_path(sc->mly_cam_sim[bus]), target, 0);
if (status == CAM_REQ_CMP) {
periph = cam_periph_find(path, NULL);
xpt_free_path(path);
} else {
periph = NULL;
}
return(periph);
}
示例15: tw_osli_cam_detach
/*
* Function name: tw_osli_cam_detach
* Description: Detaches the driver from CAM.
*
* Input: sc -- ptr to OSL internal ctlr context
* Output: None
* Return value: None
*/
TW_VOID
tw_osli_cam_detach(struct twa_softc *sc)
{
tw_osli_dbg_dprintf(3, sc, "entered");
mtx_lock(sc->sim_lock);
if (sc->path)
xpt_free_path(sc->path);
if (sc->sim) {
xpt_bus_deregister(cam_sim_path(sc->sim));
/* Passing TRUE to cam_sim_free will free the devq as well. */
cam_sim_free(sc->sim, TRUE);
}
/* It's ok have 1 hold count while destroying the mutex */
mtx_destroy(sc->sim_lock);
}