dragonfly.git
4 years agoMerge branch 'vendor/LIBARCHIVE'
Peter Avalos [Tue, 17 May 2016 20:00:43 +0000 (13:00 -0700)]
Merge branch 'vendor/LIBARCHIVE'

Bring in two bug fixes from libarchive's master branch. This should fix
some dports breakage.

Requested-by: zrj@
4 years agoDisable ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS in bsdcpio p mode.
Peter Avalos [Tue, 17 May 2016 19:58:51 +0000 (12:58 -0700)]
Disable ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS in bsdcpio p mode.

Obtained-from: libarchive 199d5c79b547cebe3d7d33e5acd10ae03008c4a2

4 years agoReject cpio symlinks that exceed 1MB.
Peter Avalos [Tue, 17 May 2016 19:57:30 +0000 (12:57 -0700)]
Reject cpio symlinks that exceed 1MB.

Obtained-from: libarchive fd7e0c02e272913a0a8b6d492c7260dfca0b1408

4 years agodrm/radeon: Backport two bugfixes from drm v3.19
zrj [Tue, 17 May 2016 09:06:30 +0000 (12:06 +0300)]
drm/radeon: Backport two bugfixes from drm v3.19

In attempt to keep radeon at v3.18 level for drm/ttm update.

4 years agodrm/radeon: Disable some unused functions.
zrj [Tue, 17 May 2016 09:02:14 +0000 (12:02 +0300)]
drm/radeon: Disable some unused functions.

Remove or #if 0 for future reference them.
While there, make TRACE_TODO consistent through code.

No functional change.

Spotted-by: swildner
4 years agoUpdate the pciconf(8) database.
Sascha Wildner [Sun, 15 May 2016 10:17:24 +0000 (12:17 +0200)]
Update the pciconf(8) database.

May 11, 2016 snapshot from http://pciids.sourceforge.net/

4 years agodrm/uapi_drm: Update to Linux 4.6
David Shao [Sat, 14 May 2016 07:48:14 +0000 (09:48 +0200)]
drm/uapi_drm: Update to Linux 4.6

Added definition of __kernel_size_t to linux/types.h.
Preserved current definitions of invalid flags in i915_drm.h.

4 years agodrm/linux: Add asm/ioctl.h
François Tigeot [Sat, 14 May 2016 06:44:58 +0000 (08:44 +0200)]
drm/linux: Add asm/ioctl.h

4 years agodrm cleanup 12/x: Layout fixes to match upstream in drmP.h
zrj [Thu, 12 May 2016 17:48:11 +0000 (20:48 +0300)]
drm cleanup 12/x: Layout fixes to match upstream in drmP.h

Mainly to reduce differences for upcomming further cleanup.

Strictly no functional change.

4 years agodrm cleanup 11/x: Remove some unused callbacks from drm_driver.
zrj [Thu, 12 May 2016 17:26:04 +0000 (20:26 +0300)]
drm cleanup 11/x: Remove some unused callbacks from drm_driver.

4 years agodrm cleanup 10/x: Move DRM_WAIT_ON and DRM_CURRENTPID macros.
zrj [Thu, 12 May 2016 17:02:29 +0000 (20:02 +0300)]
drm cleanup 10/x: Move DRM_WAIT_ON and DRM_CURRENTPID macros.

DRM_CURRENTPID macro will no longer be used after v4.4

4 years agodrm cleanup 09/x: Move EREMOTEIO to linux/errno.h
zrj [Thu, 12 May 2016 16:41:28 +0000 (19:41 +0300)]
drm cleanup 09/x: Move EREMOTEIO to linux/errno.h

Technically <linux/errno.h> should be included in:
radeon/atombios_dp.c and i915/intel_dp.c

4 years agodrm cleanup 08/x: Move memset_XXX helpers to linux asm/io.h
zrj [Thu, 12 May 2016 16:36:47 +0000 (19:36 +0300)]
drm cleanup 08/x: Move memset_XXX helpers to linux asm/io.h

4 years agodrm cleanup 07/x: Move byte order functions to linux layer.
zrj [Thu, 12 May 2016 16:14:55 +0000 (19:14 +0300)]
drm cleanup 07/x: Move byte order functions to linux layer.

BITS_PER_LONG and [un]likely() are already defined elsewhere.

4 years agodrm cleanup 06/x: Remove KIB_NOTYET macro.
zrj [Thu, 12 May 2016 15:42:25 +0000 (18:42 +0300)]
drm cleanup 06/x: Remove KIB_NOTYET macro.

Not used even at FreeBSD.

While there, remove few other from initial port.

