summaryrefslogtreecommitdiffstats
path: root/sys/dev/en/midway.c
Commit message (Collapse)AuthorAgeFilesLines
* Lock down the network interface queues. The queue mutex must be obtainedjlemon2000-11-251-13/+13
| | | | | | | | | | | | | | 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.
* Change check for existence of mbuf->m_ext.ext_free to check of new ext_typebmilekic2000-11-111-1/+1
| | | | | | | in order to determine whether the ext_buf is a cluster, or some other type of storage. Reviewed by: jlemon
* restore the freebsd local type-cast fixes that I mistakenly removedkjc2000-11-081-14/+15
| | | | | | | in the previous commit while attempting to sync with netbsd. Pointed out by: bde (never thought of compiling i386's LINT with -64-bit-longs...)
* newbusify the en atm driver.kjc2000-11-071-67/+88
| | | | | | | | also - sync with netbsd - fix a bug that miscalculates tx cell counts when the pointer size isn't 4 tested both ENI and Adaptec cards on both i386 and alpha.
* Enabled the used include of <machine/bus.h> -- don't depend on evilbde2000-11-041-1/+1
| | | | | | | | namespace pollution in <sys/mutex.h>. This was half fixed in rev.1.3 of midwayreg.h. The pollution exposed the bug that this driver was using toy versions of the bus space macros under FreeBSD. Disabling the toy versions made this driver compile and maybe support PIO space, but dependent on the pollution.
* Remove unneeded #include <sys/proc.h> lines.phk2000-10-291-1/+0
|
* Remove unneeded #include <machine/clock.h>phk2000-10-151-1/+0
|
* Replace the mbuf external reference counting code with somethingdwmalone2000-08-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that should be better. The old code counted references to mbuf clusters by using the offset of the cluster from the start of memory allocated for mbufs and clusters as an index into an array of chars, which did the reference counting. If the external storage was not a cluster then reference counting had to be done by the code using that external storage. NetBSD's system of linked lists of mbufs was cosidered, but Alfred felt it would have locking issues when the kernel was made more SMP friendly. The system implimented uses a pool of unions to track external storage. The union contains an int for counting the references and a pointer for forming a free list. The reference counts are incremented and decremented atomically and so should be SMP friendly. This system can track reference counts for any sort of external storage. Access to the reference counting stuff is now through macros defined in mbuf.h, so it should be easier to make changes to the system in the future. The possibility of storing the reference count in one of the referencing mbufs was considered, but was rejected 'cos it would often leave extra mbufs allocated. Storing the reference count in the cluster was also considered, but because the external storage may not be a cluster this isn't an option. The size of the pool of reference counters is available in the stats provided by "netstat -m". PR: 19866 Submitted by: Bosko Milekic <bmilekic@dsuper.net> Reviewed by: alfred (glanced at by others on -net)
* Remove #if NEN > 0 in the name of FreeBSD - it's not required as configpeter2000-01-291-5/+1
| | | | only compiles this file if it's true. NEN is still used though. :-(
* remove unused #include, add $FreeBSD$phk1999-10-111-1/+2
|
* Rename bpfilter to bpf.des1999-07-061-7/+7
|
* clean up en atm driverkjc1999-05-081-319/+54
| | | | | | | | | | | | | o fix DDB support - include "opt_ddb.h" - fix Debugger() arg pointed out by bde o back out pvc shadow interface support - it is currently not used - to make it easier to merge another implementation o misc minor cleanup
* Undo excess staticization - these two are meant to be callable frompeter1999-05-061-2/+4
| | | | DDB.
* 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.
* Staticize.eivind1999-04-111-3/+3
|
* Fix warnings preparing for -Wall -Wcast-qualdillon1999-01-271-1/+1
| | | | | Also disable one usb module in LINT due to fatal compilation errors, temporary.
* Examine all occurrences of sprintf(), strcat(), and str[n]cpy()archie1998-12-041-4/+4
| | | | | | | | | | | | | | for possible buffer overflow problems. Replaced most sprintf()'s with snprintf(); for others cases, added terminating NUL bytes where appropriate, replaced constants like "16" with sizeof(), etc. These changes include several bug fixes, but most changes are for maintainability's sake. Any instance where it wasn't "immediately obvious" that a buffer overflow could not occur was made safer. Reviewed by: Bruce Evans <bde@zeta.org.au> Reviewed by: Matthew Dillon <dillon@apollo.backplane.com> Reviewed by: Mike Spengler <mks@networkcs.com>
* fix a bug which could lock up a transmitter.kjc1998-10-091-1/+5
| | | | | don't use the entire buffer space. if WRTX becomes equal to RDTX, the transmitter stops assuming the buffer is empty.
* FIxed printf format errors. Most of them were exposed by our ntohl()bde1998-08-171-25/+31
| | | | returning long. There would be many more if int_32_t were not int.
* Use [u]intptr_t instead of [u_]long for casts between pointers andbde1998-08-161-13/+14
| | | | integers. Don't forget to cast to (void *) as well.
* update ATM driver. (base version: midway.c 1.67 --> 1.68)kjc1998-07-291-141/+639
| | | | | | | | | | | | | | | | | | | | | | | several new features are added: - support vc/vp shaping - support pvc shadow interface code cleanup: - remove WMAYBE related code. ENI WMAYBE DMA doen't work. - remove updating if_lastchange for every packet. - BPF related code is moved to midway.c as it should be. (bpfwrite should work if atm_pseudohdr and LLC/SNAP are prepended.) - BPF link type is changed to DLT_ATM_RFC1483. BPF now understands only LLC/SNAP!! (because bpf can't handle variable link header length.) It is recommended to use LLC/SNAP instead of NULL encapsulation for various reasons. (BPF, IPv6, interoperability, etc.) the code has been used for months in ALTQ and KAME IPv6. OKed by phk long time ago.
* Support compiling with `gcc -ansi'.bde1998-04-151-1/+1
|
* Staticize.eivind1998-02-091-1/+1
|
* Make POWERFAIL_NMI, PPS_SYNC and NATM new style options.eivind1998-01-311-0/+1
| | | | This also fixes a couple of defunct options; submitted by bde.
* Make INET a proper option.eivind1998-01-081-0/+1
| | | | | | | | | | | | 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>.
* Removed unused #includes.bde1997-06-141-7/+0
|
* import Chuck Cranor's ATM driverkjc1997-05-091-0/+3208
OpenPOWER on IntegriCloud