dragonfly.git
7 years agosys/vfs/hammer: Fix comments
Tomohiro Kusumi [Sat, 12 Nov 2016 15:45:04 +0000 (00:45 +0900)]
sys/vfs/hammer: Fix comments

7 years agosys/vfs/hammer: Remove wrong comment
Tomohiro Kusumi [Sat, 12 Nov 2016 15:44:51 +0000 (00:44 +0900)]
sys/vfs/hammer: Remove wrong comment

7 years agosys/vfs/hammer: Use HAMMER_HEAD_DOALIGN()
Tomohiro Kusumi [Sat, 12 Nov 2016 09:57:41 +0000 (18:57 +0900)]
sys/vfs/hammer: Use HAMMER_HEAD_DOALIGN()

7 years agosbin/hammer: sbin/hammer: Fix hammer show-undo output format
Tomohiro Kusumi [Sat, 12 Nov 2016 09:48:50 +0000 (18:48 +0900)]
sbin/hammer: sbin/hammer: Fix hammer show-undo output format

Add some ondisk redo fields.

7 years agosys/vfs/hammer: Change unused ondisk redo_mtime to reserved
Tomohiro Kusumi [Sat, 12 Nov 2016 09:26:13 +0000 (18:26 +0900)]
sys/vfs/hammer: Change unused ondisk redo_mtime to reserved

It was never used after added in 6048b411 in 2010.

7 years agoif_iwm - Move iwm_read_firmware() call into iwm_attach().
Imre Vadász [Sat, 12 Nov 2016 12:41:49 +0000 (13:41 +0100)]
if_iwm - Move iwm_read_firmware() call into iwm_attach().

* We should load the firmware exactly once before the driver really
  initializes the hardware the first time, and unload it at detach time.
  There is no need to retrieve the firmware during execution of
  iwm_mvm_load_ucode_wait_alive(), we should make sure we already have the
  firmware data at hand before that.

* The existing sc_preinit_hook code fails to deal with the case where
  if_iwm is loaded by the loader (or is statically linked) and the
  firmware needs to be loaded from disk. So we can just call
  iwm_read_firmware() from iwm_attach() directly.

* A separate solution will have to be added to properly defer the firmware
  loading during bootup, until the necessary filesystem is mounted.

7 years agoDo 3b5eca529baf58ea74a485139963552cc4c1d977 a bit better.
Sascha Wildner [Sat, 12 Nov 2016 11:45:01 +0000 (12:45 +0100)]
Do 3b5eca529baf58ea74a485139963552cc4c1d977 a bit better.

FWIW, keep the NO_CRYPT dependency in lib/libcrypt for various sources.

7 years agoif_iwm - Attach to new AC3168 and AC8265 chipsets (untested).
Imre Vadász [Fri, 11 Nov 2016 20:09:05 +0000 (21:09 +0100)]
if_iwm - Attach to new AC3168 and AC8265 chipsets (untested).

7 years agoiwmfw - Add version 22 firmwares for AC3168 and AC8265 chipsets.
Imre Vadász [Fri, 11 Nov 2016 20:08:29 +0000 (21:08 +0100)]
iwmfw - Add version 22 firmwares for AC3168 and AC8265 chipsets.

7 years agosbin/hammer: Fix hammer show-undo output format
Tomohiro Kusumi [Sat, 12 Nov 2016 06:25:41 +0000 (15:25 +0900)]
sbin/hammer: Fix hammer show-undo output format

The whole size should be in %d since data size is in %d as well.

7 years agosys/vfs/hammer: Add hammer_xlate_to_undo()
Tomohiro Kusumi [Sat, 12 Nov 2016 05:37:26 +0000 (14:37 +0900)]
sys/vfs/hammer: Add hammer_xlate_to_undo()

7 years agosbin/hammer: Refactor left/right boundary elms in hammer show
Tomohiro Kusumi [Sat, 12 Nov 2016 04:11:10 +0000 (13:11 +0900)]
sbin/hammer: Refactor left/right boundary elms in hammer show

hammer show doesn't need to pass around pointers to left/right
boundary elms in every function while walking the B-Tree.

Left/right elms are there to test whether a B-Tree node in
question fits in boundaries defined by its parent, which means
that hammer show always requires the right elm be (left+1), but
not some random elm after the left elm. Because of this, it
only needs to pass around the left elm.

The code is more efficient plus look better without bunch of
left/right stuff.

7 years agosbin/hammer: Cleanup zone statistics
Tomohiro Kusumi [Fri, 11 Nov 2016 18:23:52 +0000 (03:23 +0900)]
sbin/hammer: Cleanup zone statistics

7 years agosbin/hammer: Cleanup hammer show-undo
Tomohiro Kusumi [Fri, 11 Nov 2016 18:14:49 +0000 (03:14 +0900)]
sbin/hammer: Cleanup hammer show-undo

7 years agosbin/hammer: Make hammer show-undo support zone statistics
Tomohiro Kusumi [Fri, 11 Nov 2016 18:09:39 +0000 (03:09 +0900)]
sbin/hammer: Make hammer show-undo support zone statistics

7 years agosys/vfs/hammer: Add HAMMER_UNDO_DOALIGN()
Tomohiro Kusumi [Wed, 9 Nov 2016 15:56:25 +0000 (00:56 +0900)]
sys/vfs/hammer: Add HAMMER_UNDO_DOALIGN()