4 years agodrm cleanup 05/x: Move IS_ALIGNED macro to linux/kernel.h
zrj [Thu, 12 May 2016 15:17:11 +0000 (18:17 +0300)]
drm cleanup 05/x: Move IS_ALIGNED macro to linux/kernel.h

Only used in radeon/r600_cs.c
It is cleaner to have it in compat layer.

4 years agodrm cleanup 04/x: Remove some unused radeon compat defines.
zrj [Thu, 12 May 2016 14:32:54 +0000 (17:32 +0300)]
drm cleanup 04/x: Remove some unused radeon compat defines.

These were only used in radeon UMS driver, that is removed now.

4 years agodrm cleanup 03/x: Move all includes in drmP.h to the top.
zrj [Thu, 12 May 2016 14:10:47 +0000 (17:10 +0300)]
drm cleanup 03/x: Move all includes in drmP.h to the top.

Hide struct videomode under CONFIG_VIDEOMODE_HELPERS option.
There is no need for it in DragonFly.

While there, resort include order to match one at Linux v4.3

No functional change intended.

4 years agodrm cleanup 02/x: Fix drm_legacy_sg_cleanup() prototype.
zrj [Thu, 12 May 2016 13:19:49 +0000 (16:19 +0300)]
drm cleanup 02/x: Fix drm_legacy_sg_cleanup() prototype.

Make it take struct drm_device as in Linux.

No functional change.

4 years agodrm cleanup 01/x: Move legacy buffer structs to drm_leagcy.h
zrj [Thu, 12 May 2016 13:07:11 +0000 (16:07 +0300)]
drm cleanup 01/x: Move legacy buffer structs to drm_leagcy.h

As was done in Linux v3.18 commit:
ba8286fab52652e431784d066b075c1bb4933ea1

This cleans drmP.h header a bit.

While there, move LOCK_TEST_WITH_RETURN macro too.

No functional change intended.

4 years agodrm: Sync drm_agpsupport.h with Linux 4.3
zrj [Thu, 12 May 2016 10:50:50 +0000 (13:50 +0300)]
drm: Sync drm_agpsupport.h with Linux 4.3

Fix build w/o __OS_HAS_AGP

Perform some cleanup in drmP.h as well.

No functional change intended.

Submitted-by: ftigeot@ with few changes
4 years agodrm/radeon: Preparations for AGP cleanup.
zrj [Thu, 12 May 2016 08:34:09 +0000 (11:34 +0300)]
drm/radeon: Preparations for AGP cleanup.

No functional change intended.

4 years agodrm/i915: Comment out a DRM_DEBUG_KMS statement
François Tigeot [Fri, 13 May 2016 08:58:58 +0000 (10:58 +0200)]
drm/i915: Comment out a DRM_DEBUG_KMS statement

Sysfs interface for connectors is not implemented.

Requested-by: zrj
4 years agobsdcat(1): Bump WARNS down for contrib code.
Peter Avalos [Fri, 13 May 2016 01:26:30 +0000 (18:26 -0700)]
bsdcat(1): Bump WARNS down for contrib code.

4 years agoAdjust files for libarchive-3.2.0 import.
Peter Avalos [Fri, 13 May 2016 00:51:24 +0000 (17:51 -0700)]
Adjust files for libarchive-3.2.0 import.

4 years agoMerge branch 'vendor/LIBARCHIVE'
Peter Avalos [Fri, 13 May 2016 00:44:10 +0000 (17:44 -0700)]
Merge branch 'vendor/LIBARCHIVE'

4 years agorc - Add unconfigured wifi interfaces to the netif list
Matthew Dillon [Thu, 12 May 2016 21:44:16 +0000 (14:44 -0700)]
rc - Add unconfigured wifi interfaces to the netif list

* Use sysctl net.wlan.devices to get a list of wifi interfaces.
  This sysctl is not yet active in master but will be when the wifi
  update goes in (at which point the devices no longer show up in
  ifconfig -l).

* This will allow existing wifi configurations in /etc/rc.conf to just
  work with the upcoming update.

4 years agosysctl - Add -i and -q from FreeBSD
Matthew Dillon [Thu, 12 May 2016 21:27:09 +0000 (14:27 -0700)]
sysctl - Add -i and -q from FreeBSD

Enhance the sysctl code, will be used by /etc/network.subr

* sysctl -i - Exit cleanly with exit code 0 if a sysctl mib does not
  exist.  No warning or error message is output for this
  case.

* sysctl -q - Exit with exit code N if a sysctl mib does not exist.
  N is the number of mib's on the command line which failed.
  No warning or error message is output for this case.

4 years agoImport libarchive-3.2.0.
Peter Avalos [Thu, 12 May 2016 20:58:50 +0000 (13:58 -0700)]
Import libarchive-3.2.0.

