Commit Graph

795 Commits

Author SHA1 Message Date
Darren Reed
051adc35a2 Enable building /sbin/ipf (but not the rescue version) with the ability to
parse bpf strings for filter rules in ipf.conf
2005-05-16 16:22:55 +00:00
Darren Reed
05793fcbf0 Enable IPFilter to correctly determine if BPF has been optioned into the
kernel it is being compiled against and subsequently enable using BPF for
packet matching in ipf rules.
2005-05-15 03:34:17 +00:00
Max Laier
ac9dfc9061 if_mtu not ifp_mtu. 2005-05-04 19:51:06 +00:00
Max Laier
69d9333494 Bring back fix from rev. 1.28 which was lost during the import. 2005-05-04 16:03:01 +00:00
Max Laier
8398e1894d Combine rev. 1.29 and 1.30 to something that will make sense for future
imports.
2005-05-04 15:55:29 +00:00
Max Laier
10ca483be0 Make LINT happy. 2005-05-04 15:29:28 +00:00
Andre Oppermann
c773494edd Pass icmp_error() the MTU argument directly instead of
an interface pointer.  This simplifies a couple of uses
and removes some XXX workarounds.
2005-05-04 13:09:19 +00:00
Max Laier
b01933e6bf Resolve conflicts created during the import of pf 3.7 Some features are
missing and will be implemented in a second step.  This is functional as is.

Tested by:	freebsd-pf, pfsense.org
Obtained from:	OpenBSD
X-MFC after:	never (breaks API/ABI)
2005-05-03 16:43:32 +00:00
Ruslan Ermilov
f9067637f7 Fix the following warnings on amd64:
/usr/src/sbin/ipf/ipftest/../../../sys/contrib/ipfilter/netinet/ip_frag.c: In function `fr_ipid_newfrag':
/usr/src/sbin/ipf/ipftest/../../../sys/contrib/ipfilter/netinet/ip_frag.c:397: warning: cast to pointer from integer of different size
/usr/src/sbin/ipf/ipftest/../../../sys/contrib/ipfilter/netinet/ip_frag.c: In function `fr_ipid_knownfrag':
/usr/src/sbin/ipf/ipftest/../../../sys/contrib/ipfilter/netinet/ip_frag.c:582: warning: cast from pointer to integer of different size
2005-04-29 05:57:17 +00:00
Darren Reed
e01de6cda3 Don't use quad_t on FreeBSD (deprecated) so use "long long" instead.
Someday this should be converted to uint64_t and printstate.c changed to
use those horrid PRiud64 things.
2005-04-28 21:36:30 +00:00
Darren Reed
caec4e7746 The current H.323 proxy source has a license that isn't suitable for inclusion
with FreeBSD so we shouldn't be trying to include it here.
2005-04-27 05:53:12 +00:00
Darren Reed
b1660bb30d - Comment out duplicate rcsid strings in *.c files
- Move SIOCPROXY from ip_nat.h to ip_proxy.h and fix ip_proxy.h so that it
  can be easily compiled into kdump, et al.
2005-04-27 03:48:10 +00:00
Darren Reed
c81e55a2df Add an include for netinet/ip_compat.h directly so that we don't need to
add another special file in the creation of ioctls.c for kdump.
2005-04-26 17:58:05 +00:00
Darren Reed
6eab6ed50f Merge the changes from 3.4.35 to 4.1.8 into the kernel source tree 2005-04-25 18:43:14 +00:00
Darren Reed
8158c4468d import ipfilter 4.1.8 into the kernel source tree 2005-04-25 18:15:41 +00:00
Darren Reed
d607092b37 This commit was generated by cvs2svn to compensate for changes in r145516,
which included commits to RCS files with non-trunk default branches.
2005-04-25 18:15:41 +00:00
Gleb Smirnoff
2fa088e969 Fix error in synproxy connection completion. Source and
destination windows were confused, one instead of other.
This error was masked, because first segment of just
established connection is usually smaller than initially
announced window, and it was successfully passed. First
window reannouncement corrected erroneous 'seqhi' value.
The error showed up when client connected to synproxy
with zero initial window, and reannounced it after
session establishment.

In collaboration with:	dhartmei [we came to same patch independtly]
Reviewed by:		mlaier
Sponsored by:		Rambler
MFC after:		3 days
2005-04-22 09:53:46 +00:00
Robert Watson
e551d45211 Modify the alq(9) alq_open() API to accept a file creation mode, rather
than defaulting the cmode argument to vn_open() to 0.  Supply a default
argument of ALQ_DEFAULT_CMODE (0600) in current callers.

Discussed with/pointed out by:	hmp
Reveiwed by:	jeff, hmp
MFC after:	3 days
2005-04-16 12:12:27 +00:00
Gleb Smirnoff
699df192d9 Fix mss byte order, only affects synproxy code path.
Submitted by:	John L. Scarfone via OpenBSD
Reviewed by:	mlaier
Obtained from:	OpenBSD, rev. 1.483
MFC after:	2 days
2005-04-13 21:05:55 +00:00
David E. O'Brien
1e5fec6b15 Import the nForce MCP NIC bits. This is version 1.0-0301.
Demanded by:	DES
Encouraged by:	scottl
2005-03-12 00:17:37 +00:00
David E. O'Brien
0587a1ea34 This commit was generated by cvs2svn to compensate for changes in r143439,
which included commits to RCS files with non-trunk default branches.
2005-03-12 00:17:37 +00:00
Scott Long
d38d9c9e5e Move all of the hptmv files to /sys/dev/hptmv so that they won't be mistaken
for being on a CVS vendor branch.  The files were moved via a repo-copy.
2005-03-02 05:14:28 +00:00
David E. O'Brien
bb4e63066a Add FreeBSD ID. 2005-02-28 00:53:29 +00:00
Poul-Henning Kamp
4db0fda84e Use dynamic major number allocation. 2005-02-27 22:19:35 +00:00
Sam Leffler
c01f36ef0c avoid sneaky double free
Noticed by:	Coverity Prevent analysis tool
Reviewed by:	scottl
2005-02-25 00:16:53 +00:00
Brian Feldman
d011a9158c Do not fail to initialize callouts (on SMP only) -- it leads to crashing. 2005-02-22 04:27:05 +00:00
Max Laier
93d6cddf05 Fix a terrible braino in pfi_maybe_destroy() and unbreak "$pfctl -Fall" with
renamed interfaces.

PR:		kern/77645
Reported by:	Harald Schmalzbauer <harryNOschmalzbauerSPAMde>
Reviewed by:	yongari
MFC after:	3 days
2005-02-21 17:20:00 +00:00
Max Laier
0df559602c Don't use the static CALLOUT_INITIALIZER for __FreeBSD_version >= 600000. It
was a bad idea, but since it is done like this in the vendor source we keep
it around for older versions. As a safe guard against future misuse we don't
even define CALLOUT_INITIALIZER anymore.

This fixes ALTQ after callout_init_mtx() and takes altq_var.h off the vendor
branch.

Submitted by:	Divacky Roman <xdivac02NOstud.fit.vutbrSPAMcz> (w/ changes)
2005-02-21 17:11:09 +00:00
Pyun YongHyeon
a94f16f4fa Fix inteface clear time. pf printed "Thu Jan 1 09:00:01 1970"
in "pfctl -vvsI" output when pf was statically linked to kernel.

Discussed with:	mlaier
2005-02-17 03:36:31 +00:00
Max Laier
68198dedf8 Access softc embedded struct ifnet via function macro to make it easier to
untangle struct ifnet and softc/arpcom in the future.

Requested by:	brooks
2005-02-09 19:29:13 +00:00
Matthew N. Dodd
1f005b6723 - Split out PCI support.
- Add previously removed ISA support.

Submitted by:	David S. Madole <david AT madole.net>
2005-02-03 23:01:01 +00:00
Daniel Hartmeier
d4f925e4df Use the packet's address family instead of the rule's when selecting a
replacement address for an rdr rule. Some rdr rules have no address family
(when the replacement is a table and no other criterion implies one AF).
In this case, pf would fail to select a replacement address and drop the
packet due to translation failure.

