freebsd.git
7 years agoRevert r306148 to fix build
cem [Thu, 22 Sep 2016 00:25:23 +0000 (00:25 +0000)]
Revert r306148 to fix build

Requested by: jpaetzel
Reported by: Larry Rosenman <ler at lerctr.org>, Jenkins

7 years agoUpdate oce driver to 11.0.50.0
jpaetzel [Wed, 21 Sep 2016 22:53:16 +0000 (22:53 +0000)]
Update oce driver to 11.0.50.0

Submitted by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>

7 years agoRevert part of r306065
jhibbits [Wed, 21 Sep 2016 22:09:17 +0000 (22:09 +0000)]
Revert part of r306065

This is a separate change I was testing.

7 years agoRegenerate.
bdrewery [Wed, 21 Sep 2016 21:42:06 +0000 (21:42 +0000)]
Regenerate.

7 years agoSYSTEM_COMPILER is not forced off with META_MODE after r304682.
bdrewery [Wed, 21 Sep 2016 21:32:05 +0000 (21:32 +0000)]
SYSTEM_COMPILER is not forced off with META_MODE after r304682.

Sponsored by: Dell EMC Isilon

7 years ago[iwm] use rate control info from the node txrates; use mgmtrate for EAPOL frames
adrian [Wed, 21 Sep 2016 20:56:10 +0000 (20:56 +0000)]
[iwm] use rate control info from the node txrates; use mgmtrate for EAPOL frames

This changes the transmit rate control code to do a few things:

* use fixed rates (mcast, ucast, mgmt) where required.
* Don't use a hard-coded 11a or 11bg rate for non-data frames -
  use what net80211 says we should use.
* use mgmtrate for EAPOL frames.

Reviewed by: avos
Differential Revision: https://reviews.freebsd.org/D7994

7 years ago[net80211] don't add IBSS node table entries for neighbors from other SSIDs.
adrian [Wed, 21 Sep 2016 19:48:07 +0000 (19:48 +0000)]
[net80211] don't add IBSS node table entries for neighbors from other SSIDs.

The adhoc probe/beacon input path was creating nodes for all SSIDs.
This wasn't a problem when the NICs were configured to only process
frames for the current BSSID, but that didn't allow IBSS merges.
Once avos and I flipped on "beacons from all BSSIDs" to allow for
correct IBSS merging, we found this interesting behaviour.

This adds a check against the current SSID.

* If there's no VAP SSID, allow anything
* If there's a VAP SSID, check if the incoming frame has a suitable
  SSID and if so, allow it.

This prevents nodes being created for other SSIDs in probe and beacon
frames - ie, beacons overlapping IBSSes with different SSIDs, and
probe requests from arbitrary devices.

Tested:

* AR9380, IBSS mode, both local and other IBSSes.

Reviewed by: avos
Differential Revision: https://reviews.freebsd.org/D7959

7 years agoFix typo.
np [Wed, 21 Sep 2016 19:30:34 +0000 (19:30 +0000)]
Fix typo.

7 years agocxgbetool: Add T6 support to the SGE context decoder.
np [Wed, 21 Sep 2016 19:26:36 +0000 (19:26 +0000)]
cxgbetool: Add T6 support to the SGE context decoder.

Obtained from: Chelsio Communications
Sponsored by: Chelsio Communications

7 years agoAdd myself (jrm) to calendar.freebsd
jrm [Wed, 21 Sep 2016 18:52:49 +0000 (18:52 +0000)]
Add myself (jrm) to calendar.freebsd

Approved by:    swills (mentor)

7 years agoAdd evdev support to ums(4)
gonzo [Wed, 21 Sep 2016 18:52:03 +0000 (18:52 +0000)]
Add evdev support to ums(4)

event generation is disabled by default in favour of sysmouse. This
behavoiur is controlled by kern.evdev.rcpt_mask sysctl, bit 2 should
be set to give priority to hw over sysmouse

Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
Reviewed by: hans
Differential Revision: https://reviews.freebsd.org/D7863

7 years agoAdd myself (jrm) as a ports committer and update mentor/mentee relationships
jrm [Wed, 21 Sep 2016 18:50:11 +0000 (18:50 +0000)]
Add myself (jrm) as a ports committer and update mentor/mentee relationships

Approved by: swills (mentor)

7 years agoAdd evdev support to ukbd driver
gonzo [Wed, 21 Sep 2016 18:47:21 +0000 (18:47 +0000)]
Add evdev support to ukbd driver

event generation is disabled by default in favour of kbdmux. This
behavoiur is controlled by kern.evdev.rcpt_mask sysctl, bit 3 should
be set to give priority to hw over mux

Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
Reviewed by: hans
Differential Revision: https://reviews.freebsd.org/D7957

7 years agoUpdate mkimg(1) author's contact info
asomers [Wed, 21 Sep 2016 18:42:17 +0000 (18:42 +0000)]
Update mkimg(1) author's contact info

Reviewed by: marcel, imp
MFC after: 3 days
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D7991

