Fix a descriptor leak in devd.  Clients reading /var/run/devd.pipe can close
their socket connection any time, and devd only notices that when it gets an
error trying to write an event to the client.  On a system with no device
change activity, clients could connect and disappear repeatedly without devd
noticing, leading to an ever-growing list of open socket descriptors in devd.

Now devd uses poll(2) looking for POLLHUP on all existing clients every time
a new client connection is established, and also periodically (once a minute)
to proactively find zombie clients and reap the socket descriptors.  It also
now has a connection limit, configurable with a new -l <num> command line arg.
When the maximum number of connections is reached it stops accepting new
connections until some current clients drop off.

Reviewed by:	imp
Approved by:	cognet (mentor)


git-svn-id: svn://svn.freebsd.org/base/head@246121 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Modify the FreeBSD USB kernel code so that it can be compiled directly
into the FreeBSD boot loader, typically for non-USB aware BIOSes, EFI systems
or embedded platforms. This is also useful for out of the system compilation
of the FreeBSD USB stack for various purposes. The USB kernel files can
now optionally include a global header file which should include all needed
definitions required to compile the FreeBSD USB stack. When the global USB
header file is included, no other USB header files will be included by
default.

Add new file containing the USB stack configuration for the
FreeBSD loader build.

Replace some __FBSDID()'s by /* $FreeBSD$ */ comments. Now all
USB files follow the same style.

Use cases:
 - console in loader via USB
 - loading kernel via USB

Discussed with:		Hiroki Sato, hrs @ EuroBSDCon


git-svn-id: svn://svn.freebsd.org/base/head@246122 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Provide one global language string descriptor for
american english instead of giving each module its
own.

Submitted by:	Christoph Mallon


git-svn-id: svn://svn.freebsd.org/base/head@246123 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Use an anonymous struct for generated string descriptors.

Submitted by:	Christoph Mallon


git-svn-id: svn://svn.freebsd.org/base/head@246124 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Use string literals in string descriptors for marginally
better readability.

Submitted by:	Christoph Mallon


git-svn-id: svn://svn.freebsd.org/base/head@246125 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Do not unnecessarily split a string literal, because
splitting it makes it hard to grep.

Submitted by:	Christoph Mallon


git-svn-id: svn://svn.freebsd.org/base/head@246126 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
When adding the directory ownership to the METALOG do it by name rather
than number as is done in install so as to differ binding of names to
ids.

Remove the -W flag from the mtree command so that the correct user and
group is recorded rather than the default.


git-svn-id: svn://svn.freebsd.org/base/head@246127 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Use DEVMETHOD_END macro defined in sys/bus.h instead of {0, 0} sentinel on device_method_t arrays

Reviewed by:	cognet
Approved by:	cognet


git-svn-id: svn://svn.freebsd.org/base/head@246128 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Allow the address and ports to be separated by a colon or period rather
than a space to permit directly pasting the output of commands such as
netstat and sockstat on the command line.

Reviewed by:	net
MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@246129 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Utilize m_get2() to get mbuf of appropriate size.


git-svn-id: svn://svn.freebsd.org/base/head@246130 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix a problem introduced in r231057: in bsd.own.mk, move the test for
whether clang is enabled to just after the last place where it could
have been forced to "no".

MFC after:	3 days


git-svn-id: svn://svn.freebsd.org/base/head@246131 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Improve devd startup time, by tweaking some string handling routines that are
heavily used when parsing config files.  Mostly these changes avoid making
temporary copies of the strings, and avoid doing byte at a time append
operations, on the most-used code path.

On a 1.2 GHz ARM processor this reduces the time to parse the config files
from 13 to 6 seconds.

Reviewed by:	imp
Approved by:	cognet (mentor)


git-svn-id: svn://svn.freebsd.org/base/head@246134 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Do metadata relocation fixup on all loaded modules, not just the kernel.

Approved by:	cognet (mentor)


git-svn-id: svn://svn.freebsd.org/base/head@246135 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Mark tftp_log() as __printflike() (which would have caught the bug
fixed in r246106) and deal with the fallout.

MFC after:	2 weeks


git-svn-id: svn://svn.freebsd.org/base/head@246139 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Work around some rather unfortunate race conditions inside net80211.

Right now, ic_curchan seems to be updated rather quickly (ie, during
the ioctl) and before the driver gets notified of what's going on.
So what I was seeing was:

* NIC was in channel X;
* It generates PHY errors for channel X;
* an ioctl comes along from userland and changes things to channel Y;
* .. this updates ic_curchan, but hasn't yet reset the hardware;
* in parallel, RX is occuring and it looks at ic_curchan;
* .. which is channel Y, so events get stamped with that now.

Sigh.


git-svn-id: svn://svn.freebsd.org/base/head@246141 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Retire struct sockaddr_inarp.

Since ARP and routing are separated, "proxy only" entries
don't have any meaning, thus we don't need additional field
in sockaddr to pass SIN_PROXY flag.

New kernel is binary compatible with old tools, since sizes
of sockaddr_inarp and sockaddr_in match, and sa_family are
filled with same value.

The structure declaration is left for compatibility with
third party software, but in tree code no longer use it.

Reviewed by:	ru, andre, net@


git-svn-id: svn://svn.freebsd.org/base/head@246143 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
- Move AUTHORS and ACKNOWLEDGEMENTS to the end of the page.
- Add myself to list of authors.


git-svn-id: svn://svn.freebsd.org/base/head@246144 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Initial version of libusbboot, a fully stand-alone, single threaded and
functional compilation of the FreeBSD USB stack for use with boot loaders
and such.

Discussed with:		Hiroki Sato, hrs @ EuroBSDCon


git-svn-id: svn://svn.freebsd.org/base/head@246145 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Format CDB output as 2 digit hex correcting the length

Approved by:	pjd (mentor)
MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@246146 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
When in -U mode do avoid setting SUID bits, but do not modify the mode
variable so the intended mode can be logged correctly if -M is specified.

Sponsored by:	DARPA, AFRL


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