freebsd.git
8 years agoWhen checking for binary file, check if ch is not EOF only ch actually got
bapt [Sat, 30 Apr 2016 14:48:30 +0000 (14:48 +0000)]
When checking for binary file, check if ch is not EOF only ch actually got
a value assigned

Reported by: pfg

8 years agoinclude: minor spelling fixes.
pfg [Sat, 30 Apr 2016 14:43:42 +0000 (14:43 +0000)]
include: minor spelling fixes.

No functional change.

8 years agosys: Make use of our rounddown() macro when sys/param.h is available.
pfg [Sat, 30 Apr 2016 14:41:18 +0000 (14:41 +0000)]
sys: Make use of our rounddown() macro when sys/param.h is available.

No functional change.

8 years agoAdd the UDP encaps port as a parameter to sctp_add_remote_addr().
tuexen [Sat, 30 Apr 2016 14:25:00 +0000 (14:25 +0000)]
Add the UDP encaps port as a parameter to sctp_add_remote_addr().

This is currently only a code change without any functional
change. But this allows to set the remote encapsulation port
in a more detailed way, which will be provided in a follow-up
commit.

MFC after: 1 week

8 years agoANSIfy fdescfs(5)
emaste [Sat, 30 Apr 2016 12:44:03 +0000 (12:44 +0000)]
ANSIfy fdescfs(5)

8 years agoUpdate from subversion 1.9.2 to 1.9.4.
dim [Sat, 30 Apr 2016 10:35:42 +0000 (10:35 +0000)]
Update from subversion 1.9.2 to 1.9.4.

This contains only bug fixes, no new features.  The repository format is
also unchanged from 1.9.2.  Full list of changes between 1.9.4 and
earlier versions:

  https://svn.apache.org/repos/asf/subversion/tags/1.9.4/CHANGES

Note that the two security issues fixed in 1.9.4 (CVE-2016-2167 and
CVE-2016-2168) do not affect the version of Subversion in the FreeBSD
base system, since neither SASL nor Apache modules are enabled.

Relnotes: yes
MFC after: 2 weeks

8 years agoMake SERVERS REQUIRE clean when MK_KERBEROS==no
ngie [Sat, 30 Apr 2016 09:50:08 +0000 (09:50 +0000)]
Make SERVERS REQUIRE clean when MK_KERBEROS==no

Make kdc run BEFORE SERVERS instead of being REQUIREd by SERVERS,
so systems that pedantically check REQUIREs function after r270782

MFC after: 1 week
X-MFC with: r270782
Sponsored by: EMC / Isilon Storage Division

8 years agoDon't leak PML4 in _amd64_initvtop(..) if kvm_read2(..) fails
ngie [Sat, 30 Apr 2016 09:32:19 +0000 (09:32 +0000)]
Don't leak PML4 in _amd64_initvtop(..) if kvm_read2(..) fails

MFC after: 1 week
Reported by: Coverity
CID: 1341474
Sponsored by: EMC / Isilon Storage Division

8 years agoRemove a -Wunused-but-set-variable variable -- `pa`
ngie [Sat, 30 Apr 2016 09:31:01 +0000 (09:31 +0000)]
Remove a -Wunused-but-set-variable variable -- `pa`

Reported by: gcc 5.x
Sponsored by: EMC / Isilon Storage Division

8 years agoRemove kvm_getfiles(3)
ngie [Sat, 30 Apr 2016 09:21:13 +0000 (09:21 +0000)]
Remove kvm_getfiles(3)

This libcall has been broken since (at least) r174989/8.0-RELEASE.

Bump SHLIB_MAJOR for the change

Differential Revision: https://reviews.freebsd.org/D6052
Relnotes: yes
Reviewed by: jhb, markj
Sponsored by: EMC / Isilon Storage Division

8 years agoFix memory allocation edgecases in kvm_argv(..)
ngie [Sat, 30 Apr 2016 09:13:26 +0000 (09:13 +0000)]
Fix memory allocation edgecases in kvm_argv(..)

- Don't leak nbufp on realloc failure in kvm_argv
- Catch malloc errors with bufp
- Set buflen last in the "buflen == 0" case to ensure that
  bufp/nbufp is properly reallocated on the next go around

Differential Revision: https://reviews.freebsd.org/D6051
MFC after: 1 week
Reviewed by: jhb, markj
Reported by: cppcheck
Sponsored by: EMC / Isilon Storage Division

8 years agoRevert AccessWidth/BitOffset support for AcpiHwWrite() and AcpiHwRead() for
jkim [Sat, 30 Apr 2016 06:48:48 +0000 (06:48 +0000)]
Revert AccessWidth/BitOffset support for AcpiHwWrite() and AcpiHwRead() for
now.  The following upstream commits are reverted from hwregs.c:

