Deleted Added
full compact
uvscom.c (196219) uvscom.c (197570)
1/* $NetBSD: usb/uvscom.c,v 1.1 2002/03/19 15:08:42 augustss Exp $ */
2
3#include <sys/cdefs.h>
1/* $NetBSD: usb/uvscom.c,v 1.1 2002/03/19 15:08:42 augustss Exp $ */
2
3#include <sys/cdefs.h>
4__FBSDID("$FreeBSD: head/sys/dev/usb/serial/uvscom.c 196219 2009-08-14 20:03:53Z jhb $");
4__FBSDID("$FreeBSD: head/sys/dev/usb/serial/uvscom.c 197570 2009-09-28 08:13:50Z thompsa $");
5
6/*-
7 * Copyright (c) 2001-2003, 2005 Shunsuke Akiyama <akiyama@jp.FreeBSD.org>.
8 * All rights reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:

--- 167 unchanged lines hidden (view full) ---

180static void uvscom_start_read(struct ucom_softc *);
181static void uvscom_stop_read(struct ucom_softc *);
182static void uvscom_start_write(struct ucom_softc *);
183static void uvscom_stop_write(struct ucom_softc *);
184static void uvscom_cfg_get_status(struct ucom_softc *, uint8_t *,
185 uint8_t *);
186static void uvscom_cfg_write(struct uvscom_softc *, uint8_t, uint16_t);
187static uint16_t uvscom_cfg_read_status(struct uvscom_softc *);
5
6/*-
7 * Copyright (c) 2001-2003, 2005 Shunsuke Akiyama <akiyama@jp.FreeBSD.org>.
8 * All rights reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:

--- 167 unchanged lines hidden (view full) ---

180static void uvscom_start_read(struct ucom_softc *);
181static void uvscom_stop_read(struct ucom_softc *);
182static void uvscom_start_write(struct ucom_softc *);
183static void uvscom_stop_write(struct ucom_softc *);
184static void uvscom_cfg_get_status(struct ucom_softc *, uint8_t *,
185 uint8_t *);
186static void uvscom_cfg_write(struct uvscom_softc *, uint8_t, uint16_t);
187static uint16_t uvscom_cfg_read_status(struct uvscom_softc *);
188static void uvscom_poll(struct ucom_softc *ucom);
188
189static const struct usb_config uvscom_config[UVSCOM_N_TRANSFER] = {
190
191 [UVSCOM_BULK_DT_WR] = {
192 .type = UE_BULK,
193 .endpoint = UE_ADDR_ANY,
194 .direction = UE_DIR_OUT,
195 .bufsize = UVSCOM_BULK_BUF_SIZE,

--- 29 unchanged lines hidden (view full) ---

225 .ucom_cfg_open = &uvscom_cfg_open,
226 .ucom_cfg_close = &uvscom_cfg_close,
227 .ucom_pre_open = &uvscom_pre_open,
228 .ucom_pre_param = &uvscom_pre_param,
229 .ucom_start_read = &uvscom_start_read,
230 .ucom_stop_read = &uvscom_stop_read,
231 .ucom_start_write = &uvscom_start_write,
232 .ucom_stop_write = &uvscom_stop_write,
189
190static const struct usb_config uvscom_config[UVSCOM_N_TRANSFER] = {
191
192 [UVSCOM_BULK_DT_WR] = {
193 .type = UE_BULK,
194 .endpoint = UE_ADDR_ANY,
195 .direction = UE_DIR_OUT,
196 .bufsize = UVSCOM_BULK_BUF_SIZE,

--- 29 unchanged lines hidden (view full) ---

226 .ucom_cfg_open = &uvscom_cfg_open,
227 .ucom_cfg_close = &uvscom_cfg_close,
228 .ucom_pre_open = &uvscom_pre_open,
229 .ucom_pre_param = &uvscom_pre_param,
230 .ucom_start_read = &uvscom_start_read,
231 .ucom_stop_read = &uvscom_stop_read,
232 .ucom_start_write = &uvscom_start_write,
233 .ucom_stop_write = &uvscom_stop_write,
234 .ucom_poll = &uvscom_poll,
233};
234
235static const struct usb_device_id uvscom_devs[] = {
236 /* SUNTAC U-Cable type A4 */
237 {USB_VPI(USB_VENDOR_SUNTAC, USB_PRODUCT_SUNTAC_AS144L4, 0)},
238 /* SUNTAC U-Cable type D2 */
239 {USB_VPI(USB_VENDOR_SUNTAC, USB_PRODUCT_SUNTAC_DS96L, 0)},
240 /* SUNTAC Ir-Trinity */

--- 488 unchanged lines hidden (view full) ---

729 err = ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom,
730 &req, data, 0, 1000);
731 if (err) {
732 DPRINTFN(0, "device request failed, err=%s "
733 "(ignored)\n", usbd_errstr(err));
734 }
735 return (data[0] | (data[1] << 8));
736}
235};
236
237static const struct usb_device_id uvscom_devs[] = {
238 /* SUNTAC U-Cable type A4 */
239 {USB_VPI(USB_VENDOR_SUNTAC, USB_PRODUCT_SUNTAC_AS144L4, 0)},
240 /* SUNTAC U-Cable type D2 */
241 {USB_VPI(USB_VENDOR_SUNTAC, USB_PRODUCT_SUNTAC_DS96L, 0)},
242 /* SUNTAC Ir-Trinity */

--- 488 unchanged lines hidden (view full) ---

731 err = ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom,
732 &req, data, 0, 1000);
733 if (err) {
734 DPRINTFN(0, "device request failed, err=%s "
735 "(ignored)\n", usbd_errstr(err));
736 }
737 return (data[0] | (data[1] << 8));
738}
739
740static void
741uvscom_poll(struct ucom_softc *ucom)
742{
743 struct uvscom_softc *sc = ucom->sc_parent;
744 usbd_transfer_poll(sc->sc_xfer, UVSCOM_N_TRANSFER);
745}