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