7 years agoReduce code duplication by factoring out the delta_t() function.
trasz [Wed, 21 Sep 2016 18:07:25 +0000 (18:07 +0000)]
Reduce code duplication by factoring out the delta_t() function.
No functional changes.

MFC after: 1 month

7 years agoposix_openpt.2: Sort includes per style(9)
cem [Wed, 21 Sep 2016 17:51:27 +0000 (17:51 +0000)]
posix_openpt.2: Sort includes per style(9)

Sponsored by: Dell EMC Isilon

7 years agoFix invalid vendor ID constant (typo).
jhb [Wed, 21 Sep 2016 16:51:56 +0000 (16:51 +0000)]
Fix invalid vendor ID constant (typo).

During a bus rescan the check for an invalid vendor ID of a subfunction
used the wrong constant.

Submitted by: Dexuan Cui <decui@microsoft.com>
MFC after: 3 days

7 years ago1) For already non-standard %z extension implement GNU compatible formats:
ache [Wed, 21 Sep 2016 15:47:40 +0000 (15:47 +0000)]
1) For already non-standard %z extension implement GNU compatible formats:
+hh and -hh.
2) Check for incorrect values for %z.

MFC after:      7 days

7 years agoHopefully, fix build of the module outside the kernel tree.
kib [Wed, 21 Sep 2016 14:42:23 +0000 (14:42 +0000)]
Hopefully, fix build of the module outside the kernel tree.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoAdd support for the TP-Link TG-3468 v2.
kevlo [Wed, 21 Sep 2016 14:15:15 +0000 (14:15 +0000)]
Add support for the TP-Link TG-3468 v2.

This is an RTL8168 chip, which we already support so all we have to do is add
the vendor ID.

PR: 212876
Submitted by: Tobias Kortkamp <t@tobik.me>
MFC after: 3 days

7 years agoRefine the dirname(3) compatibility workaround a bit more.
ed [Wed, 21 Sep 2016 13:03:55 +0000 (13:03 +0000)]
Refine the dirname(3) compatibility workaround a bit more.

Right now our workaround is so good that it doesn't throw any warnings
on misuse. This means that people will keep on using the old version
of dirname(3) silently without fixing their code.

Go ahead and change the prototype of __old_dirname() to also use a plain
char *, so that we still get a compiler warning. This won't have any
negative effect on building older versions of FreeBSD on HEAD, as those
are built with -Werror disabled.

Differential Revision: https://reviews.freebsd.org/D7844

7 years agoFix misuse of the basename() and dirname() functions.
ed [Wed, 21 Sep 2016 13:02:43 +0000 (13:02 +0000)]
Fix misuse of the basename() and dirname() functions.

These functions are allowed to overwrite their input. Pull a copy of the
input parameter and call dirname() and basename() on that instead. Do
ensure that we reload the pathname value between calls.

7 years agoUse kqueue(2) instead of select(2).
br [Wed, 21 Sep 2016 11:59:52 +0000 (11:59 +0000)]
Use kqueue(2) instead of select(2).
This helps to ensure we will not lose SIGINT sent by parent to child.

Reviewed by: sbruno, ngie
Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
Differential Revision: https://reviews.freebsd.org/D7892

7 years agoAdd kernel interfaces to call EFI Runtime Services.
kib [Wed, 21 Sep 2016 11:31:58 +0000 (11:31 +0000)]
Add kernel interfaces to call EFI Runtime Services.

Runtime services require special execution environment for the call.
Besides that, OS must inform firmware about runtime virtual memory map
which will be active during the calls, with the SetVirtualAddressMap()
runtime call, done while the 1:1 mapping is still used.  There are two
complication: the SetVirtualAddressMap() effectively must be done from
loader, which needs to know kernel address map in advance.  More,
despite not explicitely mentioned in the specification, both 1:1 and
the map passed to SetVirtualAddressMap() must be active during the
SetVirtualAddressMap() call.  Second, there are buggy BIOSes which
require both mappings active during runtime calls as well, most likely
because they fail to identify all relocations to perform.

On amd64, we can get rid of both problems by providing 1:1 mapping for
the duration of runtime calls, by temprorary remapping user addresses.
As result, we avoid the need for loader to know about future kernel
address map, and avoid bugs in BIOSes.  Typically BIOS only maps
something in low 4G.  If not runtime bugs, we would take advantage of
the DMAP, as previous versions of this patch did.

Similar but more complicated trick can be used even for i386 and 32bit
runtime, if and when the EFI boot on i386 is supported.  We would need
a trampoline page, since potentially whole 4G of VA would be switched
on calls, instead of only userspace portion on amd64.

Context switches are disabled for the duration of the call, FPU access
is granted, and interrupts are not disabled.  The later is possible
because kernel is mapped during calls.

To test, the sysctl mib debug.efi_time is provided, setting it to 1
makes one call to EFI get_time() runtime service, on success the efitm
structure is printed to the control terminal.  Load efirt.ko, or add
EFIRT option to the kernel config, to enable code.

Discussed with: emaste, imp
Tested by: emaste (mac, qemu)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoCosmetics - add missing newline.
trasz [Wed, 21 Sep 2016 11:27:56 +0000 (11:27 +0000)]
Cosmetics - add missing newline.