The only reason it's "DOALIGN" instead of just "ALIGN" is
because that's how macros have been named in HAMMER1/2.
"ALIGN" macros represent alignment size.

7 years agosbin/hammer: Cleanup blockmap
Tomohiro Kusumi [Wed, 9 Nov 2016 15:41:31 +0000 (00:41 +0900)]
sbin/hammer: Cleanup blockmap

7 years agodrm/linux: Add clamp_val()
François Tigeot [Fri, 11 Nov 2016 11:25:55 +0000 (12:25 +0100)]
drm/linux: Add clamp_val()

Obtained-from: FreeBSD

7 years agodrm/linux: Add ktime_get_boottime and ktime_ms_delta()
François Tigeot [Fri, 11 Nov 2016 11:09:29 +0000 (12:09 +0100)]
drm/linux: Add ktime_get_boottime and ktime_ms_delta()

7 years agogcc50: Install liblto_plugin.so as +x.
zrj [Fri, 11 Nov 2016 07:17:44 +0000 (09:17 +0200)]
gcc50: Install liblto_plugin.so as +x.

Sad but this limitation in gcc driver requires that utility be executable.
This matches how it is done on standard installations, so follow along.
Some ports rely on gcc -print-prog-name=liblto_plugin.so working.

7 years agobuild: Suppress exessive echoing.
zrj [Fri, 11 Nov 2016 07:02:07 +0000 (09:02 +0200)]
build: Suppress exessive echoing.

7 years agoLIBPRIV: Add common PRIVATELIB_LDFLAGS definitions.
zrj [Wed, 9 Nov 2016 17:14:52 +0000 (19:14 +0200)]
LIBPRIV: Add common PRIVATELIB_LDFLAGS definitions.

Simply being able to change it in two places is easier than everywhere.
Also add PRIVATELIB_BLDFLAGS that is intended for bootsrapping only.
While there, perform some cleanup for dup entries.

7 years agoLIBPRIV: Introduce PRIVATELIB knob (just like INTERNALLIB).
zrj [Wed, 9 Nov 2016 15:36:05 +0000 (17:36 +0200)]
LIBPRIV: Introduce PRIVATELIB knob (just like INTERNALLIB).

Collect common private libraries path handling bits into share/mk/bsd.lib.mk.
It is cleaner this way, prevents issues like manual paths and/or ignoring stale
.depend for /usr/obj/usr/src/world_x86_64/usr/lib/priv/priv/libprivate_ncurses.a

7 years agoflex: Break the hardlinks to fix quickworld issues.
zrj [Wed, 9 Nov 2016 10:25:23 +0000 (12:25 +0200)]
flex: Break the hardlinks to fix quickworld issues.

Upon repeated quickworld run when install -C installs the libfl.a it breaks
the previous hardlink and retrigers relink for anything that depends on -ll.

Solve this by changing logic to install compat libs for install target only.
During buildworld only main ${LIBL} should be used where needed.

Fix a single case where -lfl was used in binutils. Add missing DPADD too.

7 years agoflex: Rename and install the main libl.a as primary one.
zrj [Wed, 9 Nov 2016 10:12:41 +0000 (12:12 +0200)]
flex: Rename and install the main libl.a as primary one.

libfl and libln are only used as compat ones for external sources linkage.
Whole base makefile system uses the ${LIBL}.

7 years agosys/vfs/hammer: Add HAMMER_ZONE_LAYER2_NEXT_OFFSET()
Tomohiro Kusumi [Wed, 9 Nov 2016 13:06:18 +0000 (22:06 +0900)]
sys/vfs/hammer: Add HAMMER_ZONE_LAYER2_NEXT_OFFSET()

Note that this is different from HAMMER_BLOCKMAP_LAYER2_OFFSET().
HAMMER_BLOCKMAP_LAYER2_OFFSET() is an offset of layer2 entry within
a big-block for layer2, but not zone offset itself.

7 years agosys/vfs/hammer: Add HAMMER_ZONE_LAYER1_NEXT_OFFSET()
Tomohiro Kusumi [Wed, 9 Nov 2016 12:52:21 +0000 (21:52 +0900)]
sys/vfs/hammer: Add HAMMER_ZONE_LAYER1_NEXT_OFFSET()

Note that this is different from HAMMER_BLOCKMAP_LAYER1_OFFSET().
HAMMER_BLOCKMAP_LAYER1_OFFSET() is an offset of layer1 entry within
a big-block for layer1, but not zone offset itself.

7 years agobsd.crunchgen.mk: Sync with FreeBSD.
zrj [Mon, 7 Nov 2016 12:33:52 +0000 (14:33 +0200)]
bsd.crunchgen.mk: Sync with FreeBSD.

This finally allows not to relink rescue image if there are no changes and
have clean stage of "4d: building everything.."!
Helps a lot on LTO quick rebuilds.

While there, remove hack from crunchgen(1), it no longer should be needed.
Please report build races if any.

Taken-from: FreeBSD

7 years agobsd.crunchgen.mk: Split few monolitic targets.
zrj [Mon, 7 Nov 2016 11:32:11 +0000 (13:32 +0200)]
bsd.crunchgen.mk: Split few monolitic targets.

For easier debug.

Taken-from: FreeBSD

7 years agobsd.crunchgen.mk: Simplify mk logic a bit.
zrj [Mon, 7 Nov 2016 11:12:54 +0000 (13:12 +0200)]
bsd.crunchgen.mk: Simplify mk logic a bit.

