Commit Graph

58110 Commits

Author SHA1 Message Date
John Baldwin
de49f3252c Remove some dead code.
Coverity ID:	822
Found by:	Coverity Prevent
Reviewed by:	ariff
MFC after:	1 week
2006-02-23 19:23:55 +00:00
John Baldwin
b36f458861 Use the recently added msleep_spin() function to simplify the
callout_drain() logic.  We no longer need a separate non-spin mutex to
do sleep/wakeup with, instead we can now just use the one spin mutex to
manage all the callout functionality.
2006-02-23 19:13:12 +00:00
John Baldwin
9fc9d84b9b - Use callout_init_mtx() to initialize toffhandle callout using the fdc's
mutex.
- Don't use callout_drain() to stop the toffhandle callout while holding the
  fdc mutex (this could deadlock) in functions called from softclock
  (callouts aren't allowed to do voluntary sleeps).  Instead, use
  callout_stop().  Note that since we hold the associated mutex and are now
  using callout_init_mtx(), callout_stop() is just as effective as
  callout_drain().  (Though callout_drain() is still needed in detach to
  make sure softclock isn't contesting on our mutex before we destroy the
  mutex.)
- Remove unused callout 'tohandle' from softc.

MFC after:	1 week
2006-02-23 19:11:16 +00:00
Søren Schmidt
c94b3e542e In ata_cmd_allocate() only call ata_pci_allocate once.
found by:	jhb@
2006-02-23 18:52:15 +00:00
John Baldwin
44a4a80962 Check the return value of copyin() and return an error if it fails.
Coverity ID:	839
Found by:	Coverity Prevent
MFC after:	1 week
Reviewed by:	ps, scottl
2006-02-23 18:05:38 +00:00
Andrew Gallatin
784daffb89 Unhook myri10ge from build in preparation for rename 2006-02-23 12:30:39 +00:00
David Xu
7e0221a251 1. Refine kern_sigtimedwait() to remove redundant code.
2. Fix a bug, if thread got a SIGKILL signal, call sigexit() to kill
   its process.

MFC after: 3 days
2006-02-23 09:24:19 +00:00
David Xu
7c9a98f15b Code cleanup, simply compare with curproc. 2006-02-23 05:50:55 +00:00
Jeff Roberson
8febcfb92f - Use vfs_ref/rel to protect a mountpoint from going away while VFS_STATFS
is being called.  Be sure to grab the ref before we unlock the vnode to
   prevent the mount from disappearing.

Tested by:	kris
2006-02-23 05:18:07 +00:00
Jeff Roberson
a1db11fc40 - Release the mount ref once the vnode has been recycled rather than once
the last reference is dropped.  I forgot that vnodes can stick around
   for a very long time until processes discover that they are dead.  This
   means that a vnode reference is not sufficient to keep the mount
   referenced and even more code will be required to ref mount points.

Discovered by:	kris
2006-02-23 05:15:37 +00:00
David Xu
dc94f5e383 Move comments to more accurate place. 2006-02-23 03:42:17 +00:00
David Xu
c008d51784 Fix a sleep queue race for KSE thread.
Reviewed by: jhb
2006-02-23 00:13:58 +00:00
John Baldwin
93d74675d6 G/C unused variable. 2006-02-22 21:47:04 +00:00
Sam Leffler
3f676959ae guard function decls with _KERNEL so user code can include this file
MFC after:	1 week
2006-02-22 21:38:33 +00:00
John Baldwin
daad1cd74d Fixup some comments. Mutexes's are locked, not entered for several years
now and msleep blocks threads rather than processes.
2006-02-22 20:46:10 +00:00
John Baldwin
06ad42b2f7 Close some races between procfs/ptrace and exit(2):
- Reorder the events in exit(2) slightly so that we trigger the S_EXIT
  stop event earlier.  After we have signalled that, we set P_WEXIT and
  then wait for any processes with a hold on the vmspace via PHOLD to
  release it.  PHOLD now KASSERT()'s that P_WEXIT is clear when it is
  invoked, and PRELE now does a wakeup if P_WEXIT is set and p_lock drops
  to zero.
- Change proc_rwmem() to require that the processing read from has its
  vmspace held via PHOLD by the caller and get rid of all the junk to
  screw around with the vmspace reference count as we no longer need it.
- In ptrace() and pseudofs(), treat a process with P_WEXIT set as if it
  doesn't exist.
- Only do one PHOLD in kern_ptrace() now, and do it earlier so it covers
  FIX_SSTEP() (since on alpha at least this can end up calling proc_rwmem()
  to clear an earlier single-step simualted via a breakpoint).  We only
  do one to avoid races.  Also, by making the EINVAL error for unknown
  requests be part of the default: case in the switch, the various
  switch cases can now just break out to return which removes a _lot_ of
  duplicated PRELE and proc unlocks, etc.  Also, it fixes at least one bug
  where a LWP ptrace command could return EINVAL with the proc lock still
  held.
- Changed the locking for ptrace_single_step(), ptrace_set_pc(), and
  ptrace_clear_single_step() to always be called with the proc lock
  held (it was a mixed bag previously).  Alpha and arm have to drop
  the lock while the mess around with breakpoints, but other archs
  avoid extra lock release/acquires in ptrace().  I did have to fix a
  couple of other consumers in kern_kse and a few other places to
  hold the proc lock and PHOLD.

Tested by:	ps (1 mostly, but some bits of 2-4 as well)
MFC after:	1 week
2006-02-22 18:57:50 +00:00
John Baldwin
57fb5e6097 - Use bus_setup_intr() and bus_teardown_intr() to register device driver
interrupt handlers rather than BUS_SETUP_INTR() and BUS_TEARDOWN_INTR().
  Uses of the BUS_*() versions in the implementation of foo_intr methods
  in bus drivers were not changed.  Mostly this just means that some
  drivers might start printing diagnostic messages like [FAST] when
  appropriate as well as honoring mpsafenet=0.
- Fix two more of the ppbus drivers' identify routines to function
  correctly in the mythical case of a machine with more than one ppbus.
2006-02-22 18:16:26 +00:00
John Baldwin
f8e3eeb519 Change pfs_visible() to optionally return a pointer to the process
associated with the passed in pfs_node.  If it does return a pointer, it
keeps the process locked.  This allows a lot of places that were calling
pfind() again right after pfs_visible() to not have to do that and avoids
races since we don't drop the proc lock just to turn around and lock it
again.  This will become more important with future changes to fix races
between procfs/ptrace and exit(2).  Also, removed a duplicate pfs_visible()
call in pfs_getextattr().

Reviewed by:	des
MFC after:	1 week
2006-02-22 17:24:54 +00:00
John Baldwin
54690b5679 Don't do a PHOLD() in kthread_create() w/o a matching PRELE() in
kthread_exit().  Rather than add the missing PRELE() I chose to just
axe the PHOLD() since it was redundant with the P_SYSTEM flag.

MFC after:	1 week
2006-02-22 17:21:45 +00:00
John Baldwin
7a61c1a3cb Hold the proc lock while calling proc_sstep() since the function asserts
it and remove a PRELE() that didn't have a matching PHOLD().  The calling
code already has a PHOLD anyway.

MFC after:	1 week
2006-02-22 17:20:37 +00:00
John Baldwin
3df4e47b1e Use bus_setup_intr() rather than invoking BUS_SETUP_INTR() directly so that
puc still prints out [FAST] on Peter's box.
2006-02-22 17:19:10 +00:00
John Baldwin
8f95fc2481 Various style and comment fixes.
Submitted by:	bde
2006-02-22 16:58:48 +00:00
Wayne Salamon
bc5504b942 Add pathname and/or vnode argument auditing for the following system calls:
quotactl, statfs, fstatfs, fchdir, chdir, chroot, open, mknod, mkfifo,
link, symlink, undelete, unlink, access, eaccess, stat, lstat, pathconf,
readlink, chflags, lchflags, fchflags, chmod, lchmod, fchmod, chown,
lchown, fchown, utimes, lutimes, futimes, truncate, ftruncate, fsync,
rename, mkdir, rmdir, getdirentries, revoke, lgetfh, getfh, extattrctl,
extattr_set_file, extattr_set_link, extattr_get_file, extattr_get_link,
extattr_delete_file, extattr_delete_link, extattr_list_file, extattr_list_link.

In many cases the pathname and vnode auditing is done within namei lookup
instead of directly in the system call.

Audit the remaining arguments to these system calls:
fstatfs, fchdir, open, mknod, chflags, lchflags, fchflags, chmod, lchmod,
fchmod, chown, lchown, fchown, futimes, ftruncate, fsync, mkdir,
getdirentries.
2006-02-22 16:04:20 +00:00
Gleb Smirnoff
9cc9484cb5 Back out 1.112,1.113. I don't have enough resources to fix breakages
introduced by this change.
2006-02-22 14:11:16 +00:00
Pawel Jakub Dawidek
290c616103 Do not use bio structure after g_io_deliver(), it may not longer by valid.
Found and fixed by:	Vsevolod Lobko <seva@ip.net.ua>
MFC after:		3 days
2006-02-22 10:21:05 +00:00
Jeff Roberson
c5dcb84008 - Revert r1.406 until a solution can be found that doesn't break nfs. The
statfs handler in nfs will lock vnodes which may lead to deadlock or
   recursion.

Found by:	kris
Pointy hat to:	me
2006-02-22 09:52:25 +00:00
Jeff Roberson
f50b03bfd6 - We must hold a reference to a vnode before calling vgone() otherwise
it may not be removed from the freelist.

MFC After:	1 week
Found by:	kris
2006-02-22 09:05:40 +00:00
Jeff Roberson
a4aeaefe5a - We can not hold a vnode lock while we do a lookup. Search for and load
modules prior to looking up the directory which we will cover to avoid
   this problem in mount.
 - We must hold the coveredvp locked before we can busy the mountpoint to
   prevent a lock order reversal with the vfs_busy() in lookup which holds
   the directory lock prior to doing a vfs_busy().  The directory lock is
   required to safely clear the v_mountedhere field on the directory.

MFC After:	1 week
2006-02-22 06:29:55 +00:00
Jeff Roberson
8a7cd2fdfb - Grab a mnt ref in vfs_busy() before dropping the interlock. This will
prevent the mount point from going away while we're waiting on the lock.
   The ref does not need to persist once we have the lock because the
   lock prevents the mount point from being unmounted.

MFC After:	1 week
2006-02-22 06:20:12 +00:00
Jeff Roberson
05b6a20a66 - Hold the vnode used in the statfs related functions until we're done with
the VFS_STATFS call to prevent the mount from disappearing while we're
   stating.
 - Convert these routines to use MPSAFE namei semantics.

MFC After:	1 week
2006-02-22 06:19:08 +00:00
Jeff Roberson
f5cacb3964 - spell VOP_LOCK(vp, LK_RELEASE... VOP_UNLOCK(vp,... so that asserts in
vop_lock_post do not trigger.
 - Rearrange null_inactive to null_hashrem earlier so there is no chance
   of finding the null node on the hash list after the locks have been
   switched.
 - We should never have a NULL lowervp in null_reclaim() so there is
   no need to handle this situation.  panic instead.

MFC After:	1 week
2006-02-22 06:17:31 +00:00
Jeff Roberson
9c12e63100 - Assert that the lowervp is locked in null_hashget().
- Simplify the logic dealing with recycled vnodes in null_hashget() and
   null_hashins().  Since we hold the lower node locked in both cases
   the null node can not be undergoing recycling unless reclaim somehow
   called null_nodeget().  The logic that was in place was not safe and
   was essentially dead code.

MFC After:	1 week
2006-02-22 06:15:12 +00:00
Jeff Roberson
f5a4db791d - Using LK_NOWAIT in qsync() can get us into infinite loop situations that
lead to deadlocks.  Remove it.

MFC After:	1 week
2006-02-22 06:12:53 +00:00
Jeff Roberson
578abc8e54 - Deadfs should not use the std GETWRITEMOUNT routine. Add one that always
returns NULL.

MFC After:	1 week
2006-02-22 06:11:59 +00:00
Matt Jacob
696e0ce44d Remove commented out qualifier to dumping a message. 2006-02-22 05:19:50 +00:00
David Xu
ba0360b135 Abstract function mqfs_create_node() to create a mqueue node. 2006-02-22 02:38:25 +00:00
David Xu
ad8de0f243 If block size is zero, use normal file operations to do I/O,
this eliminates a divided-by-zero fault.

Recommended by: phk
2006-02-22 00:05:12 +00:00
Sam Leffler
386d84f60e honor user-specified key index for global key slots
Submitted by:	Joe Love
Reviewed by:	avatar
MFC after:	1 week
2006-02-21 23:51:19 +00:00
John Baldwin
ca95b5146a Lock the vm_object while checking its type to see if it is a vnode-backed
object that requires Giant in vm_object_deallocate().  This is somewhat
hairy in that if we can't obtain Giant directly, we have to drop the
object lock, then lock Giant, then relock the object lock and verify that
we still need Giant.  If we don't (because the object changed to OBJT_DEAD
for example), then we drop Giant before continuing.

Reviewed by:	alc
Tested by:	kris
2006-02-21 22:09:54 +00:00
John Baldwin
bd106be404 Move the ruadd() in kern_exit() to save our final stats in our child
stats even further down in exit1() so that it includes the runtime and
tick counts from the final time slice for the dying thread.

Reviewed by:	phk
2006-02-21 21:48:42 +00:00
John Baldwin
6fc6433ecd Split calcru() back into a calcru1() function shared with calccru() and
a calcru() wrapper that passes a local rusage_ext on the stack that is
a snapshot to do the calculations on.  Now we can pass p->p_crux to
calcru1() in calccru() again which fixes the issues with runtime going
backwards messages when dead processes are harvested by init.

Reviewed by:	phk
Tested by:	Stefan Ehmann shoesoft at gmx dot net
2006-02-21 21:47:46 +00:00
Marius Strobl
0c05ab41ab - In the interrupt handler clear the interrupt source flags before
processing the interrupt events. If we clear them afterwards we
  can completely miss some events as the NIC can change the source
  flags while we're in the handler. In order to not get another
  interrupt while we're in ifp->if_input() with the driver lock
  dropped we now turn off NIC interrupts while in the interrupt
  handler. Previously this was meant to be achieved by clearing the
  interrupt source flags after processing the interrupt events but
  didn't really work as clearing these flags doesn't actually
  acknowledge and re-enable the events.
  This fixes the device timeouts seen with the VMware LANCE.
- Relax the watchdog timer somewhat; don't enable it until the last
  packet is enqueued and if there is a TX interrupt but there are
  still outstanding ones reload the timer.

Reported and tested by:	Morten Rodal <morten@rodal.no>
MFC after:		3 days
2006-02-21 20:20:43 +00:00
Ruslan Ermilov
aa00bc830f Clear csum_flags after reading data from socket buffer. Otherwise,
if ksocket is connected to an interface-type node somewhere later
in the graph (e.g., ng_eiface or ng_iface), the csum_data may be
applied to a wrong packet (if we encapsulate Ethernet or IP).

MFC after:	3 days
2006-02-21 13:04:39 +00:00
Yoshihiro Takahashi
c15ff0bc7b Initialize the port_bst and port_bsh variables.
The ed driver on pc98 was broken by if_edvar.h rev1.31.

Reported by:	Kaho Toshikazu (kaho at elam kais kyoto-u ac jp)
Tested by:	Eiji Kato (ekato at a1 mbn or jp)
MFC after:	3 days
2006-02-21 12:01:39 +00:00
Nate Lawson
ce1a23d397 Remove unused variable.
Coverity ID:	558
Found by:	Coverity Prevent
2006-02-21 03:19:24 +00:00
Nate Lawson
987b1ad6d5 Remove unused variable.
Coverity ID:	548
Found by:	Coverity Prevent
2006-02-21 03:16:58 +00:00
Nate Lawson
6dd47e5b2a Remove unused variable.
Coverity ID:	546
Found by:	Coverity Prevent
2006-02-21 03:15:26 +00:00
Sam Leffler
b197bba53b correct check for whether wpa is enabled
MFC after:	3 days
2006-02-20 20:49:56 +00:00
Sam Leffler
d3b3a464a5 treat setting the optional ie to a zero-length datum to mean "delete
the ie"; this helps drivers that (wrongly) check ic_opt_ie against NULL
when making decisions

Reviewed by:	luigi, avatar
MFC after:	3 days
2006-02-20 17:17:00 +00:00
Hajimu UMEMOTO
9bf40914d2 Obey opt_inet6.h in kernel build directory.
Reported by:	Peter Losher <plosher-keyword-freebsd.a36e57__at__plosh.net>
MFC after:	3 days
2006-02-20 12:30:32 +00:00
Yoshihiro Takahashi
58d89e5cef Disable the myri10ge driver on pc98. 2006-02-20 12:05:52 +00:00
Bernd Walter
4d3d7085f6 Copy MAC address to fix alignment problems.
Tested on alpha (AS600) with RTL8169S
Suggested by: jhb
2006-02-20 10:29:40 +00:00
Andrew Gallatin
2790e25d62 Hook the myri10ge driver to the i386 and amd64 module builds.
Sponsored by: Myricom Inc.
Reviewed by: scottl
2006-02-20 02:50:09 +00:00
Max Laier
009b3d3d4b ${.CURDIR} != pwd and since we use the shell version of if now we don't even
need to prepend it.

Found-by:	gallatin
2006-02-20 01:08:33 +00:00
Andrew Gallatin
b2fc195e1b 10GbE mode driver and binary firmware for Myricom's PCI-express NICs.
More info regarding these nics can be found at http://www.myri.com.

Please note that the files
sys/dev/myri10ge/{mcp_gen_header.h,myri10ge_mcp.h} are internally
shared between all our drivers (solaris, macosx, windows, linux, etc).
I'd like to keep these files unchanged, so I can just import newer
versions of them when the firmware API/ABI changes.  This means I'm
stuck with some of the crazy-long #define names, and possibly
non-style(9) characteristics of these files.

Many thanks to mlaier for doing firmware(9) just as I
needed it, and to scottl for his helpful review.

Reviewed by: scottl, glebius
Sponsored by: Myricom Inc.
2006-02-19 22:39:19 +00:00
Ian Dowse
199a2380fe Add a UQ_OPEN_CLEARSTALL quirk for devices that need a clear-stall
operation when a pipe is opened, and add an entry for the ST Micro
biometric CPU.

Submitted by:	Fredrik Lindberg
MFC after:	1 week
2006-02-19 14:48:02 +00:00
Marius Strobl
9789208431 - Don't bother traversing trap frames in stack_save(). This fixes panics
when option DEBUG_LOCKS is used. Trap frames are determined by checking
  whether the caller was one of the tl0_*() or tl1_*() asm functions via
  a newly added pair of dummy symbols in exception.S which mark the begin
  and end of these functions. The tl_trap_* pair marks those in the special
  .trap section and the tl_text_* in the regular .text section. Because
  of their performance penalty db_search_symbol()/db_symbol_values() and
  linker_ddb_search_symbol()/linker_ddb_symbol_values() aren't used here
  for determining the caller, with db_search_symbol()/db_symbol_values()
  additionally not being reentrant.
- For consistency, change db_backtrace() to also use the new markers for
  determining the tl0_*() and tl1_*() asm functions instead of bcmp()'ing
  the symbol name.
- Use FBSDID in db_trace.c.

PR:			93226
Based on a patch by:	Antoine Brodin <antoine.brodin@laposte.net>
Ok'ed by:		jhb
2006-02-19 11:54:46 +00:00
Yaroslav Tykhiy
c0d157d85f For the coda5 module, CODA_COMPAT_5 is mandatory, not optional.
Without CODA_COMPAT_5, it would be equivalent to the plain coda
module.  Therefore just add -DCODA_COMPAT_5 to CFLAGS instead of
fiddling with opt_coda.h.  This is particularly important when
the module is built along with the kernel and CODA_COMPAT_5 isn't
in the kernel conf file (and so not in opt_coda.h either).

MFC after:	3 days
2006-02-19 02:43:42 +00:00
Yaroslav Tykhiy
9be0cda615 Style: Remove blank lines before EOF.
Tested by:	cvs diff -B
2006-02-18 23:49:28 +00:00
Yaroslav Tykhiy
7ad7a38277 Work around the fact that nfsclient SRCS must include
nfs_diskless.c if NFS_ROOT is in effect, e.g., present
in the kernel config file.  Otherwise the built module
won't load due to an undefined reference to nfs_setup_diskless.

MFC after:	3 days
2006-02-18 23:31:49 +00:00
Andre Oppermann
80444f8803 The sysctls kern.ipc.[max_linkhdr|max_protohdr|max_hdr|max_datalen]
can't be changed from userland.  Make them read-only and provide
descriptions.

kern.ipc.max_datalen must never be less than one byte.  Enforce this
with a panic in net_init_domain().

Sponsored by:	TCP/IP Optimization Fundraise 2005
MFC after:	3 days
2006-02-18 17:16:18 +00:00
Andre Oppermann
8e8aab7aec Remove unneeded includes and provide more accurate description
to others.

Submitted by:	garys
PR:		kern/86437
2006-02-18 17:05:00 +00:00
Andre Oppermann
da3482e0f6 Add missing TH_PUSH to the TH_FLAGS enumeration.
Submitted by:	Andre Albsmeier <Andre.Albsmeier-at-siemens.com>
PR:		kern/85203
2006-02-18 16:50:08 +00:00
Robert Watson
d8ff22ea7f Add system call auditing support for sparc64.
Submitted by:	brueffer
Obtained from:	TrustedBSD Project
2006-02-18 16:36:56 +00:00
Pawel Jakub Dawidek
3d48264f02 Inform when label disappears.
MFC after:	3 days
2006-02-18 11:24:00 +00:00
Pawel Jakub Dawidek
bdf2e45a5c Allow to use g_slice_orphan() from outside.
MFC after:	3 days
2006-02-18 11:21:17 +00:00
Pawel Jakub Dawidek
c058f51257 - Do not depend on fact that file system covers entire provider.
It won't work for file systems created with -s option.
  Use better file system verfication.
- Add myself to the copyright.

MFC after:	3 days
2006-02-18 10:59:47 +00:00
Ariff Abdullah
050519958c - Fix severe crackling after long running and abusive module load / unload by
forcing DMA alignment to default buffer size.
- Make sure DMA pointer properly aligned to avoid being truncated by caller
  which causing severe underruns and random popping (especially in 32bit
  playback / recording).
- Add AC97 inverted external amplifier quirk for Maxselect x710s
  - http://maxselect.ru/

MFC after:	1 week
2006-02-18 10:24:48 +00:00
Ariff Abdullah
fba6b23875 Fix random popping while playing in 32bit by increasing default buffer size
from 4096 to 8192.

MFC after:	1 week
2006-02-18 10:23:37 +00:00
Pawel Jakub Dawidek
17fb8ae78f This function returns nothing. 2006-02-18 03:04:26 +00:00
Pawel Jakub Dawidek
33361bb5db If provider's sector size prevents reading SBLOCKSIZE bytes return
immediatelly.
2006-02-18 03:00:49 +00:00
Max Laier
ff8e7669d6 Use shell's version of if to check if the firmware really exists in the
current directory to allow user rules to create the firmware (e.g. from a
uuencoded blob).  make's version of if is evaluated too early to catch this.

Found-by:	gallatin
2006-02-18 01:38:44 +00:00
Sam Leffler
08d7a88599 use s/w bmiss facility
MFC after:	1 week
2006-02-18 01:04:08 +00:00
Sam Leffler
e3f629dff9 stop device so we don't panic on card eject
MFC after:	1 week
2006-02-18 01:03:09 +00:00
Warner Losh
2f415ac34d These files apply to all the atmel parts that freebsd is going to run on,
so name them more generically.  If we do support the MMU-less ARM7 parts,
then we'll need to, at that time, expand the files we have.
2006-02-17 22:33:13 +00:00
Warner Losh
77017e63bb This file was obsolete when committed. Catchup and delete it. 2006-02-17 22:23:36 +00:00
Tor Egge
625e6c0af4 Expand scope of marker to reduce the number of page queue scan restarts. 2006-02-17 21:02:39 +00:00
Doug Ambrisko
c094bde40d Re-work the bus attachment somewhat. Make the rids unique for
the SMI/TCO address space.  Switch the bus space I/O to the
one specific for either the SMI or TCO space.  Re-calibrate
the tick.  Add some more device id's, 82801FBR submitted by des.
This makes it work on the platforms I've tested with.

Go ahead by:	des
2006-02-17 18:46:18 +00:00
Tor Egge
db27dcc0f0 Check return value from nonblocking call to vn_start_write(). 2006-02-17 18:22:19 +00:00
Oleg Bulyzhin
1493e8838e 1) Ignore link events for MII/GMII cards if MI auto-polling disabled. This
should fix strange link state behaviour reported for bcm5721 & bcm5704c
2) Clear bge_link flag in bge_stop()
3) Force link state check after bge_ifmedia_upd(). Otherwise we can miss link
   event if PHY changes it's state fast enough.

