Commit Graph

16 Commits

Author SHA1 Message Date
Alfred Perlstein
3939094dfb change NULL to 0 to silence warning. 2003-12-24 18:23:02 +00:00
Hartmut Brandt
0144e71085 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.
2003-11-05 11:15:47 +00:00
Hartmut Brandt
cc3f6cb9fd 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.
2003-10-30 16:19:50 +00:00
Hartmut Brandt
62b93d9b12 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.
2003-10-30 10:43:52 +00:00
Hartmut Brandt
cb79e7478d Remove a superfluous ) from the previous commit. This was obviously
a result of the current solar storm.
2003-10-29 15:11:26 +00:00
Hartmut Brandt
278bc3c3a9 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.
2003-10-29 15:07:10 +00:00
Hartmut Brandt
ac45adc11a 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.
2003-10-29 14:28:26 +00:00
Hartmut Brandt
908b018b49 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.
2003-10-29 13:21:38 +00:00
Hartmut Brandt
7672807356 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.
2003-10-29 13:14:39 +00:00
Hartmut Brandt
d1f6e71f1d 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.
2003-10-29 12:59:44 +00:00
Hartmut Brandt
325014126d 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.
2003-10-27 16:21:59 +00:00
David E. O'Brien
aad970f1fe Use __FBSDID().
Also some minor style cleanups.
2003-08-24 17:55:58 +00:00
Warner Losh
77e6a3b2dd 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.
2003-08-22 06:00:27 +00:00
Hartmut Brandt
445b5e54cf 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.
2003-07-10 13:55:09 +00:00
Hartmut Brandt
1329537b7a Style: __FBSDID(). 2003-06-18 09:31:37 +00:00
Hartmut Brandt
c594298bee 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.
2003-06-17 16:12:50 +00:00