Commit Graph

44739 Commits

Author SHA1 Message Date
Bill Paul
ed880bb60f Convert from using taskqueue_swi to using private kernel threads. The
problem with using taskqueue_swi is that some of the things we defer
into threads might block for up to several seconds. This is an unfriendly
thing to do to taskqueue_swi, since it is assumed the taskqueue threads
will execute fairly quickly once a task is submitted. Reorganized the
locking in if_ndis.c in the process.

Cleaned up ndis_write_cfg() and ndis_decode_parm() a little.
2004-01-18 22:57:11 +00:00
Maxim Sobolev
4168deefd6 Add new CPU_ENABLE_TCC option, from NOTES:
CPU_ENABLE_TCC enables Thermal Control Circuitry (TCC) found in some
Pentium(tm) 4 and (possibly) later CPUs. When enabled and detected,
TCC allows to restrict power consumption by using machdep.cpuperf*
sysctls. This operates independently of SpeedStep and is useful on
systems where other mechanisms such as apm(4) or acpi(4) don't work.

Given the fact that many, even modern, notebooks don't work properly
with Intel ACPI, this is indeed very useful option for notebook owners.

Obtained from:  OpenBSD
MFC after:      2 weeks
2004-01-18 21:18:00 +00:00
Maxim Sobolev
e7846ad79e Add new CPU_ENABLE_TCC option, from NOTES:
CPU_ENABLE_TCC enables Thermal Control Circuitry (TCC) found in some
Pentium(tm) 4 and (possibly) later CPUs. When enabled and detected,
TCC allows to restrict power consumption by using machdep.cpuperf*
sysctls. This operates independently of SpeedStep and is useful on
systems where other mechanisms such as apm(4) or acpi(4) don't work.

Given the fact that many, even modern, notebooks don't work properly
with Intel ACPI, this is indeed very useful option for notebook owners.

Obtained from:	OpenBSD
MFC after:	2 weeks
2004-01-18 21:06:56 +00:00
Yaroslav Tykhiy
a4e16ddd8d A network interface driver can support IFCAP_VLAN_MTU only,
without IFCAP_VLAN_HWTAGGING.  The previous version of the
leading comment in this file could lead to the opposite conclusion.

Fix some typos in the comment as well.
2004-01-18 19:29:04 +00:00
Ruslan Ermilov
7287c40c0d Fixed a memory leak.
Reported by:	Stanford Metacompilation research group
Reviewed by:	scottl
2004-01-18 17:34:11 +00:00
Ruslan Ermilov
bbc712e6ba Fixed a memory leak. 2004-01-18 17:21:15 +00:00
Ruslan Ermilov
4c7ca6e54c Fixed a memory leak.
Reported by:	Stanford Metacompilation research group
2004-01-18 16:55:01 +00:00
Søren Schmidt
61016883ad Fix botch in last commit. 2004-01-18 15:58:30 +00:00
Ruslan Ermilov
0541040c46 Since "m" is not part of the "mp" chain, need to free() it.
Reported by:	Stanford Metacompilation research group
2004-01-18 14:02:53 +00:00
Ruslan Ermilov
ebbdb48fe6 Apparently there's a good reason why M_WAITOK malloc() is done before
xpt_create_path().
2004-01-18 13:09:38 +00:00
Ruslan Ermilov
85e17c603d Fixed a memory leak.
Reported by:	Stanford Metacompilation research group
2004-01-18 12:49:36 +00:00
MIHIRA Sanpei Yoshiro
edac5229ae Empty vendor string overrides knowndevs
ubd_devinfo_vp() is getting an empty string from its  usbd_get_string()
call on the vendor, instead of NULL.  This means usb_knowndevs in not
consulted.

Add lines between grabbing those char *s and the USBVERBOSE ifdef to
set vendor to NULL if it is the empty string (similarly for product).

This causes vendor to be filled-out, although the product name read
overrules usb_knowndevs (this appears to be a conscience decision made
by the NetBSD folks):

PR:		kern/56097
Submitted by:	Hal Burch <hburch@lumeta.com>
MFC after:	1 week
2004-01-18 12:46:19 +00:00
Ruslan Ermilov
703981ae28 Fixed a memory leak.
Submitted by:	Stanford Metacompilation research group
2004-01-18 12:32:06 +00:00
Ruslan Ermilov
b659f64e82 Fixed a memory leak.
Submitted by:	Stanford Metacompilation research group
2004-01-18 12:26:33 +00:00
Søren Schmidt
7c633af872 Add missing free's. 2004-01-18 10:50:40 +00:00
Yaroslav Tykhiy
6bb87e74a6 Avoid overwriting capability bits marked earlier
when setting HW checksum offload bits.

Enable available capabilities properly.

Reviewed by:	sam
2004-01-18 10:15:48 +00:00
MIHIRA Sanpei Yoshiro
dd4350b4a7 Pay attention to the timeout value passed down by the upper layer.
(NetBSD src/sys/dev/usb/umass.c rev.1.67)

PR:		kern/58649 (Problem 1)
Submitted by:	SAKIYAMA Nobuo <sakichan@sakichan.org>
MFC after:	1 week
2004-01-18 09:19:53 +00:00
MIHIRA Sanpei Yoshiro
3121d08f99 Sync to 1.158 of usbdevs 2004-01-18 09:04:57 +00:00
MIHIRA Sanpei Yoshiro
a4a37c3010 add device id for PANASONIC KXLRW32AN(USB CD-R/RW,not yet support) 2004-01-18 08:02:34 +00:00
Alan Cox
c19aa3402b Increase UMA_BOOT_PAGES because of changes to pv entry initialization in
revision 1.457 of i386/i386/pmap.c.
2004-01-18 05:51:06 +00:00
Yoshihiro Takahashi
c9a7784cc7 PC98 uses the different frame code. 2004-01-18 04:13:27 +00:00
Yoshihiro Takahashi
2b0292a5ae Fix to support KANA and graphics characters which code are over 0x80. 2004-01-18 04:10:45 +00:00
Alan Cox
23b186d324 Don't acquire Giant in vm_object_deallocate() unless the object is vnode-
backed.
2004-01-18 03:44:14 +00:00
Johan Karlsson
8004412590 Fix type in comment, 's/writtent/written/'
PR:		56954
Submitted by:	Dan Langille <dan@langille.org>
2004-01-18 00:17:14 +00:00
Søren Schmidt
74a1b9fccf Add support for the Silicon Image 3114 4 channel SATA controller. 2004-01-17 23:34:13 +00:00
Warner Losh
70be398070 It appears that the changes in the resources allocated is causing much
pain and suffering.  Attempt to back it out by removing the 'if the
requested range is larger than the window, clip to the window' code.
This is a band-aide until the issues are better understood and the
issues with the lazy allocation patches are resolved.
2004-01-17 21:54:04 +00:00
Alfred Perlstein
95f94a7ff7 Don't panic because of RPC proto mismatches. Whitespace cleanup.
Submitted by: Jim Rees <rees@umich.edu>
2004-01-17 21:25:05 +00:00
Andrew Gallatin
1c318b9665 Handle sf_buf_alloc() returning null. This can happen if the
process takes a signal while waiting for an sf_buf to become available.

Reviewed by: alc
2004-01-17 21:16:51 +00:00
Poul-Henning Kamp
37f0ad870c remove elan_mmcr, I'm not sure I understand what it did here in the
first place.
2004-01-17 13:13:48 +00:00
Poul-Henning Kamp
5e289f9eb6 Mostly mechanical rework of libalias:
Makes it possible to have multiple packet aliasing instances in a
single process by moving all static and global variables into an
instance structure called "struct libalias".

Redefine a new API based on s/PacketAlias/LibAlias/g

Add new "instance" argument to all functions in the new API.

Implement old API in terms of the new API.
2004-01-17 10:52:21 +00:00
Poul-Henning Kamp
135bd3f8a1 Make sure set the media type in the phy, we cannot trust it to have chosen
the type we happen to want.

Bug triggered by net-booting soekris hardware which comes up in 10/hdx mode
by default.
2004-01-17 10:44:39 +00:00
Poul-Henning Kamp
4555065861 As previously announced: discontinue use of makedev() call in soundcode.
This takes us a lot closer to refcounting dev_t.

This patch originally by cg@ with a few minor changes by me.

It is largely untested, but has been HEADSUP'ed twice, so presumably
people have not found any issues with it.

