Deleted Added
full compact
usb_controller.c (215802) usb_controller.c (215812)
1/* $FreeBSD: head/sys/dev/usb/controller/usb_controller.c 215802 2010-11-24 19:11:32Z weongyo $ */
1/* $FreeBSD: head/sys/dev/usb/controller/usb_controller.c 215812 2010-11-25 03:30:43Z weongyo $ */
2/*-
3 * Copyright (c) 2008 Hans Petter Selasky. 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
9 * notice, this list of conditions and the following disclaimer.

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

202 /* Get rid of USB explore process */
203
204 usb_proc_free(&bus->explore_proc);
205
206 /* Get rid of control transfer process */
207
208 usb_proc_free(&bus->control_xfer_proc);
209
2/*-
3 * Copyright (c) 2008 Hans Petter Selasky. 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
9 * notice, this list of conditions and the following disclaimer.

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

202 /* Get rid of USB explore process */
203
204 usb_proc_free(&bus->explore_proc);
205
206 /* Get rid of control transfer process */
207
208 usb_proc_free(&bus->control_xfer_proc);
209
210 usbpf_detach(bus);
211
210 return (0);
211}
212
213/*------------------------------------------------------------------------*
214 * usb_bus_explore
215 *
216 * This function is used to explore the device tree from the root.
217 *------------------------------------------------------------------------*/

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

430{
431 const char *pname = device_get_nameunit(dev);
432
433 mtx_lock(&Giant);
434 if (usb_devclass_ptr == NULL)
435 usb_devclass_ptr = devclass_find("usbus");
436 mtx_unlock(&Giant);
437
212 return (0);
213}
214
215/*------------------------------------------------------------------------*
216 * usb_bus_explore
217 *
218 * This function is used to explore the device tree from the root.
219 *------------------------------------------------------------------------*/

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

432{
433 const char *pname = device_get_nameunit(dev);
434
435 mtx_lock(&Giant);
436 if (usb_devclass_ptr == NULL)
437 usb_devclass_ptr = devclass_find("usbus");
438 mtx_unlock(&Giant);
439
440 usbpf_attach(bus);
441
438 /* Initialise USB process messages */
439 bus->explore_msg[0].hdr.pm_callback = &usb_bus_explore;
440 bus->explore_msg[0].bus = bus;
441 bus->explore_msg[1].hdr.pm_callback = &usb_bus_explore;
442 bus->explore_msg[1].bus = bus;
443
444 bus->detach_msg[0].hdr.pm_callback = &usb_bus_detach;
445 bus->detach_msg[0].bus = bus;

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

543 mtx_init(&bus->bus_mtx, device_get_nameunit(bus->parent),
544 NULL, MTX_DEF | MTX_RECURSE);
545
546 usb_callout_init_mtx(&bus->power_wdog,
547 &bus->bus_mtx, 0);
548
549 TAILQ_INIT(&bus->intr_q.head);
550
442 /* Initialise USB process messages */
443 bus->explore_msg[0].hdr.pm_callback = &usb_bus_explore;
444 bus->explore_msg[0].bus = bus;
445 bus->explore_msg[1].hdr.pm_callback = &usb_bus_explore;
446 bus->explore_msg[1].bus = bus;
447
448 bus->detach_msg[0].hdr.pm_callback = &usb_bus_detach;
449 bus->detach_msg[0].bus = bus;

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

547 mtx_init(&bus->bus_mtx, device_get_nameunit(bus->parent),
548 NULL, MTX_DEF | MTX_RECURSE);
549
550 usb_callout_init_mtx(&bus->power_wdog,
551 &bus->bus_mtx, 0);
552
553 TAILQ_INIT(&bus->intr_q.head);
554
551 usbpf_attach(bus);
552
553#if USB_HAVE_BUSDMA
554 usb_dma_tag_setup(bus->dma_parent_tag, bus->dma_tags,
555 dmat, &bus->bus_mtx, NULL, 32, USB_BUS_DMA_TAG_MAX);
556#endif
557 if ((bus->devices_max > USB_MAX_DEVICES) ||
558 (bus->devices_max < USB_MIN_DEVICES) ||
559 (bus->devices == NULL)) {
560 DPRINTFN(0, "Devices field has not been "

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

592{
593#if USB_HAVE_BUSDMA
594 if (cb) {
595 cb(bus, &usb_bus_mem_free_all_cb);
596 }
597 usb_dma_tag_unsetup(bus->dma_parent_tag);
598#endif
599
555#if USB_HAVE_BUSDMA
556 usb_dma_tag_setup(bus->dma_parent_tag, bus->dma_tags,
557 dmat, &bus->bus_mtx, NULL, 32, USB_BUS_DMA_TAG_MAX);
558#endif
559 if ((bus->devices_max > USB_MAX_DEVICES) ||
560 (bus->devices_max < USB_MIN_DEVICES) ||
561 (bus->devices == NULL)) {
562 DPRINTFN(0, "Devices field has not been "

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

594{
595#if USB_HAVE_BUSDMA
596 if (cb) {
597 cb(bus, &usb_bus_mem_free_all_cb);
598 }
599 usb_dma_tag_unsetup(bus->dma_parent_tag);
600#endif
601
600 usbpf_detach(bus);
601
602 mtx_destroy(&bus->bus_mtx);
603}
604
605struct usb_bus *
606usb_bus_find(const char *name)
607{
608 struct usb_bus *ubus;
609 devclass_t dc;

--- 21 unchanged lines hidden ---
602 mtx_destroy(&bus->bus_mtx);
603}
604
605struct usb_bus *
606usb_bus_find(const char *name)
607{
608 struct usb_bus *ubus;
609 devclass_t dc;

--- 21 unchanged lines hidden ---