summaryrefslogtreecommitdiff
path: root/sys/dev/en
AgeCommit message (Collapse)Author
2017-04-24Remove the NATM framework including the en(4), fatm(4), hatm(4), andBrooks Davis
patm(4) devices. Maintaining an address family and framework has real costs when we make infrastructure improvements. In the case of NATM we support no devices manufactured in the last 20 years and some will not even work in modern motherboards (some newer devices that patm(4) could be updated to support apparently exist, but we do not currently have support). With this change, support remains for some netgraph modules that don't require NATM support code. It is unclear if all these should remain, though ng_atmllc certainly stands alone. Note well: FreeBSD 11 supports NATM and will continue to do so until at least September 30, 2021. Improvements to the code in FreeBSD 11 are certainly welcome. Reviewed by: philip Approved by: harti Notes: svn path=/head/; revision=317383
2016-04-21sys: use our roundup2/rounddown2() macros when param.h is available.Pedro F. Giffuni
rounddown2 tends to produce longer lines than the original code and when the code has a high indentation level it was not really advantageous to do the replacement. This tries to strike a balance between readability using the macros and flexibility of having the expressions, so not everything is converted. Notes: svn path=/head/; revision=298433
2015-01-05To ease changes to underlying mbuf structure and the mbuf allocator, reduceRobert Watson
the knowledge of mbuf layout, and in particular constants such as M_EXT, MLEN, MHLEN, and so on, in mbuf consumers by unifying various alignment utility functions (M_ALIGN(), MH_ALIGN(), MEXT_ALIGN() in a single M_ALIGN() macro, implemented by a now-inlined m_align() function: - Move m_align() from uipc_mbuf.c to mbuf.h; mark as __inline. - Reimplement M_ALIGN(), MH_ALIGN(), and MEXT_ALIGN() using m_align(). - Update consumers around the tree to simply use M_ALIGN(). This change eliminates a number of cases where mbuf consumers must be aware of whether or not mbufs returned by the allocator use external storage, but also assumptions about the size of the returned mbuf. This will make it easier to introduce changes in how we use external storage, as well as features such as variable-size mbufs. Differential Revision: https://reviews.freebsd.org/D1436 Reviewed by: glebius, trasz, gnn, bz Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=276692
2014-09-19Mechanically convert to if_inc_counter().Gleb Smirnoff
Notes: svn path=/head/; revision=271849
2013-12-29In sys/dev/en/midway.c, #if 0 an unused static function.Dimitry Andric
MFC after: 3 days Notes: svn path=/head/; revision=260038
2013-10-26The r48589 promised to remove implicit inclusion of if_var.h soon. PrepareGleb Smirnoff
to this event, adding if_var.h to files that do need it. Also, include all includes that now are included due to implicit pollution via if_var.h Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=257176
2012-12-04Mechanically substitute flags from historic mbuf allocator withGleb Smirnoff
malloc(9) flags in sys/dev. Notes: svn path=/head/; revision=243857
2012-03-12Final pass at having devices use their bus parent for dma tags. TheScott Long
remaining drivers that haven't been converted have various problems or complexities that will be dealt with later. This list includes: hptrr, hptmv, hpt27xx - device aggregation across multiple parents drm - want to talk to the maintainer first tsec, sec - Openfirmware devices, not sure if changes are warranted fatm - Done except for unused testing code usb - want to talk to the maintainer first ce, cp, ctau, cx - Significant driver changes needed to convey parent info There are also devices tucked into architecture subtrees that I'll leave for the respective maintainers to deal with. Notes: svn path=/head/; revision=232883
2011-06-28Remove duplicate header includesKevin Lo
Notes: svn path=/head/; revision=223624
2011-01-18Specify a CTLTYPE_FOO so that a future sysctl(8) change does not needMatthew D Fleming
to rely on the format string. Notes: svn path=/head/; revision=217556
2008-11-06Hide an unused variable in case we compile with neither INET nor INET6.Bjoern A. Zeeb
NATM needs 'struct in_addr' to compile, which is a problem on its own but include in.h for now if we have NATM but neither INET or INET6. MFC after: 2 months Notes: svn path=/head/; revision=184712
2008-03-25Replaced the misleading uses of a historical artefact M_TRYWAIT with M_WAIT.Ruslan Ermilov
Removed dead code that assumed that M_TRYWAIT can return NULL; it's not true since the advent of MBUMA. Reviewed by: arch There are ongoing disputes as to whether we want to switch to directly using UMA flags M_WAITOK/M_NOWAIT for mbuf(9) allocation. Notes: svn path=/head/; revision=177599
2007-05-29Where I previously removed calls to kdb_enter(), now remove include ofRobert Watson
kdb.h. Pointed out by: bde Notes: svn path=/head/; revision=170093
2007-05-27Rather than entering DDB with the message "unexpected error" and wedgingRobert Watson
the card, panic explicitly if EN_DEBUG is enabled. In the (default) case of !EN_DEBUG, the driver resets the card. Probably this case shouldn't exist at all. Notes: svn path=/head/; revision=170013
2007-02-23o break newbus api: add a new argument of type driver_filter_t toPaolo Pisati
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@ Notes: svn path=/head/; revision=166901
2006-12-29Fix fat-fingering in previous commit.John Baldwin
Pointy hat to: jhb Notes: svn path=/head/; revision=165640
2006-12-29Various bpf(4) related fixes to catch places up to the new bpf(4)John Baldwin
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) Notes: svn path=/head/; revision=165632
2006-09-15- Consistently use if_printf() only in interface methods: if_start(),Gleb Smirnoff
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> Notes: svn path=/head/; revision=162321
2006-03-21Subtracting two pointers produces a ptrdiff_t not a size_t so useHartmut Brandt
the %td to print this instead of %zu or %d. Notes: svn path=/head/; revision=156951
2005-10-27Drop the driver lock around atm_input() analogous to all the ethernetJohn Baldwin
drivers dropping the driver lock around ether_input(). Silence by: harti Notes: svn path=/head/; revision=151771
2005-09-29- Use PCIR_BAR macro rather than hardcoding 0x10.John Baldwin
- Use pci_enable_busmaster() rather than doing it by hand. - Remove duplicate if_free(). Notes: svn path=/head/; revision=150712
2005-09-19Make sure that we call if_free(ifp) after bus_teardown_intr. Since weWarner Losh
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. Notes: svn path=/head/; revision=150306
2005-09-16Fix "struct ifnet" leaks when attach() fails in the middle.Ruslan Ermilov
Notes: svn path=/head/; revision=150215
2005-08-09Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE andRobert Watson
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 Notes: svn path=/head/; revision=148887
2005-06-10Stop embedding struct ifnet at the top of driver softcs. Instead theBrooks Davis
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 Notes: svn path=/head/; revision=147256
2005-03-05Use BUS_PROBE_DEFAULT for pci probe return valueWarner Losh
Notes: svn path=/head/; revision=143161
2005-01-06Start each of the license/copyright comments with /*-, minor shuffle of linesWarner Losh
Notes: svn path=/head/; revision=139749
2004-08-02* Add a "how" argument to uma_zone constructors and initialization functionsBrian Feldman
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. Notes: svn path=/head/; revision=132987
2004-07-10Update for the KDB framework:Marcel Moolenaar
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. Notes: svn path=/head/; revision=131913
2004-05-30Add missing <sys/module.h> includesPoul-Henning Kamp
Notes: svn path=/head/; revision=129879
2004-03-17Convert callers to the new bus_alloc_resource_any(9) API.Nate Lawson
Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde Notes: svn path=/head/; revision=127135
2004-02-29All three of these drivers abused cv_waitq_empty in the same way by spinningScott Long
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 Notes: svn path=/head/; revision=126396
2003-12-17Move the locking of the softc up to before the allocation of theHartmut Brandt
transmission map. This allocation accesses the softc so should be under the lock (it uses NOWAIT). Notes: svn path=/head/; revision=123593
2003-10-31Replace the if_name and if_unit members of struct ifnet with new membersBrooks Davis
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) Notes: svn path=/head/; revision=121816
2003-08-24Use __FBSDID().David E. O'Brien
Also some minor style cleanups. Notes: svn path=/head/; revision=119418
2003-08-22Prefer new location of pci include files (which have only been in theWarner Losh
tree for two or more years now), except in a few places where there's code to be compatible with older versions of FreeBSD. Notes: svn path=/head/; revision=119277
2003-08-07Consistently use the BSD u_int and u_short instead of the SYSV uint andJohn Baldwin
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) Notes: svn path=/head/; revision=118607
2003-08-06Remove the ATMIOCENA and ATMIOCDIS ioctl. Everyting has been convertedHartmut Brandt
to use the new OPENVCC and CLOSEVCC calls that allow the sepcification of traffic parameters for the connections. Notes: svn path=/head/; revision=118548
2003-08-06Honor the new ATMIO_FLAG_ASYNC that requests asynchronuous open/closeHartmut Brandt
operations on VCs. Notes: svn path=/head/; revision=118534
2003-08-06When sending check that the channel is really open. Get the informationHartmut Brandt
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. Notes: svn path=/head/; revision=118533
2003-08-06Print an array index that is computed as ptrdiff_t with %tu.Hartmut Brandt
Notes: svn path=/head/; revision=118532
2003-08-06Change the format type to unbreak LINT on 64-bit platforms.David E. O'Brien
Notes: svn path=/head/; revision=118523
2003-08-05Implement per-VC statistics.Hartmut Brandt
Notes: svn path=/head/; revision=118495
2003-08-05Implement the ATMIOCOPENVCC and ATMIOCCLOSEVCC ioctls(). This was theHartmut Brandt
last driver that did not know about those. Notes: svn path=/head/; revision=118494
2003-08-05Use the generic getvccs function from net/if_atmsubr.c and removeHartmut Brandt
the home-grown version. Notes: svn path=/head/; revision=118491
2003-08-05Arrghhh. Remove debugging printf's that slipped in in the pre-previousHartmut Brandt
commit. Notes: svn path=/head/; revision=118490
2003-08-05Use __FBSDID() as per style(9).Hartmut Brandt
Notes: svn path=/head/; revision=118489
2003-08-05Make the en(4) driver more like the other ATM drivers. This is theHartmut Brandt
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. Notes: svn path=/head/; revision=118487
2003-08-05Move the clearing of the IFF_RUNNING flag into the reset routine.Hartmut Brandt
Otherwise the interface will report RUNNING to ifconfig after doing 'ifconfig down' although it isn't running anymore. Notes: svn path=/head/; revision=118484
2003-07-15Be careful to call bus_dmamap_load with BUS_DMA_NOWAIT so that theHartmut Brandt
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. Notes: svn path=/head/; revision=117641