https://github.com/acpica/acpica/commit/96ece05
https://github.com/acpica/acpica/commit/3d8583a
https://github.com/acpica/acpica/commit/48eea5e
https://github.com/acpica/acpica/commit/0a212c3
https://github.com/acpica/acpica/commit/41f6aef
https://github.com/acpica/acpica/commit/26434b9
https://github.com/acpica/acpica/commit/c23034a
https://github.com/acpica/acpica/commit/c49a751

Note this commit will be reverted when the upstream fixes the code properly.

8 years agoAdd sdiff test directory to the tests mtree
bapt [Sat, 30 Apr 2016 06:37:32 +0000 (06:37 +0000)]
Add sdiff test directory to the tests mtree

8 years agoboot/forth: spelling fixes.
pfg [Sat, 30 Apr 2016 02:47:41 +0000 (02:47 +0000)]
boot/forth: spelling fixes.

Reviewed by: dteske
MFC after: 2 weeks

8 years agolibc: spelling fixes.
pfg [Sat, 30 Apr 2016 01:24:24 +0000 (01:24 +0000)]
libc: spelling fixes.

Mostly on comments.

8 years agosys/compat/linux*: spelling fixes.
pfg [Sat, 30 Apr 2016 00:53:10 +0000 (00:53 +0000)]
sys/compat/linux*: spelling fixes.

Mostly on comments but there are some user-visible messages as well.

MFC after: 2 weeks

8 years agondis: spelling fixes in comments.
pfg [Sat, 30 Apr 2016 00:35:46 +0000 (00:35 +0000)]
ndis: spelling fixes in comments.

No functional change.

8 years agox86bios: spelling fix in a comment.
pfg [Sat, 30 Apr 2016 00:34:04 +0000 (00:34 +0000)]
x86bios: spelling fix in a comment.

No functional change.

8 years agosys/boot: spelling fixes in comments.
pfg [Sat, 30 Apr 2016 00:26:38 +0000 (00:26 +0000)]
sys/boot: spelling fixes in comments.

No functional change.

8 years agoAdd PCI_IOV to NOTES.
jhb [Fri, 29 Apr 2016 23:55:22 +0000 (23:55 +0000)]
Add PCI_IOV to NOTES.

8 years agoMove 'device pci' for the PCI bus driver to the MI NOTES file.
jhb [Fri, 29 Apr 2016 23:53:55 +0000 (23:53 +0000)]
Move 'device pci' for the PCI bus driver to the MI NOTES file.

The PCI bus was already listed in all of the MD NOTES files and the
driver should at least compile on all platforms.

8 years agoimport sdiff(1) from GSoC 2012
bapt [Fri, 29 Apr 2016 23:27:15 +0000 (23:27 +0000)]
import sdiff(1) from GSoC 2012

Import sdiff(1) from the diff version written by Raymond Lai,
improved during GSoC 2012 by Jesse Hagewood.

Compared to the version done in during that summer of code:
- Remove the zlib frontend: zsdiff
- Compatible output (column size and separators) with GNU sdiff

Compared to GNU sdiff in ports:
- The only difference is padding using spaces vs tabs

Compared to OpenBSD and NetBSD import:
- Implement missing options (including long options) from GNU sdiff
- Improved support for the edition mode (signal handling)
- Output visually compatible with GNU sdiff: size of columns

While here import regression tests from NetBSD adapted to fit the output as
expected by GNU sdiff

Reviewed by: emaste (in part)
Obtained from: OpenBSD, NetBSD, GSoC 2012
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D5981
Differential Revision: https://reviews.freebsd.org/D6032 (diff with NetBSD version)
Differential Revision: https://reviews.freebsd.org/D6033 (diff with OpenBSD version)

8 years agowpi: convert to ieee80211_add_channel() (mostly noop).
avos [Fri, 29 Apr 2016 22:43:11 +0000 (22:43 +0000)]
wpi: convert to ieee80211_add_channel() (mostly noop).

Tested with Intel 3945BG, STA / HOSTAP modes.

8 years agoAdd FDT overlays support to ubldr
gonzo [Fri, 29 Apr 2016 22:42:59 +0000 (22:42 +0000)]
Add FDT overlays support to ubldr

FDT overlays is de-facto standard for describing expansion boards like
Beaglebone capes or Raspberry Pi shields. The ides is to have basic
DTB for base board and overlays DTB for shields/capes and to construct
final DTB either using human-readable configuration or some
self-discovery mechanism. I believe this approach can also be expanded
to support dynamically loadable FPGA bitstreams on systems like
Zedboard/Zybo.

