]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoOnly compile tests/ if MK_TESTS != no or ALL_MODULES is defined
ngie [Tue, 9 May 2017 04:59:05 +0000 (04:59 +0000)]
Only compile tests/ if MK_TESTS != no or ALL_MODULES is defined

MFC after: 3 weeks
Sponsored by: Dell EMC Isilon

7 years agoAdd intermediary Makefile for compiling all items in the directory
ngie [Tue, 9 May 2017 04:56:14 +0000 (04:56 +0000)]
Add intermediary Makefile for compiling all items in the directory

MFC after: 3 weeks
Sponsored by: Dell EMC Isilon

7 years agostyle(9): sort headers and remove duplicates
ngie [Tue, 9 May 2017 04:54:29 +0000 (04:54 +0000)]
style(9): sort headers and remove duplicates

MFC after: 3 weeks
Sponsored by: Dell EMC Isilon

7 years ago[iwm] Add basic powermanagement support via ifconfig wlan0 powersave.
adrian [Tue, 9 May 2017 04:15:07 +0000 (04:15 +0000)]
[iwm] Add basic powermanagement support via ifconfig wlan0 powersave.

* The DEVICE_POWER_FLAGS_CAM_MSK flag was removed in the upstream iwlwifi
  in Linux commit ceef91c89480dd18bb3ac51e91280a233d0ca41f.

* Add sc_ps_disabled flag to struct iwm_softc, which corresponds to
  mvm->ps_disabled in struct iwl_mvm in Linux iwlwifi.

* Adds a hw.iwm.power_scheme tunable which corresponds to the power_scheme
  module parameter in Linux iwlwifi. Set this to 1 for completely
  disabling power management, 2 (default) for balanced powermanagement,
  and 3 for lowerpower mode (which does dtim period skipping).

* Imports the constants.h file from iwlwifi as if_iwm_constants.h.

* This doesn't allow changing the powermanagement setting while connected,
  also one can only choose between enabled and disabled powersaving with
  ifconfig (so switching between balanced and low-power mode requires
  rebooting to change the tunable).

* After any changes to powermanagement (i.e. "ifconfig wlan0 powersave" to
  enable powermanagement, or "ifconfig wlan0 -powersave" for disabling
  powermanagement), one has to disconnect and reconnect to the accespoint
  for the change to take effect.

Obtained from: dragonflybsd.git d7002a7990d077c92585978ea998474af50f91e0

7 years agoRemove expected failure that no longer fails with gnu grep in base
ngie [Tue, 9 May 2017 04:11:53 +0000 (04:11 +0000)]
Remove expected failure that no longer fails with gnu grep in base

Reported by: Jenkins
Submitted by: Kyle Evans <kevans91@ksu.edu>
Sponsored by: Dell EMC Isilon

7 years ago[iwm] Add iwm_nic_unlock() calls missing from previous commit.
adrian [Tue, 9 May 2017 02:42:53 +0000 (02:42 +0000)]
[iwm] Add iwm_nic_unlock() calls missing from previous commit.

Obtained from: dragonflybsd.git f88ab372284e63c4c13da93e9026a203b9b4cdc5

7 years ago[iwm] iwm_{read,write}_prph() don't grab the nic lock in iwm themselves.
adrian [Tue, 9 May 2017 02:41:33 +0000 (02:41 +0000)]
[iwm] iwm_{read,write}_prph() don't grab the nic lock in iwm themselves.

* Fix a couple of cases where the nic lock ended up not being grabbed
  during an iwm_read_prph() or iwm_write_prph().

Obtained from: dragonflybsd.git 6c5470f2db219c61e362c981fea969d97e1b8293

7 years ago[iwm] include opt_iwm.h and opt_wlan.h consistently in all files.
adrian [Tue, 9 May 2017 02:38:23 +0000 (02:38 +0000)]
[iwm] include opt_iwm.h and opt_wlan.h consistently in all files.

7 years agoDIRDEPS_BUILD: Update dependencies.
bdrewery [Tue, 9 May 2017 01:48:23 +0000 (01:48 +0000)]
DIRDEPS_BUILD: Update dependencies.

Sponsored by: Dell EMC Isilon

7 years agoDIRDEPS_BUILD: Connect new directories.
bdrewery [Tue, 9 May 2017 01:48:14 +0000 (01:48 +0000)]
DIRDEPS_BUILD: Connect new directories.

Sponsored by: Dell EMC Isilon

7 years agoFix invalid .o SRCS from r314527.
bdrewery [Tue, 9 May 2017 01:48:02 +0000 (01:48 +0000)]
Fix invalid .o SRCS from r314527.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoFix bug where MTX_DEF lock was held while taskqueue_drain() was invoked.
davidcs [Tue, 9 May 2017 01:01:41 +0000 (01:01 +0000)]
Fix bug where MTX_DEF lock was held while taskqueue_drain() was invoked.
Check IFF_DRV_RUNNING flag is set prior to calling ql_hw_set_multi()

MFC after:3 days

7 years ago- Also outside of the KOBJOPLOOKUP macro - which in turn is used by
marius [Mon, 8 May 2017 21:08:39 +0000 (21:08 +0000)]
- Also outside of the KOBJOPLOOKUP macro - which in turn is used by
  the code auto-generated for *.m - kobj_lookup_method(9) is useful;
  for example in back-ends or base class device drivers in order to
  determine whether a default method has been overridden. Thus, allow
  for the kobj_method_t pointer argument - used by KOBJOPLOOKUP in
  order to update the cache entry - of kobj_lookup_method(9), to be
  NULL. Actually, that pointer is redundant as it's just set to the
  same kobj_method_t that the kobj_lookup_method(9) function returns
  in the first place, but probably it serves to reduce the number of
  instructions generated for KOBJOPLOOKUP.
