2 /* $OpenBSD: umoscom.c,v 1.2 2006/10/26 06:02:43 jsg Exp $ */
5 * Copyright (c) 2006 Jonathan Gray <jsg@openbsd.org>
7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20 #include <sys/stdint.h>
21 #include <sys/param.h>
22 #include <sys/queue.h>
23 #include <sys/types.h>
24 #include <sys/systm.h>
25 #include <sys/kernel.h>
27 #include <sys/module.h>
29 #include <sys/condvar.h>
30 #include <sys/sysctl.h>
31 #include <sys/unistd.h>
32 #include <sys/callout.h>
33 #include <sys/malloc.h>
35 #include <sys/serial.h>
37 #include <bus/u4b/usb.h>
38 #include <bus/u4b/usbdi.h>
39 #include <bus/u4b/usbdi_util.h>
42 #define USB_DEBUG_VAR umoscom_debug
43 #include <bus/u4b/usb_debug.h>
44 #include <bus/u4b/usb_process.h>
46 #include <bus/u4b/serial/usb_serial.h>
49 static int umoscom_debug = 0;
51 static SYSCTL_NODE(_hw_usb, OID_AUTO, umoscom, CTLFLAG_RW, 0, "USB umoscom");
52 SYSCTL_INT(_hw_usb_umoscom, OID_AUTO, debug, CTLFLAG_RW,
53 &umoscom_debug, 0, "Debug level");
56 #define UMOSCOM_BUFSIZE 1024 /* bytes */
58 #define UMOSCOM_CONFIG_INDEX 0
59 #define UMOSCOM_IFACE_INDEX 0
61 /* interrupt packet */
62 #define UMOSCOM_IIR_RLS 0x06
63 #define UMOSCOM_IIR_RDA 0x04
64 #define UMOSCOM_IIR_CTI 0x0c
65 #define UMOSCOM_IIR_THR 0x02
66 #define UMOSCOM_IIR_MS 0x00
69 #define UMOSCOM_READ 0x0d
70 #define UMOSCOM_WRITE 0x0e
71 #define UMOSCOM_UART_REG 0x0300
72 #define UMOSCOM_VEND_REG 0x0000
74 #define UMOSCOM_TXBUF 0x00 /* Write */
75 #define UMOSCOM_RXBUF 0x00 /* Read */
76 #define UMOSCOM_INT 0x01
77 #define UMOSCOM_FIFO 0x02 /* Write */
78 #define UMOSCOM_ISR 0x02 /* Read */
79 #define UMOSCOM_LCR 0x03
80 #define UMOSCOM_MCR 0x04
81 #define UMOSCOM_LSR 0x05
82 #define UMOSCOM_MSR 0x06
83 #define UMOSCOM_SCRATCH 0x07
84 #define UMOSCOM_DIV_LO 0x08
85 #define UMOSCOM_DIV_HI 0x09
86 #define UMOSCOM_EFR 0x0a
87 #define UMOSCOM_XON1 0x0b
88 #define UMOSCOM_XON2 0x0c
89 #define UMOSCOM_XOFF1 0x0d
90 #define UMOSCOM_XOFF2 0x0e
92 #define UMOSCOM_BAUDLO 0x00
93 #define UMOSCOM_BAUDHI 0x01
95 #define UMOSCOM_INT_RXEN 0x01
96 #define UMOSCOM_INT_TXEN 0x02
97 #define UMOSCOM_INT_RSEN 0x04
98 #define UMOSCOM_INT_MDMEM 0x08
99 #define UMOSCOM_INT_SLEEP 0x10
100 #define UMOSCOM_INT_XOFF 0x20
101 #define UMOSCOM_INT_RTS 0x40
103 #define UMOSCOM_FIFO_EN 0x01
104 #define UMOSCOM_FIFO_RXCLR 0x02
105 #define UMOSCOM_FIFO_TXCLR 0x04
106 #define UMOSCOM_FIFO_DMA_BLK 0x08
107 #define UMOSCOM_FIFO_TXLVL_MASK 0x30
108 #define UMOSCOM_FIFO_TXLVL_8 0x00
109 #define UMOSCOM_FIFO_TXLVL_16 0x10
110 #define UMOSCOM_FIFO_TXLVL_32 0x20
111 #define UMOSCOM_FIFO_TXLVL_56 0x30
112 #define UMOSCOM_FIFO_RXLVL_MASK 0xc0
113 #define UMOSCOM_FIFO_RXLVL_8 0x00
114 #define UMOSCOM_FIFO_RXLVL_16 0x40
115 #define UMOSCOM_FIFO_RXLVL_56 0x80
116 #define UMOSCOM_FIFO_RXLVL_80 0xc0
118 #define UMOSCOM_ISR_MDM 0x00
119 #define UMOSCOM_ISR_NONE 0x01
120 #define UMOSCOM_ISR_TX 0x02
121 #define UMOSCOM_ISR_RX 0x04
122 #define UMOSCOM_ISR_LINE 0x06
123 #define UMOSCOM_ISR_RXTIMEOUT 0x0c
124 #define UMOSCOM_ISR_RX_XOFF 0x10
125 #define UMOSCOM_ISR_RTSCTS 0x20
126 #define UMOSCOM_ISR_FIFOEN 0xc0
128 #define UMOSCOM_LCR_DBITS(x) ((x) - 5)
129 #define UMOSCOM_LCR_STOP_BITS_1 0x00
130 #define UMOSCOM_LCR_STOP_BITS_2 0x04 /* 2 if 6-8 bits/char or 1.5 if 5 */
131 #define UMOSCOM_LCR_PARITY_NONE 0x00
132 #define UMOSCOM_LCR_PARITY_ODD 0x08
133 #define UMOSCOM_LCR_PARITY_EVEN 0x18
134 #define UMOSCOM_LCR_BREAK 0x40
135 #define UMOSCOM_LCR_DIVLATCH_EN 0x80
137 #define UMOSCOM_MCR_DTR 0x01
138 #define UMOSCOM_MCR_RTS 0x02
139 #define UMOSCOM_MCR_LOOP 0x04
140 #define UMOSCOM_MCR_INTEN 0x08
141 #define UMOSCOM_MCR_LOOPBACK 0x10
142 #define UMOSCOM_MCR_XONANY 0x20
143 #define UMOSCOM_MCR_IRDA_EN 0x40
144 #define UMOSCOM_MCR_BAUD_DIV4 0x80
146 #define UMOSCOM_LSR_RXDATA 0x01
147 #define UMOSCOM_LSR_RXOVER 0x02
148 #define UMOSCOM_LSR_RXPAR_ERR 0x04
149 #define UMOSCOM_LSR_RXFRM_ERR 0x08
150 #define UMOSCOM_LSR_RXBREAK 0x10
151 #define UMOSCOM_LSR_TXEMPTY 0x20
152 #define UMOSCOM_LSR_TXALLEMPTY 0x40
153 #define UMOSCOM_LSR_TXFIFO_ERR 0x80
155 #define UMOSCOM_MSR_CTS_CHG 0x01
156 #define UMOSCOM_MSR_DSR_CHG 0x02
157 #define UMOSCOM_MSR_RI_CHG 0x04
158 #define UMOSCOM_MSR_CD_CHG 0x08
159 #define UMOSCOM_MSR_CTS 0x10
160 #define UMOSCOM_MSR_RTS 0x20
161 #define UMOSCOM_MSR_RI 0x40
162 #define UMOSCOM_MSR_CD 0x80
164 #define UMOSCOM_BAUD_REF 115200
173 struct umoscom_softc {
174 struct ucom_super_softc sc_super_ucom;
175 struct ucom_softc sc_ucom;
177 struct usb_xfer *sc_xfer[UMOSCOM_N_TRANSFER];
178 struct usb_device *sc_udev;
187 static device_probe_t umoscom_probe;
188 static device_attach_t umoscom_attach;
189 static device_detach_t umoscom_detach;
191 static usb_callback_t umoscom_write_callback;
192 static usb_callback_t umoscom_read_callback;
193 static usb_callback_t umoscom_intr_callback;
195 static void umoscom_cfg_open(struct ucom_softc *);
196 static void umoscom_cfg_close(struct ucom_softc *);
197 static void umoscom_cfg_set_break(struct ucom_softc *, uint8_t);
198 static void umoscom_cfg_set_dtr(struct ucom_softc *, uint8_t);
199 static void umoscom_cfg_set_rts(struct ucom_softc *, uint8_t);
200 static int umoscom_pre_param(struct ucom_softc *, struct termios *);
201 static void umoscom_cfg_param(struct ucom_softc *, struct termios *);
202 static void umoscom_cfg_get_status(struct ucom_softc *, uint8_t *,
204 static void umoscom_cfg_write(struct umoscom_softc *, uint16_t, uint16_t);
205 static uint8_t umoscom_cfg_read(struct umoscom_softc *, uint16_t);
206 static void umoscom_start_read(struct ucom_softc *);
207 static void umoscom_stop_read(struct ucom_softc *);
208 static void umoscom_start_write(struct ucom_softc *);
209 static void umoscom_stop_write(struct ucom_softc *);
210 static void umoscom_poll(struct ucom_softc *ucom);
212 static const struct usb_config umoscom_config_data[UMOSCOM_N_TRANSFER] = {
214 [UMOSCOM_BULK_DT_WR] = {
216 .endpoint = UE_ADDR_ANY,
217 .direction = UE_DIR_OUT,
218 .bufsize = UMOSCOM_BUFSIZE,
219 .flags = {.pipe_bof = 1,.force_short_xfer = 1,},
220 .callback = &umoscom_write_callback,
223 [UMOSCOM_BULK_DT_RD] = {
225 .endpoint = UE_ADDR_ANY,
226 .direction = UE_DIR_IN,
227 .bufsize = UMOSCOM_BUFSIZE,
228 .flags = {.pipe_bof = 1,.short_xfer_ok = 1,},
229 .callback = &umoscom_read_callback,
232 [UMOSCOM_INTR_DT_RD] = {
233 .type = UE_INTERRUPT,
234 .endpoint = UE_ADDR_ANY,
235 .direction = UE_DIR_IN,
236 .flags = {.pipe_bof = 1,.short_xfer_ok = 1,},
237 .bufsize = 0, /* use wMaxPacketSize */
238 .callback = &umoscom_intr_callback,
242 static const struct ucom_callback umoscom_callback = {
243 /* configuration callbacks */
244 .ucom_cfg_get_status = &umoscom_cfg_get_status,
245 .ucom_cfg_set_dtr = &umoscom_cfg_set_dtr,
246 .ucom_cfg_set_rts = &umoscom_cfg_set_rts,
247 .ucom_cfg_set_break = &umoscom_cfg_set_break,
248 .ucom_cfg_param = &umoscom_cfg_param,
249 .ucom_cfg_open = &umoscom_cfg_open,
250 .ucom_cfg_close = &umoscom_cfg_close,
252 /* other callbacks */
253 .ucom_pre_param = &umoscom_pre_param,
254 .ucom_start_read = &umoscom_start_read,
255 .ucom_stop_read = &umoscom_stop_read,
256 .ucom_start_write = &umoscom_start_write,
257 .ucom_stop_write = &umoscom_stop_write,
258 .ucom_poll = &umoscom_poll,
261 static device_method_t umoscom_methods[] = {
262 DEVMETHOD(device_probe, umoscom_probe),
263 DEVMETHOD(device_attach, umoscom_attach),
264 DEVMETHOD(device_detach, umoscom_detach),
268 static devclass_t umoscom_devclass;
270 static driver_t umoscom_driver = {
272 .methods = umoscom_methods,
273 .size = sizeof(struct umoscom_softc),
276 static const STRUCT_USB_HOST_ID umoscom_devs[] = {
277 {USB_VPI(USB_VENDOR_MOSCHIP, USB_PRODUCT_MOSCHIP_MCS7703, 0)}
280 DRIVER_MODULE(umoscom, uhub, umoscom_driver, umoscom_devclass, NULL, NULL);
281 MODULE_DEPEND(umoscom, ucom, 1, 1, 1);
282 MODULE_DEPEND(umoscom, usb, 1, 1, 1);
283 MODULE_VERSION(umoscom, 1);
286 umoscom_probe(device_t dev)
288 struct usb_attach_arg *uaa = device_get_ivars(dev);
290 if (uaa->usb_mode != USB_MODE_HOST) {
293 if (uaa->info.bConfigIndex != UMOSCOM_CONFIG_INDEX) {
296 if (uaa->info.bIfaceIndex != UMOSCOM_IFACE_INDEX) {
299 return (usbd_lookup_id_by_uaa(umoscom_devs, sizeof(umoscom_devs), uaa));
303 umoscom_attach(device_t dev)
305 struct usb_attach_arg *uaa = device_get_ivars(dev);
306 struct umoscom_softc *sc = device_get_softc(dev);
310 sc->sc_udev = uaa->device;
311 sc->sc_mcr = 0x08; /* enable interrupts */
313 /* XXX the device doesn't provide any ID string, so set a static one */
314 device_set_desc(dev, "MOSCHIP USB Serial Port Adapter");
315 device_printf(dev, "<MOSCHIP USB Serial Port Adapter>\n");
317 lockinit(&sc->sc_lock, "umoscom", 0, LK_CANRECURSE);
319 iface_index = UMOSCOM_IFACE_INDEX;
320 error = usbd_transfer_setup(uaa->device, &iface_index,
321 sc->sc_xfer, umoscom_config_data,
322 UMOSCOM_N_TRANSFER, sc, &sc->sc_lock);
327 /* clear stall at first run */
328 lockmgr(&sc->sc_lock, LK_EXCLUSIVE);
329 usbd_xfer_set_stall(sc->sc_xfer[UMOSCOM_BULK_DT_WR]);
330 usbd_xfer_set_stall(sc->sc_xfer[UMOSCOM_BULK_DT_RD]);
331 lockmgr(&sc->sc_lock, LK_RELEASE);
333 error = ucom_attach(&sc->sc_super_ucom, &sc->sc_ucom, 1, sc,
334 &umoscom_callback, &sc->sc_lock);
338 ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
343 device_printf(dev, "attach error: %s\n", usbd_errstr(error));
349 umoscom_detach(device_t dev)
351 struct umoscom_softc *sc = device_get_softc(dev);
353 ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom);
354 usbd_transfer_unsetup(sc->sc_xfer, UMOSCOM_N_TRANSFER);
355 lockuninit(&sc->sc_lock);
361 umoscom_cfg_open(struct ucom_softc *ucom)
363 struct umoscom_softc *sc = ucom->sc_parent;
367 /* Purge FIFOs or odd things happen */
368 umoscom_cfg_write(sc, UMOSCOM_FIFO, 0x00 | UMOSCOM_UART_REG);
371 umoscom_cfg_write(sc, UMOSCOM_FIFO, UMOSCOM_FIFO_EN |
372 UMOSCOM_FIFO_RXCLR | UMOSCOM_FIFO_TXCLR |
373 UMOSCOM_FIFO_DMA_BLK | UMOSCOM_FIFO_RXLVL_MASK |
376 /* Enable Interrupt Registers */
377 umoscom_cfg_write(sc, UMOSCOM_INT, 0x0C | UMOSCOM_UART_REG);
380 umoscom_cfg_write(sc, 0x01, 0x08);
383 umoscom_cfg_write(sc, 0x00, 0x02);
387 umoscom_cfg_close(struct ucom_softc *ucom)
393 umoscom_cfg_set_break(struct ucom_softc *ucom, uint8_t onoff)
395 struct umoscom_softc *sc = ucom->sc_parent;
400 val |= UMOSCOM_LCR_BREAK;
402 umoscom_cfg_write(sc, UMOSCOM_LCR, val | UMOSCOM_UART_REG);
406 umoscom_cfg_set_dtr(struct ucom_softc *ucom, uint8_t onoff)
408 struct umoscom_softc *sc = ucom->sc_parent;
411 sc->sc_mcr |= UMOSCOM_MCR_DTR;
413 sc->sc_mcr &= ~UMOSCOM_MCR_DTR;
415 umoscom_cfg_write(sc, UMOSCOM_MCR, sc->sc_mcr | UMOSCOM_UART_REG);
419 umoscom_cfg_set_rts(struct ucom_softc *ucom, uint8_t onoff)
421 struct umoscom_softc *sc = ucom->sc_parent;
424 sc->sc_mcr |= UMOSCOM_MCR_RTS;
426 sc->sc_mcr &= ~UMOSCOM_MCR_RTS;
428 umoscom_cfg_write(sc, UMOSCOM_MCR, sc->sc_mcr | UMOSCOM_UART_REG);
432 umoscom_pre_param(struct ucom_softc *ucom, struct termios *t)
434 if ((t->c_ospeed <= 1) || (t->c_ospeed > 115200))
441 umoscom_cfg_param(struct ucom_softc *ucom, struct termios *t)
443 struct umoscom_softc *sc = ucom->sc_parent;
446 DPRINTF("speed=%d\n", t->c_ospeed);
448 data = ((uint32_t)UMOSCOM_BAUD_REF) / ((uint32_t)t->c_ospeed);
451 DPRINTF("invalid baud rate!\n");
454 umoscom_cfg_write(sc, UMOSCOM_LCR,
455 UMOSCOM_LCR_DIVLATCH_EN | UMOSCOM_UART_REG);
457 umoscom_cfg_write(sc, UMOSCOM_BAUDLO,
458 (data & 0xFF) | UMOSCOM_UART_REG);
460 umoscom_cfg_write(sc, UMOSCOM_BAUDHI,
461 ((data >> 8) & 0xFF) | UMOSCOM_UART_REG);
463 if (t->c_cflag & CSTOPB)
464 data = UMOSCOM_LCR_STOP_BITS_2;
466 data = UMOSCOM_LCR_STOP_BITS_1;
468 if (t->c_cflag & PARENB) {
469 if (t->c_cflag & PARODD)
470 data |= UMOSCOM_LCR_PARITY_ODD;
472 data |= UMOSCOM_LCR_PARITY_EVEN;
474 data |= UMOSCOM_LCR_PARITY_NONE;
476 switch (t->c_cflag & CSIZE) {
478 data |= UMOSCOM_LCR_DBITS(5);
481 data |= UMOSCOM_LCR_DBITS(6);
484 data |= UMOSCOM_LCR_DBITS(7);
487 data |= UMOSCOM_LCR_DBITS(8);
492 umoscom_cfg_write(sc, UMOSCOM_LCR, data | UMOSCOM_UART_REG);
496 umoscom_cfg_get_status(struct ucom_softc *ucom, uint8_t *p_lsr, uint8_t *p_msr)
498 struct umoscom_softc *sc = ucom->sc_parent;
504 /* read status registers */
506 lsr = umoscom_cfg_read(sc, UMOSCOM_LSR);
507 msr = umoscom_cfg_read(sc, UMOSCOM_MSR);
511 if (msr & UMOSCOM_MSR_CTS)
514 if (msr & UMOSCOM_MSR_CD)
517 if (msr & UMOSCOM_MSR_RI)
520 if (msr & UMOSCOM_MSR_RTS)
525 umoscom_cfg_write(struct umoscom_softc *sc, uint16_t reg, uint16_t val)
527 struct usb_device_request req;
529 req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
530 req.bRequest = UMOSCOM_WRITE;
531 USETW(req.wValue, val);
532 USETW(req.wIndex, reg);
533 USETW(req.wLength, 0);
535 ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom,
536 &req, NULL, 0, 1000);
540 umoscom_cfg_read(struct umoscom_softc *sc, uint16_t reg)
542 struct usb_device_request req;
545 req.bmRequestType = UT_READ_VENDOR_DEVICE;
546 req.bRequest = UMOSCOM_READ;
547 USETW(req.wValue, 0);
548 USETW(req.wIndex, reg);
549 USETW(req.wLength, 1);
551 ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom,
552 &req, &val, 0, 1000);
554 DPRINTF("reg=0x%04x, val=0x%02x\n", reg, val);
560 umoscom_start_read(struct ucom_softc *ucom)
562 struct umoscom_softc *sc = ucom->sc_parent;
565 /* start interrupt endpoint */
566 usbd_transfer_start(sc->sc_xfer[UMOSCOM_INTR_DT_RD]);
568 /* start read endpoint */
569 usbd_transfer_start(sc->sc_xfer[UMOSCOM_BULK_DT_RD]);
573 umoscom_stop_read(struct ucom_softc *ucom)
575 struct umoscom_softc *sc = ucom->sc_parent;
577 /* stop interrupt transfer */
578 usbd_transfer_stop(sc->sc_xfer[UMOSCOM_INTR_DT_RD]);
580 /* stop read endpoint */
581 usbd_transfer_stop(sc->sc_xfer[UMOSCOM_BULK_DT_RD]);
585 umoscom_start_write(struct ucom_softc *ucom)
587 struct umoscom_softc *sc = ucom->sc_parent;
589 usbd_transfer_start(sc->sc_xfer[UMOSCOM_BULK_DT_WR]);
593 umoscom_stop_write(struct ucom_softc *ucom)
595 struct umoscom_softc *sc = ucom->sc_parent;
597 usbd_transfer_stop(sc->sc_xfer[UMOSCOM_BULK_DT_WR]);
601 umoscom_write_callback(struct usb_xfer *xfer, usb_error_t error)
603 struct umoscom_softc *sc = usbd_xfer_softc(xfer);
604 struct usb_page_cache *pc;
607 switch (USB_GET_STATE(xfer)) {
609 case USB_ST_TRANSFERRED:
613 pc = usbd_xfer_get_frame(xfer, 0);
614 if (ucom_get_data(&sc->sc_ucom, pc, 0,
615 UMOSCOM_BUFSIZE, &actlen)) {
617 usbd_xfer_set_frame_len(xfer, 0, actlen);
618 usbd_transfer_submit(xfer);
623 if (error != USB_ERR_CANCELLED) {
624 DPRINTFN(0, "transfer failed\n");
625 /* try to clear stall first */
626 usbd_xfer_set_stall(xfer);
634 umoscom_read_callback(struct usb_xfer *xfer, usb_error_t error)
636 struct umoscom_softc *sc = usbd_xfer_softc(xfer);
637 struct usb_page_cache *pc;
640 usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL);
642 switch (USB_GET_STATE(xfer)) {
643 case USB_ST_TRANSFERRED:
644 DPRINTF("got %d bytes\n", actlen);
645 pc = usbd_xfer_get_frame(xfer, 0);
646 ucom_put_data(&sc->sc_ucom, pc, 0, actlen);
652 usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer));
653 usbd_transfer_submit(xfer);
657 if (error != USB_ERR_CANCELLED) {
658 DPRINTFN(0, "transfer failed\n");
659 /* try to clear stall first */
660 usbd_xfer_set_stall(xfer);
668 umoscom_intr_callback(struct usb_xfer *xfer, usb_error_t error)
670 struct umoscom_softc *sc = usbd_xfer_softc(xfer);
673 usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL);
675 switch (USB_GET_STATE(xfer)) {
676 case USB_ST_TRANSFERRED:
678 DPRINTF("too short message\n");
681 ucom_status_change(&sc->sc_ucom);
685 usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer));
686 usbd_transfer_submit(xfer);
690 if (error != USB_ERR_CANCELLED) {
691 DPRINTFN(0, "transfer failed\n");
692 /* try to clear stall first */
693 usbd_xfer_set_stall(xfer);
701 umoscom_poll(struct ucom_softc *ucom)
703 struct umoscom_softc *sc = ucom->sc_parent;
704 usbd_transfer_poll(sc->sc_xfer, UMOSCOM_N_TRANSFER);