• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ cam_sim_free函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中cam_sim_free函数的典型用法代码示例。如果您正苦于以下问题:C++ cam_sim_free函数的具体用法?C++ cam_sim_free怎么用?C++ cam_sim_free使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了cam_sim_free函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: vpo_attach

/*
 * vpo_attach()
 */
static int
vpo_attach(device_t dev)
{
	struct vpo_data *vpo = DEVTOSOFTC(dev);
	struct cam_devq *devq;
	int error;

	/* low level attachment */
	if (vpo->vpo_isplus) {
		if ((error = imm_attach(&vpo->vpo_io)))
			return (error);
	} else {
		if ((error = vpoio_attach(&vpo->vpo_io)))
			return (error);
	}

	/*
	**	Now tell the generic SCSI layer
	**	about our bus.
	*/
	devq = cam_simq_alloc(/*maxopenings*/1);
	/* XXX What about low-level detach on error? */
	if (devq == NULL)
		return (ENXIO);

	vpo->sim = cam_sim_alloc(vpo_action, vpo_poll, "vpo", vpo,
				 device_get_unit(dev),
				 /*untagged*/1, /*tagged*/0, devq);
	if (vpo->sim == NULL) {
		cam_simq_free(devq);
		return (ENXIO);
	}

	if (xpt_bus_register(vpo->sim, /*bus*/0) != CAM_SUCCESS) {
		cam_sim_free(vpo->sim, /*free_devq*/TRUE);
		return (ENXIO);
	}

	if (xpt_create_path(&vpo->path, /*periph*/NULL,
			    cam_sim_path(vpo->sim), CAM_TARGET_WILDCARD,
			    CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
		xpt_bus_deregister(cam_sim_path(vpo->sim));
		cam_sim_free(vpo->sim, /*free_devq*/TRUE);
		return (ENXIO);
	}

	/* all went ok */

	return (0);
}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:53,代码来源:vpo.c


示例2: mpt_cam_attach

void
mpt_cam_attach(mpt_softc_t *mpt)
{
	struct cam_devq *devq;
	struct cam_sim *sim;
	int maxq;

	mpt->bus = 0;
	maxq = (mpt->mpt_global_credits < MPT_MAX_REQUESTS(mpt))?
	    mpt->mpt_global_credits : MPT_MAX_REQUESTS(mpt);


	/*
	 * Create the device queue for our SIM(s).
	 */
	
	devq = cam_simq_alloc(maxq);
	if (devq == NULL) {
		return;
	}

	/*
	 * Construct our SIM entry.
	 */
	sim = cam_sim_alloc(mpt_action, mpt_poll, "mpt", mpt,
	    mpt->unit, 1, maxq, devq);
	if (sim == NULL) {
		cam_simq_free(devq);
		return;
	}

	/*
	 * Register exactly the bus.
	 */

	if (xpt_bus_register(sim, 0) != CAM_SUCCESS) {
		cam_sim_free(sim, TRUE);
		return;
	}

	if (xpt_create_path(&mpt->path, NULL, cam_sim_path(sim),
	    CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
		xpt_bus_deregister(cam_sim_path(sim));
		cam_sim_free(sim, TRUE);
		return;
	}
	mpt->sim = sim;
}
开发者ID:MarginC,项目名称:kame,代码行数:48,代码来源:mpt_freebsd.c


示例3: aac_cam_attach

/*
 * Register the driver as a CAM SIM
 */
static int
aac_cam_attach(device_t dev)
{
    struct cam_devq *devq;
    struct cam_sim *sim;
    struct cam_path *path;
    struct aac_cam *camsc;
    struct aac_sim *inf;

    fwprintf(NULL, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "");

    camsc = (struct aac_cam *)device_get_softc(dev);
    inf = (struct aac_sim *)device_get_ivars(dev);
    camsc->inf = inf;

    devq = cam_simq_alloc(inf->TargetsPerBus);
    if (devq == NULL)
        return (EIO);

    sim = cam_sim_alloc(aac_cam_action, aac_cam_poll, "aacp", camsc,
                        device_get_unit(dev), &inf->aac_sc->aac_io_lock, 1, 1, devq);
    if (sim == NULL) {
        cam_simq_free(devq);
        return (EIO);
    }

    /* Since every bus has it's own sim, every bus 'appears' as bus 0 */
    mtx_lock(&inf->aac_sc->aac_io_lock);
    if (xpt_bus_register(sim, dev, 0) != CAM_SUCCESS) {
        cam_sim_free(sim, TRUE);
        mtx_unlock(&inf->aac_sc->aac_io_lock);
        return (EIO);
    }

    if (xpt_create_path(&path, NULL, cam_sim_path(sim),
                        CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
        xpt_bus_deregister(cam_sim_path(sim));
        cam_sim_free(sim, TRUE);
        mtx_unlock(&inf->aac_sc->aac_io_lock);
        return (EIO);
    }
    mtx_unlock(&inf->aac_sc->aac_io_lock);

    camsc->sim = sim;
    camsc->path = path;

    return (0);
}
开发者ID:oza,项目名称:FreeBSD-7.3-dyntick,代码行数:51,代码来源:aac_cam.c


示例4: amr_cam_detach

/********************************************************************************
 * Disconnect ourselves from CAM
 */
static int
amr_cam_detach(device_t dev)
{
	struct amr_softc *sc;
	int		chn;

	sc = device_get_softc(dev);
	mtx_lock(&sc->amr_list_lock);
	for (chn = 0; chn < sc->amr_maxchan; chn++) {
		/*
		 * If a sim was allocated for this channel, free it
		 */
		if (sc->amr_cam_sim[chn] != NULL) {
			xpt_bus_deregister(cam_sim_path(sc->amr_cam_sim[chn]));
			cam_sim_free(sc->amr_cam_sim[chn], FALSE);
		}
	}
	mtx_unlock(&sc->amr_list_lock);

	/* Now free the devq */
	if (sc->amr_cam_devq != NULL)
		cam_simq_free(sc->amr_cam_devq);

	return (0);
}
开发者ID:AhmadTux,项目名称:freebsd,代码行数:28,代码来源:amr_cam.c


示例5: amr_cam_detach

/********************************************************************************
 * Disconnect ourselves from CAM
 */
static int
amr_cam_detach(device_t dev)
{
	struct amr_softc *sc;
	int		chn;

	sc = device_get_softc(dev);
	lockmgr(&sc->amr_list_lock, LK_EXCLUSIVE);
	for (chn = 0; chn < sc->amr_maxchan; chn++) {
		/*
		 * If a sim was allocated for this channel, free it
		 */
		if (sc->amr_cam_sim[chn] != NULL) {
			xpt_bus_deregister(cam_sim_path(sc->amr_cam_sim[chn]));
			cam_sim_free(sc->amr_cam_sim[chn]);
		}
	}
	lockmgr(&sc->amr_list_lock, LK_RELEASE);

	/* Now free the devq */
	if (sc->amr_cam_devq != NULL)
		cam_simq_release(sc->amr_cam_devq);

	return (0);
}
开发者ID:varialus,项目名称:DragonFlyX,代码行数:28,代码来源:amr_cam.c


示例6: mly_cam_detach

/********************************************************************************
 * Detach from CAM
 */
void
mly_cam_detach(struct mly_softc *sc)
{
    int		chn, nchn, first;

    debug_called(1);

    nchn = sc->mly_controllerinfo->physical_channels_present +
	sc->mly_controllerinfo->virtual_channels_present;

    /*
     * Iterate over channels, deregistering as we go.
     */
    nchn = sc->mly_controllerinfo->physical_channels_present +
	sc->mly_controllerinfo->virtual_channels_present;
    for (chn = 0, first = 1; chn < nchn; chn++) {

	/*
	 * If a sim was registered for this channel, free it.
	 */
	if (sc->mly_cam_sim[chn] != NULL) {
	    debug(1, "deregister bus %d", chn);
	    xpt_bus_deregister(cam_sim_path(sc->mly_cam_sim[chn]));
	    debug(1, "free sim for channel %d (%sfree queue)", chn, first ? "" : "don't ");
	    cam_sim_free(sc->mly_cam_sim[chn], first ? TRUE : FALSE);
	    first = 0;
	}
    }
}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:32,代码来源:mly_cam.c


示例7: aha_attach

int
aha_attach(struct aha_softc *aha)
{
	int tagged_dev_openings;
	struct cam_devq *devq;

	/*
	 * We don't do tagged queueing, since the aha cards don't
	 * support it.
	 */
	tagged_dev_openings = 0;

	/*
	 * Create the device queue for our SIM.
	 */
	devq = cam_simq_alloc(aha->max_ccbs - 1);
	if (devq == NULL)
		return (ENOMEM);

	/*
	 * Construct our SIM entry
	 */
	aha->sim = cam_sim_alloc(ahaaction, ahapoll, "aha", aha,
	    device_get_unit(aha->dev), &aha->lock, 2, tagged_dev_openings,
	    devq);
	if (aha->sim == NULL) {
		cam_simq_free(devq);
		return (ENOMEM);
	}
	mtx_lock(&aha->lock);
	if (xpt_bus_register(aha->sim, aha->dev, 0) != CAM_SUCCESS) {
		cam_sim_free(aha->sim, /*free_devq*/TRUE);
		mtx_unlock(&aha->lock);
		return (ENXIO);
	}
	if (xpt_create_path(&aha->path, /*periph*/NULL, cam_sim_path(aha->sim),
	    CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
		xpt_bus_deregister(cam_sim_path(aha->sim));
		cam_sim_free(aha->sim, /*free_devq*/TRUE);
		mtx_unlock(&aha->lock);
		return (ENXIO);
	}
	mtx_unlock(&aha->lock);

	return (0);
}
开发者ID:2trill2spill,项目名称:freebsd,代码行数:46,代码来源:aha.c


示例8: 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);
}
开发者ID:victoredwardocallaghan,项目名称:DragonFlyBSD,代码行数:25,代码来源:mrsas_cam.c


示例9: 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;
	}
}
开发者ID:MarginC,项目名称:kame,代码行数:10,代码来源:mpt_freebsd.c


