]>
Commit | Line | Data |
---|---|---|
1c79356b | 1 | /* |
5d5c5d0d | 2 | * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. |
1c79356b | 3 | * |
8ad349bb | 4 | * @APPLE_LICENSE_OSREFERENCE_HEADER_START@ |
1c79356b | 5 | * |
8ad349bb A |
6 | * This file contains Original Code and/or Modifications of Original Code |
7 | * as defined in and that are subject to the Apple Public Source License | |
8 | * Version 2.0 (the 'License'). You may not use this file except in | |
9 | * compliance with the License. The rights granted to you under the | |
10 | * License may not be used to create, or enable the creation or | |
11 | * redistribution of, unlawful or unlicensed copies of an Apple operating | |
12 | * system, or to circumvent, violate, or enable the circumvention or | |
13 | * violation of, any terms of an Apple operating system software license | |
14 | * agreement. | |
15 | * | |
16 | * Please obtain a copy of the License at | |
17 | * http://www.opensource.apple.com/apsl/ and read it before using this | |
18 | * file. | |
19 | * | |
20 | * The Original Code and all software distributed under the License are | |
21 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
22 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | |
23 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
24 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | |
25 | * Please see the License for the specific language governing rights and | |
26 | * limitations under the License. | |
27 | * | |
28 | * @APPLE_LICENSE_OSREFERENCE_HEADER_END@ | |
1c79356b A |
29 | */ |
30 | /* | |
31 | * @OSF_COPYRIGHT@ | |
32 | */ | |
33 | /* | |
34 | * @APPLE_FREE_COPYRIGHT@ | |
35 | */ | |
36 | ||
37 | ||
38 | #include <device/device_types.h> | |
39 | #include <mach_kdp.h> | |
40 | ||
41 | /* | |
42 | * Console is on the Printer Port (chip channel 0) | |
43 | * Debugger is on the Modem Port (chip channel 1) | |
44 | */ | |
45 | ||
46 | #define CONSOLE_PORT 1 | |
47 | ||
48 | struct scc_tty { | |
49 | char * t_addr; /* device pointer */ | |
50 | int t_dev; /* device number */ | |
51 | int t_ispeed; /* input speed */ | |
52 | int t_ospeed; /* output speed */ | |
53 | char t_breakc; /* character to deliver when 'break' | |
54 | condition received */ | |
55 | int t_flags; /* mode flags */ | |
56 | int t_state; /* current state */ | |
57 | int t_line; /* fake line discipline number, | |
58 | for old drivers - always 0 */ | |
59 | int t_outofband; /* current out-of-band events */ | |
60 | int t_outofbandarg; /* arg to first out-of-band event */ | |
61 | int t_nquoted; /* number of quoted chars in inq */ | |
62 | int t_hiwater; /* baud-rate limited high water mark */ | |
63 | int t_lowater; /* baud-rate limited low water mark */ | |
64 | }; | |
65 | typedef struct scc_tty *scc_tty_t; | |
66 | ||
67 | /* | |
68 | * function declarations for performing serial i/o | |
69 | * other functions below are declared in kern/misc_protos.h | |
70 | * cnputc, cngetc, cnmaygetc | |
71 | */ | |
72 | ||
91447636 | 73 | void initialize_serial(caddr_t scc_phys_base, int32_t serial_baud); |
1c79356b | 74 | |
91447636 | 75 | extern int scc_probe(int32_t serial_baud); |
1c79356b A |
76 | |
77 | #if 0 | |
78 | extern int scc_open( | |
79 | dev_t dev, | |
80 | dev_mode_t flag, | |
81 | io_req_t ior); | |
82 | ||
83 | extern void scc_close( | |
84 | dev_t dev); | |
85 | ||
86 | extern int scc_read( | |
87 | dev_t dev, | |
88 | io_req_t ior); | |
89 | ||
90 | extern io_return_t scc_write( | |
91 | dev_t dev, | |
92 | io_req_t ior); | |
93 | ||
94 | extern io_return_t scc_get_status( | |
95 | dev_t dev, | |
96 | dev_flavor_t flavor, | |
97 | dev_status_t data, | |
98 | mach_msg_type_number_t *status_count); | |
99 | ||
100 | extern io_return_t scc_set_status( | |
101 | dev_t dev, | |
102 | dev_flavor_t flavor, | |
103 | dev_status_t data, | |
104 | mach_msg_type_number_t status_count); | |
105 | ||
106 | extern boolean_t scc_portdeath( | |
107 | dev_t dev, | |
108 | ipc_port_t port); | |
109 | ||
110 | #endif /* 0 */ | |
111 | ||
112 | extern int scc_putc( | |
113 | int unit, | |
114 | int line, | |
115 | int c); | |
116 | ||
117 | extern int scc_getc( | |
118 | int unit, | |
119 | int line, | |
120 | boolean_t wait, | |
121 | boolean_t raw); | |
122 | ||
55e303ae | 123 | |
1c79356b | 124 | |
de355530 A |
125 | /* |
126 | * JMM - We are not really going to support this driver in SMP (barely | |
127 | * support it now - so just pick up the stubbed out versions. | |
128 | */ | |
129 | #define DECL_FUNNEL(class,f) | |
130 | #define DECL_FUNNEL_VARS | |
131 | #define FUNNEL_INIT(f,p) | |
132 | #define FUNNEL_ENTER(f) | |
133 | #define FUNNEL_EXIT(f) | |
134 | #define FUNNEL_ESCAPE(f) (1) | |
135 | #define FUNNEL_REENTER(f,count) | |
136 | #define FUNNEL_IN_USE(f) (TRUE) | |
1c79356b A |
137 | |
138 | /* | |
139 | * Flags | |
140 | */ | |
141 | #define TF_ODDP 0x00000002 /* get/send odd parity */ | |
142 | #define TF_EVENP 0x00000004 /* get/send even parity */ | |
143 | #define TF_ANYP (TF_ODDP|TF_EVENP) | |
144 | /* get any parity/send none */ | |
145 | #define TF_LITOUT 0x00000008 /* output all 8 bits | |
146 | otherwise, characters >= 0x80 | |
147 | are time delays XXX */ | |
148 | #define TF_ECHO 0x00000080 /* device wants user to echo input */ | |
149 | #define TS_MIN 0x00004000 /* buffer input chars, if possible */ |