dragonfly.git
7 years agosbin/hammer: Remove get_node()
Tomohiro Kusumi [Mon, 26 Sep 2016 00:51:45 +0000 (09:51 +0900)]
sbin/hammer: Remove get_node()

Just call get_data_buffer(offset, &buffer, 0) like other data do.

7 years agosbin/hammer: Make get_node() a wrapper over get_buffer_data()
Tomohiro Kusumi [Sun, 25 Sep 2016 22:20:44 +0000 (07:20 +0900)]
sbin/hammer: Make get_node() a wrapper over get_buffer_data()

get_node() which is only used by hammer show/blockmap commands should
be a wrapper over the existing get_buffer_data().

It needs to do rel_buffer() if the given offset is out of range when
*bufferp is non NULL. Adding this check makes this function equivalent
of get_buffer_data() with 0 for isnew. isnew must be 0 because this
function assumes and only works when the B-Tree node already exists.

This doesn't change anything because hammer show/blockmap always give
NULL for *bufferp, but it should still be changed.

7 years agolocaledef: Improve cc_list parsing
John Marino [Thu, 6 Oct 2016 15:46:50 +0000 (10:46 -0500)]
localedef: Improve cc_list parsing

I had originally suspected the parsing of ctype definition files as being
the source of the ctype flag mis-definitions, but it wasn't.  In the
process, I simplified the cc_list parsing so I'm committing the no-impact
improvement separately.  It removes some parsing redundancies and
won't parse partial range definitions anymore.

7 years agolocaledef: Fix ctype dump (fixed wide spread errors)
John Marino [Thu, 6 Oct 2016 15:37:06 +0000 (10:37 -0500)]
localedef: Fix ctype dump (fixed wide spread errors)

This was a CTYPE encoding error involving consecutive points of the same
ctype.  It was reported by myself to Illumos over a year ago but I was
unsure if it was only happening on BSD.  Given the cause, the bug is also
present on Illumos.

Basically, if consecutive points were of the exact same ctype, they would
be defined as a range regardless.  For example, all of these would be
considered equivalent:

  <A> ... <C>, <H>  (converts to <A> .. <H>)
  <A>, <B>, <H>     (converts to <A> .. <H>)
  <A>, <J> ... <H>  (converts to <A> .. <H>)

So all the points that shouldn't have been defined got "bridged" by the
extreme points.

The effects were recently reported to FreeBSD on PR 213013.  There are
countless places were the ctype flags are misdefined, so this is a major
fix that has to be MFC'd.

7 years agoif_iwm - Enable Energy Based Scan (EBS).
Imre Vadász [Wed, 5 Oct 2016 20:31:35 +0000 (22:31 +0200)]
if_iwm - Enable Energy Based Scan (EBS).

* This can significantly reduce scan duration thus saving time and power.
  EBS failure reported by FW disables EBS for current connection. It is
  re-enabled upon new connection attempt on any WLAN interface.

Taken-From: Linux iwlwifi

7 years agoif_iwm - GC unused code from if_iwm_scan.c, copyied from iwn or iwlwifi/dvm.
Imre Vadász [Wed, 5 Oct 2016 18:40:23 +0000 (20:40 +0200)]
if_iwm - GC unused code from if_iwm_scan.c, copyied from iwn or iwlwifi/dvm.

7 years agoif_iwm - Tiny cleanup in iwm_rx_addbuf().
Imre Vadász [Wed, 5 Oct 2016 11:29:12 +0000 (13:29 +0200)]
if_iwm - Tiny cleanup in iwm_rx_addbuf().

7 years agoif_iwm - Make ucode capabilities and api flags handling more like iwlwifi.
Imre Vadász [Tue, 4 Oct 2016 22:41:41 +0000 (00:41 +0200)]
if_iwm - Make ucode capabilities and api flags handling more like iwlwifi.

Taken-From: Linux iwlwifi

7 years agoif_iwm - Remove a couple of unneeded IWM_UCODE_TLV_FLAGS_* flags.
Imre Vadász [Tue, 4 Oct 2016 21:05:19 +0000 (23:05 +0200)]
if_iwm - Remove a couple of unneeded IWM_UCODE_TLV_FLAGS_* flags.

* All the supported firmwares have these flags set.

* This removes the following flags:
    IWM_UCODE_TLV_FLAGS_PM_CMD_SUPPORT,
    IWM_UCODE_TLV_FLAGS_NEWBT_COEX,
    IWM_UCODE_TLV_FLAGS_BF_UPDATED,
    IWM_UCODE_TLV_FLAGS_D3_CONTINUITY_API,
    IWM_UCODE_TLV_FLAGS_STA_KEY_CMD,
    IWM_UCODE_TLV_FLAGS_DEVICE_PS_CMD,
    IWM_UCODE_TLV_FLAGS_SCHED_SCAN,
    IWM_UCODE_TLV_FLAGS_RX_ENERGY_API,
    IWM_UCODE_TLV_FLAGS_TIME_EVENT_API_V2

* Also remove definitions and code for dealing with the v1 time-event api.

* Remove unneeded calc_rssi() function.

Taken-From: Linux iwlwifi

7 years agoSync ACPICA with Intel's version 20160930.
Sascha Wildner [Tue, 4 Oct 2016 19:25:31 +0000 (21:25 +0200)]
Sync ACPICA with Intel's version 20160930.

