2 * PROJECT: ReactOS Kernel
3 * LICENSE: BSD - See COPYING.ARM in the top level directory
4 * FILE: ntoskrnl/inbv/inbvport.c
5 * PURPOSE: Serial Port Boot Driver for Headless Terminal Support
6 * PROGRAMMERS: ReactOS Portable Systems Group
9 /* INCLUDES ******************************************************************/
14 /* GLOBALS *******************************************************************/
24 /* FUNCTIONS *****************************************************************/
28 InbvPortEnableFifo(IN ULONG PortId
,
31 /* Set FIFO as requested */
32 CpEnableFifo(Port
[PortId
].Address
, Enable
);
37 InbvPortPutByte(IN ULONG PortId
,
41 CpPutByte(&Port
[PortId
], Output
);
46 InbvPortTerminate(IN ULONG PortId
)
48 /* The port is now available */
49 Port
[PortId
].Address
= NULL
;
54 InbvPortInitialize(IN ULONG BaudRate
,
56 IN PUCHAR PortAddress
,
58 IN BOOLEAN IsMMIODevice
)
60 /* Not yet supported */
61 ASSERT(IsMMIODevice
== FALSE
);
63 /* Set default baud rate */
64 if (BaudRate
== 0) BaudRate
= 19200;
66 /* Check if port or address given */
69 /* Pick correct address for port */
75 PortAddress
= (PUCHAR
)0x3F8;
79 PortAddress
= (PUCHAR
)0x2F8;
83 PortAddress
= (PUCHAR
)0x3E8;
88 PortAddress
= (PUCHAR
)0x2E8;
94 /* Pick correct port for address */
95 PortAddress
= (PUCHAR
)0x2F8;
96 if (CpDoesPortExist(PortAddress
))
102 PortAddress
= (PUCHAR
)0x3F8;
103 if (!CpDoesPortExist(PortAddress
)) return FALSE
;
108 /* Initialize the port unless it's already up, and then return it */
109 if (Port
[PortNumber
- 1].Address
) return FALSE
;
111 CpInitialize(&Port
[PortNumber
- 1], PortAddress
, BaudRate
);
112 *PortId
= PortNumber
- 1;