* Another tiny cut in stack load time: do not delay after setting the current

configuration of a root hub
* Cut down on number of retries to set the initial device address

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24804 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz
2008-04-05 00:38:38 +00:00
parent f1a9c3c214
commit b04afa2413
4 changed files with 9 additions and 6 deletions
@@ -135,7 +135,7 @@ BusManager::AllocateDevice(Hub *parent, uint8 port, usb_speed speed)
}
status_t result = B_ERROR;
for (int32 i = 0; i < 15; i++) {
for (int32 i = 0; i < 3; i++) {
// Set the address of the device USB 1.1 spec p202
result = defaultPipe->SendRequest(
USB_REQTYPE_STANDARD | USB_REQTYPE_DEVICE_OUT, // type
@@ -223,7 +223,7 @@ BusManager::AllocateDevice(Hub *parent, uint8 port, usb_speed speed)
TRACE(("USB BusManager: creating new device\n"));
Device *device = new(std::nothrow) Device(parent, port, deviceDescriptor,
deviceAddress, speed);
deviceAddress, speed, false);
if (!device) {
TRACE_ERROR(("USB BusManager: no memory to allocate device\n"));
FreeAddress(deviceAddress);
@@ -11,11 +11,12 @@
Device::Device(Object *parent, int8 hubPort, usb_device_descriptor &desc,
int8 deviceAddress, usb_speed speed)
int8 deviceAddress, usb_speed speed, bool isRootHub)
: Object(parent),
fDeviceDescriptor(desc),
fInitOK(false),
fAvailable(true),
fIsRootHub(isRootHub),
fConfigurations(NULL),
fCurrentConfiguration(NULL),
fSpeed(speed),
@@ -372,7 +373,8 @@ Device::SetConfigurationAt(uint8 index)
InitEndpoints();
// Wait some for the configuration being finished
snooze(USB_DELAY_SET_CONFIGURATION);
if (!fIsRootHub)
snooze(USB_DELAY_SET_CONFIGURATION);
return B_OK;
}
+1 -1
View File
@@ -13,7 +13,7 @@
Hub::Hub(Object *parent, int8 hubPort, usb_device_descriptor &desc,
int8 deviceAddress, usb_speed speed, bool isRootHub)
: Device(parent, hubPort, desc, deviceAddress, speed),
: Device(parent, hubPort, desc, deviceAddress, speed, isRootHub),
fInterruptPipe(NULL)
{
TRACE(("USB Hub %d: creating hub\n", DeviceAddress()));
+2 -1
View File
@@ -414,7 +414,7 @@ public:
Device(Object *parent, int8 hubPort,
usb_device_descriptor &desc,
int8 deviceAddress,
usb_speed speed);
usb_speed speed, bool isRootHub);
virtual ~Device();
status_t InitCheck();
@@ -469,6 +469,7 @@ protected:
private:
bool fAvailable;
bool fIsRootHub;
usb_configuration_info *fConfigurations;
usb_configuration_info *fCurrentConfiguration;
usb_speed fSpeed;