* Increase maximum loop count before AE_AML_INFINITE_LOOP exception to
  1048575.

* iasl: Correctly handle unresolved symbols in the hardware map file.

* iasl: Support for control method invocation as an operand of DeRefOf().

* Various improvements and some issues fixed.

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

7 years agoLibreSSL: complete update v2.4.2 => v2.4.3
John Marino [Mon, 3 Oct 2016 19:31:45 +0000 (14:31 -0500)]
LibreSSL: complete update v2.4.2 => v2.4.3

7 years agoMerge branch 'vendor/LIBRESSL'
John Marino [Mon, 3 Oct 2016 19:58:14 +0000 (14:58 -0500)]
Merge branch 'vendor/LIBRESSL'

7 years agoUpdate LibreSSL from version 2.4.2 => 2.4.3
John Marino [Mon, 3 Oct 2016 19:23:51 +0000 (14:23 -0500)]
Update LibreSSL from version 2.4.2 => 2.4.3

7 years agomtree(8): Fix wrong extern.
Sascha Wildner [Mon, 3 Oct 2016 17:56:42 +0000 (19:56 +0200)]
mtree(8): Fix wrong extern.

Done wrong by me in b4b8669d4991221d7aafe58b020346a1746d1ead.

Reported-by: zrj
7 years agoRelocate private panel library to intended location
John Marino [Mon, 3 Oct 2016 16:19:47 +0000 (11:19 -0500)]
Relocate private panel library to intended location

The only consumer of libpanel is the DF installer.  It wasn't installed in
the correct private area, but the linker found it anyway on the standard
search path.  Fix the installation location and task "make upgrade" to
remove the publically installed private libraries.

7 years agopc64: Fix typo in wrmsr_safe.
Imre Vadász [Mon, 3 Oct 2016 12:41:29 +0000 (14:41 +0200)]
pc64: Fix typo in wrmsr_safe.

7 years agoUse <termios.h> instead of the deprecated <sys/termios.h>.
Sascha Wildner [Mon, 3 Oct 2016 12:09:18 +0000 (14:09 +0200)]
Use <termios.h> instead of the deprecated <sys/termios.h>.

7 years agoSplit out <sys/_termios.h> for struct termios and the flags.
Sascha Wildner [Mon, 3 Oct 2016 12:08:15 +0000 (14:08 +0200)]
Split out <sys/_termios.h> for struct termios and the flags.

termios.h includes it and has the C library interface.

Similar to what FreeBSD did. No functional change.

7 years agoif_iwm - Move mbuf hacks after sanity checks in iwm_mvm_rx_rx_mpdu().
Imre Vadász [Mon, 3 Oct 2016 10:21:53 +0000 (12:21 +0200)]
if_iwm - Move mbuf hacks after sanity checks in iwm_mvm_rx_rx_mpdu().

* This avoids leaving the mbuf in a weird state, when dropping a packet.

7 years agoRemove old timezone via 'make upgrade'.
Sascha Wildner [Sun, 2 Oct 2016 00:28:09 +0000 (02:28 +0200)]
Remove old timezone via 'make upgrade'.

7 years agobsd-family-tree: Sync with FreeBSD (various NetBSD versions).
Sascha Wildner [Sun, 2 Oct 2016 00:29:17 +0000 (02:29 +0200)]
bsd-family-tree: Sync with FreeBSD (various NetBSD versions).

7 years agosys/dev/disk/dm: Remove default:break for switch enums on kldload
Tomohiro Kusumi [Sat, 1 Oct 2016 21:20:55 +0000 (06:20 +0900)]
sys/dev/disk/dm: Remove default:break for switch enums on kldload

This could be reverted as compilers may warn if not all enum elements
are covered, but some dm targets don't have default case on loading,
and it's been working. Compiles with LINT64.

7 years agosys/dev/disk/dm: Remove #if0'd dmminphys() from NetBSD
Tomohiro Kusumi [Wed, 21 Sep 2016 02:36:51 +0000 (11:36 +0900)]
sys/dev/disk/dm: Remove #if0'd dmminphys() from NetBSD

This is specific to NetBSD, so we can remove this.

7 years agosys/dev/disk/dm: Cleanup
Tomohiro Kusumi [Wed, 21 Sep 2016 02:29:49 +0000 (11:29 +0900)]
sys/dev/disk/dm: Cleanup

7 years agoif_iwm - Get rid of struct iwm_rx_data argument for iwm_mvm_rx_rx_mpdu.
Imre Vadász [Sat, 1 Oct 2016 15:18:45 +0000 (17:18 +0200)]
if_iwm - Get rid of struct iwm_rx_data argument for iwm_mvm_rx_rx_mpdu.

7 years agoExpose ld.bfd and ld.gold
John Marino [Sat, 1 Oct 2016 00:26:59 +0000 (19:26 -0500)]
Expose ld.bfd and ld.gold

It's now expected that ld, ld.bfd, and ld.gold are all installed by
modern binutils.  The -fuse-gold option on GCC depends on it (both from
base and ports) and possibly clang as well.  This work is 6 months old,
but it was never committed as collect2 utility was only recently
built and installed.

Discussed with: dillon (6 months ago).