Tested by:	phk (bcm5704c)
Approved by:	glebius (mentor)
MFC after:	1 week
2006-02-17 14:33:35 +00:00
Andre Oppermann
ec63cb90a3 Replace the 4k fixed sized jumbo mbuf clusters with PAGE_SIZE sized
jumbo mbuf clusters.  To make the variable size clear they are named
MJUMPAGESIZE.

Having jumbo clusters with the native PAGE_SIZE is more useful than
a fixed 4k size according the device driver writers using this API.

The 9k and 16k jumbo mbuf clusters remain unchanged.

Requested by:	glebius, gallatin
Sponsored by:	TCP/IP Optimization Fundraise 2005
MFC after:	3 days
2006-02-17 14:14:15 +00:00
Søren Schmidt
608e65bb2a Add r/w support for JMicron ATA RAID metadata.
Acknowledgement should definitly go to JMicron Technology for providing full
docs on the metadata format as the only vendor so far, big thanks from here.
2006-02-17 13:02:10 +00:00
Ruslan Ermilov
525312f7c0 Fix standalone module build.
Reported by:	Boris Samorodov
2006-02-17 10:52:59 +00:00
Gleb Smirnoff
ffbea430b8 Remove unused now field. 2006-02-17 09:42:49 +00:00
David E. O'Brien
40244cc2ca When linking make sure it succeeds. 2006-02-17 04:59:23 +00:00
Eric Anholt
14b4fdc4d6 Add support for the Intel E7205 chipset.
PR:		kern/91315
Submitted by:	Joerg Pulz <Joerg.Pulz@frm2.tum.de>
2006-02-17 01:40:46 +00:00
Tor Egge
6bd7e81d83 Rounding addr upwards to next 4M or 2M boundary in pmap_growkernel() could
cause addr to become 0, resulting in an early return without populating
the last PDE.