4 years agochown(8)/chgrp(1): Sync with FreeBSD
Peter Avalos [Thu, 12 May 2016 19:00:30 +0000 (12:00 -0700)]
chown(8)/chgrp(1): Sync with FreeBSD

- Be consistent with chmod(1) for symlinks.
- Use basename(3).
- Use uid_t.
- Allocate buffers for getgroups(3) dynamically.
- Add -x option to prevent crossing of mountpoints.
- Sprinkle some static.

Obtained-from: FreeBSD

4 years agochflags(1): symlink handling similar to chmod(1)
Peter Avalos [Thu, 12 May 2016 03:28:34 +0000 (20:28 -0700)]
chflags(1): symlink handling similar to chmod(1)

Obtained-from:  FreeBSD

4 years agochmod(1): Bring in some changes from FreeBSD.
Peter Avalos [Thu, 12 May 2016 02:31:08 +0000 (19:31 -0700)]
chmod(1): Bring in some changes from FreeBSD.

- Change directory permissions in pre-order.
- Allow "-v -v" to mean very verbose.
- Follow symbolic links named as command line arguments if run w/o -R.

Obtained-from:  FreeBSD

4 years agokernel/drm: Resort radeon sources alphabetically.
zrj [Tue, 10 May 2016 17:32:32 +0000 (20:32 +0300)]
kernel/drm: Resort radeon sources alphabetically.

While there, add hint for module depends in LINT64.

4 years agodrm: Destroy events consistently.
zrj [Tue, 10 May 2016 16:29:10 +0000 (19:29 +0300)]
drm: Destroy events consistently.

Fixes wrong function casting in drm_atomic.c

While there, make all call sites more similar.

4 years agobwn.4: Update firmware dport reference.
zrj [Tue, 10 May 2016 14:10:50 +0000 (17:10 +0300)]
bwn.4: Update firmware dport reference.

Reported-and-tested-by: basedacid@
4 years agodrm/radeon: Add ACPI function stubs.
zrj [Tue, 10 May 2016 13:10:27 +0000 (16:10 +0300)]
drm/radeon: Add ACPI function stubs.

Reduces diffs in radeon_bios with Linux v3.18

4 years agodrm/radeon: Fix some leaks on module unload.
zrj [Tue, 10 May 2016 12:59:03 +0000 (15:59 +0300)]
drm/radeon: Fix some leaks on module unload.

This prevents leaking of whopping 1008 bytes of M_DRM memory:
  * 512 bytes from radeon/atom.c
  * 440 bytes from radeon/radeon_atombios.c voltage_tables
  * 56 bytes from allocation of struct fb_info *info

fb_info case needs help from syscons, for now let it leak those 56 bytes.

4 years agodrm/radeon: Nuke some orphaned externs.
zrj [Tue, 10 May 2016 06:07:52 +0000 (09:07 +0300)]
drm/radeon: Nuke some orphaned externs.

Spotted-by: swildner
4 years ago80211 - Further ifp->if_softc -> ic_softc conversions in wlan drivers.
Imre Vadász [Sat, 7 May 2016 21:14:46 +0000 (23:14 +0200)]
80211 - Further ifp->if_softc -> ic_softc conversions in wlan drivers.

4 years agou4b/wlan - Convert ifp->if_softc -> ic->ic_softc.
Imre Vadász [Sat, 7 May 2016 20:38:31 +0000 (22:38 +0200)]
u4b/wlan - Convert ifp->if_softc -> ic->ic_softc.

Taken-From: FreeBSD

4 years agou4b/wlan - Mechanically convert to IFNET_STAT_INC.
Imre Vadász [Sat, 7 May 2016 17:57:15 +0000 (19:57 +0200)]
u4b/wlan - Mechanically convert to IFNET_STAT_INC.

Inspired-by: FreeBSD (SVN r271866)
4 years agoif_iwm: Utilize updated net80211 stuff, improves scanning behaviour.
Imre Vadász [Tue, 5 Jan 2016 14:46:41 +0000 (15:46 +0100)]
if_iwm: Utilize updated net80211 stuff, improves scanning behaviour.

* Just remove some #if defined(__DragonFly__) workarounds that were
  previously needed.

* Now scanning should find access points on all channels, and not just on
  the currently selected channel.

4 years ago80211 - Add missing ic_softc initializations in sys/bus/u4b/wlan drivers.
Imre Vadász [Sat, 7 May 2016 07:41:03 +0000 (09:41 +0200)]
80211 - Add missing ic_softc initializations in sys/bus/u4b/wlan drivers.

4 years ago80211 - Fixup missing ic_name, ic_softc
Matthew Dillon [Fri, 6 May 2016 00:57:54 +0000 (17:57 -0700)]
80211 - Fixup missing ic_name, ic_softc