- For the same reason, move updating kobj_lookup_{hits,misses} (if
  KOBJ_STATS is defined) from kobj_lookup_method(9) to KOBJOPLOOKUP.
  As a side-effect, this gets rid of the convoluted approach of always
  incrementing kobj_lookup_hits in KOBJOPLOOKUP and then in case of
  a cache miss, decrementing it in kobj_lookup_method(9) again.

7 years agoRevise r315430; there's no need to build mmc_subr.c into both mmc.ko
marius [Mon, 8 May 2017 20:58:32 +0000 (20:58 +0000)]
Revise r315430; there's no need to build mmc_subr.c into both mmc.ko
and mmcsd.ko.

7 years agoFix syntax error in parse_path after r316952.
bdrewery [Mon, 8 May 2017 20:44:21 +0000 (20:44 +0000)]
Fix syntax error in parse_path after r316952.

Also fix bad whitespace in sort_unique after r314809.

The parse_path syntax error came up in DIRDEPS_BUILD as the following
and emptied out all Makefile.depend files due to it:

# python share/mk/meta2deps.py
  File "share/mk/meta2deps.py", line 538
    rdir = os.path.realpath(dir)
    ^
IndentationError: unexpected indent

Sponsored by: Dell EMC Isilon

7 years agoRemove MK_MANDOCDB option missed in r315057
bdrewery [Mon, 8 May 2017 20:44:12 +0000 (20:44 +0000)]
Remove MK_MANDOCDB option missed in r315057

7 years agoHonor WITHOUT_LIB32 on mips64.
jhb [Mon, 8 May 2017 18:51:13 +0000 (18:51 +0000)]
Honor WITHOUT_LIB32 on mips64.

The closing paren for the list of architectures that should enable LIB32
by default was in the wrong place resulting in LIB32 always be enabled on
mips64 regardless of WITH_LIB32/WITHOUT_LIB32.

Submitted by: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
Obtained from: CheriBSD
Sponsored by: DARPA / AFRL

7 years agoRestore `sectorsize` global to unbreak makefs after r317744
ngie [Mon, 8 May 2017 18:42:38 +0000 (18:42 +0000)]
Restore `sectorsize` global to unbreak makefs after r317744

This also unbreaks the fstyp tests.

Reported by: Alastair Hogge <agh@fastmail.fm>, Jenkins
Sponsored by: Dell EMC Isilon

7 years agoFix the build after r317942 by adding usr.bin/csplit to BSD.tests.dist
ngie [Mon, 8 May 2017 17:13:00 +0000 (17:13 +0000)]
Fix the build after r317942 by adding usr.bin/csplit to BSD.tests.dist

Pointyhat to: cem
MFC with: r317942
Sponsored by: Dell EMC Isilon

7 years agomakefs: further size_t warning cleanup (missing from r317944)
emaste [Mon, 8 May 2017 16:57:33 +0000 (16:57 +0000)]
makefs: further size_t warning cleanup (missing from r317944)

Sponsored by: The FreeBSD Foundation

7 years agomakefs: cast snprintf return value to size_t to clear warning
emaste [Mon, 8 May 2017 16:34:39 +0000 (16:34 +0000)]
makefs: cast snprintf return value to size_t to clear warning

Sponsored by: The FreeBSD Foundation

7 years agocsplit(1): Fix extraneous output in edge case
cem [Mon, 8 May 2017 15:51:29 +0000 (15:51 +0000)]
csplit(1): Fix extraneous output in edge case

When the input to csplit contains fewer lines than the number of matches
specified, extra output was mistakenly included in some output files.

Fix the bug and add a simple ATF regression test.

PR: 219024
Submitted by: J.R. Oldroyd <fbsd at opal.com>

7 years agoAdd myself (dbaio) as a new ports committer
dbaio [Mon, 8 May 2017 14:33:38 +0000 (14:33 +0000)]
Add myself (dbaio) as a new ports committer

Approved by: garga (mentor)
Differential Revision: https://reviews.freebsd.org/D10633

7 years agoarch(7): correct initial versions for alpha and pc98
emaste [Mon, 8 May 2017 14:17:10 +0000 (14:17 +0000)]
arch(7): correct initial versions for alpha and pc98

Submitted by: imp

7 years agomakefs: use size_t as appropriate to clean up warnings
emaste [Mon, 8 May 2017 13:09:27 +0000 (13:09 +0000)]
makefs: use size_t as appropriate to clean up warnings

Sponsored by: The FreeBSD Foundation

7 years agoSort variable declarations; no functional changes.
trasz [Mon, 8 May 2017 09:14:41 +0000 (09:14 +0000)]
Sort variable declarations; no functional changes.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

7 years agoAdd resizewin -z. It makes resizewin not do anything if the terminal
trasz [Mon, 8 May 2017 08:58:51 +0000 (08:58 +0000)]
Add resizewin -z. It makes resizewin not do anything if the terminal
size is already set to something other than zero. It's supposed to be
called from eg /etc/profile - it's not neccessary to query terminal
size when logging in over the network, because the protocol used already
takes care of this, but it's neccessary when logging over a serial line.