Submitted by:	cg@
2004-01-17 10:37:11 +00:00
Matthew N. Dodd
baa039868e - Handle failure of cam_sim_alloc().
This prevents xpt_bus_register() from dereferencing NULL.
- Assign pointer to NULL after cam_sim_free().

Submitted by:	 Paul Twohey <twohey@CS.Stanford.EDU>
2004-01-17 05:57:52 +00:00
Ruslan Ermilov
2e53e513a8 Replaced outdated comment. 2004-01-17 03:28:27 +00:00
Dag-Erling Smørgrav
a6d4491c71 Restore correct semantics for F_DUPFD fcntl. This should fix the errors
people have been getting with configure scripts.
2004-01-17 00:59:04 +00:00
Brian Feldman
6d8e1f823b Do not allow operations which cause known file-system corruption. 2004-01-16 22:55:25 +00:00
Brian Feldman
478382096e Remove a warning. 2004-01-16 22:54:33 +00:00
Dag-Erling Smørgrav
56a9fc0e93 WITNESS won't let us hold two filedesc locks at the same time, so juggle
fdp and newfdp around a bit.
2004-01-16 21:54:56 +00:00
Robert Watson
bafc8f255a KASSERT() that initproc->p_pid is 1. Very bad things happen if init's
pid isn't 1, and it can actually occur if kthread_create() is called
before SUB_SI_CREATE_INIT without RFHIGHPID.

Discussed with:	jhb
2004-01-16 20:29:23 +00:00
Brian Feldman
016344807a Fix an upper-vnode leak created in revision 1.52. When an upper-layer
file has been removed, it should be purged from the cache, but it need
not be removed from the directory stack causing corruption; instead,
it will simply be removed once the last references and holds on it
are dropped at the end of the unlink/rmdir system calls, and the
normal !UN_CACHED VOP_INACTIVE() handler for unionfs finishes it off.

This is easily reproduced by repeated "echo >file; rm file" on a
unionfs mount.  Strangely, "echo -n >file; rm file" didn't make
it happen.
2004-01-16 16:31:01 +00:00
Ruslan Ermilov
b8eaa978fc - Build things in pure alphabetical dictionary order.
- Unify the conditional assignments section so that architectural
  exclusions come first, sorted, then options and !options, sorted
  by the option name, also in directory order, then architecture
  specific sections, sorted by the architecture name, with i386
  being a traditional exception.

Prodded by:	bde
2004-01-16 15:55:29 +00:00
MIHIRA Sanpei Yoshiro
203d1f9b68 Sync to 1.157 of usbdevs 2004-01-16 15:31:20 +00:00
MIHIRA Sanpei Yoshiro
24ce22f495 Add support SUNTAC U-Cable type A3(AS64LX)
Submitted by:	TAKAHASHI Daisuke <takaha@mue.biglobe.ne.jp> [FreeBSD-users-jp 72475]
		and MIZUTANI Masaki <m-saki@rr.iij4u.or.jp>
MFC after:	1 week
2004-01-16 15:29:27 +00:00
Dag-Erling Smørgrav
ddce426f69 Remove two KASSERTs which were overly paranoid. 2004-01-16 08:45:56 +00:00
David E. O'Brien
a971a19262 The ndis_kspin_lock type is called KSPIN_LOCK in MS-Windows.
According to the Windows DDK header files, KSPIN_LOCK is defined like this:
	typedef ULONG_PTR KSPIN_LOCK;

From basetsd.h (SDK, Feb. 2003):
	typedef [public] unsigned __int3264 ULONG_PTR, *PULONG_PTR;
	typedef unsigned __int64 ULONG_PTR, *PULONG_PTR;
	typedef _W64 unsigned long ULONG_PTR, *PULONG_PTR;

The keyword __int3264 specifies an integral type that has the following
properties:
 + It is 32-bit on 32-bit platforms
 + It is 64-bit on 64-bit platforms
 + It is 32-bit on the wire for backward compatibility.
   It gets truncated on the sending side and extended appropriately
   (signed or unsigned) on the receiving side.

Thus register_t seems the proper mapping onto FreeBSD for spin locks.
2004-01-16 02:07:04 +00:00
Peter Grehan
ec9db41566 Catch up with ATA UMA changes 2004-01-15 23:52:32 +00:00
Bill Paul
ece759a4da The definition for __stdcall logically belongs in pe_var.h, but
the definitions for NDIS_BUS_SPACE_IO and NDIS_BUS_SPACE_MEM logically
belong in hal_var.h. At least, that's my story, and I'm sticking to it.

Also, remove definition of __stdcall from if_ndis.c now that it's pulled
in from pe_var.h.
2004-01-15 21:31:49 +00:00
David E. O'Brien
75280cae75 Create NDIS_BUS_SPACE_{IO,MEM} to abstract MD BUS_SPACE macros.
Provide appropriate definitions for i386 and AMD64.
2004-01-15 19:34:56 +00:00
Dag-Erling Smørgrav
12d568c2b1 Take care to drop locks when calling malloc() 2004-01-15 18:50:11 +00:00
Atsushi Onoe
7cab13c7c0 Correct beacon (src/bssid) for hostap and adhoc mode. 2004-01-15 13:30:06 +00:00
Dag-Erling Smørgrav
a2fe44e8cf New file descriptor allocation code, derived from similar code introduced
in OpenBSD by Niels Provos.  The patch introduces a bitmap of allocated
file descriptors which is used to locate available descriptors when a new
one is needed.  It also moves the task of growing the file descriptor table
out of fdalloc(), reducing complexity in both fdalloc() and do_dup().

Debts of gratitude are owed to tjr@ (who provided the original patch on
which this work is based), grog@ (for the gdb(4) man page) and rwatson@
(for assistance with pxeboot(8)).
2004-01-15 10:15:04 +00:00
Atsushi Onoe
d148e81e76 Use generic net80211 framework for awi driver.
Restore awi to be workable again; it was broken..
XXX: The initialization is still unreliable yet, it sometimes fails on
     some card.
2004-01-15 10:04:21 +00:00
Atsushi Onoe
4844aa7d12 Add support for FH phy, which will be used by awi driver.
Also some if_media constants to indicate operational mode are changed
to bitmasks to reduce diffs from NetBSD.
2004-01-15 08:44:27 +00:00
Peter Grehan
f8735aa3bd - add openpic macio and psim/iobus attachments
- alpha sort powermac files
2004-01-15 08:43:46 +00:00
Bill Paul
70e8088cde Implement NdisCopyFromPacketToPacket() and NdisCopyFromPacketToPacketSafe().
I only have one driver that references this routine (for the 3Com 3cR990)
and it never gets called, but just in case, here it is.
2004-01-15 07:42:26 +00:00
Matthew N. Dodd
a85ce5b61f Add a per controller IOCTL interface. 2004-01-15 06:37:52 +00:00
Matthew N. Dodd
b7279e13a8 - Add comments.
- Add more command defines and data structures.
- Re-organize struct ida_drive_info to factor out struct ida_drive_info
  which will be used elsewhere.
2004-01-15 04:05:47 +00:00
Matthew N. Dodd
cacc81a67c Insure values of adapter structure members are in correct byte order. 2004-01-15 02:42:20 +00:00
Don Lewis
ff5f695e78 VOP_GETATTR() wants the vnode passed to it to be locked. Instead
of adding the code to lock and unlock the vnodes and taking care
to avoid deadlock, simplify linux_emul_convpath() by comparing the
vnode pointers directly instead of comparing their va_fsid and
va_fileid attributes.  This allows the removal of the calls to
VOP_GETATTR().
2004-01-14 22:38:03 +00:00
Søren Schmidt
5df3ca789c Use UMA instead of plain malloc for getting ATA request storage.
This gives +10% performance on simple tests, so definitly worth it.
A few percent more could be had by not using M_ZERO'd alloc's, but
we then need to clear fields all over the place to be safe, and
that was deemed not worth the trouble (and it makes life dangerous).
2004-01-14 21:26:35 +00:00
Dag-Erling Smørgrav
8892f1439b Back out previous commit, which as bde@ pointed out is a no-op. 2004-01-14 21:02:06 +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
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
Matt Jacob
58feac18f2 Update firmware sets for the 12160, 2200 and 2300 cards to the (more or
less) latest from QLogic.
2004-01-14 18:38:03 +00:00
Yoshihiro Takahashi
2a9e935823 MFi386: revision 1.462 2004-01-14 15:11:08 +00:00
Søren Schmidt
ee242ddc36 Fix potential cable detection problem on older CMD chips. 2004-01-14 14:24:36 +00:00
Dag-Erling Smørgrav
7f3155aab1 Re-add libkern/ffs.c. I thought sparc64 had an inline version, but
failed to notice that it's #if 0'ed out.
2004-01-14 08:38:13 +00:00
Dag-Erling Smørgrav
13ffdb96fd #include <machine/cpufunc.h>, which may define inline versions of some
of the functions in libkern.  Without this, parts of the kernel would
reference a non-existent (undeclared and undefined) ffs() function; the
only reason this didn't break the kernel build is that gcc happens to
have a built-in ffs() and incorrectly fails to warn about the lack of
prototypes for built-in functions.
2004-01-14 08:36:36 +00:00
Dag-Erling Smørgrav
29554ea51a Translate from GNU C to ISO C. 2004-01-14 07:47:10 +00:00
Alan Cox
f4c2663897 Remove vm_page_alloc_contig(). It's now unused. 2004-01-14 06:21:38 +00:00
Alan Cox
cf3f6e5041 Use contigmalloc() instead of vm_page_alloc_contig(). Pass M_ZERO to
contigmalloc() instead of calling bzero().
2004-01-14 06:14:35 +00:00
Hajimu UMEMOTO
3b0105ca30 invalidate secpolicy pcb cache on key_timehandler. part of
http://sources.zabbadoz.net/freebsd/patchset/110-ipsec-netkey-key.diff