Found by:	Gustavo A. Baratto
2005-01-20 18:07:35 +00:00
Daniel Hartmeier
9624b04d64 Prohibit ruleset changes at securelevel > 2, not > 1. It's documented
like this in init(8), but the code didn't match the documentation.

Submitted by:	Juraj Lutter <otis at sk dot FreeBSD dot org>
Agrees:		mlaier
2005-01-19 21:37:00 +00:00
Nate Lawson
edd973a013 Clean up a small memory leak introduced with the previous commit to
dsutils.c.  We need to GC the implicitly-returned object.

Submitted by:	Robert.Moore at Intel
MFC after:	1 day
2005-01-14 06:37:43 +00:00
Nate Lawson
d26e4b9a02 This commit was generated by cvs2svn to compensate for changes in r140216,
which included commits to RCS files with non-trunk default branches.
2005-01-14 06:37:43 +00:00
Nate Lawson
4802655124 Fix handling of the implicit return case for methods called from an
external source (i.e., _STA).  The previous case only handled calls
occurring within AML.  This should fix Toshibas, among others.  Thanks
to Robert Moore of Intel for the fix.

MFC after:	2 days
2005-01-12 00:52:40 +00:00
Nate Lawson
6023610d63 This commit was generated by cvs2svn to compensate for changes in r140094,
which included commits to RCS files with non-trunk default branches.
2005-01-12 00:52:40 +00:00
Darren Reed
4d7cb202f1 Elminate 1 LOR (actually a recursive mutex grab) involving ipfilter where
we loop through all the list of NICs (struct ifnet), holding the lock on
it and then do a name lookup with ifunit() whilst holding it.
2005-01-08 04:32:02 +00:00
Darren Reed
4541c49f79 * Remove some code that's in a #ifndef FreeBSD that's no longer used. 2004-12-26 09:09:29 +00:00
Darren Reed
2fb1eb06a7 * The #ifdef's to cause mutex's for freebsd to be declared were meant to pick
up on USE_MUTEX being defined, but this patch
* Remove some code that's in a #ifndef FreeBSD that's no longer used.
2004-12-26 09:08:42 +00:00
Scott Long
98331badc2 Darnit, through a maze of twisty passages, ipfilter needs to have PFIL_HOOKS
defined.  Revert part of the previous commit to fix this.
2004-12-25 00:48:27 +00:00
Scott Long
0ca8ae1641 Sprinkle in some __FreeBSD_version checks so that this compiles again. Don't
define PFIL_HOOKS anymore.

Submitted by: keramida
2004-12-25 00:22:25 +00:00
Darren Reed
77bb8ca4a3 Enable fine grained locking within IPFilter, using mtx(9) and sx(9) allowing
the the "needs giant" flag to be removed from the driver.
2004-12-24 09:14:26 +00:00
Daniel Hartmeier
2726bbe221 Initialise init_addr in pf_map_addr() in the PF_POOL_ROUNDROBIN,
prevents a possible endless loop in pf_get_sport() with 'static-port'

ICMP state entries use the ICMP ID as port for the unique state key. When
checking for a usable key, construct the key in the same way. Otherwise,
a colliding key might be missed or a state insertion might be refused even
though it could be inserted. The second case triggers the endless loop,
possibly allowing a NATed LAN client to lock up the kernel.

PR:			kern/74930
Reported and tested by:	Hugo Silva, Srebrenko Sehic
MFC after:		3 days
2004-12-19 19:43:04 +00:00
Max Laier
905c6b87b7 Make ip_nat compile again. Should read #if->n<-def LARGE_NAT as in ipf 4.x 2004-12-18 03:47:54 +00:00
Darren Reed
f42b5dbebb Move two variables that are unused if LARGE_NAT is defined inside an #ifdef
to keep them out of harms way when compiling.

PR:	72783
2004-12-17 15:59:16 +00:00
Darren Reed
8a377db272 Allow ipnat redirect rules to work for non-TCP/UDP packets.
PR:             70038
Submitted by:   fming@borderware.com
Reviewed by:    darrenr
Obtained from:  fming@borderware.com
2004-12-17 02:29:34 +00:00
Darren Reed
6de0f6c8b8 Using just m_pullup to get all of the interesting bits in packet into one
buffer doesn't work for ipv6 packets, so use m_defrag() here instead as an
easy drop-in replacement.

