Deleted Added
full compact
if_cue.c (185950) if_cue.c (186454)
1/*-
2 * Copyright (c) 1997, 1998, 1999, 2000
3 * Bill Paul <wpaul@ee.columbia.edu>. 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

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

26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30 * THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1997, 1998, 1999, 2000
3 * Bill Paul <wpaul@ee.columbia.edu>. 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

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

26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30 * THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/sys/dev/usb2/ethernet/if_cue2.c 185950 2008-12-11 23:17:48Z thompsa $");
34__FBSDID("$FreeBSD: head/sys/dev/usb2/ethernet/if_cue2.c 186454 2008-12-23 19:59:21Z thompsa $");
35
36/*
37 * CATC USB-EL1210A USB to ethernet driver. Used in the CATC Netmate
38 * adapters and others.
39 *
40 * Written by Bill Paul <wpaul@ee.columbia.edu>
41 * Electrical Engineering Department
42 * Columbia University, New York City

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

403 sc->sc_udev = uaa->device;
404 sc->sc_dev = dev;
405 sc->sc_unit = device_get_unit(dev);
406
407 device_set_usb2_desc(dev);
408
409 mtx_init(&sc->sc_mtx, "cue lock", NULL, MTX_DEF | MTX_RECURSE);
410
35
36/*
37 * CATC USB-EL1210A USB to ethernet driver. Used in the CATC Netmate
38 * adapters and others.
39 *
40 * Written by Bill Paul <wpaul@ee.columbia.edu>
41 * Electrical Engineering Department
42 * Columbia University, New York City

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

403 sc->sc_udev = uaa->device;
404 sc->sc_dev = dev;
405 sc->sc_unit = device_get_unit(dev);
406
407 device_set_usb2_desc(dev);
408
409 mtx_init(&sc->sc_mtx, "cue lock", NULL, MTX_DEF | MTX_RECURSE);
410
411 usb2_callout_init_mtx(&sc->sc_watchdog,
412 &sc->sc_mtx, CALLOUT_RETURNUNLOCKED);
411 usb2_callout_init_mtx(&sc->sc_watchdog, &sc->sc_mtx, 0);
413
414 iface_index = CUE_IFACE_IDX;
415 error = usb2_transfer_setup(uaa->device, &iface_index,
416 sc->sc_xfer, cue_config, CUE_ENDPT_MAX, sc, &sc->sc_mtx);
417 if (error) {
418 device_printf(dev, "allocating USB "
419 "transfers failed!\n");
420 goto detach;

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

428 }
429 mtx_lock(&sc->sc_mtx);
430
431 /* start setup */
432
433 usb2_config_td_queue_command
434 (&sc->sc_config_td, NULL, &cue_cfg_first_time_setup, 0, 0);
435
412
413 iface_index = CUE_IFACE_IDX;
414 error = usb2_transfer_setup(uaa->device, &iface_index,
415 sc->sc_xfer, cue_config, CUE_ENDPT_MAX, sc, &sc->sc_mtx);
416 if (error) {
417 device_printf(dev, "allocating USB "
418 "transfers failed!\n");
419 goto detach;

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

427 }
428 mtx_lock(&sc->sc_mtx);
429
430 /* start setup */
431
432 usb2_config_td_queue_command
433 (&sc->sc_config_td, NULL, &cue_cfg_first_time_setup, 0, 0);
434
436 /* start watchdog (will exit mutex) */
437
438 cue_watchdog(sc);
435 cue_watchdog(sc);
439
436 mtx_unlock(&sc->sc_mtx);
440 return (0); /* success */
441
442detach:
443 cue_detach(dev);
444 return (ENXIO); /* failure */
445}
446
447static void

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

874
875 mtx_assert(&sc->sc_mtx, MA_OWNED);
876
877 usb2_config_td_queue_command
878 (&sc->sc_config_td, NULL, &cue_cfg_tick, 0, 0);
879
880 usb2_callout_reset(&sc->sc_watchdog,
881 hz, &cue_watchdog, sc);
437 return (0); /* success */
438
439detach:
440 cue_detach(dev);
441 return (ENXIO); /* failure */
442}
443
444static void

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

871
872 mtx_assert(&sc->sc_mtx, MA_OWNED);
873
874 usb2_config_td_queue_command
875 (&sc->sc_config_td, NULL, &cue_cfg_tick, 0, 0);
876
877 usb2_callout_reset(&sc->sc_watchdog,
878 hz, &cue_watchdog, sc);
882
883 mtx_unlock(&sc->sc_mtx);
884}
885
886/*
887 * Stop the adapter and free any mbufs allocated to the
888 * RX and TX lists.
889 */
890static void
891cue_cfg_pre_stop(struct cue_softc *sc,

--- 53 unchanged lines hidden ---
879}
880
881/*
882 * Stop the adapter and free any mbufs allocated to the
883 * RX and TX lists.
884 */
885static void
886cue_cfg_pre_stop(struct cue_softc *sc,

--- 53 unchanged lines hidden ---