7 years agoSync zoneinfo database with tzdata2016g from ftp://ftp.iana.org/tz/releases
Sascha Wildner [Thu, 29 Sep 2016 17:39:30 +0000 (19:39 +0200)]
Sync zoneinfo database with tzdata2016g from ftp://ftp.iana.org/tz/releases

* Turkey switched from EET/EEST (+02/+03) to permanent +03,
    effective 2016-09-07.  (Thanks to Burak AYDIN.)  Use "+03" rather
    than an invented abbreviation for the new time.

* New leap second 2016-12-31 23:59:60 UTC as per IERS Bulletin C 52.
    (Thanks to Tim Parenti.)

* For America/Los_Angeles, spring-forward transition times have been
    corrected from 02:00 to 02:01 in 1948, and from 02:00 to 01:00 in
    1950-1966.

* For zones using Soviet time on 1919-07-01, transitions to UT-based
    time were at 00:00 UT, not at 02:00 local time.  The affected
    zones are Europe/Kirov, Europe/Moscow, Europe/Samara, and
    Europe/Ulyanovsk.  (Thanks to Alexander Belopolsky.)

* The Factory zone now uses the time zone abbreviation -00 instead
    of a long English-language string, as -00 is now the normal way to
    represent an undefined time zone.

* Several zones in Antarctica and the former Soviet Union, along
    with zones intended for ships at sea that cannot use POSIX TZ
    strings, now use numeric time zone abbreviations instead of
    invented or obsolete alphanumeric abbreviations.  The affected
    zones are Antarctica/Casey, Antarctica/Davis,
    Antarctica/DumontDUrville, Antarctica/Mawson, Antarctica/Rothera,
    Antarctica/Syowa, Antarctica/Troll, Antarctica/Vostok,
    Asia/Anadyr, Asia/Ashgabat, Asia/Baku, Asia/Bishkek, Asia/Chita,
    Asia/Dushanbe, Asia/Irkutsk, Asia/Kamchatka, Asia/Khandyga,
    Asia/Krasnoyarsk, Asia/Magadan, Asia/Omsk, Asia/Sakhalin,
    Asia/Samarkand, Asia/Srednekolymsk, Asia/Tashkent, Asia/Tbilisi,
    Asia/Ust-Nera, Asia/Vladivostok, Asia/Yakutsk, Asia/Yekaterinburg,
    Asia/Yerevan, Etc/GMT-14, Etc/GMT-13, Etc/GMT-12, Etc/GMT-11,
    Etc/GMT-10, Etc/GMT-9, Etc/GMT-8, Etc/GMT-7, Etc/GMT-6, Etc/GMT-5,
    Etc/GMT-4, Etc/GMT-3, Etc/GMT-2, Etc/GMT-1, Etc/GMT+1, Etc/GMT+2,
    Etc/GMT+3, Etc/GMT+4, Etc/GMT+5, Etc/GMT+6, Etc/GMT+7, Etc/GMT+8,
    Etc/GMT+9, Etc/GMT+10, Etc/GMT+11, Etc/GMT+12, Europe/Kaliningrad,
    Europe/Minsk, Europe/Samara, Europe/Volgograd, and
    Indian/Kerguelen.  For Europe/Moscow the invented abbreviation MSM
    was replaced by +05, whereas MSK and MSD were kept as they are not
    our invention and are widely used.

* Rename Asia/Rangoon to Asia/Yangon, with a backward compatibility link.
    (Thanks to David Massoud.)

* Comments now cite URLs for some 1917-1921 Russian DST decrees.
    (Thanks to Alexander Belopolsky.)

7 years agoAdd HISTORY sections in most sbin/ manual pages.
Sascha Wildner [Thu, 29 Sep 2016 17:10:46 +0000 (19:10 +0200)]
Add HISTORY sections in most sbin/ manual pages.

Submitted-by: Sevan Janiyan
Dragonfly-bug: <https://bugs.dragonflybsd.org/issues/2950>

7 years agokernel: Explicitly exclude -flto cflags for genassym.c
zrj [Thu, 29 Sep 2016 14:06:52 +0000 (17:06 +0300)]
kernel: Explicitly exclude -flto cflags for genassym.c

Causes all defines to be detected as 0x0. Try to avoid that. For now
it is unclear why nm(1) output format differs on -flto objects.

7 years agousb4bsd: Fix compilation with -flto.
zrj [Thu, 29 Sep 2016 13:18:11 +0000 (16:18 +0300)]
usb4bsd: Fix compilation with -flto.

usbd_lookup_id_by_uaa() takes const so use const in declaration.
Using -flto caused lto_wrapper to complain about:
error: uftdi_devs causes a section type conflict with urio_devs (TBI).

7 years agocxm(4): Fix type mismatches on firmware variables.
zrj [Thu, 29 Sep 2016 12:59:31 +0000 (15:59 +0300)]
cxm(4): Fix type mismatches on firmware variables.

This one is strange, uses casts to uint32_t.
Add attributes to prototypes too.
While there, switch to __aligned(x) for attributes.

Noticed while playing with -flto on LINT64 kernel configuration.

7 years agokernel/smbfs: Fix type mismatches for smbfs_pbuf_freecnt.
zrj [Thu, 29 Sep 2016 12:35:44 +0000 (15:35 +0300)]
kernel/smbfs: Fix type mismatches for smbfs_pbuf_freecnt.

