summaryrefslogtreecommitdiffstats
path: root/sys/dev/atkbdc
Commit message (Collapse)AuthorAgeFilesLines
* Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.ed2011-11-071-2/+2
| | | | | | 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-0/+1
| | | | | | | | | 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.
* Correct a typo.delphij2011-06-201-1/+1
| | | | | Submitted by: Fabian Keil <fk fabiankeil de> MFC after: 3 days
* Add comments about the validation.delphij2011-06-111-0/+9
|
* Validate INT 15h and 16h vectors more strictly. Traditionally these entryjkim2011-06-061-1/+2
| | | | | | | | | | | | | | | | | | | points are fixed addresses and (U)EFI CSM specification also mandated that. Unfortunately, (U)EFI CSM specification does not specifically mention this is to call service routine via interrupt vector table or to jump directly to the entry point. As a result, some CSM seems to install two routines and acts differently, depending on how it was executed, unfortunately. When INT 15h is used, it calls a function pointer (which is probably a UEFI service function). When it jumps directly to the entry point, it executes a simple and traditional INT 15h service routine. Therefore, actually there are two possible fixes, i. e., this fix or jumping directly to the fixed entry point. However, we chose this fix because a) keyboard typematic support via BIOS is becoming extremely rarer and b) we cannot support random service routine installed by a firmware or a boot loader. This should fix Lenovo X220 laptop, specifically. Reviewed by: delphij MFC after: 3 days
* Revert r222152. The root cause was analysed and better fix is upcoming.jkim2011-06-062-4/+0
| | | | Discussed with: delphij
* Add a new knob to atkbd(4) to enable typematic rate detection on boot,delphij2011-05-202-0/+4
| | | | | | | | | which is now disabled by default. The detection is known to cause hangs on boot with some new Lenovo laptops on FreeBSD/amd64. Reported by: gnn Discussed with: jkim MFC after: 3 months
* Only use the BIOS-supplied IRQ for the atkbdc device for a child atkbdjhb2010-12-211-8/+10
| | | | | | device. Specifically, do not reuse it for a child psm device. Tested by: many
* Merge amd64 and i386 bus.h and move the resulting header to x86. Replacetijl2010-12-201-4/+2
| | | | | | | | | the original amd64 and i386 headers with stubs. Rename (AMD64|I386)_BUS_SPACE_* to X86_BUS_SPACE_* everywhere. Reviewed by: imp (previous version), jhb Approved by: kib (mentor)
* - If the atkbdc device is assigned an IRQ resource by ACPI or the PnPBIOS,jhb2010-12-163-14/+55
| | | | | | | | | | allow the child atkbd device to reuse that IRQ resource instead of reallocating the same IRQ from the parent bus inside the atkbd driver. - Don't allocate a shared IRQ for the atkbd driver. For AT keyboard devices on an ISA bus the IRQ is not shareable. Instead, the bus driver should mark the IRQ shareable if the bus supports shared IRQs. - Don't identify child devices until after the atkbdc device itself has attached.
* - When moving the IRQ resource from the psmcpnp device to the psm device,jhb2010-12-161-15/+5
| | | | | | | delete the IRQ resource from the psmcpnp device completely. - Don't allocate the IRQ resource shared. It is not a shareable interrupt on ISA. The bus driver can set RF_SHAREABLE if the IRQ is actually shareable on a non-ISA bus.
* Various small typos and grammar nits in comments.jhb2010-11-181-4/+4
|
* bus_add_child: change type of order parameter to u_intavg2010-09-101-2/+2
| | | | | | | | | | This reflects actual type used to store and compare child device orders. Change is mostly done via a Coccinelle (soon to be devel/coccinelle) semantic patch. Verified by LINT+modules kernel builds. Followup to: r212213 MFC after: 10 days
* Let psm(4) use si_drv1 to refer to its softc.ed2010-09-091-28/+22
|
* On certain chipsets AT keyboard controller isn't present and issobomax2010-04-294-16/+69
| | | | | | | | | | | | | | | | | | | | emulated by BIOS using SMI interrupt. On those chipsets reading from the status port may be thousand times slower than usually. Sometimes this emilation is not working properly resulting in commands timing out and since we assume that inb() operation takes very little time to complete we need to adjust number of retries to keep waiting time within a designed limits (100ms). Measure time it takes to make read_status() call and adjust number of retries accordingly. To keep it simple, use TSC to measure inb() performance and keep it to amd64-only, since TSC may not available on older CPUs. Also enable detection of the AT controller absence on amd64. Reviewed by: jhb MFC after: 1 month
* Add new "hw.psm.tap_enabled" tunable and sysctl.dumbbell2009-12-181-0/+35
| | | | | | | | | | | | | This tunable allows one to enable (1) or disable (0) gestures like tap and tap-hold on Synaptics TouchPad when the Extended mode isn't enabled (ie. "hw.psm.synaptics_support" not set). By default, the value is -1 in order to keep the current behaviour of not enabling/disabling gestures explicitly. PR: kern/139272 Submitted by: David Horn <dhorn2000 AT gmail DOT com> Reviewed by: David Horn <dhorn2000 AT gmail DOT com>
* Rewrite x86bios and update its dependent drivers.jkim2009-10-191-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Do not map entire real mode memory (1MB). Instead, we map IVT/BDA and ROM area separately. Most notably, ROM area is mapped as device memory (uncacheable) as it should be. User memory is dynamically allocated and free'ed with contigmalloc(9) and contigfree(9). Remove now redundant and potentially dangerous x86bios_alloc.c. If this emulator ever grows to support non-PC hardware, we may implement it with rman(9) later. - Move all host-specific initializations from x86emu_util.c to x86bios.c and remove now unnecessary x86emu_util.c. Currently, non-PC hardware is not supported. We may use bus_space(9) later when the KPI is fixed. - Replace all bzero() calls for emulated registers with more obviously named x86bios_init_regs(). This function also initializes DS and SS properly. - Add x86bios_get_intr(). This function checks if the interrupt vector is available for the platform. It is not necessary for PC-compatible hardware but it may be needed later. ;-) - Do not try turning off monitor if DPMS does not support the state. - Allocate stable memory for VESA OEM strings instead of just holding pointers to them. They may or may not be accessible always. Fix a memory leak of video mode table while I am here. - Add (experimental) BIOS POST call for vesa(4). This function calls VGA BIOS POST code from the current VGA option ROM. Some video controllers cannot save and restore the state properly even if it is claimed to be supported. Usually the symptom is blank display after resuming from suspend state. If the video mode does not match the previous mode after restoring, we try BIOS POST and force the known good initial state. Some magic was taken from NetBSD (and it was taken from vbetool, I believe.) - Add a loader tunable for vgapci(4) to give a hint to dpms(4) and vesa(4) to identify who owns the VESA BIOS. This is very useful for multi-display adapter setup. By default, the POST video controller is automatically probed and the tunable "hw.pci.default_vgapci_unit" is set to corresponding vgapci unit number. You may override it from loader but it is very unlikely to be necessary. Unfortunately only AGP/PCI/PCI-E controllers can be matched because ISA controller does not have necessary device IDs. - Fix a long standing bug in state save/restore function. The state buffer pointer should be ES:BX, not ES:DI according to VBE 3.0. If it ever worked, that's because BX was always zero. :-) - Clean up register initializations more clearer per VBE 3.0. - Fix a lot of style issues with vesa(4).
* Fix couple of style nits missed in the previous commit.jkim2009-09-251-1/+1
|
* - Use x86bios_offset() instead of BIOS_PADDRTOVADDR() macro.[1]jkim2009-09-251-14/+23
| | | | | | | | | | | | | | | - Clear all registers before calling real mode interrupt handlers as we did for dpms and vesa and re-enable the function as it should be fixed by this. - Tidy up register access. For example, when we call INT 0x15, AH=0xc0, we used to initialize AX=0xc000 to clear AL at the same time but it is very confusing. We don't have to do this any more because we are explicitly clearing all registers now. - Check size of system configuration table although it is almost always 8. This is to make sure we are not reading some random low physical memory. Hopefully it is just zero in that case. :-) - Fix some style nits and add more comments. Submitted by: paradox (ddkprog yahoo com)[1]
* - Use FreeBSD function naming convention.jkim2009-09-241-3/+3
| | | | | | | - Change x86biosCall() to more appropriate x86bios_intr().[1] Discussed with: delphij, paradox (ddkprog yahoo com) Submitted by: paradox (ddkprog yahoo com)[1]
* Move sys/dev/x86bios to sys/compat/x86bios.jkim2009-09-231-1/+1
| | | | | | It may not be optimal but it is clearly better than the old place. OK'ed by: delphij, paradox (ddkprog yahoo com)
* Temporarily disable typematic retrieving code until we get a real fix,delphij2009-09-221-2/+2
| | | | | | | which currently causes hangs in some configurations. Reported by: joel Submitted by: swell.k at gmail.com
* Allow atkbd to obtain keyboard repeat rate from BIOS on amd64.delphij2009-09-211-19/+18
| | | | Submitted by: swell.k at gmail.com
* Temporarily revert the new-bus locking for 8.0 release. It will bejhb2009-08-201-4/+0
| | | | | | reintroduced after HEAD is reopened for commits by re@. Approved by: re (kib), attilio
* Make the newbus subsystem Giant free by adding the new newbus sxlock.attilio2009-08-021-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The newbus lock is responsible for protecting newbus internIal structures, device states and devclass flags. It is necessary to hold it when all such datas are accessed. For the other operations, softc locking should ensure enough protection to avoid races. Newbus lock is automatically held when virtual operations on the device and bus are invoked when loading the driver or when the suspend/resume take place. For other 'spourious' operations trying to access/modify the newbus topology, newbus lock needs to be automatically acquired and dropped. For the moment Giant is also acquired in some key point (modules subsystem) in order to avoid problems before the 8.0 release as module handlers could make assumptions about it. This Giant locking should go just after the release happens. Please keep in mind that the public interface can be expanded in order to provide more support, if there are really necessities at some point and also some bugs could arise as long as the patch needs a bit of further testing. Bump __FreeBSD_version in order to reflect the newbus lock introduction. Reviewed by: ed, hps, jhb, imp, mav, scottl No answer by: ariff, thompsa, yongari Tested by: pho, G. Trematerra <giovanni dot trematerra at gmail dot com>, Brandon Gooch <jamesbrandongooch at gmail dot com> Sponsored by: Yahoo! Incorporated Approved by: re (ksmith)
* Prevent atkbd(4) interrupt handler from calling keyboard callback functionemax2009-04-171-2/+4
| | | | | | | | | | when polled mode is enabled. This should help with duplicated/missing characters problem at mountroot, geli, etc. prompts on multi CPU systems while kbdmux(4) is enabled. Tested by: Tobias Grosser <grosser -at- fim -dot- uni-passau -dot- de> Tested by: Fabian Keil <freebsd-listen -at- fabiankeil -dot- de> MFC after: 3 days
* Teach psm about O_ASYNCrnoland2009-03-161-0/+23
| | | | | | This makes Xorg happy if you aren't using moused. MFC after: 3 days
* bus_add_child takes a const char *.imp2009-02-051-3/+3
|
* Synaptics touchpads must be reinitialized after suspend/resume.dumbbell2008-12-171-1/+9
| | | | | | This fixes touchpad resume on Asus EeePC among others. Submitted by: rpaulo
* Rephrase and/or fix some comments in Synaptics touchpad initializationdumbbell2008-12-161-10/+15
| | | | function.
* Rewrite Synaptics touchpads support with the following goals in mind:dumbbell2008-10-141-175/+982
| | | | | | | | | | | | | | | | | o better quality of the movement smoothing o more features such as tap-hold and virtual scrolling Support must still be enabled with this line in your /boot/loader.conf: hw.psm.synaptics_support="1" The following sysctls were removed: hw.psm.synaptics.low_speed_threshold hw.psm.synaptics.min_movement hw.psm.synaptics.squelch_level An overview of this new driver and a short documentation about the added sysctls is available on the wiki: http://wiki.freebsd.org/SynapticsTouchpad
* 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
* Fill in sysctl descriptions.trhodes2008-07-261-10/+18
| | | | Approved by: philip
* Try to detect a Synaptics touchpad before IntelliMouse. Some touchpads willphilip2008-06-011-2/+2
| | | | | | | | | | | | | pretend to be IntelliMouse (which have a few more features than generic mice) causing the IntelliMouse probe to work and the Synaptics code never to be called. This should not break "real" IntelliMouse because the Synaptics detection code is fairly specific. PR: kern/120833 Submitted by: Eygene Ryabinkin <rea-fbsd -at- codelabs.ru> MFC after: 1 week
* Clean up and fix style(9) nits.jkim2008-04-081-2852/+2938
|
* - Add write(2) support for psm(4) in native operation level. Now arbitraryjkim2008-04-081-7/+53
| | | | | | | commands can be written to /dev/psm%d and status can be read back from it. - Reflect the change in psm(4) and bump version for ports. MFC after: 1 week
* Some PS/2 mice (at least the A4Tech X-7xx) need to be set to Intelli moderink2008-02-251-0/+7
| | | | | | | | | first before they can be set to Explorer mode. PR: kern/118578 Submitted by: Andriy Gapon <avg@icyb.net.ua> (I added some comments) Reviewed by: philip MFC after: 1 month
* Remove explicit calls to keyboard methods with their respective variantswkoszek2007-12-292-8/+8
| | | | | | | | | | | | | | | 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
* Initialize mouse resolution to zero if converting frommjacob2007-06-171-0/+2
| | | | OLD to NEW.
* o break newbus api: add a new argument of type driver_filter_t topiso2007-02-232-2/+2
| | | | | | | | | | | | | bus_setup_intr() o add an int return code to all fast handlers o retire INTR_FAST/IH_FAST For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current Reviewed by: many Approved by: re@
* Synaptics TouchPad seems to go back to Relative Mode after the calldumbbell2007-02-041-0/+10
| | | | | | | to set_controller_command_byte() call; by issueing a Read Mode Byte command, the touchpad is in Absolute Mode again. This problem occursed at least on Asus V6V laptops.
* Spell "Kensington Thinking Mouse" correctly.keramida2006-12-181-1/+1
|
* 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
* Avoid an infinite loop in empty_both_buffers() by adding a timeout.dwhite2006-09-041-0/+11
| | | | | | | | | | | This helps systems that don't actually have atkbd controllers, such as the Intel SBX82 blade, boot without device.hints hacks. Hardware for this fix provided by iXsystems. PR: 94822 Submitted by: Devon H. O'Dell <devon.odell@coyotepoint.com> MFC After: 3 days
* Make sure command/data port (0x60) and status port (0x64) are in correctjkim2006-07-031-4/+10
| | | | order. Some brain-damaged ACPI BIOS has reversed resources.
* MFp4: need machine/bus.h here since we use bus space macros. It used toimp2006-06-121-0/+1
| | | | | | be brought in by name-space polluted sys/rman.h. Pointy hat to: imp
* 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-122-3/+1
|
* Use the same method for detecting actual presence of AT-style keyboardsobomax2006-04-263-5/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
OpenPOWER on IntegriCloud