Disable setting the MII port speed.

This seems to break at least my test board here (AR71xx + AR8316 switch
PHY).  Since I do have a whole sleuth of "normal" PHY boards (with
an AR71xx on a normal PHY port), I'll do some further testing with those
to determine whether this is a general issue, or whether it's limited
to the behaviour of the "fake" dedicated PHY port mode on these atheros
switches.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234992 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Implement read-only support for volumes in optimal state (without using
redundancy) for the following RAID levels: RAID4/5E/5EE/6/MDF.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234993 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix bug causing memory corruption and panics with big-endian metadata.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234994 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Use SCTP_PRINTF() instead of printf() in all SCTP sources.

MFC after: 3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234995 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Call panic() only under INVARIANTS.

MFC after: 3 days


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

MFC after: 3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234997 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Use a unique zpool name during install, in the case of having another
PC-BSD / FreeBSD zpool on the system for another install.

Submitted by:	kmoore
Obtained from:	PC-BSD
MFC after:	3 days
Sponsored by:	iXsystems


git-svn-id: svn+ssh://svn.freebsd.org/base/head@235005 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add powerpc / powerpc64 support to pc-sysinstall. This patch will
autodetect if on powerpc and use the APM gpart GEOM class
automaticaly.  At this time support for full disk installation is
the only supported scheme.

Submitted by:	kmoore
Obtained from:	PC-BSD
MFC after:	3 days
Sponsored by:	iXsystems


git-svn-id: svn+ssh://svn.freebsd.org/base/head@235006 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add bootcamp bootloader stamp

Submitted by:	kmoore
Obtained from:	PC-BSD
MFC after:	3 days
Sponsored by:	iXsystems


git-svn-id: svn+ssh://svn.freebsd.org/base/head@235008 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add support for SCTP_STREAM_CHANGE_EVENT, SCTP_ASSOC_RESET_EVENT as
required by RFC 6525. This also fixes SCTP_STREAM_RESET_EVENT.

MFC after: 3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@235009 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix final bugs in memory barriers on PowerPC:
- Use isync/lwsync unconditionally for acquire/release. Use of isync
  guarantees a complete memory barrier, which is important for serialization
  of bus space accesses with mutexes on multi-processor systems.
- Go back to using sync as the I/O memory barrier, which solves the same
  problem as above with respect to mutex release using lwsync, while not
  penalizing non-I/O operations like a return to sync on the atomic release
  operations would.
- Place an acquisition barrier around thread lock acquisition in
  cpu_switchin().


git-svn-id: svn+ssh://svn.freebsd.org/base/head@235013 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
First fix pr 167226:
	ThunderBolt cannot read sector >= 2^32 or 2^21
with supplied patch.

Second the bigger change, fix RAID operation on ThunderBolt base
card such as physically removing a disk from a RAID and replacing
it.  The current situation is the RAID firmware effectively hangs
waiting for an acknowledgement from the driver.  This is due to
the firmware support of the driver actually accessing the RAID
from under the firmware.  This is an interesting feature that
the FreeBSD driver does not use.  However, when the firmare
detects the driver has attached it then expects the driver will
synchronize LD's with the firmware.  If the driver does not sync.
then the management part of the firmware will hang waiting for
it so a pulled driver will listed as still there.

