History log of /freebsd-11-stable/sys/dev/kbd/kbd.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 356013 22-Dec-2019 kevans

MFC r355796-r355797, r355799: kbd: defaults for get_fkeystr/diag

The genkbd version of these remains exposed for stable branches, but
keyboard drivers that just want to use the defaults can simply not provide
their own. There shouldn't be any unset in the wild.

r355796:
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.

r355797:
chrome_kb: remove default get_fkeystr/diag implementations

This file was missed in r355796, but no harm would have come from this.

r355799:
kbd: patch linker set methods, too

This is needed after r355796. Some double-registration of kbd drivers needs
to be sorted out, then this sysinit will simply add these drivers into the
normal list and kill off any other bits in the driver that are aware of the
linker set, for simplicity.


# 331722 29-Mar-2018 eadler

Revert r330897:

This was intended to be a non-functional change. It wasn't. The commit
message was thus wrong. In addition it broke arm, and merged crypto
related code.

Revert with prejudice.

This revert skips files touched in r316370 since that commit was since
MFCed. This revert also skips files that require $FreeBSD$ property
changes.

Thank you to those who helped me get out of this mess including but not
limited to gonzo, kevans, rgrimes.

Requested by: gjb (re)


# 330897 14-Mar-2018 eadler

Partial merge of the SPDX changes

These changes are incomplete but are making it difficult
to determine what other changes can/should be merged.

No objections from: pfg


# 312351 17-Jan-2017 lifanov

MFC r311650

Restore priority value for OGIO_KEYMAP