Overlaying process is simmilar to executable link process for
binaries: each DTB has "exported" symbols and "undefined" symbols, the
latter are resolved using information for the former obtained from
base DTB or one of the overlays applied earlier (more rare case).

This symbols information is not generated by standard dtc that FreeBSD
has in base system, patched[1] version required to produces
overlay-compatible blobs. So although DTB files generated by
buildkernel do not support overlays there are enough
vendor/community-provided DTB blobs ciruclating around to justify
committing this change to ubldr.

This commit introduces handler for "fdt_overlays" variable that can be
defined either as a loader env variable or U-Boot env variable.
fdt_overlays is comma-separated list of .dtbo files located in
/boot/dtb/ directory along with base .dtb. ubldr loads files and
applies them one-by-one to base .dtb and then passes result blob to
the kernel.

[1] https://github.com/RobertCNelson/dtc/commit/dd6a0533e846e8d5e690a618fa35cc15a6103efb

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

8 years agoRemove vestiges of IEEE-488/GPIB drivers removed in r276214.
jhb [Fri, 29 Apr 2016 22:29:33 +0000 (22:29 +0000)]
Remove vestiges of IEEE-488/GPIB drivers removed in r276214.

8 years agosys/kern: spelling fixes in comments.
pfg [Fri, 29 Apr 2016 22:15:33 +0000 (22:15 +0000)]
sys/kern: spelling fixes in comments.

No functional change.

8 years agonet80211 + drivers: hide size of 'bands' array behind a macro.
avos [Fri, 29 Apr 2016 22:14:11 +0000 (22:14 +0000)]
net80211 + drivers: hide size of 'bands' array behind a macro.

Auto-replace 'howmany(IEEE80211_MODE_MAX, 8)' with 'IEEE80211_MODE_BYTES'.
No functional changes.

8 years agosys/kern: spelling fixes.
pfg [Fri, 29 Apr 2016 21:54:28 +0000 (21:54 +0000)]
sys/kern: spelling fixes.

Mostly on comments but affects some debug messages.

MFC after: 2 weeks

8 years agoSet txbuf_map array size to TX_DESC_COUNT instead of RX_DESC_COUNT.
jmcneill [Fri, 29 Apr 2016 21:46:43 +0000 (21:46 +0000)]
Set txbuf_map array size to TX_DESC_COUNT instead of RX_DESC_COUNT.

8 years agowpi: remove unused variable.
avos [Fri, 29 Apr 2016 21:38:36 +0000 (21:38 +0000)]
wpi: remove unused variable.

8 years agoFix a use-after-free when "zpool import" fails
asomers [Fri, 29 Apr 2016 21:29:37 +0000 (21:29 +0000)]
Fix a use-after-free when "zpool import" fails

clear vd->vdev_tsd in vdev_geom_close_locked instead of vdev_geom_detach.
In the latter function, it would fail to happen in certain circumstances
where cp->private was unset.  Ideally, the latter should never happen, but
it can happen when vdev open fails, or where spares are involved.

MFC after: 4 weeks
X-MFC-With: 298786
Sponsored by: Spectra Logic Corp

8 years agosys/netgraph: spelling fixes in comments.
pfg [Fri, 29 Apr 2016 21:25:05 +0000 (21:25 +0000)]
sys/netgraph: spelling fixes in comments.

No functional change.

8 years agonet80211: provide a set of ieee80211_add_channel*() functions
avos [Fri, 29 Apr 2016 21:18:14 +0000 (21:18 +0000)]
net80211: provide a set of ieee80211_add_channel*() functions

This change adds few methods for net80211 channel table setup:

- ieee80211_add_channel()
- ieee80211_add_channel_ht40()
(primarily for drivers, that parse EEPROM to get channel list -
they will allow to hide implementation details).

- ieee80211_add_channel_list_2ghz()
- ieee80211_add_channel_list_5ghz()
(mostly as a replacement for ieee80211_init_channels() - they will allow
to specify non-default channel list; may be used in ic_getradiocaps()).

Tested with wpi(4) (add_channel) and rum(4) (add_channel_list_2ghz).

Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D6124

8 years agoAutomate the subr_unit test.
asomers [Fri, 29 Apr 2016 21:11:31 +0000 (21:11 +0000)]
Automate the subr_unit test.

Build and install the subr_unit test program originally written by phk, and
run it with the other ATF tests.

tests/sys/kern/Makefile
* Build and install the subr_unit test as a plain test

sys/kern/subr_unit.c
* Reduce the default number of repetitions from 100 to 1, and add a
  command-line parser to override it.
* Don't be so noisy by default
* Fix an include problem for the test build

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

8 years agosys/cam: spelling fixes in comments.
pfg [Fri, 29 Apr 2016 21:05:48 +0000 (21:05 +0000)]
sys/cam: spelling fixes in comments.

