summaryrefslogtreecommitdiff
path: root/sys/dev/hatm
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-05-03sys/dev: minor spelling fixes.Pedro F. Giffuni
Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955
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
2016-04-19sys/dev: use our nitems() macro when it is avaliable through param.h.Pedro F. Giffuni
No functional change, only trivial cases are done in this sweep, Drivers that can get further enhancements will be done independently. Discussed in: freebsd-current Notes: svn path=/head/; revision=298307
2014-10-21Fix multiple incorrect SYSCTL arguments in the kernel:Hans Petter Selasky
- Wrong integer type was specified. - Wrong or missing "access" specifier. The "access" specifier sometimes included the SYSCTL type, which it should not, except for procedural SYSCTL nodes. - Logical OR where binary OR was expected. - Properly assert the "access" argument passed to all SYSCTL macros, using the CTASSERT macro. This applies to both static- and dynamically created SYSCTLs. - Properly assert the the data type for both static and dynamic SYSCTLs. In the case of static SYSCTLs we only assert that the data pointed to by the SYSCTL data pointer has the correct size, hence there is no easy way to assert types in the C language outside a C-function. - Rewrote some code which doesn't pass a constant "access" specifier when creating dynamic SYSCTL nodes, which is now a requirement. - Updated "EXAMPLES" section in SYSCTL manual page. MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=273377
2014-10-16Follow up to r225617. In order to maximize the re-usability of kernel codeDavide Italiano
in userland rename in-kernel getenv()/setenv() to kern_setenv()/kern_getenv(). This fixes a namespace collision with libc symbols. Submitted by: kmacy Tested by: make universe Notes: svn path=/head/; revision=273174
2014-09-19Mechanically convert to if_inc_counter().Gleb Smirnoff
Notes: svn path=/head/; revision=271849
2014-07-11Fix style bug: rename the refcount field of m_ext to ext_cnt, to matchGleb Smirnoff
other members. Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=268530
2014-07-11All mbuf external free functions never fail, so let them be void.Gleb Smirnoff
Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=268529
2013-11-30Fix undefined behavior: (1 << 31) is not defined as 1 is an int and thisEitan Adler
shifts into the sign bit. Instead use (1U << 31) which gets the expected result. This fix is not ideal as it assumes a 32 bit int, but does fix the issue for most cases. A similar change was made in OpenBSD. Discussed with: -arch, rdivacky Reviewed by: cperciva Notes: svn path=/head/; revision=258780
2013-11-30Similar to the (1 << 31) case it is not defined to do (2 << 30).Eitan Adler
Notes: svn path=/head/; revision=258779
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
2013-08-25Give (*ext_free) an int return value allowing for very sophisticatedAndre Oppermann
external mbuf buffer management capabilities in the future. For now only EXT_FREE_OK is defined with current legacy behavior. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=254842
2013-08-24Add an mbuf pointer parameter to (*ext_free) to give the externalAndre Oppermann
free function access to the mbuf the external memory was attached to. Mechanically adjust all users to include the mbuf parameter. This fixes a long standing annoyance for external free functions. Before one had to sacrifice one of the argument pointers for this. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=254799
2013-08-12Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCIScott Long
command register. The lazy BAR allocation code in FreeBSD sometimes disables this bit when it detects a range conflict, and will re-enable it on demand when a driver allocates the BAR. Thus, the bit is no longer a reliable indication of capability, and should not be checked. This results in the elimination of a lot of code from drivers, and also gives the opportunity to simplify a lot of drivers to use a helper API to set the busmaster enable bit. This changes fixes some recent reports of disk controllers and their associated drives/enclosures disappearing during boot. Submitted by: jhb Reviewed by: jfv, marius, achadd, achim MFC after: 1 day Notes: svn path=/head/; revision=254263
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-12More conversions of drivers to use the PCI parent DMA tag.Scott Long
Notes: svn path=/head/; revision=232874
2010-01-07Remove extraneous semicolons, no functional changes.Martin Blapp
Submitted by: Marc Balmer <marc@msys.ch> MFC after: 1 week Notes: svn path=/head/; revision=201758
2009-11-30Free pointer from getenv() when done with it.Ed Maste
Submitted by: Phil Longstaff Notes: svn path=/head/; revision=199970
2009-11-06Take a step towards removing if_watchdog/if_timer. Don't explicitly setJohn Baldwin
if_watchdog/if_timer to NULL/0 when initializing an ifnet. if_alloc() sets those members to NULL/0 already. Notes: svn path=/head/; revision=198988
2008-02-01Give MEXTADD() another argument to make both void pointers to thePoul-Henning Kamp
free function controlable, instead of passing the KVA of the buffer storage as the first argument. Fix all conventional users of the API to pass the KVA of the buffer as the first argument, to make this a no-op commit. Likely break the only non-convetional user of the API, after informing the relevant committer. Update the mbuf(9) manual page, which was already out of sync on this point. Bump __FreeBSD_version to 800016 as there is no way to tell how many arguments a CPP macro needs any other way. This paves the way for giving sendfile(9) a way to wait for the passed storage to have been accessed before returning. This does not affect the memory layout or size of mbufs. Parental oversight by: sam and rwatson. No MFC is anticipated. Notes: svn path=/head/; revision=175872
2007-06-08Remove the __inline qualifier from a function which is in fact not anMatt Jacob
inline but instead a module wide function, thus quieting a GCC 4.2 warning. Notes: svn path=/head/; revision=170411
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
2005-09-19Replace m_extadd() with macro version MEXTADD().Andre Oppermann
Notes: svn path=/head/; revision=150347
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-07-15Convert the atomic_ptr() operations over to operating on uintptr_tJohn Baldwin
variables rather than void * variables. This makes it easier and simpler to get asm constraints and volatile keywords correct. MFC after: 3 days Tested on: i386, alpha, sparc64 Compiled on: ia64, powerpc, amd64 Kernel toolchain busted on: arm Notes: svn path=/head/; revision=148067
2005-07-01Fix another fallout from the ifnet change that assumed that a softcHartmut Brandt
starts with an ifatm which in turns has an ifnet. Remove also a couple of unneccessary casts that could hide such things in the future. Approved by: re Notes: svn path=/head/; revision=147721
2005-06-22Fix the debugging macro. The struct ifnet isn't embedded in softcHartmut Brandt
anymore - instead we have a pointer in the softc to it. Use that instead to call if_printf(). Approved by: re Notes: svn path=/head/; revision=147524
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-05-25Add a missing comma which prevents compilation with debugging enabled.Hartmut Brandt
Spotted by: Donatas <donatas@lrtc.net> Notes: svn path=/head/; revision=146617
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-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-24change NULL to 0 to silence warning.Alfred Perlstein
Notes: svn path=/head/; revision=123810
2003-11-05Make the driver conditionally MPSAFE. MPSAFEty defaults to not-mpsafeHartmut Brandt
but can be enabled by setting hw.atm.hatmN.mpsafe in the kernel environment to a non-zero value before loading the driver. When the problems with network MPSAFEty have been sorted out this will be removed and the driver will default to MPSAFE. Notes: svn path=/head/; revision=122113
2003-11-05When compiled with debugging trace the number of transmit mbufs thatHartmut Brandt
we own. Warn if something strange happens (number drops below zero or there appears to be a leak). Notes: svn path=/head/; revision=122112
2003-11-05Initialize the USED flag in new external receive buffers to 0, not to 1.Hartmut Brandt
We put them directly onto the free list instead of calling the external mbuf free routine (that routine would have cleaned the flag). This fixes a bug which manifests itself in falsely reporting a lot of used buffers when configuring the interface down. Notes: svn path=/head/; revision=122111
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-10-31Fix breakage on ia64: PAGE_SIZE on ia64 is large enough that more thanHartmut Brandt
256 raw receive buffers (96 byte each) fit into one page. This breaks the limit imposed by the usage of an uint8_t for the buffer number. Restrict the allocation size for buffers to a maximum of 8192. Notes: svn path=/head/; revision=121797
2003-10-30Explain why the lock-free allocation algorithm is safe in our caseHartmut Brandt
while beeing not safe in the general case. Thanks to David Schultz <das@freebsd.org> for help. Notes: svn path=/head/; revision=121744
2003-10-30Reinvent the used-flag for external mbufs. This and the on-card flagHartmut Brandt
are now in the header of the external buffer itself which allows us to manipulate them in the free routine without having to lock the softc structure or the free list. To get space for these flags the chunk number is reduced to 8 bit which amounts to a maximum of 256 chunks per allocated page. This restriction is now enforced by a CTASSERT. Notes: svn path=/head/; revision=121729
2003-10-29Allow sending of more than one raw cell from a single mbuf. Only theHartmut Brandt
very first cell in the mbuf should have a cell header word (of which everything except the payload type and the CLP bit is ignored). All other cells should be 48 byte and get the same header as the first cell. This fixes a problem with sending more than 120000 raw cells/sec through an HE155. The card seems to need 2 cell times to DMA the transmit buffer ready queue entry and the transmit buffer descriptor so at 1/3 the link rate the transmit buffer ready queue starts to fill up. Even with this patch it's obviously impossible to send raw cells at link rate. Notes: svn path=/head/; revision=121687
2003-10-29Remove a superfluous ) from the previous commit. This was obviouslyHartmut Brandt
a result of the current solar storm. Notes: svn path=/head/; revision=121686
2003-10-29Make the maximum number of pages for external mbufs configurable inHartmut Brandt
the kernel environment and accessible as a RO sysctl. Explain that the HE155 will not work in 64-bit/66MHz slots, but may work in 64-bit/33MHz slots. Notes: svn path=/head/; revision=121685
2003-10-29Make the value of the HATM_DEBUG symbol the default for the debuggingHartmut Brandt
flags. Introduce a new debugging flag to dump received packets. Notes: svn path=/head/; revision=121681
2003-10-29Inline a function that was called only in one place directly into that place.Hartmut Brandt
Correct a bug when the number of pages for external mbufs was very large. In this case the page number could overflow into the large buffer flag. Make this more unlikley by move that flag further away. Notes: svn path=/head/; revision=121680
2003-10-29We have some space in the external mbufs so use this space forHartmut Brandt
the external buffer reference count. This saves us a malloc() + free() per small receive mbuf. Notes: svn path=/head/; revision=121677
2003-10-29Defer allocation of the actual receive mbuf until the external bufferHartmut Brandt
is returned from the card to the driver. Add a counter that shows how many times this allocation has failed. Note, that we could even further delay the allocation of the mbuf until we know, that we need it (there are no receive errors and the connection is open). This will be done in a later commit. Print the new statistics field in atmconfig. Notes: svn path=/head/; revision=121676