您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ xpt_create_path函数代码示例

51自学网 2021-06-03 11:50:39
  C++
这篇教程C++ xpt_create_path函数代码示例写得很实用,希望能帮到您。

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

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

示例1: mrsas_bus_scan

/* * mrsas_bus_scan:	Perform bus scan * input:			Adapter instance soft state * * This mrsas_bus_scan function is needed for FreeBSD 7.x.  Also, it should not * be called in FreeBSD 8.x and later versions, where the bus scan is * automatic. */intmrsas_bus_scan(struct mrsas_softc *sc){    union ccb *ccb_0;    union ccb *ccb_1;    if ((ccb_0 = xpt_alloc_ccb()) == NULL) {        return (ENOMEM);    }    if ((ccb_1 = xpt_alloc_ccb()) == NULL) {        xpt_free_ccb(ccb_0);        return (ENOMEM);    }    mtx_lock(&sc->sim_lock);    if (xpt_create_path(&ccb_0->ccb_h.path, xpt_periph, cam_sim_path(sc->sim_0),                        CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {        xpt_free_ccb(ccb_0);        xpt_free_ccb(ccb_1);        mtx_unlock(&sc->sim_lock);        return (EIO);    }    if (xpt_create_path(&ccb_1->ccb_h.path, xpt_periph, cam_sim_path(sc->sim_1),                        CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {        xpt_free_ccb(ccb_0);        xpt_free_ccb(ccb_1);        mtx_unlock(&sc->sim_lock);        return (EIO);    }    mtx_unlock(&sc->sim_lock);    xpt_rescan(ccb_0);    xpt_rescan(ccb_1);    return (0);}
开发者ID:chubbymaggie,项目名称:freebsd,代码行数:42,


示例2: mrsas_bus_scan

/* * mrsas_bus_scan:           Perform bus scan  * input:                    Adapter instance soft state   * * This mrsas_bus_scan function is needed for FreeBSD 7.x.  Also, it should * not be called in FreeBSD 8.x and later versions, where the bus scan is  * automatic.  */ int mrsas_bus_scan(struct mrsas_softc *sc){    union ccb *ccb_0;    union ccb *ccb_1;    lockmgr(&sc->sim_lock, LK_EXCLUSIVE);    if ((ccb_0 = xpt_alloc_ccb()) == NULL) {        lockmgr(&sc->sim_lock, LK_RELEASE);        return(ENOMEM);    }    if ((ccb_1 = xpt_alloc_ccb()) == NULL) {	xpt_free_ccb(ccb_0);        lockmgr(&sc->sim_lock, LK_RELEASE);        return(ENOMEM);    }     if (xpt_create_path(&ccb_0->ccb_h.path, xpt_periph, cam_sim_path(sc->sim_0),            CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP){        xpt_free_ccb(ccb_0);        xpt_free_ccb(ccb_1);        lockmgr(&sc->sim_lock, LK_RELEASE);        return(EIO);    }    if (xpt_create_path(&ccb_1->ccb_h.path, xpt_periph, cam_sim_path(sc->sim_1),            CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP){        xpt_free_ccb(ccb_0);        xpt_free_ccb(ccb_1);        lockmgr(&sc->sim_lock, LK_RELEASE);        return(EIO);    }    xpt_setup_ccb(&ccb_0->ccb_h, ccb_0->ccb_h.path, 5/*priority (low)*/);    ccb_0->ccb_h.func_code = XPT_SCAN_BUS;    ccb_0->ccb_h.cbfcnp = mrsas_rescan_callback;    ccb_0->crcn.flags = CAM_FLAG_NONE;    xpt_action(ccb_0); /* scan is now in progress */    xpt_setup_ccb(&ccb_1->ccb_h, ccb_1->ccb_h.path, 5/*priority (low)*/);    ccb_1->ccb_h.func_code = XPT_SCAN_BUS;    ccb_1->ccb_h.cbfcnp = mrsas_rescan_callback;    ccb_1->crcn.flags = CAM_FLAG_NONE;    xpt_action(ccb_1); /* scan is now in progress */    lockmgr(&sc->sim_lock, LK_RELEASE);    return(0);}
开发者ID:victoredwardocallaghan,项目名称:DragonFlyBSD,代码行数:57,


示例3: cfcs_onoffline

static voidcfcs_onoffline(void *arg, int online){	struct cfcs_softc *softc;	union ccb *ccb;	softc = (struct cfcs_softc *)arg;	mtx_lock(&softc->lock);	softc->online = online;	ccb = xpt_alloc_ccb_nowait();	if (ccb == NULL) {		printf("%s: unable to allocate CCB for rescan/n", __func__);		goto bailout;	}	if (xpt_create_path(&ccb->ccb_h.path, xpt_periph,			    cam_sim_path(softc->sim), CAM_TARGET_WILDCARD,			    CAM_LUN_WILDCARD) != CAM_REQ_CMP) {		printf("%s: can't allocate path for rescan/n", __func__);		xpt_free_ccb(ccb);		goto bailout;	}	xpt_rescan(ccb);bailout:	mtx_unlock(&softc->lock);}
开发者ID:ornarium,项目名称:freebsd,代码行数:29,


示例4: ptinit

static voidptinit(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);	}}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:31,


示例5: nvme_sim_new_ns

static void *nvme_sim_new_ns(struct nvme_namespace *ns, void *sc_arg){	struct nvme_sim_softc *sc = sc_arg;	struct nvme_controller *ctrlr = sc->s_ctrlr;	union ccb *ccb;	mtx_lock(&ctrlr->lock);	ccb = xpt_alloc_ccb_nowait();	if (ccb == NULL) {		printf("unable to alloc CCB for rescan/n");		return (NULL);	}	if (xpt_create_path(&ccb->ccb_h.path, /*periph*/NULL,	    cam_sim_path(sc->s_sim), 0, ns->id) != CAM_REQ_CMP) {		printf("unable to create path for rescan/n");		xpt_free_ccb(ccb);		return (NULL);	}	xpt_rescan(ccb);	mtx_unlock(&ctrlr->lock);	return (ns);}
开发者ID:derekmarcotte,项目名称:freebsd,代码行数:28,


示例6: ahci_cam_rescan

static voidahci_cam_rescan(struct ahci_port *ap){	struct cam_path *path;	union ccb *ccb;	int status;	int i;	if (ap->ap_flags & AP_F_SCAN_RUNNING) {		ap->ap_flags |= AP_F_SCAN_REQUESTED;		return;	}	ap->ap_flags |= AP_F_SCAN_RUNNING;	for (i = 0; i < AHCI_MAX_PMPORTS; ++i) {		ap->ap_ata[i]->at_features |= ATA_PORT_F_RESCAN;	}	status = xpt_create_path(&path, xpt_periph, cam_sim_path(ap->ap_sim),				 CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD);	if (status != CAM_REQ_CMP)		return;	ccb = xpt_alloc_ccb();	xpt_setup_ccb(&ccb->ccb_h, path, 5);	/* 5 = low priority */	ccb->ccb_h.func_code = XPT_ENG_EXEC;	ccb->ccb_h.cbfcnp = ahci_cam_rescan_callback;	ccb->ccb_h.sim_priv.entries[0].ptr = ap;	ccb->crcn.flags = CAM_FLAG_NONE;	xpt_action_async(ccb);}
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:30,


示例7: tws_bus_scan

inttws_bus_scan(struct tws_softc *sc){    struct cam_path *path;    union ccb       *ccb;    TWS_TRACE_DEBUG(sc, "entry", sc, 0);    KASSERT(sc->sim, ("sim not allocated"));    KKASSERT(lockstatus(&sc->sim_lock, curthread) != 0);    ccb = sc->scan_ccb;    if (xpt_create_path(&path, xpt_periph, cam_sim_path(sc->sim),                  CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {        /* lockmgr(&sc->sim_lock, LK_RELEASE); */        return(EIO);    }    xpt_setup_ccb(&ccb->ccb_h, path, 5);    ccb->ccb_h.func_code = XPT_SCAN_BUS;    ccb->ccb_h.cbfcnp = tws_bus_scan_cb;    ccb->crcn.flags = CAM_FLAG_NONE;    xpt_action(ccb);    return(0);}
开发者ID:kusumi,项目名称:DragonFlyBSD,代码行数:25,


示例8: tw_osli_request_bus_scan

/* * Function name:	tw_osli_request_bus_scan * Description:		Requests CAM for a scan of the bus. * * Input:		sc	-- ptr to per ctlr structure * Output:		None * Return value:	0	-- success *			non-zero-- failure */TW_INT32tw_osli_request_bus_scan(struct twa_softc *sc){	union ccb	*ccb;	tw_osli_dbg_dprintf(3, sc, "entering");	/* If we get here before sc->sim is initialized, return an error. */	if (!(sc->sim))		return(ENXIO);	if ((ccb = xpt_alloc_ccb()) == NULL)		return(ENOMEM);	lockmgr(sc->sim_lock, LK_EXCLUSIVE);	if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(sc->sim),	    CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {		xpt_free_ccb(ccb);		lockmgr(sc->sim_lock, LK_RELEASE);		return(EIO);	}	xpt_setup_ccb(&ccb->ccb_h, ccb->ccb_h.path, 5/*priority (low)*/);	ccb->ccb_h.func_code = XPT_SCAN_BUS;	ccb->ccb_h.cbfcnp = twa_bus_scan_cb;	ccb->crcn.flags = CAM_FLAG_NONE;	xpt_action(ccb);	lockmgr(sc->sim_lock, LK_RELEASE);	return(0);}
开发者ID:Gwenio,项目名称:DragonFlyBSD,代码行数:38,


示例9: isci_controller_domain_discovery_complete

void isci_controller_domain_discovery_complete(    struct ISCI_CONTROLLER *isci_controller, struct ISCI_DOMAIN *isci_domain){	if (!isci_controller->has_been_scanned)	{		/* Controller has not been scanned yet.  We'll clear		 *  the discovery bit for this domain, then check if all bits		 *  are now clear.  That would indicate that all domains are		 *  done with discovery and we can then proceed with initial		 *  scan.		 */		isci_controller->initial_discovery_mask &=		    ~(1 << isci_domain->index);		if (isci_controller->initial_discovery_mask == 0) {			struct isci_softc *driver = isci_controller->isci;			uint8_t next_index = isci_controller->index + 1;			isci_controller->has_been_scanned = TRUE;			/* Unfreeze simq to allow initial scan to proceed. */			xpt_release_simq(isci_controller->sim, TRUE);#if __FreeBSD_version < 800000			/* When driver is loaded after boot, we need to			 *  explicitly rescan here for versions <8.0, because			 *  CAM only automatically scans new buses at boot			 *  time.			 */			union ccb *ccb = xpt_alloc_ccb_nowait();			xpt_create_path(&ccb->ccb_h.path, xpt_periph,			    cam_sim_path(isci_controller->sim),			    CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD);			xpt_rescan(ccb);#endif			if (next_index < driver->controller_count) {				/*  There are more controllers that need to				 *   start.  So start the next one.				 */				isci_controller_start(				    &driver->controllers[next_index]);			}			else			{				/* All controllers have been started and completed discovery.				 *  Disestablish the config hook while will signal to the				 *  kernel during boot that it is safe to try to find and				 *  mount the root partition.				 */				config_intrhook_disestablish(				    &driver->config_hook);			}		}	}}
开发者ID:varanasisaigithub,项目名称:freebsd-1,代码行数:59,


示例10: vpo_attach

/* * vpo_attach() */static intvpo_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,


示例11: ahci_cam_changed

/* * The state of the port has changed. * * If atx is NULL the physical port has changed state. * If atx is non-NULL a particular target behind a PM has changed state. * * If found is -1 the target state must be queued to a non-interrupt context. * (only works with at == NULL). * * If found is 0 the target was removed. * If found is 1 the target was inserted. */voidahci_cam_changed(struct ahci_port *ap, struct ata_port *atx, int found){	struct cam_path *tmppath;	int status;	int target;	target = atx ? atx->at_target : CAM_TARGET_WILDCARD;	if (ap->ap_sim == NULL)		return;	if (found == CAM_TARGET_WILDCARD) {		status = xpt_create_path(&tmppath, NULL,					 cam_sim_path(ap->ap_sim),					 target, CAM_LUN_WILDCARD);		if (status != CAM_REQ_CMP)			return;		ahci_cam_rescan(ap);	} else {		status = xpt_create_path(&tmppath, NULL,					 cam_sim_path(ap->ap_sim),					 target,					 CAM_LUN_WILDCARD);		if (status != CAM_REQ_CMP)			return;#if 0		/*		 * This confuses CAM		 */		if (found)			xpt_async(AC_FOUND_DEVICE, tmppath, NULL);		else			xpt_async(AC_LOST_DEVICE, tmppath, NULL);#endif	}	xpt_free_path(tmppath);}
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:49,


示例12: isci_remote_device_release_lun_queue

voidisci_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);	}}
开发者ID:2asoft,项目名称:freebsd,代码行数:15,


示例13: aac_cam_attach

/* * Register the driver as a CAM SIM */static intaac_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,


示例14: mpt_cam_attach

voidmpt_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,


示例15: 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);}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:19,


示例16: aha_attach

intaha_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,


示例17: os_query_remove_device

int os_query_remove_device(void *osext, int id){	PVBUS_EXT				vbus_ext = (PVBUS_EXT)osext;	struct cam_periph		*periph = NULL;    struct cam_path			*path;    int						status,retval = 0;    status = xpt_create_path(&path, NULL, vbus_ext->sim->path_id, id, 0);    if (status == CAM_REQ_CMP) {		if((periph = cam_periph_find(path, "da")) != NULL){			if(periph->refcount >= 1)					retval = -1;		}		xpt_free_path(path);    }    return retval;}
开发者ID:AhmadTux,项目名称:freebsd,代码行数:18,


示例18: nvme_sim_new_controller

static void *nvme_sim_new_controller(struct nvme_controller *ctrlr){	struct nvme_sim_softc *sc;	struct cam_devq *devq;	int max_trans;	max_trans = ctrlr->max_hw_pend_io;	devq = cam_simq_alloc(max_trans);	if (devq == NULL)		return (NULL);	sc = malloc(sizeof(*sc), M_NVME, M_ZERO | M_WAITOK);	sc->s_ctrlr = ctrlr;	sc->s_sim = cam_sim_alloc(nvme_sim_action, nvme_sim_poll,	    "nvme", sc, device_get_unit(ctrlr->dev),	    &ctrlr->lock, max_trans, max_trans, devq);	if (sc->s_sim == NULL) {		printf("Failed to allocate a sim/n");		cam_simq_free(devq);		goto err1;	}	if (xpt_bus_register(sc->s_sim, ctrlr->dev, 0) != CAM_SUCCESS) {		printf("Failed to create a bus/n");		goto err2;	}	if (xpt_create_path(&sc->s_path, /*periph*/NULL, cam_sim_path(sc->s_sim),	    CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {		printf("Failed to create a path/n");		goto err3;	}	return (sc);err3:	xpt_bus_deregister(cam_sim_path(sc->s_sim));err2:	cam_sim_free(sc->s_sim, /*free_devq*/TRUE);err1:	free(sc, M_NVME);	return (NULL);}
开发者ID:derekmarcotte,项目名称:freebsd,代码行数:43,


示例19: twa_request_bus_scan

/* * Function name:	twa_request_bus_scan * Description:		Requests CAM for a scan of the bus. * * Input:		sc	-- ptr to per ctlr structure * Output:		None * Return value:	None */voidtwa_request_bus_scan(struct twa_softc *sc){	struct cam_path	*path;	union ccb	*ccb;	if ((ccb = malloc(sizeof(union ccb), M_TEMP, M_WAITOK)) == NULL)		return;	bzero(ccb, sizeof(union ccb));	if (xpt_create_path(&path, xpt_periph, cam_sim_path(sc->twa_sim),			CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP)		return;	xpt_setup_ccb(&ccb->ccb_h, path, 5);	ccb->ccb_h.func_code = XPT_SCAN_BUS;	ccb->ccb_h.cbfcnp = twa_bus_scan_cb;	ccb->crcn.flags = CAM_FLAG_NONE;	xpt_action(ccb);}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:27,


示例20: ahci_xpt_rescan

static voidahci_xpt_rescan(struct ahci_port *ap){	struct cam_path *path;	union ccb *ccb;	int status;	status = xpt_create_path(&path, xpt_periph, cam_sim_path(ap->ap_sim),				 CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD);	if (status != CAM_REQ_CMP)		return;	ccb = xpt_alloc_ccb();	xpt_setup_ccb(&ccb->ccb_h, path, 5);	/* 5 = low priority */	ccb->ccb_h.func_code = XPT_SCAN_BUS;	ccb->ccb_h.cbfcnp = ahci_cam_rescan_callback;	ccb->ccb_h.sim_priv.entries[0].ptr = ap;	ccb->crcn.flags = CAM_FLAG_NONE;	xpt_action_async(ccb);}
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:20,


示例21: vpo_cam_rescan

static voidvpo_cam_rescan(struct vpo_data *vpo){        struct cam_path *path;        union ccb *ccb = malloc(sizeof(union ccb), M_TEMP, M_WAITOK | M_ZERO);        if (xpt_create_path(&path, xpt_periph, cam_sim_path(vpo->sim), 0, 0)            != CAM_REQ_CMP) {		/* A failure is benign as the user can do a manual rescan */                return;	}        xpt_setup_ccb(&ccb->ccb_h, path, 5/*priority (low)*/);        ccb->ccb_h.func_code = XPT_SCAN_BUS;        ccb->ccb_h.cbfcnp = vpo_cam_rescan_callback;        ccb->crcn.flags = CAM_FLAG_NONE;        xpt_action(ccb);        /* The scan is in progress now. */}
开发者ID:MarginC,项目名称:kame,代码行数:20,


示例22: pmprelease

static voidpmprelease(struct cam_periph *periph, int mask){	struct pmp_softc *softc = (struct pmp_softc *)periph->softc;	struct cam_path *dpath;	int i;	mask &= softc->frozen;	for (i = 0; i < 15; i++) {		if ((mask & (1 << i)) == 0)			continue;		if (xpt_create_path(&dpath, periph,		    xpt_path_path_id(periph->path),		    i, 0) == CAM_REQ_CMP) {			softc->frozen &= ~(1 << i);			cam_release_devq(dpath, 0, 0, 0, FALSE);			xpt_release_device(dpath->device);			xpt_free_path(dpath);		}	}}
开发者ID:2trill2spill,项目名称:freebsd,代码行数:21,


示例23: pmponinvalidate

static voidpmponinvalidate(struct cam_periph *periph){	struct cam_path *dpath;	int i;	/*	 * De-register any async callbacks.	 */	xpt_register_async(0, pmpasync, periph, periph->path);	for (i = 0; i < 15; i++) {		if (xpt_create_path(&dpath, periph,		    xpt_path_path_id(periph->path),		    i, 0) == CAM_REQ_CMP) {			xpt_async(AC_LOST_DEVICE, dpath, NULL);			xpt_free_path(dpath);		}	}	pmprelease(periph, -1);}
开发者ID:2trill2spill,项目名称:freebsd,代码行数:21,


示例24: pmpfreeze

static voidpmpfreeze(struct cam_periph *periph, int mask){	struct pmp_softc *softc = (struct pmp_softc *)periph->softc;	struct cam_path *dpath;	int i;	mask &= ~softc->frozen;	for (i = 0; i < 15; i++) {		if ((mask & (1 << i)) == 0)			continue;		if (xpt_create_path(&dpath, periph,		    xpt_path_path_id(periph->path),		    i, 0) == CAM_REQ_CMP) {			softc->frozen |= (1 << i);			xpt_acquire_device(dpath->device);			cam_freeze_devq_arg(dpath,			    RELSIM_RELEASE_RUNLEVEL, CAM_RL_BUS + 1);			xpt_free_path(dpath);		}	}}
开发者ID:vkhromov,项目名称:freebsd,代码行数:22,


示例25: scif_cb_remote_device_ready

/** * @brief This callback method informs the framework user that the remote *        device is ready and capable of processing IO requests. * * @param[in]  controller This parameter specifies the controller object *             with which this callback is associated. * @param[in]  domain This parameter specifies the domain object with *             which this callback is associated. * @param[in]  remote_device This parameter specifies the device object with *             which this callback is associated. * * @return none */voidscif_cb_remote_device_ready(SCI_CONTROLLER_HANDLE_T controller,    SCI_DOMAIN_HANDLE_T domain, SCI_REMOTE_DEVICE_HANDLE_T remote_device){	struct ISCI_REMOTE_DEVICE *isci_remote_device =	    sci_object_get_association(remote_device);	struct ISCI_CONTROLLER *isci_controller =	    sci_object_get_association(controller);	uint32_t device_index = isci_remote_device->index;	if (isci_controller->remote_device[device_index] == NULL) {		/* This new device is now ready, so put it in the controller's		 *  remote device list so it is visible to CAM.		 */		isci_controller->remote_device[device_index] =		    isci_remote_device;		if (isci_controller->has_been_scanned) {			/* The sim object has been scanned at least once			 *  already.  In that case, create a CCB to instruct			 *  CAM to rescan this device.			 * If the sim object has not been scanned, this device			 *  will get scanned as part of the initial scan.			 */			union ccb *ccb = xpt_alloc_ccb_nowait();			xpt_create_path(&ccb->ccb_h.path, NULL,			    cam_sim_path(isci_controller->sim),			    isci_remote_device->index, CAM_LUN_WILDCARD);			xpt_rescan(ccb);		}	}	isci_remote_device_release_device_queue(isci_remote_device);}
开发者ID:2asoft,项目名称:freebsd,代码行数:49,


示例26: tw_osli_request_bus_scan

/* * Function name:	tw_osli_request_bus_scan * Description:		Requests CAM for a scan of the bus. * * Input:		sc	-- ptr to per ctlr structure * Output:		None * Return value:	0	-- success *			non-zero-- failure */TW_INT32tw_osli_request_bus_scan(struct twa_softc *sc){	union ccb	*ccb;	tw_osli_dbg_dprintf(3, sc, "entering");	/* If we get here before sc->sim is initialized, return an error. */	if (!(sc->sim))		return(ENXIO);	if ((ccb = xpt_alloc_ccb()) == NULL)		return(ENOMEM);	mtx_lock(sc->sim_lock);	if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(sc->sim),	    CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {		xpt_free_ccb(ccb);		mtx_unlock(sc->sim_lock);		return(EIO);	}	xpt_rescan(ccb);	mtx_unlock(sc->sim_lock);	return(0);}
开发者ID:2trill2spill,项目名称:freebsd,代码行数:33,



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


C++ xpt_free_path函数代码示例
C++ xpt_bus_deregister函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。