MFC after: 1 month

7 years agoMake the "r/s" and "w/s" fields in "iostat -x" a little bit wider;
trasz [Wed, 21 Sep 2016 11:22:19 +0000 (11:22 +0000)]
Make the "r/s" and "w/s" fields in "iostat -x" a little bit wider;
five chars is way too narrow for todays disks.

MFC after: 1 month

7 years agoMake it possible for diskinfo(8) to operate on files. This is useful
trasz [Wed, 21 Sep 2016 11:17:58 +0000 (11:17 +0000)]
Make it possible for diskinfo(8) to operate on files.  This is useful
with -t and upcoming -i.

MFC after: 1 month

7 years agoDisable extattr test on UFS1.
br [Wed, 21 Sep 2016 10:58:58 +0000 (10:58 +0000)]
Disable extattr test on UFS1.

This test supports native extended attributes only (e.g. UFS2)

Reviewed by: asomers, ngie
Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
Differential Revision: https://reviews.freebsd.org/D7981

7 years agoRename efi_systbl to efi_systbl_phys, the variable contains the
kib [Wed, 21 Sep 2016 10:55:28 +0000 (10:55 +0000)]
Rename efi_systbl to efi_systbl_phys, the variable contains the
physical address of the EFI System Table.  Add _KERNEL guard around
its declaration in sys/efi.h.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoAdd a way for the architecture to specify the calling ABI for methods
kib [Wed, 21 Sep 2016 10:35:44 +0000 (10:35 +0000)]
Add a way for the architecture to specify the calling ABI for methods
in the EFI Runtime Services Table.  On amd64, the calling conventions
are MS.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoSimple post-mortem reporter for amd64 loader.efi.
kib [Wed, 21 Sep 2016 10:22:46 +0000 (10:22 +0000)]
Simple post-mortem reporter for amd64 loader.efi.

There is no way to see anything about the faults occuring in
loader.efi. Some intel BIOSes do output a line into serial port at
115200/8/1 regardless of the current port settings with the EFI error
number, but this is too little, and not always available, esp. if the
user does not know where to look.

The patch adds a simple facility to grab exceptions and at least dump
generic registers and some exception details.  Due to the relative
complexity of correctly taking over the BIOS IDT setup, only install
the facility on user request.

Two new commands, 'grab_faults' and 'ungrab_faults' are provided,
first one takes over, second undoes the first. It is supposed that
user would execute 'grab' by the developer direction of collecting the
debugging data.  The 'fault' command generates exception to test the
setup.

Fault handlers use dedicated stack to improve chances of catching
stack/TSS exceptions.  Due to this, BIOS IDT is duplicated into a
private copy, and debugger needs to find a free GDT slot for TSS. This
is done in somewhat complicated efi_redirect_exceptions().

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D7935

7 years agoMake resettodr_lock accessible outside subr_rtc.c. Protect
kib [Wed, 21 Sep 2016 10:15:08 +0000 (10:15 +0000)]
Make resettodr_lock accessible outside subr_rtc.c.  Protect
CLOCK_GETTIME() with the lock.

Now all time-related accesses to the CMOS for RTC should be under the
lock.  This is needed to allow upcoming EFI Runtime Services support
to provide required execution environment for the firmware calls.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoAdd amd64 functions to load/store GDT register, store IDT and TR registers.
kib [Wed, 21 Sep 2016 10:10:36 +0000 (10:10 +0000)]
Add amd64 functions to load/store GDT register, store IDT and TR registers.

Note that lgdt() name is already used for function which, besides
loading GDT, also reloads segment descriptors cache, thus new function
is named bare_lgdt().

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoExport the pmap_cache_bits() and pmap_pinit_pml4() functions from the
kib [Wed, 21 Sep 2016 10:05:51 +0000 (10:05 +0000)]
Export the pmap_cache_bits() and pmap_pinit_pml4() functions from the
amd64 pmap.

The new pmap_pinit_pml4() function initializes the level 4 page table
with entries for the kernel mappings.  Both functions are needed for
upcoming EFI Runtime Services support.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoUpdate the device tree source files to a Linux 4.7-RC.
andrew [Wed, 21 Sep 2016 08:54:08 +0000 (08:54 +0000)]
Update the device tree source files to a Linux 4.7-RC.

MFC after: 2 weeks
Sponsored by: ABT Systems Ltd

7 years agoFix the handling of unordered fragmented user messages using DATA chunks.
tuexen [Wed, 21 Sep 2016 08:28:18 +0000 (08:28 +0000)]
Fix the handling of unordered fragmented user messages using DATA chunks.

There were two bugs:
* There was an accounting bug resulting in reporting a too small a_rwnd.
* There are a bug when abandoning messages in the reassembly queue.

MFC after: 4 weeks

7 years agoAdd PROC_TRAPCAP procctl(2) controls and global sysctl kern.trap_enocap.
kib [Wed, 21 Sep 2016 08:23:33 +0000 (08:23 +0000)]
Add PROC_TRAPCAP procctl(2) controls and global sysctl kern.trap_enocap.

