Mon Aug 31 17:54:18 2020 UTC ()
defparam and use ADBKBD_LAYOUT, default to KB_US|KB_APPLE for tradition


(macallan)
diff -r1.29 -r1.30 src/sys/dev/adb/adb_kbd.c
diff -r1.9 -r1.10 src/sys/dev/adb/files.adb

cvs diff -r1.29 -r1.30 src/sys/dev/adb/adb_kbd.c (expand / switch to unified diff)

--- src/sys/dev/adb/adb_kbd.c 2019/06/09 14:18:29 1.29
+++ src/sys/dev/adb/adb_kbd.c 2020/08/31 17:54:18 1.30
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: adb_kbd.c,v 1.29 2019/06/09 14:18:29 christos Exp $ */ 1/* $NetBSD: adb_kbd.c,v 1.30 2020/08/31 17:54:18 macallan Exp $ */
2 2
3/* 3/*
4 * Copyright (C) 1998 Colin Wood 4 * Copyright (C) 1998 Colin Wood
5 * Copyright (C) 2006, 2007 Michael Lorenz 5 * Copyright (C) 2006, 2007 Michael Lorenz
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
11 * 1. Redistributions of source code must retain the above copyright 11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer. 12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright 13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the 14 * notice, this list of conditions and the following disclaimer in the
@@ -22,27 +22,27 @@ @@ -22,27 +22,27 @@
22 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 22 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
23 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 23 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 24 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 25 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 */ 32 */
33 33
34#include <sys/cdefs.h> 34#include <sys/cdefs.h>
35__KERNEL_RCSID(0, "$NetBSD: adb_kbd.c,v 1.29 2019/06/09 14:18:29 christos Exp $"); 35__KERNEL_RCSID(0, "$NetBSD: adb_kbd.c,v 1.30 2020/08/31 17:54:18 macallan Exp $");
36 36
37#ifdef _KERNEL_OPT 37#ifdef _KERNEL_OPT
38#include "opt_ddb.h" 38#include "opt_ddb.h"
39#endif 39#endif
40 40
41#include <sys/param.h> 41#include <sys/param.h>
42#include <sys/device.h> 42#include <sys/device.h>
43#include <sys/fcntl.h> 43#include <sys/fcntl.h>
44#include <sys/poll.h> 44#include <sys/poll.h>
45#include <sys/select.h> 45#include <sys/select.h>
46#include <sys/proc.h> 46#include <sys/proc.h>
47#include <sys/systm.h> 47#include <sys/systm.h>
48#include <sys/kernel.h> 48#include <sys/kernel.h>
@@ -129,30 +129,30 @@ struct wskbd_accessops adbkbd_accessops  @@ -129,30 +129,30 @@ struct wskbd_accessops adbkbd_accessops
129 adbkbd_ioctl, 129 adbkbd_ioctl,
130}; 130};
131 131
132static void adbkbd_cngetc(void *, u_int *, int *); 132static void adbkbd_cngetc(void *, u_int *, int *);
133static void adbkbd_cnpollc(void *, int); 133static void adbkbd_cnpollc(void *, int);
134 134
135struct wskbd_consops adbkbd_consops = { 135struct wskbd_consops adbkbd_consops = {
136 adbkbd_cngetc, 136 adbkbd_cngetc,
137 adbkbd_cnpollc, 137 adbkbd_cnpollc,
138}; 138};
139 139
140struct wskbd_mapdata adbkbd_keymapdata = { 140struct wskbd_mapdata adbkbd_keymapdata = {
141 akbd_keydesctab, 141 akbd_keydesctab,
142#ifdef AKBD_LAYOUT 142#ifdef ADBKBD_LAYOUT
143 AKBD_LAYOUT, 143 ADBKBD_LAYOUT,
144#else 144#else
145 KB_US, 145 KB_US | KB_APPLE,
146#endif 146#endif
147}; 147};
148 148
149#if NWSMOUSE > 0 149#if NWSMOUSE > 0
150static int adbkms_enable(void *); 150static int adbkms_enable(void *);
151static int adbkms_ioctl(void *, u_long, void *, int, struct lwp *); 151static int adbkms_ioctl(void *, u_long, void *, int, struct lwp *);
152static void adbkms_disable(void *); 152static void adbkms_disable(void *);
153 153
154const struct wsmouse_accessops adbkms_accessops = { 154const struct wsmouse_accessops adbkms_accessops = {
155 adbkms_enable, 155 adbkms_enable,
156 adbkms_ioctl, 156 adbkms_ioctl,
157 adbkms_disable, 157 adbkms_disable,
158}; 158};

