]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoThe ARM generic timer keeps ticking even if disabled or it expired.
bz [Wed, 4 May 2016 16:09:51 +0000 (16:09 +0000)]
The ARM generic timer keeps ticking even if disabled or it expired.
In case of updating it with a very low value it might expire again
after writing the tval but before updating ctrl. In that case we do
lose the status bit saying that the timer expired and we will consequently
not get an interrupt for it, leaving the timer in a "dead" state.

In order to solve this increase the minimum period with what the timer
can be loaded to something higher.

Found & analysed with: gem5
Debugged with: andrew
Sponsored by: DARPA/AFRL
Reviewed by: andrew
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D6202

8 years agosys/sparc64: minor spelling fixes.
pfg [Wed, 4 May 2016 15:52:40 +0000 (15:52 +0000)]
sys/sparc64: minor spelling fixes.

Only affects comments: no functional change.

8 years agosys/arm: Minor spelling fixes.
pfg [Wed, 4 May 2016 15:48:59 +0000 (15:48 +0000)]
sys/arm: Minor spelling fixes.

Only affects comments: no functional change.

8 years agoxen/pvclock: set the correct resolution for the Xen PV clock
royger [Wed, 4 May 2016 13:49:59 +0000 (13:49 +0000)]
xen/pvclock: set the correct resolution for the Xen PV clock

The Xen PV clock has a resolution of 1ns, so set the resolution to the
highest one that FreeBSD supports, which is 1us.

MFC after: 2 weeks
Sponsored by: Citrix Systems R&D

8 years agortc: fix inverted resolution check
royger [Wed, 4 May 2016 13:48:59 +0000 (13:48 +0000)]
rtc: fix inverted resolution check

The current code in clock_register checks if the newly added clock has a
resolution value higher than the current one in order to make it the
default, which is wrong. Clocks with a lower resolution value should be
better than ones with a higher resolution value, in fact with the current
code FreeBSD is always selecting the worse clock.

Reviewed by: kib jhb jkim
Sponsored by: Citrix Systems R&D
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D6185

8 years agoiwn: fix device reset after watchdog timeout.
avos [Wed, 4 May 2016 12:51:27 +0000 (12:51 +0000)]
iwn: fix device reset after watchdog timeout.

Simple device reset (stop/start) is not enough here;
post-init state changes must be applied too.

8 years agoExtend the UQ_NO_STRINGS quirk to also cover the USB language string
hselasky [Wed, 4 May 2016 08:57:40 +0000 (08:57 +0000)]
Extend the UQ_NO_STRINGS quirk to also cover the USB language string
descriptor. This fixes enumeration of some older Samsung Galaxy S3
phones.

MFC after: 1 week

8 years agos/struct device */device_t/g
adrian [Wed, 4 May 2016 06:26:27 +0000 (06:26 +0000)]
s/struct device */device_t/g

Submitted by: kmacy

8 years agos/struct device */device_t/g
adrian [Wed, 4 May 2016 06:25:12 +0000 (06:25 +0000)]
s/struct device */device_t/g

Submitted by: kmacy

8 years agos/struct device */device_t/g
adrian [Wed, 4 May 2016 06:24:51 +0000 (06:24 +0000)]
s/struct device */device_t/g

Submitted by: kmacy

8 years agos/struct device */device_t/g
adrian [Wed, 4 May 2016 06:24:10 +0000 (06:24 +0000)]
s/struct device */device_t/g

Submitted by: kmacy

8 years agos/struct device */device_t/g
adrian [Wed, 4 May 2016 06:23:49 +0000 (06:23 +0000)]
s/struct device */device_t/g

Submitted by: kmacy

8 years agoFix build without "options PCI_IOV".
jkim [Wed, 4 May 2016 06:22:41 +0000 (06:22 +0000)]
Fix build without "options PCI_IOV".

8 years agoDIRDEPS_BUILD: Update dependencies.
bdrewery [Wed, 4 May 2016 03:14:34 +0000 (03:14 +0000)]
DIRDEPS_BUILD: Update dependencies.

Sponsored by: EMC / Isilon Storage Division

8 years agoDIRDEPS_BUILD: Exclude secure/lib* libraries for host builds.
bdrewery [Wed, 4 May 2016 03:13:48 +0000 (03:13 +0000)]
DIRDEPS_BUILD: Exclude secure/lib* libraries for host builds.

Sponsored by: EMC / Isilon Storage Division

8 years agokern: Factor out function to convert hash flags to malloc(9) flags
sephe [Wed, 4 May 2016 03:07:52 +0000 (03:07 +0000)]
kern: Factor out function to convert hash flags to malloc(9) flags

