aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/hatm
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Get rid of the mutexes for the exernal buffer free lists. UseHartmut Brandt2003-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. Notes: svn path=/head/; revision=121675
* When we cannot allocate an external buffer (bacause we've hitHartmut Brandt2003-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. Notes: svn path=/head/; revision=121617
* Sysctl names should not contain dots. Convert them to underlines.Hartmut Brandt2003-10-241-19/+19
| | | | Notes: svn path=/head/; revision=121469
* Use PCIR_BAR(x) instead of PCIR_MAPS.John Baldwin2003-09-021-1/+1
| | | | | | | | Glanced over by: imp, gibbs Tested by: i386 LINT Notes: svn path=/head/; revision=119690
* Use __FBSDID().David E. O'Brien2003-08-241-6/+7
| | | | | | | Also some minor style cleanups. Notes: svn path=/head/; revision=119418
* Prefer new location of pci include files (which have only been in theWarner Losh2003-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. Notes: svn path=/head/; revision=119280
* Make the driver preserve open connections accross ifconfig downHartmut Brandt2003-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. Notes: svn path=/head/; revision=118598
* Remove the ATMIOCENA and ATMIOCDIS ioctl. Everyting has been convertedHartmut Brandt2003-08-061-54/+2
| | | | | | | | to use the new OPENVCC and CLOSEVCC calls that allow the sepcification of traffic parameters for the connections. Notes: svn path=/head/; revision=118548
* Make the driver honor the ATMIO_FLAG_ASYNC that requestsHartmut Brandt2003-08-064-9/+6
| | | | | | | asynchronuous open/close operations. Notes: svn path=/head/; revision=118540
* Rearrange the fields in the vcc table entry to fit to the requirementsHartmut Brandt2003-07-302-68/+13
| | | | | | | | of the generic getvcc function and used that function instead of the home grown. Notes: svn path=/head/; revision=118205
* Generate events for carrier state, PVC state changes and flow controlHartmut Brandt2003-07-293-16/+13
| | | | | | | changes. Still have to figure out, how to get at the ABR information. Notes: svn path=/head/; revision=118170
* Remove the rather bogus statistics sysctl and merge it into theHartmut Brandt2003-07-292-17/+8
| | | | | | | internal driver statistics sysctl. Notes: svn path=/head/; revision=118169
* The card resets the S/Uni chip when it is resetted. ThereforHartmut Brandt2003-07-171-0/+5
| | | | | | | | we need to reinitialize the PHY after the call to reset when stopping the interface. Notes: svn path=/head/; revision=117687
* Use the default arguments for lockfunc and lockfuncarg inHartmut Brandt2003-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. Notes: svn path=/head/; revision=117382
* Mega busdma API commit.Scott Long2003-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 Notes: svn path=/head/; revision=117126
* Style: __FBSDID().Hartmut Brandt2003-06-185-10/+16
| | | | Notes: svn path=/head/; revision=116519
* This is a driver for Fore/Marconi HE155 and HE622 ATM cards. It is fullHartmut Brandt2003-06-178-0/+6017
busdma and has extensively been tested on i386 and sparc64. Notes: svn path=/head/; revision=116491