path: root/sys/sys/ttydevsw.h
Commit message (Collapse)AuthorAgeFilesLines
* tty: convert tty_lock_assert to tty_assert_locked to hide lock typeKyle Evans2020-04-171-8/+8
| | | | | | | | | | | | | | | | | A later change, currently being iterated on in D24459, will in-fact change the lock type to an sx so that TTY drivers can sleep on it if they need to. Committing this ahead of time to make the review in question a little more palatable. tty_lock_assert() is unfortunately still needed for now in two places to make sure that the tty lock has not been recursed upon, for those scenarios where it's supplied by the TTY driver and possibly a mutex that is allowed to recurse. Suggested by: markj Notes: svn path=/head/; revision=360051
* sys/sys: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | 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=326256
* - Make the code consistent with itself style-wise and bring it closerMarius Strobl2016-01-251-7/+19
| | | | | | | | | to style(9). - Mark unused arguments as such. - Make the ttystates table const. Notes: svn path=/head/; revision=294753
* Correct assertions in r294362, foobared when separating style fixesMarius Strobl2016-01-201-1/+2
| | | | | | | from functional changes before commit. Notes: svn path=/head/; revision=294414
* Fix tty_drain() and, thus, TIOCDRAIN of the current tty(4) incarnationMarius Strobl2016-01-191-1/+13
| | | | | | | | | | | | | | | | to actually wait until the TX FIFOs of UARTs have be drained before returning. This is done by bringing the equivalent of the TS_BUSY flag found in the previous implementation back in an ABI-preserving way. Reported and tested by: Patrick Powell Most likely, drivers for USB-serial-adapters likewise incorporating TX FIFOs as well as other terminal devices that buffer output in some form should also provide implementations of tsw_busy. MFC after: 3 days Notes: svn path=/head/; revision=294362
* Reintroduce the cioctl() hook in the TTY layer for digi(4).Ed Schouten2011-07-021-0/+14
| | | | | | | | | | | | | The cioctl() hook can be used by drivers to add ioctls to the *.init and *.lock devices. This commit breaks the ttydevsw ABI, since this structure didn't provide any padding. To prevent ABI breakage in the future, add a tsw_spare. Submitted by: Peter Jeremy <peter jeremy alcatel lucent com> Obtained from: kern/152254 (slightly modified) Notes: svn path=/head/; revision=223722
* Update d_mmap() to accept vm_ooffset_t and vm_memattr_t.Robert Noland2009-12-291-4/+5
| | | | | | | | | | | | | | | | This replaces d_mmap() with the d_mmap2() implementation and also changes the type of offset to vm_ooffset_t. Purge d_mmap2(). All driver modules will need to be rebuilt since D_VERSION is also bumped. Reviewed by: jhb@ MFC after: Not in this lifetime... Notes: svn path=/head/; revision=201223
* Introduce a hooks layer for the MPSAFE TTY layer.Ed Schouten2008-09-221-3/+1
| | | | | | | | | | | | | | | | | | | | | | | One of the features that prevented us from fixing some of the TTY consumers to work once again, was an interface that allowed consumers to do the following: - `Sniff' incoming data, which is used by the snp(4) driver. - Take direct control of the input and output paths of a TTY, which is used by ng_tty(4), ppp(4), sl(4), etc. There's no practical advantage in committing a hooks layer without having any consumers. In P4 there is a preliminary port of snp(4) and thompsa@ is busy porting ng_tty(4) to this interface. I already want to have it in the tree, because this may stimulate others to work on the remaining modules. Discussed with: thompsa Obtained from: //depot/projects/mpsafetty/... Notes: svn path=/head/; revision=183276
* Fix style(9) issue in TTY header files: document function argument names.Ed Schouten2008-09-221-10/+12
| | | | | | | | | | | | | | | | According to style(9), function argument names should only be omitted for prototypes that are exported to userspace. This means we should document the function arguments in the TTY header files, because they are only used in userspace. While there, change the type of the buffer argument of ttydisc_rint_bypass() to `const void *' instead of `char *'. Requested by: attilio Obtained from: //depot/projects/mpsafetty/... Notes: svn path=/head/; revision=183274
* Implement pts(4) packet mode.Ed Schouten2008-09-041-0/+11
| | | | | | | | | | | | As reported by several users on the mailing lists, applications like screen(1) fail to properly handle ^S and ^Q characters. This was because MPSAFE TTY didn't implement packet mode (TIOCPKT) yet. Add basic packet mode support to make these applications work again. Obtained from: //depot/projects/mpsafetty/... Notes: svn path=/head/; revision=182764
* Integrate the new MPSAFE TTY layer to the FreeBSD operating system.Ed Schouten2008-08-201-0/+158
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