Remove comments left in accidentally while testing, so the
VM /etc/fstab is actually created.

Sponsored by:	The FreeBSD Foundation
Add strptime(3) support for %U and %W (take 2)

Add support for the missing POSIX-2001 %U and %W features: the
existing FreeBSD strptime code recognizes both directives and
validates that the week number lies in the permitted range,
but then simply discards the value.

Initial support for the feature was written by Paul Green.
David Carlier added the initial handling of tm_wday/tm_yday.
Major credit goes to Andrey Chernov for detecting much of the
brokenness, and rewriting/cleaning most of the code, making it
much more robust.

Tested independently with the strptime test from the GNU C
library.

PR:		137307
MFC after:	1 month
Relnotes:	yes
Change the /var dataset in the default ZFS layout to have the
ZFS property canmount=off so that /var/db/pkg and other such directories
are part of the / dataset, and only /var/mail, /var/log, and /var/crash
are excluded from the ZFS boot environment (beadm).

PR:		193971
Approved by:	jmg
MFC after:	ASAP
Relnotes:	yes
Sponsored by:	ScaleEngine Inc.
Remove the UFS label from the root filesystem since it is added
by mkimg(1) as a gpt label, consistent with the fstab(5) entry.

Sponsored by:	The FreeBSD Foundation
Use snprintf(3) in place of unbounded sprintf(3) (prevent buffer overflow).
Use adequately sized buffer for error(s) (512 -> PATH_MAX + 512).
Fix the following style(9) nits while here:
- distfetch.c uses PATH_MAX while distextract.c uses MAXPATHLEN;
  standardize on one (PATH_MAX)
- Move $FreeBSD$ from comment to __FBSDID()
- Sort included headers (alphabetically, sys/* at top)
- Add missing header includes (e.g., <stdlib.h> for getenv(3),
  calloc(3)/malloc(3)/free(3), and atoi(3); <string.h> for strdup(3),
  strrchr(3), strsep(3), and strcmp(3); <ctype.h> for isspace(3); and
  <unistd.h> for chdir(2), etc.)
- Remove rogue newline at end of distfetch.c
- Don't declare variables in if-, while-, or other statement
NB: To prevent masking of prior declarations atop function
- Perform stack alignment for variable declarations
- Add missing function prototype for count_files() in distextract.c
- Break out single-line multivariable-declarations
NB: Aligning similarly-named variables with one-char difference(s)
NB: Minimizes diffs and makes future diffs more clear
- Use err(3) family of functions (requires s/int err;/int retval;/g)

Reviewed by:	nwhitehorn, julian
Comment cleanup in panic() message when mkimg(1) does not support
the requested disk image format.

Sponsored by:	The FreeBSD Foundation
Instead of failing when neither PAM_TTY nor PAM_RHOST are available, call
login_access() with "**unknown**" as the second argument.  This will allow
"ALL" rules to match.

Reported by:	Tim Daneliuk <tundra@tundraware.com>
Tested by:	dim@
PR:		83099 193927
MFC after:	3 days
Hopefully fix build breakage with gcc passing void * instead of char *
to "%s" format string after r272280.

PR:		83099 193927
MFC after:	3 days
X-MFC with:	r272280
Search for the nearest PORTSDIR where Mk/bsd.ports.mk exists, from .CURDIR.
This will only take effect if PORTSDIR is not set, as previously supported.

Use .if exists(), for four specific possibilities relative to .CURDIR:
., .., ../.., and ../../..  The fourth possibility is primarily in case
ports ever grows a third level.  If none of these paths exist, fall back to
the old default of /usr/ports.

This removes the need to set PORTSDIR explicitly (or via wrapper script) if
one is running out of a ports tree that is not in /usr/ports, but in a
home directory.

Reviewed by:	bapt, bdrewery (older version)
CR:		D799
MFC after:	1 week
Sponsored by:	Spectra Logic
Fix integer truncation in affecting systat -ifstat

The "systat -ifstat" command was using a u_int to store byte counters.
With a 10Gbps or faster interface, this overflows within the default
5 second refresh period.  Switch to using a uint64_t across the board,
which matches the size used for all counters as of r263102.

PR:		182448
MFC after:	1 week
Sponsored by:	Sandvine Inc
Ensure that ixl_flush() uses a defined register on VFs

In some code that is shared between the ixl(4) and ixlv(4) drivers,
a macro hard-coded a register offset that was not valid on ixlv devices.
Fix this by having each driver define a variable that contains the correct
offset.

Reviewed by:	Eric Joyner <ricera10 AT gmail.com>
MFC after:	3 days
Sponsored by:	Sandvine Inc
Import ACPICA 20140926.
When setting environment variables in the atrun script, use the
"export foo=bar" form instead of "foo=bar; export foo" since the
former allows the shell to catch variable names that are not valid
shell identifiers.  This will cause /bin/sh to exit with an error
(which gets mailed to the at user) and it will not run the script.

Obtained from:	OpenBSD (r1.63 millert)
MFC after:	3 days
Sigh, remove a line that needs to be removed along with previous commit.

Submitted by:	mjg
MFC after:	3 days
X-MFC-with:	272288
Use bzero instead of explicitly zeroing stuff in do_execve.

While strictly speaking this is not correct since some fields are pointers,
it makes no difference on all supported archs and we already rely on it doing
the right thing in other places.

No functional changes.
Document [EPERM] for UNIX sockets.

MFC after:	2 weeks
Add initial support for the AR9485 CUS198 / CUS230 variants.

These variants have a few differences from the default AR9485 NIC,
namely:

* a non-default antenna switch config;
* slightly different RX gain table setup;
* an external XLNA hooked up to a GPIO pin;
* (and not yet done) RSSI threshold differences when
  doing slow diversity.

To make this possible:

* Add the PCI device list from Linux ath9k, complete with vendor and
  sub-vendor IDs for various things to be enabled;
* .. and until FreeBSD learns about a PCI device list like this,
  write a search function inspired by the USB device enumeration code;
* add HAL_OPS_CONFIG to the HAL attach methods; the HAL can use this
  to initialise its local driver parameters upon attach;
* copy these parameters over in the AR9300 HAL;
* don't default to override the antenna switch - only do it for
  the chips that require it;
* I brought over ar9300_attenuation_apply() from ath9k which is cleaner
  and easier to read for this particular NIC.

This is a work in progress.  I'm worried that there's some post-AR9380
NIC out there which doesn't work without the antenna override set as
I currently haven't implemented bluetooth coexistence for the AR9380
and later HAL.  But I'd rather have this code in the tree and fix it
up before 11.0-RELEASE happens versus having a set of newer NICs
in laptops be effectively RX deaf.

Tested:

* AR9380 (STA)
* AR9485 CUS198 (STA)

Obtained from:	Qualcomm Atheros, Linux ath9k
Remove this stuff - it's no longer needed here.
Make clear in the ipheth(4) hardware notes that this driver is for the
tethering functionality only.  Add a "bugs" section to give a pointer
to usbconfig set_config if the device isn't automatically detected.

MFC after:	3 days
Add a missing file from the last commit.

Noticed by: jhibbits