summaryrefslogtreecommitdiffstats
path: root/sys/dev/kbd/kbd.c
Commit message (Collapse)AuthorAgeFilesLines
* Do the dreaded s/dev_t/struct cdev */phk2004-06-161-6/+6
| | | | Bump __FreeBSD_version accordingly.
* style(9): return foo -> return (foo)des2004-04-021-95/+95
| | | | also fix a continuation indent I missed in the previous commit.
* Clean up whitespace, fix continuation indents, wrap some long lines.des2004-04-021-27/+27
|
* Device megapatch 4/6:phk2004-02-211-0/+2
| | | | | | | | 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.
* Device megapatch 1/6:phk2004-02-211-2/+0
| | | | | | | 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.
* While USB keyboards attach as ukbd[0-9]+, the device node created bydes2004-01-271-1/+2
| | | | | | | | | | | 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.
* - Implement selwakeuppri() which allows raising the priority of atanimura2003-11-091-2/+2
| | | | | | | | | | | | | 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
* Fix dev_t handling to avoid needless makedev() call.phk2003-09-271-12/+5
|
* Use __FBSDID().obrien2003-08-241-1/+3
| | | | Also some minor style cleanups.
* Add a a sysctl, hw.kbd.keymap_restrict_change, which acts a bitdwmalone2003-03-091-0/+144
| | | | | | | | | | | | | | | | | | | | | 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
* Gigacommit to improve device-driver source compatibility betweenphk2003-03-031-13/+8
| | | | | | | | | | | | | 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)
* More low-hanging fruit: kill caddr_t in calls to wakeup(9) / [mt]sleep(9).des2003-03-021-3/+3
|
* Back out M_* changes, per decision of the TRB.imp2003-02-191-1/+1
| | | | Approved by: trb
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-1/+1
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Fixes to make select/poll mpsafe.alfred2002-03-141-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* KSE Milestone 2julian2001-09-121-5/+5
| | | | | | | | | | | | | | 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
* Return consistent key action codes at key press and releaseyokota2001-07-201-92/+101
| | | | | | | | | | 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
* With this commit, I hereby pronounce gensetdefs past its use-by date.peter2001-06-131-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Send the remains (such as I have located) of "block major numbers" tophk2001-03-261-1/+0
| | | | the bit-bucket.
* Convert more malloc+bzero to malloc+M_ZERO.dwmalone2000-12-081-4/+3
| | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net>
* Remove unneeded #include <sys/proc.h> lines.phk2000-10-291-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.
* Add the ability to define a "shutdown" and "shutdown and poweroff" keydwmalone2000-09-111-0/+1
| | | | | | | | to syscons. I have a man page to follow describing the format of the kbdmap file. PR: 19273 Reviewed by: sheldonh
* Back out the previous change to the queue(3) interface.jake2000-05-261-2/+2
| | | | | | It was not discussed and should probably not happen. Requested by: msmith and others
* Change the way that the queue(3) structures are declared; don't assume thatjake2000-05-231-2/+2
| | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd
* Use config's conditional compilation rather than using #ifdefs that makepeter2000-01-291-1/+0
| | | | | modular compilation harder. I'm doing this because people seem to like cut/pasting examples of bad practices in existing code.
* Rework shifta/ctla/alta key handling. It appears that there wasyokota2000-01-111-9/+18
| | | | | misunderstanding between the PR originator and me. I hope I got it right this time.
* - Add a module event function to the ukbd driver and make the ukbd KLDyokota1999-12-131-1/+43
| | | | | module work. - Delete unnecessary #include.
* - Remember the keyboard repeat delay and rate.yokota1999-12-131-0/+5
| | | | | - 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-11/+68
| | | | | | | | | 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
* Remove five now unused fields from struct cdevsw. They should neverphk1999-09-251-5/+0
| | | | | | | | 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
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* - Remove cdevsw entry points in individual keyboard drivers;yokota1999-08-221-203/+98
| | | | | | | | 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
* Simplify cdevsw registration.phk1999-05-311-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* This commit should be a extensive NO-OP:phk1999-05-301-5/+20
| | | | | | | | | | | | | 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.
* Don't bogusly define a d_reset_t function.phk1999-05-301-14/+2
|
* Silence warnings.yokota1999-05-181-10/+10
|
* Remove unnecessary function call.yokota1999-05-181-2/+1
|
* Keyboard driver update in preparation for the USB keyboard driver.yokota1999-03-101-14/+60
| | | | | | | | | | | | | | | | | | | | | | | - 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.
* Fix PIO_KEYMAPENT/GIO_KEYMAPENT. They used to copy from/to a wrong place.yokota1999-01-121-3/+3
| | | | The bug found by: Mike Zanker <A.M.Zanker@open.ac.uk>
* Clean up warnings: get conditional compilation right so that a localyokota1999-01-121-6/+11
| | | | | function won't be defined unless it is actually used. Requested by: eivind
* Add the new keyboard driver and video card driver. They will beyokota1999-01-091-0/+1193
used by console drivers. (They are not yet activated yet. Wait for announcement later.)
OpenPOWER on IntegriCloud