Both can be used to cause processes in capability mode to receive
SIGTRAP when ENOTCAPABLE or ECAPMODE errors are returned from
syscalls.

Idea by: emaste
Reviewed by: oshogbo (previous version), emaste
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D7965

7 years agoMFC r305939:
kib [Wed, 21 Sep 2016 08:14:55 +0000 (08:14 +0000)]
MFC r305939:
Remove trailing space.

7 years agoBump __FreeBSD_version after r305988, removal of bio_taskqueue().
trasz [Wed, 21 Sep 2016 07:25:05 +0000 (07:25 +0000)]
Bump __FreeBSD_version after r305988, removal of bio_taskqueue().

Suggested by: asomers@

7 years agohyperv/hn: Put debug messages under bootverbose
sephe [Wed, 21 Sep 2016 06:54:26 +0000 (06:54 +0000)]
hyperv/hn: Put debug messages under bootverbose

While I'm here, strip blank line.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7963

7 years ago1) Microoptimize %p case.
ache [Wed, 21 Sep 2016 06:44:32 +0000 (06:44 +0000)]
1) Microoptimize %p case.
2) Implememt %u for GNU compatibility.
3) Don't forget to advance buf for %w/%u.
4) Fail with incomplete week (week 0) request and no such week in the
year.
5) Fix yday formula when Sunday requested and the week started from Monday.
6) Fail with impossible yday for incomplete week (week 0) and direct %w/%u
request.
7) Shift yday/wday to the first day of the year, if incomplete week
(week 0) requested and no %w/%u used.

MFC after:      7 days

7 years agohyperv/vmbus: Assert that the bufring address is page aligned.
sephe [Wed, 21 Sep 2016 06:43:52 +0000 (06:43 +0000)]
hyperv/vmbus: Assert that the bufring address is page aligned.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7962

7 years agohyperv/hn: Allocate bufrings in attach DEVMETHOD.
sephe [Wed, 21 Sep 2016 06:27:42 +0000 (06:27 +0000)]
hyperv/hn: Allocate bufrings in attach DEVMETHOD.

So that reinitialization, e.g. MTU change, will not fail when the system
memory is excessively fragmented.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7961

7 years agohyperv/vmbus: Allow bufrings preallocation.
sephe [Wed, 21 Sep 2016 05:56:47 +0000 (05:56 +0000)]
hyperv/vmbus: Allow bufrings preallocation.

The assumption that the channel is only opened upon synthetic device
attach time no longer holds, e.g. Hyper-V network device MTU changes.
We have to allow device drivers to preallocate bufrings, e.g. in
attach DEVMETHOD, to prevent bufring allocation failure once the
system memory is fragmented after running for a while.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7960

7 years agoFix bug introduced with r302388, which could cause processes accessing
trasz [Wed, 21 Sep 2016 05:44:13 +0000 (05:44 +0000)]
Fix bug introduced with r302388, which could cause processes accessing
automounted shares to hang with "vfs_busy" wchan.

(As a workaround one can run 'automount -u' from cron.)

Reviewed by: kib@
MFC after: 1 month

7 years agoAdd support for SPI-mapped MSI interrupts outside of GICv2m.
wma [Wed, 21 Sep 2016 05:33:18 +0000 (05:33 +0000)]
Add support for SPI-mapped MSI interrupts outside of GICv2m.

SPI-mapped MSI interrupts coming from a controller other
than GICv2m need to have their trigger and polarity
properly configured. This patch fixes MSI/MSI-X
on Annapurna Alpine platform with GICv2.

Obtained from:         Semihalf
Submitted by:          Michal Stanek <mst@semihalf.com>
Sponsored by:          Annapurna Labs
Reviewed by:           skra, wma
Differential Revision: https://reviews.freebsd.org/D7698

7 years agoAdd support for SPI-mapped MSI interrupts in GICv3.
wma [Wed, 21 Sep 2016 05:22:49 +0000 (05:22 +0000)]
Add support for SPI-mapped MSI interrupts in GICv3.

PIC_SETUP_INTR implementation in GICv3 did not allow
for setting up interrupts without included FDT
description. GICv2m-like MSI interrupts, which map
MSI messages to SPI interrupt lines, may not have
a description in FDT. Add support for such interrupts
by setting the trigger and polarity to the appropriate
values for MSI (edge, high) and get the hardware
IRQ number from the corresponding ISRC.

Obtained from:         Semihalf
Submitted by:          Michal Stanek <mst@semihalf.com>
Sponsored by:          Annapurna Labs
Reviewed by:           wma
Differential Revision: https://reviews.freebsd.org/D7662

7 years agoRegister GICv3 xref.
wma [Wed, 21 Sep 2016 05:15:50 +0000 (05:15 +0000)]
Register GICv3 xref.

This allows other drivers to retrieve interrupt parent node.

Obtained from:         Semihalf
Submitted by:          Michal Stanek <mst@semihalf.com>
Sponsored by:          Annapurna Labs
Reviewed by:           wma, zbb
Differential Revision: https://reviews.freebsd.org/D7568