* Fixup missing ic_name and ic_softc assignments.

4 years ago80211 - Update README.DRAGONFLY, we use "if_inc_counter -> IFNET_STAT_INC".
Imre Vadász [Tue, 3 May 2016 22:18:00 +0000 (00:18 +0200)]
80211 - Update README.DRAGONFLY, we use "if_inc_counter -> IFNET_STAT_INC".

4 years ago80211 - Check if_clone_destroy return value.
Imre Vadász [Thu, 5 May 2016 23:05:57 +0000 (01:05 +0200)]
80211 - Check if_clone_destroy return value.

* Otherwise ieee80211_ifdetach can end up in an infinite loop, when
  if_clone_destroy fails.

4 years ago80211 - Update up to FreeBSD's r287029 (only skipping a few minor changes)
Imre Vadász [Mon, 4 Jan 2016 11:14:51 +0000 (12:14 +0100)]
80211 - Update up to FreeBSD's r287029 (only skipping a few minor changes)

Taken-From: FreeBSD

4 years ago80211 - Migrate the scan iterator lock typedefs into ieee80211_dragonfly.h
Imre Vadász [Tue, 3 May 2016 20:07:19 +0000 (22:07 +0200)]
80211 - Migrate the scan iterator lock typedefs into ieee80211_dragonfly.h

Now only wlan_global_serializer locking remains, all other os-specific
locking is inside ieee80211_dragonfly.h.

Taken-From: FreeBSD (SVN r283556)

4 years agodrm/radeon: Release firmware on CIK at driver fini.
zrj [Mon, 9 May 2016 12:08:42 +0000 (15:08 +0300)]
drm/radeon: Release firmware on CIK at driver fini.

While testing on Bonaire noticed that firmware stays behind
after kldunload radeonkms. Fix it.

4 years agodrm/radeon: Expand atomic_cmpxchg() use in UVD/VCE
zrj [Tue, 1 Dec 2015 16:26:19 +0000 (18:26 +0200)]
drm/radeon: Expand atomic_cmpxchg() use in UVD/VCE

I somehow lost this one in a pile. Likely fixes few bugs on msg packet destroy.

4 years agodrm/radeon: Revert "drm/radeon: Partial sync with Linux 3.18"
zrj [Mon, 9 May 2016 05:58:14 +0000 (08:58 +0300)]
drm/radeon: Revert "drm/radeon: Partial sync with Linux 3.18"

This partially reverts commit bd519ccc430654ba519981ec2781920010d5bb19

Caused driver teardown problems.

4 years agosys/vfs/tmpfs: Use vop_write_dirent()
Tomohiro Kusumi [Mon, 9 May 2016 08:15:12 +0000 (17:15 +0900)]
sys/vfs/tmpfs: Use vop_write_dirent()

Make filesystem code independent of struct dirent format.
struct dirent is basically for userspace to retrieve entries.

4 years agodrm/radeon/dp: Fix long-standing bug in Display Port handling.
zrj [Sun, 8 May 2016 15:42:08 +0000 (18:42 +0300)]
drm/radeon/dp: Fix long-standing bug in Display Port handling.

This fixes EDID information fetching from monitor through aux/iic
when using Display Port and no longer requires providing binary
EDID block with drm.edid_firmware="DP-1:edidfw_MONITOR" tunable.

From testing/disecting looks like bug was from initial radeonkms port.

While there, add hpd (hot plug detection) pin assignment for future
reference when common drm i2c/iic over aux will be implemented.

Changes intended only for Display-Port.
Note that currently on DP cable remove or monitor power off when monitor
is plugged-in DP connector stays in disconnected state (DP-only quirk).

Tested-on: R7 360 BONAIRE w/ HP LA DP-1(1920x1200), HP LP DVI(1600x1200)
           HD5770 JUNIPER w/ DELL P2416D DP-1(2560x1440) and
                                         HDMI(1920x1200)[card limit]

4 years agodrm/radeon/dp: Sync Display Port code with drm v3.18
zrj [Sun, 8 May 2016 16:07:39 +0000 (19:07 +0300)]
drm/radeon/dp: Sync Display Port code with drm v3.18

Some heavy changes were needed because of missing common
i2c/iic over aux helpers in drm.

Actual fix to fetch EDID info through Display Port will follow.

4 years agoRemove some duplicated #include's in thread.h and queue.h.
Sascha Wildner [Sun, 8 May 2016 19:12:57 +0000 (21:12 +0200)]
Remove some duplicated #include's in thread.h and queue.h.

4 years agoifconfig(8): Adjust for cec7392796354.
Sascha Wildner [Sun, 8 May 2016 06:54:26 +0000 (08:54 +0200)]
ifconfig(8): Adjust for cec7392796354.

