ulpt.c (185950) | ulpt.c (186454) |
---|---|
1#include <sys/cdefs.h> | 1#include <sys/cdefs.h> |
2__FBSDID("$FreeBSD: head/sys/dev/usb2/serial/ulpt2.c 185950 2008-12-11 23:17:48Z thompsa $"); | 2__FBSDID("$FreeBSD: head/sys/dev/usb2/serial/ulpt2.c 186454 2008-12-23 19:59:21Z thompsa $"); |
3 4/* $NetBSD: ulpt.c,v 1.60 2003/10/04 21:19:50 augustss Exp $ */ 5 6/*- 7 * Copyright (c) 1998, 2003 The NetBSD Foundation, Inc. 8 * All rights reserved. 9 * 10 * This code is derived from software contributed to The NetBSD Foundation --- 544 unchanged lines hidden (view full) --- 555 556 sc->sc_dev = dev; 557 sc->sc_udev = uaa->device; 558 559 device_set_usb2_desc(dev); 560 561 mtx_init(&sc->sc_mtx, "ulpt lock", NULL, MTX_DEF | MTX_RECURSE); 562 | 3 4/* $NetBSD: ulpt.c,v 1.60 2003/10/04 21:19:50 augustss Exp $ */ 5 6/*- 7 * Copyright (c) 1998, 2003 The NetBSD Foundation, Inc. 8 * All rights reserved. 9 * 10 * This code is derived from software contributed to The NetBSD Foundation --- 544 unchanged lines hidden (view full) --- 555 556 sc->sc_dev = dev; 557 sc->sc_udev = uaa->device; 558 559 device_set_usb2_desc(dev); 560 561 mtx_init(&sc->sc_mtx, "ulpt lock", NULL, MTX_DEF | MTX_RECURSE); 562 |
563 usb2_callout_init_mtx(&sc->sc_watchdog, 564 &sc->sc_mtx, CALLOUT_RETURNUNLOCKED); | 563 usb2_callout_init_mtx(&sc->sc_watchdog, &sc->sc_mtx, 0); |
565 566 /* search through all the descriptors looking for bidir mode */ 567 568 id = usb2_get_interface_descriptor(uaa->iface); 569 alt_index = 0 - 1; 570 while (1) { 571 if (id == NULL) { 572 break; --- 93 unchanged lines hidden (view full) --- 666 &unlpt_fifo_methods, &sc->sc_fifo_noreset, 667 unit, 0 - 1, uaa->info.bIfaceIndex); 668 if (error) { 669 goto detach; 670 } 671 /* start reading of status */ 672 673 mtx_lock(&sc->sc_mtx); | 564 565 /* search through all the descriptors looking for bidir mode */ 566 567 id = usb2_get_interface_descriptor(uaa->iface); 568 alt_index = 0 - 1; 569 while (1) { 570 if (id == NULL) { 571 break; --- 93 unchanged lines hidden (view full) --- 665 &unlpt_fifo_methods, &sc->sc_fifo_noreset, 666 unit, 0 - 1, uaa->info.bIfaceIndex); 667 if (error) { 668 goto detach; 669 } 670 /* start reading of status */ 671 672 mtx_lock(&sc->sc_mtx); |
674 675 ulpt_watchdog(sc); /* will unlock mutex */ 676 | 673 ulpt_watchdog(sc); 674 mtx_unlock(&sc->sc_mtx); |
677 return (0); 678 679detach: 680 ulpt_detach(dev); 681 return (ENOMEM); 682} 683 684static int --- 72 unchanged lines hidden (view full) --- 757 struct ulpt_softc *sc = arg; 758 759 mtx_assert(&sc->sc_mtx, MA_OWNED); 760 761 usb2_transfer_start(sc->sc_xfer[2]); 762 763 usb2_callout_reset(&sc->sc_watchdog, 764 hz, &ulpt_watchdog, sc); | 675 return (0); 676 677detach: 678 ulpt_detach(dev); 679 return (ENOMEM); 680} 681 682static int --- 72 unchanged lines hidden (view full) --- 755 struct ulpt_softc *sc = arg; 756 757 mtx_assert(&sc->sc_mtx, MA_OWNED); 758 759 usb2_transfer_start(sc->sc_xfer[2]); 760 761 usb2_callout_reset(&sc->sc_watchdog, 762 hz, &ulpt_watchdog, sc); |
765 766 mtx_unlock(&sc->sc_mtx); | |
767} 768 769static devclass_t ulpt_devclass; 770 771static device_method_t ulpt_methods[] = { 772 DEVMETHOD(device_probe, ulpt_probe), 773 DEVMETHOD(device_attach, ulpt_attach), 774 DEVMETHOD(device_detach, ulpt_detach), --- 12 unchanged lines hidden --- | 763} 764 765static devclass_t ulpt_devclass; 766 767static device_method_t ulpt_methods[] = { 768 DEVMETHOD(device_probe, ulpt_probe), 769 DEVMETHOD(device_attach, ulpt_attach), 770 DEVMETHOD(device_detach, ulpt_detach), --- 12 unchanged lines hidden --- |