Reviewed by:	alc
2006-02-16 22:10:57 +00:00
Andre Oppermann
eaf80179e2 Have TCP Inflight disable itself if the RTT is below a certain
threshold.  Inflight doesn't make sense on a LAN as it has
trouble figuring out the maximal bandwidth because of the coarse
tick granularity.

The sysctl net.inet.tcp.inflight.rttthresh specifies the threshold
in milliseconds below which inflight will disengage.  It defaults
to 10ms.

Tested by:	Joao Barros <joao.barros-at-gmail.com>,
		Rich Murphey <rich-at-whiteoaklabs.com>
Sponsored by:	TCP/IP Optimization Fundraise 2005
2006-02-16 19:38:07 +00:00
Søren Schmidt
e3989d3ebf Add support for the JMicron JMB363 dual SATA + single PATA controller.
Documentation and HW kindly provided by JMicron.
2006-02-16 17:09:24 +00:00
Andre Oppermann
cf744713e8 In in_pcbconnect_setup() reduce code duplication and use ip_rtaddr()
to find the outgoing interface for this connection.

Sponsored by:	TCP/IP Optimization Fundraise 2005
MFC after:	2 weeks
2006-02-16 15:45:28 +00:00
Andre Oppermann
a4684d742d Make sysctl_msec_to_ticks(SYSCTL_HANDLER_ARGS) generally available instead
of being private to tcp_timer.c.

Sponsored by:	TCP/IP Optimization Fundraise 2005
MFC after:	3 days
2006-02-16 15:40:36 +00:00
David Xu
94f0972bec Fix a long standing race between sleep queue and thread
suspension code. When a thread A is going to sleep, it calls
sleepq_catch_signals() to detect any pending signals or thread
suspension request, if nothing happens, it returns without
holding process lock or scheduler lock, this opens a race
window which allows thread B to come in and do process
suspension work, however since A is still at running state,
thread B can do nothing to A, thread A continues, and puts
itself into actually sleeping state, but B has never seen it,
and it sits there forever until B is woken up by other threads
sometimes later(this can be very long delay or never
happen). Fix this bug by forcing sleepq_catch_signals to
return with scheduler lock held.
Fix sleepq_abort() by passing it an interrupted code, previously,
it worked as wakeup_one(), and the interruption can not be
identified correctly by sleep queue code when the sleeping
thread is resumed.
Let thread_suspend_check() returns EINTR or ERESTART, so sleep
queue no longer has to use SIGSTOP as a hack to build a return
value.

Reviewed by:	jhb
MFC after:	1 week
2006-02-15 23:52:01 +00:00
Stephan Uphoff
224409590d When the VM needs to allocated physical memory pages (for non interrupt use)
and it has not plenty of free pages it tries to free pages in the cache queue.
Unfortunately freeing a cached page requires the locking of the object that
owns the page. However in the context of allocating pages we may not be able
to lock the object and thus can only TRY to lock the object. If the locking try
fails the cache page can not be freed and is activated to move it out of the way
so that we may try to free other cache pages.

If all pages in the cache belong to objects that are currently locked the
cache queue can be emptied without freeing a single page. This scenario caused
two problems:

    1)  vm_page_alloc always failed allocation when it tried freeing pages from
        the cache queue and failed to do so. However if there are more than
        cnt.v_interrupt_free_min pages on the free list it should return pages
        when requested with priority VM_ALLOC_SYSTEM. Failure to do so can cause
        resource exhaustion deadlocks.

    2)  Threads than need to allocate pages spend a lot of time cleaning up the
        page queue without really getting anything done while the pagedaemon
         needs to work overtime to refill the cache.

This change fixes the first problem. (1)

Reviewed by:	tegge@
2006-02-15 22:29:53 +00:00
Sam Leffler
1d89d44f74 drop softc lock around copyin/copyout
MFC after:	2 weeks
2006-02-15 18:36:52 +00:00
Sam Leffler
d2f6ed153d fix build w/o AR_DEBUG
MFC after:	2 weeks
2006-02-15 18:35:09 +00:00
Sam Leffler
7a4c5ed92c improve tx/rx buf printing routines
MFC after:	2 weeks
2006-02-15 18:31:04 +00:00
Sam Leffler
9760f8aeb9 add missing bit from 1.130 2006-02-15 18:24:22 +00:00
Sam Leffler
16c8acaab5 o handle fatal errors directly instead of via the task queue
o temporarily dump some h/w state for diagnosis; this will be
  removed once some issues are resolved

MFC after:	2 weeks
2006-02-15 18:23:03 +00:00
Sam Leffler
e2815d6951 use ath_hal_gettxintrtxqs so we only process h/w tx
queues that have an interrupt pending

MFC after:	2 weeks
2006-02-15 18:17:53 +00:00
Sam Leffler
c66c48cba2 fixup comments 2006-02-15 18:15:49 +00:00
Sam Leffler
1539af1ef5 close race between ath_tx_start and ath_tx_processq
Reviewed by:	apatti
MFC after:	1 week
2006-02-15 18:12:24 +00:00
Marius Strobl
f8c28bb5ac For E250 and E450 enable the watchdog part of the MK48Txx as it just
works there.