Just provide defaults if needed.

7 years agobsd.crunchgen.mk: Remove dub handling of CANONICALOBJDIR.
zrj [Mon, 7 Nov 2016 10:40:29 +0000 (12:40 +0200)]
bsd.crunchgen.mk: Remove dub handling of CANONICALOBJDIR.

It is already handled in bsd.obj.mk.
While there, drop non functional NO_DEBUG_FILES and update bsd.README.

7 years agobsd.crunchgen.mk: No longer exclude -P option.
zrj [Mon, 7 Nov 2016 08:48:16 +0000 (10:48 +0200)]
bsd.crunchgen.mk: No longer exclude -P option.

It was used only when fmake.
While there, do not hardcode crunchgen name and add env handling.

Taken-from: FreeBSD

7 years agobsd.crunchgen.mk: Use single style for variables.
zrj [Mon, 7 Nov 2016 08:40:22 +0000 (10:40 +0200)]
bsd.crunchgen.mk: Use single style for variables.

No functional change.

7 years agoif_iwm - Advertise full-offload scan support, fixes scan while associated.
Imre Vadász [Mon, 7 Nov 2016 21:02:31 +0000 (22:02 +0100)]
if_iwm - Advertise full-offload scan support, fixes scan while associated.

* This avoids the firmware panics previously experienced when starting a
  wlan scan (e.g. with "ifconfig wlan0 scan" or "scan" command in a
  wpa_supplicant user-interface), while associated to an AP.

7 years agowlan - Import initial full-offload scan support from FreeBSD.
Imre Vadász [Mon, 7 Nov 2016 20:45:45 +0000 (21:45 +0100)]
wlan - Import initial full-offload scan support from FreeBSD.

This is a very simple addition to the net80211 scan support.

It doesn't implement a replacement scan interface - it just disables
the pieces that we should disable to make this lifecycle a bit
more managable.

There's more work to come before full scan offload support is available
but it should be good enough for driver work.

* add a flag to say "full offload"
* don't do probe requests when scanning full-offload - firmware can do that
* don't do powersave transitions and buffering - firmware can do that
* don't abort a background scan upon reception of a single packet.
  Full offload drivers don't need this behaviour - they do it in firmware.

Taken-From: FreeBSD (svn r307602, r308007 and r308008)

7 years agosys/vfs/hammer: Use HAMMER_BUFSIZE_DOALIGN() and variants
Tomohiro Kusumi [Mon, 7 Nov 2016 15:12:54 +0000 (00:12 +0900)]
sys/vfs/hammer: Use HAMMER_BUFSIZE_DOALIGN() and variants

This should have been in bbc5e78b (failed to catch these).

7 years agosys/vfs/hammer: Cleanups
Tomohiro Kusumi [Mon, 7 Nov 2016 15:06:43 +0000 (00:06 +0900)]
sys/vfs/hammer: Cleanups

7 years agosys/vfs/hammer: Add HAMMER_BIGBLOCK_DOALIGN()
Tomohiro Kusumi [Mon, 7 Nov 2016 14:53:08 +0000 (23:53 +0900)]
sys/vfs/hammer: Add HAMMER_BIGBLOCK_DOALIGN()

The only reason it's "DOALIGN" instead of just "ALIGN" is
because that's how macros have been named in HAMMER1/2.
"ALIGN" macros represent alignment size.

7 years agokernel - Attempt to fix cluster pbuf deadlock on recursive filesystems
Matthew Dillon [Tue, 8 Nov 2016 02:56:34 +0000 (18:56 -0800)]
kernel - Attempt to fix cluster pbuf deadlock on recursive filesystems

* Change global pbuf count limits (used primarily for clustered I/O) to
  per-mount and per-device limits.  The per-mount / per-device limit
  is set to nswbuf_kva / 10, allowing 10 different entities to obtain
  pbufs concurrently without interference.

* This change goes a long way towards fixing deadlocks that could occur
  with the old global system (a global limit of nswbuf_kva / 2) when
  the I/O system recurses through a virtual block device or filesystem.
  Two examples of virtual block devices are the 'vn' device and the crypto
  layer.

* We also note that even normal filesystem read and write I/O strategy calls
  will recurse at least once to dive the underlying block device.  DFly also
  had issues with pbuf hogging by one mount causing unnecessary stalls
  in other mounts.  This fix also prevents pbuf hogging.

* Remove unused internal O_MAPONREAD flag.

Reported-by: htse, multiple
Testing-by: htse, dillon
7 years agokernel - Add nvme to the default kernel build
Matthew Dillon [Sun, 6 Nov 2016 19:55:45 +0000 (11:55 -0800)]
kernel - Add nvme to the default kernel build

* Add the nvme disk driver to the default kernel build, it no longer
  needs to be loaded as a module.

7 years agosbin/hammer: Cleanup alloc_blockmap()
Tomohiro Kusumi [Mon, 7 Nov 2016 12:04:41 +0000 (21:04 +0900)]
sbin/hammer: Cleanup alloc_blockmap()

Layer1 could be assertion.
It's essentially the same as what 0d1f6085 in 2015 checks.

7 years agosbin/hammer: Add another condition to assert_volume_offset()
Tomohiro Kusumi [Sun, 6 Nov 2016 14:14:06 +0000 (23:14 +0900)]
sbin/hammer: Add another condition to assert_volume_offset()

which is kinda obvious and expected to be false on newfs time.

