[CPORTLIB]

Code formatting only.

svn path=/trunk/; revision=57759
This commit is contained in:
Hermès Bélusca-Maïto 2012-11-24 18:22:26 +00:00
parent 1279ab0e12
commit c5166c1a2d
3 changed files with 120 additions and 112 deletions

View file

@ -11,8 +11,8 @@
#pragma once #pragma once
/* Note: These definitions are the internal definitions used by Microsoft serial /* Note: These definitions are the internal definitions used by Microsoft serial
driver (see src/kernel/serial/serial.h in WDK source code). Linux uses its own, as driver (see src/kernel/serial/serial.h in WDK source code). Linux uses its own,
do most other OS. as do most other OS.
*/ */
#if !defined(SERIAL_REGISTER_STRIDE) #if !defined(SERIAL_REGISTER_STRIDE)

View file

@ -72,3 +72,5 @@ CpPutByte(
IN PCPPORT Port, IN PCPPORT Port,
IN UCHAR Byte IN UCHAR Byte
); );
/* EOF */

View file

@ -72,12 +72,11 @@ BOOLEAN
NTAPI NTAPI
CpDoesPortExist(IN PUCHAR Address) CpDoesPortExist(IN PUCHAR Address)
{ {
UCHAR Old;
/* /*
* See "Building Hardware and Firmware to Complement Microsoft Windows Headless Operation" * See "Building Hardware and Firmware to Complement Microsoft Windows Headless Operation"
* Out-of-Band Management Port Device Requirements: * Out-of-Band Management Port Device Requirements:
* The device must act as a 16550 or 16450 UART. * The device must act as a 16550 or 16450 UART.
* Windows Server 2003 will test this device using the following process. * Windows Server 2003 will test this device using the following process:
* 1. Save off the current modem status register. * 1. Save off the current modem status register.
* 2. Place the UART into diagnostic mode (The UART is placed into loopback mode * 2. Place the UART into diagnostic mode (The UART is placed into loopback mode
* by writing SERIAL_MCR_LOOP to the modem control register). * by writing SERIAL_MCR_LOOP to the modem control register).
@ -91,9 +90,12 @@ CpDoesPortExist(IN PUCHAR Address)
* This means SERIAL_MSR_RI should be set. * This means SERIAL_MSR_RI should be set.
* 6. Restore original modem status register. * 6. Restore original modem status register.
*/ */
Old = READ_PORT_UCHAR(Address + MODEM_CONTROL_REGISTER);
UCHAR Old = READ_PORT_UCHAR(Address + MODEM_CONTROL_REGISTER);
WRITE_PORT_UCHAR(Address + MODEM_CONTROL_REGISTER, SERIAL_MCR_LOOP); WRITE_PORT_UCHAR(Address + MODEM_CONTROL_REGISTER, SERIAL_MCR_LOOP);
WRITE_PORT_UCHAR(Address + MODEM_CONTROL_REGISTER, SERIAL_MCR_LOOP); WRITE_PORT_UCHAR(Address + MODEM_CONTROL_REGISTER, SERIAL_MCR_LOOP);
if (!(READ_PORT_UCHAR(Address + MODEM_STATUS_REGISTER) & if (!(READ_PORT_UCHAR(Address + MODEM_STATUS_REGISTER) &
(SERIAL_MSR_CTS | SERIAL_MSR_DSR | SERIAL_MSR_RI | SERIAL_MSR_DCD))) (SERIAL_MSR_CTS | SERIAL_MSR_DSR | SERIAL_MSR_RI | SERIAL_MSR_DCD)))
{ {
@ -105,7 +107,9 @@ CpDoesPortExist(IN PUCHAR Address)
return TRUE; return TRUE;
} }
} }
WRITE_PORT_UCHAR(Address + MODEM_CONTROL_REGISTER, Old); WRITE_PORT_UCHAR(Address + MODEM_CONTROL_REGISTER, Old);
return FALSE; return FALSE;
} }
@ -225,3 +229,5 @@ CpPutByte(IN PCPPORT Port,
/* Send the byte */ /* Send the byte */
WRITE_PORT_UCHAR(Port->Address + RECEIVE_BUFFER_REGISTER, Byte); WRITE_PORT_UCHAR(Port->Address + RECEIVE_BUFFER_REGISTER, Byte);
} }
/* EOF */