Mostly used for getpbuf_kva() that takes int*.
Noticed while playing with -flto on LINT64 kernel configuration.

7 years agokernel/adv: Fix extern type to match the real one.
zrj [Thu, 29 Sep 2016 12:00:46 +0000 (15:00 +0300)]
kernel/adv: Fix extern type to match the real one.

Noticed while playing with -flto enabled kernel compilation.

7 years agogcc50: Compile and install collect2 utility.
zrj [Thu, 29 Sep 2016 08:20:33 +0000 (11:20 +0300)]
gcc50: Compile and install collect2 utility.

Enables few extra features and only costs <20s on buildworld time.

7 years ago<sys/cdefs.h> Also add __malloclike to lint case.
zrj [Thu, 29 Sep 2016 05:27:24 +0000 (08:27 +0300)]
<sys/cdefs.h> Also add __malloclike to lint case.

Fixes: $ echo "#include <stdlib.h>" | gcc -Wall -Wextra -Dlint -c -xc -

7 years agokernel - Remove mplock from KTRACE paths
Matthew Dillon [Tue, 27 Sep 2016 21:39:03 +0000 (14:39 -0700)]
kernel - Remove mplock from KTRACE paths

* The mplock is no longer needed for KTRACE, ktrace writes are serialized
  by the vnode lock and everything else is MPSAFE.  Note that this change
  means that even fast system calls may interleave in the ktrace output on
  a multi-threaded program.

* Fix ktrace bug related to vkernels.  The syscall2() code assumes that
  no tokens are held on entry (since we are coming from usermode), but
  a system call made from the vkernel may actually be nested inside
  another syscall2().  The mplock KTRACE held caused this to assert in
  the nested syscall2().  The removal of the mplock from the ktrace path
  also fixes this bug.

* Minor comment adjustment in vm_vmspace.c.

Reported-by: tuxillo
7 years agocpuctl(4): Require write rights for CPUCTL_MSRSBIT and CPUCTL_MSRCBIT.
Imre Vadász [Mon, 26 Sep 2016 23:44:43 +0000 (01:44 +0200)]
cpuctl(4): Require write rights for CPUCTL_MSRSBIT and CPUCTL_MSRCBIT.

* Both CPUCTL_MSRSBIT and CPUCTL_MSRCBIT write MSR registers, so they
  should require write rights like CPUCTL_WRMSR.

7 years agokernel/vmx - Add a missing lwkt_reltoken()
Antonio Huete Jimenez [Mon, 26 Sep 2016 22:45:50 +0000 (00:45 +0200)]
kernel/vmx - Add a missing lwkt_reltoken()

7 years agoif_iwm - Get rid of some more superfluous bus_dmamap_sync calls in rx path.
Imre Vadász [Mon, 26 Sep 2016 20:54:02 +0000 (22:54 +0200)]
if_iwm - Get rid of some more superfluous bus_dmamap_sync calls in rx path.

7 years agokernel - Change IPI recovery watchdog
Matthew Dillon [Mon, 26 Sep 2016 18:09:49 +0000 (11:09 -0700)]
kernel - Change IPI recovery watchdog

* Change the default recovery watchdog timeout for IPIs from 1/16 second
  to 2 seconds and the repeated timeout from 1/2 second to 2 seconds.

* Add missing initialization to pmap_inval_smp_cmpset(), without it an
  improper watchdog timeout/retry could occur.

* This still may not fix issues with VMs when core threads cause extreme
  latencies on the host.

Reported-by: zach
7 years agolibc_r: Tiny adjustment, git add.
zrj [Mon, 26 Sep 2016 10:34:38 +0000 (13:34 +0300)]
libc_r: Tiny adjustment, git add.

Got lost for fdc2e97852d952eedc66a271c9ae1c12f246934b

7 years agolibpthread: Some more adjustments for pthread_attr_setschedpolicy().
Sascha Wildner [Mon, 26 Sep 2016 09:46:01 +0000 (11:46 +0200)]
libpthread: Some more adjustments for pthread_attr_setschedpolicy().

* Adjust libc_r too.

* Remove unneeded braces.

* Adjust manual page.

7 years agoif_iwm - Add support for Firmware paging, needed for newer 8000C firmware.
Imre Vadász [Sun, 25 Sep 2016 00:32:05 +0000 (02:32 +0200)]
if_iwm - Add support for Firmware paging, needed for newer 8000C firmware.

* Uses the IWM_FW_PAGING_BLOCK_CMD firmware command to tell the firmware
  what memory ranges to use for paging.

Taken-From: Linux iwlwifi

7 years agoif_iwm - Move iwm_dma_contig_alloc/_free functions to if_iwm_util.c.
Imre Vadász [Sun, 25 Sep 2016 00:25:37 +0000 (02:25 +0200)]
if_iwm - Move iwm_dma_contig_alloc/_free functions to if_iwm_util.c.

7 years agopthread: Split pthread_exit() to smaller chunks.
zrj [Mon, 19 Sep 2016 10:20:47 +0000 (13:20 +0300)]
pthread: Split pthread_exit() to smaller chunks.

To see what is needed for thread unwind support.

7 years agopthread: Split mutex_init().
zrj [Mon, 19 Sep 2016 09:33:40 +0000 (12:33 +0300)]
pthread: Split mutex_init().

