Initial commit of USB support. These are just stubs. They build, but that is about...
authorMark Tempel <mtempel@visi.com>
Fri, 14 Jan 2005 16:12:34 +0000 (16:12 +0000)
committerMark Tempel <mtempel@visi.com>
Fri, 14 Jan 2005 16:12:34 +0000 (16:12 +0000)
svn path=/trunk/; revision=13044

23 files changed:
reactos/drivers/usb/Makefile [new file with mode: 0644]
reactos/drivers/usb/miniport/usbehci/makefile [new file with mode: 0644]
reactos/drivers/usb/miniport/usbehci/usbehci.c [new file with mode: 0644]
reactos/drivers/usb/miniport/usbehci/usbehci.h [new file with mode: 0644]
reactos/drivers/usb/miniport/usbehci/usbehci.rc [new file with mode: 0644]
reactos/drivers/usb/miniport/usbohci/makefile [new file with mode: 0644]
reactos/drivers/usb/miniport/usbohci/usbohci.c [new file with mode: 0644]
reactos/drivers/usb/miniport/usbohci/usbohci.h [new file with mode: 0644]
reactos/drivers/usb/miniport/usbohci/usbohci.rc [new file with mode: 0644]
reactos/drivers/usb/miniport/usbuhci/makefile [new file with mode: 0644]
reactos/drivers/usb/miniport/usbuhci/usbuhci.c [new file with mode: 0644]
reactos/drivers/usb/miniport/usbuhci/usbuhci.h [new file with mode: 0644]
reactos/drivers/usb/miniport/usbuhci/usbuhci.rc [new file with mode: 0644]
reactos/drivers/usb/usbhub/makefile [new file with mode: 0644]
reactos/drivers/usb/usbhub/usbhub.c [new file with mode: 0644]
reactos/drivers/usb/usbhub/usbhub.def [new file with mode: 0644]
reactos/drivers/usb/usbhub/usbhub.h [new file with mode: 0644]
reactos/drivers/usb/usbhub/usbhub.rc [new file with mode: 0644]
reactos/drivers/usb/usbport/makefile [new file with mode: 0644]
reactos/drivers/usb/usbport/usbport.c [new file with mode: 0644]
reactos/drivers/usb/usbport/usbport.def [new file with mode: 0644]
reactos/drivers/usb/usbport/usbport.h [new file with mode: 0644]
reactos/drivers/usb/usbport/usbport.rc [new file with mode: 0644]