PR:	70399
2004-12-16 21:02:16 +00:00
Max Laier
7cadbe4109 Compile pfsync w/o bpf.
Noticed by:	"Jayel Villamin" <jarthel operamail com>
2004-12-10 17:42:47 +00:00
Sam Leffler
8c489f7420 clear old files now in public 2004-12-08 18:27:44 +00:00
Sam Leffler
7a4700cda9 resolve merge conflict 2004-12-08 18:18:39 +00:00
Sam Leffler
31801f0d36 Version 0.9.14.12:
[Changes listed only since last public release 0.9.12.14; for changes
 prior to that consult the CVS logs at http://madwifi.sourceforge.net]

o reorg directory structure to have a single set of public binary builds
  shared by all systems
o support for new parts (all shipping pci/cardbus parts to this date work)
o new capabilities for identifying various chip features
o set/get tx power cap for supporting 802.11h information element
o revised api for set/get tx queue properties
o support for updating CTS in frames when doing packet bursting
o support for querying which tx queues have pending interrupts
2004-12-08 18:06:09 +00:00
Sam Leffler
230d5663fc This commit was generated by cvs2svn to compensate for changes in r138583,
which included commits to RCS files with non-trunk default branches.
2004-12-08 18:06:09 +00:00
Daniel Hartmeier
8092705059 IPv6 packets can contain headers (like options) before the TCP/UDP/ICMP6
header. pf finds the first TCP/UDP/ICMP6 header to filter by traversing
the header chain. In the case where headers are skipped, the protocol
checksum verification used the wrong length (included the skipped headers),
leading to incorrectly mismatching checksums. Such IPv6 packets with
headers were silently dropped.

Discovered by:	Bernhard Schmidt
MFC after:	1 week
2004-12-05 12:15:43 +00:00
Mark Santcroos
697831d611 Oops, remove unnecessary cast in original, out-commented code.
This was a debug leftover.

MFC after:	1 week
2004-12-02 00:12:19 +00:00
Mark Santcroos
cdb35b24fe This commit was generated by cvs2svn to compensate for changes in r138298,
which included commits to RCS files with non-trunk default branches.
2004-12-02 00:12:19 +00:00
Mark Santcroos
f42941d3ec Local change: Supporting code not yet available, use previous behavior
instead for the time being. Intel should fix this.

Note that if this commit is correct, it is made on the vendor branch.
We expect the Intel folks to fix it, and we don't want to unnecessarily
take files off the vendor branch.

Approved by:	njl
MFC after:	1 week
2004-12-02 00:05:02 +00:00
Mark Santcroos
cc50c2376d This commit was generated by cvs2svn to compensate for changes in r138296,
which included commits to RCS files with non-trunk default branches.
2004-12-02 00:05:02 +00:00
Mark Santcroos
3e5f2bd199 Local change: Remove warnings from vendor files.
Approved by:	njl
MFC after:	1 week
2004-12-01 23:42:21 +00:00
Mark Santcroos
0f190207e6 Local change: In the resume path, give up after waiting for a while
for WAK_STS to be set.  Some BIOSs never set it.

Approved by:	njl
MFC after:	1 week
2004-12-01 23:40:48 +00:00
Mark Santcroos
40047a89b4 Local change: Put various debugging options under ACPI_DISASSEMBLER.
Approved by:	njl
MFC after:	1 week
2004-12-01 23:39:45 +00:00
Mark Santcroos
8baa584183 Unchanged files that are off the vendor branch.
Approved by:	njl
MFC after:	1 week
2004-12-01 23:34:39 +00:00
Mark Santcroos
c846686064 Vendor import of Intel ACPI-CA 20041119 2004-12-01 23:14:10 +00:00
Mark Santcroos
3a36dacc92 This commit was generated by cvs2svn to compensate for changes in r138287,
which included commits to RCS files with non-trunk default branches.
2004-12-01 23:14:10 +00:00
Daniel Hartmeier
1a4a376387 fix a bug that leads to a crash when binat rules of the form
'binat from ... to ... -> (if)' are used, where the interface
is dynamic.

Discovered by:	kos(at)bastard(dot)net
Analyzed by:	Pyun YongHyeon
Approved by:	mlaier (mentor)
MFC after:	1 week
2004-11-24 00:43:34 +00:00
Ruslan Ermilov
9528cdfa6e Removed the remnants of gx(4). 2004-11-08 20:24:52 +00:00
Max Laier
a9052a1691 Improved interface handling. This should fix the use of renamed interfaces
(ifconfig xl0 name foo) as well as some special interfaces such as the 6to4
tunnel.

Reported by:	Ed Schouten <ed (at) il ! fontys , nl>
Tested by:	freebsd-pf
PR:		kern/72444
MFC after:	3 weeks
2004-11-03 17:21:12 +00:00
Max Laier
b6b3698c8e Fix a panic discovered with some apache2 configure test (that seemed to
trigger a socket creation race some some kind). Checking for non-NULL socket
and credential is not a bad idea anyway. Unfortunatly too late for the
release.

Reported & tested by:	Gilbert Cao
MFC after:		2 weeks
2004-10-24 19:35:02 +00:00
Scott Long
7d9aed9c4c Fix some warnings that only triggered in LINT. 2004-10-24 09:23:07 +00:00
Scott Long
f01be89133 Embed the correct name. 2004-10-24 08:48:32 +00:00
Scott Long
1713e81b9c Import the HighPoint RocketRAID 182x driver. Thanks to HighPoint for
providing the original driver, and thanks to IronSystems for providing
hardware for testing.
2004-10-24 05:37:23 +00:00
Max Laier
d6a8d58875 Add an additional struct inpcb * argument to pfil(9) in order to enable
passing along socket information. This is required to work around a LOR with
the socket code which results in an easy reproducible hard lockup with
debug.mpsafenet=1. This commit does *not* fix the LOR, but enables us to do
so later. The missing piece is to turn the filter locking into a leaf lock
and will follow in a seperate (later) commit.

This will hopefully be MT5'ed in order to fix the problem for RELENG_5 in
forseeable future.

Suggested by:		rwatson
A lot of work by:	csjp (he'd be even more helpful w/o mentor-reviews ;)
Reviewed by:		rwatson, csjp
Tested by:		-pf, -ipfw, LINT, csjp and myself
MFC after:		3 days

LOR IDs:		14 - 17 (not fixed yet)
2004-09-29 04:54:33 +00:00
Max Laier
7ea7663ca4 Protect sockaddr_union definitions with a protecting define. This allows to
build kernels with FAST_IPSEC and PF. This is the least disruptive fix.

PR:		kern/71836
Reviewed by:	bms, various mailing lists
MFC after:	3 days
2004-09-23 12:44:40 +00:00
Max Laier
abd627ebb7 Break out altq_enable/disable from DIOC{START,STOP}ALTQ into seprate
functions that can be called from enable/disable pf as well. This improves
switching from non-altq ruleset to altq ruleset (and the other way 'round)
by a great deal and makes pfctl act like the user would except it to.

PR:		kern/71746
Tested by:	Aurilien "beorn" Rougemont (PR submitter)
MFC after:	3 days
2004-09-17 02:15:05 +00:00
Max Laier
4758aa2bd4 Reactivate skipping over bogus IPCP addresses on ppp interfaces. Be more
careful with the skip condition this time. Addresses are only not taken into
account if:
	- The interface is POINTTOPOINT
	- There is no route installed for the address
	- The user specified noalias (:0)
and	- We are looking at an IPv4 address.

This should be enough paranoia to not cause any false positives.

PR:	 	misc/69954
Discussed with:	yongari
MFC after:	4 days
2004-09-14 15:20:24 +00:00
Max Laier
f78086efb6 Move pf* init from SI_SUB_PSEUDO to SI_SUB_PROTO_IFATTACHDOMAIN where it is
save to call if_attachdomain from if_attach() (as done for if_loop.c). We
will now end up with a properly initialized if_afdata array and the nd6
callout will no longer try to deref a NULL pointer.

Still this is a temp workaround and the locking for if_afdata should be
revisited at a later point.

Requested by:			rwatson
Discussed with and tested by:	yongari (a while ago)
PR:				kern/70393
MFC after:			5 days
2004-09-14 03:12:01 +00:00
Max Laier
c9f6794e2e One more round on the H/W supported checksum code: Fix NICs that can't do
the pseudo header. We really need the TCP packet length here. This happens
to end up in ip->ip_len in tcp_input.c, but here we should get it from the
len function variable instead.

Submitted by:	yongari
Tested by:	Nicolas Linard, yongari (sparc64 + hme)
MFC after:	5 days
2004-09-11 11:18:25 +00:00
Andre Oppermann
5f56967319 From __FreeBSD_version 600001 on PFIL_HOOKS is permanently in the kernel and
doesn't require to include opt_pfil_hooks.h.
2004-08-27 20:01:08 +00:00
Max Laier
7fff37fc15 Use securelevel_gt instead of reading global securelevel unprotected.
Submitted by:	yongari
MFC after:	3 days
2004-08-22 15:23:48 +00:00
Nate Lawson
aaff1d4cfa Add a padding member to the header overlaid on data allocated in the
ACPI_DEBUG case.  Without this, use of allocated memory is unaligned and
causes a trap on ia64.  Intel may fix this differently in a subsequent
release but this is adequate for now.

Submitted by:	marcel
MFC after:	2 days
2004-08-18 05:41:21 +00:00
Nate Lawson
ca36a5dc0d This commit was generated by cvs2svn to compensate for changes in r133931,
which included commits to RCS files with non-trunk default branches.
2004-08-18 05:41:21 +00:00
Max Laier
e89d8405c7 Comment out rev. 1.4 after problems w/ IPv6, a better solution must be
found.
2004-08-16 17:58:12 +00:00
David Malone
1f44b0a1b5 Get rid of the RANDOM_IP_ID option and make it a sysctl. NetBSD
have already done this, so I have styled the patch on their work:

        1) introduce a ip_newid() static inline function that checks
        the sysctl and then decides if it should return a sequential
        or random IP ID.

        2) named the sysctl net.inet.ip.random_id

        3) IPv6 flow IDs and fragment IDs are now always random.
        Flow IDs and frag IDs are significantly less common in the
        IPv6 world (ie. rarely generated per-packet), so there should
        be smaller performance concerns.

The sysctl defaults to 0 (sequential IP IDs).

Reviewed by:	andre, silby, mlaier, ume
Based on:	NetBSD
MFC after:	2 months
2004-08-14 15:32:40 +00:00
Robert Watson
9baf5f2da1 Since if_oltr doesn't contain locking or run with INTR_MPSAFE, mark
the interface as IFF_NEEDSGIANT so if_start is run holding Giant.
2004-08-14 00:19:07 +00:00
Max Laier
571065e55f Loopback fix from Mathieu Sauve-Frankel:
Add missing check for NULL in DIOCCHANGERULE. This prevents a crash
	in certain rare cases.
2004-08-12 14:15:42 +00:00
Max Laier
01105bbf3b Loopback fix from Daniel Hartmeier:
pf_cksum_fixup() was called without last argument from
	normalization, also fixup checksum when random-id modifies ip_id.
	This would previously lead to incorrect checksums for packets
	modified by scrub random-id.

(Originally) Submitted by:	yongari
2004-08-12 13:59:44 +00:00
Max Laier
91a9e0b42b Loopback fix from Henning Brauer:
skip over interface addresses without IFA_ROUTE, fixes some issue
	with pppd

PR:	misc/69954
2004-08-12 13:54:50 +00:00
Hartmut Brandt
63fa1c3303 Exclusion list for easier import. 2004-08-11 12:25:09 +00:00
Hartmut Brandt
e42ab7cde1 Virgin import of NgATM shared kernel/user part 1.1 2004-08-11 12:21:36 +00:00
Hartmut Brandt
f3e103df9f This commit was generated by cvs2svn to compensate for changes in r133492,
which included commits to RCS files with non-trunk default branches.
2004-08-11 12:21:36 +00:00
Max Laier
8de5b6f306 Use in_cksum_skip() to calculate in4_cksum instead of doing handrolled magic
(that does not compile with !gcc). Moreover we get the benefit for all archs
that have a hand optimized in_cksum_skip().