7 years agoMove ofw_parse_bootargs to the correct place.
jhibbits [Wed, 21 Sep 2016 03:10:41 +0000 (03:10 +0000)]
Move ofw_parse_bootargs to the correct place.

Also, create a static initial environment, so bootargs can be set from uboot.

7 years agoMove ofw_cpu file to the main files conf file.
jhibbits [Wed, 21 Sep 2016 02:56:57 +0000 (02:56 +0000)]
Move ofw_cpu file to the main files conf file.

There is nothing CPU specific here, and it's usable by both fdt and Open
Firmware based systems.  Rather than keeping the same file in every one, just
add it to the ofw/fdt block in the main file.

7 years agoAdd a ofw_parse_bootargs function, and use it for powerpc
jhibbits [Wed, 21 Sep 2016 02:28:39 +0000 (02:28 +0000)]
Add a ofw_parse_bootargs function, and use it for powerpc

Summary:
If the environment variable is set, U-boot adds a 'bootargs' property to
/chosen.  This is already handled by ARM and MIPS, but should be handled in a
central location.  For now, ofw_subr.c is a good place until we determine if it
should be moved to init_main.c, or somewhere more central to all architectures.

Eventually arm and mips should be modified to use ofw_parse_bootargs() as well,
rather than using the duplicate code already.

Reviewed By: adrian
Differential Revision: https://reviews.freebsd.org/D7846

7 years agoAdd yet another QorIQ GPIO compat string.
jhibbits [Wed, 21 Sep 2016 02:27:23 +0000 (02:27 +0000)]
Add yet another QorIQ GPIO compat string.

P1022 boards use the string "fsl,pq3-gpio", which seems to be common in Linux
dts files.

7 years agocxgbe(4): Setup congestion response for T6 rx queues.
np [Wed, 21 Sep 2016 00:50:22 +0000 (00:50 +0000)]
cxgbe(4): Setup congestion response for T6 rx queues.

7 years agocxgbe(4): Show wcwr_stats for T6 cards.
np [Wed, 21 Sep 2016 00:46:08 +0000 (00:46 +0000)]
cxgbe(4): Show wcwr_stats for T6 cards.

7 years agoProtect ccbq access with devq->send_mtx in the XPT_ABORT handler.
markj [Wed, 21 Sep 2016 00:08:42 +0000 (00:08 +0000)]
Protect ccbq access with devq->send_mtx in the XPT_ABORT handler.

Submitted by: Ryan Libby <rlibby@gmail.com>
Reviewed by: mav
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D7985

7 years agoelfdump: limit STDIN to no rights rather than closing it
emaste [Tue, 20 Sep 2016 21:38:12 +0000 (21:38 +0000)]
elfdump: limit STDIN to no rights rather than closing it

Closing stdin/stdout/stderr is often a bad idea as a future open()
can end up with its fd. Leave it open and limit it to no rights
instead.

Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D7984

7 years agodhclient(8): Enable numbered user class ID option
cem [Tue, 20 Sep 2016 19:21:41 +0000 (19:21 +0000)]
dhclient(8): Enable numbered user class ID option

By adding it to the option priorities table.

PR: 184117
Submitted by: Lowell Gilbert <freebsd-bugs-local at be-well.ilk.org>
Reported by: Tomek CEDRO <cederom at tlen.pl>
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D7911

7 years agoIf present, honor the USB port mode (host or peripheral) set on DTS, if not,
loos [Tue, 20 Sep 2016 19:06:58 +0000 (19:06 +0000)]
If present, honor the USB port mode (host or peripheral) set on DTS, if not,
keep the beaglebone defaults: USB0 -> peripheral/gadget, USB1 -> host.

This is only a workaround as in fact fact this hardware is capable of detect
the USB port mode based on type of cable and act according with the detected
mode.  Unfortunately the driver does not handle that at moment.

MFC after: 3 days
Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agonet80211: remove IEEE80211_RADIOTAP_TSFT field from transmit definitions.
avos [Tue, 20 Sep 2016 18:53:42 +0000 (18:53 +0000)]
net80211: remove IEEE80211_RADIOTAP_TSFT field from transmit definitions.

This field may be used for received frames only.

Differential Revision: https://reviews.freebsd.org/D3826
Differential Revision: https://reviews.freebsd.org/D3827

7 years agoFix periodic scripts when an NFS mount covers a local mount
asomers [Tue, 20 Sep 2016 18:47:33 +0000 (18:47 +0000)]
Fix periodic scripts when an NFS mount covers a local mount

100.chksetuid and 110.neggrpperm try to search through all UFS and ZFS
filesystems. But their logic contains an error. They also search through
remote filesystems that are mounted on top of the root of a local
filesystem. For example, if a user installs a FreeBSD system with the
default ZFS layout, he'll get a zroot/usr/home filesystem. If he then mounts
/usr/home over NFS, these scripts would search through /usr/home.

MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D7482

