summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/controller
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2009-04-05 18:20:38 +0000
committerthompsa <thompsa@FreeBSD.org>2009-04-05 18:20:38 +0000
commitf498dc2227c7edc88b3ba4fdfbbe30ec4205369a (patch)
treeff099ee3c8b568709e18b80fe23a0f2cb176ef02 /sys/dev/usb/controller
parent0020f46b4a875816f7768284ac79b7b482aabf39 (diff)
downloadFreeBSD-src-f498dc2227c7edc88b3ba4fdfbbe30ec4205369a.zip
FreeBSD-src-f498dc2227c7edc88b3ba4fdfbbe30ec4205369a.tar.gz
MFp4 //depot/projects/usb@159909
- make usb2_power_mask_t 16-bit - remove "usb2_config_sub" structure from "usb2_config". To compensate for this "usb2_config" has a new field called "usb_mode" which select for which mode the current xfer entry is active. Options are: a) Device mode only b) Host mode only (default-by-zero) c) Both modes. This change was scripted using the following sed script: "s/\.mh\././g". - the standard packet size table in "usb_transfer.c" is now a function, hence the code for the function uses less memory than the table itself. Submitted by: Hans Petter Selasky
Diffstat (limited to 'sys/dev/usb/controller')
-rw-r--r--sys/dev/usb/controller/usb_controller.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/dev/usb/controller/usb_controller.c b/sys/dev/usb/controller/usb_controller.c
index 28b99d3..7ae0ce8 100644
--- a/sys/dev/usb/controller/usb_controller.c
+++ b/sys/dev/usb/controller/usb_controller.c
@@ -209,7 +209,6 @@ usb2_bus_explore(struct usb2_proc_msg *pm)
* First update the USB power state!
*/
usb2_bus_powerd(bus);
-
/*
* Explore the Root USB HUB. This call can sleep,
* exiting Giant, which is actually Giant.
@@ -328,6 +327,20 @@ usb2_bus_attach(struct usb2_proc_msg *pm)
USB_BUS_UNLOCK(bus);
mtx_lock(&Giant); /* XXX not required by USB */
+ /* default power_mask value */
+ bus->hw_power_state =
+ USB_HW_POWER_CONTROL |
+ USB_HW_POWER_BULK |
+ USB_HW_POWER_INTERRUPT |
+ USB_HW_POWER_ISOC |
+ USB_HW_POWER_NON_ROOT_HUB;
+
+ /* make sure power is set at least once */
+
+ if (bus->methods->set_hw_power != NULL) {
+ (bus->methods->set_hw_power) (bus);
+ }
+
/* Allocate the Root USB device */
child = usb2_alloc_device(bus->bdev, bus, NULL, 0, 0, 1,
OpenPOWER on IntegriCloud