Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / release / picobsd / mfs_tree / etc / rc.serial
1 #!/bin/sh
2 # $FreeBSD: src/release/picobsd/mfs_tree/etc/rc.serial,v 1.1.2.1 2001/02/14 23:47:02 luigi Exp $
3 # $DragonFly: src/release/picobsd/mfs_tree/etc/Attic/rc.serial,v 1.2 2003/06/17 04:27:20 dillon Exp $
4
5 # Change some defaults for serial devices.
6 # Standard defaults are:
7 #       dtrwait 300 drainwait 0
8 #       initial cflag from <sys/ttydefaults.h> = cread cs8 hupcl
9 #       initial iflag, lflag and oflag all 0
10 #       speed 9600
11 #       special chars from <sys/ttydefaults.h>
12 #       nothing locked
13 # except for serial consoles the initial iflag, lflag and oflag are from
14 # <sys/ttydefaults.h> and clocal is locked on.
15
16 default() {
17         # Reset everything changed by the other functions to initial defaults.
18
19         ci=$1; shift    # call in device identifier
20         co=$1; shift    # call out device identifier
21
22         for i in $*
23         do
24                 comcontrol /dev/tty$ci$i dtrwait 300 drainwait 0
25                 stty </dev/ttyi$ci$i -clocal  crtscts  hupcl 9600 reprint ^R
26                 stty </dev/ttyl$ci$i -clocal -crtscts -hupcl 0
27                 stty </dev/cuai$co$i -clocal  crtscts  hupcl 9600 reprint ^R
28                 stty </dev/cual$co$i -clocal -crtscts -hupcl 0
29         done
30 }
31
32 maybe() {
33         # Special settings.
34
35         ci=$1; shift
36         co=$1; shift
37
38         for i in $*
39         do
40                 # Don't use ^R; it breaks bash's ^R when typed ahead.
41                 stty </dev/ttyi$ci$i reprint undef
42                 stty </dev/cuai$co$i reprint undef
43                 # Lock clocal off on dialin device for security.
44                 stty </dev/ttyl$ci$i clocal
45                 # Lock the speeds to use old binaries that don't support them.
46                 # Any legal speed works to lock the initial speed.
47                 stty </dev/ttyl$ci$i 300
48                 stty </dev/cual$co$i 300
49         done
50 }
51
52 modem() {
53         # Modem that supports CTS and perhaps RTS handshaking.
54
55         ci=$1; shift
56         co=$1; shift
57
58         for i in $*
59         do
60                 # may depend on modem
61                 comcontrol /dev/tty$ci$i dtrwait 100 drainwait 180
62                 # Lock crtscts on.
63                 # Speed reasonable for V42bis.
64                 stty </dev/ttyi$ci$i crtscts 57600
65                 stty </dev/ttyl$ci$i crtscts
66                 stty </dev/cuai$co$i crtscts 57600
67                 stty </dev/cual$co$i crtscts
68         done
69 }
70
71 mouse() {
72         # Mouse on either callin or callout port.
73
74         ci=$1; shift
75         co=$1; shift
76
77         for i in $*
78         do
79                 # Lock clocal on, hupcl off.
80                 # Standard speed for Microsoft mouse.
81                 stty </dev/ttyi$ci$i clocal -hupcl 1200
82                 stty </dev/ttyl$ci$i clocal  hupcl
83                 stty </dev/cuai$co$i clocal -hupcl 1200
84                 stty </dev/cual$co$i clocal  hupcl
85         done
86 }
87
88 terminal() {
89         # Terminal that supports CTS and perhaps RTS handshaking
90         # with the cable or terminal arranged so that DCD is on
91         # at least while the terminal is on.
92         # Also works for bidirectional communications to another pc
93         # provided at most one side runs getty.
94         # Same as modem() except we want a faster speed and no dtrwait.
95
96         ci=$1; shift
97         co=$1; shift
98
99         modem $ci $co $*
100         for i in $*
101         do
102                 comcontrol /dev/tty$ci$i dtrwait 0
103                 stty </dev/ttyi$ci$i 115200
104                 stty </dev/cuai$co$i 115200
105         done
106 }
107
108 # Don't use anything from this file unless you have some buggy programs
109 # that require it.
110
111 # Edit the functions and the examples to suit your system.
112 # $1 is the call in device identifier, $2 is the call out device identifier
113 # and the remainder of the line lists the device numbers.
114
115 # Initialize assorted 8250-16550 (sio) ports.
116 # maybe    d a  0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v
117 # mouse    d a      2
118 # modem    d a    1
119 # terminal d a  0
120
121 # Initialize all ports on a Cyclades-8yo.
122 # modem    c c  00 01 02 03 04 05 06 07
123
124 # Initialize all ports on a Cyclades-16ye.
125 # modem    c c  00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 
126
127 # Initialize all ports on a Digiboard 8.
128 # modem    D D  00 01 02 03 04 05 06 07