7 years agoReduce code duplication around NDP message handlers in icmp6_input().
markj [Tue, 20 Sep 2016 18:08:17 +0000 (18:08 +0000)]
Reduce code duplication around NDP message handlers in icmp6_input().

No functional change intended.

MFC after: 2 weeks

7 years agoAlways pass -m to ld for converting binary files to kernel ELF objects
emaste [Tue, 20 Sep 2016 17:07:14 +0000 (17:07 +0000)]
Always pass -m to ld for converting binary files to kernel ELF objects

This is in preparation for linking with LLVM's lld, which does not have
a compiled-in default output emulation. lld requires that it is
specified via the -m option, or obtained from the object file(s) being
linked.

This will also allow all build targets to share a common linker binary.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7837

7 years agoPort vnd_test to FreeBSD
ngie [Tue, 20 Sep 2016 16:40:15 +0000 (16:40 +0000)]
Port vnd_test to FreeBSD

Use mdmfs/mdconfig instead of vndconfig/newfs. vndconfig doesn't exist on FreeBSD.

TODO: need to parameterize out the md(4) device as it's currently hardcoded to "3"
(in both the FreeBSD and NetBSD cases).

MFC after: 1 month
Sponsored by: Dell EMC Isilon

7 years agoPort to mknod_test and readdir_test to FreeBSD
ngie [Tue, 20 Sep 2016 16:37:02 +0000 (16:37 +0000)]
Port to mknod_test and readdir_test to FreeBSD

The `mknod <file> p` command doesn't exist on FreeBSD, like on NetBSD. Use
mkfifo instead to create named pipes (FIFOs).

MFC after: 1 month
Sponsored by: Dell EMC Isilon

7 years agoPort sizes_test and statvfs_test to FreeBSD
ngie [Tue, 20 Sep 2016 16:31:57 +0000 (16:31 +0000)]
Port sizes_test and statvfs_test to FreeBSD

Similar to r306030, use a simpler method for getting the value of
`hw.pagesize`, i.e. `sysctl -n hw.pagesize`. The awk filtering method doesn't
work on FreeBSD

MFC after: 1 month
Sponsored by: Dell EMC Isilon

7 years agoPort contrib/netbsd-tests/fs/h_funcs.subr to FreeBSD
ngie [Tue, 20 Sep 2016 16:28:57 +0000 (16:28 +0000)]
Port contrib/netbsd-tests/fs/h_funcs.subr to FreeBSD

Use kldstat -m to determine whether or not a filesystem is loaded. This works
well with tmpfs, ufs, and zfs

MFC after: 1 month
Sponsored by: Dell EMC Isilon

7 years agoPort vnode_leak_test:main to FreeBSD
ngie [Tue, 20 Sep 2016 16:27:34 +0000 (16:27 +0000)]
Port vnode_leak_test:main to FreeBSD

Use a simpler way of dumping kern.maxvnodes, i.e. `sysctl -n kern.maxvnodes`

The awk filtering method employed in NetBSD doesn't work on FreeBSD

MFC after: 1 month
Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP instead of the longhand version for defining the path to contrib/atf
ngie [Tue, 20 Sep 2016 16:24:22 +0000 (16:24 +0000)]
Use SRCTOP instead of the longhand version for defining the path to contrib/atf

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agoSpell alphabetically correctly both in the commit message AND in the
imp [Tue, 20 Sep 2016 15:14:33 +0000 (15:14 +0000)]
Spell alphabetically correctly both in the commit message AND in the
actual man page. Sigh.

Submitted by: David A Bright and Pedro Giffuni

7 years agobspatch: Remove backwards-compatibility sys/capability.h support
emaste [Tue, 20 Sep 2016 15:13:15 +0000 (15:13 +0000)]
bspatch: Remove backwards-compatibility sys/capability.h support

bspatch previously included sys/capability.h or sys/capsicum.h based
on __FreeBSD_version, as FreeBSD is the upstream for bsdiff and we may
see this file incorporated into other third-party software.

The Capsicum header is now installed as sys/capsicum.h in stable/10 and
FreeBSD 10.3, so we can just use sys/capsicum.h and simplify the logic.

Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D7954

7 years agomrsas: update for sys/capability.h rename in r263232
emaste [Tue, 20 Sep 2016 12:59:30 +0000 (12:59 +0000)]
mrsas: update for sys/capability.h rename in r263232

7 years agoauditdistd: update for sys/capability.h rename in r263232
emaste [Tue, 20 Sep 2016 12:58:28 +0000 (12:58 +0000)]
auditdistd: update for sys/capability.h rename in r263232

7 years agohwpmc: remove sys/capability.h backwards compatibility
emaste [Tue, 20 Sep 2016 12:56:03 +0000 (12:56 +0000)]
hwpmc: remove sys/capability.h backwards compatibility

The Capsicum header is installed as sys/capsicum.h in stable/10 as well.

7 years agoAdd driver for PCIe root complex on Annapurna Alpine platform.
wma [Tue, 20 Sep 2016 11:11:06 +0000 (11:11 +0000)]
Add driver for PCIe root complex on Annapurna Alpine platform.

