Home | History | Annotate | only in /src/sys/dev/adb
History log of /src/sys/dev/adb
RevisionDateAuthorComments
 1.10 16-Jun-2025  macallan move a couple more ADB macros into adbvar.h, drop <machine/keyboard.h>
 1.9 16-Jun-2025  macallan remove some unused softc members
 1.8 11-Jun-2025  macallan make this actually self-contined
- don't include machine/adbsys.h - we only needed it for a couple #defines,
none of which are arch-specific
- move all the ADB definitions to adbvar.h
 1.7 28-Oct-2017  riastradh branches: 1.7.42;
Kill some more extern struct cfdriver declarations.

Down with externs in .c!
 1.6 08-Sep-2010  macallan branches: 1.6.18;
make debug code compile again
 1.5 15-May-2008  macallan branches: 1.5.18; 1.5.20;
Let ADB button devices send PMF events instead of pretending to be keyboards.
 1.4 29-Apr-2008  martin branches: 1.4.2;
Convert to new 2 clause license
 1.3 05-Apr-2008  cegger branches: 1.3.2; 1.3.4;
use aprint_*_dev and device_xname
 1.2 26-Mar-2008  matt split softc/device_t
 1.1 16-Apr-2007  macallan branches: 1.1.2; 1.1.4; 1.1.6; 1.1.16; 1.1.36;
add a very simple driver for ADB button devices found on halfway recent
*Books. So far it only returns function key events.
 1.1.36.2 02-Jun-2008  mjf Sync with HEAD.
 1.1.36.1 03-Apr-2008  mjf Sync with HEAD.
 1.1.16.2 03-Sep-2007  yamt sync with head.
 1.1.16.1 16-Apr-2007  yamt file adb_bt.c was added on branch yamt-lazymbuf on 2007-09-03 14:33:23 +0000
 1.1.6.2 11-Jul-2007  mjf Sync with head.
 1.1.6.1 16-Apr-2007  mjf file adb_bt.c was added on branch mjf-ufs-trans on 2007-07-11 20:05:12 +0000
 1.1.4.2 09-Jun-2007  ad Sync with head.
 1.1.4.1 16-Apr-2007  ad file adb_bt.c was added on branch vmlocking on 2007-06-09 21:37:12 +0000
 1.1.2.2 07-May-2007  yamt sync with head.
 1.1.2.1 16-Apr-2007  yamt file adb_bt.c was added on branch yamt-idlelwp on 2007-05-07 10:55:24 +0000
 1.3.4.3 09-Oct-2010  yamt sync with head
 1.3.4.2 04-May-2009  yamt sync with head.
 1.3.4.1 16-May-2008  yamt sync with head.
 1.3.2.1 18-May-2008  yamt sync with head.
 1.4.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.5.20.1 05-Mar-2011  rmind sync with head
 1.5.18.1 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.6.18.1 03-Dec-2017  jdolecek update from HEAD
 1.7.42.1 02-Aug-2025  perseant Sync with HEAD
 1.14 16-Jun-2025  macallan tsleep/wakeup -> cv_timedwait/cv_signal
while there remove a bunch of unnecessary includes
 1.13 11-Jun-2025  macallan make this actually self-contined
- don't include machine/adbsys.h - we only needed it for a couple #defines,
none of which are arch-specific
- move all the ADB definitions to adbvar.h
 1.12 07-Aug-2021  thorpej branches: 1.12.12;
Merge thorpej-cfargs2.
 1.11 24-Apr-2021  thorpej branches: 1.11.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.10 08-Nov-2014  macallan branches: 1.10.36;
aprint_*-ize
 1.9 12-May-2009  cegger branches: 1.9.22;
KNF
 1.8 29-Apr-2008  martin branches: 1.8.14;
Convert to new 2 clause license
 1.7 26-Mar-2008  matt branches: 1.7.2; 1.7.4;
split softc/device_t
 1.6 19-Oct-2007  ad branches: 1.6.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.5 16-Apr-2007  macallan branches: 1.5.6; 1.5.8; 1.5.12;
