uhci_pci.c (184610) | uhci_pci.c (184824) |
---|---|
1/*- 2 * Copyright (c) 1998 The NetBSD Foundation, Inc. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to The NetBSD Foundation 6 * by Lennart Augustsson (augustss@carlstedt.se) at 7 * Carlstedt Research & Technology. 8 * --- 22 unchanged lines hidden (view full) --- 31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 * POSSIBILITY OF SUCH DAMAGE. 36 */ 37 38#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1998 The NetBSD Foundation, Inc. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to The NetBSD Foundation 6 * by Lennart Augustsson (augustss@carlstedt.se) at 7 * Carlstedt Research & Technology. 8 * --- 22 unchanged lines hidden (view full) --- 31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 * POSSIBILITY OF SUCH DAMAGE. 36 */ 37 38#include <sys/cdefs.h> |
39__FBSDID("$FreeBSD: head/sys/dev/usb2/controller/uhci2_pci.c 184610 2008-11-04 02:31:03Z alfred $"); | 39__FBSDID("$FreeBSD: head/sys/dev/usb2/controller/uhci2_pci.c 184824 2008-11-10 20:54:31Z thompsa $"); |
40 41/* Universal Host Controller Interface 42 * 43 * UHCI spec: http://www.intel.com/ 44 */ 45 46/* The low level controller code for UHCI has been split into 47 * PCI probes and UHCI specific code. This was done to facilitate the --- 268 unchanged lines hidden (view full) --- 316 case PCI_USB_REV_1_0: 317 sc->sc_bus.usbrev = USB_REV_1_0; 318 break; 319 default: 320 sc->sc_bus.usbrev = USB_REV_UNKNOWN; 321 break; 322 } 323 | 40 41/* Universal Host Controller Interface 42 * 43 * UHCI spec: http://www.intel.com/ 44 */ 45 46/* The low level controller code for UHCI has been split into 47 * PCI probes and UHCI specific code. This was done to facilitate the --- 268 unchanged lines hidden (view full) --- 316 case PCI_USB_REV_1_0: 317 sc->sc_bus.usbrev = USB_REV_1_0; 318 break; 319 default: 320 sc->sc_bus.usbrev = USB_REV_UNKNOWN; 321 break; 322 } 323 |
324 err = usb2_config_td_setup(&sc->sc_config_td, sc, &sc->sc_bus.mtx, | 324 err = usb2_config_td_setup(&sc->sc_config_td, sc, &sc->sc_bus.bus_mtx, |
325 NULL, 0, 4); 326 if (err) { 327 device_printf(self, "could not setup config thread!\n"); 328 goto error; 329 } 330#if (__FreeBSD_version >= 700031) 331 err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, 332 NULL, (void *)(void *)uhci_interrupt, sc, &sc->sc_intr_hdl); --- 52 unchanged lines hidden (view full) --- 385 /* during module unload there are lots of children leftover */ 386 device_delete_all_children(self); 387 388 /* 389 * disable interrupts that might have been switched on in 390 * uhci_init. 391 */ 392 if (sc->sc_io_res) { | 325 NULL, 0, 4); 326 if (err) { 327 device_printf(self, "could not setup config thread!\n"); 328 goto error; 329 } 330#if (__FreeBSD_version >= 700031) 331 err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, 332 NULL, (void *)(void *)uhci_interrupt, sc, &sc->sc_intr_hdl); --- 52 unchanged lines hidden (view full) --- 385 /* during module unload there are lots of children leftover */ 386 device_delete_all_children(self); 387 388 /* 389 * disable interrupts that might have been switched on in 390 * uhci_init. 391 */ 392 if (sc->sc_io_res) { |
393 mtx_lock(&sc->sc_bus.mtx); | 393 USB_BUS_LOCK(&sc->sc_bus); |
394 395 /* stop the controller */ 396 uhci_reset(sc); 397 | 394 395 /* stop the controller */ 396 uhci_reset(sc); 397 |
398 mtx_unlock(&sc->sc_bus.mtx); | 398 USB_BUS_UNLOCK(&sc->sc_bus); |
399 } 400 pci_disable_busmaster(self); 401 402 if (sc->sc_irq_res && sc->sc_intr_hdl) { 403 int err = bus_teardown_intr(self, sc->sc_irq_res, sc->sc_intr_hdl); 404 405 if (err) { 406 /* XXX or should we panic? */ --- 47 unchanged lines hidden --- | 399 } 400 pci_disable_busmaster(self); 401 402 if (sc->sc_irq_res && sc->sc_intr_hdl) { 403 int err = bus_teardown_intr(self, sc->sc_irq_res, sc->sc_intr_hdl); 404 405 if (err) { 406 /* XXX or should we panic? */ --- 47 unchanged lines hidden --- |