* 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:
@@ -135,7 +135,7 @@ BusManager::AllocateDevice(Hub *parent, uint8 port, usb_speed speed)
|
|||||||
}
|
}
|
||||||
|
|
||||||
status_t result = B_ERROR;
|
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
|
// Set the address of the device USB 1.1 spec p202
|
||||||
result = defaultPipe->SendRequest(
|
result = defaultPipe->SendRequest(
|
||||||
USB_REQTYPE_STANDARD | USB_REQTYPE_DEVICE_OUT, // type
|
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"));
|
TRACE(("USB BusManager: creating new device\n"));
|
||||||
Device *device = new(std::nothrow) Device(parent, port, deviceDescriptor,
|
Device *device = new(std::nothrow) Device(parent, port, deviceDescriptor,
|
||||||
deviceAddress, speed);
|
deviceAddress, speed, false);
|
||||||
if (!device) {
|
if (!device) {
|
||||||
TRACE_ERROR(("USB BusManager: no memory to allocate device\n"));
|
TRACE_ERROR(("USB BusManager: no memory to allocate device\n"));
|
||||||
FreeAddress(deviceAddress);
|
FreeAddress(deviceAddress);
|
||||||
|
|||||||
@@ -11,11 +11,12 @@
|
|||||||
|
|
||||||
|
|
||||||
Device::Device(Object *parent, int8 hubPort, usb_device_descriptor &desc,
|
Device::Device(Object *parent, int8 hubPort, usb_device_descriptor &desc,
|
||||||
int8 deviceAddress, usb_speed speed)
|
int8 deviceAddress, usb_speed speed, bool isRootHub)
|
||||||
: Object(parent),
|
: Object(parent),
|
||||||
fDeviceDescriptor(desc),
|
fDeviceDescriptor(desc),
|
||||||
fInitOK(false),
|
fInitOK(false),
|
||||||
fAvailable(true),
|
fAvailable(true),
|
||||||
|
fIsRootHub(isRootHub),
|
||||||
fConfigurations(NULL),
|
fConfigurations(NULL),
|
||||||
fCurrentConfiguration(NULL),
|
fCurrentConfiguration(NULL),
|
||||||
fSpeed(speed),
|
fSpeed(speed),
|
||||||
@@ -372,7 +373,8 @@ Device::SetConfigurationAt(uint8 index)
|
|||||||
InitEndpoints();
|
InitEndpoints();
|
||||||
|
|
||||||
// Wait some for the configuration being finished
|
// Wait some for the configuration being finished
|
||||||
snooze(USB_DELAY_SET_CONFIGURATION);
|
if (!fIsRootHub)
|
||||||
|
snooze(USB_DELAY_SET_CONFIGURATION);
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
Hub::Hub(Object *parent, int8 hubPort, usb_device_descriptor &desc,
|
Hub::Hub(Object *parent, int8 hubPort, usb_device_descriptor &desc,
|
||||||
int8 deviceAddress, usb_speed speed, bool isRootHub)
|
int8 deviceAddress, usb_speed speed, bool isRootHub)
|
||||||
: Device(parent, hubPort, desc, deviceAddress, speed),
|
: Device(parent, hubPort, desc, deviceAddress, speed, isRootHub),
|
||||||
fInterruptPipe(NULL)
|
fInterruptPipe(NULL)
|
||||||
{
|
{
|
||||||
TRACE(("USB Hub %d: creating hub\n", DeviceAddress()));
|
TRACE(("USB Hub %d: creating hub\n", DeviceAddress()));
|
||||||
|
|||||||
@@ -414,7 +414,7 @@ public:
|
|||||||
Device(Object *parent, int8 hubPort,
|
Device(Object *parent, int8 hubPort,
|
||||||
usb_device_descriptor &desc,
|
usb_device_descriptor &desc,
|
||||||
int8 deviceAddress,
|
int8 deviceAddress,
|
||||||
usb_speed speed);
|
usb_speed speed, bool isRootHub);
|
||||||
virtual ~Device();
|
virtual ~Device();
|
||||||
|
|
||||||
status_t InitCheck();
|
status_t InitCheck();
|
||||||
@@ -469,6 +469,7 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
bool fAvailable;
|
bool fAvailable;
|
||||||
|
bool fIsRootHub;
|
||||||
usb_configuration_info *fConfigurations;
|
usb_configuration_info *fConfigurations;
|
||||||
usb_configuration_info *fCurrentConfiguration;
|
usb_configuration_info *fCurrentConfiguration;
|
||||||
usb_speed fSpeed;
|
usb_speed fSpeed;
|
||||||
|
|||||||
Reference in New Issue
Block a user