Suggested by: jhb
Reviewed by: jhb, kib
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6184

8 years ago[bwn] fix rate control feedback.
adrian [Wed, 4 May 2016 02:11:45 +0000 (02:11 +0000)]
[bwn] fix rate control feedback.

* Add a debug print for the xmit completion status fields.
  Yes, I like staring at a stream of DWORDS.

* Set the retrycnt to the number of full frame retries for now;
  I'll figure out how to factor rts/cts failures into it when
  I figure out what the difference is.

  It's -1 because it's not "retries", it's "tries".

It now passes the youtube test.

Tested:

* BCM4312, STA mode

8 years agosh: Handle empty hostname and $PWD when building prompt
vangyzen [Wed, 4 May 2016 02:06:46 +0000 (02:06 +0000)]
sh: Handle empty hostname and $PWD when building prompt

If the hostname is empty and \h is used in $PS1,
the remainder of the prompt following \h will be empty.
Likewise for $PWD and \w.  Fix it.

Reviewed by: jilles
MFC after: 1 week
Sponsored by: Dell Inc.
Differential Revision: https://reviews.freebsd.org/D6188

8 years agoFix nvram2env after bus_space_fdt removal.
kan [Wed, 4 May 2016 01:56:37 +0000 (01:56 +0000)]
Fix nvram2env after bus_space_fdt removal.

The generic bus space does the mapping now, no need to pre-translate
phys addresses to KSEG1 anymore.

Submitted by: Hiroki Mori

8 years agoUse imin() macro from sys/libkern.h.
araujo [Wed, 4 May 2016 01:43:07 +0000 (01:43 +0000)]
Use imin() macro from sys/libkern.h.

MFC after: 2 weeks.

8 years ago[bwn] accurately(ish) account transmit/recieve failures for rate control.
adrian [Wed, 4 May 2016 01:36:19 +0000 (01:36 +0000)]
[bwn] accurately(ish) account transmit/recieve failures for rate control.

I noticed that it'd associate fine, but it'd quickly stop exchanging traffic.
Receive was okay, but transmit just failed.

Then I went "wlandebug +rate".  I discovered it started at 36M OFDM, and then
quickly rose to 54M, which then showed 0% transmit success.

Then, I dug into how the completion path works.  We are reading 'ack=0'
in the TX status side, so .. then I discovered we were only processing the
TX completion status /if/ ack=1.  So, we'd only ever count successes;
we'd never count failures, and thus the rate control code thought
everything was a-ok.

We also have to set retrycnt to something non-zero so it indeed does
bring the rate down upon failure.

So:

* Delete the rate control completion code from the tx completion
  routine, it's just duplicate and never worked.  Putting it behind
  'if (status->ack) was pointless.

* Move it to the PIO and DMA completion routines which actually
  do free the node reference and mbuf.  We know at that point
  what the status is, so do it there.

* Fake a retrycnt of 1 for now, so we at least count failures.

Also:

* Start adding comments about weird stuff I find with rate selection.
  In this instance, we shouldn't be selecting a fallback rate that
  doesn't match the currently configured mode (11a, 11b, 11g, etc.)

This isn't perfect - AMRR does try 54mbit and takes a few packets
before it figures out it's a bad idea - but it's better than nothing.

This makes the bwn(4) driver actually useful for the first time since
I've tried using it - and that dates back to 2011.  I've resisted
successfully until now.

Tested:

* Broadcom BCM4312 802.11b/g Wireless, STA mode
  WLAN (chipid 0x4312 rev 15) PHY (analog 6 type 5 rev 1) RADIO (manuf 0x17f ver 0x2062 rev 2)

TODO:

* See if the fallback rate actually /is/ working
* Question my own sanity over touching this driver in the first place.

8 years ago[bwn] ensure the fallback rate stays in the same PHY mode.
adrian [Wed, 4 May 2016 01:29:00 +0000 (01:29 +0000)]
[bwn] ensure the fallback rate stays in the same PHY mode.

Falling back from 6MB OFDM to 5MB CCK (a) may not work well in the
11bg PHYs, (b) won't work at all if you're 11g only, and (c) plainly
won't work for the 11a PHY.

So, don't do that!

Tested:

* BCM4312 802.11b/g Wireless, STA mode
  WLAN (chipid 0x4312 rev 15) PHY (analog 6 type 5 rev 1) RADIO (manuf 0x17f ver 0x2062 rev 2)