The fix for this problem isn't extremely difficult.  However,
figuring out why some of the code was the way it was and then
redoing it was involved.  Not have a spec. made it harder to
try to figure out.  The existing driver would send a
MFI_DCMD_LD_MAP_GET_INFO command in write mode to acknowledge
a LD state change.  In read mode it gets the RAID map from the
firmware.  The FreeBSD driver doesn't do that currently.  It
could be added in the future with the appropriate structures.
To simplify things, get the current LD state and then build
the MFI_DCMD_LD_MAP_GET_INFO/write command so that it sends
an acknowledgement for each LD.  The map would probably state
which LD's changed so then the driver could probably just
acknowledge the LD's that changed versus all.  This doesn't seem
to be a problem.  When a MFI_DCMD_LD_MAP_GET_INFO/write command
is sent to the firmware, it will complete later when a change
to the LD's happen.  So it is very much like an AEN command
returning when something happened.  When the
MFI_DCMD_LD_MAP_GET_INFO/write command completes, we refire the
sync'ing of the LD state.  This needs to be done in as an event
so that MFI_DCMD_LD_GET_LIST can wait for that command to
complete before issuing the MFI_DCMD_LD_MAP_GET_INFO/write.
The prior code didn't use the call-back function and tried
to intercept the MFI_DCMD_LD_MAP_GET_INFO/write command when
processing an interrupt.  This added a bunch of code complexity
to the interrupt handler.  Using the call-back that is done
for other commands got rid of this need.  So the interrupt
handler is greatly simplified.  It seems that even commands
that shouldn't be acknowledged end up in the interrupt handler.
To deal with this, code was added to check to see if a command
is in the busy queue or not.  This might have contributed to the
interrupt storm happening without MSI enabled on these cards.

Note that MFI_DCMD_LD_MAP_GET_INFO/read returns right away.

It would be interesting to see what other complexity could
be removed from the ThunderBolt driver that really isn't
needed in our mode of operation.  Letting the RAID firmware
do all of the I/O to disks is a lot faster since it can
use its caches.  It greatly simplifies what the driver has
to do and potential bugs if the driver and firmware are
not in sync.

Simplify the aen_abort/cm_map_abort and put it in the softc
versus in the command structure.

This should get merged to 9 before the driver is merged to
8.

PR:		167226
Submitted by:	Petr Lampa
MFC after:	3 days


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


git-svn-id: svn+ssh://svn.freebsd.org/base/head@235016 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add support for the SCTP_ENABLE_STREAM_RESET socket option to
getsockopt(). This improves the support of RFC 6525.

MFC after: 3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@235021 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Use MADT to match ACPI Processor objects to CPUs.  MADT and DSDT/SSDTs may
list CPUs in different orders, especially for disabled logical cores.  Now
we match ACPI IDs from the MADT with Processor objects, strictly order CPUs
accordingly, and ignore disabled cores.  This prevents us from executing
methods for other CPUs, e. g., _PSS for disabled logical core, which may not
exist.  Unfortunately, it is known that there are a few systems with buggy
BIOSes that do not have unique ACPI IDs for MADT and Processor objects.  To
work around these problems


git-svn-id: svn+ssh://svn.freebsd.org/base/head@235024 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Complete commit message for r235024:

Use MADT to match ACPI Processor objects to CPUs.  MADT and DSDT/SSDTs may
list CPUs in different orders, especially for disabled logical cores.  Now
we match ACPI IDs from the MADT with Processor objects, strictly order CPUs
accordingly, and ignore disabled cores.  This prevents us from executing
methods for other CPUs, e. g., _PSS for disabled logical core, which may not
exist.  Unfortunately, it is known that there are a few systems with buggy
BIOSes that do not have unique ACPI IDs for MADT and Processor objects.  To
work around these problems, 'debug.acpi.cpu_unordered' tunable is added.
Set this to a non-zero value to restore the old behavior.
Many thanks to jhb for pointing me to the right direction and the manual
page change.

Reported by:	Harris, James R (james dot r dot harris at intel dot com)
Tested by:	Harris, James R (james dot r dot harris at intel dot com)
Reviewed by:	jhb
MFC after:	1 month


git-svn-id: svn+ssh://svn.freebsd.org/base/head@235029 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Don't ignore start offset value when user specifies it together
with alignment.

PR:		bin/167567
Tested by:	Warren Block
MFC after:	1 week


git-svn-id: svn+ssh://svn.freebsd.org/base/head@235033 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix a couple of sc_ac2q[] mappings that were using the TID, not the AC.

PR:		kern/167588


git-svn-id: svn+ssh://svn.freebsd.org/base/head@235034 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add ToS definitions for DiffServ Codepoints as per RFC2474.

Obtained from:	OpenBSD
MFC after:	2 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@235036 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Merge from OpenBSD 5.1.

MFC after:	3 weeks


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