7 years agosbin/hammer: Split alloc_bigblock() into two functions [2/2]
Tomohiro Kusumi [Sun, 6 Nov 2016 14:29:54 +0000 (23:29 +0900)]
sbin/hammer: Split alloc_bigblock() into two functions [2/2]

This function is currently only used by zone-3, but it's actually
only usable by zone-3 from the way it's implemented, so rename it
to alloc_undo_bigblock() and get rid of zone argument.

The way blockmap offsets (in root volume) get updated for zone-3
differs from other zones like 8/9/10/11, and this function which
doesn't update blockmap offsets on allocation only works against
zone-3.

7 years agosbin/hammer: Split alloc_bigblock() into two functions [1/2]
Tomohiro Kusumi [Sun, 6 Nov 2016 13:51:09 +0000 (22:51 +0900)]
sbin/hammer: Split alloc_bigblock() into two functions [1/2]

For zone-4, all you can (need to) do is increment offset by 8MB,
so split alloc_bigblock() into bootstrap_bigblock() for zone-4 and
alloc_bigblock() for zone-3. It's easier to understand this way.

7 years agoAdjust various things after the removal of secure/.
Sascha Wildner [Sun, 6 Nov 2016 23:08:49 +0000 (00:08 +0100)]
Adjust various things after the removal of secure/.

* Fix etc/Makefile: This brings back installation of /etc/ssh_config
    and /etc/sshd_config to our IMG/ISO.

* Add back DES and Blowfish functions to libcrypt.

* Remove installation of CA.pl/CA.sh. They don't seem to be part of
  LibreSSL.

* Remove obsolete paths from whereis(1).

* Adjust hier(7) manual page.

* Adjust openssh upgrade instructions.

* While here, fix a typo in Makefile.ssh.common.

7 years agoif_iwm - The iwm_prepare_card_hw() in iwm_attach() is only needed on 8K hw.
Imre Vadász [Sun, 6 Nov 2016 21:21:22 +0000 (22:21 +0100)]
if_iwm - The iwm_prepare_card_hw() in iwm_attach() is only needed on 8K hw.

* Doing the iwm_prepare_card_hw() call in iwm_attach() only on Family 8000
  hardware matches the code in Linux iwlwifi.

* While there remove DEFAULT_MAX_TX_POWER definition which is unused, and
  has a value different from IWL_DEFAULT_MAX_TX_POWER in iwlwifi.

7 years agoif_iwm - Use rates given in struct ieee80211_txparam for non-data transfers.
Imre Vadász [Sun, 6 Nov 2016 16:44:56 +0000 (17:44 +0100)]
if_iwm - Use rates given in struct ieee80211_txparam for non-data transfers.

* Make iwm_tx_fill_cmd() just return the uint8_t rate, to avoid looking up
  the firmware rate-index for DATA transfers.

Taken-From: FreeBSD (svn r306286)

7 years agoif_iwm - Update firmware rs table, instead of indexing the table in tx cmds.
Imre Vadász [Sun, 6 Nov 2016 15:25:54 +0000 (16:25 +0100)]
if_iwm - Update firmware rs table, instead of indexing the table in tx cmds.

* Rather than providing a non-zero index into the firmware RS table,
  we should always use index 0 and update the firmware RS table whenever
  our chosen tx rate for data-frames changes.

* Send IWM_LQ_CMD updates when the tx rate gets updated by the net80211
  rate control (which is after we tell the tx status to the net80211
  rate-control in iwm_mvm_rx_tx_cmd_single()).

* Disregard frames transferred with a different tx rate than the currently
  selected rate for the rate-control calculations. This way we avoid
  counting management frames (which are sent at a slow, and fixed rate),
  as well as frames we added to the tx queue just before a new IWM_LQ_CMD
  update took effect.

Inspired-By: Linux iwlwifi
7 years agobuild - Fix modifying operation to /usr/obj during installworld (2)
Matthew Dillon [Sun, 6 Nov 2016 19:24:00 +0000 (11:24 -0800)]
build - Fix modifying operation to /usr/obj during installworld (2)

* efi/boot1 needs the same treatment as the last commit.

Reported-by: ivadasz
7 years agobuild - Fix modifying operation to /usr/obj during installworld.
Matthew Dillon [Sun, 6 Nov 2016 18:56:35 +0000 (10:56 -0800)]
build - Fix modifying operation to /usr/obj during installworld.

* The build for /usr/src/sys/boot/efi/loader is incomplete.  The
  installworld step tries to build the last piece.  Add the piece to
  all: to properly build it during the build phase and not the
  install phase.

7 years agosys/vfs/hammer: Add HAMMER_DATA_DOALIGN() and variants
Tomohiro Kusumi [Sun, 6 Nov 2016 06:17:37 +0000 (15:17 +0900)]
sys/vfs/hammer: Add HAMMER_DATA_DOALIGN() and variants

The only reason it's "DOALIGN" instead of just "ALIGN" is
because that's how macros have been named in HAMMER1/2.
"ALIGN" macros represent alignment size.

7 years agosys/vfs/hammer: Add HAMMER_BUFSIZE_DOALIGN() and variants
Tomohiro Kusumi [Sun, 6 Nov 2016 06:35:28 +0000 (15:35 +0900)]
sys/vfs/hammer: Add HAMMER_BUFSIZE_DOALIGN() and variants

