Commit Graph

18 Commits

Author SHA1 Message Date
Hartmut Brandt
2e7d71c520 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
2005-06-22 06:42:03 +00:00
Brooks Davis
fc74a9f93a 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
2005-06-10 16:49:24 +00:00
Warner Losh
098ca2bda9 Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
Hartmut Brandt
d7af3b881c 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.
2003-11-05 11:47:31 +00:00
Hartmut Brandt
8e994188e2 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).
2003-11-05 11:43:06 +00:00
Hartmut Brandt
fba6dd7f18 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.
2003-10-31 13:35:22 +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
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
92d5836987 Make the value of the HATM_DEBUG symbol the default for the debugging
flags. Introduce a new debugging flag to dump received packets.
2003-10-29 14:33:41 +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
a80f653574 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.
2003-08-07 13:42:31 +00:00
Hartmut Brandt
b3eead8a06 Make the driver honor the ATMIO_FLAG_ASYNC that requests
asynchronuous open/close operations.
2003-08-06 13:16:51 +00:00
Hartmut Brandt
6662c0c12e 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.
2003-07-30 11:32:42 +00:00
Hartmut Brandt
b6e1558bf4 Remove the rather bogus statistics sysctl and merge it into the
internal driver statistics sysctl.
2003-07-29 14:05:45 +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