Home | History | Annotate | Download | only in wscons
History log of /src/sys/dev/wscons/wskbd.c
RevisionDateAuthorComments
 1.146  07-Apr-2025  hans wsmouse(4), wskbd(4): less DIAGNOSTIC, more KASSERT

Also, add a DPRINTF to wsmouseclose() and wskbdclose(), mirroring their
respective open functions.
 1.145  23-Mar-2025  hans wskbd(4): fix bogus DIAGNOSTIC checks

Similar to uts(4) and ums(4), these checks should be done always, and
the only thing DIAGNOSTIC about them should be the printing of the
message.
 1.144  27-Dec-2020  tsutsui branches: 1.144.24;
Explicitly include generated ioconf.h for struct cfdrivers.
 1.143  05-Feb-2019  mrg branches: 1.143.12;
- call update_modifier() explicitly for the scrolling keys up event.
 1.142  18-Sep-2018  mrg fix wsdisplay/wskbd and cngetc() return value issues:
- return -1 for error / no character
- allow 0 as a character

cngetc() itself considers any value >= 0 valid, and this matches
the usage in other drivers that return -1 for "not data", vs
polling until something arrives.

removes ^G from spewing out the askname/etc prompts when no key
has been pressed (these come from cngetsn(), ignoring unknown
non printable characters.)

from @skrll with help from @mlelstv.
 1.141  18-Dec-2017  jmcneill branches: 1.141.2; 1.141.4;
If the wskbd driver returns type 0, return "no data" from wskbd_cngetc
 1.140  13-Jun-2017  nat Move duplicate definition of SETBELL macro into wsbelldata.h.
 1.139  11-Jun-2017  nat Seperate the definitions for the console beep. This code will be shared
with a new device.

Ok pgoyette@.
 1.138  10-Dec-2016  christos branches: 1.138.6;
remove VAUDIOSPEAKER, needs to be done differently.
 1.137  08-Dec-2016  nat Add a synthesized pc beeper and keyboard bell for platforms with an audio
device.
 1.136  24-Aug-2015  pooka branches: 1.136.2;
to garnish, dust with _KERNEL_OPT
 1.135  16-Nov-2014  ozaki-r branches: 1.135.2;
Replace callout_stop with callout_halt

In order to call callout_destroy for a callout safely, we have to ensure
the function of the callout is not running and pending. To do so, we should
use callout_halt, not callout_stop.

Discussed with martin@ and riastradh@.
 1.134  25-Jul-2014  dholland branches: 1.134.2;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.133  16-Mar-2014  dholland branches: 1.133.2;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.132  29-Aug-2012  macallan branches: 1.132.2; 1.132.4;
support an optional table to translate scancodes when in event mode
 1.131  13-Mar-2012  elad Replace the remaining KAUTH_GENERIC_ISSUSER authorization calls with
something meaningful. All relevant documentation has been updated or
written.

Most of these changes were brought up in the following messages:

http://mail-index.netbsd.org/tech-kern/2012/01/18/msg012490.html
http://mail-index.netbsd.org/tech-kern/2012/01/19/msg012502.html
http://mail-index.netbsd.org/tech-kern/2012/02/17/msg012728.html

Thanks to christos, manu, njoly, and jmmv for input.

Huge thanks to pgoyette for spinning these changes through some build
cycles and ATF.
 1.130  26-Oct-2010  jruoho branches: 1.130.8; 1.130.12; 1.130.14;
Add wskbd_hotkey_deregister() to match wskbd_hotkey_register().

XXX: This is kind of futile; the only user of the wskbd(4)'s hotkey interface
is hpqlb(4), which is a questionable driver, being, by design,
limited only to the laptop model for which the driver was written.
 1.129  01-Jul-2010  ahoka output ^_ on control-/ like xterm does.
 1.128  31-May-2010  dholland PR kern/38900 Arnaud Lacombe: don't try to do WSDISPLAY_SCROLLSUPPORT
things if NWSDISPLAY is 0.

Arguably the right fix is to not allow "options WSDISPLAY_SCROLLSUPPORT"
to be enabled in this case, but AIUI config doesn't know how to encode
rules like that.
 1.127  24-Feb-2010  dyoung branches: 1.127.2;
A pointer typedef entails trading too much flexibility to declare const
and non-const types, and the kernel uses both const and non-const
PMF qualifiers and device suspensors, so change the pmf_qual_t and
device_suspensor_t typedefs from "pointers to const" to non-pointer,
non-const types.
 1.126  28-Jan-2010  drochner branches: 1.126.2;
-rename the "KS_GROUP_Ascii" key symbol category to "Plain" because
this is what it meant all the time -- it includes characters >127
-delegate translation of all key symbols >127 to the terminal emulation
layer -- formerly everything non-special was passed to the tty subsystem
directly, involving truncation to a "char", which effectively meant
some ISO-1 assumption
 1.125  13-Jan-2010  macallan revert brainfart
 1.124  12-Jan-2010  macallan send PMF events for volume control keys
 1.123  08-Jan-2010  dyoung Expand PMF_FN_* macros.
 1.122  15-Jan-2009  yamt - reduce the number of #ifdefs.
- build compat glues if MODULAR.
 1.121  13-Jan-2009  christos provide wscons_event compatibility with 5.0.
 1.120  12-Jun-2008  cegger branches: 1.120.4;