The only reason it's "DOALIGN" instead of just "ALIGN" is
because that's how macros have been named in HAMMER1/2.
"ALIGN" macros represent alignment size.

7 years agosys/vfs/hammer: Add HAMMER_BLOCKMAP_LAYER2_DOALIGN()
Tomohiro Kusumi [Sun, 6 Nov 2016 05:47:26 +0000 (14:47 +0900)]
sys/vfs/hammer: Add HAMMER_BLOCKMAP_LAYER2_DOALIGN()

The only reason it's "DOALIGN" instead of just "ALIGN" is
because that's how macros have been named in HAMMER1/2.
"ALIGN" macros represent alignment size.

7 years agosbin/hammer: Add a TODO comment for hammer recover
Tomohiro Kusumi [Sun, 6 Nov 2016 05:20:12 +0000 (14:20 +0900)]
sbin/hammer: Add a TODO comment for hammer recover

The way hammer recover simply walks through zone-2 offset from
0 to the end of the volume is inefficient.

Since we know most big-blocks are not for zone-8 (B-Tree zone),
most of the time and I/O spent for testing B-Tree nodes is wasted.
If zone-2 offset can be reverse mapped to zone-X, it no longer
needs to always call recover_top() assuming offsets are for
B-Tree nodes when we know it's mostly wrong.

Reverse mapping can also avoid possible misinterpretation of
zone-2 buffers (i.e. wrong cast to hammer_node_ondisk_t).

7 years agotic(1): Add missing beforedepend for termsort.c.
zrj [Sun, 6 Nov 2016 08:25:19 +0000 (10:25 +0200)]
tic(1): Add missing beforedepend for termsort.c.

Noticed-by: swildner
7 years agoinstaller - Enhance test_storage program
Antonio Huete Jimenez [Sat, 5 Nov 2016 17:56:27 +0000 (18:56 +0100)]
installer - Enhance test_storage program

- Warn when run as non-root.
- Actually print detected disks after execution.

7 years agoinstaller - Reorganize test directory a bit
Antonio Huete Jimenez [Sat, 5 Nov 2016 14:22:07 +0000 (15:22 +0100)]
installer - Reorganize test directory a bit

7 years agodoc - Document 'crypt' option in fstab(5)
Matthew Dillon [Sat, 5 Nov 2016 19:36:31 +0000 (12:36 -0700)]
doc - Document 'crypt' option in fstab(5)

* The 'crypt' was documented in swapon(8) but most people would probably
  look for it in fstab(5), so put it there too.

7 years agoboot: Use snprintf() when filling command_errbuf[] w/ dynamic content.
Sascha Wildner [Sat, 5 Nov 2016 07:28:51 +0000 (08:28 +0100)]
boot: Use snprintf() when filling command_errbuf[] w/ dynamic content.

Taken-from: FreeBSD

7 years agoSync zoneinfo database with tzdata2016i from ftp://ftp.iana.org/tz/releases
Sascha Wildner [Fri, 4 Nov 2016 18:49:54 +0000 (19:49 +0100)]
Sync zoneinfo database with tzdata2016i from ftp://ftp.iana.org/tz/releases

* Pacific/Tongatapu begins DST on 2016-11-06 at 02:00, ending on
    2017-01-15 at 03:00.  Assume future observances in Tonga will be
    from the first Sunday in November through the third Sunday in
    January, like Fiji.  (Thanks to Pulu ʻAnau.)  Switch to numeric
    time zone abbreviations for this zone.

* Northern Cyprus is now +03 year round, causing a split in Cyprus
    time zones starting 2016-10-30 at 04:00.  This creates a zone
    Asia/Famagusta.  (Thanks to Even Scharning and Matt Johnson.)

* Antarctica/Casey switched from +08 to +11 on 2016-10-22.
    (Thanks to Steffen Thorsen.)

* Several corrections were made for pre-1975 time stamps in Italy.
    These affect Europe/Malta, Europe/Rome, Europe/San_Marino, and
    Europe/Vatican.

  First, the 1893-11-01 00:00 transition in Italy used the new UT
    offset (+01), not the old (+00:49:56).  (Thanks to Michael
    Deckers.)

  Second, rules for daylight saving in Italy were changed to agree
    with Italy's National Institute of Metrological Research (INRiM)
    except for 1944, as follows (thanks to Pierpaolo Bernardi, Brian
    Inglis, and Michael Deckers):

    The 1916-06-03 transition was at 24:00, not 00:00.

    The 1916-10-01, 1919-10-05, and 1920-09-19 transitions were at
      00:00, not 01:00.

    The 1917-09-30 and 1918-10-06 transitions were at 24:00, not
      01:00.

    The 1944-09-17 transition was at 03:00, not 01:00.  This
      particular change is taken from Italian law as INRiM's table,
      (which says 02:00) appears to have a typo here.  Also, keep the
      1944-04-03 transition for Europe/Rome, as Rome was controlled by
      Germany then.

    The 1967-1970 and 1972-1974 fallback transitions were at 01:00,
      not 00:00.

7 years ago<sys/cdefs.h>/<machine/stdint.h>: Fix __STDC_VERSION__ macro.
Sascha Wildner [Fri, 4 Nov 2016 17:39:27 +0000 (18:39 +0100)]
<sys/cdefs.h>/<machine/stdint.h>: Fix __STDC_VERSION__ macro.