Submitted by:	"Bjoern A. Zeeb" <bzeeb+freebsd@zabbadoz.net>
Reviewed by:	itojun
2004-01-14 04:39:40 +00:00
Hajimu UMEMOTO
e9c8752e56 add missing key_freesp()s. part of
http://sources.zabbadoz.net/freebsd/patchset/110-ipsec-netkey-key.diff
with some modification.

Submitted by:	"Bjoern A. Zeeb" <bzeeb+freebsd@zabbadoz.net>
Reviewed by:	itojun
Obtained from:	KAME
2004-01-14 04:10:28 +00:00
Bill Paul
fb1ad3a85a mp_ncpus is always defined now, so no need to do an #ifdef SMP in
ndis_cpu_cnt().
2004-01-14 01:16:14 +00:00
Alan Cox
b647e8ab58 Use contigmalloc() instead of vm_page_alloc_contig(). 2004-01-14 00:52:53 +00:00
Brian Feldman
7586b25ce3 Add an "ethernet" hook to the rfc1490 netgraph module. It will send
and receive FCS-less RFC1490-"bridged" Ethernet packets that are
currently just ignored.
2004-01-14 00:39:28 +00:00
Don Lewis
288e351b55 If a device attach routine fails during boot and calls bus_teardown_intr(),
ithread_remove_handler() may fail to remove the interrupt handler if
it decides to let the ithread do the removal.  The problem is that during
boot "cold" is set, which causes msleep() to return immediately.  This
will cause ithread_remove_handler() to fail to wait for the ithread
to do the removal from the handler TAILQ before freeing the handler
back to the heap.  Bad things will happen when some other user of the
TAILQ, such as ithread_add_handler() or the actual ithread attempts to use
the freed handler.  Fix the problem by forcing ithread_remove_handler()
to do the actual removal itself if the "cold" flag is set.

Reviewed by:	jhb
2004-01-13 22:55:46 +00:00
David E. O'Brien
a4464dd7ea AMD64 has a single MS-Win calling convention, so provide an empty __stdcall.
Centralize the definition to make it easier to change.
2004-01-13 22:49:45 +00:00
David E. O'Brien
c4f7bbcfa9 Use 'vm_offset_t' rather than 'u_int32_t'.
Tested on:	AMD64
Reviewed by:	wpaul
2004-01-13 22:26:37 +00:00
David E. O'Brien
77346fe71a AMD64 has a single MS-Win calling convention, so provide an empty __stdcall. 2004-01-13 22:23:47 +00:00
Matthew N. Dodd
0718ed926b Initialize drive device_t in softc. 2004-01-13 21:44:03 +00:00
Brian Feldman
c5fe6793bd Add the Qualcomm CDMA Technologies MSM phone (umodem) device.
Submitted by: Sean Welch <welchsm@earthlink.net>
MFC after: 1 week
2004-01-13 21:42:32 +00:00
Søren Schmidt
6f595c71c2 Fix ata_getparam to accept the fact that some crappy devices can pose as
both master and slave at the same time confusing the probe code.
2004-01-13 21:35:39 +00:00
John Baldwin
0657fe7356 Add a component constant for ACPI_TOSHIBA to fix compilation of
acpi_toshiba(4) driver with ACPI_DEBUG and thus fix LINT on i386.
2004-01-13 21:27:50 +00:00
Alan Cox
13a7f14fb8 Use contigmalloc() and contigfree() instead of vm_page_alloc_contig() and
kmem_free().  Note: The FreeBSD-specific code in this file has been
subsumed by the FreeBSD-specific header file, pdq_freebsd.h.  That header
file already specifies the use of contigmalloc() and contigfree().  Thus,
the purpose of this change is to avoid having nonsensical examples of
FreeBSD-specific memory allocation in our source tree.
2004-01-13 20:36:03 +00:00
Dag-Erling Smørgrav
82ec4f6ea9 Forgot ffsl() and flsl() on alpha. 2004-01-13 18:05:49 +00:00
Dag-Erling Smørgrav
8746a69a28 Cast to unsigned to avoid sign-extension problems. 2004-01-13 16:02:20 +00:00
Dag-Erling Smørgrav
1de30b60cb Add ffsl(), fls() flsl() to platforms that don't already have them. 2004-01-13 15:37:23 +00:00
Dag-Erling Smørgrav
f04ecda547 Add C implementations of ffsl(), fls() and flsl(). 2004-01-13 15:36:34 +00:00
Dag-Erling Smørgrav
53546cd058 ANSIfy, de-register, replace VAX reference with actual description. 2004-01-13 15:35:22 +00:00
Dag-Erling Smørgrav
2d6853a650 Whitespace nit. 2004-01-13 15:30:36 +00:00
Yoshihiro Takahashi
65d28db3b2 Include "../Makefile.inc" to propagate the configuration to subdirectories. 2004-01-13 13:08:27 +00:00
Christian Brueffer
6034c7012c Fix typo in a comment 2004-01-13 11:31:09 +00:00
Ruslan Ermilov
0799be5978 MODULE_DEPEND is a C macro, not a make(1). 2004-01-13 11:30:37 +00:00
Ruslan Ermilov
5ef42ab64d bsd.kmod.mk does not deal with manpages anymore. 2004-01-13 11:28:51 +00:00
Matthew N. Dodd
ddd531b381 style(9): single tab after #define. 2004-01-13 11:28:21 +00:00
Peter Grehan
73cb337c32 Use a device identify entry point to attach to nexus, since the
nexus code no longer searches for interrupt controllers.
2004-01-13 11:25:40 +00:00
Peter Grehan
739af9bcb5 Make the OpenPic driver bus-independent, with attachments for
the MacIO chip and PSIM's IOBus. Bus-specific drivers should
use the identify method to attach themselves to nexus so
interrupt can be allocated before the h/w is probed. The
'early attach' routine in openpic is used for this stage
of boot. When h/w is probed, the openpic can be attached
properly. It will enable interrupts allocated prior to
this.
2004-01-13 11:24:36 +00:00
Peter Grehan
8dbee7197d Remove hard-coded knowledge of specific OFW devices. Use bus_generic_probe
and add_child entry point to allow devices to use the identify
method to add themselves if need be (e.g. openpic, syscons).
Export interrupt-controller-add routine for extern int cntlr drivers.
Eliminate recursive OFW device-tree walk and only iterate the
top-level ala sparc64. Allow child devices to set the device
type with write_ivars.

