Alike to r242314 for GRAID make GMIRROR more aggressive in marking volumes
as clean on shutdown and move that action from shutdown_pre_sync stage to
shutdown_post_sync to avoid extra flapping.

ZFS tends to not close devices on shutdown, that doesn't allow GEOM RAID
to shutdown gracefully.  To handle that, mark volume as clean just when
shutdown time comes and there are no active writes.

PR:		kern/113957
MFC after:	2 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@245443 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Alike to r242314 for GRAID make GRAID3 more aggressive in marking volumes
as clean on shutdown and move that action from shutdown_pre_sync stage to
shutdown_post_sync to avoid extra flapping.

ZFS tends to not close devices on shutdown, that doesn't allow GEOM RAID
to shutdown gracefully.  To handle that, mark volume as clean just when
shutdown time comes and there are no active writes.

MFC after:	2 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@245444 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
In case somebody still use it, fix legacy ataraid(4) to work on combined
PATA+AHCI controllers, such as JMicron JMB363.

PR:		kern/159271
MFC after:	1 week


git-svn-id: svn+ssh://svn.freebsd.org/base/head@245446 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add myself as a port committer (with eadler@ and bdrewery@ as mentors).

While in the repository, add myself to calendar.freebsd.

Approved by:	eadler/bdrewery (mentor)


git-svn-id: svn+ssh://svn.freebsd.org/base/head@245447 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
cxgbe/tom: Basic CLIP table management.

This is the Compressed Local IPv6 table on the chip.  To save space, the
chip uses an index into this table instead of a full IPv6 address in
some of its hardware data structures.

For now the driver fills this table with all the local IPv6 addresses
that it sees at the time the table is initialized.  I'll improve this
later so that the table is updated whenever new IPv6 addresses are
configured or existing ones deleted.

MFC after:	1 week


git-svn-id: svn+ssh://svn.freebsd.org/base/head@245448 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Initial support for Allwinner A10 SoC (Cubieboard)
	Add simple console driver
	Add interrupt handling and timer codes
	Add kernel config file
	Add dts file
Approved by: gonzo


git-svn-id: svn+ssh://svn.freebsd.org/base/head@245450 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix license to follow standard license template

Reviewed by: joel


git-svn-id: svn+ssh://svn.freebsd.org/base/head@245453 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix formatting of license according to share/examples/etc/bsd-style-copyright

Reviewed by: joel


git-svn-id: svn+ssh://svn.freebsd.org/base/head@245454 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add mistakenly removed third clause to license

Reviewed by: joel


git-svn-id: svn+ssh://svn.freebsd.org/base/head@245455 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Allow to insert new component to geom_raid3 without specifying number.

PR:		kern/160562
MFC after:	2 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@245456 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
- Detect when we are in KVM.

Silence on:	emulation
Approved by:	kib (mentor)
MFC after:	1 week


git-svn-id: svn+ssh://svn.freebsd.org/base/head@245457 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
- Use standard RETURN VALUES section.

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


git-svn-id: svn+ssh://svn.freebsd.org/base/head@245458 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Satisfy the intent of kern/151564: [ciss] ciss(4) should increase
CISS_MAX_LOGICAL to 107

Submitter wanted to increase the number of logical disks supported by ciss(4)
by simply raising the CISS_MAX_LOGICAL value even higher.  Instead, consult
the documentation for the raid controller (OPENCISS) and poke the controller
bits to ask it for how many logical/physical disks it can handle.

Revert svn R242089 that raised CISS_MAX_LOGICAL to 64 for all controllers.

For older controllers that don't support this mechanism, fallback to the old
value of 16 logical disks.  Tested on P420, P410, P400 and 6i model ciss(4)
controllers.

This should will be MFC'd back to stable/9 stable/8 and stable/7 after the MFC
period.

PR:		kern/151564
Reviewed by:	scottl@freebsd.org
MFC after:	2 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@245459 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add gjb as my co-mentor now that I have a full doc/www bit.

Approved by:	remko (mentor)


git-svn-id: svn+ssh://svn.freebsd.org/base/head@245463 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Remove the use of the ifnet send queue and if_start() in the power
save queue code.