Makes it easier to see what is needed for PTHREAD_PROCESS_SHARED
support, that it is plenty..

7 years agopthread: Prefer explicit return on error.
zrj [Mon, 19 Sep 2016 08:41:17 +0000 (11:41 +0300)]
pthread: Prefer explicit return on error.

Easier to follow the logic.

7 years agopthread: Set default contention scope to system.
zrj [Mon, 19 Sep 2016 06:13:28 +0000 (09:13 +0300)]
pthread: Set default contention scope to system.

It is a bit unclear how scope was handled previously.
Make it explicit to see what falls down.

7 years agopthread: Use spin hint for cpu on x86_64 too.
zrj [Mon, 19 Sep 2016 05:45:39 +0000 (08:45 +0300)]
pthread: Use spin hint for cpu on x86_64 too.

Looks like missed case in initial port to x864_64.

Pointed-by: swildner
7 years agopthread: Move few attr private structs to thr_init.c
zrj [Mon, 19 Sep 2016 05:14:59 +0000 (08:14 +0300)]
pthread: Move few attr private structs to thr_init.c

These symbols should only be available if _thread_init() gets linked in.
Helps with -static troubleshooting.

7 years agopthread: Add vprintf variant of _thread_printf, reformat PANIC()
zrj [Fri, 16 Sep 2016 13:47:17 +0000 (16:47 +0300)]
pthread: Add vprintf variant of _thread_printf, reformat PANIC()

Cleans up intermediate writes.

Taken-from: FreeBSD

7 years agopthread: Fix some warnings, do not raise WARNS to 6.
zrj [Fri, 16 Sep 2016 13:09:34 +0000 (16:09 +0300)]
pthread: Fix some warnings, do not raise WARNS to 6.

Using -Os will create lots of -Winline, thus leave at 5 by default.
Sorry for __is_threaded.

7 years agopthread: Collect separated mutex functions.
zrj [Fri, 16 Sep 2016 11:49:05 +0000 (14:49 +0300)]
pthread: Collect separated mutex functions.

Split and integrate them into thr_mutex.c and thr_mutexattr.c
just as it is currently in FreeBSD to reduce diffs.

7 years agopthread: Change single weak reference to strong one.
zrj [Fri, 16 Sep 2016 10:25:28 +0000 (13:25 +0300)]
pthread: Change single weak reference to strong one.

Mainly to match libc_r and have only strong references in libthread_xu.

7 years agopthread: Move out pthread_md.c from x86_64 dir to common code.
zrj [Fri, 16 Sep 2016 09:58:32 +0000 (12:58 +0300)]
pthread: Move out pthread_md.c from x86_64 dir to common code.

This leaves only assembly code in arch specific dir.
Similary as it was done on FreeBSD.

7 years agopthread: Fix return value for pthread_attr_setschedpolicy()
zrj [Fri, 16 Sep 2016 09:26:04 +0000 (12:26 +0300)]
pthread: Fix return value for pthread_attr_setschedpolicy()

There are to possible interpretations of ENOTSUP in POSIX specs.
After some research and trial and error testing for now stick to:
on unsupported [known] attribute ENOTSUP should be returned.
Check sched parameters explictly.

While there, rename too generic local variable 'local' and
move up the <sys/syscall.h> include.

7 years agopthread: General pre-cleanup (style, typos etc)
zrj [Fri, 16 Sep 2016 09:18:50 +0000 (12:18 +0300)]
pthread: General pre-cleanup (style, typos etc)

No functional change.

7 years agopthread: Sync copyright changes with FreeBSD.
zrj [Fri, 16 Sep 2016 09:12:34 +0000 (12:12 +0300)]
pthread: Sync copyright changes with FreeBSD.

Taken-from: FreeBSD

7 years agowpa_supplicant: Avoid cpp warning during buildworld.
zrj [Sun, 25 Sep 2016 16:02:15 +0000 (19:02 +0300)]
wpa_supplicant: Avoid cpp warning during buildworld.

Used MIN() macro is essentially the same to one in sys/param.h but
for the sake of argument it is better to avoid warning by simply
using system header variant.

Note: there is issue with WPA_OUI_TYPE definition so leave WANRS at 0.

7 years agoOpenSSH: Add missing prototypes and bump WARNS to 3.
zrj [Sun, 25 Sep 2016 15:23:42 +0000 (18:23 +0300)]
OpenSSH: Add missing prototypes and bump WARNS to 3.

Just include sshlogin.h header and make two functions static (used locally).

7 years agoOpenSSH: Suppress last warning in session.c
zrj [Sun, 25 Sep 2016 15:10:27 +0000 (18:10 +0300)]
OpenSSH: Suppress last warning in session.c

Use __DECONST() trick, that is safe here because login_getcapstr() either
returns copy on success or error string that in this case is passed as
def_nl and checked if return pointer is != def_nl.

7 years agoOpenSSH: Suppress warning on login_getcapstr().
zrj [Sun, 25 Sep 2016 15:04:35 +0000 (18:04 +0300)]
OpenSSH: Suppress warning on login_getcapstr().

Taken-from: FreeBSD (r255767 hidden in merge commit)

7 years agogcc47: Suppress last codegen warning.
zrj [Sun, 25 Sep 2016 14:19:48 +0000 (17:19 +0300)]
gcc47: Suppress last codegen warning.