No functional change.

8 years agosys/cam: spelling fixes.
pfg [Fri, 29 Apr 2016 21:04:06 +0000 (21:04 +0000)]
sys/cam: spelling fixes.

Affects a debug message.

MFC after: 2 weeks

8 years agosys/geom: spelling fixes in comments.
pfg [Fri, 29 Apr 2016 20:56:58 +0000 (20:56 +0000)]
sys/geom: spelling fixes in comments.

No functional change.

8 years agosys/ddb: spelling fixes in comments.
pfg [Fri, 29 Apr 2016 20:53:39 +0000 (20:53 +0000)]
sys/ddb: spelling fixes in comments.

No functional change.

8 years agosys/fs: spelling fixes in comments.
pfg [Fri, 29 Apr 2016 20:51:24 +0000 (20:51 +0000)]
sys/fs: spelling fixes in comments.

No functional change.

8 years agofs/ext2fs: spelling fixes on comment.
pfg [Fri, 29 Apr 2016 20:45:50 +0000 (20:45 +0000)]
fs/ext2fs: spelling fixes on comment.

No functional change.

8 years agoUFS: spelling fixes on comments.
pfg [Fri, 29 Apr 2016 20:43:51 +0000 (20:43 +0000)]
UFS: spelling fixes on comments.

No functional change.

8 years agoDon't assign, just compare...
tuexen [Fri, 29 Apr 2016 20:33:20 +0000 (20:33 +0000)]
Don't assign, just compare...

8 years agoAdd driver for AM33xx SoC touchscreen
gonzo [Fri, 29 Apr 2016 20:31:49 +0000 (20:31 +0000)]
Add driver for AM33xx SoC touchscreen

Split ADC driver in two halves: ADC(analog ot digital) and
TSC(touchscreen). Touchscreen driver is fully functional
up to the point of reporting samples. This part will be added
once FreeBSD has API for touchscreen.

Tested on: Beaglebone Black + 4DCAPE-43T
Reviewed by: loos
Differential Revision: https://reviews.freebsd.org/D5847

8 years agox86bios_alloc(): Unsign a counter.
pfg [Fri, 29 Apr 2016 20:22:10 +0000 (20:22 +0000)]
x86bios_alloc(): Unsign a counter.

The value can't even be signed so we can avoid the signed vs. unsigned
comparison.

Reviewed by: jkim

8 years agoAdd support for handling ICMP and ICMP6 messages sent in response
tuexen [Fri, 29 Apr 2016 20:22:01 +0000 (20:22 +0000)]
Add support for handling ICMP and ICMP6 messages sent in response
to SCTP/UDP/IP and SCTP/UDP/IPv6 packets.

8 years agoUse correct order of source and destination address and port.
tuexen [Fri, 29 Apr 2016 20:13:35 +0000 (20:13 +0000)]
Use correct order of source and destination address and port.

8 years agoExpose soaio_enqueue().
jhb [Fri, 29 Apr 2016 20:12:45 +0000 (20:12 +0000)]
Expose soaio_enqueue().

This can be used by protocol-specific AIO handlers to queue work to the
socket AIO daemon pool.

Sponsored by: Chelsio Communications

8 years agoIntroduce a new protocol hook pru_aio_queue.
jhb [Fri, 29 Apr 2016 20:11:09 +0000 (20:11 +0000)]
Introduce a new protocol hook pru_aio_queue.

This allows a protocol to claim individual AIO requests instead of using
the default socket AIO handling.

Sponsored by: Chelsio Communications

8 years agoThe iwm_nic_error() defined if IWM_DEBUG is defined.
dchagin [Fri, 29 Apr 2016 19:10:22 +0000 (19:10 +0000)]
The iwm_nic_error() defined if IWM_DEBUG is defined.

8 years ago[ath] initialise do_ldpc to 0.
adrian [Fri, 29 Apr 2016 18:53:16 +0000 (18:53 +0000)]
[ath] initialise do_ldpc to 0.

I .. can't believe I missed this.

This showed up because the AP was TX'ing LDPC to an iwm(4) chipset,
which didn't advertise LDPC and doesn't /accept/ LDPC.  Amusingly, all
the two other FreeBSD 11n parts I had tested with (AR9380, Intel 7260)
and I completely forgot to test on ye olde hardware.

That'll teach me.

Tested:

* AR9580 (AP) - Intel 7260 (STA), AR9380 (STA), Intel 6205 (STA)

8 years agoPRINT_BUF_FLAGS: Remove removed DIRTY/PERSIST flags
cem [Fri, 29 Apr 2016 17:56:16 +0000 (17:56 +0000)]
PRINT_BUF_FLAGS: Remove removed DIRTY/PERSIST flags