The driver subclasses pci-host-generic and additionally
performs configuration of vendor-specific PCIe registers.

Obtained from:         Semihalf
Submitted by:          Michal Stanek <mst@semihalf.com>
Sponsored by:          Annapurna Labs
Reviewed by:           wma
Differential Revision: https://reviews.freebsd.org/D7571

7 years agoMove pmap_p*e_index() inline functions from pmap.c to pmap.h.
kib [Tue, 20 Sep 2016 09:38:07 +0000 (09:38 +0000)]
Move pmap_p*e_index() inline functions from pmap.c to pmap.h.
They are already used in minidump code.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoUpdate Annapurna Alpine HAL
wma [Tue, 20 Sep 2016 09:19:22 +0000 (09:19 +0000)]
Update Annapurna Alpine HAL

alpine-hal SerDes file was omitted in the previous commit.
Files added here.
All unnecessary (old) files were also removed.
Merge from vendor-sys, r306017

7 years agoFollow up r305988 by removing g_bio_run_task and related code.
trasz [Tue, 20 Sep 2016 09:18:33 +0000 (09:18 +0000)]
Follow up r305988 by removing g_bio_run_task and related code.
The g_io_schedule_up() gets its "if" condition swapped to make
it more similar to g_io_schedule_down().

Suggested by: mav@
Reviewed by: mav@
MFC after: 1 month

7 years agohyperv/storvsc: Fix SRB length setting.
sephe [Tue, 20 Sep 2016 08:52:45 +0000 (08:52 +0000)]
hyperv/storvsc: Fix SRB length setting.

This fixes disk discovery issue on WS2008R2 Hyper-V, which plagued
us since 10.2-release.

Reported by: many
MFC after: 3 days
Sponsored by: Microsoft

7 years agohyperv/hn: Let the caller of hn_nvs_doinit() do the error logging.
sephe [Tue, 20 Sep 2016 05:45:18 +0000 (05:45 +0000)]
hyperv/hn: Let the caller of hn_nvs_doinit() do the error logging.

So that NVS version probing failure does not look too scary.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7950

7 years agohyperv/hn: Fix ifnet hwassist setup.
sephe [Tue, 20 Sep 2016 05:26:40 +0000 (05:26 +0000)]
hyperv/hn: Fix ifnet hwassist setup.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7948

7 years agoFix -media to not mount ufs with "async"; it doesn't make sense when
trasz [Tue, 20 Sep 2016 04:54:00 +0000 (04:54 +0000)]
Fix -media to not mount ufs with "async"; it doesn't make sense when
there is softupdates.

Suggested by: imp@
MFC after: 1 month

7 years agoStop appending "noatime" in the autofs -media map, and instead add it
trasz [Tue, 20 Sep 2016 04:52:01 +0000 (04:52 +0000)]
Stop appending "noatime" in the autofs -media map, and instead add it
to auto_master, since all filesystems seem to support it.  It's cleaner
this way, and easier to customize.

MFC after: 1 month

7 years agoDocument existing practice and be more clear about sys/foo.h files
imp [Tue, 20 Sep 2016 04:50:53 +0000 (04:50 +0000)]
Document existing practice and be more clear about sys/foo.h files
being alphabetical with sys/param.h or sys/types.h being first. Expand
the example to hopefully make this (slightly) clearer.

Noticed by: cem@

7 years agoMake autofs(5) -media map also use "async" and "noatime" for ext2fs(5).
trasz [Tue, 20 Sep 2016 04:33:58 +0000 (04:33 +0000)]
Make autofs(5) -media map also use "async" and "noatime" for ext2fs(5).

Suggested by: pfg@
MFC after: 1 month

7 years agolibdwarf: Add definitions for Apple's DWARF extension attributes.
markj [Tue, 20 Sep 2016 00:22:35 +0000 (00:22 +0000)]
libdwarf: Add definitions for Apple's DWARF extension attributes.

Reviewed by: emaste
MFC after: 1 week

7 years ago[iwm] Improve reliability of iwm_release on disassociation a bit.
ivadasz [Mon, 19 Sep 2016 22:36:30 +0000 (22:36 +0000)]
[iwm] Improve reliability of iwm_release on disassociation a bit.

* We need to first call ivp->iv_newstate(), to enqueue the deauth/deassoc
  mgmt frame, then flush the tx queue, before actually calling
  iwm_release().

* cycling a wlan connection via wpa_cli frontend to wpa_supplicant, by
  issuing disconnect and reconnect commandos works quite well.
  (There is still an issue when disconnecting/reconnecting too quickly)

* Reassociating or roaming via wpa_supplicant is still broken.

Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D7943

7 years ago[iwm] Remove dead fw_totlen from struct iwm_fw_sects; clean up struct iwm_nvm_data.
ivadasz [Mon, 19 Sep 2016 22:26:37 +0000 (22:26 +0000)]
[iwm] Remove dead fw_totlen from struct iwm_fw_sects; clean up struct iwm_nvm_data.

* No functional change, none of these values were ever read.

* The values removed from struct iwm_nvm_data are only used for old dvm
  devices in Linux iwlwifi, and irrelevant to iwm hence.

Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D7945

