summaryrefslogtreecommitdiffstats
path: root/sys/dev/en
Commit message (Collapse)AuthorAgeFilesLines
* Start each of the license/copyright comments with /*-, minor shuffle of linesimp2005-01-063-6/+3
|
* * Add a "how" argument to uma_zone constructors and initialization functionsgreen2004-08-021-21/+12
| | | | | | | | | | | | | | | | | so that they know whether the allocation is supposed to be able to sleep or not. * Allow uma_zone constructors and initialation functions to return either success or error. Almost all of the ones in the tree currently return success unconditionally, but mbuf is a notable exception: the packet zone constructor wants to be able to fail if it cannot suballocate an mbuf cluster, and the mbuf allocators want to be able to fail in general in a MAC kernel if the MAC mbuf initializer fails. This fixes the panics people are seeing when they run out of memory for mbuf clusters. * Allow debug.nosleepwithlocks on WITNESS to be disabled, without changing the default. Both bmilekic and jeff have reviewed the changes made to make failable zone allocations work.
* Update for the KDB framework:marcel2004-07-101-3/+2
| | | | | | o Call kdb_enter() instead of Debugger(). o Don't make such calls conditional upon KDB instead of DDB because they're already conditional upon EN_DEBUG.
* Add missing <sys/module.h> includesphk2004-05-301-0/+1
|
* Convert callers to the new bus_alloc_resource_any(9) API.njl2004-03-171-3/+3
| | | | | Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde
* All three of these drivers abused cv_waitq_empty in the same way by spinningscottl2004-02-291-4/+1
| | | | | | | | | on it in hopes of making sure that the waitq was empty before going on. This wasn't needed and probably never would have worked as intended. Now that cv_waitq_empty() and friends are gone, the code in these drivers that spins on it can go away too. This should unbreak LINT. Discussed with: kan
* Move the locking of the softc up to before the allocation of theharti2003-12-171-4/+6
| | | | | transmission map. This allocation accesses the softc so should be under the lock (it uses NOWAIT).
* Replace the if_name and if_unit members of struct ifnet with new membersbrooks2003-10-312-7/+5
| | | | | | | | | | | | | 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)
* Use __FBSDID().obrien2003-08-241-0/+3
| | | | Also some minor style cleanups.
* Prefer new location of pci include files (which have only been in theimp2003-08-221-2/+2
| | | | | tree for two or more years now), except in a few places where there's code to be compatible with older versions of FreeBSD.
* Consistently use the BSD u_int and u_short instead of the SYSV uint andjhb2003-08-071-1/+1
| | | | | | | ushort. In most of these files, there was a mixture of both styles and this change just makes them self-consistent. Requested by: bde (kern_ktrace.c)
* Remove the ATMIOCENA and ATMIOCDIS ioctl. Everyting has been convertedharti2003-08-062-32/+6
| | | | | to use the new OPENVCC and CLOSEVCC calls that allow the sepcification of traffic parameters for the connections.
* Honor the new ATMIO_FLAG_ASYNC that requests asynchronuous open/closeharti2003-08-061-1/+1
| | | | operations on VCs.
* When sending check that the channel is really open. Get the informationharti2003-08-061-7/+9
| | | | | whether we use AAL5 or not from the aal field of the channel parameters instead of the flag in the pseudo header. This flag will go away soon.
* Print an array index that is computed as ptrdiff_t with %tu.harti2003-08-061-2/+2
|
* Change the format type to unbreak LINT on 64-bit platforms.obrien2003-08-061-2/+2
|
* Implement per-VC statistics.harti2003-08-051-1/+8
|
* Implement the ATMIOCOPENVCC and ATMIOCCLOSEVCC ioctls(). This was theharti2003-08-053-37/+86
| | | | last driver that did not know about those.
* Use the generic getvccs function from net/if_atmsubr.c and removeharti2003-08-051-54/+4
| | | | the home-grown version.
* Arrghhh. Remove debugging printf's that slipped in in the pre-previousharti2003-08-051-11/+1
| | | | commit.
* Use __FBSDID() as per style(9).harti2003-08-051-2/+2
|
* Make the en(4) driver more like the other ATM drivers. This is theharti2003-08-053-247/+348
| | | | | | | preparation for supporting the OPENVCC and CLOSEVCC ioctls which are needed for ng_atm. This required some re-organisation of the code (mostly converting array indexes to pointers). This also gives us an array of open vccs that will help in using the generic GETVCCS handler.
* Move the clearing of the IFF_RUNNING flag into the reset routine.harti2003-08-051-1/+2
| | | | | Otherwise the interface will report RUNNING to ifconfig after doing 'ifconfig down' although it isn't running anymore.
* Be careful to call bus_dmamap_load with BUS_DMA_NOWAIT so that theharti2003-07-151-7/+7
| | | | | | callback will never be deferred. ATM needs to prevent cell and packet ordering. Also use the default mutex and lock functions (those that panic) for the tag creation.
* Delete a superfluous semi-colon.harti2003-07-041-1/+1
| | | | Pointed out by: nick@garage.freebsd.pl
* Mega busdma API commit.scottl2003-07-011-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | Add two new arguments to bus_dma_tag_create(): lockfunc and lockfuncarg. Lockfunc allows a driver to provide a function for managing its locking semantics while using busdma. At the moment, this is used for the asynchronous busdma_swi and callback mechanism. Two lockfunc implementations are provided: busdma_lock_mutex() performs standard mutex operations on the mutex that is specified from lockfuncarg. dftl_lock() is a panic implementation and is defaulted to when NULL, NULL are passed to bus_dma_tag_create(). The only time that NULL, NULL should ever be used is when the driver ensures that bus_dmamap_load() will not be deferred. Drivers that do not provide their own locking can pass busdma_lock_mutex,&Giant args in order to preserve the former behaviour. sparc64 and powerpc do not provide real busdma_swi functions, so this is largely a noop on those platforms. The busdma_swi on is64 is not properly locked yet, so warnings will be emitted on this platform when busdma callback deferrals happen. If anyone gets panics or warnings from dflt_lock() being called, please let me know right away. Reviewed by: tmm, gibbs
* Implement the ioctl that returns a list of currently open VCCs.harti2003-06-131-0/+70
|
* Make the midway driver use the new ATM phy driver. This allows one toharti2003-06-133-6/+86
| | | | | | | toggle several media options (sonet/sdh, for example) with ifconfig and to see the carrier state in ifconfig's output. It gives also read/write access (given the right privilegs) to the S/Uni registers to user space programs.
* Use __FBSDID().obrien2003-06-111-3/+4
|
* Make the internal statistics sysctl an array of integers rather than a string.harti2003-06-041-33/+10
| | | | | | | | | While a string is readable without a tool, an array is easier to process for a monitoring application. This also prevents the extra hoops we need with sbufs and locking. Move the mtx_init() in en_attach() higher before the first failure point so that we can unconditionally destroy it in en_destroy().
* Fix off-by-one error in range check of VC index.phk2003-05-311-1/+1
| | | | Found by: FlexeLint
* Define a link layer MIB for ATM. Most fields of this MIB are needed byharti2003-05-053-65/+84
| | | | | | ILMI daemons. Factor out common softc fields for all ATM interfaces that need to be externally visible into an ifatm structure and make the midway driver using this structure and fill the MIB.
* Add module data and version to the atm_subr and reference this info from theharti2003-04-292-5/+7
| | | | | | | | | | | | | | | | (currently) only consumer (en). Add a sysctl node hw.atm where the atm drivers will hook on their hardware sysctl sub-trees. Make atm_ifattach call if_attach and remove the corresponding call to if_attach from en. Create atm_ifdetach and use that in en. While the last change actually changes the interface this is not a problem in practice because the only other consumer of this API is an older LANAI driver on the net, that is not ready for current anyway. Reviewed by: -atm
* Convert the midway driver to use busdma. Except for this conversion theharti2003-04-254-3381/+3191
| | | | | | | | | | | | | | | | | | | | following changes have been done: - stylify. The original code was too hard to read. - get rid of a number of compilation options (Adaptec-only, Eni-only, no-DMA). - more debugging features. - locking. This is not correct yet in the absence of interface layer locking, but is correct enough to not to cause lock order reversals. - remove RAW mode. There are no users of this in the tree and I doubt that there are any. - remove NetBSD compatibility code. There was no way to keep NetBSD non-busdma and FreeBSD busdma code together. - if_en now buildable as a module. This has been actively tested on sparc64 and i386 with ENI server and client cards and an Adaptec card (thanks to kjc). Reviewed by: mdodd, arr
* - Express hard dependencies on bus (pci, isa, pccard) andmdodd2003-04-151-1/+1
| | | | | | | | network layer (ether). - Don't abuse module names to facilitate ifconfig module loading; such abuse isn't really needed. (And if we do need type information associated with a module then we should make it explicit and not use hacks.)
* clean up the en driver since it will survice for a while bykjc2003-03-121-96/+0
| | | | | | | | Harti Brandt's effort. remove the DMA test to detect problems of the first generation PCI chipsets back in 1998. it is no longer needed and has been the source of the false alarm that the driver uses too much stack space.
* Update netisr handling; Each SWI now registers its queue, and all queuejlemon2003-03-041-0/+2
| | | | | | | | | | drain routines are done by swi_net, which allows for better queue control at some future point. Packets may also be directly dispatched to a netisr instead of queued, this may be of interest at some installations, but currently defaults to off. Reviewed by: hsu, silby, jayanth, sam Sponsored by: DARPA, NAI Labs
* Back out M_* changes, per decision of the TRB.imp2003-02-191-7/+7
| | | | Approved by: trb
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-7/+7
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Correct mbuf packet header propagation. Previously, packet headerssam2002-12-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | were sometimes propagated using M_COPY_PKTHDR which actually did something between a "move" and a "copy" operation. This is replaced by M_MOVE_PKTHDR (which copies the pkthdr contents and "removes" it from the source mbuf) and m_dup_pkthdr which copies the packet header contents including any m_tag chain. This corrects numerous problems whereby mbuf tags could be lost during packet manipulations. These changes also introduce arguments to m_tag_copy and m_tag_copy_chain to specify if the tag copy work should potentially block. This introduces an incompatibility with openbsd which we may want to revisit. Note that move/dup of packet headers does not handle target mbufs that have a cluster bound to them. We may want to support this; for now we watch for it with an assert. Finally, M_COPYFLAGS was updated to include M_FIRSTFRAG|M_LASTFRAG. Supported by: Vernier Networks Reviewed by: Robert Watson <rwatson@FreeBSD.org>
* network interface driver changes:sam2002-11-141-1/+0
| | | | | | | | | | | | | | o don't strip the Ethernet header from inbound packets; pass packets up the stack intact (required significant changes to some drivers) o reference common definitions in net/ethernet.h (e.g. ETHER_ALIGN) o track ether_ifattach/ether_ifdetach API changes o track bpf changes (use BPF_TAP and BPF_MTAP) o track vlan changes (ifnet capabilities, revised processing scheme, etc.) o use if_input to pass packets "up" o call ether_ioctl for default handling of ioctls Reviewed by: many Approved by: re
* Rename "struct device" to "struct midway_device" to avoid clashingphk2002-09-282-3/+3
| | | | with newbus.
* Don't include "bpf.h" when compiling on FreeBSD. We always compile inbrooks2002-09-061-0/+4
| | | | bpf support these days.
* Remove __P.alfred2002-03-203-40/+38
|
* 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-144/+187
|
* newbusify the en atm driver.kjc2000-11-073-77/+90
| | | | | | | | 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.
* Added used include of <machine/bus.h> -- don't depend on evil namespacebde2000-11-041-1/+2
| | | | | | | | 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 but dependent on the pollution. There was still a toy version of bus_space_read_1() in unreachable code.
OpenPOWER on IntegriCloud