332288 |
08-Apr-2018 |
brooks |
MFC r331797:
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 |
302408 |
08-Jul-2016 |
gjb |
Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle. Prune svn:mergeinfo from the new branch, as nothing has been merged here.
Additional commits post-branch will follow.
Approved by: re (implicit) Sponsored by: The FreeBSD Foundation |
298955 |
03-May-2016 |
pfg |
sys/dev: minor spelling fixes.
Most affect comments, very few have user-visible effects.
|
298433 |
21-Apr-2016 |
pfg |
sys: use our roundup2/rounddown2() macros when param.h is available.
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.
|
298307 |
19-Apr-2016 |
pfg |
sys/dev: use our nitems() macro when it is avaliable through param.h.
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
|
273377 |
21-Oct-2014 |
hselasky |
Fix multiple incorrect SYSCTL arguments in the kernel:
- 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
|
273174 |
16-Oct-2014 |
davide |
Follow up to r225617. In order to maximize the re-usability of kernel code 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
|
271849 |
19-Sep-2014 |
glebius |
Mechanically convert to if_inc_counter().
|
268530 |
11-Jul-2014 |
glebius |
Fix style bug: rename the refcount field of m_ext to ext_cnt, to match other members.
Sponsored by: Nginx, Inc.
|
268529 |
11-Jul-2014 |
glebius |
All mbuf external free functions never fail, so let them be void.
Sponsored by: Nginx, Inc.
|
258780 |
30-Nov-2013 |
eadler |
Fix undefined behavior: (1 << 31) is not defined as 1 is an int and this 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
|
258779 |
30-Nov-2013 |
eadler |
Similar to the (1 << 31) case it is not defined to do (2 << 30).
|
257176 |
26-Oct-2013 |
glebius |
The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare 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.
|
254842 |
25-Aug-2013 |
andre |
Give (*ext_free) an int return value allowing for very sophisticated 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
|
254799 |
24-Aug-2013 |
andre |
Add an mbuf pointer parameter to (*ext_free) to give the external 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
|
254263 |
12-Aug-2013 |
scottl |
Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCI 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
|
243857 |
04-Dec-2012 |
glebius |
Mechanically substitute flags from historic mbuf allocator with malloc(9) flags in sys/dev.
|
232874 |
12-Mar-2012 |
scottl |
More conversions of drivers to use the PCI parent DMA tag.
|
201758 |
07-Jan-2010 |
mbr |
Remove extraneous semicolons, no functional changes.
Submitted by: Marc Balmer <marc@msys.ch> MFC after: 1 week
|
199970 |
30-Nov-2009 |
emaste |
Free pointer from getenv() when done with it.
Submitted by: Phil Longstaff
|
198988 |
06-Nov-2009 |
jhb |
Take a step towards removing if_watchdog/if_timer. Don't explicitly set if_watchdog/if_timer to NULL/0 when initializing an ifnet. if_alloc() sets those members to NULL/0 already.
|
175872 |
01-Feb-2008 |
phk |
Give MEXTADD() another argument to make both void pointers to the 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.
|
170411 |
08-Jun-2007 |
mjacob |
Remove the __inline qualifier from a function which is in fact not an inline but instead a module wide function, thus quieting a GCC 4.2 warning.
|
166901 |
23-Feb-2007 |
piso |
o break newbus api: add a new argument of type driver_filter_t to 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@
|
150347 |
19-Sep-2005 |
andre |
Replace m_extadd() with macro version MEXTADD().
|
150215 |
16-Sep-2005 |
ru |
Fix "struct ifnet" leaks when attach() fails in the middle.
|
148887 |
09-Aug-2005 |
rwatson |
Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE and 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
|
148067 |
15-Jul-2005 |
jhb |
Convert the atomic_ptr() operations over to operating on uintptr_t 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
|
147721 |
01-Jul-2005 |
harti |
Fix another fallout from the ifnet change that assumed that a softc 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
|
147524 |
22-Jun-2005 |
harti |
Fix the debugging macro. The struct ifnet isn't embedded in softc anymore - instead we have a pointer in the softc to it. Use that instead to call if_printf().
Approved by: re
|
147256 |
10-Jun-2005 |
brooks |
Stop embedding struct ifnet at the top of driver softcs. Instead the 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
|
146617 |
25-May-2005 |
harti |
Add a missing comma which prevents compilation with debugging enabled.
Spotted by: Donatas <donatas@lrtc.net>
|
143161 |
05-Mar-2005 |
imp |
Use BUS_PROBE_DEFAULT for pci probe return value
|
139749 |
06-Jan-2005 |
imp |
Start each of the license/copyright comments with /*-, minor shuffle of lines
|
127135 |
17-Mar-2004 |
njl |
Convert callers to the new bus_alloc_resource_any(9) API.
Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde
|
126396 |
29-Feb-2004 |
scottl |
All three of these drivers abused cv_waitq_empty in the same way by spinning 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
|
123810 |
24-Dec-2003 |
alfred |
change NULL to 0 to silence warning.
|
122113 |
05-Nov-2003 |
harti |
Make the driver conditionally MPSAFE. MPSAFEty defaults to not-mpsafe 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.
|
122112 |
05-Nov-2003 |
harti |
When compiled with debugging trace the number of transmit mbufs that we own. Warn if something strange happens (number drops below zero or there appears to be a leak).
|
122111 |
05-Nov-2003 |
harti |
Initialize the USED flag in new external receive buffers to 0, not to 1. 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.
|
121816 |
31-Oct-2003 |
brooks |
Replace the if_name and if_unit members of struct ifnet with new members 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)
|
121797 |
31-Oct-2003 |
harti |
Fix breakage on ia64: PAGE_SIZE on ia64 is large enough that more than 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.
|
121744 |
30-Oct-2003 |
harti |
Explain why the lock-free allocation algorithm is safe in our case while beeing not safe in the general case. Thanks to David Schultz <das@freebsd.org> for help.
|
121729 |
30-Oct-2003 |
harti |
Reinvent the used-flag for external mbufs. This and the on-card flag 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.
|
121687 |
29-Oct-2003 |
harti |
Allow sending of more than one raw cell from a single mbuf. Only the 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.
|
121686 |
29-Oct-2003 |
harti |
Remove a superfluous ) from the previous commit. This was obviously a result of the current solar storm.
|
121685 |
29-Oct-2003 |
harti |
Make the maximum number of pages for external mbufs configurable in 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.
|
121681 |
29-Oct-2003 |
harti |
Make the value of the HATM_DEBUG symbol the default for the debugging flags. Introduce a new debugging flag to dump received packets.
|
121680 |
29-Oct-2003 |
harti |
Inline a function that was called only in one place directly into that place.
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.
|
121677 |
29-Oct-2003 |
harti |
We have some space in the external mbufs so use this space for the external buffer reference count. This saves us a malloc() + free() per small receive mbuf.
|
121676 |
29-Oct-2003 |
harti |
Defer allocation of the actual receive mbuf until the external buffer 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.
|
121675 |
29-Oct-2003 |
harti |
Get rid of the mutexes for the exernal buffer free lists. Use 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.
|
121617 |
27-Oct-2003 |
harti |
When we cannot allocate an external buffer (bacause we've hit the maximum number of pages for buffers) return -1 instead of 0. This fixes a panic under conditions when many mbufs are needed.
Update the head pointer of the receive buffer pool queue even when we could not supply a buffer to the chip. Otherwise the chip will not re-interrupt us for another try. A better strategy would probably be to remember this condition and to supply buffers without an interrupt as soon as buffers get available.
|
121469 |
24-Oct-2003 |
harti |
Sysctl names should not contain dots. Convert them to underlines.
|
119690 |
02-Sep-2003 |
jhb |
Use PCIR_BAR(x) instead of PCIR_MAPS.
Glanced over by: imp, gibbs Tested by: i386 LINT
|
119418 |
24-Aug-2003 |
obrien |
Use __FBSDID(). Also some minor style cleanups.
|
119280 |
22-Aug-2003 |
imp |
Prefer new location of pci include files (which have only been in the tree for two or more years now), except in a few places where there's code to be compatible with older versions of FreeBSD.
|
118598 |
07-Aug-2003 |
harti |
Make the driver preserve open connections accross ifconfig down and up commands. When configuring the interface down only the connections that are currently closing are deleted from the connection table. When the interface is configured up, all connections that are in the table are re-opened.
|
118548 |
06-Aug-2003 |
harti |
Remove the ATMIOCENA and ATMIOCDIS ioctl. Everyting has been converted to use the new OPENVCC and CLOSEVCC calls that allow the sepcification of traffic parameters for the connections.
|
118540 |
06-Aug-2003 |
harti |
Make the driver honor the ATMIO_FLAG_ASYNC that requests asynchronuous open/close operations.
|
118205 |
30-Jul-2003 |
harti |
Rearrange the fields in the vcc table entry to fit to the requirements of the generic getvcc function and used that function instead of the home grown.
|
118170 |
29-Jul-2003 |
harti |
Generate events for carrier state, PVC state changes and flow control changes. Still have to figure out, how to get at the ABR information.
|
118169 |
29-Jul-2003 |
harti |
Remove the rather bogus statistics sysctl and merge it into the internal driver statistics sysctl.
|
117687 |
17-Jul-2003 |
harti |
The card resets the S/Uni chip when it is resetted. Therefor we need to reinitialize the PHY after the call to reset when stopping the interface.
|
117382 |
10-Jul-2003 |
harti |
Use the default arguments for lockfunc and lockfuncarg in bus_dma_tag_create. We need to be sure that our packets are kept in-sequence (that's how ATM is supposed to work) and therefor use BUS_DMA_NOWAIT in all calls to bus_dmamap_load.
For memory allocated with bus_dmamem_alloc the use of anything other than NULL arguments for the locking is anyway bogus because this memory never should need bouncing and hence the load should never be defered.
Allow the receipt of OAM and RM cells on raw connections. Caveat: it seems that RM cells are still processed by the hardware even when we open the connection as UBR.
|
117126 |
01-Jul-2003 |
scottl |
Mega busdma API commit.
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
|
116519 |
18-Jun-2003 |
harti |
Style: __FBSDID().
|
116491 |
17-Jun-2003 |
harti |
This is a driver for Fore/Marconi HE155 and HE622 ATM cards. It is full busdma and has extensively been tested on i386 and sparc64.
|