2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
26 * @APPLE_FREE_COPYRIGHT@
30 #include <device/device_types.h>
34 * Console is on the Printer Port (chip channel 0)
35 * Debugger is on the Modem Port (chip channel 1)
38 #define CONSOLE_PORT 1
41 char * t_addr
; /* device pointer */
42 int t_dev
; /* device number */
43 int t_ispeed
; /* input speed */
44 int t_ospeed
; /* output speed */
45 char t_breakc
; /* character to deliver when 'break'
47 int t_flags
; /* mode flags */
48 int t_state
; /* current state */
49 int t_line
; /* fake line discipline number,
50 for old drivers - always 0 */
51 int t_outofband
; /* current out-of-band events */
52 int t_outofbandarg
; /* arg to first out-of-band event */
53 int t_nquoted
; /* number of quoted chars in inq */
54 int t_hiwater
; /* baud-rate limited high water mark */
55 int t_lowater
; /* baud-rate limited low water mark */
57 typedef struct scc_tty
*scc_tty_t
;
60 * function declarations for performing serial i/o
61 * other functions below are declared in kern/misc_protos.h
62 * cnputc, cngetc, cnmaygetc
65 void initialize_serial(caddr_t scc_phys_base
, int32_t serial_baud
);
67 extern int scc_probe(int32_t serial_baud
);
75 extern void scc_close(
82 extern io_return_t
scc_write(
86 extern io_return_t
scc_get_status(
90 mach_msg_type_number_t
*status_count
);
92 extern io_return_t
scc_set_status(
96 mach_msg_type_number_t status_count
);
98 extern boolean_t
scc_portdeath(
115 /* Functions in serial_console.c for switching between serial and video
117 extern boolean_t
console_is_serial(void);
118 extern int switch_to_serial_console(
121 extern int switch_to_video_console(
124 extern void switch_to_old_console(
127 void serial_keyboard_init(void);
128 void serial_keyboard_start(void);
129 void serial_keyboard_poll(void);
133 * JMM - We are not really going to support this driver in SMP (barely
134 * support it now - so just pick up the stubbed out versions.
136 #define DECL_FUNNEL(class,f)
137 #define DECL_FUNNEL_VARS
138 #define FUNNEL_INIT(f,p)
139 #define FUNNEL_ENTER(f)
140 #define FUNNEL_EXIT(f)
141 #define FUNNEL_ESCAPE(f) (1)
142 #define FUNNEL_REENTER(f,count)
143 #define FUNNEL_IN_USE(f) (TRUE)
148 #define TF_ODDP 0x00000002 /* get/send odd parity */
149 #define TF_EVENP 0x00000004 /* get/send even parity */
150 #define TF_ANYP (TF_ODDP|TF_EVENP)
151 /* get any parity/send none */
152 #define TF_LITOUT 0x00000008 /* output all 8 bits
153 otherwise, characters >= 0x80
154 are time delays XXX */
155 #define TF_ECHO 0x00000080 /* device wants user to echo input */
156 #define TS_MIN 0x00004000 /* buffer input chars, if possible */