MFC after:	3 days
2006-02-15 16:56:38 +00:00
David Malone
0cbae93607 It seems bit 5 of cpu_feature2 is the VMX (Virtual Machine Extensions)
bit. While I'm here, delete a comment that was cut and past from the
cpu_features code that doesn't belong here.
2006-02-15 14:48:59 +00:00
Gleb Smirnoff
37790e7f74 Fix fallout from last commit - we need to program the MAC address in em_init(). 2006-02-15 14:27:38 +00:00
Gleb Smirnoff
95c01e57d9 em_hardware_init() in em_init() is not needed, and leads to annoying
link flap.

Submitted by:	ru, Mike Tancsa
2006-02-15 13:45:02 +00:00
Gleb Smirnoff
1d66a76549 Set ifp->if_baudrate according to current speed. 2006-02-15 11:38:33 +00:00
Gleb Smirnoff
c47c580e83 - Rename em_print_link_status() to em_update_link_status().
- In em_attach() remove em_check_for_link(). Not needed here, since
  already done in em_hardware_init().
- In em_attach() replace the printing block with call to
  em_update_link_status().
- Remove modification of sc->link_state from em_hardware_init() and
  from em_media_status(). This makes em_update_link_status() a
  single point of change. Call em_update_link_status() where needed.
2006-02-15 10:51:11 +00:00
Gleb Smirnoff
eb0ec08982 - Second style(9) megacleanup.
- Rename "adapter" to "sc"/"softc", to be like other drivers.

  (-13 Kb less source code)
2006-02-15 08:39:50 +00:00
Gleb Smirnoff
a7c959fe18 Fix build. 2006-02-15 08:25:40 +00:00
Matt Jacob
1dae40eb49 a) clean up some declaration stuff (i.e., make more modern with respect
to getting rid u_int for uint and so on).

b) Turn back on 64 bit DAC support. Cheeze it a bit in that we have two
DMA callback functions- one when we have bus_addr_t > 4 bits in width and
the other which should be normal. Even Cheezier in that we turn off setting
up DMA maps to be BUS_SPACE_MAXADDR if we're in ISP_TARGET_MODE. More work
on this in a week or so.

c) Tested under amd64 and 1MB DFLTPHYS, sparc64, i386 (PAE, but insufficient
memory to really test > 4GB). LINT check under amd64.

MFC after:	1 month
2006-02-15 00:31:48 +00:00
Sam Leffler
97bcffbd74 o make driver override of net80211 parameter state consistent
with methods: instead of honoring non-zero values expect drivers
  to write their own values on return from ieee80211_ifattach
o add a define for the default h/w bmiss count

MFC after:	2 weeks
2006-02-14 17:48:56 +00:00
Ruslan Ermilov
e185ee8004 Unbreak this. 2006-02-14 15:22:24 +00:00
John Baldwin
414c4ab4c5 Fix the hw.realmem sysctl. The global realmem variable is a count of
pages, not a count of bytes.  The sysctl handler for hw.realmem already
uses ctob() to convert realmem from pages to bytes.  Thus, on archs that
were storing a byte count in the realmem variable, hw.realmem was inflated.

Reported by:	Valerio daelli valerio dot daelli at gmail dot com (alpha)
MFC after:	3 days
2006-02-14 14:50:11 +00:00
Gleb Smirnoff
207ebbc424 Move includes from if_em.h to if_em.c and sort them. 2006-02-14 13:11:36 +00:00
Yoshihiro Takahashi
42a64e5369 Disable the ipmi driver on pc98. 2006-02-14 12:55:07 +00:00
Gleb Smirnoff
23033eebf4 Do not touch ifp->if_baudrate in miibus aware drivers. 2006-02-14 12:44:56 +00:00
Gleb Smirnoff
efd19b8fd0 - Introduce ifmedia_baudrate(), which returns correct baudrate of the
given media status. [1]
- Utilize ifmedia_baudrate() in miibus_statchg() to update ifp->if_baudrate.

Obtained from:	NetBSD [1]
2006-02-14 12:10:03 +00:00
Ruslan Ermilov
ea9dce1461 When sending a packet from dummynet, indicate that we're forwarding
it so that ip_id etc. don't get overwritten.  This fixes forwarding
of fragmented IP packets through a dummynet pipe -- fragments came
out with modified and different(!) ip_id's, making it impossible to
reassemble a datagram at the receiver side.

Submitted by:	Alexander Karptsov (reworked by me)
MFC after:	3 days
2006-02-14 06:36:39 +00:00
Wayne Salamon
085a0d43ca Audit the arguments to the ptrace(2) system call.
Obtained from: TrustedBSD Project
Approved by: rwatson (mentor)
2006-02-14 01:18:31 +00:00
Wayne Salamon
bfd7575a39 Audit the arguments to the kill(2) and killpg(2) system calls.
Obtained from: TrustedBSD Project
Approved by: rwatson (mentor)
2006-02-14 01:17:03 +00:00
Sam Leffler
aaba14d7b2 fix comment and whitespace 2006-02-13 18:40:53 +00:00
Sam Leffler
fdb05e3c89 fix merge botch (duplicate processing of cabq for old cards) 2006-02-13 18:23:32 +00:00
Doug Ambrisko
1c204a5731 Tie the ipmi driver into the i386/amd64 builds. 2006-02-13 17:56:24 +00:00
John Baldwin
66de9771a8 Use a wildcard unit (-1) to device_find_child() in our identify routine to
match the wildcard unit passed to BUS_ADD_CHILD().
2006-02-13 17:53:39 +00:00
Doug Ambrisko
19d61f3f27 Don't conflict with the DEBUG define. 2006-02-13 16:50:45 +00:00
Søren Schmidt
2ca38c74df Add a reset of the AHCI machinery to the ICH6/ICH7 support.
This should fix the missed devices on some systems.
2006-02-13 13:47:58 +00:00
David Xu
d8267df729 In order to speed up process suspension on MP machine, send IPI to
remote CPU. While here, abstract thread suspension code into a function
called sig_suspend_threads, the function is called when a process received
a STOP signal.
2006-02-13 03:16:55 +00:00
Pawel Jakub Dawidek
bf31327cca On component state change to ACTIVE don't forget to update metadata.
MFC after:	3 days
2006-02-12 17:38:09 +00:00
Pawel Jakub Dawidek
01f1f41c25 Use time_uptime instead of time_second, as the latter may go backwards.
Suggested by:	ru
MFC after:	3 days
2006-02-12 17:36:09 +00:00
Gleb Smirnoff
2ce61916c2 Typo: s/fint/find/ 2006-02-12 17:32:59 +00:00
Ian Dowse
496a1b8908 Add USB polling calls to umass_cam_poll(). This appears to be enough
to make kernel crash dumps to umass devices work, at least in some
cases.
2006-02-12 15:51:03 +00:00
Hajimu UMEMOTO
430683286b avoided the use of purged address structure when an address became
invalid in nd6_timer().

PR:		kern/93170
Reported by:	kris
Submitted by:	JINMEI Tatuya <jinmei__at__isl.rdc.toshiba.co.jp>
Confirmed by:	kris
Obtained from:	KAME
MFC after:	2 days
2006-02-12 15:37:08 +00:00
Robert Watson
13f322c2fc Improve consistency of return() style.
MFC after:	3 days
2006-02-12 15:00:27 +00:00
Robert Watson
5652c15c24 In quotaoff(), lock the vnode instead of asserting it when manipulating
v_vflags.

MFC after:	1 week
Submitted by:	Antoine Brodin <antoine at brodin at laposte dot net>
2006-02-12 13:20:06 +00:00
Ariff Abdullah
34733eb529 Fix possible DMA leak and locking violation especially
during suspend <-> resume and module load <-> unload.

PR:		kern/92764
MFC after:	3 days
2006-02-12 10:42:47 +00:00
Scott Long
b5a531ae40 Give the asr softc list global a proper name. 2006-02-12 06:57:41 +00:00
Pawel Jakub Dawidek
67cae8aab8 Allow to set kern.geom.raid3.disconnect_on_failure from loader.conf.
MFC after:	3 days
2006-02-12 02:01:38 +00:00
Robert Watson
bad70a881b Add stub AUE_EACCESS entry.
Obtained from:	TrustedBSD Project
2006-02-11 23:55:08 +00:00
Robert Watson
ba7f6690f1 Initialize user process audit ID to AU_DEFAUDITID so that init and
its pre-authentication children are covered by naflags.

Obtained from:	TrustedBSD Project
2006-02-11 23:53:00 +00:00
Robert Watson
4a99d6f90a Instead of asserting the vnode lock before manipulating v_vflag, acquire
it and drop it afterwards.

Found by:	kris
MFC after:	1 week
2006-02-11 21:09:27 +00:00
Ruslan Ermilov
fc07e4027a Don't count output bytes twice (the byte accouting is done
in if.c).  Count output errors.

MFC after:	3 days
2006-02-11 20:25:00 +00:00
Marcel Moolenaar
e13946c127 Correct the spinlock nesting of the idle thread of the APs before we
save the MCA state of the AP. Saving the MCA state of the AP requires
us to allocate memory, which uses sleep locks.
Now that we correct the spinlock nesting of the AP without having
schedlock, avoid calling spinlock_exit(). Instead call critical_exit()
and manually clear the MD spinlock count.

MFC after: 3 days
2006-02-11 19:55:18 +00:00
Robert Watson
082dc776db Skip per-cpu caches associated with absent CPUs when generating a
memory statistics record stream via sysctl.

MFC after:	3 days
2006-02-11 19:20:56 +00:00
Pawel Jakub Dawidek
3aae74ec02 - Add kern.geom.raid3.disconnect_on_failure sysctl/tunnable (default to 1
to preserve currect behaviour). When set to 0, components are not
  disconnected - graid3 will try to still use them (only first error will
  be logged). This is helpful when we have two broken components, but in
  different places, so actually all data is available.
  Such buggy component will be visible in 'graid3 list' output with flag
  BROKEN.
- Never disconnect the last valid component. If we detect errors there we
  will just pass them up. This wasn't reasonable to deny access to the
  whole provider because of one broken sector.

Prodded by:	ru
MFC after:	3 days
2006-02-11 17:42:31 +00:00
Pawel Jakub Dawidek
d4b0268a24 - Add kern.geom.mirror.disconnect_on_failure sysctl/tunnable (default to 1
to preserve currect behaviour). When set to 0, components are not
  disconnected - gmirror will try to still use them (only first error will
  be logged). This is helpful when we have two broken components, but in
  different places, so actually all data is available.
  Such buggy component will be visible in 'gmirror list' output with flag
  BROKEN.
- Never disconnect the last valid component. If we detect errors there we
  will just pass them up. This wasn't reasonable to deny access to the
  whole provider because of one broken sector.

Prodded by:	ru
MFC after:	3 days
2006-02-11 17:39:29 +00:00
Pawel Jakub Dawidek
17fec17e77 Correct typo. 'fbp' is NULL here so this will result in a panic.
MFC after:	3 days
2006-02-11 17:29:06 +00:00
Pawel Jakub Dawidek
0962f94295 Mark array as CLEAN when there are no write requests in
kern.geom.raid3.idletime seconds. Write, not any requests.
Mark array as clean immediatelly on last write close.