Commit cec7392796354c53ac6469588a64f6536ed22659 changed ia6t_vltime
and ia6t_pltime to use time_uptime instead of time_second in
sys/netinet6/in6.c.

This change had not been reflected in the userland 'ifconfig'
command which still tried to interpret inet6 vltime and pltime
values as wall clock seconds.

The commit fixes the issue. It was adapted from FreeBSD r268049.

Submitted-by: Yann Grossel
Dragonfly-bug: <https://bugs.dragonflybsd.org/issues/2889>

4 years agoupgrade - Make sure /var/run/sem exists
Matthew Dillon [Sun, 8 May 2016 18:47:09 +0000 (11:47 -0700)]
upgrade - Make sure /var/run/sem exists

* Make sure /var/run/sem exists and is mode 1777.  Newer mtrees already
  handle this, but upgrades from older installs might not have the directory.

Reported-by: benjolitz
4 years agodrm/radeon: Clean up DPCD debug hex output print.
zrj [Sat, 7 May 2016 15:50:03 +0000 (18:50 +0300)]
drm/radeon: Clean up DPCD debug hex output print.

Linux uses "%*ph" format that does different thing on DragonFly.
It already got into into i915(4), so in radeonkms use hexncpy().

4 years agosys/vfs/hammer: Add missing \n in debug kprintf
Tomohiro Kusumi [Fri, 6 May 2016 14:11:47 +0000 (23:11 +0900)]
sys/vfs/hammer: Add missing \n in debug kprintf

4 years agoctags(1): Sync with FreeBSD.
Sascha Wildner [Fri, 6 May 2016 11:29:19 +0000 (13:29 +0200)]
ctags(1): Sync with FreeBSD.

* -t is now default, per POSIX. A new option -T specifies the old default
  (to not create tags for typedefs, structs, unions, and enums).

* Stop using system(3).

* Fix a parsing bug in the FORTRAN code.

While here, remove (void) casts.

4 years agodrm/i915: Update to Linux 4.3
François Tigeot [Fri, 6 May 2016 06:29:53 +0000 (08:29 +0200)]
drm/i915: Update to Linux 4.3

* Generic stability improvements

* Stability fixes and support improvements for various GPU families, including
  Broxton, Valleyview, Cherryview, Broadwell and Skylake

* Skylake support is no longer considered experimental

* HDMI now uses 12 bits per color component if the screen supports it.

* Power saving features improvements: many fixes have been made to the
  PSR (panel self refresh) and FBC (framebuffer compression) code.
  These features are not yet enabled by default though.

4 years ago<sys/msg.h>: Define msglen_t and msgqnum_t, use them in struct msqid_ds.
Sascha Wildner [Thu, 5 May 2016 09:35:53 +0000 (11:35 +0200)]
<sys/msg.h>: Define msglen_t and msgqnum_t, use them in struct msqid_ds.

See:

http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_msg.h.html

4 years agoFix filename and also misspelled word.
Justin C. Sherrill [Thu, 5 May 2016 03:17:34 +0000 (23:17 -0400)]
Fix filename and also misspelled word.

4 years ago<stdio.h>/<wchar.h>: Reduce namespace pollution in <wchar.h>.
Sascha Wildner [Wed, 4 May 2016 21:04:48 +0000 (23:04 +0200)]
<stdio.h>/<wchar.h>: Reduce namespace pollution in <wchar.h>.

Instead of including the whole of <stdio.h> in <wchar.h>, just define
FILE there too, which is all it needs.

Based on FreeBSD's similar definitions.

4 years agodrm/radeon: Add missing new bonaire pci id
zrj [Wed, 4 May 2016 07:15:03 +0000 (10:15 +0300)]
drm/radeon: Add missing new bonaire pci id

Tested-on: Gigabyte R7 360 (rev 2.0) card

4 years agoLocal adjustments for OpenSSL 1.0.1t.
Sascha Wildner [Tue, 3 May 2016 19:57:45 +0000 (21:57 +0200)]
Local adjustments for OpenSSL 1.0.1t.

4 years agoMerge branch 'vendor/OPENSSL'
Sascha Wildner [Tue, 3 May 2016 19:53:00 +0000 (21:53 +0200)]
Merge branch 'vendor/OPENSSL'

4 years agoImport OpenSSL 1.0.1t.
Sascha Wildner [Tue, 3 May 2016 19:47:42 +0000 (21:47 +0200)]
Import OpenSSL 1.0.1t.

* Fix CVE-2016-2107, CVE-2016-2105, CVE-2016-2106, CVE-2016-2109,
  CVE-2016-2176, CVE-2016-0702