Submitted by:	yongari
Tested by:	me (i386, extensivly), pf4freebsd ML (various)
2004-08-05 20:41:38 +00:00
Alexander Kabaev
7e86873d5c Initialize s variable early to shut up GCC warnings.
Do not declare inline functions without body as this is useless in
general and generates a warning with GCC 3.4.x.

Glanced over by:	dhartmei
2004-07-28 06:14:44 +00:00
Max Laier
c99c1da589 Fix the following LOR on pf module unload:
1st ifnet (ifnet) @/usr/src/sys/contrib/pf/net/pf_if.c:191
2nd pf task mtx (pf task mtx) @/usr/src/sys/contrib/pf/net/pf_if.c:197

Reported by:	Pyun YongHyeon (a long time ago)
2004-07-23 03:37:05 +00:00
Max Laier
bb73d87a1e Refine pf_check_proto_cksum() a bit in order to avoid additional in_pseudo()
calls further down the stack. If we find the cksum to be okay we pretend
that the hardware did all the work and hence keep the upper layers from
checking again.

Submitted by:	Pyun YongHyeon
2004-07-23 03:31:42 +00:00
Max Laier
e89865e516 Fix a stupid attemp to apply host arithmetics to network byte ordered data.
This fixes checksum for some drivers with partial H/W ckcsum offloads.

Reported by:	Simon 'corecode' Schubert, Devon H. O'Dell, hmp
Reviewed by:	Pyun YongHyeon
2004-07-18 14:25:48 +00:00
Max Laier
a9ce8750b6 m_tag_copy takes an additional "how" parameter in FreeBSD.
Submitted by:	rwatson
2004-07-18 00:51:56 +00:00
Max Laier
0ad9506fab Merge in a stable fix from OpenBSD:
MFC:
  Fix by dhartmei@

  change pf_route() loop detection: introduce a counter (number of times
  a packet is routed already) in the mbuf tag, allow at most four times.
  Fixes some legitimate cases broken by the previous change.

Reviewed by:	dhartmei
2004-07-17 17:15:15 +00:00
Max Laier
c550f2206d Define semantic of M_SKIP_FIREWALL more precisely, i.e. also pass associated
icmp_error() packets. While here retire PACKET_TAG_PF_GENERATED (which
served the same purpose) and use M_SKIP_FIREWALL in pf as well. This should
speed up things a bit as we get rid of the tag allocations.

Discussed with:	juli
2004-07-17 05:10:06 +00:00
Poul-Henning Kamp
3f4324df4d Send the fla driver in the Attic 2004-07-13 17:44:17 +00:00
Darren Reed
781950a42f Clean up a bunch of white-space difference with IPFilter source as well as
remove some superfluous assignments for .d_version/.d_flags in a cdevsw
structure initialisation that never sees the light of day in FreeBSD.
2004-07-11 10:13:05 +00:00
Hartmut Brandt
8339b15086 Virgin import of NgATM share kernel/user part 1.0 2004-07-08 16:39:03 +00:00
Hartmut Brandt
72767e9575 This commit was generated by cvs2svn to compensate for changes in r131826,
which included commits to RCS files with non-trunk default branches.
2004-07-08 16:39:03 +00:00
Mark Santcroos
bde5ba82c2 Local change: Allow access to the field if it is within the region
size rounded up to a multiple of the access byte width.  This overcomes
"off-by-one" programming errors in the AML often found in Toshiba
laptops.
2004-07-02 08:38:55 +00:00
Mark Santcroos
2e8f631a0d Local diff: allow use of the disassembler. 2004-07-02 08:37:56 +00:00
Mark Santcroos
727fde6f33 Unchanged files that are off the vendor branch. 2004-07-02 08:34:19 +00:00
Mark Santcroos
671d52d8aa Vendor import of Intel ACPI-CA 20040527 2004-07-02 08:14:36 +00:00
Mark Santcroos
648474d5f4 This commit was generated by cvs2svn to compensate for changes in r131440,
which included commits to RCS files with non-trunk default branches.
2004-07-02 08:14:36 +00:00
Darren Reed
be134cb640 Mess from update & merge - don't release the ifnet lock twice, just once
and after we're finished with it.
2004-06-29 03:39:06 +00:00
Brooks Davis
f889d2ef8d Major overhaul of pseudo-interface cloning. Highlights include:
- Split the code out into if_clone.[ch].
 - Locked struct if_clone. [1]
 - Add a per-cloner match function rather then simply matching names of
   the form <name><unit> and <name>.
 - Use the match function to allow creation of <interface>.<tag>
   vlan interfaces.  The old way is preserved unchanged!
 - Also the match function to allow creation of stf(4) interfaces named
   stf0, stf, or 6to4.  This is the only major user visible change in
   that "ifconfig stf" creates the interface stf rather then stf0 and
   does not print "stf0" to stdout.
 - Allow destroy functions to fail so they can refuse to delete
   interfaces.  Currently, we forbid the deletion of interfaces which
   were created in the init function, particularly lo0, pflog0, and
   pfsync0.  In the case of lo0 this was a panic implementation so it
   does not count as a user visiable change. :-)
 - Since most interfaces do not need the new functionality, an family of
   wrapper functions, ifc_simple_*(), were created to wrap old style
   cloner functions.
 - The IF_CLONE_INITIALIZER macro is replaced with a new incompatible
   IFC_CLONE_INITIALIZER and ifc_simple consumers use IFC_SIMPLE_DECLARE
   instead.

Submitted by:   Maurycy Pawlowski-Wieronski <maurycy at fouk.org> [1]
Reviewed by:    andre, mlaier
Discussed on:	net
2004-06-22 20:13:25 +00:00
Darren Reed
01dbed783b revert section of code that calls netisr_queue() to match v1.33 of this file 2004-06-22 05:20:30 +00:00
Darren Reed
5e9c7ec5dc #ifdef's for FreeBSD are wrong, causing too many variable declaractions to
disappear.
2004-06-22 05:16:29 +00:00
Darren Reed
27944d9422 one too many #endif's from the update broke the build 2004-06-22 02:44:06 +00:00
Darren Reed
7b807523f4 Update ipfilter from 3.4.31 -> 3.4.35. Some important changes:
* block packets that fail to create state table entries
* only allow non-fragmented packets to influence whether or not a logged
  packet is the same as the one logged before.
* correct the ICMP packet checksum fixing up when processing ICMP errors for NAT
* implement a maximum for the number of entries in the NAT table (NAT_TABLE_MAX
  and ipf_nattable_max)
* frsynclist() wasn't paying attention to all the places where interface
  names are, like it should.
* fix comparing ICMP packets with established TCP state where only 8 bytes
  of header are returned in the ICMP error.

MFC after:	1 week
2004-06-21 22:46:36 +00:00
Darren Reed
866bef8856 Import ipfilter 3.4.35 (destinated for RELENG_4) to vendor branch 2004-06-21 22:26:10 +00:00
Poul-Henning Kamp
cb5cb48675 Add missing <sys/module.h> include.
Approved by:	sam
2004-06-18 08:53:55 +00:00
Max Laier
c0d431fe31 Import two fixes from the OpenBSD stable branch:
- prevent an endless loop with route-to lo0, fixes PR 3736 (dhartmei@)
 - The rule_number parameter for pf_get_pool() needs to be 32 bits, not 8 -
   this fixes corruption of the address pools with large rulesets.
   (mcbride@, pb@)

Reviewed-by:	dhartmei
2004-06-17 16:59:47 +00:00
Max Laier
7c1fe95333 Commit pf version 3.5 and link additional files to the kernel build.
Version 3.5 brings:
 - Atomic commits of ruleset changes (reduce the chance of ending up in an
   inconsistent state).
 - A 30% reduction in the size of state table entries.
 - Source-tracking (limit number of clients and states per client).
 - Sticky-address (the flexibility of round-robin with the benefits of
   source-hash).
 - Significant improvements to interface handling.
 - and many more ...
