Deleted Added
full compact
uark.c (196219) uark.c (197570)
1/* $OpenBSD: uark.c,v 1.1 2006/08/14 08:30:22 jsg Exp $ */
2
3/*
4 * Copyright (c) 2006 Jonathan Gray <jsg@openbsd.org>
5 *
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 *
1/* $OpenBSD: uark.c,v 1.1 2006/08/14 08:30:22 jsg Exp $ */
2
3/*
4 * Copyright (c) 2006 Jonathan Gray <jsg@openbsd.org>
5 *
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 *
18 * $FreeBSD: head/sys/dev/usb/serial/uark.c 196219 2009-08-14 20:03:53Z jhb $
18 * $FreeBSD: head/sys/dev/usb/serial/uark.c 197570 2009-09-28 08:13:50Z thompsa $
19 */
20
21/*
22 * NOTE: all function names beginning like "uark_cfg_" can only
23 * be called from within the config thread function !
24 */
25
26

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

109static void uark_start_write(struct ucom_softc *);
110static void uark_stop_write(struct ucom_softc *);
111static int uark_pre_param(struct ucom_softc *, struct termios *);
112static void uark_cfg_param(struct ucom_softc *, struct termios *);
113static void uark_cfg_get_status(struct ucom_softc *, uint8_t *,
114 uint8_t *);
115static void uark_cfg_set_break(struct ucom_softc *, uint8_t);
116static void uark_cfg_write(struct uark_softc *, uint16_t, uint16_t);
19 */
20
21/*
22 * NOTE: all function names beginning like "uark_cfg_" can only
23 * be called from within the config thread function !
24 */
25
26

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

109static void uark_start_write(struct ucom_softc *);
110static void uark_stop_write(struct ucom_softc *);
111static int uark_pre_param(struct ucom_softc *, struct termios *);
112static void uark_cfg_param(struct ucom_softc *, struct termios *);
113static void uark_cfg_get_status(struct ucom_softc *, uint8_t *,
114 uint8_t *);
115static void uark_cfg_set_break(struct ucom_softc *, uint8_t);
116static void uark_cfg_write(struct uark_softc *, uint16_t, uint16_t);
117static void uark_poll(struct ucom_softc *ucom);
117
118static const struct usb_config
119 uark_xfer_config[UARK_N_TRANSFER] = {
120
121 [UARK_BULK_DT_WR] = {
122 .type = UE_BULK,
123 .endpoint = UE_ADDR_ANY,
124 .direction = UE_DIR_OUT,

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

141 .ucom_cfg_get_status = &uark_cfg_get_status,
142 .ucom_cfg_set_break = &uark_cfg_set_break,
143 .ucom_cfg_param = &uark_cfg_param,
144 .ucom_pre_param = &uark_pre_param,
145 .ucom_start_read = &uark_start_read,
146 .ucom_stop_read = &uark_stop_read,
147 .ucom_start_write = &uark_start_write,
148 .ucom_stop_write = &uark_stop_write,
118
119static const struct usb_config
120 uark_xfer_config[UARK_N_TRANSFER] = {
121
122 [UARK_BULK_DT_WR] = {
123 .type = UE_BULK,
124 .endpoint = UE_ADDR_ANY,
125 .direction = UE_DIR_OUT,

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

142 .ucom_cfg_get_status = &uark_cfg_get_status,
143 .ucom_cfg_set_break = &uark_cfg_set_break,
144 .ucom_cfg_param = &uark_cfg_param,
145 .ucom_pre_param = &uark_pre_param,
146 .ucom_start_read = &uark_start_read,
147 .ucom_stop_read = &uark_stop_read,
148 .ucom_start_write = &uark_start_write,
149 .ucom_stop_write = &uark_stop_write,
150 .ucom_poll = &uark_poll,
149};
150
151static device_method_t uark_methods[] = {
152 /* Device methods */
153 DEVMETHOD(device_probe, uark_probe),
154 DEVMETHOD(device_attach, uark_attach),
155 DEVMETHOD(device_detach, uark_detach),
156 {0, 0}

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

426
427 err = ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom,
428 &req, NULL, 0, 1000);
429 if (err) {
430 DPRINTFN(0, "device request failed, err=%s "
431 "(ignored)\n", usbd_errstr(err));
432 }
433}
151};
152
153static device_method_t uark_methods[] = {
154 /* Device methods */
155 DEVMETHOD(device_probe, uark_probe),
156 DEVMETHOD(device_attach, uark_attach),
157 DEVMETHOD(device_detach, uark_detach),
158 {0, 0}

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

428
429 err = ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom,
430 &req, NULL, 0, 1000);
431 if (err) {
432 DPRINTFN(0, "device request failed, err=%s "
433 "(ignored)\n", usbd_errstr(err));
434 }
435}
436
437static void
438uark_poll(struct ucom_softc *ucom)
439{
440 struct uark_softc *sc = ucom->sc_parent;
441 usbd_transfer_poll(sc->sc_xfer, UARK_N_TRANSFER);
442}