8 years agoUse DEVMETHOD_END ({ NULL, NULL }) instead of hardcoding { 0, 0 }
ngie [Tue, 3 May 2016 23:56:52 +0000 (23:56 +0000)]
Use DEVMETHOD_END ({ NULL, NULL }) instead of hardcoding { 0, 0 }

Sponsored by: EMC / Isilon Storage Division

8 years agopmcstudy.8: minor "efficiency" fix.
pfg [Tue, 3 May 2016 22:20:55 +0000 (22:20 +0000)]
pmcstudy.8: minor "efficiency" fix.

No functional change.

8 years agosys/amd64: Small spelling fixes.
pfg [Tue, 3 May 2016 22:13:04 +0000 (22:13 +0000)]
sys/amd64: Small spelling fixes.

No functional change.

8 years agovmm(4): Small spelling fixes.
pfg [Tue, 3 May 2016 22:07:18 +0000 (22:07 +0000)]
vmm(4): Small spelling fixes.

Reviewed by: grehan

8 years agokgssapi: insignificant spelling fix.
pfg [Tue, 3 May 2016 22:05:03 +0000 (22:05 +0000)]
kgssapi: insignificant spelling fix.

No functional change.

8 years agoMisc. build: minor spelling fixes.
pfg [Tue, 3 May 2016 22:01:48 +0000 (22:01 +0000)]
Misc. build: minor spelling fixes.

No functional change.

8 years agosys/isa: minor spelling fixes.
pfg [Tue, 3 May 2016 21:51:52 +0000 (21:51 +0000)]
sys/isa: minor spelling fixes.

No functional change.

8 years agoPrint the fchmodat mode in human readable fashion
bapt [Tue, 3 May 2016 21:27:17 +0000 (21:27 +0000)]
Print the fchmodat mode in human readable fashion

MFC after: 1 week

8 years agoWork around (ignore) broken SRAT tables
vangyzen [Tue, 3 May 2016 20:14:04 +0000 (20:14 +0000)]
Work around (ignore) broken SRAT tables

Instead of panicking when parsing an invalid ACPI SRAT table,
just ignore it, effectively disabling NUMA.

https://lists.freebsd.org/pipermail/freebsd-current/2016-May/060984.html

Reported and tested by:  Bill O'Hanlon (bill.ohanlon at gmail.com)
Reviewed by: jhb
MFC after: 1 week
Relnotes: If dmesg shows "SRAT: Duplicate local APIC ID",
                try updating your BIOS to fix NUMA support.
Sponsored by: Dell Inc.

8 years agoSave and restore SRIOV-related config registers.
jhb [Tue, 3 May 2016 19:45:24 +0000 (19:45 +0000)]
Save and restore SRIOV-related config registers.

Save the value of the IOV control and page size registers and restore
them (along with the VF count) in pci_cfg_save/pci_cfg_restore.  This
ensures ARI remains enabled if a PF driver resets itself during the
PCI_IOV_INIT callback.  This might also properly restore SRIOV state
across suspend/resume.

Reviewed by: rstone, vangyzen
Differential Revision: https://reviews.freebsd.org/D6192

8 years agoUse the correct location of the SRIOV capability when enabling ARI.
jhb [Tue, 3 May 2016 19:37:25 +0000 (19:37 +0000)]
Use the correct location of the SRIOV capability when enabling ARI.

While here, check if ARI was enabled by re-reading the config register
after writing it and return an error if the write fails.

Reviewed by: rstone, vangyzen

8 years agoMerge OpenSSL 1.0.2h.
jkim [Tue, 3 May 2016 18:50:10 +0000 (18:50 +0000)]
Merge OpenSSL 1.0.2h.

Relnotes: yes

8 years agoAdd a debug dir for /boot/modules.
jhb [Tue, 3 May 2016 18:26:07 +0000 (18:26 +0000)]
Add a debug dir for /boot/modules.

This provides a place for standalone modules to store debug symbols.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D6190

8 years agoRe-sync the FreeBSD-specific Subversion template with the one from
dim [Tue, 3 May 2016 18:06:42 +0000 (18:06 +0000)]
Re-sync the FreeBSD-specific Subversion template with the one from
ports.

MFC after: 11 days
X-MFC-With: r298845

8 years agosys/net*: minor spelling fixes.
pfg [Tue, 3 May 2016 18:05:43 +0000 (18:05 +0000)]
sys/net*: minor spelling fixes.

No functional change.

8 years agoImport OpenSSL 1.0.2h.
jkim [Tue, 3 May 2016 18:00:27 +0000 (18:00 +0000)]
Import OpenSSL 1.0.2h.

