summaryrefslogtreecommitdiffstats
path: root/sys/dev/nmdm/nmdm.c
Commit message (Collapse)AuthorAgeFilesLines
* Start each of the license/copyright comments with /*-, minor shuffle of linesimp2005-01-061-1/+1
|
* #include of <sys/vnode.h> not necesary.phk2004-12-221-1/+0
|
* Add new function ttyinitmode() which sets our systemwide defaultphk2004-10-181-7/+1
| | | | | | | | | | | | | | 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.
* Preparation commit for the tty cleanups that will follow in the nearphk2004-07-151-1/+1
| | | | | | | | | 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.
* Add modemcontrol support for DTR and DCD.phk2004-07-041-6/+37
| | | | Tested by: ambrisko
* Second half of the dev_t cleanup.phk2004-06-171-1/+1
| | | | | | | | | | | The big lines are: NODEV -> NULL NOUDEV -> NODEV udev_t -> dev_t udev2dev() -> findcdev() Various minor adjustments including handling of userland access to kernel space struct cdev etc.
* Do the dreaded s/dev_t/struct cdev */phk2004-06-161-8/+8
| | | | Bump __FreeBSD_version accordingly.
* Machine generated patch which changes linedisc calls from accessingphk2004-06-041-4/+4
| | | | | | linesw[] directly to using the ttyld...() functions The ttyld...() functions ar inline so there is no performance hit.
* A major overhaul of the nmdm(4) driver:phk2004-06-011-375/+81
| | | | | | | | | | | | | | | | | | | | | | | | | It was based on the pty(4) driver which as a tty side an a non-tty side. Nmdm(4) seems to have inherited two symmetric sides from pty but unfortunately they are not quite ttys. Running a getty one one side and tip on the other failed to produce NL->CRNL mapping for instance. Rip out the basically bogus cdevsw->{read,write} functions and rely on ttyread() and ttywrite() which does the same thing. Use taskqueue_swi_giant to run a task for either side to do what needs to be done. (Direct calling is not an option as it leads to recursion.) Trigger the task from the t_oproc and t_stop methods. Default the ports to not ECHO. Since we neither rate limiting nor emulation, two ports echoing each other is a really bad idea, which can only be properly mitigated by rate limiting, rate emulation or intelligent detection. Rate emulation would be a neat feature. Ditch the modem-line emulation, if needed for some app, it needs to be thought much more about how it interacts with the open/close logic.
* There is no need to explicitly call the stop function. In all likelyhoodphk2004-06-011-1/+0
| | | | ->l_close() did it and ttyclose certainly will.
* Add missing <sys/module.h> includesphk2004-05-301-0/+1
|
* Remove advertising clause from University of California Regent'simp2004-04-071-4/+0
| | | | | | | license, per letter dated July 22, 1999 and email from Peter Wemm, Alan Cox and Robert Watson. Approved by: core, peter, alc, rwatson
* Add clone_setup() function rather than rely on lazy initialization.phk2004-03-111-0/+1
| | | | Requested by: rwatson
* Device megapatch 4/6:phk2004-02-211-2/+3
| | | | | | | | 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 3/6:phk2004-02-211-1/+0
| | | | | | | | | | | | 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.
* Device megapatch 2/6:phk2004-02-211-84/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds a couple of functions for pseudodrivers to use for implementing cloning in a manner we will be able to lock down (shortly). Basically what happens is that pseudo drivers get a way to ask for "give me the dev_t with this unit number" or alternatively "give me a dev_t with the lowest guaranteed free unit number" (there is unfortunately a lot of non-POLA in the exact numeric value of this number, just live with it for now) Managing the unit number space this way removes the need to use rman(9) to do so in the drivers this greatly simplifies the code in the drivers because even using rman(9) they still needed to manage their dev_t's anyway. I have taken the if_tun, if_tap, snp and nmdm drivers through the mill, partly because they (ab)used makedev(), but mostly because together they represent three different problems for device-cloning: if_tun and snp is the plain case: just give me a device. if_tap has two kinds of devices, with a flag for device type. nmdm has paired devices (ala pty) can you can clone either of them.
* - 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
* I don't know from where the notion that device driver should orphk2003-09-281-2/+2
| | | | | | | | | | | | | | even could call VOP_REVOKE() on vnodes associated with its dev_t's has originated, but it stops right here. If there are things people belive destroy_dev() needs to learn how to do, please tell me about it, preferably with a reproducible test case. Include <sys/uio.h> in bluetooth code rather than rely on <sys/vnode.h> to do so. The fact that some of the USB code needs to include <sys/vnode.h> still disturbs me greatly, but I do not have time to chase that.
* Use __FBSDID().obrien2003-08-241-1/+3
| | | | Also some minor style cleanups.
* Make TTYHOG tunable.das2003-03-051-0/+2
| | | | Reviewed by: mike (mentor)
* Gigacommit to improve device-driver source compatibility betweenphk2003-03-031-13/+9
| | | | | | | | | | | | | 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)
* Back out M_* changes, per decision of the TRB.imp2003-02-191-1/+1
| | | | Approved by: trb
* 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.
* Change the suser() API to take advantage of td_ucred as well as do ajhb2002-04-011-1/+1
| | | | | | | | | | | | 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@
* Simple p_ucred -> td_ucred changes to start using the per-thread ucredjhb2002-02-271-1/+1
| | | | reference.
* Cleanup of nmdm devicejulian2002-02-201-61/+100
|
* Don't call cdevsw_add().phk2001-11-041-1/+1
| | | | XXX: this driver lacks a proper _clone method.
* KSE Milestone 2julian2001-09-121-9/+9
| | | | | | | | | | | | | | 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
* Remove unused nmdmpoll function.mp2001-08-111-63/+0
| | | | Approved by: julian
* Send the remains (such as I have located) of "block major numbers" tophk2001-03-261-1/+0
| | | | the bit-bucket.
* Remove warnings.. seems to compile as a module now too.julian2001-02-271-4/+3
|
* Catch up with rwatsons ucred changes.julian2001-02-271-1/+1
|
* Do it right this time. Give it a better name and placejulian2001-02-271-0/+644
CVSrepo deletion of the previous attempt will be requested: --original message-- Add the 'virtual nulmodem driver' Particularly useful for debuging kernels using vmware. If your name is Bruce evans and you are a WIZ at tty interfaces, then you should probably rip this to shreds and offer lots of suggestions and patches. I've been using this since 4.0-CURRENT and it's never caused problems but I'm sure I got something wrong. This is similar to the pty/cty device driver except that both sides are ttys. Even minor numbers are side A and odd minor numbers are side B. Work needs to be done regarding what happens to the other side when you close a node. to use with vmware, configure vmware to redirect COM2 out to side A of one of these and boot a kernel with teh gdb remote port set to sio1. AFTER dropping into the gdb kernel debugger in your test kernel, fire up gdb with it's remote port pointing at the appropriate side B. To catch all console output, you can boot the vmware kernel with a serial console, (COM1) similarly redirected to a nulmodem, and use 'tip' to observe it. This is practically unaltered since pre 4.0 days except for changes made along the way needed to make it compile, so any suggestions or offers of total rewrites will be listenned to :-)
OpenPOWER on IntegriCloud