Add Qlogic 10Gigabit Ethernet & CNA Adapter Driver Version 3.10.10 for
QLogic 8300 Series Adapters

Submitted by: David C Somayajulu (davidcs@freebsd.org) QLogic Corporation
Approved by: George Neville-Neil (gnn@freebsd.org)
sbin/camcontrol/camcontrol.c
	If an expander returns 0x00 (no device attached) in the ATTACHED DEVICE
	field of the SMP DISCOVER response, ignore the value of ATTACHED SAS
	ADDRESS, because it is invalid.  Some expanders zero out the address
	when the attached device is removed, but others do not.  Section
	9.4.3.10 of the SAS Protocol Layer 2 revision 04b does not require them
	to do so.

Approved by:	ken (mentor)
MFC after:	3 weeks
Implement my first cut at "correct" node power-save and
PS-POLL support.

This implements PS-POLL awareness i nthe

* Implement frame "leaking", which allows for a software queue
  to be scheduled even though it's asleep
* Track whether a frame has been leaked or not
* Leak out a single non-AMPDU frame when transmitting aggregates
* Queue BAR frames if the node is asleep
* Direct-dispatch the rest of control and management frames.
  This allows for things like re-association to occur (which involves
  sending probe req/resp as well as assoc request/response) when
  the node is asleep and then tries reassociating.
* Limit how many frames can set in the software node queue whilst
  the node is asleep.  net80211 is already buffering frames for us
  so this is mostly just paranoia.
* Add a PS-POLL method which leaks out a frame if there's something
  in the software queue, else it calls net80211's ps-poll routine.
  Since the ath PS-POLL routine marks the node as having a single frame
  to leak, either a software queued frame would leak, OR the next queued
  frame would leak. The next queued frame could be something from the
  net80211 power save queue, OR it could be a NULL frame from net80211.

TODO:

* Don't transmit further BAR frames (eg via a timeout) if the node is
  currently asleep.  Otherwise we may end up exhausting management frames
  due to the lots of queued BAR frames.

  I may just undo this bit later on and direct-dispatch BAR frames
  even if the node is asleep.

* It would be nice to burst out a single A-MPDU frame if both ends
  support this.  I may end adding a FreeBSD IE soon to negotiate
  this power save behaviour.

* I should make STAs timeout of power save mode if they've been in power
  save for more than a handful of seconds.  This way cards that get
  "stuck" in power save mode don't stay there for the "inactivity" timeout
  in net80211.

* Move the queue depth check into the driver layer (ath_start / ath_transmit)
  rather than doing it in the TX path.

* There could be some naughty corner cases with ps-poll leaking.
  Specifically, if net80211 generates a NULL data frame whilst another
  transmitter sends a normal data frame out net80211 output / transmit,
  we need to ensure that the NULL data frame goes out first.
  This is one of those things that should occur inside the VAP/ic TX lock.
  Grr, more investigations to do..

Tested:

* STA: AR5416, AR9280
* AP: AR5416, AR9280, AR9160
Constify parameters, no functional or binary change.

Verified with:	sha256(1)
MFC after:	2 weeks
Rename O_DIRECTORY to O_TMP_DIRECTORY to avoid shadowing the fcntl.h
O_DIRECTORY flag.

PR:		bin/173924
Obtained from:	git://repo.or.cz/nvi.git
Convert a couple of helper scripts used to test the ip provider to work on
FreeBSD. In the IPv6 case, try each interface before returning an error;
each IPv6-enabled interface will have a link-local address even if the link
isn't up.

MFC after:	1 week
Return one-based key so that user can check if the key is ever allocated
in the first place.

Initial patch submitted by: phk
Add a kernel config file for the BeableBone Black SoC.
Add tcp header flags ECE and CWR defined in RFC 3168.

PR:	140349
Submitted by:	Alan Amesbury <amesbury@umn.edu> (earlier version)
Reviewed by:	delphij
Approved by:	sbruno (mentor)
Fix L2 cache write-back invalidate for Sheeva core.

Submitted by:	Michal Dubiel
Obtained from:	Netasq, Semihalf
Add dependencies on the firmware, which allows the loading of the cxgb
and cxgbe modules.

Reviewed and approved by:	np
MFC after:	1 week
Add a sample script to create filesystem images from an installed tree
created by installworld+distribution with the -DNO_ROOT option.
Build bmake by default.
If someone explicitly builds usr.bin/make while MK_BMAKE==yes,
install it as 'fmake'.

Reviewed by:	brooks
Finally change the mbuf to have its own fib field instead of stealing
4 flag bits. This was supposed to happen in 8.0, and again in 2012..

MFC after:	never
Add a handy function for truncating variables to a specific byte-length. It
should be noted that newlines are both preserved and included in said byte-
count. If you want to truncate single-line values without regard to line
termination, there's always f_substr() which already exists herein.
Fix a typo in a comment.
Dump out the holding buffer descriptor contents and addresses stopping DMA.
Limit the number of software queued frames when doing non-aggregation.

This should prevent the TX queue being filled with non-aggregate frames,
causing starvation and non-fair queue behaviour.
Tidy up the debugging - don't bother printing out TID pointers; now
that we are printing out the MAC address in these fields, just printing
out the TID is enough.
A library function shall not set errno to 0.

Reviewed by:	mdf