summaryrefslogtreecommitdiffstats
path: root/sys/net/if_var.h
Commit message (Collapse)AuthorAgeFilesLines
* Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,schweikh2003-01-011-2/+2
| | | | especially in troff files.
* Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/schweikh2002-12-301-1/+1
| | | | Add FreeBSD Id tag where missing.
* Long chain of calls starting with bridge_on(), going through IPv6, andhsu2002-12-271-1/+2
| | | | | ending up at ifa_ifwithdstaddr() could lead to a recursive lock of the ifnet list mutex.
* SMP locking for ifnet list.hsu2002-12-221-0/+7
|
* Switch to the conventional reference counting scheme.hsu2002-12-181-15/+15
|
* Lock up ifaddr reference counts.hsu2002-12-181-8/+24
|
* o add if_nvlans member to track the number of vlans active on an interfacesam2002-11-141-9/+3
| | | | | | | | o add if_input member for interface drivers to call through to pass packets "up" o remove ethernet-specific function decls (moved to ethernet.h) Reviewed by: many Approved by: re
* Fixed some of the namespace pollution in rev.1.33. <sys/systm.h> wasbde2002-09-291-1/+0
| | | | | included here because it was once a prerequisite of <sys/mutex.h> although that bug was fixed long ago.
* Add a new helper function if_printf() modeled on device_printf(). Thebrooks2002-09-241-0/+1
| | | | | | | | function takes a struct ifnet pointer followed by the usual printf arguments and prints "<interfacename>: " before the results of printf. Since this is the primary form of printf calls in network device drivers and accounts for most uses of the ifnet menber if_unit, this significantly simplifies many printf()s.
* Increase size of ifnet.if_flags from 16 bits (short) to 32 bits (int). To avoidsobomax2002-08-181-1/+1
| | | | | | | breaking application ABI use unused ifreq.ifru_flags[1] for upper 16 bits in SIOCSIFFLAGS and SIOCGIFFLAGS ioctl's. Reviewed by: -hackers, -net
* Move to nested include of _label.h instead of mac.h, reducing namespacerwatson2002-08-141-1/+1
| | | | | | | | pollution. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs Suggested by: bde
* Introduce support for Mandatory Access Control and extensiblerwatson2002-07-301-0/+2
| | | | | | | | | | | | | kernel access control. Label network interface structures, permitting security features to be maintained on those objects. if_label will be used to authorize data flow using the network interface. if_label will be protected using the same synchronization primitives as other mutable entries in struct ifnet. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Minor style nitimp2002-05-071-1/+1
|
* Remove __P.alfred2002-03-191-69/+65
|
* whitespace fixes.jlemon2001-12-141-1/+1
|
* Device Polling code for -current.luigi2001-12-141-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Non-SMP, i386-only, no polling in the idle loop at the moment. To use this code you must compile a kernel with options DEVICE_POLLING and at runtime enable polling with sysctl kern.polling.enable=1 The percentage of CPU reserved to userland can be set with sysctl kern.polling.user_frac=NN (default is 50) while the remainder is used by polling device drivers and netisr's. These are the only two variables that you should need to touch. There are a few more parameters in kern.polling but the default values are adequate for all purposes. See the code in kern_poll.c for more details on them. Polling in the idle loop will be implemented shortly by introducing a kernel thread which does the job. Until then, the amount of CPU dedicated to polling will never exceed (100-user_frac). The equivalent (actually, better) code for -stable is at http://info.iet.unipi.it/~luigi/polling/ and also supports polling in the idle loop. NOTE to Alpha developers: There is really nothing in this code that is i386-specific. If you move the 2 lines supporting the new option from sys/conf/{files,options}.i386 to sys/conf/{files,options} I am pretty sure that this should work on the Alpha as well, just that I do not have a suitable test box to try it. If someone feels like trying it, I would appreciate it. NOTE to other developers: sure some things could be done better, and as always I am open to constructive criticism, which a few of you have already given and I greatly appreciated. However, before proposing radical architectural changes, please take some time to possibly try out this code, or at the very least read the comments in kern_poll.c, especially re. the reason why I am using a soft netisr and cannot (I believe) replace it with a simple timeout. Quick description of files touched by this commit: sys/conf/files.i386 new file kern/kern_poll.c sys/conf/options.i386 new option sys/i386/i386/trap.c poll in trap (disabled by default) sys/kern/kern_clock.c initialization and hardclock hooks. sys/kern/kern_intr.c minor swi_net changes sys/kern/kern_poll.c the bulk of the code. sys/net/if.h new flag sys/net/if_var.h declaration for functions used in device drivers. sys/net/netisr.h NETISR_POLL sys/dev/fxp/if_fxp.c sys/dev/fxp/if_fxpvar.h sys/pci/if_dc.c sys/pci/if_dcreg.h sys/pci/if_sis.c sys/pci/if_sisreg.h device driver modifications
* Expand the comment on the layout of softc, arpcom and ifnet structures,luigi2001-11-221-0/+15
| | | | and list the places where the assumption is used.
* Remove ifnet.if_mpsafe for now. If this is needed, it won't be neededjhb2001-11-141-9/+1
| | | | | | until much later when the network stack locking is farther along. Approved by: jlemon
* Pull post-4.4BSD change to sys/net/route.c from BSD/OS 4.2.ru2001-10-171-1/+2
| | | | | | | | | | | | | | | | | | | | Have sys/net/route.c:rtrequest1(), which takes ``rt_addrinfo *'' as the argument. Pass rt_addrinfo all the way down to rtrequest1 and ifa->ifa_rtrequest. 3rd argument of ifa->ifa_rtrequest is now ``rt_addrinfo *'' instead of ``sockaddr *'' (almost noone is using it anyways). Benefit: the following command now works. Previously we needed two route(8) invocations, "add" then "change". # route add -inet6 default ::1 -ifp gif0 Remove unsafe typecast in rtrequest(), from ``rtentry *'' to ``sockaddr *''. It was introduced by 4.3BSD-Reno and never corrected. Obtained from: BSD/OS, NetBSD MFC after: 1 month PR: kern/28360
* bring in ARP support for variable length link level addressesfjoe2001-10-141-0/+4
| | | | | | | Reviewed by: jdp Approved by: jdp Obtained from: NetBSD MFC after: 6 weeks
* Documentation comment: note that the each NIC's softc is assumed to startmjacob2001-10-021-0/+5
| | | | | | with an ifnet structure. MFC after: 1 week
* Add two fields to the ifnet structure indicating what extra capabilitiesjlemon2001-09-181-0/+2
| | | | a network device has, and which ones are enabled.
* KSE Milestone 2julian2001-09-121-2/+2
| | | | | | | | | | | | | | 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
* Wrap array accesses in macros, which also happen to be lvalues:jlemon2001-09-061-3/+14
| | | | | | | ifnet_addrs[i - 1] -> ifaddr_byindex(i) ifindex2ifnet[i] -> ifnet_byindex(i) This is intended to ease the conversion to SMPng.
* Add kernel infrastructure for network device cloning.brooks2001-07-021-1/+7
| | | | | | Reviewed by: ru, ume Obtained from: NetBSD MFC after: 1 week
* Catch up to header include changes:jhb2001-03-281-1/+3
| | | | | - <sys/mutex.h> now requires <sys/systm.h> - <sys/mutex.h> and <sys/sx.h> now require <sys/lock.h>
* Change and clean the mutex lock interface.bmilekic2001-02-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mtx_enter(lock, type) becomes: mtx_lock(lock) for sleep locks (MTX_DEF-initialized locks) mtx_lock_spin(lock) for spin locks (MTX_SPIN-initialized) similarily, for releasing a lock, we now have: mtx_unlock(lock) for MTX_DEF and mtx_unlock_spin(lock) for MTX_SPIN. We change the caller interface for the two different types of locks because the semantics are entirely different for each case, and this makes it explicitly clear and, at the same time, it rids us of the extra `type' argument. The enter->lock and exit->unlock change has been made with the idea that we're "locking data" and not "entering locked code" in mind. Further, remove all additional "flags" previously passed to the lock acquire/release routines with the exception of two: MTX_QUIET and MTX_NOSWITCH The functionality of these flags is preserved and they can be passed to the lock/unlock routines by calling the corresponding wrappers: mtx_{lock, unlock}_flags(lock, flag(s)) and mtx_{lock, unlock}_spin_flags(lock, flag(s)) for MTX_DEF and MTX_SPIN locks, respectively. Re-inline some lock acq/rel code; in the sleep lock case, we only inline the _obtain_lock()s in order to ensure that the inlined code fits into a cache line. In the spin lock case, we inline recursion and actually only perform a function call if we need to spin. This change has been made with the idea that we generally tend to avoid spin locks and that also the spin locks that we do have and are heavily used (i.e. sched_lock) do recurse, and therefore in an effort to reduce function call overhead for some architectures (such as alpha), we inline recursion for this case. Create a new malloc type for the witness code and retire from using the M_DEV type. The new type is called M_WITNESS and is only declared if WITNESS is enabled. Begin cleaning up some machdep/mutex.h code - specifically updated the "optimized" inlined code in alpha/mutex.h and wrote MTX_LOCK_SPIN and MTX_UNLOCK_SPIN asm macros for the i386/mutex.h as we presently need those. Finally, caught up to the interface changes in all sys code. Contributors: jake, jhb, jasone (in no particular order)
* Convert if_multiaddrs from LIST to TAILQ so that it can be traversedphk2001-02-061-2/+2
| | | | | | backwards in the three drivers which want to do that. Reviewed by: mikeh
* Make the number of loopback interfaces dynamically tunable. Why onepeter2001-01-291-1/+1
| | | | | | | would *want* to is a different story, but it used to be able to be done statically. Get rid of #include "loop.h" and struct ifnet loif[NLOOP]; This could be used as an example of how to do this in other drivers, for example: ccd.
* Unbreak world; #include <sys/mutex.h> instead of <machine/mutex.h>jlemon2000-11-261-1/+3
| | | | | Only include <sys/mbuf.h> when building kernel sources. This should probably be changed to require callers to include it themselves.
* Lock down the network interface queues. The queue mutex must be obtainedjlemon2000-11-251-50/+99
| | | | | | | | | | | | | | 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.
* Augment the 'ifaddr' structure with a 'struct if_data' to keepjoe2000-10-191-0/+1
| | | | | | | | | | | statistics on a per network address basis. Teach the IPv4 and IPv6 input/output routines to log packets/bytes against the network address connected to the flow. Teach netstat to display the per-address stats for IP protocols when 'netstat -i' is evoked, instead of displaying the per-interface stats.
* Export the functionality of SIOCSIFLLADDR with if_setlladdr()archie2000-08-151-0/+1
| | | | | | and add some more rigorous sanity checking in the process. Reviewed by: freebsd-net
* Make all Ethernet drivers attach using ether_ifattach() and detach usingarchie2000-07-131-1/+2
| | | | | | | | | ether_ifdetach(). The former consolidates the operations of if_attach(), ng_ether_attach(), and bpfattach(). The latter consolidates the corresponding detach operations. Reviewed by: julian, freebsd-net
* Fix kernel build breakage when 'device ether' was not included.archie2000-06-291-1/+0
|
* Make the ng_ether(4) node type dynamically loadable like the rest.archie2000-06-261-0/+3
| | | | | | | | | | | | | This means 'options NETGRAPH' is no longer necessary in order to get netgraph-enabled Ethernet interfaces. This supports loading/unloading the ng_ether.ko and attaching/detaching the Ethernet interface in any order. Add two new hooks 'upper' and 'lower' to allow access to the protocol demux engine and the raw device, respectively. This enables bridging to be defined as a netgraph node, if so desired. Reviewed by: freebsd-net@freebsd.org
* Back out the previous change to the queue(3) interface.jake2000-05-261-8/+8
| | | | | | It was not discussed and should probably not happen. Requested by: msmith and others
* Just need to pass the address family to if_simloop(), not the whole sockaddr.archie2000-05-241-2/+1
|
* Change the way that the queue(3) structures are declared; don't assume thatjake2000-05-231-8/+8
| | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd
* Add support for offloading IP/TCP/UDP checksums to NIC hardware whichjlemon2000-03-271-0/+1
| | | | supports them.
* Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"peter1999-12-291-4/+4
| | | | | | is an application space macro and the applications are supposed to be free to use it as they please (but cannot). This is consistant with the other BSD's who made this change quite some time ago. More commits to come.
* KAME netinet6 basic part(no IPsec,no V6 Multicast Forwarding, no UDP/TCPshin1999-11-221-4/+11
| | | | | | | | | | for IPv6 yet) With this patch, you can assigne IPv6 addr automatically, and can reply to IPv6 ping. Reviewed by: freebsd-arch, cvs-committers Obtained from: KAME project
* KAME related header files additions and merges.shin1999-11-051-0/+18
| | | | | | | (only those which don't affect c source files so much) Reviewed by: cvs-committers Obtained from: KAME project
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Define IF_MAXMTU and IF_MINMTU and don't allow MTUs withbrian1999-08-061-1/+9
| | | | | | | | | out-of-range values. ``comparison is always 0'' warnings are silly ! Ok'd by: wollman, dg Advised by: bde
* PR: kern/10570pb1999-05-161-2/+2
| | | | | | | | | | Submitted by: adrian@freebsd.org Change reference count in struct ifaddr to a u_int, to be able to handle more than 2^16 routes to the same interface. Fix suggested by Andrew Bangs <andrewb@demon.net> in PR kern/10570. Tested by <adrian@freebsd.org> and me under -current.
* Add sufficient braces to keep egcs happy about potentially ambiguouspeter1999-05-061-5/+7
| | | | if/else nesting.
* Bring the 'new-bus' to the i386. This extensively changes the way thepeter1999-04-161-1/+2
| | | | | | | | | | | | | | | | | | i386 platform boots, it is no longer ISA-centric, and is fully dynamic. Most old drivers compile and run without modification via 'compatability shims' to enable a smoother transition. eisa, isapnp and pccard* are not yet using the new resource manager. Once fully converted, all drivers will be loadable, including PCI and ISA. (Some other changes appear to have snuck in, including a port of Soren's ATA driver to the Alpha. Soren, back this out if you need to.) This is a checkpoint of work-in-progress, but is quite functional. The bulk of the work was done over the last few years by Doug Rabson and Garrett Wollman. Approved by: core
* Generalize the if_up() and if_down() functions under the namesphk1998-12-161-4/+3
| | | | | | if_route() and if_unroute(). This is first step towards sanitizing IFF_UP and IFF_RUNNING
* Go through the loopback code with a broom..julian1998-06-121-3/+3
| | | | | | | | | | | | | | | | Remove lots'o'hacks. looutput is now static. Other callers who want to use loopback to allow shortcutting should call the special entrypoint for this, if_simloop(), which is specifically designed for this purpose. Using looutput for this purpose was problematic, particularly with bpf and trying to keep track of whether one should be using the charateristics of the loopback interface or the interface (e.g. if_ethersubr.c) that was requesting the loopback. There was a whole class of errors due to this mis-use each of which had hacks to cover them up. Consists largly of hack removal :-)
OpenPOWER on IntegriCloud