8 years ago[asmc] Add support for MacBookPro5,1
adrian [Tue, 3 May 2016 17:11:33 +0000 (17:11 +0000)]
[asmc] Add support for MacBookPro5,1

Tested by: Johannes Lundberg <johannes@brilliantservice.co.jp>
PR: kern/209179
Submitted by: Thomas Brierley <tomxor@gmail.com>

8 years agoioat(4): Implement CRC and MOVECRC APIs
cem [Tue, 3 May 2016 17:07:18 +0000 (17:07 +0000)]
ioat(4): Implement CRC and MOVECRC APIs

And document them in ioat.4.

Sponsored by: EMC / Isilon Storage Division

8 years agoioat(4): Add CRC descriptor structure
cem [Tue, 3 May 2016 17:06:33 +0000 (17:06 +0000)]
ioat(4): Add CRC descriptor structure

Add CRC/MOVECRC operations, as well as the TEST and STORE variants.

With these operations, a CRC32C can be computed over one or more
descriptors' source data.  When the STORE operation is encountered, the
accumulated CRC32C is emitted to memory.  A TEST operations triggers an
IOAT channel error if the accumulated CRC32C does not match one in
memory.

These operations are not exposed through any API yet.

Sponsored by: EMC / Isilon Storage Division

8 years agoioat(4): Limit descriptor allocation to low 40 bits
cem [Tue, 3 May 2016 17:05:58 +0000 (17:05 +0000)]
ioat(4): Limit descriptor allocation to low 40 bits

The IOAT engine can only address the low 40 bits (1 TB) of physmem via
the 'next descriptor' pointer.  Restrict acceptable range given to
bus_dma_tag_create to match.

Sponsored by: EMC / Isilon Storage Division

8 years agosys/sys: missed in r298981.
pfg [Tue, 3 May 2016 16:37:09 +0000 (16:37 +0000)]
sys/sys: missed in r298981.

I am sure I've missed others as well, but at least it should
be more readable now.

No functional change.

8 years agoRemove the most useful INET || INET6 check leftover from whenever,
bz [Tue, 3 May 2016 16:01:53 +0000 (16:01 +0000)]
Remove the most useful INET || INET6 check leftover from whenever,
doing nothing.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

8 years agoCorrect wording.
kib [Tue, 3 May 2016 15:58:35 +0000 (15:58 +0000)]
Correct wording.

Submitted by: David A. Bright
MFC after: 2 weeks

8 years agoAdd some device IDs from Intel Sunrise Point chipsets.
mav [Tue, 3 May 2016 15:27:47 +0000 (15:27 +0000)]
Add some device IDs from Intel Sunrise Point chipsets.

MFC after: 2 weeks

8 years agoAdd EVFILT_VNODE open, read and close notifications.
kib [Tue, 3 May 2016 15:17:43 +0000 (15:17 +0000)]
Add EVFILT_VNODE open, read and close notifications.

While there, order EVFILT_VNODE notes descriptions alphabetically.

Based on submission, and tested by: Vladimir Kondratyev <wulf@cicgroup.ru>
MFC after: 2 weeks

8 years agosys/sys: minor spelling fixes.
pfg [Tue, 3 May 2016 15:14:17 +0000 (15:14 +0000)]
sys/sys: minor spelling fixes.

While the changes are minor, these headers are very visible.

MFC after: 2 weeks

8 years agodev/iscsi: minor spelling fixes.
pfg [Tue, 3 May 2016 14:49:49 +0000 (14:49 +0000)]
dev/iscsi: minor spelling fixes.

No functional change.

Reviewed by: trasz

8 years agoFix a memory leak in the devctl notify code.
scottl [Tue, 3 May 2016 14:30:26 +0000 (14:30 +0000)]
Fix a memory leak in the devctl notify code.

Submitted by: markj
MFC after: asap

8 years agoRevert r298955 for the cxgbe firmware.
pfg [Tue, 3 May 2016 11:49:29 +0000 (11:49 +0000)]
Revert r298955 for the cxgbe firmware.

These files have checksums that are none of my business.

Requested by: np

8 years agotcp/lro: Refactor the active list operation.
sephe [Tue, 3 May 2016 08:13:25 +0000 (08:13 +0000)]
tcp/lro: Refactor the active list operation.

Ease more work concerning active list, e.g. hash table etc.

Reviewed by: gallatin, rrs (earlier version)
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6137

8 years agoxen/i386: enable the platform hypercall for i386
royger [Tue, 3 May 2016 08:05:14 +0000 (08:05 +0000)]
xen/i386: enable the platform hypercall for i386