Noticed-by: zrj
7 years ago<netinet/ip.h>: Few style(9) fixes.
zrj [Fri, 4 Nov 2016 07:24:32 +0000 (09:24 +0200)]
<netinet/ip.h>: Few style(9) fixes.

Looks like IPTOS_CE and IPTOS_ECT were deprecated and should not be used.
Leave for now, still used by ip_ecn.c and ipfw2.c.
Same applies to _IP_VHL version.

No functional change.

7 years ago<netinet/ip.h>: Add ToS defs for RFC 2474 and 5865.
zrj [Fri, 4 Nov 2016 07:16:53 +0000 (09:16 +0200)]
<netinet/ip.h>: Add ToS defs for RFC 2474 and 5865.

While there, convert IPTOS_PREC macros to use IPTOS_DSCP definitions.

Taken-from: OpenBSD, FreeBSD(IPTOS_DSCP_VA)

7 years agonc(1): Adjust makefile and hook into buildworld.
zrj [Thu, 3 Nov 2016 17:19:09 +0000 (19:19 +0200)]
nc(1): Adjust makefile and hook into buildworld.

Given that nc(1) in dports is only installed when dports/libressl is used,
but not available when dports/openssl, it is useful to have base nc(1).
Also it makes a very good test case for LTO toolchain testing:
LTO + NOSHARED + libressl + openbsd compat layer + certain parts of libc.
Since base does not provide libprivate_tls lib, compile tls bits just for nc.

7 years agolibressl: Few local modifications for netcat.
zrj [Thu, 3 Nov 2016 17:15:43 +0000 (19:15 +0200)]
libressl: Few local modifications for netcat.

 * Exclude pledge(), has no use for us.
 * Make strtoport() static to prevent missing prototype warning.

No functional change for libprivate_crypto or libprivate_ssl.

7 years agogcc50: Hook missing source into the libgcc.a.
zrj [Fri, 4 Nov 2016 08:57:12 +0000 (10:57 +0200)]
gcc50: Hook missing source into the libgcc.a.

Missing hidden symbol __sfp_handle_exception.
Fixes linkage: gcc main.c -Wl,--whole-archive -Wl,-v -nostdlib -lgcc -lc

7 years agobuild - Fix bootstrap build for csh
Matthew Dillon [Fri, 4 Nov 2016 06:32:24 +0000 (23:32 -0700)]
build - Fix bootstrap build for csh

* Fix the bootstrap portion of the buildworld for csh on systems which are
  updated past the termcap library rename but do not yet have
  libprivate_crypto.

7 years agomd5 - Fix seg-fault
Matthew Dillon [Fri, 4 Nov 2016 06:31:53 +0000 (23:31 -0700)]
md5 - Fix seg-fault

* Fix seg-fault due to mixed API use.

Reported-by: marino, others
7 years agoif_iwm - Sync rs (rate-selection) API definitions from Linux iwlwifi.
Imre Vadász [Thu, 3 Nov 2016 20:49:05 +0000 (21:49 +0100)]
if_iwm - Sync rs (rate-selection) API definitions from Linux iwlwifi.

* While there clean up alignments and line wrapping in existing
  definitions for rs API in if_iwmreg.h

Taken-From: Linux iwlwifi

7 years agoif_iwm - Add iwm_mvm_send_lq_cmd() from Linux iwlwifi to if_iwm_util.c.
Imre Vadász [Thu, 3 Nov 2016 19:53:11 +0000 (20:53 +0100)]
if_iwm - Add iwm_mvm_send_lq_cmd() from Linux iwlwifi to if_iwm_util.c.

Taken-From: Linux iwlwifi

7 years agosbin/hammer: Fix wrong error message
Tomohiro Kusumi [Thu, 3 Nov 2016 15:30:26 +0000 (00:30 +0900)]
sbin/hammer: Fix wrong error message

It's supposed to be "does not match".

7 years agosbin/mount_hammer: Fix/cleanup test_volumes()
Tomohiro Kusumi [Thu, 3 Nov 2016 14:37:09 +0000 (23:37 +0900)]
sbin/mount_hammer: Fix/cleanup test_volumes()

The requirement of this function is basically the same as
__verify_volume() in sbin/hammer/ondisk.c, so make it
__verify_volume() based.

Note that this function doesn't necessarily print the real
reason mount(2) failed, as shown in a comment. This function
just takes a wild guess with sanity checks on volume header.
The real reason is likely to be in dmesg. This originally
didn't exist, but was added by 1a607e3e in 2009.

7 years agosbin/mount_hammer: Simplify ondisk verification
Tomohiro Kusumi [Thu, 3 Nov 2016 13:37:06 +0000 (22:37 +0900)]
sbin/mount_hammer: Simplify ondisk verification

Unlike sbin/hammer or sbin/newfs_hammer, sbin/mount_hammer
has no restriction regarding I/O size since it's readonly.
It doesn't have to be 16KB as long as I/O size meets the
requirement of read(2) over a raw block device.

7 years agosys/vfs/hammer: Add HAMMER_ENCODE_UNDO()
Tomohiro Kusumi [Thu, 3 Nov 2016 12:06:14 +0000 (21:06 +0900)]
sys/vfs/hammer: Add HAMMER_ENCODE_UNDO()

Add and use HAMMER_ENCODE_UNDO(offset) instead of
HAMMER_ZONE_ENCODE(HAMMER_ZONE_UNDO_INDEX, offset),
just like other ENCODE macros available for other zones.

