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 #ifndef _DEV_IC_PCKBCVAR_H_
31 #define _DEV_IC_PCKBCVAR_H_
32
33 #include <sys/timeout.h>
34
35 #define PCKBCCF_SLOT 0
36 #define PCKBCCF_SLOT_DEFAULT -1
37
38 typedef void *pckbc_tag_t;
39 typedef int pckbc_slot_t;
40 #define PCKBC_KBD_SLOT 0
41 #define PCKBC_AUX_SLOT 1
42 #define PCKBC_NSLOTS 2
43
44
45
46
47
48 struct pckbc_internal {
49 bus_space_tag_t t_iot;
50 bus_space_handle_t t_ioh_d, t_ioh_c;
51 bus_addr_t t_addr;
52 u_char t_cmdbyte;
53
54 int t_haveaux;
55 struct pckbc_slotdata *t_slotdata[PCKBC_NSLOTS];
56
57 struct pckbc_softc *t_sc;
58
59 struct timeout t_cleanup;
60 struct timeout t_poll;
61 };
62
63 typedef void (*pckbc_inputfcn)(void *, int);
64
65
66
67
68 struct pckbc_softc {
69 struct device sc_dv;
70 struct pckbc_internal *id;
71
72 pckbc_inputfcn inputhandler[PCKBC_NSLOTS];
73 void *inputarg[PCKBC_NSLOTS];
74 char *subname[PCKBC_NSLOTS];
75
76 void (*intr_establish)(struct pckbc_softc *, pckbc_slot_t);
77 };
78
79 struct pckbc_attach_args {
80 pckbc_tag_t pa_tag;
81 pckbc_slot_t pa_slot;
82 };
83
84 extern const char *pckbc_slot_names[];
85 extern struct pckbc_internal pckbc_consdata;
86 extern int pckbc_console_attached;
87
88 void pckbc_set_inputhandler(pckbc_tag_t, pckbc_slot_t,
89 pckbc_inputfcn, void *, char *);
90
91 void pckbc_flush(pckbc_tag_t, pckbc_slot_t);
92 int pckbc_poll_cmd(pckbc_tag_t, pckbc_slot_t, u_char *, int,
93 int, u_char *, int);
94 int pckbc_enqueue_cmd(pckbc_tag_t, pckbc_slot_t, u_char *, int,
95 int, int, u_char *);
96 int pckbc_send_cmd(bus_space_tag_t, bus_space_handle_t, u_char);
97 int pckbc_poll_data(pckbc_tag_t, pckbc_slot_t);
98 int pckbc_poll_data1(bus_space_tag_t, bus_space_handle_t,
99 bus_space_handle_t, pckbc_slot_t, int);
100 void pckbc_set_poll(pckbc_tag_t, pckbc_slot_t, int);
101 int pckbc_xt_translation(pckbc_tag_t, pckbc_slot_t, int);
102 void pckbc_slot_enable(pckbc_tag_t, pckbc_slot_t, int);
103
104 void pckbc_attach(struct pckbc_softc *);
105 int pckbc_cnattach(bus_space_tag_t, bus_addr_t, bus_size_t,
106 pckbc_slot_t);
107 int pckbc_is_console(bus_space_tag_t, bus_addr_t);
108 int pckbcintr(void *);
109
110 #endif