summaryrefslogtreecommitdiffstats
path: root/sys/net/if_sl.c
Commit message (Collapse)AuthorAgeFilesLines
* Change callers of mtx_init() to pass in an appropriate lock type name. Injhb2002-04-041-1/+1
| | | | | | | most cases NULL is passed, but in some cases such as network driver locks (which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used. Tested on: i386, alpha, sparc64
* Replace (deprecated ?) FREE() macro with direct calls to free()luigi2002-04-041-4/+4
|
* 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@
* Remove __P.alfred2002-03-191-10/+10
|
* Lock struct pgrp, session and sigio.tanimura2002-02-231-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | New locks are: - pgrpsess_lock which locks the whole pgrps and sessions, - pg_mtx which protects the pgrp members, and - s_mtx which protects the session members. Please refer to sys/proc.h for the coverage of these locks. Changes on the pgrp/session interface: - pgfind() needs the pgrpsess_lock held. - The caller of enterpgrp() is responsible to allocate a new pgrp and session. - Call enterthispgrp() in order to enter an existing pgrp. - pgsignal() requires a pgrp lock held. Reviewed by: jhb, alfred Tested on: cvsup.jp.FreeBSD.org (which is a quad-CPU machine running -current)
* Get rid of the twisted MFREE() macro entirely.dillon2002-02-051-3/+1
| | | | | Reviewed by: dg, bmilekic MFC after: 3 days
* Staticise private interface lists.msmith2002-01-081-1/+1
|
* KSE Milestone 2julian2001-09-121-7/+7
| | | | | | | | | | | | | | 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
* Only allocate teh 1540 byte buffer if we need it..julian2001-08-161-20/+20
| | | | | | (lazy allocation) MFC after: 13 days
* Don't allocate an entire 1500 byte buffer on the stack.julian2001-08-151-5/+13
| | | | | | May need more review in light of SMP. MFC after: 2 weeks
* Exterminate the use of PSEUDO_SET() with extreme prejudice.peter2001-01-311-16/+29
|
* * Rename M_WAIT mbuf subsystem flag to M_TRYWAIT.bmilekic2000-12-211-2/+2
| | | | | | | | | | | | | | | | | | 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.
* Convert more malloc+bzero to malloc+M_ZERO.dwmalone2000-12-081-2/+1
| | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net>
* Lock down the network interface queues. The queue mutex must be obtainedjlemon2000-11-251-13/+5
| | | | | | | | | | | | | | before adding/removing packets from the queue. Also, the if_obytes and if_omcasts fields should only be manipulated under protection of the mutex. IF_ENQUEUE, IF_PREPEND, and IF_DEQUEUE perform all necessary locking on the queue. An IF_LOCK macro is provided, as well as the old (mutex-less) versions of the macros in the form _IF_ENQUEUE, _IF_QFULL, for code which needs them, but their use is discouraged. Two new macros are introduced: IF_DRAIN() to drain a queue, and IF_HANDOFF, which takes care of locking/enqueue, and also statistics updating/start if necessary.
* Move suser() and suser_xxx() prototypes and a related #define fromphk2000-10-291-1/+0
| | | | | | | | | <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>.
* Handle slip options in the usual way (generate a dummy options file inbde2000-09-261-2/+1
| | | | | | the module Makefile and don't clutter the sources with ifdefs). Fixed nearby formatting bugs.
* The slip driver used to allocate a mbuf cluster without attachingdwmalone2000-08-181-9/+21
| | | | | | | | | | it to a mbuf. This patch makes it attach it to mbuf. This patch is in preperation for Bosko Milekic's mbuf external reference counting patches. PR: 19866 (first stage) Submitted by: Ian Dowse <iedowse@maths.tcd.ie> Reviewed by: alfred
* Unused include: #include "sl.h" - NSL is no longer used.peter2000-06-101-2/+0
|
* Make sl(4) SLIP devices dynamically expansible. Yay! =)green2000-05-301-115/+169
| | | | | PR: kern/17758 Submitted by: David Malone <dwmalone@maths.tcd.ie>
* Fix possible SLIOCSUNIT panicache2000-02-201-0/+1
| | | | | | PR: 16564 Submitted by: ru Approved by: jkh
* Remove some #if NFOO > 0 that are always true because of config rules.peter2000-01-291-4/+1
|
* Re-allocate cblocks after changing the slip unit number.ru1999-10-281-0/+3
|
* Remove NBPF conditionality of bpf calls in most of our network drivers.phk1999-09-251-21/+0
| | | | | | | | | | | | This means that we will not have to have a bpf and a non-bpf version of our driver modules. This does not open any security hole, because the bpf core isn't loadable The drivers left unchanged are the "cross platform" drivers where the respective maintainers are urged to DTRT, whatever that may be. Add a couple of missing FreeBSD tags.
* Don't call if_up() here, just set IFF_UP.ru1999-09-141-1/+1
| | | | | PR: 12251 Reviewed by: wollman
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Rename bpfilter to bpf.des1999-07-061-11/+11
|
* Fix a printf int/long problem on the Alphapeter1999-07-011-2/+3
|
* Suser() simplification:phk1999-04-271-2/+2
| | | | | | | | | | | | | | | | | | | 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.
* Get rid of IFF_BROADCAST from default IFF_ slip options. This accidentlydillon1999-02-021-2/+2
| | | | snuck in during the big -Wall commit and wasn't supposed to be in there.
* Fix warnings in preparation for adding -Wall -Wcast-qual to thedillon1999-01-271-2/+2
| | | | kernel compile
* This is a rather large commit that encompasses the new swapper,dillon1999-01-211-3/+9
| | | | | | | | | | changes to the VM system to support the new swapper, VM bug fixes, several VM optimizations, and some additional revamping of the VM code. The specific bug fixes will be documented with additional forced commits. This commit is somewhat rough in regards to code cleanup issues. Reviewed by: "John S. Dyson" <root@dyson.iquest.net>, "David Greenman" <dg@root.com>
* Cast pointers to uintptr_t/intptr_t instead of to u_long/long,bde1998-07-151-2/+2
| | | | | | | respectively. Most of the longs should probably have been u_longs, but this changes is just to prevent warnings about casts between pointers and integers of different sizes, not to fix poorly chosen types.
* This commit fixes various 64bit portability problems required fordfr1998-06-071-6/+6
| | | | | | | | | | 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.
* Eradicate the variable "time" from the kernel, using various measures.phk1998-03-301-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "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
* Implement the spirit but not the letter of Terrys hot-char patch.phk1998-02-131-2/+3
| | | | | | | 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
* Staticize.eivind1998-02-091-2/+2
|
* Make INET a proper option.eivind1998-01-081-2/+3
| | | | | | | | | | | | This will not make any of object files that LINT create change; there might be differences with INET disabled, but hardly anything compiled before without INET anyway. Now the 'obvious' things will give a proper error if compiled without inet - ipx_ip, ipfw, tcp_debug. The only thing that _should_ work (but can't be made to compile reasonably easily) is sppp :-( This commit move struct arpcom from <netinet/if_ether.h> to <net/if_arp.h>.
* MALLOC->mallocache1997-12-191-3/+3
| | | | Suggested-by: bde
* SUNIT: use MALLOC/FREE and M_NOWAITache1997-12-191-4/+8
|
* 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.
* Preserve old SC_STATIC value after units exchangeache1997-10-071-1/+3
|
* Update for new callout interface.gibbs1997-09-211-13/+17
|
* SUNIT: exchange up/down states tooache1997-08-131-1/+7
|
* Removed unused #includes.bde1997-08-021-4/+1
|
* Use malloc to save space for temp SUNIT variableache1997-07-281-9/+10
| | | | Submitted by: bde
* Move tmpnc struct out of stack, too largeache1997-07-271-2/+3
| | | | Suggested by: bde
* SUNIT: exchange back whole ifnet structures since they are in the linkedache1997-07-261-7/+6
| | | | list, not device numbers only
* Forget to change units in prev. SUNIT commit. Move variales to localache1997-07-261-2/+7
| | | | section for SUNIT.
* Exchange whole structures on SUNIT, not unit+flags fields only.ache1997-07-261-6/+6
| | | | | It is needed because if_attach() assumes fixed units order and pass it to ifconfig
* Don't include <sys/ioctl.h> in the kernel. Stage 2: includebde1997-03-241-2/+2
| | | | <sys/sockio.h> instead of <sys/ioctl.h> in network files.
OpenPOWER on IntegriCloud