Not sure why the platform hypercall was disabled on i386, just enable it in
order to fix compilation of the PV timer on i386.

Sponsored by: Citrix Systems R&D

8 years agokern: Add phashinit_flags(), which allows malloc(M_NOWAIT)
sephe [Tue, 3 May 2016 07:17:13 +0000 (07:17 +0000)]
kern: Add phashinit_flags(), which allows malloc(M_NOWAIT)

It will be used for the upcoming LRO hash table initialization.
And probably will be useful in other cases, when M_WAITOK can't
be used.

Reviewed by: jhb, kib
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6138

8 years agosys/dev: minor spelling fixes.
pfg [Tue, 3 May 2016 03:41:25 +0000 (03:41 +0000)]
sys/dev: minor spelling fixes.

Most affect comments, very few have user-visible effects.

8 years ago[bwn] update bwn_dummy_transmission().
adrian [Tue, 3 May 2016 03:31:16 +0000 (03:31 +0000)]
[bwn] update bwn_dummy_transmission().

This is based on the b43 code.  It'll be used by the upcoming 11n phy.

Obtained from: Linux b43 (concept)

8 years ago[bwn] add PHY types for later PHYs.
adrian [Tue, 3 May 2016 03:27:11 +0000 (03:27 +0000)]
[bwn] add PHY types for later PHYs.

Obtained from: Linux b43

8 years ago[bwn] migrate bwn_dummy_transmission() back to main, as it'll be used by other PHYs.
adrian [Tue, 3 May 2016 03:24:27 +0000 (03:24 +0000)]
[bwn] migrate bwn_dummy_transmission() back to main, as it'll be used by other PHYs.

The Linux b43 driver uses this in other PHYs besides the g PHY.

8 years agoRevert bus_get_cpus() for now.
jhb [Tue, 3 May 2016 01:17:40 +0000 (01:17 +0000)]
Revert bus_get_cpus() for now.

I really thought I had run this through the tinderbox before committing,
but many places need <sys/types.h> -> <sys/param.h> for <sys/bus.h> now.

8 years agoFix an off by one error when remapping MSI-X vectors.
jhb [Tue, 3 May 2016 00:35:11 +0000 (00:35 +0000)]
Fix an off by one error when remapping MSI-X vectors.

pci_remap_msix() can be used to alter the mapping of allocated
MSI-X vectors to the MSI-X table.  The code had an off by one error
when adding the IRQ resources after performing a remap.  This was
fatal for any vectors in the table that used the "last" valid IRQ as
those vectors were assigned a garbage IRQ value.

MFC after: 3 days

8 years agoChange a rounding operation that had missing braces into a roundup2()
peter [Tue, 3 May 2016 00:09:13 +0000 (00:09 +0000)]
Change a rounding operation that had missing braces into a roundup2()
macro.  Adjust the buffer clipping code to work as expected.

This prevented a number of machines in the FreeBSD.org cluster from
booting due to "ZFS: i/o error - all block copies unavailable"
after an unclean shutdown.

8 years ago[bwn] break out the 'g' phy code into a separate source file.
adrian [Mon, 2 May 2016 22:58:11 +0000 (22:58 +0000)]
[bwn] break out the 'g' phy code into a separate source file.

* Break out the 'g' phy code;
* Break out the debugging bits into a separate source file, since
  some debugging prints are done in the phy code;
* Make some more chip methods in if_bwn.c public.

This brings the size of if_bwn.c down to 6,805 lines which is now
approaching managable.

8 years ago[bhnd] fix more module dependencies.
adrian [Mon, 2 May 2016 22:30:46 +0000 (22:30 +0000)]
[bhnd] fix more module dependencies.

Submitted by: Landon Fuller <landonf@landonf.org>
Differential Revision: https://reviews.freebsd.org/D6180

8 years agobsdinstall: fix static address assignment for protected wireless networks.
avos [Mon, 2 May 2016 21:40:34 +0000 (21:40 +0000)]
bsdinstall: fix static address assignment for protected wireless networks.

Filter out IFCONFIG_PREFIX variable (which may contain WPA keyword)
from ifconfig parameters.

PR: 169199

8 years agoUndo a spell fix introduced in r298942, which breaks compilation.
tuexen [Mon, 2 May 2016 21:23:05 +0000 (21:23 +0000)]
Undo a spell fix introduced in r298942, which breaks compilation.

