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 struct commulti_attach_args {
36 int ca_slave;
37
38 bus_space_tag_t ca_iot;
39 bus_space_handle_t ca_ioh;
40 int ca_iobase;
41 int ca_noien;
42 };
43
44 struct com_softc {
45 struct device sc_dev;
46 void *sc_ih;
47 bus_space_tag_t sc_iot;
48 struct tty *sc_tty;
49 struct timeout sc_dtr_tmo;
50 struct timeout sc_diag_tmo;
51
52 int sc_overflows;
53 int sc_floods;
54 int sc_errors;
55
56 int sc_halt;
57
58 int sc_iobase;
59 int sc_frequency;
60
61 bus_space_handle_t sc_ioh;
62 bus_space_handle_t sc_hayespioh;
63
64 u_char sc_uarttype;
65 #define COM_UART_UNKNOWN 0x00
66 #define COM_UART_8250 0x01
67 #define COM_UART_16450 0x02
68 #define COM_UART_16550 0x03
69 #define COM_UART_16550A 0x04
70 #define COM_UART_ST16650 0x05
71 #define COM_UART_ST16650V2 0x06
72 #define COM_UART_TI16750 0x07
73 #define COM_UART_ST16C654 0x08
74 #define COM_UART_XR16850 0x10
75 #define COM_UART_OX16C950 0x12
76 u_char sc_uartrev;
77
78 u_char sc_hwflags;
79 #define COM_HW_NOIEN 0x01
80 #define COM_HW_FIFO 0x02
81 #define COM_HW_CONSOLE 0x40
82 #define COM_HW_KGDB 0x80
83 u_char sc_swflags;
84 #define COM_SW_SOFTCAR 0x01
85 #define COM_SW_CLOCAL 0x02
86 #define COM_SW_CRTSCTS 0x04
87 #define COM_SW_MDMBUF 0x08
88 int sc_fifolen;
89 u_char sc_msr, sc_mcr, sc_lcr, sc_ier;
90 u_char sc_dtr;
91
92 u_char sc_cua;
93
94 u_char sc_initialize;
95
96 #define RBUFSIZE 512
97 #define RBUFMASK 511
98 u_int sc_rxget;
99 volatile u_int sc_rxput;
100 u_char sc_rxbuf[RBUFSIZE];
101 u_char *sc_tba;
102 int sc_tbc;
103
104
105 int (*enable)(struct com_softc *);
106 void (*disable)(struct com_softc *);
107 int enabled;
108 };
109
110 int comprobe1(bus_space_tag_t, bus_space_handle_t);
111 void cominit(bus_space_tag_t, bus_space_handle_t, int);
112 int comstop(struct tty *, int);
113 int comintr(void *);
114 int com_detach(struct device *, int);
115 int com_activate(struct device *, enum devact);
116
117 void comdiag(void *);
118 int comspeed(long, long);
119 int comparam(struct tty *, struct termios *);
120 void comstart(struct tty *);
121 void comsoft(void);
122 int comhwiflow(struct tty *, int);
123 void com_raisedtr(void *);
124
125 struct consdev;
126 void comcnprobe(struct consdev *);
127 void comcninit(struct consdev *);
128 int comcngetc(dev_t);
129 void comcnputc(dev_t, int);
130 void comcnpollc(dev_t, int);
131 int com_common_getc(bus_space_tag_t, bus_space_handle_t);
132 void com_common_putc(bus_space_tag_t, bus_space_handle_t, int);
133
134 #if defined(DDB) || defined(KGDB)
135 void com_enable_debugport(struct com_softc *);
136 #endif
137
138 #ifdef KGDB
139 extern bus_space_tag_t com_kgdb_iot;
140 extern bus_addr_t com_kgdb_addr;
141
142 int com_kgdb_attach(bus_space_tag_t, bus_addr_t, int, int, tcflag_t);
143 int kgdbintr(void *);
144 #endif
145
146 void com_attach_subr(struct com_softc *);
147
148 extern bus_addr_t comconsaddr;
149 extern int comconsinit;
150 extern int comconsattached;
151 extern bus_space_tag_t comconsiot;
152 extern bus_space_handle_t comconsioh;
153 extern tcflag_t comconscflag;