aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/kbd
Commit message (Collapse)AuthorAgeFilesLines
* MFC r311650Nikolai Lifanov2017-01-171-1/+1
| | | | | | | | | | | | | | Restore priority value for OGIO_KEYMAP PR: 206678 Submitted by: ecturt@gmail.com Reviewed by: cem Approved by: cem, matthew (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D5095 Notes: svn path=/stable/11/; revision=312351
* MFC r307145: Use M_WAITOK in PIO_KEYMAP ioctlEd Maste2016-10-191-1/+1
| | | | | | | The malloc return value is not checked. Notes: svn path=/stable/11/; revision=307634
* MFC r303335: apply some style(9) to kbd: make function name start in column 1Ed Maste2016-09-151-8/+8
| | | | Notes: svn path=/stable/11/; revision=305846
* Use unsigned version of min() when handling arguments of SETFKEY ioctl.Gleb Smirnoff2016-05-171-1/+1
| | | | | | | | | Submitted by: C Turt <cturt hardenedbsd.org> Security: SA-16:18 Security: CVE-2016-1886 Notes: svn path=/head/; revision=300089
* sys/dev: minor spelling fixes.Pedro F. Giffuni2016-05-031-1/+1
| | | | | | | Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955
* sys: Make use of our rounddown() macro when sys/param.h is available.Pedro F. Giffuni2016-04-301-1/+1
| | | | | | | No functional change. Notes: svn path=/head/; revision=298848
* sys/dev: use our nitems() macro when it is avaliable through param.h.Pedro F. Giffuni2016-04-191-1/+1
| | | | | | | | | | No functional change, only trivial cases are done in this sweep, Drivers that can get further enhancements will be done independently. Discussed in: freebsd-current Notes: svn path=/head/; revision=298307
* Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.Ed Schouten2011-11-071-1/+1
| | | | | | | | | The SYSCTL_NODE macro defines a list that stores all child-elements of that node. If there's no SYSCTL_DECL macro anywhere else, there's no reason why it shouldn't be static. Notes: svn path=/head/; revision=227309
* Restore binary compatibility for GIO_KEYMAP and PIO_KEYMAP.Ed Schouten2011-07-171-8/+32
| | | | | | | | | | | | Back in 2009 I changed the ABI of the GIO_KEYMAP and PIO_KEYMAP ioctls to support wide characters. I created a patch to add ABI compatibility for the old calls, but I didn't get any feedback to that. It seems now people are upgrading from 8 to 9 they experience this issue, so add it anyway. Notes: svn path=/head/; revision=224126
* Explicitly tell the compiler that we don't care about the return valueRui Paulo2010-10-131-5/+5
| | | | | | | of kbdd_ioctl(). Notes: svn path=/head/; revision=213770
* Use an unsigned integer for storing the key code.Ed Schouten2009-09-221-1/+1
| | | | | | | | | | | | It seems Clang breaks when checking for SPCLKEY, which is now 0x80000000. Using an unsigned integer fixes this. This is also consistent with other pieces of kbd/syscons code, because these also use u_int. Submitted by: rdivacky Notes: svn path=/head/; revision=197400
* Make the keyboard layer Unicode aware.Ed Schouten2009-09-191-7/+19
| | | | | | | | | | | | | | | Just take keyent_t to use an u_int to store the Unicode codepoints. Unfortunately the keymap is now too big to be loaded using an ioctl argument, so change the ioctl to pick a pointer. This change breaks kbdcontrol ABI. It doesn't break X11, because X11 doesn't do anything with syscons keymaps. It just switches the device out of K_XLATE. Obtained from: //depot/user/ed/newcons/... Notes: svn path=/head/; revision=197330
* Move buffer management into kbd and kbdmux drivers.Ed Schouten2009-06-051-23/+51
| | | | | | | | | | | These two drivers seem to be the last consumers of clists. clists are quite overengineered for simple circular buffers, so I'm adding similar buffer management routines to the kbd and kbdmux drivers. The input buffer is now part of the softc structures, instead of having dynamically allocated cblocks. Notes: svn path=/head/; revision=193512
* Whitespace nitpickingMaksim Yevmenkin2009-04-091-2/+2
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=190870
* Introduce KB_POLLED flag to struct keyboard's kb_flags field.Maksim Yevmenkin2009-04-091-0/+4
| | | | | | | | Reviewed by: freebsd-current@, freebsd-hackers@ MFC after: 1 week Notes: svn path=/head/; revision=190869
* Replace all calls to minor() with dev2unit().Ed Schouten2008-09-271-2/+2
| | | | | | | | | | | | | | | | | | After I removed all the unit2minor()/minor2unit() calls from the kernel yesterday, I realised calling minor() everywhere is quite confusing. Character devices now only have the ability to store a unit number, not a minor number. Remove the confusion by using dev2unit() everywhere. This commit could also be considered as a bug fix. A lot of drivers call minor(), while they should actually be calling dev2unit(). In -CURRENT this isn't a problem, but it turns out we never had any problem reports related to that issue in the past. I suspect not many people connect more than 256 pieces of the same hardware. Reviewed by: kib Notes: svn path=/head/; revision=183397
* Don't include <sys/tty.h> in non-TTY drivers.Ed Schouten2008-07-241-1/+2
| | | | | | | | | | | | | The kbd, kbdmux, ugen and uhid drivers included <sys/tty.h>, because they needed clists, which have been moved to <sys/clist.h> some time ago. In the MPSAFE TTY branch, <sys/tty.h> does not include <sys/clist.h>, which means we have to teach these drivers to include this header file directly. Approved by: philip (mentor, implicit) Notes: svn path=/head/; revision=180777
* Remove explicit calls to keyboard methods with their respective variantsWojciech A. Koszek2007-12-292-17/+56
| | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=174984
* Sweep kernel replacing suser(9) calls with priv(9) calls, assigningRobert Watson2006-11-061-9/+10
| | | | | | | | | | | | | | | | specific privilege names to a broad range of privileges. These may require some future tweaking. Sponsored by: nCircle Network Security, Inc. Obtained from: TrustedBSD Project Discussed on: arch@ Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri, Alex Lyashkov <umka at sevcity dot net>, Skip Ford <skip dot ford at verizon dot net>, Antoine Brodin <antoine dot brodin at laposte dot net> Notes: svn path=/head/; revision=164033
* Integrate kbdmux(4) into syscons(4) and kbd code.Maksim Yevmenkin2006-02-281-0/+24
| | | | | | | | | | | | | | | | | | | | | | | By default syscons(4) will look for the kbdmux(4) keyboard first, and then, if not found, look for any keyboard. Current kbd code is modified so if kbdmux(4) is the current keyboard, all new keyboards are automatically added to the kbdmux(4). Switch to kbdmux(4) can be done at boot time, by loading kbdmux module at the loader prompt, or at runtime, by kldload'ing the kbdmux module and releasing current active keyboard. If, for whatever reason, kbdmux(4) is not required/desired then just do not load it and everything should work as before. It is also possible to kldunload kbdmux at runtime and syscons(4) will automatically switch to the first available keyboard. No response from: freebsd-current@ MFC after: 1 day Notes: svn path=/head/; revision=156126
* kbdmux(4) keyboard multiplexer integrationMaksim Yevmenkin2005-07-132-3/+18
| | | | | | | | | | | | | | | | | | | | | | o Add two new ioctl's KBADDKBD and KBRELKBD. These are used to add and remove keyboard to (and from) kbdmux(4) keyboard multiplexer; o Introduce new kbd_find_keyboard2() function. It does exactly the same job as kbd_find_keyboard() function except it allows to specify starting index. This function can be used to iterate over keyboards array; o Re-implement kbd_find_keyboard() as call to kbd_find_keyboard2() with starting index of zero; o Make sure syscons(4) passed KBADDKBD and KBRELKBD ioctl's onto currently active keyboard. These changes should not have any visible effect. MFC after: 1 week Notes: svn path=/head/; revision=147980
* - Hook up the new locations of the atkbdc(4), atkbd(4) and psm(4) sourceMarius Strobl2005-06-104-2795/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=147271
* Remove bus_{mem,p}io.h and related code for a micro-optimization on i386Yoshihiro Takahashi2005-05-291-1/+0
| | | | | | | | | and amd64. The optimization is a trivial on recent machines. Reviewed by: -arch (imp, marcel, dfr) Notes: svn path=/head/; revision=146734
* Move the pc98 keymap define into pckbdtables.h because it should be usedYoshihiro Takahashi2005-05-121-142/+0
| | | | | | | only on the pckbd driver. Notes: svn path=/head/; revision=146138
* Backout previous diffs - this functionality is already provided by theMaxim Sobolev2005-04-071-15/+0
| | | | | | | | | | hints to the atkbd(4). PR: Submitted by: jhb Notes: svn path=/head/; revision=144768
* Make previous commit actually working by replacing TUNABLE_INT() withMaxim Sobolev2005-04-071-11/+11
| | | | | | | | | | TUNABLE_INT_FETCH(). Apparently keyboard init is performed earlier in the boot process than fetching all static tunables. MFC after: 1 day Notes: svn path=/head/; revision=144753
* Provide a new tunable hw.atkbdc.broken_kit_cmd, which if set to 1Maxim Sobolev2005-04-071-0/+15
| | | | | | | | | | | | | | | | | | instructs the driver to avoid using Keyboard Interface Test command. This command causes problems with some non-compliant hardware, resulting in machine being abruptly powered down early in the boot process. Particularly it's known that HP ZV5000 and Compaq R3000Z notebooks are affected by this problem. Due to popularity of those models this patch is good MFC5.4 candidate. PR: 67745 Submitted by: Jung-uk Kim jkim at niksun.com MFC after: 1 days Notes: svn path=/head/; revision=144749
* plug memory leakSam Leffler2005-02-261-18/+37
| | | | | | | Noticed by: Coverity Prevent analysis tool Notes: svn path=/head/; revision=142569
* #include fcntl.h not vnode.h. Check O_NONBLOCK not IO_NDELAY.Poul-Henning Kamp2004-12-221-2/+2
| | | | Notes: svn path=/head/; revision=139193
* Add a new flag to the atkbd(4) driver to disable testing the keyboardJohn Baldwin2004-12-152-1/+3
| | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=138900
* Do the dreaded s/dev_t/struct cdev */Poul-Henning Kamp2004-06-162-7/+7
| | | | | | | Bump __FreeBSD_version accordingly. Notes: svn path=/head/; revision=130585
* Remove atdevbase and replace it's remaining uses with direct references toJohn Baldwin2004-06-101-0/+1
| | | | | | | KERNBASE instead. Notes: svn path=/head/; revision=130312
* style(9): return foo -> return (foo)Dag-Erling Smørgrav2004-04-021-95/+95
| | | | | | | also fix a continuation indent I missed in the previous commit. Notes: svn path=/head/; revision=127752
* Clean up whitespace, fix continuation indents, wrap some long lines.Dag-Erling Smørgrav2004-04-021-27/+27
| | | | Notes: svn path=/head/; revision=127751
* Device megapatch 4/6:Poul-Henning Kamp2004-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. Notes: svn path=/head/; revision=126080
* Device megapatch 1/6:Poul-Henning Kamp2004-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. Notes: svn path=/head/; revision=126076
* While USB keyboards attach as ukbd[0-9]+, the device node created byDag-Erling Smørgrav2004-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. Notes: svn path=/head/; revision=125087
* - Implement selwakeuppri() which allows raising the priority of aSeigo Tanimura2003-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 Notes: svn path=/head/; revision=122352
* Assign keycodes for Power, Sleep and Wake keys.Max Khon2003-10-071-0/+9
| | | | | | | Submitted by: Eugene Grosbein <eugen@grosbein.pp.ru> Notes: svn path=/head/; revision=120875
* Fix dev_t handling to avoid needless makedev() call.Poul-Henning Kamp2003-09-272-12/+6
| | | | Notes: svn path=/head/; revision=120502
* Use __FBSDID().David E. O'Brien2003-08-243-3/+9
| | | | | | | Also some minor style cleanups. Notes: svn path=/head/; revision=119418
* Fix for FAIL_IF_NO_KBD case as expected.Hidetoshi Shimokawa2003-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'. Notes: svn path=/head/; revision=117513
* Add support for the A4 Tech RFSW-35 mouse wheel. Probe is similar toMike Heffner2003-07-121-0/+1
| | | | | | | | | 4D Plus. PR: 44333 Notes: svn path=/head/; revision=117478
* - Use the new resource_disabled() helper function to see if devices areJohn Baldwin2003-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. Notes: svn path=/head/; revision=117167
* AMD64 physical space is much larger than i386, de-i386 the bus_space andPeter Wemm2003-05-121-1/+3
| | | | | | | | | | | bus_dma MD code for AMD64. (And a trivial ifdef update in dev/kbd because of this). More updates are needed here to take advantage of the 64 bit instructions. Approved by: re (blanket amd64/*) Notes: svn path=/head/; revision=114930
* Update the hardcoded bus tags for early console support for amd64.Peter Wemm2003-05-011-1/+1
| | | | Notes: svn path=/head/; revision=114382
* Fix some easy, global, lint warnings. In most cases, this meansMark Murray2003-04-301-1/+1
| | | | | | | | making some local variables static. In a couple of cases, this means removing an unused variable. Notes: svn path=/head/; revision=114293
* Deprecate machine/limits.h in favor of new sys/limits.h.Alexander Kabaev2003-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> Notes: svn path=/head/; revision=114216
* Add a a sysctl, hw.kbd.keymap_restrict_change, which acts a bitDavid Malone2003-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 Notes: svn path=/head/; revision=112050
* Gigacommit to improve device-driver source compatibility betweenPoul-Henning Kamp2003-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) Notes: svn path=/head/; revision=111815