uhso.c (214761) | uhso.c (214843) |
---|---|
1/*- 2 * Copyright (c) 2010 Fredrik Lindberg <fli@shapeshifter.se> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 10 unchanged lines hidden (view full) --- 19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * 25 */ 26#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2010 Fredrik Lindberg <fli@shapeshifter.se> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 10 unchanged lines hidden (view full) --- 19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * 25 */ 26#include <sys/cdefs.h> |
27__FBSDID("$FreeBSD: head/sys/dev/usb/net/uhso.c 214761 2010-11-03 21:50:49Z n_hibma $"); | 27__FBSDID("$FreeBSD: head/sys/dev/usb/net/uhso.c 214843 2010-11-05 19:12:48Z n_hibma $"); |
28 29#include <sys/param.h> 30#include <sys/types.h> 31#include <sys/sockio.h> 32#include <sys/mbuf.h> 33#include <sys/malloc.h> 34#include <sys/kernel.h> 35#include <sys/module.h> --- 861 unchanged lines hidden (view full) --- 897 error = uhso_attach_muxserial(sc, iface, type); 898 if (error == 0 && sc->sc_ttys > 0) { 899 error = ucom_attach(&sc->sc_super_ucom, sc->sc_ucom, 900 sc->sc_ttys, sc, &uhso_ucom_callback, &sc->sc_mtx); 901 if (error) { 902 device_printf(sc->sc_dev, "ucom_attach failed\n"); 903 return (ENXIO); 904 } | 28 29#include <sys/param.h> 30#include <sys/types.h> 31#include <sys/sockio.h> 32#include <sys/mbuf.h> 33#include <sys/malloc.h> 34#include <sys/kernel.h> 35#include <sys/module.h> --- 861 unchanged lines hidden (view full) --- 897 error = uhso_attach_muxserial(sc, iface, type); 898 if (error == 0 && sc->sc_ttys > 0) { 899 error = ucom_attach(&sc->sc_super_ucom, sc->sc_ucom, 900 sc->sc_ttys, sc, &uhso_ucom_callback, &sc->sc_mtx); 901 if (error) { 902 device_printf(sc->sc_dev, "ucom_attach failed\n"); 903 return (ENXIO); 904 } |
905 ucom_set_pnpinfo_usb(&sc->sc_super_ucom, sc->sc_dev); |
|
905 906 mtx_lock(&sc->sc_mtx); 907 usbd_transfer_start(sc->sc_xfer[UHSO_MUX_ENDPT_INTR]); 908 mtx_unlock(&sc->sc_mtx); 909 } 910 } else if ((UHSO_IFACE_USB_TYPE(type) & UHSO_IF_BULK) && 911 UHSO_IFACE_PORT(type) & UHSO_PORT_SERIAL) { 912 913 error = uhso_attach_bulkserial(sc, iface, type); 914 if (error) 915 return (ENXIO); 916 917 error = ucom_attach(&sc->sc_super_ucom, sc->sc_ucom, 918 sc->sc_ttys, sc, &uhso_ucom_callback, &sc->sc_mtx); 919 if (error) { 920 device_printf(sc->sc_dev, "ucom_attach failed\n"); 921 return (ENXIO); 922 } | 906 907 mtx_lock(&sc->sc_mtx); 908 usbd_transfer_start(sc->sc_xfer[UHSO_MUX_ENDPT_INTR]); 909 mtx_unlock(&sc->sc_mtx); 910 } 911 } else if ((UHSO_IFACE_USB_TYPE(type) & UHSO_IF_BULK) && 912 UHSO_IFACE_PORT(type) & UHSO_PORT_SERIAL) { 913 914 error = uhso_attach_bulkserial(sc, iface, type); 915 if (error) 916 return (ENXIO); 917 918 error = ucom_attach(&sc->sc_super_ucom, sc->sc_ucom, 919 sc->sc_ttys, sc, &uhso_ucom_callback, &sc->sc_mtx); 920 if (error) { 921 device_printf(sc->sc_dev, "ucom_attach failed\n"); 922 return (ENXIO); 923 } |
924 ucom_set_pnpinfo_usb(&sc->sc_super_ucom, sc->sc_dev); |
|
923 } 924 else { 925 UHSO_DPRINTF(0, "Unknown type %x\n", type); 926 return (ENXIO); 927 } 928 929 return (0); 930} --- 974 unchanged lines hidden --- | 925 } 926 else { 927 UHSO_DPRINTF(0, "Unknown type %x\n", type); 928 return (ENXIO); 929 } 930 931 return (0); 932} --- 974 unchanged lines hidden --- |