Reviewed by: cem, Daniel O'Connor <darius@dons.net.au>
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D10637

7 years agoUse tcflush(3) instead of (nonstandard) TIOCFLUSH.
trasz [Mon, 8 May 2017 08:34:50 +0000 (08:34 +0000)]
Use tcflush(3) instead of (nonstandard) TIOCFLUSH.

Reported by: kib
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

7 years agoFix mount_nfs so that it doesn't create mounttab entries for NFSv4 mounts.
rmacklem [Mon, 8 May 2017 00:45:05 +0000 (00:45 +0000)]
Fix mount_nfs so that it doesn't create mounttab entries for NFSv4 mounts.

The NFSv4 protocol doesn't use the Mount protocol, so it doesn't make sense
to add an entry for an NFSv4 mount to /var/db/mounttab. Also, r308871
modified umount so that it doesn't remove any entry created by mount_nfs.
Reported on freebsd-current@.

Reported by: clbuisson@orange.fr
MFC after: 2 weeks

7 years agoAdd necessary bits to get FreeBSD booting on the Unifi Security Gateway
jhibbits [Sun, 7 May 2017 22:04:12 +0000 (22:04 +0000)]
Add necessary bits to get FreeBSD booting on the Unifi Security Gateway

Summary:
The Ubiquiti Unifi Security Gateway is virtually identical to the
EdgeRouter Lite, with a smaller PCB and apparently a different board identifier.
Simply adding the new board identifier alongside the ERL identifier, FreeBSD
boots successfully, and can access the needed peripherals (tested with USB
booting, and basic pings on one ethernet interface)

Reviewed By: adrian
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D10639

7 years agoFix the output of very large rebind, renew and lease time options in
n_hibma [Sun, 7 May 2017 21:11:28 +0000 (21:11 +0000)]
Fix the output of very large rebind, renew and lease time options in
lease file.

Some routers set very large values for rebind time (Netgear) and these
are erroneously reported as negative in the leasefile. This was due to a
wrong printf format specification of %ld for an unsigned long on 32-bit
platforms.

7 years agoFix handling of large DHCP expiry values.
n_hibma [Sun, 7 May 2017 19:59:37 +0000 (19:59 +0000)]
Fix handling of large DHCP expiry values.

They would overflow a signed 32-bit time_t on 32 bit architectures. This
was taken care of, but a compiler optimisation makes this behave
erratically. This could be resolved by adding a -fwrapv flag, but
instead we can check the value before adding the current timestamp to
it.

In the lease file values are still wrong though:

  option dhcp-rebinding-time -644245096;

PR: 218980
Reported by: Bob Eager
MFC after: 2 weeks

7 years agoglob: Fix comment about collapsing asterisks after r317749.
jilles [Sun, 7 May 2017 19:52:56 +0000 (19:52 +0000)]
glob: Fix comment about collapsing asterisks after r317749.

After r317749, collapsing adjacent asterisks is still required, but for a
different reason.

7 years agosh: Fix INTOFF leak after a builtin with different locale settings.
jilles [Sun, 7 May 2017 19:49:46 +0000 (19:49 +0000)]
sh: Fix INTOFF leak after a builtin with different locale settings.

After executing a builtin with different locale settings such as
  LC_ALL=C true
SIGINT handling was left disabled indefinitely.

MFC after: 1 week

7 years agoBring VOP_GETPAGES.9 more up-to-date
bjk [Sun, 7 May 2017 19:01:08 +0000 (19:01 +0000)]
Bring VOP_GETPAGES.9 more up-to-date

Attempt to catch up to the KPI changes from r292373, and perform
some other tidying while in the area.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D10579

7 years agoMake resizewin(1) discard the terminal queues, to lower the chance
trasz [Sun, 7 May 2017 17:21:22 +0000 (17:21 +0000)]
Make resizewin(1) discard the terminal queues, to lower the chance
for "unable to parse response" error which happens when youre typing
too fast for the machine you're running it on.

Reviewed by: cem, Daniel O'Connor <darius@dons.net.au>
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D10624

7 years agoRemove spl() calls from UFS code.
kib [Sun, 7 May 2017 14:59:45 +0000 (14:59 +0000)]
Remove spl() calls from UFS code.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agopf: Fix vnet initialisation
kp [Sun, 7 May 2017 14:33:58 +0000 (14:33 +0000)]
pf: Fix vnet initialisation

When running the vnet init code (pf_load_vnet()) we used to iterate over
all vnets, marking them as unhooked.
This is incorrect and leads to panics if pf is unloaded, as the unload
code does not unregister the pfil hooks (because the vnet is marked as
unhooked).

There's no need or reason to touch other vnets during initialisation.
Their pf_load_vnet() function will be triggered, which handles all
required initialisation.

Reviewed by: zec, gnn
Differential Revision: https://reviews.freebsd.org/D10592

7 years agoFix the client side krpc from doing TCP reconnects for ERESTART from sosend().
rmacklem [Sun, 7 May 2017 12:12:45 +0000 (12:12 +0000)]
Fix the client side krpc from doing TCP reconnects for ERESTART from sosend().

