summaryrefslogtreecommitdiff
path: root/sys/dev/hatm
Commit message (Collapse)AuthorAgeFilesLines
* MFC r331797:Brooks Davis2018-04-081-1/+1
| | | | | | | | | | | | | | | Use an accessor function to access ifr_data. This fixes 32-bit compat (no ioctl command defintions are required as struct ifreq is the same size). Reviewed by: kib Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14900 Notes: svn path=/stable/11/; revision=332288
* sys/dev: minor spelling fixes.Pedro F. Giffuni2016-05-033-3/+3
| | | | | | | Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955
* sys: use our roundup2/rounddown2() macros when param.h is available.Pedro F. Giffuni2016-04-211-4/+2
| | | | | | | | | | | | | 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
* sys/dev: use our nitems() macro when it is avaliable through param.h.Pedro F. Giffuni2016-04-191-1/+1
| | | | | | | | | | 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
* Fix multiple incorrect SYSCTL arguments in the kernel:Hans Petter Selasky2014-10-211-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* Follow up to r225617. In order to maximize the re-usability of kernel codeDavide Italiano2014-10-161-1/+1
| | | | | | | | | | | 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
* Mechanically convert to if_inc_counter().Gleb Smirnoff2014-09-192-9/+9
| | | | Notes: svn path=/head/; revision=271849
* Fix style bug: rename the refcount field of m_ext to ext_cnt, to matchGleb Smirnoff2014-07-111-2/+2
| | | | | | | | | other members. Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=268530
* All mbuf external free functions never fail, so let them be void.Gleb Smirnoff2014-07-111-4/+2
| | | | | | | Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=268529
* Fix undefined behavior: (1 << 31) is not defined as 1 is an int and thisEitan Adler2013-11-301-2/+2
| | | | | | | | | | | | | | | | 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
* Similar to the (1 << 31) case it is not defined to do (2 << 30).Eitan Adler2013-11-301-1/+1
| | | | Notes: svn path=/head/; revision=258779
* The r48589 promised to remove implicit inclusion of if_var.h soon. PrepareGleb Smirnoff2013-10-265-0/+5
| | | | | | | | | | | 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
* Give (*ext_free) an int return value allowing for very sophisticatedAndre Oppermann2013-08-251-4/+6
| | | | | | | | | | | 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
* Add an mbuf pointer parameter to (*ext_free) to give the externalAndre Oppermann2013-08-241-4/+4
| | | | | | | | | | | | | | | 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
* Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCIScott Long2013-08-121-7/+1
| | | | | | | | | | | | | | | | | | | | 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
* Mechanically substitute flags from historic mbuf allocator withGleb Smirnoff2012-12-042-3/+3
| | | | | | | malloc(9) flags in sys/dev. Notes: svn path=/head/; revision=243857
* More conversions of drivers to use the PCI parent DMA tag.Scott Long2012-03-121-2/+2
| | | | Notes: svn path=/head/; revision=232874
* Remove extraneous semicolons, no functional changes.Martin Blapp2010-01-071-2/+2
| | | | | | | | Submitted by: Marc Balmer <marc@msys.ch> MFC after: 1 week Notes: svn path=/head/; revision=201758
* Free pointer from getenv() when done with it.Ed Maste2009-11-301-0/+1
| | | | | | | Submitted by: Phil Longstaff Notes: svn path=/head/; revision=199970
* Take a step towards removing if_watchdog/if_timer. Don't explicitly setJohn Baldwin2009-11-061-1/+0
| | | | | | | | 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
* Give MEXTADD() another argument to make both void pointers to thePoul-Henning Kamp2008-02-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Remove the __inline qualifier from a function which is in fact not anMatt Jacob2007-06-081-1/+1
| | | | | | | inline but instead a module wide function, thus quieting a GCC 4.2 warning. Notes: svn path=/head/; revision=170411
* o break newbus api: add a new argument of type driver_filter_t toPaolo Pisati2007-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@ Notes: svn path=/head/; revision=166901
* Replace m_extadd() with macro version MEXTADD().Andre Oppermann2005-09-191-2/+2
| | | | Notes: svn path=/head/; revision=150347
* Fix "struct ifnet" leaks when attach() fails in the middle.Ruslan Ermilov2005-09-161-3/+4
| | | | Notes: svn path=/head/; revision=150215
* Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE andRobert Watson2005-08-095-16/+16
| | | | | | | | | | | | | | | | | 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
* Convert the atomic_ptr() operations over to operating on uintptr_tJohn Baldwin2005-07-151-3/+6
| | | | | | | | | | | | | 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
* Fix another fallout from the ifnet change that assumed that a softcHartmut Brandt2005-07-013-5/+5
| | | | | | | | | | 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
* Fix the debugging macro. The struct ifnet isn't embedded in softcHartmut Brandt2005-06-221-1/+1
| | | | | | | | | | 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
* Stop embedding struct ifnet at the top of driver softcs. Instead theBrooks Davis2005-06-106-114/+122
| | | | | | | | | | | | | | | | | | | | | | | 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
* Add a missing comma which prevents compilation with debugging enabled.Hartmut Brandt2005-05-251-1/+1
| | | | | | | Spotted by: Donatas <donatas@lrtc.net> Notes: svn path=/head/; revision=146617
* Use BUS_PROBE_DEFAULT for pci probe return valueWarner Losh2005-03-051-1/+1
| | | | Notes: svn path=/head/; revision=143161
* Start each of the license/copyright comments with /*-, minor shuffle of linesWarner Losh2005-01-068-8/+8
| | | | Notes: svn path=/head/; revision=139749
* Convert callers to the new bus_alloc_resource_any(9) API.Nate Lawson2004-03-171-4/+4
| | | | | | | | Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde Notes: svn path=/head/; revision=127135
* All three of these drivers abused cv_waitq_empty in the same way by spinningScott Long2004-02-291-7/+2
| | | | | | | | | | | | 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
* change NULL to 0 to silence warning.Alfred Perlstein2003-12-241-1/+1
| | | | Notes: svn path=/head/; revision=123810
* Make the driver conditionally MPSAFE. MPSAFEty defaults to not-mpsafeHartmut Brandt2003-11-052-2/+9
| | | | | | | | | | 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
* When compiled with debugging trace the number of transmit mbufs thatHartmut Brandt2003-11-052-2/+46
| | | | | | | | we own. Warn if something strange happens (number drops below zero or there appears to be a leak). Notes: svn path=/head/; revision=122112
* Initialize the USED flag in new external receive buffers to 0, not to 1.Hartmut Brandt2003-11-051-2/+2
| | | | | | | | | | | 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
* Replace the if_name and if_unit members of struct ifnet with new membersBrooks Davis2003-10-311-4/+1
| | | | | | | | | | | | | | | | 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
* Fix breakage on ia64: PAGE_SIZE on ia64 is large enough that more thanHartmut Brandt2003-10-311-1/+5
| | | | | | | | | 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
* Explain why the lock-free allocation algorithm is safe in our caseHartmut Brandt2003-10-301-0/+18
| | | | | | | | while beeing not safe in the general case. Thanks to David Schultz <das@freebsd.org> for help. Notes: svn path=/head/; revision=121744
* Reinvent the used-flag for external mbufs. This and the on-card flagHartmut Brandt2003-10-303-19/+56
| | | | | | | | | | | 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
* Allow sending of more than one raw cell from a single mbuf. Only theHartmut Brandt2003-10-291-8/+11
| | | | | | | | | | | | | | | 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
* Remove a superfluous ) from the previous commit. This was obviouslyHartmut Brandt2003-10-291-1/+1
| | | | | | | a result of the current solar storm. Notes: svn path=/head/; revision=121686
* Make the maximum number of pages for external mbufs configurable inHartmut Brandt2003-10-293-2/+7
| | | | | | | | | | 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
* Make the value of the HATM_DEBUG symbol the default for the debuggingHartmut Brandt2003-10-293-12/+14
| | | | | | | flags. Introduce a new debugging flag to dump received packets. Notes: svn path=/head/; revision=121681
* Inline a function that was called only in one place directly into that place.Hartmut Brandt2003-10-292-71/+71
| | | | | | | | | 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
* We have some space in the external mbufs so use this space forHartmut Brandt2003-10-292-2/+5
| | | | | | | | the external buffer reference count. This saves us a malloc() + free() per small receive mbuf. Notes: svn path=/head/; revision=121677
* Defer allocation of the actual receive mbuf until the external bufferHartmut Brandt2003-10-294-29/+30
| | | | | | | | | | | | | 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