Commit Graph

32 Commits

Author SHA1 Message Date
drochner ef369e0ed6 remove license clauses 3 and 4 from my cpoyright notices 2004-03-24 17:26:53 +00:00
bjh21 dff5222d3a Abstract the interface between pckbc(4), and the pckbd(4) and pms(4)
drivers that attach to it.  This allows for other host interface chips
that use the same keyboards and mice, such as the ones in the ARM
IOMD20, ARM7500, and SA-1111.  The PC-compatible driver is still
called pckbc(4), and the new abstraction layer is "pckbport", so the
child devices have moved from sys/dev/pckbc to sys/dev/pckbport, which
also contains some code shared between all host controllers.  To avoid
incompatibility, pckbdreg.h is still installed in
/usr/include/dev/pckbc.

In theory, this shouldn't cause any behavioural changes in the drivers
concerned.  Thy just use rather more function pointers than before.  Tested
on i386 and (with a new host driver) acorn32.  Compiled on several other
affected architectures.
2004-03-13 17:31:33 +00:00
bjh21 5aca86918f Add a new MI attribute, pckbc_machdep_cnattach, and change pckbc_cnattach()
to only call pckbc_machdep_cnattach() if this is present.  This allows
pckbc_machdep_cnattach() to be omitted entirely on most ports, where it only
returns ENXIO anyway.

The devices with this attribute at the moment are pc(4) on i386 and bebox, and
pckbc on sparc, where pckbc_machdep_cnattach() mysteriously returns 0 rather
than ENXIO.
2004-02-14 14:33:28 +00:00
martin cc7556d487 Fix compilation for ports w/o __GENERIC_SOFT_INTERRUPTS_ALL_LEVELS. 2003-12-12 22:35:13 +00:00
martin 9489d737cd In parallel to the interrupt handler pckbcintr provide two functions
pckbcintr_hard and pckbcintr_soft, which, together, do the same as
pckbcintr. The first is called from the interrupt handler, the second
from a softinterrupt at arbitrary protection level (lower or equal to
IPL_TTY). They pass data via a small ringbuffer.

The new functions are intended for platforms that, due to
hardware/firmware restrictions are not able to make pckbcintr called at
IPL_TTY, like Krups javastations. Using the monolithic pckbcintr on
these plattforms leads to the input handlers for the slot data to be
run at elevated priority, causing various race conditions.
2003-12-12 14:30:16 +00:00
wiz c5670263e0 Fix some typos. From Tom Cosgrove via jmc@openbsd. 2003-11-02 11:07:44 +00:00
uwe faa757d699 Request KBC_SELFTEST in pckbc_cnattach(), hidden under #ifdef
PCKBC_CNATTACH_SELFTEST.  On machines where we boot on cold iron
(e.g. netwinder) we need this to init the pckbc.
2003-06-12 03:34:12 +00:00
grant 5d17facb78 wrap a debug message in #ifdef PCKBCDEBUG.
ok'd by simonb. fixes my PR kern/18441.
2003-06-10 07:46:29 +00:00
thorpej 703e7687a9 Use aprint_normal() in cfprint routines. 2003-01-01 00:16:46 +00:00
jdolecek 60c092247e pckbc_poll_data1(): make sure the loop variable is always initialized
this potential problem found by Krister Walfridsson
2002-11-01 21:39:31 +00:00
thorpej 6c88de3b53 Introduce a new routine, config_match(), which invokes the
cfattach->ca_match function in behalf of the caller.  Use it
rather than invoking cfattach->ca_match directly.
2002-09-27 03:17:40 +00:00
soren 95c864d4f6 Previous was committed by mistake; revert. 2001-12-18 15:50:23 +00:00
soren 875bff0962 To make dev/pcmcia work on platforms with 64-bit bus_addr_t and
32-bit bus_size_t (sparc), change the pcmcia_mem_map(9) offsetp
argument to bus_size_t as it is used as a bus_space offset.
2001-12-15 13:23:20 +00:00
augustss ba528e6dec Small change to Christos' fix: allow malloc() to return NULL, but complain
if it does.
2001-12-06 20:00:58 +00:00
christos 94074f1212 change the malloc arg from NOWAIT to WAITOK; pointed out by lennard. 2001-12-06 19:54:02 +00:00
christos dbabce6bb7 PR/14852: Martin Husemann: Allocate the slotdata the the probed slot before
we call the configuration function. Thanks lennard for pointing it out.
XXX: Someone should look this over and make sure that the current strategy
makes sense.
2001-12-06 19:52:56 +00:00
lukem a4bae8b066 add/cleanup RCSID 2001-11-13 13:14:31 +00:00
jdolecek 2b7d2123cd Make console polling (cnpollc/cngetc) work on IBM PS/2 keyboard controller
using level triggered interrupts, which livelocks calling intr routine
if the data register is not read in the interrupt routine, as it's case
when polling after interrupts are enabled during boot.

