summaryrefslogtreecommitdiffstats
path: root/sys/net/ppp_tty.c
Commit message (Collapse)AuthorAgeFilesLines
* Use new (inline) functions for calls into driver.phk2005-10-161-5/+3
|
* Axe ppp_for_tty(). Use tty->t_lsc pointer to store sc. Thisglebius2005-08-121-7/+7
| | | | | | | | also eliminates recursive use of ppp_softc_list_mtx. PR: kern/84686 Reviewed by: phk MFC after: 1 week
* Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE andrwatson2005-08-091-1/+1
| | | | | | | | | | | | | | IFF_DRV_RUNNING, as well as the move from ifnet.if_flags to ifnet.if_drv_flags. Device drivers are now responsible for synchronizing access to these flags, as they are in if_drv_flags. This helps prevent races between the network stack and device driver in maintaining the interface flags field. Many __FreeBSD__ and __FreeBSD_version checks maintained and continued; some less so. Reviewed by: pjd, bz MFC after: 7 days
* Use m_uiotombuf() instead of own implementation. This is not justglebius2005-07-011-25/+10
| | | | | | | | | | a cosmetic change. m_uiotombuf() produces a packet header mbuf, while original implementation did not. When kernel is compiled with MAC support, headerless mbuf will cause panic. Reported by: Alexander Nikiforenko <asn rambler-co.ru> Approved by: re (scottl) MFC After: 2 weeks
* Stop embedding struct ifnet at the top of driver softcs. Instead thebrooks2005-06-101-24/+24
| | | | | | | | | | | | | | | | | | | | struct ifnet or the layer 2 common structure it was embedded in have been replaced with a struct ifnet pointer to be filled by a call to the new function, if_alloc(). The layer 2 common structure is also allocated via if_alloc() based on the interface type. It is hung off the new struct ifnet member, if_l2com. This change removes the size of these structures from the kernel ABI and will allow us to better manage them as interfaces come and go. Other changes of note: - Struct arpcom is no longer referenced in normal interface code. Instead the Ethernet address is accessed via the IFP2ENADDR() macro. To enforce this ac_enaddr has been renamed to _ac_enaddr. - The second argument to ether_ifattach is now always the mac address from driver private storage rather than sometimes being ac_enaddr. Reviewed by: sobomax, sam
* /* -> /*- for license, minor formatting changesimp2005-01-071-1/+2
|
* Check O_NONBLOCK instead of IO_NDELAY.phk2004-12-221-2/+1
| | | | Don't include <sys/vnode.h>
* Don't abuse tp->t_sc, as it is now used by tty drivers.cognet2004-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)
* 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.
* Pick the hotchar out of the tty structure instead of caching privatephk2004-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.
* Fix line discipline switching issues: If opening a new ldisc fails,phk2004-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.)
* Do the dreaded s/dev_t/struct cdev */phk2004-06-161-2/+2
| | | | Bump __FreeBSD_version accordingly.
* Replace the if_name and if_unit members of struct ifnet with new membersbrooks2003-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)
* Back out M_* changes, per decision of the TRB.imp2003-02-191-4/+4
| | | | Approved by: trb
* Remove #include <sys/dkstat.h>phk2003-02-161-1/+0
|
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-4/+4
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Use if_printf(ifp, "blah") instead of printf("ppp%d: blah", ifp->if_unit).brooks2002-10-211-15/+13
|
* Be consistent about functions being static.phk2002-10-161-1/+1
| | | | Spotted by: FlexeLint
* Make ppp(4) devices clonable and unloadable.brooks2002-08-091-2/+8
|
* Change the suser() API to take advantage of td_ucred as well as do ajhb2002-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@
* Remove __P.alfred2002-03-191-18/+18
|
* Get rid of the twisted MFREE() macro entirely.dillon2002-02-051-3/+1
| | | | | Reviewed by: dg, bmilekic MFC after: 3 days
* KSE Milestone 2julian2001-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
* * Rename M_WAIT mbuf subsystem flag to M_TRYWAIT.bmilekic2000-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.
* Removed unused includes (garbage left over/created by the SMPng megacommit).bde2000-09-261-6/+0
|
* Major update to the way synchronization is done in the kernel. Highlightsjasone2000-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
* Remove some #if NFOO > 0 that are always true because of config rules.peter2000-01-291-5/+0
|
* This patch clears the way for removing a number of tty relatedphk1999-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
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* I got tired of seeing all the cdevsw[major(foo)] all over the place.phk1999-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.
* Suser() simplification:phk1999-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.
* Undo #undef KERNEL hack for vnode.h to avoid vnode_if.h.peter1999-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.
* Missing splx().peter1998-06-201-2/+4
|
* This commit fixes various 64bit portability problems required fordfr1998-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.
* Oops, the previous commit should have changed `i386' to `__i386__',bde1998-05-011-3/+3
| | | | not `__i386'.
* Support compiling with `gcc -ansi'.bde1998-04-151-3/+3
|
* Use getmicrotime() for if_lastchange, 10msec is plenty precision.phk1998-04-061-2/+2
|
* Eradicate the variable "time" from the kernel, using various measures.phk1998-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
* Moved some #includes from <sys/param.h> nearer to where they are actuallybde1998-03-281-2/+2
| | | | used.
* Implement the spirit but not the letter of Terrys hot-char patch.phk1998-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
* Use ENOIOCTL instead of -1 (= ERESTART) for tty ioctls that arebde1997-12-061-2/+2
| | | | | not handled at a particular level. This fixes mainly restarting of interrupted TIOCDRAINs and TIOCSETA{W,F}s.
* Don't test for conflicting combinations of PPP_FILTER/BPFILTER here.bde1997-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.
* Convert PPP_FILTER to an option, like PPP_BSDCOMP and PPP_DEFLATE.peter1997-10-181-3/+7
| | | | It requires bpf, I'll note this in LINT.
* Better fix for the bpf dependency that doesn't have such a large impactpeter1997-10-181-1/+6
| | | | | on the code and pppd in userland. PPP_FILTER is meant to be an option (or negatable option).
* Try out PPP_FILTERpeter1997-10-101-1/+2
|
* Update for new callout interface.gibbs1997-09-211-3/+3
|
* Some fixes from Bruce:peter1997-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
* Update kernel parts of pppd from 2.2.0 to 2.3.0. I've yet to look at thepeter1997-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.
* Fix this damn mbuf with a negative m_len. It turnsbrian1997-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
* Protect against garbage mbufs in pppstart.brian1997-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).
OpenPOWER on IntegriCloud