When sosend() replies ERESTART in the client side krpc, it indicates that
the RPC message hasn't yet been sent and that the send queue is full or
locked while a signal is posted for the process.
Without this patch, this would result in a RPC_CANTSEND reply from
clnt_vc_call(), which would cause clnt_reconnect_call() to create a new
TCP transport connection. For most NFS servers, this wasn't a serious problem,
although it did imply retries of outstanding RPCs, which could possibly
have missed the DRC.
For an NFSv4.1 mount to AmazonEFS, this caused a serious problem, since
AmazonEFS often didn't retain the NFSv4.1 session and would reply with
NFS4ERR_BAD_SESSION. This implies to the client a crash/reboot which
requires open/lock state recovery.

Three options were considered to fix this:
- Return the ERESTART all the way up to the system call boundary and then
  have the system call redone. This is fraught with risk, due to convoluted
  code paths, asynchronous I/O RPCs etc. cperciva@ worked on this, but it
  is still a work in prgress and may not be feasible.
- Set SB_NOINTR for the socket buffer. This fixes the problem, but makes
  the sosend() completely non interruptible, which kib@ considered
  inappropriate. It also would break forced dismount when a thread
  was blocked in sosend().
- Modify the retry loop in clnt_vc_call(), so that it loops for this case
  for up to 15sec. Testing showed that the sosend() usually succeeded by
  the 2nd retry. The extreme case observed was 111 loop iterations, or
  about 100msec of delay.
This third alternative is what is implemented in this patch, since the
change is:
- localized
- straightforward
- forced dismount is not broken by it.

This patch has been tested by cperciva@ extensively against AmazonEFS.

Reported by: cperciva
Tested by: cperciva
MFC after: 2 weeks

7 years agoRename a variable, hopefully fixing build after r317901.
trasz [Sun, 7 May 2017 12:08:41 +0000 (12:08 +0000)]
Rename a variable, hopefully fixing build after r317901.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

7 years ago.Xr resizewin from stty(1) man page.
trasz [Sun, 7 May 2017 11:44:25 +0000 (11:44 +0000)]
.Xr resizewin from stty(1) man page.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

7 years agoImprove error reporting in resizewin(1).
trasz [Sun, 7 May 2017 09:19:42 +0000 (09:19 +0000)]
Improve error reporting in resizewin(1).

Reviewed by: cem (earlier version)
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D10624

7 years agoPull in r302362 from upstream libc++ trunk (by me):
dim [Sat, 6 May 2017 21:43:55 +0000 (21:43 +0000)]
Pull in r302362 from upstream libc++ trunk (by me):

  Ensure showbase does not overflow do_put buffers

  Summary:
  In https://bugs.freebsd.org/207918, Daniel McRobb describes how using
  std::showbase with ostreams can cause truncation of unsigned long long
  when output format is octal.  In fact, this can even happen with
  unsigned int and unsigned long.

  To ensure this does not happen, add one additional character to the
  do_put buffers if std::showbase is on.  Also add a test case.

  Reviewers: EricWF, mclow.lists

  Reviewed By: EricWF

  Subscribers: cfe-commits, emaste

  Differential Revision: https://reviews.llvm.org/D32670

PR: 207918
MFC after: 3 days

7 years agoloader: network read rework
tsoome [Sat, 6 May 2017 20:32:27 +0000 (20:32 +0000)]
loader: network read rework

The current read from network is working from up to down - we have some
protocol needing the data from the network, so we build the buffer space
for that protocol, add the extra space for headers and pass this buffer
down to be filled by nif get call in hope, we have guessed the incoming
packet size right. Amazingly enough this approach mostly does work, but
not always...

So, this update does work from down to up - we allocate buffer (based
on MTU or frame size info), fill it up, and pass on for upper layers.
The obvious problem is that when we should free the buffer - if at all.

In the current implementation the upper layer will free the packet on error
or when the packet is no longer needed.

While working on the issue, the additional issue did pop up - the bios
implementation does not have generic get/put interface but is using pxe
udpsend/udpreceive instead. So the udp calls are gone and undi interface
is implemented instead. Which in turn means slight other changes as we
do not need to have duplicated pxe implementation and can just use dev_net.

To align packet content, the actual read from nic is using shifted buffer by
ETHER_ALIGN (2).

Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D10232

7 years agodistinguish NFS versus TFTP boot by rootpath
bapt [Sat, 6 May 2017 19:23:58 +0000 (19:23 +0000)]
distinguish NFS versus TFTP boot by rootpath

Don't use DHCP 150 option to decide which protocol use to netboot. When
root-path includes ip address - go thru NFS, if ip address not exists in
root-path - go thru TFTP from server which ip address is in next-server.  But
there is one limitation - only one tftp server in network to provide loader and
everything else.  Does enybody use more than only one?

Submitted by: kczekirda
Sponsored by: Oktawave
MFC after: 3 weeks
Relnote: Yes
Differential Revision: https://reviews.freebsd.org/D8740

7 years agoAdd zstd to the rescue binary
bapt [Sat, 6 May 2017 18:35:01 +0000 (18:35 +0000)]
Add zstd to the rescue binary

Having zstd might be useful in rescue to be able to access to log files
compressed by zstandard

Suggested by: ian

7 years agoFix linprocfs_docpuinfo() output regarding to what newer Linux apps expect
mmokhi [Sat, 6 May 2017 17:37:01 +0000 (17:37 +0000)]
Fix linprocfs_docpuinfo() output regarding to what newer Linux apps expect

Reviewed by: trasz
Approved by: trasz
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D10274

7 years agosh: Update TOUR and comments for some code changes, some of them old.
jilles [Sat, 6 May 2017 13:28:42 +0000 (13:28 +0000)]
sh: Update TOUR and comments for some code changes, some of them old.

