2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
29 * @APPLE_FREE_COPYRIGHT@
33 #include <device/device_types.h>
37 * Console is on the Printer Port (chip channel 0)
38 * Debugger is on the Modem Port (chip channel 1)
41 #define CONSOLE_PORT 1
44 char * t_addr
; /* device pointer */
45 int t_dev
; /* device number */
46 int t_ispeed
; /* input speed */
47 int t_ospeed
; /* output speed */
48 char t_breakc
; /* character to deliver when 'break'
50 int t_flags
; /* mode flags */
51 int t_state
; /* current state */
52 int t_line
; /* fake line discipline number,
53 for old drivers - always 0 */
54 int t_outofband
; /* current out-of-band events */
55 int t_outofbandarg
; /* arg to first out-of-band event */
56 int t_nquoted
; /* number of quoted chars in inq */
57 int t_hiwater
; /* baud-rate limited high water mark */
58 int t_lowater
; /* baud-rate limited low water mark */
60 typedef struct scc_tty
*scc_tty_t
;
63 * function declarations for performing serial i/o
64 * other functions below are declared in kern/misc_protos.h
65 * cnputc, cngetc, cnmaygetc
68 void initialize_serial(caddr_t scc_phys_base
);
70 extern int scc_probe(void);
78 extern void scc_close(
85 extern io_return_t
scc_write(
89 extern io_return_t
scc_get_status(
93 mach_msg_type_number_t
*status_count
);
95 extern io_return_t
scc_set_status(
99 mach_msg_type_number_t status_count
);
101 extern boolean_t
scc_portdeath(
118 /* Functions in serial_console.c for switching between serial and video
120 extern boolean_t
console_is_serial(void);
121 extern int switch_to_serial_console(
124 extern int switch_to_video_console(
127 extern void switch_to_old_console(
130 void serial_keyboard_init(void);
131 void serial_keyboard_start(void);
132 void serial_keyboard_poll(void);
138 #define TF_ODDP 0x00000002 /* get/send odd parity */
139 #define TF_EVENP 0x00000004 /* get/send even parity */
140 #define TF_ANYP (TF_ODDP|TF_EVENP)
141 /* get any parity/send none */
142 #define TF_LITOUT 0x00000008 /* output all 8 bits
143 otherwise, characters >= 0x80
144 are time delays XXX */
145 #define TF_ECHO 0x00000080 /* device wants user to echo input */
146 #define TS_MIN 0x00004000 /* buffer input chars, if possible */