summaryrefslogtreecommitdiff
path: root/sys/dev/syscons/sysmouse.c
AgeCommit message (Collapse)Author
2025-03-07sysmouse(4): Add wsp(4)-style T-Axis reporting.Joshua Rogers
Neither the ums(4) nor psm(4) reporting can be used by the wsp(4) driver, as they rely on static-length movements, while wsp(4) may need to scroll in large amounts per evdev event push. This style uses a false button-5 press as an indicator that the z-axis movement is a horizontal scroll, otherwise a vertical scroll. Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu>
2023-08-16sys: Remove $FreeBSD$: one-line .c patternWarner Losh
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-05-12spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
2022-11-18evdev: Extend EVIOCGRAB ioctl scope to cover sysmouse interfaceVladimir Kondratyev
of psm(4), ums(4) and sysmouse(4) drivers. EVIOCGRAB ioctl execution on /dev/input/event# device node gains exclusive access to this device to caller. It is used mostly for development purposes and remote control software. See e.g. https://reviews.freebsd.org/D30020 which is the reason of creation of this change. MFC after: 2 weeks Tested by: corvink Differential revision: https://reviews.freebsd.org/D30542
2020-09-01syscons: clean up empty lines in .c and .h filesMateusz Guzik
Notes: svn path=/head/; revision=365088
2018-06-10Drop MOUSE_GETVARS and MOUSE_SETVARS ioctls support.Vladimir Kondratyev
These ioctls are not documented and only stubbed in a few drivers: mse(4), psm(4) and syscon's sysmouse(4). The only exception is MOUSE_GETVARS implemented in psm(4) Given the fact that they were introduced 20 years ago and implementation has never been completed, remove any related code. PR: 228718 (exp-run) Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D15726 Notes: svn path=/head/; revision=334923
2017-11-27sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni
Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326255
2017-11-01sysmouse(4): Fix ums(4)-style T-axis reporting via evdev protocolVladimir Kondratyev
- Do not report T-axis wheel events as button presses - Reverse T-axis to match Linux - Remove wrong comment. T-axis buttons state should be checked by level not by edge to allow continuous wheel tilt reporting Reviewed by: gonzo Approved by: gonzo (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D12676 Notes: svn path=/head/; revision=325297
2016-12-10[evdev] Adds evdev support to sysmouse(4) driverOleksandr Tymoshenko
For horizontal (T-axis) wheel reporting which is not supported by sysmouse protocol kern.evdev.sysmouse_t_axis sysctl is introduced. It can take following values: 0 - no T-axis events (default) 1 - T-axis events are originated in ums(4) driver. 2 - T-axis events are originated in psm(4) driver. Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru> MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D8597 Notes: svn path=/head/; revision=309823
2014-06-27Use a common tunable to choose between vt(4)/sc(4)Ed Maste
With this change and previous work from ray@ it will be possible to put both in GENERIC, and have one enabled by default, but allow the other to be selected via the loader. (The previous implementation had separate kern.vt.disable and hw.syscons.disable tunables, and would panic if both drivers were compiled in and neither was explicitly disabled.) MFC after: 1 week Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=267965
2014-06-18Allow to disable syscons(4) if "hw.syscons.disable" kenv is set.Aleksandr Rybalko
Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=267625
2009-11-28Include <sys/ttydefaults.h>, instead of doing it through <sys/termios.h>.Ed Schouten
I want to prevent the header polution of <sys/termios.h> eventually. Notes: svn path=/head/; revision=199881
2009-05-29Last minute TTY API change: remove mutex argument from tty_alloc().Ed Schouten
I don't want people to override the mutex when allocating a TTY. It has to be there, to keep drivers like syscons happy. So I'm creating a tty_alloc_mutex() which can be used in those cases. tty_alloc_mutex() should eventually be removed. The advantage of this approach, is that we can just remove a function, without breaking the regular API in the future. Notes: svn path=/head/; revision=193018
2008-11-08Reduce the default baud rate of PTY's to 9600.Ed Schouten
On RELENG_6 (and probably RELENG_7) we see our syscons windows and pseudo-terminals have the following buffer sizes: | LINE RAW CAN OUT IHIWT ILOWT OHWT LWT COL STATE SESS PGID DISC | ttyv0 0 0 0 7680 6720 2052 256 7 OCcl 1146 1146 term | ttyp0 0 0 0 7680 6720 1296 256 0 OCc 82033 82033 term These buffer sizes make no sense, because we often have much more output than input, but I guess having higher input buffer sizes improves guarantees of the system. On MPSAFE TTY I just sent both the input and output buffer sizes to 7 KB, which is pretty big on a standard FreeBSD install with 8 syscons windows and some PTY's. Reduce the baud rate to 9600 baud, which means we now have the following buffer sizes: | LINE INQ CAN LIN LOW OUTQ USE LOW COL SESS PGID STATE | ttyv0 1920 0 0 192 1984 0 199 7 2401 2401 Oil | pts/0 1920 0 0 192 1984 0 199 5631 1305 2526 Oi This is a lot smaller, but for pseudo-devices this should be good enough. You need to do a lot of punching to fill up a 7.5 KB input buffer. If it turns out things don't work out this way, we'll just switch to 19200 baud. Notes: svn path=/head/; revision=184771
2008-08-24Make sysmouse(4) use its own locks, instead of using Giant.Ed Schouten
When I changed syscons(4) to work with the MPSAFE TTY code, I just locked all device nodes down using the compatibility feature that allows you to override the TTY's lock (Giant in this case). Upon closer inspection, it seems sysmouse(4) only has two internal variables that need locking: mouse_level and mouse_status. I haven't done any performance benchmarks on this, though I think it won't have any dramatic improvements on the system. It is good to get rid of Giant here, because the third argument of tty_alloc() has only been added to ease migration to MPSAFE TTY. It should not be used when not needed. While there, remove SC_MOUSE, which is a leftover from the MPSAFE TTY import. Notes: svn path=/head/; revision=182109
2008-08-20Integrate the new MPSAFE TTY layer to the FreeBSD operating system.Ed Schouten
The last half year I've been working on a replacement TTY layer for the FreeBSD kernel. The new TTY layer was designed to improve the following: - Improved driver model: The old TTY layer has a driver model that is not abstract enough to make it friendly to use. A good example is the output path, where the device drivers directly access the output buffers. This means that an in-kernel PPP implementation must always convert network buffers into TTY buffers. If a PPP implementation would be built on top of the new TTY layer (still needs a hooks layer, though), it would allow the PPP implementation to directly hand the data to the TTY driver. - Improved hotplugging: With the old TTY layer, it isn't entirely safe to destroy TTY's from the system. This implementation has a two-step destructing design, where the driver first abandons the TTY. After all threads have left the TTY, the TTY layer calls a routine in the driver, which can be used to free resources (unit numbers, etc). The pts(4) driver also implements this feature, which means posix_openpt() will now return PTY's that are created on the fly. - Improved performance: One of the major improvements is the per-TTY mutex, which is expected to improve scalability when compared to the old Giant locking. Another change is the unbuffered copying to userspace, which is both used on TTY device nodes and PTY masters. Upgrading should be quite straightforward. Unlike previous versions, existing kernel configuration files do not need to be changed, except when they reference device drivers that are listed in UPDATING. Obtained from: //depot/projects/mpsafetty/... Approved by: philip (ex-mentor) Discussed: on the lists, at BSDCan, at the DevSummit Sponsored by: Snow B.V., the Netherlands dcons(4) fixed by: kan Notes: svn path=/head/; revision=181905
2008-03-16In keeping with style(9)'s recommendations on macros, use a ';'Robert Watson
after each SYSINIT() macro invocation. This makes a number of lightweight C parsers much happier with the FreeBSD kernel source, including cflow's prcc and lxr. MFC after: 1 month Discussed with: imp, rink Notes: svn path=/head/; revision=177253
2006-11-06Sweep kernel replacing suser(9) calls with priv(9) calls, assigningRobert Watson
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
2005-12-04Fix -Wundef.Ruslan Ermilov
Notes: svn path=/head/; revision=153072
2005-02-27Remove debug printout of major/minor numbers, print name instead.Poul-Henning Kamp
Notes: svn path=/head/; revision=142692
2004-10-18Add new function ttyinitmode() which sets our systemwide defaultPoul-Henning Kamp
modes on a tty structure. Both the ".init" and the current settings are initialized allowing the function to be used both at attach and open time. The function takes an argument to decide if echoing should be enabled. Echoing should not be enabled for regular physical serial ports unless they are consoles, in which case they should be configured by ttyconsolemode() instead. Use the new function throughout. Notes: svn path=/head/; revision=136680
2004-10-14Fix echo in console mode.Poul-Henning Kamp
Notes: svn path=/head/; revision=136505
2004-07-15Preparation commit for the tty cleanups that will follow in the nearPoul-Henning Kamp
future: rename ttyopen() -> tty_open() and ttyclose() -> tty_close(). We need the ttyopen() and ttyclose() for the new generic cdevsw functions for tty devices in order to have consistent naming. Notes: svn path=/head/; revision=132226
2004-06-16Do the dreaded s/dev_t/struct cdev */Poul-Henning Kamp
Bump __FreeBSD_version accordingly. Notes: svn path=/head/; revision=130585
2004-06-04Manual edits to change linesw[]-frobbing to ttyld_*() calls.Poul-Henning Kamp
Notes: svn path=/head/; revision=130095
2004-06-04Machine generated patch which changes linedisc calls from accessingPoul-Henning Kamp
linesw[] directly to using the ttyld...() functions The ttyld...() functions ar inline so there is no performance hit. Notes: svn path=/head/; revision=130077
2004-06-01Remove unused variable.Poul-Henning Kamp
Notes: svn path=/head/; revision=129954
2004-06-01Gainfully employ the new ttyioctl in the trivial cases.Poul-Henning Kamp
Notes: svn path=/head/; revision=129944
2004-02-21Device megapatch 4/6:Poul-Henning Kamp
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
2004-02-21Device megapatch 3/6:Poul-Henning Kamp
Add missing D_TTY flags to various drivers. Complete asserts that dev_t's passed to ttyread(), ttywrite(), ttypoll() and ttykqwrite() have (d_flags & D_TTY) and a struct tty pointer. Make ttyread(), ttywrite(), ttypoll() and ttykqwrite() the default cdevsw methods for D_TTY drivers and remove the explicit initializations in various drivers cdevsw structures. Notes: svn path=/head/; revision=126078
2004-02-21Device megapatch 1/6:Poul-Henning Kamp
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
2003-08-24Use __FBSDID().David E. O'Brien
Also some minor style cleanups. Notes: svn path=/head/; revision=119420
2003-03-03Gigacommit to improve device-driver source compatibility betweenPoul-Henning Kamp
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
2002-04-01Change the suser() API to take advantage of td_ucred as well as do aJohn Baldwin
general cleanup of the API. The entire API now consists of two functions similar to the pre-KSE API. The suser() function takes a thread pointer as its only argument. The td_ucred member of this thread must be valid so the only valid thread pointers are curthread and a few kernel threads such as thread0. The suser_cred() function takes a pointer to a struct ucred as its first argument and an integer flag as its second argument. The flag is currently only used for the PRISON_ROOT flag. Discussed on: smp@ Notes: svn path=/head/; revision=93593
2001-09-12KSE Milestone 2Julian Elischer
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 Notes: svn path=/head/; revision=83366
2001-07-06Call ttymalloc() when sysmouse is opened, rather thanKazutaka YOKOTA
when the driver is attached. MFC after: 2 weeks Notes: svn path=/head/; revision=79344
2001-03-26Send the remains (such as I have located) of "block major numbers" toPoul-Henning Kamp
the bit-bucket. Notes: svn path=/head/; revision=74810
2000-10-29Move suser() and suser_xxx() prototypes and a related #define fromPoul-Henning Kamp
<sys/proc.h> to <sys/systm.h>. Correctly document the #includes needed in the manpage. Add one now needed #include of <sys/systm.h>. Remove the consequent 48 unused #includes of <sys/proc.h>. Notes: svn path=/head/; revision=67893
2000-10-09Initiate deorbit burn sequence for <machine/mouse.h>.Poul-Henning Kamp
Replace all in-tree uses with <sys/mouse.h> which repo-copied a few moments ago from src/sys/i386/include/mouse.h by peter. This is also the appropriate fix for exo-tree sources. Put warnings in <machine/mouse.h> to discourage use. November 15th 2000 the warnings will be converted to errors. January 15th 2001 the <machine/mouse.h> files will be removed. Notes: svn path=/head/; revision=66860
2000-10-08Initiate deorbit burn sequence for <machine/console.h>.Poul-Henning Kamp
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. Notes: svn path=/head/; revision=66834
2000-09-10Harvest mouse events for the entropy device in a better place. In theMark Murray
new location, all mouse events are harvested, not just the ones being written out to moused(8). This means that mouse entropy is harvested at the consoles as well as in X. Notes: svn path=/head/; revision=65690
2000-08-27Fix ioctl MOUSE_SETMODE as defined in mouse(4).Kazutaka YOKOTA
(Do not return EINVAL when -1 is specified as a new value, as it should mean "preserve the current value.") Notes: svn path=/head/; revision=65129
2000-07-25o Fix a horrible bug where small reads (< 8 bytes) would return theMark Murray
wrong bytes. o Improve the public interface; use void* instead of char* or u_int64_t to pass arbitrary data around. Submitted by: kris ("horrible bug") Notes: svn path=/head/; revision=63855
2000-07-09Add entropy-harvesting calls.Mark Murray
/dev/random now has new-and-improved entropy! Notes: svn path=/head/; revision=62842
2000-01-29Use config's conditional compilation rather than using #ifdefs that makePeter Wemm
modular compilation harder. I'm doing this because people seem to like cut/pasting examples of bad practices in existing code. Notes: svn path=/head/; revision=56836
2000-01-15This is the 3rd stage of syscons code reorganization.Kazutaka YOKOTA
- Split terminal emulation code from the main part of the driver so that we can have alternative terminal emulator modules if we like in the future. (We are not quite there yet, though.) - Put sysmouse related code in a separate file, thus, simplifying the main part of the driver. As some files are added to the source tree, you need to run config(8) before you compile a new kernel next time. You shouldn't see any functional change by this commit; this is only internal code reorganization. Notes: svn path=/head/; revision=56043