Prodded by:	ru
MFC after:	3 days
2006-02-11 14:42:58 +00:00
Pawel Jakub Dawidek
fe6f94ea84 Mark array as CLEAN when there are no write requests in
kern.geom.mirror.idletime seconds. Write, not any requests.
Mark array as clean immediatelly on last write close.

Prodded by:	ru
MFC after:	3 days
2006-02-11 14:42:23 +00:00
Pawel Jakub Dawidek
9af2131b78 Teach geli how to load keyfiles before root file system is mounted.
An example entries for loader.conf to make it possible:

geli_da0_keyfile0_load="YES"
geli_da0_keyfile0_type="da0:geli_keyfile0"
geli_da0_keyfile0_name="/boot/keys/da0.key0"
geli_da0_keyfile1_load="YES"
geli_da0_keyfile1_type="da0:geli_keyfile1"
geli_da0_keyfile1_name="/boot/keys/da0.key1"
geli_da0_keyfile2_load="YES"
geli_da0_keyfile2_type="da0:geli_keyfile2"
geli_da0_keyfile2_name="/boot/keys/da0.key2"

geli_da1s3a_keyfile0_load="YES"
geli_da1s3a_keyfile0_type="da1s3a:geli_keyfile0"
geli_da1s3a_keyfile0_name="/boot/keys/da1s3a.key"

Thanks for jhb and kan who showed me the right direction.

MFC after:	3 days
2006-02-11 13:08:24 +00:00
Pawel Jakub Dawidek
a80f82a4a3 Check rootvnode variable to see if we still want to ask for passphrase on
boot. Other methods just don't work properly.

MFC after:	3 days
2006-02-11 12:45:01 +00:00
Poul-Henning Kamp
e8444a7e6f CPU time accounting speedup (step 2)
Keep accounting time (in per-cpu) cputicks and the statistics counts
in the thread and summarize into struct proc when at context switch.

Don't reach across CPUs in calcru().

Add code to calibrate the top speed of cpu_tickrate() for variable
cpu_tick hardware (like TSC on power managed machines).

Don't enforce monotonicity (at least for now) in calcru.  While the
calibrated cpu_tickrate ramps up it may not be true.

Use 27MHz counter on i386/Geode.

Use TSC on amd64 & i386 if present.

