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
September 2010
----- 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
18 participants
278 discussions
Start a n
N
ew thread
[sir_richard] 48780: Patch by Anton Yarotsky: [NTOSKRNL]: Fix support for non Headless scenarios as well.
by sir_richard@svn.reactos.org
Author: sir_richard Date: Thu Sep 16 02:22:10 2010 New Revision: 48780 URL:
http://svn.reactos.org/svn/reactos?rev=48780&view=rev
Log: Patch by Anton Yarotsky: [NTOSKRNL]: Fix support for non Headless scenarios as well. Modified: trunk/reactos/ntoskrnl/ex/hdlsterm.c Modified: trunk/reactos/ntoskrnl/ex/hdlsterm.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/hdlsterm.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/ex/hdlsterm.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ex/hdlsterm.c [iso-8859-1] Thu Sep 16 02:22:10 2010 @@ -194,25 +194,22 @@ HdlspSendStringAtBaud(HeadlessGlobals->TmpBuffer); } -/* - * @unimplemented - */ NTSTATUS NTAPI -HeadlessDispatch( - IN HEADLESS_CMD Command, - IN PVOID InputBuffer, - IN SIZE_T InputBufferSize, - OUT PVOID OutputBuffer, - OUT PSIZE_T OutputBufferSize +HdlspDispatch( + IN HEADLESS_CMD Command, + IN PVOID InputBuffer, + IN SIZE_T InputBufferSize, + OUT PVOID OutputBuffer, + OUT PSIZE_T OutputBufferSize ) { NTSTATUS Status = STATUS_NOT_IMPLEMENTED; ASSERT(HeadlessGlobals != NULL); // ASSERT(HeadlessGlobals->PageLockHandle != NULL); - + /* FIXME: This should be using the headless spinlock */ - + /* Ignore non-reentrant commands */ if ((Command != HeadlessCmdAddLogEntry) && (Command != HeadlessCmdStartBugCheck) && @@ -224,7 +221,7 @@ /* Don't allow these commands next time */ HeadlessGlobals->ProcessingCmd = TRUE; } - + /* Handle each command */ switch (Command) { @@ -241,7 +238,7 @@ Status = STATUS_INVALID_PARAMETER; goto Reset; } - + /* Terminal should be on */ if (HeadlessGlobals->TerminalEnabled) { @@ -249,7 +246,7 @@ PHEADLESS_CMD_PUT_STRING PutString = (PVOID)InputBuffer; HdlspPutString(PutString->String); } - + /* Return success either way */ Status = STATUS_SUCCESS; break; @@ -304,10 +301,51 @@ { ASSERT(HeadlessGlobals->ProcessingCmd == TRUE); HeadlessGlobals->ProcessingCmd = FALSE; - } + } //UNIMPLEMENTED; return STATUS_SUCCESS; } +/* + * @unimplemented + */ +NTSTATUS +NTAPI +HeadlessDispatch( + IN HEADLESS_CMD Command, + IN PVOID InputBuffer, + IN SIZE_T InputBufferSize, + OUT PVOID OutputBuffer, + OUT PSIZE_T OutputBufferSize + ) +{ + /* Check for stubs that will expect something even with headless off */ + if (!HeadlessGlobals) + { + /* Don't allow the SAC to connect */ + if (Command == HeadlessCmdEnableTerminal) return STATUS_UNSUCCESSFUL; + + /* Send bogus reply */ + if ((Command == HeadlessCmdQueryInformation) || + (Command == HeadlessCmdGetByte) || + (Command == HeadlessCmdGetLine) || + (Command == HeadlessCmdCheckForReboot) || + (Command == HeadlessCmdTerminalPoll)) + { + if (!(OutputBuffer) || !(OutputBufferSize)) return STATUS_INVALID_PARAMETER; + RtlZeroMemory(OutputBuffer, *OutputBufferSize); + } + return STATUS_SUCCESS; + } + + /* Do the real work */ + return HdlspDispatch( + Command, + InputBuffer, + InputBufferSize, + OutputBuffer, + OutputBufferSize); +} + /* EOF */
14 years, 3 months
1
0
0
0
[tkreuzer] 48779: Fix arm build a bit.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Sep 15 23:48:38 2010 New Revision: 48779 URL:
http://svn.reactos.org/svn/reactos?rev=48779&view=rev
Log: Fix arm build a bit. Modified: trunk/reactos/ReactOS-arm.rbuild Modified: trunk/reactos/ReactOS-arm.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ReactOS-arm.rbuild?rev=487…
============================================================================== --- trunk/reactos/ReactOS-arm.rbuild [iso-8859-1] (original) +++ trunk/reactos/ReactOS-arm.rbuild [iso-8859-1] Wed Sep 15 23:48:38 2010 @@ -7,18 +7,18 @@ </xi:fallback> </xi:include> - <xi:include href="ReactOS-generic.rbuild" /> + <xi:include href="ReactOS-generic.rbuild" /> - <!-- <define name="_M_ARM" /> Already defined by toolchain --> + <!-- <define name="_M_ARM" /> Already defined by toolchain --> <define name="_ARM_" /> <define name="__arm__" /> <define name="TARGET_arm" host="true" /> - <define name="USE_COMPILER_EXCEPTIONS" /> + <define name="USE_COMPILER_EXCEPTIONS" /> - <property name="WINEBUILD_FLAGS" value="--kill-at"/> + <property name="WINEBUILD_FLAGS" value="--kill-at"/> - <include>include/reactos/arm</include> + <include>include/reactos/arm</include> <if property="SARCH" value="versatile"> <define name="BOARD_CONFIG_VERSATILE"/> @@ -29,17 +29,17 @@ <compilerflag>-ftracer</compilerflag> </if> <compilerflag>-fms-extensions</compilerflag> - <compilerflag>-Wno-attributes</compilerflag> - <compilerflag>-U_UNICODE</compilerflag> - <compilerflag>-UUNICODE</compilerflag> + <compilerflag>-Wno-attributes</compilerflag> + <compilerflag>-U_UNICODE</compilerflag> + <compilerflag>-UUNICODE</compilerflag> </group> <define name="__MSVCRT__"/> <!-- DUBIOUS --> <group linkerset="ld"> - <linkerflag>--strip-debug</linkerflag> <!-- INVESTIGATE --> - <linkerflag>-static</linkerflag> <!-- INVESTIGATE --> + <linkerflag>--strip-debug</linkerflag> <!-- INVESTIGATE --> + <linkerflag>-static</linkerflag> <!-- INVESTIGATE --> <linkerflag>-file-alignment=0x1000</linkerflag> <linkerflag>-section-alignment=0x1000</linkerflag> </group> @@ -53,7 +53,10 @@ <directory name="drivers"> <directory name="csq"> <xi:include href="lib/drivers/csq/csq.rbuild" /> - </directory> + </directory> + </directory> + <directory name="cportlib"> + <xi:include href="lib/cportlib/cportlib.rbuild" /> </directory> <directory name="debugsup"> <xi:include href="lib/debugsup/debugsup.rbuild" /> @@ -152,9 +155,9 @@ </directory> <directory name="base"> <directory name="system"> - <directory name="smss"> - <xi:include href="base/system/smss/smss.rbuild" /> - </directory> + <directory name="smss"> + <xi:include href="base/system/smss/smss.rbuild" /> + </directory> </directory> </directory> </project>
14 years, 3 months
1
0
0
0
[sir_richard] 48778: Patch by Anton Yarotsky: [NTOSKRNL]: Implement CmdPutString command, and add log message types. Kernel version/build, processor, and RAM, now appear on EMS screen (due to InbvD...
by sir_richard@svn.reactos.org
Author: sir_richard Date: Wed Sep 15 18:30:06 2010 New Revision: 48778 URL:
http://svn.reactos.org/svn/reactos?rev=48778&view=rev
Log: Patch by Anton Yarotsky: [NTOSKRNL]: Implement CmdPutString command, and add log message types. Kernel version/build, processor, and RAM, now appear on EMS screen (due to InbvDisplayString), as well as loaded drivers. Next steps are to support log entries and a flag to route debug output (a ReactOS-specific feature request). Modified: trunk/reactos/ntoskrnl/ex/hdlsterm.c trunk/reactos/ntoskrnl/include/internal/hdl.h Modified: trunk/reactos/ntoskrnl/ex/hdlsterm.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/hdlsterm.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/ex/hdlsterm.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ex/hdlsterm.c [iso-8859-1] Wed Sep 15 18:30:06 2010 @@ -20,7 +20,7 @@ VOID NTAPI HdlspSendStringAtBaud( - IN PCHAR String + IN PUCHAR String ) { /* Send every byte */ @@ -51,8 +51,8 @@ if (!HeadlessGlobals->TerminalEnabled) return STATUS_UNSUCCESSFUL; /* Cleanup the screen and reset the cursor */ - HdlspSendStringAtBaud("\x1B[2J"); - HdlspSendStringAtBaud("\x1B[H"); + HdlspSendStringAtBaud((PUCHAR)"\x1B[2J"); + HdlspSendStringAtBaud((PUCHAR)"\x1B[H"); /* Enable FIFO */ InbvPortEnableFifo(HeadlessGlobals->TerminalPort, TRUE); @@ -109,6 +109,10 @@ /* Log entries are not yet supported */ DPRINT1("FIXME: No Headless logging support\n"); + /* Allocate temporary buffer */ + HeadlessGlobals->TmpBuffer = ExAllocatePoolWithTag(NonPagedPool, 80, 'sldH'); + if (!HeadlessGlobals->TmpBuffer) return; + /* Windows seems to apply some special hacks for 9600 bps */ if (HeadlessGlobals->TerminalBaudRate == 9600) { @@ -117,6 +121,77 @@ /* Enable the terminal */ HdlspEnableTerminal(TRUE); +} + +VOID +NTAPI +HdlspPutString( + IN PUCHAR String + ) +{ + PUCHAR Dest = HeadlessGlobals->TmpBuffer; + UCHAR Char = 0; + + /* Scan each character */ + while (*String != ANSI_NULL) + { + /* Check for rotate, send existing buffer and restart from where we are */ + if (Dest >= &HeadlessGlobals->TmpBuffer[79]) + { + HeadlessGlobals->TmpBuffer[79] = ANSI_NULL; + HdlspSendStringAtBaud(HeadlessGlobals->TmpBuffer); + Dest = HeadlessGlobals->TmpBuffer; + } + else + { + /* Get the current character and check for special graphical chars */ + Char = *String; + if (Char & 0x80) + { + switch (Char) + { + case 0xB0: case 0xB3: case 0xBA: + Char = '|'; + break; + case 0xB1: case 0xDC: case 0xDD: case 0xDE: case 0xDF: + Char = '%'; + break; + case 0xB2: case 0xDB: + Char = '#'; + break; + case 0xA9: case 0xAA: case 0xBB: case 0xBC: case 0xBF: + case 0xC0: case 0xC8: case 0xC9: case 0xD9: case 0xDA: + Char = '+'; + break; + case 0xC4: + Char = '-'; + break; + case 0xCD: + Char = '='; + break; + } + } + + /* Anything else must be Unicode */ + if (Char & 0x80) + { + /* Can't do Unicode yet */ + UNIMPLEMENTED; + } + else + { + /* Add the modified char to the temporary buffer */ + *Dest++ = Char; + } + + /* Check the next char */ + String++; + } + } + + /* Finish and send */ + *Dest = ANSI_NULL; + HdlspSendStringAtBaud(HeadlessGlobals->TmpBuffer); } /* @@ -132,8 +207,107 @@ OUT PSIZE_T OutputBufferSize ) { + NTSTATUS Status = STATUS_NOT_IMPLEMENTED; + ASSERT(HeadlessGlobals != NULL); +// ASSERT(HeadlessGlobals->PageLockHandle != NULL); + + /* FIXME: This should be using the headless spinlock */ + + /* Ignore non-reentrant commands */ + if ((Command != HeadlessCmdAddLogEntry) && + (Command != HeadlessCmdStartBugCheck) && + (Command != HeadlessCmdSendBlueScreenData) && + (Command != HeadlessCmdDoBugCheckProcessing)) + { + if (HeadlessGlobals->ProcessingCmd) return STATUS_UNSUCCESSFUL; + + /* Don't allow these commands next time */ + HeadlessGlobals->ProcessingCmd = TRUE; + } + + /* Handle each command */ + switch (Command) + { + case HeadlessCmdEnableTerminal: + break; + case HeadlessCmdCheckForReboot: + break; + + case HeadlessCmdPutString: + + /* Validate the existence of an input buffer */ + if (!InputBuffer) + { + Status = STATUS_INVALID_PARAMETER; + goto Reset; + } + + /* Terminal should be on */ + if (HeadlessGlobals->TerminalEnabled) + { + /* Print each byte in the string making sure VT100 chars are used */ + PHEADLESS_CMD_PUT_STRING PutString = (PVOID)InputBuffer; + HdlspPutString(PutString->String); + } + + /* Return success either way */ + Status = STATUS_SUCCESS; + break; + case HeadlessCmdClearDisplay: + break; + case HeadlessCmdClearToEndOfDisplay: + break; + case HeadlessCmdClearToEndOfLine: + break; + case HeadlessCmdDisplayAttributesOff: + break; + case HeadlessCmdDisplayInverseVideo: + break; + case HeadlessCmdSetColor: + break; + case HeadlessCmdPositionCursor: + break; + case HeadlessCmdTerminalPoll: + break; + case HeadlessCmdGetByte: + break; + case HeadlessCmdGetLine: + break; + case HeadlessCmdStartBugCheck: + break; + case HeadlessCmdDoBugCheckProcessing: + break; + case HeadlessCmdQueryInformation: + break; + case HeadlessCmdAddLogEntry: + break; + case HeadlessCmdDisplayLog: + break; + case HeadlessCmdSetBlueScreenData: + break; + case HeadlessCmdSendBlueScreenData: + break; + case HeadlessCmdQueryGUID: + break; + case HeadlessCmdPutData: + break; + default: + break; + } + +Reset: + /* Unset prcessing state */ + if ((Command != HeadlessCmdAddLogEntry) && + (Command != HeadlessCmdStartBugCheck) && + (Command != HeadlessCmdSendBlueScreenData) && + (Command != HeadlessCmdDoBugCheckProcessing)) + { + ASSERT(HeadlessGlobals->ProcessingCmd == TRUE); + HeadlessGlobals->ProcessingCmd = FALSE; + } + //UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; + return STATUS_SUCCESS; } /* EOF */ Modified: trunk/reactos/ntoskrnl/include/internal/hdl.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/hdl.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/hdl.h [iso-8859-1] Wed Sep 15 18:30:06 2010 @@ -31,6 +31,33 @@ #else #define HDLTRACE(x, ...) DPRINT(__VA_ARGS__) #endif + +// +// Well-known messages that Io and Pnp post to the kernel log +// +typedef enum _HEADLESS_LOG_MESSAGE +{ + HeadlessLogDriverLoad = 1, + HeadlessLogDriverSuccess, + HeadlessLogDriverFailed, + HeadlessLogEventFailed, + HeadlessLogObjectFailed, + HeadlessLogDirectoryFailed, + HeadlessLogPnpFailed, + HeadlessLogPnpFailed2, + HeadlessLogBootDriversFailed, + HeadlessLogNtdllFailed, + HeadlessLogSystemDriversFailed, + HeadlessLogReassignSystemRootFailed, + HeadlessLogProtectSystemRootFailed, + HeadlessLogConvertSystemRootFailed, + HeadlessLogConvertDeviceNameFailed, + HeadlessLogGroupOrderListFailed, + HeadlessLogGroupTableFailed + // + // There are more, but not applicable to ReactOS, I believe + // +} HEADLESS_LOG_MESSAGE; // // Headless Log Entry @@ -123,6 +150,11 @@ HeadlessCmdPutData } HEADLESS_CMD, *PHEADLESS_CMD; +typedef struct _HEADLESS_CMD_PUT_STRING +{ + UCHAR String[1]; +} HEADLESS_CMD_PUT_STRING, *PHEADLESS_CMD_PUT_STRING; + NTSTATUS NTAPI HeadlessDispatch(
14 years, 3 months
1
0
0
0
[mjmartin] 48777: [usb/usbehci] - Change email address to one that actually works.
by mjmartin@svn.reactos.org
Author: mjmartin Date: Wed Sep 15 13:16:59 2010 New Revision: 48777 URL:
http://svn.reactos.org/svn/reactos?rev=48777&view=rev
Log: [usb/usbehci] - Change email address to one that actually works. Modified: trunk/reactos/drivers/usb/usbehci/common.c trunk/reactos/drivers/usb/usbehci/fdo.c trunk/reactos/drivers/usb/usbehci/irp.c trunk/reactos/drivers/usb/usbehci/misc.c trunk/reactos/drivers/usb/usbehci/pdo.c trunk/reactos/drivers/usb/usbehci/urbreq.c trunk/reactos/drivers/usb/usbehci/usbehci.c trunk/reactos/drivers/usb/usbehci/usbiffn.c Modified: trunk/reactos/drivers/usb/usbehci/common.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbehci/common…
============================================================================== --- trunk/reactos/drivers/usb/usbehci/common.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbehci/common.c [iso-8859-1] Wed Sep 15 13:16:59 2010 @@ -4,7 +4,7 @@ * FILE: drivers/usb/usbehci/common.c * PURPOSE: Common operations in FDO/PDO. * PROGRAMMERS: - * Michael Martin (mjmartin(a)reactos.org) + * Michael Martin (michael.martin(a)reactos.org) */ #define INITGUID Modified: trunk/reactos/drivers/usb/usbehci/fdo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbehci/fdo.c?…
============================================================================== --- trunk/reactos/drivers/usb/usbehci/fdo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbehci/fdo.c [iso-8859-1] Wed Sep 15 13:16:59 2010 @@ -4,7 +4,7 @@ * FILE: drivers/usb/usbehci/fdo.c * PURPOSE: USB EHCI device driver. * PROGRAMMERS: - * Michael Martin (mjmartin(a)reactos.org) + * Michael Martin (michael.martin(a)reactos.org) */ /* INCLUDES *******************************************************************/ Modified: trunk/reactos/drivers/usb/usbehci/irp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbehci/irp.c?…
============================================================================== --- trunk/reactos/drivers/usb/usbehci/irp.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbehci/irp.c [iso-8859-1] Wed Sep 15 13:16:59 2010 @@ -4,7 +4,7 @@ * FILE: drivers/usb/usbehci/irp.c * PURPOSE: IRP Handling. * PROGRAMMERS: - * Michael Martin + * Michael Martin (michael.martin(a)reactos.org) */ #include "usbehci.h" Modified: trunk/reactos/drivers/usb/usbehci/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbehci/misc.c…
============================================================================== --- trunk/reactos/drivers/usb/usbehci/misc.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbehci/misc.c [iso-8859-1] Wed Sep 15 13:16:59 2010 @@ -4,7 +4,7 @@ * FILE: drivers/usb/usbehci/misc.c * PURPOSE: Misceallenous operations. * PROGRAMMERS: - * Michael Martin + * Michael Martin (michael.martin(a)reactos.org) */ #include "usbehci.h" Modified: trunk/reactos/drivers/usb/usbehci/pdo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbehci/pdo.c?…
============================================================================== --- trunk/reactos/drivers/usb/usbehci/pdo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbehci/pdo.c [iso-8859-1] Wed Sep 15 13:16:59 2010 @@ -4,7 +4,7 @@ * FILE: drivers/usb/usbehci/pdo.c * PURPOSE: USB EHCI device driver. * PROGRAMMERS: - * Michael Martin + * Michael Martin (michael.martin(a)reactos.org) */ #define INITGUID Modified: trunk/reactos/drivers/usb/usbehci/urbreq.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbehci/urbreq…
============================================================================== --- trunk/reactos/drivers/usb/usbehci/urbreq.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbehci/urbreq.c [iso-8859-1] Wed Sep 15 13:16:59 2010 @@ -4,7 +4,7 @@ * FILE: drivers/usb/usbehci/urbreq.c * PURPOSE: URB Related Functions. * PROGRAMMERS: - * Michael Martin (mjmartin(a)reactos.org) + * Michael Martin (michael.martin(a)reactos.org) */ #include "usbehci.h" Modified: trunk/reactos/drivers/usb/usbehci/usbehci.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbehci/usbehc…
============================================================================== --- trunk/reactos/drivers/usb/usbehci/usbehci.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbehci/usbehci.c [iso-8859-1] Wed Sep 15 13:16:59 2010 @@ -4,7 +4,7 @@ * FILE: drivers/usb/usbehci/usbehci.c * PURPOSE: USB EHCI device driver. * PROGRAMMERS: - * Michael Martin (mjmartin(a)reactos.com) + * Michael Martin (michael.martin(a)reactos.org) */ /* DEFINES *******************************************************************/ Modified: trunk/reactos/drivers/usb/usbehci/usbiffn.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbehci/usbiff…
============================================================================== --- trunk/reactos/drivers/usb/usbehci/usbiffn.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbehci/usbiffn.c [iso-8859-1] Wed Sep 15 13:16:59 2010 @@ -4,7 +4,7 @@ * FILE: drivers/usb/usbehci/usbiffn.c * PURPOSE: Direct Call Interface Functions. * PROGRAMMERS: - * Michael Martin (mjmartin(a)reactos.org) + * Michael Martin (michael.martin(a)reactos.org) */ #include "usbehci.h"
14 years, 3 months
1
0
0
0
[fireball] 48776: - Take absolute value of ScanLines in GreSetDIBits because it can be negative. Fixes last major issue with arwinss-in-trunk.
by fireball@svn.reactos.org
Author: fireball Date: Wed Sep 15 12:56:35 2010 New Revision: 48776 URL:
http://svn.reactos.org/svn/reactos?rev=48776&view=rev
Log: - Take absolute value of ScanLines in GreSetDIBits because it can be negative. Fixes last major issue with arwinss-in-trunk. Modified: branches/arwinss/reactos/subsystems/win32/win32k/gre/bitblt.c Modified: branches/arwinss/reactos/subsystems/win32/win32k/gre/bitblt.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/gre/bitblt.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/gre/bitblt.c [iso-8859-1] Wed Sep 15 12:56:35 2010 @@ -585,7 +585,7 @@ // Create source surface SourceSize.cx = bmi->bmiHeader.biWidth; - SourceSize.cy = ScanLines; + SourceSize.cy = abs(ScanLines); // Determine width of DIB DIBWidth = DIB_GetDIBWidthBytes(SourceSize.cx, bmi->bmiHeader.biBitCount); @@ -654,10 +654,9 @@ // Determine destination rectangle DestRect.left = 0; - DestRect.top = abs(bmi->bmiHeader.biHeight) - StartScan - ScanLines; + DestRect.top = abs(bmi->bmiHeader.biHeight) - StartScan - SourceSize.cy; DestRect.right = SourceSize.cx; - DestRect.bottom = DestRect.top + ScanLines; - + DestRect.bottom = DestRect.top + SourceSize.cy; copyBitsResult = GreCopyBits(DestSurf, SourceSurf, NULL, &exlo.xlo, &DestRect, &ZeroPoint); // If it succeeded, return number of scanlines copies
14 years, 3 months
1
0
0
0
[fireball] 48775: - Improve parameters check in usermode part of SetDIBits too. - Fix signedness of scanlines passed to SetDIBitsToDevice.
by fireball@svn.reactos.org
Author: fireball Date: Wed Sep 15 12:54:45 2010 New Revision: 48775 URL:
http://svn.reactos.org/svn/reactos?rev=48775&view=rev
Log: - Improve parameters check in usermode part of SetDIBits too. - Fix signedness of scanlines passed to SetDIBitsToDevice. Modified: branches/arwinss/reactos/dll/win32/winent.drv/gdidrv.c Modified: branches/arwinss/reactos/dll/win32/winent.drv/gdidrv.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winen…
============================================================================== --- branches/arwinss/reactos/dll/win32/winent.drv/gdidrv.c [iso-8859-1] (original) +++ branches/arwinss/reactos/dll/win32/winent.drv/gdidrv.c [iso-8859-1] Wed Sep 15 12:54:45 2010 @@ -730,7 +730,23 @@ INT CDECL RosDrv_SetDIBits( NTDRV_PDEVICE *physDev, HBITMAP hbitmap, UINT startscan, UINT lines, LPCVOID bits, const BITMAPINFO *info, UINT coloruse ) { - return RosGdiSetDIBits(physDev->hKernelDC, hbitmap, startscan, lines, bits, info, coloruse); + LONG height, width, tmpheight; + WORD infoBpp, compression; + + /* Perform extensive parameter checking */ + if (DIB_GetBitmapInfo( &info->bmiHeader, &width, &height, + &infoBpp, &compression ) == -1) + return 0; + + tmpheight = height; + if (height < 0) height = -height; + if (!lines || (startscan >= height)) + return 0; + + if (startscan + lines > height) lines = height - startscan; + + return RosGdiSetDIBits(physDev->hKernelDC, hbitmap, startscan, + tmpheight >= 0 ? lines : -lines, bits, info, coloruse); } INT CDECL RosDrv_SetDIBitsToDevice( NTDRV_PDEVICE *physDev, INT xDest, INT yDest, DWORD cx, @@ -790,7 +806,7 @@ if (!cx || !cy) return lines; return RosGdiSetDIBitsToDevice(physDev->hKernelDC, pt.x, pt.y, cx, cy, - xSrc, ySrc, startscan, lines, bits, info, coloruse); + xSrc, ySrc, startscan, top_down ? -lines : lines, bits, info, coloruse); } void CDECL RosDrv_SetDeviceClipping( NTDRV_PDEVICE *physDev, HRGN vis_rgn, HRGN clip_rgn )
14 years, 3 months
1
0
0
0
[akhaldi] 48774: [DDK] - Define DECLSPEC_EXPORT when it's not already defined.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Sep 15 09:03:57 2010 New Revision: 48774 URL:
http://svn.reactos.org/svn/reactos?rev=48774&view=rev
Log: [DDK] - Define DECLSPEC_EXPORT when it's not already defined. Modified: trunk/reactos/include/ddk/usbdlib.h Modified: trunk/reactos/include/ddk/usbdlib.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/usbdlib.h?rev=…
============================================================================== --- trunk/reactos/include/ddk/usbdlib.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/usbdlib.h [iso-8859-1] Wed Sep 15 09:03:57 2010 @@ -1,4 +1,8 @@ #pragma once + +#ifndef DECLSPEC_EXPORT +#define DECLSPEC_EXPORT __declspec(dllexport) +#endif typedef struct _USBD_INTERFACE_LIST_ENTRY { PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor;
14 years, 3 months
1
0
0
0
[sir_richard] 48773: Patch by Anton Yarotsky: [NTOSKRNL]: Implement basic Headless support in the kernel. Implement missing InbvPort routines based on WinLdrPort (using cportlib). Add header for Hd...
by sir_richard@svn.reactos.org
Author: sir_richard Date: Wed Sep 15 07:46:28 2010 New Revision: 48773 URL:
http://svn.reactos.org/svn/reactos?rev=48773&view=rev
Log: Patch by Anton Yarotsky: [NTOSKRNL]: Implement basic Headless support in the kernel. Implement missing InbvPort routines based on WinLdrPort (using cportlib). Add header for Hdl. Terminal initializes now on COM2. Added misisng code to InbvDisplayString to also display on Headless Terminal (requires unimplemented HeadlessDispatch). Next steps are to implement the kernel log buffer, and HeadlessCmdPutString to see boot strings. Added: trunk/reactos/ntoskrnl/inbv/inbvport.c (with props) trunk/reactos/ntoskrnl/include/internal/hdl.h (with props) Modified: trunk/reactos/ntoskrnl/ex/hdlsterm.c trunk/reactos/ntoskrnl/inbv/inbv.c trunk/reactos/ntoskrnl/include/internal/inbv.h trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild Modified: trunk/reactos/ntoskrnl/ex/hdlsterm.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/hdlsterm.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/ex/hdlsterm.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ex/hdlsterm.c [iso-8859-1] Wed Sep 15 07:46:28 2010 @@ -1,9 +1,9 @@ /* * PROJECT: ReactOS Kernel - * LICENSE: GPL - See COPYING in the top level directory + * LICENSE: BSD - See COPYING.ARM in the top level directory * FILE: ntoskrnl/ex/hdlsterm.c * PURPOSE: Headless Terminal Support - * PROGRAMMERS: Alex Ionescu (alex.ionescu(a)reactos.org) + * PROGRAMMERS: ReactOS Portable Systems Group */ /* INCLUDES ******************************************************************/ @@ -13,20 +13,127 @@ /* GLOBALS *******************************************************************/ +PHEADLESS_GLOBALS HeadlessGlobals; + /* FUNCTIONS *****************************************************************/ VOID NTAPI -HeadlessInit(IN PLOADER_PARAMETER_BLOCK LoaderBlock) +HdlspSendStringAtBaud( + IN PCHAR String + ) { - PHEADLESS_LOADER_BLOCK HeadlessBlock; + /* Send every byte */ + while (*String++ != ANSI_NULL) + { + InbvPortPutByte(HeadlessGlobals->TerminalPort, *String); + } +} - /* Get the headless loader block */ - HeadlessBlock = LoaderBlock->Extension->HeadlessLoaderBlock; - if (HeadlessBlock) - { - DPRINT1("ReactOS does not currently have Headless Terminal support!\n"); - } +NTSTATUS +NTAPI +HdlspEnableTerminal( + IN BOOLEAN Enable + ) +{ + /* Enable if requested, as long as this isn't a PCI serial port crashing */ + if ((Enable) && + !(HeadlessGlobals->TerminalEnabled) && + !((HeadlessGlobals->IsMMIODevice) && (HeadlessGlobals->InBugCheck))) + { + /* Initialize the COM port with cportlib */ + HeadlessGlobals->TerminalEnabled = InbvPortInitialize( + HeadlessGlobals->TerminalBaudRate, + HeadlessGlobals->TerminalPortNumber, + HeadlessGlobals->TerminalPortAddress, + &HeadlessGlobals->TerminalPort, + HeadlessGlobals->IsMMIODevice); + if (!HeadlessGlobals->TerminalEnabled) return STATUS_UNSUCCESSFUL; + + /* Cleanup the screen and reset the cursor */ + HdlspSendStringAtBaud("\x1B[2J"); + HdlspSendStringAtBaud("\x1B[H"); + + /* Enable FIFO */ + InbvPortEnableFifo(HeadlessGlobals->TerminalPort, TRUE); + } + else if (!Enable) + { + /* Specific case when headless is being disabled */ + InbvPortTerminate(HeadlessGlobals->TerminalPort); + HeadlessGlobals->TerminalPort = 0; + HeadlessGlobals->TerminalEnabled = FALSE; + } + return STATUS_SUCCESS; +} + +VOID +NTAPI +HeadlessInit( + IN PLOADER_PARAMETER_BLOCK LoaderBlock + ) +{ + PHEADLESS_LOADER_BLOCK HeadlessBlock; + + HeadlessBlock = LoaderBlock->Extension->HeadlessLoaderBlock; + if (!HeadlessBlock) return; + if ((HeadlessBlock->PortNumber > 4) && (HeadlessBlock->UsedBiosSettings)) return; + + HeadlessGlobals = ExAllocatePoolWithTag( + NonPagedPool, + sizeof(HEADLESS_GLOBALS), + 'sldH'); + if (!HeadlessGlobals) return; + + /* Zero and copy loader data */ + RtlZeroMemory(HeadlessGlobals, sizeof(HEADLESS_GLOBALS)); + HeadlessGlobals->TerminalPortNumber = HeadlessBlock->PortNumber; + HeadlessGlobals->TerminalPortAddress = HeadlessBlock->PortAddress; + HeadlessGlobals->TerminalBaudRate = HeadlessBlock->BaudRate; + HeadlessGlobals->TerminalParity = HeadlessBlock->Parity; + HeadlessGlobals->TerminalStopBits = HeadlessBlock->StopBits; + HeadlessGlobals->UsedBiosSettings = HeadlessBlock->UsedBiosSettings; + HeadlessGlobals->IsMMIODevice = HeadlessBlock->IsMMIODevice; + HeadlessGlobals->TerminalType = HeadlessBlock->TerminalType; + HeadlessGlobals->SystemGUID = HeadlessBlock->SystemGUID; + + /* These two are opposites of each other */ + if (HeadlessGlobals->IsMMIODevice) HeadlessGlobals->IsNonLegacyDevice = TRUE; + + /* Check for a PCI device, warn that this isn't supported */ + if (HeadlessBlock->PciDeviceId != PCI_INVALID_VENDORID) + { + DPRINT1("PCI Serial Ports not supported\n"); + } + + /* Log entries are not yet supported */ + DPRINT1("FIXME: No Headless logging support\n"); + + /* Windows seems to apply some special hacks for 9600 bps */ + if (HeadlessGlobals->TerminalBaudRate == 9600) + { + DPRINT1("Please use other baud rate than 9600bps for now\n"); + } + + /* Enable the terminal */ + HdlspEnableTerminal(TRUE); +} + +/* + * @unimplemented + */ +NTSTATUS +NTAPI +HeadlessDispatch( + IN HEADLESS_CMD Command, + IN PVOID InputBuffer, + IN SIZE_T InputBufferSize, + OUT PVOID OutputBuffer, + OUT PSIZE_T OutputBufferSize + ) +{ + //UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; } /* EOF */ Modified: trunk/reactos/ntoskrnl/inbv/inbv.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/inbv/inbv.c?rev=4…
============================================================================== --- trunk/reactos/ntoskrnl/inbv/inbv.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/inbv/inbv.c [iso-8859-1] Wed Sep 15 07:46:28 2010 @@ -259,8 +259,13 @@ /* Make sure we're installed and display the string */ if (InbvBootDriverInstalled) VidDisplayString((PUCHAR) String); - /* Call Headless (We don't support headless for now) - HeadlessDispatch(DISPLAY_STRING); */ + /* Print the string on the EMS port */ + HeadlessDispatch( + HeadlessCmdPutString, + String, + strlen(String) + sizeof(ANSI_NULL), + NULL, + NULL); /* Release the lock */ InbvReleaseLock(); Added: trunk/reactos/ntoskrnl/inbv/inbvport.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/inbv/inbvport.c?r…
============================================================================== --- trunk/reactos/ntoskrnl/inbv/inbvport.c (added) +++ trunk/reactos/ntoskrnl/inbv/inbvport.c [iso-8859-1] Wed Sep 15 07:46:28 2010 @@ -1,0 +1,121 @@ +/* + * PROJECT: ReactOS Kernel + * LICENSE: BSD - See COPYING.ARM in the top level directory + * FILE: ntoskrnl/inbv/inbvport.c + * PURPOSE: Serial Port Boot Driver for Headless Terminal Support + * PROGRAMMERS: ReactOS Portable Systems Group + */ + +/* INCLUDES ******************************************************************/ + +#include <ntoskrnl.h> +#include <debug.h> + +/* GLOBALS *******************************************************************/ + +CPPORT Port[4] = +{ + {NULL, 0, TRUE}, + {NULL, 0, TRUE}, + {NULL, 0, TRUE}, + {NULL, 0, TRUE} +}; + +/* FUNCTIONS *****************************************************************/ + +VOID +NTAPI +InbvPortEnableFifo( + IN ULONG PortId, + IN BOOLEAN Enable + ) +{ + /* Set FIFO as requested */ + CpEnableFifo(Port[PortId].Address, Enable); +} + +VOID +NTAPI +InbvPortPutByte( + IN ULONG PortId, + IN BOOLEAN Output + ) +{ + /* Send the byte */ + CpPutByte(&Port[PortId], Output); +} + +VOID +NTAPI +InbvPortTerminate( + IN ULONG PortId + ) +{ + /* The port is now available */ + Port[PortId].Address = NULL; +} + +BOOLEAN +NTAPI +InbvPortInitialize( + IN ULONG BaudRate, + IN ULONG PortNumber, + IN PUCHAR PortAddress, + OUT PULONG PortId, + IN BOOLEAN IsMMIODevice + ) +{ + /* Not yet supported */ + ASSERT(IsMMIODevice == FALSE); + + /* Set default baud rate */ + if (BaudRate == 0) BaudRate = 19200; + + /* Check if port or address given */ + if (PortNumber) + { + /* Pick correct address for port */ + if (!PortAddress) + { + switch (PortNumber) + { + case 1: + PortAddress = (PUCHAR)0x3F8; + break; + + case 2: + PortAddress = (PUCHAR)0x2F8; + break; + + case 3: + PortAddress = (PUCHAR)0x3E8; + break; + + default: + PortNumber = 4; + PortAddress = (PUCHAR)0x2E8; + } + } + } + else + { + /* Pick correct port for address */ + PortAddress = (PUCHAR)0x2F8; + if (CpDoesPortExist(PortAddress)) + { + PortNumber = 2; + } + else + { + PortAddress = (PUCHAR)0x3F8; + if (!CpDoesPortExist(PortAddress)) return FALSE; + PortNumber = 1; + } + } + + /* Initialize the port unless it's already up, and then return it */ + if (Port[PortNumber - 1].Address) return FALSE; + CpInitialize(&Port[PortNumber - 1], PortAddress, BaudRate); + *PortId = PortNumber - 1; + return TRUE; +} Propchange: trunk/reactos/ntoskrnl/inbv/inbvport.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/ntoskrnl/include/internal/hdl.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/hdl.h (added) +++ trunk/reactos/ntoskrnl/include/internal/hdl.h [iso-8859-1] Wed Sep 15 07:46:28 2010 @@ -1,0 +1,144 @@ +/* + * PROJECT: ReactOS Kernel + * LICENSE: BSD - See COPYING.ARM in the top level directory + * FILE: ntoskrnl/include/internal/hdl.h + * PURPOSE: Internal header for the Configuration Manager + * PROGRAMMERS: ReactOS Portable Systems Group + */ +#define _HDL_ +#include <cportlib/cportlib.h> + +// +// Define this if you want debugging support +// +#define _HDL_DEBUG_ 0x00 + +// +// These define the Debug Masks Supported +// +#define HDL_XXX_DEBUG 0x01 + +// +// Debug/Tracing support +// +#if _HDL_DEBUG_ +#ifdef NEW_DEBUG_SYSTEM_IMPLEMENTED // enable when Debug Filters are implemented +#define HDLTRACE DbgPrintEx +#else +#define HDLTRACE(x, ...) \ + if (x & HdlpTraceLevel) DbgPrint(__VA_ARGS__) +#endif +#else +#define HDLTRACE(x, ...) DPRINT(__VA_ARGS__) +#endif + +// +// Headless Log Entry +// +typedef struct _HEADLESS_LOG_ENTRY +{ + SYSTEM_TIMEOFDAY_INFORMATION TimeOfEntry; + PWCHAR String; +} HEADLESS_LOG_ENTRY, *PHEADLESS_LOG_ENTRY; + +// +// Headless Bugcheck Information +// +typedef struct _HEADLESS_BLUE_SCREEN_DATA +{ + PUCHAR Property; + PUCHAR XMLData; + struct _HEADLESS_BLUE_SCREEN_DATA *Next; +} HEADLESS_BLUE_SCREEN_DATA, * PHEADLESS_BLUE_SCREEN_DATA; + +// +// Headless Control Structure, mostly for !SAC +// +typedef struct _HEADLESS_GLOBALS +{ + KSPIN_LOCK SpinLock; + HANDLE PageLockHandle; + PHEADLESS_LOG_ENTRY LogEntries; + PUCHAR TmpBuffer; + PUCHAR InputBuffer; + PHEADLESS_BLUE_SCREEN_DATA BlueScreenData; + union + { + struct + { + ULONG TerminalEnabled:1; + ULONG InBugCheck:1; + ULONG NewLogEntryAdded:1; + ULONG UsedBiosSettings:1; + ULONG InputProcessing:1; + ULONG InputLineDone:1; + ULONG ProcessingCmd:1; + ULONG TerminalParity:1; + ULONG TerminalStopBits:1; + ULONG TerminalPortNumber:3; + ULONG IsNonLegacyDevice:1; + }; + ULONG AllFlags; + }; + ULONG TerminalBaudRate; + ULONG TerminalPort; + PUCHAR TerminalPortAddress; + LARGE_INTEGER DelayTime; + ULONG MicroSecondsDelayTime; + UCHAR TerminalType; + SIZE_T InputBufferIndex; + USHORT LogEntryLast; + USHORT LogEntryStart; + GUID SystemGUID; + BOOLEAN IsMMIODevice; + BOOLEAN IsLastCharCR; +} HEADLESS_GLOBALS, *PHEADLESS_GLOBALS; + +// +// FIXME: A public header in the NDK? Ask Alex +// +typedef enum _HEADLESS_CMD +{ + HeadlessCmdEnableTerminal = 1, + HeadlessCmdCheckForReboot, + HeadlessCmdPutString, + HeadlessCmdClearDisplay, + HeadlessCmdClearToEndOfDisplay, + HeadlessCmdClearToEndOfLine, + HeadlessCmdDisplayAttributesOff, + HeadlessCmdDisplayInverseVideo, + HeadlessCmdSetColor, + HeadlessCmdPositionCursor, + HeadlessCmdTerminalPoll, + HeadlessCmdGetByte, + HeadlessCmdGetLine, + HeadlessCmdStartBugCheck, + HeadlessCmdDoBugCheckProcessing, + HeadlessCmdQueryInformation, + HeadlessCmdAddLogEntry, + HeadlessCmdDisplayLog, + HeadlessCmdSetBlueScreenData, + HeadlessCmdSendBlueScreenData, + HeadlessCmdQueryGUID, + HeadlessCmdPutData +} HEADLESS_CMD, *PHEADLESS_CMD; + +NTSTATUS +NTAPI +HeadlessDispatch( + IN HEADLESS_CMD Command, + IN PVOID InputBuffer, + IN SIZE_T InputBufferSize, + OUT PVOID OutputBuffer, + OUT PSIZE_T OutputBufferSize +); + +// +// Global variables accessible from all of Hdl +// +extern PHEADLESS_GLOBALS HeadlessGlobals; + +// +// Inlined functions +// +//#include "hdl_x.h" Propchange: trunk/reactos/ntoskrnl/include/internal/hdl.h ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/ntoskrnl/include/internal/inbv.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/inbv.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/inbv.h [iso-8859-1] Wed Sep 15 07:46:28 2010 @@ -71,4 +71,34 @@ VOID ); +VOID +NTAPI +InbvPortEnableFifo( + IN ULONG PortId, + IN BOOLEAN Enable +); + +VOID +NTAPI +InbvPortPutByte( + IN ULONG PortId, + IN BOOLEAN Output +); + +VOID +NTAPI +InbvPortTerminate( + IN ULONG PortId +); + +BOOLEAN +NTAPI +InbvPortInitialize( + IN ULONG BaudRate, + IN ULONG PortNumber, + IN PUCHAR PortAddress, + OUT PULONG PortId, + IN BOOLEAN IsMMIODevice +); + extern BOOLEAN InbvBootDriverInstalled; Modified: trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h [iso-8859-1] Wed Sep 15 07:46:28 2010 @@ -88,6 +88,7 @@ #include "inbv.h" #include "vdm.h" #include "hal.h" +#include "hdl.h" #include "arch/intrin_i.h" /* Modified: trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ntoskrnl-generic.…
============================================================================== --- trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild [iso-8859-1] Wed Sep 15 07:46:28 2010 @@ -31,6 +31,7 @@ <library>bootvid</library> <library>wdmguid</library> <library>ioevent</library> + <library>cportlib</library> <dependency>bugcodes</dependency> <directory name="include"> <pch>ntoskrnl.h</pch> @@ -263,6 +264,7 @@ </directory> <directory name="inbv"> <file>inbv.c</file> + <file>inbvport.c</file> </directory> <directory name="io"> <directory name="iomgr">
14 years, 3 months
1
0
0
0
[sir_richard] 48772: Patch by Anton Yarotsky: [FREELDR]: Fix Headless support.
by sir_richard@svn.reactos.org
Author: sir_richard Date: Wed Sep 15 07:40:50 2010 New Revision: 48772 URL:
http://svn.reactos.org/svn/reactos?rev=48772&view=rev
Log: Patch by Anton Yarotsky: [FREELDR]: Fix Headless support. Modified: trunk/reactos/boot/freeldr/freeldr/windows/headless.c trunk/reactos/boot/freeldr/freeldr/windows/winldr.c Modified: trunk/reactos/boot/freeldr/freeldr/windows/headless.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/windo…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/windows/headless.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/windows/headless.c [iso-8859-1] Wed Sep 15 07:40:50 2010 @@ -237,11 +237,6 @@ StallExecutionProcessor(WinLdrTerminalDelay); } } - else - { - /* The port was bogus, so don't give any information to the kernel */ - RtlZeroMemory(&LoaderRedirectionInformation, sizeof(HEADLESS_LOADER_BLOCK)); - } } VOID @@ -249,6 +244,9 @@ { PCHAR RedirectPort; + /* Start fresh */ + RtlZeroMemory(&LoaderRedirectionInformation, sizeof(HEADLESS_LOADER_BLOCK)); + /* Use a direction port if one was given, or use ACPI to detect one instead */ RedirectPort = strstr(BootOptions, "/redirect="); Modified: trunk/reactos/boot/freeldr/freeldr/windows/winldr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/windo…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/windows/winldr.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/windows/winldr.c [iso-8859-1] Wed Sep 15 07:40:50 2010 @@ -203,6 +203,25 @@ /* See KiRosFrldrLpbToNtLpb for details */ Extension->AcpiTable = (PVOID)1; } + + /* Set headless block pointer */ + extern HEADLESS_LOADER_BLOCK LoaderRedirectionInformation; + extern BOOLEAN WinLdrTerminalConnected; + if (WinLdrTerminalConnected) + { + Extension->HeadlessLoaderBlock = MmHeapAlloc(sizeof(HEADLESS_LOADER_BLOCK)); + if (Extension->HeadlessLoaderBlock == NULL) + { + UiMessageBox("Failed to allocate HLB Extension!"); + while (TRUE); + return; + } + RtlCopyMemory( + Extension->HeadlessLoaderBlock, + &LoaderRedirectionInformation, + sizeof(HEADLESS_LOADER_BLOCK)); + Extension->HeadlessLoaderBlock = PaToVa(Extension->HeadlessLoaderBlock); + } /* Load drivers database */ strcpy(MiscFiles, BootPath); @@ -215,6 +234,7 @@ if (LoaderBlock->SetupLdrBlock) LoaderBlock->SetupLdrBlock = PaToVa(LoaderBlock->SetupLdrBlock); + } BOOLEAN @@ -601,10 +621,6 @@ /* Save final value of LoaderPagesSpanned */ LoaderBlockVA->Extension->LoaderPagesSpanned = LoaderPagesSpanned; - - /* Set headless block pointer */ - extern HEADLESS_LOADER_BLOCK LoaderRedirectionInformation; - LoaderBlockVA->Extension->HeadlessLoaderBlock = PaToVa(&LoaderRedirectionInformation); DPRINTM(DPRINT_WINDOWS, "Hello from paged mode, KiSystemStartup %p, LoaderBlockVA %p!\n", KiSystemStartup, LoaderBlockVA);
14 years, 3 months
1
0
0
0
[mjmartin] 48771: [usb/usbhub] - On completion of SCE request, create and queue a workitem to handle: Clearing the connection flag and reset the port. Create and initialize the USB device by callin...
by mjmartin@svn.reactos.org
Author: mjmartin Date: Tue Sep 14 12:04:15 2010 New Revision: 48771 URL:
http://svn.reactos.org/svn/reactos?rev=48771&view=rev
Log: [usb/usbhub] - On completion of SCE request, create and queue a workitem to handle: Clearing the connection flag and reset the port. Create and initialize the USB device by calling the appropriate roothubs Direct Call Interface. Create the device object, get the device descriptors and the serial and product strings of the USB device to be used for creating the deviceid and instanceid. - Format code and misc changes. - Together with the usbehci driver, ReactOS at least runs the device installation wizard with the correct device description. Modified: trunk/reactos/drivers/usb/usbhub/fdo.c trunk/reactos/drivers/usb/usbhub/pdo.c trunk/reactos/drivers/usb/usbhub/usbhub.c trunk/reactos/drivers/usb/usbhub/usbhub.h Modified: trunk/reactos/drivers/usb/usbhub/fdo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbhub/fdo.c?r…
============================================================================== --- trunk/reactos/drivers/usb/usbhub/fdo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbhub/fdo.c [iso-8859-1] Tue Sep 14 12:04:15 2010 @@ -15,6 +15,24 @@ #include "usbdlib.h" #define IO_METHOD_FROM_CTL_CODE(ctlCode) (ctlCode&0x00000003) + + +typedef struct _USB_LANGUAGEID_DESCRIPTOR { + UCHAR bLength; + UCHAR bDescriptorType; + WCHAR wLANGIDs[1]; +} USB_LANGUAGEID_DESCRIPTOR, *PUSB_LANGUAGEID_DESCRIPTOR; + +typedef struct _PORTSTATUSANDCHANGE +{ + USHORT Status; + USHORT Change; +} PORTSTATUSANDCHANGE, *PPORTSTATUSANDCHANGE; + +NTSTATUS +QueryRootHub(IN PDEVICE_OBJECT Pdo, IN ULONG IoControlCode, OUT PVOID OutParameter1, OUT PVOID OutParameter2); +NTSTATUS +WaitForUsbDeviceArrivalNotification(PDEVICE_OBJECT DeviceObject); VOID DumpDeviceDescriptor(PUSB_DEVICE_DESCRIPTOR DeviceDescriptor) { @@ -81,19 +99,309 @@ } } + +VOID +WorkerThread(IN PVOID Context) +{ + PHUB_DEVICE_EXTENSION DeviceExtension; + PDEVICE_OBJECT DeviceObject = (PDEVICE_OBJECT)Context, Pdo; + PHUB_CHILDDEVICE_EXTENSION PdoExtension; + PURB Urb; + PORTSTATUSANDCHANGE PortStatusAndChange; + int PortLoop, DeviceCount; + NTSTATUS Status; + USB_DEVICE_DESCRIPTOR DevDesc; + USB_CONFIGURATION_DESCRIPTOR ConfigDesc; + ULONG DevDescSize, ConfigDescSize; + PUSB_STRING_DESCRIPTOR StringDesc; + USB_LANGUAGEID_DESCRIPTOR LanguageIdDescriptor; + + DeviceExtension = (PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + + /* Determine where in the children array to store this device info */ + for (DeviceCount = 0; DeviceCount < USB_MAXCHILDREN; DeviceCount++) + { + if (DeviceExtension->UsbChildren[DeviceCount] == NULL) + { + break; + } + } + + DPRINT("Storing Device Info at %x\n", DeviceCount); + Urb = ExAllocatePoolWithTag(NonPagedPool, sizeof(URB), USB_HUB_TAG); + if (!Urb) + { + DPRINT1("Failed to allocate memory for URB!\n"); + ASSERT(FALSE); + } + + RtlZeroMemory(Urb, sizeof(URB)); + + for (PortLoop = 0; PortLoop < DeviceExtension->UsbExtHubInfo.NumberOfPorts; PortLoop++) + { + /* Get the port status */ + UsbBuildVendorRequest(Urb, + URB_FUNCTION_CLASS_OTHER, + sizeof(Urb->UrbControlVendorClassRequest), + USBD_TRANSFER_DIRECTION_OUT, + 0, + USB_REQUEST_GET_STATUS, + 0, + PortLoop + 1, + &PortStatusAndChange, + 0, + sizeof(PORTSTATUSANDCHANGE), + 0); + Status = QueryRootHub(DeviceObject, IOCTL_INTERNAL_USB_SUBMIT_URB, Urb, NULL); + + if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to get PortStatus!\n"); + return; + } + + DPRINT("Notification Port %x:\n", PortLoop + 1); + DPRINT("Status %x\n", PortStatusAndChange.Status); + DPRINT("Change %x\n", PortStatusAndChange.Change); + + if (PortStatusAndChange.Change == USB_PORT_STATUS_RESET) + { + /* Clear the Reset */ + UsbBuildVendorRequest(Urb, + URB_FUNCTION_CLASS_OTHER, + sizeof(Urb->UrbControlVendorClassRequest), + USBD_TRANSFER_DIRECTION_IN, + 0, + USB_REQUEST_CLEAR_FEATURE, + C_PORT_RESET, + PortLoop + 1, + &PortStatusAndChange, + 0, + sizeof(PORTSTATUSANDCHANGE), + 0); + + Status = QueryRootHub(DeviceObject, IOCTL_INTERNAL_USB_SUBMIT_URB, Urb, NULL); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to Clear the Port Reset with Status %x!\n", Status); + return; + } + UsbBuildVendorRequest(Urb, URB_FUNCTION_CLASS_OTHER, + sizeof(Urb->UrbControlVendorClassRequest), + USBD_TRANSFER_DIRECTION_OUT, + 0, + USB_REQUEST_GET_STATUS, + 0, + PortLoop + 1, + &PortStatusAndChange, + 0, + sizeof(PORTSTATUSANDCHANGE), + 0); + + Status = QueryRootHub(DeviceObject, IOCTL_INTERNAL_USB_SUBMIT_URB, Urb, NULL); + + DPRINT("Status %x\n", PortStatusAndChange.Status); + DPRINT("Change %x\n", PortStatusAndChange.Change); + + /* Create the UsbDevice */ + Status = DeviceExtension->HubInterface.CreateUsbDevice(DeviceExtension->RootHubPdo, + (PVOID)&DeviceExtension->UsbChildren[DeviceCount], + DeviceExtension->RootHubUsbDevice, + PortStatusAndChange.Status, + PortLoop + 1); + DPRINT1("CreateUsbDevice Status %x\n", Status); + + Status = DeviceExtension->HubInterface.InitializeUsbDevice(DeviceExtension->RootHubPdo, DeviceExtension->UsbChildren[DeviceCount]); + DPRINT1("InitializeUsbDevice Status %x\n", Status); + + DevDescSize = sizeof(USB_DEVICE_DESCRIPTOR); + ConfigDescSize = sizeof(USB_CONFIGURATION_DESCRIPTOR); + Status = DeviceExtension->HubInterface.GetUsbDescriptors(DeviceExtension->RootHubPdo, + DeviceExtension->UsbChildren[DeviceCount], + (PUCHAR)&DevDesc, + &DevDescSize, + (PUCHAR)&ConfigDesc, + &ConfigDescSize); + + if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to Get Usb Deccriptors %x!\n", Status); + } + + DumpDeviceDescriptor(&DevDesc); + + Status = IoCreateDevice(DeviceObject->DriverObject, + sizeof(HUB_CHILDDEVICE_EXTENSION), + NULL, + FILE_DEVICE_CONTROLLER, + FILE_AUTOGENERATED_DEVICE_NAME, + FALSE, + &DeviceExtension->Children[DeviceCount]); + + if (!NT_SUCCESS(Status)) + { + DPRINT1("UsbHub; IoCreateDevice failed with status %x\n",Status); + return; + } + + Pdo = DeviceExtension->Children[DeviceCount]; + DPRINT1("Created New Device with %x\n", Pdo); + Pdo->Flags |= DO_BUS_ENUMERATED_DEVICE; + + PdoExtension = Pdo->DeviceExtension; + + RtlZeroMemory(PdoExtension, sizeof(HUB_CHILDDEVICE_EXTENSION)); + + PdoExtension->DeviceId = ExAllocatePoolWithTag(NonPagedPool, 32 * sizeof(WCHAR), USB_HUB_TAG); + RtlZeroMemory(PdoExtension->DeviceId, 32 * sizeof(WCHAR)); + swprintf(PdoExtension->DeviceId, L"USB\\Vid_%04x&Pid_%04x", DevDesc.idVendor, DevDesc.idProduct); + + + /* Get the LANGids */ + RtlZeroMemory(&LanguageIdDescriptor, sizeof(USB_LANGUAGEID_DESCRIPTOR)); + UsbBuildGetDescriptorRequest(Urb, + sizeof(Urb->UrbControlDescriptorRequest), + USB_STRING_DESCRIPTOR_TYPE, + 0, + 0, + &LanguageIdDescriptor, + NULL, + sizeof(USB_LANGUAGEID_DESCRIPTOR), + NULL); + + Urb->UrbHeader.UsbdDeviceHandle = DeviceExtension->UsbChildren[DeviceCount]; + + Status = QueryRootHub(DeviceExtension->RootHubPdo, IOCTL_INTERNAL_USB_SUBMIT_URB, Urb, NULL); + + /* Get the length of the SerialNumber */ + StringDesc = ExAllocatePoolWithTag(PagedPool, 64, USB_HUB_TAG); + RtlZeroMemory(StringDesc, 64); + StringDesc->bLength = 0; + StringDesc->bDescriptorType = 0; + + UsbBuildGetDescriptorRequest(Urb, + sizeof(Urb->UrbControlDescriptorRequest), + USB_STRING_DESCRIPTOR_TYPE, + DevDesc.iSerialNumber, + LanguageIdDescriptor.wLANGIDs[0], + StringDesc, + NULL, + 64, + NULL); + + Urb->UrbHeader.UsbdDeviceHandle = DeviceExtension->UsbChildren[DeviceCount]; + + Status = QueryRootHub(DeviceExtension->RootHubPdo, IOCTL_INTERNAL_USB_SUBMIT_URB, Urb, NULL); + + PdoExtension->InstanceId = ExAllocatePoolWithTag(NonPagedPool, (StringDesc->bLength + 1) * sizeof(WCHAR), USB_HUB_TAG); + DPRINT1("PdoExtension->InstanceId %x\n",PdoExtension->InstanceId); + + RtlZeroMemory(PdoExtension->InstanceId, (StringDesc->bLength + 1) * sizeof(WCHAR)); + RtlCopyMemory(PdoExtension->InstanceId, &StringDesc->bString[0], StringDesc->bLength); + DPRINT1("------>SerialNumber %S\n", PdoExtension->InstanceId); + + + + RtlZeroMemory(StringDesc, 64); + StringDesc->bLength = 0; + StringDesc->bDescriptorType = 0; + + UsbBuildGetDescriptorRequest(Urb, + sizeof(Urb->UrbControlDescriptorRequest), + USB_STRING_DESCRIPTOR_TYPE, + DevDesc.iProduct, + LanguageIdDescriptor.wLANGIDs[0], + StringDesc, + NULL, + 64, + NULL); + + Urb->UrbHeader.UsbdDeviceHandle = DeviceExtension->UsbChildren[DeviceCount]; + + Status = QueryRootHub(DeviceExtension->RootHubPdo, IOCTL_INTERNAL_USB_SUBMIT_URB, Urb, NULL); + + PdoExtension->TextDescription = ExAllocatePoolWithTag(NonPagedPool, (StringDesc->bLength + 1) * sizeof(WCHAR), USB_HUB_TAG); + + RtlZeroMemory(PdoExtension->TextDescription, (StringDesc->bLength + 1) * sizeof(WCHAR)); + RtlCopyMemory(PdoExtension->TextDescription, &StringDesc->bString[0], StringDesc->bLength); + ExFreePool(StringDesc); + DPRINT1("------>TextDescription %S\n", PdoExtension->TextDescription); + + PdoExtension->IsFDO = FALSE; + PdoExtension->Parent = DeviceObject; + Pdo->Flags &= ~DO_DEVICE_INITIALIZING; + + IoInvalidateDeviceRelations(DeviceExtension->RootHubPdo, BusRelations); + return; + } + + /* Is a device connected to this port */ + if (PortStatusAndChange.Change == USB_PORT_STATUS_CONNECT) + { + /* Clear the Connect from ProtChange */ + UsbBuildVendorRequest(Urb, + URB_FUNCTION_CLASS_OTHER, + sizeof(Urb->UrbControlVendorClassRequest), + USBD_TRANSFER_DIRECTION_IN, + 0, + USB_REQUEST_CLEAR_FEATURE, + C_PORT_CONNECTION, + PortLoop + 1, + &PortStatusAndChange, + 0, + sizeof(PORTSTATUSANDCHANGE), + 0); + + Status = QueryRootHub(DeviceObject, IOCTL_INTERNAL_USB_SUBMIT_URB, Urb, NULL); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to Clear the Port Connect!\n"); + return; + } + + /* Send the miniport controller a SCE request so when the port resets we can be informed */ + WaitForUsbDeviceArrivalNotification(DeviceObject); + + UsbBuildVendorRequest(Urb, + URB_FUNCTION_CLASS_OTHER, + sizeof(Urb->UrbControlVendorClassRequest), + USBD_TRANSFER_DIRECTION_IN, + 0, + USB_REQUEST_SET_FEATURE, + PORT_RESET, + PortLoop + 1, + &PortStatusAndChange, + 0, + sizeof(PORTSTATUSANDCHANGE), + 0); + + Status = QueryRootHub(DeviceObject, IOCTL_INTERNAL_USB_SUBMIT_URB, Urb, NULL); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to Reset the port!\n"); + return; + } + /* At this point the miniport will complete another SCE to inform of Reset completed */ + } + } +} + NTSTATUS DeviceArrivalCompletion(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context) { - PHUB_DEVICE_EXTENSION DeviceExtension; LONG i; DeviceExtension = (PHUB_DEVICE_EXTENSION)((PDEVICE_OBJECT)Context)->DeviceExtension; - /* FIXME: Need to use the number of ports returned from miniport at device start */ - for (i=0; i < 8; i++) - DPRINT1("Port %x DeviceExtension->PortStatus %x\n",i, DeviceExtension->PortStatus[i]); - + for (i=0; i < DeviceExtension->UsbExtHubInfo.NumberOfPorts; i++) + DPRINT1("Port %x DeviceExtension->PortStatus %x\n",i+1, DeviceExtension->PortStatus[i]); + + if (Irp->PendingReturned) + IoMarkIrpPending(Irp); + + ExInitializeWorkItem(&DeviceExtension->WorkItem, (PWORKER_THREAD_ROUTINE)WorkerThread, Context); + ExQueueWorkItem(&DeviceExtension->WorkItem, DelayedWorkQueue); return STATUS_SUCCESS; } @@ -147,7 +455,8 @@ Stack->Parameters.Others.Argument1 = Urb; Stack->Parameters.Others.Argument2 = NULL; - IoSetCompletionRoutineEx(DeviceExtension->RootHubPdo, Irp, (PIO_COMPLETION_ROUTINE)DeviceArrivalCompletion, DeviceObject, TRUE, TRUE, TRUE); + //IoSetCompletionRoutineEx(DeviceExtension->RootHubPdo, Irp, (PIO_COMPLETION_ROUTINE)DeviceArrivalCompletion, DeviceObject, TRUE, TRUE, TRUE); + IoSetCompletionRoutine(Irp, (PIO_COMPLETION_ROUTINE)DeviceArrivalCompletion, DeviceObject, TRUE, TRUE, TRUE); Status = IoCallDriver(DeviceExtension->RootHubPdo, Irp); @@ -193,7 +502,7 @@ if (Status == STATUS_PENDING) { - DPRINT("Usbhub: Operation pending\n"); + DPRINT1("Usbhub: Operation pending\n"); KeWaitForSingleObject(&Event, Suspended, KernelMode, FALSE, NULL); Status = IoStatus.Status; } @@ -273,33 +582,22 @@ { PHUB_DEVICE_EXTENSION DeviceExtension; PDEVICE_RELATIONS DeviceRelations; - PDEVICE_OBJECT Pdo; - PHUB_DEVICE_EXTENSION PdoExtension; ULONG i; ULONG Children = 0; ULONG NeededSize; DeviceExtension = (PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension; DPRINT1("USBHUB: Query Bus Relations\n"); + /* Create PDOs that are missing */ for (i = 0; i < USB_MAXCHILDREN; i++) { - if (DeviceExtension->Children[i] == NULL) + if (DeviceExtension->UsbChildren[i] == NULL) { continue; } Children++; - Pdo = DeviceExtension->Children[i]; - Pdo->Flags |= DO_BUS_ENUMERATED_DEVICE; - - PdoExtension = Pdo->DeviceExtension; - - RtlZeroMemory(PdoExtension, sizeof(HUB_DEVICE_EXTENSION)); - - PdoExtension->IsFDO = FALSE; - - Pdo->Flags &= ~DO_DEVICE_INITIALIZING; } /* Fill returned structure */ @@ -364,6 +662,7 @@ QueryRootHub(DeviceObject, IOCTL_INTERNAL_USB_GET_ROOTHUB_PDO, &DeviceExtension->RootHubPdo, &DeviceExtension->RootHubFdo); ASSERT(DeviceExtension->RootHubPdo); ASSERT(DeviceExtension->RootHubFdo); + DPRINT1("RootPdo %x, RootFdo %x\n", DeviceExtension->RootHubPdo, DeviceExtension->RootHubFdo); /* Send the START_DEVICE irp down to the PDO of RootHub */ Status = ForwardIrpAndWait(DeviceExtension->RootHubPdo, Irp); @@ -416,13 +715,13 @@ &Result); - DPRINT1("Status %x, Result %x\n", Status, Result); - DPRINT1("InformationLevel %x\n", DeviceExtension->DeviceInformation.InformationLevel); - DPRINT1("ActualLength %x\n", DeviceExtension->DeviceInformation.ActualLength); - DPRINT1("PortNumber %x\n", DeviceExtension->DeviceInformation.PortNumber); - DPRINT1("DeviceDescriptor %x\n", DeviceExtension->DeviceInformation.DeviceDescriptor); - DPRINT1("HubAddress %x\n", DeviceExtension->DeviceInformation.HubAddress); - DPRINT1("NumberofPipes %x\n", DeviceExtension->DeviceInformation.NumberOfOpenPipes); + DPRINT("Status %x, Result %x\n", Status, Result); + DPRINT("InformationLevel %x\n", DeviceExtension->DeviceInformation.InformationLevel); + DPRINT("ActualLength %x\n", DeviceExtension->DeviceInformation.ActualLength); + DPRINT("PortNumber %x\n", DeviceExtension->DeviceInformation.PortNumber); + DPRINT("DeviceDescriptor %x\n", DeviceExtension->DeviceInformation.DeviceDescriptor); + DPRINT("HubAddress %x\n", DeviceExtension->DeviceInformation.HubAddress); + DPRINT("NumberofPipes %x\n", DeviceExtension->DeviceInformation.NumberOfOpenPipes); /* Get roothubs device descriptor */ UsbBuildGetDescriptorRequest(Urb, @@ -458,6 +757,7 @@ Urb->UrbHeader.UsbdDeviceHandle = DeviceExtension->RootHubUsbDevice; Status = QueryRootHub(DeviceExtension->RootHubPdo, IOCTL_INTERNAL_USB_SUBMIT_URB, Urb, NULL); + if (!NT_SUCCESS(Status)) { DPRINT1("Usbhub: Failed to get RootHub Configuration with status %x\n", Status); @@ -513,8 +813,6 @@ Status = QueryRootHub(DeviceExtension->RootHubPdo, IOCTL_INTERNAL_USB_SUBMIT_URB, Urb, NULL); - DPRINT1("Status %x\n", Status); - DeviceExtension->ConfigurationHandle = Urb->UrbSelectConfiguration.ConfigurationHandle; DeviceExtension->PipeHandle = Urb->UrbSelectConfiguration.Interface.Pipes[0].PipeHandle; DPRINT1("Configuration Handle %x\n", DeviceExtension->ConfigurationHandle); @@ -523,6 +821,52 @@ DPRINT1("Status %x\n", Status); + { + int PortLoop; + USHORT PortStatusAndChange[2]; + + for (PortLoop=0; PortLoop< DeviceExtension->UsbExtHubInfo.NumberOfPorts; PortLoop++) + { + DPRINT1("Port %x\n", PortLoop); + UsbBuildVendorRequest(Urb, + URB_FUNCTION_CLASS_OTHER, + sizeof(Urb->UrbControlVendorClassRequest), + USBD_TRANSFER_DIRECTION_IN, + 0, + USB_REQUEST_SET_FEATURE, + PORT_POWER, + 1, + 0, + 0, + 0, + 0); + + Urb->UrbOSFeatureDescriptorRequest.MS_FeatureDescriptorIndex = PortLoop + 1; + Status = QueryRootHub(DeviceObject, IOCTL_INTERNAL_USB_SUBMIT_URB, Urb, NULL); + + DPRINT1("Status %x\n", Status); + + UsbBuildVendorRequest(Urb, + URB_FUNCTION_CLASS_OTHER, + sizeof(Urb->UrbControlVendorClassRequest), + USBD_TRANSFER_DIRECTION_OUT, + 0, + USB_REQUEST_GET_STATUS, + 0, + PortLoop + 1, + &PortStatusAndChange, + 0, + sizeof(PortStatusAndChange), + 0); + Status = QueryRootHub(DeviceObject, IOCTL_INTERNAL_USB_SUBMIT_URB, Urb, NULL); + + DPRINT1("Status %x\n", Status); + DPRINT1("PortStatus = %x\n", PortStatusAndChange[0]); + DPRINT1("PortChange = %x\n", PortStatusAndChange[1]); + } + } + + ExFreePool(Urb); break; } Modified: trunk/reactos/drivers/usb/usbhub/pdo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbhub/pdo.c?r…
============================================================================== --- trunk/reactos/drivers/usb/usbhub/pdo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbhub/pdo.c [iso-8859-1] Tue Sep 14 12:04:15 2010 @@ -16,298 +16,299 @@ NTSTATUS UsbhubInternalDeviceControlPdo( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp) -{ - PIO_STACK_LOCATION Stack; - ULONG_PTR Information = 0; - NTSTATUS Status; - - DPRINT1("Usbhub: UsbhubInternalDeviceControlPdo() called\n"); - - Stack = IoGetCurrentIrpStackLocation(Irp); - Status = Irp->IoStatus.Status; - - switch (Stack->Parameters.DeviceIoControl.IoControlCode) - { - case IOCTL_INTERNAL_USB_GET_PARENT_HUB_INFO: - { - PHUB_DEVICE_EXTENSION DeviceExtension; - - DPRINT1("Usbhub: IOCTL_INTERNAL_USB_GET_PARENT_HUB_INFO\n"); - if (Irp->AssociatedIrp.SystemBuffer == NULL - || Stack->Parameters.DeviceIoControl.OutputBufferLength != sizeof(PVOID)) - { - Status = STATUS_INVALID_PARAMETER; - } - else - { - PVOID* pHubPointer; - DeviceExtension = (PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension; - - pHubPointer = (PVOID*)Irp->AssociatedIrp.SystemBuffer; - *pHubPointer = DeviceExtension->dev; - Information = sizeof(PVOID); - Status = STATUS_SUCCESS; - } - break; - } - default: - { - DPRINT1("Usbhub: Unknown IOCTL code 0x%lx\n", Stack->Parameters.DeviceIoControl.IoControlCode); - Information = Irp->IoStatus.Information; - Status = Irp->IoStatus.Status; - } - } - - Irp->IoStatus.Information = Information; - Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return Status; + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp) +{ + PIO_STACK_LOCATION Stack; + ULONG_PTR Information = 0; + NTSTATUS Status; + + DPRINT1("Usbhub: UsbhubInternalDeviceControlPdo() called\n"); + + Stack = IoGetCurrentIrpStackLocation(Irp); + Status = Irp->IoStatus.Status; + + switch (Stack->Parameters.DeviceIoControl.IoControlCode) + { + case IOCTL_INTERNAL_USB_GET_PARENT_HUB_INFO: + { + PHUB_DEVICE_EXTENSION DeviceExtension; + + DPRINT1("Usbhub: IOCTL_INTERNAL_USB_GET_PARENT_HUB_INFO\n"); + if (Irp->AssociatedIrp.SystemBuffer == NULL + || Stack->Parameters.DeviceIoControl.OutputBufferLength != sizeof(PVOID)) + { + Status = STATUS_INVALID_PARAMETER; + } + else + { + PVOID* pHubPointer; + DeviceExtension = (PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + + pHubPointer = (PVOID*)Irp->AssociatedIrp.SystemBuffer; + *pHubPointer = DeviceExtension->dev; + Information = sizeof(PVOID); + Status = STATUS_SUCCESS; + } + break; + } + default: + { + DPRINT1("Usbhub: Unknown IOCTL code 0x%lx\n", Stack->Parameters.DeviceIoControl.IoControlCode); + Information = Irp->IoStatus.Information; + Status = Irp->IoStatus.Status; + } + } + + Irp->IoStatus.Information = Information; + Irp->IoStatus.Status = Status; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return Status; } static NTSTATUS UsbhubPdoStartDevice( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp) -{ - PHUB_DEVICE_EXTENSION DeviceExtension; - NTSTATUS Status = STATUS_UNSUCCESSFUL; - - DeviceExtension = (PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension; - - /* Register and activate device interface */ + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp) +{ + PHUB_DEVICE_EXTENSION DeviceExtension; + NTSTATUS Status = STATUS_UNSUCCESSFUL; + + DeviceExtension = (PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + + /* Register and activate device interface */ /* - Status = IoRegisterDeviceInterface( - DeviceObject, - DeviceExtension->dev->descriptor.bDeviceClass == USB_CLASS_HUB ? - &GUID_DEVINTERFACE_USB_HUB : - &GUID_DEVINTERFACE_USB_DEVICE, - NULL, - &DeviceExtension->SymbolicLinkName); + Status = IoRegisterDeviceInterface( + DeviceObject, + DeviceExtension->dev->descriptor.bDeviceClass == USB_CLASS_HUB ? + &GUID_DEVINTERFACE_USB_HUB : + &GUID_DEVINTERFACE_USB_DEVICE, + NULL, + &DeviceExtension->SymbolicLinkName); */ - if (!NT_SUCCESS(Status)) - { - DPRINT1("Usbhub: IoRegisterDeviceInterface() failed with status 0x%08lx\n", Status); - return Status; - } - - //Status = IoSetDeviceInterfaceState(&DeviceExtension->SymbolicLinkName, TRUE); - if (!NT_SUCCESS(Status)) - { - DPRINT1("Usbhub: IoSetDeviceInterfaceState() failed with status 0x%08lx\n", Status); - return Status; - } - - return STATUS_SUCCESS; + if (!NT_SUCCESS(Status)) + { + DPRINT1("Usbhub: IoRegisterDeviceInterface() failed with status 0x%08lx\n", Status); + return Status; + } + + //Status = IoSetDeviceInterfaceState(&DeviceExtension->SymbolicLinkName, TRUE); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Usbhub: IoSetDeviceInterfaceState() failed with status 0x%08lx\n", Status); + return Status; + } + + return STATUS_SUCCESS; } static NTSTATUS UsbhubPdoQueryId( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp, - OUT ULONG_PTR* Information) -{ - PHUB_DEVICE_EXTENSION DeviceExtension; - ULONG IdType; - PUNICODE_STRING SourceString; - UNICODE_STRING String; - NTSTATUS Status; - - IdType = IoGetCurrentIrpStackLocation(Irp)->Parameters.QueryId.IdType; - DeviceExtension = (PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension; - RtlInitUnicodeString(&String, NULL); - - switch (IdType) - { - case BusQueryDeviceID: - { - DPRINT1("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryDeviceID\n"); - SourceString = &DeviceExtension->DeviceId; - break; - } - case BusQueryHardwareIDs: - { - DPRINT1("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryHardwareIDs\n"); - SourceString = &DeviceExtension->HardwareIds; - break; - } - case BusQueryCompatibleIDs: - { - DPRINT1("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryCompatibleIDs\n"); - SourceString = &DeviceExtension->CompatibleIds; - break; - } - case BusQueryInstanceID: - { - DPRINT1("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryInstanceID\n"); - SourceString = &DeviceExtension->InstanceId; - break; - } - default: - DPRINT1("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_ID / unknown query id type 0x%lx\n", IdType); - return STATUS_NOT_SUPPORTED; - } - - Status = UsbhubDuplicateUnicodeString( - &String, - SourceString, - PagedPool); - *Information = (ULONG_PTR)String.Buffer; - return Status; + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp, + OUT ULONG_PTR* Information) +{ + PHUB_CHILDDEVICE_EXTENSION DeviceExtension; + ULONG IdType; + PWCHAR SourceString = NULL; + NTSTATUS Status = STATUS_SUCCESS; + + IdType = IoGetCurrentIrpStackLocation(Irp)->Parameters.QueryId.IdType; + DeviceExtension = (PHUB_CHILDDEVICE_EXTENSION)DeviceObject->DeviceExtension; + + switch (IdType) + { + case BusQueryDeviceID: + { + DPRINT1("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryDeviceID\n"); + SourceString = DeviceExtension->DeviceId; + break; + } + /* FIXME: Implement */ + case BusQueryHardwareIDs: + { + DPRINT1("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryHardwareIDs\n"); + SourceString = DeviceExtension->HardwareIds; + Status = STATUS_NOT_SUPPORTED; + break; + } + /* FIXME: Implement */ + case BusQueryCompatibleIDs: + { + DPRINT1("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryCompatibleIDs\n"); + SourceString = DeviceExtension->CompatibleIds; + Status = STATUS_NOT_SUPPORTED; + break; + } + case BusQueryInstanceID: + { + DPRINT1("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryInstanceID\n"); + SourceString = DeviceExtension->InstanceId; + break; + } + default: + DPRINT1("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_ID / unknown query id type 0x%lx\n", IdType); + return STATUS_NOT_SUPPORTED; + } + + *Information = (ULONG_PTR)SourceString; + return Status; } static NTSTATUS UsbhubPdoQueryDeviceText( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp, - OUT ULONG_PTR* Information) -{ - PHUB_DEVICE_EXTENSION DeviceExtension; - DEVICE_TEXT_TYPE DeviceTextType; - LCID LocaleId; - - DeviceTextType = IoGetCurrentIrpStackLocation(Irp)->Parameters.QueryDeviceText.DeviceTextType; - LocaleId = IoGetCurrentIrpStackLocation(Irp)->Parameters.QueryDeviceText.LocaleId; - DeviceExtension = (PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension; -DPRINT1("Usbhub: UsbhubPdoQueryDeviceText\n"); - switch (DeviceTextType) - { - case DeviceTextDescription: - case DeviceTextLocationInformation: - { - if (DeviceTextType == DeviceTextDescription) - DPRINT1("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_TEXT / DeviceTextDescription\n"); - else - DPRINT1("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_TEXT / DeviceTextLocationInformation\n"); - -/* if (!DeviceExtension->dev->descriptor.iProduct) - return STATUS_NOT_SUPPORTED;*/ - - return STATUS_SUCCESS; - } - default: - DPRINT1("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_TEXT / unknown device text type 0x%lx\n", DeviceTextType); - return STATUS_NOT_SUPPORTED; - } + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp, + OUT ULONG_PTR* Information) +{ + PHUB_CHILDDEVICE_EXTENSION DeviceExtension; + DEVICE_TEXT_TYPE DeviceTextType; + LCID LocaleId; + + DeviceTextType = IoGetCurrentIrpStackLocation(Irp)->Parameters.QueryDeviceText.DeviceTextType; + LocaleId = IoGetCurrentIrpStackLocation(Irp)->Parameters.QueryDeviceText.LocaleId; + DeviceExtension = (PHUB_CHILDDEVICE_EXTENSION)DeviceObject->DeviceExtension; + + switch (DeviceTextType) + { + case DeviceTextDescription: + case DeviceTextLocationInformation: + { + if (DeviceTextType == DeviceTextDescription) + { + *Information = (ULONG_PTR)DeviceExtension->TextDescription; + DPRINT1("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_TEXT / DeviceTextDescription\n"); + } + else + DPRINT1("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_TEXT / DeviceTextLocationInformation\n"); + +/* if (!DeviceExtension->dev->descriptor.iProduct) + return STATUS_NOT_SUPPORTED;*/ + + return STATUS_SUCCESS; + } + default: + DPRINT1("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_TEXT / unknown device text type 0x%lx\n", DeviceTextType); + return STATUS_NOT_SUPPORTED; + } } NTSTATUS NTAPI UsbhubPnpPdo( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp) -{ - ULONG MinorFunction; - PIO_STACK_LOCATION Stack; - ULONG_PTR Information = 0; - NTSTATUS Status; - - Stack = IoGetCurrentIrpStackLocation(Irp); - MinorFunction = Stack->MinorFunction; - - switch (MinorFunction) - { - case IRP_MN_START_DEVICE: /* 0x0 */ - { - DPRINT1("Usbhub: IRP_MJ_PNP / IRP_MN_START_DEVICE\n"); - Status = UsbhubPdoStartDevice(DeviceObject, Irp); - break; - } - case IRP_MN_QUERY_CAPABILITIES: /* 0x09 */ - { - PDEVICE_CAPABILITIES DeviceCapabilities; - ULONG i; - DPRINT1("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_CAPABILITIES\n"); - - DeviceCapabilities = (PDEVICE_CAPABILITIES)Stack->Parameters.DeviceCapabilities.Capabilities; - /* FIXME: capabilities can change with connected device */ - DeviceCapabilities->LockSupported = TRUE; - DeviceCapabilities->EjectSupported = FALSE; - DeviceCapabilities->Removable = FALSE; - DeviceCapabilities->DockDevice = FALSE; - DeviceCapabilities->UniqueID = FALSE; - DeviceCapabilities->SilentInstall = TRUE; - DeviceCapabilities->RawDeviceOK = FALSE; - DeviceCapabilities->SurpriseRemovalOK = FALSE; - DeviceCapabilities->HardwareDisabled = FALSE; /* FIXME */ - //DeviceCapabilities->NoDisplayInUI = FALSE; /* FIXME */ - DeviceCapabilities->DeviceState[0] = PowerDeviceD0; /* FIXME */ - for (i = 0; i < PowerSystemMaximum; i++) - DeviceCapabilities->DeviceState[i] = PowerDeviceD3; /* FIXME */ - //DeviceCapabilities->DeviceWake = PowerDeviceUndefined; /* FIXME */ - DeviceCapabilities->D1Latency = 0; /* FIXME */ - DeviceCapabilities->D2Latency = 0; /* FIXME */ - DeviceCapabilities->D3Latency = 0; /* FIXME */ - Status = STATUS_SUCCESS; - break; - } - case IRP_MN_QUERY_RESOURCES: /* 0x0a */ - { - PCM_RESOURCE_LIST ResourceList; - - DPRINT1("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_RESOURCES\n"); - ResourceList = ExAllocatePool(PagedPool, sizeof(CM_RESOURCE_LIST)); - if (!ResourceList) - { - DPRINT1("Usbhub: ExAllocatePool() failed\n"); - Status = STATUS_INSUFFICIENT_RESOURCES; - } - else - { - ResourceList->Count = 0; - Information = (ULONG_PTR)ResourceList; - Status = STATUS_SUCCESS; - } - break; - } - case IRP_MN_QUERY_RESOURCE_REQUIREMENTS: /* 0x0b */ - { - PIO_RESOURCE_REQUIREMENTS_LIST ResourceList; - - DPRINT1("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_RESOURCE_REQUIREMENTS\n"); - ResourceList = ExAllocatePool(PagedPool, sizeof(IO_RESOURCE_REQUIREMENTS_LIST)); - if (!ResourceList) - { - DPRINT1("Usbhub: ExAllocatePool() failed\n"); - Status = STATUS_INSUFFICIENT_RESOURCES; - } - else - { - RtlZeroMemory(ResourceList, sizeof(IO_RESOURCE_REQUIREMENTS_LIST)); - ResourceList->ListSize = sizeof(IO_RESOURCE_REQUIREMENTS_LIST); - ResourceList->AlternativeLists = 1; - ResourceList->List->Version = 1; - ResourceList->List->Revision = 1; - ResourceList->List->Count = 0; - Information = (ULONG_PTR)ResourceList; - Status = STATUS_SUCCESS; - } - break; - } - case IRP_MN_QUERY_DEVICE_TEXT: /* 0x0c */ - { - Status = UsbhubPdoQueryDeviceText(DeviceObject, Irp, &Information); - break; - } - case IRP_MN_QUERY_ID: /* 0x13 */ - { - Status = UsbhubPdoQueryId(DeviceObject, Irp, &Information); - break; - } - default: - { - /* We can't forward request to the lower driver, because - * we are a Pdo, so we don't have lower driver... - */ - DPRINT1("Usbhub: IRP_MJ_PNP / unknown minor function 0x%lx\n", MinorFunction); - Information = Irp->IoStatus.Information; - Status = Irp->IoStatus.Status; - } - } - - Irp->IoStatus.Information = Information; - Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return Status; -} - + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp) +{ + ULONG MinorFunction; + PIO_STACK_LOCATION Stack; + ULONG_PTR Information = 0; + NTSTATUS Status; + + Stack = IoGetCurrentIrpStackLocation(Irp); + MinorFunction = Stack->MinorFunction; + + switch (MinorFunction) + { + case IRP_MN_START_DEVICE: /* 0x0 */ + { + DPRINT1("Usbhub: IRP_MJ_PNP / IRP_MN_START_DEVICE\n"); + Status = UsbhubPdoStartDevice(DeviceObject, Irp); + break; + } + case IRP_MN_QUERY_CAPABILITIES: /* 0x09 */ + { + PDEVICE_CAPABILITIES DeviceCapabilities; + ULONG i; + DPRINT1("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_CAPABILITIES\n"); + + DeviceCapabilities = (PDEVICE_CAPABILITIES)Stack->Parameters.DeviceCapabilities.Capabilities; + /* FIXME: capabilities can change with connected device */ + DeviceCapabilities->LockSupported = TRUE; + DeviceCapabilities->EjectSupported = FALSE; + DeviceCapabilities->Removable = FALSE; + DeviceCapabilities->DockDevice = FALSE; + DeviceCapabilities->UniqueID = FALSE; + DeviceCapabilities->SilentInstall = TRUE; + DeviceCapabilities->RawDeviceOK = FALSE; + DeviceCapabilities->SurpriseRemovalOK = FALSE; + DeviceCapabilities->HardwareDisabled = FALSE; /* FIXME */ + //DeviceCapabilities->NoDisplayInUI = FALSE; /* FIXME */ + DeviceCapabilities->DeviceState[0] = PowerDeviceD0; /* FIXME */ + for (i = 0; i < PowerSystemMaximum; i++) + DeviceCapabilities->DeviceState[i] = PowerDeviceD3; /* FIXME */ + //DeviceCapabilities->DeviceWake = PowerDeviceUndefined; /* FIXME */ + DeviceCapabilities->D1Latency = 0; /* FIXME */ + DeviceCapabilities->D2Latency = 0; /* FIXME */ + DeviceCapabilities->D3Latency = 0; /* FIXME */ + Status = STATUS_SUCCESS; + break; + } + case IRP_MN_QUERY_RESOURCES: /* 0x0a */ + { + PCM_RESOURCE_LIST ResourceList; + + DPRINT1("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_RESOURCES\n"); + ResourceList = ExAllocatePool(PagedPool, sizeof(CM_RESOURCE_LIST)); + if (!ResourceList) + { + DPRINT1("Usbhub: ExAllocatePool() failed\n"); + Status = STATUS_INSUFFICIENT_RESOURCES; + } + else + { + ResourceList->Count = 0; + Information = (ULONG_PTR)ResourceList; + Status = STATUS_SUCCESS; + } + break; + } + case IRP_MN_QUERY_RESOURCE_REQUIREMENTS: /* 0x0b */ + { + PIO_RESOURCE_REQUIREMENTS_LIST ResourceList; + + DPRINT1("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_RESOURCE_REQUIREMENTS\n"); + ResourceList = ExAllocatePool(PagedPool, sizeof(IO_RESOURCE_REQUIREMENTS_LIST)); + if (!ResourceList) + { + DPRINT1("Usbhub: ExAllocatePool() failed\n"); + Status = STATUS_INSUFFICIENT_RESOURCES; + } + else + { + RtlZeroMemory(ResourceList, sizeof(IO_RESOURCE_REQUIREMENTS_LIST)); + ResourceList->ListSize = sizeof(IO_RESOURCE_REQUIREMENTS_LIST); + ResourceList->AlternativeLists = 1; + ResourceList->List->Version = 1; + ResourceList->List->Revision = 1; + ResourceList->List->Count = 0; + Information = (ULONG_PTR)ResourceList; + Status = STATUS_SUCCESS; + } + break; + } + case IRP_MN_QUERY_DEVICE_TEXT: /* 0x0c */ + { + Status = UsbhubPdoQueryDeviceText(DeviceObject, Irp, &Information); + break; + } + case IRP_MN_QUERY_ID: /* 0x13 */ + { + Status = UsbhubPdoQueryId(DeviceObject, Irp, &Information); + break; + } + default: + { + /* We can't forward request to the lower driver, because + * we are a Pdo, so we don't have lower driver... + */ + DPRINT1("Usbhub: IRP_MJ_PNP / unknown minor function 0x%lx\n", MinorFunction); + Information = Irp->IoStatus.Information; + Status = Irp->IoStatus.Status; + } + } + + Irp->IoStatus.Information = Information; + Irp->IoStatus.Status = Status; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return Status; +} + Modified: trunk/reactos/drivers/usb/usbhub/usbhub.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbhub/usbhub.…
============================================================================== --- trunk/reactos/drivers/usb/usbhub/usbhub.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbhub/usbhub.c [iso-8859-1] Tue Sep 14 12:04:15 2010 @@ -56,7 +56,8 @@ DeviceExtension->IsFDO = TRUE; Fdo->Flags |= DO_POWER_PAGABLE; - Status = IoAttachDeviceToDeviceStackSafe(Fdo, Pdo, &DeviceExtension->LowerDevice); + //Status = IoAttachDeviceToDeviceStackSafe(Fdo, Pdo, &DeviceExtension->LowerDevice); + DeviceExtension->LowerDevice = IoAttachDeviceToDeviceStack(Fdo, Pdo); if (!NT_SUCCESS(Status)) { DPRINT("Usbhub: IoAttachDeviceToDeviceStackSafe() failed with status 0x%08lx\n", Status); Modified: trunk/reactos/drivers/usb/usbhub/usbhub.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbhub/usbhub.…
============================================================================== --- trunk/reactos/drivers/usb/usbhub/usbhub.h [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbhub/usbhub.h [iso-8859-1] Tue Sep 14 12:04:15 2010 @@ -61,16 +61,29 @@ USB_CONFIGURATION *ActiveConfig; USB_INTERFACE *ActiveInterface; USB_CONFIGURATION **Configs; +} USB_DEVICE, *PUSB_DEVICE; -} USB_DEVICE, *PUSB_DEVICE; +typedef struct _HUB_CHILDDEVICE_EXTENSION +{ + BOOLEAN IsFDO; + PDEVICE_OBJECT Parent; + PWCHAR DeviceId; // REG_SZ + PWCHAR InstanceId; // REG_SZ + PWCHAR HardwareIds; // REG_MULTI_SZ + PWCHAR CompatibleIds; // REG_MULTI_SZ + PWCHAR TextDescription; + UNICODE_STRING SymbolicLinkName; +} HUB_CHILDDEVICE_EXTENSION, *PHUB_CHILDDEVICE_EXTENSION; typedef struct _HUB_DEVICE_EXTENSION { - BOOLEAN IsFDO; - USB_DEVICE* dev; - PDEVICE_OBJECT LowerDevice; + BOOLEAN IsFDO; + USB_DEVICE* dev; + PDEVICE_OBJECT LowerDevice; ULONG ChildCount; - PDEVICE_OBJECT Children[USB_MAXCHILDREN]; + PDEVICE_OBJECT Children[USB_MAXCHILDREN]; + + PUSB_DEVICE UsbChildren[USB_MAXCHILDREN]; PUSB_DEVICE RootHubUsbDevice; @@ -79,7 +92,7 @@ ULONG HubCount; - ULONG PortStatus[256]; + USHORT PortStatus[256]; USB_BUS_INTERFACE_HUB_V5 HubInterface; USB_BUS_INTERFACE_USBDI_V2 UsbDInterface; @@ -94,72 +107,70 @@ USB_EXTHUB_INFORMATION_0 UsbExtHubInfo; USB_DEVICE_INFORMATION_0 DeviceInformation; + WORK_QUEUE_ITEM WorkItem; + USBD_CONFIGURATION_HANDLE ConfigurationHandle; USBD_PIPE_HANDLE PipeHandle; - /* Fields valid only when IsFDO == FALSE */ - UNICODE_STRING DeviceId; // REG_SZ - UNICODE_STRING InstanceId; // REG_SZ - UNICODE_STRING HardwareIds; // REG_MULTI_SZ - UNICODE_STRING CompatibleIds; // REG_MULTI_SZ + UNICODE_STRING SymbolicLinkName; } HUB_DEVICE_EXTENSION, *PHUB_DEVICE_EXTENSION; /* createclose.c */ NTSTATUS NTAPI UsbhubCreate( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp); + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp); NTSTATUS NTAPI UsbhubClose( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp); + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp); NTSTATUS NTAPI UsbhubCleanup( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp); + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp); /* fdo.c */ NTSTATUS NTAPI UsbhubPnpFdo( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp); + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp); NTSTATUS UsbhubDeviceControlFdo( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp); + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp); /* misc.c */ NTSTATUS ForwardIrpAndWait( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp); + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp); NTSTATUS NTAPI ForwardIrpAndForget( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp); + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp); NTSTATUS UsbhubDuplicateUnicodeString( - OUT PUNICODE_STRING Destination, - IN PUNICODE_STRING Source, - IN POOL_TYPE PoolType); + OUT PUNICODE_STRING Destination, + IN PUNICODE_STRING Source, + IN POOL_TYPE PoolType); NTSTATUS UsbhubInitMultiSzString( - OUT PUNICODE_STRING Destination, - ... /* list of PCSZ */); + OUT PUNICODE_STRING Destination, + .../* list of PCSZ */); /* pdo.c */ NTSTATUS NTAPI UsbhubPnpPdo( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp); + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp); NTSTATUS UsbhubInternalDeviceControlPdo( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp); + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp);
14 years, 3 months
1
0
0
0
← Newer
1
...
15
16
17
18
19
20
21
...
28
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
Results per page:
10
25
50
100
200