From f498dc2227c7edc88b3ba4fdfbbe30ec4205369a Mon Sep 17 00:00:00 2001 From: thompsa Date: Sun, 5 Apr 2009 18:20:38 +0000 Subject: 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 --- sys/dev/usb/controller/usb_controller.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'sys/dev/usb/controller') 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, -- cgit v1.1