use device_lookup_private to get softc
use device_lookup to get device_t
 1.119  04-May-2008  martin branches: 1.119.2; 1.119.4;
Move to standard TNF 2 clause license
 1.118  01-May-2008  cegger hpqlb(4): driver for HP Quick Launch buttons - found on HP Pavilion Notebooks
 1.117  27-Apr-2008  cegger branches: 1.117.2;
aprint_verbose -> aprint_verbose_dev
 1.116  05-Apr-2008  cegger branches: 1.116.2;
use aprint_*_dev and device_xname
 1.115  25-Mar-2008  cube Split device_t and softc for wskbd(4), wsmouse(4) and that creepy wsmux(4).
 1.114  28-Feb-2008  dyoung Do not return EBUSY if this is the console.
 1.113  22-Feb-2008  dyoung Return EBUSY and do not detach if we are the console.

Cosmetic: use device_t and accessors. Temporarily use PMF_FN_PROTO,
PMF_FN_ARGS.
 1.112  13-Dec-2007  joerg branches: 1.112.2; 1.112.6;
Stop the key pressed timeout on suspend to avoid virtually hanging keys,
e.g. when calling sysctl -w machdep.sleep_state=3 manually.
 1.111  10-Dec-2007  jmcneill branches: 1.111.2;
Wups, pmf_class_input_deregister is private; use pmf_device_deregister
instead
 1.110  10-Dec-2007  jmcneill Deregister input class handler on detach.
 1.109  09-Dec-2007  jmcneill Merge jmcneill-pm branch.
 1.108  01-Dec-2007  jmcneill branches: 1.108.2; 1.108.4;
aprintify
 1.107  18-Oct-2007  joerg branches: 1.107.2;
Always declare wskbd_repeat to fix build without wsdisplay.
 1.106  16-Oct-2007  joerg branches: 1.106.2;
Use callout_setfunc/callout_schedule instead of callout_reset.
Use mstohz for the calculations.
 1.105  06-Aug-2007  macallan branches: 1.105.2; 1.105.4; 1.105.6;
set the scrollmode flag when entering/leaving scroll mode, send scroll reset
when leaving
 1.104  09-Jul-2007  ad branches: 1.104.2; 1.104.6;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.103  04-Apr-2007  mishka Revert previous commit until further investigation because it is
known as problematic. Some problems obscured are dead Del key (I
can reproduce this with wscons scroll support) and panic (seen by
<elad> only).
 1.102  02-Apr-2007  mishka Implement locking switcher for alternative layots (many languages
are based on completely different alphabet, and typesetting with
one of modifiers pressed all the time is just a PITA). See
http://mail-index.netbsd.org/tech-kern/2007/03/29/0002.html for
usage details.

While here, perform the following small cleanups:
- KS_Cmd_Scroll* execution should be explicitly interrupted with 'break'.
- Some 'human' cleanups in ksym extraction algorithm (no func. changes).
- Add a note: implemented ksym translation isn't sufficient for l10n.
 1.101  04-Mar-2007  christos branches: 1.101.2; 1.101.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.100  09-Feb-2007  ad branches: 1.100.2;
Merge newlock2 to head.
 1.99  04-Jan-2007  elad Consistent usage of KAUTH_GENERIC_ISSUSER.
 1.98  16-Nov-2006  christos __unused removal on arguments; approved by core.
 1.97  17-Oct-2006  dogcow now that we have -Wno-unused-parameter, back out all the tremendously ugly
code to gratuitously access said parameters.
 1.96  13-Oct-2006  dogcow More -Wunused fallout. sprinkle __unused when possible; otherwise, use the
do { if (&x) {} } while (/* CONSTCOND */ 0);
construct as suggested by uwe in <20061012224845.GA9449@snark.ptc.spbu.ru>.
 1.95  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.94  28-Aug-2006  christos branches: 1.94.2; 1.94.4;
fix incomplete initializers
 1.93  21-Jul-2006  ad - Use the LWP cached credentials where sane.
- Minor cosmetic changes.
 1.92  14-May-2006  elad integrate kauth.
 1.91  14-May-2006  martin Fix typo in comment. From M�ty�s J�nos in PR kern/33477.
 1.90  14-Apr-2006  christos Coverity CID 1084: Don't call suser if we don't have a process context.
 1.89  29-Mar-2006  thorpej Use device_cfdata().
 1.88  28-Mar-2006  thorpej Use device_unit().
 1.87  14-Mar-2006  uwe branches: 1.87.2;
Make this compile with WSKBD_DEBUG again.
 1.86  07-Feb-2006  jmmv branches: 1.86.2; 1.86.4;
wsevent cleanup:

- Add a wsevent_inject function that atomically adds a set of events to an
event queue and change all code that directly messed with a queue to use it.
- Replace the WSEVENT_WAKEUP macro with a regular function.
- Make WSEVENT_QSIZE, PWSEVENT and splwsevent private definitions to
wsevent.c, instead of exposing them in the header file.
- Make the wsevent_init function take a process to attach to the queue,
instead of leaving this task to the caller (which always did it).

Reviewed in tech-kern@.
 1.85  11-Dec-2005  christos branches: 1.85.2; 1.85.4; 1.85.6;
merge ktrace-lwp.
 1.84  11-Nov-2005  simonb Call nanotime() directly, instead of doing the