8 years ago[bwn] break out the LP PHY code into a separate file.
adrian [Mon, 2 May 2016 21:06:02 +0000 (21:06 +0000)]
[bwn] break out the LP PHY code into a separate file.

This (and eventually migrating the other PHY code out) is in preparation
for adding the 11n PHY.  No, the 11ac PHY (for the BCM4260 softmac part) isn't
yet open source, so we can't grow that.  Yet.

This trims ~3,700 lines of code from if_bwn.c, bringing it down to a slightly
less crazy sounding 10,446 lines of code.

8 years ago[bhnd] add module dependencies.
adrian [Mon, 2 May 2016 21:01:08 +0000 (21:01 +0000)]
[bhnd] add module dependencies.

Submitted by: Landon Fuller <landonf@landonf.org>
Differential Revision: https://reviews.freebsd.org/D6179

8 years agonetinet/sctp*: minor spelling fixes in comments.
pfg [Mon, 2 May 2016 20:56:11 +0000 (20:56 +0000)]
netinet/sctp*: minor spelling fixes in comments.

No functional change.

Reviewed by: tuexen

8 years agonet80211: fix MAC address change via SIOCSIFLLADDR ioctl.
avos [Mon, 2 May 2016 20:46:05 +0000 (20:46 +0000)]
net80211: fix MAC address change via SIOCSIFLLADDR ioctl.

Recheck MAC address on SIOCSIFFLAGS; as a result,
'ifconfig wlan0 ether <addr>' can be used after interface startup.

PR: 208933

8 years agosys/vm: minor spelling fixes in comments.
pfg [Mon, 2 May 2016 20:16:29 +0000 (20:16 +0000)]
sys/vm: minor spelling fixes in comments.

No functional change.

8 years agodev/ath: minor spelling fixes in comments.
pfg [Mon, 2 May 2016 19:56:48 +0000 (19:56 +0000)]
dev/ath: minor spelling fixes in comments.

No functional change.

Reviewed by: adrian

8 years agoEnhance the ddb examine (x) command.
pfg [Mon, 2 May 2016 19:32:06 +0000 (19:32 +0000)]
Enhance the ddb examine (x) command.

* Change x/a to work similar to gdb.  The content of the memory is
  treated as an address, printed symbolically and the address is advanced.
  This way you can x/a <stack_address> and then just hit return a bunch
  of times to locate useful data on the stack.

* Add x/p.  The content of the memory is treated as an address and
  printed as hex.

This is based on the similar commit from DragonFlyBSD without the
cosmetic changes.

Relnotes: yes
Obtained from: DragonflyBSD (Matthew Dillon)
Reference: 0624d20e86affcd708609cbf9014207537537a72

8 years ago[asmc] add support for more models and restore keyboard backlight after resume.
adrian [Mon, 2 May 2016 19:15:16 +0000 (19:15 +0000)]
[asmc] add support for more models and restore keyboard backlight after resume.

This patch adds support for restoring backlight after resume and adds models
Macbook3,1
MacbookAir5,1
MacbookAir5,2

It also incorporates fixes for bug #175260, bug #203610 and bug #203512
so those can be closed if this patch is applied.

PR: kern/209156
PR: kern/175260
PR: kern/203610
PR: kern/203512
Submitted by: Johannes Lundberg <johannes@brilliantservice.co.jp>

8 years agoiwm: fix parameters for iwm_add_channel_band()
avos [Mon, 2 May 2016 19:07:44 +0000 (19:07 +0000)]
iwm: fix parameters for iwm_add_channel_band()

It accepts <first index, max index + 1>, not
<first index, number of entries>.

Reported by: adrian

8 years ago[bhnd] add missing bus interface SRC bits, required after the last source import.
adrian [Mon, 2 May 2016 18:48:37 +0000 (18:48 +0000)]
[bhnd] add missing bus interface SRC bits, required after the last source import.

8 years agoxen/control: improve suspend/resume
royger [Mon, 2 May 2016 18:23:48 +0000 (18:23 +0000)]
xen/control: improve suspend/resume

Implement several small improvements to the suspend/resume Xen sequence:

 - Call the power_suspend_early event before stopping all processes.
 - Stop all processes. This was done implicitly previously by putting all
   the CPUs in a known IPI handler.
 - Warm up the timecounter.
 - Re-initialize the time of day register.

Sponsored by: Citrix Systems R&D

8 years agoAdd a new bus method to fetch device-specific CPU sets.
jhb [Mon, 2 May 2016 18:00:38 +0000 (18:00 +0000)]
Add a new bus method to fetch device-specific CPU sets.