cleanup autoconfig output
 1.4 10-Feb-2007  tsutsui branches: 1.4.2; 1.4.4; 1.4.8; 1.4.10;
Fix botch on newlock2 merge.
 1.3 09-Feb-2007  ad Merge newlock2 to head.
 1.2 09-Feb-2007  macallan do a bus reset before looking for devices
 1.1 17-Jan-2007  macallan branches: 1.1.2;
new, simplified ADB drivers
 1.1.2.2 06-Feb-2007  ad Fix CVS screwup.
 1.1.2.1 17-Jan-2007  ad file adb_bus.c was added on branch newlock2 on 2007-02-06 17:10:30 +0000
 1.4.10.1 11-Jul-2007  mjf Sync with head.
 1.4.8.2 23-Oct-2007  ad Sync with head.
 1.4.8.1 27-May-2007  ad Sync with head.
 1.4.4.4 27-Oct-2007  yamt sync with head.
 1.4.4.3 03-Sep-2007  yamt sync with head.
 1.4.4.2 26-Feb-2007  yamt sync with head.
 1.4.4.1 10-Feb-2007  yamt file adb_bus.c was added on branch yamt-lazymbuf on 2007-02-26 09:09:57 +0000
 1.4.2.1 07-May-2007  yamt sync with head.
 1.5.12.1 25-Oct-2007  bouyer Sync with HEAD.
 1.5.8.1 06-Nov-2007  matt sync with HEAD
 1.5.6.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.6.16.2 02-Jun-2008  mjf Sync with HEAD.
 1.6.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.7.4.2 16-May-2009  yamt sync with head
 1.7.4.1 16-May-2008  yamt sync with head.
 1.7.2.1 18-May-2008  yamt sync with head.
 1.8.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.9.22.1 03-Dec-2017  jdolecek update from HEAD
 1.10.36.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.11.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.12.12.1 02-Aug-2025  perseant Sync with HEAD
 1.36 16-Jun-2025  macallan move a couple more ADB macros into adbvar.h, drop <machine/keyboard.h>
 1.35 16-Jun-2025  macallan tsleep/wakeup -> cv_timedwait/cv_signal
while there remove a bunch of unnecessary includes
 1.34 11-Jun-2025  macallan make this actually self-contined
- don't include machine/adbsys.h - we only needed it for a couple #defines,
none of which are arch-specific
- move all the ADB definitions to adbvar.h
 1.33 14-May-2022  manu branches: 1.33.10;
Add ISO and JIS keyboard layouts for ADB to USB emulation

The layout is configurable using sysctl machdep.adbkbdX.emulate_usb:
0 = no emulation
1 = ANSI
2 = ISO (new with this change)
3 = JIS (new with this change)

Default value is detected using the ADB keyboard handler id. JIS
default is disabled until it is tested.
 1.32 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.31 24-Apr-2021  thorpej branches: 1.31.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.30 31-Aug-2020  macallan branches: 1.30.4;
defparam and use ADBKBD_LAYOUT, default to KB_US|KB_APPLE for tradition
 1.29 09-Jun-2019  christos make this compile again without ddb
 1.28 06-Jun-2019  macallan - call Debugger() from adbkbd_keys() instead of the task queue
- add options ADBKBD_POWER_DDB to enable DDB-on-Power by default
 1.27 28-Oct-2017  riastradh branches: 1.27.4;
Kill some more extern struct cfdriver declarations.

Down with externs in .c!
 1.26 29-Jul-2015  christos We don't have Debugger if we don't have DDB.
 1.25 27-Jul-2015  macallan add a sysctl to optionally ender ddb when pressing the power button
 1.24 08-Nov-2014  macallan branches: 1.24.2;
aprint_*-ize
 1.23 08-Nov-2014  macallan nicely ask the keyboard to distinguish between left and right Control, Alt
and Shift keys.
Welcome to the world of accents and diacritics!
 1.22 18-Nov-2013  nisimura branches: 1.22.4;

minor tweaks to shut gcc4.8 warning off.
 1.21 19-Sep-2012  macallan branches: 1.21.2;