For a more detailed list of changes, see crypto/openssl/CHANGES.

4 years agoRevert "kqueue: Avoid reprocessing processed knotes in KNOTE."
Sepherosa Ziehau [Tue, 3 May 2016 12:29:11 +0000 (20:29 +0800)]
Revert "kqueue: Avoid reprocessing processed knotes in KNOTE."

This reverts commit ed9db6a1912db34af387ff6978a265003258df16.

This cause panic under certain network load.

Reported-by: pavalos@
4 years agoRevert "kqueue: Return value of knote_release is no longer useful."
Sepherosa Ziehau [Tue, 3 May 2016 12:27:50 +0000 (20:27 +0800)]
Revert "kqueue: Return value of knote_release is no longer useful."

This reverts commit b75b5648541ea38deaf678ee62466780ffe62374.

Prepare to revert ed9db6a1912db34af387ff6978a265003258df16, which causes
panic under certain network load.

Reported-by: pavalos@
4 years agodrm/linux: Add linux/pwm.h
François Tigeot [Sun, 3 Apr 2016 11:46:08 +0000 (13:46 +0200)]
drm/linux: Add linux/pwm.h

4 years agodrm/linux: Add linux/gpio/consumer.h
François Tigeot [Tue, 3 May 2016 11:31:21 +0000 (13:31 +0200)]
drm/linux: Add linux/gpio/consumer.h

4 years agodrm/linux: Define U64_MAX
François Tigeot [Tue, 3 May 2016 11:13:03 +0000 (13:13 +0200)]
drm/linux: Define U64_MAX

4 years agodrm/linux: Add __test_and_clear_bit
François Tigeot [Tue, 3 May 2016 09:28:37 +0000 (11:28 +0200)]
drm/linux: Add __test_and_clear_bit

Obtained-from: NetBSD

4 years agogpio_intel: Slightly simplify interface to chipset-specific code.
Imre Vadász [Sun, 1 May 2016 15:10:45 +0000 (17:10 +0200)]
gpio_intel: Slightly simplify interface to chipset-specific code.

* The intidx value in struct pin_intr_map is slightly redundant at the
  moment, but it avoids needless lookups for now.

4 years agogpio_intel: Use a cookie object for gpio interrupt allocation as well.
Imre Vadász [Sat, 30 Apr 2016 20:07:57 +0000 (22:07 +0200)]
gpio_intel: Use a cookie object for gpio interrupt allocation as well.

* This tries to improve the gpio_if.m api, e.g. only the interrupt pin
  allocation can legitimately fail. The interrupt setup and teardown
  functions can't really fail for proper input values (and for bogus
  arguments it can just panic).

4 years agosys/dev/disk/dm: Remove read/write support for /dev/mapper/control
Tomohiro Kusumi [Sun, 1 May 2016 00:12:10 +0000 (09:12 +0900)]
sys/dev/disk/dm: Remove read/write support for /dev/mapper/control

It's obvious that /dev/mapper/control has nothing to read/write.
Running below results in kernel panic as the code requires properly
initialized a per-table lock while this chrdev has no tables mapped.
(control chrdev and dm blkdevs use the same dm device structures)

-----
 [root@]~# cat ./dm1.c
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <fcntl.h>
 int main(void)
 {
         int fd;
         char buf[1024];
         fd = open("/dev/mapper/control", O_RDWR);
         if (fd == -1) {
                 perror("open");
                 exit(1);
         }
         if (read(fd, buf, sizeof(buf)) == -1)
                 perror("read");
         if (write(fd, buf, sizeof(buf)) == -1)
                 perror("write");
         close(fd);
         return 0;
 }

With this commit.
-----
 [root@]~# uname
 DragonFly
 [root@]~# kldload dm
 [root@]~# ls -l /dev/mapper/control
 crw-r-----  1 root  operator   65, 0x00000000 May  1 09:25 /dev/mapper/control
 [root@]~# gcc -Wall -g ./dm1.c -o ./dm1
 [root@]~# ./dm1
 read: Operation not supported by device
 write: Operation not supported by device

With Linux kernel.
-----
 [root@localhost]~# uname
 Linux
 [root@localhost]~# ls -l /dev/mapper/control
 crw-rw---- 1 root root 10, 236 Apr 25 12:44 /dev/mapper/control
 [root@localhost]~# gcc -Wall -g ./dm1.c -o ./dm1
 [root@localhost]~# ./dm1
 read: Invalid argument
 write: Invalid argument

4 years agogpio_acpi: Introduce separate setup_intr and teardown_intr functions.
Imre Vadász [Fri, 29 Apr 2016 20:32:09 +0000 (22:32 +0200)]
gpio_acpi: Introduce separate setup_intr and teardown_intr functions.

