Add a quick work-around if ath_beacon_config() to not die if it's called
when an interface is going down.

Right now it's quite possible (but very unlikely!) that ath_reset()
or similar is called, leading to a beacon config call, in parallel with
the last VAP being destroyed.

This likely should be fixed by making sure the bmiss/bstuck/watchdog
taskqueues are canceled whenever the last VAP is destroyed.


git-svn-id: svn://svn.freebsd.org/base/head@245554 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix hangs (exposed by spectral scan activity) in STA mode when the
chip hangs.

* Always do a reset in ath_bmiss_proc(), regardless of whether the
  hardware is "hung" or not.  Specifically, for spectral scan, there's
  likely a whole bunch of potential hangs that we don't (yet) recognise
  in the HAL.  So to avoid staying RX deaf persisting until the station
  disassociates, just do a no-loss reset.

* Set sc_beacons=1 in STA mode.  During a reset, the beacon programming
  isn't done.  (It's likely I need to set sc_syncbeacons during a hang
  reset, but I digress.)  Thus after a reset, there's no beacon timer
  programming to send a BMISS interrupt if beacons aren't heard ..
  thus if the AP disappears, you won't get notified and you'll have to
  reset your interface.

This hasn't yet fixed all of the hangs that I've seen when debugging
spectral scan, but it's certainly reduced the hang frequency and it
should improve general STA stability in very noisy environments.

Tested:

* AR9280, STA mode, spectral scan off/on

PR:		kern/175227


git-svn-id: svn://svn.freebsd.org/base/head@245556 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add extra debugging fields.


git-svn-id: svn://svn.freebsd.org/base/head@245560 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add a new LIBRARIES_ONLY make variable to disable the build and install
of files other than the actual libraries.

Use LIBRARIES_ONLY to supress the inclusion of files in the lib32
distribution that are duplicates of files in base.

Sponsored by:	DARPA, AFRL
Reviewed by:	emaste


git-svn-id: svn://svn.freebsd.org/base/head@245561 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add myself as a committer, and my mentor relationship.

Approved by:	cognet (mentor)


git-svn-id: svn://svn.freebsd.org/base/head@245562 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Correct the distrib-dirs target in the -DDB_FROM_SRC case.


git-svn-id: svn://svn.freebsd.org/base/head@245563 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Rework the mtree portion of etc/Makefile's distrib-dirs target to run
mtree in a shell loop so there is only one mtree commandline.  Move the
implementation of LOCAL_MTREE into etc/Makefile.

Sponsored by:	DARPA, AFRL
Reviewed by:	mtree :)


git-svn-id: svn://svn.freebsd.org/base/head@245565 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Remove a no-longer-used variable after the previous change to use
VA_UTIMES_NULL.

Submitted by:	bde, rmacklem
MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@245566 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
cxgbe: Make the for_each macros safer to use by turning them
into a single statement each.

Submitted by:	Christoph Mallon <christoph dot mallon at gmx dot de>
MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@245567 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Remove the unused nfs_curusec().


git-svn-id: svn://svn.freebsd.org/base/head@245568 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
remove an incorrect comment and debugging code


git-svn-id: svn://svn.freebsd.org/base/head@245570 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
In preparation for logging metadata about each filesystem object
refactor the link section of distrib-dirs to alwasy install to a full
path (the link contents remain relative as they should).

Eliminate the use of the "rm -r[f] <foo>; ln -s <bar> <foo>" pattern in
favor of "ln -sf <bar> <foo>".  None of these links could be directories
on a system installed in the last decade.

Sponsored by:	DARPA, AFRL
Reviewed by:	mtree


git-svn-id: svn://svn.freebsd.org/base/head@245571 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Implement the zonename token for jailed processes.  If
a process has an auditid/preselection masks specified, and
is jailed, include the zonename (jailname) token as a
part of the audit record.

Reviewed by:	pjd
MFC after:	2 weeks


git-svn-id: svn://svn.freebsd.org/base/head@245573 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Move the mbuf memory limit calculations from init_param2() to
tunable_mbinit() where it is next to where it is used later.

Change the sysinit level of tunable_mbinit() from SI_SUB_TUNABLES
to SI_SUB_KMEM after the VM is running.  This allows to use better
methods to determine the effectively available physical and virtual
memory available to the kernel.

Update comments.

In a second step it can be merged into mbuf_init().


git-svn-id: svn://svn.freebsd.org/base/head@245575 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Don't attempt to use clflush on the local APIC register window.  Various
CPUs exhibit bad behavior if this is done (Intel Errata AAJ3, hangs on
Pentium-M, and trashing of the local APIC registers on a VIA C7).  The
local APIC is implicitly mapped UC already via MTRRs, so the clflush isn't
necessary anyway.

MFC after:	2 weeks


git-svn-id: svn://svn.freebsd.org/base/head@245577 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
add some definition and driver changes in preparation for
two upcoming features:

semi-transparent mode:
    when a device is opened in this mode, the
    user program will be able to mark slots that must be forwarded
    to the "other" side (i.e. from NIC to host stack, or viceversa),
    and the forwarding will occur automatically at the next netmap syscall.
    This saves the need to open another file descriptor and do
    the forwarding manually.

direct-forwarding mode:
    when operating with a VALE port, the user can specify in the slot
    the actual destination port, overriding the forwarding decision
    made by a lookup of the destination MAC. This can be useful to
    implement packet dispatchers.

No API changes will be introduced.
No new functionality in this patch yet.


git-svn-id: svn://svn.freebsd.org/base/head@245579 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
In r245571, "rm -rf <foo>; ln -s <bar> <foo>" needed to be replaced with
"ln -sfh <bar> <foo>" or the links would fail when a valid link to a
directly was in place at <foo>.

Reported by:	peter
Tested by:	peter
Pointy hat to:	brooks


git-svn-id: svn://svn.freebsd.org/base/head@245580 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
remove the old memory allocator, not useful anymore


git-svn-id: svn://svn.freebsd.org/base/head@245581 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Merge ACPICA 20130117.


git-svn-id: svn://svn.freebsd.org/base/head@245582 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Spelling: exitting -> exiting

MFC after:	2 weeks


git-svn-id: svn://svn.freebsd.org/base/head@245584 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f