Step 1 of many in removing the hard-dependency on OpenFirmware.
2004-01-13 11:20:52 +00:00
Ruslan Ermilov
63f030791d Don't put .depend in CLEANFILES, it's cleaned by cleandepend. 2004-01-13 11:13:00 +00:00
Peter Grehan
c576427c52 Catch up with ATA changes by including <sys/sema.h> 2004-01-13 10:54:35 +00:00
Hajimu UMEMOTO
a18310584f call ipsec_pcbconn()/ipsec_pcbdisconn() from in6_pcbconnect().
Obtained from:	KAME
2004-01-13 10:45:02 +00:00
Hajimu UMEMOTO
548c676b32 do not deref freed pointer
Submitted by:	"Bjoern A. Zeeb" <bzeeb+freebsd@zabbadoz.net>
Reviewed by:	itojun
2004-01-13 09:51:47 +00:00
Bill Paul
fef7cebe7b Implement some more unicode handling routines. This will hopefully bring
us closer to being able to run the Intel PRO/Wireless 5000 driver.
2004-01-13 09:12:47 +00:00
Alan Cox
2dc8633eab Replace calls to vm_page_alloc_contig() by calls to contigmalloc().
vm_page_alloc_contig() will be removed after the three remaining drivers
that use it are also converted to contigmalloc().
2004-01-13 07:45:10 +00:00
Sam Leffler
6f161f0342 Handle SIOCSIFMTU ioctl directly so we can apply 802.11-specific bounds.
Note that the min is actually constrained to IF_MINMTU by the if layer.
2004-01-13 06:22:55 +00:00
Hajimu UMEMOTO
22acb4fa32 correct spelling
Submitted by:	"Bjoern A. Zeeb" <bzeeb+freebsd@zabbadoz.net>
Reviewed by:	itojun
2004-01-13 05:39:07 +00:00
Hajimu UMEMOTO
7495684aca fix potential 'cannot-happen' memory leak
Submitted by:	"Bjoern A. Zeeb" <bzeeb+freebsd@zabbadoz.net>
Reviewed by:	itojun
2004-01-13 05:32:12 +00:00
Bill Paul
2333afc31e Loosen up the range test in ndis_register_ioport(). Allow drivers to
map ranges that are smaller than what our resource manager code knows
is available, rather than requiring that they match exactly. This
fixes a problem with the Intel PRO/1000 gigE driver: it wants to map
a range of 32 I/O ports, even though some chips appear set up to
decode a range of 64. With this fix, it loads and runs correctly.
2004-01-13 01:12:28 +00:00
Alfred Perlstein
b0d8e5b388 Prevent a panic when mounting a v2/v3 only server with mount_nfs4.
Submitted by: Jim Rees <rees@umich.edu>
Reported/testing: Florian C. Smeets <flo@kasimir.com>
2004-01-13 01:04:36 +00:00
Bill Paul
22c48a5f23 Ugh. I am not having a good day. Remove debugging #ifdef that accidentally
crept into the last commit.
2004-01-12 21:40:05 +00:00
Matthew N. Dodd
a14b52fe81 Handle "Bad Command List" errors.
No error status is returned by the adapter so set CMD_REJECTED so that
ida_done() will DTRT.
2004-01-12 21:05:06 +00:00
Bill Paul
716b5b3580 Ugh. Last commit went horribly wrong. Back out changes to subr_ntoskrnl.c,
make sure if_ndis.c really gets checked in this time.
2004-01-12 21:04:43 +00:00
Matthew N. Dodd
6f5d148559 Remove comments that no longer apply. 2004-01-12 21:01:18 +00:00
Bill Paul
958e09f637 In if_ndis.c:ndis_intr(), be a bit more intelligent about squelching
unexpected interrupts. If an interrupt is triggered and we're not
finished initializing yet, bail. If we have finished initializing,
but IFF_UP isn't set yet, drain the interrupt with ndis_intr() or
ndis_disable_intr() as appropriate, then return _without_ scheduling
ndis_intrtask().

In kern_ndis.c:ndis_load_driver() only relocate/dynalink a given driver
image once. Trying to relocate an image that's already been relocated
will trash the image. We poison a part of the image header that we
don't otherwise need with a magic value to indicate it's already been
fixed up. This fixes the case where there are multiple units of the
same kind of device.
2004-01-12 21:00:48 +00:00
John Baldwin
361c31ad14 - Use constant for shift when converting file length in bytes to a sector
count.
- Fix the twiddle output so that it actually spins.
- Save %cx around BIOS calls to read in sectors from the disc as at least
  one BIOS trashes %cx when called to read off of a USB CD-ROM drive.

Submitted by:	Martin Nilsson <martin@gneto.com>
MFC after:	1 week
2004-01-12 20:34:42 +00:00
Nate Lawson
b9585d5e60 Only remove the handler if we installed it. 2004-01-12 19:35:31 +00:00
Nate Lawson
cc609df826 Hook up acpi_toshiba 2004-01-12 19:30:57 +00:00
David E. O'Brien
4239793589 Add emu10k1-alsa%diked.h dependancies. 2004-01-12 19:02:37 +00:00
Nate Lawson
5ce6805764 Bite the bullet and uncomment the shutdown() in case we hit the _CRT or
_HOT temperatures.  We have to do this at some point to keep from getting
imp(tm) melted hardware.
2004-01-12 17:59:10 +00:00
Andre Oppermann
bed824fa90 Disable the minmssoverload connection drop by default until the detection
logic is refined.
2004-01-12 15:46:04 +00:00
Tim J. Robbins
08fe4bfbda Fix an inverted test for NOPEN in the unused function smb_smb_flush(). 2004-01-12 14:43:49 +00:00
Takeshi Shibagaki
7636aa79ab Fix a suspend/resume issue. My Compaq N400c works fine. 2004-01-12 14:18:55 +00:00
MIHIRA Sanpei Yoshiro
b27ef31d1b I added unwanted character. I cleaned 2004-01-12 12:47:36 +00:00
Matthew N. Dodd
68d2672d3b - Initialize qcb flags in ida_construct_qcb() with respect to DMA direction.
- Print operation type, if known in hard/soft error message in ida_done().
- NULL qcb struct bio pointer in ida_done().
2004-01-12 12:31:03 +00:00
Poul-Henning Kamp
d5a929dc17 Allow specification of a geometry for vnode backed devices as well as
for malloc backed devices.
2004-01-12 10:52:00 +00:00
Søren Schmidt
45a0b23e06 Always return ENOMEM if ata_request_alloc fails so GEOM can dtrt. 2004-01-12 09:33:10 +00:00
Søren Schmidt
bd234a46da #include sema.h is now required. 2004-01-12 07:16:07 +00:00
Nate Lawson
1114c59266 Clean up the probe message and sort the function table according to
the function order in the file.
2004-01-12 06:55:50 +00:00
Bill Paul
60a9ef3d9c Merge in some changes submitted by Brian Feldman. Among other things,
these add support for listing BSSIDs via wicontrol -l. I added code
to call OID_802_11_BSSID_LIST_SCAN to allow scanning for any nearby
wirelsss nets.

Convert from using individual mutexes to a mutex pool, created in
subr_ndis.c. This deals with the problem of drivers creating locks
in their DriverEntry() routines which might get trashed later.

Put some messages under IFF_DEBUG.
2004-01-12 03:49:20 +00:00
Yoshihiro Takahashi
91d0bb0b66 MFi386: revision 1.1114. 2004-01-12 03:43:05 +00:00
Robert Watson
09dbf7a214 Correct for proper vn_fullpath() failure mode: "== -1" -> "!= 0"
Discussed with:	des
2004-01-12 03:14:37 +00:00
David E. O'Brien
b64a0ad5c1 Specify the right location of the generated header. 2004-01-12 00:06:30 +00:00
Don Lewis
b8b67f93a4 Don't try to unlock the directory vnode in null_lookup() if the lock is
shared with the underlying file system and the lookup in the underlying
file system did the unlock for us.
2004-01-11 23:44:32 +00:00
Søren Schmidt
a7a120f649 Overhaul of the timeout/reinit framework. This should clear up most
of the leftovers from the old version that really doesn't work anymore.

Add a reset function for host-end of the ATA channel. This is needed
for the SiI3112 in order to whack it back to reality if a device
locks up the SATA interface (thereby preventing that we can reset the
device). The result is that ATA now recovers from the timeouts that
happens with the SiI3112A and more or less all disks based on old
PATA electronics with a Marvell PATA->SATA converter. This includes
lots of the popular SATA dongles and the WDC Raptor disks..
2004-01-11 22:08:34 +00:00
Alex Dupre
fd4b744b5b Update list of device drivers that support polling.
Remove redundancy in NOTES.