some older powerbook keyboards use the same scancode for the power button as
later ones send on Fn-Command - now we look for that 'special' scancode only
on keyboards that actually need it
 1.20 02-Sep-2012  he branches: 1.20.2;
Move adbkbd_setup_sysctl() declaration to outside NWSMOUSE > 0, to
match the rest of the code.
 1.19 30-Aug-2012  macallan add options ADBKBD_EMUL_USB to turn USB emulation on by default
 1.18 29-Aug-2012  macallan when in event mode, optionally pretend to be a USB keyboard
with this USB and ADB keyboards can coexist at the same mux, with X just
listening to /dev/wskbd instead of having to open each one separately
this can be controlled via sysctl, defaults to off for now
needs testing with non-US keyboards
 1.17 02-Jun-2012  dsl Add some pre-processor magic to verify that the type of the data item
passed to sysctl_createv() actually matches the declared type for
the item itself.
In the places where the caller specifies a function and a structure
address (typically the 'softc') an explicit (void *) cast is now needed.
Fixes bugs in sys/dev/acpi/asus_acpi.c sys/dev/bluetooth/bcsp.c
sys/kern/vfs_bio.c sys/miscfs/syncfs/sync_subr.c and setting
AcpiGbl_EnableAmlDebugObject.
(mostly passing the address of a uint64_t when typed as CTLTYPE_INT).
I've test built quite a few kernels, but there may be some unfixed MD
fallout. Most likely passing &char[] to char *.
Also add CTLFLAG_UNSIGNED for unsiged decimals - not set yet.
 1.16 16-Nov-2011  macallan only require the power button to be pressed twice on keyboards where it's easy
to hit by accident, send an event to sysmon immediately otherwise
 1.15 18-Aug-2011  christos branches: 1.15.2;
Fix gcc-4.5 warnings. If you still see them, e-mail them to me.
 1.14 28-Jul-2011  macallan sanitize sysctl interface in order to appease gcc 4.5
 1.13 18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.12 26-Mar-2008  matt branches: 1.12.4; 1.12.12; 1.12.18;
split softc/device_t
 1.11 10-Oct-2007  macallan branches: 1.11.18;
make this compile without wsmouse support in the kernel
 1.10 09-May-2007  macallan branches: 1.10.6; 1.10.8; 1.10.10;
in order to avoid accidential shutdown only send power button events to powerd
if the power button is pressed twice, with more than two but less than five
seconds delay
 1.9 16-Apr-2007  macallan don't panic when someone presses the power button without powerd running
 1.8 16-Apr-2007  macallan actually support WSDISPLAY_COMPAT_RAWKBD
unlike akbd we're sending ADB scancodes though, and don't try to translate
them into XT scancodes
 1.7 16-Apr-2007  macallan more autoconfig cosmetics
 1.6 16-Apr-2007  macallan on the iBook Fn-Command sends the same scancode as the power button on some
powerbooks so we'll listen to this scancode only on powerbooks
 1.5 04-Mar-2007  christos branches: 1.5.2; 1.5.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.4 20-Feb-2007  macallan branches: 1.4.2;
update copyrights
 1.3 20-Feb-2007  macallan report power button events to sysmon
 1.2 18-Jan-2007  macallan branches: 1.2.2; 1.2.4;