Instead, use if_transmit() directly - and handle the cases where frame
transmission fails.

I don't necessarily like this and I think at this point the M_ENCAP check,
node freeing upon fail and the actual if_transmit() call should be done
in methods in ieee80211_freebsd.c, but I digress slightly..

This removes one of the last few uses of if_start() and the ifnet
if_snd queue.  The last major offender is ieee80211_output.c, where
ieee80211_start() implements if_start() and uses the ifnet queue
directly.

(There's a couple of gotchas here, where the if_start pointer is
compared to ieee80211_start(), but that's a later problem.)


git-svn-id: svn+ssh://svn.freebsd.org/base/head@245464 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Implement frame (data) transmission using if_transmit(), rather than
if_start().

This removes the overlapping data path TX from occuring, which
solves quite a number of the potential TX queue races in ath(4).
It doesn't fix the net80211 layer TX queue races and it doesn't
fix the raw TX path yet, but it's an important step towards this.

This hasn't dropped the TX performance in my testing; primarily
because now the TX path can quickly queue frames and continue
along processing.

This involves a few rather deep changes:

* Use the ath_buf as a queue placeholder for now, as we need to be
  able to support queuing a list of mbufs (ie, when transmitting
  fragments) and m_nextpkt can't be used here (because it's what is
  joining the fragments together)

* if_transmit() now simply allocates the ath_buf and queues it to
  a driver TX staging queue.

* TX is now moved into a taskqueue function.

* The TX taskqueue function now dequeues and transmits frames.

* Fragments are handled correctly here - as the current API passes
  the fragment list as one mbuf list (joined with m_nextpkt) through
  to the driver if_transmit().

* For the couple of places where ath_start() may be called (mostly
  from net80211 when starting the VAP up again), just reimplement
  it using the new enqueue and taskqueue methods.

What I don't like (about this work and the TX code in general):

* I'm using the same lock for the staging TX queue management and the
  actual TX.  This isn't required; I'm just being slack.

* I haven't yet moved TX to a separate taskqueue (but the taskqueue is
  created); it's easy enough to do this later if necessary.  I just need
  to make sure it's a higher priority queue, so TX has the same
  behaviour as it used to (where it would preempt existing RX..)

* I need to re-review the TX path a little more and make sure that
  ieee80211_node_*() functions aren't called within the TX lock.
  When queueing, I should just push failed frames into a queue and
  when I'm wrapping up the TX code, unlock the TX lock and
  call ieee80211_node_free() on each.

* It would be nice if I could hold the TX lock for the entire
  TX and TX completion, rather than this release/re-acquire behaviour.
  But that requires that I shuffle around the TX completion code
  to handle actual ath_buf free and net80211 callback/free outside
  of the TX lock.  That's one of my next projects.

* the ic_raw_xmit() path doesn't use this yet - so it still has
  sequencing problems with parallel, overlapping calls to the
  data path.  I'll fix this later.

Tested:

* Hostap - AR9280, AR9220
* STA - AR5212, AR9280, AR5416


git-svn-id: svn+ssh://svn.freebsd.org/base/head@245465 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add some new debugging options for the ath(4) and ath_hal(4) drivers.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@245466 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
cxgbe/tom: Add support for fully offloaded TCP/IPv6 connections (active open).

MFC after:	1 week


git-svn-id: svn+ssh://svn.freebsd.org/base/head@245467 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
cxgbe/tom: Add support for fully offloaded TCP/IPv6 connections (passive open).

MFC after:	1 week


git-svn-id: svn+ssh://svn.freebsd.org/base/head@245468 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Do not autotune ncallout to be greater than 18508.

When maxusers was unrestricted and maxfiles was allowed to autotune
much higher the result was that ncallout which was based on maxfiles
and maxproc grew much higher than was needed.

To fix this clip autotuning to the same number we would get with
the old maxusers algorithm which would stop scaling at 384
maxusers.

Growing ncalout higher is not likely to be needed since most consumers
of timeout(9) are gone and any higher value for ncallout causes the
callwheel hashes to be much larger than will even be needed for
most applications.

MFC after:      1 month

Reviewed by:	mav


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