PR:		docs/61195
Submitted by:	Xin LI <delphij@frontfree.net>
Approved by:	blackend (mentor)
MFC after:	1 week
2004-01-11 22:07:19 +00:00
Dag-Erling Smørgrav
ac34dc4e79 Back out 1.160, which was committed by mistake. 2004-01-11 20:08:57 +00:00
Dag-Erling Smørgrav
d7a1c7e34b Back out 1.166, which was committed by mistake. 2004-01-11 20:07:15 +00:00
Dag-Erling Smørgrav
f1ea6d813d Mechanical whitespace cleanup + other minor style nits. 2004-01-11 19:56:42 +00:00
Dag-Erling Smørgrav
0e5dfade00 Mechanical whitespace cleanup. 2004-01-11 19:54:45 +00:00
Dag-Erling Smørgrav
05c3c5c8b6 Mechanical whitespace cleanup; parenthesize return values; other minor
style nits.  The #ifdefs in this file give me a headache...
2004-01-11 19:52:10 +00:00
Dag-Erling Smørgrav
e5aeaa0c67 Mechanical whitespace cleanup; parenthesize return values; other minor
style nits.
2004-01-11 19:48:19 +00:00
Dag-Erling Smørgrav
012b5531f4 Mechanical whitespace cleanup + minor style nits. 2004-01-11 19:43:14 +00:00
Dag-Erling Smørgrav
c9de31f55f Mechanical whitespace cleanup. 2004-01-11 19:39:14 +00:00
Nate Lawson
65c0f49140 Add the ACPI Toshiba extras driver (hotkeys, LCD backlight, video output,
forced fan control, and CPU throttling).

PR:
Submitted by:	Hiroyuki Aizu <aizu@navi.org>
Reviewed by:
Approved by:
Obtained from:
MFC after:
2004-01-11 19:18:39 +00:00
Nate Lawson
4fd3a4fdd2 Add the ACPI Toshiba extras driver (hotkeys, LCD backlight, video output,
forced fan control, and CPU throttling).

Submitted by:	Hiroyuki Aizu <aizu@navi.org>
2004-01-11 19:18:38 +00:00
Hidetoshi Shimokawa
480878299e Sync type of linkspeed with firewire.c. 2004-01-11 15:40:42 +00:00
Ruslan Ermilov
9c855145a8 Stay in sync with src/COPYRIGHT and src/sys/sys/copyright.h,
and put the starting year of the project into the copyright.
2004-01-11 14:13:29 +00:00
David E. O'Brien
21f1e37cbd Add Audigy support.
I started with a year-old patch by Orlando Bassotto
<orlando.bassotto@ieo-research.it>, and ported it to 5.2-CURRENT along with
fixing the problems working with pre-Audigy cards.
2004-01-11 10:30:56 +00:00
Poul-Henning Kamp
cbb650409c Print the correct pointer in a KASSERT.
Submitted by:	Pawel Jakub Dawidek <nick@garage.freebsd.pl>
2004-01-11 10:02:42 +00:00
Yoshihiro Takahashi
6c021e3150 MFi386: revision 1.583. 2004-01-11 09:18:33 +00:00
Yoshihiro Takahashi
8d6649fef6 The ida module is not needed for pc98. 2004-01-11 09:15:13 +00:00
Matthew N. Dodd
99e5f60af4 ida(4) module. PCI only for now. 2004-01-11 07:01:30 +00:00
Alan Cox
0e88a71798 Remove long dead code, specifically, code related to munmapfd().
(See also vm/vm_mmap.c revision 1.173.)
2004-01-11 06:59:21 +00:00
Warner Losh
e4b59fc500 Add support for subtractive decoding bridges. These bridges pass all
signals to addresses to the child busses.  Typically, ProgIf of 1
means a subtractive bridge.  However, Intel has a whole lot of ones
with a ProgIf of 80 that are also subtractive.  We cope with these
bridges too.  This eliminates hw.pci.allow_unsupported_io_range
because that had almost the same effect as these patches (almost means
'buggy').  Remove the bogus checks for ISA bus locations: these cycles
aren't special and are only passed by transparent bridges.

We allow any range to succeed.  If the range is a superset of the
range that's decoded, trim the resource to that range.  Otherwise,
pass the range unchanged.  This will change the location that PC Card
and CardBus cards are attached.  This might bogusly cause some
overlapping allocation that wasn't present before, but the overlapping
fixes need to be in the pci level.

There's also a few formatting changes here.
2004-01-11 06:52:31 +00:00
Robert Watson
c370f01276 Release audit device major number reservation. The new audit
implementation writes directly to a file, similar to the Darwin,
Solaris, and whoever else implementations, rather than buffering
through a pseudo-device.
2004-01-11 06:24:34 +00:00
David E. O'Brien
076fcd1776 This commit was generated by cvs2svn to compensate for changes in r124361,
which included commits to RCS files with non-trunk default branches.
2004-01-11 03:34:02 +00:00
David E. O'Brien
fbee6927b8 Vendor import emu10k1.h from version 1.0.1 of the ALSA driver.
ftp://ftp.alsa-project.org/pub/driver/alsa-driver-1.0.1.tar.bz2
  or http://www.alsa-project.org/alsa/cvs/alsa-kernel/include/emu10k1.h
2004-01-11 03:34:02 +00:00
Alan Cox
7fac6d07f6 Include "opt_cpu.h" and related #ifdef's for SSE so that pagezero()
actually includes the call to sse2_pagezero().
2004-01-11 03:02:25 +00:00
Robert Watson
def055686c When not creating a core dump due to resource limits specifying
a maximum dump size of 0, return a size-related error, rather
than returning success.  Otherwise, waitpid() will incorrectly
return a status indicating that a core dump was created.  Note
that the specific error doesn't actually matter, since it's lost.

MFC after:	2 weeks
PR:		60367
Submitted by:	Valentin Nechayev <netch@netch.kiev.ua>
2004-01-11 02:28:06 +00:00
David E. O'Brien
c1d6534deb Remove EMUDEBUG [un]def. This should be done in the Makefile. 2004-01-11 01:34:41 +00:00
Warner Losh
28c30c8315 MF-p4/diff reduction:
Eliminate trailing blank line in this file.
2004-01-11 00:18:03 +00:00
Alan Cox
baadec0711 - Unmanage pages allocated by contigmalloc1(). (There is no point in
having PV entries for these pages.)
 - Remove splvm() and splx() calls.
2004-01-10 21:17:53 +00:00
Jens Schweikhardt
85495c72ff s/Muliple/Multiple
Removed whitespace at EOL and EOF.
2004-01-10 18:34:01 +00:00
Dag-Erling Smørgrav
d41457da80 More unparenthesized return values. 2004-01-10 17:14:53 +00:00
Ruslan Ermilov
6c3d1bdfa3 Properly fix the FreeBSD copyright.
Pointed by:	scottl
2004-01-10 16:24:22 +00:00
Ruslan Ermilov
ab8de8b9d7 s/FreeBSD Inc./The FreeBSD Foundation/g 2004-01-10 15:38:47 +00:00
Dag-Erling Smørgrav
b91a599717 Style: parenthesize return values. 2004-01-10 13:03:43 +00:00
Hajimu UMEMOTO
803434325e try rtinit() only when the route is not installed.
this allows, e.g., duplicated attempts of 'ifconfig lo0 ::1'
like for IPv4.

Obtained from:	KAME
MFC after:	1 week
2004-01-10 08:59:21 +00:00
Don Lewis
e29ef13f6c Check that sa_len is the appropriate value in tcp_usr_bind(),
tcp6_usr_bind(), tcp_usr_connect(), and tcp6_usr_connect() before checking
to see whether the address is multicast so that the proper errno value
will be returned if sa_len is incorrect.  The checks are identical to the
ones in in_pcbbind_setup(), in6_pcbbind(), and in6_pcbladdr(), which are
called after the multicast address check passes.

MFC after:	30 days
2004-01-10 08:53:00 +00:00
Don Lewis
2b77864f1e Add a somewhat redundant check on the len arguement to getsockaddr() to
avoid relying on the minimum memory allocation size to avoid problems.
The check is somewhat redundant because the consumers of the returned
structure will check that sa_len is a protocol-specific larger size.

Submitted by:	Matthew Dillon <dillon@apollo.backplane.com>
Reviewed by:	nectar
MFC after:	30 days
2004-01-10 08:28:54 +00:00
Don Lewis
3f02eaf396 Don't execute the code in in6_ifdetach() that removes the link-local
allnodes multicast route if the routing table has not been initialized.
This avoids a panic during boot if an interface detaches before the
routing table is initialized.

Submitted by:	sam
2004-01-10 08:14:27 +00:00
Hajimu UMEMOTO
5fac41781b in set{peer, sock}addr, do not convert the unspecified
address (::) to the mapped address form.