PR: 206678
Submitted by: ecturt@gmail.com
Reviewed by: cem
Approved by: cem, matthew (mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D5095


# 307634 19-Oct-2016 emaste

MFC r307145: Use M_WAITOK in PIO_KEYMAP ioctl

The malloc return value is not checked.


# 305846 15-Sep-2016 emaste

MFC r303335: apply some style(9) to kbd: make function name start in column 1


# 302408 07-Jul-2016 gjb

Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle.
Prune svn:mergeinfo from the new branch, as nothing has been merged
here.

Additional commits post-branch will follow.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


/freebsd-11-stable/MAINTAINERS
/freebsd-11-stable/cddl
/freebsd-11-stable/cddl/contrib/opensolaris
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/zfs
/freebsd-11-stable/cddl/contrib/opensolaris/lib/libzfs
/freebsd-11-stable/contrib/amd
/freebsd-11-stable/contrib/apr
/freebsd-11-stable/contrib/apr-util
/freebsd-11-stable/contrib/atf
/freebsd-11-stable/contrib/binutils
/freebsd-11-stable/contrib/bmake
/freebsd-11-stable/contrib/byacc
/freebsd-11-stable/contrib/bzip2
/freebsd-11-stable/contrib/com_err
/freebsd-11-stable/contrib/compiler-rt
/freebsd-11-stable/contrib/dialog
/freebsd-11-stable/contrib/dma
/freebsd-11-stable/contrib/dtc
/freebsd-11-stable/contrib/ee
/freebsd-11-stable/contrib/elftoolchain
/freebsd-11-stable/contrib/elftoolchain/ar
/freebsd-11-stable/contrib/elftoolchain/brandelf
/freebsd-11-stable/contrib/elftoolchain/elfdump
/freebsd-11-stable/contrib/expat
/freebsd-11-stable/contrib/file
/freebsd-11-stable/contrib/gcc
/freebsd-11-stable/contrib/gcclibs/libgomp
/freebsd-11-stable/contrib/gdb
/freebsd-11-stable/contrib/gdtoa
/freebsd-11-stable/contrib/groff
/freebsd-11-stable/contrib/ipfilter
/freebsd-11-stable/contrib/ldns
/freebsd-11-stable/contrib/ldns-host
/freebsd-11-stable/contrib/less
/freebsd-11-stable/contrib/libarchive
/freebsd-11-stable/contrib/libarchive/cpio
/freebsd-11-stable/contrib/libarchive/libarchive
/freebsd-11-stable/contrib/libarchive/libarchive_fe
/freebsd-11-stable/contrib/libarchive/tar
/freebsd-11-stable/contrib/libc++
/freebsd-11-stable/contrib/libc-vis
/freebsd-11-stable/contrib/libcxxrt
/freebsd-11-stable/contrib/libexecinfo
/freebsd-11-stable/contrib/libpcap
/freebsd-11-stable/contrib/libstdc++
/freebsd-11-stable/contrib/libucl
/freebsd-11-stable/contrib/libxo
/freebsd-11-stable/contrib/llvm
/freebsd-11-stable/contrib/llvm/projects/libunwind
/freebsd-11-stable/contrib/llvm/tools/clang
/freebsd-11-stable/contrib/llvm/tools/lldb
/freebsd-11-stable/contrib/llvm/tools/llvm-dwarfdump
/freebsd-11-stable/contrib/llvm/tools/llvm-lto
/freebsd-11-stable/contrib/mdocml
/freebsd-11-stable/contrib/mtree
/freebsd-11-stable/contrib/ncurses
/freebsd-11-stable/contrib/netcat
/freebsd-11-stable/contrib/ntp
/freebsd-11-stable/contrib/nvi
/freebsd-11-stable/contrib/one-true-awk
/freebsd-11-stable/contrib/openbsm
/freebsd-11-stable/contrib/openpam
/freebsd-11-stable/contrib/openresolv
/freebsd-11-stable/contrib/pf
/freebsd-11-stable/contrib/sendmail
/freebsd-11-stable/contrib/serf
/freebsd-11-stable/contrib/sqlite3
/freebsd-11-stable/contrib/subversion
/freebsd-11-stable/contrib/tcpdump
/freebsd-11-stable/contrib/tcsh
/freebsd-11-stable/contrib/tnftp
/freebsd-11-stable/contrib/top
/freebsd-11-stable/contrib/top/install-sh
/freebsd-11-stable/contrib/tzcode/stdtime
/freebsd-11-stable/contrib/tzcode/zic
/freebsd-11-stable/contrib/tzdata
/freebsd-11-stable/contrib/unbound
/freebsd-11-stable/contrib/vis
/freebsd-11-stable/contrib/wpa
/freebsd-11-stable/contrib/xz
/freebsd-11-stable/crypto/heimdal
/freebsd-11-stable/crypto/openssh
/freebsd-11-stable/crypto/openssl
/freebsd-11-stable/gnu/lib
/freebsd-11-stable/gnu/usr.bin/binutils
/freebsd-11-stable/gnu/usr.bin/cc/cc_tools
/freebsd-11-stable/gnu/usr.bin/gdb
/freebsd-11-stable/lib/libc/locale/ascii.c
/freebsd-11-stable/sys/cddl/contrib/opensolaris
/freebsd-11-stable/sys/contrib/dev/acpica
/freebsd-11-stable/sys/contrib/ipfilter
/freebsd-11-stable/sys/contrib/libfdt
/freebsd-11-stable/sys/contrib/octeon-sdk
/freebsd-11-stable/sys/contrib/x86emu
/freebsd-11-stable/sys/contrib/xz-embedded
/freebsd-11-stable/usr.sbin/bhyve/atkbdc.h
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.c
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.h
/freebsd-11-stable/usr.sbin/bhyve/console.c
/freebsd-11-stable/usr.sbin/bhyve/console.h
/freebsd-11-stable/usr.sbin/bhyve/pci_fbuf.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.h
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.c
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.h
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.c
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.h
/freebsd-11-stable/usr.sbin/bhyve/rfb.c
/freebsd-11-stable/usr.sbin/bhyve/rfb.h
/freebsd-11-stable/usr.sbin/bhyve/sockstream.c
/freebsd-11-stable/usr.sbin/bhyve/sockstream.h
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.c
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.h
/freebsd-11-stable/usr.sbin/bhyve/usb_mouse.c
/freebsd-11-stable/usr.sbin/bhyve/vga.c
/freebsd-11-stable/usr.sbin/bhyve/vga.h
# 300089 17-May-2016 glebius

Use unsigned version of min() when handling arguments of SETFKEY ioctl.

Submitted by: C Turt <cturt hardenedbsd.org>
Security: SA-16:18
Security: CVE-2016-1886


# 298955 03-May-2016 pfg

sys/dev: minor spelling fixes.

Most affect comments, very few have user-visible effects.


# 298848 30-Apr-2016 pfg

sys: Make use of our rounddown() macro when sys/param.h is available.

No functional change.


# 298307 19-Apr-2016 pfg

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


# 227309 07-Nov-2011 ed

Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.

The SYSCTL_NODE macro defines a list that stores all child-elements of
that node. If there's no SYSCTL_DECL macro anywhere else, there's no
reason why it shouldn't be static.


# 224126 17-Jul-2011 ed

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.


# 213770 13-Oct-2010 rpaulo

Explicitly tell the compiler that we don't care about the return value
of kbdd_ioctl().


# 197400 22-Sep-2009 ed

Use an unsigned integer for storing the key code.

It seems Clang breaks when checking for SPCLKEY, which is now
0x80000000. Using an unsigned integer fixes this. This is also
consistent with other pieces of kbd/syscons code, because these also use
u_int.

Submitted by: rdivacky


# 197330 19-Sep-2009 ed

Make the keyboard layer Unicode aware.

Just take keyent_t to use an u_int to store the Unicode codepoints.
Unfortunately the keymap is now too big to be loaded using an ioctl
argument, so change the ioctl to pick a pointer.

This change breaks kbdcontrol ABI. It doesn't break X11, because X11
doesn't do anything with syscons keymaps. It just switches the device
out of K_XLATE.

Obtained from: //depot/user/ed/newcons/...


# 193512 05-Jun-2009 ed

Move buffer management into kbd and kbdmux drivers.

These two drivers seem to be the last consumers of clists. clists are
quite overengineered for simple circular buffers, so I'm adding similar
buffer management routines to the kbd and kbdmux drivers. The input
buffer is now part of the softc structures, instead of having
dynamically allocated cblocks.


# 183397 27-Sep-2008 ed

Replace all calls to minor() with dev2unit().

After I removed all the unit2minor()/minor2unit() calls from the kernel
yesterday, I realised calling minor() everywhere is quite confusing.
Character devices now only have the ability to store a unit number, not
a minor number. Remove the confusion by using dev2unit() everywhere.

This commit could also be considered as a bug fix. A lot of drivers call
minor(), while they should actually be calling dev2unit(). In -CURRENT
this isn't a problem, but it turns out we never had any problem reports
related to that issue in the past. I suspect not many people connect
more than 256 pieces of the same hardware.

Reviewed by: kib


# 180777 24-Jul-2008 ed

Don't include <sys/tty.h> in non-TTY drivers.

The kbd, kbdmux, ugen and uhid drivers included <sys/tty.h>, because
they needed clists, which have been moved to <sys/clist.h> some time
ago. In the MPSAFE TTY branch, <sys/tty.h> does not include
<sys/clist.h>, which means we have to teach these drivers to include
this header file directly.

Approved by: philip (mentor, implicit)


# 174984 29-Dec-2007 wkoszek

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


# 164033 06-Nov-2006 rwatson

Sweep kernel replacing suser(9) calls with priv(9) calls, assigning
specific privilege names to a broad range of privileges. These may
require some future tweaking.

Sponsored by: nCircle Network Security, Inc.
Obtained from: TrustedBSD Project
Discussed on: arch@
Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri,
Alex Lyashkov <umka at sevcity dot net>,
Skip Ford <skip dot ford at verizon dot net>,
Antoine Brodin <antoine dot brodin at laposte dot net>


# 156126 28-Feb-2006 emax

Integrate kbdmux(4) into syscons(4) and kbd code.

By default syscons(4) will look for the kbdmux(4) keyboard first, and then,
if not found, look for any keyboard.

Current kbd code is modified so if kbdmux(4) is the current keyboard, all
new keyboards are automatically added to the kbdmux(4).

Switch to kbdmux(4) can be done at boot time, by loading kbdmux module at
the loader prompt, or at runtime, by kldload'ing the kbdmux module and
releasing current active keyboard.

If, for whatever reason, kbdmux(4) is not required/desired then just do
not load it and everything should work as before. It is also possible to
kldunload kbdmux at runtime and syscons(4) will automatically switch to
the first available keyboard.

No response from: freebsd-current@
MFC after: 1 day


# 147980 13-Jul-2005 emax

kbdmux(4) keyboard multiplexer integration

o Add two new ioctl's KBADDKBD and KBRELKBD. These are used to add and remove
keyboard to (and from) kbdmux(4) keyboard multiplexer;

o Introduce new kbd_find_keyboard2() function. It does exactly the same job
as kbd_find_keyboard() function except it allows to specify starting index.
This function can be used to iterate over keyboards array;

o Re-implement kbd_find_keyboard() as call to kbd_find_keyboard2() with starting
index of zero;

o Make sure syscons(4) passed KBADDKBD and KBRELKBD ioctl's onto currently
active keyboard.

These changes should not have any visible effect.

MFC after: 1 week


# 139193 22-Dec-2004 phk

#include fcntl.h not vnode.h. Check O_NONBLOCK not IO_NDELAY.


# 130585 16-Jun-2004 phk

Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.


# 127752 02-Apr-2004 des

style(9): return foo -> return (foo)
also fix a continuation indent I missed in the previous commit.


# 127751 02-Apr-2004 des

Clean up whitespace, fix continuation indents, wrap some long lines.


# 126080 21-Feb-2004 phk

Device megapatch 4/6:

Introduce d_version field in struct cdevsw, this must always be
initialized to D_VERSION.

Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing
four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.


# 126076 21-Feb-2004 phk

Device megapatch 1/6:

Free approx 86 major numbers with a mostly automatically generated patch.

A number of strategic drivers have been left behind by caution, and a few
because they still (ab)use their major number.


# 125087 27-Jan-2004 des

While USB keyboards attach as ukbd[0-9]+, the device node created by
kbd_attach() is called kbd[0-9]+, with a different unit number. This
makes it impossible to write a devd rule which will automatically
switch to a USB keyboard when one is attached, because there is no way
to guess the correct device node to pass to kbdcontrol.

Therefore, change kbd_attach() to create a device node using the
keyboard device's real name (atkbd0, ukbd0...), and create the
kbd[0-9]+ node as an alias for backward compatibility.


# 122352 09-Nov-2003 tanimura

- Implement selwakeuppri() which allows raising the priority of a
thread being waken up. The thread waken up can run at a priority as
high as after tsleep().

- Replace selwakeup()s with selwakeuppri()s and pass appropriate
priorities.

- Add cv_broadcastpri() which raises the priority of the broadcast
threads. Used by selwakeuppri() if collision occurs.

Not objected in: -arch, -current


# 120502 27-Sep-2003 phk

Fix dev_t handling to avoid needless makedev() call.


# 119418 24-Aug-2003 obrien

Use __FBSDID().
Also some minor style cleanups.


# 112050 09-Mar-2003 dwmalone

Add a a sysctl, hw.kbd.keymap_restrict_change, which acts a bit
like secure level but which restricts changes to the keymap. Its
values impose the following restrictions:

0: No restriction - this is the default.
1: Only root can change restricted keys (like boot, panic, ...)
2: Only root can change restricted keys and regular keys.
Other users still can change accents and function keys.
3: Only root can change restricted keys, regular keys and accents.
4: Only root can change any of the keymap (restricted keys, regular
keys, accents and function keys).

Unfortunately, the keyboard's accent map is cleared when a new keymap
is loaded, which makes the distinction between level 3 and level 4
less useful.

The MAC guys might like to make this a policy?

No objections from: -audit about 6 moths ago


# 111815 03-Mar-2003 phk

Gigacommit to improve device-driver source compatibility between
branches:

Initialize struct cdevsw using C99 sparse initializtion and remove
all initializations to default values.

This patch is automatically generated and has been tested by compiling
LINT with all the fields in struct cdevsw in reverse order on alpha,
sparc64 and i386.

Approved by: re(scottl)


# 111748 02-Mar-2003 des

More low-hanging fruit: kill caddr_t in calls to wakeup(9) / [mt]sleep(9).


# 111119 19-Feb-2003 imp

Back out M_* changes, per decision of the TRB.

Approved by: trb


# 109623 21-Jan-2003 alfred

Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.


# 92252 13-Mar-2002 alfred

Fixes to make select/poll mpsafe.

Problem:
selwakeup required calling pfind which would cause lock order
reversals with the allproc_lock and the per-process filedesc lock.
Solution:
Instead of recording the pid of the select()'ing process into the
selinfo structure, actually record a pointer to the thread. To
avoid dereferencing a bad address all the selinfo structures that
are in use by a thread are kept in a list hung off the thread
(protected by sellock). When a selwakeup occurs the selinfo is
removed from that threads list, it is also removed on the way out
of select or poll where the thread will traverse its list removing
all the selinfos from its own list.

Problem:
Previously the PROC_LOCK was used to provide the mutual exclusion
needed to ensure proper locking, this couldn't work because there
was a single condvar used for select and poll and condvars can
only be used with a single mutex.
Solution:
Introduce a global mutex 'sellock' which is used to provide mutual
exclusion when recording events to wait on as well as performing
notification when an event occurs.

Interesting note:
schedlock is required to manipulate the per-thread TDF_SELECT
flag, however if given its own field it would not need schedlock,
also because TDF_SELECT is only manipulated under sellock one
doesn't actually use schedlock for syncronization, only to protect
against corruption.

Proc locks are no longer used in select/poll.

Portions contributed by: davidc


# 83366 12-Sep-2001 julian

KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

Sorry john! (your next MFC will be a doosie!)

Reviewed by: peter@freebsd.org, dillon@freebsd.org

X-MFC after: ha ha ha ha


# 80040 20-Jul-2001 yokota

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


# 78161 13-Jun-2001 peter

With this commit, I hereby pronounce gensetdefs past its use-by date.

Replace the a.out emulation of 'struct linker_set' with something
a little more flexible. <sys/linker_set.h> now provides macros for
accessing elements and completely hides the implementation.

The linker_set.h macros have been on the back burner in various
forms since 1998 and has ideas and code from Mike Smith (SET_FOREACH()),
John Polstra (ELF clue) and myself (cleaned up API and the conversion
of the rest of the kernel to use it).

The macros declare a strongly typed set. They return elements with the
type that you declare the set with, rather than a generic void *.

For ELF, we use the magic ld symbols (__start_<setname> and
__stop_<setname>). Thanks to Richard Henderson <rth@redhat.com> for the
trick about how to force ld to provide them for kld's.

For a.out, we use the old linker_set struct.

NOTE: the item lists are no longer null terminated. This is why
the code impact is high in certain areas.

The runtime linker has a new method to find the linker set
boundaries depending on which backend format is in use.

linker sets are still module/kld unfriendly and should never be used
for anything that may be modular one day.

Reviewed by: eivind


# 74810 26-Mar-2001 phk

Send the remains (such as I have located) of "block major numbers" to
the bit-bucket.


# 69781 08-Dec-2000 dwmalone

Convert more malloc+bzero to malloc+M_ZERO.

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


# 67882 29-Oct-2000 phk

Remove unneeded #include <sys/proc.h> lines.


# 66834 08-Oct-2000 phk

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.


# 65759 11-Sep-2000 dwmalone

Add the ability to define a "shutdown" and "shutdown and poweroff" key
to syscons. I have a man page to follow describing the format of the
kbdmap file.

PR: 19273
Reviewed by: sheldonh


# 60938 26-May-2000 jake

Back out the previous change to the queue(3) interface.
It was not discussed and should probably not happen.

Requested by: msmith and others


# 60833 23-May-2000 jake

Change the way that the queue(3) structures are declared; don't assume that
the type argument to *_HEAD and *_ENTRY is a struct.

Suggested by: phk
Reviewed by: phk
Approved by: mdodd


# 56836 29-Jan-2000 peter

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.


# 55820 11-Jan-2000 yokota

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.


# 54545 13-Dec-1999 yokota

- Add a module event function to the ukbd driver and make the ukbd KLD
module work.
- Delete unnecessary #include.


# 54543 13-Dec-1999 yokota

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


# 54382 10-Dec-1999 yokota

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


# 51658 25-Sep-1999 phk

Remove five now unused fields from struct cdevsw. They should never
have been there in the first place. A GENERIC kernel shrinks almost 1k.

Add a slightly different safetybelt under nostop for tty drivers.

Add some missing FreeBSD tags


# 50477 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 50154 22-Aug-1999 yokota

- 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


# 47640 31-May-1999 phk

Simplify cdevsw registration.

The cdevsw_add() function now finds the major number(s) in the
struct cdevsw passed to it. cdevsw_add_generic() is no longer
needed, cdevsw_add() does the same thing.

cdevsw_add() will print an message if the d_maj field looks bogus.

Remove nblkdev and nchrdev variables. Most places they were used
bogusly. Instead check a dev_t for validity by seeing if devsw()
or bdevsw() returns NULL.

Move bdevsw() and devsw() functions to kern/kern_conf.c

Bump __FreeBSD_version to 400006

This commit removes:
72 bogus makedev() calls
26 bogus SYSINIT functions

if_xe.c bogusly accessed cdevsw[], author/maintainer please fix.

I4b and vinum not changed. Patches emailed to authors. LINT
probably broken until they catch up.


# 47625 30-May-1999 phk

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.


# 47624 30-May-1999 phk

Don't bogusly define a d_reset_t function.


# 47295 18-May-1999 yokota

Silence warnings.


# 47294 18-May-1999 yokota

Remove unnecessary function call.


# 44628 10-Mar-1999 yokota

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.


# 42573 12-Jan-1999 yokota

Fix PIO_KEYMAPENT/GIO_KEYMAPENT. They used to copy from/to a wrong place.
The bug found by: Mike Zanker <A.M.Zanker@open.ac.uk>


# 42564 12-Jan-1999 yokota

Clean up warnings: get conditional compilation right so that a local
function won't be defined unless it is actually used.
Requested by: eivind


# 42421 09-Jan-1999 yokota

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.)