Since zone-3 doesn't take volume# by design (see L136 of
sys/vfs/hammer/hammer_disk.h), HAMMER_ENCODE_UNDO() only
takes offset, but not (volume#, offset). In other words,
UNDO/REDO FIFO is in the root volume.

sys/vfs/hammer/hammer_disk.h
 * zone 1 (z,v,o): raw volume relative (offset 0 is the volume header)
 * zone 2 (z,v,o): raw buffer relative (offset 0 is the first buffer)
 * zone 3 (z,o): undo/redo fifo - fixed zone-2 offset array in volume header
 * zone 4 (z,v,o): freemap - only real blockmap
 * zone 8 (z,v,o): B-Tree - actually zone-2 address
 * zone 9 (z,v,o): meta - actually zone-2 address
 * zone 10 (z,v,o): large-data - actually zone-2 address
 * zone 11 (z,v,o): small-data - actually zone-2 address

7 years agobuild: Fix wrong DPADD for libcrypto.
zrj [Fri, 28 Oct 2016 07:43:03 +0000 (10:43 +0300)]
build: Fix wrong DPADD for libcrypto.

Follow up to 0fe46dc6296951eb138485d8c6b580bac0488fd8

7 years agobsd.libnames.mk: Remove outdated XXX.
zrj [Fri, 28 Oct 2016 07:34:34 +0000 (10:34 +0300)]
bsd.libnames.mk: Remove outdated XXX.

No longer applies after 0fe46dc6296951eb138485d8c6b580bac0488fd8

7 years agogcc47: Do not include empty header.
zrj [Thu, 27 Oct 2016 16:25:09 +0000 (19:25 +0300)]
gcc47: Do not include empty header.

Including this header only poisons and triggers ctype_members.cc to be recompiled
on every repeated quickworld together with relink of libstdc++ for no good reason.

7 years agotic(1): Restrict termsort.c hack to btools.
zrj [Thu, 27 Oct 2016 15:37:02 +0000 (18:37 +0300)]
tic(1): Restrict termsort.c hack to btools.

It is unclear why this was needed, for now just limit it to BOOTSTRAPPING case.

7 years agobsd.sys.mk: Exclude PROG from PHONY list.
zrj [Thu, 27 Oct 2016 14:30:09 +0000 (17:30 +0300)]
bsd.sys.mk: Exclude PROG from PHONY list.

This prevents surprises when any PROG would match anything in that list.
Was causing contantly relinking of patch(1) and fetch(1)!

7 years agoinstaller: Fix typo in handling null mounts array.
zrj [Thu, 27 Oct 2016 05:26:53 +0000 (08:26 +0300)]
installer: Fix typo in handling null mounts array.

This could have prevented to install on certain custom system layouts.

7 years agosys/vfs/hammer: Add ascii-art for volume layout
Tomohiro Kusumi [Thu, 3 Nov 2016 07:03:48 +0000 (16:03 +0900)]
sys/vfs/hammer: Add ascii-art for volume layout

7 years agosys/vfs/hammer: Fix terminology for undo fifo
Tomohiro Kusumi [Thu, 3 Nov 2016 05:51:32 +0000 (14:51 +0900)]
sys/vfs/hammer: Fix terminology for undo fifo

Always use "UNDO/REDO FIFO" whenever printf/manpage/etc refer to
undo in terms of HAMMER's zone-3 data structure, because that's
how it's been used originally.

But leave comments as they are now. There are tons of comments
that refer to UNDO, but not REDO when they could be UNDO/REDO,
but those mostly come from the fact that REDO was added later.

7 years agoif_iwm - Sync statistics API definitions with Linux iwlwifi.
Imre Vadász [Wed, 2 Nov 2016 21:08:28 +0000 (22:08 +0100)]
if_iwm - Sync statistics API definitions with Linux iwlwifi.

Taken-From: Linux iwlwifi

7 years agoBump __DragonFly_version after md/crypt/ressl conflict resolution
John Marino [Wed, 2 Nov 2016 14:54:36 +0000 (09:54 -0500)]
Bump __DragonFly_version after md/crypt/ressl conflict resolution

7 years ago<sys/cdefs.h>: Remove some duplicate definitions.
Sascha Wildner [Tue, 1 Nov 2016 23:14:40 +0000 (00:14 +0100)]
<sys/cdefs.h>: Remove some duplicate definitions.

7 years agoif_iwm - Cleanup mbufq draining. Add iwm_xmit_queue_drain() like in iwn(4).
Imre Vadász [Tue, 1 Nov 2016 15:34:14 +0000 (16:34 +0100)]
if_iwm - Cleanup mbufq draining. Add iwm_xmit_queue_drain() like in iwn(4).

* iwm_xmit_queue_drain() calls ieee80211_free_node(), removing a possible
  memory leak, compared to using just mbufq_drain().

* Remove duplicate mbufq_drain() from iwm_mvm_rm_sta(), this should be
  handled in the caller.

7 years agosys/vfs/hammer: Use HAMMER_OFF_{SHORT,LONG}_ENCODE()
Tomohiro Kusumi [Tue, 1 Nov 2016 12:44:06 +0000 (21:44 +0900)]
sys/vfs/hammer: Use HAMMER_OFF_{SHORT,LONG}_ENCODE()

HAMMER_OFF_XXX_ENCODE() macros cast result to hammer_off_t,
which is uint64_t, but makes no difference in these cases.

7 years agosbin/hammer: Fix print_blockmap() for non-root volume
Tomohiro Kusumi [Tue, 1 Nov 2016 11:34:05 +0000 (20:34 +0900)]
sbin/hammer: Fix print_blockmap() for non-root volume

It should work the same regardless of root/non-root,
though vol0_blockmap[] is empty for non-root volumes.

7 years agosbin/newfs_hammer: Fix print_volume() for non-root volume
Tomohiro Kusumi [Tue, 1 Nov 2016 11:31:29 +0000 (20:31 +0900)]
sbin/newfs_hammer: Fix print_volume() for non-root volume

It should work the same regardless of root/non-root.

7 years agoif_iwm - Use chan list from ieee80211_scan_state for scan, not ic_channels.
Imre Vadász [Tue, 1 Nov 2016 11:08:10 +0000 (12:08 +0100)]
if_iwm - Use chan list from ieee80211_scan_state for scan, not ic_channels.

* Limiting the channel list with "ifconfig wlan0 chanlist ..." now will
  actually set the list of channels scanned by iwm.

7 years agoif_iwm - Factor out and improve iwm_mvm_scan_rxon_flags() in if_iwm_scan.c.
Imre Vadász [Mon, 31 Oct 2016 23:34:28 +0000 (00:34 +0100)]
if_iwm - Factor out and improve iwm_mvm_scan_rxon_flags() in if_iwm_scan.c.

* Actually look at the first channel in the list. If it's a 2.4GHz channel,
  set IWM_PHY_BAND_24 flag. The IWM_PHY_BAND_5 flag is 0 anyway, so we
  don't need to look further.

* While there factor out the iwm_mvm_rrm_scan_needed() tlv capability check.

Taken-From: Linux iwlwifi

7 years agoif_iwm - Remove support for fw older than -17 and -22
Imre Vadász [Mon, 31 Oct 2016 20:44:12 +0000 (21:44 +0100)]
if_iwm - Remove support for fw older than -17 and -22

* iwm(4) didn't use any of these definitions yet, anyway.

Taken-From: Linux iwlwifi (commit 4b87e5af638b6056bd6c20b0954d09a5a58633be)

7 years agokernel - Add trackpoint and elantech mouse support (2)
Matthew Dillon [Mon, 31 Oct 2016 18:22:27 +0000 (11:22 -0700)]
kernel - Add trackpoint and elantech mouse support (2)

* Fix bitcount build issue.

7 years agokernel - Add trackpoint and elantech mouse support
Matthew Dillon [Mon, 31 Oct 2016 17:51:15 +0000 (10:51 -0700)]
kernel - Add trackpoint and elantech mouse support

* Add trackpoint and elantech mouse support, generally
  synchronizing psm code with FreeBSD.

Submitted-by: htse (Harald Brinkhof)
Taken-from: FreeBSD

7 years agosbin/newfs_hammer: Fix newfs_hammer(8) manpage
Tomohiro Kusumi [Mon, 31 Oct 2016 11:36:03 +0000 (20:36 +0900)]
sbin/newfs_hammer: Fix newfs_hammer(8) manpage

7 years agosbin/newfs_hammer: Fix remaining one from 3e7805d7
Tomohiro Kusumi [Mon, 31 Oct 2016 14:17:34 +0000 (23:17 +0900)]
sbin/newfs_hammer: Fix remaining one from 3e7805d7

7 years agosbin/newfs_hammer: Add printf for HAMMER version after formatting
Tomohiro Kusumi [Mon, 31 Oct 2016 11:43:23 +0000 (20:43 +0900)]
sbin/newfs_hammer: Add printf for HAMMER version after formatting

After the previous commit which didn't change actual outputs,
this commit adds a new line for HAMMER version. It should have
a separate line for HAMMER version in the beginning IMO.

7 years agosbin/newfs_hammer: Fix source for filesystem info after formatting
Tomohiro Kusumi [Sun, 30 Oct 2016 16:08:53 +0000 (01:08 +0900)]
sbin/newfs_hammer: Fix source for filesystem info after formatting

This commit changes source of outputs after formatting a fs,
but doesn't change outputs itself, as it should result the same.
(the only difference in when -d is specified for junk space)

Now outputs are based on ondisk fields that are to be written
back to backing storage, rather than global variables within
sbin/newfs_hammer/newfs_hammer.c.

It's better to use actual ondisk fields than other variables
to make it robust against possible changes in newfs_hammer in
the future (i.e. ondisk fields are always ondisk fields).

7 years agosbin/newfs_hammer: Replace hard-coded 512MB/1GB strings with sizetostr()
Tomohiro Kusumi [Sun, 30 Oct 2016 12:14:03 +0000 (21:14 +0900)]
sbin/newfs_hammer: Replace hard-coded 512MB/1GB strings with sizetostr()

7 years agosys/vfs/hammer: Add HAMMER_VOL_JUNK_SIZE/HAMMER_{MIN,MAX}_VOL_JUNK
Tomohiro Kusumi [Mon, 31 Oct 2016 14:15:50 +0000 (23:15 +0900)]
sys/vfs/hammer: Add HAMMER_VOL_JUNK_SIZE/HAMMER_{MIN,MAX}_VOL_JUNK

No functional difference. Just rename HAMMER_VOL_ALLOC to
HAMMER_VOL_JUNK_SIZE, as well as add HAMMER_{MIN,MAX}_VOL_JUNK
macros for max/min header junk space which are all the same.