Turns out gcc(compilation as C) differentiates when initializing global variables that
are declared 'extern' on the same line (removal of extern attribute is ok, includes
c-common.h header that properly marks c_family_lang_mask global variable as extern).

Note: do not apply same change to gcc50 since it is compiled as C++ that is not affected.

7 years agogcc47: Fix misplaced NULL usage in strings.
zrj [Sun, 25 Sep 2016 14:17:32 +0000 (17:17 +0300)]
gcc47: Fix misplaced NULL usage in strings.

Specific to c++, just do not do it.

7 years agogcc47: Backport objc fix from gcc trunk.
zrj [Sun, 25 Sep 2016 13:37:22 +0000 (16:37 +0300)]
gcc47: Backport objc fix from gcc trunk.

This prevents spurious warnings when compiling with gcc50.
Fix is needed for objc ABI inline semantics.
Also why we even provide objc language support in base?

Taken-from: gcc trunk (trunk@220175)

7 years agogcc47: Prevent -Wswitch-bool noise.
zrj [Sun, 25 Sep 2016 13:00:29 +0000 (16:00 +0300)]
gcc47: Prevent -Wswitch-bool noise.

In gcc v5 and later -Wswitch-bool is default and creates a lot of
warnings when building gcc v4.7 with gcc v5 compiler.
Since backporting patches to generate "compatible" gcc private headers
would be very error-prune, just take lkml.org/2015/5/27/941 approach.
At this point we only need to catch real issues for backup compiler.

7 years agocrunchgen(1): Fix few spurious warnings.
zrj [Sun, 25 Sep 2016 12:48:16 +0000 (15:48 +0300)]
crunchgen(1): Fix few spurious warnings.

Just add prototypes to help compiler detecting real bugs and not
pollute build logs with false positives.

Note: made crunch_help() static, seems to be fine.

7 years agolibncurses: Set WANRS at 5.
zrj [Sun, 25 Sep 2016 11:13:23 +0000 (14:13 +0300)]
libncurses: Set WANRS at 5.

Turns out private libncurses was completely ignoring WARNS and running loose,
so after previous few changes connect to global lib/Makefile.inc and set
WARNS at 5 (6 is an overkill, also does not survive FORMAT_AUDIT).

7 years agolibncurses: Avoid warning when calling cgetent().
zrj [Sun, 25 Sep 2016 11:08:29 +0000 (14:08 +0300)]
libncurses: Avoid warning when calling cgetent().

Since both read_termcap.c static version of cgetent() and cgetent(3) has second
argument as char** just use __DECONST() trick so to not have big changes.
It should be safe to do that, base libncurses is a private library now.

7 years agolibncurses: Avoid -Woverflow in baud rates.
zrj [Sun, 25 Sep 2016 10:40:48 +0000 (13:40 +0300)]
libncurses: Avoid -Woverflow in baud rates.

NCURSES_OSPEED has type - short so anything >= B38400 overflows.
Since changing NCURSES_OSPEED to use int is an ABI change and given
that overflown values are still unique and only used as identifiers
there is nothing wrong by explictly casting it to used type.

7 years agobootstrap: Expand BOOTSTRAPPING case to avoid warning.
zrj [Sun, 25 Sep 2016 09:18:28 +0000 (12:18 +0300)]
bootstrap: Expand BOOTSTRAPPING case to avoid warning.

Addition to 6d3bd8e3942560036cf2aec0d98a65819c5f3b4c that allows to prevent
"warning: 'encode_b64' defined but not used [-Wunused-function]"

7 years agoath_hal: Add FCC6_FCCA regulatory domain (0x0014)
John Marino [Mon, 26 Sep 2016 00:35:57 +0000 (19:35 -0500)]
ath_hal: Add FCC6_FCCA regulatory domain (0x0014)

Tested on TP-Link N900, AR9380, regdomain 0x0014 (FCC6_FCCA)

Taken From FreeBSD: SVN rev 306323 (25 SEP 2016)

Thanks Adrian!

7 years agokernel/psm: Support newer Synaptics touchpads
Daniel Bilik [Mon, 26 Sep 2016 00:47:17 +0000 (02:47 +0200)]
kernel/psm: Support newer Synaptics touchpads

Taken-from: FreeBSD

7 years agokernel/clock_gettime: Various fixes.
Sascha Wildner [Sun, 25 Sep 2016 22:36:03 +0000 (00:36 +0200)]
kernel/clock_gettime: Various fixes.

* Fix CLOCK_PROF and CLOCK_VIRTUAL to behave like FreeBSD's. They are
  not meant to return the values of ITIMER_PROF and ITIMER_VIRTUAL
  (which are decreasing, see getitimer(2)), like they were implemented
  by 91810a6f0686477493e9915e98cfc5adcbe91363. This also fixes
  CLOCK_PROCESS_CPUTIME_ID.

* Fix CLOCK_PROCESS_THREAD_ID. It was adding the values wrongly in a
  way that could cause tv_nsec to overflow (i.e. become >= 1000000000).

* Fix clock_getres() for CLOCK_{PROCESS,THREAD}_CPUTIME_ID.

* Mention CLOCK_{PROCESS,THREAD}_CPUTIME_ID in clock_gettime()'s manual
  page.

