Commit Graph

52 Commits

Author SHA1 Message Date
David E. O'Brien
aad970f1fe Use __FBSDID().
Also some minor style cleanups.
2003-08-24 17:55:58 +00:00
Warner Losh
3d11ce04c6 s=include <ofw/=include <dev/ofw/= to reflect removal of -I$S/dev 2003-08-23 00:11:16 +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
bec064b151 Implement a traffic shaping option for the PCA200 for CBR channels.
This is controlled by a per-adapter sysctl hw.atm.hfaX.shape. When
set to 0, no shaping occures. When set to 1 at most 1 channel is
shaped. When set to 2 all CBR channels are shaped. Note, that the
latter may actually not work, because of the adapter supporting
the shaping of only one PDU at the same time.
2003-07-31 14:52:44 +00:00
Hartmut Brandt
50b751a7d4 Make the driver to work with firmware version 4.1.12 (other 4.X.Y should
also do it). Three problems have been encountered:

1. The initialisation command does not work in interrupt mode. Whether
   this is a firmware bug or a feature is not clear. The original Fore
   drivers execute the initialize command always in polling mode, so
   it appears that this behaviour is expected. When we detect a 4.X.Y
   firmware do busy wait on the command status.

2. The command code of the GET_PROM command has changed. This is an
   unofficial command anyway. What was GET_PROM in 3.X.Y is CLEAR_STATS
   in 4.X.Y (although unimplemented in the firmware). We need to
   use the correct code depending on the firmware.

3. The 4.X.Y firmware can set the error flag in the command status
   without also setting the completion flag (as the documenation says).
   Check both variants.

An additional field in the per-card structure fu_ft4 is TRUE when we have
detected a 4.X.Y firmware. Otherwise it is false. The behaviour of the
driver when using a 3.X.Y firmware should be identical to the previous
behaviour.

This change will enable traffic shaping of (at least one) CBR channels.
2003-07-31 14:20:07 +00:00
Hartmut Brandt
bfbb5daa0f Use a size_t where a buffer length is meant. 2003-07-29 13:33:14 +00:00
Matthew N. Dodd
533294b956 - Don't call pci_enable_io() in drivers (unless needed for resume).
- Don't test memory/port status and emit an error message; the PCI
  bus code will do this now.
2003-04-16 03:16:57 +00:00
Jonathan Lemon
1cafed3941 Update netisr handling; Each SWI now registers its queue, and all queue
drain routines are done by swi_net, which allows for better queue control
at some future point.  Packets may also be directly dispatched to a netisr
instead of queued, this may be of interest at some installations, but
currently defaults to off.

Reviewed by: hsu, silby, jayanth, sam
Sponsored by: DARPA, NAI Labs
2003-03-04 23:19:55 +00:00
Poul-Henning Kamp
7ac40f5f59 Gigacommit to improve device-driver source compatibility between
branches:

Initialize struct cdevsw using C99 sparse initializtion and remove
all initializations to default values.

This patch is automatically generated and has been tested by compiling
LINT with all the fields in struct cdevsw in reverse order on alpha,
sparc64 and i386.

Approved by:    re(scottl)
2003-03-03 12:15:54 +00:00
Dag-Erling Smørgrav
521f364b80 More low-hanging fruit: kill caddr_t in calls to wakeup(9) / [mt]sleep(9). 2003-03-02 16:54:40 +00:00
John Baldwin
f77f866d28 Adjust some casts to quiet warnings.
Reviewed by:	mdodd
2002-11-06 22:58:55 +00:00
Sam Leffler
5d84645305 Replace aux mbufs with packet tags:
o instead of a list of mbufs use a list of m_tag structures a la openbsd
o for netgraph et. al. extend the stock openbsd m_tag to include a 32-bit
  ABI/module number cookie
o for openbsd compatibility define a well-known cookie MTAG_ABI_COMPAT and
  use this in defining openbsd-compatible m_tag_find and m_tag_get routines
o rewrite KAME use of aux mbufs in terms of packet tags
o eliminate the most heavily used aux mbufs by adding an additional struct
  inpcb parameter to ip_output and ip6_output to allow the IPsec code to
  locate the security policy to apply to outbound packets
o bump __FreeBSD_version so code can be conditionalized
o fixup ipfilter's call to ip_output based on __FreeBSD_version

Reviewed by:	julian, luigi (silent), -arch, -net, darren
Approved by:	julian, silence from everyone else
Obtained from:	openbsd (mostly)
MFC after:	1 month
2002-10-16 01:54:46 +00:00
Matthew N. Dodd
945a11211b Use more standard variable names for modevent functions. 2002-10-02 04:47:52 +00:00
Matthew N. Dodd
f72e17e233 Add a field to struct cmn_unit to hold a pointer to the driver's softc. 2002-10-01 22:04:31 +00:00
Archie Cobbs
4a6a94d8d8 Replace (ab)uses of "NULL" where "0" is really meant. 2002-08-22 21:24:01 +00:00
Andrew R. Reiter
9561b109ae - Remove DMA_* macros as only one, DMA_GET_ADDR, was used.
- Convert DMA_GET_ADDR() calls to vtophys() calls in order to finish
  removing the DMA_* macros.
