summaryrefslogtreecommitdiffstats
path: root/sys/dev/hatm
Commit message (Collapse)AuthorAgeFilesLines
* sys/dev: minor spelling fixes.pfg2016-05-033-3/+3
| | | | Most affect comments, very few have user-visible effects.
* sys: use our roundup2/rounddown2() macros when param.h is available.pfg2016-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.
* sys/dev: use our nitems() macro when it is avaliable through param.h.pfg2016-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
* Fix multiple incorrect SYSCTL arguments in the kernel:hselasky2014-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
* Follow up to r225617. In order to maximize the re-usability of kernel codedavide2014-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
* Mechanically convert to if_inc_counter().glebius2014-09-192-9/+9
|
* Fix style bug: rename the refcount field of m_ext to ext_cnt, to matchglebius2014-07-111-2/+2
| | | | | | other members. Sponsored by: Nginx, Inc.
* All mbuf external free functions never fail, so let them be void.glebius2014-07-111-4/+2
| | | | Sponsored by: Nginx, Inc.
* Fix undefined behavior: (1 << 31) is not defined as 1 is an int and thiseadler2013-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
* Similar to the (1 << 31) case it is not defined to do (2 << 30).eadler2013-11-301-1/+1
|
* The r48589 promised to remove implicit inclusion of if_var.h soon. Prepareglebius2013-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.
* Give (*ext_free) an int return value allowing for very sophisticatedandre2013-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
* Add an mbuf pointer parameter to (*ext_free) to give the externalandre2013-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
* Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCIscottl2013-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
* Mechanically substitute flags from historic mbuf allocator withglebius2012-12-042-3/+3
| | | | malloc(9) flags in sys/dev.
* More conversions of drivers to use the PCI parent DMA tag.scottl2012-03-121-2/+2
|
* Remove extraneous semicolons, no functional changes.mbr2010-01-071-2/+2
| | | | | Submitted by: Marc Balmer <marc@msys.ch> MFC after: 1 week
* Free pointer from getenv() when done with it.emaste2009-11-301-0/+1
| | | | Submitted by: Phil Longstaff
* Take a step towards removing if_watchdog/if_timer. Don't explicitly setjhb2009-11-061-1/+0
| | | | | if_watchdog/if_timer to NULL/0 when initializing an ifnet. if_alloc() sets those members to NULL/0 already.
* Give MEXTADD() another argument to make both void pointers to thephk2008-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.
* Remove the __inline qualifier from a function which is in fact not anmjacob2007-06-081-1/+1
| | | | inline but instead a module wide function, thus quieting a GCC 4.2 warning.
* 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@
* Replace m_extadd() with macro version MEXTADD().andre2005-09-191-2/+2
|
* Fix "struct ifnet" leaks when attach() fails in the middle.ru2005-09-161-3/+4
|
* Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE andrwatson2005-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
* Convert the atomic_ptr() operations over to operating on uintptr_tjhb2005-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
* Fix another fallout from the ifnet change that assumed that a softcharti2005-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
* Fix the debugging macro. The struct ifnet isn't embedded in softcharti2005-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
* Stop embedding struct ifnet at the top of driver softcs. Instead thebrooks2005-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
* Add a missing comma which prevents compilation with debugging enabled.harti2005-05-251-1/+1
| | | | Spotted by: Donatas <donatas@lrtc.net>
* Use BUS_PROBE_DEFAULT for pci probe return valueimp2005-03-051-1/+1
|
* Start each of the license/copyright comments with /*-, minor shuffle of linesimp2005-01-068-8/+8
|
* Convert callers to the new bus_alloc_resource_any(9) API.njl2004-03-171-4/+4
| | | | | 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-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
* change NULL to 0 to silence warning.alfred2003-12-241-1/+1
|
* Make the driver conditionally MPSAFE. MPSAFEty defaults to not-mpsafeharti2003-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.
* When compiled with debugging trace the number of transmit mbufs thatharti2003-11-052-2/+46
| | | | | we own. Warn if something strange happens (number drops below zero or there appears to be a leak).
* Initialize the USED flag in new external receive buffers to 0, not to 1.harti2003-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.
* Replace the if_name and if_unit members of struct ifnet with new membersbrooks2003-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)
* Fix breakage on ia64: PAGE_SIZE on ia64 is large enough that more thanharti2003-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.
* Explain why the lock-free allocation algorithm is safe in our caseharti2003-10-301-0/+18
| | | | | while beeing not safe in the general case. Thanks to David Schultz <das@freebsd.org> for help.
* Reinvent the used-flag for external mbufs. This and the on-card flagharti2003-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.
* Allow sending of more than one raw cell from a single mbuf. Only theharti2003-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.
* Remove a superfluous ) from the previous commit. This was obviouslyharti2003-10-291-1/+1
| | | | a result of the current solar storm.
* Make the maximum number of pages for external mbufs configurable inharti2003-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.
* Make the value of the HATM_DEBUG symbol the default for the debuggingharti2003-10-293-13/+15
| | | | flags. Introduce a new debugging flag to dump received packets.
* Inline a function that was called only in one place directly into that place.harti2003-10-292-72/+72
| | | | | | 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.
* We have some space in the external mbufs so use this space forharti2003-10-292-2/+5
| | | | | the external buffer reference count. This saves us a malloc() + free() per small receive mbuf.
* Defer allocation of the actual receive mbuf until the external bufferharti2003-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.
* Get rid of the mutexes for the exernal buffer free lists. Useharti2003-10-293-52/+51
| | | | | | atomic instructions instead. Remove the stuff used to track whether an external mbuf travels through the system. This is temporary only and will come back soon.
OpenPOWER on IntegriCloud