2004-06-16 23:24:02 +00:00
Max Laier
779616355a This commit was generated by cvs2svn to compensate for changes in r130610,
which included commits to RCS files with non-trunk default branches.
2004-06-16 23:03:14 +00:00
Max Laier
32b3098356 Import pf from OpenBSD 3.5 (OPENBSD_3_5_BASE) 2004-06-16 23:03:14 +00:00
Poul-Henning Kamp
89c9c53da0 Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.
2004-06-16 09:47:26 +00:00
Max Laier
7421be0528 Disable "bulk dequeue" when enabling ALTQ so it does not irritate the
timing.
2004-06-15 23:59:37 +00:00
Max Laier
4cb655c020 Transform tbr_dequeue into a function pointer in order to build drivers with
ALTQ enabled versions of IFQ_* macros by default, as requested by serveral
others. This is a follow-up to the quick fix I committed yesterday which
turned off the ALTQ checks for non-ALTQ kernels.
2004-06-15 01:45:19 +00:00
Max Laier
4e6d06effe Remove some more leftover from the old pfaltq_module hack to allow for
kernels w/ pf, but w/o altq.

Reported-by:	 Xin LI
2004-06-14 16:13:05 +00:00
Max Laier
eb8fefbe04 #if out an old leftover in the KAME code. opt_cpu.h is no longer useful here
and breaks build on some arch.

Found-by:	tinderbox
2004-06-13 22:52:38 +00:00
Max Laier
cc4dbc7c7d Prepare pf for building with ALTQ:
- remove old pfaltq module linkage
 - move pfaltq_running to pf_ioctl.c It is protected by PF_LOCK()
2004-06-13 01:36:31 +00:00
Max Laier
6ef5ab3cb5 Add an additional queue which will be "owned by the driver". This allows to
rig a PREPEND macro for ALTQ as the POLL/DEQUEUE semantic is very bad in
terms of locking. We make this a full functional queue to allow "bulk
dequeue" which will further reduce the locking overhead (for non-altq
enabled devices). Drivers will access this via the following macros, which
will show up in <net/if_var.h> once we expose ALTQ to the build:

IFQ_DRV_DEQUEUE(ifq, m)	- takes a mbuf off the queue (driver queue first)
IFQ_DRV_PREPEND(ifq, m)	- pushes a mbuf back to the driver queue
IFQ_DRV_PURGE(ifq)	- drops all packets in both queues
IFQ_DRV_IS_EMPTY(ifq)	- checks for pending mbufs in either queue

One has to make sure that the first three are protected by a driver mutex.
At the moment most network drivers still require Giant, so this is not an
issue. Even those that have thier own mutex usually hold it in if_start and
the like, so this requirement is almost always satisfied.

This evolved from a discussion with Andrew Gallatin.
2004-06-12 18:47:24 +00:00
Max Laier
6d43605d86 FreeBSD-ify ALTQ:
- add locking
 - disable ALTQ3_COMPAT by default (do not remove the code to keep the diff
   towards KAME small)
 - put some more code under ALTQ3 conditional compilation as it should be
 - account for if_xname
 - some more minor compile fixes

As people started wondering:
The strange path layout "altq/altq" is there to avoid "-Isys/contrib" and
make it "-Isys/contrib/altq" instead, as we will need at least <altq/altq.h>
and <altq/if_altq.h> for kernel compilation.

The "freebsd4_..." in the privious commit is just the best tag name in the
KAME tree I could find to classify this in order to track its history. It
does *not* mean that this will go to 4-STABLE or anything of that kind.
2004-06-12 00:57:20 +00:00
Max Laier
4fd250c713 This commit was generated by cvs2svn to compensate for changes in r130365,
which included commits to RCS files with non-trunk default branches.
2004-06-12 00:10:21 +00:00
Max Laier
a2f5f9a397 Import parts of the ALTQ framework from latest KAME snapshot (which is up to
HEAD at this point). This will not exactly live in a vendor branch, but have
the vendor backing to make it easier to exchange diffs.

This will be followed by a diff which takes most of the .c files off the
vendor branch in order to:
 - add locking
 - disable ALTQ3_COMPAT code (which is outdated and "un-lockable")

There is work in progress to refine the configuration API. Import this "as
is" now to have more exposure time before 5-STABLE.

This is only the import, it will be some more days until you will actually
be able to compile ALTQ support into your kernel so don't hold your breath.
HEADUPs will be posted on current@ and net@ before this is actually enabled.

No-objection:	re(scottl), core(rwatson)
2004-06-12 00:10:21 +00:00
Darren Reed
578a650271 Recognise NOINET6 as an indication to not build IPv6 enabled source even
if FreeBSD header files, etc, support it.

Submitted by:	Sergey Mokryshev <mokr@mokr.net>
2004-06-08 23:52:22 +00:00
Max Laier
1fb675e712 "Get rid of the nested include of <sys/module.h> from <sys/kernel.h>" or
better do no longer depend on it.

Requested-by:	phk
Approved-by:	bms(mentor)
2004-05-31 22:48:19 +00:00
Poul-Henning Kamp
77409fe148 Add missing #include <sys/module.h> 2004-05-30 20:34:58 +00:00
Nate Lawson
0d224e7f88 Remove a warning of a constant that is too large. Change submitted to
vendor.
2004-05-25 03:06:37 +00:00
Nate Lawson
a86c577a6d This commit was generated by cvs2svn to compensate for changes in r129694,
which included commits to RCS files with non-trunk default branches.
2004-05-25 03:06:37 +00:00
Nate Lawson
275c8028ab Local change: allow usermode to compile this header. Submitted to vendor. 2004-05-25 02:41:49 +00:00
Nate Lawson
0c3e6e7452 Local change: don't hang forever if WAK_STS is never set. 2004-05-25 02:41:19 +00:00
Nate Lawson
c2c6addc68 Local change: remove warnings. 2004-05-25 02:40:48 +00:00
Nate Lawson
4ace1857d7 Local diff: allow use of the disassembler. 2004-05-25 02:39:46 +00:00
Nate Lawson
6c57d4e8fb Unchanged files that are off the vendor branch. 2004-05-25 02:39:01 +00:00
Nate Lawson
a5a81f7c89 Vendor import of Intel ACPI-CA 20040514. 2004-05-25 02:34:44 +00:00
Nate Lawson
d57f8354ca This commit was generated by cvs2svn to compensate for changes in r129684,
which included commits to RCS files with non-trunk default branches.
2004-05-25 02:34:44 +00:00
Marcel Moolenaar
9cc6463a07 Update to BETA 7. Besides C++ support, which is irrelevant to us,
this version mostly has bugs fixes.
2004-05-09 03:06:25 +00:00
Marcel Moolenaar
203bd0c3e7 This commit was generated by cvs2svn to compensate for changes in r129059,
which included commits to RCS files with non-trunk default branches.
2004-05-09 03:06:25 +00:00
Nate Lawson
c3bac8b5d5 Add sys/types.h for both kernel and user compiles. 2004-05-05 20:02:02 +00:00
Daniel Hartmeier
01044eaadc Commit three imported bugfixes from OpenBSD 3.4-stable:
- change pf_get_pool() argument rule_number type from u_int32_t
    to u_int8_t, fixes corruption of address pools with large
    rulesets (mcbride@)
  - prevent endless loops with route-to (dhartmei@)
  - limit option length to 2 octets max (frantzen@)

Obtained from:	OpenBSD
Approved by:	mlaier(mentor), bms(mentor)
2004-05-02 20:47:24 +00:00
Daniel Hartmeier
ac529e0479 Import OpenBSD 3.4-stable fixes 2004-05-02 19:43:28 +00:00
Nate Lawson
eccb3e0e14 Remove warnings from vendor files. This takes some files off the vendor
branch but they have indicated they will not fix these warnings.
2004-04-14 18:12:29 +00:00
Nate Lawson
95ee367419 Even though the patch has been submitted to the vendor, this file is off
the vendor branch.  Once more, with feeling!
2004-04-14 16:52:19 +00:00
Nate Lawson
5391902bdf Only avoid disabling bus mastering on the sleep path. This should fix
power off for some users.  The patch has been submitted to Intel.

Bug:	http://bugme.osdl.org/show_bug.cgi?id=2109
2004-04-14 16:50:32 +00:00
Nate Lawson
aa87b3ef75 Check in files with local changes:
* In the resume path, give up after waiting for a while
for WAK_STS to be set.  Some BIOSs never set it.