microtime()/TIMEVAL_TO_TIMESPEC() dance.
 1.83  21-Jun-2005  ws branches: 1.83.2;
PR-30566: Poll must not return <sys/errno.h> values.
Start with those places I can easily test.
 1.82  29-May-2005  christos - sprinkle const.
- avoid variable shadowing.
 1.81  08-May-2005  he Enclose some code dependent on wsdisplay in #if NWSDISPLAY > 0 / #endif;
fixes build problem for news68k.

Reviewed by augustss
 1.80  04-May-2005  augustss Make auto repeat of events a compile time option, and have it off by default.
Turn on by WSKBD_EVENT_AUTOREPEAT.
 1.79  03-May-2005  augustss Change the logic for generating auto repeat from the keyboard. Previously
auto repeat was only available in translated mode, but not in event mode.
Now both modes have auto repeat. There are actually a few users of
the event mode, and they deserve auto repeat too. :)

Also make it possible to turn off auto repeat by setting repeat.del1=0.
 1.78  28-Apr-2005  martin Make it possible for a console driver to deliver raw ASCII characters
to wskbd. This is for special cases only, and may even be considered a
hack, but it is cheap and very local.
 1.77  27-Feb-2005  perry branches: 1.77.2;
nuke trailing whitespace
 1.76  03-Jun-2004  christos branches: 1.76.4; 1.76.6;
return ENODEV if functions are not compiled in the kernel.
 1.75  29-May-2004  christos fix scrolling code that was not ifdefed.
 1.74  28-May-2004  christos PR/19925: David Ferlier: Add scrolling support to wscons.
 1.73  08-Feb-2004  bjh21 branches: 1.73.2;
Trailing whitespace cleanup.
 1.72  28-Nov-2003  drochner always check whether a display is attached before calling
wsdisplay_*() functions
 1.71  21-Sep-2003  jdolecek cleanup & uniform descriptor owner handling:
* introduce fsetown(), fgetown(), fownsignal() - this sets/retrieves/signals
the owner of descriptor, according to appropriate sematics
of TIOCSPGRP/FIOSETOWN/SIOCSPGRP/TIOCGPGRP/FIOGETOWN/SIOCGPGRP ioctl; use
these routines instead of custom code where appropriate
* make every place handling TIOCSPGRP/TIOCGPGRP handle also FIOSETOWN/FIOGETOWN
properly, and remove the translation of FIO[SG]OWN to TIOC[SG]PGRP
in sys_ioctl() & sys_fcntl()
* also remove the socket-specific hack in sys_ioctl()/sys_fcntl() and
pass the ioctls down to soo_ioctl() as any other ioctl

change discussed on tech-kern@
 1.70  07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.69  29-Jun-2003  fvdl branches: 1.69.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.68  28-Jun-2003  darrenr Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
 1.67  01-Jan-2003  thorpej Use aprint_normal() in cfprint routines.
 1.66  23-Oct-2002  jdolecek merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.65  02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.64  01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.63  27-Sep-2002  thorpej Declare all cfattach structures const.
 1.62  06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.61  17-Mar-2002  atatat branches: 1.61.4;
Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.60  12-Jan-2002  tsutsui Call malloc(9) with M_ZERO flag instead of memset() after malloc().
 1.59  22-Nov-2001  augustss Add some DIAGNOSTIC tests.
 1.58  13-Nov-2001  lukem add/cleanup RCSIDs
 1.57  10-Nov-2001  augustss Make wsdisplay_set_console_kbd() a little less twisted.
 1.56  07-Nov-2001  augustss Ad a debug message. (With { } this time.)
 1.55  27-Oct-2001  augustss Cosmetics.
 1.54  27-Oct-2001  augustss Cosmetics.
 1.53  27-Oct-2001  augustss Don't enable/disable kbds that belong to a display; they are always enabled.
 1.52  26-Oct-2001  augustss Compare against coreect value to determine if we belong to a mux.
 1.51  26-Oct-2001  augustss Small rearrangement and more error checking.
 1.50  25-Oct-2001  augustss Change back to have a wseventvar in the softc for event sources. This
way the effect of FIOASYNC survives close()/open(). Later versions
of XFree86 relies on this bug/feature.
Also add some more debug stuff.
 1.49  24-Oct-2001  augustss Clear wskbd_console_device when console keyboard is detached.
 1.48  24-Oct-2001  augustss Major rototilling of the wsmux code. No user visible changes (except that
many bugs have been fixed).
Changes:
The wskbd, wsmouse, and wsmux are now "sub-classes" of wsevsrc, which is
a source of ws events. This make the structure of those drivers a little
more uniform.
Many bug fixes involving adding and removing devices from muxes.
When a kernel is configured without wsmux there will now be none (unlike
before where you got a console mux anyway).
The kernel now compiles with all combinations of ws devices present.
 1.47  13-Oct-2001  augustss branches: 1.47.2;
Fix a pasto.
 1.46  13-Oct-2001  augustss Use memset(), not bzero().
 1.45  13-Oct-2001  augustss ANSIfy.
 1.44  13-Oct-2001  augustss Two changes to the wsmux code:
