summaryrefslogtreecommitdiffstats
path: root/sys/dev/en
Commit message (Collapse)AuthorAgeFilesLines
* o break newbus api: add a new argument of type driver_filter_t topiso2007-02-231-1/+1
| | | | | | | | | | | | | bus_setup_intr() o add an int return code to all fast handlers o retire INTR_FAST/IH_FAST For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current Reviewed by: many Approved by: re@
* Fix fat-fingering in previous commit.jhb2006-12-291-1/+1
| | | | Pointy hat to: jhb
* Various bpf(4) related fixes to catch places up to the new bpf(4)jhb2006-12-291-2/+2
| | | | | | | | | | | | | semantics. - Stop testing bpf pointers for NULL. In some cases use bpf_peers_present() and then call the function directly inside the conditional block instead of the macro. - For places where the entire conditional block is the macro, remove the test and make the macro unconditional. - Use BPF_MTAP() in if_pfsync on FreeBSD instead of an expanded version of the old semantics. Reviewed by: csjp (older version)
* - Consistently use if_printf() only in interface methods: if_start(),glebius2006-09-152-22/+22
| | | | | | | | if_watchdog, etc., or in functions used only in these methods. In all other functions in the driver use device_printf(). - Use __func__ instead of typing function name. Submitted by: Alex Lyashkov <umka sevcity.net>
* Subtracting two pointers produces a ptrdiff_t not a size_t so useharti2006-03-211-9/+9
| | | | the %td to print this instead of %zu or %d.
* Drop the driver lock around atm_input() analogous to all the ethernetjhb2005-10-271-0/+2
| | | | | | drivers dropping the driver lock around ether_input(). Silence by: harti
* - Use PCIR_BAR macro rather than hardcoding 0x10.jhb2005-09-291-6/+2
| | | | | - Use pci_enable_busmaster() rather than doing it by hand. - Remove duplicate if_free().
* Make sure that we call if_free(ifp) after bus_teardown_intr. Since weimp2005-09-191-1/+1
| | | | | | | could get an interrupt after we free the ifp, and the interrupt handler depended on the ifp being still alive, this could, in theory, cause a crash. Eliminate this possibility by moving the if_free to after the bus_teardown_intr() call.
* Fix "struct ifnet" leaks when attach() fails in the middle.ru2005-09-161-2/+9
|
* Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE andrwatson2005-08-092-12/+12
| | | | | | | | | | | | | | 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
* Stop embedding struct ifnet at the top of driver softcs. Instead thebrooks2005-06-103-67/+73
| | | | | | | | | | | | | | | | | | | | 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
* Use BUS_PROBE_DEFAULT for pci probe return valueimp2005-03-051-2/+2
|
* 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
OpenPOWER on IntegriCloud