Fix a few critical typos/mistakes (like interruptvector/interruptlevel),
stdcall for thread's func, etc. Also added some "hacks" into hub's
thread, but at least it leads to first steps to device enumeration.
Driver (OHCI) bugchecks on my_pci_pool_allocation now (when trying to
send URB).
Modified: trunk/reactos/drivers/usb/cromwell/core/hub.c
Modified: trunk/reactos/drivers/usb/cromwell/host/ohci_main.c
Modified: trunk/reactos/drivers/usb/cromwell/linux/linux_wrapper.h
Modified: trunk/reactos/drivers/usb/cromwell/sys/linuxwrapper.c
_____
Modified: trunk/reactos/drivers/usb/cromwell/core/hub.c
--- trunk/reactos/drivers/usb/cromwell/core/hub.c 2005-06-04
21:07:00 UTC (rev 15794)
+++ trunk/reactos/drivers/usb/cromwell/core/hub.c 2005-06-04
21:35:07 UTC (rev 15795)
@@ -1019,6 +1019,7 @@
* safe since we delete the hub from the event list.
* Not the most efficient, but avoids deadlocks.
*/
+ DPRINT1("hub_events() called\n");
while (m<5) {
m++;
@@ -1138,7 +1139,8 @@
spin_unlock_irqrestore(&hub_event_lock, flags);
}
-static int hub_thread(void *__hub)
+// ReactOS: STDCALL is needed here
+static int STDCALL hub_thread(void *__hub)
{
/*
* This thread doesn't need any user-level access,
@@ -1149,14 +1151,25 @@
allow_signal(SIGKILL);
/* Send me a signal to get me die (for debugging) */
do {
-
+
+ /* The following is just for debug */
+ inc_jiffies(1);
+ do_all_timers();
+ handle_irqs(-1);
+ /* End of debug hack*/
+
hub_events();
+ /* The following is just for debug */
+ handle_irqs(-1);
+ /* End of debug hack*/
+
+
//FIXME: Correct this
//wait_event_interruptible(khubd_wait,
!list_empty(&hub_event_list)); // interruptable_sleep_on analog - below
- while (!list_empty(&hub_event_list)) {
- interruptible_sleep_on(&khubd_wait);
- }
+ //while (!list_empty(&hub_event_list)) {
+ // interruptible_sleep_on(&khubd_wait);
+ //}
if (current->flags & PF_FREEZE)
refrigerator(PF_IOTHREAD);
_____
Modified: trunk/reactos/drivers/usb/cromwell/host/ohci_main.c
--- trunk/reactos/drivers/usb/cromwell/host/ohci_main.c 2005-06-04
21:07:00 UTC (rev 15794)
+++ trunk/reactos/drivers/usb/cromwell/host/ohci_main.c 2005-06-04
21:35:07 UTC (rev 15795)
@@ -125,7 +125,8 @@
ohci_hcd_pci_cleanup();
}
-NTSTATUS InitLinuxWrapper(PDEVICE_OBJECT DeviceObject)
+NTSTATUS
+InitLinuxWrapper(PDEVICE_OBJECT DeviceObject)
{
NTSTATUS Status;
POHCI_DEVICE_EXTENSION DeviceExtension =
(POHCI_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
@@ -134,7 +135,7 @@
dev = ExAllocatePoolWithTag(PagedPool, sizeof(struct pci_dev),
USB_OHCI_TAG);
init_wrapper(dev);
- dev->irq = DeviceExtension->InterruptLevel;
+ dev->irq = DeviceExtension->InterruptVector;
dev->dev_ext = (PVOID)DeviceExtension;
dev->slot_name = ExAllocatePoolWithTag(NonPagedPool, 128,
USB_OHCI_TAG); // 128 max len for slot name
@@ -151,7 +152,7 @@
// Probe device with real id now
ohci_pci_driver.probe(dev, pci_ids);
- DPRINT("InitLinuxWrapper() done\n");
+ DPRINT1("InitLinuxWrapper() done\n");
return STATUS_SUCCESS;
}
_____
Modified: trunk/reactos/drivers/usb/cromwell/linux/linux_wrapper.h
--- trunk/reactos/drivers/usb/cromwell/linux/linux_wrapper.h
2005-06-04 21:07:00 UTC (rev 15794)
+++ trunk/reactos/drivers/usb/cromwell/linux/linux_wrapper.h
2005-06-04 21:35:07 UTC (rev 15795)
@@ -517,7 +517,7 @@
#define flush_scheduled_work() do {} while(0)
#define refrigerator(x) do {} while(0)
-#define signal_pending(x) 1 // fall through threads
+#define signal_pending(x) 0 // Don't fall through threads!
ReactOS implements this correctly
#define complete_and_exit(a,b) return 0
//#define kill_proc(a,b,c) 0
_____
Modified: trunk/reactos/drivers/usb/cromwell/sys/linuxwrapper.c
--- trunk/reactos/drivers/usb/cromwell/sys/linuxwrapper.c
2005-06-04 21:07:00 UTC (rev 15794)
+++ trunk/reactos/drivers/usb/cromwell/sys/linuxwrapper.c
2005-06-04 21:35:07 UTC (rev 15795)
@@ -126,6 +126,8 @@
(PKSTART_ROUTINE)handler,
parm);
+ DPRINT1("usbcore: Created system thread %d\n", (int)hThread);
+
return (int)hThread; // FIXME: Correct?
}