* Allow the wsmux used by wsdisplay for the keyboard(s) to be explicitely
specified with the kbdmux locator.
* Allow keyboards and mice that have a mux to be opened in the regular way.
These changes should be totally backwards compatible.
 1.43  26-Sep-2001  matthias wskbd_rawinput: check sc->sc_displaydv before calling wsdisplay_kbdinput.
 1.42  05-Aug-2001  jdolecek branches: 1.42.2;
introduce hard limit on maximum font size (WSDISPLAY_MAXFONTSZ - 512KB)
and keymap size (WSKBDIO_MAXMAPLEN - 64KB)
 1.41  30-May-2001  lukem branches: 1.41.2;
add missing #include "opt_kgdb.h"
 1.40  23-Mar-2001  lukem #ifdef KGDB, call kgdb_connect(1) if KS_Cmd_Debugger (a la ddb invoking
console_debugger() in the same situation).
this makes it easier to get remote kgdb going if you forget to use boot -d.
 1.39  01-Oct-2000  takemura branches: 1.39.2;
- Add ioctl commands to wsdisplay which set/get some LCD status,
backlight, brightness and contrast.
- Add 9 command key symbols which make wskbd to call wsdisplay's
iocontrol.
- Add special key map variant KB_MACHDEP. This variant does not
have any real keymap but it's just a placeholder for machine dependent
maps which will be overwrite by machine dependent keyboard driver.
 1.38  23-Mar-2000  thorpej branches: 1.38.4;
New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
 1.37  06-Mar-2000  thorpej Add cnbell() support.
 1.36  22-Jan-2000  drochner pass raw keyboard data unsigned to avoid sign extension
 1.35  05-Jan-2000  drochner replace embedded _rcsid[] string by __KERNEL_RCSID(), remove _copyright[]
 1.34  21-Dec-1999  drochner change decoding function to return multiple symbols per keypress
(through the "internal" structure), derive a METAESC flag from the
layout variant and translate ALT-<key> into ESC <key> if the flag is set
 1.33  01-Dec-1999  augustss Done something half sensible if a USB console keyboard is unplugged instead
of panic()ing.
XXX Untested. I will test it the next time I can borrow an iMac.
 1.32  01-Dec-1999  augustss Make it compile even if there is no wsdisplay.
 1.31  08-Nov-1999  mycroft branches: 1.31.2;
Apply wrstuden's stopgap change to make alpha/macppc X work without wsmux.
 1.30  16-Aug-1999  augustss branches: 1.30.2; 1.30.4; 1.30.6;
Mention mux # when ignoring it for the console.
 1.29  07-Aug-1999  augustss Make it possible to open wskbd devices for write (i.e. ioctl) even
if it is already open.
 1.28  30-Jul-1999  augustss Eliminate the need for needs-count for wsmux. This should make
wsdisplays work properly again.
 1.27  29-Jul-1999  augustss Add the wsmux pseudo device.
 1.26  06-Jul-1999  augustss Add the detach and activate entry points to the cfattach struct.
 1.25  01-Jul-1999  drochner make it compile if WSDISPLAY_COMPAT_RAWKBD is defined, but NWSDISPLAY not,
reported by Kazushi Marukawa <jam@pobox.com>
 1.24  30-Jun-1999  augustss Make it possible to detach wsmouse and wskbd.
XXX wskbd probably needs some more work.
 1.23  16-May-1999  thorpej Make this build without wsdisplay.
 1.22  15-May-1999  drochner Get rid of the timeout-driven wscons_glue stuff which caused a lot of
headaches.
Now console keyboard and display are connected at autoconfiguration time,
when the last of them is found. Other keyboards / displays remain
unconnected until a new ioctl (WSDISPLAYIO_SETKEYBOARD) is called.
 1.21  14-May-1999  drochner Sort out the inclusion of wscons source files: the files are only
compiled if the corresponding devices are configured.
(Files calling wscons functions have to check whether these are present.)
 1.20  27-Mar-1999  drochner branches: 1.20.4;
remove a diagnostic panic in the keyboard autorepeat timeout() handler.
There is a rece condition which might trigger this but is harmless
otherwise. Leave the handler silently instead.
 1.19  26-Jan-1999  drochner Debugger() -> console_debugger() to honour the ddb_fromconsole sysctl
 1.18  17-Jan-1999  drochner adapt to "reset" interface change, pass "close all" to wsdisplay
 1.17  14-Jan-1999  drochner add a "reset terminal emulator" command pseudo-keysym and call the
corresponding callback if one is hit
 1.16  10-Jan-1999  augustss Remove redundant test if the unit numbers is in range.
 1.15  10-Jan-1999  augustss Change from bcopy/bzero to memxxx. From PR 6778 by
Erik Bertelsen <erik@q610.ebe.uni-c.dk>.
 1.14  28-Dec-1998  hannken Prepare for wsconsctrl:
- clean up keycode defines.
- allow easy parse of wsksymdef.h.
- add misssing KB_IT entry.
- set layout to KB_USER after ioctl WSKBDIO_SETMAP.
 1.13  17-Sep-1998  drochner Define a new keyboard eveny type "all keys up". This allows to reduce
the amount of statekeeping in drivers for LK201-like keyboards, and it
might be useful to resync after resets or overflows.
(reused the unused WSCONS_EVENT_KEY_OTHER event ID)
Implement the necessary decoding bits.
 1.12  02-Aug-1998  drochner Split the wskbd_attach arguments into console and autoconfiguration parts