diff --git a/reactos/drivers/usb/Makefile b/reactos/drivers/usb/Makefile
new file mode 100644 (file)
index 0000000..504f8c4
--- /dev/null
@@ -0,0 +1,50 @@
+#\r
+# ReactOS USB Drivers\r
+#\r
+\r
+PATH_TO_TOP = ../..\r
+\r
+include $(PATH_TO_TOP)/rules.mak\r
+\r
+DRIVERS = usbport miniport/usbuhci miniport/usbehci miniport/usbohci usbhub\r
+\r
+all: $(DRIVERS)\r
+\r
+depends: \r
+\r
+implib: $(DRIVERS:%=%_implib)\r
+\r
+clean:         $(DRIVERS:%=%_clean)\r
+\r
+install: $(DRIVERS:%=%_install)\r
+\r
+bootcd: $(DRIVERS:%=%_bootcd)\r
+\r
+.PHONY: all depends implib clean install bootcd\r
+\r
+\r
+#\r
+# USB DRIVERS\r
+#\r
+$(DRIVERS): %:\r
+       $(MAKE) -C $*\r
+\r
+$(DRIVERS:%=%_implib): %_implib:\r
+       $(MAKE) -C $* implib\r
+\r
+$(DRIVERS:%=%_clean): %_clean:\r
+       $(MAKE) -C $* clean\r
+\r
+$(DRIVERS:%=%_install): %_install:\r
+       $(MAKE) -C $* install\r
+\r
+$(DRIVERS:%=%_bootcd): %_bootcd:\r
+       $(MAKE) -C $* bootcd\r
+\r
+.PHONY: $(DRIVERS) $(DRIVERS:%=%_implib) $(DRIVERS:%=%_clean) $(DRIVERS:%=%_install) $(DRIVERS:%=%_bootcd)\r
+\r
+\r
+etags:\r
+       find . -name "*.[ch]" -print | etags --language=c -\r
+\r
+# EOF\r
diff --git a/reactos/drivers/usb/miniport/usbehci/makefile b/reactos/drivers/usb/miniport/usbehci/makefile
new file mode 100644 (file)
index 0000000..bf4be62
--- /dev/null
@@ -0,0 +1,16 @@
+PATH_TO_TOP = ../../../..\r
+\r
+TARGET_TYPE = driver\r
+\r
+TARGET_NAME = usbehci\r
+\r
+TARGET_DDKLIBS = ntoskrnl.a usbport.a\r
+\r
+TARGET_CFLAGS = -Werror -Wall -I$(PATH_TO_TOP)/ntoskrnl/include -D__USE_W32API\r
+\r
+TARGET_OBJECTS = \\r
+  usbehci.o\r
+\r
+include $(PATH_TO_TOP)/rules.mak\r
+\r
+include $(TOOLS_PATH)/helper.mk\r
diff --git a/reactos/drivers/usb/miniport/usbehci/usbehci.c b/reactos/drivers/usb/miniport/usbehci/usbehci.c
new file mode 100644 (file)
index 0000000..9289968
--- /dev/null
@@ -0,0 +1,41 @@
+/*\r
+ * ReactOS USB EHCI miniport driver\r
+ * Copyright (C) 2004 Mark Tempel\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.\r
+ *\r
+ */\r
+\r
+/* INCLUDES *******************************************************************/\r
+\r
+#include "usbehci.h"\r
+#include "../../usbport/usbport.h"\r
+\r
+/* PUBLIC AND PRIVATE FUNCTIONS ***********************************************/\r
+\r
+NTSTATUS STDCALL\r
+DriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)\r
+{\r
+       PUSB_CONTROLLER_INTERFACE ControllerInterface;\r
+\r
+       USBPORT_AllocateUsbControllerInterface(&ControllerInterface);\r
+\r
+       /*\r
+        * Set up the list of callbacks here.\r
+        * TODO TODO TODO\r
+        */\r
+       \r
+       return USBPORT_RegisterUSBPortDriver(DriverObject, 0, ControllerInterface);\r
+}\r
diff --git a/reactos/drivers/usb/miniport/usbehci/usbehci.h b/reactos/drivers/usb/miniport/usbehci/usbehci.h
new file mode 100644 (file)
index 0000000..7eccf7a
--- /dev/null
@@ -0,0 +1,45 @@
+/*\r
+ * ReactOS USB EHCI miniport driver\r
+ *\r
+ * Copyright (C) 2004 Mark Tempel\r
+ *                      \r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.\r
+ */\r
+\r
+#ifndef USBEHCI_H\r
+#define USBEHCI_H\r
+\r
+/* INCLUDES *******************************************************************/\r
+\r
+#include "stddef.h" \r
+#include "windef.h"\r
+//#include <ddk/miniport.h>\r
+#include <ddk/ntapi.h>\r
+\r
+#ifdef DBG\r
+#define DPRINT(arg) DbgPrint arg;\r
+#else\r
+#define DPRINT(arg)\r
+#endif\r
+\r
+// Export funcs here\r
+/*\r
+BOOL FASTCALL\r
+VBESetColorRegisters(\r
+   PVBE_DEVICE_EXTENSION DeviceExtension,\r
+   PVIDEO_CLUT ColorLookUpTable,\r
+   PSTATUS_BLOCK StatusBlock);\r
+*/\r
+#endif /* USBEHCI_H */\r
diff --git a/reactos/drivers/usb/miniport/usbehci/usbehci.rc b/reactos/drivers/usb/miniport/usbehci/usbehci.rc
new file mode 100644 (file)
index 0000000..241bf2b
--- /dev/null
@@ -0,0 +1,5 @@
+#define REACTOS_VERSION_DLL\r
+#define REACTOS_STR_FILE_DESCRIPTION   "USB EHCI miniport Device Driver\0"\r
+#define REACTOS_STR_INTERNAL_NAME      "usbehci\0"\r
+#define REACTOS_STR_ORIGINAL_FILENAME  "usbehci.sys\0"\r
+#include <reactos/version.rc>\r
diff --git a/reactos/drivers/usb/miniport/usbohci/makefile b/reactos/drivers/usb/miniport/usbohci/makefile
new file mode 100644 (file)
index 0000000..f16a9d8
--- /dev/null
@@ -0,0 +1,16 @@
+PATH_TO_TOP = ../../../..\r
+\r
+TARGET_TYPE = driver\r
+\r
+TARGET_NAME = usbohci\r
+\r
+TARGET_DDKLIBS = ntoskrnl.a usbport.a\r
+\r
+TARGET_CFLAGS = -Werror -Wall -I$(PATH_TO_TOP)/ntoskrnl/include -D__USE_W32API\r
+\r
+TARGET_OBJECTS = \\r
+  usbohci.o\r
+\r
+include $(PATH_TO_TOP)/rules.mak\r
+\r
+include $(TOOLS_PATH)/helper.mk\r
diff --git a/reactos/drivers/usb/miniport/usbohci/usbohci.c b/reactos/drivers/usb/miniport/usbohci/usbohci.c
new file mode 100644 (file)
index 0000000..f8faf89
--- /dev/null
@@ -0,0 +1,41 @@
+/*\r
+ * ReactOS USB OpenHCI miniport driver\r
+ * Copyright (C) 2004 Mark Tempel\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.\r
+ *\r
+ */\r
+\r
+/* INCLUDES *******************************************************************/\r
+\r
+#include "usbohci.h"\r
+#include "../../usbport/usbport.h"\r
+\r
+/* PUBLIC AND PRIVATE FUNCTIONS ***********************************************/\r
+\r
+NTSTATUS STDCALL\r
+DriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)\r
+{\r
+       PUSB_CONTROLLER_INTERFACE ControllerInterface;\r
+\r
+       USBPORT_AllocateUsbControllerInterface(&ControllerInterface);\r
+\r
+       /*\r
+        * Set up the list of callbacks here.\r
+        * TODO TODO TODO\r
+        */\r
+       \r
+       return USBPORT_RegisterUSBPortDriver(DriverObject, 0, ControllerInterface);\r
+}\r
diff --git a/reactos/drivers/usb/miniport/usbohci/usbohci.h b/reactos/drivers/usb/miniport/usbohci/usbohci.h
new file mode 100644 (file)
index 0000000..c6f3aa0
--- /dev/null
@@ -0,0 +1,45 @@
+/*\r
+ * ReactOS USB OpenHCI miniport driver\r
+ *\r
+ * Copyright (C) 2004 Mark Tempel\r
+ *                      \r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.\r
+ */\r
+\r
+#ifndef USBOHCI_H\r
+#define USBOHCI_H\r
+\r
+/* INCLUDES *******************************************************************/\r
+\r
+#include "stddef.h" \r
+#include "windef.h"\r
+//#include <ddk/miniport.h>\r
+#include <ddk/ntapi.h>\r
+\r
+#ifdef DBG\r
+#define DPRINT(arg) DbgPrint arg;\r
+#else\r
+#define DPRINT(arg)\r
+#endif\r
+\r
+// Export funcs here\r
+/*\r
+BOOL FASTCALL\r
+VBESetColorRegisters(\r
+   PVBE_DEVICE_EXTENSION DeviceExtension,\r
+   PVIDEO_CLUT ColorLookUpTable,\r
+   PSTATUS_BLOCK StatusBlock);\r
+*/\r
+#endif /* USBOHCI_H */\r
diff --git a/reactos/drivers/usb/miniport/usbohci/usbohci.rc b/reactos/drivers/usb/miniport/usbohci/usbohci.rc
new file mode 100644 (file)
index 0000000..2badbbf
--- /dev/null
@@ -0,0 +1,5 @@
+#define REACTOS_VERSION_DLL\r
+#define REACTOS_STR_FILE_DESCRIPTION   "USB OpenHCI miniport Device Driver\0"\r
+#define REACTOS_STR_INTERNAL_NAME      "usbohci\0"\r
+#define REACTOS_STR_ORIGINAL_FILENAME  "usbohci.sys\0"\r
+#include <reactos/version.rc>\r
diff --git a/reactos/drivers/usb/miniport/usbuhci/makefile b/reactos/drivers/usb/miniport/usbuhci/makefile
new file mode 100644 (file)
index 0000000..b89c935
--- /dev/null
@@ -0,0 +1,16 @@
+PATH_TO_TOP = ../../../..\r
+\r
+TARGET_TYPE = driver\r
+\r
+TARGET_NAME = usbuhci\r
+\r
+TARGET_DDKLIBS = ntoskrnl.a usbport.a\r
+\r
+TARGET_CFLAGS = -Werror -Wall -I$(PATH_TO_TOP)/ntoskrnl/include -D__USE_W32API\r
+\r
+TARGET_OBJECTS = \\r
+  usbuhci.o\r
+\r
+include $(PATH_TO_TOP)/rules.mak\r
+\r
+include $(TOOLS_PATH)/helper.mk\r
diff --git a/reactos/drivers/usb/miniport/usbuhci/usbuhci.c b/reactos/drivers/usb/miniport/usbuhci/usbuhci.c
new file mode 100644 (file)
index 0000000..52f6093
--- /dev/null
@@ -0,0 +1,41 @@
+/*\r
+ * ReactOS USB UHCI miniport driver\r
+ * Copyright (C) 2004 Mark Tempel\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.\r
+ *\r
+ */\r
+\r
+/* INCLUDES *******************************************************************/\r
+\r
+#include "usbuhci.h"\r
+#include "../../usbport/usbport.h"\r
+\r
+/* PUBLIC AND PRIVATE FUNCTIONS ***********************************************/\r
+\r
+NTSTATUS STDCALL\r
+DriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)\r
+{\r
+       PUSB_CONTROLLER_INTERFACE ControllerInterface;\r
+\r
+       USBPORT_AllocateUsbControllerInterface(&ControllerInterface);\r
+\r
+       /*\r
+        * Set up the list of callbacks here.\r
+        * TODO TODO TODO\r
+        */\r
+       \r
+       return USBPORT_RegisterUSBPortDriver(DriverObject, 0, ControllerInterface);\r
+}\r
diff --git a/reactos/drivers/usb/miniport/usbuhci/usbuhci.h b/reactos/drivers/usb/miniport/usbuhci/usbuhci.h
new file mode 100644 (file)
index 0000000..2710eff
--- /dev/null
@@ -0,0 +1,45 @@
+/*\r
+ * ReactOS USB UHCI miniport driver\r
+ *\r
+ * Copyright (C) 2004 Mark Tempel\r
+ *                      \r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.\r
+ */\r
+\r
+#ifndef USBUHCI_H\r
+#define USBUHCI_H\r
+\r
+/* INCLUDES *******************************************************************/\r
+\r
+#include "stddef.h" \r
+#include "windef.h"\r
+//#include <ddk/miniport.h>\r
+#include <ddk/ntapi.h>\r
+\r
+#ifdef DBG\r
+#define DPRINT(arg) DbgPrint arg;\r
+#else\r
+#define DPRINT(arg)\r
+#endif\r
+\r
+// Export funcs here\r
+/*\r
+BOOL FASTCALL\r
+VBESetColorRegisters(\r
+   PVBE_DEVICE_EXTENSION DeviceExtension,\r
+   PVIDEO_CLUT ColorLookUpTable,\r
+   PSTATUS_BLOCK StatusBlock);\r
+*/\r
+#endif /* USBUHCI_H */\r
diff --git a/reactos/drivers/usb/miniport/usbuhci/usbuhci.rc b/reactos/drivers/usb/miniport/usbuhci/usbuhci.rc
new file mode 100644 (file)
index 0000000..fbd26dd
--- /dev/null
@@ -0,0 +1,5 @@
+#define REACTOS_VERSION_DLL\r
+#define REACTOS_STR_FILE_DESCRIPTION   "USB UHCI miniport Device Driver\0"\r
+#define REACTOS_STR_INTERNAL_NAME      "usbuhci\0"\r
+#define REACTOS_STR_ORIGINAL_FILENAME  "usbuhci.sys\0"\r
+#include <reactos/version.rc>\r
diff --git a/reactos/drivers/usb/usbhub/makefile b/reactos/drivers/usb/usbhub/makefile
new file mode 100644 (file)
index 0000000..644f5bd
--- /dev/null
@@ -0,0 +1,16 @@
+PATH_TO_TOP = ../../..\r
+\r
+TARGET_TYPE = driver\r
+\r
+TARGET_NAME = usbhub\r
+\r
+TARGET_DDKLIBS = ntoskrnl.a\r
+\r
+TARGET_CFLAGS = -Werror -Wall -I$(PATH_TO_TOP)/ntoskrnl/include -D__USE_W32API\r
+\r
+TARGET_OBJECTS = \\r
+  usbhub.o\r
+\r
+include $(PATH_TO_TOP)/rules.mak\r
+\r
+include $(TOOLS_PATH)/helper.mk\r
diff --git a/reactos/drivers/usb/usbhub/usbhub.c b/reactos/drivers/usb/usbhub/usbhub.c
new file mode 100644 (file)
index 0000000..00098d4
--- /dev/null
@@ -0,0 +1,38 @@
+/*\r
+ * ReactOS USB hub driver\r
+ * Copyright (C) 2004 Aleksey Bragin\r
+ *           (C) 2005 Mark Tempel\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.\r
+ *\r
+ */\r
+\r
+/* INCLUDES *******************************************************************/\r
+#include <stddef.h>\r
+#include <windef.h>\r
+#include <ddk/ntddk.h>\r
+#include "..\usbport\usbport.h"\r
+\r
+/* PUBLIC AND PRIVATE FUNCTIONS ***********************************************/\r
+\r
+/*\r
+ * Standard DriverEntry method.\r
+ */\r
+NTSTATUS STDCALL\r
+DriverEntry(IN PVOID Context1, IN PVOID Context2)\r
+{\r
+       return STATUS_SUCCESS;\r
+}\r
+\r
diff --git a/reactos/drivers/usb/usbhub/usbhub.def b/reactos/drivers/usb/usbhub/usbhub.def
new file mode 100644 (file)
index 0000000..b1a9fe4
--- /dev/null
@@ -0,0 +1,4 @@
+;\r
+; Exports definition file for usbhub.sys\r
+;\r
+EXPORTS\r
diff --git a/reactos/drivers/usb/usbhub/usbhub.h b/reactos/drivers/usb/usbhub/usbhub.h
new file mode 100644 (file)
index 0000000..01a26a4
--- /dev/null
@@ -0,0 +1,10 @@
+/*\r
+ * Declarations for undocumented usbport.sys calls\r
+ *\r
+ * Written by Mark Tempel\r
+ */\r
+\r
+#ifndef _USBHUB_H\r
+#define _USBHUB_H\r
+\r
+#endif /* _USBHUB_H */\r
diff --git a/reactos/drivers/usb/usbhub/usbhub.rc b/reactos/drivers/usb/usbhub/usbhub.rc
new file mode 100644 (file)
index 0000000..9f253e2
--- /dev/null
@@ -0,0 +1,5 @@
+#define REACTOS_VERSION_DLL\r
+#define REACTOS_STR_FILE_DESCRIPTION   "USB Hub Driver\0"\r
+#define REACTOS_STR_INTERNAL_NAME      "usbhub\0"\r
+#define REACTOS_STR_ORIGINAL_FILENAME  "usbhub.sys\0"\r
+#include <reactos/version.rc>\r
diff --git a/reactos/drivers/usb/usbport/makefile b/reactos/drivers/usb/usbport/makefile
new file mode 100644 (file)
index 0000000..40ead05
--- /dev/null
@@ -0,0 +1,16 @@
+PATH_TO_TOP = ../../..\r
+\r
+TARGET_TYPE = export_driver\r
+\r
+TARGET_NAME = usbport\r
+\r
+TARGET_DDKLIBS = ntoskrnl.a\r
+\r
+TARGET_CFLAGS = -Werror -Wall -I$(PATH_TO_TOP)/ntoskrnl/include -D__USE_W32API\r
+\r
+TARGET_OBJECTS = \\r
+  usbport.o\r
+\r
+include $(PATH_TO_TOP)/rules.mak\r
+\r
+include $(TOOLS_PATH)/helper.mk\r
diff --git a/reactos/drivers/usb/usbport/usbport.c b/reactos/drivers/usb/usbport/usbport.c
new file mode 100644 (file)
index 0000000..acd7898
--- /dev/null
@@ -0,0 +1,81 @@
+/*\r
+ * ReactOS USB Port driver\r
+ * Copyright (C) 2004 Aleksey Bragin\r
+ *           (C) 2005 Mark Tempel\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.\r
+ *\r
+ * STATUS:\r
+ *   19-Dec-2004 - just a stub for now, but with useful info by Filip\r
+ */\r
+\r
+/* INCLUDES *******************************************************************/\r
+#include <stddef.h>\r
+#include <windef.h>\r
+#include <ddk/ntddk.h>\r
+#include "usbport.h"\r
+\r
+/* PUBLIC AND PRIVATE FUNCTIONS ***********************************************/\r
+\r
+/*\r
+** Standard DriverEntry method.\r
+** We do nothing here.  All real work is done in USBPRORT_RegisterUSBPortDriver.\r
+*/\r
+NTSTATUS STDCALL\r
+DriverEntry(IN PVOID Context1, IN PVOID Context2)\r
+{\r
+       return STATUS_SUCCESS;\r
+}\r
+/*\r
+ * This method is used by miniports to connect set up \r
+ */\r
+NTSTATUS STDCALL\r
+USBPORT_RegisterUSBPortDriver(PDRIVER_OBJECT DriverObject, DWORD Unknown1,\r
+    PUSB_CONTROLLER_INTERFACE Interface)\r
+{\r
+       ASSERT(KeGetCurrentIRQL() < DISPATCH_LEVEL);\r
+\r
+       return STATUS_SUCCESS;\r
+}\r
+\r
+NTSTATUS STDCALL\r
+USBPORT_GetHciMn(VOID)\r
+{\r
+       return 0x10000001;\r
+}\r
+/*\r
+ * This method is to allow miniports to create \r
+ */\r
+NTSTATUS STDCALL\r
+USBPORT_AllocateUsbControllerInterface(OUT PUSB_CONTROLLER_INTERFACE *pControllerInterface)\r
+{\r
+       ASSERT(KeGetCurrentIRQL() < DISPATCH_LEVEL);\r
+       ASSERT(0 != ControllerObject);\r
+\r
+       *pControllerInterface = (PUSB_CONTROLLER_INTERFACE)ExAllocatePoolWithTag(PagedPool, sizeof(USB_CONTROLLER_INTERFACE),USB_CONTROLLER_INTERFACE_TAG);\r
+       RtlZeroMemory(*pControllerInterface, sizeof(USB_CONTROLLER_INTERFACE));\r
+       \r
+       return STATUS_SUCCESS;\r
+}\r
+\r
+NTSTATUS STDCALL\r
+USBPORT_FreeUsbControllerInterface(IN PUSB_CONTROLLER_INTERFACE ControllerInterface)\r
+{\r
+       ASSERT(KeGetCurrentIRQL() < DISPATCH_LEVEL);    \r
+\r
+       ExFreePool(ControllerInterface);\r
+       \r
+       return STATUS_SUCCESS;\r
+}\r
diff --git a/reactos/drivers/usb/usbport/usbport.def b/reactos/drivers/usb/usbport/usbport.def
new file mode 100644 (file)
index 0000000..c647cb1
--- /dev/null
@@ -0,0 +1,8 @@
+;\r
+; Exports definition file for usbport.sys\r
+;\r
+EXPORTS\r
+USBPORT_RegisterUSBPortDriver@12\r
+USBPORT_GetHciMn@0\r
+USBPORT_AllocateUsbControllerInterface@4\r
+USBPORT_FreeUsbControllerInterface@4
\ No newline at end of file
diff --git a/reactos/drivers/usb/usbport/usbport.h b/reactos/drivers/usb/usbport/usbport.h
new file mode 100644 (file)
index 0000000..36cfc50
--- /dev/null
@@ -0,0 +1,130 @@
+/*\r
+ * Declarations for undocumented usbport.sys calls\r
+ *\r
+ * Written by Filip Navara <xnavara@volny.cz>\r
+ * Updates by Mark Tempel\r
+ */\r
+\r
+#ifndef _USBPORT_H\r
+#define _USBPORT_H\r
+\r
+#define USB_CONTROLLER_INTERFACE_TAG 0x001E1E10\r
+\r
+/**** B E G I N   M S   I N T E R N A L   P R O T O C O L ****/ \r
+typedef DWORD (*POPEN_ENDPOINT)(\r
+    DWORD Unknown1,\r
+    DWORD Unknown2,\r
+    DWORD Unknown3\r
+);\r
+\r
+typedef NTSTATUS (*PPOKE_ENDPOINT)(\r
+    DWORD Unknown1,\r
+    DWORD Unknown2,\r
+    DWORD Unknown3\r
+);\r
+\r
+typedef DWORD (*PQUERY_ENDPOINT_REQUIREMENTS)(\r
+    DWORD Unknown1,\r
+    DWORD Unknown2,\r
+    DWORD Unknown3\r
+);\r
+\r
+typedef VOID (*PCLOSE_ENDPOINT)(\r
+    DWORD Unknown1,\r
+    DWORD Unknown2\r
+);\r
+\r
+\r
+\r
+typedef struct {\r
+    DWORD Unknown1; /* 2 (UHCI), 3 (EHCI) */\r
+    DWORD Unknown2; /* 2C3 (UHCI), 95 (EHCI) */\r
+    DWORD Unknown3; /* 2EE0 (UHCI), 61A80 (EHCI) */\r
+    DWORD Unknown4; /* - */\r
+    DWORD Unknown5; /* 164 (UHCI), 178 (EHCI) */\r
+    DWORD Unknown6; /* 8C (UHCI), A0 (EHCI) */\r
+    DWORD Unknown7; /* 1C (UHCI), 30 (EHCI) */ /* Offset: 118 */\r
+    DWORD Unknown8; /* - */\r
+    DWORD Unknown9; /* - */\r
+    DWORD Unknown10; /* 2280 (UHCI), 2C800 (EHCI) */ /* Offset: 124 */\r
+    POPEN_ENDPOINT OpenEndpoint;\r
+    PPOKE_ENDPOINT PokeEndpoint;\r
+    PQUERY_ENDPOINT_REQUIREMENTS QueryEndpointRequirements;\r
+    PCLOSE_ENDPOINT CloseEndpoint;\r
+    PVOID StartController;           /* P00010A1C (2) */ /* Offset: 138 */\r
+    PVOID StopController;            /* P00010952 */ /* Offset: 13C */\r
+    PVOID SuspendController;         /* P00011584 */ /* Offset: 140 */\r
+    PVOID ResumeController;          /* P0001164C */ /* Offset: 144 */\r
+    PVOID InterruptService;          /* P00013C72 */ /* Offset: 148 */\r
+    PVOID InterruptDpc;              /* P00013D8E */ /* Offset: 14C */\r
+    PVOID SubmitTransfer;            /* P00011010 */ /* Offset: 150 */\r
+    PVOID IsochTransfer;             /* P000136E8 */ /* Offset: 154 */\r
+    PVOID AbortTransfer;             /* P00011092 */ /* Offset: 158 */\r
+    PVOID GetEndpointState;          /* P00010F48 */ /* Offset: 15C */\r
+    PVOID SetEndpointState;          /* P00010EFA */ /* Offset: 160 */\r
+    PVOID PollEndpoint;              /* P00010D32 */ /* Offset: 164 */\r
+    PVOID CheckController;           /* P00011794 */ /* Offset: 168 */\r
+    PVOID Get32BitFrameNumber;       /* P00010F86 */ /* Offset: 16C */\r
+    PVOID InterruptNextSOF;          /* P00013F56 */ /* Offset: 170 */\r
+    PVOID EnableInterrupts;          /* P00013ED0 */ /* Offset: 174 */\r
+    PVOID DisableInterrupts;         /* P00013E18 */ /* Offset: 178 */\r
+    PVOID PollController;            /* P00010FF2 */ /* Offset: 17C */\r
+    PVOID SetEndpointDataToggle;     /* P000110E6 */ /* Offset: 180 */\r
+    PVOID GetEndpointStatus;         /* P00010ECE */ /* Offset: 184 */\r
+    PVOID SetEndpointStatus;         /* P00010E52 */ /* Offset: 188 */\r
+    DWORD Unknown36; /* - */\r
+    PVOID RHGetRootHubData;          /* P00011AC6 */  /* Offset: 190 */ \r
+    PVOID RHGetStatus;               /* P00011B1A */  /* Offset: 194 */ \r
+    PVOID RHGetPortStatus;           /* P00011BBA */  /* Offset: 198 */ \r
+    PVOID RHGetHubStatus;            /* P00011B28 */  /* Offset: 19C */ \r
+    PVOID RHSetFeaturePortReset;     /* P00011F84 */  /* Offset: 1A0 */ \r
+    PVOID RHSetFeaturePortPower;     /* P00011BB4 */  /* Offset: 1A4 */ \r
+    PVOID RHSetFeaturePortEnable;    /* P00011BA2 */  /* Offset: 1A8 */ \r
+    PVOID RHSetFeaturePortSuspend;   /* P00011FF8 */  /* Offset: 1AC */ \r
+    PVOID RHClearFeaturePortEnable;  /* P00011B90 */  /* Offset: 1B0 */ \r
+    PVOID RHClearFeaturePortPower;     /* P00011BB4 */  /* Offset: 1B4 */ \r
+    PVOID RHClearFeaturePortSuspend; /* P0001210E */  /* Offset: 1B8 */ \r
+    PVOID RHClearFeaturePortEnableChange; /* P00012236 */  /* Offset: 1BC */ \r
+    PVOID RHClearFeaturePortConnectChange; /* P000121DE */  /* Offset: 1C0 */ \r
+    PVOID RHClearFeaturePortResetChange; /* P00012284 */  /* Offset: 1C4 */ \r
+    PVOID RHClearFeaturePortSuspendChange; /* P0001229C */  /* Offset: 1C8 */ \r
+    PVOID RHClearFeaturePortOvercurrentChange; /* P000122B4 */  /* Offset: 1CC */ \r
+    PVOID RHDisableIrq;              /* P00013F52 */  /* Offset: 1D0 */ \r
+    PVOID RHDisableIrq2;             /* P00013F52 */  /* Offset: 1D4 */ \r
+    PVOID StartSendOnePacket;        /* P00011144 */  /* Offset: 1D8 */ \r
+    PVOID EndSendOnePacket;          /* P000119B6 */  /* Offset: 1DC */ \r
+    PVOID PassThru;                  /* P000110E0 */  /* Offset: 1E0 */ \r
+    DWORD Unknown58[17];             /* - */\r
+    PVOID FlushInterrupts;           /* P00013EA0 */  /* Offset: 228 */\r
+    /* ... */\r
+} USB_CONTROLLER_INTERFACE, *PUSB_CONTROLLER_INTERFACE;\r
+/**** E N D   M S   I N T E R N A L   P R O T O C O L ****/\r
+\r
+/*\r
+ * With this call USB miniport driver registers itself with usbport.sys\r
+ *\r
+ * Unknown1 - Could be 0x64 or 0xC8. (0x9A also ?)\r
+ * Unknown2 - Pointer to structure which contains function entry points\r
+ */\r
+NTSTATUS STDCALL\r
+USBPORT_RegisterUSBPortDriver(PDRIVER_OBJECT DriverObject, DWORD Unknown1,\r
+    PUSB_CONTROLLER_INTERFACE Interface);\r
+\r
+/*\r
+ * This function always returns 0x10000001 in Windows XP SP1\r
+ */\r
+NTSTATUS STDCALL\r
+USBPORT_GetHciMn(VOID);\r
+\r
+/*\r
+ * This method is provided for miniports to use to allocate their USB_CONTROLLER_INTERFACEs.\r
+ */\r
+NTSTATUS STDCALL\r
+USBPORT_AllocateUsbControllerInterface(OUT PUSB_CONTROLLER_INTERFACE *pControllerInterface);\r
+\r
+/*\r
+ * We can't have an allocate without a free.\r
+ */\r
+NTSTATUS STDCALL\r
+USBPORT_FreeUsbControllerInterface(IN PUSB_CONTROLLER_INTERFACE ControllerInterface);\r
+#endif /* _USBPORT_H */\r
diff --git a/reactos/drivers/usb/usbport/usbport.rc b/reactos/drivers/usb/usbport/usbport.rc
new file mode 100644 (file)
index 0000000..e8482bb
--- /dev/null
@@ -0,0 +1,5 @@
+#define REACTOS_VERSION_DLL\r
+#define REACTOS_STR_FILE_DESCRIPTION   "USB Port Driver\0"\r
+#define REACTOS_STR_INTERNAL_NAME      "usbport\0"\r
+#define REACTOS_STR_ORIGINAL_FILENAME  "usbport.sys\0"\r
+#include <reactos/version.rc>\r