2002-06-24 05:03:44 +00:00
Andrew R. Reiter
c3f9fb1a24 - Remove the definition for SCHED_ATM
- Change SCHED_ATM statements into schednetisr() calls.
2002-06-24 04:10:12 +00:00
Andrew R. Reiter
b6037a7953 - Turn the hea and hfa HARP storage pools into UMA zones and insert
the necesary uma_zcreate() and uma_zdestroy calls into module loading
  handler and the device attach handling.
- Change the related HARP netatm code to use UMA zone functions when
  dealing with the zones that were formerly the ATM interface (hea, hfa)
  storage pools.
- Have atm_physif_freenifs() now get passed an uma_zone_t so that we can
  properly free the allocated NIF's back to their zone.

This should be the last commit to remove any code that makes use of the
netatm storage pool api.  I will be removing the api code within the near
future.

Reviewed by:	mdodd
2002-06-14 16:59:38 +00:00
Matthew N. Dodd
33b04e2fcb Move some code around.
Minor whitespace changes.
2002-06-07 01:55:42 +00:00
Mike Barcroft
72cd6fa0c0 Change two KM_COPY()s to bcopy(). This should have been done when the
KM_* macros were removed.
2002-04-20 19:27:34 +00:00
Matthew N. Dodd
906cf7526c - Convert the 'hfa' ATM interface driver to newbus.
- Add stubs for EISA and SBUS cards.
  (VME, FutureBUS, and TurboChannel stubs not provided.)
- Add infrastructure to build driver and bus front-end modules.
2002-04-17 00:26:09 +00:00
Andrew R. Reiter
99b8d33f34 - Nuke fore_pci_device.
- Add a device_method_t array, fore_methods.
- Add a fore_ident_table that contains the various FORE Systems PCA-200
  series devices.
- Rewrite of the fore_probe routine (formerly known as fore_pci_probe).
- Minor changes... mostly WIP stuff to get this updated... still much to
  be done.
2002-04-16 01:38:31 +00:00
Andrew R. Reiter
1df8b447a2 - Remove PCA-200E definition -- this will be re-added in the commit to
fore_load.c that will add ``fore_ident_table'' which holds various
  types of FORE Systems PCA-200 series devices.
2002-04-16 01:34:00 +00:00
Alfred Perlstein
e51a25f850 Remove __P. 2002-03-20 02:08:01 +00:00
Jim Pirzyk
3398752a77 Applied the patch to fix HARP ATM that was broken when KAME IPv6 came
into FreeBSD.

PR:		kern/23620
Submitted by:	rh@matriplex.com
MFC after:	1 month
2001-06-20 17:09:14 +00:00
Poul-Henning Kamp
f83880518b Send the remains (such as I have located) of "block major numbers" to
the bit-bucket.
2001-03-26 12:41:29 +00:00
Peter Wemm
b348bd9392 Minor tweaks to get these to stop breaking LINT. They still dont work
and emit warnings, but we need to get the test coverage elsewhere.
2001-01-17 01:08:50 +00:00
Poul-Henning Kamp
a3671bc8c8 Add back some now needed #include <sys/systm.h>
Fix various warnings while here anyway.
2000-12-07 22:19:06 +00:00
Jonathan Lemon
df5e198723 Lock down the network interface queues. The queue mutex must be obtained
before adding/removing packets from the queue.  Also, the if_obytes and
if_omcasts fields should only be manipulated under protection of the mutex.

IF_ENQUEUE, IF_PREPEND, and IF_DEQUEUE perform all necessary locking on
the queue.  An IF_LOCK macro is provided, as well as the old (mutex-less)
versions of the macros in the form _IF_ENQUEUE, _IF_QFULL, for code which
needs them, but their use is discouraged.

Two new macros are introduced: IF_DRAIN() to drain a queue, and IF_HANDOFF,
which takes care of locking/enqueue, and also statistics updating/start
if necessary.
2000-11-25 07:35:38 +00:00
Poul-Henning Kamp
8879e52387 Add back some #include <sys/systm.h> which were needed when <sys/ktr.h>
doesn't mess us up.

Noted by:	Harti Brandt <brandt@fokus.gmd.de>
2000-10-30 20:37:01 +00:00
Poul-Henning Kamp
bb2e7ebb7c Remove 86 unneeded #includes 2000-10-27 21:32:10 +00:00
Poul-Henning Kamp
db7e3af111 Remove unneeded #include <machine/clock.h> 2000-10-15 14:19:01 +00:00
Poul-Henning Kamp
1f22e63352 Remove even more unneeded #includes. 2000-10-14 17:37:32 +00:00
Poul-Henning Kamp
67b0d5b9ea Remove the #include kitchensink <netatm/kern_include.h> and add
the #includes to the respective source files.