avoid another collision
 1.1 17-Jan-2007  macallan new, simplified ADB drivers
 1.2.4.4 17-May-2007  yamt sync with head.
 1.2.4.3 07-May-2007  yamt sync with head.
 1.2.4.2 12-Mar-2007  rmind Sync with HEAD.
 1.2.4.1 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.2.2.2 06-Feb-2007  ad Fix CVS screwup.
 1.2.2.1 18-Jan-2007  ad file adb_kbd.c was added on branch newlock2 on 2007-02-06 17:10:30 +0000
 1.4.2.4 27-Oct-2007  yamt sync with head.
 1.4.2.3 03-Sep-2007  yamt sync with head.
 1.4.2.2 26-Feb-2007  yamt sync with head.
 1.4.2.1 20-Feb-2007  yamt file adb_kbd.c was added on branch yamt-lazymbuf on 2007-02-26 09:09:58 +0000
 1.5.4.1 11-Jul-2007  mjf Sync with head.
 1.5.2.2 12-Oct-2007  ad Sync with head.
 1.5.2.1 27-May-2007  ad Sync with head.
 1.10.10.1 14-Oct-2007  yamt sync with head.
 1.10.8.1 06-Nov-2007  matt sync with HEAD
 1.10.6.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.11.18.1 03-Apr-2008  mjf Sync with HEAD.
 1.12.18.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.12.12.1 28-Apr-2009  skrll Sync with HEAD.
 1.12.4.1 04-May-2009  yamt sync with head.
 1.15.2.3 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.15.2.2 30-Oct-2012  yamt sync with head
 1.15.2.1 17-Apr-2012  yamt sync with head
 1.20.2.3 03-Dec-2017  jdolecek update from HEAD
 1.20.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.20.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.21.2.1 18-May-2014  rmind sync with head
 1.22.4.1 05-Jul-2016  snj Pull up following revision(s) (requested by sevan in ticket #1187):
sys/dev/adb/adb_kbd.c: revision 1.23
sys/dev/adb/adb_keymap.h: revisions 1.5, 1.6
sys/dev/adb/adb_usb_map.c: revision 1.2
nicely ask the keyboard to distinguish between left and right Control, Alt
and Shift keys.
Welcome to the world of accents and diacritics!
--
Add us.dvorak keymap variant for ADB keyboards. Addresses PR 51255.
Tested by sevan@.
 1.24.2.1 22-Sep-2015  skrll Sync with HEAD
 1.27.4.1 10-Jun-2019  christos Sync with HEAD
 1.30.4.1 02-Apr-2021  thorpej config_found_ia() -> config_found() w/ CFARG_IATTR.
 1.31.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.33.10.1 02-Aug-2025  perseant Sync with HEAD
 1.10 14-May-2022  manu Add ISO and JIS keyboard layouts for ADB to USB emulation

The layout is configurable using sysctl machdep.adbkbdX.emulate_usb:
0 = no emulation
1 = ANSI
2 = ISO (new with this change)
3 = JIS (new with this change)

Default value is detected using the ADB keyboard handler id. JIS
default is disabled until it is tested.
 1.9 06-Apr-2022  macallan we've been using the power key for its intended purpose for yesrs, which
makes breaking into DDB awkward, so let's do what everyone else does and
use Ctrl-Alt-Escape / Cmd-Escape depending on the layout variant
 1.8 31-Aug-2020  macallan behave like USB keyboards - KB_US uses ctrl-alt-Fn, KB_APPLE variant uses
Command-Fn
 1.7 29-Aug-2020  macallan properly map left Command to Meta_L and left Option to Alt_L
Mostly for correctness, should help non-US layouts
 1.6 20-Jun-2016  jakllsch Add us.dvorak keymap variant for ADB keyboards. Addresses PR 51255.

Tested by sevan@.
 1.5 08-Nov-2014  macallan branches: 1.5.2;
nicely ask the keyboard to distinguish between left and right Control, Alt
and Shift keys.
Welcome to the world of accents and diacritics!
 1.4 29-Aug-2012  macallan branches: 1.4.2; 1.4.14;
when in event mode, optionally pretend to be a USB keyboard
with this USB and ADB keyboards can coexist at the same mux, with X just
listening to /dev/wskbd instead of having to open each one separately
this can be controlled via sysctl, defaults to off for now
needs testing with non-US keyboards
 1.3 28-Apr-2008  martin branches: 1.3.34;
Remove clause 3 and 4 from TNF licenses
 1.2 06-Aug-2007  macallan branches: 1.2.22; 1.2.24; 1.2.26; 1.2.28;
add keysyms for scrollback support
 1.1 17-Jan-2007  macallan branches: 1.1.2; 1.1.6; 1.1.10; 1.1.18; 1.1.22;
new, simplified ADB drivers
 1.1.22.1 09-Aug-2007  jmcneill Sync with HEAD.
 1.1.18.1 15-Aug-2007  skrll Sync with HEAD.
 1.1.10.1 20-Aug-2007  ad Sync with HEAD.
 1.1.6.3 03-Sep-2007  yamt sync with head.
 1.1.6.2 26-Feb-2007  yamt sync with head.
 1.1.6.1 17-Jan-2007  yamt file adb_keymap.h was added on branch yamt-lazymbuf on 2007-02-26 09:09:58 +0000
 1.1.2.2 06-Feb-2007  ad Fix CVS screwup.
 1.1.2.1 17-Jan-2007  ad file adb_keymap.h was added on branch newlock2 on 2007-02-06 17:10:30 +0000
 1.2.28.2 06-Aug-2007  macallan add keysyms for scrollback support
 1.2.28.1 06-Aug-2007  macallan file adb_keymap.h was added on branch matt-mips64 on 2007-08-06 03:40:11 +0000
 1.2.26.1 16-May-2008  yamt sync with head.
 1.2.24.1 18-May-2008  yamt sync with head.
 1.2.22.1 02-Jun-2008  mjf Sync with HEAD.
 1.3.34.1 30-Oct-2012  yamt sync with head
 1.4.14.1 05-Jul-2016  snj Pull up following revision(s) (requested by sevan in ticket #1187):
sys/dev/adb/adb_kbd.c: revision 1.23
sys/dev/adb/adb_keymap.h: revisions 1.5, 1.6
sys/dev/adb/adb_usb_map.c: revision 1.2
nicely ask the keyboard to distinguish between left and right Control, Alt
and Shift keys.
Welcome to the world of accents and diacritics!
--
Add us.dvorak keymap variant for ADB keyboards. Addresses PR 51255.
Tested by sevan@.
 1.4.2.1 03-Dec-2017  jdolecek update from HEAD
 1.5.2.1 09-Jul-2016  skrll Sync with HEAD
 1.9 16-Jun-2025  macallan tsleep/wakeup -> cv_timedwait/cv_signal
while there remove a bunch of unnecessary includes
 1.8 11-Jun-2025  macallan make this actually self-contined
- don't include machine/adbsys.h - we only needed it for a couple #defines,
none of which are arch-specific
- move all the ADB definitions to adbvar.h
 1.7 11-Feb-2024  andvar branches: 1.7.2;
Fix few more typos in comments and log message:
s/butoon/button/
s/BUTTOM/BOTTOM/
s/communicaiton/communication/
s/recevice/receive/
s/regiion/region/
 1.6 06-Oct-2022  andvar fix few typos in comments and node description.
 1.5 06-Apr-2022  macallan KNF nits, NFC
 1.4 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.3 24-Apr-2021  thorpej branches: 1.3.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.2 15-Sep-2019  macallan branches: 1.2.8; 1.2.12;
fix non-debug build
 1.1 08-Sep-2019  macallan add driver for Kensington Turbo Mouse ( actually a trackball )
the adbms driver contains basic support, this driver lets you program the
buttons, I'll add other features once I figure out how they work
 1.2.12.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.2.8.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.2.8.1 15-Sep-2019  martin file adb_ktm.c was added on branch phil-wifi on 2020-04-13 08:04:18 +0000
 1.3.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.7.2.1 02-Aug-2025  perseant Sync with HEAD
 1.27 27-Jun-2025  andvar Grammar and spelling fixes, mainly in comments. A few in documentation,
logging, test description, and SCSI ASC/ASCQ assignment descriptions.
 1.26 16-Jun-2025  macallan tsleep/wakeup -> cv_timedwait/cv_signal
while there remove a bunch of unnecessary includes
 1.25 11-Jun-2025  macallan make this actually self-contined
- don't include machine/adbsys.h - we only needed it for a couple #defines,
none of which are arch-specific
- move all the ADB definitions to adbvar.h
 1.24 10-Jun-2025  martin Restore MSCLASS_* defines to fix the build for now - something did go wrong
in the previous commit obviously.
 1.23 10-Jun-2025  macallan properly support ancient, non-programmable MicroSpeed trackballs
with this the left and right buttons behave as expected, the middle button does
some weird toggle thing that, as far as I can tell, can't be changed.
Unlike newer models this one doesn't respond to any register writes other than
what's required for ADB device discovery and setup, the handler ID can't be
changed, and register 1 and 2 return nothing.
should probably be adapted to mac68k's ams.c
 1.22 11-Feb-2024  andvar branches: 1.22.2;
Fix few more typos in comments and log message:
s/butoon/button/
s/BUTTOM/BOTTOM/
s/communicaiton/communication/
s/recevice/receive/
s/regiion/region/
 1.21 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.20 24-Apr-2021  thorpej branches: 1.20.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.19 05-Sep-2019  macallan branches: 1.19.10;
now that I figured out how the checksum for the Kensington Turbo Mouse's
init command works:
- document it
- calculate the checksum instead of hardcoding it, so the init command can be
easily changed
- drop the first init string - it's entirely overwritten by the 2nd
- remove some debug goop
 1.18 31-Aug-2019  macallan fix Kensington Turbo Mouse support properly
- program the buttons sanely ( as left & right mouse buttons, no toggles and
no ridiculous debounce delay either ) - apparently the init values were
cargo culted from cthulhu knows where
- don't fudge buttons anymore, now that they behave sanely
- add comments on what I could figure out the init command actually does
- leave in code to find checksum values for init commands, at least until I
can figure out what exactly the checksum is
Todo: deal with models that have more than 2 buttons, figure out what the rest
of the init command does
 1.17 30-Aug-2019  macallan make Kensington Turbo Mouse ( actually a trackball ) work:
- this thing speaks EMP, act like it
- adjust the *way* excessive timeout for trying to enable EMP mode on mice -
for some reason this trackball shows up as two devices - the trackball and a
non-functional non-EMP mouse
- map both buttons to button 0 - one is an on/off switch for button 0, the
other shows up as regular button 1
 1.16 29-Oct-2014  macallan branches: 1.16.20;
actually support EMP
( as in, look for additional motion info bits, not just buttons )
 1.15 18-Nov-2013  nisimura minor tweaks to shut gcc4.8 warning off.
 1.14 27-Oct-2012  chs branches: 1.14.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.13 02-Jun-2012  dsl branches: 1.13.2;
Add some pre-processor magic to verify that the type of the data item
passed to sysctl_createv() actually matches the declared type for
the item itself.
In the places where the caller specifies a function and a structure
address (typically the 'softc') an explicit (void *) cast is now needed.
Fixes bugs in sys/dev/acpi/asus_acpi.c sys/dev/bluetooth/bcsp.c
sys/kern/vfs_bio.c sys/miscfs/syncfs/sync_subr.c and setting
AcpiGbl_EnableAmlDebugObject.
(mostly passing the address of a uint64_t when typed as CTLTYPE_INT).
I've test built quite a few kernels, but there may be some unfixed MD
fallout. Most likely passing &char[] to char *.
Also add CTLFLAG_UNSIGNED for unsiged decimals - not set yet.
 1.12 18-Aug-2011  christos branches: 1.12.2;
Fix gcc-4.5 warnings. If you still see them, e-mail them to me.
 1.11 01-Aug-2011  mbalmer According to the Oxford Dictionary of Etymology, a wether is a male sheep
or ram.
 1.10 28-Jul-2011  macallan sanitize sysctl interface in order to appease gcc 4.5
 1.9 11-Aug-2010  macallan Make the movement-while-tapping threshold smaller so moving the cursor by a
few pixels won't trigger a button event. This should probably become a sysctl
knob.
While there, remove some commented out stuff and fix a typo.
 1.8 26-Mar-2008  matt branches: 1.8.4; 1.8.24; 1.8.26;
split softc/device_t
 1.7 16-Apr-2007  macallan branches: 1.7.28;
more autoconfig cosmetics
 1.6 04-Mar-2007  christos branches: 1.6.2; 1.6.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.5 20-Feb-2007  macallan branches: 1.5.2;
update copyrights
 1.4 10-Feb-2007  tsutsui branches: 1.4.2;
Fix botch on newlock2 merge.
 1.3 09-Feb-2007  ad Merge newlock2 to head.
 1.2 09-Feb-2007  macallan add a sysctl to turn off tapping to button event translation, same as in
ams
 1.1 17-Jan-2007  macallan branches: 1.1.2;
new, simplified ADB drivers
 1.1.2.2 06-Feb-2007  ad Fix CVS screwup.
 1.1.2.1 17-Jan-2007  ad file adb_ms.c was added on branch newlock2 on 2007-02-06 17:10:30 +0000
 1.4.2.3 07-May-2007  yamt sync with head.
 1.4.2.2 12-Mar-2007  rmind Sync with HEAD.
 1.4.2.1 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.5.2.3 03-Sep-2007  yamt sync with head.
 1.5.2.2 26-Feb-2007  yamt sync with head.
 1.5.2.1 20-Feb-2007  yamt file adb_ms.c was added on branch yamt-lazymbuf on 2007-02-26 09:09:58 +0000
 1.6.4.1 11-Jul-2007  mjf Sync with head.
 1.6.2.1 27-May-2007  ad Sync with head.
 1.7.28.1 03-Apr-2008  mjf Sync with HEAD.
 1.8.26.1 05-Mar-2011  rmind sync with head
 1.8.24.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.8.4.1 09-Oct-2010  yamt sync with head
 1.12.2.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.12.2.1 30-Oct-2012  yamt sync with head
 1.13.2.3 03-Dec-2017  jdolecek update from HEAD
 1.13.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.13.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.14.2.1 18-May-2014  rmind sync with head
 1.16.20.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.19.10.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.20.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.22.2.1 02-Aug-2025  perseant Sync with HEAD
 1.3 14-May-2022  manu Add ISO and JIS keyboard layouts for ADB to USB emulation

The layout is configurable using sysctl machdep.adbkbdX.emulate_usb:
0 = no emulation
1 = ANSI
2 = ISO (new with this change)
3 = JIS (new with this change)

Default value is detected using the ADB keyboard handler id. JIS
default is disabled until it is tested.
 1.2 08-Nov-2014  macallan nicely ask the keyboard to distinguish between left and right Control, Alt
and Shift keys.
Welcome to the world of accents and diacritics!
 1.1 29-Aug-2012  macallan branches: 1.1.2; 1.1.4; 1.1.16;
when in event mode, optionally pretend to be a USB keyboard
with this USB and ADB keyboards can coexist at the same mux, with X just
listening to /dev/wskbd instead of having to open each one separately
this can be controlled via sysctl, defaults to off for now
needs testing with non-US keyboards
 1.1.16.1 05-Jul-2016  snj Pull up following revision(s) (requested by sevan in ticket #1187):
sys/dev/adb/adb_kbd.c: revision 1.23
sys/dev/adb/adb_keymap.h: revisions 1.5, 1.6
sys/dev/adb/adb_usb_map.c: revision 1.2
nicely ask the keyboard to distinguish between left and right Control, Alt
and Shift keys.
Welcome to the world of accents and diacritics!
--
Add us.dvorak keymap variant for ADB keyboards. Addresses PR 51255.
Tested by sevan@.
 1.1.4.2 30-Oct-2012  yamt sync with head
 1.1.4.1 29-Aug-2012  yamt file adb_usb_map.c was added on branch yamt-pagecache on 2012-10-30 17:20:52 +0000
 1.1.2.1 03-Dec-2017  jdolecek update from HEAD
 1.6 16-Jun-2025  macallan move a couple more ADB macros into adbvar.h, drop <machine/keyboard.h>
 1.5 11-Jun-2025  macallan make this actually self-contined
- don't include machine/adbsys.h - we only needed it for a couple #defines,
none of which are arch-specific
- move all the ADB definitions to adbvar.h
 1.4 16-Apr-2020  rin branches: 1.4.26;
Revert previous for now:
http://mail-index.netbsd.org/source-changes/2020/04/16/msg116278.html

The reasoning turned out to be wrong; __KERNEL_RCSID() in header files
does *not* overwrite RCSID in main source files. The real problem is that
it inserts its RCSID into *every* object files. However, it can be still
useful even if heavily duplicated.
 1.3 16-Apr-2020  rin Stop using __KERNEL_RCSID() in header files; it confuses ident(1) by
overwriting RCSID in main source files.

XXX
The first argument of __KERNEL_RCSID() is neglected for ELF. If we wish
to have RCSID of header files in kernel binary, we need something like
__FBSDID() macro in FreeBSD.
 1.2 29-Apr-2008  martin branches: 1.2.100;
Convert to new 2 clause license
 1.1 17-Jan-2007  macallan branches: 1.1.2; 1.1.6; 1.1.44; 1.1.46; 1.1.48;
new, simplified ADB drivers
 1.1.48.1 16-May-2008  yamt sync with head.
 1.1.46.1 18-May-2008  yamt sync with head.
 1.1.44.1 02-Jun-2008  mjf Sync with HEAD.
 1.1.6.2 26-Feb-2007  yamt sync with head.
 1.1.6.1 17-Jan-2007  yamt file adbvar.h was added on branch yamt-lazymbuf on 2007-02-26 09:09:58 +0000
 1.1.2.2 06-Feb-2007  ad Fix CVS screwup.
 1.1.2.1 17-Jan-2007  ad file adbvar.h was added on branch newlock2 on 2007-02-06 17:10:30 +0000
 1.2.100.1 20-Apr-2020  bouyer Sync with HEAD
 1.4.26.1 02-Aug-2025  perseant Sync with HEAD
 1.10 31-Aug-2020  macallan defparam and use ADBKBD_LAYOUT, default to KB_US|KB_APPLE for tradition
 1.9 08-Sep-2019  macallan add driver for Kensington Turbo Mouse ( actually a trackball )
the adbms driver contains basic support, this driver lets you program the
buttons, I'll add other features once I figure out how they work
 1.8 06-Jun-2019  macallan - call Debugger() from adbkbd_keys() instead of the task queue
- add options ADBKBD_POWER_DDB to enable DDB-on-Power by default
 1.7 30-Aug-2012  macallan branches: 1.7.40;
add options ADBKBD_EMUL_USB to turn USB emulation on by default
 1.6 29-Aug-2012  macallan when in event mode, optionally pretend to be a USB keyboard
with this USB and ADB keyboards can coexist at the same mux, with X just
listening to /dev/wskbd instead of having to open each one separately
this can be controlled via sysctl, defaults to off for now
needs testing with non-US keyboards
 1.5 16-Apr-2007  macallan branches: 1.5.68;
add a very simple driver for ADB button devices found on halfway recent
*Books. So far it only returns function key events.
 1.4 20-Feb-2007  macallan branches: 1.4.2; 1.4.6; 1.4.8;
report power button events to sysmon
 1.3 10-Feb-2007  tsutsui branches: 1.3.2;
Fix botch on newlock2 merge.
 1.2 09-Feb-2007  ad Merge newlock2 to head.
 1.1 17-Jan-2007  macallan new, simplified ADB drivers
 1.3.2.2 07-May-2007  yamt sync with head.
 1.3.2.1 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.4.8.1 11-Jul-2007  mjf Sync with head.
 1.4.6.1 27-May-2007  ad Sync with head.
 1.4.2.3 03-Sep-2007  yamt sync with head.
 1.4.2.2 26-Feb-2007  yamt sync with head.
 1.4.2.1 20-Feb-2007  yamt file files.adb was added on branch yamt-lazymbuf on 2007-02-26 09:09:58 +0000
 1.5.68.1 30-Oct-2012  yamt sync with head
 1.7.40.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.7.40.1 10-Jun-2019  christos Sync with HEAD

RSS XML Feed