当前位置: 首页>>代码示例>>C++>>正文


C++ config_detach函数代码示例

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


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

示例1: uhidev_detach

int
uhidev_detach(struct device *self, int flags)
{
	struct uhidev_softc *sc = (struct uhidev_softc *)self;
	int i, rv;

	DPRINTF(("uhidev_detach: sc=%p flags=%d\n", sc, flags));

	sc->sc_dying = 1;
	if (sc->sc_ipipe != NULL)
		usbd_abort_pipe(sc->sc_ipipe);

	if (sc->sc_repdesc != NULL)
		free(sc->sc_repdesc, M_USBDEV);

	rv = 0;
	for (i = 0; i < sc->sc_nrepid; i++) {
		if (sc->sc_subdevs[i] != NULL) {
			rv |= config_detach(&sc->sc_subdevs[i]->sc_dev, flags);
			sc->sc_subdevs[i] = NULL;
		}
	}

	usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
			   &sc->sc_dev);

	return (rv);
}
开发者ID:7shi,项目名称:openbsd-loongson-vc,代码行数:28,代码来源:uhidev.c

示例2: uticom_detach

int
uticom_detach(struct device *self, int flags)
{
	struct uticom_softc *sc = (struct uticom_softc *)self;

	DPRINTF(("%s: uticom_detach: sc = %p\n",
	    sc->sc_dev.dv_xname, sc));
	sc->sc_dying = 1;

	if (sc->sc_subdev != NULL) {
		config_detach(sc->sc_subdev, flags);
		sc->sc_subdev = NULL;
	}

	if (sc->sc_intr_pipe != NULL) {
		usbd_abort_pipe(sc->sc_intr_pipe);
		usbd_close_pipe(sc->sc_intr_pipe);
		free(sc->sc_intr_buf, M_USBDEV);
		sc->sc_intr_pipe = NULL;
	}

	usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
	    &sc->sc_dev);
	return (0);
}
开发者ID:repos-holder,项目名称:openbsd-patches,代码行数:25,代码来源:uticom.c

示例3: uhidev_detach

int
uhidev_detach(device_t self, int flags)
{
	struct uhidev_softc *sc = device_private(self);
	int i, rv;
	struct uhidev *csc;

	DPRINTF(("uhidev_detach: sc=%p flags=%d\n", sc, flags));

	sc->sc_dying = 1;
	if (sc->sc_ipipe != NULL)
		usbd_abort_pipe(sc->sc_ipipe);

	if (sc->sc_repdesc != NULL)
		kmem_free(sc->sc_repdesc, sc->sc_repdesc_size);

	rv = 0;
	for (i = 0; i < sc->sc_nrepid; i++) {
		if (sc->sc_subdevs[i] != NULL) {
			csc = device_private(sc->sc_subdevs[i]);
			rnd_detach_source(&csc->rnd_source);
			rv |= config_detach(sc->sc_subdevs[i], flags);
		}
	}

	usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev, sc->sc_dev);

	pmf_device_deregister(self);
	mutex_destroy(&sc->sc_lock);

	return rv;
}
开发者ID:ryo,项目名称:netbsd-src,代码行数:32,代码来源:uhidev.c

示例4: ubsa_detach

int 
ubsa_detach(device_t self, int flags)
{
	struct ubsa_softc *sc = device_private(self);
	int i;
	int rv = 0;


	DPRINTF(("ubsa_detach: sc = %p\n", sc));

	if (sc->sc_intr_pipe != NULL) {
		usbd_abort_pipe(sc->sc_intr_pipe);
		usbd_close_pipe(sc->sc_intr_pipe);
		free(sc->sc_intr_buf, M_USBDEV);
		sc->sc_intr_pipe = NULL;
	}

	sc->sc_dying = 1;
	for (i = 0; i < sc->sc_numif; i++) {
		if (sc->sc_subdevs[i] != NULL)
			rv |= config_detach(sc->sc_subdevs[i], flags);
	}

	usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
			   sc->sc_dev);

	return (rv);
}
开发者ID:eyberg,项目名称:rumpkernel-netbsd-src,代码行数:28,代码来源:ubsa.c

示例5: coram_detach

static int
coram_detach(device_t self, int flags)
{
	struct coram_softc *sc = device_private(self);
	struct coram_iic_softc *cic;
	unsigned int i;
	int error;

	error = coram_mpeg_detach(sc, flags);
	if (error)
		return error;

	if (sc->sc_tuner)
		mt2131_close(sc->sc_tuner);
	if (sc->sc_demod)
		cx24227_close(sc->sc_demod);
	for (i = 0; i < I2C_NUM; i++) {
		cic = &sc->sc_iic[i];
		if (cic->cic_i2cdev)
			config_detach(cic->cic_i2cdev, flags);
		mutex_destroy(&cic->cic_busmutex);
	}
	pmf_device_deregister(self);

	if (sc->sc_mems)
		bus_space_unmap(sc->sc_memt, sc->sc_memh, sc->sc_mems);
	if (sc->sc_ih)
		pci_intr_disestablish(sc->sc_pc, sc->sc_ih);

	return 0;
}
开发者ID:RyanLucchese,项目名称:rumpkernel-netbsd-src,代码行数:31,代码来源:coram.c

