Initialize the endpoints of all interfaces of the configuration to be set. Fixes stuff that needs more than one interface at the same time (ACM modems for example).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21741 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -330,7 +330,8 @@ Device::SetConfigurationAt(uint8 index)
|
||||
fCurrentConfiguration = &fConfigurations[index];
|
||||
|
||||
// Initialize all the endpoints that are now active
|
||||
usb_interface_info *interfaceInfo = fCurrentConfiguration->interface[0].active;
|
||||
for (size_t j = 0; j < fCurrentConfiguration->interface_count; j++) {
|
||||
usb_interface_info *interfaceInfo = fCurrentConfiguration->interface[j].active;
|
||||
for (size_t i = 0; i < interfaceInfo->endpoint_count; i++) {
|
||||
usb_endpoint_info *endpoint = &interfaceInfo->endpoint[i];
|
||||
Pipe *pipe = NULL;
|
||||
@@ -366,6 +367,7 @@ Device::SetConfigurationAt(uint8 index)
|
||||
|
||||
endpoint->handle = pipe->USBID();
|
||||
}
|
||||
}
|
||||
|
||||
// Wait some for the configuration being finished
|
||||
snooze(USB_DELAY_SET_CONFIGURATION);
|
||||
@@ -400,12 +402,14 @@ Device::Unconfigure(bool atDeviceLevel)
|
||||
if (!fCurrentConfiguration)
|
||||
return B_OK;
|
||||
|
||||
usb_interface_info *interfaceInfo = fCurrentConfiguration->interface[0].active;
|
||||
for (size_t j = 0; j < fCurrentConfiguration->interface_count; j++) {
|
||||
usb_interface_info *interfaceInfo = fCurrentConfiguration->interface[j].active;
|
||||
for (size_t i = 0; i < interfaceInfo->endpoint_count; i++) {
|
||||
usb_endpoint_info *endpoint = &interfaceInfo->endpoint[i];
|
||||
delete (Pipe *)GetStack()->GetObject(endpoint->handle);
|
||||
endpoint->handle = 0;
|
||||
}
|
||||
}
|
||||
|
||||
fCurrentConfiguration = NULL;
|
||||
return B_OK;
|
||||
|
||||
Reference in New Issue
Block a user