kbd_pckbport.c revision 1.4 1 1.4 tsutsui /* $NetBSD: kbd_pckbport.c,v 1.4 2008/04/07 13:31:15 tsutsui Exp $ */
2 1.1 bjh21
3 1.1 bjh21 /*
4 1.1 bjh21 * Copyright (c) 2002 Valeriy E. Ushakov
5 1.1 bjh21 * All rights reserved.
6 1.1 bjh21 *
7 1.1 bjh21 * Redistribution and use in source and binary forms, with or without
8 1.1 bjh21 * modification, are permitted provided that the following conditions
9 1.1 bjh21 * are met:
10 1.1 bjh21 * 1. Redistributions of source code must retain the above copyright
11 1.1 bjh21 * notice, this list of conditions and the following disclaimer.
12 1.1 bjh21 * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 bjh21 * notice, this list of conditions and the following disclaimer in the
14 1.1 bjh21 * documentation and/or other materials provided with the distribution.
15 1.1 bjh21 * 3. The name of the author may not be used to endorse or promote products
16 1.1 bjh21 * derived from this software without specific prior written permission
17 1.1 bjh21 *
18 1.1 bjh21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 1.1 bjh21 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 1.1 bjh21 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 1.1 bjh21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 1.1 bjh21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 1.1 bjh21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 1.1 bjh21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 1.1 bjh21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 1.1 bjh21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 1.1 bjh21 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 1.1 bjh21 */
29 1.1 bjh21
30 1.1 bjh21 /*-
31 1.1 bjh21 * Copyright (c) 1998 The NetBSD Foundation, Inc.
32 1.1 bjh21 * All rights reserved.
33 1.1 bjh21 *
34 1.1 bjh21 * This code is derived from software contributed to The NetBSD Foundation
35 1.1 bjh21 * by Charles M. Hannum.
36 1.1 bjh21 *
37 1.1 bjh21 * Redistribution and use in source and binary forms, with or without
38 1.1 bjh21 * modification, are permitted provided that the following conditions
39 1.1 bjh21 * are met:
40 1.1 bjh21 * 1. Redistributions of source code must retain the above copyright
41 1.1 bjh21 * notice, this list of conditions and the following disclaimer.
42 1.1 bjh21 * 2. Redistributions in binary form must reproduce the above copyright
43 1.1 bjh21 * notice, this list of conditions and the following disclaimer in the
44 1.1 bjh21 * documentation and/or other materials provided with the distribution.
45 1.1 bjh21 * 3. All advertising materials mentioning features or use of this software
46 1.1 bjh21 * must display the following acknowledgement:
47 1.1 bjh21 * This product includes software developed by the NetBSD
48 1.1 bjh21 * Foundation, Inc. and its contributors.
49 1.1 bjh21 * 4. Neither the name of The NetBSD Foundation nor the names of its
50 1.1 bjh21 * contributors may be used to endorse or promote products derived
51 1.1 bjh21 * from this software without specific prior written permission.
52 1.1 bjh21 *
53 1.1 bjh21 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
54 1.1 bjh21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
55 1.1 bjh21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
56 1.1 bjh21 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
57 1.1 bjh21 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
58 1.1 bjh21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
59 1.1 bjh21 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
60 1.1 bjh21 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
61 1.1 bjh21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
62 1.1 bjh21 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
63 1.1 bjh21 * POSSIBILITY OF SUCH DAMAGE.
64 1.1 bjh21 */
65 1.1 bjh21
66 1.1 bjh21 /*-
67 1.1 bjh21 * Copyright (c) 1990 The Regents of the University of California.
68 1.1 bjh21 * All rights reserved.
69 1.1 bjh21 *
70 1.1 bjh21 * This code is derived from software contributed to Berkeley by
71 1.1 bjh21 * William Jolitz and Don Ahn.
72 1.1 bjh21 *
73 1.1 bjh21 * Redistribution and use in source and binary forms, with or without
74 1.1 bjh21 * modification, are permitted provided that the following conditions
75 1.1 bjh21 * are met:
76 1.1 bjh21 * 1. Redistributions of source code must retain the above copyright
77 1.1 bjh21 * notice, this list of conditions and the following disclaimer.
78 1.1 bjh21 * 2. Redistributions in binary form must reproduce the above copyright
79 1.1 bjh21 * notice, this list of conditions and the following disclaimer in the
80 1.1 bjh21 * documentation and/or other materials provided with the distribution.
81 1.1 bjh21 * 3. Neither the name of the University nor the names of its contributors
82 1.1 bjh21 * may be used to endorse or promote products derived from this software
83 1.1 bjh21 * without specific prior written permission.
84 1.1 bjh21 *
85 1.1 bjh21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
86 1.1 bjh21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
87 1.1 bjh21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
88 1.1 bjh21 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
89 1.1 bjh21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
90 1.1 bjh21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
91 1.1 bjh21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
92 1.1 bjh21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
93 1.1 bjh21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
94 1.1 bjh21 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
95 1.1 bjh21 * SUCH DAMAGE.
96 1.1 bjh21 *
97 1.1 bjh21 * @(#)pccons.c 5.11 (Berkeley) 5/21/91
98 1.1 bjh21 */
99 1.1 bjh21 #include <sys/cdefs.h>
100 1.4 tsutsui __KERNEL_RCSID(0, "$NetBSD: kbd_pckbport.c,v 1.4 2008/04/07 13:31:15 tsutsui Exp $");
101 1.1 bjh21
102 1.1 bjh21 /*
103 1.1 bjh21 * Serve JavaStation-1 PS/2 keyboard as a Type5 keyboard with US101A
104 1.1 bjh21 * layout. Since stock Xsun(1) knows this layout, JavaStation-1 gets
105 1.1 bjh21 * X for free. When sparc port is switched to wscons and its X server
106 1.1 bjh21 * knows how to talk wskbd, this driver will no longer be necessary,
107 1.1 bjh21 * and we will be able to attach the keyboard with the MI pckbport(4) driver.
108 1.1 bjh21 */
109 1.1 bjh21
110 1.1 bjh21 #include <sys/param.h>
111 1.1 bjh21 #include <sys/systm.h>
112 1.1 bjh21 #include <sys/conf.h>
113 1.1 bjh21 #include <sys/device.h>
114 1.1 bjh21 #include <sys/kernel.h>
115 1.1 bjh21 #include <sys/select.h>
116 1.1 bjh21
117 1.1 bjh21 #include <machine/autoconf.h>
118 1.1 bjh21 #include <machine/bus.h>
119 1.1 bjh21 #include <machine/intr.h>
120 1.1 bjh21
121 1.1 bjh21 #include <dev/sun/kbd_reg.h>
122 1.1 bjh21 #include <dev/sun/kbio.h>
123 1.1 bjh21
124 1.1 bjh21 #include <dev/pckbport/pckbdreg.h>
125 1.1 bjh21 #include <dev/pckbport/pckbportvar.h>
126 1.1 bjh21
127 1.1 bjh21 #include <dev/sun/event_var.h>
128 1.1 bjh21 #include <dev/sun/kbd_xlate.h>
129 1.1 bjh21 #include <dev/sun/kbdvar.h>
130 1.1 bjh21
131 1.1 bjh21 #define DPRINTF(args) /* printf args */
132 1.1 bjh21
133 1.1 bjh21
134 1.1 bjh21 struct kbd_pckbport_softc {
135 1.1 bjh21 struct kbd_softc sc_kbd;
136 1.1 bjh21
137 1.1 bjh21 /* pckbport attachment */
138 1.1 bjh21 pckbport_tag_t sc_kbctag;
139 1.1 bjh21 pckbport_slot_t sc_kbcslot;
140 1.1 bjh21
141 1.1 bjh21 /*
142 1.1 bjh21 * Middle layer data.
143 1.3 uwe */
144 1.1 bjh21 int sc_isopen;
145 1.1 bjh21 int sc_pcleds;
146 1.1 bjh21
147 1.1 bjh21 /* xt scan-codes decoding */
148 1.1 bjh21 int sc_lastchar;
149 1.1 bjh21 int sc_extended;
150 1.1 bjh21 int sc_extended1;
151 1.1 bjh21 };
152 1.1 bjh21
153 1.4 tsutsui static int kbd_pckbport_match(device_t, cfdata_t, void *);
154 1.4 tsutsui static void kbd_pckbport_attach(device_t, device_t, void *);
155 1.1 bjh21
156 1.4 tsutsui CFATTACH_DECL_NEW(kbd_pckbport, sizeof(struct kbd_pckbport_softc),
157 1.1 bjh21 kbd_pckbport_match, kbd_pckbport_attach, NULL, NULL);
158 1.1 bjh21
159 1.1 bjh21
160 1.1 bjh21 /*
161 1.1 bjh21 * Middle layer.
162 1.1 bjh21 */
163 1.1 bjh21
164 1.1 bjh21 /* callbacks for the upper /dev/kbd layer */
165 1.1 bjh21 static int kbd_pckbport_open(struct kbd_softc *);
166 1.1 bjh21 static int kbd_pckbport_close(struct kbd_softc *);
167 1.1 bjh21 static int kbd_pckbport_do_cmd(struct kbd_softc *, int, int);
168 1.1 bjh21 static int kbd_pckbport_set_leds(struct kbd_softc *, int, int);
169 1.1 bjh21
170 1.1 bjh21 static const struct kbd_ops kbd_ops_pckbport = {
171 1.1 bjh21 kbd_pckbport_open,
172 1.1 bjh21 kbd_pckbport_close,
173 1.1 bjh21 kbd_pckbport_do_cmd,
174 1.1 bjh21 kbd_pckbport_set_leds
175 1.1 bjh21 };
176 1.1 bjh21
177 1.1 bjh21
178 1.3 uwe static const uint8_t kbd_pckbport_xt_to_sun[];
179 1.1 bjh21
180 1.1 bjh21 static int kbd_pckbport_set_xtscancode(pckbport_tag_t, pckbport_slot_t);
181 1.1 bjh21 static void kbd_pckbport_input(void *, int);
182 1.1 bjh21 static int kbd_pckbport_decode(struct kbd_pckbport_softc *, int, int *);
183 1.1 bjh21
184 1.1 bjh21
185 1.1 bjh21 /*********************************************************************
186 1.1 bjh21 * Autoconfiguration
187 1.1 bjh21 */
188 1.1 bjh21
189 1.3 uwe static int
190 1.4 tsutsui kbd_pckbport_match(device_t parent, cfdata_t cf, void *aux)
191 1.1 bjh21 {
192 1.1 bjh21 struct pckbport_attach_args *pa = aux;
193 1.1 bjh21
194 1.1 bjh21 if (pa->pa_slot != PCKBPORT_KBD_SLOT)
195 1.1 bjh21 return (0);
196 1.1 bjh21
197 1.1 bjh21 return (1);
198 1.1 bjh21 }
199 1.1 bjh21
200 1.1 bjh21
201 1.3 uwe static void
202 1.4 tsutsui kbd_pckbport_attach(device_t parent, device_t self, void *aux)
203 1.1 bjh21 {
204 1.4 tsutsui struct kbd_pckbport_softc *sc = device_private(self);
205 1.1 bjh21 struct pckbport_attach_args *pa = aux;
206 1.1 bjh21 struct kbd_softc *kbd = &sc->sc_kbd;
207 1.1 bjh21
208 1.1 bjh21 /* save our attachment to pckbport */
209 1.1 bjh21 sc->sc_kbctag = pa->pa_tag;
210 1.1 bjh21 sc->sc_kbcslot = pa->pa_slot;
211 1.1 bjh21
212 1.1 bjh21 /* provide upper layer a link to our middle layer */
213 1.4 tsutsui kbd->k_dev = self;
214 1.1 bjh21 kbd->k_ops = &kbd_ops_pckbport;
215 1.1 bjh21
216 1.1 bjh21 /* pre-fill keyboard type/layout */
217 1.1 bjh21 kbd->k_state.kbd_id = KB_SUN4; /* NB: type5 keyboards actually report type4 */
218 1.1 bjh21 kbd->k_state.kbd_layout = 19; /* US101A */
219 1.1 bjh21
220 1.1 bjh21 if (1) { /* XXX: pckbport_machdep_cnattach should tell us */
221 1.1 bjh21 /*
222 1.1 bjh21 * Hookup ourselves as the console input channel
223 1.1 bjh21 */
224 1.1 bjh21 extern void kd_attach_input(struct cons_channel *);
225 1.1 bjh21 struct cons_channel *cc;
226 1.1 bjh21
227 1.1 bjh21 if ((cc = kbd_cc_alloc(kbd)) == NULL)
228 1.1 bjh21 return;
229 1.1 bjh21
230 1.1 bjh21 kd_attach_input(cc); /* XXX ???? */
231 1.1 bjh21 kbd->k_isconsole = 1;
232 1.4 tsutsui aprint_normal(": console input");
233 1.1 bjh21 }
234 1.1 bjh21
235 1.4 tsutsui aprint_normal("\n");
236 1.1 bjh21
237 1.1 bjh21 kbd_pckbport_set_xtscancode(sc->sc_kbctag, sc->sc_kbcslot);
238 1.1 bjh21
239 1.1 bjh21 /* slow down typematic (can't disable, grrr) */
240 1.1 bjh21 {
241 1.1 bjh21 u_char cmd[2];
242 1.1 bjh21 int res;
243 1.1 bjh21
244 1.1 bjh21 cmd[0] = KBC_TYPEMATIC;
245 1.1 bjh21 cmd[1] = 0x7f; /* 1s, 2/s */
246 1.1 bjh21 res = pckbport_poll_cmd(sc->sc_kbctag, sc->sc_kbcslot,
247 1.1 bjh21 cmd, 2, 0, NULL, 0);
248 1.1 bjh21 if (res) {
249 1.4 tsutsui aprint_error_dev(self,
250 1.4 tsutsui "set typematic failed, error %d\n", res);
251 1.1 bjh21 }
252 1.1 bjh21 }
253 1.1 bjh21
254 1.1 bjh21 /* register our callback with pckbport interrupt handler */
255 1.1 bjh21 pckbport_set_inputhandler(sc->sc_kbctag, sc->sc_kbcslot,
256 1.4 tsutsui kbd_pckbport_input, sc, device_xname(self));
257 1.1 bjh21 }
258 1.1 bjh21
259 1.1 bjh21
260 1.1 bjh21 static int
261 1.3 uwe kbd_pckbport_set_xtscancode(pckbport_tag_t kbctag, pckbport_slot_t kbcslot)
262 1.1 bjh21 {
263 1.1 bjh21 u_char cmd[2];
264 1.1 bjh21 int res;
265 1.1 bjh21
266 1.1 bjh21 /*
267 1.1 bjh21 * Some keyboard/8042 combinations do not seem to work if the keyboard
268 1.1 bjh21 * is set to table 1; in fact, it would appear that some keyboards just
269 1.1 bjh21 * ignore the command altogether. So by default, we use the AT scan
270 1.1 bjh21 * codes and have the 8042 translate them. Unfortunately, this is
271 1.1 bjh21 * known to not work on some PS/2 machines. We try desparately to deal
272 1.1 bjh21 * with this by checking the (lack of a) translate bit in the 8042 and
273 1.1 bjh21 * attempting to set the keyboard to XT mode. If this all fails, well,
274 1.1 bjh21 * tough luck.
275 1.1 bjh21 *
276 1.1 bjh21 * XXX It would perhaps be a better choice to just use AT scan codes
277 1.1 bjh21 * and not bother with this.
278 1.1 bjh21 */
279 1.1 bjh21 if (pckbport_xt_translation(kbctag, kbcslot, 1)) {
280 1.1 bjh21 /* The 8042 is translating for us; use AT codes. */
281 1.1 bjh21 cmd[0] = KBC_SETTABLE;
282 1.1 bjh21 cmd[1] = 2;
283 1.1 bjh21 res = pckbport_poll_cmd(kbctag, kbcslot, cmd, 2, 0, 0, 0);
284 1.1 bjh21 if (res) {
285 1.2 jmc u_char resetcmd[1];
286 1.1 bjh21 #ifdef DEBUG
287 1.1 bjh21 printf("pckbd: error setting scanset 2\n");
288 1.1 bjh21 #endif
289 1.1 bjh21 /*
290 1.1 bjh21 * XXX at least one keyboard is reported to lock up
291 1.1 bjh21 * if a "set table" is attempted, thus the "reset".
292 1.1 bjh21 * XXX ignore errors, scanset 2 should be
293 1.1 bjh21 * default anyway.
294 1.1 bjh21 */
295 1.2 jmc resetcmd[0] = KBC_RESET;
296 1.3 uwe (void)pckbport_poll_cmd(kbctag, kbcslot, resetcmd,
297 1.2 jmc 1, 1, 0, 1);
298 1.1 bjh21 pckbport_flush(kbctag, kbcslot);
299 1.1 bjh21 res = 0;
300 1.1 bjh21 }
301 1.1 bjh21 } else {
302 1.1 bjh21 /* Stupid 8042; set keyboard to XT codes. */
303 1.1 bjh21 cmd[0] = KBC_SETTABLE;
304 1.1 bjh21 cmd[1] = 1;
305 1.1 bjh21 res = pckbport_poll_cmd(kbctag, kbcslot, cmd, 2, 0, 0, 0);
306 1.1 bjh21 #ifdef DEBUG
307 1.1 bjh21 if (res)
308 1.1 bjh21 printf("pckbd: error setting scanset 1\n");
309 1.1 bjh21 #endif
310 1.1 bjh21 }
311 1.1 bjh21 return (res);
312 1.1 bjh21 }
313 1.1 bjh21
314 1.1 bjh21
315 1.1 bjh21 /*********************************************************************
316 1.1 bjh21 * /dev/kbd middle layer
317 1.1 bjh21 */
318 1.1 bjh21
319 1.1 bjh21 /*
320 1.1 bjh21 * Initialization to be done at first open.
321 1.1 bjh21 * This is called from kbdopen() or kd_cc_open()
322 1.1 bjh21 * Called with user context.
323 1.1 bjh21 */
324 1.1 bjh21 static int
325 1.3 uwe kbd_pckbport_open(struct kbd_softc *kbd)
326 1.1 bjh21 {
327 1.1 bjh21 struct kbd_pckbport_softc *sc = (struct kbd_pckbport_softc *)kbd;
328 1.1 bjh21 struct kbd_state *ks;
329 1.1 bjh21 int error = 0;
330 1.1 bjh21
331 1.1 bjh21 if (kbd == NULL) {
332 1.1 bjh21 DPRINTF(("kbd_pckbport_open: kbd == NULL\n"));
333 1.1 bjh21 return (ENXIO);
334 1.1 bjh21 }
335 1.1 bjh21
336 1.1 bjh21 ks = &kbd->k_state;
337 1.1 bjh21
338 1.1 bjh21 /* tolerate extra calls */
339 1.1 bjh21 if (sc->sc_isopen)
340 1.1 bjh21 return (0);
341 1.1 bjh21
342 1.1 bjh21 /* open internal device */
343 1.1 bjh21
344 1.1 bjh21 /* reset the keyboard (and enable interrupts?) */
345 1.1 bjh21
346 1.1 bjh21 /*
347 1.1 bjh21 * Initialize the table pointers for this type/layout.
348 1.1 bjh21 * NB: fixed type/layout were preset during attach.
349 1.1 bjh21 */
350 1.1 bjh21 kbd_xlate_init(ks);
351 1.1 bjh21
352 1.1 bjh21 if (error == 0)
353 1.1 bjh21 sc->sc_isopen = 1;
354 1.1 bjh21 return (error);
355 1.1 bjh21 }
356 1.1 bjh21
357 1.1 bjh21
358 1.1 bjh21 static int
359 1.3 uwe kbd_pckbport_close(struct kbd_softc *kbd)
360 1.1 bjh21 {
361 1.1 bjh21 #if 0
362 1.1 bjh21 struct kbd_pckbport_softc *k = (struct kbd_pckbport_softc *)kbd;
363 1.1 bjh21 #endif
364 1.1 bjh21 return (0); /* nothing to do so far */
365 1.1 bjh21 }
366 1.1 bjh21
367 1.1 bjh21
368 1.1 bjh21 /*
369 1.1 bjh21 * Upper layer talks sun keyboard protocol to us.
370 1.1 bjh21 */
371 1.1 bjh21 /* ARGSUSED2 */
372 1.1 bjh21 static int
373 1.3 uwe kbd_pckbport_do_cmd(struct kbd_softc *kbd, int suncmd, int isioctl)
374 1.1 bjh21 {
375 1.1 bjh21 int error = 0;
376 1.1 bjh21
377 1.1 bjh21 switch (suncmd) {
378 1.1 bjh21
379 1.1 bjh21 case KBD_CMD_BELL: /* FALLTHROUGH */
380 1.1 bjh21 case KBD_CMD_NOBELL: /* FALLTHROUGH */
381 1.1 bjh21 case KBD_CMD_CLICK: /* FALLTHROUGH */
382 1.1 bjh21 case KBD_CMD_NOCLICK:
383 1.1 bjh21 /* not supported, do nothing */
384 1.1 bjh21 DPRINTF(("%s: ignoring KIOCCMD 0x%02x\n",
385 1.4 tsutsui device_xname(kbd->k_dev), suncmd));
386 1.1 bjh21 break;
387 1.1 bjh21
388 1.1 bjh21 default:
389 1.1 bjh21 error = EINVAL;
390 1.1 bjh21 break;
391 1.1 bjh21 }
392 1.1 bjh21
393 1.1 bjh21 return (error);
394 1.1 bjh21 }
395 1.1 bjh21
396 1.1 bjh21 /* ARGSUSED2 */
397 1.1 bjh21 static int
398 1.3 uwe kbd_pckbport_set_leds(struct kbd_softc *kbd, int sunleds, int isioctl)
399 1.1 bjh21 {
400 1.1 bjh21 struct kbd_pckbport_softc *sc = (struct kbd_pckbport_softc *)kbd;
401 1.1 bjh21 u_char pcleds;
402 1.1 bjh21 u_char cmd[2];
403 1.1 bjh21 int res;
404 1.1 bjh21
405 1.1 bjh21 /* re-encode sun leds into pckbd leds */
406 1.1 bjh21 /* pckbd: 0 - scroll; 1 - num; 2 - caps */
407 1.1 bjh21 pcleds = 0;
408 1.1 bjh21 if (sunleds & LED_SCROLL_LOCK)
409 1.1 bjh21 pcleds |= 0x01;
410 1.1 bjh21 if (sunleds & LED_NUM_LOCK)
411 1.1 bjh21 pcleds |= 0x02;
412 1.1 bjh21 if (sunleds & LED_CAPS_LOCK)
413 1.1 bjh21 pcleds |= 0x04;
414 1.1 bjh21
415 1.1 bjh21 if (pcleds == sc->sc_pcleds)
416 1.1 bjh21 return (0);
417 1.1 bjh21 sc->sc_pcleds = pcleds;
418 1.1 bjh21 DPRINTF(("leds: sun %x, pc %x\n", sunleds, pcleds));
419 1.1 bjh21
420 1.1 bjh21 /* request the change */
421 1.1 bjh21 cmd[0] = KBC_MODEIND;
422 1.1 bjh21 cmd[1] = pcleds;
423 1.1 bjh21 if (isioctl) /* user called KIOCSLED */
424 1.1 bjh21 res = pckbport_enqueue_cmd(sc->sc_kbctag, sc->sc_kbcslot,
425 1.1 bjh21 cmd, 2, 0, 1, NULL);
426 1.1 bjh21 else /* console updates leds - called from interrupt handler */
427 1.1 bjh21 res = pckbport_poll_cmd(sc->sc_kbctag, sc->sc_kbcslot,
428 1.1 bjh21 cmd, 2, 0, NULL, 0);
429 1.1 bjh21 return (res);
430 1.1 bjh21 }
431 1.1 bjh21
432 1.1 bjh21
433 1.1 bjh21 /*********************************************************************
434 1.1 bjh21 * /dev/kbd lower layer
435 1.1 bjh21 */
436 1.1 bjh21
437 1.1 bjh21 /*
438 1.1 bjh21 * Got a receive interrupt - pckbport wants to give us a byte.
439 1.1 bjh21 */
440 1.1 bjh21 static void
441 1.3 uwe kbd_pckbport_input(void *vsc, int data)
442 1.1 bjh21 {
443 1.1 bjh21 struct kbd_pckbport_softc *sc = vsc;
444 1.1 bjh21 struct kbd_softc *kbd = &sc->sc_kbd;
445 1.1 bjh21 int sunkey;
446 1.1 bjh21
447 1.1 bjh21 /* convert to sun make/break code */
448 1.1 bjh21 if (!kbd_pckbport_decode(sc, data, &sunkey))
449 1.1 bjh21 return;
450 1.1 bjh21
451 1.1 bjh21 kbd_input(kbd, sunkey);
452 1.1 bjh21 }
453 1.1 bjh21
454 1.1 bjh21
455 1.1 bjh21 /*
456 1.1 bjh21 * Plagiarized from pckbd_decode
457 1.1 bjh21 */
458 1.1 bjh21 static int
459 1.3 uwe kbd_pckbport_decode(struct kbd_pckbport_softc *sc, int data, int *sundata)
460 1.1 bjh21 {
461 1.1 bjh21 int key, up;
462 1.1 bjh21 int sunkey;
463 1.1 bjh21
464 1.1 bjh21 /* XXX: DEBUG*/
465 1.4 tsutsui DPRINTF(("%s: %02x", device_xname(sc->sc_kbd.k_dev), data));
466 1.1 bjh21
467 1.1 bjh21 if (data == KBR_EXTENDED0) {
468 1.1 bjh21 sc->sc_extended = 1;
469 1.1 bjh21 DPRINTF(("\n"));
470 1.1 bjh21 return (0);
471 1.1 bjh21 } else if (data == KBR_EXTENDED1) {
472 1.1 bjh21 sc->sc_extended1 = 2;
473 1.1 bjh21 DPRINTF(("\n"));
474 1.1 bjh21 return (0);
475 1.1 bjh21 }
476 1.1 bjh21
477 1.1 bjh21 /* map extended keys to (unused) codes 128-254 */
478 1.1 bjh21 key = (data & 0x7f) | (sc->sc_extended ? 0x80 : 0);
479 1.1 bjh21 sc->sc_extended = 0;
480 1.1 bjh21
481 1.1 bjh21 /*
482 1.1 bjh21 * process BREAK key (EXT1 1D 45 EXT1 9D C5):
483 1.1 bjh21 * map to (unused) code 7F
484 1.1 bjh21 */
485 1.1 bjh21 if (sc->sc_extended1 == 2 && (data == 0x1d || data == 0x9d)) {
486 1.1 bjh21 sc->sc_extended1 = 1;
487 1.1 bjh21 DPRINTF(("\n"));
488 1.1 bjh21 return (0);
489 1.1 bjh21 } else if (sc->sc_extended1 == 1
490 1.1 bjh21 && (data == 0x45 || data == 0xc5)) {
491 1.1 bjh21 sc->sc_extended1 = 0;
492 1.1 bjh21 key = 0x7f;
493 1.1 bjh21 } else if (sc->sc_extended1 > 0) {
494 1.1 bjh21 sc->sc_extended1 = 0;
495 1.1 bjh21 }
496 1.1 bjh21
497 1.1 bjh21 if (data & 0x80) {
498 1.1 bjh21 sc->sc_lastchar = 0;
499 1.1 bjh21 up = 1;
500 1.1 bjh21 } else {
501 1.1 bjh21 /* always ignore typematic keys */
502 1.1 bjh21 if (key == sc->sc_lastchar) {
503 1.1 bjh21 DPRINTF(("\n"));
504 1.1 bjh21 return (0);
505 1.1 bjh21 }
506 1.1 bjh21 sc->sc_lastchar = key;
507 1.1 bjh21 up = 0;
508 1.1 bjh21 }
509 1.1 bjh21
510 1.1 bjh21 sunkey = kbd_pckbport_xt_to_sun[key];
511 1.1 bjh21
512 1.1 bjh21 DPRINTF((" -> xt 0x%02x %s -> %d\n",
513 1.1 bjh21 key, (up ? "up " : "down"), sunkey));
514 1.1 bjh21
515 1.1 bjh21 if (up)
516 1.1 bjh21 sunkey |= KBD_UP;
517 1.1 bjh21
518 1.1 bjh21 *sundata = sunkey;
519 1.1 bjh21 return (1);
520 1.1 bjh21 }
521 1.1 bjh21
522 1.3 uwe static const uint8_t kbd_pckbport_xt_to_sun[256] = {
523 1.1 bjh21 /* 0x00 */ 0, /* */
524 1.1 bjh21 /* 0x01 */ 29, /* Esc */
525 1.1 bjh21 /* 0x02 */ 30, /* 1 */
526 1.1 bjh21 /* 0x03 */ 31, /* 2 */
527 1.1 bjh21 /* 0x04 */ 32, /* 3 */
528 1.1 bjh21 /* 0x05 */ 33, /* 4 */
529 1.1 bjh21 /* 0x06 */ 34, /* 5 */
530 1.1 bjh21 /* 0x07 */ 35, /* 6 */
531 1.1 bjh21 /* 0x08 */ 36, /* 7 */
532 1.1 bjh21 /* 0x09 */ 37, /* 8 */
533 1.1 bjh21 /* 0x0a */ 38, /* 9 */
534 1.1 bjh21 /* 0x0b */ 39, /* 0 */
535 1.1 bjh21 /* 0x0c */ 40, /* minus */
536 1.1 bjh21 /* 0x0d */ 41, /* equal */
537 1.1 bjh21 /* 0x0e */ 43, /* BackSpace */
538 1.1 bjh21 /* 0x0f */ 53, /* Tab */
539 1.1 bjh21 /* 0x10 */ 54, /* Q */
540 1.1 bjh21 /* 0x11 */ 55, /* W */
541 1.1 bjh21 /* 0x12 */ 56, /* E */
542 1.1 bjh21 /* 0x13 */ 57, /* R */
543 1.1 bjh21 /* 0x14 */ 58, /* T */
544 1.1 bjh21 /* 0x15 */ 59, /* Y */
545 1.1 bjh21 /* 0x16 */ 60, /* U */
546 1.1 bjh21 /* 0x17 */ 61, /* I */
547 1.1 bjh21 /* 0x18 */ 62, /* O */
548 1.1 bjh21 /* 0x19 */ 63, /* P */
549 1.1 bjh21 /* 0x1a */ 64, /* [ */
550 1.1 bjh21 /* 0x1b */ 65, /* ] */
551 1.1 bjh21 /* 0x1c */ 89, /* Return */
552 1.1 bjh21 /* 0x1d */ 76, /* Ctrl_L */
553 1.1 bjh21 /* 0x1e */ 77, /* A */
554 1.1 bjh21 /* 0x1f */ 78, /* S */
555 1.1 bjh21 /* 0x20 */ 79, /* D */
556 1.1 bjh21 /* 0x21 */ 80, /* F */
557 1.1 bjh21 /* 0x22 */ 81, /* G */
558 1.1 bjh21 /* 0x23 */ 82, /* H */
559 1.1 bjh21 /* 0x24 */ 83, /* J */
560 1.1 bjh21 /* 0x25 */ 84, /* K */
561 1.1 bjh21 /* 0x26 */ 85, /* L */
562 1.1 bjh21 /* 0x27 */ 86, /* ; */
563 1.1 bjh21 /* 0x28 */ 87, /* apostr. */
564 1.1 bjh21 /* 0x29 */ 42, /* grave/tilde */
565 1.1 bjh21 /* 0x2a */ 99, /* Shift_L */
566 1.1 bjh21 /* 0x2b */ 88, /* backslash */
567 1.1 bjh21 /* 0x2c */ 100, /* Z */
568 1.1 bjh21 /* 0x2d */ 101, /* X */
569 1.1 bjh21 /* 0x2e */ 102, /* C */
570 1.1 bjh21 /* 0x2f */ 103, /* V */
571 1.1 bjh21 /* 0x30 */ 104, /* B */
572 1.1 bjh21 /* 0x31 */ 105, /* N */
573 1.1 bjh21 /* 0x32 */ 106, /* M */
574 1.1 bjh21 /* 0x33 */ 107, /* , */
575 1.1 bjh21 /* 0x34 */ 108, /* . */
576 1.1 bjh21 /* 0x35 */ 109, /* / */
577 1.1 bjh21 /* 0x36 */ 110, /* Shift_R */
578 1.1 bjh21 /* 0x37 */ 47, /* R6/KP_Mult */
579 1.1 bjh21 /* 0x38 */ 120, /* Meta_L */
580 1.1 bjh21 /* 0x39 */ 121, /* SpaceBar */
581 1.1 bjh21 /* 0x3a */ 119, /* CapsLock */
582 1.1 bjh21 /* 0x3b */ 5, /* F1 */
583 1.1 bjh21 /* 0x3c */ 6, /* F2 */
584 1.1 bjh21 /* 0x3d */ 8, /* F3 */
585 1.1 bjh21 /* 0x3e */ 10, /* F4 */
586 1.1 bjh21 /* 0x3f */ 12, /* F5 */
587 1.1 bjh21 /* 0x40 */ 14, /* F6 */
588 1.1 bjh21 /* 0x41 */ 16, /* F7 */
589 1.1 bjh21 /* 0x42 */ 17, /* F8 */
590 1.1 bjh21 /* 0x43 */ 18, /* F9 */
591 1.1 bjh21 /* 0x44 */ 7, /* F10 */
592 1.1 bjh21 /* 0x45 */ 98, /* Num_Lock */
593 1.1 bjh21 /* 0x46 */ 0, /* */ /* scroll lock */
594 1.1 bjh21 /* 0x47 */ 68, /* R7/Home */
595 1.1 bjh21 /* 0x48 */ 69, /* R8/Up */
596 1.1 bjh21 /* 0x49 */ 70, /* R9/PgUp */
597 1.1 bjh21 /* 0x4a */ 71, /* KP_Minus */
598 1.1 bjh21 /* 0x4b */ 91, /* R10/Left */
599 1.1 bjh21 /* 0x4c */ 92, /* R11/KP_5 */
600 1.1 bjh21 /* 0x4d */ 93, /* R12/Right */
601 1.1 bjh21 /* 0x4e */ 125, /* KP_Add */
602 1.1 bjh21 /* 0x4f */ 112, /* R13/End */
603 1.1 bjh21 /* 0x50 */ 113, /* R14/Down */
604 1.1 bjh21 /* 0x51 */ 114, /* R15/PgDn */
605 1.1 bjh21 /* 0x52 */ 94, /* KP_Insert */
606 1.1 bjh21 /* 0x53 */ 50, /* KP_Delete */
607 1.1 bjh21 /* 0x54 */ 0, /* */
608 1.1 bjh21 /* 0x55 */ 0, /* */
609 1.1 bjh21 /* 0x56 */ 0, /* */
610 1.1 bjh21 /* 0x57 */ 9, /* F11 */
611 1.1 bjh21 /* 0x58 */ 11, /* F12 */
612 1.1 bjh21 /* 0x59 */ 0, /* */
613 1.1 bjh21 /* 0x5a */ 0, /* */
614 1.1 bjh21 /* 0x5b */ 0, /* */
615 1.1 bjh21 /* 0x5c */ 0, /* */
616 1.1 bjh21 /* 0x5d */ 0, /* */
617 1.1 bjh21 /* 0x5e */ 0, /* */
618 1.1 bjh21 /* 0x5f */ 0, /* */
619 1.1 bjh21 /* 0x60 */ 0, /* */
620 1.1 bjh21 /* 0x61 */ 0, /* */
621 1.1 bjh21 /* 0x62 */ 0, /* */
622 1.1 bjh21 /* 0x63 */ 0, /* */
623 1.1 bjh21 /* 0x64 */ 0, /* */
624 1.1 bjh21 /* 0x65 */ 0, /* */
625 1.1 bjh21 /* 0x66 */ 0, /* */
626 1.1 bjh21 /* 0x67 */ 0, /* */
627 1.1 bjh21 /* 0x68 */ 0, /* */
628 1.1 bjh21 /* 0x69 */ 0, /* */
629 1.1 bjh21 /* 0x6a */ 0, /* */
630 1.1 bjh21 /* 0x6b */ 0, /* */
631 1.1 bjh21 /* 0x6c */ 0, /* */
632 1.1 bjh21 /* 0x6d */ 0, /* */
633 1.1 bjh21 /* 0x6e */ 0, /* */
634 1.1 bjh21 /* 0x6f */ 0, /* */
635 1.1 bjh21 /* 0x70 */ 0, /* */
636 1.1 bjh21 /* 0x71 */ 0, /* */
637 1.1 bjh21 /* 0x72 */ 0, /* */
638 1.1 bjh21 /* 0x73 */ 0, /* */
639 1.1 bjh21 /* 0x74 */ 0, /* */
640 1.1 bjh21 /* 0x75 */ 0, /* */
641 1.1 bjh21 /* 0x76 */ 0, /* */
642 1.1 bjh21 /* 0x77 */ 0, /* */
643 1.1 bjh21 /* 0x78 */ 0, /* */
644 1.1 bjh21 /* 0x79 */ 0, /* */
645 1.1 bjh21 /* 0x7a */ 0, /* */
646 1.1 bjh21 /* 0x7b */ 0, /* */
647 1.1 bjh21 /* 0x7c */ 0, /* */
648 1.1 bjh21 /* 0x7d */ 0, /* */
649 1.1 bjh21 /* 0x7e */ 0, /* */
650 1.1 bjh21 /* 0x7f */ 23, /* R3/Break */
651 1.1 bjh21
652 1.1 bjh21 /* 0x80 */ 0, /* */
653 1.1 bjh21 /* 0x81 */ 0, /* */
654 1.1 bjh21 /* 0x82 */ 0, /* */
655 1.1 bjh21 /* 0x83 */ 0, /* */
656 1.1 bjh21 /* 0x84 */ 0, /* */
657 1.1 bjh21 /* 0x85 */ 0, /* */
658 1.1 bjh21 /* 0x86 */ 0, /* */
659 1.1 bjh21 /* 0x87 */ 0, /* */
660 1.1 bjh21 /* 0x88 */ 0, /* */
661 1.1 bjh21 /* 0x89 */ 0, /* */
662 1.1 bjh21 /* 0x8a */ 0, /* */
663 1.1 bjh21 /* 0x8b */ 0, /* */
664 1.1 bjh21 /* 0x8c */ 0, /* */
665 1.1 bjh21 /* 0x8d */ 0, /* */
666 1.1 bjh21 /* 0x8e */ 0, /* */
667 1.1 bjh21 /* 0x8f */ 0, /* */
668 1.1 bjh21 /* 0x90 */ 0, /* */
669 1.1 bjh21 /* 0x91 */ 0, /* */
670 1.1 bjh21 /* 0x92 */ 0, /* */
671 1.1 bjh21 /* 0x93 */ 0, /* */
672 1.1 bjh21 /* 0x94 */ 0, /* */
673 1.1 bjh21 /* 0x95 */ 0, /* */
674 1.1 bjh21 /* 0x96 */ 0, /* */
675 1.1 bjh21 /* 0x97 */ 0, /* */
676 1.1 bjh21 /* 0x98 */ 0, /* */
677 1.1 bjh21 /* 0x99 */ 0, /* */
678 1.1 bjh21 /* 0x9a */ 0, /* */
679 1.1 bjh21 /* 0x9b */ 0, /* */
680 1.1 bjh21 /* 0x9c */ 90, /* KP_Enter */
681 1.1 bjh21 /* 0x9d */ 76, /* Ctrl_L */ /* XXX: Sun kbd has no Ctrl_R */
682 1.1 bjh21 /* 0x9e */ 0, /* */
683 1.1 bjh21 /* 0x9f */ 0, /* */
684 1.1 bjh21 /* 0xa0 */ 0, /* */
685 1.1 bjh21 /* 0xa1 */ 0, /* */
686 1.1 bjh21 /* 0xa2 */ 0, /* */
687 1.1 bjh21 /* 0xa3 */ 0, /* */
688 1.1 bjh21 /* 0xa4 */ 0, /* */
689 1.1 bjh21 /* 0xa5 */ 0, /* */
690 1.1 bjh21 /* 0xa6 */ 0, /* */
691 1.1 bjh21 /* 0xa7 */ 0, /* */
692 1.1 bjh21 /* 0xa8 */ 0, /* */
693 1.1 bjh21 /* 0xa9 */ 0, /* */
694 1.1 bjh21 /* 0xaa */ 0, /* */
695 1.1 bjh21 /* 0xab */ 0, /* */
696 1.1 bjh21 /* 0xac */ 0, /* */
697 1.1 bjh21 /* 0xad */ 0, /* */
698 1.1 bjh21 /* 0xae */ 0, /* */
699 1.1 bjh21 /* 0xaf */ 0, /* */
700 1.1 bjh21 /* 0xb0 */ 0, /* */
701 1.1 bjh21 /* 0xb1 */ 0, /* */
702 1.1 bjh21 /* 0xb2 */ 0, /* */
703 1.1 bjh21 /* 0xb3 */ 0, /* */
704 1.1 bjh21 /* 0xb4 */ 0, /* */
705 1.1 bjh21 /* 0xb5 */ 46, /* R5/KP_Div */
706 1.1 bjh21 /* 0xb6 */ 0, /* */
707 1.1 bjh21 /* 0xb7 */ 0, /* */
708 1.1 bjh21 /* 0xb8 */ 122, /* Meta_R */
709 1.1 bjh21 /* 0xb9 */ 0, /* */
710 1.1 bjh21 /* 0xba */ 0, /* */
711 1.1 bjh21 /* 0xbb */ 0, /* */
712 1.1 bjh21 /* 0xbc */ 0, /* */
713 1.1 bjh21 /* 0xbd */ 0, /* */
714 1.1 bjh21 /* 0xbe */ 0, /* */
715 1.1 bjh21 /* 0xbf */ 0, /* */
716 1.1 bjh21 /* 0xc0 */ 0, /* */
717 1.1 bjh21 /* 0xc1 */ 0, /* */
718 1.1 bjh21 /* 0xc2 */ 0, /* */
719 1.1 bjh21 /* 0xc3 */ 0, /* */
720 1.1 bjh21 /* 0xc4 */ 0, /* */
721 1.1 bjh21 /* 0xc5 */ 0, /* */
722 1.1 bjh21 /* 0xc6 */ 0, /* */
723 1.1 bjh21 /* 0xc7 */ 52, /* - T5_Home */
724 1.1 bjh21 /* 0xc8 */ 20, /* T5_Up */
725 1.1 bjh21 /* 0xc9 */ 96, /* - T5_PgUp */
726 1.1 bjh21 /* 0xca */ 0, /* */
727 1.1 bjh21 /* 0xcb */ 24, /* T5_Left */
728 1.1 bjh21 /* 0xcc */ 0, /* */
729 1.1 bjh21 /* 0xcd */ 28, /* T5_Right */
730 1.1 bjh21 /* 0xce */ 0, /* */
731 1.1 bjh21 /* 0xcf */ 74, /* - T5_End */
732 1.1 bjh21 /* 0xd0 */ 27, /* T5_Down */
733 1.1 bjh21 /* 0xd1 */ 123, /* - T5_PgDn */
734 1.1 bjh21 /* 0xd2 */ 44, /* - T5_Insert */
735 1.1 bjh21 /* 0xd3 */ 66, /* Delete */
736 1.1 bjh21 /* 0xd4 */ 0, /* */
737 1.1 bjh21 /* 0xd5 */ 0, /* */
738 1.1 bjh21 /* 0xd6 */ 0, /* */
739 1.1 bjh21 /* 0xd7 */ 0, /* */
740 1.1 bjh21 /* 0xd8 */ 0, /* */
741 1.1 bjh21 /* 0xd9 */ 0, /* */
742 1.1 bjh21 /* 0xda */ 0, /* */
743 1.1 bjh21 /* 0xdb */ 19, /* Alt_L */ /* left flying window */
744 1.1 bjh21 /* 0xdc */ 0, /* */ /* right flying window */
745 1.1 bjh21 /* 0xdd */ 0, /* */ /* (right) menu key */
746 1.1 bjh21 /* 0xde */ 0, /* */
747 1.1 bjh21 /* 0xdf */ 0, /* */
748 1.1 bjh21 /* 0xe0 */ 0, /* */
749 1.1 bjh21 /* 0xe1 */ 0, /* */
750 1.1 bjh21 /* 0xe2 */ 0, /* */
751 1.1 bjh21 /* 0xe3 */ 0, /* */
752 1.1 bjh21 /* 0xe4 */ 0, /* */
753 1.1 bjh21 /* 0xe5 */ 0, /* */
754 1.1 bjh21 /* 0xe6 */ 0, /* */
755 1.1 bjh21 /* 0xe7 */ 0, /* */
756 1.1 bjh21 /* 0xe8 */ 0, /* */
757 1.1 bjh21 /* 0xe9 */ 0, /* */
758 1.1 bjh21 /* 0xea */ 0, /* */
759 1.1 bjh21 /* 0xeb */ 0, /* */
760 1.1 bjh21 /* 0xec */ 0, /* */
761 1.1 bjh21 /* 0xed */ 0, /* */
762 1.1 bjh21 /* 0xee */ 0, /* */
763 1.1 bjh21 /* 0xef */ 0, /* */
764 1.1 bjh21 /* 0xf0 */ 0, /* */
765 1.1 bjh21 /* 0xf1 */ 0, /* */
766 1.1 bjh21 /* 0xf2 */ 0, /* */
767 1.1 bjh21 /* 0xf3 */ 0, /* */
768 1.1 bjh21 /* 0xf4 */ 0, /* */
769 1.1 bjh21 /* 0xf5 */ 0, /* */
770 1.1 bjh21 /* 0xf6 */ 0, /* */
771 1.1 bjh21 /* 0xf7 */ 0, /* */
772 1.1 bjh21 /* 0xf8 */ 0, /* */
773 1.1 bjh21 /* 0xf9 */ 0, /* */
774 1.1 bjh21 /* 0xfa */ 0, /* */
775 1.1 bjh21 /* 0xfb */ 0, /* */
776 1.1 bjh21 /* 0xfc */ 0, /* */
777 1.1 bjh21 /* 0xfd */ 0, /* */
778 1.1 bjh21 /* 0xfe */ 0, /* */
779 1.1 bjh21 /* 0xff */ 0 /* */
780 1.1 bjh21 }; /* kbd_pckbport_xt_to_sun */
781