History log of /freebsd-current/sys/dev/atkbdc/atkbd.c
Revision Date Author Comments
# 685dc743 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 971bac5a 06-Jul-2023 Michael <git@paepcke.de>

kbd: consolidate kb interfaces (phase one)

Refactor to eliminate duplicated rate and delay tables, with minor style
tweaks for changed lines. Remove an obsolete comment about needing to
convert from microseconds to ticks (that's done elsewhere). Remove
traiing whitespace in kbdcontrol.c.

Except for the new warning, no change in behavior

Sponsored by: DSS GmbH
Reviewed by: imp [minor style tweaks as well]
Pull Request: https://github.com/freebsd/pull/683
Differential Revision: https://reviews.freebsd.org/D38818


# 4d846d26 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix


# 50fce3b4 14-Feb-2023 Ed Maste <emaste@FreeBSD.org>

atkbd: correct bogus character in #ifdef

Fixes: f20058955c9d ("sys/kbio.h: make pre-unicode keymap...")
Sponsored by: The FreeBSD Foundation


# f2005895 14-Feb-2023 Stefan Eßer <se@FreeBSD.org>

sys/kbio.h: make pre-unicode keymap support optional

FreeBSD-9 had introduced support for the full set of Unicode
characters to the parsing and processing of keymap character tables.

This support has been extended to cover the table for accented
characters that are reached via dead key combinations in FreeBSD-13.2.

New ioctls have been introduced to support both the pre-Unicode and
the Unicode formats and keyboard drivers have been extended to support
those ioctls.

This commit makes the ABI compatibility functions in the kernel
optional and dependent on COMPAT_FREEBSD13 in -CURRENT.

The kbdcontrol command in -CURRENT and 13-STABLE (before 13.2) has
been made ABI compatible with old kernels to allow a new world to be
run on an old kernel (that does not have full Unicode support for
keymaps).

This commit is not to merged back to 12-STABLE or 13-STABLE. It is
part of review D38465, which has been split into 3 separate commits
due to different MFC and life-time requirements of either commit.

Approved by: imp
Differential Revision: https://reviews.freebsd.org/D38465


# 4972fb92 06-Feb-2023 Stefan Eßer <se@FreeBSD.org>

Support Unicode characters in keymap dead key tables

Support for Unicode characters had been added to the keyboard code,
but there are keymaps that have accented characters accessed via dead
key combinations, and those were still restricted to 8 bit codes.

This update to kbd.c adds support for Unicode characters and
compatibility code that allows a kbdcontrol command built from kbio.h
without these patches to work on a new kernel.

Compatibility code that allows a new kbdcontrol binary running on an
old kernel to load and display the dead key map will be committed in a
separate commit.

Reviewed by: imp, brooks
Approved by: brooks
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D38381


# 18308893 18-Nov-2022 Vladimir Kondratyev <wulf@FreeBSD.org>

evdev: Extend EVIOCGRAB ioctl scope to cover kbd interface

of various keyboard drivers.
EVIOCGRAB ioctl execution on /dev/input/event# device node gains
exclusive access to this device to caller. It is used mostly for
development purposes and remote control software. See e.g.
https://reviews.freebsd.org/D30020 which is the reason of creation
of this change.
Keyboard grabbing is disabled in KDB and during panics.

MFC with: 4a0db5e2920c
Tested by: corvink
Differential revision: https://reviews.freebsd.org/D30542


# 6a26c99f 19-Jul-2022 Vladimir Kondratyev <wulf@FreeBSD.org>

atkbd(4): Fix "hancha" and "han/yong" korean keys handling.

The Korean keyboard has two keys, the Korean/Chinese and the
Korean/English toggles, that generate scancodes 0xF1 and 0xF2
(respectively) when pressed, and nothing when released. They do not
repeat.
As Hanyong/Hancha keys are generally greater than 0x80, which is
generally considered a release key, add extra preceding press key event
to generate press/release pair.
Swap Hanyong/Hancha key codes to match reality.

Reported by: Warioburn <warioburn@yahoo.co.jp>
PR: 265260
MFC after: 1 week


# ce881170 05-Jan-2022 Alexander Motin <mav@FreeBSD.org>

atkbd: Disable periodic polling by default.

It is one of the few remaining Giant-locked callouts. It would be
good to remove it, not mentioning that polling itself is not good.

If this cause keyboard/mouse freezes on some hardware, please set
loader tunable hw.atkbd.hz=1 as workaround and report the issue.

Submitted by: imp, jhb


# 9e007a88 05-Jan-2022 Alexander Motin <mav@FreeBSD.org>

atkbd: Reduce polling rate from 10Hz to ~1Hz.

In my understanding this is only needed to workaround lost interrupts.
I was thinking to remove it completely, but the comment about edge-
triggered interrupt may be true and needs deeper investigation. ~1Hz
should be often enough to handle the supposedly rare loss cases, but
rare enough to not appear in top. Add sysctl hw.atkbd.hz to tune it.

MFC after: 1 month


# bf479e13 01-Sep-2020 Mateusz Guzik <mjg@FreeBSD.org>

atkbdc: clean up empty lines in .c and .h files


# 58aa35d4 03-Feb-2020 Warner Losh <imp@FreeBSD.org>

Remove sparc64 kernel support

Remove all sparc64 specific files
Remove all sparc64 ifdefs
Removee indireeect sparc64 ifdefs


# eefc662f 15-Dec-2019 Kyle Evans <kevans@FreeBSD.org>

kbd: provide default implementations of get_fkeystr/diag

Most keyboard drivers are using the genkbd implementations as it is;
formally use them for any that aren't set and make
genkbd_get_fkeystr/genkbd_diag private.


# 1c5c067a 15-Dec-2019 Kyle Evans <kevans@FreeBSD.org>

keyboard switch definitions: standardize on c99 initializers

A future change will provide default implementations for some of these where
it makes sense and most of them are already using the genkbd
implementation (e.g. get_fkeystr, diag).


# f86e7267 27-Oct-2018 Vladimir Kondratyev <wulf@FreeBSD.org>

evdev: Use console lock as evdev lock for all supported keyboard drivers.

Now evdev part of keyboard drivers does not take any locks if corresponding
input/eventN device node is not opened by userland consumers.

Do not assert console lock inside evdev to handle the cases when keyboard
driver is called from some special single-threaded context like shutdown
thread.


# 48f2b006 13-Aug-2018 Vladimir Kondratyev <wulf@FreeBSD.org>

evdev: Remove evdev.ko linkage dependency on kbd driver

Move evdev_ev_kbd_event() helper from evdev to kbd.c as otherwise evdev
unconditionally requires all keyboard and console stuff to be compiled
into the kernel. This dependency happens as evdev_ev_kbd_event() helper
references kbdsw global variable defined in kbd.c through use of
kbdd_ioctl() macro.

While here make all keyboard drivers respect evdev_rcpt_mask while setting
typematic rate and LEDs with evdev interface.

Requested by: Milan Obuch <bsd@dino.sk>
Reviewed by: hselasky, gonzo
Differential Revision: https://reviews.freebsd.org/D16614


# 6469bdcd 06-Apr-2018 Brooks Davis <brooks@FreeBSD.org>

Move most of the contents of opt_compat.h to opt_global.h.

opt_compat.h is mentioned in nearly 180 files. In-progress network
driver compabibility improvements may add over 100 more so this is
closer to "just about everywhere" than "only some files" per the
guidance in sys/conf/options.

Keep COMPAT_LINUX32 in opt_compat.h as it is confined to a subset of
sys/compat/linux/*.c. A fake _COMPAT_LINUX option ensure opt_compat.h
is created on all architectures.

Move COMPAT_LINUXKPI to opt_dontuse.h as it is only used to control the
set of compiled files.

Reviewed by: kib, cem, jhb, jtl
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14941


# 718cf2cc 27-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

sys/dev: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.


# 38ae0c59 02-Nov-2016 Oleksandr Tymoshenko <gonzo@FreeBSD.org>

[evdev] Add evdev support to atkbd(4) driver

To enable event sourcing from atkbd kern.evdev.rcpt_mask value
should have bit 3 set.

Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D8381


# 73a1170a 19-Apr-2016 Pedro F. Giffuni <pfg@FreeBSD.org>

sys/dev: use our nitems() macro when it is avaliable through param.h.

No functional change, only trivial cases are done in this sweep,
Drivers that can get further enhancements will be done independently.

Discussed in: freebsd-current


# 59023e6c 30-Apr-2015 Jung-uk Kim <jkim@FreeBSD.org>

Remove leftover from r282269.

MFC after: 2 weeks
X-MFC with: r282269


# b19f7eec 30-Apr-2015 Roger Pau Monné <royger@FreeBSD.org>

atkbd: remove usage of x86bios

Instead of trying to get the keyboard repeat rate set by the BIOS just set a
default one. This allows removing the usage of x86bios from atkbd.

Sponsored by: Citrix Systems R&D
Reviewed by: jkim, delphij
Differential Revision: https://reviews.freebsd.org/D2399
MFC after: 2 weeks


# 6c176113 14-Feb-2015 Michael Gmelin <grembo@FreeBSD.org>

Quirk based support of Chromebook keyboard found in Acer C720

This probably supports other devices based on SeaBIOS, which need
to be added to the smbios based quirks table.

The functionality has been ported from DragonFlyBSD and adapted
to FreeBSD's more general purpose environment.

Devices not covered by a quirk shouldn't be affected at all. Thanks
to jhb and kostikbel for reviewing the code.

Reviewed by: kostikbel, jhb
Approved by: jhb, kostikbel
Differential Revision: https://reviews.freebsd.org/D1802


# fadf3fb9 22-Sep-2014 John Baldwin <jhb@FreeBSD.org>

Convert from timeout(9) to callout(9).


# 0897438a 11-Jan-2013 Warner Losh <imp@FreeBSD.org>

Pass the device_t into atkbd_{probe,attach}_unit and get the
controller unit and keyboard unit from there. It will be needed
for other things in the future as well...


# f0143dac 11-Jan-2013 Warner Losh <imp@FreeBSD.org>

style(9) changes before I do more real changes.


# 78d4d8ee 17-Jul-2011 Ed Schouten <ed@FreeBSD.org>

Restore binary compatibility for GIO_KEYMAP and PIO_KEYMAP.

Back in 2009 I changed the ABI of the GIO_KEYMAP and PIO_KEYMAP ioctls
to support wide characters. I created a patch to add ABI compatibility
for the old calls, but I didn't get any feedback to that.

It seems now people are upgrading from 8 to 9 they experience this
issue, so add it anyway.


# d82aac76 20-Jun-2011 Xin LI <delphij@FreeBSD.org>

Correct a typo.

Submitted by: Fabian Keil <fk fabiankeil de>
MFC after: 3 days


# 97ae6667 10-Jun-2011 Xin LI <delphij@FreeBSD.org>

Add comments about the validation.


# 393ec7ad 06-Jun-2011 Jung-uk Kim <jkim@FreeBSD.org>

Validate INT 15h and 16h vectors more strictly. Traditionally these entry
points are fixed addresses and (U)EFI CSM specification also mandated that.
Unfortunately, (U)EFI CSM specification does not specifically mention this
is to call service routine via interrupt vector table or to jump directly
to the entry point. As a result, some CSM seems to install two routines
and acts differently, depending on how it was executed, unfortunately.
When INT 15h is used, it calls a function pointer (which is probably a UEFI
service function). When it jumps directly to the entry point, it executes
a simple and traditional INT 15h service routine. Therefore, actually there
are two possible fixes, i. e., this fix or jumping directly to the fixed
entry point. However, we chose this fix because a) keyboard typematic
support via BIOS is becoming extremely rarer and b) we cannot support random
service routine installed by a firmware or a boot loader. This should fix
Lenovo X220 laptop, specifically.

Reviewed by: delphij
MFC after: 3 days


# 7d09e4ab 06-Jun-2011 Jung-uk Kim <jkim@FreeBSD.org>

Revert r222152. The root cause was analysed and better fix is upcoming.

Discussed with: delphij


# dd4aae65 20-May-2011 Xin LI <delphij@FreeBSD.org>

Add a new knob to atkbd(4) to enable typematic rate detection on boot,
which is now disabled by default. The detection is known to cause hangs
on boot with some new Lenovo laptops on FreeBSD/amd64.

Reported by: gnn
Discussed with: jkim
MFC after: 3 months


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# aa3d547d 01-Mar-2010 Xin LI <delphij@FreeBSD.org>

MFC x86emu/x86bios emulator and make previously i386 only dpms and vesa
framebuffer driver, etc. work on FreeBSD/amd64.

A significant amount of improvements were done by jkim@ during the recent
months to make vesa(4) work better, over the initial code import. This
work is based on OpenBSD's x86emu implementation and contributed by
paradox <ddkprog yahoo com> and swell.k at gmail com.

Hopefully I have stolen all their work to 8-STABLE :)

All bugs in this commit are mine, as usual.


# 3219f535 19-Oct-2009 Jung-uk Kim <jkim@FreeBSD.org>

Rewrite x86bios and update its dependent drivers.

- Do not map entire real mode memory (1MB). Instead, we map IVT/BDA and
ROM area separately. Most notably, ROM area is mapped as device memory
(uncacheable) as it should be. User memory is dynamically allocated and
free'ed with contigmalloc(9) and contigfree(9). Remove now redundant and
potentially dangerous x86bios_alloc.c. If this emulator ever grows to
support non-PC hardware, we may implement it with rman(9) later.
- Move all host-specific initializations from x86emu_util.c to x86bios.c and
remove now unnecessary x86emu_util.c. Currently, non-PC hardware is not
supported. We may use bus_space(9) later when the KPI is fixed.
- Replace all bzero() calls for emulated registers with more obviously named
x86bios_init_regs(). This function also initializes DS and SS properly.
- Add x86bios_get_intr(). This function checks if the interrupt vector is
available for the platform. It is not necessary for PC-compatible hardware
but it may be needed later. ;-)
- Do not try turning off monitor if DPMS does not support the state.
- Allocate stable memory for VESA OEM strings instead of just holding
pointers to them. They may or may not be accessible always. Fix a memory
leak of video mode table while I am here.
- Add (experimental) BIOS POST call for vesa(4). This function calls VGA
BIOS POST code from the current VGA option ROM. Some video controllers
cannot save and restore the state properly even if it is claimed to be
supported. Usually the symptom is blank display after resuming from suspend
state. If the video mode does not match the previous mode after restoring,
we try BIOS POST and force the known good initial state. Some magic was
taken from NetBSD (and it was taken from vbetool, I believe.)
- Add a loader tunable for vgapci(4) to give a hint to dpms(4) and vesa(4)
to identify who owns the VESA BIOS. This is very useful for multi-display
adapter setup. By default, the POST video controller is automatically
probed and the tunable "hw.pci.default_vgapci_unit" is set to corresponding
vgapci unit number. You may override it from loader but it is very unlikely
to be necessary. Unfortunately only AGP/PCI/PCI-E controllers can be
matched because ISA controller does not have necessary device IDs.
- Fix a long standing bug in state save/restore function. The state buffer
pointer should be ES:BX, not ES:DI according to VBE 3.0. If it ever worked,
that's because BX was always zero. :-)
- Clean up register initializations more clearer per VBE 3.0.
- Fix a lot of style issues with vesa(4).


# 7ca724d5 25-Sep-2009 Jung-uk Kim <jkim@FreeBSD.org>

Fix couple of style nits missed in the previous commit.


# ee8cbcb4 25-Sep-2009 Jung-uk Kim <jkim@FreeBSD.org>

- Use x86bios_offset() instead of BIOS_PADDRTOVADDR() macro.[1]
- Clear all registers before calling real mode interrupt handlers as we did
for dpms and vesa and re-enable the function as it should be fixed by this.
- Tidy up register access. For example, when we call INT 0x15, AH=0xc0,
we used to initialize AX=0xc000 to clear AL at the same time but it is
very confusing. We don't have to do this any more because we are explicitly
clearing all registers now.
- Check size of system configuration table although it is almost always 8.
This is to make sure we are not reading some random low physical memory.
Hopefully it is just zero in that case. :-)
- Fix some style nits and add more comments.

Submitted by: paradox (ddkprog yahoo com)[1]


# a8672748 24-Sep-2009 Jung-uk Kim <jkim@FreeBSD.org>

- Use FreeBSD function naming convention.
- Change x86biosCall() to more appropriate x86bios_intr().[1]

Discussed with: delphij, paradox (ddkprog yahoo com)
Submitted by: paradox (ddkprog yahoo com)[1]


# 19de5df5 23-Sep-2009 Jung-uk Kim <jkim@FreeBSD.org>

Move sys/dev/x86bios to sys/compat/x86bios.

It may not be optimal but it is clearly better than the old place.

OK'ed by: delphij, paradox (ddkprog yahoo com)


# bacfa53d 22-Sep-2009 Xin LI <delphij@FreeBSD.org>

Temporarily disable typematic retrieving code until we get a real fix,
which currently causes hangs in some configurations.

Reported by: joel
Submitted by: swell.k at gmail.com


# 8b1620e0 21-Sep-2009 Xin LI <delphij@FreeBSD.org>

Allow atkbd to obtain keyboard repeat rate from BIOS on amd64.

Submitted by: swell.k at gmail.com


# 018cd707 16-Apr-2009 Maksim Yevmenkin <emax@FreeBSD.org>

Prevent atkbd(4) interrupt handler from calling keyboard callback function
when polled mode is enabled. This should help with duplicated/missing
characters problem at mountroot, geli, etc. prompts on multi CPU systems
while kbdmux(4) is enabled.

Tested by: Tobias Grosser <grosser -at- fim -dot- uni-passau -dot- de>
Tested by: Fabian Keil <freebsd-listen -at- fabiankeil -dot- de>
MFC after: 3 days


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# 259699b2 29-Dec-2007 Wojciech A. Koszek <wkoszek@FreeBSD.org>

Remove explicit calls to keyboard methods with their respective variants
implemented with macros. This patch improves code readability. Reasoning
behind kbdd_* is a "keyboard discipline".

List of macros is supposed to be complete--all methods of keyboard_switch
should have their respective macros from now on.

Functionally, this code should be no-op. My intention is to leave current
behaviour of code as is.

Glanced at by: rwatson
Reviewed by: emax, marcel
Approved by: cognet


# ac3912b0 25-Oct-2006 Ruslan Ermilov <ru@FreeBSD.org>

Fix LEDs not working when atkbd is an active keyboard and the physical
keyboard is attached only after the system has already booted.

If USB keyboard is also present, and there's no kbdmux(4), the problem
has been hiding itself because as soon as we get to multi-user, the
USB keyboard becomes an active keyboard (see devd.conf), thus marking
atkbd inactive and letting the old code initialize the keyboard.

With kbdmux(4), or if there's no USB keyboard, the atkbd keyboard is
always active, whether it's physically attached or not, thus it never
initialized itself properly on a physical attach.

To fix this, move block that initialized the keyboard on attach upper
so it doesn't depend on the (KBD_IS_ACTIVE(kbd) && KBD_IS_BUSY(kbd))
condition. Also move KBD_FOUND_DEVICE() a few lines upper so that
KDSETLED and KDSETREPEAT that follow it propagate to the controller.

MFC after: 3 days


# 9fddcc66 27-Sep-2006 Ruslan Ermilov <ru@FreeBSD.org>

Fix our ioctl(2) implementation when the argument is "int". New
ioctls passing integer arguments should use the _IOWINT() macro.
This fixes a lot of ioctl's not working on sparc64, most notable
being keyboard/syscons ioctls.

Full ABI compatibility is provided, with the bonus of fixing the
handling of old ioctls on sparc64.

Reviewed by: bde (with contributions)
Tested by: emax, marius
MFC after: 1 week


# f6ce2a64 17-May-2006 Poul-Henning Kamp <phk@FreeBSD.org>

Send the pcvt(4) driver off to retirement.


# 73dbd3da 11-May-2006 John Baldwin <jhb@FreeBSD.org>

Remove various bits of conditional Alpha code and fixup a few comments.


# 6621aa5c 26-Apr-2006 Maxim Sobolev <sobomax@FreeBSD.org>

Use the same method for detecting actual presence of AT-style keyboard
controller as we use in boot blocks (querying status register until
bit 1 goes off). If that doesn't happed during reasonable period assume
that the hardware doesn't have AT-style keyboard controller. This makes
FreeBSD working almost OOB on MacBook Pro (still there are issues with
putting second CPU core on-line, but since installation CD comes with
UP kernel with this change one should be able to install FreeBSD without
playing tricks with hints). Other legacy-free hardware (e.g. IBM NetVista
S40) should benefit from this as well, but since I don't have any I can't
verify.

It should make no difference on the ordinary i386 hardware (since in
that case that hardware already would be having an issues with A20
routines in boot blocks). I don't know much about AT-style keyboard
controller on other platforms (and don't have dedicated access to one),
therefore, the code is restricted to i386 for now. I suspect that amd64
may need this as well, but I would rather leave this decision to someone
who knows better about the platform(s) in question.

I have tested this change on as many "ordinary i386 boxes" as I can get
my hands on, and it doesn't create any false negatives on hardware with
AT-style keyboard present.

MFC after: 1 month


# 520b6353 10-Jun-2005 Marius Strobl <marius@FreeBSD.org>

- Hook up the new locations of the atkbdc(4), atkbd(4) and psm(4) source
files after they were repo-copied to sys/dev/atkbdc. The sources of
atkbdc(4) and its children were moved to the new location in preparation
for adding an EBus front-end to atkbdc(4) for use on sparc64; i.e. in
order to not further scatter them over the whole tree which would have
been the result of adding atkbdc_ebus.c in e.g. sys/sparc64/ebus. Another
reason for the repo-copies was that some of the sources were misfiled,
e.g. sys/isa/atkbd_isa.c wasn't ISA-specific at all but for hanging
atkbd(4) off of atkbdc(4) and was renamed to atkbd_atkbdc.c accordingly.
Most of sys/isa/psm.c, i.e. expect for its PSMC PNP part, also isn't
ISA-specific.
- Separate the parts of atkbdc_isa.c which aren't actually ISA-specific
but are shareable between different atkbdc(4) bus front-ends into
atkbdc_subr.c (repo-copied from atkbdc_isa.c). While here use
bus_generic_rl_alloc_resource() and bus_generic_rl_release_resource()
respectively in atkbdc_isa.c instead of rolling own versions.
- Add sparc64 MD bits to atkbdc(4) and atkbd(4) and an EBus front-end for
atkbdc(4). PS/2 controllers and input devices are used on a couple of
Sun OEM boards and occur on either the EBus or the ISA bus. Depending on
the board it's either the only on-board mean to connect a keyboard and
mouse or an alternative to either RS232 or USB devices.
- Wrap the PSMC PNP part of psm.c in #ifdef DEV_ISA so it can be compiled
without isa(4) (e.g. for EBus-only machines). This ISA-specific part
isn't separated into its own source file, yet, as it requires more work
than was feasible for 6.0 in order to do it in a clean way. Actually
philip@ is working on a rewrite of psm(4) so a more comprehensive
clean-up and separation of hardware dependent and independent parts is
expected to happen after 6.0.

Tested on: i386, sparc64 (AX1105, AXe and AXi boards)
Reviewed by: philip


# ff690962 26-Feb-2005 Sam Leffler <sam@FreeBSD.org>

plug memory leak

Noticed by: Coverity Prevent analysis tool


# f5517dc8 15-Dec-2004 John Baldwin <jhb@FreeBSD.org>

Add a new flag to the atkbd(4) driver to disable testing the keyboard
port during the device probe as this can cause hangs on some machines,
specifically Compaq R3000Z series amd64 laptops. The flag is bit 3, or
0x8.

PR: amd64/67745
Reported by: Neil Winterbauer newntrbr at ucla dot edu, many others
Tested by: ade, astrodog at gmail dot com, many others
MFC after: 1 week


# 092a5c45 10-Jun-2004 John Baldwin <jhb@FreeBSD.org>

Remove atdevbase and replace it's remaining uses with direct references to
KERNBASE instead.


# 7ea199a7 07-Oct-2003 Max Khon <fjoe@FreeBSD.org>

Assign keycodes for Power, Sleep and Wake keys.

Submitted by: Eugene Grosbein <eugen@grosbein.pp.ru>


# aad970f1 24-Aug-2003 David E. O'Brien <obrien@FreeBSD.org>

Use __FBSDID().
Also some minor style cleanups.


# 8ce4e518 13-Jul-2003 Hidetoshi Shimokawa <simokawa@FreeBSD.org>

Fix for FAIL_IF_NO_KBD case as expected.

Even if we have no AT keyboard, an AT keyboard is registered because
it's probed with KB_CONF_PROBE_ONLY flag set during console initialization.
Unregister the keyboard if it doesn't present while second probe.

This should fix USB keyboard only case without 'kbdcontrol -k /dev/kbd1'.


# 8a9bc9c0 02-Jul-2003 John Baldwin <jhb@FreeBSD.org>

- Use the new resource_disabled() helper function to see if devices are
disabled.
- Change the apm driver to match the acpi driver's behavior by checking to
see if the device is disabled in the identify routine instead of in the
probe routine. This way if the device is disabled it is never created.

Note that a few places (ips(4), Alpha SMP) used "disable" instead of
"disabled" for their hint names, and these hints must be changed to
"disabled". If this is a big problem, resource_disabled() can always be
changed to honor both names.


# 51da11a2 29-Apr-2003 Mark Murray <markm@FreeBSD.org>

Fix some easy, global, lint warnings. In most cases, this means
making some local variables static. In a couple of cases, this means
removing an unused variable.


# 104a9b7e 29-Apr-2003 Alexander Kabaev <kan@FreeBSD.org>

Deprecate machine/limits.h in favor of new sys/limits.h.
Change all in-tree consumers to include <sys/limits.h>

Discussed on: standards@
Partially submitted by: Craig Rodrigues <rodrigc@attbi.com>


# c0f44a59 05-Feb-2003 Philippe Charnier <charnier@FreeBSD.org>

Spelling.


# 93b0017f 25-Aug-2002 Philippe Charnier <charnier@FreeBSD.org>

Replace various spelling with FALLTHROUGH which is lint()able


# 2ce7d7a0 09-Apr-2002 Poul-Henning Kamp <phk@FreeBSD.org>

GC various bits and pieces of USERCONFIG from all over the place.


# 2bb113d0 08-Apr-2002 Jeroen Ruigrok van der Werven <asmodai@FreeBSD.org>

Fix typo: conole -> console

PR: 33965
Submitted by: Nicola Vitale <nivit@libero.it>


# 76495257 20-Jul-2001 Kazutaka YOKOTA <yokota@FreeBSD.org>

Return consistent key action codes at key press and release
events. Otherwise you would see unexpected results if shift or
locking keys are defined to give different actions depending
on other shift/locking keys' state.

Please keep the ukbd module and the kernel in sync, otherwise
the USB keyboard won't work after this change.
MFC after: 10 days


# d2db0502 22-Jan-2001 David Malone <dwmalone@FreeBSD.org>

Free the kbd pointer when it isn't NULL, as opposed to when it is.
This was a typo in the M_ZERO patches.

Submitted by: Mike Silbersack <silby@silby.com>


# 7cc0979f 08-Dec-2000 David Malone <dwmalone@FreeBSD.org>

Convert more malloc+bzero to malloc+M_ZERO.

Submitted by: josh@zipperup.org
Submitted by: Robert Drehmel <robd@gmx.net>


# db7e3af1 15-Oct-2000 Poul-Henning Kamp <phk@FreeBSD.org>

Remove unneeded #include <machine/clock.h>


# 00d25f51 08-Oct-2000 Poul-Henning Kamp <phk@FreeBSD.org>

Initiate deorbit burn sequence for <machine/console.h>.

Replace all in-tree uses with necessary subset of <sys/{fb,kb,cons}io.h>.
This is also the appropriate fix for exo-tree sources.

Put warnings in <machine/console.h> to discourage use.
November 15th 2000 the warnings will be converted to errors.
January 15th 2001 the <machine/console.h> files will be removed.


# 2073104f 27-May-2000 Andrey A. Chernov <ache@FreeBSD.org>

Manipulate with AltGR Led (really CapsLock Led) only in K_XLATE mode, because
all other modes not set ALKED flag and it means that CapsLock always turned
off for them.
Real bug example is X11 which never turn on CapsLock with Russian keyboard.

PR: 18651
Submitted by: "Mike E. Matsnev" <mike@po.cs.msu.su>


# db3e34cb 18-Mar-2000 Kazutaka YOKOTA <yokota@FreeBSD.org>

- Properly keep track of I/O port resources.
- Use bus_space_read/write() to access the ports.


# a68d00e3 11-Mar-2000 Kazutaka YOKOTA <yokota@FreeBSD.org>

One more patch for the atkbd driver. It will make sure that the
keyboard port and interrupt is enabled and the driver is attached even
when the keyboard itself is not present when the system is booting.
(This has been the behavior through out 2.X and 3.X, but is somehow
broken in 4.0.)

# I certainly don't recommend people to `hot-plug' the AT keyboard,
# because the interface isn't designed for hot-plugging and such act
# will often break the keyboard controller. But, so many people want to
# do that anyway...

Approved by: jkh


# aec1fa1c 10-Feb-2000 Kazutaka YOKOTA <yokota@FreeBSD.org>

- Be slightly more cautious and try to make more sure the keyboard
input queue is emptied when initializing the keyboard controller.
- Remove an unnecessary `if' statement.

Approved by: jkh


# 8f8e5879 29-Jan-2000 Peter Wemm <peter@FreeBSD.org>

Use config's conditional compilation rather than using #ifdefs that make
modular compilation harder. I'm doing this because people seem to like
cut/pasting examples of bad practices in existing code.


# 7c6f57a3 20-Jan-2000 Kazutaka YOKOTA <yokota@FreeBSD.org>

- Add some comment from bde on the keyboard interrupt.
- Fix obsolete comments.


# 7642cc82 11-Jan-2000 Kazutaka YOKOTA <yokota@FreeBSD.org>

Rework shifta/ctla/alta key handling. It appears that there was
misunderstanding between the PR originator and me. I hope I got it
right this time.


# 56f5e27c 10-Jan-2000 Kazutaka YOKOTA <yokota@FreeBSD.org>

Obtain the initial key repeat rate setting via BIOS in i386 if
possible.


# 934d11e3 10-Jan-2000 Kazutaka YOKOTA <yokota@FreeBSD.org>

Add some keyboard IDs.


# 57995893 13-Dec-1999 Kazutaka YOKOTA <yokota@FreeBSD.org>

- Remember the keyboard repeat delay and rate.
- Add a new ioctl, KDGETREPEAT, to retrieve the keyboard repeat rate.
- Delete unnecessary #include.


# 82d654e8 09-Dec-1999 Kazutaka YOKOTA <yokota@FreeBSD.org>

Add support new keys: lshifta, rshifta, lctrla, rctrla, lalta, and
ralta. These keys combine shift/ctrl/alt function and the AltLock
function. When these keys pressed together with another key, they act
just like the ordinary shift/ctrl/alt keys. When these keys are
pressed and released alone, Alt lock state is toggled.

PR: kern/12475


# c3aac50f 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# 9dcbe240 23-Aug-1999 Poul-Henning Kamp <phk@FreeBSD.org>

Convert DEVFS hooks in (most) drivers to make_dev().

Diskslice/label code not yet handled.

Vinum, i4b, alpha, pc98 not dealt with (left to respective Maintainers)

Add the correct hook for devfs to kern_conf.c

The net result of this excercise is that a lot less files depends on DEVFS,
and devtoname() gets more sensible output in many cases.

A few drivers had minor additional cleanups performed relating to cdevsw
registration.

A few drivers don't register a cdevsw{} anymore, but only use make_dev().


# 800da3b2 22-Aug-1999 Kazutaka YOKOTA <yokota@FreeBSD.org>

- Remove cdevsw entry points in individual keyboard drivers;
instead, use generic entry points for all drivers.
- Eliminate bogus makedev().
- Eliminate softc in the lower drivers, as it is no longer necessary.

Submitted (95%) by: phk


# 6c6028ff 15-Aug-1999 Kazutaka YOKOTA <yokota@FreeBSD.org>

Correctly save `flags' bits.


# 29e59d7d 18-Jul-1999 Kazutaka YOKOTA <yokota@FreeBSD.org>

- Move the `return' statement the correct place so that the keyboard
won't be initialized if `atkbd?' is disabled.


# 4e2f199e 30-May-1999 Poul-Henning Kamp <phk@FreeBSD.org>

This commit should be a extensive NO-OP:

Reformat and initialize correctly all "struct cdevsw".

Initialize the d_maj and d_bmaj fields.

The d_reset field was not removed, although it is never used.

I used a program to do most of this, so all the files now use the
same consistent format. Please keep it that way.

Vinum and i4b not modified, patches emailed to respective authors.


# d3c87b85 20-May-1999 Kazutaka YOKOTA <yokota@FreeBSD.org>

- Include isa/isareg.h rather than i386/isa/isa.h for i386.
- Remove unused (thus, commented out) section of code.


# 83fc7c6c 18-May-1999 Kazutaka YOKOTA <yokota@FreeBSD.org>

The previous commit was wrong! This is the correct one ;-<


# 194da42d 08-May-1999 Kazutaka YOKOTA <yokota@FreeBSD.org>

Don't confuse cursor keys with numpad keys when composing a char code.

PR: kern/10988


# 57600c23 08-May-1999 Kazutaka YOKOTA <yokota@FreeBSD.org>

Minor tweak after the introduction of new-bus to i386; properly
check "disabled" and "flags" probe hints.


# 6182fdbd 16-Apr-1999 Peter Wemm <peter@FreeBSD.org>

Bring the 'new-bus' to the i386. This extensively changes the way the
i386 platform boots, it is no longer ISA-centric, and is fully dynamic.
Most old drivers compile and run without modification via 'compatability
shims' to enable a smoother transition. eisa, isapnp and pccard* are
not yet using the new resource manager. Once fully converted, all drivers
will be loadable, including PCI and ISA.

(Some other changes appear to have snuck in, including a port of Soren's
ATA driver to the Alpha. Soren, back this out if you need to.)

This is a checkpoint of work-in-progress, but is quite functional.

The bulk of the work was done over the last few years by Doug Rabson and
Garrett Wollman.

Approved by: core


# e9deda23 10-Mar-1999 Kazutaka YOKOTA <yokota@FreeBSD.org>

Keyboard driver update in preparation for the USB keyboard driver.

- Refined internal interface in keyboard drivers so that:
1. the side effect of device probe is kept minimal,
2. polling mode function is added,
3. and new ioctl and configuration options are added (see below).

- Added new ioctl: KDSETREPEAT
Set keyboard typematic rate. There has existed an ioctl command,
KDSETRAD, for the same purpose. However, KDSETRAD is dependent on
the AT keyboard. KDSETREPEAT provides more generic interface.
KDSETRAD will still be supported in the atkbd driver.

- Added new configuration options:
ATKBD_DFLT_KEYMAP
Specify a keymap to be used as the default, built-in keymap.
(There has been undocumented options, DKKEYMAP, UKKEYMAP, GRKEYMAP,
SWKEYMAP, RUKEYMAP, ESKEYMAP, and ISKEYMAP to set the default keymap.
These options are now gone for good. The new option is more general.)

KBD_DISABLE_KEYMAP_LOADING
Don't allow the user to change the keymap.


# ffba82a9 28-Jan-1999 Kazutaka YOKOTA <yokota@FreeBSD.org>

- Fixed the bug which always ignored Ctrl-Pause/Break on the AT 101
keyboard.
- Translate some keycode for the 84 keyboard so that the 84 keyboard
and the 101 keyboard become more compatible in terms of keycodes.
- Updated the built-in keymaps so that it is in line with the recent
changes in share/syscons/keymaps.
- Added some comment on the Pause/Break key on the 101 keyboard.


# f359876f 19-Jan-1999 Kazutaka YOKOTA <yokota@FreeBSD.org>

syscons
- Bring down the splash screen when a vty is opened for the first
time.
- Make sure the splash screen/screen saver is stopped before
switching vtys.
- Read and save initial values in the BIOS data area early.
VESA BIOS may change BIOS data values when switching modes.
- Fix missing '&' operator.
- Move ISA specific part of driver initialization to syscons_isa.c.

atkbd
- kbdtables.h is now in /sys/dev/kbd.

all
- Adjust for forthcoming alpha port. Submitted by: dfr


# 00f19754 13-Jan-1999 Kazutaka YOKOTA <yokota@FreeBSD.org>

Use the correct macro to test flags; we need KBD_IS_INITIALIZED here,
not KBD_IS_PROBED.


# 617b9080 08-Jan-1999 Kazutaka YOKOTA <yokota@FreeBSD.org>

Add the new keyboard driver and video card driver. They will be
used by console drivers.

(They are not yet activated yet. Wait for announcement later.)