summaryrefslogtreecommitdiffstats
path: root/sys/dev/hatm
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* When we cannot allocate an external buffer (bacause we've hitharti2003-10-271-9/+5
| | | | | | | | | | | 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.
* Sysctl names should not contain dots. Convert them to underlines.harti2003-10-241-19/+19
|
* Use PCIR_BAR(x) instead of PCIR_MAPS.jhb2003-09-021-1/+1
| | | | | Glanced over by: imp, gibbs Tested by: i386 LINT
* Use __FBSDID().obrien2003-08-241-6/+7
| | | | Also some minor style cleanups.
* Prefer new location of pci include files (which have only been in theimp2003-08-225-10/+10
| | | | | tree for two or more years now), except in a few places where there's code to be compatible with older versions of FreeBSD.
* Make the driver preserve open connections accross ifconfig downharti2003-08-074-26/+57
| | | | | | | 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.
* Remove the ATMIOCENA and ATMIOCDIS ioctl. Everyting has been convertedharti2003-08-061-54/+2
| | | | | to use the new OPENVCC and CLOSEVCC calls that allow the sepcification of traffic parameters for the connections.
* Make the driver honor the ATMIO_FLAG_ASYNC that requestsharti2003-08-064-9/+6
| | | | asynchronuous open/close operations.
* Rearrange the fields in the vcc table entry to fit to the requirementsharti2003-07-302-68/+13
| | | | | of the generic getvcc function and used that function instead of the home grown.
* Generate events for carrier state, PVC state changes and flow controlharti2003-07-293-16/+13
| | | | changes. Still have to figure out, how to get at the ABR information.
* Remove the rather bogus statistics sysctl and merge it into theharti2003-07-292-17/+8
| | | | internal driver statistics sysctl.
* The card resets the S/Uni chip when it is resetted. Thereforharti2003-07-171-0/+5
| | | | | we need to reinitialize the PHY after the call to reset when stopping the interface.
* Use the default arguments for lockfunc and lockfuncarg inharti2003-07-105-14/+23
| | | | | | | | | | | | | | | 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.
* Mega busdma API commit.scottl2003-07-011-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Style: __FBSDID().harti2003-06-185-10/+16
|
* This is a driver for Fore/Marconi HE155 and HE622 ATM cards. It is fullharti2003-06-178-0/+6017
busdma and has extensively been tested on i386 and sparc64.
OpenPOWER on IntegriCloud