Fix M_FILEDESC leak in fdgrowtable() introduced in r244510.

fdgrowtable() now only reallocates fd_map when necessary.

This fixes fdgrowtable() to use the same logic as fdescfree() for
when to free the fd_map. The logic in fdescfree() is intended to
not free the initial static allocation, however the fd_map grows
at a slower rate than the table does. The table is intended to hold
20 fd, but its initial map has many more slots than 20.  The slot
sizing causes NDSLOTS(20) through NDSLOTS(63) to be 1 which matches
NDSLOTS(20), so fdescfree() was assuming that the fd_map was still
the initial allocation and not freeing it.

This partially reverts r244510 by reintroducing some of the logic
it removed in fdgrowtable().

Reviewed by:	mjg
Approved by:	bapt (mentor)
MFC after:	2 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@262006 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Implement PHY bus MMD writes for arswitch.

This is used by the AR8327 PHY setup path.

Obtained from:	OpenWRT


git-svn-id: svn+ssh://svn.freebsd.org/base/head@262010 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
calendar(1): don't segfault in invalid input

When the user supplies an invalid number of days provide a useful error message
instead of segfaulting.

PR:		bin/186697
Reported by:	kaltheat <kaltheat@gmail.com>
Submitted by:	oliver <oliver@beefrankly.org> (older version)


git-svn-id: svn+ssh://svn.freebsd.org/base/head@262011 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add mmd declaration.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@262015 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
The MDIO control register for the AR8327 has a different address to
previous chipsets.

Obtained from:	AR8327 datasheet


git-svn-id: svn+ssh://svn.freebsd.org/base/head@262016 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Make it possible to use the env kernel config file option for AVILA
and CAMBRIA boards that does not use loader to load the kernel. This
is basically how it was done for i386. This way tunables can also be
set. For example in config file:

env "/conf/AVILA.env"

And in AVILA.env:

vfs.unmapped_buf_allowed=0

MFC after:	2 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@262020 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
o Remove at compile time the HASH_ALL code, that was never
  tested and is unfinished. However, I've tested my version,
  it works okay. As before it is unfinished: timeout aren't
  driven by TCP session state. To enable the HASH_ALL mode,
  one needs in kernel config:

	options FLOWTABLE_HASH_ALL

o Reduce the alignment on flentry to 64 bytes. Without
  the FLOWTABLE_HASH_ALL option, twice less memory would
  be consumed by flows.
o API to ip_output()/ip6_output() got even more thin: 1 liner.
o Remove unused unions. Simply use fle->f_key[].
o Merge all IPv4 code into flowtable_lookup_ipv4(), and do same
  flowtable_lookup_ipv6(). Stop copying data to on stack
  sockaddr structures, simply use key[] on stack.
o Move code from flowtable_lookup_common() that actually works
  on insertion into flowtable_insert().

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@262027 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Bring copyright notice to standard style.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@262028 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Whitespace.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@262029 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add my copyright to flowtable.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@262030 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
etcupdate should use the src tree from where the release is built, not
the default (/usr/src) tree.

MFC after:	2 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@262036 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix formatting.

"Manpages should start a new sentence on a new line. This makes it easier
for translators to track changes." -jhb

Approved by:	jhb
MFC after:	3 days
Sponsored by:	SupraNet Communications, Inc


git-svn-id: svn+ssh://svn.freebsd.org/base/head@262051 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
pcm(4): Permit non-root users to change default unit

Discussed with:	mav


git-svn-id: svn+ssh://svn.freebsd.org/base/head@262066 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Update lldb for clang/llvm 3.4 import

This commit largely restores the lldb source to the upstream r196259
snapshot with the addition of threaded inferior support and a few bug
fixes.

Specific upstream lldb revisions restored include:
   SVN      git
  181387  779e6ac
  181703  7bef4e2
  182099  b31044e
  182650  f2dcf35
  182683  0d91b80
  183862  15c1774
  183929  99447a6
  184177  0b2934b
  184948  4dc3761
  184954  007e7bc
  186990  eebd175

Sponsored by:	DARPA, AFRL


git-svn-id: svn+ssh://svn.freebsd.org/base/head@262121 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Give the fdt helper routines static linkage since no global definition
of them is provided anywhere.  (gcc was nice enough to warn about this,
clang didn't for some reason.)


git-svn-id: svn+ssh://svn.freebsd.org/base/head@262123 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
In sys/dev/usb/controller/uss820dci.c, similar to r261977, fix a warning
about uss820dci_odevd being unused, by adding it to the part that
handles getting descriptors.

Reported by:	loos
Reviewed by:	hselasky
MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@262125 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Adjust USB quirk.

MFC after:	1 week
Submitted by:	Volodymyr Kostyrko <arcade@b1t.name>


git-svn-id: svn+ssh://svn.freebsd.org/base/head@262128 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Our quirk table is almost full. Add some room for more quirks.

MFC after:	1 week


git-svn-id: svn+ssh://svn.freebsd.org/base/head@262129 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
test_eagain_*_* should've been using nonblocking sockets instead of
blocking sockets.  The error was not exposed as long as the kernel
suffered from PR kern/185812.  Now corrected, these tests pass on
DragonFlyBSD 3.6.0.

PR:		kern/185812
Sponsored by:	Spectra Logic Corporation
MFC after:	2 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@262133 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add $FreeBSD$.

MFC after:	1 week


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