bus_get_cpus() returns a specified set of CPUs for a device.  It accepts
an enum for the second parameter that indicates the type of cpuset to
request.  Currently two valus are supported:

 - LOCAL_CPUS (on x86 this returns all the CPUs in the package closest to
   the device when DEVICE_NUMA is enabled)
 - INTR_CPUS (like LOCAL_CPUS but only returns 1 SMT thread for each core)

For systems that do not support NUMA (or if it is not enabled in the kernel
config), LOCAL_CPUS fails with EINVAL.  INTR_CPUS is mapped to 'all_cpus'
by default.  The idea is that INTR_CPUS should always return a valid set.

Device drivers which want to use per-CPU interrupts should start using
INTR_CPUS instead of simply assigning interrupts to all available CPUs.
In the future we may wish to add tunables to control the policy of
INTR_CPUS (e.g. should it be local-only or global, should it ignore
SMT threads or not).

The x86 nexus driver exposes the internal set of interrupt CPUs from the
the x86 interrupt code via INTR_CPUS.

The ACPI bus driver and PCI bridge drivers use _PXM to return a suitable
LOCAL_CPUS set when _PXM exists and DEVICE_NUMA is enabled.  They also and
the global INTR_CPUS set from the nexus driver with the per-domain set from
_PXM to generate a local INTR_CPUS set for child devices.

Reviewed by: wblock (manpage)
Differential Revision: https://reviews.freebsd.org/D5519

8 years agodev/usb: minor spelling fixes in comments.
pfg [Mon, 2 May 2016 17:44:03 +0000 (17:44 +0000)]
dev/usb: minor spelling fixes in comments.

No functional change.

Reviewed by: hselasky

8 years agoetc: minor spelling fixes.
pfg [Mon, 2 May 2016 16:47:28 +0000 (16:47 +0000)]
etc: minor spelling fixes.

Mostly comments but also some user-visible strings.

MFC after: 2 weeks

8 years agoxen/time: fix PV clock resolution
royger [Mon, 2 May 2016 16:16:08 +0000 (16:16 +0000)]
xen/time: fix PV clock resolution

The current resolution of the Xen PV clock is too high, which causes an
adjustment of 5s to be applied to it. Reduce the resolution to be the same
as the RTC plus one, so it's always selected as the best source when
available on x86.

Also don't reset the clock on resume, it's pointless and discards any
previous adjustments.

Sponsoted by: Citrix Systems R&D

8 years agoxen/time: allow Dom0 to set the host time
royger [Mon, 2 May 2016 16:15:28 +0000 (16:15 +0000)]
xen/time: allow Dom0 to set the host time

Dom0 should be able to set the host time. This is implemented by first
writing to the RTC (as would be done on bare metal), and then using the
XENPF_settime64 hypercall in order to force Xen to update the wallclock
shared page of all domains.

Sponsored by: Citrix Systems R&D

8 years agoatrtc: export function to set RTC
royger [Mon, 2 May 2016 16:14:55 +0000 (16:14 +0000)]
atrtc: export function to set RTC

This is going to be used by the Xen clock on Dom0 in order to set the RTC of
the host. The current logic in atrtc_settime is moved to atrtc_set and the
unused device_t parameter is removed from the atrtc_set function call so it
can be safely used by other callers.

Sponsored by: Citrix Systems R&D
Reviewed by: kib, jhb
Differential revision: https://reviews.freebsd.org/D6067

8 years agoxen/timer: remove the timer setup loop
royger [Mon, 2 May 2016 16:13:55 +0000 (16:13 +0000)]
xen/timer: remove the timer setup loop

With the removal of the usage of the VCPU_SSHOTTMR_future flag, now
all errors from xentimer_vcpu_start_timer should be considered fatal, and
the loop is no longer needed since in case of setting the timer in the past
we will get an event interrupt right away (instead of returning ETIME).

Sponsored by: Citrix Systems R&D
MFC after : 2 weeks

8 years agoxen/x86: don't lose event interrupts
royger [Mon, 2 May 2016 16:13:11 +0000 (16:13 +0000)]
xen/x86: don't lose event interrupts

On slow platforms with unreliable TSC, such as QEMU emulated machines,
it is possible for the FreeBSD kernel to request the next event in the
past. In that case, in the current implementation of
xentimer_vcpu_start_timer, we simply return -ETIME. To be precise Xen
returns -ETIME and we pass it on. As a consequence we need to loop
around to function to make sure that the timer is properly set.

Instead it is better to always ask the hypervisor for a timer event,
even if the timeout is past. To do that, remove the VCPU_SSHOTTMR_future
flag.