* Bring in some minor manual page fixes from FreeBSD.

Reported-by: zhtw
Dragonfly-bug: <https://bugs.dragonflybsd.org/issues/2951>

7 years agoif_iwm - Switch 7265D and 3165 devices to 7265D firmware.
Imre Vadász [Tue, 20 Sep 2016 22:33:02 +0000 (00:33 +0200)]
if_iwm - Switch 7265D and 3165 devices to 7265D firmware.

7 years agoiwmfw - Import 7265D firmware for AC3165 and newer AC7265 revisions.
Imre Vadász [Tue, 6 Sep 2016 21:20:39 +0000 (23:20 +0200)]
iwmfw - Import 7265D firmware for AC3165 and newer AC7265 revisions.

7 years agoif_iwm - Move struct iwm_cfg chipset configs to if_iwm_7000.c and _8000.c
Imre Vadász [Sun, 25 Sep 2016 19:21:20 +0000 (21:21 +0200)]
if_iwm - Move struct iwm_cfg chipset configs to if_iwm_7000.c and _8000.c

* This is more similar to how code/definitions are distributed in
  Linux's iwlwifi.

* This should make recognizing new chipset variants, and adding additional
  flags from the Linux iwlwifi code easier, without blowing up if_iwm.c

Taken-From: Linux iwlwifi

7 years agoif_iwm - Simplify device id matching code a bit.
Imre Vadász [Sun, 25 Sep 2016 18:59:55 +0000 (20:59 +0200)]
if_iwm - Simplify device id matching code a bit.

* Just add the struct iwm_cfg pointers to the iwm_devices array, to get
  rid of the large switch clause.

7 years agokernel/vmm - Fix build with VMM_DEBUG
Antonio Huete Jimenez [Sun, 25 Sep 2016 10:57:09 +0000 (12:57 +0200)]
kernel/vmm - Fix build with VMM_DEBUG

7 years agopthread: Init libthread_xu also in pthread_key_create()
zrj [Fri, 16 Sep 2016 04:42:37 +0000 (07:42 +0300)]
pthread: Init libthread_xu also in pthread_key_create()

Previously libtreahd_xu was only prepared in pthread_create()
but there are cases where keys need to be initialized before.

Solves runtime of statically linked gfortran programs with -pthread
(libgfortran calls newlocale() when setting up the environment).

7 years ago<pthread.h>: Avoid namespace pollution.
zrj [Thu, 22 Sep 2016 11:32:51 +0000 (14:32 +0300)]
<pthread.h>: Avoid namespace pollution.

Rename MUTEX_TYPE_MAX -> PTHREAD_MUTEX_TYPE_MAX to avoid clashes
with types in user source codes. Adjust all use cases.

While there, remove deprecated unused compat mutex types.

7 years ago<pthread.h>: Mark some __nonnull(x) cases.
zrj [Thu, 22 Sep 2016 11:25:10 +0000 (14:25 +0300)]
<pthread.h>: Mark some __nonnull(x) cases.

7 years ago<pthread.h>: Visibility changes.
zrj [Thu, 22 Sep 2016 07:04:32 +0000 (10:04 +0300)]
<pthread.h>: Visibility changes.

While there, remove prototypes of pthread_attr_{get,set}floatstate()
looks like they never were implemented, so do not advertise them.

7 years ago<pthread.h>: Perform some style(9) cleanup.
zrj [Thu, 22 Sep 2016 06:57:39 +0000 (09:57 +0300)]
<pthread.h>: Perform some style(9) cleanup.

Change indentation to a single tab, since both protype names and arguments
are quite long and later added attribute decorations will only make it worse.

Strictly no functional change, just shifting stuff around for readability and
upcoming changes.

7 years agoUse recently added attributes in few standard headers.
zrj [Thu, 22 Sep 2016 06:19:10 +0000 (09:19 +0300)]
Use recently added attributes in few standard headers.

There attributes are to assits compiler making better analysis
doring compilation time. Like branch prediction and hinting.

While there, for now prefer to use __attribute__((__noreturn__)) to
_Noreturn, since neither OpenBSD or NetBSD has it at all and in our
variant we don't handle it in c++ case ([[noreturn]]) anyway.
Looks to be only a workaround for some old clang++ version.

7 years ago<stdlib.h>: Change visibility of few POSIX extensions to ISO C.
zrj [Thu, 22 Sep 2016 05:44:57 +0000 (08:44 +0300)]
<stdlib.h>: Change visibility of few POSIX extensions to ISO C.

Seems it should be like this.

7 years agostyle(9): Perform some cleanup in few standard headers.
zrj [Thu, 22 Sep 2016 05:32:10 +0000 (08:32 +0300)]
style(9): Perform some cleanup in few standard headers.

For upcomming changes. No functional change.

Kindly-requested-by: swildner@
7 years ago<sys/cdefs.h>: Add support for alloc_align, alloc_size and malloc attributes.
zrj [Tue, 20 Sep 2016 07:27:39 +0000 (10:27 +0300)]
<sys/cdefs.h>: Add support for alloc_align, alloc_size and malloc attributes.

  * __alloc_align tells the compiler that one of the arguments is a
    minimal alignment for pointer to help with pointers analysis.
  * __alloc_size tells the compiler that one of the arguments is a
    size of a pointer returned by function.
  * __malloclike tells the compiler that returned pointer does not
    alias any other pointer to help futher optimizations.