Block all interrupts when polling for keypress, and modify intr routine
to read and store value from data register. The latter one is to avoid
losing a keypress when one would manage to press a key when kernel is
not in spl-guarded code section.

Tested with classic pccons, 'pcconskbd at pckbc' and 'pckbd at pckbc'
configurations, on i386.
2001-07-31 13:15:28 +00:00
jdolecek 000f85917b Since ~all pckbc_poll_data1() callers had the appropriate pckbc
tag handy and we are going to need more of it in pckbc_poll_data1() soon,
change pckbc_poll_data1() to accept it as first arg. iot, ioh_d, ioh_c are
no longer passed separately. Use fabricated pckbc tag for calls from
arch/arc/jazz/pckbc_jazzio.c and dev/isa/pckbc_isa.c.
2001-07-23 21:03:19 +00:00
thorpej 0884f20bf7 bzero -> memset 2001-07-07 16:13:44 +00:00
thorpej 7711ad565b bcopy -> memcpy 2001-07-07 15:53:13 +00:00
jdolecek adaaf11f9f make pckbc_slot_names[], pckbc_portcmd const 2001-06-17 16:15:41 +00:00
jdolecek f6af05f407 Back the last revision off, upon Bill Sommerfeld's request 2001-06-02 00:46:00 +00:00
jdolecek 5dbe622e77 When polling, raise priority level to tty, to block keyboard interrupts
when the system is "warm", i.e. interrupts are not blocked anymore.
This seems to be necessary on my PS/2 Model 70 keyboard - without this,
system ends up in endless loop calling the keyboard intr routine if a key
is pressed when polling. This _may_ be just specific to level-triggered
interrupts PS/2 MCA uses, though it's more likely it's just the way the
particular keyboard controller works.

Discussed on tech-kern@.
2001-06-02 00:01:04 +00:00
drochner 5e1115908d Revert previous change; this breaks for the old controllers which 1.6
should help for. Instead, weaken the "echo" test: don't insist in
getting the same value back which was written.
2001-05-17 10:48:39 +00:00
christos 6ae38c2f7a Try the kbc_auxtest if the random write/read to the aux port fails (it returns
0xfe on my gateway 2000 circa 1993). That should not affect broken controllers
that choke on the kbc_auxtest, because for those the write/read test succeeds.
2001-05-15 22:01:07 +00:00
drochner 9e9590f441 Change the way the aux port is probed for. Some older chipsets w/o
mouse port seem to interpret the "test aux port" (0xa9) command differently,
leading to a non-working keyboard.
Now we try to echo a byte through the aux port by means of the "echo aux"
(0xd3) command, which is what Linux does.
Thanks to Christoph Badura for detailed reports and testing.
2001-04-09 15:45:50 +00:00
soda 0f76c56f2d increase number of parameters of pckbc_cnattach(), since offset of command port
is not 4 (KBCMDP), but 1 on jazz based platforms of arc port.
2000-06-09 04:58:32 +00:00
sommerfeld f1802cf848 Fix previous change: guard against missing subdevices of pckbc. 2000-06-06 16:21:22 +00:00
sommerfeld bcf02ec8ff If rnd is configured into the kernel, do rnd(4) entropy collection
from devices connected to pckbc:
 - Do actual sample collection in pckbc.
 - Add rndsource_element_t to the slot data.
 - Change pckbc_set_inputhandler() to take an additional argument,
the name of the device, which is (eventually) passed into
rnd_attach_source() to identify the source.
 - Change callers of pckbc_set_inputhander() appropriately.
2000-06-05 22:20:54 +00:00
thorpej fc96443d15 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.
2000-03-23 07:01:25 +00:00
thorpej 4560ac465a Split the PC-like keyboard controller driver into chip back-end and
bus front-end.
1999-12-03 22:48:22 +00:00