summaryrefslogtreecommitdiffstats
path: root/sys/dev/atkbdc/atkbd.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove explicit calls to keyboard methods with their respective variantswkoszek2007-12-291-4/+4
| | | | | | | | | | | | | | | 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
* Fix LEDs not working when atkbd is an active keyboard and the physicalru2006-10-251-16/+16
| | | | | | | | | | | | | | | | | | | | keyboard is attached only after the system has already booted. If USB keyboard is also present, and there's no kbdmux(4), the problem has been hiding itself because as soon as we get to multi-user, the USB keyboard becomes an active keyboard (see devd.conf), thus marking atkbd inactive and letting the old code initialize the keyboard. With kbdmux(4), or if there's no USB keyboard, the atkbd keyboard is always active, whether it's physically attached or not, thus it never initialized itself properly on a physical attach. To fix this, move block that initialized the keyboard on attach upper so it doesn't depend on the (KBD_IS_ACTIVE(kbd) && KBD_IS_BUSY(kbd)) condition. Also move KBD_FOUND_DEVICE() a few lines upper so that KDSETLED and KDSETREPEAT that follow it propagate to the controller. MFC after: 3 days
* Fix our ioctl(2) implementation when the argument is "int". Newru2006-09-271-0/+33
| | | | | | | | | | | | | ioctls passing integer arguments should use the _IOWINT() macro. This fixes a lot of ioctl's not working on sparc64, most notable being keyboard/syscons ioctls. Full ABI compatibility is provided, with the bonus of fixing the handling of old ioctls on sparc64. Reviewed by: bde (with contributions) Tested by: emax, marius MFC after: 1 week
* Send the pcvt(4) driver off to retirement.phk2006-05-171-3/+0
|
* Remove various bits of conditional Alpha code and fixup a few comments.jhb2006-05-121-1/+1
|
* Use the same method for detecting actual presence of AT-style keyboardsobomax2006-04-261-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | controller as we use in boot blocks (querying status register until bit 1 goes off). If that doesn't happed during reasonable period assume that the hardware doesn't have AT-style keyboard controller. This makes FreeBSD working almost OOB on MacBook Pro (still there are issues with putting second CPU core on-line, but since installation CD comes with UP kernel with this change one should be able to install FreeBSD without playing tricks with hints). Other legacy-free hardware (e.g. IBM NetVista S40) should benefit from this as well, but since I don't have any I can't verify. It should make no difference on the ordinary i386 hardware (since in that case that hardware already would be having an issues with A20 routines in boot blocks). I don't know much about AT-style keyboard controller on other platforms (and don't have dedicated access to one), therefore, the code is restricted to i386 for now. I suspect that amd64 may need this as well, but I would rather leave this decision to someone who knows better about the platform(s) in question. I have tested this change on as many "ordinary i386 boxes" as I can get my hands on, and it doesn't create any false negatives on hardware with AT-style keyboard present. MFC after: 1 month
* - Hook up the new locations of the atkbdc(4), atkbd(4) and psm(4) sourcemarius2005-06-101-7/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | files after they were repo-copied to sys/dev/atkbdc. The sources of atkbdc(4) and its children were moved to the new location in preparation for adding an EBus front-end to atkbdc(4) for use on sparc64; i.e. in order to not further scatter them over the whole tree which would have been the result of adding atkbdc_ebus.c in e.g. sys/sparc64/ebus. Another reason for the repo-copies was that some of the sources were misfiled, e.g. sys/isa/atkbd_isa.c wasn't ISA-specific at all but for hanging atkbd(4) off of atkbdc(4) and was renamed to atkbd_atkbdc.c accordingly. Most of sys/isa/psm.c, i.e. expect for its PSMC PNP part, also isn't ISA-specific. - Separate the parts of atkbdc_isa.c which aren't actually ISA-specific but are shareable between different atkbdc(4) bus front-ends into atkbdc_subr.c (repo-copied from atkbdc_isa.c). While here use bus_generic_rl_alloc_resource() and bus_generic_rl_release_resource() respectively in atkbdc_isa.c instead of rolling own versions. - Add sparc64 MD bits to atkbdc(4) and atkbd(4) and an EBus front-end for atkbdc(4). PS/2 controllers and input devices are used on a couple of Sun OEM boards and occur on either the EBus or the ISA bus. Depending on the board it's either the only on-board mean to connect a keyboard and mouse or an alternative to either RS232 or USB devices. - Wrap the PSMC PNP part of psm.c in #ifdef DEV_ISA so it can be compiled without isa(4) (e.g. for EBus-only machines). This ISA-specific part isn't separated into its own source file, yet, as it requires more work than was feasible for 6.0 in order to do it in a clean way. Actually philip@ is working on a rewrite of psm(4) so a more comprehensive clean-up and separation of hardware dependent and independent parts is expected to happen after 6.0. Tested on: i386, sparc64 (AX1105, AXe and AXi boards) Reviewed by: philip
* plug memory leaksam2005-02-261-18/+37
| | | | Noticed by: Coverity Prevent analysis tool
* Add a new flag to the atkbd(4) driver to disable testing the keyboardjhb2004-12-151-1/+2
| | | | | | | | | | | port during the device probe as this can cause hangs on some machines, specifically Compaq R3000Z series amd64 laptops. The flag is bit 3, or 0x8. PR: amd64/67745 Reported by: Neil Winterbauer newntrbr at ucla dot edu, many others Tested by: ade, astrodog at gmail dot com, many others MFC after: 1 week
* Remove atdevbase and replace it's remaining uses with direct references tojhb2004-06-101-0/+1
| | | | KERNBASE instead.
* Assign keycodes for Power, Sleep and Wake keys.fjoe2003-10-071-0/+9
| | | | Submitted by: Eugene Grosbein <eugen@grosbein.pp.ru>
* Use __FBSDID().obrien2003-08-241-1/+3
| | | | Also some minor style cleanups.
* Fix for FAIL_IF_NO_KBD case as expected.simokawa2003-07-131-1/+3
| | | | | | | | Even if we have no AT keyboard, an AT keyboard is registered because it's probed with KB_CONF_PROBE_ONLY flag set during console initialization. Unregister the keyboard if it doesn't present while second probe. This should fix USB keyboard only case without 'kbdcontrol -k /dev/kbd1'.
* - Use the new resource_disabled() helper function to see if devices arejhb2003-07-021-2/+1
| | | | | | | | | | | | disabled. - Change the apm driver to match the acpi driver's behavior by checking to see if the device is disabled in the identify routine instead of in the probe routine. This way if the device is disabled it is never created. Note that a few places (ips(4), Alpha SMP) used "disable" instead of "disabled" for their hint names, and these hints must be changed to "disabled". If this is a big problem, resource_disabled() can always be changed to honor both names.
* Fix some easy, global, lint warnings. In most cases, this meansmarkm2003-04-301-1/+1
| | | | | making some local variables static. In a couple of cases, this means removing an unused variable.
* Deprecate machine/limits.h in favor of new sys/limits.h.kan2003-04-291-2/+1
| | | | | | | Change all in-tree consumers to include <sys/limits.h> Discussed on: standards@ Partially submitted by: Craig Rodrigues <rodrigc@attbi.com>
* Spelling.charnier2003-02-051-1/+1
|
* Replace various spelling with FALLTHROUGH which is lint()ablecharnier2002-08-251-2/+2
|
* GC various bits and pieces of USERCONFIG from all over the place.phk2002-04-091-1/+1
|
* Fix typo: conole -> consoleasmodai2002-04-081-1/+1
| | | | | PR: 33965 Submitted by: Nicola Vitale <nivit@libero.it>
* Return consistent key action codes at key press and releaseyokota2001-07-201-1/+1
| | | | | | | | | | 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
* Free the kbd pointer when it isn't NULL, as opposed to when it is.dwmalone2001-01-221-1/+1
| | | | | | This was a typo in the M_ZERO patches. Submitted by: Mike Silbersack <silby@silby.com>
* Convert more malloc+bzero to malloc+M_ZERO.dwmalone2000-12-081-9/+6
| | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net>
* Remove unneeded #include <machine/clock.h>phk2000-10-151-1/+0
|
* Initiate deorbit burn sequence for <machine/console.h>.phk2000-10-081-1/+1
| | | | | | | | | 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.
* Manipulate with AltGR Led (really CapsLock Led) only in K_XLATE mode, becauseache2000-05-281-1/+2
| | | | | | | | | all other modes not set ALKED flag and it means that CapsLock always turned off for them. Real bug example is X11 which never turn on CapsLock with Russian keyboard. PR: 18651 Submitted by: "Mike E. Matsnev" <mike@po.cs.msu.su>
* - Properly keep track of I/O port resources.yokota2000-03-191-9/+12
| | | | - Use bus_space_read/write() to access the ports.
* One more patch for the atkbd driver. It will make sure that theyokota2000-03-111-0/+12
| | | | | | | | | | | | | | keyboard port and interrupt is enabled and the driver is attached even when the keyboard itself is not present when the system is booting. (This has been the behavior through out 2.X and 3.X, but is somehow broken in 4.0.) # I certainly don't recommend people to `hot-plug' the AT keyboard, # because the interface isn't designed for hot-plugging and such act # will often break the keyboard controller. But, so many people want to # do that anyway... Approved by: jkh
* - Be slightly more cautious and try to make more sure the keyboardyokota2000-02-111-4/+9
| | | | | | | input queue is emptied when initializing the keyboard controller. - Remove an unnecessary `if' statement. Approved by: jkh
* Use config's conditional compilation rather than using #ifdefs that makepeter2000-01-291-5/+0
| | | | | modular compilation harder. I'm doing this because people seem to like cut/pasting examples of bad practices in existing code.
* - Add some comment from bde on the keyboard interrupt.yokota2000-01-201-11/+19
| | | | - Fix obsolete comments.
* Rework shifta/ctla/alta key handling. It appears that there wasyokota2000-01-111-7/+0
| | | | | misunderstanding between the PR originator and me. I hope I got it right this time.
* Obtain the initial key repeat rate setting via BIOS in i386 ifyokota2000-01-101-0/+54
| | | | possible.
* Add some keyboard IDs.yokota2000-01-101-2/+9
|
* - Remember the keyboard repeat delay and rate.yokota1999-12-131-10/+32
| | | | | - Add a new ioctl, KDGETREPEAT, to retrieve the keyboard repeat rate. - Delete unnecessary #include.
* Add support new keys: lshifta, rshifta, lctrla, rctrla, lalta, andyokota1999-12-101-1/+15
| | | | | | | | | 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
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Convert DEVFS hooks in (most) drivers to make_dev().phk1999-08-231-2/+1
| | | | | | | | | | | | | | | | Diskslice/label code not yet handled. Vinum, i4b, alpha, pc98 not dealt with (left to respective Maintainers) Add the correct hook for devfs to kern_conf.c The net result of this excercise is that a lot less files depends on DEVFS, and devtoname() gets more sensible output in many cases. A few drivers had minor additional cleanups performed relating to cdevsw registration. A few drivers don't register a cdevsw{} anymore, but only use make_dev().
* - Remove cdevsw entry points in individual keyboard drivers;yokota1999-08-221-105/+8
| | | | | | | | 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
* Correctly save `flags' bits.yokota1999-08-151-1/+2
|
* - Move the `return' statement the correct place so that the keyboardyokota1999-07-181-5/+5
| | | | won't be initialized if `atkbd?' is disabled.
* This commit should be a extensive NO-OP:phk1999-05-301-6/+21
| | | | | | | | | | | | | 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.
* - Include isa/isareg.h rather than i386/isa/isa.h for i386.yokota1999-05-201-43/+3
| | | | - Remove unused (thus, commented out) section of code.
* The previous commit was wrong! This is the correct one ;-<yokota1999-05-181-2/+2
|
* Don't confuse cursor keys with numpad keys when composing a char code.yokota1999-05-091-5/+5
| | | | PR: kern/10988
* Minor tweak after the introduction of new-bus to i386; properlyyokota1999-05-091-14/+14
| | | | check "disabled" and "flags" probe hints.
* Bring the 'new-bus' to the i386. This extensively changes the way thepeter1999-04-161-10/+9
| | | | | | | | | | | | | | | | | | i386 platform boots, it is no longer ISA-centric, and is fully dynamic. Most old drivers compile and run without modification via 'compatability shims' to enable a smoother transition. eisa, isapnp and pccard* are not yet using the new resource manager. Once fully converted, all drivers will be loadable, including PCI and ISA. (Some other changes appear to have snuck in, including a port of Soren's ATA driver to the Alpha. Soren, back this out if you need to.) This is a checkpoint of work-in-progress, but is quite functional. The bulk of the work was done over the last few years by Doug Rabson and Garrett Wollman. Approved by: core
* Keyboard driver update in preparation for the USB keyboard driver.yokota1999-03-101-86/+158
| | | | | | | | | | | | | | | | | | | | | | | - 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.
* - Fixed the bug which always ignored Ctrl-Pause/Break on the AT 101yokota1999-01-281-2/+39
| | | | | | | | | keyboard. - Translate some keycode for the 84 keyboard so that the 84 keyboard and the 101 keyboard become more compatible in terms of keycodes. - Updated the built-in keymaps so that it is in line with the recent changes in share/syscons/keymaps. - Added some comment on the Pause/Break key on the 101 keyboard.
* sysconsyokota1999-01-191-4/+15
| | | | | | | | | | | | | | | | | - Bring down the splash screen when a vty is opened for the first time. - Make sure the splash screen/screen saver is stopped before switching vtys. - Read and save initial values in the BIOS data area early. VESA BIOS may change BIOS data values when switching modes. - Fix missing '&' operator. - Move ISA specific part of driver initialization to syscons_isa.c. atkbd - kbdtables.h is now in /sys/dev/kbd. all - Adjust for forthcoming alpha port. Submitted by: dfr
OpenPOWER on IntegriCloud