This is a follow-up to r298789, which removed the B_DIRTY and B_PERSISTENT
flags.  This changeset removes them from the associated %b bit description
string as well.

Reviewed by: pfg
Sponsored by: EMC / Isilon Storage Division

8 years agoDon't require write locks on the VM object for vm_page_prev/next.
jhb [Fri, 29 Apr 2016 17:35:28 +0000 (17:35 +0000)]
Don't require write locks on the VM object for vm_page_prev/next.

Reviewed by: kib
Sponsored by: Chelsio Communications

8 years agobufs: make B_DIRTY and B_PERSISTENT flags available
pfg [Fri, 29 Apr 2016 16:32:28 +0000 (16:32 +0000)]
bufs: make B_DIRTY and B_PERSISTENT flags available

It appears these flags were related to ext2fs but are completely
unused nowadays. Retire them.

Suggested by: mckusick

8 years agoNFS: spelling fixes on comments.
pfg [Fri, 29 Apr 2016 16:07:25 +0000 (16:07 +0000)]
NFS: spelling fixes on comments.

No funcional change.

8 years agoadd invpcid instruction to i386 dtrace disassembler tables
avg [Fri, 29 Apr 2016 15:45:22 +0000 (15:45 +0000)]
add invpcid instruction to i386 dtrace disassembler tables

MFC after: 2 weeks

8 years agoRefactor vdev_geom_attach and friends to reduce code duplication
asomers [Fri, 29 Apr 2016 15:23:51 +0000 (15:23 +0000)]
Refactor vdev_geom_attach and friends to reduce code duplication

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
Move checks for provider's sectorsize and mediasize into a single
location in vdev_geom_attach. Remove the zfs::vdev::taste class;
it's ok to use the regular vdev class for tasting. Consolidate guid
checks into a single location in vdev_attach_ok. Consolidate some
error handling code from vdev_geom_attach into vdev_geom_detach,
closing a resource leak of geom consumers in the process.

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

8 years agoAdd a savecore_enable variable support for the savecore rc script
bapt [Fri, 29 Apr 2016 12:23:56 +0000 (12:23 +0000)]
Add a savecore_enable variable support for the savecore rc script

By default set to 'YES' so it does not change the current behaviour for users,
this variable allows to decide to not extract crach dumps from the dump
device at boot time by setting it to "NO" in rc.conf.

Sponsored by: Gandi.net

8 years agoRegenerate usb.conf .
hselasky [Fri, 29 Apr 2016 12:00:36 +0000 (12:00 +0000)]
Regenerate usb.conf .

MFC after: 1 week

8 years agoCorrect some error codes to native FreeBSD ones.
hselasky [Fri, 29 Apr 2016 11:01:06 +0000 (11:01 +0000)]
Correct some error codes to native FreeBSD ones.

Sponsored by: Mellanox Technologies
Tested by: Netflix
MFC after: 1 week

8 years agoAdd function to detect the presence of a port module and use this
hselasky [Fri, 29 Apr 2016 11:00:12 +0000 (11:00 +0000)]
Add function to detect the presence of a port module and use this
function to error out early when no port module is present and doing
eeprom access. This also prevents error codes from filling up in
dmesg.

Sponsored by: Mellanox Technologies
Tested by: Netflix
MFC after: 1 week

8 years agotcp/syncache: Set flowid and hash type properly for SYN|ACK
sephe [Fri, 29 Apr 2016 07:23:08 +0000 (07:23 +0000)]
tcp/syncache: Set flowid and hash type properly for SYN|ACK

So the underlying drivers can use it to select the sending queue
properly for SYN|ACK instead of rolling their own hash.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6120

8 years agoFix including Kyuafile in packaged base system.
gjb [Fri, 29 Apr 2016 05:28:40 +0000 (05:28 +0000)]
Fix including Kyuafile in packaged base system.

Fix a related typo while here.

Note, this change results in the Kyuafile inclusion in the runtime
package, which needs to be fixed, however addresses the PR as far
as I can tell in my tests.

PR: 209114
Submitted by: ngie
Sponsored by: The FreeBSD Foundation

8 years ago[ath] Add LDPC transmit support.
adrian [Fri, 29 Apr 2016 01:53:45 +0000 (01:53 +0000)]
[ath] Add LDPC transmit support.

LDPC adds better transmit reliability if both ends support it.

You in theory can do both STBC and LDPC at the same time.
If I see issues I'll disable it.

* Only enable it if both ends of a connection negotiate it.
* Disable it if any rate is non-11n.
* Count both LDPC TX and STBC TX.

Tested:

* AR9380, STA mode