Also, improve some terminology in TOUR and comments.

7 years agoBuild zstandard with threading enabled
bapt [Sat, 6 May 2017 10:59:10 +0000 (10:59 +0000)]
Build zstandard with threading enabled

7 years agoAdd a zstdmt which is equivalent as running zstd -T0
bapt [Sat, 6 May 2017 10:28:57 +0000 (10:28 +0000)]
Add a zstdmt which is equivalent as running zstd -T0

7 years agoImport Zstandard 1.2.0
bapt [Sat, 6 May 2017 10:26:40 +0000 (10:26 +0000)]
Import Zstandard 1.2.0

Among new things it is now threaded by default, use zstd -T# to chose the
number of threads not that -T0 will automatically determine the number of
threads based on the number of CPU online.

7 years agoImport Zstandard 1.2.0
bapt [Sat, 6 May 2017 10:17:59 +0000 (10:17 +0000)]
Import Zstandard 1.2.0
Among changes: threading support is now default and supports freebsd

7 years ago[mediatek] [gpio] add PPS / interrupt support.
adrian [Sat, 6 May 2017 06:22:14 +0000 (06:22 +0000)]
[mediatek] [gpio] add PPS / interrupt support.

Submitted by: Hiroki Mori <yamori813@yahoo.co.jp>
Reviewed by: mizhka
Differential Revision: https://reviews.freebsd.org/D9784

7 years ago[mips] [rt2880] Add oldest Ralink MIPS SOC RT2880 support code.
adrian [Sat, 6 May 2017 06:20:34 +0000 (06:20 +0000)]
[mips] [rt2880] Add oldest Ralink MIPS SOC RT2880 support code.

* Target module have ic plus etherswitch ip175c.
* Also add etherswitch support code on rt driver.

Reviewed by: mizhka
Differential Revision: https://reviews.freebsd.org/D10336

7 years ago[arm] [rt1310] add initial RT1310 SoC code.
adrian [Sat, 6 May 2017 06:14:46 +0000 (06:14 +0000)]
[arm] [rt1310] add initial RT1310 SoC code.

This code base on lpc code. Ralink RT1310 is oem from 5V Technologies.
RT1310 is ARM926EJS(arm5t).

Tested:

* Buffalo WZR2-G300N

Submitted by: Hiroki Mori <yamori813@yahoo.co.jp>
Reviewed by: mizhka
Differential Revision: https://reviews.freebsd.org/D7238

7 years ago[ar934x] do an ethernet analog reset; apparently some boards don't.
adrian [Sat, 6 May 2017 06:09:50 +0000 (06:09 +0000)]
[ar934x] do an ethernet analog reset; apparently some boards don't.

Tested:

* on IOData WN-G300R. may be same as Sitecom WLR-2100.

Submitted by: Hiroki Mori <yamori813@yahoo.co.jp>
Differential Revision: https://reviews.freebsd.org/D10621

7 years ago[mx25l] add new device ids.
adrian [Sat, 6 May 2017 06:08:44 +0000 (06:08 +0000)]
[mx25l] add new device ids.

Submitted by: Hiroki Mori <yamori813@yahoo.co.jp>
Differential Revision: https://reviews.freebsd.org/D10621

7 years ago[etherswitch] [e6000sw] fix compile issue under clang/arm
adrian [Sat, 6 May 2017 06:07:44 +0000 (06:07 +0000)]
[etherswitch] [e6000sw] fix compile issue under clang/arm

Submitted by: Hiroki Mori <yamori813@yahoo.co.jp>
Approved by: mizhka
Differential Revision: https://reviews.freebsd.org/D10563

7 years ago[ar531x] [if_are] Fix if_are behaviour under high load traffic
adrian [Sat, 6 May 2017 06:06:11 +0000 (06:06 +0000)]
[ar531x] [if_are] Fix if_are behaviour under high load traffic

* use ifqmaxlen
* handle (inefficiently for now) meeting padding and alignment requirements for
  transmit mbufs.
* change how TX ring handling is done

Submitted by: Hiroki Mori <yamori813@yahoo.co.jp>
Differential Revision: https://reviews.freebsd.org/D10557

7 years ago[etherswitch] add manpages for etherswitch supported devices.
adrian [Sat, 6 May 2017 06:01:17 +0000 (06:01 +0000)]
[etherswitch] add manpages for etherswitch supported devices.

Submitted by: Hiroki Mori <yamori813@yahoo.co.jp>
Reviewed by: mizhka
Differential Revision: https://reviews.freebsd.org/D10278

7 years ago[ip17x] [etherswitch] fdt away and mii hang workaround on ip17x
adrian [Sat, 6 May 2017 05:53:42 +0000 (05:53 +0000)]
[ip17x] [etherswitch] fdt away and mii hang workaround on ip17x

Add workaround mii access because of rt1310 is hang up on etherswitch mii poll.
And FDT away on arm platform.

Tested:

* wzr2-g300n

Submitted by: Hiroki Mori <yamori813@yahoo.co.jp>
Reviewed by: mizhka
Differential Revision: https://reviews.freebsd.org/D10295

7 years ago[cfi] fix CFI flash reset command for MX29LV320T/B.
adrian [Sat, 6 May 2017 05:52:01 +0000 (05:52 +0000)]
[cfi] fix CFI flash reset command for MX29LV320T/B.

MX flash MX29LV320T/B datasheet say reset is 0xf0.

