Home | History | Annotate | Download | only in dev
History log of /src/sys/arch/amiga/dev/kbd.c
RevisionDateAuthorComments
 1.62  08-Sep-2024  rillig fix a/an grammar in obvious cases
 1.61  07-Aug-2021  thorpej branches: 1.61.12;
Merge thorpej-cfargs2.
 1.60  03-Jun-2021  rin branches: 1.60.2;
kbd(4) and ms(4) carry multiple interface attributes. They are configurable
both as standalone drivers for legacy framebuffer console, or parents of
wskbd(4) and wsmouse(4), respectively. For the latter, be explicit about
using "wskbddev" and "wsmousedev" interface attributes for children.
 1.59  24-Apr-2021  thorpej branches: 1.59.2; 1.59.6;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.58  24-Feb-2019  jandberg branches: 1.58.14;
fix comment
 1.57  25-Jul-2014  dholland branches: 1.57.28;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.56  16-Mar-2014  dholland branches: 1.56.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.55  27-Oct-2012  chs branches: 1.55.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.54  03-Jun-2011  matt branches: 1.54.2; 1.54.12;
CFATTACH_DECL_NEW, device_t, cfdata_t
 1.53  12-Dec-2009  phx branches: 1.53.4; 1.53.6; 1.53.10;
Reverted the CIA-timer based delay() to the pre-5.0 method of a calibrated
delay loop.
This fixes keyboard handshaking problems with some A1200 models since 5.0
and restores the precision for short delays on DraCo systems (the QuickLogic
timer has only a seventh of the CIA precision).
Changed the keyboard handshaking delay from 2000 back to 200ms, although
even the recommended 85ms were successfully tested on the most problematic
A1200 keyboards.
All those changes were tested on an A3000 and A1200 with 68060/50 CPU, and
previously discussed on the port-amiga ML.
 1.52  14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.51  12-Jan-2009  mhitch branches: 1.51.2;
Retain compatibility with old firm_event. Old Xamiga binary now works with
-current kernel.
 1.50  28-Dec-2007  joerg branches: 1.50.6; 1.50.10; 1.50.18; 1.50.20; 1.50.26;
Prepare for timecounter support on amiga.
 1.49  04-Mar-2007  christos branches: 1.49.20; 1.49.26; 1.49.32;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.48  11-Dec-2005  christos branches: 1.48.26;
merge ktrace-lwp.
 1.47  01-Jun-2005  jandberg branches: 1.47.2;
Tell kbd when it is the console keyboard instead of always assuming
it is. Also console keyboard initialization is now made during consinit
instead of autoconf.
Reviewed by <is>.
 1.46  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.45  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.44  06-Jan-2003  wiz branches: 1.44.2;
interrupt with two rs.
 1.43  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.42  02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.41  27-Sep-2002  thorpej Declare all cfattach structures const.
 1.40  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.39  17-Mar-2002  atatat branches: 1.39.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.38  28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.37  26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.36  13-Jan-2002  jandberg wskbd updates.
kbd.c: Now identifies itself as WSKBD_TYPE_AMIGA.
wskbdmap_amiga.c: Updated de/dk/sv/no keymaps.
 1.35  02-Feb-2001  is branches: 1.35.2; 1.35.4; 1.35.8;
Initial, still incomplete wscons support by Jukka Andberg, PR 11068
 1.34  25-May-2000  is Prepare for AmigaPPC.
 1.33  26-Jul-1998  is branches: 1.33.14;
yet more atomic operations accessing DraCo registers
 1.32  08-Mar-1998  is Conditionally (on defined(DRACO)) compile new DraCo keyboard code sequences.
Pointed out by Bernd Ernesti.
 1.31  28-Feb-1998  is Probe for the native DraCo (rekeycaped MF-II) keyboard, instead of guessing
it from the QuickLogic chip version byte.
If found, switch it to non-autorepeat mode (which seems to avoid the race
condition which made my keyboard driver / X server lose state under heavy
interupt load).
If not found, assume an Amiga keyboard on CIA-A.
XXX We should probe for the presence of the CIAs on the DraCo.
 1.30  23-Feb-1998  is Initialize keyboard structures also from kbdopen(), if necessary.