8 years ago[ath] turn the BA hardware bug back into a printf().
adrian [Fri, 29 Apr 2016 01:52:06 +0000 (01:52 +0000)]
[ath] turn the BA hardware bug back into a printf().

I saw this happen a couple of times and all I saw was a dump of the
transmit descriptors.  Log the message for now so I can see whta happened.

8 years ago[ath] Add counters for STBC TX and LDPC TX.
adrian [Fri, 29 Apr 2016 01:51:27 +0000 (01:51 +0000)]
[ath] Add counters for STBC TX and LDPC TX.

This is a big no-op until the TX path changes to enable LDPC TX are
added.

8 years agoClarify build(7) instructions for alternate object directory.
wblock [Thu, 28 Apr 2016 22:14:09 +0000 (22:14 +0000)]
Clarify build(7) instructions for alternate object directory.

PR: 209062
Submitted by: Shawn Debnath <sd@beastie.io>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D6106

8 years agoRemove logically impossible test in scsidoinquiry(..)
ngie [Thu, 28 Apr 2016 21:17:23 +0000 (21:17 +0000)]
Remove logically impossible test in scsidoinquiry(..)

It was already done 4 lines prior and the value of error didn't change

MFC after: 3 days
Reported by: Coverity
CID: 1011236
Sponsored by: EMC / Isilon Storage Division

8 years ago[net80211] fix indenting.
adrian [Thu, 28 Apr 2016 20:30:49 +0000 (20:30 +0000)]
[net80211] fix indenting.

Sponsored by: Eva Automation, Inc.

8 years ago[net80211] handle action frames in adhoc mode from the node that created the BSS.
adrian [Thu, 28 Apr 2016 20:29:49 +0000 (20:29 +0000)]
[net80211] handle action frames in adhoc mode from the node that created the BSS.

We don't have a separate bss node; instead we dup the first node we saw
and turn that into the BSS node.  This means that action frames from
that node would be rejected.

So, check that the node is the bss node /and/ the MAC doesn't match ni_macaddr.
That's the "right" way for now to verify it's an unknown node.

This fixes handling action frames in adhoc mode, which includes negotiating
11n aggregation via ADDBA/DELBA.

This by itself isn't enough to correctly create 11n adhoc networks; but
it is required for aggregation to be negotiated.

Tested:

* AR9380, 11n adhoc mode
* broadcom 11ac adhoc (vendor platform)

Sponsored by: Eva Automation, Inc.

8 years agosys/geom: spelling fixes.
pfg [Thu, 28 Apr 2016 19:26:46 +0000 (19:26 +0000)]
sys/geom: spelling fixes.

These affect debugging messages.

MFC after: 2 weeks

8 years agoOnly count CPU devices that are using the ACPI CPU driver.
jhb [Thu, 28 Apr 2016 18:53:14 +0000 (18:53 +0000)]
Only count CPU devices that are using the ACPI CPU driver.

Arguably we should only be doing the probe/attach to children of
these devices as well.

Tested by: Michal Stanek <mst_semihalf.com> (arm64)
Differential Revision: https://reviews.freebsd.org/D6133

8 years agoFix va_list handling
ngie [Thu, 28 Apr 2016 18:41:55 +0000 (18:41 +0000)]
Fix va_list handling

- Add missing va_end's after corresponding va_start's to cleanup state
- Eliminate questionable bzero'ing of va_list passed in to
  do_buff_decode(..) and do_encode(..) from buff_{de,en}code_visit(..)
  and csio_{de,en}code_visit(..). Make va_list a pointer instead and
  pass NULL into the underlying functions to handler this in a portable
  way.
- Do some minor style(9) clean up in affected functions.

Differential Revision: https://reviews.freebsd.org/D6072
MFC after: 3 days
Reported by: cppcheck, Coverity
CID: 1018500-1018503
Reviewed by: cem
Sponsored by: EMC / Isilon Storage Division

8 years agoAdd some notes about the implicit resource mapping for activated resources.
jhb [Thu, 28 Apr 2016 18:23:18 +0000 (18:23 +0000)]
Add some notes about the implicit resource mapping for activated resources.

Specifically, mention that rman_get_bustag/handle/virtual are valid after
a resource is activated.  Also, mention the wrapper API that accepts a
struct resource instead of a bus tag and handle.

8 years agoDocument RF_PREFETCHABLE.
jhb [Thu, 28 Apr 2016 18:01:25 +0000 (18:01 +0000)]
Document RF_PREFETCHABLE.

8 years agoUse a better idiom for finding UTC prefixed timezones
ngie [Thu, 28 Apr 2016 17:57:17 +0000 (17:57 +0000)]
Use a better idiom for finding UTC prefixed timezones

Instead of copy-pasting the string literal for "UTC" 3 times and using
strlen, use a static char[3] buffer and sizeof(..).