Use tick counter on sparc64
2006-02-11 09:33:07 +00:00
Warner Losh
e1fa2d9556 Use the correct address for the ohci device. 2006-02-11 03:58:07 +00:00
Warner Losh
6600b2ce30 Use ETHER_ADDR_LEN rather than 6. 2006-02-11 03:50:03 +00:00
Warner Losh
0085aa8869 Improve the memory resoruce allocation and usage during the probe.
I've had these improvements in my tree for almost a year now...
2006-02-11 03:41:20 +00:00
Warner Losh
55303171a4 Use the release version as a floor, not an exact match. Add comment to that
effect and draw attention to the fact that the list has stronger ordering
requirements than before.
2006-02-11 03:30:17 +00:00
Warner Losh
5df2beab5b Give ohci_intr a proper return value. In FreeBSD, this is void. Remove
now-redundant cast on establishing the interrupt.
2006-02-11 03:29:02 +00:00
Warner Losh
da8341a31a Update the keyspan product list from NetBSD. 2006-02-11 03:27:57 +00:00
Matt Jacob
444dd2b669 Do initial cut of SAS HBA support. These controllers (106X) seem to support
automatically both SATA and SAS drives.  The async SAS event handling we catch
but ignore at present (so automagic attach/detach isn't hooked up yet).

Do 64 bit PCI support- we can now work on systems with > 4GB of memory.

Do large transfer support- we now can support up to reported chain depth, or
the length of our request area. We simply allocate additional request elements
when we would run out of room for chain lists.

Tested on Ultra320, FC and SAS controllers on AMD64 and i386 platforms.
There were no RAID cards available for me to regression test.

The error recovery for this driver still is pretty bad.
2006-02-11 01:35:29 +00:00
Doug Ambrisko
37b1ce132c Add an OpenIPMI mostly compatible driver. This driver was developed
to work with ipmitools.  It works with other tools that have an OpenIPMI
driver interface.  The port will need to get updated to used this.
I have not implemented the IPMB mode yet so ioctl's for that don't
really do much otherwise it should work like the OpenIPMI version.
The ipmi.h definitions was derived from the ipmitool header file.
The bus attachments are done for smbios and pci/smbios.  Differences
in bus probe order for modules/static are delt with.  ACPI attachment
should be done.

This drivers registers with the watchdod(4) interface

Work to do:
     - BT interface
     - IPMB mode

This has been tested on Dell PE2850, PE2650 & PE850 with i386 & amd64
kernel.

I will link this into the build on next week.

Tom Rhodes, helped me with the man page.

Sponsored by:   IronPort Systems Inc.
Inspired from:  ipmitool & Linux
2006-02-10 20:51:35 +00:00
Sam Leffler
bd5a9920c2 Update for rev 0.9.16.16 hal:
o add dfs+radar hooks; DFS is presently disabled in the hal
o channel and mode handling changes
o various api changes
o be more aggressive about iq calibration settling so ap mode
  operation is better immediately after startup
o rfkill/rfsilent sysctl support
o tpc ack/cts sysctl support

MFC after:	2 weeks
2006-02-10 19:07:08 +00:00
Sam Leffler
1be92ea1ca resolve merge conflicts
MFC after:	2 weeks
2006-02-10 19:01:02 +00:00
Sam Leffler
07c5770b96 This commit was generated by cvs2svn to compensate for changes in r155511,
which included commits to RCS files with non-trunk default branches.
2006-02-10 18:57:38 +00:00
Sam Leffler
c6f3555125 Version 0.9.16.16:
o new chip support
o new platforms: powerpc-be-elf, sparc64-be-elf, and alpha-elf
  (alpha is untested, others are known to work)
o many fixes and improvements

MFC after:	2 weeks
2006-02-10 18:57:38 +00:00
Rink Springer
424d9b482d Cleaned the memory initialization up, moved some defines from the framebuffer
to an include file.

Reviewed by:		imp
Approved by:		imp (mentor)
2006-02-10 18:48:22 +00:00
Ed Maste
11edc47706 Bump the MODULE_VERSION for HEAD, as the vlan(4) API is different in
RELENG_6, and would require a lower version number.

Requested by:	glebius
Approved by:	rwatson (mentor)
2006-02-10 18:38:33 +00:00
John Baldwin
ccabcacb30 Correctly set MNTK_MPSAFE flag from the lower vnode's mount rather than
always turning it on along with any flags set in the lower mount.

Tested by:	kris
Reviewed by:	jeff
MFC after:	3 days
2006-02-10 18:06:49 +00:00
David Xu
42925630b6 Test before modifying p_sflag to avoid unconditionally cache line
ping-pong on SMP.
2006-02-10 14:59:16 +00:00
Yaroslav Tykhiy
802dadcfeb Avoid frobbing IFF_UP at any cost (which is close to
zero in this case.)  A kernel driver has IFF_DRV_RUNNING
at its full disposal while IFF_UP may be toggled only by
humans or their daemonic deputies from the userland.

MFC after:	3 days
2006-02-10 11:01:10 +00:00
David Xu
71b7afb2b4 Call thread_stopped in thr_exit to notify parent that the child process
is now fully stopped, this was already in kse_exit().
2006-02-10 03:34:29 +00:00
Sam Leffler
e35a02a97d pad for future statistics
MFC after:	2 weeks
2006-02-09 22:37:33 +00:00
Sam Leffler
f9748b9d0d Minor tx path cleanups:
o assume all data frames have been classified so there's no need
  to check if QoS is being used, just fetch the wme priority from
  the mbuf
o fix double counting of noack frames
o fix nearby comment

MFC after:	2 weeks
2006-02-09 22:34:34 +00:00
Sam Leffler
b2792ff681 correct handling of mbuf allocation failure when replenishing the rx list
(leave a printf for the moment, need to make a debug msg)

Obtained from:	atheros
MFC after:	2 weeks
2006-02-09 22:29:23 +00:00
Sam Leffler
80d939bfba Beacon timer setup fixes:
o pull nexttbtt forward in adhoc mode too
o resync beacon timers on joining a bss or ibss as the tstamp we
  collected while scanning is almost certainly out of date

Note we may need to refine the ibss mode check in ath_recv_mgmt.

Reviewed by:	avatar, dyoung
Obtained from:	atheros
MFC after:	2 weeks
2006-02-09 22:21:53 +00:00
Sam Leffler
2c27b2f635 only start the cab queue if there are frames to send
MFC after:	2 weeks
2006-02-09 22:14:11 +00:00
Sam Leffler
370572d951 debug fixups: reduce noise msgs, report channel flags on reset failure,
mark data+link fields in descriptor dumps

MFC after:	2 weeks
2006-02-09 22:12:28 +00:00
Ed Maste
7f8b993473 Add a MODULE_VERSION so that other modules (perhaps third-party) can
depend on this one.

Approved by:	rwatson (mentor)
2006-02-09 22:11:58 +00:00
Sam Leffler
d7736e139e Phantom beacon miss workaround: track the tsf of the last received
frame and if we get a beacon miss interrupt ignore it if we've received
a frame within the beacon miss interval.  This should never trigger
and the handling at the net80211 layer should likewise deal with this
but it doesn't hurt and can suppress extranous probe request frames.
Note that we can legtimately get a bmiss when under heavy load.

MFC after:	2 weeks
2006-02-09 22:03:26 +00:00
Sam Leffler
0bbf544158 use a private task queue thread
MFC after:	2 weeks
2006-02-09 21:48:51 +00:00
Sam Leffler
7a04dc27c1 add adhoc demo mode support
MFC after:	2 weeks
2006-02-09 21:42:53 +00:00
Sam Leffler
17f3f177e4 make regdomain sysctl r/w in case it's possible to do this in the future
MFC after:	2 weeks
2006-02-09 21:36:00 +00:00
Sam Leffler
6c4612b94d cleanup rate setup
MFC after:	2 weeks
2006-02-09 21:31:48 +00:00
Qing Li
eee9df08bd Set the M_ZERO flag when calling uma_zalloc() to allocate a syncache entry.
Reviewed by:	andre, glebius
MFC after:	3 days
2006-02-09 21:29:02 +00:00
Sam Leffler
86e07743eb add tx99 hooks
MFC after:	2 weeks
2006-02-09 21:28:11 +00:00
Sam Leffler
ffa2cab632 move hal statistics to softc; the per-node stats are overkill, they're
only used when operating in station mode

MFC after:	2 weeks
2006-02-09 21:23:44 +00:00
Sam Leffler
913a1ba103 lookup the protection tx rate index in the rate tables
instead of using a known value

MFC after:	2 weeks
2006-02-09 21:17:28 +00:00
Sam Leffler
8b5341de05 honor net80211 mcast tx rate
MFC after:	2 weeks
2006-02-09 21:15:36 +00:00
Sam Leffler
6f890873fb craft unique names for tx q + buffer mtx's to help with interpreting ktr data
MFC after:	2 weeks
2006-02-09 21:09:26 +00:00
Sam Leffler
e2d787fa61 allow the size of tx+rx buffer pools to be tuned
MFC after:	2 weeks
2006-02-09 21:03:25 +00:00
Sam Leffler
be61348037 lower try count on mgt (and ctl) frames to avoid clogging the tx queue
and loading the bss when operating in ap mode under load; adjust recognition
of multi-rate retry to match

MFC after:	2 weeks
2006-02-09 20:57:48 +00:00
Søren Schmidt
466be09c2a Unbreak Promise SATAII/150 controllers caused by the DMA dump changes. 2006-02-09 20:54:42 +00:00
Søren Schmidt
0a3a1935b3 Unbreak dump on legacy systems. Needs a more clean solution but that is
more intrusive and can wait 'til after 6.1
2006-02-09 20:53:32 +00:00
Sam Leffler
55f63772e8 move mgt frame tx rate responsibility from the rate control modules
to the driver; this avoids redundant logic and will be necessary
for future additions

MFC after:	2 weeks
2006-02-09 20:49:55 +00:00
Sam Leffler
b91bf513f3 sync with latest code in madwifi
Obtained from:	madwifi
MFC after:	2 weeks
2006-02-09 20:40:28 +00:00
Gleb Smirnoff
4f4a363562 Fix two important typos in watchdog handling:
- Restart watchdog if we *did* processed any descriptors. [1]
- Log the watchdog event if the link is *up*. [2]

PR:		kern/92948 [1]
Submitted by:	Mihail Balikov <mihail.balikov interbgc.com> [1]
PR:		kern/92895 [2]
Submitted by:	Vladimir Ivanov <wawa yandex-team.ru> [2]
2006-02-09 12:57:17 +00:00
Yoshihiro Takahashi
d41b34d1cd MFi386: revision 1.622.
> Clear carry flag in get_mcontext so that setcontext does not
> return a bogus error.

MFC after:	3 days
2006-02-09 11:50:22 +00:00
Yoshihiro Takahashi
2afd016ce3 The asr driver was moved to NOTES for i386. So 'nodevice asr' is not
needed anymore.
2006-02-09 11:43:13 +00:00
Gleb Smirnoff
3bbbf02d3c - Increase maximum number of interfaces to 2048.
- Regroup softc so that frequently used elements are
  grouped in the beginning, while the interfaces
  array is at the end.
2006-02-09 11:42:17 +00:00
Yaroslav Tykhiy
84d8f1b027 Avoid calling CPUID function 0x02 if the CPU reports no support for
it.  The former code used to hang older Intel CPUs by trying to get
non-existent TLB info 2^32 times.

Reduce code duplication around the calls to CPUID 0x02 by using
do-while loops.

PR:		i386/92977
Tested by:	cy
2006-02-09 09:10:54 +00:00
Qing Li
c1fd993af9 Redo the previous fix by setting the UMA_ZONE_ZINIT bit in the syncache
zone, eliminating the need to call bzero() after each syncache entry
allocation.

Suggested by:	glebius
Reviewed by:	andre
MFC after:	3 days
2006-02-08 23:32:57 +00:00
Lukas Ertl
d9a7dc858a Catch the case when a subdisk has no provider or no consumer
attached to it.
2006-02-08 21:32:45 +00:00
Sam Leffler
6d049ab343 set the mgt frame tx timer before dispatching the frame to the
driver; this closes a race where a response could be processed
before the timer was started and cause a RUN->SCAN state change
when operating in station mode

Reviewed by:	avatar, dyoung
MFC after:	1 week
2006-02-08 17:30:31 +00:00
Poul-Henning Kamp
eb2da9a51f Simplify system time accounting for profiling.
Rename struct thread's td_sticks to td_pticks, we will need the
other name for more appropriately named use shortly.  Reduce it
from uint64_t to u_int.

Clear td_pticks whenever we enter the kernel instead of recording
its value as reference for userret().  Use the absolute value of
td->pticks in userret() and eliminate third argument.
2006-02-08 08:09:17 +00:00
George V. Neville-Neil
f2b1bd14dc Fix for an inappropriate bzero of the ICMPv6 stats. The code was zero'ing the wrong structure member but setting the correct one.
Submitted by:	James dot Juran at baesystems dot com
Reviewed by:	gnn
MFC after:	1 week
2006-02-08 07:16:46 +00:00
Matt Jacob
c68a0f14fd Garbage collect a file that no longe is used (replaced by mpi_log_fc.h). 2006-02-08 05:58:25 +00:00
Robert Watson
a7f18116c2 Acquire vnode lock around call to VOP_GETATTR() in audit_record_write().
In the future, we may want to acquire the lock early in the function and
hold it across calls to vn_rdwr(), etc, to avoid multiple acquires.

Spotted by:	kris (bugmagnet)
Obtained from:	TrustedBSD Project
2006-02-07 23:44:31 +00:00
Olivier Houchard
e56b7f20a0 Set the MAC address after we just read it at attach time, as it seems needed. 2006-02-07 21:31:13 +00:00
Poul-Henning Kamp
5b1a8eb397 Modify the way we account for CPU time spent (step 1)
Keep track of time spent by the cpu in various contexts in units of
"cputicks" and scale to real-world microsec^H^H^H^H^H^H^H^Hclock_t
only when somebody wants to inspect the numbers.

For now "cputicks" are still derived from the current timecounter
and therefore things should by definition remain sensible also on
SMP machines.  (The main reason for this first milestone commit is
to verify that hypothesis.)

On slower machines, the avoided multiplications to normalize timestams
at every context switch, comes out as a 5-7% better score on the
unixbench/context1 microbenchmark.  On more modern hardware no change
in performance is seen.
2006-02-07 21:22:02 +00:00
Olivier Houchard
9bfe35c80d Set m_pkthdr.len and m_pkthdr.rcvif. 2006-02-07 20:48:52 +00:00
Qing Li
6b7b44acd9 The code in rn_walktree_from() that checks if we backed up too far
did not stop at the right node. Change the backtracking check from
smaller-than to smaller-or-equal to prevent this from happening.
While here fix one additional problem where the insertion of the
default route traversed the entire tree.

PR:		kern/38752
Submitted by:	qingli (before I became committer)
Reviewed by:	andre
MFC after:	3 days
2006-02-07 20:25:39 +00:00
Qing Li
d03e5467a4 Remove two unnecessary type casts, of which both had a typo in
it anyways.

Approved by: andre
MFC after: 3 days
2006-02-07 20:09:02 +00:00
Qing Li
737b12e98f Fixes a crash due to the memory of the newly allocated syncache entry
in syncache_lookup() is not cleared and may lead to an arbitrary and
bogus rtentry pointer which later gets free'd.

Reviewed by: andre
MFC after: 3 days
2006-02-07 19:59:46 +00:00
John Baldwin
222fdf4bff Provide some anti-footshooting. Don't allow the user to set the interval
for acctwatch() runs to be negative or zero as this could result in either
a possible hang (or panic if INVARIANTS is on).  Previously the accounting
code handled the <= 0 case by calling acctwatch on every clock tick (eww!)
due to an implementation detail of callout_reset().  (Tick counts of
<= 0 are converted to 1).

MFC after:	3 days
2006-02-07 18:59:47 +00:00
Warner Losh
37a395c110 This file isn't GENERIC, so change the header 2006-02-07 18:45:54 +00:00
Warner Losh
e51680a229 Rather than pull in all the phy, just pull in the lxt phy that we need
for this board (although our lxtphy driver isn't claiming it, but that's
a different problem).

This saves 57k in this kernel.
2006-02-07 18:43:46 +00:00
Warner Losh
ca6831c711 Allow one to subset phy. If you want the kitchen sink, use device
miibus (like today).  If you want a subset, choose device mii and zero
or more phy to include.  We always include unkphy.  We make use of
the | functionality that ruslan recently added to config.

This allowed me to trim 57k from my KB9202 kernel.
2006-02-07 18:41:56 +00:00
Warner Losh
22293c3afb Detach the children before we delete them. This is a little cleaner
than just deleting them.  Also add comments about why we do this.
Given the current behavior of delete_child, I don't think this changes
anything.  It just feels cleaner.
2006-02-07 18:38:51 +00:00
Yaroslav Tykhiy
a35ebcc25d INET doesn't belong to opt_inet6.h: INET6 belongs to it. 2006-02-07 18:13:56 +00:00
Christian Brueffer
9864500624 Clean up some sysctl descriptions, debug messages etc.
Approved by:	pjd
MFC after:	3 days
2006-02-07 17:23:22 +00:00
John Baldwin
505a14934e - Add a kthread to periodically call acctwatch() when accounting is active
instead of calling acctwatch() from softclock.  The acctwatch() function
  needs to hold an sx lock and also makes a VFS call, and neither of these
  are good things (or safe) to do from a callout.  The kthread only exists
  and is running when accounting is turned on; it is started and stopped
  as needed.  I didn't run acctwatch() via the thread taskqueue at Robert's
  request as he was worried that if the accounting file was over NFS the
  VFS_STAT() calls might stall other work on the taskqueue.
- Add an acct_disable() function to take care of closing the accounting
  vnode and cleaning up so we don't duplicate the same code in two
  different places.

MFC after:	3 days
2006-02-07 16:04:03 +00:00
Robert Watson
860ae58e3f Fix queue drop logic when the queue overflows: decrement queue length.
Obtained from:	TrustedBSD Project
2006-02-07 14:46:26 +00:00
Ruslan Ermilov
ee439c43ae Remove .depend when doing "make cleandir". 2006-02-07 13:37:26 +00:00
Gleb Smirnoff
d640400bc5 Since em(4) taskqueue is a new network context, we need to conditionally
lock Giant here.

Submitted by:	Andrey V. Elsukov <bu7cher yandex.ru>
2006-02-07 13:11:13 +00:00
Oleg Bulyzhin
6edb555dbc Fix five years old bug in ip_reass(): if we are using 'full' (i.e. including
pseudo header) hardware rx checksum offloading ip_reass() fails to calculate
TCP/UDP checksum for reassembled packet correctly.  This also should fix
recent 'NFS over UDP over bge' issue exposed by if_bge.c rev. 1.123

Reviewed by:	sam (earlier version), bde
Approved by:	glebius (mentor)
MFC after:	2 weeks
2006-02-07 11:48:10 +00:00
Jeff Roberson
fbf586bd40 - No need to WANTPARENT when we're just going to vrele it in a deadlock
prone way later.

Reported by:	kkenn
MFC After:	3 days
2006-02-07 11:31:32 +00:00
Marcel Moolenaar
f9d7b4d515 Allocate memory for the MCA state information with M_NOWAIT. We can
get a MCA event at any moment and it may not be safe to sleep.

MFC after: 3 days
2006-02-07 02:02:14 +00:00
Robert Watson
09daf1c828 Add support for audit pipe special devices, which allow user space
applications to insert a "tee" in the live audit event stream.  Records
are inserted into a per-clone queue so that user processes can pull
discreet records out of the queue.  Unlike delivery to disk, audit pipes
are "lossy", dropping records in low memory conditions or when the
process falls behind real-time events.  This mechanism is appropriate
for use by live monitoring systems, host-based intrusion detection, etc,
and avoids applications having to dig through active on-disk trails that
are owned by the audit daemon.

Obtained from:	TrustedBSD Project
2006-02-06 22:50:39 +00:00
Robert Watson
c9d97251e3 Alphabetize. 2006-02-06 22:34:29 +00:00
Robert Watson
cba07e4acc Manage audit record memory with the slab allocator, turning
initialization routines into a ctor, tear-down to a dtor, cleaning
up, etc.  This will allow audit records to be allocated from
per-cpu caches.

On recent FreeBSD, dropping the audit_mtx around freeing to UMA is
no longer required (at one point it was possible to acquire Giant
on that path), so a mutex-free thread-local drain is no longer
required.

Obtained from:	TrustedBSD Project
2006-02-06 22:30:54 +00:00
Olivier Houchard
ea9f99ddcd - Call mii_phy_probe() after we allocated an ifp. mii has this evil
hack where it assumes the first field of the driver softc is the struct
ifnet, and it copies its value in mii_phy_probe().
- In the interrupt handler, set the mbuf m_len field on packet receive.
2006-02-06 22:17:42 +00:00
Robert Watson
ce41b52994 Regenerate. 2006-02-06 22:15:00 +00:00
Robert Watson
68b21daa64 Assign audit event identifiers to ibcs2 system calls.
Obtained from:	TrustedBSD Project
2006-02-06 22:14:50 +00:00
John Baldwin
8917b8d28c - Always call exec_free_args() in kern_execve() instead of doing it in all
the callers if the exec either succeeds or fails early.
- Move the code to call exit1() if the exec fails after the vmspace is
  gone to the bottom of kern_execve() to cut down on some code duplication.
2006-02-06 22:06:54 +00:00
John Baldwin
809f984b21 Add a kern_eaccess() function and use it to implement xenix_eaccess()
rather than kern_access().

Suggested by:	rwatson
2006-02-06 22:00:53 +00:00
John Baldwin
934ba9b2cf - Move the wakeup() for exiting kthreads out of exit1() and into
kthread_exit() as that is cleaner and less obscured.  It also does the
  wakeup sooner.
- Add some comments to kthread_exit().
2006-02-06 21:56:13 +00:00
John Baldwin
2c9d9d392a We don't need the proc lock to check P_KTHREAD on curthread since it is
only set before the kthread starts executing and is never cleared.
2006-02-06 21:54:47 +00:00
Søren Schmidt
52c7e322b2 Unbreak DMA dumo on Intel 31224. 2006-02-06 19:17:48 +00:00
Olivier Houchard
123f34932c Use memory clobbers, to be on the safe side.
Suggested by:	jhb
2006-02-06 18:29:05 +00:00
Olivier Houchard
2a3b10658d rwlock expects the struct thread to be aligned on 8 bytes, so make sure
thread0 is.
2006-02-06 16:03:10 +00:00
Ruslan Ermilov
e497d0cdba Two fixes:
- Run send queue down to completion, not just one packet.
  It has been observed to cause a stall queue otherwise.

- Prevent queueing multiple function calls to a node.

MFC after:	3 days
2006-02-06 14:30:21 +00:00
Jeff Roberson
04f6d3effa - Add a ref count to the mount structure. Sleep for up to 3 seconds in
vfs_mount_destroy waiting for this ref to hit 0.  We don't print an
   error if we are rebooting as the root mount always retains some refernces
   by init proc.
 - Acquire a mnt ref for every vnode allocated to a mount point.  Drop this
   ref only once vdestroy() has been called and the mount has been freed.
 - No longer NULL the v_mount pointer in delmntque() so that we may release
   the ref after vgone() has been called.  This allows us to guarantee
   that the mount point structure will be valid until the last vnode has
   lost its last ref.
 - Fix a few places that rely on checking v_mount to detect recycling.

Sponsored by:	Isilon Systems, Inc.
MFC After:	1 week
2006-02-06 10:19:50 +00:00
Jeff Roberson
2f0bca553a - Don't check v_mount for NULL to determine if a vnode has been recycled.
Use the more appropriate VI_DOOMED flag instead.

Sponsored by:	Isilon Systems, Inc.
MFC After:	1 week
2006-02-06 10:15:27 +00:00
Jeff Roberson
b73f64c484 - Fix silly VI locking that is used to check a single flag. The vnode
lock also protects this flag so it is not necessary.
 - Don't rely on v_mount to detect whether or not we've been recycled, use
   the more appropriate VI_DOOMED instead.

Sponsored by:	Isilon Systems, Inc.
MFC After:	1 week
2006-02-06 10:14:12 +00:00
Jeff Roberson
36a52c3cae - Add the global 'rebooting' variable that is used to detect when
boot() has been called.

Sponsored by:	Isilon Systems, Inc.
MFC After:	1 week
2006-02-06 10:12:00 +00:00
Jeff Roberson
c4be19469a - Remove ifdef disabled code that doesn't have a chance of working anymore. 2006-02-06 10:10:42 +00:00
David Xu
ea8e65b0fa Add members pl_sigmask and pl_siglist into ptrace_lwpinfo to get lwp's
signal mask and pending signals.
2006-02-06 09:41:56 +00:00
Robert Watson
9653775b18 Regenerate. 2006-02-06 02:00:32 +00:00
Robert Watson
c983324ef5 Prefer AUE_FOO audit identifiers to AUE_O_FOO, which are largely left
over from the Darwin implementation.

When we implement a system call as a wrapper to sysctl(), audit it as
AUE_SYSCTL.  This leads to greater compatibility with Solaris audit
trails as sysctl() argument tokens are not the same as the ones for
the originaly system calls (i.e., setdomainname()).

Replace references to AUE_ events that are equivilent to AUE_NULL with
AUE_NULL.  In the case of process signal configuration, this is
because these events do not require auditing.

Move from the Darwin spelling of getsockopt() to the FreeBSD/Solaris
one.

Audit nmount().

Obtained from:	TrustedBSD Project
2006-02-06 02:00:06 +00:00
Robert Watson
89964dd284 When exiting a thread, submit any pending record. Today, we don't
audit thread exit, but should that happen, this will prevent
unhappiness, as the thread exit system call will never return, and
hence not commit the record.

Pointed out by/with:	cognet
Obtained from:		TrustedBSD Project
2006-02-06 01:51:08 +00:00
Robert Watson
3f4b50a482 Regenerate. 2006-02-06 01:40:48 +00:00
Robert Watson
35d982a761 Assign audit event identifiers to Linux i386 system calls.
Obtained from:	TrustedBSD Project
2006-02-06 01:40:30 +00:00
Robert Watson
6b28a1b2a3 Regenerate. 2006-02-06 01:16:00 +00:00
Robert Watson
4790bb223e Reflect fix in Linux setfsgid() event name from OpenBSM in the alpha
linux system call table.

Obtained from:	TrustedBSD Project
2006-02-06 01:13:47 +00:00
Robert Watson
8c32c1901b Merge OpenBSM 1.0 alpha 3 include file changes from contrib/openbsm/bsm
to sys/bsm:

- Correct error in definition of audit event for Linux setfsgid().
- Add audit event identifier for sysarch().

Obtained from:	TrustedBSD Project
2006-02-06 01:12:46 +00:00
Wayne Salamon
2f8a46d5ff Audit the arguments (user/group IDs) for the system calls that set these IDs.
Obtained from: TrustedBSD Project
Approved by: rwatson (mentor)
2006-02-06 00:32:33 +00:00
Wayne Salamon
ad20c8f325 Audit the args to rfork(), and the child PID for all fork system calls.
Obtained from: TrustedBSD Project
Approved by: rwatson (mentor)
2006-02-06 00:28:50 +00:00
Wayne Salamon
de3007e8f3 Audit the pid being requested in wait4().
Obtained from: TrustedBSD Project
Approved by: rwatson (mentor)
2006-02-06 00:19:09 +00:00
Wayne Salamon
a750d0b2a2 Add auditing of arguments to the close() and fstat() system calls. Much more
argument auditing yet to come, for remaining system calls in this file.

Obtained from: TrustedBSD Project
Approved by: rwatson (mentor)
2006-02-05 23:57:32 +00:00
Robert Watson
570d840b52 Regenerate. 2006-02-05 23:28:46 +00:00
Robert Watson
b11c14d6e9 Assign audit event identfiers to Xenix system calls. Note: AUE_EACCESS
is assigned to xenix_eaccess() instead of AUE_ACCESS, as that is the
intended meaning of the system call.  xenix_eaccess() should be
reimplemented using our native eaccess() implementation so that it
works as intended.

Obtained from:	TrustedBSD Project
2006-02-05 23:28:01 +00:00
Robert Watson
ad3a6a7d36 Correct help line: list targets, not names of files generated by targets
when no argument is provided to make.

MFC after:	1 week
2006-02-05 23:25:19 +00:00
Robert Watson
4334cc4f81 Regenerate (accidentally also committed in commit that updated
syscalls.isc).
2006-02-05 23:16:20 +00:00
Robert Watson
60be92dd8d Assign audit event identifiers to ibcs2 ISC system calls.
Obtained from:	TrustedBSD Project
2006-02-05 23:15:22 +00:00
Olivier Houchard
697e7cb715 Backout rev 1.12. It would have been a good thing, if gcc was smart enough
not to generate bad code.
2006-02-05 22:06:12 +00:00
Robert Watson
00c28d9678 On process exit, audit the return value of the process, and commit the
record immediately, as this system call never returns.

Obtained from:	TrustedBSD Project
2006-02-05 21:08:25 +00:00
Robert Watson
6e8525ce84 When GC'ing a thread, assert that it has no active audit record.
This should not happen, but with this assert, brueffer and I would
not have spent 45 minutes trying to figure out why he wasn't
seeing audit records with the audit version in CVS.

Obtained from:	TrustedBSD Project
2006-02-05 21:06:09 +00:00
Alexander Leidinger
9d978cc757 Convert NULL checks into KASSERT (and move them before the first
dereferencing) since a NULL value would be a bug here.

Note: Both affected functions look very similar. A refactoring may
be beneficial.

CID:		483, 485
Found with:	Coverity Prevent(tm)
Discussed with:	ariff
MFC after:	5 days
2006-02-05 17:47:26 +00:00
Warner Losh
d87076c835 an driver not endian clean, so don't enable on sparc64 2006-02-05 17:38:28 +00:00
Alexander Leidinger
cd9de7ee61 A pointer was checked for NULL after dereferencing it. The check is not
needed here, except there's a bug which results in detaching the device
twice.

Move the NULL pointer check to the beginning of the function and convert
it into a KASSERT.

CID:		420
Found with:	Coverity Prevent(tm)
Discussed with:	ariff
MFC after:	5 days
2006-02-05 17:33:18 +00:00
Max Laier
5bba2114d0 Make pflog a seperate module. As a result pflog_packet() becomes a function
pointer that is declared in pf_ioctl.c

Requested by:	yar (as part of the module build reorg)
MFC after:	1 week
X-MFC with:	yar's module reorg
2006-02-05 17:17:32 +00:00
Alexander Leidinger
f31eef8b22 Fix memory leak in some failure cases.
CID:		420
Found with:	Coverity Prevent(tm)
2006-02-05 17:10:52 +00:00
Robert Watson
95fea57c65 Add AUDITVNODE[12] flags to namei(), which cause namei() to audit path
and vnode attribute information for looked up vnodes during the lookup
operation.  This will allow consumers of namei() to specify that this
information be added to the in-process audit record.

Submitted by:	wsalamon
Obtained from:	TrustedBSD Project
2006-02-05 15:42:01 +00:00
Hajimu UMEMOTO
8c76311215 shut up strict-aliasing rules warning. 2006-02-05 09:52:40 +00:00
Ken Smith
4d286e9426 Move asr driver from global NOTES to i386-specific NOTES. Requestor
reports it is neither endian-clean or 64-bit clean.  :-)

