ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
August 2005
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
23 participants
669 discussions
Start a n
N
ew thread
[hbirr] 17358: Fixed _WINBASE_/_WINBASE_H
by hbirr@svn.reactos.com
Fixed _WINBASE_/_WINBASE_H Modified: trunk/reactos/include/ndk/rtltypes.h Modified: trunk/reactos/w32api/include/winbase.h _____ Modified: trunk/reactos/include/ndk/rtltypes.h --- trunk/reactos/include/ndk/rtltypes.h 2005-08-12 22:04:52 UTC (rev 17357) +++ trunk/reactos/include/ndk/rtltypes.h 2005-08-12 23:35:14 UTC (rev 17358) @@ -399,7 +399,7 @@ } RTL_ATOM_TABLE, *PRTL_ATOM_TABLE; /* Let Kernel Drivers use this */ -#ifndef _WINBASE_H +#if !defined(_WINBASE_H) && !defined(_WINBASE_) typedef struct _SYSTEMTIME { WORD wYear; _____ Modified: trunk/reactos/w32api/include/winbase.h --- trunk/reactos/w32api/include/winbase.h 2005-08-12 22:04:52 UTC (rev 17357) +++ trunk/reactos/w32api/include/winbase.h 2005-08-12 23:35:14 UTC (rev 17358) @@ -1,5 +1,5 @@ -#ifndef _WINBASE_H -#define _WINBASE_H +#ifndef _WINBASE_ +#define _WINBASE_ #if __GNUC__ >= 3 #pragma GCC system_header #endif
19 years, 4 months
1
0
0
0
[hbirr] 17357: MEMORY_AREA_PEB_OR_TEB must be handled like MEMORY_AREA_VIRTUAL_MEMORY.
by hbirr@svn.reactos.com
MEMORY_AREA_PEB_OR_TEB must be handled like MEMORY_AREA_VIRTUAL_MEMORY. Modified: branches/cache_manager_rewrite/reactos/ntoskrnl/mm/pageop.c _____ Modified: branches/cache_manager_rewrite/reactos/ntoskrnl/mm/pageop.c --- branches/cache_manager_rewrite/reactos/ntoskrnl/mm/pageop.c 2005-08-12 21:56:43 UTC (rev 17356) +++ branches/cache_manager_rewrite/reactos/ntoskrnl/mm/pageop.c 2005-08-12 22:04:52 UTC (rev 17357) @@ -83,7 +83,8 @@ { Hash = (((ULONG_PTR)Segment) | (((ULONG_PTR)Offset) / PAGE_SIZE)); } - else if (MArea->Type == MEMORY_AREA_VIRTUAL_MEMORY) + else if (MArea->Type == MEMORY_AREA_VIRTUAL_MEMORY || + MArea->Type == MEMORY_AREA_PEB_OR_TEB) { Hash = (((ULONG_PTR)Pid) | (((ULONG_PTR)Address) / PAGE_SIZE)); } @@ -157,7 +158,8 @@ { Hash = (((ULONG_PTR)Segment) | (((ULONG_PTR)Offset) / PAGE_SIZE)); } - else if (MArea->Type == MEMORY_AREA_VIRTUAL_MEMORY) + else if (MArea->Type == MEMORY_AREA_VIRTUAL_MEMORY || + MArea->Type == MEMORY_AREA_PEB_OR_TEB) { Hash = (((ULONG_PTR)Pid) | (((ULONG_PTR)Address) / PAGE_SIZE)); }
19 years, 4 months
1
0
0
0
[hbirr] 17356: Allocate the segments, page tables and the image section object from non paged pool.
by hbirr@svn.reactos.com
Allocate the segments, page tables and the image section object from non paged pool. Modified: branches/cache_manager_rewrite/reactos/ntoskrnl/mm/section.c _____ Modified: branches/cache_manager_rewrite/reactos/ntoskrnl/mm/section.c --- branches/cache_manager_rewrite/reactos/ntoskrnl/mm/section.c 2005-08-12 21:01:32 UTC (rev 17355) +++ branches/cache_manager_rewrite/reactos/ntoskrnl/mm/section.c 2005-08-12 21:56:43 UTC (rev 17356) @@ -456,7 +456,7 @@ { Table = Segment->PageDirectory.PageTables[DirectoryOffset] = - ExAllocatePoolWithTag(PagedPool, sizeof(SECTION_PAGE_TABLE), + ExAllocatePoolWithTag(NonPagedPool, sizeof(SECTION_PAGE_TABLE), TAG_SECTION_PAGE_TABLE); if (Table == NULL) { @@ -3292,7 +3292,7 @@ KeInitializeSpinLock(&Section->ViewListLock); Section->FileObject = NULL; Section->MaximumSize = MaximumSize; - Segment = ExAllocatePoolWithTag(PagedPool, sizeof(MM_SECTION_SEGMENT), + Segment = ExAllocatePoolWithTag(NonPagedPool, sizeof(MM_SECTION_SEGMENT), TAG_MM_SECTION_SEGMENT); if (Segment == NULL) { @@ -3476,7 +3476,7 @@ if (Segment == NULL) { - Segment = ExAllocatePoolWithTag(PagedPool, sizeof(MM_SECTION_SEGMENT), + Segment = ExAllocatePoolWithTag(NonPagedPool, sizeof(MM_SECTION_SEGMENT), TAG_MM_SECTION_SEGMENT); if (Segment == NULL) { @@ -3637,7 +3637,7 @@ /* TODO: check for integer overflow */ SizeOfSegments = sizeof(MM_SECTION_SEGMENT) * NrSegments; - Segments = ExAllocatePoolWithTag(PagedPool, + Segments = ExAllocatePoolWithTag(NonPagedPool, SizeOfSegments, TAG_MM_SECTION_SEGMENT); @@ -4210,7 +4210,7 @@ SizeOfSegments = sizeof(MM_SECTION_SEGMENT) * ImageSectionObject->NrSegments; - Segments = ExAllocatePoolWithTag(PagedPool, + Segments = ExAllocatePoolWithTag(NonPagedPool, SizeOfSegments, TAG_MM_SECTION_SEGMENT); @@ -4341,7 +4341,7 @@ } } - ImageSectionObject = ExAllocatePoolWithTag(PagedPool, sizeof(MM_IMAGE_SECTION_OBJECT), TAG_MM_SECTION_SEGMENT); + ImageSectionObject = ExAllocatePoolWithTag(NonPagedPool, sizeof(MM_IMAGE_SECTION_OBJECT), TAG_MM_SECTION_SEGMENT); if (ImageSectionObject == NULL) { ObDereferenceObject(FileObject);
19 years, 4 months
1
0
0
0
[fireball] 17355: Correct include tree, fixing multiple defines.
by fireball@svn.reactos.com
Correct include tree, fixing multiple defines. Modified: trunk/reactos/drivers/usb/cromwell/uhci/uhci.h _____ Modified: trunk/reactos/drivers/usb/cromwell/uhci/uhci.h --- trunk/reactos/drivers/usb/cromwell/uhci/uhci.h 2005-08-12 20:57:26 UTC (rev 17354) +++ trunk/reactos/drivers/usb/cromwell/uhci/uhci.h 2005-08-12 21:01:32 UTC (rev 17355) @@ -1,11 +1,11 @@ -#include <ddk/ntddk.h> +//#include <ddk/ntddk.h> +// config and include core/hcd.h, for hc_device struct struct usb_interface *usb_ifnum_to_if(struct usb_device *dev, unsigned ifnum) + +#include "../usb_wrapper.h" #include <ddk/usbdi.h> #include <ddk/usbiodef.h> #include <initguid.h> -// config and include core/hcd.h, for hc_device struct struct usb_interface *usb_ifnum_to_if(struct usb_device *dev, unsigned ifnum) - -#include "../usb_wrapper.h" #include "../core/hcd.h" #include "../host/ohci_main.h"
19 years, 4 months
1
0
0
0
[ea] 17354: Correct version info.
by ea@svn.reactos.com
Correct version info. Modified: trunk/vms/server/vmssrv.rc _____ Modified: trunk/vms/server/vmssrv.rc --- trunk/vms/server/vmssrv.rc 2005-08-12 20:55:07 UTC (rev 17353) +++ trunk/vms/server/vmssrv.rc 2005-08-12 20:57:26 UTC (rev 17354) @@ -1,4 +1,4 @@ #define REACTOS_STR_FILE_DESCRIPTION "ReactOS/VMS Environment Subsystem Server\0" -#define REACTOS_STR_INTERNAL_NAME "vmsss\0" -#define REACTOS_STR_ORIGINAL_FILENAME "vmsss.exe\0" +#define REACTOS_STR_INTERNAL_NAME "vmssrv\0" +#define REACTOS_STR_ORIGINAL_FILENAME "vmsrv.dll\0" #include <reactos/version.rc>
19 years, 4 months
1
0
0
0
[ea] 17353: OS/2: more changes to make it conform to rbuild.
by ea@svn.reactos.com
OS/2: more changes to make it conform to rbuild. Deleted: trunk/os2/apps/bepslep/.cvsignore Added: trunk/os2/apps/bepslep/bepslep.xml Added: trunk/os2/apps/directory.xml Added: trunk/os2/lib/directory.xml Deleted: trunk/os2/lib/doscalls/.cvsignore Deleted: trunk/os2/lib/doscalls/devices/.cvsignore Modified: trunk/os2/lib/doscalls/devices/devices.cpp Modified: trunk/os2/lib/doscalls/doscalls.rc Added: trunk/os2/lib/doscalls/doscalls.xml Deleted: trunk/os2/lib/doscalls/file/.cvsignore Modified: trunk/os2/lib/doscalls/file/directory.cpp Modified: trunk/os2/lib/doscalls/file/openclose.cpp Deleted: trunk/os2/lib/doscalls/misc/.cvsignore Modified: trunk/os2/lib/doscalls/misc/doscalls.cpp Modified: trunk/os2/lib/doscalls/misc/error.cpp Deleted: trunk/os2/lib/doscalls/run/.cvsignore Modified: trunk/os2/lib/doscalls/run/process.cpp Deleted: trunk/os2/server/.cvsignore Added: trunk/os2/server/dllmain.c Deleted: trunk/os2/server/makefile Added: trunk/os2/server/os2srv.def Added: trunk/os2/server/os2srv.h Added: trunk/os2/server/os2srv.rc Added: trunk/os2/server/os2srv.xml Deleted: trunk/os2/server/os2ss.cpp Added: trunk/os2/server/server.c _____ Deleted: trunk/os2/apps/bepslep/.cvsignore --- trunk/os2/apps/bepslep/.cvsignore 2005-08-12 20:29:01 UTC (rev 17352) +++ trunk/os2/apps/bepslep/.cvsignore 2005-08-12 20:55:07 UTC (rev 17353) @@ -1,3 +0,0 @@ -*.exe -*.o -*.sym _____ Added: trunk/os2/apps/bepslep/bepslep.xml Property changes on: trunk/os2/apps/bepslep/bepslep.xml ___________________________________________________________________ Name: svn:keywords + author date id revision Name: svn:eol-style + native _____ Added: trunk/os2/apps/directory.xml --- trunk/os2/apps/directory.xml 2005-08-12 20:29:01 UTC (rev 17352) +++ trunk/os2/apps/directory.xml 2005-08-12 20:55:07 UTC (rev 17353) @@ -0,0 +1,5 @@ +<group> + <directory name="bepslep"> + <xi:include href="bepslep/bepslep.xml" /> + </directory> +</group> Property changes on: trunk/os2/apps/directory.xml ___________________________________________________________________ Name: svn:keywords + author date id revision Name: svn:eol-style + native _____ Added: trunk/os2/lib/directory.xml --- trunk/os2/lib/directory.xml 2005-08-12 20:29:01 UTC (rev 17352) +++ trunk/os2/lib/directory.xml 2005-08-12 20:55:07 UTC (rev 17353) @@ -0,0 +1,5 @@ +<group> + <directory name="doscalls"> + <xi:include href="doscalls/doscalls.xml" /> + </directory> +</group> Property changes on: trunk/os2/lib/directory.xml ___________________________________________________________________ Name: svn:keywords + author date id revision Name: svn:eol-style + native _____ Deleted: trunk/os2/lib/doscalls/.cvsignore --- trunk/os2/lib/doscalls/.cvsignore 2005-08-12 20:29:01 UTC (rev 17352) +++ trunk/os2/lib/doscalls/.cvsignore 2005-08-12 20:55:07 UTC (rev 17353) @@ -1,5 +0,0 @@ -*.exe -*.o -*.sym -*.dll -*.coff _____ Deleted: trunk/os2/lib/doscalls/devices/.cvsignore --- trunk/os2/lib/doscalls/devices/.cvsignore 2005-08-12 20:29:01 UTC (rev 17352) +++ trunk/os2/lib/doscalls/devices/.cvsignore 2005-08-12 20:55:07 UTC (rev 17353) @@ -1 +0,0 @@ -*.o _____ Modified: trunk/os2/lib/doscalls/devices/devices.cpp --- trunk/os2/lib/doscalls/devices/devices.cpp 2005-08-12 20:29:01 UTC (rev 17352) +++ trunk/os2/lib/doscalls/devices/devices.cpp 2005-08-12 20:55:07 UTC (rev 17353) @@ -1,4 +1,4 @@ -/* $Id: devices.cpp,v 1.5 2004/01/31 01:29:11 robertk Exp $ +/* $Id$ */ /* * _____ Modified: trunk/os2/lib/doscalls/doscalls.rc --- trunk/os2/lib/doscalls/doscalls.rc 2005-08-12 20:29:01 UTC (rev 17352) +++ trunk/os2/lib/doscalls/doscalls.rc 2005-08-12 20:55:07 UTC (rev 17353) @@ -1,38 +1,4 @@ -#include <defines.h> -#include <reactos/resource.h> - -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US - -VS_VERSION_INFO VERSIONINFO - FILEVERSION RES_UINT_FV_MAJOR,RES_UINT_FV_MINOR,RES_UINT_FV_REVISION,RES_UINT_FV_BUI LD - PRODUCTVERSION RES_UINT_PV_MAJOR,RES_UINT_PV_MINOR,RES_UINT_PV_REVISION,RES_UINT_PV_BUI LD - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "CompanyName", RES_STR_COMPANY_NAME - VALUE "FileDescription", "OS2 subsystem base services\0" - VALUE "FileVersion", RES_STR_FILE_VERSION - VALUE "InternalName", "doscalls\0" - VALUE "LegalCopyright", RES_STR_LEGAL_COPYRIGHT - VALUE "OriginalFilename", "doscalls.dll\0" - VALUE "ProductName", RES_STR_PRODUCT_NAME - VALUE "ProductVersion", RES_STR_PRODUCT_VERSION - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS-OS/2 subsystem base services\0" +#define REACTOS_STR_INTERNAL_NAME "doscalls\0" +#define REACTOS_STR_ORIGINAL_FILENAME "doscalls.dll\0" +#include <reactos/version.rc> _____ Added: trunk/os2/lib/doscalls/doscalls.xml --- trunk/os2/lib/doscalls/doscalls.xml 2005-08-12 20:29:01 UTC (rev 17352) +++ trunk/os2/lib/doscalls/doscalls.xml 2005-08-12 20:55:07 UTC (rev 17353) @@ -0,0 +1,23 @@ +<module name="doscalls" type="nativedll"> + <importlibrary definition="doscalls.def" /> + <include base="doscalls">../../include</include> + <linkerflag>-lgcc</linkerflag> + <directory name="devices"> + <file>devices.cpp</file> + <file>ioctl_async.cpp</file> + </directory> + <directory name="file"> + <file>directory.cpp</file> + <file>openclose.cpp</file> + </directory> + <directory name="memory"> + <file>memory.cpp</file> + </directory> + <directory name="misc"> + <file>doscalls.cpp</file> + <file>error.cpp</file> + </directory> + <directory name="run"> + <file>process.cpp</file> + </directory> +</module> Property changes on: trunk/os2/lib/doscalls/doscalls.xml ___________________________________________________________________ Name: svn:keywords + author date id revision Name: svn:eol-style + native _____ Deleted: trunk/os2/lib/doscalls/file/.cvsignore --- trunk/os2/lib/doscalls/file/.cvsignore 2005-08-12 20:29:01 UTC (rev 17352) +++ trunk/os2/lib/doscalls/file/.cvsignore 2005-08-12 20:55:07 UTC (rev 17353) @@ -1 +0,0 @@ -*.o _____ Modified: trunk/os2/lib/doscalls/file/directory.cpp --- trunk/os2/lib/doscalls/file/directory.cpp 2005-08-12 20:29:01 UTC (rev 17352) +++ trunk/os2/lib/doscalls/file/directory.cpp 2005-08-12 20:55:07 UTC (rev 17353) @@ -1,4 +1,4 @@ -/* $Id: directory.cpp,v 1.1 2002/09/04 22:19:47 robertk Exp $ +/* $Id$ */ /* * _____ Modified: trunk/os2/lib/doscalls/file/openclose.cpp --- trunk/os2/lib/doscalls/file/openclose.cpp 2005-08-12 20:29:01 UTC (rev 17352) +++ trunk/os2/lib/doscalls/file/openclose.cpp 2005-08-12 20:55:07 UTC (rev 17353) @@ -1,4 +1,4 @@ -/* $Id: openclose.cpp,v 1.5 2004/01/31 01:29:11 robertk Exp $ +/* $Id$ */ /* * _____ Deleted: trunk/os2/lib/doscalls/misc/.cvsignore --- trunk/os2/lib/doscalls/misc/.cvsignore 2005-08-12 20:29:01 UTC (rev 17352) +++ trunk/os2/lib/doscalls/misc/.cvsignore 2005-08-12 20:55:07 UTC (rev 17353) @@ -1 +0,0 @@ -*.o _____ Modified: trunk/os2/lib/doscalls/misc/doscalls.cpp --- trunk/os2/lib/doscalls/misc/doscalls.cpp 2005-08-12 20:29:01 UTC (rev 17352) +++ trunk/os2/lib/doscalls/misc/doscalls.cpp 2005-08-12 20:55:07 UTC (rev 17353) @@ -1,4 +1,4 @@ -/* $Id: doscalls.cpp,v 1.1 2002/07/26 00:23:13 robertk Exp $ +/* $Id$ */ /* * _____ Modified: trunk/os2/lib/doscalls/misc/error.cpp --- trunk/os2/lib/doscalls/misc/error.cpp 2005-08-12 20:29:01 UTC (rev 17352) +++ trunk/os2/lib/doscalls/misc/error.cpp 2005-08-12 20:55:07 UTC (rev 17353) @@ -1,4 +1,4 @@ -/* $Id: error.cpp,v 1.3 2003/01/07 16:23:11 robd Exp $ +/* $Id$ */ /* * _____ Deleted: trunk/os2/lib/doscalls/run/.cvsignore --- trunk/os2/lib/doscalls/run/.cvsignore 2005-08-12 20:29:01 UTC (rev 17352) +++ trunk/os2/lib/doscalls/run/.cvsignore 2005-08-12 20:55:07 UTC (rev 17353) @@ -1 +0,0 @@ -*.o _____ Modified: trunk/os2/lib/doscalls/run/process.cpp --- trunk/os2/lib/doscalls/run/process.cpp 2005-08-12 20:29:01 UTC (rev 17352) +++ trunk/os2/lib/doscalls/run/process.cpp 2005-08-12 20:55:07 UTC (rev 17353) @@ -1,4 +1,4 @@ -/* $Id: process.cpp,v 1.6 2003/01/07 16:23:11 robd Exp $ +/* $Id$ */ /* * @@ -31,7 +31,7 @@ } -/* $Id: process.cpp,v 1.6 2003/01/07 16:23:11 robd Exp $ */ +/* $Id$ */ /* Terminates the current thread or the current Process. Decission is made by action FIXME: move this code to OS2.EXE */ _____ Deleted: trunk/os2/server/.cvsignore --- trunk/os2/server/.cvsignore 2005-08-12 20:29:01 UTC (rev 17352) +++ trunk/os2/server/.cvsignore 2005-08-12 20:55:07 UTC (rev 17353) @@ -1,3 +0,0 @@ -*.exe -*.o -*.sym _____ Added: trunk/os2/server/dllmain.c --- trunk/os2/server/dllmain.c 2005-08-12 20:29:01 UTC (rev 17352) +++ trunk/os2/server/dllmain.c 2005-08-12 20:55:07 UTC (rev 17353) @@ -0,0 +1,50 @@ +/* $Id$ + * + * dllmain.c - OS/2 Enviroment Subsystem Server + * + * ReactOS Operating System + * + * -------------------------------------------------------------------- + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING.LIB. If not, write + * to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, + * MA 02139, USA. + * + * -------------------------------------------------------------------- + */ +#include "os2srv.h" + +#define NDEBUG +#include <debug.h> + +/* DLL entry point */ + +HANDLE Os2SrvDllHandle = 0; + +/* FUNCTIONS *****************************************************************/ + +BOOL STDCALL +DllMain(HANDLE hDll, + DWORD dwReason, + LPVOID lpReserved) +{ + if (DLL_PROCESS_ATTACH == dwReason) + { + Os2SrvDllHandle = hDll; + } + + return TRUE; +} + +/* EOF */ Property changes on: trunk/os2/server/dllmain.c ___________________________________________________________________ Name: svn:keywords + author data id revision Name: svn:eol-style + native _____ Deleted: trunk/os2/server/makefile --- trunk/os2/server/makefile 2005-08-12 20:29:01 UTC (rev 17352) +++ trunk/os2/server/makefile 2005-08-12 20:55:07 UTC (rev 17353) @@ -1,34 +0,0 @@ -# $Id: makefile,v 1.3 2003/01/12 02:03:06 robd Exp $ - -PATH_TO_TOP = ../../reactos - -TARGET_TYPE = program - -TARGET_NORC = yes - -TARGET_APPTYPE = native - -TARGET_NAME = os2ss - -TARGET_INSTALLDIR = system32 - -TARGET_CFLAGS = -D__NTAPP__ - -TARGET_SDKLIBS = ntdll.a kernel32.a csrss.a - -TARGET_GCCLIBS = stdc++ - -OBJECTS_API = - -OBJECTS_MISC = \ - $(TARGET_NAME).o - -TARGET_OBJECTS = \ - $(OBJECTS_API) \ - $(OBJECTS_MISC) - -include $(PATH_TO_TOP)/rules.mak - -include $(TOOLS_PATH)/helper.mk - -# EOF _____ Added: trunk/os2/server/os2srv.def --- trunk/os2/server/os2srv.def 2005-08-12 20:29:01 UTC (rev 17352) +++ trunk/os2/server/os2srv.def 2005-08-12 20:55:07 UTC (rev 17353) @@ -0,0 +1,3 @@ +LIBRARY os2srv.dll +EXPORTS +ServerDllInitialization@8 Property changes on: trunk/os2/server/os2srv.def ___________________________________________________________________ Name: svn:keywords + author data id revision Name: svn:eol-style + native _____ Added: trunk/os2/server/os2srv.h --- trunk/os2/server/os2srv.h 2005-08-12 20:29:01 UTC (rev 17352) +++ trunk/os2/server/os2srv.h 2005-08-12 20:55:07 UTC (rev 17353) @@ -0,0 +1,13 @@ +#ifndef _OS2SS_H_INCLUDED_ +#define _OS2SS_H_INCLUDED_ + +/* PSDK/NDK Headers */ +#include <stdio.h> +#include <windows.h> + +#define NTOS_MODE_USER +#include <ndk/ntndk.h> + +#include <csr/server.h> + +#endif /* ndef _OS2SS_H_INCLUDED_ */ Property changes on: trunk/os2/server/os2srv.h ___________________________________________________________________ Name: svn:keywords + author data id revision Name: svn:eol-style + native _____ Added: trunk/os2/server/os2srv.rc --- trunk/os2/server/os2srv.rc 2005-08-12 20:29:01 UTC (rev 17352) +++ trunk/os2/server/os2srv.rc 2005-08-12 20:55:07 UTC (rev 17353) @@ -0,0 +1,4 @@ +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS-OS/2 Environment Subsystem Server\0" +#define REACTOS_STR_INTERNAL_NAME "os2srv\0" +#define REACTOS_STR_ORIGINAL_FILENAME "os2srv.dll\0" +#include <reactos/version.rc> Property changes on: trunk/os2/server/os2srv.rc ___________________________________________________________________ Name: svn:keywords + author data id revision Name: svn:eol-style + native _____ Added: trunk/os2/server/os2srv.xml --- trunk/os2/server/os2srv.xml 2005-08-12 20:29:01 UTC (rev 17352) +++ trunk/os2/server/os2srv.xml 2005-08-12 20:55:07 UTC (rev 17353) @@ -0,0 +1,11 @@ +<module name="os2srv" type="nativedll"> + <importlibrary definition="os2srv.def" /> + <include base="os2srv">.</include> + <define name="__USE_W32API" /> + <define name="_DISABLE_TIDENTS" /> + <library>ntdll</library> + <library>csrsrv</library> + <file>dllmain.c</file> + <file>server.c</file> + <file>os2srv.rc</file> +</module> Property changes on: trunk/os2/server/os2srv.xml ___________________________________________________________________ Name: svn:keywords + author data id revision Name: svn:eol-style + native _____ Deleted: trunk/os2/server/os2ss.cpp --- trunk/os2/server/os2ss.cpp 2005-08-12 20:29:01 UTC (rev 17352) +++ trunk/os2/server/os2ss.cpp 2005-08-12 20:55:07 UTC (rev 17353) @@ -1,157 +0,0 @@ -/* $Id: os2ss.cpp,v 1.2 2003/01/07 16:23:12 robd Exp $ - * - * reactos/subsys/csrss/api/process.c - * - * "\windows\ApiPort" port process management functions - * - * ReactOS Operating System - */ - // TODO: Rewrite the whole file. This is just a copy - -#include <ddk/ntddk.h> -#include <ntdll/rtl.h> -#include <ntos/synch.h> - -extern "C" { -BOOL CsrServerInitialization(ULONG ArgumentCount, PWSTR *ArgumentArray); -VOID DisplayString(LPCWSTR lpwString); -//BOOL STDCALL CsrServerInitialization (ULONG ArgumentCount, PWSTR *ArgumentArray); -//VOID STDCALL DisplayString(LPCWSTR lpwString); -//VOID STDCALL PrintString (char* fmt, ...); -//NTSTATUS STDCALL NtDisplayString(IN PUNICODE_STRING DisplayString); - -void -DisplayString(LPCWSTR lpwString) -{ - UNICODE_STRING us; - - RtlInitUnicodeString(&us, lpwString); - NtDisplayString(&us); -} - -/* -void -PrintString(char* fmt,...) -{ - char buffer[512]; - va_list ap; - UNICODE_STRING UnicodeString; - ANSI_STRING AnsiString; - - va_start(ap, fmt); - vsprintf(buffer, fmt, ap); - va_end(ap); - - RtlInitAnsiString(&AnsiString, buffer); - RtlAnsiStringToUnicodeString(&UnicodeString, - &AnsiString, - TRUE); - NtDisplayString(&UnicodeString); - RtlFreeUnicodeString(&UnicodeString); -} - */ - -} - -/* server variables */ - -int NumProcesses; - - - -/* Native image's entry point */ - -void NtProcessStartup (PPEB Peb) -{ - PRTL_USER_PROCESS_PARAMETERS ProcParams; - PWSTR ArgBuffer; - PWSTR *argv; - ULONG argc = 0; - int i = 0; - int afterlastspace = 0; - OBJECT_ATTRIBUTES ObjectAttributes; - HANDLE CsrssInitEvent; - UNICODE_STRING UnicodeString; - NTSTATUS Status; - - ProcParams = RtlNormalizeProcessParams (Peb->ProcessParameters); - - argv = (PWSTR *)RtlAllocateHeap (Peb->ProcessHeap, - 0, 512 * sizeof(PWSTR)); - ArgBuffer = (PWSTR)RtlAllocateHeap (Peb->ProcessHeap, - 0, - ProcParams->CommandLine.Length + sizeof(WCHAR)); - memcpy (ArgBuffer, - ProcParams->CommandLine.Buffer, - ProcParams->CommandLine.Length + sizeof(WCHAR)); - - while (ArgBuffer[i]) - { - if (ArgBuffer[i] == L' ') - { - argc++; - ArgBuffer[i] = L'\0'; - argv[argc-1] = &(ArgBuffer[afterlastspace]); - i++; - while (ArgBuffer[i] == L' ') - i++; - afterlastspace = i; - } - else - { - i++; - } - } - - if (ArgBuffer[afterlastspace] != L'\0') - { - argc++; - ArgBuffer[i] = L'\0'; - argv[argc-1] = &(ArgBuffer[afterlastspace]); - } - - RtlInitUnicodeString(&UnicodeString, - L"\\CsrssInitDone"); - InitializeObjectAttributes(&ObjectAttributes, - &UnicodeString, - EVENT_ALL_ACCESS, - 0, - NULL); - Status = NtOpenEvent(&CsrssInitEvent, - EVENT_ALL_ACCESS, - &ObjectAttributes); - if (!NT_SUCCESS(Status)) - { - DbgPrint("CSR: Failed to open csrss notification event\n"); - } - if (CsrServerInitialization (argc, argv) == TRUE) - { - - NtSetEvent(CsrssInitEvent, - NULL); - - RtlFreeHeap (Peb->ProcessHeap, - 0, argv); - RtlFreeHeap (Peb->ProcessHeap, - 0, - ArgBuffer); - - /* terminate the current thread only */ - NtTerminateThread( NtCurrentThread(), 0 ); - } - else - { - DisplayString( L"CSR: Subsystem initialization failed.\n" ); - - RtlFreeHeap (Peb->ProcessHeap, - 0, argv); - RtlFreeHeap (Peb->ProcessHeap, - 0, - ArgBuffer); - - /* - * Tell SM we failed. - */ - NtTerminateProcess( NtCurrentProcess(), 0 ); - } -} _____ Added: trunk/os2/server/server.c --- trunk/os2/server/server.c 2005-08-12 20:29:01 UTC (rev 17352) +++ trunk/os2/server/server.c 2005-08-12 20:55:07 UTC (rev 17353) @@ -0,0 +1,84 @@ +/* $Id$ + * + * server.c - OS/2 Enviroment Subsystem Server - Initialization + * + * ReactOS Operating System + * + * -------------------------------------------------------------------- + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING.LIB. If not, write + * to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, + * MA 02139, USA. + * + * -------------------------------------------------------------------- + */ +#include "os2srv.h" + +//#define NDEBUG +#include <debug.h> + +HANDLE Os2ApiPort = NULL; + +/********************************************************************** + * NAME PRIVATE + * Os2StaticServerThread/1 + */ +VOID STDCALL Os2StaticServerThread (PVOID x) +{ + NTSTATUS Status = STATUS_SUCCESS; + PPORT_MESSAGE Request = (PPORT_MESSAGE) x; + PPORT_MESSAGE Reply = NULL; + ULONG MessageType = 0; + + DPRINT("VMSSRV: %s called\n", __FUNCTION__); + + MessageType = Request->u2.s2.Type; + DPRINT("VMSSRV: %s received a message (Type=%d)\n", + __FUNCTION__, MessageType); + switch (MessageType) + { + default: + Reply = Request; + Status = NtReplyPort (Os2ApiPort, Reply); + break; + } +} + +/*===================================================================== + * PUBLIC API + *===================================================================*/ + +NTSTATUS STDCALL ServerDllInitialization (ULONG ArgumentCount, + LPWSTR *Argument) +{ + NTSTATUS Status = STATUS_SUCCESS; + + DPRINT("VMSSRV: %s called\n", __FUNCTION__); + + // Get the listening port from csrsrv.dll + Os2ApiPort = CsrQueryApiPort (); + if (NULL == Os2ApiPort) + { + return STATUS_UNSUCCESSFUL; + } + // Register our message dispatcher + Status = CsrAddStaticServerThread (Os2StaticServerThread); + if (NT_SUCCESS(Status)) + { + //TODO: perform the real OS/2 server internal initialization here + } + return Status; +} + +/* EOF */ Property changes on: trunk/os2/server/server.c ___________________________________________________________________ Name: svn:keywords + author data id revision Name: svn:eol-style + native
19 years, 4 months
1
0
0
0
[fireball] 17352: Xbox hack added, so two exactly the same PCI devices (OHCI controllers) have different locations. Without it USB drivers won't work at all.
by fireball@svn.reactos.com
Xbox hack added, so two exactly the same PCI devices (OHCI controllers) have different locations. Without it USB drivers won't work at all. Modified: trunk/reactos/drivers/bus/pci/pci.c _____ Modified: trunk/reactos/drivers/bus/pci/pci.c --- trunk/reactos/drivers/bus/pci/pci.c 2005-08-12 20:21:22 UTC (rev 17351) +++ trunk/reactos/drivers/bus/pci/pci.c 2005-08-12 20:29:01 UTC (rev 17352) @@ -296,7 +296,27 @@ return TRUE; #endif - return PciCreateUnicodeString(InstanceID, L"0000", PagedPool); + WCHAR Buffer[256]; + + swprintf(Buffer, + L"PCI\\VEN_%04X&DEV_%04X&SUBSYS_%08X&REV_%02X", + Device->PciConfig.VendorID, + Device->PciConfig.DeviceID, + (Device->PciConfig.u.type0.SubSystemID << 16) + + Device->PciConfig.u.type0.SubVendorID, + Device->PciConfig.RevisionID); + + // XBOX HACK + if (!wcscmp(L"PCI\\VEN_10DE&DEV_01C2&SUBSYS_00000000&REV_D4", Buffer)) + { + //DPRINT("xbox ohci controler found at bus 0x%lX, dev num %d, func num %d\n", Device->BusNumber, Device->SlotNumber.u.bits.DeviceNumber, Device->SlotNumber.u.bits.FunctionNumber); + if (Device->SlotNumber.u.bits.DeviceNumber == 2) + return PciCreateUnicodeString(InstanceID, L"0000", PagedPool); + else + return PciCreateUnicodeString(InstanceID, L"0001", PagedPool); + } + else + return PciCreateUnicodeString(InstanceID, L"0000", PagedPool); }
19 years, 4 months
1
0
0
0
[fireball] 17351: Major additions to usb stack:
by fireball@svn.reactos.com
Major additions to usb stack: 1) Improve hardware support in linux_wrapper 2) Add embedded drivers, register them in linux usb stack 3) Add working wrapper for keyboard and mouse devices - now if usbohci or uhci loads, it will be the first to create KeyboardClass0 and PointerClass0 devices, so PS/2 keyb/mouse won't work. 4) Added logic for registering miniport at port driver (like Windows' usb stack does) Bad things: 1) "multithreading" is still done not the proper way, but ugly way 2) under xbox xpad doesn't work 3) it must be wasting lots of CPU power now, since hub thread doesn't block while waiting for events Modified: trunk/reactos/drivers/usb/cromwell/core/hcd-pci.c Modified: trunk/reactos/drivers/usb/cromwell/core/hub.c Modified: trunk/reactos/drivers/usb/cromwell/core/message.c Modified: trunk/reactos/drivers/usb/cromwell/core/urb.c Modified: trunk/reactos/drivers/usb/cromwell/core/usb.c Modified: trunk/reactos/drivers/usb/cromwell/core/usbcore.c Modified: trunk/reactos/drivers/usb/cromwell/core/usbcore.def Modified: trunk/reactos/drivers/usb/cromwell/core/usbcore.xml Modified: trunk/reactos/drivers/usb/cromwell/host/ohci_main.c Modified: trunk/reactos/drivers/usb/cromwell/host/ohci_main.h 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/sys/ros_wrapper.c Modified: trunk/reactos/drivers/usb/cromwell/sys/usbkey.c Modified: trunk/reactos/drivers/usb/cromwell/usb_wrapper.h _____ Modified: trunk/reactos/drivers/usb/cromwell/core/hcd-pci.c --- trunk/reactos/drivers/usb/cromwell/core/hcd-pci.c 2005-08-12 20:11:56 UTC (rev 17350) +++ trunk/reactos/drivers/usb/cromwell/core/hcd-pci.c 2005-08-12 20:21:22 UTC (rev 17351) @@ -33,7 +33,7 @@ #include <linux/usb.h> #include "hcd.h" #else -#define DEBUG + #include "../usb_wrapper.h" #include "hcd.h" #endif @@ -193,6 +193,10 @@ if ((retval = driver->start (hcd)) < 0) usb_hcd_pci_remove (dev); + //ReactOS-specific: Init core drivers here + UsbKeyBoardInit(); + UsbMouseInit(); + return retval; } EXPORT_SYMBOL (usb_hcd_pci_probe); _____ Modified: trunk/reactos/drivers/usb/cromwell/core/hub.c --- trunk/reactos/drivers/usb/cromwell/core/hub.c 2005-08-12 20:11:56 UTC (rev 17350) +++ trunk/reactos/drivers/usb/cromwell/core/hub.c 2005-08-12 20:21:22 UTC (rev 17351) @@ -7,7 +7,6 @@ * (C) Copyright 2001 Brad Hards (bhards(a)bigpond.net.au) * */ -#define DEBUG #if 0 #include <linux/config.h> #include <linux/kernel.h> @@ -34,11 +33,13 @@ #include "hcd.h" #include "hub.h" + #else + #include "../usb_wrapper.h" #include "hcd.h" #include "hub.h" -#define DEBUG + #endif /* Wakes up khubd */ @@ -152,7 +153,7 @@ default: /* presumably an error */ /* Cause a hub reset after 10 consecutive errors */ - //printe("hub_irq got ...: error %d URB: %d",hub->error,urb->status); + printk("hub_irq got ...: error %d URB: %d",hub->error,urb->status); dev_dbg (&hub->intf->dev, "transfer --> %d\n", urb->status); if ((++hub->nerrors < 10) || hub->error) @@ -379,8 +380,8 @@ goto fail; } else if (hub->descriptor->bNbrPorts > USB_MAXCHILDREN) { message = "hub has too many ports!"; - ret = -ENODEV; - goto fail; + // XBOX PATCH hub->descriptor->bNbrPorts = 4; //ret = -ENODEV; + //goto fail; } hub_dev = hubdev(dev); @@ -517,6 +518,7 @@ /* Wake up khubd */ wake_up(&khubd_wait); + printk("hub_thread should woke up\n"); hub_power_on(hub); @@ -597,7 +599,7 @@ /* specs is not defined, but it works */ if ((desc->desc.bInterfaceSubClass != 0) && (desc->desc.bInterfaceSubClass != 1)) { -descriptor_error: +//descriptor_error: desc->desc.bInterfaceSubClass =0; dev_err (&intf->dev, "bad descriptor, ignoring hub\n"); //return -EIO; @@ -1208,6 +1210,8 @@ // ReactOS: STDCALL is needed here static int STDCALL hub_thread(void *__hub) { + //LARGE_INTEGER delay; + /* * This thread doesn't need any user-level access, * so get rid of all our resources @@ -1219,6 +1223,11 @@ // Initialize khubd spinlock KeInitializeSpinLock((PKSPIN_LOCK)&hub_event_lock); + //delay.QuadPart = -10000000*5; // wait 5 seconds before powering up + //KeDelayExecutionThread(KernelMode, FALSE, &delay); //wait_us(1); + + printk("hub_thread starting"); + /* Send me a signal to get me die (for debugging) */ do { LARGE_INTEGER delay; @@ -1226,7 +1235,7 @@ /* The following is just for debug */ inc_jiffies(1); do_all_timers(); - handle_irqs(-1); + //handle_irqs(-1); /* End of debug hack*/ hub_events(); /* The following is just for debug */ _____ Modified: trunk/reactos/drivers/usb/cromwell/core/message.c --- trunk/reactos/drivers/usb/cromwell/core/message.c 2005-08-12 20:11:56 UTC (rev 17350) +++ trunk/reactos/drivers/usb/cromwell/core/message.c 2005-08-12 20:21:22 UTC (rev 17351) @@ -40,7 +40,7 @@ struct usb_api_data awd; int status; - printk("usb_start_wait_urb(): urb devnum=%d, timeout=%d, urb->actual_length=%d\n", urb->dev->devnum, timeout, urb->actual_length); + //printk("usb_start_wait_urb(): urb devnum=%d, timeout=%d, urb->actual_length=%d\n", urb->dev->devnum, timeout, urb->actual_length); init_waitqueue_head((PKEVENT)&awd.wqh); awd.done = 0; @@ -58,7 +58,7 @@ remove_wait_queue(&awd.wqh, &wait); return status; } - printk("TRACE 3.1, timeout=%d, awd.done=%d\n", timeout, awd.done); + //printk("TRACE 3.1, timeout=%d, awd.done=%d\n", timeout, awd.done); while (timeout && !awd.done) { timeout = schedule_timeout(timeout); @@ -156,7 +156,7 @@ dr->wIndex = cpu_to_le16p(&index); dr->wLength = cpu_to_le16p(&size); - printk("usb_control_msg: devnum=%d, size=%d, timeout=%d\n", dev->devnum, size, timeout); + //printk("usb_control_msg: devnum=%d, size=%d, timeout=%d\n", dev->devnum, size, timeout); ret = usb_internal_control_msg(dev, pipe, dr, data, size, timeout); kfree(dr); _____ Modified: trunk/reactos/drivers/usb/cromwell/core/urb.c --- trunk/reactos/drivers/usb/cromwell/core/urb.c 2005-08-12 20:11:56 UTC (rev 17350) +++ trunk/reactos/drivers/usb/cromwell/core/urb.c 2005-08-12 20:21:22 UTC (rev 17351) @@ -201,8 +201,8 @@ struct usb_device *dev; struct usb_operations *op; int is_out; - printk("sub dev %p bus %p num %i op %p sub %p\n", - urb->dev, urb->dev->bus,urb->dev->devnum,urb->dev->bus->op, urb->dev->bus->op->submit_urb); + //printk("sub dev %p bus %p num %i op %p sub %p\n", + // urb->dev, urb->dev->bus,urb->dev->devnum,urb->dev->bus->op, urb->dev->bus->op->submit_urb); if (!urb || urb->hcpriv || !urb->complete) return -EINVAL; if (!(dev = urb->dev) || _____ Modified: trunk/reactos/drivers/usb/cromwell/core/usb.c --- trunk/reactos/drivers/usb/cromwell/core/usb.c 2005-08-12 20:11:56 UTC (rev 17350) +++ trunk/reactos/drivers/usb/cromwell/core/usb.c 2005-08-12 20:21:22 UTC (rev 17351) @@ -54,8 +54,6 @@ #include "hcd.h" #endif -#define DEBUG - extern int usb_hub_init(void); extern void usb_hub_cleanup(void); extern int usb_major_init(void); _____ Modified: trunk/reactos/drivers/usb/cromwell/core/usbcore.c --- trunk/reactos/drivers/usb/cromwell/core/usbcore.c 2005-08-12 20:11:56 UTC (rev 17350) +++ trunk/reactos/drivers/usb/cromwell/core/usbcore.c 2005-08-12 20:21:22 UTC (rev 17351) @@ -5,7 +5,18 @@ #include <ddk/ntddk.h> #include <debug.h> +#include "../usb_wrapper.h" +USBPORT_INTERFACE UsbPortInterface; + +void STDCALL RegisterPortDriver(PDRIVER_OBJECT pDrvObj, PUSBPORT_INTERFACE pUsbPortIntf) +{ + // copy struct to global var + DPRINT("Miniport 0x%08X registered\n", (ULONG)pDrvObj); + memcpy(&UsbPortInterface.KbdConnectData, &pUsbPortIntf->KbdConnectData, sizeof(CONNECT_DATA)); + memcpy(&UsbPortInterface.MouseConnectData, &pUsbPortIntf->MouseConnectData, sizeof(CONNECT_DATA)); +} + NTSTATUS STDCALL AddDevice(PDRIVER_OBJECT DriverObject, PDEVICE_OBJECT pdo) { _____ Modified: trunk/reactos/drivers/usb/cromwell/core/usbcore.def --- trunk/reactos/drivers/usb/cromwell/core/usbcore.def 2005-08-12 20:11:56 UTC (rev 17350) +++ trunk/reactos/drivers/usb/cromwell/core/usbcore.def 2005-08-12 20:21:22 UTC (rev 17351) @@ -29,4 +29,5 @@ usb_put_dev@4 usb_disabled@0 usb_hcd_pci_probe@8 -usb_hcd_pci_remove@4 \ No newline at end of file +usb_hcd_pci_remove@4 +RegisterPortDriver@8 \ No newline at end of file _____ Modified: trunk/reactos/drivers/usb/cromwell/core/usbcore.xml --- trunk/reactos/drivers/usb/cromwell/core/usbcore.xml 2005-08-12 20:11:56 UTC (rev 17350) +++ trunk/reactos/drivers/usb/cromwell/core/usbcore.xml 2005-08-12 20:21:22 UTC (rev 17351) @@ -2,6 +2,7 @@ <importlibrary definition="usbcore.def" /> <define name="__USE_W32API" /> <define name="DEBUG_MODE" /> + <define name="DEBUG" /> <include base="ntoskrnl">include</include> <library>sys_base</library> <library>ntoskrnl</library> @@ -16,5 +17,8 @@ <file>buffer_simple.c</file> <file>usb-debug.c</file> <file>usbcore.c</file> + <file>core_drivers/usbkey.c</file> + <file>core_drivers/usbmouse.c</file> + <file>usbcore.rc</file> </module> _____ Modified: trunk/reactos/drivers/usb/cromwell/host/ohci_main.c --- trunk/reactos/drivers/usb/cromwell/host/ohci_main.c 2005-08-12 20:11:56 UTC (rev 17350) +++ trunk/reactos/drivers/usb/cromwell/host/ohci_main.c 2005-08-12 20:21:22 UTC (rev 17351) @@ -5,6 +5,9 @@ */ #include <ddk/ntddk.h> +#include <ddk/ntddkbd.h> +#include <ddk/ntdd8042.h> + #include <debug.h> #include "../usb_wrapper.h" #include "../core/hcd.h" @@ -20,14 +23,74 @@ extern const struct pci_device_id pci_ids[]; - // This should be removed, but for testing purposes it's here struct pci_dev *dev; //struct pci_device_id *dev_id; +static bool xbox_workaround=false; +// data for embedded drivers +CONNECT_DATA KbdClassInformation; +CONNECT_DATA MouseClassInformation; +PDEVICE_OBJECT KeyboardFdo = NULL; +PDEVICE_OBJECT MouseFdo = NULL; + #define USB_OHCI_TAG TAG('u','s','b','o') +NTSTATUS AddDevice_Keyboard(PDRIVER_OBJECT DriverObject, PDEVICE_OBJECT pdo) +{ + UNICODE_STRING DeviceName = RTL_CONSTANT_STRING(L"\\Device\\KeyboardClass0"); + PDEVICE_OBJECT fdo; + NTSTATUS Status; + + Status = IoCreateDevice(DriverObject, + 8, // debug + &DeviceName, + FILE_DEVICE_KEYBOARD, + FILE_DEVICE_SECURE_OPEN, + TRUE, + &fdo); + + if (!NT_SUCCESS(Status)) + { + DPRINT1("IoCreateDevice for usb keyboard driver failed\n"); + return Status; + } + KeyboardFdo = fdo; + fdo->Flags &= ~DO_DEVICE_INITIALIZING; + DPRINT1("Created keyboard fdo: %p\n", fdo); + + return STATUS_SUCCESS; +} + +NTSTATUS AddDevice_Mouse(PDRIVER_OBJECT DriverObject, PDEVICE_OBJECT pdo) +{ + UNICODE_STRING DeviceName = RTL_CONSTANT_STRING(L"\\Device\\PointerClass0"); + PDEVICE_OBJECT fdo; + NTSTATUS Status; + + Status = IoCreateDevice(DriverObject, + 8, // debug + &DeviceName, + FILE_DEVICE_MOUSE, + FILE_DEVICE_SECURE_OPEN, + TRUE, + &fdo); + + if (!NT_SUCCESS(Status)) + { + DPRINT1("IoCreateDevice for usb mouse driver failed\n"); + return Status; + } + MouseFdo = fdo; + fdo->Flags &= ~DO_DEVICE_INITIALIZING; + + DPRINT1("Created mouse fdo: %p\n", fdo); + + return STATUS_SUCCESS; +} + + NTSTATUS STDCALL AddDevice(PDRIVER_OBJECT DriverObject, PDEVICE_OBJECT pdo) { PDEVICE_OBJECT fdo; @@ -40,6 +103,11 @@ DPRINT1("ohci: AddDevice called\n"); + if (xbox_workaround) + return STATUS_INSUFFICIENT_RESOURCES; // Fail for any other host controller than the first + + xbox_workaround = true; + // Allocate driver extension now DriverExtension = IoGetDriverObjectExtension(DriverObject, DriverObject); if (DriverExtension == NULL) @@ -105,9 +173,15 @@ } DPRINT("Done AddDevice\n"); - return STATUS_SUCCESS; + + // create embedded keyboard driver + Status = AddDevice_Keyboard(DriverObject, pdo); + Status = AddDevice_Mouse(DriverObject, pdo); + + return Status; } + VOID STDCALL DriverUnload(PDRIVER_OBJECT DriverObject) { DPRINT1("DriverUnload()\n"); @@ -196,6 +270,9 @@ NTSTATUS Status; // debug LONGLONG delay; // debug + if (DeviceObject == KeyboardFdo || DeviceObject == MouseFdo) + return STATUS_SUCCESS; + /* * Get the initialization data we saved in VideoPortInitialize. */ @@ -264,10 +341,12 @@ * Init wrapper with this object */ //return InitLinuxWrapper(DeviceObject); + + // debug wait Status = InitLinuxWrapper(DeviceObject); - delay = -10000000*60*2; // wait 2 minutes - KeDelayExecutionThread(KernelMode, FALSE, (LARGE_INTEGER *)&delay); //wait_us(1); + //delay = -10000000*30; // wait 30 secs + //KeDelayExecutionThread(KernelMode, FALSE, (LARGE_INTEGER *)&delay); //wait_us(1); return Status; } @@ -280,6 +359,9 @@ IrpSp = IoGetCurrentIrpStackLocation(Irp); + DPRINT("PNP for %p, minorfunc=0x%x\n", DeviceObject, IrpSp->MinorFunction); + + switch (IrpSp->MinorFunction) { case IRP_MN_START_DEVICE: @@ -331,16 +413,254 @@ return STATUS_SUCCESS; } +NTSTATUS STDCALL UsbCoreDispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp) +{ + ULONG MajorFunction = IoGetCurrentIrpStackLocation(Irp)->MajorFunction; + + DPRINT("usbohci: Dispatching major function 0x%lx\n", MajorFunction); + + IoCompleteRequest (Irp, IO_NO_INCREMENT); + return STATUS_SUCCESS; +} + + +NTSTATUS STDCALL UsbCoreInternalDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp) +{ + NTSTATUS Status = STATUS_INVALID_DEVICE_REQUEST; + + DPRINT("INT_IOCTL for %p, code=0x%x\n", DeviceObject, IoGetCurrentIrpStackLocation(Irp)->Parameters.DeviceIoControl.IoControlC ode); + + if (DeviceObject == KeyboardFdo) + { + // it's keyboard's IOCTL + PIO_STACK_LOCATION Stk; + + Irp->IoStatus.Information = 0; + Stk = IoGetCurrentIrpStackLocation(Irp); + + switch (Stk->Parameters.DeviceIoControl.IoControlCode) { + case IOCTL_INTERNAL_KEYBOARD_CONNECT: + DPRINT("IOCTL_INTERNAL_KEYBOARD_CONNECT\n"); + if (Stk->Parameters.DeviceIoControl.InputBufferLength < sizeof(CONNECT_DATA)) { + DPRINT1("Keyboard IOCTL_INTERNAL_KEYBOARD_CONNECT " + "invalid buffer size\n"); + Irp->IoStatus.Status = STATUS_INVALID_PARAMETER; + goto intcontfailure; + } + + memcpy(&KbdClassInformation, + Stk->Parameters.DeviceIoControl.Type3InputBuffer, + sizeof(CONNECT_DATA)); + + Irp->IoStatus.Status = STATUS_SUCCESS; + break; + + case IOCTL_INTERNAL_I8042_KEYBOARD_WRITE_BUFFER: + DPRINT("IOCTL_INTERNAL_I8042_KEYBOARD_WRITE_BUFFER\n"); + if (Stk->Parameters.DeviceIoControl.InputBufferLength < 1) { + Irp->IoStatus.Status = STATUS_INVALID_PARAMETER; + goto intcontfailure; + } +/* if (!DevExt->KeyboardInterruptObject) { + Irp->IoStatus.Status = STATUS_DEVICE_NOT_READY; + goto intcontfailure; + }*/ + + Irp->IoStatus.Status = STATUS_SUCCESS; + break; + case IOCTL_KEYBOARD_QUERY_ATTRIBUTES: + DPRINT("IOCTL_KEYBOARD_QUERY_ATTRIBUTES\n"); + if (Stk->Parameters.DeviceIoControl.OutputBufferLength < + sizeof(KEYBOARD_ATTRIBUTES)) { + DPRINT("Keyboard IOCTL_KEYBOARD_QUERY_ATTRIBUTES " + "invalid buffer size\n"); + Irp->IoStatus.Status = STATUS_BUFFER_TOO_SMALL; + goto intcontfailure; + } + /*memcpy(Irp->AssociatedIrp.SystemBuffer, + &DevExt->KeyboardAttributes, + sizeof(KEYBOARD_ATTRIBUTES));*/ + + Irp->IoStatus.Status = STATUS_SUCCESS; + break; + case IOCTL_KEYBOARD_QUERY_INDICATORS: + DPRINT("IOCTL_KEYBOARD_QUERY_INDICATORS\n"); + if (Stk->Parameters.DeviceIoControl.OutputBufferLength < + sizeof(KEYBOARD_INDICATOR_PARAMETERS)) { + DPRINT("Keyboard IOCTL_KEYBOARD_QUERY_INDICATORS " + "invalid buffer size\n"); + Irp->IoStatus.Status = STATUS_BUFFER_TOO_SMALL; + goto intcontfailure; + } + /*memcpy(Irp->AssociatedIrp.SystemBuffer, + &DevExt->KeyboardIndicators, + sizeof(KEYBOARD_INDICATOR_PARAMETERS));*/ + + Irp->IoStatus.Status = STATUS_SUCCESS; + break; + case IOCTL_KEYBOARD_QUERY_TYPEMATIC: + DPRINT("IOCTL_KEYBOARD_QUERY_TYPEMATIC\n"); + if (Stk->Parameters.DeviceIoControl.OutputBufferLength < + sizeof(KEYBOARD_TYPEMATIC_PARAMETERS)) { + DPRINT("Keyboard IOCTL_KEYBOARD_QUERY_TYPEMATIC " + "invalid buffer size\n"); + Irp->IoStatus.Status = STATUS_BUFFER_TOO_SMALL; + goto intcontfailure; + } + /*memcpy(Irp->AssociatedIrp.SystemBuffer, + &DevExt->KeyboardTypematic, + sizeof(KEYBOARD_TYPEMATIC_PARAMETERS));*/ + + Irp->IoStatus.Status = STATUS_SUCCESS; + break; + case IOCTL_KEYBOARD_SET_INDICATORS: + DPRINT("IOCTL_KEYBOARD_SET_INDICATORS\n"); + if (Stk->Parameters.DeviceIoControl.InputBufferLength < + sizeof(KEYBOARD_INDICATOR_PARAMETERS)) { + DPRINT("Keyboard IOCTL_KEYBOARD_SET_INDICTATORS " + "invalid buffer size\n"); + Irp->IoStatus.Status = STATUS_BUFFER_TOO_SMALL; + goto intcontfailure; + } + + /*memcpy(&DevExt->KeyboardIndicators, + Irp->AssociatedIrp.SystemBuffer, + sizeof(KEYBOARD_INDICATOR_PARAMETERS));*/ + + //DPRINT("%x\n", DevExt->KeyboardIndicators.LedFlags); + + Irp->IoStatus.Status = STATUS_SUCCESS; + break; + case IOCTL_KEYBOARD_SET_TYPEMATIC: + DPRINT("IOCTL_KEYBOARD_SET_TYPEMATIC\n"); + if (Stk->Parameters.DeviceIoControl.InputBufferLength < + sizeof(KEYBOARD_TYPEMATIC_PARAMETERS)) { + DPRINT("Keyboard IOCTL_KEYBOARD_SET_TYPEMATIC " + "invalid buffer size\n"); + Irp->IoStatus.Status = STATUS_BUFFER_TOO_SMALL; + goto intcontfailure; + } + + /*memcpy(&DevExt->KeyboardTypematic, + Irp->AssociatedIrp.SystemBuffer, + sizeof(KEYBOARD_TYPEMATIC_PARAMETERS));*/ + + Irp->IoStatus.Status = STATUS_SUCCESS; + break; + case IOCTL_KEYBOARD_QUERY_INDICATOR_TRANSLATION: + /* We should check the UnitID, but it's kind of pointless as + * all keyboards are supposed to have the same one + */ +#if 0 + if (Stk->Parameters.DeviceIoControl.OutputBufferLength < + sizeof(LOCAL_KEYBOARD_INDICATOR_TRANSLATION)) { + DPRINT("IOCTL_KEYBOARD_QUERY_INDICATOR_TRANSLATION: " + "invalid buffer size (expected)\n"); + /* It's to query the buffer size */ + Irp->IoStatus.Status = STATUS_BUFFER_TOO_SMALL; + goto intcontfailure; + } + Irp->IoStatus.Information = + sizeof(LOCAL_KEYBOARD_INDICATOR_TRANSLATION); +#endif + /*memcpy(Irp->AssociatedIrp.SystemBuffer, + &IndicatorTranslation, + sizeof(LOCAL_KEYBOARD_INDICATOR_TRANSLATION));*/ + + Irp->IoStatus.Status = STATUS_SUCCESS; + break; + case IOCTL_INTERNAL_I8042_HOOK_KEYBOARD: + /* Nothing to do here */ + Irp->IoStatus.Status = STATUS_SUCCESS; + break; + default: + Irp->IoStatus.Status = STATUS_INVALID_DEVICE_REQUEST; + break; + } + + intcontfailure: + Status = Irp->IoStatus.Status; + } + else if (DeviceObject == MouseFdo) + { + // it's mouse's IOCTL + PIO_STACK_LOCATION Stk; + + Irp->IoStatus.Information = 0; + Stk = IoGetCurrentIrpStackLocation(Irp); + + switch (Stk->Parameters.DeviceIoControl.IoControlCode) { + case IOCTL_INTERNAL_MOUSE_CONNECT: + DPRINT("IOCTL_INTERNAL_MOUSE_CONNECT\n"); + if (Stk->Parameters.DeviceIoControl.InputBufferLength < sizeof(CONNECT_DATA)) { + DPRINT1("Mouse IOCTL_INTERNAL_MOUSE_CONNECT " + "invalid buffer size\n"); + Irp->IoStatus.Status = STATUS_INVALID_PARAMETER; + goto intcontfailure2; + } + + memcpy(&MouseClassInformation, + Stk->Parameters.DeviceIoControl.Type3InputBuffer, + sizeof(CONNECT_DATA)); + + Irp->IoStatus.Status = STATUS_SUCCESS; + break; + + default: + Irp->IoStatus.Status = STATUS_SUCCESS;//STATUS_INVALID_DEVICE_REQUEST; + break; + } + intcontfailure2: + Status = Irp->IoStatus.Status; + } + else + { + DPRINT("We got IOCTL for UsbCore\n"); + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return STATUS_SUCCESS; + } + + + if (Status == STATUS_INVALID_DEVICE_REQUEST) { + DPRINT1("Invalid internal device request!\n"); + } + + if (Status != STATUS_PENDING) + IoCompleteRequest(Irp, IO_NO_INCREMENT); + + return Status; +} + + /* * Standard DriverEntry method. */ NTSTATUS STDCALL DriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegPath) { + int i; + USBPORT_INTERFACE UsbPortInterface; + DriverObject->DriverUnload = DriverUnload; DriverObject->DriverExtension->AddDevice = AddDevice; + + for (i = 0; i < IRP_MJ_MAXIMUM_FUNCTION; i++) + DriverObject->MajorFunction[i] = UsbCoreDispatch; + DriverObject->MajorFunction[IRP_MJ_PNP] = DispatchPnp; DriverObject->MajorFunction[IRP_MJ_POWER] = DispatchPower; + DriverObject->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] = UsbCoreInternalDeviceControl; + // Register in usbcore.sys + UsbPortInterface.KbdConnectData = &KbdClassInformation; + UsbPortInterface.MouseConnectData = &MouseClassInformation; + + KbdClassInformation.ClassService = NULL; + KbdClassInformation.ClassDeviceObject = NULL; + MouseClassInformation.ClassService = NULL; + MouseClassInformation.ClassDeviceObject = NULL; + + RegisterPortDriver(DriverObject, &UsbPortInterface); + return STATUS_SUCCESS; } _____ Modified: trunk/reactos/drivers/usb/cromwell/host/ohci_main.h --- trunk/reactos/drivers/usb/cromwell/host/ohci_main.h 2005-08-12 20:11:56 UTC (rev 17350) +++ trunk/reactos/drivers/usb/cromwell/host/ohci_main.h 2005-08-12 20:21:22 UTC (rev 17351) @@ -62,5 +62,7 @@ PDEVICE_OBJECT RootHubPdo; } OHCI_DEVICE_EXTENSION, *POHCI_DEVICE_EXTENSION; +#define IOCTL_INTERNAL_KEYBOARD_CONNECT \ + CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0080, METHOD_NEITHER, FILE_ANY_ACCESS) #endif _____ Modified: trunk/reactos/drivers/usb/cromwell/linux/linux_wrapper.h --- trunk/reactos/drivers/usb/cromwell/linux/linux_wrapper.h 2005-08-12 20:11:56 UTC (rev 17350) +++ trunk/reactos/drivers/usb/cromwell/linux/linux_wrapper.h 2005-08-12 20:21:22 UTC (rev 17351) @@ -703,13 +703,12 @@ /*---------------------------------------------------------------------- --*/ void STDCALL usb_hcd_pci_remove (struct pci_dev *dev); -#define my_wait_ms(x) wait_ms(x) +#define my_wait_ms(x) wait_ms(x) // milliseconds -#define my_udelay(x) wait_ms(x) -#define udelay(x) my_udelay(x) +#define udelay(x) my_udelay(x) // microseconds #define my_mdelay(x) wait_ms(1+x/1000); -#define mdelay(x) my_mdelay(x); +#define mdelay(x) my_mdelay(x); // milliseconds = udelay(1000*x) #define pci_find_slot(a,b) my_pci_find_slot(a,b) struct pci_dev *my_pci_find_slot(int a,int b); @@ -851,3 +850,7 @@ int my_pci_write_config_word(struct pci_dev *, int, u16); +void UsbKeyBoardInit(void); +void UsbKeyBoardRemove(void); +void UsbMouseInit(void); +void UsbMouseRemove(void); _____ Modified: trunk/reactos/drivers/usb/cromwell/sys/linuxwrapper.c --- trunk/reactos/drivers/usb/cromwell/sys/linuxwrapper.c 2005-08-12 20:11:56 UTC (rev 17350) +++ trunk/reactos/drivers/usb/cromwell/sys/linuxwrapper.c 2005-08-12 20:21:22 UTC (rev 17351) @@ -258,7 +258,7 @@ x+=5; // safety x = x*1000; // to us format */ - x = 300; // it's enough for most purposes + x = 50; // it's enough for most purposes while(x>0) { @@ -701,7 +701,7 @@ if ((i + block) < pool->blocks_per_page) { - DPRINT("pci_pool_alloc(): Allocating block %p:%d:%d:%d\n", pool, page, map, block); + //DPRINT("pci_pool_alloc(): Allocating block %p:%d:%d:%d\n", pool, page, map, block); clear_bit(block, &pool->pages[page].bitmap[map]); offset = (BITS_PER_LONG * map) + block; offset *= pool->size; @@ -763,7 +763,7 @@ set_bit (block, &pool->pages[page].bitmap[map]); pool->blocks_allocated--; - DPRINT("pci_pool_free(): alloc'd: %d\n", pool->blocks_allocated); + //DPRINT("pci_pool_free(): alloc'd: %d\n", pool->blocks_allocated); } /* _____ Modified: trunk/reactos/drivers/usb/cromwell/sys/ros_wrapper.c --- trunk/reactos/drivers/usb/cromwell/sys/ros_wrapper.c 2005-08-12 20:11:56 UTC (rev 17350) +++ trunk/reactos/drivers/usb/cromwell/sys/ros_wrapper.c 2005-08-12 20:21:22 UTC (rev 17351) @@ -5,6 +5,20 @@ { LARGE_INTEGER Interval; - Interval.QuadPart = -mils*10; + DPRINT1("wait_ms(%d)\n", mils); + + Interval.QuadPart = -(mils+1)*10000; KeDelayExecutionThread(KernelMode, FALSE, &Interval); + +// schedule_timeout(1 + mils * HZ / 1000); } + +void my_udelay(int us) +{ + LARGE_INTEGER Interval; + + DPRINT1("udelay(%d)\n", us); + + Interval.QuadPart = -us*10; + KeDelayExecutionThread(KernelMode, FALSE, &Interval); +} _____ Modified: trunk/reactos/drivers/usb/cromwell/sys/usbkey.c --- trunk/reactos/drivers/usb/cromwell/sys/usbkey.c 2005-08-12 20:11:56 UTC (rev 17350) +++ trunk/reactos/drivers/usb/cromwell/sys/usbkey.c 2005-08-12 20:21:22 UTC (rev 17351) @@ -1,9 +1,9 @@ #include "../usb_wrapper.h" -#define keyboarddebug 0 +#define keyboarddebug 1 #if keyboarddebug -extern int printe(const char *szFormat, ...); +//extern int printk(const char *szFormat, ...); int ycoffset = 0; #endif @@ -28,7 +28,7 @@ static void usb_kbd_irq(struct urb *urb, struct pt_regs *regs) { struct usb_kbd_info *kbd = urb->context; - int i; + //int i; if (urb->status) return; @@ -38,11 +38,11 @@ #if keyboarddebug - ycoffset += 15; - ycoffset = ycoffset % 600; - VIDEO_CURSOR_POSX=20; - VIDEO_CURSOR_POSY=ycoffset; - printe(" -%02x %02x %02x %02x %02x %02x\n",kbd->kbd_pkt[0],kbd->kbd_pkt[1],kbd->kbd_pkt[2],kbd->kbd_pkt[3], kbd->kbd_pkt[4],kbd->kbd_pkt[5]); + //ycoffset += 15; + //ycoffset = ycoffset % 600; + //VIDEO_CURSOR_POSX=20; + //VIDEO_CURSOR_POSY=ycoffset; + printk(" -%02x %02x %02x %02x %02x %02x\n",kbd->kbd_pkt[0],kbd->kbd_pkt[1],kbd->kbd_pkt[2],kbd->kbd_pkt[3], kbd->kbd_pkt[4],kbd->kbd_pkt[5]); #endif usb_submit_urb(urb,GFP_ATOMIC); @@ -54,11 +54,11 @@ struct urb *urb; struct usb_device *udev = interface_to_usbdev (intf); struct usb_endpoint_descriptor *ep_irq_in; - struct usb_endpoint_descriptor *ep_irq_out; + //struct usb_endpoint_descriptor *ep_irq_out; struct usb_kbd_info *usbk; - int i, pipe, maxp; - char *buf; + //int i, pipe, maxp; + //char *buf; usbk=(struct usb_kbd_info *)kmalloc(sizeof(struct usb_kbd_info),0); if (!usbk) return -1; @@ -77,8 +77,10 @@ usb_submit_urb(urb,GFP_ATOMIC); usb_set_intfdata(intf,usbk); #if keyboarddebug - printe("USB Keyboard Connected\n"); + printk("USB Keyboard Connected\n"); #endif + + return 0; } @@ -107,12 +109,11 @@ void UsbKeyBoardInit(void) { - //current_remote_key=0; //sbprintk("Keyboard probe %p ",xremote_probe); if (usb_register(&usb_kbd_driver) < 0) { #if keyboarddebug - printe("Unable to register Keyboard driver"); + printk("Unable to register Keyboard driver"); #endif return; } _____ Modified: trunk/reactos/drivers/usb/cromwell/usb_wrapper.h --- trunk/reactos/drivers/usb/cromwell/usb_wrapper.h 2005-08-12 20:11:56 UTC (rev 17350) +++ trunk/reactos/drivers/usb/cromwell/usb_wrapper.h 2005-08-12 20:21:22 UTC (rev 17351) @@ -1,13 +1,31 @@ //#include <stdlib.h> //#include <ntos/types.h> //#include <ddk/extypes.h> + +/* + TODO: Do a major cleanup of this file! + Lots of definitions should go to corresponding files +*/ + #include <ddk/ntddk.h> +#include <ddk/kbdmou.h> #include <debug.h> #define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24)) void wait_ms(int mils); +void my_udelay(int us); +// For now this is needed only for correct operation of embedded keyboard and mouse drvs +typedef struct _USBPORT_INTERFACE +{ + PCONNECT_DATA KbdConnectData; + PCONNECT_DATA MouseConnectData; +} USBPORT_INTERFACE, *PUSBPORT_INTERFACE; + +// Register in usbcore.sys +void STDCALL RegisterPortDriver(PDRIVER_OBJECT, PUSBPORT_INTERFACE); + #ifndef _snprintf int _snprintf(char * buf, size_t cnt, const char *fmt, ...); #endif
19 years, 4 months
1
0
0
0
[fireball] 17350: removed debug message about submitting urb
by fireball@svn.reactos.com
removed debug message about submitting urb Modified: trunk/reactos/drivers/usb/cromwell/core/hcd.c _____ Modified: trunk/reactos/drivers/usb/cromwell/core/hcd.c --- trunk/reactos/drivers/usb/cromwell/core/hcd.c 2005-08-12 19:54:40 UTC (rev 17349) +++ trunk/reactos/drivers/usb/cromwell/core/hcd.c 2005-08-12 20:11:56 UTC (rev 17350) @@ -982,7 +982,7 @@ if (!hcd || !dev) return -ENODEV; - printk("submit_urb %p, # %i, t %i\n",urb,urb->dev->devnum,usb_pipetype(urb->pipe)); + //printk("submit_urb %p, # %i, t %i\n",urb,urb->dev->devnum,usb_pipetype(urb->pipe)); /* * FIXME: make urb timeouts be generic, keeping the HCD cores * as simple as possible.
19 years, 4 months
1
0
0
0
[fireball] 17349: USB keyboard and mouse "embedded" drivers from cromwell and linux 2.5.0 usb stack adapted to our stack.
by fireball@svn.reactos.com
USB keyboard and mouse "embedded" drivers from cromwell and linux 2.5.0 usb stack adapted to our stack. Added: trunk/reactos/drivers/usb/cromwell/core/core_drivers/ Added: trunk/reactos/drivers/usb/cromwell/core/core_drivers/usbkey.c Added: trunk/reactos/drivers/usb/cromwell/core/core_drivers/usbmouse.c _____ Added: trunk/reactos/drivers/usb/cromwell/core/core_drivers/usbkey.c --- trunk/reactos/drivers/usb/cromwell/core/core_drivers/usbkey.c 2005-08-12 19:22:42 UTC (rev 17348) +++ trunk/reactos/drivers/usb/cromwell/core/core_drivers/usbkey.c 2005-08-12 19:54:40 UTC (rev 17349) @@ -0,0 +1,236 @@ +/* + This driver is based on Cromwell's usbkey driver + and also includes stuff from Linux 2.5 usbkey driver by Vojtech Pavlik +*/ + +#define NDEBUG +#include "../../usb_wrapper.h" + +#define keyboarddebug 0 + +#if keyboarddebug +//extern int printk(const char *szFormat, ...); +#endif + +unsigned int current_keyboard_key; + +extern USBPORT_INTERFACE UsbPortInterface; + +static unsigned char usb_kbd_keycode[256] = { + 0, 0, 0, 0, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38, + 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 21, 44, 2, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 28, 1, 14, 15, 57, 12, 13, 26, + 27, 43, 84, 39, 40, 41, 51, 52, 53, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 87, 88, 99, 70,119,110,102,104,111,107,109,106, + 105,108,103, 69, 98, 55, 74, 78, 96, 79, 80, 81, 75, 76, 77, 71, + 72, 73, 82, 83, 86,127,116,117, 85, 89, 90, 91, 92, 93, 94, 95, + 120,121,122,123,134,138,130,132,128,129,131,137,133,135,136,113, + 115,114, 0, 0, 0,124, 0,181,182,183,184,185,186,187,188,189, + 190,191,192,193,194,195,196,197,198, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 29, 42, 56,125, 97, 54,100,126,164,166,165,163,161,115,114,113, + 150,158,159,128,136,177,178,176,142,152,173,140 +}; + +struct usb_kbd_info { + struct urb *urb; + unsigned char kbd_pkt[8]; + unsigned char old[8]; + + /* + struct input_dev dev; + struct usb_device *usbdev; + struct urb irq, led; + struct usb_ctrlrequest dr; + unsigned char leds, newleds; + char name[128]; + int open; + */ +}; + +/** + * memscan - Find a character in an area of memory. + * @addr: The memory area + * @c: The byte to search for + * @size: The size of the area. + * + * returns the address of the first occurrence of @c, or 1 byte past + * the area if @c is not found + */ +void * memscan(void * addr, int c, size_t size) +{ + unsigned char * p = (unsigned char *) addr; + + while (size) { + if (*p == c) + return (void *) p; + p++; + size--; + } + return (void *) p; +} + +void input_report_key(unsigned int code, int value) +{ + KEYBOARD_INPUT_DATA KeyboardInputData; + ULONG InputDataConsumed; + + KeyboardInputData.MakeCode = code; + KeyboardInputData.Flags = (value == 1) ? KEY_MAKE : KEY_BREAK; + + if (UsbPortInterface.KbdConnectData->ClassService) + { + KIRQL OldIrql; + + KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); + (*(PSERVICE_CALLBACK_ROUTINE)UsbPortInterface.KbdConnectData->ClassServi ce)( + UsbPortInterface.KbdConnectData->ClassDeviceObject, + &KeyboardInputData, + (&KeyboardInputData)+1, + &InputDataConsumed); + KeLowerIrql(OldIrql); + } +} + +static void usb_kbd_irq(struct urb *urb, struct pt_regs *regs) +{ + struct usb_kbd_info *kbd = urb->context; + int i; + + if (urb->status) return; + + memcpy(kbd->kbd_pkt, urb->transfer_buffer, 8); + + //for (i = 0; i < 8; i++) + // input_report_key(usb_kbd_keycode[i + 224], (kbd->kbd_pkt[0] >> i) & 1); + + for (i = 2; i < 8; i++) { + + if (kbd->old[i] > 3 && memscan(kbd->kbd_pkt + 2, kbd->old[i], 6) == kbd->kbd_pkt + 8) { + if (usb_kbd_keycode[kbd->old[i]]) + input_report_key(usb_kbd_keycode[kbd->old[i]], 0); + else + info("Unknown key (scancode %#x) released.", kbd->old[i]); + } + + if (kbd->kbd_pkt[i] > 3 && memscan(kbd->old + 2, kbd->kbd_pkt[i], 6) == kbd->old + 8) { + if (usb_kbd_keycode[kbd->kbd_pkt[i]]) + input_report_key(usb_kbd_keycode[kbd->kbd_pkt[i]], 1); + else + info("Unknown key (scancode %#x) pressed.", kbd->kbd_pkt[i]); + } + } + + memcpy(kbd->old, kbd->kbd_pkt, 8); + +#if 0 + //memcpy(kbd->kbd_pkt, urb->transfer_buffer, 8); + //current_keyboard_key = kbd->kbd_pkt[2]; + { + KEYBOARD_INPUT_DATA KeyboardInputData; + ULONG InputDataConsumed; + + KeyboardInputData.MakeCode = current_keyboard_key & ~0x80; + KeyboardInputData.Flags = (current_keyboard_key & 0x80) ? KEY_MAKE : KEY_BREAK; + + if (UsbPortInterface.KbdConnectData->ClassService) + { + KIRQL OldIrql; + + KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); + (*(PSERVICE_CALLBACK_ROUTINE)UsbPortInterface.KbdConnectData->ClassServi ce)( + UsbPortInterface.KbdConnectData->ClassDeviceObject, + &KeyboardInputData, + (&KeyboardInputData)+1, + &InputDataConsumed); + KeLowerIrql(OldIrql); + } + } +#endif + + + #if keyboarddebug + printk(" -%02x %02x %02x %02x %02x %02x\n",kbd->kbd_pkt[0],kbd->kbd_pkt[1],kbd->kbd_pkt[2],kbd->kbd_pkt[3], kbd->kbd_pkt[4],kbd->kbd_pkt[5]); + #endif + + usb_submit_urb(urb,GFP_ATOMIC); + +} + +static int usb_kbd_probe(struct usb_interface *intf, const struct usb_device_id *id) +{ + struct urb *urb; + struct usb_device *udev = interface_to_usbdev (intf); + struct usb_endpoint_descriptor *ep_irq_in; + //struct usb_endpoint_descriptor *ep_irq_out; + struct usb_kbd_info *usbk; + + //int i, pipe, maxp; + //char *buf; + + usbk=(struct usb_kbd_info *)kmalloc(sizeof(struct usb_kbd_info),0); + if (!usbk) return -1; + memset(usbk, 0, sizeof(struct usb_kbd_info)); + + urb=usb_alloc_urb(0,0); + if (!urb) return -1; + + usbk->urb=urb; + + ep_irq_in = &intf->altsetting[0].endpoint[0].desc; + usb_fill_int_urb(urb, udev, + usb_rcvintpipe(udev, ep_irq_in->bEndpointAddress), + usbk->kbd_pkt, 8, usb_kbd_irq, + usbk, 8); + + usb_submit_urb(urb,GFP_ATOMIC); + usb_set_intfdata(intf,usbk); + #if keyboarddebug + printk("USB Keyboard Connected\n"); + #endif + + return 0; +} + + +static void usb_kbd_disconnect(struct usb_interface *intf) +{ + struct usb_kbd_info *usbk = usb_get_intfdata (intf); + usbprintk("Keyboard disconnected\n "); + usb_unlink_urb(usbk->urb); + usb_free_urb(usbk->urb); + kfree(usbk); +} + +static struct usb_device_id usb_kbd_id_table [] = { + { USB_INTERFACE_INFO(3, 1, 1) }, + { } /* Terminating entry */ +}; + + +static struct usb_driver usb_kbd_driver = { + .owner = THIS_MODULE, + .name = "keyboard", + .probe = usb_kbd_probe, + .disconnect = usb_kbd_disconnect, + .id_table = usb_kbd_id_table, +}; + +void UsbKeyBoardInit(void) +{ + //current_remote_key=0; + //sbprintk("Keyboard probe %p ",xremote_probe); + if (usb_register(&usb_kbd_driver) < 0) { + #if keyboarddebug + printk("Unable to register Keyboard driver"); + #endif + return; + } +} + +void UsbKeyBoardRemove(void) { + usb_deregister(&usb_kbd_driver); +} _____ Added: trunk/reactos/drivers/usb/cromwell/core/core_drivers/usbmouse.c --- trunk/reactos/drivers/usb/cromwell/core/core_drivers/usbmouse.c 2005-08-12 19:22:42 UTC (rev 17348) +++ trunk/reactos/drivers/usb/cromwell/core/core_drivers/usbmouse.c 2005-08-12 19:54:40 UTC (rev 17349) @@ -0,0 +1,279 @@ +/* + This driver is based on Linux 2.5.75 usbmouse driver by Vojtech Pavlik +*/ + +#define NDEBUG +#include "../../usb_wrapper.h" + +extern USBPORT_INTERFACE UsbPortInterface; + +struct usb_mouse { + char name[128]; + char phys[64]; + struct usb_device *usbdev; + char btn_old; + //struct input_dev dev; + struct urb *irq; + int open; + + signed char *data; + dma_addr_t data_dma; +}; + +static void usb_mouse_irq(struct urb *urb, struct pt_regs *regs) +{ + struct usb_mouse *mouse = urb->context; + signed char *data = mouse->data; + int status; + + switch (urb->status) { + case 0: /* success */ + break; + case -ECONNRESET: /* unlink */ + case -ENOENT: + case -ESHUTDOWN: + return; + /* -EPIPE: should clear the halt */ + default: /* error */ + goto resubmit; + } +/* + input_regs(dev, regs); + + input_report_key(dev, BTN_LEFT, data[0] & 0x01); + input_report_key(dev, BTN_RIGHT, data[0] & 0x02); + input_report_key(dev, BTN_MIDDLE, data[0] & 0x04); + input_report_key(dev, BTN_SIDE, data[0] & 0x08); + input_report_key(dev, BTN_EXTRA, data[0] & 0x10); + + input_report_rel(dev, REL_X, data[1]); + input_report_rel(dev, REL_Y, data[2]); + input_report_rel(dev, REL_WHEEL, data[3]); + + input_sync(dev); +*/ + + { + MOUSE_INPUT_DATA MouseInputData; + ULONG InputDataConsumed; + + MouseInputData.Flags = MOUSE_MOVE_RELATIVE; + MouseInputData.LastX = data[1]; + MouseInputData.LastY = data[2]; + + MouseInputData.ButtonFlags = 0; + MouseInputData.ButtonData = 0; + + if ((data[0] & 0x01) && ((mouse->btn_old & 0x01) != (data[0] & 0x01))) + MouseInputData.ButtonFlags |= MOUSE_LEFT_BUTTON_DOWN; + else if (!(data[0] & 0x01) && ((mouse->btn_old & 0x01) != (data[0] & 0x01))) + MouseInputData.ButtonFlags |= MOUSE_LEFT_BUTTON_UP; + + if ((data[0] & 0x02) && ((mouse->btn_old & 0x02) != (data[0] & 0x02))) + MouseInputData.ButtonFlags |= MOUSE_RIGHT_BUTTON_DOWN; + else if (!(data[0] & 0x02) && ((mouse->btn_old & 0x02) != (data[0] & 0x02))) + MouseInputData.ButtonFlags |= MOUSE_RIGHT_BUTTON_UP; + + if ((data[0] & 0x04) && ((mouse->btn_old & 0x04) != (data[0] & 0x04))) + MouseInputData.ButtonFlags |= MOUSE_MIDDLE_BUTTON_DOWN; + else if (!(data[0] & 0x04) && ((mouse->btn_old & 0x04) != (data[0] & 0x04))) + MouseInputData.ButtonFlags |= MOUSE_MIDDLE_BUTTON_UP; + + if ((data[0] & 0x08) && ((mouse->btn_old & 0x08) != (data[0] & 0x08))) + MouseInputData.ButtonFlags |= MOUSE_BUTTON_4_DOWN; + else if (!(data[0] & 0x08) && ((mouse->btn_old & 0x08) != (data[0] & 0x08))) + MouseInputData.ButtonFlags |= MOUSE_BUTTON_4_UP; + + if ((data[0] & 0x10) && ((mouse->btn_old & 0x10) != (data[0] & 0x10))) + MouseInputData.ButtonFlags |= MOUSE_BUTTON_5_DOWN; + else if (!(data[0] & 0x10) && ((mouse->btn_old & 0x10) != (data[0] & 0x10))) + MouseInputData.ButtonFlags |= MOUSE_BUTTON_5_UP; + + if (data[3]) + { + MouseInputData.ButtonFlags |= MOUSE_WHEEL; + MouseInputData.ButtonData = data[3]; + } + + if (UsbPortInterface.MouseConnectData->ClassService) + { + KIRQL OldIrql; + + KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); + (*(PSERVICE_CALLBACK_ROUTINE)UsbPortInterface.MouseConnectData->ClassSer vice)( + UsbPortInterface.MouseConnectData->ClassDeviceObject, + &MouseInputData, + (&MouseInputData)+1, + &InputDataConsumed); + KeLowerIrql(OldIrql); + } + + mouse->btn_old = data[0]; + + // debug info + printk("MouseInputData.Buttons=0x%03x\n", MouseInputData.Buttons); + } + + printk("Mouse input: x %d, y %d, w %d, btn: 0x%02x\n", data[1], data[2], data[3], data[0]); + +resubmit: + status = usb_submit_urb (urb, SLAB_ATOMIC); + if (status) + err ("can't resubmit intr, %s-%s/input0, status %d", + mouse->usbdev->bus->bus_name, + mouse->usbdev->devpath, status); +} +/* +static int usb_mouse_open(struct input_dev *dev) +{ + struct usb_mouse *mouse = dev->private; + + if (mouse->open++) + return 0; + + mouse->irq->dev = mouse->usbdev; + if (usb_submit_urb(mouse->irq, GFP_KERNEL)) { + mouse->open--; + return -EIO; + } + + return 0; +} + +static void usb_mouse_close(struct input_dev *dev) +{ + struct usb_mouse *mouse = dev->private; + + if (!--mouse->open) + usb_unlink_urb(mouse->irq); +} +*/ + +static int usb_mouse_probe(struct usb_interface * intf, const struct usb_device_id * id) +{ + struct usb_device * dev = interface_to_usbdev(intf); + struct usb_host_interface *interface; + struct usb_endpoint_descriptor *endpoint; + struct usb_mouse *mouse; + int pipe, maxp; + char path[64]; + char *buf; + + interface = &intf->altsetting[intf->act_altsetting]; + + if (interface->desc.bNumEndpoints != 1) + return -ENODEV; + + endpoint = &interface->endpoint[0].desc; + if (!(endpoint->bEndpointAddress & 0x80)) + return -ENODEV; + if ((endpoint->bmAttributes & 3) != 3) + return -ENODEV; + + pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress); + maxp = usb_maxpacket(dev, pipe, usb_pipeout(pipe)); + + if (!(mouse = kmalloc(sizeof(struct usb_mouse), GFP_KERNEL))) + return -ENOMEM; + memset(mouse, 0, sizeof(struct usb_mouse)); + + mouse->data = usb_buffer_alloc(dev, 8, SLAB_ATOMIC, &mouse->data_dma); + if (!mouse->data) { + kfree(mouse); + return -ENOMEM; + } + + mouse->irq = usb_alloc_urb(0, GFP_KERNEL); + if (!mouse->irq) { + usb_buffer_free(dev, 8, mouse->data, mouse->data_dma); + kfree(mouse); + return -ENODEV; + } + + mouse->usbdev = dev; + + usb_make_path(dev, path, 64); + sprintf(mouse->phys, "%s/input0", path); + + if (!(buf = kmalloc(63, GFP_KERNEL))) { + usb_buffer_free(dev, 8, mouse->data, mouse->data_dma); + kfree(mouse); + return -ENOMEM; + } + + if (dev->descriptor.iManufacturer && + usb_string(dev, dev->descriptor.iManufacturer, buf, 63) > 0) + strcat(mouse->name, buf); + if (dev->descriptor.iProduct && + usb_string(dev, dev->descriptor.iProduct, buf, 63) > 0) + sprintf(mouse->name, "%s %s", mouse->name, buf); + + if (!strlen(mouse->name)) + sprintf(mouse->name, "USB HIDBP Mouse %04x:%04x", + dev->descriptor.idVendor, dev->descriptor.idProduct); + + kfree(buf); + + usb_fill_int_urb(mouse->irq, dev, pipe, mouse->data, + (maxp > 8 ? 8 : maxp), + usb_mouse_irq, mouse, endpoint->bInterval); + //mouse->irq->transfer_dma = mouse->data_dma; + //mouse->irq->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; + + printk(KERN_INFO "input: %s on %s\n", mouse->name, path); + + usb_set_intfdata(intf, mouse); + + // Open device + mouse->irq->dev = mouse->usbdev; + if (usb_submit_urb(mouse->irq, GFP_KERNEL)) { + return -EIO; + } + + mouse->btn_old = 0; + + return 0; +} + +static void usb_mouse_disconnect(struct usb_interface *intf) +{ + struct usb_mouse *mouse = usb_get_intfdata (intf); + + usb_set_intfdata(intf, NULL); + usbprintk("Mouse disconnected\n "); + if (mouse) { + usb_unlink_urb(mouse->irq); + usb_free_urb(mouse->irq); + usb_buffer_free(interface_to_usbdev(intf), 8, mouse->data, mouse->data_dma); + kfree(mouse); + } +} + +static struct usb_device_id usb_mouse_id_table [] = { + { USB_INTERFACE_INFO(3, 1, 2) }, + { } /* Terminating entry */ +}; + +MODULE_DEVICE_TABLE (usb, usb_mouse_id_table); + +static struct usb_driver usb_mouse_driver = { + .owner = THIS_MODULE, + .name = "usbmouse", + .probe = usb_mouse_probe, + .disconnect = usb_mouse_disconnect, + .id_table = usb_mouse_id_table, +}; + +void UsbMouseInit(void) +{ + if (usb_register(&usb_mouse_driver) < 0) { + #if mousedebug + printk("Unable to register Mouse driver"); + #endif + return; + } +} + +void UsbMouseRemove(void) { + usb_deregister(&usb_mouse_driver); +}
19 years, 4 months
1
0
0
0
← Newer
1
...
22
23
24
25
26
27
28
...
67
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
Results per page:
10
25
50
100
200