summaryrefslogtreecommitdiffstats
path: root/sys/dev/kbd
Commit message (Collapse)AuthorAgeFilesLines
* Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.ed2011-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.
* Restore binary compatibility for GIO_KEYMAP and PIO_KEYMAP.ed2011-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.
* Explicitly tell the compiler that we don't care about the return valuerpaulo2010-10-131-5/+5
| | | | of kbdd_ioctl().
* Use an unsigned integer for storing the key code.ed2009-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
* Make the keyboard layer Unicode aware.ed2009-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/...
* Move buffer management into kbd and kbdmux drivers.ed2009-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.
* Whitespace nitpickingemax2009-04-091-2/+2
| | | | MFC after: 1 week
* Introduce KB_POLLED flag to struct keyboard's kb_flags field.emax2009-04-091-0/+4
| | | | | Reviewed by: freebsd-current@, freebsd-hackers@ MFC after: 1 week
* Replace all calls to minor() with dev2unit().ed2008-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
* Don't include <sys/tty.h> in non-TTY drivers.ed2008-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)
* Remove explicit calls to keyboard methods with their respective variantswkoszek2007-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
* Sweep kernel replacing suser(9) calls with priv(9) calls, assigningrwatson2006-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>
* Integrate kbdmux(4) into syscons(4) and kbd code.emax2006-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
* kbdmux(4) keyboard multiplexer integrationemax2005-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
* - Hook up the new locations of the atkbdc(4), atkbd(4) and psm(4) sourcemarius2005-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
* Remove bus_{mem,p}io.h and related code for a micro-optimization on i386nyan2005-05-291-1/+0
| | | | | | and amd64. The optimization is a trivial on recent machines. Reviewed by: -arch (imp, marcel, dfr)
* Move the pc98 keymap define into pckbdtables.h because it should be usednyan2005-05-121-142/+0
| | | | only on the pckbd driver.
* Backout previous diffs - this functionality is already provided by thesobomax2005-04-071-15/+0
| | | | | | | hints to the atkbd(4). PR: Submitted by: jhb
* Make previous commit actually working by replacing TUNABLE_INT() withsobomax2005-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
* Provide a new tunable hw.atkbdc.broken_kit_cmd, which if set to 1sobomax2005-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
* plug memory leaksam2005-02-261-18/+37
| | | | Noticed by: Coverity Prevent analysis tool
* #include fcntl.h not vnode.h. Check O_NONBLOCK not IO_NDELAY.phk2004-12-221-2/+2
|
* Add a new flag to the atkbd(4) driver to disable testing the keyboardjhb2004-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
* Do the dreaded s/dev_t/struct cdev */phk2004-06-162-7/+7
| | | | Bump __FreeBSD_version accordingly.
* Remove atdevbase and replace it's remaining uses with direct references tojhb2004-06-101-0/+1
| | | | KERNBASE instead.
* 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
* Assign keycodes for Power, Sleep and Wake keys.fjoe2003-10-071-0/+9
| | | | Submitted by: Eugene Grosbein <eugen@grosbein.pp.ru>
* Fix dev_t handling to avoid needless makedev() call.phk2003-09-272-12/+6
|
* Use __FBSDID().obrien2003-08-243-3/+9
| | | | 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'.
* Add support for the A4 Tech RFSW-35 mouse wheel. Probe is similar tomikeh2003-07-121-0/+1
| | | | | | 4D Plus. PR: 44333
* - 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.
* AMD64 physical space is much larger than i386, de-i386 the bus_space andpeter2003-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/*)
* Update the hardcoded bus tags for early console support for amd64.peter2003-05-011-1/+1
|
* 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>
* 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
* Spelling.charnier2003-02-051-1/+1
|
* 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.
* Include "opt_kbd.h" since certain structures size depend on the valuephk2002-10-151-0/+2
| | | | | | | | | | | | | | of KBDIO_DEBUG which may be defined in the kernel config (as it is in NOTES). This kind of bug is a _really_ horribly thing as we end up with one bit of code thinking a particular structure is 136 bytes and another that it is only 112 bytes. Ideally all places would remember to #include the right "opt_foo.h" file, but I think in practice file containing the variable sized struct should #include it explicitly as a precaution. Detected by: FlexeLint
* Replace various spelling with FALLTHROUGH which is lint()ablecharnier2002-08-251-2/+2
|
* de-count atkbdc. I have more extensive patches to make properly dynamic,peter2002-08-191-2/+1
| | | | | | but since pc hardware only allows one AT-style keyboard controller, this doesn't seem particularly urgent. (I do not know what the old sunriver remote keyboard/mouse/vga cards do, that might be an exception).
OpenPOWER on IntegriCloud