Submitted by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed by: royger
MFC after: 2 weeks

8 years agoiwn: do not buffer frames for non-passive channels (it's not needed).
avos [Mon, 2 May 2016 15:14:16 +0000 (15:14 +0000)]
iwn: do not buffer frames for non-passive channels (it's not needed).

8 years agofgetc returns an int not a char.
bz [Mon, 2 May 2016 15:07:43 +0000 (15:07 +0000)]
fgetc returns an int not a char.

Found by:   powerpc builds failing due to comparing with EOF raised:
"comparison is always false due to limited range of data type"

8 years agodev/random: minor spelling fixes in comments.
pfg [Mon, 2 May 2016 14:35:57 +0000 (14:35 +0000)]
dev/random: minor spelling fixes in comments.

No functional change.

Reviewed by: markm
Approved by: so

8 years agoIssue NOTE_EXTEND when a directory entry is added to or removed from
kib [Mon, 2 May 2016 13:18:17 +0000 (13:18 +0000)]
Issue NOTE_EXTEND when a directory entry is added to or removed from
the monitored directory as the result of rename(2) operation.  The
renames staying in the directory are not reported.

Submitted by: Vladimir Kondratyev <wulf@cicgroup.ru>
MFC after: 2 weeks

8 years agoFix reporting of NOTE_LINK when directory link count changes due to
kib [Mon, 2 May 2016 13:13:32 +0000 (13:13 +0000)]
Fix reporting of NOTE_LINK when directory link count changes due to
rename removing or adding subdirectory entry.

Discussed with and tested by: Vladimir Kondratyev <wulf@cicgroup.ru>
NetBSD PR: 48958 (http://gnats.netbsd.org/48958)
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

8 years ago[otus] implement monitor mode.
adrian [Mon, 2 May 2016 05:43:46 +0000 (05:43 +0000)]
[otus] implement monitor mode.

* break out the operating mode and rx filter into new functions, rather
  than them being hard-coded
* if we're in sniffer mode or not associated, set the BSS MAC to all zero,
  rather than relying on a chip reset to do it for us
* add comments about .. how interestingly buggy the chip is.

Tested:

* AR9170 + AR9102, STA+monitor mode

Obtained from: linux carl9170 (general chip workings, constant definitions)

8 years agos/struct device */device_t/
adrian [Mon, 2 May 2016 05:37:25 +0000 (05:37 +0000)]
s/struct device */device_t/

Submitted by: kmacy

8 years ago[mwl] s/struct device/device_t/
adrian [Mon, 2 May 2016 04:15:15 +0000 (04:15 +0000)]
[mwl] s/struct device/device_t/

Submitted by: kmacy

8 years agorpcbind: use our roundup() macro when available through <sys/param.h>.
pfg [Mon, 2 May 2016 02:15:05 +0000 (02:15 +0000)]
rpcbind: use our roundup() macro when available through <sys/param.h>.

No functional change.

8 years agoquot: make use of our rounddown() macro when <sys/param.h> is available.
pfg [Mon, 2 May 2016 02:13:22 +0000 (02:13 +0000)]
quot: make use of our rounddown() macro when <sys/param.h> is available.

No functional change.

8 years agoUse MIN macro from sys/param.h.
araujo [Mon, 2 May 2016 01:49:42 +0000 (01:49 +0000)]
Use MIN macro from sys/param.h.

MFC after: 2 weeks.

8 years agoUse MIN/MAX macros from sys/param.h.
araujo [Mon, 2 May 2016 01:47:13 +0000 (01:47 +0000)]
Use MIN/MAX macros from sys/param.h.

MFC after: 2 weeks.

8 years agoUse MIN macro from sys/param.h.
araujo [Mon, 2 May 2016 01:45:52 +0000 (01:45 +0000)]
Use MIN macro from sys/param.h.

MFC after: 2 weeks.

8 years agoUse MAX macro from sys/param.h.
araujo [Mon, 2 May 2016 01:43:22 +0000 (01:43 +0000)]
Use MAX macro from sys/param.h.

MFC after: 2 weeks.

8 years agoUse MIN macro from sys/param.h.
araujo [Mon, 2 May 2016 01:40:31 +0000 (01:40 +0000)]
Use MIN macro from sys/param.h.

MFC after: 2 weeks

8 years agoUse MIN/MAX macros from sys/param.h.
araujo [Mon, 2 May 2016 01:28:21 +0000 (01:28 +0000)]
Use MIN/MAX macros from sys/param.h.

MFC after: 2 weeks.