Commit graph

41 commits

Author SHA1 Message Date
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 c398230b64 /* -> /*- for license, minor formatting changes 2005-01-07 01:45:51 +00:00
Alexander Kabaev 445e045b0d Avoid casts as lvalues. 2004-07-28 06:59:55 +00:00
Brooks Davis 9bf40ede4a Replace the if_name and if_unit members of struct ifnet with new members
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)
2003-10-31 18:32:15 +00:00
Hartmut Brandt dd937e32bd Make the ioctl() interface cleaner with regard to types: use size_t
instead of int where the variable has to hold buffer lengths,
use u_int for things like number of network interfaces which
in principle can never be negative.
2003-07-29 13:32:10 +00:00
Hartmut Brandt a327640a9e Print the offending SPANS message only if printing is enabled. 2003-07-25 12:32:08 +00:00
Hartmut Brandt 5d53a37cb4 Create a sysctl that allows to enable/disable printing of SPANS messages.
While here delete to sys/types.h includes when sys/param.h is also included.

Submitted by:	Vincent Jardin <vjardin@wanadoo.fr>
MFC after:	2 weeks
2003-07-24 14:37:01 +00:00
Hartmut Brandt b92ba02261 Remove the zone limits for all the zones used in the ATM code.
These were a left over from when the private memory pools were
converted to use uma zones. The limit of UMA zones, however,
works differently. When a zone is limited to only one or two pages
than, on multi-cpu systems, processes can get stuck on the zonelimit,
because all remaining free items are in caches of other CPUs.

Also add rudimentary error handling in some places (panic) when a zone
cannot be created.
2003-07-22 12:46:30 +00:00
David E. O'Brien f25de95508 Use __FBSDID(). 2003-06-11 07:11:35 +00:00
David E. O'Brien 8368cf8f75 Use __FBSDID rather than rcsid[]. 2003-04-03 21:36:33 +00:00
Warner Losh a163d034fa Back out M_* changes, per decision of the TRB.
Approved by: trb
2003-02-19 05:47:46 +00:00
Alfred Perlstein 44956c9863 Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
2003-01-21 08:56:16 +00:00
Jens Schweikhardt 9d5abbddbf Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,
especially in troff files.
2003-01-01 18:49:04 +00:00
Jens Schweikhardt d64ada501a Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/
Add FreeBSD Id tag where missing.
2002-12-30 21:18:15 +00:00
John Baldwin 672cc99ed3 - Change the ATM stack functions to use intptr_t instead of int for opaque
arguments.
- Fix a few other places that assumed that sizeof(int) == sizeof(void *).

Reviewed by:	mdodd
2002-11-08 18:27:30 +00:00
Peter Wemm d223099401 Make netatm/spans compile in the kernel without depending on userland
include files to provide functions for kernel source (spans_kxdr.c)
2002-09-17 08:57:52 +00:00
Peter Wemm 86a492bffa Fix a few warnings by adding a missing prototype 2002-05-24 06:17:17 +00:00
Andrew R. Reiter d5f2cdc5f2 - Remove a few storage pools and replace them with UMA zones. The spans
code is now storage pool free, so I believe this only leaves the uni
  base not cleaned.
2002-05-24 00:39:58 +00:00
Andrew R. Reiter 64151e7a8a - Nuke some more not needed #ifdef cruft. 2002-04-21 01:41:05 +00:00
Andrew R. Reiter 4fba67caca - Nuke some more #ifdef sun related sections. 2002-04-19 21:38:43 +00:00
Andrew R. Reiter 2575dfa6d9 - Change KM_ macro calls to the appropriate function call.
- Nuke KM_ macros from port.h

  This is a leadin step towards cleaning up this code as I wait for some
  ATM cards and a ATM switch to arrive.
2002-04-19 17:45:22 +00:00
Matthew N. Dodd 073bba0262 Wrap function in #ifdef DIAGNOSTIC to compile with -Werror. 2002-04-17 00:30:38 +00:00
Alfred Perlstein 03d1b8bc94 Remove __P. 2002-03-20 08:00:54 +00:00
Alfred Perlstein 2c9e2445bb Silence some warnings
Submitted by: LINT
2001-03-20 10:42:49 +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
Poul-Henning Kamp a3b266147d Remove more unused #includes. 2000-10-30 07:42:06 +00:00
Poul-Henning Kamp db7e3af111 Remove unneeded #include <machine/clock.h> 2000-10-15 14:19:01 +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 98e185d2a5 Process SPANS ARP requests even if source IP is 0.0.0.0 (or broadcast). This
can occur when talking to a Fore host which is using "bonded" interfaces.
2000-01-15 20:34:55 +00:00
Peter Wemm 3078c786f8 Fix a warning (unused variable RCSid) 1999-11-18 08:18:13 +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
Matthew Dillon 8aef171243 Fix warnings in preparation for adding -Wall -Wcast-qual to the
kernel compile
1999-01-28 00:57:57 +00:00
Matthew Dillon 831a80b0d5 Fix warnings in preparation for adding -Wall -Wcast-qual to the
kernel compile
1999-01-27 22:42:27 +00:00
Mike Spengler cffed8a128 Don't return errors for 'atm show arpserver' command on sigpvc and spans
interfaces.
1999-01-19 23:11:40 +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
Poul-Henning Kamp d80044954c Two patches from the HARP people:
Various Makefile related fixes.

-Wformat fixes.

Submitted by:	Mike Spengler <mks@networkcs.com>
1998-09-17 09:35:02 +00:00
Poul-Henning Kamp 1820df7a2d Add new files for HARP3
Host ATM Research Platform (HARP), Network Computing Services, Inc.
This software was developed with the support of the Defense Advanced
Research Projects Agency (DARPA).
1998-09-15 08:23:17 +00:00