示例6: auich_detach

static int
auich_detach(device_t self, int flags)
{
	struct auich_softc *sc = device_private(self);

	/* audio */
	if (sc->sc_audiodev != NULL)
		config_detach(sc->sc_audiodev, flags);

	/* sysctl */
	sysctl_teardown(&sc->sc_log);

	mutex_enter(&sc->sc_lock);

	/* audio_encoding_set */
	auconv_delete_encodings(sc->sc_encodings);
	auconv_delete_encodings(sc->sc_spdif_encodings);

	/* ac97 */
	if (sc->codec_if != NULL)
		sc->codec_if->vtbl->detach(sc->codec_if);

	mutex_exit(&sc->sc_lock);
	mutex_destroy(&sc->sc_lock);
	mutex_destroy(&sc->sc_intr_lock);

	/* PCI */
	if (sc->sc_ih != NULL)
		pci_intr_disestablish(sc->sc_pc, sc->sc_ih);
	if (sc->mix_size != 0)
		bus_space_unmap(sc->iot, sc->mix_ioh, sc->mix_size);
	if (sc->aud_size != 0)
		bus_space_unmap(sc->iot, sc->aud_ioh, sc->aud_size);
	return 0;
}
开发者ID:RyanLucchese,项目名称:rumpkernel-netbsd-src,代码行数:35,代码来源:auich.c

示例7: puc_cardbus_detach

int
puc_cardbus_detach(struct device *self, int flags)
{
    struct puc_cardbus_softc *sc = (struct puc_cardbus_softc *)self;
    struct puc_softc *psc = &sc->sc_psc;
    struct cardbus_devfunc *ct = sc->ct;
    int i, rv;

    for (i = PUC_MAX_PORTS; i--; ) {
        if (psc->sc_ports[i].intrhand)
            cardbus_intr_disestablish(ct->ct_cc, ct->ct_cf,
                                      psc->sc_ports[i].intrhand);
        if (psc->sc_ports[i].dev)
            if ((rv = config_detach(psc->sc_ports[i].dev, flags)))
                return (rv);
    }

    for (i = PUC_NBARS; i--; )
        if (psc->sc_bar_mappings[i].mapped)
            Cardbus_mapreg_unmap(ct, psc->sc_bar_mappings[i].type,
                                 psc->sc_bar_mappings[i].t,
                                 psc->sc_bar_mappings[i].h,
                                 psc->sc_bar_mappings[i].s);

    return (0);
}
开发者ID:alenichev,项目名称:openbsd-kernel,代码行数:26,代码来源:puc_cardbus.c

示例8: umct_detach

int
umct_detach(struct device *self, int flags)
{
	struct umct_softc *sc = (struct umct_softc *)self;
	int rv = 0;

	DPRINTF(("umct_detach: sc=%p flags=%d\n", sc, flags));

        if (sc->sc_intr_pipe != NULL) {
                usbd_abort_pipe(sc->sc_intr_pipe);
                usbd_close_pipe(sc->sc_intr_pipe);
		free(sc->sc_intr_buf, M_USBDEV);
                sc->sc_intr_pipe = NULL;
        }

	sc->sc_dying = 1;
	if (sc->sc_subdev != NULL) {
		rv = config_detach(sc->sc_subdev, flags);
		sc->sc_subdev = NULL;
	}

	usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
			   &sc->sc_dev);

	return (rv);
}
开发者ID:repos-holder,项目名称:openbsd-patches,代码行数:26,代码来源:umct.c

示例9: hilmsdetach

int
hilmsdetach(struct device *self, int flags)
{
	struct hilms_softc *sc = (void *)self;

	if (sc->sc_wsmousedev != NULL)
		return config_detach(sc->sc_wsmousedev, flags);

	return (0);
}
开发者ID:avsm,项目名称:openbsd-xen-sys,代码行数:10,代码来源:hilms.c

示例10: auvitek_video_detach

int
auvitek_video_detach(struct auvitek_softc *sc, int flags)
{
	if (sc->sc_videodev != NULL) {
		config_detach(sc->sc_videodev, flags);
		sc->sc_videodev = NULL;
	}

	return 0;
}
开发者ID:eyberg,项目名称:rumpkernel-netbsd-src,代码行数:10,代码来源:auvitek_video.c

示例11: hilmsdetach

int
hilmsdetach(device_t self, int flags)
{
	struct hilms_softc *sc = device_private(self);

	if (sc->sc_wsmousedev != NULL)
		return config_detach(sc->sc_wsmousedev, flags);

	return 0;
}
开发者ID:eyberg,项目名称:rumpkernel-netbsd-src,代码行数:10,代码来源:hilms.c

示例12: hilempty

/*
 * Called after the loop has been unplugged. We simply force detach of
 * all our children.
 */