Submitted by: Hiroki Mori <yamori813@yahoo.co.jp>
Approved by: mizhka
Differential Revision: https://reviews.freebsd.org/D10177

7 years ago[infineon] [etherswitch] no hardcode tagging port setting at amd6996fc
adrian [Sat, 6 May 2017 05:50:07 +0000 (05:50 +0000)]
[infineon] [etherswitch] no hardcode tagging port setting at amd6996fc

Tagging port can set by etherswitchcfg command.

Tested:

* on Netgear_WGR614Cv7

Submitted by: Hiroki Mori <yamori813@yahoo.co.jp>
Reviewed by: mizhka

7 years agoFix some "don't build" optimizations from r308599 not working due to a typo.
bdrewery [Sat, 6 May 2017 05:37:36 +0000 (05:37 +0000)]
Fix some "don't build" optimizations from r308599 not working due to a typo.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoImprove blacklist support before upgrading libblacklist
lidl [Sat, 6 May 2017 04:17:48 +0000 (04:17 +0000)]
Improve blacklist support before upgrading libblacklist

The locally declared enum of blacklistd actions needs to be
hidden when the soon to be committed changes to libblacklist
are brought into the tree.  Fix the type of the "msg" parameter
to match the library.

There should be no functional changes.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

7 years agoWhen editing a mode page on a tape drive, do not clear the device
ken [Fri, 5 May 2017 21:29:28 +0000 (21:29 +0000)]
When editing a mode page on a tape drive, do not clear the device
specific parameter.

Tape drives include write protect (WP), Buffered Mode and Speed
settings in the device-specific parameter.  Clearing this
parameter on a mode select can have the effect of turning off
write protect or buffered mode, or changing the speed setting of
the tape drive.

Disks report DPO/FUA support via the device specific parameter
for MODE SENSE, but the bit is reserved for MODE SELECT.  So we
clear this for disks (and other non-tape devices) to avoid
potential errors from the target device.

sbin/camcontrol/modeedit.c:
Clear the device-specific parameter in the mode page
header if we're not operating on a tape drive.

MFC after: 3 days
Sponsored by: Spectra Logic

7 years agocxgbe/t4_tom: Per-connection rate limiting for TCP sockets handled by
np [Fri, 5 May 2017 20:06:49 +0000 (20:06 +0000)]
cxgbe/t4_tom: Per-connection rate limiting for TCP sockets handled by
the TOE.  For now this capability is always enabled in kernels with
options RATELIMIT.  t4_tom will check if_capenable once the base driver
gets code to support rate limiting for any socket (TOE or not).

This was tested with iperf3 and netperf ToT as they already support
SO_MAX_PACING_RATE sockopt.  There is a bug in firmwares prior to
1.16.45.0 that affects the BSD driver only and results in rate-limiting
at an incorrect rate.  This will resolve by itself as soon as 1.16.45.0
or later firmware shows up in the driver.

Relnotes: Yes
Sponsored by: Chelsio Communications

7 years agoAdd basic programmable early warning error injection to the sa(4) driver.
ken [Fri, 5 May 2017 20:00:53 +0000 (20:00 +0000)]
Add basic programmable early warning error injection to the sa(4) driver.

This will help application developers simulate end of tape conditions.

To inject an error in sa0:

sysctl kern.cam.sa.0.inject_eom=1

This will return the next read or write request queued with 0 bytes
written.  Any subsequent writes or reads will go along as usual.

This will also cause the early warning position flag to get set
for the next position query.  So, 'mt status' will show the BPEW
(Beyond Programmable Early Warning) flag on the first query after
an error injection.  After that, the position flags will be as they
are in the underlying tape drive.

Also, update the sa(4) man page to describe tape parameters,
which can be set via 'mt param'.

sys/cam/scsi/scsi_sa.c:
In saregister(), create the inject_eom sysctl variable.

In sastart(), check to see whether inject_eom is set.  If
so, return the read or write with 0 bytes written to
indicate EOM.  Set the set_pews_status flag so that we
fake PEWS status in the next position call for reads, and the
next 3 calls for writes.  This allows the user to see the BPEW
flag one time via 'mt status'.

In sagetpos(), check the set_pews_status flag and fake
PEWS status and decrement the counter if it is set.

share/man/man4/sa.4:
Document the inject_eom sysctl variable.

Document all of the parameters currently supported via
'mt param'.

usr.bin/mt/mt.1:
Point the user to the sa(4) man page for more details on
supported parameters.

MFC after: 3 days
Sponsored by: Spectra Logic

7 years agocxgbe(4): The Tx scheduler initialization either works or doesn't. It
np [Fri, 5 May 2017 19:34:05 +0000 (19:34 +0000)]
cxgbe(4): The Tx scheduler initialization either works or doesn't.  It
doesn't need a refresh in either case.

Sponsored by: Chelsio Communications

7 years agoRegent post r317845.
brooks [Fri, 5 May 2017 18:50:22 +0000 (18:50 +0000)]
Regent post r317845.

MFC after: 1 week
MFC with: r317845
Sponsored by: DARPA, AFRL

7 years agoProvide a freebsd32 implementation of sigqueue()
brooks [Fri, 5 May 2017 18:49:39 +0000 (18:49 +0000)]
Provide a freebsd32 implementation of sigqueue()

The previous misuse of sys_sigqueue() was sending random register or
stack garbage to 64-bit targets.  The freebsd32 implementation preserves
the sival_int member of value when signaling a 64-bit process.

