* Use the rescan function when compiled for Haiku
* Move waiting for the first explore to complete * Small cleanup git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23099 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -26,8 +26,6 @@ Pipe::~Pipe()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Pipe::InitCommon(int8 deviceAddress, uint8 endpointAddress, usb_speed speed,
|
Pipe::InitCommon(int8 deviceAddress, uint8 endpointAddress, usb_speed speed,
|
||||||
pipeDirection direction, size_t maxPacketSize, uint8 interval,
|
pipeDirection direction, size_t maxPacketSize, uint8 interval,
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ Stack::Stack()
|
|||||||
size_t bufferSize = sizeof(moduleName);
|
size_t bufferSize = sizeof(moduleName);
|
||||||
|
|
||||||
TRACE(("USB Stack: looking for host controller modules\n"));
|
TRACE(("USB Stack: looking for host controller modules\n"));
|
||||||
while(read_next_module_name(moduleList, moduleName, &bufferSize) == B_OK) {
|
while (read_next_module_name(moduleList, moduleName, &bufferSize) == B_OK) {
|
||||||
bufferSize = sizeof(moduleName);
|
bufferSize = sizeof(moduleName);
|
||||||
TRACE(("USB Stack: found module %s\n", moduleName));
|
TRACE(("USB Stack: found module %s\n", moduleName));
|
||||||
|
|
||||||
@@ -81,6 +81,12 @@ Stack::Stack()
|
|||||||
fExploreThread = spawn_kernel_thread(ExploreThread, "usb explore",
|
fExploreThread = spawn_kernel_thread(ExploreThread, "usb explore",
|
||||||
B_LOW_PRIORITY, this);
|
B_LOW_PRIORITY, this);
|
||||||
resume_thread(fExploreThread);
|
resume_thread(fExploreThread);
|
||||||
|
|
||||||
|
// wait for the first explore to complete. this ensures that a driver that
|
||||||
|
// is opening the module does not get rescanned while or before installing
|
||||||
|
// its hooks.
|
||||||
|
while (!fFirstExploreDone)
|
||||||
|
snooze(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -110,7 +116,6 @@ Stack::InitCheck()
|
|||||||
{
|
{
|
||||||
if (fBusManagers.Count() == 0)
|
if (fBusManagers.Count() == 0)
|
||||||
return ENODEV;
|
return ENODEV;
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -355,7 +360,7 @@ Stack::RescanDrivers(rescan_item *rescanItem)
|
|||||||
close(devFS);
|
close(devFS);
|
||||||
#else
|
#else
|
||||||
// use the private devfs API under Haiku
|
// use the private devfs API under Haiku
|
||||||
//devfs_rescan_driver(name);
|
devfs_rescan_driver(rescanItem->name);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
rescan_item *next = rescanItem->link;
|
rescan_item *next = rescanItem->link;
|
||||||
@@ -436,11 +441,6 @@ Stack::InstallNotify(const char *driverName, const usb_notify_hooks *hooks)
|
|||||||
{
|
{
|
||||||
TRACE(("USB Stack: installing notify hooks for driver \"%s\"\n", driverName));
|
TRACE(("USB Stack: installing notify hooks for driver \"%s\"\n", driverName));
|
||||||
|
|
||||||
// wait for the first explore to complete
|
|
||||||
// this ensures that we get all initial devices
|
|
||||||
while (!fFirstExploreDone)
|
|
||||||
snooze(1000);
|
|
||||||
|
|
||||||
usb_driver_info *element = fDriverList;
|
usb_driver_info *element = fDriverList;
|
||||||
while (element) {
|
while (element) {
|
||||||
if (strcmp(element->driver_name, driverName) == 0) {
|
if (strcmp(element->driver_name, driverName) == 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user