* This allows us to actually reserve the gpio pin before, and separately
  from actually setting up the interrupt handler.

* XXX This interface is still a bit inconvenient to use, because the
  code allows gpio_setup_intr to fail. Instead the gpio_alloc_intr
  function should be returning a cookie to use for gpio_setup_intr
  (which could obviously never fail then).

4 years agolibstand: Fix -Wstrict-prototypes warning.
Sascha Wildner [Fri, 29 Apr 2016 14:02:44 +0000 (16:02 +0200)]
libstand: Fix -Wstrict-prototypes warning.

4 years agosys/boot: Fix a prototype (pointed out by zrj).
Sascha Wildner [Fri, 29 Apr 2016 12:05:07 +0000 (14:05 +0200)]
sys/boot: Fix a prototype (pointed out by zrj).

4 years agosys/boot: Ansify the remaining cases found by -Wold-style-definition.
Sascha Wildner [Fri, 29 Apr 2016 08:42:56 +0000 (10:42 +0200)]
sys/boot: Ansify the remaining cases found by -Wold-style-definition.

4 years agoboot/common: Clean up, ansify some functions, remove unneeded statements.
Imre Vadász [Thu, 28 Apr 2016 20:54:08 +0000 (22:54 +0200)]
boot/common: Clean up, ansify some functions, remove unneeded statements.

* No functional changes.

* Change some int variables into size_t in boot/common/module.c.

* Use MAX macro.

4 years agodrm/radeon: Retire old UMS driver.
zrj [Thu, 28 Apr 2016 16:29:22 +0000 (19:29 +0300)]
drm/radeon: Retire old UMS driver.

Cleanup before next, removed upstream.

4 years agotcp: Count connections by TCP state
Sepherosa Ziehau [Thu, 28 Apr 2016 14:37:58 +0000 (22:37 +0800)]
tcp: Count connections by TCP state

Inspired-by: FreeBSD 'netstat -s -p tcp' output
4 years agoUse size_t to remove casts.
zrj [Thu, 28 Apr 2016 13:09:18 +0000 (16:09 +0300)]
Use size_t to remove casts.

While there, perform some style(9) fixes.

No functional change.

4 years agoexamples: Add binary firmware wrapping reference script.
zrj [Tue, 26 Apr 2016 14:30:32 +0000 (17:30 +0300)]
examples: Add binary firmware wrapping reference script.

Mainly to keep base with dports synchronized.
Also could be used while developing drivers to quickly make
firmware modules for testing.

4 years agoboot/loader: Handle the /boot/modules.local
zrj [Tue, 26 Apr 2016 14:28:27 +0000 (17:28 +0300)]
boot/loader: Handle the /boot/modules.local

Weather /boot/modules.local is used during boot or by kldload(8)
is controlled by a new "local_modules" loader variable.

If local_modules is set to "YES", /boot/modules.local is also
appended to kern.module_path sysctl variable for use by kldload(8).
Setting variable to any other value disables that.

By default allow modules to searched in /boot/modules.local directory
since it does not shadow the default kernel modules and has lower
directory search priority.

4 years agomtree: Create /boot/modules.local
zrj [Tue, 26 Apr 2016 13:53:23 +0000 (16:53 +0300)]
mtree: Create /boot/modules.local

Intended for external modules and firmware e.g. from dports or for
user driver testing to keep base system clean during development.

This directory does not get affected when upgrading base system.

4 years agosys/kern: Add comment on unmounting
Tomohiro Kusumi [Thu, 28 Apr 2016 04:34:00 +0000 (13:34 +0900)]
sys/kern: Add comment on unmounting

4 years agoahci: Add and use AHCI_PREG_SCTL_IPM_NODEVSLP definition from ahci-1.3.1.
Imre Vadász [Sat, 23 Apr 2016 11:23:14 +0000 (13:23 +0200)]
ahci: Add and use AHCI_PREG_SCTL_IPM_NODEVSLP definition from ahci-1.3.1.

* The DevSleep interface power saving state was introduced with the
  ahci-1.3.1 specification. However actual DevSleep support needs to be
  recognized via the AHCI_REG_CAP2_SDS bit, since many controllers
  identifying as ahci-1.3 already support DevSleep.

* Since the correct bitmask to use in the AHCI_PREG_SCTL_IPM field
  for disabling all power-management features depends on DevSleep support,
  store that precomputed value in sc->sc_ipm_disable.

* Make some operations on the AHCI_PREG_SCTL_IPM_* bitfield a bit clearer.

* While there add AHCI_PREG_CMD_ICC_DEVSLEEP definition.