Document the mixed ABI implementation of union sigval and the
incompability of sival_ptr with pointer integrity schemes.

Reviewed by: kib, wblock
MFC after: 1 week
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D10605

7 years agoGrammar fixes.
kib [Fri, 5 May 2017 18:36:41 +0000 (18:36 +0000)]
Grammar fixes.

Noted by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoDefine the scope and purpose of the page.
kib [Fri, 5 May 2017 18:21:33 +0000 (18:21 +0000)]
Define the scope and purpose of the page.

Submitted by: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agobsdgrep: don't ouptut matches with -c, -l, -L
emaste [Fri, 5 May 2017 17:35:05 +0000 (17:35 +0000)]
bsdgrep: don't ouptut matches with -c, -l, -L

Refactoring done in r317703 broke -c, -l, and -L flags implying
suppression of match printing.  Fortunately this is just a matter of not
doing any printing of the resulting matches and context printing was not
broken in this refactoring.

Add some regression tests since this area may still see further
refactoring, include different context flags as well even though they
were not broken in this case.

PR: 219077
Submitted by: Kyle kevans91@ksu.edu
Reported by: markj
Reviewed by: cem, ngie
Differential Revision: https://reviews.freebsd.org/D10607

7 years agoFix some grammar, fix some markup, bump copyright year, provide more
kib [Fri, 5 May 2017 17:23:57 +0000 (17:23 +0000)]
Fix some grammar, fix some markup, bump copyright year, provide more
exact claims in some cases.

Discussed with: bde (most parts)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoUse pmap_invalidate_cache() to implement wbinvd_on_all_cpus().
markj [Fri, 5 May 2017 17:22:00 +0000 (17:22 +0000)]
Use pmap_invalidate_cache() to implement wbinvd_on_all_cpus().

Suggested by: jhb
X-MFC with: r317651

7 years agoShow more fields in the IOCFact message
scottl [Fri, 5 May 2017 17:01:54 +0000 (17:01 +0000)]
Show more fields in the IOCFact message

7 years agocxgbe(4): Update the VF device ids too. This should have been part
np [Fri, 5 May 2017 16:52:25 +0000 (16:52 +0000)]
cxgbe(4):  Update the VF device ids too.  This should have been part
of r317820.

Reported by: jhb@
MFC after: 1 week
Sponsored by: Chelsio Communications

7 years agoRelax r317696 locking to not drain taskqueue under the lock.
mav [Fri, 5 May 2017 16:51:53 +0000 (16:51 +0000)]
Relax r317696 locking to not drain taskqueue under the lock.

MFC after: 11 days

7 years agoarch(7): add a table of per-arch initial/final FreeBSD version
emaste [Fri, 5 May 2017 16:40:45 +0000 (16:40 +0000)]
arch(7): add a table of per-arch initial/final FreeBSD version

Reviewed by: kib, wblock
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10573

7 years agoUFS fs.h: clear warning from use in makefs(1)
emaste [Fri, 5 May 2017 15:26:55 +0000 (15:26 +0000)]
UFS fs.h: clear warning from use in makefs(1)

makefs(1) has a number of signedness warnings (when built with higher
WARNS), most of which can be addressed by careful application of casts
in makefs itself.

There is one case where a signedness warning arises from the blksize
macro, so must be addressed in the macro itself.

Reviewed by: kib, mckusick
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10589

7 years agoIfdef out a redundant if statement when INET6 is disabled.
cy [Fri, 5 May 2017 14:34:09 +0000 (14:34 +0000)]
Ifdef out a redundant if statement when INET6 is disabled.

MFC after: 1 week

7 years agoMFV r317581: less v491.
delphij [Fri, 5 May 2017 14:33:39 +0000 (14:33 +0000)]
MFV r317581: less v491.

MFC after: 1 month

7 years agoFix for use after free in the LinuxKPI.
hselasky [Fri, 5 May 2017 14:09:44 +0000 (14:09 +0000)]
Fix for use after free in the LinuxKPI.

Background:
The same VM object might be shared by multiple processes and the
mm_struct is usually freed when a process exits.

Grab a reference on the mm_struct while the vmap is in the
linux_vma_head list in case the first process which inserted a VM
object has exited.

Tested by: kwm @
MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoUpgrade to OpenPAM Resedacea.
des [Fri, 5 May 2017 13:31:25 +0000 (13:31 +0000)]
Upgrade to OpenPAM Resedacea.

MFC after: 3 weeks

7 years agoAdd reclaim_pv_chunk on arm64. This is based on the amd64 code so should
andrew [Fri, 5 May 2017 10:01:27 +0000 (10:01 +0000)]
Add reclaim_pv_chunk on arm64. This is based on the amd64 code so should
operate similarly, other than not needing the delayed invalidation.

It has been tested with artificial injection of vm_page_alloc failures
while running 'sort /dev/zero'.

Reviewed by: alc, kib
MFC after: 1 week
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D10574

7 years agohyperv/kbd: Channel read expects non-NULL channel argument.
sephe [Fri, 5 May 2017 03:28:30 +0000 (03:28 +0000)]
hyperv/kbd: Channel read expects non-NULL channel argument.

MFC after: now
Sponsored by: Microsoft

7 years agocxgbe(4): Update the list of PCIe devices claimed by the driver. At
np [Fri, 5 May 2017 00:54:23 +0000 (00:54 +0000)]
cxgbe(4): Update the list of PCIe devices claimed by the driver.  At
this point any board with a T6 should just work.