示例10: 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 */
	}
}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:18,代码来源:twa_cam.c


示例11: 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);
}
开发者ID:Alkzndr,项目名称:freebsd,代码行数:25,代码来源:mrsas_cam.c


示例12: 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);
}
开发者ID:2trill2spill,项目名称:freebsd,代码行数:12,代码来源:aha.c


示例13: 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);
}
开发者ID:dcui,项目名称:FreeBSD-9.3_kernel,代码行数:13,代码来源:tws_cam.c


示例14: 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);
}
开发者ID:kusumi,项目名称:DragonFlyBSD,代码行数:13,代码来源:tws_cam.c


示例15: 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);
}
开发者ID:derekmarcotte,项目名称:freebsd,代码行数:14,代码来源:nvme_sim.c


示例16: amr_cam_detach

/********************************************************************************
 * Disconnect ourselves from CAM
 */
void
amr_cam_detach(struct amr_softc *sc)
{
    int		chn, first;

    for (chn = 0, first = 1; chn < sc->amr_maxchan; chn++) {

	/*
	 * If a sim was allocated for this channel, free it
	 */
	if (sc->amr_cam_sim[chn] != NULL) {
	    xpt_bus_deregister(cam_sim_path(sc->amr_cam_sim[chn]));
	    cam_sim_free(sc->amr_cam_sim[chn], first ? TRUE : FALSE);
	    first = 0;
	}
    }
}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:20,代码来源:amr_cam.c