(again); put some constant data into shared structures. This makes it
more look like the mouse part, and it helps USB integration.
Implement wskbd_enable() to enable/disable the keyboard.
 1.11  23-Jul-1998  drochner Switch keyboard to "event mode" on open.
Nuke wskbd_set_translation(). It doesn't fit into the "screen" model.
 1.10  04-Jul-1998  jonathan defopt DDB.
 1.9  15-Jun-1998  drochner Move the translation of keypad and function keys into the realm of the
terminal emulation. For this, change the interface to wsdisplay_kbdinput()
to take a "keysym_t" as argument. From there, the code is handed to the
appropriate emulation module via a new entry point: "translate".
Nuke the ioctls dealing with global assignment of character sequences
to keypad/function keys.
The "sun" emulation works much better now!
 1.8  13-Jun-1998  drochner fix initialization in non-console case
 1.7  11-Jun-1998  drochner add "sleeping ok" argument to wsdisplay_switch()
implement a way to get raw keyboard data (for X)
 1.6  09-Jun-1998  thorpej Nuke __BROKEN_INDIRECT_CONFIG.
 1.5  23-May-1998  thorpej Make it possible to build a kernel with a wscons display device but not
a wscons keyboard device.
 1.4  09-Apr-1998  hannken Forgot to initialize sc->ioctl. From Matthias Drochner.
 1.3  09-Apr-1998  hannken Split wscons/wskbd.c's softc into a static and a nonstatic part.
Booting into debugger (-d) now works.
Cleaned wscons/wskbdvar.h. Use the same attach arguments for
console and normal keyboards.
 1.2  07-Apr-1998  hannken Initial import of MI keyboard translation for dev/wscons.
 1.1  22-Mar-1998  drochner Initial import of cgd's new wscons code.
 1.20.4.3  02-Aug-1999  thorpej Update from trunk.
 1.20.4.2  01-Jul-1999  thorpej Sync w/ -current.
 1.20.4.1  21-Jun-1999  thorpej Sync w/ -current.
 1.30.6.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.30.4.1  15-Nov-1999  fvdl Sync with -current
 1.30.2.2  27-Mar-2001  bouyer Sync with HEAD.
 1.30.2.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.31.2.2  08-Nov-1999  mycroft Apply wrstuden's stopgap change to make alpha/macppc X work without wsmux.
 1.31.2.1  08-Nov-1999  mycroft file wskbd.c was added on branch comdex-fall-1999 on 1999-11-08 04:48:19 +0000
 1.38.4.1  16-Aug-2001  tv Pullup [jdolecek]:

sys/dev/wscons/wsdisplay.c 1.52
sys/dev/wscons/wskbd.c 1.42
sys/dev/wscons/wsconsio.h 1.40

Introduce hard limits on wscons font size and keymap size, and
bounds check against those limits.
 1.39.2.13  03-Jan-2003  thorpej Sync with HEAD.
 1.39.2.12  11-Nov-2002  nathanw Catch up to -current
 1.39.2.11  18-Oct-2002  nathanw Catch up to -current.
 1.39.2.10  17-Sep-2002  nathanw Catch up to -current.
 1.39.2.9  01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.39.2.8  28-Feb-2002  nathanw Catch up to -current.
 1.39.2.7  08-Jan-2002  nathanw Catch up to -current.
 1.39.2.6  14-Nov-2001  nathanw Catch up to -current.
 1.39.2.5  22-Oct-2001  nathanw Catch up to -current.
 1.39.2.4  26-Sep-2001  nathanw Catch up to -current.
Again.
 1.39.2.3  24-Aug-2001  nathanw Catch up with -current.
 1.39.2.2  21-Jun-2001  nathanw Catch up to -current.
 1.39.2.1  09-Apr-2001  nathanw Catch up with -current.
 1.41.2.6  10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.41.2.5  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.41.2.4  11-Feb-2002  jdolecek Sync w/ -current.
 1.41.2.3  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.41.2.2  08-Sep-2001  thorpej Add kqueue support to wscons events.
 1.41.2.1  25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.42.2.3  01-Oct-2001  fvdl Catch up with -current.
 1.42.2.2  26-Sep-2001  fvdl * add a VCLONED vnode flag that indicates a vnode representing a cloned
device.
* rename REVOKEALL to REVOKEALIAS, and add a REVOKECLONE flag, to pass
to VOP_REVOKE
* the revoke system call will revoke all aliases, as before, but not the
clones
* vdevgone is called when detaching a device, so make it use REVOKECLONE
to get rid of all clones as well
* clean up all uses of VOP_OPEN wrt. locking.
* add a few VOPS to spec_vnops that need to do something when it's a
clone vnode (access and getattr)
* add a copy of the vnode vattr structure of the original 'master' vnode
to the specinfo of a cloned vnode. could possibly redirect getattr to
the 'master' vnode, but this has issues with revoke
* add a vdev_reassignvp function that disassociates a vnode from its
original device, and reassociates it with the specified dev_t. to be
used by cloning devices only, in case a new minor is allocated.
* change all direct references in drivers to v_devcookie and v_rdev
to vdev_privdata(vp) and vdev_rdev(vp). for diagnostic purposes
when debugging race conditions that still exist wrt. locking and
revoking vnodes.
* make the locking state of a vnode consistent when passed to
d_open and d_close (unlocked). locked would be better, but has
some deadlock issues
 1.42.2.1  07-Sep-2001  thorpej Commit my "devvp" changes to the thorpej-devvp branch. This