Obtained from: Chelsio Communications
MFC after: 1 week
Sponsored by: Chelsio Communications

7 years agoReduce synaptics touch sensitivity
wulf [Thu, 4 May 2017 23:19:27 +0000 (23:19 +0000)]
Reduce synaptics touch sensitivity

Increase hw.psm.synaptics.min_pressure default value from 16 to 32
to nearly match Linux driver (30-35 hysteresis loop).
This makes libinput tap detection more reliable.

Reviewed by: gonzo
Approved by: gonzo (mentor)
MFC after: 2 weeks

7 years agopsm(4): Remove sys/libkern.h header inclusion
wulf [Thu, 4 May 2017 23:17:21 +0000 (23:17 +0000)]
psm(4): Remove sys/libkern.h header inclusion

It is already included via sys/systm.h

Reviewed by: gonzo
Approved by: gonzo (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D10266

7 years agoSet predefined logical touchpad sizes for several ancient Elan hw v.2
wulf [Thu, 4 May 2017 23:12:45 +0000 (23:12 +0000)]
Set predefined logical touchpad sizes for several ancient Elan hw v.2
models. This change is based on Linux driver.
Determine logical trace size. It used for calculation of touch sizes
in surface units for MT-protocol type B evdev reports.

Reviewed by: gonzo
Approved by: gonzo (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D10266

7 years agoReport 3-rd and 4-th fingers as first finger for Elan hw v.2 and v.3 as
wulf [Thu, 4 May 2017 23:08:55 +0000 (23:08 +0000)]
Report 3-rd and 4-th fingers as first finger for Elan hw v.2 and v.3 as
Linux does. It should not affect gesture processing in current state as it
ignores finger coords on 3-finger tap detection but it should make evdev
reports looking more Linux-alike.

Reviewed by: gonzo
Approved by: gonzo
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D10266

7 years agoEnable palm detection on two finger touches for multitouch trackpads.
wulf [Thu, 4 May 2017 23:04:52 +0000 (23:04 +0000)]
Enable palm detection on two finger touches for multitouch trackpads.

Reviewed by: gonzo
Approved by: gonzo (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D10266

7 years agopsm(4): reduce cursor jumping on palm detection
wulf [Thu, 4 May 2017 23:02:34 +0000 (23:02 +0000)]
psm(4): reduce cursor jumping on palm detection

This is done with discarding pointer movements rather then mouse packets

Reviewed by: gonzo
Approved by: gonzo (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D10266

7 years agoAdjust Elantech palm width threshold to nearly match synaptics defaults
wulf [Thu, 4 May 2017 22:53:45 +0000 (22:53 +0000)]
Adjust Elantech palm width threshold to nearly match synaptics defaults

Reviewed by: gonzo
Approved by: gonzo (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D10266

7 years agoReduce default tap_min_queue size for Elan touchpads
wulf [Thu, 4 May 2017 22:51:22 +0000 (22:51 +0000)]
Reduce default tap_min_queue size for Elan touchpads

Elan hw v.4 touchpads often sends touchpad release packet right after
touchpad touch one. Most probably this happens due to PS/2 limited bandwith.
Reducing of tap_min_queue size to 1 makes multifinger tap detection
more reliable in this case.

Reviewed by: gonzo
Approved by: gonzo (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D10266

7 years agoFix triple-finger taps reported as double-finger for Elan hw v.4 touchpads
wulf [Thu, 4 May 2017 22:47:18 +0000 (22:47 +0000)]
Fix triple-finger taps reported as double-finger for Elan hw v.4 touchpads

Wait for all advertised head packets after status packet have been received.
This fixes rare but quite annoying issue in Elan hw v.4 touchpads support
when triple-finger taps are reported as double-finger taps under several
circumstances.

Reviewed by: gonzo
Approved by: gonzo (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D10266

7 years agoPull in r302183 from upstream llvm trunk (by Krzysztof Parzyszek):
dim [Thu, 4 May 2017 21:40:16 +0000 (21:40 +0000)]
Pull in r302183 from upstream llvm trunk (by Krzysztof Parzyszek):

  [PPC] When restoring R30 (PIC base pointer), mark it as <def>

  This happened on the PPC32/SVR4 path and was discovered when building
  FreeBSD on PPC32. It was a typo-class error in the frame lowering
  code.

  This fixes PR26519.

Reported by: Mark Millard
PR: 206990
MFC after: 3 days

7 years agoProvide introduction for the arch(7) manpage.
kib [Thu, 4 May 2017 21:31:50 +0000 (21:31 +0000)]
Provide introduction for the arch(7) manpage.

Start with some words about linear address space and its layout, then
explain pointers models and ABIs, providing explanation to the
structure of the tables.

Reviewed by: emaste, imp
'Future-proof' cheri wording by: brooks
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D10596

7 years agoThe nandsim(4) simulator driver doesn't have any protection against
glebius [Thu, 4 May 2017 20:42:31 +0000 (20:42 +0000)]
The nandsim(4) simulator driver doesn't have any protection against
races at least in its ioctl handler, and at the same time it creates
device entry with 0666 permissions.

To plug possible issues in it:
- Mark it as needing Giant.
- Switch device mode to 0600.

Submitted by: C Turt
Reviewed by: imp
MFC after: 1 week
Security: Possible double free in ioctl handler