aboutsummaryrefslogtreecommitdiff
path: root/sys/net/ppp_tty.c
Commit message (Collapse)AuthorAgeFilesLines
* /* -> /*- for license, minor formatting changesWarner Losh2005-01-071-1/+2
| | | | Notes: svn path=/head/; revision=139823
* Check O_NONBLOCK instead of IO_NDELAY.Poul-Henning Kamp2004-12-221-2/+1
| | | | | | | Don't include <sys/vnode.h> Notes: svn path=/head/; revision=139200
* Don't abuse tp->t_sc, as it is now used by tty drivers.Olivier Houchard2004-11-071-13/+9
| | | | | | | | | This fixes the panic that occurs when using ppp(4) Reported and tested by: Yann Berthier (yb at sainte-barbe dot org) Notes: svn path=/head/; revision=137335
* Preparation commit for the tty cleanups that will follow in the nearPoul-Henning Kamp2004-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. Notes: svn path=/head/; revision=132226
* Pick the hotchar out of the tty structure instead of caching privatePoul-Henning Kamp2004-06-261-0/+1
| | | | | | | | | | | copies. No current line disciplines have a dynamically changing hotchar, and expecting to receive anything sensible during a change in ldisc is insane so no locking of the hotchar field is necessary. Notes: svn path=/head/; revision=131134
* Fix line discipline switching issues: If opening a new ldisc fails,Poul-Henning Kamp2004-06-261-10/+2
| | | | | | | | | | | | | | | | we have to revert to TTYDISC which we know will successfully open rather than try the previous ldisc which might also fail to open. Do not let ldisc implementations muck about with ->t_line, and remove code which checks for reopens, it should never happen. Move ldisc->l_hotchar to tty->t_hotchar and have ldisc implementation initialize it in their open routines. Reset to zero when we enter TTYDISC. ("no" should really be -1 since zero could be a valid hotchar for certain old european mainframe protocols.) Notes: svn path=/head/; revision=131130
* Do the dreaded s/dev_t/struct cdev */Poul-Henning Kamp2004-06-161-2/+2
| | | | | | | Bump __FreeBSD_version accordingly. Notes: svn path=/head/; revision=130585
* Replace the if_name and if_unit members of struct ifnet with new membersBrooks Davis2003-10-311-1/+1
| | | | | | | | | | | | | | | | if_xname, if_dname, and if_dunit. if_xname is the name of the interface and if_dname/unit are the driver name and instance. This change paves the way for interface renaming and enhanced pseudo device creation and configuration symantics. Approved By: re (in principle) Reviewed By: njl, imp Tested On: i386, amd64, sparc64 Obtained From: NetBSD (if_xname) Notes: svn path=/head/; revision=121816
* Back out M_* changes, per decision of the TRB.Warner Losh2003-02-191-4/+4
| | | | | | | Approved by: trb Notes: svn path=/head/; revision=111119
* Remove #include <sys/dkstat.h>Poul-Henning Kamp2003-02-161-1/+0
| | | | Notes: svn path=/head/; revision=111002
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.Alfred Perlstein2003-01-211-4/+4
| | | | | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT. Notes: svn path=/head/; revision=109623
* Use if_printf(ifp, "blah") instead of printf("ppp%d: blah", ifp->if_unit).Brooks Davis2002-10-211-15/+13
| | | | Notes: svn path=/head/; revision=105603
* Be consistent about functions being static.Poul-Henning Kamp2002-10-161-1/+1
| | | | | | | Spotted by: FlexeLint Notes: svn path=/head/; revision=105228
* Make ppp(4) devices clonable and unloadable.Brooks Davis2002-08-091-2/+8
| | | | Notes: svn path=/head/; revision=101588
* Change the suser() API to take advantage of td_ucred as well as do aJohn Baldwin2002-04-011-4/+4
| | | | | | | | | | | | | | | 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
* Remove __P.Alfred Perlstein2002-03-191-18/+18
| | | | Notes: svn path=/head/; revision=92725
* Get rid of the twisted MFREE() macro entirely.Matthew Dillon2002-02-051-3/+1
| | | | | | | | Reviewed by: dg, bmilekic MFC after: 3 days Notes: svn path=/head/; revision=90227
* KSE Milestone 2Julian Elischer2001-09-121-11/+11
| | | | | | | | | | | | | | | | | 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
* * Rename M_WAIT mbuf subsystem flag to M_TRYWAIT.Bosko Milekic2000-12-211-1/+1
| | | | | | | | | | | | | | | | | | | | | This is because calls with M_WAIT (now M_TRYWAIT) may not wait forever when nothing is available for allocation, and may end up returning NULL. Hopefully we now communicate more of the right thing to developers and make it very clear that it's necessary to check whether calls with M_(TRY)WAIT also resulted in a failed allocation. M_TRYWAIT basically means "try harder, block if necessary, but don't necessarily wait forever." The time spent blocking is tunable with the kern.ipc.mbuf_wait sysctl. M_WAIT is now deprecated but still defined for the next little while. * Fix a typo in a comment in mbuf.h * Fix some code that was actually passing the mbuf subsystem's M_WAIT to malloc(). Made it pass M_WAITOK instead. If we were ever to redefine the value of the M_WAIT flag, this could have became a big problem. Notes: svn path=/head/; revision=70254
* Removed unused includes (garbage left over/created by the SMPng megacommit).Bruce Evans2000-09-261-6/+0
| | | | Notes: svn path=/head/; revision=66390
* Major update to the way synchronization is done in the kernel. HighlightsJason Evans2000-09-071-21/+2
| | | | | | | | | | | | | | | | | | include: * Mutual exclusion is used instead of spl*(). See mutex(9). (Note: The alpha port is still in transition and currently uses both.) * Per-CPU idle processes. * Interrupts are run in their own separate kernel threads and can be preempted (i386 only). Partially contributed by: BSDi (BSD/OS) Submissions by (at least): cp, dfr, dillon, grog, jake, jhb, sheldonh Notes: svn path=/head/; revision=65557
* Remove some #if NFOO > 0 that are always true because of config rules.Peter Wemm2000-01-291-5/+0
| | | | Notes: svn path=/head/; revision=56856
* This patch clears the way for removing a number of tty relatedPoul-Henning Kamp1999-09-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | fields in struct cdevsw: d_stop moved to struct tty. d_reset already unused. d_devtotty linkage now provided by dev_t->si_tty. These fields will be removed from struct cdevsw together with d_params and d_maxio Real Soon Now. The changes in this patch consist of: initialize dev->si_tty in *_open() initialize tty->t_stop remove devtotty functions rename ttpoll to ttypoll a few adjustments to these changes in the generic code a bump of __FreeBSD_version add a couple of FreeBSD tags Notes: svn path=/head/; revision=51654
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* I got tired of seeing all the cdevsw[major(foo)] all over the place.Poul-Henning Kamp1999-05-081-2/+2
| | | | | | | | | | | Made a new (inline) function devsw(dev_t dev) and substituted it. Changed to the BDEV variant to this format as well: bdevsw(dev_t dev) DEVFS will eventually benefit from this change too. Notes: svn path=/head/; revision=46676
* Suser() simplification:Poul-Henning Kamp1999-04-271-5/+5
| | | | | | | | | | | | | | | | | | | | | | 1: s/suser/suser_xxx/ 2: Add new function: suser(struct proc *), prototyped in <sys/proc.h>. 3: s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/ The remaining suser_xxx() calls will be scrutinized and dealt with later. There may be some unneeded #include <sys/cred.h>, but they are left as an exercise for Bruce. More changes to the suser() API will come along with the "jail" code. Notes: svn path=/head/; revision=46112
* Undo #undef KERNEL hack for vnode.h to avoid vnode_if.h.Peter Wemm1999-01-171-9/+2
| | | | | | | | | | | | XXX It probably makes sense to have a flag for bsd.kern.mk to avoid these rules. XXX IO_NDELAY seems to be the main reason for it, when used in a cdevsw read or write "flag" context. Perhaps a redundant declaration somewhere like sys/conf.h might help remove the need for vnode.h in these device drivers in the first place. Notes: svn path=/head/; revision=42769
* Missing splx().Peter Wemm1998-06-201-2/+4
| | | | Notes: svn path=/head/; revision=37066
* This commit fixes various 64bit portability problems required forDoug Rabson1998-06-071-3/+3
| | | | | | | | | | | | | FreeBSD/alpha. The most significant item is to change the command argument to ioctl functions from int to u_long. This change brings us inline with various other BSD versions. Driver writers may like to use (__FreeBSD_version == 300003) to detect this change. The prototype FreeBSD/alpha machdep will follow in a couple of days time. Notes: svn path=/head/; revision=36735
* Oops, the previous commit should have changed `i386' to `__i386__',Bruce Evans1998-05-011-3/+3
| | | | | | | not `__i386'. Notes: svn path=/head/; revision=35596
* Support compiling with `gcc -ansi'.Bruce Evans1998-04-151-3/+3
| | | | Notes: svn path=/head/; revision=35210
* Use getmicrotime() for if_lastchange, 10msec is plenty precision.Poul-Henning Kamp1998-04-061-2/+2
| | | | Notes: svn path=/head/; revision=35067
* Eradicate the variable "time" from the kernel, using various measures.Poul-Henning Kamp1998-03-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "time" wasn't a atomic variable, so splfoo() protection were needed around any access to it, unless you just wanted the seconds part. Most uses of time.tv_sec now uses the new variable time_second instead. gettime() changed to getmicrotime(0. Remove a couple of unneeded splfoo() protections, the new getmicrotime() is atomic, (until Bruce sets a breakpoint in it). A couple of places needed random data, so use read_random() instead of mucking about with time which isn't random. Add a new nfs_curusec() function. Mark a couple of bogosities involving the now disappeard time variable. Update ffs_update() to avoid the weird "== &time" checks, by fixing the one remaining call that passwd &time as args. Change profiling in ncr.c to use ticks instead of time. Resolution is the same. Add new function "tvtohz()" to avoid the bogus "splfoo(), add time, call hzto() which subtracts time" sequences. Reviewed by: bde Notes: svn path=/head/; revision=34961
* Moved some #includes from <sys/param.h> nearer to where they are actuallyBruce Evans1998-03-281-2/+2
| | | | | | | used. Notes: svn path=/head/; revision=34924
* Implement the spirit but not the letter of Terrys hot-char patch.Poul-Henning Kamp1998-02-131-3/+4
| | | | | | | | | | The differences Terrys patch and this patch are: * Remove a lot of un-needed comments. * Don't put l_hotchar at the front of stuct linesw, there is no need to. * Use the #defines for the hotchar in the SLIP and PPP line disciplines Notes: svn path=/head/; revision=33322
* Use ENOIOCTL instead of -1 (= ERESTART) for tty ioctls that areBruce Evans1997-12-061-2/+2
| | | | | | | | not handled at a particular level. This fixes mainly restarting of interrupted TIOCDRAINs and TIOCSETA{W,F}s. Notes: svn path=/head/; revision=31577
* Don't test for conflicting combinations of PPP_FILTER/BPFILTER here.Bruce Evans1997-11-181-29/+9
| | | | | | | | | | | | | | | | | Testing in if_ppp.c is good enough. Added comments about bogus #includes and #defines. Removed unused #includes. Don't depend on gcc's misfeature of rewriting short args in old-style function definitions to match wrong prototypes. I just changed the function definition to match the prototype, since this is easy to verify automatically (it causes no changes in the object code), but it breaks K&R1 support and doesn't fix the pessimal type. Notes: svn path=/head/; revision=31266
* Convert PPP_FILTER to an option, like PPP_BSDCOMP and PPP_DEFLATE.Peter Wemm1997-10-181-3/+7
| | | | | | | It requires bpf, I'll note this in LINT. Notes: svn path=/head/; revision=30527
* Better fix for the bpf dependency that doesn't have such a large impactPeter Wemm1997-10-181-1/+6
| | | | | | | | on the code and pppd in userland. PPP_FILTER is meant to be an option (or negatable option). Notes: svn path=/head/; revision=30525
* Try out PPP_FILTERPeter Wemm1997-10-101-1/+2
| | | | Notes: svn path=/head/; revision=30270
* Update for new callout interface.Justin T. Gibbs1997-09-211-3/+3
| | | | Notes: svn path=/head/; revision=29681
* Some fixes from Bruce:Peter Wemm1997-08-221-4/+6
| | | | | | | | | | | - don't access time (a volatile) via struct copy. - merge botches - note risk of CCOUNT accessing *tp outside spltty(). Submitted by: bde Notes: svn path=/head/; revision=28583
* Update kernel parts of pppd from 2.2.0 to 2.3.0. I've yet to look at thePeter Wemm1997-08-191-112/+143
| | | | | | | | | | | | | 2.3.0 -> 2.3.1 changes, but I seem to recall that there are certain "issues" with 2.3.1 (I'm not sure if it's just pppd or the whole lot, I am not quite that far). The present pppd seems to work with it just fine for the time being. Among the changes are that zlib (aka LZ77 aka deflate aka gzip) compression is implemented as well as the original compress(1) LZW style. Notes: svn path=/head/; revision=28415
* Fix this damn mbuf with a negative m_len. It turnsBrian Somers1997-06-221-5/+1
| | | | | | | | | | | | | | | | out to be a problem with VJ header compression. davidg spotted this in usr.sbin/ppp/slcompress.c a while ago, but I believe gave the wrong reasons - it's too easy to reproduce ! The only scenario that I've been able to reproduce the problem under is when m_len is *exactly* 40 ! So go figure ! PR: 3749 Submitted elsewhere by: davidg Obtained from: usr.sbin/ppp/slcompress.c Notes: svn path=/head/; revision=26778
* Protect against garbage mbufs in pppstart.Brian Somers1997-06-181-2/+7
| | | | | | | | | | | Remove previous hack in pppfcs(). This is still not the correct solution. We shouldn't have any incorrect mbufs. This patch does however make pppd/natd work (rather than jamming the interface). Notes: svn path=/head/; revision=26709
* Prevent panic with garbage mbuf.Brian Somers1997-06-091-2/+2
| | | | | | | Submitted by: Lenzi, Sergio <lenzi@bsi.com.br> Notes: svn path=/head/; revision=26517
* Move interrupt handling code from isa.c to a new file. This should makeDoug Rabson1997-06-021-2/+2
| | | | | | | | | | isa.c (slightly) more portable and will make my life developing the really portable version much easier. Reviewed by: peter, fsmp Notes: svn path=/head/; revision=26373
* Bruce mentioned to me that Paul Traina had noticed that the ppp_ttyPeter Wemm1997-05-311-4/+4
| | | | | | | | | | | | | | | interrupt mask hackery wasn't happening when being modloaded via the if_ppp lkm. It seems that the lkm system doesn't particularly like having two sets of load/unload/etc routines. :-] This really should be fixed by having a seperate if_ppp and ppp_tty lkm, but that requires that ppp_tty is loaded after if_ppp, and needs to be able to link with symbols in if_ppp. This gets messy, it is a better task for the in-kernel linker. (if_ppp is generic, ppp_tty is a tty-specific bottom end for if_ppp, it's not _too_ hard to have another "provider" (such as a hdlc sync card) connected to if_ppp) Notes: svn path=/head/; revision=26314
* don't refer to SWI_*_MASK, it's not SMP/UP kernel portable for the lkm.Peter Wemm1997-05-311-4/+3
| | | | Notes: svn path=/head/; revision=26313
* Don't include <sys/ioctl.h> in the kernel. Stage 1: don't includeBruce Evans1997-03-241-2/+1
| | | | | | | | it when it is not used. In most cases, the reasons for including it went away when the special ioctl headers became self-sufficient. Notes: svn path=/head/; revision=24203