示例17: 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);
}
开发者ID:2trill2spill,项目名称:freebsd,代码行数:25,代码来源:tw_osl_cam.c


示例18: vpo_attach

/*
 * vpo_attach()
 */
static int
vpo_attach(device_t dev)
{
	struct vpo_data *vpo = DEVTOSOFTC(dev);
	device_t ppbus = device_get_parent(dev);
	struct ppb_data *ppb = device_get_softc(ppbus);	/* XXX: layering */
	struct cam_devq *devq;
	int error;

	/* low level attachment */
	if (vpo->vpo_isplus) {
		if ((error = imm_attach(&vpo->vpo_io)))
			return (error);
	} else {
		if ((error = vpoio_attach(&vpo->vpo_io)))
			return (error);
	}

	/*
	**	Now tell the generic SCSI layer
	**	about our bus.
	*/
	devq = cam_simq_alloc(/*maxopenings*/1);
	/* XXX What about low-level detach on error? */
	if (devq == NULL)
		return (ENXIO);

	vpo->sim = cam_sim_alloc(vpo_action, vpo_poll, "vpo", vpo,
				 device_get_unit(dev), ppb->ppc_lock,
				 /*untagged*/1, /*tagged*/0, devq);
	if (vpo->sim == NULL) {
		cam_simq_free(devq);
		return (ENXIO);
	}

	ppb_lock(ppbus);
	if (xpt_bus_register(vpo->sim, dev, /*bus*/0) != CAM_SUCCESS) {
		cam_sim_free(vpo->sim, /*free_devq*/TRUE);
		ppb_unlock(ppbus);
		return (ENXIO);
	}
	ppb_unlock(ppbus);

	return (0);
}
开发者ID:dcui,项目名称:FreeBSD-9.3_kernel,代码行数:48,代码来源:vpo.c