Requested by:	scottl
2006-02-05 05:06:04 +00:00
Scott Long
5d9299772e Squash a couple more invalid long casts. 2006-02-05 05:05:27 +00:00
David Xu
25c926f1b0 Regenerate. 2006-02-05 02:23:41 +00:00
David Xu
9e7d72246f Implement thr_set_name to set a name for thread.
Reviewed by: julian
2006-02-05 02:18:46 +00:00
Warner Losh
1248f2322b Import support for the Atmel AT91RM9200 CPU/Microcontroller. This SoC
is a ARM920T based CPU with a bunch of built-in peripherals.  The
inital import supports the SPI bus, the TWI bus (although iicbus
integration is not complete), the uarts, the system timer and the
onboard ethernet.  Support for the Kwikbyte KB9202
(http://www.kwikbyte.com) board is also included, although there's no
reason why the 9200 and the 9201 wouldn't also work.  Primitive
support for running under the skyeye emulator is also provided
(although skyeye's support for the AT91RM9200 is a little weak).

The code has been structured so that other members of Atmel's arm family can
be supported in the future.  The AT91SAM9260 is not presently supported
due to lack of hardware.  The arm7tdmi families are also not supported
becasue they lack an MMU.

Many thanks to cognet@ for his help and assistance in bringing up this
board.  He did much of the vm work and wrote parts of the uart and
system timer code as well as the bus space implementation.

The system boots to single user w/o problem, although the serial
console is a little slow and the ethernet driver is still in flux.

This work was sponsored by Timing Solutions, Corporation.  I am
grateful to their support of the FreeBSD project in this manner.
2006-02-04 23:32:13 +00:00
Marius Strobl
ea227b498b - Add support for using LOM (Lights Out Management) and RSC (Remote System
Control) devices as console. These are microcontrollers which are either
  on-board or part of an add-on card and provide terminal server, remote
  power switch and monitoring functionality. For console usage these are
  connected to the rest of the system via a SCC or an UART. This commit adds
  support for the following variants (corresponds to what 'input-device' and
  'output-device' have to be set to):
  rsc		found on-board in E250 and supposedly some Netra, connected
		via a SAB82532, com. parameters can be determined via OFW
  rsc-console	RSC card found in E280R, Fire V4x0, Fire V8x0, connected
		via a NS16550, hardwired to 115200 8N1
  lom-console	LOMlite2 card found in Netra 20/T4, connected via a NS16550,
		hardwired to 9600 8N1

- Add my copyright to uart_cpu_sparc64.c as I've rewritten about one third
  of that file over time.

Tested on:	E250, E280R
Thanks to:	dwhite@ for providing access to an E280R
OK'ed by:	marcel
MFC after:	1 week
2006-02-04 23:27:16 +00:00
Warner Losh
ccc0f2f0af Silence the strict-alias warnings. Make a trip through (void *) when
casting a structure to a uint32_t *.  Many drivers in the tree do this, but
I'll not update them until these changes can be reviewed by the pedantic
standards folks.
2006-02-04 22:51:03 +00:00
Alan Cox
3b7db47d7e Remove an unnecessary call to pmap_remove_all(). The given page is not
mapped because its contents are invalid.
2006-02-04 22:37:10 +00:00
Warner Losh
53920ff8d9 Type of overrun_buf doesn't matter to this code, but does to gcc.
Make it a void *.
2006-02-04 22:33:08 +00:00
Warner Losh
2805b31bdf Use void * for pointer rather than u_int8_t *, since it doesn't
matter.  Well it does for type punning warnings.
2006-02-04 22:14:20 +00:00
Warner Losh
44dc92eb94 Now that TUNABLE_ULONG is in the tree, and has been for a while, use it.
This also avoids typepunning.
2006-02-04 21:56:14 +00:00
Warner Losh
ed3eb6ebe2 Don't type pun accidentally. Instead, be explicit that we're type
punning with an union so that the compiler knows.
2006-02-04 21:37:39 +00:00
Wayne Salamon
4f9ac41fba Call the audit syscall enter/exit functions for the amd64 architecture,
both 32-bit and 64-bit paths. System calls will now be audited.

Obtained from: TrustedBSD Project
Approved by: rwatson (mentor)
2006-02-04 20:37:20 +00:00
Bill Paul
55ad415824 When ndis_attach() runs, it has to very briefly initialize the card
in order to query the underlying Windows driver for the station address
and some other properties. There is a slim chance that the card may
receive a packet and indicate it up to us before ndis_attach() can call
ndis_halt_nic(). This is bad, because both the softc structure and
the ifnet structure aren't fully initialized yet: many pointers are
still NULL, so if we make it into ndis_rxeof(), we will panic.

To fix this, we need to do the following:

- Move the calls to IoAllocateWorkItem() to before the call to ndis_init_nic().
- Move the initialization of the RX DPC and status callback function pointers
  to before ndis_init_nic() as well.
- Modify ndis_rxeof() to check if the IFF_DRV_RUNNING flag is set. If it
  isn't, we return any supplied NDIS_PACKETs to the NIC without processing
  them.

This fixes a crash than can occur when activating a wireless NIC in
close proximity to a very busy wireless network, reported by Ryan
Beasley (ryan%^$!ATgoddamnbastard-****!!!DOTorg.

MFC after:	3 days
2006-02-04 19:42:49 +00:00
Olivier Houchard
0cc56a19e1 Don't forget to set the address of the next descriptor to 0 when we're
zeroing a physical page, or we could end up re-zeroing portions of
memory we have zeroed before, which is clearly not wanted.
2006-02-04 18:01:15 +00:00
Scott Long
1107d45356 Squash another use of vtophys. Instead of creating separate busdma objects
for doing static memory transfers, start collecting them into a single
object.
2006-02-04 17:56:17 +00:00
Olivier Houchard
19d5d0da40 MFi386:
revision 1.288
date: 2006/02/04 14:11:33;  author: wsalamon;  state: Exp;  lines: +4 -1
Hook up the audit system to system call entry and exit. System calls will
now be audited.

Obtained from:  TrustedBSD Project
Approved by: rwatson (mentor)
2006-02-04 17:01:19 +00:00
Scott Long
73450b30c8 Now that the em driver no longer needs to directly touch the scheduler, remove some
unneeded headers.
2006-02-04 16:50:14 +00:00
Wayne Salamon
c62ccf20b2 Hook up the audit system to system call entry and exit. System calls will
now be audited.

Obtained from:	TrustedBSD Project
Approved by: rwatson (mentor)
2006-02-04 14:11:33 +00:00
David Xu
7f96995ebd Create childproc_jobstate function to report job control state, this
also fixes a bug in childproc_continued which ignored PS_NOCLDSTOP.
2006-02-04 14:10:57 +00:00
Robert Watson
01bcdff15d Assign audit identifiers to alpha/linux system calls so that they will
be audited.

Obtained from:	TrustedBSD Project
2006-02-04 14:03:22 +00:00
Robert Watson
ef572cf5bb Regenerate. 2006-02-04 13:29:09 +00:00
Robert Watson
2b8d08f814 Audit FreeBSD 32-bit system calls on 64-bit FreeBSD systems.
Obtained from:	TrustedBSD Project
2006-02-04 13:28:55 +00:00
Robert Watson
1ba0723bd6 Merge OpenBSM 1.0 alpha 2 kernel audit events into src/sys/bsm. Almost
entirely new audit event identifiers for FreeBSD, Linux, and POSIX.1b
system calls.

Obtained from:	TrustedBSD Project
2006-02-04 13:22:44 +00:00
Rink Springer
aaadec7cac Patch to allow XBox-users to use the onboard nve(4) nForce ethernet driver.
The patch crudely forces the NIC out of operating mode before the nve(4)
driver can initialize it; this is required to properly initialize the NIC.

It is XBox-specific, as this condition can only occur on XBoxes (Most loaders
will simply leave the NIC running, forcing us to use a crude workaround like
this to get it in a workable condition). Due to the XBox-only aspect, this has
been solved in XBox-specific initialization code and not within nve(4).

Reviewed by:	imp
Approved by:	imp (mentor)
No objection:	bz@, obrien@, q@ontheweb.com.au
2006-02-04 10:01:33 +00:00
Scott Long
b0cb1aaf7c Add the start of busdma infrastructure to this driver. Convert the
ASR_resetIOPR function to use it.
2006-02-04 08:45:19 +00:00
Matt Jacob
51effc8cd5 Actually, no, I had it wrong in 1.109. The arguments to bus_dma_create_tag
are bus_addr_t, not bus_size_t.

In any case, turn off DAC support entirely until it is revamped to actually
work *correctly* for 64 bit platforms (not using a PAE definition and for
both initiator and target mode).
2006-02-04 08:39:02 +00:00
Scott Long
b32f2b9a08 Now that the U32 type is a really 32-bits wide, eliminate a bunch of other
bad assumptions and long values.
2006-02-04 08:20:23 +00:00