Commit Graph

49 Commits

Author SHA1 Message Date
Matt Jacob
2a9a64c6a2 Fix various compilation warnings for gcc-4.2.
Approved by:	re (bruce)
2007-06-23 00:02:20 +00:00
Sam Leffler
af72fe981b don't assume char is signed
MFC after:	1 week
2005-12-21 00:19:08 +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
c398230b64 /* -> /*- for license, minor formatting changes 2005-01-07 01:45:51 +00:00
Hartmut Brandt
305627df81 Fix a typo that could provoke a panic or access to random memory.
PR:		kern/67012
Submitted by:	Zhenmin <zli4@cs.uiuc.edu>
2004-07-19 12:54:00 +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
f345f5e020 The number of prefixes can never be negative so use an u_int for this. 2003-07-29 13:46:43 +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
6c373d607e Make the debugging variable that controls printing of UNI messages
accessible as a sysctl and move the debugging stuff out of DIAGNOSTICS.

Submitted by:	Vincent Jardin <vjardin@wanadoo.fr>
MFC after:	2 weeks
2003-07-25 06:39:46 +00:00
Hartmut Brandt
892e9c9b57 Free the UNI vcc to the same zone from where it was allocated from.
This resulted in a panic when detaching the uni31 signalling manager.
2003-07-24 12:24:41 +00:00
Hartmut Brandt
56acf6178a Constify the arguments to several pdu_print functions. 2003-07-24 09:13:03 +00:00
Hartmut Brandt
06055f52f3 Convert a lot of uma_zalloc() calls to be NOWAIT instead of WAITOK. All
these may be called from contexts where we cannot sleep (callout handlers
for example).
2003-07-23 14:28:57 +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
Hartmut Brandt
084fb28576 Fix a number of occurences of calling uma_zalloc() with neither
M_WAITOK nor M_NOWAIT.
2003-07-18 16:36:41 +00:00
David E. O'Brien
81a6b595de Use __FBSDID(). 2003-06-11 07:22:30 +00:00
David E. O'Brien
1e44b62e0d There is no reason to be cute with ntohl(). Just call it directly rather
than use a macro that tries to do conversions in place.

Compile tested on:	sparc64
2003-02-23 22:26:39 +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
Bruce Evans
65c66e222d Include <sys/systm.h> instead of depending on namespace pollution in
<net/if_var.h>.  But depend on the standard pollution in <sys/param.h>.
Removed unused includes.
2002-09-29 12:01:36 +00:00
Andrew R. Reiter
560edda366 - Finish the uni part of the storage pool cleanup. There should now only
be a few bits left to clean from the HARP code in terms of what is using
  the storage pools; once that's done, the memory management code can be
  removed entirely.

  This commit effectively changes the use of dynamic memory routines from
  atm_allocate, atm_free, atm_release_pool to uma_zcreate, uma_zalloc,
  uma_zfree, uma_zdestroy.
2002-06-13 14:32:51 +00:00
Andrew R. Reiter
64151e7a8a - Nuke some more not needed #ifdef cruft. 2002-04-21 01:41:05 +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
Alfred Perlstein
03d1b8bc94 Remove __P. 2002-03-20 08:00:54 +00:00
Kris Kennaway
7c483fee3f Don't call log() without a format string.
MFC after:	2 weeks
2001-09-10 12:00:47 +00:00
Jim Pirzyk
03b84cf051 Commited patch for uni signaling fix.
PR:		kern/28748
Submitted by:	Richard Hodges <rh@matriplex.com>
MFC after:	2 weeks
2001-07-11 16:31:50 +00:00
Jeroen Ruigrok van der Werven
d7d97eb0aa Preceed/preceeding are not english words. Use precede and preceding. 2001-02-18 10:43:53 +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
96cdb64ea9 Remove un-needed #include's.
Pointed out by: phk
2000-01-17 20:49:59 +00:00
Mike Spengler
c34532be04 Notice when an interface's ATM address changes when running a local arpserver. 2000-01-15 20:46:07 +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
9848a01e47 Prevent duplicate output lines from 'atm show arpserver' command on systems
with multiple ATM physical interfaces.
1999-01-19 23:16:11 +00:00
Mike Spengler
4515a6631a Prevent accessing freed signalling instance memory during detach processing. 1999-01-19 23:14:51 +00:00
Poul-Henning Kamp
93e31e2f3c Set and propagate the correct cause code values.
Submitted by: Mike Spengler <mks@circe.networkcs.com>
1998-12-11 21:47:47 +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
3538f74065 Unneeded file.
Submitted by:	Mike Spengler <mks@networkcs.com>
1998-10-31 20:09:25 +00:00
Poul-Henning Kamp
5930f69a34 Set BLLI Layer 2 protocol field when using a 'User specified' protocol.
Submitted by:	Mike Spengler <mks@networkcs.com>
1998-10-31 20:08:03 +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