这篇教程C++ usbd_abort_pipe函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中usbd_abort_pipe函数的典型用法代码示例。如果您正苦于以下问题:C++ usbd_abort_pipe函数的具体用法?C++ usbd_abort_pipe怎么用?C++ usbd_abort_pipe使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了usbd_abort_pipe函数的24个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: ucom_cleanupvoiducom_cleanup(struct ucom_softc *sc){ DPRINTF(("ucom_cleanup: closing pipes/n")); sc->sc_open = 0; ucom_shutdown(sc); if (sc->sc_bulkin_pipe != NULL) { usbd_abort_pipe(sc->sc_bulkin_pipe); usbd_close_pipe(sc->sc_bulkin_pipe); sc->sc_bulkin_pipe = NULL; } if (sc->sc_bulkout_pipe != NULL) { usbd_abort_pipe(sc->sc_bulkout_pipe); usbd_close_pipe(sc->sc_bulkout_pipe); sc->sc_bulkout_pipe = NULL; } if (sc->sc_ixfer != NULL) { if (sc->sc_uhidev == NULL) usbd_free_xfer(sc->sc_ixfer); sc->sc_ixfer = NULL; } if (sc->sc_oxfer != NULL) { usbd_free_buffer(sc->sc_oxfer); if (sc->sc_uhidev == NULL) usbd_free_xfer(sc->sc_oxfer); sc->sc_oxfer = NULL; }}
开发者ID:appleorange1,项目名称:bitrig,代码行数:30,
示例2: uirda_closeintuirda_close(void *h, int flag, int mode, struct lwp *l){ struct uirda_softc *sc = h; DPRINTF(("%s: sc=%p/n", __func__, sc)); if (sc->sc_rd_pipe != NULL) { usbd_abort_pipe(sc->sc_rd_pipe); usbd_close_pipe(sc->sc_rd_pipe); sc->sc_rd_pipe = NULL; } if (sc->sc_wr_pipe != NULL) { usbd_abort_pipe(sc->sc_wr_pipe); usbd_close_pipe(sc->sc_wr_pipe); sc->sc_wr_pipe = NULL; } if (sc->sc_rd_xfer != NULL) { usbd_free_xfer(sc->sc_rd_xfer); sc->sc_rd_xfer = NULL; sc->sc_rd_buf = NULL; } if (sc->sc_wr_xfer != NULL) { usbd_free_xfer(sc->sc_wr_xfer); sc->sc_wr_xfer = NULL; sc->sc_wr_buf = NULL; } return (0);}
开发者ID:NetBsdDriverProxy,项目名称:NetBsdDriverProxy,代码行数:31,
示例3: ulpt_detachintulpt_detach(struct device *self, int flags){ struct ulpt_softc *sc = (struct ulpt_softc *)self; int s; int maj, mn; DPRINTF(("ulpt_detach: sc=%p/n", sc)); if (sc->sc_out_pipe != NULL) usbd_abort_pipe(sc->sc_out_pipe); if (sc->sc_in_pipe != NULL) usbd_abort_pipe(sc->sc_in_pipe); s = splusb(); if (--sc->sc_refcnt >= 0) { /* There is noone to wake, aborting the pipe is enough */ /* Wait for processes to go away. */ usb_detach_wait(&sc->sc_dev); } splx(s); /* locate the major number */ for (maj = 0; maj < nchrdev; maj++) if (cdevsw[maj].d_open == ulptopen) break; /* Nuke the vnodes for any open instances (calls close). */ mn = self->dv_unit; vdevgone(maj, mn, mn, VCHR); vdevgone(maj, mn | ULPT_NOPRIME , mn | ULPT_NOPRIME, VCHR); return (0);}
开发者ID:appleorange1,项目名称:bitrig,代码行数:34,
示例4: ubcmtp_disablevoidubcmtp_disable(void *v){ struct ubcmtp_softc *sc = v; if (usbd_is_dying(sc->sc_udev) || !(sc->sc_status & UBCMTP_ENABLED)) return; sc->sc_status &= ~UBCMTP_ENABLED; ubcmtp_raw_mode(sc, 0); if (sc->sc_tp_pipe != NULL) { usbd_abort_pipe(sc->sc_tp_pipe); usbd_close_pipe(sc->sc_tp_pipe); sc->sc_tp_pipe = NULL; } if (sc->sc_bt_pipe != NULL) { usbd_abort_pipe(sc->sc_bt_pipe); usbd_close_pipe(sc->sc_bt_pipe); sc->sc_bt_pipe = NULL; } if (sc->tp_pkt != NULL) { free(sc->tp_pkt, M_USBDEV, 0); sc->tp_pkt = NULL; } if (sc->bt_pkt != NULL) { free(sc->bt_pkt, M_USBDEV, 0); sc->bt_pkt = NULL; }}
开发者ID:orumin,项目名称:openbsd-efivars,代码行数:32,
示例5: cdc_abort_data_pipesvoid cdc_abort_data_pipes(uwh_cdc_dev_h dev_ctx){ jcdc_dev_softc_t *sc = (jcdc_dev_softc_t *)dev_ctx; if (sc->bulk_pipe_in) usbd_abort_pipe(sc->bulk_pipe_in); if (sc->bulk_pipe_out) usbd_abort_pipe(sc->bulk_pipe_out);}
开发者ID:bgtwoigu,项目名称:1110,代码行数:10,
示例6: ugl_stop/* * Stop the adapter and free any mbufs allocated to the * RX and TX lists. */voidugl_stop(struct ugl_softc *sc){ struct ifnet *ifp; int i; DPRINTFN(10,("%s: %s: enter/n", sc->sc_dev.dv_xname,__func__)); ifp = GET_IFP(sc); ifp->if_timer = 0; ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); /* Stop transfers. */ if (sc->sc_ep[UGL_ENDPT_RX] != NULL) { usbd_abort_pipe(sc->sc_ep[UGL_ENDPT_RX]); usbd_close_pipe(sc->sc_ep[UGL_ENDPT_RX]); sc->sc_ep[UGL_ENDPT_RX] = NULL; } if (sc->sc_ep[UGL_ENDPT_TX] != NULL) { usbd_abort_pipe(sc->sc_ep[UGL_ENDPT_TX]); usbd_close_pipe(sc->sc_ep[UGL_ENDPT_TX]); sc->sc_ep[UGL_ENDPT_TX] = NULL; } if (sc->sc_ep[UGL_ENDPT_INTR] != NULL) { usbd_abort_pipe(sc->sc_ep[UGL_ENDPT_INTR]); usbd_close_pipe(sc->sc_ep[UGL_ENDPT_INTR]); sc->sc_ep[UGL_ENDPT_INTR] = NULL; } /* Free RX resources. */ for (i = 0; i < UGL_RX_LIST_CNT; i++) { if (sc->sc_cdata.ugl_rx_chain[i].ugl_mbuf != NULL) { m_freem(sc->sc_cdata.ugl_rx_chain[i].ugl_mbuf); sc->sc_cdata.ugl_rx_chain[i].ugl_mbuf = NULL; } if (sc->sc_cdata.ugl_rx_chain[i].ugl_xfer != NULL) { usbd_free_xfer(sc->sc_cdata.ugl_rx_chain[i].ugl_xfer); sc->sc_cdata.ugl_rx_chain[i].ugl_xfer = NULL; } } /* Free TX resources. */ for (i = 0; i < UGL_TX_LIST_CNT; i++) { if (sc->sc_cdata.ugl_tx_chain[i].ugl_mbuf != NULL) { m_freem(sc->sc_cdata.ugl_tx_chain[i].ugl_mbuf); sc->sc_cdata.ugl_tx_chain[i].ugl_mbuf = NULL; } if (sc->sc_cdata.ugl_tx_chain[i].ugl_xfer != NULL) { usbd_free_xfer(sc->sc_cdata.ugl_tx_chain[i].ugl_xfer); sc->sc_cdata.ugl_tx_chain[i].ugl_xfer = NULL; } }}
开发者ID:appleorange1,项目名称:bitrig,代码行数:59,
示例7: udsir_close/* ARGSUSED */static intudsir_close(void *h, int flag, int mode, struct lwp *l){ struct udsir_softc *sc = h; DPRINTFN(0, ("%s: sc=%p/n", __func__, sc)); sc->sc_refcnt++; sc->sc_rd_readinprogress = 1; sc->sc_closing = 1; wakeup(&sc->sc_thread); while (sc->sc_thread != NULL) tsleep(&sc->sc_closing, PWAIT, "usircl", 0); if (sc->sc_rd_pipe != NULL) { usbd_abort_pipe(sc->sc_rd_pipe); } if (sc->sc_wr_pipe != NULL) { usbd_abort_pipe(sc->sc_wr_pipe); } if (sc->sc_rd_xfer != NULL) { usbd_destroy_xfer(sc->sc_rd_xfer); sc->sc_rd_xfer = NULL; sc->sc_rd_buf = NULL; } if (sc->sc_wr_xfer != NULL) { usbd_destroy_xfer(sc->sc_wr_xfer); sc->sc_wr_xfer = NULL; sc->sc_wr_buf = NULL; } if (sc->sc_rd_pipe != NULL) { usbd_close_pipe(sc->sc_rd_pipe); sc->sc_rd_pipe = NULL; } if (sc->sc_wr_pipe != NULL) { usbd_close_pipe(sc->sc_wr_pipe); sc->sc_wr_pipe = NULL; } if (sc->sc_ur_buf != NULL) { kmem_free(sc->sc_ur_buf, IRDA_MAX_FRAME_SIZE); sc->sc_ur_buf = NULL; } if (--sc->sc_refcnt < 0) usb_detach_wakeupold(sc->sc_dev); return 0;}
开发者ID:ryo,项目名称:netbsd-src,代码行数:52,
示例8: ucom_detachintucom_detach(struct device *self, int flags){ struct ucom_softc *sc = (struct ucom_softc *)self; struct tty *tp = sc->sc_tty; int maj, mn; int s; DPRINTF(("ucom_detach: sc=%p flags=%d tp=%p, pipe=%d,%d/n", sc, flags, tp, sc->sc_bulkin_no, sc->sc_bulkout_no)); sc->sc_dying = 1; if (sc->sc_bulkin_pipe != NULL) usbd_abort_pipe(sc->sc_bulkin_pipe); if (sc->sc_bulkout_pipe != NULL) usbd_abort_pipe(sc->sc_bulkout_pipe); s = splusb(); if (--sc->sc_refcnt >= 0) { /* Wake up anyone waiting */ if (tp != NULL) { CLR(tp->t_state, TS_CARR_ON); CLR(tp->t_cflag, CLOCAL | MDMBUF); ttyflush(tp, FREAD|FWRITE); } /* Wait for processes to go away. */ usb_detach_wait(&sc->sc_dev); } splx(s); /* locate the major number */ for (maj = 0; maj < nchrdev; maj++) if (cdevsw[maj].d_open == ucomopen) break; /* Nuke the vnodes for any open instances. */ mn = self->dv_unit; DPRINTF(("ucom_detach: maj=%d mn=%d/n", maj, mn)); vdevgone(maj, mn, mn, VCHR); vdevgone(maj, mn | UCOMCUA_MASK, mn | UCOMCUA_MASK, VCHR); /* Detach and free the tty. */ if (tp != NULL) { ttyfree(tp); sc->sc_tty = NULL; } return (0);}
开发者ID:repos-holder,项目名称:openbsd-patches,代码行数:50,
示例9: uhidcloseintuhidclose(dev_t dev, int flag, int mode, usb_proc_ptr p){ struct uhid_softc *sc; USB_GET_SC(uhid, UHIDUNIT(dev), sc); DPRINTF(("uhidclose: sc=%p/n", sc)); /* Disable interrupts. */ usbd_abort_pipe(sc->sc_intrpipe); usbd_close_pipe(sc->sc_intrpipe); sc->sc_intrpipe = 0; ndflush(&sc->sc_q, sc->sc_q.c_cc); clfree(&sc->sc_q); free(sc->sc_ibuf, M_USBDEV); free(sc->sc_obuf, M_USBDEV); sc->sc_state &= ~UHID_OPEN; sc->sc_async = 0; return (0);}
开发者ID:MarginC,项目名称:kame,代码行数:26,
示例10: uticom_detachintuticom_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,
示例11: uhidev_detachintuhidev_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,
示例12: xboxcontroller_wsmouse_disablestatic voidxboxcontroller_wsmouse_disable(void *opaque){ struct xboxcontroller_softc *sc; sc = (struct xboxcontroller_softc *)opaque; if (!sc->sc_enabled) { aprint_error_dev(sc->sc_dev, "already disabled!/n"); return; } if (sc->sc_ep != NULL) { usbd_abort_pipe(sc->sc_ep); usbd_close_pipe(sc->sc_ep); sc->sc_ep = NULL; } if (sc->sc_buf != NULL) { free(sc->sc_buf, M_USBDEV); sc->sc_buf = NULL; } sc->sc_enabled = 0; return;}
开发者ID:NetBsdDriverProxy,项目名称:NetBsdDriverProxy,代码行数:27,
示例13: usbd_intr_transferusbd_statususbd_intr_transfer(usbd_xfer_handle xfer, usbd_pipe_handle pipe, u_int16_t flags, u_int32_t timeout, void *buf, u_int32_t *size, char *lbl){ usbd_status err; int s, error; usbd_setup_xfer(xfer, pipe, 0, buf, *size, flags, timeout, usbd_intr_transfer_cb); DPRINTFN(1, ("usbd_intr_transfer: start transfer %d bytes/n", *size)); s = splusb(); /* don't want callback until tsleep() */ err = usbd_transfer(xfer); if (err != USBD_IN_PROGRESS) { splx(s); return (err); } error = tsleep(xfer, PZERO | PCATCH, lbl, 0); splx(s); if (error) { DPRINTF(("usbd_intr_transfer: tsleep=%d/n", error)); usbd_abort_pipe(pipe); return (USBD_INTERRUPTED); } usbd_get_xfer_status(xfer, NULL, NULL, size, &err); DPRINTFN(1,("usbd_intr_transfer: transferred %d/n", *size)); if (err) { DPRINTF(("usbd_intr_transfer: error=%d/n", err)); usbd_clear_endpoint_stall(pipe); } return (err);}
开发者ID:7shi,项目名称:openbsd-loongson-vc,代码行数:31,
示例14: ndisusb_detachstatic intndisusb_detach(device_t self){ int i, error; struct ndis_softc *sc = device_get_softc(self); struct usb_attach_arg *uaa = device_get_ivars(self); wlan_serialize_enter(); sc->ndisusb_status |= NDISUSB_STATUS_DETACH; for (i = 0; i < NDISUSB_ENDPT_MAX; i++) { if (sc->ndisusb_ep[i] == NULL) continue; usbd_abort_pipe(sc->ndisusb_ep[i]); usbd_close_pipe(sc->ndisusb_ep[i]); sc->ndisusb_ep[i] = NULL; } if (sc->ndisusb_iin_buf != NULL) { kfree(sc->ndisusb_iin_buf, M_USBDEV); sc->ndisusb_iin_buf = NULL; } ndis_pnpevent_nic(self, NDIS_PNP_EVENT_SURPRISE_REMOVED); usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, uaa->device, self); error = ndis_detach(self); wlan_serialize_exit(); return error;}
开发者ID:mihaicarabas,项目名称:dragonfly,代码行数:33,
示例15: ubsa_detachint 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,
示例16: uhub_detach/* * Called from process context when the hub is gone. * Detach all devices on active ports. */intuhub_detach(struct device *self, int flags){ struct uhub_softc *sc = (struct uhub_softc *)self; struct usbd_hub *hub = sc->sc_hub->hub; struct usbd_port *rup; int port, nports; DPRINTF(("uhub_detach: sc=%p flags=%d/n", sc, flags)); if (hub == NULL) /* Must be partially working */ return (0); usbd_abort_pipe(sc->sc_ipipe); usbd_close_pipe(sc->sc_ipipe); nports = hub->hubdesc.bNbrPorts; for(port = 0; port < nports; port++) { rup = &hub->ports[port]; if (rup->device) usb_disconnect_port(rup, self); } usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_hub, &sc->sc_dev); if (hub->ports[0].tt) free(hub->ports[0].tt, M_USBDEV); free(hub, M_USBDEV); sc->sc_hub->hub = NULL; return (0);}
开发者ID:repos-holder,项目名称:openbsd-patches,代码行数:37,
示例17: umct_detachintumct_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,
示例18: uhub_detach/* * Called from process context when the hub is gone. * Detach all devices on active ports. */intuhub_detach(struct device *self, int flags){ struct uhub_softc *sc = (struct uhub_softc *)self; struct usbd_hub *hub = sc->sc_hub->hub; struct usbd_port *rup; int port; if (hub == NULL) /* Must be partially working */ return (0); usbd_abort_pipe(sc->sc_ipipe); usbd_close_pipe(sc->sc_ipipe); for (port = 0; port < hub->nports; port++) { rup = &hub->ports[port]; if (rup->device != NULL) { usbd_detach(rup->device, self); rup->device = NULL; } } if (hub->ports[0].tt) free(hub->ports[0].tt, M_USBDEV, 0); if (sc->sc_statusbuf) free(sc->sc_statusbuf, M_USBDEV, 0); if (hub->ports) free(hub->ports, M_USBDEV, 0); free(hub, M_USBDEV, 0); sc->sc_hub->hub = NULL; return (0);}
开发者ID:orumin,项目名称:openbsd-efivars,代码行数:37,
示例19: uhidev_detachintuhidev_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,
示例20: uvscom_closeStatic voiduvscom_close(void *addr, int portno) { struct uvscom_softc *sc = addr; int err; if (sc->sc_dying) return; DPRINTF(("uvscom_close: close/n")); uvscom_shutdown(sc); if (sc->sc_intr_pipe != NULL) { err = usbd_abort_pipe(sc->sc_intr_pipe); if (err) printf("%s: abort interrupt pipe failed: %s/n", USBDEVNAME(sc->sc_dev), usbd_errstr(err)); err = usbd_close_pipe(sc->sc_intr_pipe); if (err) printf("%s: close interrupt pipe failed: %s/n", USBDEVNAME(sc->sc_dev), usbd_errstr(err)); free(sc->sc_intr_buf, M_USBDEV); sc->sc_intr_pipe = NULL; }}
开发者ID:MarginC,项目名称:kame,代码行数:28,
|