示例19: mfip_detach

static int
mfip_detach(device_t dev)
{
    struct mfip_softc *sc;

    sc = device_get_softc(dev);
    if (sc == NULL)
        return (EINVAL);

    if (sc->sim != NULL) {
        lockmgr(&sc->mfi_sc->mfi_io_lock, LK_EXCLUSIVE);
        xpt_bus_deregister(cam_sim_path(sc->sim));
        cam_sim_free(sc->sim);
        lockmgr(&sc->mfi_sc->mfi_io_lock, LK_RELEASE);
    }

    return (0);
}
开发者ID:vishesh,项目名称:DragonFlyBSD,代码行数:18,代码来源:mfi_cam.c


示例20: vpo_attach

/*
 * vpo_attach()
 */
static int
vpo_attach(device_t dev)
{
	struct vpo_data *vpo = DEVTOSOFTC(dev);
	struct cam_devq *devq;
	int error;

	/* low level attachment */
	if (vpo->vpo_isplus) {
		if ((error = imm_attach(&vpo->vpo_io)))
			return (error);
	} else {
		if ((error = vpoio_attach(&vpo->vpo_io)))
			return (error);
	}

	/*
	**	Now tell the generic SCSI layer
	**	about our bus.
	*/
	devq = cam_simq_alloc(/*maxopenings*/1);
	/* XXX What about low-level detach on error? */
	if (devq == NULL)
		return (ENXIO);

	vpo->sim = cam_sim_alloc(vpo_action, vpo_poll, "vpo", vpo,
				 device_get_unit(dev), &sim_mplock,
				 /*untagged*/1, /*tagged*/0, devq);
	cam_simq_release(devq);
	if (vpo->sim == NULL) {
		return (ENXIO);
	}

	if (xpt_bus_register(vpo->sim, /*bus*/0) != CAM_SUCCESS) {
		cam_sim_free(vpo->sim);
		return (ENXIO);
	}

	/* all went ok */

	vpo_cam_rescan(vpo);	/* have CAM rescan the bus */

	return (0);
}
开发者ID:Gwenio,项目名称:DragonFlyBSD,代码行数:47,代码来源:vpo.c



注:本文中的cam_sim_free函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ cam_sim_path函数代码示例发布时间:2022-05-30
下一篇:
C++ cam_info函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap