dragonfly.git
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.

7 years agosbin/newfs_hammer: Add hidden -j option for header junk space
Tomohiro Kusumi [Sun, 30 Oct 2016 07:17:51 +0000 (16:17 +0900)]
sbin/newfs_hammer: Add hidden -j option for header junk space

There is 256KB header junk space (which includes volume header)
starting from offset 0 of the filesystem partition up until
where boot_area/memory_log starts, but the header junk space
beyond volume header isn't used for anything.

This commit adds -j option to specify header junk size smaller
than 256KB. -j option does exactly the same as how -b,-m,-u
options allow below low limit when -f is specified.

Don't mention this option in newfs_hammer(8) because there is
no reason for users to use this. The header junk space exists
only for future enhancement of volume header (though most likely
will never be used), so users should just stick with 256KB.

7 years agosbin/newfs_hammer: Add assertion for header junk space size
Tomohiro Kusumi [Sun, 30 Oct 2016 10:17:55 +0000 (19:17 +0900)]
sbin/newfs_hammer: Add assertion for header junk space size

HAMMER_VOL_ALLOC, which represents volume header junk space size,
includes space for the volume header itself, so it needs to be
at least as large as the volume header (1928 bytes).

7 years agoacpi/cst: Keep parsing rest of the GAS, even if the mwait hint is wrong.
Sepherosa Ziehau [Mon, 31 Oct 2016 12:47:00 +0000 (20:47 +0800)]
acpi/cst: Keep parsing rest of the GAS, even if the mwait hint is wrong.

The rest part of GAS contains useful bus mastering information.

Tested-by: dillon@
7 years agokernel - Fix a vty switch/history bug
Matthew Dillon [Mon, 31 Oct 2016 03:31:01 +0000 (20:31 -0700)]
kernel - Fix a vty switch/history bug

* Fail gracefully when a M_NOWAIT allocate of the history
  buffer fails.

Reported-by: Harald Brinkhof
7 years agoiwmfw - Update 7265D and 8000C firmwares to version 22.
Imre Vadász [Tue, 20 Sep 2016 20:43:58 +0000 (22:43 +0200)]
iwmfw - Update 7265D and 8000C firmwares to version 22.

7 years agoif_iwm - Ignore IWM_DEBUG_LOG_MSG notifications.
Imre Vadász [Sun, 30 Oct 2016 16:52:48 +0000 (17:52 +0100)]
if_iwm - Ignore IWM_DEBUG_LOG_MSG notifications.

* Firmware versions 21 and 22 generate some IWM_DEBUG_LOG_MSG notifications,
  which seem to be harmless. Avoid spamming the system log with
  "frame ... UNHANDLED (this should not happen)" messages.

* While there fix nitpicks. Use iwm_rx_packet_len() inline function.
  Move iwm_lar_disable tunable out of #ifdef __DragonFly__.

7 years agoif_iwm - Set command code for PHY_DB as well.
Imre Vadász [Sun, 30 Oct 2016 16:02:57 +0000 (17:02 +0100)]
if_iwm - Set command code for PHY_DB as well.

Taken-From: Linux iwlwifi (commit 176aa60bf148b5af4209ac323cef941dee76e390)

7 years agoif_iwm - Set correct state in smart-fifo configuration.
Imre Vadász [Sun, 30 Oct 2016 15:39:51 +0000 (16:39 +0100)]
if_iwm - Set correct state in smart-fifo configuration.

Taken-From: Linux iwlwifi (commit 849a9627299100ae3f0ce573fc87d2b476f3bb59)

7 years agoif_iwm - Remove dead code from iwm_pcie_load_cpu_sections().
Imre Vadász [Sun, 30 Oct 2016 14:31:08 +0000 (15:31 +0100)]
if_iwm - Remove dead code from iwm_pcie_load_cpu_sections().

* If device family is 8000 then iwm_pcie_load_cpu_sections()
  won't be called at all (iwm_pcie_load_cpu_sections_8000() is
  called in that case) so this piece of code never gets called.

Taken-From: Linux iwlwifi (commit 76f8c0e17edc6eba43f84952e5a87c7f50f69370)

7 years agosbin/newfs_hammer: Allow 0 for boot_area/memory_log size [3/3]
Tomohiro Kusumi [Sat, 29 Oct 2016 15:25:22 +0000 (00:25 +0900)]
sbin/newfs_hammer: Allow 0 for boot_area/memory_log size [3/3]

This commit gives an option to allocate no space for
boot_area/memory_log since these aren't used for anything.

Allow boot_area/memory_log size smaller than HAMMER_{BOOT,MEM}_MINBYTES
if -f is specified. If -f is not specified, MINBYTES are still
low limits for boot_area/memory_log.

This is similar to the way newfs_hammer allows undo size smaller
than 512MB when -f is specified.

7 years agosbin/newfs_hammer: Allow 0 for boot_area/memory_log size [2/3]
Tomohiro Kusumi [Sat, 29 Oct 2016 14:57:04 +0000 (23:57 +0900)]
sbin/newfs_hammer: Allow 0 for boot_area/memory_log size [2/3]

Remove unused minval/maxval args from getsize() after the previous commit.

7 years agosbin/newfs_hammer: Allow 0 for boot_area/memory_log size [1/3]
Tomohiro Kusumi [Sat, 29 Oct 2016 14:53:41 +0000 (23:53 +0900)]
sbin/newfs_hammer: Allow 0 for boot_area/memory_log size [1/3]

This is for the next few commits.
Add a function to check size, and don't use size checks in getsize().

7 years agosys/vfs/hammer: Rename mem_area_size to memory_log_size
Tomohiro Kusumi [Sat, 29 Oct 2016 14:52:06 +0000 (23:52 +0900)]
sys/vfs/hammer: Rename mem_area_size to memory_log_size

The name of this field has been "memory area size" ever since it
was added in 90ecab35 in 2009, but rename it to "memory log size"
since this is the real name for this field.
(see stdout of newfs_hammer and newfs_hammer(8))

This commit changes a name of ioctl structure field, but doesn't
affect or break userspace, as the ioctl is only used or usable by
hammer volume-add command.

7 years agosbin/hammer: Fix default behavior of init_{boot,mem}_area_size()
Tomohiro Kusumi [Sat, 29 Oct 2016 13:38:38 +0000 (22:38 +0900)]
sbin/hammer: Fix default behavior of init_{boot,mem}_area_size()

The default algorithm should set value to HAMMER_{BOOT,MEM}_MINBYTES
instead of 0, if value becomes smaller than HAMMER_{BOOT,MEM}_MINBYTES.

It originally had it like this (see f819215c), but was probably wrong.

7 years agosbin/hammer: Test high limit in init_{boot,mem}_area_size()
Tomohiro Kusumi [Sat, 29 Oct 2016 13:17:18 +0000 (22:17 +0900)]
sbin/hammer: Test high limit in init_{boot,mem}_area_size()

Nothing changes (newfs_hammer checks this on -b and -m via getsize()),
but these functions should have high limit tests as well.

7 years agosbin/hammer: Remove \n from err(3)/errx(3)
Tomohiro Kusumi [Sat, 29 Oct 2016 12:27:00 +0000 (21:27 +0900)]
sbin/hammer: Remove \n from err(3)/errx(3)

err(3)/errx(3) don't need \n (unless that's intentional).
Most programs don't have \n either.

7 years agosbin/newfs_hammer: Remove \n from errx(3)
Tomohiro Kusumi [Sat, 29 Oct 2016 16:20:49 +0000 (01:20 +0900)]
sbin/newfs_hammer: Remove \n from errx(3)

errx(3) doesn't need \n (unless that's intentional).
Most programs don't have \n either.

7 years agosbin/newfs_hammer: Fix low limit of -b and -m option
Tomohiro Kusumi [Sat, 29 Oct 2016 08:23:47 +0000 (17:23 +0900)]
sbin/newfs_hammer: Fix low limit of -b and -m option

HAMMER_{BOOT,MEM}_MINBYTES are larger than HAMMER_BUFSIZE which is 16KB.

7 years agosbin/newfs_hammer: Check maximum undo fifo size with explicit error message
Tomohiro Kusumi [Sat, 29 Oct 2016 07:55:11 +0000 (16:55 +0900)]
sbin/newfs_hammer: Check maximum undo fifo size with explicit error message

The undo fifo size has an explicit error message for below 512MB,
so do the same for >1GB.

7 years agosys/vfs/hammer: Add HAMMER_MIN_UNDO_BIGBLOCKS to set minimum undo fifo to 512MB
Tomohiro Kusumi [Sat, 29 Oct 2016 07:03:13 +0000 (16:03 +0900)]
sys/vfs/hammer: Add HAMMER_MIN_UNDO_BIGBLOCKS to set minimum undo fifo to 512MB

Add HAMMER_MIN_UNDO_BIGBLOCKS which is 64 big-blocks in addition
to HAMMER_MAX_UNDO_BIGBLOCKS which is 128 big-blocks.

This not only removes magic number 500*1024*1024 from source,
but also changes minimum undo fifo from 500MB to 512MB in terms
of userspace command.

This means the number of big-blocks created by newfs_hammer by
default (depending on volumes size), and the minumum number of
big-blocks that can be specified, change from 63(504MB) to 64(512MB),
which is trivial given the size of total volumes required by
the filesystem.

I think it's just better to keep the number multiple of 8MB.
As mentioned, one can't assign exact 500MB for undo fifo anyway
as it gets aligned to big-block boundary.

This change doesn't affect the existing filesystem.

7 years agosys/vfs/hammer: Remove wrong comment
Tomohiro Kusumi [Sat, 29 Oct 2016 06:16:14 +0000 (15:16 +0900)]
sys/vfs/hammer: Remove wrong comment

Resizing undo fifo is not supported or even planned.

It's possible to support it, though big-blocks for undo fifo
won't be contiguous blocks when expanding (which is fine too).

Currently it's always contiguous located right after layer1/2,
but before big-blocks for the root inode/pfs in volume#0.

7 years agosys/vfs/hammer: Rename HAMMER_UNDO_LAYER2 to HAMMER_MAX_UNDO_BIGBLOCKS
Tomohiro Kusumi [Sat, 29 Oct 2016 05:23:24 +0000 (14:23 +0900)]
sys/vfs/hammer: Rename HAMMER_UNDO_LAYER2 to HAMMER_MAX_UNDO_BIGBLOCKS

This macro has existed since 2008, but should be renamed to something
like HAMMER_MAX_UNDO_BIGBLOCKS.

Big-blocks for undo fifo are separated from big-blocks managed by
layer1/2. In other words, layer1/2 entries do not point to undo fifo.
Undo fifo is fixed size space pointed to directly from volume header,
so the name makes more sense without LAYER2.

7 years agoif_iwm - Check for lar_disable tunable, and lar_enabled flag from NVM.
Imre Vadász [Sat, 29 Oct 2016 19:58:40 +0000 (21:58 +0200)]
if_iwm - Check for lar_disable tunable, and lar_enabled flag from NVM.

* LAR can be disabled with the hw.iwm.lar.disable tunable now.

* On Family 8000 devices we need to check the lar_enabled flag from
  nvm_data in addition to the TLV_CAPA_LAR_SUPPORT flag from the firmware.

* Add a separate IWM_DEBUG_LAR debugging flag.

Taken-From: Linux iwlwifi

7 years agokernel/efi: Add a sysctl machdep.efi_map to dump the raw EFI memory map.
Sascha Wildner [Sat, 29 Oct 2016 20:18:33 +0000 (22:18 +0200)]
kernel/efi: Add a sysctl machdep.efi_map to dump the raw EFI memory map.

Taken-from: FreeBSD

7 years ago<sys/efi.h>: Move the efi_next_descriptor() macro to <sys/efi.h>.
Sascha Wildner [Sat, 29 Oct 2016 19:56:38 +0000 (21:56 +0200)]
<sys/efi.h>: Move the efi_next_descriptor() macro to <sys/efi.h>.

While here, rename efi_systbl to efi_systbl_phys and make it kernel
only.

Taken-from: FreeBSD

7 years agoboot/libi386: Use SMAP_TYPE_MEMORY constant.
Sascha Wildner [Sat, 29 Oct 2016 09:40:52 +0000 (11:40 +0200)]
boot/libi386: Use SMAP_TYPE_MEMORY constant.

7 years agosysctl(8): Fix types of structure format functions.
Sascha Wildner [Sat, 29 Oct 2016 09:37:23 +0000 (11:37 +0200)]
sysctl(8): Fix types of structure format functions.

7 years agoif_iwm - Move Smart Fifo handling into if_iwm_sf.c, sync with Linux iwlwifi.
Imre Vadász [Sat, 29 Oct 2016 08:18:27 +0000 (10:18 +0200)]
if_iwm - Move Smart Fifo handling into if_iwm_sf.c, sync with Linux iwlwifi.

* This change also fixes a possible issue in the existing smart-fifo code,
  which set the IWM_SF_CFG_DUMMY_NOTIF_OFF bit on AC8260 chipsets, although
  that's only used in iwlwifi for Family 8000 chipsets connected via SDIO
  interface.

Taken-From: Linux iwlwifi

7 years agommc: With this workaround, both eMMC and sd-card slot on hp x2 210 work
Imre Vadász [Mon, 13 Jun 2016 19:13:52 +0000 (21:13 +0200)]
mmc: With this workaround, both eMMC and sd-card slot on hp x2 210 work

7 years agokernel - adjust sdhc timeouts, cleanup
Matthew Dillon [Sat, 29 Oct 2016 07:05:16 +0000 (00:05 -0700)]
kernel - adjust sdhc timeouts, cleanup

* Remove my retries stuff from the mmc code.  Try to reduce the controller
  timeout in the sdhc code.

* Remove the mplock in the mmcsd code, it isn't needed.

7 years agokernel - Fix mmcsd read/write issues
Matthew Dillon [Sat, 29 Oct 2016 04:48:11 +0000 (21:48 -0700)]
kernel - Fix mmcsd read/write issues

* b_resid was not being set to 0 on a successful read or write, resulting
  in random short-read and short-write returns for requests.  Fixing this
  fixes nominal block I/O via the mmcsd disk device.

* bus/mmc now uses tsleep() instead of DELAY for the 10ms pause in
  request/command wait loops.

* bus/mmc reduces the TIMEOUT from 10 seconds to 1 second after the first
  TIMEOUT, only increasing it back to 10 seconds when timeouts stop
  occurring.  This reduces boot-time delays when a mmc port is dead or
  powered down.

7 years agoboot - Add EFI support for placing /boot in a disklabel's 'a' partition.
Matthew Dillon [Sat, 29 Oct 2016 01:45:45 +0000 (18:45 -0700)]
boot - Add EFI support for placing /boot in a disklabel's 'a' partition.

* Add support to allow /boot to reside in the 'a' partition of a DragonFly
  disklabel64.  This allow /boot to be in either its own gpt partition or
  in the 'a' partition of a disklabel64 inside a gpt partition.

* Nominally allows the following gpt setup where all of DragonFly except
  the EFI System partition is contained in a DragonFly disklabel.

       2048     204800      0  GPT part - EFI System
     206848  124837888      1  GPT part - DragonFly Label64

  The disklabel can then be initialized as per the DragonFlyBSD standard,
  typically something like (example only):

    16 partitions:
    #          size     offset    fstype   fsuuid
      a:    1048576          0    4.2BSD    #    1024.000MB
      b:    8388608          *      swap    #    8192.000MB
      d:          *          *    HAMMER

7 years agobuild - Remove openssl from base (is now permanently replaced by ressl)
Matthew Dillon [Fri, 28 Oct 2016 20:37:44 +0000 (13:37 -0700)]
build - Remove openssl from base (is now permanently replaced by ressl)

* Remove openssl and related code that previous commits by John Marino
  replaced with libressl.  Remove build hooks, base now only uses libressl.

* Remove crypto/openssl.  This has been replaced by the openssl
  implementation from ressl.

* Remove lib/libcrypto.  This has been replaced by lib/librecrypto which
  generates a private_crypo library only used by base.

* Remove lib/libssl.  This has been replaced by lib/libressl which
  generates a private_ssl library only used by base.

* NOTE: In addition, John has been working on updating dports to ensure
that only the ports-based libssl and libcrypto (both nominally
implemented via ressl and not openssl), and that dports packages
no longer have any chance of using the private versions of these
libraries from base.

7 years agoif_iwm - Recognize IWM_FW_PAGING_BLOCK_CMD wide cmd response correctly.
Imre Vadász [Fri, 28 Oct 2016 17:13:57 +0000 (19:13 +0200)]
if_iwm - Recognize IWM_FW_PAGING_BLOCK_CMD wide cmd response correctly.

7 years agoRevert "if_iwm - SCAN_ABORT_UMAC response doesn't use a wide id"
Imre Vadász [Fri, 28 Oct 2016 16:52:11 +0000 (18:52 +0200)]
Revert "if_iwm - SCAN_ABORT_UMAC response doesn't use a wide id"

This reverts commit cef47a9cbb0a3ce5f18369fed9403d2764884bc2.

7 years agoif_iwm - Fix iwm_mvm_send_cmd_pdu(_status) declarations. Make id a uint32_t.
Imre Vadász [Fri, 28 Oct 2016 16:36:44 +0000 (18:36 +0200)]
if_iwm - Fix iwm_mvm_send_cmd_pdu(_status) declarations. Make id a uint32_t.

* This fixes cases where the group id of wide commands got lost, e.g. this
  happened to the IWM_SCAN_ABORT_UMAC command.

7 years agoinstaller: Fix comment typo.
Sascha Wildner [Fri, 28 Oct 2016 11:21:35 +0000 (13:21 +0200)]
installer: Fix comment typo.

7 years agoSync zoneinfo database with tzdata2016h from ftp://ftp.iana.org/tz/releases
Sascha Wildner [Fri, 28 Oct 2016 11:15:44 +0000 (13:15 +0200)]
Sync zoneinfo database with tzdata2016h from ftp://ftp.iana.org/tz/releases

* Asia/Gaza and Asia/Hebron end DST on 2016-10-29 at 01:00, not
    2016-10-21 at 00:00.  (Thanks to Sharef Mustafa.)  Predict that
    future fall transitions will be on the last Saturday of October
    at 01:00, which is consistent with predicted spring transitions
    on the last Saturday of March.  (Thanks to Tim Parenti.)

* In Turkey, transitions in 1986-1990 were at 01:00 standard time
    not at 02:00, and the spring 1994 transition was on March 20, not
    March 27.  (Thanks to Kıvanç Yazan.)

* Asia/Colombo now uses numeric time zone abbreviations like "+0530"
    instead of alphabetic ones like "IST" and "LKT".  Various
    English-language sources use "IST", "LKT" and "SLST", with no
    working consensus.  (Usage of "SLST" mentioned by Sadika
    Sumanapala.)

* The 'Theory' file now has a section on interface stability.
    (Requested by Paul Koning.)  It also mentions features like
    tm_zone and localtime_rz that have long been supported by the
    reference code.

* The US commentary now mentions Allen and the "day of two noons".

* The Fiji commentary mentions the government's 2016-10-03 press
    release.  (Thanks to Raymond Kumar.)

7 years agolibcompat: Remove various unneeded functions.
Sascha Wildner [Fri, 28 Oct 2016 11:04:31 +0000 (13:04 +0200)]
libcompat: Remove various unneeded functions.

Namely ascftime(), cfree(), cftime(), and getpw().

Nothing in base or dports uses them.

7 years agobuild - Fix pam issues, fix 'su', fix libopie.
Matthew Dillon [Fri, 28 Oct 2016 06:13:53 +0000 (23:13 -0700)]
build - Fix pam issues, fix 'su', fix libopie.

* libopie needs to link against our private libcrypto.  Not doing so
  broke the pam opie module, 'su', and numerous related programs.

7 years agobuildkernel - Fix build issue w/libmd changes
Matthew Dillon [Fri, 28 Oct 2016 00:48:03 +0000 (17:48 -0700)]
buildkernel - Fix build issue w/libmd changes

* Fix a build issue.

7 years agobuild - remove whitespace
Matthew Dillon [Fri, 28 Oct 2016 00:23:25 +0000 (17:23 -0700)]
build - remove whitespace

* Remove whitespace.

7 years agobuild - use libressl md5.h for kernel
Matthew Dillon [Fri, 28 Oct 2016 00:22:27 +0000 (17:22 -0700)]
build - use libressl md5.h for kernel

* libressl's md5.h needs a minor mod for us to be able to use it
  in the kernel build.

7 years agobuildkernel - Fix -j race
Matthew Dillon [Thu, 27 Oct 2016 23:19:47 +0000 (16:19 -0700)]
buildkernel - Fix -j race

* Fix -j race with forwarded header files.  Multiple threads will try to
  create the same forwarded header file, causing users of the file to
  sometimes see a partially written file.

7 years agobuild - Rewire secure, remove conflicts from libmd, libcrypt
Matthew Dillon [Thu, 27 Oct 2016 23:11:22 +0000 (16:11 -0700)]
build - Rewire secure, remove conflicts from libmd, libcrypt

* Remove /usr/src/secure, folding all of its subsystems into
  /usr/src.  There's no point having a /usr/src/secure any more,
  the system won't run without the secure stuff, the idea that some foreign
  actor could segregate it in order to legally download code without crypto
  is absurd on the modern internet, and the U.S. government stopped caring
  decades ago.

* Remove conflicts from libmd and libcrypt.  Essentially this removes
  the SHA*_*() and MD5_*() APIs from libmd because these APIs already
  exist in lib[re]ssl.

  The older SHA*() and MD5*() APIs are partially retained for legacy base
  code, but will be removed in a later stage (moved to direct-linking the
  needed support source).

  Conflicting routines in libcrypt have been renamed and internalized to
  be libcrypt-only.

* Major rewiring of the Makefile's to support the changes.

7 years agoif_iwm - Adjust if_iwm_sta.h prototypes, don't pass iwm_node to rm_sta().
Imre Vadász [Thu, 27 Oct 2016 20:09:38 +0000 (22:09 +0200)]
if_iwm - Adjust if_iwm_sta.h prototypes, don't pass iwm_node to rm_sta().

* Since a RUN -> INIT/SCAN transition seems to immediately destroy the
  ieee80211_node for the AP, we can't read the in_assoc value from there.
  Instead just directly pass that information via a boolean_t argument.

* Adds iwm_mvm_rm_sta_id() function, which just unconditionally removes
  the station from the firmware.

* The iwm_mvm_rm_sta() function shouldn't actually remove the station from
  firmware when we are still associated (i.e. during a RUN -> INIT/SCAN
  transition).

* So when disassociating we will first call iwm_mvm_rm_sta() to drain the
  queues/fifos. Later during disassociation we will then use
  iwm_mvm_rm_sta_id() to actually remove the station.

Inspired-By: Linux iwlwifi
7 years agoif_iwm - Make powersaving more similar to Linux iwlwifi behaviour.
Imre Vadász [Thu, 27 Oct 2016 19:58:48 +0000 (21:58 +0200)]
if_iwm - Make powersaving more similar to Linux iwlwifi behaviour.

* Add a per-vap ps_disabled flag, and use it for a workaround which fixes
  an association issue when powersaving is enabled.

* Compute flag that should correpsond to the mvmif->bss_conf.ps flag in
  Linux's iwlwifi (e.g. this disallows powersaving when not associated
  yet).

Inspired-By: Linux iwlwifi
7 years agoif_iwm - Clean up if_iwm_power.c a bit. Fix iwm_power_scheme debug print.
Imre Vadász [Thu, 27 Oct 2016 18:51:54 +0000 (20:51 +0200)]
if_iwm - Clean up if_iwm_power.c a bit. Fix iwm_power_scheme debug print.

7 years agodrm: Implement and use the Linux i2c API
François Tigeot [Thu, 27 Oct 2016 19:17:22 +0000 (21:17 +0200)]
drm: Implement and use the Linux i2c API

* This is mainly to the benefit of the drm/i915 driver

* Sync key portions of code with Linux 4.4

* Key drm functions using the DragonFly-specific iic(4) API
  have been copied and renamed with an _iic suffix

* The drm/radeon driver no longer being actively developed, the
  intent is to keep it functional with a frozen API

Thanks to Johannes Hofmann for figuring out we could live with
a dummy default bit_xfer() implementation

7 years agodrm: Implement and use Linux struct device
François Tigeot [Thu, 27 Oct 2016 18:43:18 +0000 (20:43 +0200)]
drm: Implement and use Linux struct device

7 years agokernel: Rename the struct behind device_t to bsd_device
François Tigeot [Thu, 27 Oct 2016 18:22:06 +0000 (20:22 +0200)]
kernel: Rename the struct behind device_t to bsd_device

Thus making it not clash with the Linux struct device anymore

Inspired-by: proposed FreeBSD changes