cvs diff -r1.9 -r1.10 src/sys/dev/adb/files.adb (expand / switch to unified diff)

--- src/sys/dev/adb/files.adb 2019/09/08 05:55:15 1.9
+++ src/sys/dev/adb/files.adb 2020/08/31 17:54:18 1.10
@@ -1,35 +1,36 @@ @@ -1,35 +1,36 @@
1#  1#
2# $NetBSD: files.adb,v 1.9 2019/09/08 05:55:15 macallan Exp $ 2# $NetBSD: files.adb,v 1.10 2020/08/31 17:54:18 macallan Exp $
3# 3#
4# Apple Desktop Bus protocol and drivers 4# Apple Desktop Bus protocol and drivers
5 5
6defflag adbdebug.h ADB_DEBUG 6defflag adbdebug.h ADB_DEBUG
7defflag adbdebug.h ADBKBD_DEBUG 7defflag adbdebug.h ADBKBD_DEBUG
8defflag adbdebug.h ADBMS_DEBUG 8defflag adbdebug.h ADBMS_DEBUG
9defflag adbdebug.h ADBBT_DEBUG 9defflag adbdebug.h ADBBT_DEBUG
10defflag adbdebug.h ADBKBD_POWER_DDB 10defflag adbdebug.h ADBKBD_POWER_DDB
11defflag adbdebug.h KTM_DEBUG 11defflag adbdebug.h KTM_DEBUG
12 12
13define adb_bus {} 13define adb_bus {}
14 14
15device nadb {} 15device nadb {}
16attach nadb at adb_bus 16attach nadb at adb_bus
17file dev/adb/adb_bus.c nadb needs-flag 17file dev/adb/adb_bus.c nadb needs-flag
18 18
19device adbkbd : wskbddev, wsmousedev, sysmon_power, sysmon_taskq 19device adbkbd : wskbddev, wsmousedev, sysmon_power, sysmon_taskq
20attach adbkbd at nadb 20attach adbkbd at nadb
21file dev/adb/adb_kbd.c adbkbd needs-flag 21file dev/adb/adb_kbd.c adbkbd needs-flag
22file dev/adb/adb_usb_map.c adbkbd 22file dev/adb/adb_usb_map.c adbkbd
23defflag opt_adbkbd.h ADBKBD_EMUL_USB 23defflag opt_adbkbd.h ADBKBD_EMUL_USB
 24defparam opt_adbkbd.h ADBKBD_LAYOUT
24 25
25device adbbt : wskbddev 26device adbbt : wskbddev
26attach adbbt at nadb 27attach adbbt at nadb
27file dev/adb/adb_bt.c adbbt 28file dev/adb/adb_bt.c adbbt
28 29
29device adbms : wsmousedev 30device adbms : wsmousedev
30attach adbms at nadb 31attach adbms at nadb
31file dev/adb/adb_ms.c adbms needs-flag 32file dev/adb/adb_ms.c adbms needs-flag
32 33
33device ktm : wsmousedev 34device ktm : wsmousedev
34attach ktm at nadb 35attach ktm at nadb
35file dev/adb/adb_ktm.c ktm needs-flag 36file dev/adb/adb_ktm.c ktm needs-flag