MFC after: 3 days
X-MFC with: r298507
Submitted by: kib
Sponsored by: EMC / Isilon Storage Division

8 years agoDocument PCI_RES_BUS as a possible resource type.
jhb [Thu, 28 Apr 2016 17:50:16 +0000 (17:50 +0000)]
Document PCI_RES_BUS as a possible resource type.

8 years agoRemove a stale reference to the removed RF_TIMESHARE flag.
jhb [Thu, 28 Apr 2016 17:48:52 +0000 (17:48 +0000)]
Remove a stale reference to the removed RF_TIMESHARE flag.

8 years agoComplete the UDP tunneling of ICMP msgs to those protocols
rrs [Thu, 28 Apr 2016 15:53:10 +0000 (15:53 +0000)]
Complete the UDP tunneling of ICMP msgs to those protocols
interested in having tunneled UDP and finding out about the
ICMP (tested by Michael Tuexen with SCTP.. soon to be using
this feature).

Differential Revision: http://reviews.freebsd.org/D5875

8 years agoSmall typo.
pfg [Thu, 28 Apr 2016 15:20:08 +0000 (15:20 +0000)]
Small typo.

8 years agoSmall typos.
pfg [Thu, 28 Apr 2016 15:18:28 +0000 (15:18 +0000)]
Small typos.

8 years agoAdd PACKAGE fields to usr.sbin/extattr/tests/Makefile
asomers [Thu, 28 Apr 2016 15:13:50 +0000 (15:13 +0000)]
Add PACKAGE fields to usr.sbin/extattr/tests/Makefile

usr.sbin/extattr/tests/Makefile
Add boiler plate required by 298107 but omitted by 298483.  These
two changes passed through CR in parallel.  I think this should get
the full test suite running in Jenkins again.

MFC after: 22 days
X-MFC-with: 298483
Sponsored by: Spectra Logic Corp

8 years agoThis cleans up the timers code in TCP to start using the new
rrs [Thu, 28 Apr 2016 13:27:12 +0000 (13:27 +0000)]
This cleans up the timers code in TCP to start using the new
async_drain functionality. This as been tested in NF as well as
by Verisign. Still to do in here is to remove all the old flags. They
are currently left being maintained but probably are no longer needed.

Sponsored by: Netflix Inc.
Differential Revision: http://reviews.freebsd.org/D5924

8 years agoTEGRA: Add interrupt support for Tegra GPIO controller.
mmel [Thu, 28 Apr 2016 13:00:40 +0000 (13:00 +0000)]
TEGRA: Add interrupt support for Tegra GPIO controller.

8 years agoStop using sbrk(2) with malloc. This helps reduce the number of places
andrew [Thu, 28 Apr 2016 12:24:58 +0000 (12:24 +0000)]
Stop using sbrk(2) with malloc. This helps reduce the number of places
within the tree where we call this legacy interface.

Reviewed by: jasone
Obtained from: brooks
Sponsored by: ABT Systems Ltd

8 years agoARM: Use kernel pmap as intermediate mapping in context switch.
mmel [Thu, 28 Apr 2016 12:05:07 +0000 (12:05 +0000)]
ARM: Use kernel pmap as intermediate mapping in context switch.
On ARM, we can directly switch between translation tables only when
the size of the mapping for any given virtual address is the same in
the old and new translation tables. The load of new TTB and subsequent
TLB flush is not atomic operation. So speculative page table walk can
load TLB entry from new mapping while rest of TLB entries are still the
old ones. In worst case, this can lead to situation when TLB cache can
contain multiple matching TLB entries. One (from old mapping) L2 entry
for VA + 4k and one (from new mapping) L1 entry for VA.

Thus, we must switch to kernel pmap translation table as intermediate
mapping because all sizes of these (old pmap and kernel pmap) mappings
are same (or unmapped). The same is true for switch from kernel pmap
translation table to new pmap one.

8 years agoINTRNG: Define 'INTR_IRQ_INVALID' constant and use it consistently
mmel [Thu, 28 Apr 2016 12:04:12 +0000 (12:04 +0000)]
INTRNG: Define 'INTR_IRQ_INVALID' constant and use it consistently
as error indicator.

8 years agoGPIO: Add support for gpio pin interrupts.
mmel [Thu, 28 Apr 2016 12:03:22 +0000 (12:03 +0000)]
GPIO: Add support for gpio pin interrupts.
Add new function gpio_alloc_intr_resource(), which allows an allocation
of interrupt resource associated to given gpio pin. It also allows to
specify interrupt configuration.

Note: This functionality is dependent on INTRNG, and must be
implemented in each GPIO controller.