* Allow access to the field if it is within the region size rounded
up to a multiple of the access byte width.  This overcomes "off-by-one"
programming errors in the AML often found in Toshiba laptops.
2004-04-14 02:17:00 +00:00
Nate Lawson
ea905c360c Check in unmodified files off the vendor branch. 2004-04-14 02:14:51 +00:00
Nate Lawson
e0ef747b89 Import ACPI-CA 20040402 distribution. 2004-04-14 02:10:27 +00:00
Nate Lawson
630c18309b This commit was generated by cvs2svn to compensate for changes in r128212,
which included commits to RCS files with non-trunk default branches.
2004-04-14 02:10:27 +00:00
Nate Lawson
ba551b7d6b Add another cleanfile for future imports. 2004-04-14 02:03:33 +00:00
Brooks Davis
bb2bfb4fa9 Staticize <if>_clone_{create,destroy} functions.
Reviewed by:	mlaier
2004-04-14 00:57:49 +00:00
Max Laier
00e7fbfb60 Commit import of OpenBSD-stable fix:
Fix by dhartmei@ and mcbride@
 1.433
 Properly m_copyback() modified TCP sequence number after demodulation
 1.432
 Fix icmp checksum when sequence number modlation is being used.
 Also fix a daddr vs saddr cut-n-paste error in ICMP error handling.

 Fixes PR 3724

Obtained from:	OpenBSD
Reviewed by:	dhartmei
Approved by:	rwatson
2004-04-11 17:35:40 +00:00
Max Laier
f43690eb9e Import another fix from the OpenBSD-Stable branch:
Fix by dhartmei@ and mcbride@
 1.433
 Properly m_copyback() modified TCP sequence number after demodulation
 1.432
 Fix icmp checksum when sequence number modlation is being used.
 Also fix a daddr vs saddr cut-n-paste error in ICMP error handling.

 Fixes PR 3724
2004-04-11 17:28:22 +00:00
Warner Losh
f36cfd49ad Remove advertising clause from University of California Regent's
license, per letter dated July 22, 1999 and email from Peter Wemm,
Alan Cox and Robert Watson.

Approved by: core, peter, alc, rwatson
2004-04-07 20:46:16 +00:00
Nate Lawson
b3d0ea94b1 Unbreak the bootloader build by excluding ctype.h.
Submitted by:	Stefan Farfeleder <stefan@fafoe.narf.at>
2004-04-05 17:30:15 +00:00
Nate Lawson
66f8ce8f20 Add #include for ctype.h to cover strupr() in the !_KERNEL case.
Submitted by:	Stefan Farfeleder <stefan@fafoe.narf.at>
2004-04-05 04:03:09 +00:00
Max Laier
eaa7035b13 Shut up a couple of annoying gcc warnings. Do not enclose the fixes with
#ifdefs in order to loop it back to OpenBSD after the next import. There are
a some implicit asserts involved which might be better spelled out
explicitly (af == AF_INET ...)

Approved by:	bms(mentor)
2004-03-30 18:28:30 +00:00
Warner Losh
3666cedd6b Eliminate support for FreeBSD 3.x and earlier now that we're in the
glide path for the 5.x branch.
2004-03-29 21:10:05 +00:00
Max Laier
cf5011b74a Commit two fixes from OpenBSD's stable branch:
- Fix binat for incoming connections when a netblock (not just a single
  address) is used for source in the binat rule. closes PR 3535, reported by
  Karl O.Pinc. ok henning@, cedric@

- Fix a problem related to empty anchor rulesets, which could cause a kernel
  panic.

Approved by:	bms(mentor)
2004-03-28 20:04:12 +00:00
Max Laier
b855d39384 Import two fixes from OpenBSD's stable branch:
- Fix binat for incoming connections when a netblock (not just a single
  address) is used for source in the binat rule. closes PR 3535, reported by
  Karl O.Pinc. ok henning@, cedric@

- Fix a problem related to empty anchor rulesets, which could cause a kernel
  panic.