While there, add partial support for clang (as it is in FreeBSD).

7 years ago<sys/cdefs.h>: Be more careful with _Noreturn.
zrj [Tue, 20 Sep 2016 08:48:55 +0000 (11:48 +0300)]
<sys/cdefs.h>: Be more careful with _Noreturn.

With modern gcc started using g++ for bootstraps _Noreturn must
be handled with a bit of extra care.

7 years ago<sys/cdefs.h>: Move __warn_unused_result__ to 3.4
zrj [Tue, 20 Sep 2016 07:14:21 +0000 (10:14 +0300)]
<sys/cdefs.h>: Move __warn_unused_result__ to 3.4

Looks like it is reliably available only at 3.4 so change it.

7 years ago<sys/cdefs.h>: Style(9) fixes.
zrj [Tue, 20 Sep 2016 06:43:53 +0000 (09:43 +0300)]
<sys/cdefs.h>: Style(9) fixes.

Mostly tabs, no functional change except for removal
of extra semicolon in __strong_reference() macro.

7 years agobootstrap: Fix old boostrapping issue once and for all.
zrj [Wed, 21 Sep 2016 10:45:50 +0000 (13:45 +0300)]
bootstrap: Fix old boostrapping issue once and for all.

This was fallout after iconv() removal of 'const' attribute to conform
with POSIX. All the later hacks are starting to accumulate and prevent
easy further base system upgrading. So given that main issue is c++
specific and only needed for bootstraping process deal with it straight
and remove all hacks(include shoehornings) that were caused by it.

To fix bootstrapping problems add WORLD_VERSION variable that indicates
current DragonFly base version and could be used to retrospectively
help bootstrapping from older releases. Makefile changes that depend on
WORLD_VERSION should *only* be used as a once switch and during native
compilations should *not* change default world makefiles logic.

7 years agoif_iwm - Remove OpenBSD-specific comment. Beautify pci cfg space accesses.
Imre Vadász [Sat, 17 Sep 2016 21:06:42 +0000 (23:06 +0200)]
if_iwm - Remove OpenBSD-specific comment. Beautify pci cfg space accesses.

7 years agoif_iwm - Fix typo in commit a7697ea01c11fd493aec52260a02f31df680eb91.
Imre Vadász [Fri, 23 Sep 2016 23:35:04 +0000 (01:35 +0200)]
if_iwm - Fix typo in commit a7697ea01c11fd493aec52260a02f31df680eb91.

* The sc->sc_uc.uc_error_event_table value is now at sc->error_event_table,
  and not sc->umac_error_event_table.

7 years agoif_iwm - Get rid of unneeded IWM_FWDMASEGSZ and IWM_FWMAXSIZE constants
Imre Vadász [Fri, 23 Sep 2016 22:27:49 +0000 (00:27 +0200)]
if_iwm - Get rid of unneeded IWM_FWDMASEGSZ and IWM_FWMAXSIZE constants

* We only need IWM_FH_MEM_TB_MAX_LENGTH bytes for the fw_dma memory.

7 years agoif_iwm - With the previous commits, this DELAY no longer seems to be needed.
Imre Vadász [Fri, 23 Sep 2016 22:31:26 +0000 (00:31 +0200)]
if_iwm - With the previous commits, this DELAY no longer seems to be needed.

7 years agoif_iwm - Sync IWM_MVM_ALIVE waiting and start_fw handling with iwlwifi.
Imre Vadász [Fri, 23 Sep 2016 17:09:13 +0000 (19:09 +0200)]
if_iwm - Sync IWM_MVM_ALIVE waiting and start_fw handling with iwlwifi.

* Use the notification wait API, like it's done in the Linux iwlwifi code,
  to wait for the IWM_MVM_ALIVE notification.

* This also should fix some firmware load interrupt issues, and errors
  in the nic lock using.

Taken-From: Linux iwlwifi

7 years agoif_iwm - Synchronize firmware loading code with Linux iwlwifi.
Imre Vadász [Fri, 9 Sep 2016 22:00:07 +0000 (00:00 +0200)]
if_iwm - Synchronize firmware loading code with Linux iwlwifi.

* While there, rename some functions to match the names and functionality
  of the similarly named functions in Linux iwlwifi.

Taken-From: Linux iwlwifi

7 years agoiwmfw - Fixup revert to version 16 for the 8000C firmware.
Imre Vadász [Thu, 22 Sep 2016 13:24:01 +0000 (15:24 +0200)]
iwmfw - Fixup revert to version 16 for the 8000C firmware.

7 years agoif_iwm - Improve reliability of iwm_release on disassociation a bit.
Imre Vadász [Sat, 17 Sep 2016 20:57:06 +0000 (22:57 +0200)]
if_iwm - Improve reliability of iwm_release on disassociation a bit.

* We need to first call ivp->iv_newstate(), to enqueue the deauth/deassoc
  mgmt frame, then flush the tx queue, before actually calling
  iwm_release().

* cycling a wlan connection via wpa_cli frontend to wpa_supplicant, by
  issuing disconnect and reconnect commandos works quite well.
  (There is still an issue when disconnecting to quickly after completing
   authentication/association).

* Reassociating or roaming via wpa_supplicant is still broken.