4 years agotcp: No need to return tcpcb from tcp_newtcpcb()
Sepherosa Ziehau [Wed, 27 Apr 2016 12:54:34 +0000 (20:54 +0800)]
tcp: No need to return tcpcb from tcp_newtcpcb()

4 years agotcp: Remove redundant tcpcb state setting
Sepherosa Ziehau [Wed, 27 Apr 2016 12:49:50 +0000 (20:49 +0800)]
tcp: Remove redundant tcpcb state setting

4 years agodhclient: Log a warning instead of bailing upon "illegal" options
Sepherosa Ziehau [Wed, 27 Apr 2016 12:41:20 +0000 (20:41 +0800)]
dhclient: Log a warning instead of bailing upon "illegal" options

Obtained-from: FreeBSD  r298385

4 years agoSync zoneinfo database with tzdata2016d from ftp://ftp.iana.org/tz/releases
Sascha Wildner [Tue, 26 Apr 2016 17:28:52 +0000 (19:28 +0200)]
Sync zoneinfo database with tzdata2016d from ftp://ftp.iana.org/tz/releases

* America/Caracas switches from -0430 to -04 on 2016-05-01 at 02:30.
    (Thanks to Alexander Krivenyshev for the heads-up.)

* Asia/Magadan switched from +10 to +11 on 2016-04-24 at 02:00.
    (Thanks to Alexander Krivenyshev and Matt Johnson.)

* New zone Asia/Tomsk, split off from Asia/Novosibirsk.  It covers
    Tomsk Oblast, Russia, which switches from +06 to +07 on 2016-05-29
    at 02:00.  (Thanks to Stepan Golosunov.)

* New zone Europe/Kirov, split off from Europe/Volgograd.  It covers
    Kirov Oblast, Russia, which switched from +04/+05 to +03/+04 on
    1989-03-26 at 02:00, roughly a year after Europe/Volgograd made
    the same change.  (Thanks to Stepan Golosunov.)

* Russia and nearby locations had daylight-saving transitions on
    1992-03-29 at 02:00 and 1992-09-27 at 03:00, instead of on
    1992-03-28 at 23:00 and 1992-09-26 at 23:00.  (Thanks to Stepan
    Golosunov.)

* Many corrections to historical time in Kazakhstan from 1991
    through 2005.  (Thanks to Stepan Golosunov.)  Replace Kazakhstan's
    invented time zone abbreviations with numeric abbreviations.

* Mention Internet RFCs 7808 (TZDIST) and 7809 (CalDAV time zone references).

4 years agoigb: Fix MSI-X allocation when # of rings is less than # of cpus
Sepherosa Ziehau [Tue, 26 Apr 2016 12:57:42 +0000 (20:57 +0800)]
igb: Fix MSI-X allocation when # of rings is less than # of cpus

Dragonfly-bug: http://bugs.dragonflybsd.org/issues/2902

4 years agohier.7: Add missing /etc/devd entry.
zrj [Tue, 26 Apr 2016 06:24:28 +0000 (09:24 +0300)]
hier.7: Add missing /etc/devd entry.

There is also empty /etc/X11 /etc/skell in BSD.root.dist
and documented /pfs/ not in BSD.root.dist

4 years agomtree: Move pam.d to correct dirname order.
zrj [Fri, 22 Apr 2016 14:52:09 +0000 (17:52 +0300)]
mtree: Move pam.d to correct dirname order.

Reduces diffs when comparing with BSD.X.new

4 years agodrm/i915: Remove a duplicated assignment
François Tigeot [Mon, 25 Apr 2016 08:55:01 +0000 (10:55 +0200)]
drm/i915: Remove a duplicated assignment

Noticed-by: davshao, issue #2903
4 years agoSync ACPICA with Intel's version 20160422.
Sascha Wildner [Sun, 24 Apr 2016 22:18:12 +0000 (00:18 +0200)]
Sync ACPICA with Intel's version 20160422.

* Fixed AcpiHwRead/AcpiHwWrite regression from 20160318. It was
  insufficiently worked around by me in 3b9bfd22b87e14, but was
  still causing issues with qemu (as reported by zrj).

* Support for I2cSerialBusV2, SpiSerialBusV2 and UartSerialBusV2.
  The original non-V2 names are deprecated. V2 macros have one
  new argument.

* Support for new integer field in _BIX's returned package object.

* New PCCT subtable (HW-Reduced Comm Subspace Type2).

* Various improvements to iASL.

For a more detailed list, please see sys/contrib/dev/acpica/changes.txt.

Tested-by: ivadasz, zrj
4 years agosys/vfs/tmpfs: Remove unused mount variables
Tomohiro Kusumi [Sun, 24 Apr 2016 19:39:56 +0000 (04:39 +0900)]
sys/vfs/tmpfs: Remove unused mount variables