7 years ago[iwm] Use IWM_DEFAULT_SCAN_CHANNELS define as default for sc_capa_n_scan_channels.
ivadasz [Mon, 19 Sep 2016 22:23:46 +0000 (22:23 +0000)]
[iwm] Use IWM_DEFAULT_SCAN_CHANNELS define as default for sc_capa_n_scan_channels.

Approved by: adrian (mentor)
Obtained from: Linux iwlwifi
Differential Revision: https://reviews.freebsd.org/D7938

7 years ago[iwm] Remove deprecated scan API definitions.
ivadasz [Mon, 19 Sep 2016 22:20:46 +0000 (22:20 +0000)]
[iwm] Remove deprecated scan API definitions.

* This removes deprecated scan API definitions, which have been unused
  since the upgrade to version 16 firmware in change r303327.

* Part of this change matches the header-file changes in Linux git commit
  1f9403863c080478ad78247c89b018e95bdfb027.

* No functional change.

Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D7937

7 years ago[iwm] Remove wrappers around iwm_dma_contig_free() calls.
ivadasz [Mon, 19 Sep 2016 22:16:03 +0000 (22:16 +0000)]
[iwm] Remove wrappers around iwm_dma_contig_free() calls.

No functional changes.

Inspired by: OpenBSD
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D7933

7 years ago[iwm] Fix iwm_poll_bit() error value check in iwm_attach().
ivadasz [Mon, 19 Sep 2016 22:13:08 +0000 (22:13 +0000)]
[iwm] Fix iwm_poll_bit() error value check in iwm_attach().

The iwm(4) iwm_poll_bit() function returns 1 on success, and 0 on failure,
whereas the iwl_poll_bit() in Linux iwlwifi returns < 0 on failure.

So the (ret < 0) check ended up ignoring any error returned by
iwm_poll_bit().

Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D7932

7 years ago[iwm] Fix off-by-one check in iwm_read_firmware().
ivadasz [Mon, 19 Sep 2016 22:11:34 +0000 (22:11 +0000)]
[iwm] Fix off-by-one check in iwm_read_firmware().

This fixes a potential buffer overrun in the firmware parsing code.

Reported by: Coverity
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D7931

7 years ago[iwm] Remove unused field from iwm_rx_data. Use uint32_t instead of enum type.
ivadasz [Mon, 19 Sep 2016 22:08:47 +0000 (22:08 +0000)]
[iwm] Remove unused field from iwm_rx_data. Use uint32_t instead of enum type.

The wantresp field in struct iwm_rx_data has never been used for anything,
so we can just delete it.

Apparently struct iwm_sf_cfg_cmd was compiled correctly (using a 32bit
value to represent the enum), but it still seems like a very bad idea to use
an enum type in a __packed struct.

Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D7930

7 years ago[iwm] Use htole16 for policy field in struct iwm_time_event_cmd_v2.
ivadasz [Mon, 19 Sep 2016 22:06:00 +0000 (22:06 +0000)]
[iwm] Use htole16 for policy field in struct iwm_time_event_cmd_v2.

The htole32 was working fine for little-endian machines, but would have
been broken on big-endian.

Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D7929

7 years agoMove sys/capsicum.h includes after types.h or param.h
cem [Mon, 19 Sep 2016 20:43:03 +0000 (20:43 +0000)]
Move sys/capsicum.h includes after types.h or param.h

This is not actually documented or even implied in style(9).  Make the change
to match convention.  Someone should document this convention in style(9).

Reported by: jhb
Sponsored by: EMC Dell Isilon

7 years agorevert unintended change from r305994
emaste [Mon, 19 Sep 2016 18:45:57 +0000 (18:45 +0000)]
revert unintended change from r305994

7 years agoCatch up to sys/capability.h rename to sys/capsicum.h in r263232
emaste [Mon, 19 Sep 2016 18:44:43 +0000 (18:44 +0000)]
Catch up to sys/capability.h rename to sys/capsicum.h in r263232

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

7 years agomount(1): Simplify by using asprintf(3)
pfg [Mon, 19 Sep 2016 18:42:58 +0000 (18:42 +0000)]
mount(1): Simplify by using asprintf(3)

Instead of strlen() + malloc() + snprintf, just use asprintf().
No functional change.

Obtained from: OpenBSD (CVS Rev. 1.67)

7 years agodev/usb: add USB IDs for Realtek 802.11ac wireless adapters.
avos [Mon, 19 Sep 2016 18:36:26 +0000 (18:36 +0000)]
dev/usb: add USB IDs for Realtek 802.11ac wireless adapters.

They are will be used by the updated rtwn(4) / urtwn(4) driver.

Suggested by: adrian

7 years agohexdump(1): Simplify by using asprintf(3)
pfg [Mon, 19 Sep 2016 18:35:22 +0000 (18:35 +0000)]
hexdump(1): Simplify by using asprintf(3)

Instead of strlen() + calloc() + snprintf, just use asprintf().
No functional change.

Obtained from: OpenBSD (CVS Rev. 1.22)