Introduce a new TLB invalidation function for efficiently invalidating
address ranges, and use this function in pmap_remove().

Tested by:	jchandra


git-svn-id: svn://svn.freebsd.org/base/head@241123 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix build with DEBUGGING disabled.


git-svn-id: svn://svn.freebsd.org/base/head@241124 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix build with LOG_FILE undefined and DEBUGGING disabled.


git-svn-id: svn://svn.freebsd.org/base/head@241125 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
mdoc: point to an existing cross reference.


git-svn-id: svn://svn.freebsd.org/base/head@241126 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Remove unused field.

MFC after:	1 week


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

MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@241128 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
 There is a complex race in in_pcblookup_hash() and in_pcblookup_group().
Both functions need to obtain lock on the found PCB, and they can't do
classic inter-lock with the PCB hash lock, due to lock order reversal.
To keep the PCB stable, these functions put a reference on it and after PCB
lock is acquired drop it. If the reference was the last one, this means
we've raced with in_pcbfree() and the PCB is no longer valid.

  This approach works okay only if we are acquiring writer-lock on the PCB.
In case of reader-lock, the following scenario can happen:

  - 2 threads locate pcb, and do in_pcbref() on it.
  - These 2 threads drop the inp hash lock.
  - Another thread comes to delete pcb via in_pcbfree(), it obtains hash lock,
    does in_pcbremlists(), drops hash lock, and runs in_pcbrele_wlocked(), which
    doesn't free the pcb due to two references on it. Then it unlocks the pcb.
  - 2 aforementioned threads acquire reader lock on the pcb and run
    in_pcbrele_rlocked(). One gets 1 from in_pcbrele_rlocked() and continues,
    second gets 0 and considers pcb freed, returns.
  - The thread that got 1 continutes working with detached pcb, which later
    leads to panic in the underlying protocol level.

  To plumb that problem an additional INPCB flag introduced - INP_FREED. We
check for that flag in the in_pcbrele_rlocked() and if it is set, we pretend
that that was the last reference.

Discussed with:		rwatson, jhb
Reported by:		Vladimir Medvedkin <medved rambler-co.ru>


git-svn-id: svn://svn.freebsd.org/base/head@241129 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Rename the module for 'device enc' to "if_enc" to avoid conflicting with
the CAM "enc" peripheral (part of ses(4)).  Previously the two modules
used the same name, so only one was included in a linked kernel causing
enc0 to not be created if you added IPSEC to GENERIC.  The new module
name follows the pattern of other network interfaces (e.g. "if_loop").

MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@241130 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
To reduce volume of pfsync traffic:
- Scan request update queue to prevent doubles.
- Do not push undersized daragram in pfsync_update_request().


git-svn-id: svn://svn.freebsd.org/base/head@241131 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix alignment related warnings reported by gcc
Switch from old style arguments to modern C
remove WARNS as a result

tested with "make universe"

Approved by:	cperciva
MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@241134 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Using putenv() and later direct pointer contents modification it is possibe
to craft environment variables with similar names like that:
a=1
a=2
...
unsetenv("a") should remove them all to make later getenv("a") impossible.
Fix it to do so (this is GNU autoconf test #3 failure too).

PR:             172273
MFC after:      1 week


git-svn-id: svn://svn.freebsd.org/base/head@241137 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Migrate the power-save functions to be overridable VAP methods.

This turns ieee80211_node_pwrsave(), ieee80211_sta_pwrsave() and
ieee80211_recv_pspoll() into methods.

The intent is to let drivers override these and tie into the power save
management pathway.

For ath(4), this is the beginning of forcing a node software queue to
stop and start as needed, as well as supporting "leaking" single frames
from the software queue to the hardware.

Right now, ieee80211_recv_pspoll() will attempt to transmit a single frame
to the hardware (whether it be a data frame on the power-save queue or
a NULL data frame) but the driver may have hardware/software queued frames
queued up.  This initial work is an attempt at providing the hooks required
to implement correct behaviour.

Allowing ieee80211_node_pwrsave() to be overridden allows the ath(4)
driver to pause and unpause the entire software queue for a given node.
It doesn't make sense to transmit anything whilst the node is asleep.

Please note that there are other corner cases to correctly handle -
specifically, setting the MORE data bit correctly on frames to a station,
as well as keeping the TIM updated.  Those particular issues can be
addressed later.


git-svn-id: svn://svn.freebsd.org/base/head@241138 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Update UPDATING with the ABI change for net80211.


git-svn-id: svn://svn.freebsd.org/base/head@241139 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Merge remote-tracking branch 'upstream/master'