PR:		kern/22868
Obtained from:	KAME
MFC after:	3 days
2004-01-10 08:11:51 +00:00
Tim J. Robbins
835fb61618 Restore closing of SMB find handle in smbfs_close(). 2004-01-10 03:45:30 +00:00
Doug Ambrisko
e2297e59c8 Remove the HACK section it breaks the older firmware and doesn't totally
fix the new firmware so remove it.
2004-01-10 03:02:04 +00:00
Alfred Perlstein
3f5c95f772 Fix a panic when attempting a v4 op against a v3/v2-only server.
It happens because rpcclnt_request is incorrectly returning 0 in the case
of an rpc mismatch or auth error.

Submitted by: Jim Rees <rees@umich.edu>
2004-01-10 02:59:54 +00:00
Alan Cox
37d44833d5 Unmanage pages allocated by kmem_alloc(). (There is no point in having PV
entries for these pages.)
2004-01-10 00:22:33 +00:00
Olivier Houchard
5cded90454 Prevent a race condition between fork1() and whatever changes the pgrp by
setting the new process' p_pgrp again before inserting it in the p_pglist.
Without it we can get the new process to be inserted in a different p_pglist
than the one p2->p_pgrp points to, and this is not something we want to happen.
This is not a fix, merely a bandaid, but it will work until someone finds a
better way to do it.

Discussed with: 	jhb (a long time ago)
2004-01-09 23:42:36 +00:00
Olivier Houchard
63bfa8ba2c Remove duplicate __FBSDID().
Mark trm as depending on cam.
2004-01-09 23:30:31 +00:00
Nate Lawson
2ccd1cac95 Clean up the acpi announce message of trailing spaces. 2004-01-09 21:04:28 +00:00
Nate Lawson
25611cfe97 Expand the check for overriding the OS name to override _OS* (including
_OS_, _OS, and _OSI).  This should fix this option for people who reported
it not changing anything.
2004-01-09 20:01:42 +00:00
Scott Long
6d38a06c85 Disable the APIC when selecting the 'Safe Mode' option of the loader. This
will disable both APIC interrupt routing and SMP.
2004-01-09 19:20:47 +00:00
Jacques Vidrine
e4dc8baa84 Provide sysarch(2) prototypes in the MD sysarch.h headers. While I'm
at it, use the ANSI C generic pointer type for the second argument,
thus matching the documentation.

Remove the now extraneous (and now conflicting) function declarations
in various libc sources.  Remove now unnecessary casts.

Reviewed by:	bde
2004-01-09 16:52:09 +00:00
Poul-Henning Kamp
cfa35456ca KASSERT against no-op access requests.
Submitted by:	Pawel Jakub Dawidek <nick@garage.freebsd.pl>
2004-01-09 16:10:32 +00:00
Andre Oppermann
1ddc17c1d5 Reduce TCP_MINMSS default to 216. The AX.25 protocol (packet radio)
is frequently used with an MTU of 256 because of slow speeds and a
high packet loss rate.
2004-01-09 14:14:10 +00:00
Hartmut Brandt
5361744dfa Fix a warning when NATM is not defined. In this case s is not used. 2004-01-09 11:25:14 +00:00
Bill Paul
e6003d0862 The private data section of ndis_packets has a 'packet flags' byte
which has two important flags in it: the 'allocated by NDIS' flag
and the 'media specific info present' flag. There are two Windows macros
for getting/setting media specific info fields within the ndis_packet
structure which can behave improperly if these flags are not initialized
correctly when a packet is allocated. It seems the correct thing
to do is always set the NDIS_PACKET_ALLOCATED_BY_NDIS flag on
all newly allocated packets.

This fixes the crashes with the Intel Centrino wireless driver.
My sample card now seems to work correctly.

Also, fix a potential LOR involving ndis_txeof() in if_ndis.c.
2004-01-09 06:53:49 +00:00
David E. O'Brien
2511c244ad Sync with Creative's 8010.h rev 1.51. 2004-01-09 06:38:11 +00:00
David E. O'Brien
a554deb2a8 Dike out some very Linux-specific parts that we can't compile with.
Also protect AC97_MUTE which is also defined in our own ac97.h.
2004-01-09 05:08:32 +00:00
David E. O'Brien
fca6c85647 Vendor import revision 1.9 of ac97_codec.h (we renamed the file) from
http://cvs.sourceforge.net/viewcvs.py/emu10k1/emu10k1/ac97_codec.h
2004-01-09 05:05:04 +00:00
David E. O'Brien
03adcebca3 This commit was generated by cvs2svn to compensate for changes in r124273,
which included commits to RCS files with non-trunk default branches.
2004-01-09 05:05:04 +00:00
Bill Paul
431b5bd6e7 Implement NdisOpenFile()/NdisCloseFile()/NdisMapFile()/NdisUnmapFile().
By default, we search for files in /compat/ndis. This can be changed with
a systcl. These routines are used by some drivers which need to download
firmware or microcode into their respective devices during initialization.

Also, remove extraneous newlines from the 'built-in' sysctl/registry
variables.
2004-01-09 03:57:00 +00:00
Brian Feldman
b712e9ec66 Also, don't crash in the netgraph disconnect node if the interface is
detached from the other direction.
2004-01-09 02:03:24 +00:00
Brian Feldman
018df1c369 Don't try to ifpromisc() on an interface that's deleted already. 2004-01-09 00:41:45 +00:00
Robert Watson
07eacae0d2 Improve the expressiveness of ttyinfo (^T) when dealing with threads
in slightly less usual states:

  If the thread is on a run queue, display "running" if the thread is
  actually running, otherwise, "runnable".

  If the thread is sleeping, and it's on a sleep queue, display the
  name of the queue, otherwise "unknown" -- previously, in this situation
  we would display "iowait".

  If the thread is waiting on a lock, display *lockname.

  If the thread is suspended, display "suspended" -- previously, in
  this situation we would display "iowait".

  If the thread is waiting for an interrupt, display "intrwait" --
  previously, in this situation we would display "iowait".

  If the thread is in a state not handled by the above, display
  "unknown" -- previously, we would print "iowait".

Among other things, this avoids displaying "iowait" when the foreground
process turns out to be suspended waiting for a debugger to properly
attach.
2004-01-08 22:49:23 +00:00
Robert Watson
047aa39b25 Drop the sigacts mutex around calls to stopevent() to avoid sleeping
holding the mutex.  Because the sigacts pointer can't change while
the process is "live" (proc locking (x)), we know our pointer is still
valid.

In communication with:	truckman
Reviewed by:		jhb
2004-01-08 22:44:54 +00:00
Alan Cox
65bae14d77 - Enable recursive acquisition of the mutex synchronizing access to the
free pages queue.  This is presently needed by contigmalloc1().
 - Move a sanity check against attempted double allocation of two pages
   to the same vm object offset from vm_page_alloc() to vm_page_insert().
   This provides better protection because double allocation could occur
   through a direct call to vm_page_insert(), such as that by
   vm_page_rename().
 - Modify contigmalloc1() to hold the mutex synchronizing access to the
   free pages queue while it scans vm_page_array in search of free pages.
 - Correct a potential leak of pages by contigmalloc1() that I introduced
   in revision 1.20: We must convert all cache queue pages to free pages
   before we begin removing free pages from the free queue.  Otherwise,
   if we have to restart the scan because we are unable to acquire the
   vm object lock that is necessary to convert a cache queue page to a
   free page, we leak those free pages already removed from the free queue.
2004-01-08 20:48:26 +00:00
Søren Schmidt
986a964900 Use the saved params for LBA-CHS conversion. Fixes PC98 bug. 2004-01-08 19:17:16 +00:00
Maxime Henrion
ec6a729924 Some integrated Davicom cards in sparc64 boxes have an all zeros
MAC address in the EEPROM, and we need to get it from OpenFirmware.
This isn't very pretty but time is lacking to do this in a better
way this near 5.2-RELEASE.  This is a RELENG_5_2 candidate.

Original version by:	Marius Strobl <marius@alchemy.franken.de>
Tested by:		Pete Bentley <pete@sorted.org>
Reviewed by:		jake
2004-01-08 19:08:27 +00:00
Andre Oppermann
53369ac9bb Limiters and sanity checks for TCP MSS (maximum segement size)
resource exhaustion attacks.

For network link optimization TCP can adjust its MSS and thus
packet size according to the observed path MTU.  This is done
dynamically based on feedback from the remote host and network
components along the packet path.  This information can be
abused to pretend an extremely low path MTU.

