Simplify the kernel pmap locking in pmap_enter_pv().  While I'm here, tidy
up the comments and whitespace.

Tested by:	cognet


git-svn-id: svn://svn.freebsd.org/base/head@240442 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Update interface to firmware 1.6.2 and include the firmware in the driver.

Obtained from:	Chelsio
MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@240443 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Compensate for half/quarter rate differences in MAC clock speed.

This fixes the incorrect slot (and likely ACK/RTS timeout) values
which I see when enabling half/quarter rate support on the AR9280.

The resulting math matches the expected calculated default values.


git-svn-id: svn://svn.freebsd.org/base/head@240444 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add register defintions for the AR5416 TX/RX latency fields.

Obtained from:	Qualcomm Atheros


git-svn-id: svn://svn.freebsd.org/base/head@240445 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Call the ar5212SetCoverageClass() function for now.

Some of the math is a little wrong thanks to clocks in 11a mode running
at 44MHz when in fast clock mode (rather than 40MHz, which the chips
before AR9280 ran 11a in).  That'll have to be addressed in a future commit.


git-svn-id: svn://svn.freebsd.org/base/head@240446 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Introduce an AR5416 flavour of the IFS and mac usec/timing configuration
used when running the chips in half/quarter rate.

This sets up some default parameters which are then overridden by the
driver (which manually configures things like slot timing at interface
start time.)

Although this is a copy-and-modify from the AR5212 HAL, I did peek
at the reference HAL and the ath9k driver to see what they did.
Ath9k in particular doesn't hard-code this - instead, their version
of ar5416InitUserSettings() does all of the relevant math.

TODO:

* do the math, not hard code things!
* fix the mac clock calculation for the AR9287; since it runs the
  MAC clock at a higher rate, requiring all the duration calculations
  to change;
* Do a whole lot more validation for half/quarter rates.

Obtained from:	Qualcomm Atheros, Linux ath9k


git-svn-id: svn://svn.freebsd.org/base/head@240447 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Flip on half/quarter rate support.

No, this isn't HT/5 and HT/10 support.  This is the 11a half/quarter
rate support primarily used by the 4.9GHz and GSM band regulatory
domains.

This is definitely a work in progress.

TODO:

* everything in the last commit;
* lots more interoperability testing with the AR5212 half/quarter rate
  support for the relevant chips;
* Do some interop testing on half/quarter rate support between _all_
  the 11n chips - AR5416, AR9160, AR9280 (and AR9285/AR9287 when 2GHz
  half/quarter rate support is coded up.)


git-svn-id: svn://svn.freebsd.org/base/head@240448 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Enable fractional 5G mode on half/quarter rate channels.

Obtained from:	Linux ath9k


git-svn-id: svn://svn.freebsd.org/base/head@240449 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Rename __member2struct() to __containerof().

Compared to __member2struct(), this macro has the following advantages:

- It ensures that the type of the pointer is compatible with the member
  field of the structure (or a void pointer).
- It works properly in combination with volatile and const, though
  unfortunately it drops these qualifiers from the returned value.

mdf@ proposed to add the container_of() macro, just like Linux has.
Eventually I decided against this, as <sys/param.h> is included all over
the place. It seems container_of() on Linux is specific to the kernel,
not userspace. I'd rather not pollute userspace with this.

I also thought about adding __container_of(), but this would have two
advantages. Xorg seems to already have a __container_of(), which is not
compatible with this version. Also, the underscore in the middle
conflicts with our existing macros (__offsetof, __rangeof, etc).

I'm changing member2struct() to use its old code, as the extra
strictness of this new macro conflicts with existing code (read: cxgb).

MFC after:	1 month


git-svn-id: svn://svn.freebsd.org/base/head@240450 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Allow cxgbe to be built into a kernel with "device cxgbe."

MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@240451 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Use native FreeBSD facilities everywhere except the shared code in common/

MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@240452 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Install interrupt handlers early, during attach, for the reason
explained in r239913 by jhb.

MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@240453 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Rename the IVY_RNG option to RDRAND_RNG.

Based on submission by:	Arthur Mesh <arthurmesh@gmail.com>
MFC after:	2 weeks


git-svn-id: svn://svn.freebsd.org/base/head@240455 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFV of 240454, tzdata2012f

- Pacific/Fiji will go into DST from 21 October 2012 till 20 January 2013.
- Fix offset for Pacific/Tokelau.
- Gaza and West Bank had DST from 29 March to 28 September 2012.
- Syria has DST from April till October
- Morocco had DST from April to September 2012 except for 20 July to 20 August.
- Cuba changed to DST from 1 April 2012 only.
- Haiti has DST between 8 March and 1 November in 2012.

Obtained from:	ftp://ftp.iana.org/tz/releases/


git-svn-id: svn://svn.freebsd.org/base/head@240457 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Document the *_chroot, *_user, *_group and *_nice knobs for services started
by rcng.

Reviewed by:	wblock, dougb


git-svn-id: svn://svn.freebsd.org/base/head@240462 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
- Fix a typo in debug message.

Approved by:	kib (mentor)
MFC after:	3 days


git-svn-id: svn://svn.freebsd.org/base/head@240463 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
The deadfs VOPs for vop_ioctl and vop_bmap call itself recursively,
which is an elaborate way to cause kernel panic. Change the VOPs
implementation to return EBADF for a reclaimed vnode.

While the calls to vop_bmap should not reach deadfs, it is indeed
possible for vop_ioctl, because the VOP locking protocol is to pass
the vnode to VOP unlocked. The actual panic was observed when ioctl
was called on procfs filedescriptor which pointed to an exited
process.

Reported by:	zont
Tested by:	pho
MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@240464 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add global and per-module sysctls/tunables to enable/disable metadata taste.
That should help to handle some cases when disk has some RAID metadata that
should be ignored, especially during boot.

MFC after:	3 days


git-svn-id: svn://svn.freebsd.org/base/head@240465 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Define missing DEBUGOUT# macros. DEBUGOUT[45] are not yet used but are
being defined pre-emptively to avoid future build breakage

PR:		kern/168967
Submitted by:	fuzhli <fuzl@arraynetworks.com.cn>
Approved by:	cperciva
MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@240466 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Ignore stop and continue signals sent to an exiting process.  Stop signals
set p_xstat to the signal that triggered the stop, but p_xstat is also
used to hold the exit status of an exiting process.  Without this change,
a stop signal that arrived after a process was marked P_WEXIT but before
it was marked a zombie would overwrite the exit status with the stop signal
number.

Reviewed by:	kib
MFC after:	1 week


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