Lines Matching +full:owl +full:- +full:uart

22  * USB-Serial adapters.  Based on datasheet AN571, publicly available from
113 /* USLCOM_SET_FLOW values - 1st word */
116 /* USLCOM_SET_FLOW values - 2nd word */
279 USLCOM_DEV(OWL, CM_160),
390 mtx_assert(&sc->sc_mtx, MA_OWNED); in uslcom_watchdog()
392 usbd_transfer_start(sc->sc_xfer[USLCOM_CTRL_DT_RD]); in uslcom_watchdog()
394 usb_callout_reset(&sc->sc_watchdog, in uslcom_watchdog()
405 if (uaa->usb_mode != USB_MODE_HOST) { in uslcom_probe()
408 if (uaa->info.bConfigIndex != USLCOM_CONFIG_INDEX) { in uslcom_probe()
424 mtx_init(&sc->sc_mtx, "uslcom", NULL, MTX_DEF); in uslcom_attach()
425 ucom_ref(&sc->sc_super_ucom); in uslcom_attach()
426 usb_callout_init_mtx(&sc->sc_watchdog, &sc->sc_mtx, 0); in uslcom_attach()
428 sc->sc_udev = uaa->device; in uslcom_attach()
430 sc->sc_iface_no = uaa->info.bIfaceNum; in uslcom_attach()
432 error = usbd_transfer_setup(uaa->device, in uslcom_attach()
433 &uaa->info.bIfaceIndex, sc->sc_xfer, uslcom_config, in uslcom_attach()
434 USLCOM_N_TRANSFER, sc, &sc->sc_mtx); in uslcom_attach()
440 sc->sc_partnum = uslcom_get_partnum(sc); in uslcom_attach()
442 error = ucom_attach(&sc->sc_super_ucom, &sc->sc_ucom, 1, sc, in uslcom_attach()
443 &uslcom_callback, &sc->sc_mtx); in uslcom_attach()
447 ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev); in uslcom_attach()
463 ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom); in uslcom_detach()
464 usbd_transfer_unsetup(sc->sc_xfer, USLCOM_N_TRANSFER); in uslcom_detach()
466 usb_callout_drain(&sc->sc_watchdog); in uslcom_detach()
480 if (ucom_unref(&sc->sc_super_ucom)) { in uslcom_free_softc()
481 mtx_destroy(&sc->sc_mtx); in uslcom_free_softc()
489 uslcom_free_softc(ucom->sc_parent); in uslcom_free()
495 struct uslcom_softc *sc = ucom->sc_parent; in uslcom_cfg_open()
501 USETW(req.wIndex, sc->sc_iface_no); in uslcom_cfg_open()
504 if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, in uslcom_cfg_open()
506 DPRINTF("UART enable failed (ignored)\n"); in uslcom_cfg_open()
510 usbd_xfer_set_stall(sc->sc_xfer[USLCOM_BULK_DT_WR]); in uslcom_cfg_open()
511 usbd_xfer_set_stall(sc->sc_xfer[USLCOM_BULK_DT_RD]); in uslcom_cfg_open()
520 struct uslcom_softc *sc = ucom->sc_parent; in uslcom_cfg_close()
524 usb_callout_stop(&sc->sc_watchdog); in uslcom_cfg_close()
529 USETW(req.wIndex, sc->sc_iface_no); in uslcom_cfg_close()
532 if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, in uslcom_cfg_close()
534 DPRINTF("UART disable failed (ignored)\n"); in uslcom_cfg_close()
549 USETW(req.wIndex, sc->sc_iface_no); in uslcom_get_partnum()
552 if (usbd_do_request_flags(sc->sc_udev, NULL, in uslcom_get_partnum()
563 struct uslcom_softc *sc = ucom->sc_parent; in uslcom_cfg_set_dtr()
575 USETW(req.wIndex, sc->sc_iface_no); in uslcom_cfg_set_dtr()
578 if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, in uslcom_cfg_set_dtr()
587 struct uslcom_softc *sc = ucom->sc_parent; in uslcom_cfg_set_rts()
599 USETW(req.wIndex, sc->sc_iface_no); in uslcom_cfg_set_rts()
602 if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, in uslcom_cfg_set_rts()
611 struct uslcom_softc *sc = ucom->sc_parent; in uslcom_pre_param()
614 switch (sc->sc_partnum) { in uslcom_pre_param()
630 if (t->c_ospeed <= 0 || t->c_ospeed > maxspeed) in uslcom_pre_param()
638 struct uslcom_softc *sc = ucom->sc_parent; in uslcom_cfg_param()
645 baudrate = t->c_ospeed; in uslcom_cfg_param()
649 USETW(req.wIndex, sc->sc_iface_no); in uslcom_cfg_param()
652 if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, in uslcom_cfg_param()
657 if (t->c_cflag & CSTOPB) in uslcom_cfg_param()
661 if (t->c_cflag & PARENB) { in uslcom_cfg_param()
662 if (t->c_cflag & PARODD) in uslcom_cfg_param()
668 switch (t->c_cflag & CSIZE) { in uslcom_cfg_param()
686 USETW(req.wIndex, sc->sc_iface_no); in uslcom_cfg_param()
689 if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, in uslcom_cfg_param()
694 if (t->c_cflag & CRTSCTS) { in uslcom_cfg_param()
706 USETW(req.wIndex, sc->sc_iface_no); in uslcom_cfg_param()
709 if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, in uslcom_cfg_param()
718 struct uslcom_softc *sc = ucom->sc_parent; in uslcom_cfg_get_status()
723 *lsr = sc->sc_lsr; in uslcom_cfg_get_status()
724 *msr = sc->sc_msr; in uslcom_cfg_get_status()
730 struct uslcom_softc *sc = ucom->sc_parent; in uslcom_cfg_set_break()
737 USETW(req.wIndex, sc->sc_iface_no); in uslcom_cfg_set_break()
740 if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, in uslcom_cfg_set_break()
750 struct uslcom_softc *sc = ucom->sc_parent; in uslcom_ioctl()
759 if (sc->sc_partnum < USLCOM_PARTNUM_CP2103) { in uslcom_ioctl()
766 USETW(req.wIndex, sc->sc_iface_no); in uslcom_ioctl()
769 if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, in uslcom_ioctl()
778 if (sc->sc_partnum < USLCOM_PARTNUM_CP2103) in uslcom_ioctl()
780 else if ((sc->sc_partnum == USLCOM_PARTNUM_CP2103) || in uslcom_ioctl()
781 (sc->sc_partnum == USLCOM_PARTNUM_CP2104)) { in uslcom_ioctl()
788 if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, in uslcom_ioctl()
817 if (ucom_get_data(&sc->sc_ucom, pc, 0, in uslcom_write_callback()
848 ucom_put_data(&sc->sc_ucom, pc, 0, actlen); in uslcom_read_callback()
888 if (msr != sc->sc_msr) { in uslcom_control_callback()
890 "(was 0x%02x)\n", msr, sc->sc_msr); in uslcom_control_callback()
891 sc->sc_msr = msr; in uslcom_control_callback()
892 ucom_status_change(&sc->sc_ucom); in uslcom_control_callback()
900 USETW(req.wIndex, sc->sc_iface_no); in uslcom_control_callback()
922 struct uslcom_softc *sc = ucom->sc_parent; in uslcom_start_read()
925 usbd_transfer_start(sc->sc_xfer[USLCOM_BULK_DT_RD]); in uslcom_start_read()
931 struct uslcom_softc *sc = ucom->sc_parent; in uslcom_stop_read()
934 usbd_transfer_stop(sc->sc_xfer[USLCOM_BULK_DT_RD]); in uslcom_stop_read()
940 struct uslcom_softc *sc = ucom->sc_parent; in uslcom_start_write()
942 usbd_transfer_start(sc->sc_xfer[USLCOM_BULK_DT_WR]); in uslcom_start_write()
948 struct uslcom_softc *sc = ucom->sc_parent; in uslcom_stop_write()
950 usbd_transfer_stop(sc->sc_xfer[USLCOM_BULK_DT_WR]); in uslcom_stop_write()
956 struct uslcom_softc *sc = ucom->sc_parent; in uslcom_poll()
957 usbd_transfer_poll(sc->sc_xfer, USLCOM_N_TRANSFER); in uslcom_poll()