Approved by:	bms(mentor)
2004-03-28 19:31:37 +00:00
Nate Lawson
bf4c71fd65 Revert 1.22. Go back to "FreeBSD" as our _OS value. Since we now support
_OSI, we can claim compatibility with MS products without claiming to BE
one.  :-)
2004-03-22 20:11:49 +00:00
Nate Lawson
fce89338bf Check in files off the vendor branch as well as files with local patches. 2004-03-18 17:46:27 +00:00
Nate Lawson
731de42fc8 Import of Intel ACPI-CA 20040311. 2004-03-18 17:42:14 +00:00
Nate Lawson
55545f899c This commit was generated by cvs2svn to compensate for changes in r127175,
which included commits to RCS files with non-trunk default branches.
2004-03-18 17:42:14 +00:00
Max Laier
cc7e902276 Style(9) round for the pf kernel parts. Mostly #if defined() -> #ifdef
Also set HOOK_HACK to true (remove the related #ifdef's) as we have the
hooks in the kernel this was missed during the merge from the port.

Noticed by:	Amir S.	(for the HOOK_HACK part)
Approved by:	bms(mentor)
2004-03-17 21:11:02 +00:00
Nate Lawson
5f96beb9e0 Convert callers to the new bus_alloc_resource_any(9) API.
Submitted by:	Mark Santcroos <marks@ripe.net>
Reviewed by:	imp, dfr, bde
2004-03-17 17:50:55 +00:00
Max Laier
7b3832e8d6 Remove `$Name$' leftovers from the port version reporting.
Noticed by:	Craig Rodrigues
Approved by:	bms(mentor)
2004-03-10 15:08:21 +00:00
Nate Lawson
d64168a5a2 Part 2 of Project Evil: Pretend to be Windows 2000 for buggy ASL that
always expects to be running on some MS OS.  A survey of ASL shows that
this is the 2nd most common expected OS value.  (1st is Win98 and we don't
emulate its buggy ACPI support.)  Our ACPI support is similar to Win2k,
also.  Put this behavior under ACPICA_PEDANTIC so we can get back to our
previous behavior for OSV testing.
2004-03-04 05:57:41 +00:00
Nate Lawson
31b8e5b3b6 Remove these on the vendor branch as we no longer import them (and some
were never used).

CVS surgery credit:	joe
2004-03-03 05:47:09 +00:00
Nate Lawson
6d0267157c This commit was generated by cvs2svn to compensate for changes in r126520,
which included commits to RCS files with non-trunk default branches.
2004-03-03 05:47:09 +00:00
Max Laier
01315efca3 Remove __inline keyword from functions that can't be inlined according to
LINT. This fixes LINT compliation for now, but needs to be revised.
Changes do not affect the objects.

Approved by:	bms(mentor)
2004-02-29 16:34:43 +00:00
Nate Lawson
2676fbe88c Strip out new, unused file acnetbsd.h 2004-02-28 20:56:25 +00:00
Nate Lawson
0161891aa1 Fix an off-by-one in the compiler path. Originally from iwasaki-san's
patches for the pmtools port.  This change has been submitted to Intel.
2004-02-28 20:42:10 +00:00
Nate Lawson
fd73230997 This commit was generated by cvs2svn to compensate for changes in r126380,
which included commits to RCS files with non-trunk default branches.
2004-02-28 20:42:10 +00:00
Nate Lawson
4c80f45557 Local change: emulate a ReturnOp if the AML expects one but it isn't
present.  Some buggy BIOSs do not have a ReturnOp even though it is
required for a function to return a value.
2004-02-28 20:40:24 +00:00
Nate Lawson
e222f620d1 Local change: In the resume path, give up after waiting for a while
for WAK_STS to be set.  Some BIOSs never set it.
2004-02-28 20:39:50 +00:00
Nate Lawson
56491b7ba0 Local change: Allow access to the field if it is within the region
size rounded up to a multiple of the access byte width.  This overcomes
"off-by-one" programming errors in the AML often found in Toshiba
laptops.
2004-02-28 20:39:09 +00:00
Nate Lawson
7420bf68bb Local change: Put various debugging options under ACPI_DISASSEMBLER. 2004-02-28 20:38:40 +00:00
Nate Lawson
96f2784ee5 Unchanged files from ACPICA 20040220 that are off the vendor branch. 2004-02-28 20:35:57 +00:00
Nate Lawson
2a2a3f2735 Vendor import of ACPICA 20040220 2004-02-28 20:23:30 +00:00
Nate Lawson
6a5f0d2f49 This commit was generated by cvs2svn to compensate for changes in r126372,
which included commits to RCS files with non-trunk default branches.
2004-02-28 20:23:30 +00:00
Max Laier
cc5934f5af Tweak existing header and other build infrastructure to be able to build
pf/pflog/pfsync as modules. Do not list them in NOTES or modules/Makefile
(i.e. do not connect it to any (automatic) builds - yet).

Approved by: bms(mentor)
2004-02-26 03:53:54 +00:00
Max Laier
2bbe8ffc9d Bring diff from the security/pf port. This has code been tested as a port
for a long time and is run in production use. This is the code present in
portversion 2.03 with some additional tweaks.

The rather extensive diff accounts for:
 - locking (to enable pf to work with a giant-free netstack)
 - byte order difference between OpenBSD and FreeBSD for ip_len/ip_off
 - conversion from pool(9) to zone(9)
 - api differences etc.

Approved by: bms(mentor) (in general)
2004-02-26 02:34:12 +00:00
Max Laier
5c45a928b9 Vendor import of OpenBSD's packet filter (pf) as of OpenBSD 3.4
Approved by: bms(mentor), core (in general)
2004-02-26 02:04:28 +00:00
Max Laier
3ef891af51 This commit was generated by cvs2svn to compensate for changes in r126258,
which included commits to RCS files with non-trunk default branches.
2004-02-26 02:04:28 +00:00
Poul-Henning Kamp
dc08ffec87 Device megapatch 4/6:
Introduce d_version field in struct cdevsw, this must always be
initialized to D_VERSION.

Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing
four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
2004-02-21 21:10:55 +00:00
Poul-Henning Kamp
0b7ed341e1 Change the disk(9) API in order to make device removal more robust.
Previously the "struct disk" were owned by the device driver and this
gave us problems when the device disappared and the users of that device
were not immediately disappearing.

Now the struct disk is allocate with a new call, disk_alloc() and owned
by geom_disk and just abandonned by the device driver when disk_create()
is called.

Unfortunately, this results in a ton of "s/\./->/" changes to device
drivers.

Since I'm doing the sweep anyway, a couple of other API improvements
have been carried out at the same time:

The Giant awareness flag has been flipped from DISKFLAG_NOGIANT to
DISKFLAG_NEEDSGIANT

A version number have been added to disk_create() so that we can detect,
report and ignore binary drivers with old ABI in the future.

Manual page update to follow shortly.
2004-02-18 21:36:53 +00:00
Nate Lawson
b88cf1027b When creating a package element via "Store(0xXXX, Index(ArgX, 0xXXX))",
be sure to increment the refcount of the argument so it is not
prematurely deleted.  This is a workaround and may appear in a different
form in ACPI-CA.  This fixes battery evaluation on Thinkpads that was
broken by fixing the Dell battery state.

Submitted by:	Luming Yu <luming.yu@intel.com>
2004-01-14 18:54:22 +00:00
Nate Lawson
2cb740cc11 This commit was generated by cvs2svn to compensate for changes in r124528,
which included commits to RCS files with non-trunk default branches.
2004-01-14 18:54:22 +00:00
Nate Lawson
59cb1d160c Fix for "UtAllocate: Attempt to allocate zero bytes" warnings on Dell
laptops that resulted in problems reading battery status.  Don't
copy Buffers, Packages, or Regions in DsStoreObjectToLocal().

Tested by:	scottl, sam
Submitted by:	Luming Yu (Intel)
2004-01-04 06:35:01 +00:00
Nate Lawson
9ca39f70b1 This commit was generated by cvs2svn to compensate for changes in r124120,
which included commits to RCS files with non-trunk default branches.
2004-01-04 06:35:01 +00:00
Nate Lawson
99d3ab068f Changes to the import script to handle the compiler/debugger import. 2003-12-09 03:13:37 +00:00
Nate Lawson
fe2e9bd26c Fix an off-by-one in the compiler path. Originally from iwasaki-san's
patches for the pmtools port.
2003-12-09 03:11:40 +00:00
Nate Lawson
4d304b42df This commit was generated by cvs2svn to compensate for changes in r123331,
which included commits to RCS files with non-trunk default branches.
2003-12-09 03:11:40 +00:00
Nate Lawson
2dfad8a854 Eliminate a warning. Patch has been sent to the vendor. 2003-12-09 03:06:28 +00:00
Nate Lawson
90d4766d51 This commit was generated by cvs2svn to compensate for changes in r123329,
which included commits to RCS files with non-trunk default branches.
2003-12-09 03:06:28 +00:00
Nate Lawson
f5f92fb181 Add the APIC_HEADER definition back in and use the correct definition
for local APIC override (64 bits).  Changes have been submitted to the
vendor.
2003-12-09 03:06:09 +00:00
Nate Lawson
b8a1658528 This commit was generated by cvs2svn to compensate for changes in r123327,
which included commits to RCS files with non-trunk default branches.
2003-12-09 03:06:09 +00:00
Nate Lawson
2d4c34274d Unchanged files that are off the vendor branch. 2003-12-09 03:00:55 +00:00
Nate Lawson
3a3f40629a Local change: In the resume path, give up after waiting for a while
for WAK_STS to be set.  Some BIOSs never set it.
2003-12-09 02:57:46 +00:00
Nate Lawson
7fc6af078c Import for 20031203 file off vendor branch. 2003-12-09 02:57:30 +00:00
Nate Lawson
aba5e23de1 Local change: emulate a ReturnOp if the AML expects one but it isn't
present.  Some buggy BIOSs do not have a ReturnOp even though it is
required for a function to return a value.
2003-12-09 02:55:47 +00:00
Nate Lawson
552bf8f4e2 Local change: Allow access to the field if it is within the region
size rounded up to a multiple of the access byte width.  This overcomes
"off-by-one" programming errors in the AML often found in Toshiba
laptops.
2003-12-09 02:54:47 +00:00
Nate Lawson
f5fccb1dda Local change: Put various debugging options under ACPI_DISASSEMBLER. 2003-12-09 02:51:09 +00:00
Nate Lawson
dee7748c35 Unchanged files that are off the vendor branch. 2003-12-09 02:48:38 +00:00
Nate Lawson
e50beb517d Import ACPI-CA 20031203 2003-12-09 02:45:16 +00:00
Nate Lawson
2afe25109b This commit was generated by cvs2svn to compensate for changes in r123315,
which included commits to RCS files with non-trunk default branches.
2003-12-09 02:45:16 +00:00
Nate Lawson
4f023945ac Remove files on the vendor branch that we no longer use. Some are no longer
distributed with ACPI-CA.  Note that all of these have been gone from HEAD
since 20030228.
2003-12-09 02:29:59 +00:00
Sam Leffler
586a7cc9c2 Version 0.9.6.3:
o relax analog radio hardware revision checking for 5212 cards
  so newer revs are allowed to attach
2003-12-07 04:07:35 +00:00
Sam Leffler
aea8889fc4 This commit was generated by cvs2svn to compensate for changes in r123202,
which included commits to RCS files with non-trunk default branches.
2003-12-07 04:07:35 +00:00
Brooks Davis
bd59f56d42 Use parens more reasionably so we match the vendor code. This is part
of the if_xname change.

Submitted by:	darrenr
Approved by:	re (scottl)
2003-12-02 18:28:00 +00:00
Sam Leffler
f668bdbdb5 Version 0.9.6.1:
o support for 5112 and 2112 radios on 5212-based products
o revised interface for ah_procRxDesc needed to handle a race
  condition created with the use of self-linked rx descriptors
o support for setting the MAC address
o remove some unused methods from the public API
o revised diagnostic API (replace dump* methods with getDiagState)
o const'ify set key cache method parameters
o support for optional 32khz sleep clock
o implement ah_setSlotTime for 5211 parts
o ANI improvements for 5212 parts

Approved by:    re (scottl)
2003-11-29 01:11:48 +00:00
Sam Leffler
ddbe8403a5 This commit was generated by cvs2svn to compensate for changes in r123041,
which included commits to RCS files with non-trunk default branches.
2003-11-29 01:11:48 +00:00
Nate Lawson
7158f454ee Commit rev 1.1.1.20 to HEAD. This file was off the vendor branch and thus
the changes need to be made to HEAD.

Approved by:	re (previously)
2003-11-22 00:48:08 +00:00
Nate Lawson
beb443da7a Update code for checking the reference count and performing the final
delete of objects.  Also revert our temporary workaround in dsmthdat.c
that always copied objects.  This is the correct fix for errors
evaluating _BST (and GBST) on IBM Thinkpads where an argument (Arg3)
was returned to the caller and the object was freed while still in use.
This will be in a future ACPI-CA dist.

Thanks to:	kochi@netbsd.org, shaohua.li@intel.com
2003-11-21 21:24:31 +00:00
Nate Lawson
f4275c3682 This commit was generated by cvs2svn to compensate for changes in r122945,
which included commits to RCS files with non-trunk default branches.
2003-11-21 21:24:31 +00:00
Nate Lawson
847c562d46 Add the byte offset to the base address for IndexField objects. This
fixes an interrupt storm for certain users.  This is done on the vendor
branch since the code is already in the 20031029 ACPI-CA dist and will
be imported after 5.2R.

Tested by:	sebastian ssmoller <sebastian.ssmoller@gmx.net>
PR:		i386/57909
Approved by:	re (jhb)
2003-11-21 21:21:17 +00:00
Hartmut Brandt
8573f7621e Re-import of the original NgATM file version 0.91 2003-11-07 08:54:27 +00:00
Hartmut Brandt
8c9ce72809 This commit was generated by cvs2svn to compensate for changes in r122208,
which included commits to RCS files with non-trunk default branches.
2003-11-07 08:54:27 +00:00
Hartmut Brandt
e2251c375b These two files are generated with the ../genfiles script and are
not part of the imported distribution.
2003-11-07 08:48:43 +00:00
Hartmut Brandt
22e2dd6a2d Virgin import of signaling layer of NgATM shared kernel/user part 0.91 2003-11-07 08:46:22 +00:00
Hartmut Brandt
7d78b3681e This commit was generated by cvs2svn to compensate for changes in r122205,
which included commits to RCS files with non-trunk default branches.
2003-11-07 08:46:22 +00:00
Nate Lawson
0e4c356acf Fix a bug in iasl(8) that caused it to core dump while parsing a DSDT
on ia64.  The bug is present in i386 as well but didn't show up due to
more relaxed page protections.  This fix has been submitted to the vendor.

Submitted by:	marcel
2003-11-05 20:51:25 +00:00
Nate Lawson
64e353a082 This commit was generated by cvs2svn to compensate for changes in r122137,
which included commits to RCS files with non-trunk default branches.
2003-11-05 20:51:25 +00:00
Hartmut Brandt
5ba1bf11b6 Explain how to handle the generated files. Explain that the import
must actually be done into the netnatm sub-directory.
2003-11-03 09:15:31 +00:00
Hartmut Brandt
29d5d9a8a7 These files are generated by the genfiles script. See FREEBSD-upgrade
for instructions how to upgrade these.
2003-11-03 09:11:53 +00:00
Hartmut Brandt
3224b86e51 Virgin import of NgATM shared kernel/user part 0.91 2003-11-03 09:05:49 +00:00
Hartmut Brandt
3d4b19bb29 This commit was generated by cvs2svn to compensate for changes in r121934,
which included commits to RCS files with non-trunk default branches.
2003-11-03 09:05:49 +00:00
Sam Leffler
eaf6a10849 Version 0.9.5.17:
o change os glue API to be compatible with Linux so hal.o's can
  be used on any system
o add ABI version to catch driver-HAL mismatches
o move hal version information from ah_osdep.c to binary component
o remove ath_hal_wait os glue component
o assign constant values to all enums to avoid potential compiler
  incompatibilities
o add support for 3Com badged cards (PCI vendor ID)
o add support for IBM mini-pci cards (PCI device ID)
o expose MAC, PHY, and radio hardware revisions
o support for big-endian platforms
o new method to set slot time in us
o bug fix for 5211: beacon timers not setup correctly
o bug fix for 5212: don't crash when handed a 5112 radio
2003-11-01 03:19:51 +00:00
Sam Leffler
d0342231f9 This commit was generated by cvs2svn to compensate for changes in r121837,
which included commits to RCS files with non-trunk default branches.
2003-11-01 03:19:51 +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
Marcel Moolenaar
c2b1cc6d02 Import beta6 of libuwx. This release has some minor fixes and
some minor corrections to beta5.
2003-10-29 04:25:17 +00:00
Marcel Moolenaar
4765b7e51a This commit was generated by cvs2svn to compensate for changes in r121642,
which included commits to RCS files with non-trunk default branches.
2003-10-29 04:25:17 +00:00
Nate Lawson
dc0b8f8933 Allow access to the field if it is within the region size rounded up
to a multiple of the access byte width.  This overcomes errors in the
AML often found in Toshiba laptops.  These errors were allowed by
the Microsoft ASL compiler and interpreter.  This will NOT be imported
by ACPI-CA so make the change on our local branch.  File was already off
the vendor branch.

Submitted by:	blaz
Original idea:	Rick Richardson for Linux
2003-10-22 22:30:57 +00:00
Hartmut Brandt
a919999bd9 Some upgrade instructions. 2003-10-22 07:44:45 +00:00
Hartmut Brandt
8711ce79a7 Virgin import of the NgATM SAAL layer shared kernel/user part v0.9. 2003-10-22 07:41:16 +00:00
Hartmut Brandt
9d5fb541c6 This commit was generated by cvs2svn to compensate for changes in r121326,
which included commits to RCS files with non-trunk default branches.
2003-10-22 07:41:16 +00:00
Hajimu UMEMOTO
11e6ffbea3 use ND_IFINFO(). 2003-10-17 20:20:14 +00:00
Marcel Moolenaar
c7f58afc39 Upgrade Unwind Express (libuwx) to BETA 5. This upgrade includes
all the fixes locally applied and submitted to the author. Not
included in BETA 5, but part of this import are:
o  FreeBSD specific ifdefs to make this compile within a kernel.
   These are limited to include directives and defines.
o  Removal of unused variables, proper casts and initializations
   to allow building with -Werror. This happens in code so has a
   higher chance of causing future import conflicts but not enough
   to worry about it.

I'm especially thankful that the author accepted the change to
replace DISABLE_TRACE with UWX_TRACE_ENABLE so that we can use it
in kernel config files without nasty mappings or indirections as
that would make the integration less perfect. Thanks Cary!
2003-10-09 03:02:46 +00:00
Marcel Moolenaar
734fc6cafd This commit was generated by cvs2svn to compensate for changes in r120925,
which included commits to RCS files with non-trunk default branches.
2003-10-09 03:02:46 +00:00
Sam Leffler
e547d9ace2 o remove extraneous include of <net/pfil.h>
o guard wrapper code against user-mode compilation

Sponsored by:	FreeBSD Foundation
2003-09-24 05:08:58 +00:00
Sam Leffler
3fe1b4f5df update to reflect PFIL_HOOKS api changes
Supported by:	FreeBSD Foundation
2003-09-23 17:55:04 +00:00
Nate Lawson
050b6a0427 Fix an overflow in the resource list code for Address16, 32, 64, and
extended irq lists.  If the resource has a trailing byte but not the full
resource string, do not attempt to parse the resource string.  This fixes
panics on transition to battery and shutdown for Larry.  Patch has been
submitted to vendor and they will incorporate in next release.

Tested by:	Larry Rosenman <ler@lerctr.org>
PR:		kern/56254
2003-09-19 19:08:55 +00:00
Nate Lawson
b5155e8fbc This commit was generated by cvs2svn to compensate for changes in r120239,
which included commits to RCS files with non-trunk default branches.
2003-09-19 19:08:55 +00:00
Warner Losh
5ccace6f2c 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 15:28:22 +00:00
Nate Lawson
3b8fe955eb Fix a few more s/UINT32/ACPI_SIZE issues. iasl and acpidb now build on
ia64.

Tested on:	pluto2
Pointed out by:	tinderbox
2003-08-12 04:56:45 +00:00