Also un-nest includes in <dev/hfa/fore_include.h>

I have run src/tools/tools/kerninclude to remove 1239 clearly
unneeded #includes reducing the total from 3524 includes to 2285.
2000-10-12 08:14:20 +00:00
Poul-Henning Kamp
67467625e2 More HARP polishina:
unifdef -UFORE_SBUS -DFORE_PCI
s/ATM_KERNEL/_KERNER/g
2000-10-12 07:42:34 +00:00
Poul-Henning Kamp
6cb2a0952f Do some cleanups of the HARP atm codes interface into the system:
Define the NETISR just like all the other NETISRs.

unifdef -Usun -D__FreeBSD__  we will probably never support sun4c
and if we do we can't use the solaris code anyway and  I doubt
anybody will be running Fore ATM cards in then in the first place.
2000-10-12 00:03:50 +00:00
Mike Spengler
3ee23c43ff Ensure that DMA mappings are freed in error situations. 2000-01-15 21:01:04 +00:00
Poul-Henning Kamp
d6a0e38a1b Remove five now unused fields from struct cdevsw. They should never
have been there in the first place.  A GENERIC kernel shrinks almost 1k.

Add a slightly different safetybelt under nostop for tty drivers.

Add some missing FreeBSD tags
1999-09-25 18:24:47 +00:00
Bruce Evans
1961e4302a Fixed printf format errors (don't assume that ntohl() returns u_long;
it returns u_int on i386's and in_addr_t (u_int32_t) on alphas).
1999-08-29 10:28:10 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Mike Smith
fcb893a801 Implement a new generic mechanism for attaching handler functions to
events, in order to pave the way for removing a number of the ad-hoc
implementations currently in use.

Retire the at_shutdown family of functions and replace them with
new event handler lists.

Rework kern_shutdown.c to take greater advantage of the use of event
handlers.

Reviewed by:	green
1999-08-21 06:24:40 +00:00
Poul-Henning Kamp
4e2f199e0c This commit should be a extensive NO-OP:
Reformat and initialize correctly all "struct cdevsw".

        Initialize the d_maj and d_bmaj fields.

        The d_reset field was not removed, although it is never used.

I used a program to do most of this, so all the files now use the
same consistent format.  Please keep it that way.

Vinum and i4b not modified, patches emailed to respective authors.
1999-05-30 16:53:49 +00:00
Mike Spengler
9ce49f6de3 Allow configuration of up to 256 network interfaces per physical interface -
just like the docs say it should.
1999-05-10 23:02:29 +00:00
Mike Spengler
8abd11a431 Enable PCI bus master during attach in case the BIOS hasn't done it for us. 1999-05-10 22:53:45 +00:00
Peter Wemm
579f45fa60 Simplify the COMPAT_PCI_DRIVER/DATA_SET hack. We can add:
#define COMPAT_PCI_DRIVER(name,data) DATA_SET(pcidevice_set,data)
.. to 2.2.x and 3.x if people think it's worth it.  Driver writers can do
this if it's not defined.  (The reason for this is that I'm trying to
progressively eliminate use of linker_sets where it hurts modularity and
runtime load capability, and these DATA_SET's keep getting in the way.)
1999-05-09 17:07:30 +00:00
Peter Wemm
96b3554e5c Use COMPAT_PCI_DRIVER() for registration if it exists. This shouldn't
hurt the driver portability to 3.x too much for where drivers are shared.
1999-04-24 20:17:05 +00:00
Matthew Dillon
b4e36adf1c Fix warnings preparing for -Wall -Wcast-qual
Also disable one usb module in LINT due to fatal compilation errors,
    temporary.
1999-01-27 20:09:21 +00:00
Matthew Dillon
2cbe36f725 probe function changed from returning char * to const char *. 1998-12-14 06:37:37 +00:00
Archie Cobbs
2127f26023 Examine all occurrences of sprintf(), strcat(), and str[n]cpy()
for possible buffer overflow problems. Replaced most sprintf()'s
with snprintf(); for others cases, added terminating NUL bytes where
appropriate, replaced constants like "16" with sizeof(), etc.

These changes include several bug fixes, but most changes are for
maintainability's sake. Any instance where it wasn't "immediately
obvious" that a buffer overflow could not occur was made safer.

Reviewed by:	Bruce Evans <bde@zeta.org.au>
Reviewed by:	Matthew Dillon <dillon@apollo.backplane.com>
Reviewed by:	Mike Spengler <mks@networkcs.com>
1998-12-04 22:54:57 +00:00
Poul-Henning Kamp
264b85f3ce Trivial stylish changes, mostly to silence gcc.
Reviewed by:	Mike Spengler <mks@networkcs.com>
Submitted by:	phk
1998-10-31 20:07:01 +00:00