The resource exhaustion works in two ways:

 o during tcp connection setup the advertized local MSS is
   exchanged between the endpoints.  The remote endpoint can
   set this arbitrarily low (except for a minimum MTU of 64
   octets enforced in the BSD code).  When the local host is
   sending data it is forced to send many small IP packets
   instead of a large one.

   For example instead of the normal TCP payload size of 1448
   it forces TCP payload size of 12 (MTU 64) and thus we have
   a 120 times increase in workload and packets. On fast links
   this quickly saturates the local CPU and may also hit pps
   processing limites of network components along the path.

   This type of attack is particularly effective for servers
   where the attacker can download large files (WWW and FTP).

   We mitigate it by enforcing a minimum MTU settable by sysctl
   net.inet.tcp.minmss defaulting to 256 octets.

 o the local host is reveiving data on a TCP connection from
   the remote host.  The local host has no control over the
   packet size the remote host is sending.  The remote host
   may chose to do what is described in the first attack and
   send the data in packets with an TCP payload of at least
   one byte.  For each packet the tcp_input() function will
   be entered, the packet is processed and a sowakeup() is
   signalled to the connected process.

   For example an attack with 2 Mbit/s gives 4716 packets per
   second and the same amount of sowakeup()s to the process
   (and context switches).

   This type of attack is particularly effective for servers
   where the attacker can upload large amounts of data.
   Normally this is the case with WWW server where large POSTs
   can be made.

   We mitigate this by calculating the average MSS payload per
   second.  If it goes below 'net.inet.tcp.minmss' and the pps
   rate is above 'net.inet.tcp.minmssoverload' defaulting to
   1000 this particular TCP connection is resetted and dropped.

MITRE CVE:	CAN-2004-0002
Reviewed by:	sam (mentor)
MFC after:	1 day
2004-01-08 17:40:07 +00:00
Bill Paul
2aae662479 Add the PCI ID for yet another bge chip: the Altima 1002.
Submitted by: Pavel Gubin <pg@rainbow.ie.tusur.ru>
2004-01-08 17:19:11 +00:00
Bill Paul
8d1da39d69 Add the NDISAPI option. 2004-01-08 17:13:10 +00:00
Nate Lawson
9bb87cde3e Always clean all files, including ones under ACPI_DEBUG when doing a
"make clean".
2004-01-08 16:38:32 +00:00
Hidetoshi Shimokawa
11fe249262 * firewire
Add tcode_str[] and improve debug message.
* sbp
	If max_speed is negative, use the maximum speed which the
	ohci chip supports.  The default max_speed is -1.
* if_fwe
	If tx_speed is negative, use the maximum speed which the
	ohci chip supports.  The default tx_speed is 2.
2004-01-08 14:58:09 +00:00
Andre Oppermann
bf87c82ebb If path mtu discovery is enabled set the DF bit in all cases we
send packets on a tcp connection.

PR:		kern/60889
Tested by:	Richard Wendland <richard@wendland.org.uk>
Approved by:	re (scottl)
2004-01-08 11:17:11 +00:00
Andre Oppermann
e0f630ea7a Do not set the ip_id to zero when DF is set on packet and
restore the general pre-randomid behaviour.

Setting the ip_id to zero causes several problems with
packet reassembly when a device along the path removes
the DF bit for some reason.

Other BSD and Linux have found and fixed the same issues.

PR:		kern/60889
Tested by:	Richard Wendland <richard@wendland.org.uk>
Approved by:	re (scottl)
2004-01-08 11:13:40 +00:00
Bill Paul
3e1b0c31a1 Correct the definition of the ndis_miniport_interrupt structure:
the ni_dpccountlock member is an ndis_kspin_lock, not an
ndis_spin_lock (the latter is too big).

Run if_ndis.c:ndis_tick() via taskqueue_schedule(). Also run
ndis_start() via taskqueue in certain circumstances.

Using these tweaks, I can now get the Broadcom BCM5701 NDIS
driver to load and run. Unfortunately, the version I have seems
to suffer from the same bug as the SMC 83820 driver, which is
that it creates a spinlock during its DriverEntry() routine.
I'm still debating the right way to deal with this.
2004-01-08 10:44:37 +00:00
Don Lewis
4ff4a9bee9 The transmit frame status is stored in the last transmit descriptor for the
frame, not the first.  It is probably also not safe to free the mbuf chain
as soon as the OWN bit is cleared on the first descriptor since the chip
may not be done copying the frame into the transmit FIFO.  Revert the part of
of busdma conversion (if_dc.c rev 1.115) which changed dc_txeof() to look for
the status in the first descriptor and free the mbuf chain when processing
the first descriptor for the frame, and revert the matching changes elsewhere
in the driver.  This part of the busdma change caused the driver to report
spurious collisions and output errors, even when running in full-duplex mode.
Reverting the mbuf chain handling slightly complicates dc_dma_map_txbuf(),
since it is responsible for setting the OWN bits on the descriptors, but does
not normally have direct access to the mbuf chain.

Tested by:
  Dejan Lesjak <dejan.lesjak at ijs.si>  alpha/<Intel 21143 10/100BaseTX>
  "Xin LI" <delphij at frontfree.net>    i386/<Macronix 98713 10/100BaseTX>
  Wiktor Niesiobedzki <bsd at w.evip.pl> i386/<3Com OfficeConnect 10/100B>

Reviewed by:	mux
2004-01-08 06:22:15 +00:00
Sam Leffler
d4b2657f98 Remove extraneous unlock. This fixes a panic seen when manipulating static
entries in the ARP table.
2004-01-07 23:42:21 +00:00
John Baldwin
ed91a3d95a Comsetic tweaks: use PCPU_GET(cpumask) and CPU_ABSENT().
Tested by:	Dejan Lesjak <dejan.lesjak@ijs.si>
2004-01-07 23:00:20 +00:00
Bill Paul
0fba60013b Correct and simplify the implementation of RtlEqualUnicodeString(). 2004-01-07 20:31:51 +00:00
Bill Paul
9163fadb70 It appears drivers may call NdisWriteErrorLogEntry() with locks
held. However, if we need to translate a unicode message table message,
ndis_unicode_to_ascii() might malloc() some memory, which causes
a warning from witness. Avoid this by using some stack space to hold
the translated message. (Also bounds check to make sure we don't
overrun the stack buffer.)
2004-01-07 19:26:47 +00:00
Sam Leffler
23428eafa0 When draining the tx queue reclaim any node references held in packets.
This fixes a problem when operating as an AP where clients would get
stuck in the node table because the reference count never went to zero.
2004-01-07 19:16:49 +00:00
Sam Leffler
a9c0425768 When ath_hal_stoptxdma returns an error dma is still likely stopped
so don't just stop trying to send a beacon frame or we'll be more likely
to lose sync.  This only seems to happen on some older chips.
2004-01-07 19:11:11 +00:00
Sam Leffler
7bbf937701 use ath_reset instead of ath_init when recovering from a watchdog timeout:
resetting the hardware is sufficient, no need to reset the 802.11 fsm
2004-01-07 19:07:41 +00:00
Sam Leffler
f3be79561f make hw.ath.debug a tunable 2004-01-07 19:05:35 +00:00
Sam Leffler
8c0370b75d make hw.ath.outdoor and hw.ath.countrycode tunables 2004-01-07 19:04:42 +00:00
Sam Leffler
e325e53069 split debugging messages up into classes;
ah_debug is now treated as a bit vector
2004-01-07 18:57:38 +00:00
Robert Watson
1f1ca35f69 Lock p->p_textvp before calling vn_fullpath() on it. Note the
potential lock order concern due to the vnode lock held
simultaneously by the caller into procfs.

Reported by:	kuriyama
Approved by:	des
2004-01-07 17:58:51 +00:00
Joerg Wunsch
d93dea685d Fix a long-standing bug that had been introduced in rev 1.24 with the
replacement of struct proc by struct thread.  This bug could cause a
NULL pointer dereferencation under certain circumstances (e. g. while
running /etc/rc.d/pcvt).
2004-01-07 10:12:59 +00:00
Bill Paul
e157128762 Use atomic ops for the interlocked increment and decrement routines
in subr_ndis and subr_ntoskrnl. This is faster and avoids potential
LOR whinage from witness (an LOR couldn't happen with the old code
since the interlocked inc/dec routines could not sleep with a lock
held, but this will keep witness happy and it's more efficient
anyway. I think.)
2004-01-07 07:29:27 +00:00
Bill Paul
e3c8d8194c In subr_ndis.c: correct ndis_interlock_inc() and ndis_interlock_dec()
so we increment the right thing. (All work and not enough parens
make Bill something something...) This makes the RealTek 8139C+
driver work correctly.