replaces the use of dev_t in most places with a struct vnode *.

This will form the basic infrastructure for real cloning device
support (besides being architecurally cleaner -- it'll be good
to get away from using numbers to represent objects).
 1.47.2.1  12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.61.4.1  16-May-2002  gehenna Add the character device switch.
Replace the direct-access to devsw table with calling devsw API.
 1.69.2.8  11-Dec-2005  christos Sync with head.
 1.69.2.7  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.69.2.6  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.69.2.5  21-Nov-2004  skrll Adapt to branch.
 1.69.2.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.69.2.3  18-Sep-2004  skrll Sync with HEAD.
 1.69.2.2  03-Aug-2004  skrll Sync with HEAD
 1.69.2.1  02-Jul-2003  darrenr Apply the aborted ktrace-lwp changes to a specific branch. This is just for
others to review, I'm concerned that patch fuziness may have resulted in some
errant code being generated but I'll look at that later by comparing the diff
from the base to the branch with the file I attempt to apply to it. This will,
at the very least, put the changes in a better context for others to review
them and attempt to tinker with removing passing of 'struct lwp' through
the kernel.
 1.73.2.3  07-Jun-2004  tron Pull up revision 1.76 (requested by recht in ticket #451):
return ENODEV if functions are not compiled in the kernel.
 1.73.2.2  07-Jun-2004  tron Pull up revision 1.75 (requested by recht in ticket #451):
fix scrolling code that was not ifdefed.
 1.73.2.1  07-Jun-2004  tron Pull up revision 1.74 (requested by recht in ticket #451):
PR/19925: David Ferlier: Add scrolling support to wscons.
 1.76.6.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.76.4.1  29-Apr-2005  kent sync with -current
 1.77.2.1  03-Jun-2005  riz Pull up revision 1.78 (requested by martin in ticket #370):
Make it possible for a console driver to deliver raw ASCII characters
to wskbd. This is for special cases only, and may even be considered a
hack, but it is cheap and very local.
 1.83.2.9  17-Mar-2008  yamt sync with head.
 1.83.2.8  27-Feb-2008  yamt sync with head.
 1.83.2.7  21-Jan-2008  yamt sync with head
 1.83.2.6  07-Dec-2007  yamt sync with head
 1.83.2.5  27-Oct-2007  yamt sync with head.
 1.83.2.4  03-Sep-2007  yamt sync with head.
 1.83.2.3  26-Feb-2007  yamt sync with head.
 1.83.2.2  30-Dec-2006  yamt sync with head.
 1.83.2.1  21-Jun-2006  yamt sync with head.
 1.85.6.2  01-Jun-2006  kardel Sync with head.
 1.85.6.1  22-Apr-2006  simonb Sync with head.
 1.85.4.1  09-Sep-2006  rpaulo sync with head
 1.85.2.1  18-Feb-2006  yamt sync with head.
 1.86.4.4  06-May-2006  christos - Move kauth_cred_t declaration to <sys/types.h>
- Cleanup struct ucred; forward declarations that are unused.
- Don't include <sys/kauth.h> in any header, but include it in the c files
that need it.

Approved by core.
 1.86.4.3  19-Apr-2006  elad sync with head.
 1.86.4.2  10-Mar-2006  elad generic_authorize() -> kauth_authorize_generic().
 1.86.4.1  08-Mar-2006  elad Adapt to kernel authorization KPI.
 1.86.2.4  03-Sep-2006  yamt sync with head.
 1.86.2.3  11-Aug-2006  yamt sync with head
 1.86.2.2  24-May-2006  yamt sync with head.
 1.86.2.1  01-Apr-2006  yamt sync with head.
 1.87.2.2  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.87.2.1  31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.94.4.2  10-Dec-2006  yamt sync with head.
 1.94.4.1  22-Oct-2006  yamt sync with head
 1.94.2.3  06-Feb-2007  ad Quieten noisy boot messages.
 1.94.2.2  12-Jan-2007  ad Sync with head.
 1.94.2.1  18-Nov-2006  ad Sync with head.
 1.100.2.1  12-Mar-2007  rmind Sync with HEAD.
 1.101.4.1  11-Jul-2007  mjf Sync with head.
 1.101.2.3  23-Oct-2007  ad Sync with head.
 1.101.2.2  20-Aug-2007  ad Sync with HEAD.
 1.101.2.1  01-Jul-2007  ad Adapt to callout API change.
 1.104.6.7  08-Dec-2007  jmcneill Rename pnp(9) -> pmf(9), as requested by many.
 1.104.6.6  01-Dec-2007  jmcneill Sync with HEAD.
 1.104.6.5  06-Nov-2007  joerg Refactor PNP API:
- Make suspend/resume directly a device functionality. It consists of
three layers (class logic, device logic, bus logic), all of them being
optional. This replaces D0/D3 transitions.
- device_is_active returns true if the device was not disabled and was
not suspended (even partially), device_is_enabled returns true if the
device was enabled.
- Change pnp_global_transition into pnp_system_suspend and
pnp_system_resume. Before running any suspend/resume handlers, check
that all currently attached devices support power management and bail
out otherwise. The latter is not done for the shutdown/panic case.
- Make the former bus-specific generic network handlers a class handler.
- Make PNP message like volume up/down/toogle PNP events. Each device
can register what events they are interested in and whether the handler
should be global or not.
- Introduce device_active API for devices to mark themselve in use from
either the system or the device. Use this to implement the idle handling
for audio and input devices. This is intended to replace most ad-hoc
watchdogs as well.
- Fix somes situations in which audio resume would lose mixer settings.
- Make USB host controllers better deal with suspend in the light of
shared interrupts.
- Flush filesystem cache on suspend.
- Flush disk caches on suspend. Put ATA disks into standby on suspend as
well.
- Adopt drivers to use the new PNP API.
- Fix a critical bug in the generic cardbus layer that made D0->D3
break.
- Fix ral(4) to set if_stop.
- Convert cbb(4) to the new PNP API.
- Apply the PCI Express SCI fix on resume again.
 1.104.6.4  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.104.6.3  09-Aug-2007  jmcneill Sync with HEAD.
 1.104.6.2  05-Aug-2007  jmcneill Certain devices either don't require a power handler, or are restored
on resume outside of the pnp power management framework. For such devices,
introduce the null power handler, pnp_generic_power.
 1.104.6.1  03-Aug-2007  jmcneill Pull in power management changes from private branch.
 1.104.2.1  15-Aug-2007  skrll Sync with HEAD.
 1.105.6.2  06-Aug-2007  macallan set the scrollmode flag when entering/leaving scroll mode, send scroll reset
when leaving
 1.105.6.1  06-Aug-2007  macallan file wskbd.c was added on branch matt-mips64 on 2007-08-06 03:07:53 +0000
 1.105.4.1  18-Oct-2007  yamt sync with head.
 1.105.2.3  23-Mar-2008  matt sync with HEAD
 1.105.2.2  09-Jan-2008  matt sync with HEAD
 1.105.2.1  06-Nov-2007  matt sync with HEAD
 1.106.2.1  25-Oct-2007  bouyer Sync with HEAD.
 1.107.2.2  27-Dec-2007  mjf Sync with HEAD.
 1.107.2.1  08-Dec-2007  mjf Sync with HEAD.
 1.108.4.1  11-Dec-2007  yamt sync with head.
 1.108.2.1  26-Dec-2007  ad Sync with head.
 1.111.2.1  13-Dec-2007  bouyer Sync with HEAD
 1.112.6.6  17-Jan-2009  mjf Sync with HEAD.
 1.112.6.5  29-Jun-2008  mjf Sync with HEAD.
 1.112.6.4  02-Jun-2008  mjf Sync with HEAD.
 1.112.6.3  06-Apr-2008  mjf - after some discussion with agc@ i agreed it would be a good idea to move
device_unregister_* to device_deregister_* to be more like the pmf(9)
functions, especially since a lot of the time the function calls are next
to each other.

- add device_register_name() support for dk(4).
 1.112.6.2  03-Apr-2008  mjf Sync with HEAD.
 1.112.6.1  29-Mar-2008  mjf - etc/devfsd.conf: Add some rules to give nodes like /dev/tty and
/dev/null better default modes, i.e. 0666.

- sbin/init: Run devfsd -s before going to multiuser.

- sys/arch: Provide arm32, i386, sparc with a mem_init() function to request
device nodes for /dev/null, /dev/zero, etc.

- sys/dev: Convert rnd, wd, agp, raid, cd, sd, wsdisplay, wskbd, wsmouse,
wsmux, tty, bpf, swap to devfs New World Order.

- sys/fs/devfs: Make the visibility attribute of device nodes configurable.
Also provide a function to mount a devfs on boot.

- sys/kern: Add a new boot flag, -n. This disables devfs support. Unless
the -n flag is specified the kernel will mount a devfs file
system on boot.
 1.112.2.1  24-Mar-2008  keiichi sync with head.
 1.116.2.2  17-Jun-2008  yamt sync with head.
 1.116.2.1  18-May-2008  yamt sync with head.
 1.117.2.4  11-Aug-2010  yamt sync with head.
 1.117.2.3  11-Mar-2010  yamt sync with head
 1.117.2.2  04-May-2009  yamt sync with head.
 1.117.2.1  16-May-2008  yamt sync with head.
 1.119.4.1  18-Jun-2008  simonb Sync with head.
 1.119.2.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.120.4.1  19-Jan-2009  skrll Sync with HEAD.
 1.126.2.3  06-Nov-2010  uebayasi Sync with HEAD.
 1.126.2.2  17-Aug-2010  uebayasi Sync with HEAD.
 1.126.2.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.127.2.2  05-Mar-2011  rmind sync with head
 1.127.2.1  03-Jul-2010  rmind sync with head
 1.130.14.1  07-Dec-2014  martin Pull up following revision(s) (requested by ozaki-r in ticket #1201):
sys/kern/kern_ktrace.c: revision 1.166
sys/dev/isa/aps.c: revision 1.16
sys/dev/sysmon/sysmonvar.h: revision 1.45
sys/dev/ir/irframe_tty.c: revision 1.60
sys/dev/sysmon/sysmon_envsys_events.c: revision 1.111-1.112 (patch)
sys/dev/pci/pccbb.c: revision 1.207
sys/dev/wscons/wskbd.c: revision 1.135
sys/dev/usb/ohci.c: revision 1.254
sys/net/if_ecosubr.c: revision 1.41
sys/dev/pcmcia/btbc.c: revision 1.17
sys/arch/x86/x86/via_padlock.c: revision 1.23
sys/dev/sdmmc/sdmmc.c: revision 1.23 (patch)
sys/dev/bluetooth/btkbd.c: revision 1.17
sys/dev/bluetooth/bcsp.c: revision 1.25
sys/arch/x86/pci/fwhrng.c: revision 1.8
sys/dev/ic/nslm7x.c: revision 1.61
share/man/man9/callout.9: revision 1.28 (patch)

Replace callout_stop with callout_halt and ensure the callout
is not running before destroying it.
 1.130.12.1  05-Apr-2012  mrg sync to latest -current.
 1.130.8.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.130.8.2  30-Oct-2012  yamt sync with head
 1.130.8.1  17-Apr-2012  yamt sync with head
 1.132.4.1  18-May-2014  rmind sync with head
 1.132.2.2  03-Dec-2017  jdolecek update from HEAD
 1.132.2.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.133.2.1  10-Aug-2014  tls Rebase.
 1.134.2.1  01-Dec-2014  martin Pull up following revision(s) (requested by ozaki-r in ticket #279):
sys/kern/kern_ktrace.c: revision 1.166
sys/dev/isa/aps.c: revision 1.16
sys/dev/sysmon/sysmonvar.h: revision 1.45
sys/dev/ir/irframe_tty.c: revision 1.60
sys/dev/sysmon/sysmon_envsys_events.c: revision 1.111
sys/dev/sysmon/sysmon_envsys_events.c: revision 1.112
sys/dev/pci/pccbb.c: revision 1.207
sys/dev/wscons/wskbd.c: revision 1.135
sys/dev/usb/ohci.c: revision 1.254
sys/net/if_ecosubr.c: revision 1.41
sys/dev/pcmcia/btbc.c: revision 1.17
sys/arch/x86/x86/via_padlock.c: revision 1.23
sys/dev/sdmmc/sdmmc.c: revision 1.23
sys/dev/bluetooth/btkbd.c: revision 1.17
sys/dev/bluetooth/bcsp.c: revision 1.25
sys/arch/x86/pci/fwhrng.c: revision 1.8
sys/dev/ic/nslm7x.c: revision 1.61
share/man/man9/callout.9: revision 1.28
Replace callout_stop with callout_halt
In order to call callout_destroy for a callout safely, we have to ensure
the function of the callout is not running and pending. To do so, we should
use callout_halt, not callout_stop.
Discussed with martin@ and riastradh@.
Make it clear that we should use not callout_stop but callout_halt
before callout_destroy
Replace callout_stop with callout_halt
In order to call callout_destroy for a callout safely, we have to ensure
the function of the callout is not running and pending. To do so, we should
use callout_halt, not callout_stop.
In this case, we need to pass an interlock to callout_halt to wait for
the callout complete.
Reviewed by riastradh@.
Kill sme_callout_mtx and use sme_mtx instead
We can use sme_mtx for the callout as well. Actually we should do so
because sme_events_list and some other data that are touched in the
callout should be protected by sme_mtx, not sme_callout_mtx.
Discussed with riastradh@ in
http://mail-index.netbsd.org/tech-kern/2014/11/11/msg017956.html
Replace callout_stop with callout_halt
In order to call callout_destroy for a callout safely, we have to ensure
the function of the callout is not running and pending. To do so, we should
use callout_halt, not callout_stop.
In this case, we need to pass an interlock to callout_halt to wait for
the callout complete. And also we make sure that SME_CALLOUT_INITIALIZED
is unset before calling callout_halt to prevent the callout from calling
callout_schedule. This is the same as what we did in sys/netinet6/mld6.c@1.61.
Reviewed by riastradh@.
 1.135.2.2  28-Aug-2017  skrll Sync with HEAD
 1.135.2.1  22-Sep-2015  skrll Sync with HEAD
 1.136.2.4  07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.136.2.3  26-Jul-2016  pgoyette Rename LOCALCOUNT_INITIALIZER to DEVSW_MODULE_INIT. This better describes
what we're doing, and why.
 1.136.2.2  19-Jul-2016  pgoyette Instead of repeatedly typing the conditional initialization of the
.d_localcount members in the various {b,c}devsw, define an initializer
macro and use it. This also removes the need for defining new symbols
for each 'struct localcount'.

As suggested by riastradh@
 1.136.2.1  18-Jul-2016  pgoyette Rump drivers are always installed via devsw_attach() so we need to
always allocate a 'struct localcount' for these drivers whenever they
are built as modules.
 1.138.6.2  29-Apr-2017  pgoyette Remove more unnecessary #include for sys/localcount.h
 1.138.6.1  27-Apr-2017  pgoyette Restore all work from the former pgoyette-localcount branch (which is
now abandoned doe to cvs merge botch).

The branch now builds, and installs via anita. There are still some
problems (cgd is non-functional and all atf tests time-out) but they
will get resolved soon.
 1.141.4.1  10-Jun-2019  christos Sync with HEAD
 1.141.2.1  30-Sep-2018  pgoyette Ssync with HEAD
 1.143.12.1  03-Jan-2021  thorpej Sync w/ HEAD.
 1.144.24.1  02-Aug-2025  perseant Sync with HEAD

RSS XML Feed