8 years agofix missing variable in r298736
avg [Thu, 28 Apr 2016 09:40:24 +0000 (09:40 +0000)]
fix missing variable in r298736

Pointyhat to: avg
Reported by: Ivan Klymenko <fidaj@ukr.net>
MFC after: 2 weeks
X-MFC with: r298736

8 years agoensure that initial local apic id is sane on AMD 10h systems
avg [Thu, 28 Apr 2016 08:29:57 +0000 (08:29 +0000)]
ensure that initial local apic id is sane on AMD 10h systems

Summary:
The Initial Local APIC ID is returned by CPUID function 1 (in EBX).
On AMD Family 10h systems the way that ID is built is controlled by
an MSR bit (InitApicIdCpuIdLo).  BKDG instructs BIOS to set it in a
certain way, but a BIOS can be buggy.  In that case the ID can confuse
tools that use it, e.g. hwloc.
For example, on a system that I own real Local APIC IDs are configured
as 0, 1, 2, 3, but IDs reported via CPUID.1 are 0, 0x40, 0x80, 0xc0.
See: https://github.com/open-mpi/hwloc/issues/183

Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D6060

8 years agosfxge(4): do not use RxQ index as label
arybchik [Thu, 28 Apr 2016 06:20:43 +0000 (06:20 +0000)]
sfxge(4): do not use RxQ index as label

Labels are limitted by 32 on EF10. It is not sufficient on powerful hosts.
Since only one RxQ is running over each EvQ, zero label may be used.

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
PR:             208267
Differential Revision:  https://reviews.freebsd.org/D6121

8 years agondis(4): it's rather unrealistic to expect a size_t here.
pfg [Thu, 28 Apr 2016 03:19:53 +0000 (03:19 +0000)]
ndis(4): it's rather unrealistic to expect a size_t here.

int was actually OK, and u_int is more than enough.

8 years agoipdivert: Remove unnecessary and incorrectly typed variable.
pfg [Thu, 28 Apr 2016 02:46:08 +0000 (02:46 +0000)]
ipdivert: Remove unnecessary and incorrectly typed variable.

In principle n is only used to carry a copy of ipi_count, which is
unsigned, in the non-VIMAGE case, however ipi_count can be used
directly so it is not needed at all. Removing it makes things look
cleaner.

8 years agosys/devfs: unsign an index to prevent signed integer overflow.
pfg [Thu, 28 Apr 2016 02:39:43 +0000 (02:39 +0000)]
sys/devfs: unsign an index to prevent signed integer overflow.

cdp_maxdirent in struct:cdev_priv is of type u_int.  Use the same
type for the corresponding index in devfs_revoke().

MFC after: 1 week

8 years agondis(4): unsign some indexes to prevent overflows.
pfg [Thu, 28 Apr 2016 01:58:56 +0000 (01:58 +0000)]
ndis(4): unsign some indexes to prevent overflows.

The "len" parameter is uint32_t, indexing it with an int may
end up in a signed integer overflow.

strlen(3) returns an integer of size_t so the corresponding index should
have that size.

MFC after: 1 week

8 years agotcp/lro: Fix more typo
sephe [Thu, 28 Apr 2016 01:43:18 +0000 (01:43 +0000)]
tcp/lro: Fix more typo

Noticed by: hiren
MFC after: 1 week
Sponsored by: Microsoft OSTC

8 years agoTrim redundant message.
jhb [Wed, 27 Apr 2016 21:51:24 +0000 (21:51 +0000)]
Trim redundant message.

WITNESS_WARN() appends "with non-sleepable lock" to the caller's message.

Sponsored by: Chelsio Communications

8 years agoAdjust prototypes for NUMA-related functions to match the style of the
jhb [Wed, 27 Apr 2016 21:12:05 +0000 (21:12 +0000)]
Adjust prototypes for NUMA-related functions to match the style of the
rest of this file.

8 years agoAdd support for the Non-maskable interrupt driver found in the Allwinner A20 and...
manu [Wed, 27 Apr 2016 20:49:57 +0000 (20:49 +0000)]
Add support for the Non-maskable interrupt driver found in the Allwinner A20 and A31 SoCs.
This is normally used for the PMU.

Reviewed by: andrew
Approved by: andrew (mentor)
Differential Revision: https://reviews.freebsd.org/D5663

8 years agoFix build without ACPI_DEBUG.
jkim [Wed, 27 Apr 2016 20:24:48 +0000 (20:24 +0000)]
Fix build without ACPI_DEBUG.

8 years agoFix build for systems without PCI_RES_BUS.
jhb [Wed, 27 Apr 2016 19:54:56 +0000 (19:54 +0000)]
Fix build for systems without PCI_RES_BUS.

Submitted by: vangyzen