USB: Properly assign IDs to USB Bus Managers (HCI drivers).
Previously they would just get -1, as the BusManager class would request their ID before they had been added to the Stack. Now we add them to the stack inside ::Start(), rather than letting the individual drivers do that just after ::Start(), and then assign the ID there directly.
This commit is contained in:
parent
d6f3954f39
commit
a182f19364
@ -14,7 +14,7 @@ BusManager::BusManager(Stack *stack)
|
||||
: fInitOK(false),
|
||||
fStack(stack),
|
||||
fRootHub(NULL),
|
||||
fUSBID(fStack->IndexOfBusManager(this))
|
||||
fUSBID((uint32)-1)
|
||||
{
|
||||
mutex_init(&fLock, "usb busmanager lock");
|
||||
|
||||
@ -253,6 +253,8 @@ BusManager::FreeDevice(Device *device)
|
||||
status_t
|
||||
BusManager::Start()
|
||||
{
|
||||
fStack->AddBusManager(this);
|
||||
fUSBID = fStack->IndexOfBusManager(this);
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
@ -1216,8 +1216,10 @@ EHCI::AddTo(Stack *stack)
|
||||
// the bus took it away
|
||||
item = new(std::nothrow) pci_info;
|
||||
|
||||
bus->Start();
|
||||
stack->AddBusManager(bus);
|
||||
if (bus->Start() != B_OK) {
|
||||
delete bus;
|
||||
continue;
|
||||
}
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
@ -647,8 +647,10 @@ OHCI::AddTo(Stack *stack)
|
||||
// the bus took it away
|
||||
item = new(std::nothrow) pci_info;
|
||||
|
||||
bus->Start();
|
||||
stack->AddBusManager(bus);
|
||||
if (bus->Start() != B_OK) {
|
||||
delete bus;
|
||||
continue;
|
||||
}
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
@ -1923,8 +1923,10 @@ UHCI::AddTo(Stack *stack)
|
||||
// the bus took it away
|
||||
item = new(std::nothrow) pci_info;
|
||||
|
||||
bus->Start();
|
||||
stack->AddBusManager(bus);
|
||||
if (bus->Start() != B_OK) {
|
||||
delete bus;
|
||||
continue;
|
||||
}
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
@ -864,8 +864,10 @@ XHCI::AddTo(Stack *stack)
|
||||
// the bus took it away
|
||||
item = new(std::nothrow) pci_info;
|
||||
|
||||
bus->Start();
|
||||
stack->AddBusManager(bus);
|
||||
if (bus->Start() != B_OK) {
|
||||
delete bus;
|
||||
continue;
|
||||
}
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user