void
hilempty(struct hil_softc *sc)
{
	u_int8_t db;
	int id, s;
	u_int oldmaxdev;

	s = splhil();

	/*
	 * Wait for the loop to be stable.
	 */
	for (;;) {
		if (send_hil_cmd(sc, HIL_READLPSTAT, NULL, 0, &db) == 0) {
			if (db & (LPS_CONFFAIL | LPS_CONFGOOD))
				break;
		} else {
			db = LPS_CONFFAIL;
			break;
		}
	}

	if (db & LPS_CONFFAIL) {
		sc->sc_maxdev = 0;
	} else {
		db = 0;
		send_hil_cmd(sc, HIL_READLPSTAT, NULL, 0, &db);
		oldmaxdev = sc->sc_maxdev;
		sc->sc_maxdev = db & LPS_DEVMASK;

		if (sc->sc_maxdev != 0) {
			/*
			 * The loop was not unplugged after all, but its
			 * configuration has changed.
			 */
			hilconfig(sc, oldmaxdev);
			return;
		}
	}

	/*
	 * Now detach all hil devices.
	 */
	for (id = sc->sc_maxdev + 1; id < NHILD; id++) {
		if (sc->sc_devices[id] != NULL)
			config_detach((struct device *)sc->sc_devices[id],
			    DETACH_FORCE);
		sc->sc_devices[id] = NULL;
	}

	sc->sc_cmdbp = sc->sc_cmdbuf;

	splx(s);
}
开发者ID:avsm,项目名称:openbsd-xen-sys,代码行数:58,代码来源:hil.c

示例13: ubcmtp_detach

int
ubcmtp_detach(struct device *self, int flags)
{
	struct ubcmtp_softc *sc = (struct ubcmtp_softc *)self;
	int ret = 0;

	if (sc->sc_wsmousedev != NULL)
		ret = config_detach(sc->sc_wsmousedev, flags);

	return (ret);
}
开发者ID:orumin,项目名称:openbsd-efivars,代码行数:11,代码来源:ubcmtp.c

示例14: uhidev_detach

int
uhidev_detach(struct device *self, int flags)
{
	struct uhidev_softc *sc = (struct uhidev_softc *)self;
	int i, rv = 0;

	DPRINTF(("uhidev_detach: sc=%p flags=%d\n", sc, flags));

	if (sc->sc_opipe != NULL) {
		usbd_abort_pipe(sc->sc_opipe);
		usbd_close_pipe(sc->sc_opipe);
		sc->sc_opipe = NULL;
	}

	if (sc->sc_ipipe != NULL) {
		usbd_abort_pipe(sc->sc_ipipe);
		usbd_close_pipe(sc->sc_ipipe);
		sc->sc_ipipe = NULL;
	}

	if (sc->sc_repdesc != NULL)
		free(sc->sc_repdesc, M_USBDEV);

	/*
	 * XXX Check if we have only one children claiming all the Report
	 * IDs, this is a hack since we need a dev -> Report ID mapping
	 * for uhidev_intr().
	 */
	if (sc->sc_nrepid > 1 && sc->sc_subdevs[0] != NULL &&
	    sc->sc_subdevs[0] == sc->sc_subdevs[1])
		return (config_detach(&sc->sc_subdevs[0]->sc_dev, flags));

	for (i = 0; i < sc->sc_nrepid; i++) {
		if (sc->sc_subdevs[i] != NULL) {
			rv |= config_detach(&sc->sc_subdevs[i]->sc_dev, flags);
			sc->sc_subdevs[i] = NULL;
		}
	}

	return (rv);
}
开发者ID:appleorange1,项目名称:bitrig,代码行数:41,代码来源:uhidev.c

示例15: bthidev_detach

int
bthidev_detach(struct device *self, int flags)
{
	struct bthidev_softc *sc = (struct bthidev_softc *)self;
	struct bthidev *hidev;

	mutex_enter(&bt_lock);
	sc->sc_flags = 0;	/* disable reconnecting */

	/* release interrupt listen */
	if (sc->sc_int_l != NULL) {
		l2cap_detach(&sc->sc_int_l);
		sc->sc_int_l = NULL;
	}

	/* release control listen */
	if (sc->sc_ctl_l != NULL) {
		l2cap_detach(&sc->sc_ctl_l);
		sc->sc_ctl_l = NULL;
	}

	/* close interrupt channel */
	if (sc->sc_int != NULL) {
		l2cap_disconnect(sc->sc_int, 0);
		l2cap_detach(&sc->sc_int);
		sc->sc_int = NULL;
	}

	/* close control channel */
	if (sc->sc_ctl != NULL) {
		l2cap_disconnect(sc->sc_ctl, 0);
		l2cap_detach(&sc->sc_ctl);
		sc->sc_ctl = NULL;
	}

	/* remove timeout */
	timeout_del(&sc->sc_reconnect);

	mutex_exit(&bt_lock);

	/* detach children */
	while ((hidev = LIST_FIRST(&sc->sc_list)) != NULL) {
		LIST_REMOVE(hidev, sc_next);
		config_detach(&hidev->sc_dev, flags);
	}

	/* release descriptor */
	if (sc->sc_desc != NULL) {
		free(sc->sc_desc, M_BTHIDEV);
		sc->sc_desc = NULL;
	}
	return 0;
}
开发者ID:appleorange1,项目名称:bitrig,代码行数:53,代码来源:bthidev.c


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