To do this, move the flag variable to kbdenable().
This will make kernels with serial console provice a working keyboard driver.
 1.29  12-Jan-1998  thorpej Adjust for changes to config.
 1.28  23-Dec-1996  veego Get rid of __BROKEN_INDIRECT_CONFIG.
 1.27  30-Nov-1996  is The DraCo MF-II to Amiga translation table is const-ant.
 1.26  13-Oct-1996  christos backout previous kprintf change
 1.25  11-Oct-1996  mhitch Changes for poll(2).
 1.24  10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.23  14-Sep-1996  is Kill two debug printfs whose output always haunt me in the boot
messages, but which I didn't find when looking for then.
 1.22  16-May-1996  is merge.
 1.21  16-May-1996  is Correct a -Wall correction.
 1.20  10-May-1996  is Cleanup the mess I left when committing yestereve's changes; in this case,
an unused variable.
 1.19  09-May-1996  is First part of M68060 and DraCo support.

* for the M68060 part: store buffer and branch target cache aren't
enabled yet (this needs cleanup of lots of locore.s code which is a
maze of little passages, all a little different) (and it wasn't yet
tested in an accellerated Amiga, only in the DraCo).

I've included a workaround for 2 of the CPU bugs in chips with Masks
1F43G and earlier, but didn't bother to deal with the can of worms
in the [0-3]D11W chips. Be sure to get "68060 rev. 1" or more
reported at kernel startup time, or at least mention it (or the mask
revision, if available) when reporting problems.

* for the DraCo: only machines with a CIA timer.

I assigned machine id 32000+nn (0x7Dnn), where n is the machine
readable Quicklogic custom chip revision (also printed at boot
time). "Guaranteed to work" up to rev. 3, newer DraCo's aren't
guaranteed to have any CIA (we don't have a driver for the new timer
yet).

Supported are:

- MF-II keyboards on the native interface and A3000 keyboards via
the CIA.
- builtin SCSI interface (yet another instance of siop)
- CIA timer.
- Zorro II devices which don't do DMA (don't get mapped to Zorro II
address space in the DraCo)
- "local bus" devices which are autoconfigured by the boot rom
(should be all); only an Altais driver is there (looks like a Retina Z3)

Not yet supported are:

- native timer of newer machines.
- Real Time Clock.
- serial, parallel + floppy on the SuperIO chip (that is also: no mouse)

XXX You need an enhanced boot loader, which will committed in a few days.

XXX std.draco should and will go away.
 1.18  21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.17  17-Mar-1996  mhitch Clean up typos and other errors from new device attachment changes.
 1.16  17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.15  07-May-1995  chopps enable pseudo-dma on ivsc, allow no ite/grfcc.
 1.14  10-Apr-1995  mycroft Nuke write routines.
 1.13  12-Feb-1995  chopps Many changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
Now use amiga HW for soft interrupts, non-contig options (2 or many chunks),
interrupt handler lists, 4066 ethernet, 1291 scsi, option to defer level 6
interrupts to level 4 (deal with icky built-in serial port)
 1.12  01-Dec-1994  chopps bring up to current. change sun to sunos. handle changes in device
open params and autoconf match function params.
 1.11  26-Oct-1994  cgd new RCS ID format.
 1.10  06-Oct-1994  chopps branches: 1.10.2;
Add Amiga 1200 support (kbd and ide) from
osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.9  08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.8  17-Feb-1994  chopps modified to use generic cons. (and some grf defs changed)
 1.7  13-Feb-1994  chopps cleaned up include's relocated grf/* stuf to grfabs*.
 1.6  11-Feb-1994  chopps Add missing Id's
 1.5  26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.4  30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.3  02-Sep-1993  mw new source release integrated from amiga-release.
 1.2  02-Aug-1993  mycroft Add RCS identifiers.
 1.1  05-Jul-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.2  02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.1.1.1  05-Jul-1993  mw sys/arch/amiga tree. This is the machdep part required to get the kernel
up on an A3000. There are still (very) few changes required outside the
arch/amiga tree, so you can't recompile the kernel yet. Support for
third party SCSI controllers for the A2000 is on its way. The kernel is
fully functional (except for a missing ethernet-driver ...). This
tree is based on my version #390.
 1.10.2.2  06-Oct-1994  chopps Add Amiga 1200 support (kbd and ide) from
osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.10.2.1  06-Oct-1994  chopps file kbd.c was added on branch netbsd-1-0 on 1994-10-06 19:54:31 +0000
 1.33.14.2  11-Feb-2001  bouyer Sync with HEAD.
 1.33.14.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.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.35.8.6  07-Jan-2003  thorpej Sync with HEAD.
 1.35.8.5  11-Nov-2002  nathanw Catch up to -current
 1.35.8.4  18-Oct-2002  nathanw Catch up to -current.
 1.35.8.3  17-Sep-2002  nathanw Catch up to -current.
 1.35.8.2  01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.35.8.1  28-Feb-2002  nathanw Catch up to -current.
 1.35.4.4  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.35.4.3  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.35.4.2  11-Feb-2002  jdolecek Sync w/ -current.
 1.35.4.1  09-Sep-2001  thorpej Add kqueue support (not yet compiled).
 1.35.2.1  10-Oct-2001  fvdl Convert all remaining devices.
 1.39.4.1  16-May-2002  gehenna Add the character device switch.
 1.44.2.5  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.44.2.4  21-Nov-2004  skrll Adapt to branch.
 1.44.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.44.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.44.2.1  03-Aug-2004  skrll Sync with HEAD
 1.47.2.3  21-Jan-2008  yamt sync with head
 1.47.2.2  03-Sep-2007  yamt sync with head.
 1.47.2.1  21-Jun-2006  yamt sync with head.
 1.48.26.1  12-Mar-2007  rmind Sync with HEAD.
 1.49.32.1  02-Jan-2008  bouyer Sync with HEAD
 1.49.26.1  18-Feb-2008  mjf Sync with HEAD.
 1.49.20.1  09-Jan-2008  matt sync with HEAD
 1.50.26.1  20-May-2011  matt bring matt-nb5-mips64 up to date with netbsd-5-1-RELEASE (except compat).
 1.50.20.1  16-Jul-2010  riz Pull up following revision(s) (requested by phx in ticket #1412):
sys/arch/amiga/dev/clock.c: revision 1.51
sys/arch/amiga/amiga/locore.s: revision 1.149 via patch
sys/arch/amiga/dev/kbd.c: revision 1.53
sys/arch/amiga/amiga/amiga_init.c: revision 1.118
Reverted the CIA-timer based delay() to the pre-5.0 method of a calibrated
delay loop.
This fixes keyboard handshaking problems with some A1200 models since 5.0
and restores the precision for short delays on DraCo systems (the QuickLogic
timer has only a seventh of the CIA precision).
Changed the keyboard handshaking delay from 2000 back to 200ms, although
even the recommended 85ms were successfully tested on the most problematic
A1200 keyboards.
All those changes were tested on an A3000 and A1200 with 68060/50 CPU, and
previously discussed on the port-amiga ML.
 1.50.18.2  28-Apr-2009  skrll Sync with HEAD.
 1.50.18.1  19-Jan-2009  skrll Sync with HEAD.
 1.50.10.2  11-Mar-2010  yamt sync with head
 1.50.10.1  04-May-2009  yamt sync with head.
 1.50.6.1  17-Jan-2009  mjf Sync with HEAD.
 1.51.2.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.53.10.1  23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.53.6.1  06-Jun-2011  jruoho Sync with HEAD.
 1.53.4.1  12-Jun-2011  rmind sync with head
 1.54.12.2  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.54.12.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.54.2.2  22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.54.2.1  30-Oct-2012  yamt sync with head
 1.55.2.1  18-May-2014  rmind sync with head
 1.56.2.1  10-Aug-2014  tls Rebase.
 1.57.28.1  10-Jun-2019  christos Sync with HEAD
 1.58.14.1  21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.59.6.1  06-Jun-2021  cjep sync with head
 1.59.2.1  17-Jun-2021  thorpej Sync w/ HEAD.
 1.60.2.1  03-Aug-2021  thorpej Adapt to CFARGS().
 1.61.12.1  02-Aug-2025  perseant Sync with HEAD

RSS XML Feed