Also fix some mtx_lock_spin()s and mtx_unlock_spin()s that should
have been just plain mtx_lock()s and mtx_unlock()s.

In kern_ndis.c: remove duplicate code from ndis_send_packets() and
just call the senddone handler (ndis_txeof()).
2004-01-07 06:15:56 +00:00
Andre Oppermann
dba7bc6a65 Enable the following TCP options by default to give it more exposure:
rfc3042  Limited retransmit
 rfc3390  Increasing TCP's initial congestion Window
 inflight TCP inflight bandwidth limiting

All my production server have it enabled and there have been no
issues.  I am confident about having them on by default and it gives
us better overall TCP performance.

Reviewed by:	sam (mentor)
2004-01-06 23:29:46 +00:00
Andre Oppermann
87c3bd2755 According to RFC1812 we have to ignore ICMP redirects when we
are acting as router (ipforwarding enabled).

This doesn't fix the problem that host routes from ICMP redirects
are never removed from the kernel routing table but removes the
problem for machines doing packet forwarding.

Reviewed by:	sam (mentor)
2004-01-06 23:20:07 +00:00
Alan Cox
c020e821c7 Don't bother clearing PG_ZERO in contigmalloc1(), kmem_alloc(), or
kmem_malloc().  It serves no purpose.
2004-01-06 20:52:55 +00:00
Jacques Vidrine
3f6f39ff54 Remove `static' prototype from header file. 2004-01-06 20:36:21 +00:00
John Baldwin
c8d7ed0d05 - Use i8259A register defines from shared sys/dev/ic/i8259.h rather than
from the i386-specific icu.h.
- Replace PC98 magic numbers with equivalent register define values along
  with comments about PC-98 "quirks".
2004-01-06 19:07:08 +00:00
John Baldwin
1e4cad1384 Use i8259A register defines from shared header sys/dev/ic/i8259.h instead
of from the amd64-specific icu.h.
2004-01-06 19:05:25 +00:00
John Baldwin
b733b2545b Add a header for the i8259A register definitions. This is based on
additions to sys/amd64/isa/icu.h from PIIX4 and other datasheets.  I
tweaked a few comments based on the NetBSD header of the same name when I
merged the constants to sys/i386/isa/icu.h, but the vast majority of this
file was created independently by Peter and not taken from any existing
files.

Submitted by:	peter
2004-01-06 18:59:37 +00:00
John Baldwin
b277f64b8b Remove the AUTO_EOI_2 option for PC-98 as it has never done anything anyway
and was even commented out in NOTES.
2004-01-06 18:51:14 +00:00
Jacques Vidrine
1d0342a3d5 Use ANSI C function definition for _mcount' and remove static'
prototype from header file.

Discussed with:	bde, maybe one year ago
2004-01-06 18:49:54 +00:00
David E. O'Brien
b06cf654be Allow one to specify the com port settings for boot0sio. 2004-01-06 18:46:35 +00:00
Bill Paul
1cfaf27e2b Clean up pe_get_message(). Allow the caller to obtain the resource
flag so that it can see if the message string is unicode or not and
do the conversion itself rather than doing it in subr_pe.c. This
prevents subr_pe.c from being dependent on subr_ndis.c.
2004-01-06 18:06:54 +00:00
Hidetoshi Shimokawa
d09a5d6fce Remove __P(). 2004-01-06 14:30:47 +00:00
Hidetoshi Shimokawa
c3e840a89b Fix register mis-alignment introduced in rev1.12. 2004-01-06 14:24:01 +00:00
Bill Paul
09bebfadee - Add pe_get_message() and pe_get_messagetable() for processing
the RT_MESSAGETABLE resources that some driver binaries have.
  This allows us to print error messages in ndis_syslog().

- Correct the implementation of InterlockedIncrement() and
  InterlockedDecrement() -- they return uint32_t, not void.

- Correct the declarations of the 64-bit arithmetic shift
  routines in subr_ntoskrnl.c (_allshr, allshl, etc...). These
  do not follow the _stdcall convention: instead, they appear
  to be __attribute__((regparm(3)).

- Change the implementation of KeInitializeSpinLock(). There is
  no complementary KeFreeSpinLock() function, so creating a new
  mutex on each call to KeInitializeSpinLock() leaks resources
  when a driver is unloaded. For now, KeInitializeSpinLock()
  returns a handle to the ntoskrnl interlock mutex.

- Use a driver's MiniportDisableInterrupt() and MiniportEnableInterrupt()
  routines if they exist. I'm not sure if I'm doing this right
  yet, but at the very least this shouldn't break any currently
  working drivers, and it makes the Intel PRO/1000 driver work.

- In ndis_register_intr(), save some state that might be needed
  later, and save a pointer to the driver's interrupt structure
  in the ndis_miniport_block.

- Save a pointer to the driver image for use by ndis_syslog()
  when it calls pe_get_message().
2004-01-06 07:09:26 +00:00
Eric Anholt
f25a19f66f Merge from DRI CVS. No longer maps the framebuffer into KVA on radeon, r128,
and mga.  MTRR code cleanups.  Includes new Radeon and Rage 128 PCI IDs.
2004-01-06 04:34:53 +00:00
Alexander Kabaev
c969c60c60 Add pid to the info printed in lockmgr_printinfo. This makes VFS
diagnostic messages slightly more useful.
2004-01-06 04:34:13 +00:00
Alexander Kabaev
580ddfa64b More style fixes.
Obtained from:	bde
2004-01-05 23:40:46 +00:00
John Baldwin
eac097962f - Allow mtx_trylock() to recurse on a recursive mutex. Attempts to recurse
on a non-recursive mutex will fail but will not trigger any assertions.
- Add an assertion to mtx_lock() that one never recurses on a non-recursive
  mutex.  This is mostly useful for the non-WITNESS case.

Requested by:	deischen, julian, others (1)
2004-01-05 23:09:51 +00:00
Alexander Kabaev
b0fdf71656 style(9):
Add empty line before first code line in functions with no local
variables.
Properly terminate comment sentences.
Indent lines which are longer that 80 characters.
Move v_addpollinfo closer to the rest of poll-related functions.
Move DEBUG_VFS_LOCKS ifdefed block to the end of file.

Obtained from:	bde (partly)
2004-01-05 19:04:29 +00:00
Alexander Kabaev
64f4c8e8e0 Properly ifdef support for vfs locking assertions based on DEBUG_VFS_LOCKS.
Obtained from: bde
2004-01-05 18:04:02 +00:00
Alexander Kabaev
89144d1a8b Style fixes:
Remove double empty lines.
	Add tab after #define's.
	Properly terminate sentences in comments.

Obtained from:	bde (mostly).
2004-01-05 16:48:18 +00:00
Hidetoshi Shimokawa
5b50d9ade7 MFp4:
* firewire
	- Remove pending list.
	- Ignore timeout for the FWXF_START state.
	- Define M_FWMEM for debugging.
	- Comment out DELAY() in fw_asybusy().
	- Improve debugging messages
* sbp
	- Freeze simq while bus reset.
2004-01-05 14:21:18 +00:00
Poul-Henning Kamp
883bd55abd Add struct definition of the Elan MMCR registers (from jb@)
Put a CTASSERT() on the size of the struct.

Use the struct where it is easy to do so in elan_mmcr.c

Add the Elan specific hardware reset code (also from jb@).
2004-01-05 12:00:59 +00:00
MIHIRA Sanpei Yoshiro
c2f1dd4d71 Sync to 1.154 of usbdevs 2004-01-05 09:53:19 +00:00
MIHIRA Sanpei Yoshiro
15e718175b fix CANOSCAN -> CanoScan
Submitted by:	 MIYAO Akio <miyao@affrc.go.jp>
2004-01-05 09:50:33 +00:00
David E. O'Brien
c53cdbeb95 Attempt to make the proper changes here for the proc.h commit:
Make sigaltstack as per-threaded, because per-process sigaltstack state
  is useless for threaded programs, multiple threads can not share same
  stack.
  The alternative signal stack is private for thread, no lock is needed,
  the orignal P_ALTSTACK is now moved into td_pflags and renamed to
  TDP_ALTSTACK.
  For single thread or Linux clone() based threaded program, there is no
  semantic changed, because those programs only have one kernel thread
  in every process.

which left out SVR4 bits.
2004-01-05 00:29:00 +00:00
David E. O'Brien
c990f469a7 Convert to __FBSDID. 2004-01-04 23:30:47 +00:00
David E. O'Brien
bd506e2a3a Convert to __FBSDID. 2004-01-04 23:21:18 +00:00