]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoAdd a REVISION section to track changes for the BEGEMOT-NETGRAPH MIB file
Enji Cooper [Mon, 9 Jan 2017 06:36:17 +0000 (06:36 +0000)]
Add a REVISION section to track changes for the BEGEMOT-NETGRAPH MIB file

This change also documents the modification harti made to a handful of
objects in r122758 (the max OCTET STRING width was increased from 15 to
31 octets)

MFC after: 1 week

7 years agoAdd a REVISION section to track changes for the BEGEMOT-MIB MIB file
Enji Cooper [Mon, 9 Jan 2017 06:27:30 +0000 (06:27 +0000)]
Add a REVISION section to track changes for the BEGEMOT-MIB MIB file

There haven't been any changes to the MIB definition, so the REVISION
remains static at the version it was imported at

MFC after: 1 week

7 years agoAdd a REVISION section to track changes for the FOKUS-MIB MIB file
Enji Cooper [Mon, 9 Jan 2017 06:24:28 +0000 (06:24 +0000)]
Add a REVISION section to track changes for the FOKUS-MIB MIB file

There haven't been any changes to the MIB definition, so the REVISION
remains static at the version it was imported at

MFC after: 1 week

7 years agoAdd a REVISION section to track changes for the BEGEMOT-ATM-FREEBSD-MIB MIB file
Enji Cooper [Mon, 9 Jan 2017 06:19:20 +0000 (06:19 +0000)]
Add a REVISION section to track changes for the BEGEMOT-ATM-FREEBSD-MIB MIB file

There haven't been any changes to the MIB definition, so the REVISION
remains static at the version it was imported at

MFC after: 1 week

7 years agoSimilar to r311750, check for the result from smiGetModule to avoid a segfault
Enji Cooper [Mon, 9 Jan 2017 06:13:27 +0000 (06:13 +0000)]
Similar to r311750, check for the result from smiGetModule to avoid a segfault
when dereferencing a NULL pointer later on.

Choose to just check for the NULL pointer in the next for-loop for now to fix
the issue with a minimal amount of code churn

sys/queue.h use here would make more sense than using a static table

MFC after: 5 days

7 years agoUse calloc instead of malloc + memset(.., 0, ..)
Enji Cooper [Mon, 9 Jan 2017 06:03:49 +0000 (06:03 +0000)]
Use calloc instead of malloc + memset(.., 0, ..)

MFC after: 5 days

7 years agoCheck result from smiGetFirstNode and smiGetNodeByOID
Enji Cooper [Mon, 9 Jan 2017 05:51:38 +0000 (05:51 +0000)]
Check result from smiGetFirstNode and smiGetNodeByOID

This avoids a segfault with malformed or unanticipated files,
like IPV6-TC.txt (a file containing just TEXTUAL-CONVENTIONS).

MFC after: 5 days
Found with: gensnmpdef /usr/local/share/snmp/mibs/IPV6-TC.txt

7 years agoBump WARNS up from 0 to 6
Enji Cooper [Mon, 9 Jan 2017 05:46:41 +0000 (05:46 +0000)]
Bump WARNS up from 0 to 6

MFC after: 5 days

7 years agoDocument bsd.snmpmod.mk from a high-level
Enji Cooper [Mon, 9 Jan 2017 04:35:55 +0000 (04:35 +0000)]
Document bsd.snmpmod.mk from a high-level

MFC after: 2 weeks

7 years agohyperv: Add method to read 64bit Hyper-V specific time value.
Sepherosa Ziehau [Mon, 9 Jan 2017 03:38:41 +0000 (03:38 +0000)]
hyperv: Add method to read 64bit Hyper-V specific time value.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D9057

7 years agoAdd a REVISION section to track changes for the BEGEMOT-IP-MIB MIB file
Enji Cooper [Mon, 9 Jan 2017 03:21:21 +0000 (03:21 +0000)]
Add a REVISION section to track changes for the BEGEMOT-IP-MIB MIB file

There haven't been any changes to the MIB definition, so the REVISION
remains static at the version it was imported at

MFC after: 1 week

7 years agoAdd a REVISION section to track changes for the hostres module
Enji Cooper [Mon, 9 Jan 2017 03:18:19 +0000 (03:18 +0000)]
Add a REVISION section to track changes for the hostres module

There haven't been any changes to the MIB definition, so the REVISION remains
static at the version it was imported at

MFC after: 1 week

7 years agoImprove the smilint target in the hostres and mibII modules
Enji Cooper [Mon, 9 Jan 2017 03:14:04 +0000 (03:14 +0000)]
Improve the smilint target in the hostres and mibII modules

- Mark the smilint target .PHONY so it's always executed when requested
- Leverage .PATH for BMIBS instead of spelling the path out longhand
  for them

MFC after: 1 week

7 years agoUse SRCTOP instead of spelling out the full path with .CURDIR
Enji Cooper [Mon, 9 Jan 2017 03:08:21 +0000 (03:08 +0000)]
Use SRCTOP instead of spelling out the full path with .CURDIR

This helps condense the output for CFLAGS and .PATH

MFC after: 3 days

7 years agoUse the new sdhci_fdt_gpio helper functions to add full support for FDT
Ian Lepore [Mon, 9 Jan 2017 02:04:54 +0000 (02:04 +0000)]
Use the new sdhci_fdt_gpio helper functions to add full support for FDT
gpio pins for detecting card insert/remove and write protect.

7 years agoUse the new sdhci_fdt_gpio helper functions to add full support for FDT
Ian Lepore [Mon, 9 Jan 2017 01:57:51 +0000 (01:57 +0000)]
Use the new sdhci_fdt_gpio helper functions to add full support for FDT
gpio pins for detecting card insert/remove and write protect.

7 years agoAdd new helper routines for sdhci bridge drivers that use gpio pins for
Ian Lepore [Mon, 9 Jan 2017 01:54:36 +0000 (01:54 +0000)]
Add new helper routines for sdhci bridge drivers that use gpio pins for
card presence and write protect switch detection.

A bridge driver just needs to call the setup routine in its attach(), the
teardown in its detach(), and write a couple tiny glue functions to connect
the sdhci interface functions to the new helper functions.  This is not
extensively documented, but multiple examples will exist real soon.

7 years agoUse nitems(mib) instead of hardcoding mib's length when calling sysctl(3)
Enji Cooper [Mon, 9 Jan 2017 01:47:00 +0000 (01:47 +0000)]
Use nitems(mib) instead of hardcoding mib's length when calling sysctl(3)

MFC after: 3 days

7 years agoAdd support for non-removable media, and a quirk to use polling to detect
Ian Lepore [Mon, 9 Jan 2017 01:15:18 +0000 (01:15 +0000)]
Add support for non-removable media, and a quirk to use polling to detect
card insert/remove events on controllers that don't implement the insert
and remove interrupts.

Bridge drivers can set a new slot option, SDHCI_NON_REMOVABLE, to indicate
non-removable media (such as eMMC).  The sdhci driver will not enable
insert/remove interrupts, and sdhci_generic_get_card_present() will always
return true.

Bridge drivers can set a new quirk, SDHCI_QUIRK_POLL_CARD_PRESENT, and the
sdhci driver will not enable insert/remove interrupts, and instead will use
a callout to poll the card-present status at 5 Hz.

For bridge drivers that get notified of card insert/remove via gpio
interrupts, there is a new sdhci_handle_card_present() function they can
call from the gpio interrupt handler to inform the sdhci code of the event.

In addition to adding these new features, the existing code to debounce card
insertions was updated to use taskqueue_enqueue_timeout() instead of
scheduling a callout to do the taskqueue_enqueue().  There is also now a
comment explaining that insertion-debounce is what's going on -- it took me
a long time to realize that's what the old sdhci_card_delay() routine was
really doing.  There is no functional difference between the old and new
debounce code (I hope!).

7 years agoUse nitems({mib,name}) instead of hardcoding their value
Enji Cooper [Mon, 9 Jan 2017 00:54:18 +0000 (00:54 +0000)]
Use nitems({mib,name}) instead of hardcoding their value

MFC after: 3 days

7 years agolib/libutil/kinfo_*: style cleanup
Enji Cooper [Mon, 9 Jan 2017 00:47:23 +0000 (00:47 +0000)]
lib/libutil/kinfo_*: style cleanup

- Use nitems(mib) instead of hardcoding mib's length
- Sort sys/ #includes

MFC after: 3 days

7 years agoUse nitems(mib) instead of hardcoding mib's length
Enji Cooper [Mon, 9 Jan 2017 00:38:19 +0000 (00:38 +0000)]
Use nitems(mib) instead of hardcoding mib's length

MFC after: 3 days

7 years agoSort #includes
Enji Cooper [Mon, 9 Jan 2017 00:37:09 +0000 (00:37 +0000)]
Sort #includes

MFC after: 3 days

7 years agoClean up trailing whitespace
Enji Cooper [Mon, 9 Jan 2017 00:33:27 +0000 (00:33 +0000)]
Clean up trailing whitespace

MFC after: 3 days

7 years agoStyle fixes
Enji Cooper [Mon, 9 Jan 2017 00:29:23 +0000 (00:29 +0000)]
Style fixes

- Delete trailing whitespace
- Use nitems(mib) instead of hardcoding the mib length

MFC after: 3 days

7 years agoStyle(9) fixes
Enji Cooper [Mon, 9 Jan 2017 00:25:33 +0000 (00:25 +0000)]
Style(9) fixes

- Sort sys/ #includes
- Use nitems instead of hardcoding the length of `mib`

MFC after: 3 days

7 years agortwn_usb(4): fix Rx buffer size calculation.
Andriy Voskoboinyk [Sun, 8 Jan 2017 23:41:17 +0000 (23:41 +0000)]
rtwn_usb(4): fix Rx buffer size calculation.

Use device-specific Rx buffer size to ensure that data will not be
truncated + add a warning if truncation was detected (the driver
cannot handle this case correctly yet).

Tested with:
 - RTL8188CUS, RTL8188EU and RTL8821AU, STA / AP modes.

7 years agoUpdate pciids to 2017.01.08
Baptiste Daroussin [Sun, 8 Jan 2017 23:25:46 +0000 (23:25 +0000)]
Update pciids to 2017.01.08

MFC after: 1 day

7 years agoKnock a page off VM_MAX_KERNEL_ADDRESS
Justin Hibbits [Sun, 8 Jan 2017 21:12:46 +0000 (21:12 +0000)]
Knock a page off VM_MAX_KERNEL_ADDRESS

There are places where checks are made against VM_MAX_KERNEL_ADDRESS, or
virtual_end (set to VM_MAX_KERNEL_ADDRESS).  With 32-bit checks, an address will
always be less than or equal to 0xffffffff.  Drop a page, so those checks can
terminate loops safely.

7 years agoUse correct PCI device id for virtio-rng.
Peter Grehan [Sun, 8 Jan 2017 20:58:58 +0000 (20:58 +0000)]
Use correct PCI device id for virtio-rng.
This prevented the device from attaching with a
Windows guest (most other guests use the device type
for matching)

PR: 212711
Submitted by: jbeich
MFC after: 3 days

7 years agoConvert gpioc to use the make_dev_s(9) KPI. This fix a possible race where
Luiz Otavio O Souza [Sun, 8 Jan 2017 20:41:32 +0000 (20:41 +0000)]
Convert gpioc to use the make_dev_s(9) KPI.  This fix a possible race where
si_drv1 can be accessed before it gets set.

This is inspired on r311700.

MFC after: 3 days

7 years agoConvert etherswitch to use the make_dev_s(9) KPI. This fix a possible race
Luiz Otavio O Souza [Sun, 8 Jan 2017 20:37:41 +0000 (20:37 +0000)]
Convert etherswitch to use the make_dev_s(9) KPI.  This fix a possible race
where si_drv1 can be accessed before it gets set.

MFC after: 3 days
Suggested by: kib
Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoMake sure the 'Always-one' bit is always set to one,
Peter Grehan [Sun, 8 Jan 2017 20:29:35 +0000 (20:29 +0000)]
Make sure the 'Always-one' bit is always set to one,
in the first byte of the 3-byte mouse data report.
Plan9/9front requires this.

Switch over to using #defines for the data report bits.

Verified no regression on Win10/Fedora-live.

Reported and tested by: Trent Thompson (trentnthompson at gmail com)
MFC after: 1 week

7 years agoRelease the ND6 list lock before making a prefix off-link in nd6_timer().
Mark Johnston [Sun, 8 Jan 2017 18:46:00 +0000 (18:46 +0000)]
Release the ND6 list lock before making a prefix off-link in nd6_timer().

Reported by: Jim <BM-2cWfdfG5CJsquqkJyry7hZT9LypbSEWEkQ@bitmessage.ch>
X-MFC With: r306829

7 years agoNow that the PRESENT_STATE register is only used for the inhibit bits loop
Ian Lepore [Sun, 8 Jan 2017 18:28:06 +0000 (18:28 +0000)]
Now that the PRESENT_STATE register is only used for the inhibit bits loop
in this function, eliminate the state variable and restructure the loop to
read the register just once at the top of the loop.

Suggested by: skra

7 years agoFix logic error in gvinum's gv_set_sd_state()
Dimitry Andric [Sun, 8 Jan 2017 17:56:54 +0000 (17:56 +0000)]
Fix logic error in gvinum's gv_set_sd_state()

With clang 4.0.0, I'm getting the following warnings:

    sys/geom/vinum/geom_vinum_state.c:186:7: error: logical not is only
    applied to the left hand side of this bitwise operator
    [-Werror,-Wlogical-not-parentheses]
                    if (!flags & GV_SETSTATE_FORCE)
                        ^      ~

The logical not operator should obiously be called after masking.

Reviewed by: mav, pfg
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D9093

7 years agoMake CTL_GETSTATS ioctl return partial data if buffer is small.
Alexander Motin [Sun, 8 Jan 2017 13:26:34 +0000 (13:26 +0000)]
Make CTL_GETSTATS ioctl return partial data if buffer is small.

MFC after: 2 weeks

7 years agoAdd direction argument to ipsec_setspidx_inpcb() function.
Andrey V. Elsukov [Sun, 8 Jan 2017 12:40:07 +0000 (12:40 +0000)]
Add direction argument to ipsec_setspidx_inpcb() function.

This function is used only by ipsec_getpolicybysock() to fill security
policy index selector for locally generated packets (that have INPCB).
The function incorrectly assumes that spidx is the same for both directions.
Fix this by using new direction argument to specify correct INPCB security
policy - sp_in or sp_out. There is no need to fill both policy indeces,
because they are overwritten for each packet.
This fixes security policy matching for outbound packets when user has
specified TCP/UDP ports in the security policy upperspec.

PR: 213869
MFC after: 1 week

7 years ago[net80211] add roaming parameters for 11ac.
Adrian Chadd [Sun, 8 Jan 2017 10:13:05 +0000 (10:13 +0000)]
[net80211] add roaming parameters for 11ac.

These are mostly placeholders for now.

7 years ago[net80211] use the correct freq2 field when populating VHT operation element.
Adrian Chadd [Sun, 8 Jan 2017 10:07:54 +0000 (10:07 +0000)]
[net80211] use the correct freq2 field when populating VHT operation element.

Whilst here, leave a TODO comment so I revisit this routine in the context
of hostap operation probe requests for IBSS/mesh.

7 years agoiso_rrip.h: Hide kernel definitions from makefs(8)
Conrad Meyer [Sun, 8 Jan 2017 09:16:07 +0000 (09:16 +0000)]
iso_rrip.h: Hide kernel definitions from makefs(8)

Reported by: O. Hartmann <ohartmann at walstatt.org>

7 years agolibprocstat: Include cd9660 headers in the same order as the kernel
Conrad Meyer [Sun, 8 Jan 2017 08:36:37 +0000 (08:36 +0000)]
libprocstat: Include cd9660 headers in the same order as the kernel

Fix userspace build after r311665.

7 years agochown/chgrp: Add SIGINFO handler
Conrad Meyer [Sun, 8 Jan 2017 06:58:42 +0000 (06:58 +0000)]
chown/chgrp: Add SIGINFO handler

PR: 191884
Submitted by: Dan McGregor <dan.mcgregor at usask.ca>
Reviewed by: mjg@ (earlier version)

7 years agochmod: Add SIGINFO handler
Conrad Meyer [Sun, 8 Jan 2017 06:50:53 +0000 (06:50 +0000)]
chmod: Add SIGINFO handler

PR: 191884
Submitted by: Dan McGregor <dan.mcgregor at usask.ca>
Reviewed by: mjg@ (earlier version)

7 years agoAdd some additional ACPI methods for DRM
Conrad Meyer [Sun, 8 Jan 2017 06:26:33 +0000 (06:26 +0000)]
Add some additional ACPI methods for DRM

Add AcpiGetDataFull and AcpiGetTableWithSize.

Submitted by: Matt Macy

7 years agoDo not truncate inode calculation from ISO9660 block offset
Conrad Meyer [Sun, 8 Jan 2017 06:22:35 +0000 (06:22 +0000)]
Do not truncate inode calculation from ISO9660 block offset

PR: 190655
Reported by: Thomas Schmitt <scdbackup at gmx.net>
Obtained from: NetBSD sys/fs/cd9660/cd9660_node.c,r1.31

7 years agocd9660: Expand internal inum size to 64 bits
Conrad Meyer [Sun, 8 Jan 2017 06:21:49 +0000 (06:21 +0000)]
cd9660: Expand internal inum size to 64 bits

Inums in cd9660 refer to byte offsets on the media.  DVD and BD media
can have entries above 4GB, especially with multi-session images.

PR: 190655
Reported by: Thomas Schmitt <scdbackup at gmx.net>

7 years agommc: Accept even lower voltage for Cherryview
Conrad Meyer [Sun, 8 Jan 2017 06:20:21 +0000 (06:20 +0000)]
mmc: Accept even lower voltage for Cherryview

And HP x2 210, per DragonFlyBSD 240bd9cd58f8259c12c14a8006837e698.

Submitted by: Johannes Lundberg <yohanesu75 at gmail.com>
No objection: gonzo@
Obtained from: DragonFlyBSD

7 years ago[net80211] include the prototype VHT code into the build.
Adrian Chadd [Sun, 8 Jan 2017 04:27:08 +0000 (04:27 +0000)]
[net80211] include the prototype VHT code into the build.

Note: it isn't called anywhere yet!

7 years ago[net80211] Add initial VHT support routines.
Adrian Chadd [Sun, 8 Jan 2017 04:25:41 +0000 (04:25 +0000)]
[net80211] Add initial VHT support routines.

This is a skeleton set based on ieee80211_ht.c.  It implements some IE
parsing, some basic unfinished negotiation, and channel promotion/demotion.

However, by itself it's not enough to do VHT - notably, the actual
channel promotion for STA mode at least is done in ieee80211_ht.c as
part of htinfo_update_chw().  I was .. quite amused when I found that
out.

I'm checking this in so others can see progress rather than one huge
commit when VHT is "done" (which will likely be quite a while.)

7 years ago[net80211] add a "is VHT available" macro.
Adrian Chadd [Sun, 8 Jan 2017 04:23:05 +0000 (04:23 +0000)]
[net80211] add a "is VHT available" macro.

We have run out of config bits, sigh, so until I expand the ic config
bits, just use this macro as a substitute.

7 years agoAdd a new sdhci interface method, get_card_present().
Ian Lepore [Sun, 8 Jan 2017 02:32:53 +0000 (02:32 +0000)]
Add a new sdhci interface method, get_card_present().

Many embedded SoC controllers that are (more or less) sdhci-compatible don't
implement card detect, and the related values in the PRESENT_STATE register
aren't useful.  A bridge driver can now implement get_card_present() to read
a gpio pin or whatever else is necessary for that system.

The default implementation reads the CARD_PRESENT bit from the PRESENT_STATE
register, so existing drivers will keep working (or keep not-fully-working,
since many drivers right now can't detect card insert/remove).

7 years agoremove network mask calculation for Classful network
Baptiste Daroussin [Sat, 7 Jan 2017 23:42:17 +0000 (23:42 +0000)]
remove network mask calculation for Classful network

Nowadays it's not necessary to compute network mask from the IP address and
compare to given by DHCP.

Submitted by: kczekirda
Reviewed by: glebius, bapt
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D8740

7 years agoOnly write to *active once, even when GPIO_ACTIVE_LOW is set.
Ian Lepore [Sat, 7 Jan 2017 22:55:23 +0000 (22:55 +0000)]
Only write to *active once, even when GPIO_ACTIVE_LOW is set.

7 years agocxgbe/t4_tom: Fix tid accounting. An offloaded IPv6 connection uses 2
Navdeep Parhar [Sat, 7 Jan 2017 20:26:19 +0000 (20:26 +0000)]
cxgbe/t4_tom: Fix tid accounting.  An offloaded IPv6 connection uses 2
tids, not 1, in the hardware.

MFC after: 3 days
Sponsored by: Chelsio Communications

7 years agoAdd skein(3) front ends to the md5 manpage
Allan Jude [Sat, 7 Jan 2017 19:43:40 +0000 (19:43 +0000)]
Add skein(3) front ends to the md5 manpage

Reported by: emaste

7 years agolibmd: add noexec stack annotation in skein_block_asm.s
Ed Maste [Sat, 7 Jan 2017 19:26:25 +0000 (19:26 +0000)]
libmd: add noexec stack annotation in skein_block_asm.s

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

7 years agostyle(9) fix
Allan Jude [Sat, 7 Jan 2017 17:37:39 +0000 (17:37 +0000)]
style(9) fix

Submitted by: jmallett

7 years agoExport __cxa_thread_atexit_impl as an alias for __cxa_thread_atexit.
Konstantin Belousov [Sat, 7 Jan 2017 16:05:19 +0000 (16:05 +0000)]
Export __cxa_thread_atexit_impl as an alias for __cxa_thread_atexit.

libstdc++ before gcc r244057 expected that libc provided
__cxa_thread_atexit_impl, and libstdc++ implemented
__cxa_thread_atexit, by forwarding the calls to _impl.  Mentioned gcc
revision checks for __cxa_thread_atexit in libc and does not provide
the symbol from libstdc++ if found.

This change helps older gcc, in particular, all released versions
which implement thread_local, by consolidating the implementation into
libc.  For that versions, if configured with the current libc, the
__cxa_thread_atexit is exported from libstdc++ as a trivial wrapper
around libc::__cxa_thread_atexit_impl.

The __cxa_thread_atexit implementation is put into separate source
file to allow for static linking with older libstdc++.a.

gcc bugzilla: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78968
Reported by: Hannes Hauswedell <h2+fbsdports@fsfe.org>
PR: 215709
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoRestore priority value for OGIO_KEYMAP
Nikolai Lifanov [Sat, 7 Jan 2017 15:58:57 +0000 (15:58 +0000)]
Restore priority value for OGIO_KEYMAP

PR: 206678
Submitted by: ecturt@gmail.com
Reviewed by: cem
Approved by: cem, matthew (mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D5095

7 years agoFix the following clang 4.0.0 warning in ngatm's snmp_atm.c:
Dimitry Andric [Sat, 7 Jan 2017 15:57:12 +0000 (15:57 +0000)]
Fix the following clang 4.0.0 warning in ngatm's snmp_atm.c:

    contrib/ngatm/snmp_atm/snmp_atm.c:173:6: error: logical not is only
    applied to the left hand side of this bitwise operator
    [-Werror,-Wlogical-not-parentheses]
            if (!ifmr.ifm_status & IFM_AVALID) {
                ^                ~

Obviously, the masking needs to be done before the logical not
operation.  Add parentheses to make it so.

MFC after:      3 days

7 years agolibunwind: add noexec stack annotation
Ed Maste [Sat, 7 Jan 2017 14:40:58 +0000 (14:40 +0000)]
libunwind: add noexec stack annotation

Reported by: vangyzen
Reviewed by: kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D9075

7 years agoDefine _POSIX_PRIORITY_SCHEDULING as 0.
Konstantin Belousov [Sat, 7 Jan 2017 12:24:45 +0000 (12:24 +0000)]
Define _POSIX_PRIORITY_SCHEDULING as 0.

sched_*(2) syscalls might be not available at runtime.  Defining this
constant as zero directs POSIX-compliant code to call sysconf(3) to
detect the feature at runtime, and forces libc sysconf(3) to ask
kernel.

Noted by: ngie
Reviewed by: jilles, ngie
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D9055

7 years agosfxge(4): allow DMA descs to cross 4k boundary on EF10
Andrew Rybchenko [Sat, 7 Jan 2017 10:55:38 +0000 (10:55 +0000)]
sfxge(4): allow DMA descs to cross 4k boundary on EF10

Siena has limitation on maximum byte count and 4k boundary crosssing
(which is stricter than maximum byte count).
EF10 has limitation on maximum byte count only.

Reviewed by:    philip
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D9061

7 years agosfxge(4): treat EFX_LINK_UNKOWN as link down
Andrew Rybchenko [Sat, 7 Jan 2017 10:52:02 +0000 (10:52 +0000)]
sfxge(4): treat EFX_LINK_UNKOWN as link down

It is safer to consider EFX_LINK_UNKNOWN as link down.
link_mode is set to EFX_LINK_UNKNOWN on port stop and fini.

Reviewed by:    philip
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D9060

7 years agosfxge(4): use SFXGE_LINK_UP() to report link up state
Andrew Rybchenko [Sat, 7 Jan 2017 10:51:12 +0000 (10:51 +0000)]
sfxge(4): use SFXGE_LINK_UP() to report link up state

Reviewed by:    philip
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D9059

7 years agoMake 'camcontrol modepage' support subpages.
Alexander Motin [Sat, 7 Jan 2017 09:56:12 +0000 (09:56 +0000)]
Make 'camcontrol modepage' support subpages.

MFC after: 2 weeks

7 years agoMake do_buff_decode() not read past the end of the buffer.
Alexander Motin [Sat, 7 Jan 2017 09:33:11 +0000 (09:33 +0000)]
Make do_buff_decode() not read past the end of the buffer.

Abort format processing as soon as we have no enough data.

MFC after: 2 weeks

7 years agoMove the mibII module up so uncommenting the bridge module works
Enji Cooper [Sat, 7 Jan 2017 09:03:40 +0000 (09:03 +0000)]
Move the mibII module up so uncommenting the bridge module works

Add a note about how module ordering and dependent modules

MFC after: 1 week

7 years agoConditionalize building libwrap support into sshd
Enji Cooper [Sat, 7 Jan 2017 08:08:35 +0000 (08:08 +0000)]
Conditionalize building libwrap support into sshd

Only build libwrap support into sshd if MK_TCP_WRAPPERS != no

This will unbreak the build if libwrap has been removed from the system

MFC after: 2 weeks
PR: 210141
Submitted by: kpect@protonmail.com
Differential Revision: D9049

7 years agoUnbreak lib/libsysdecode after r311568 by decoding MSG_MORETOCOME flag
Enji Cooper [Sat, 7 Jan 2017 07:54:23 +0000 (07:54 +0000)]
Unbreak lib/libsysdecode after r311568 by decoding MSG_MORETOCOME flag
in msgflags

MFC after: 1 month
X-MFC with: r311568
Pointyhat to: jhb
Reported by: cy
Submitted by: Michael Butler <imb@protected-networks.net>
Sponsored by: Dell EMC Isilon

7 years ago[net80211] add syncflags methods for the VHT flags configuration.
Adrian Chadd [Sat, 7 Jan 2017 07:35:27 +0000 (07:35 +0000)]
[net80211] add syncflags methods for the VHT flags configuration.

I missed this in my last commit.  Pointy hat to me.

7 years agoCapsicum: add capability mode to users binary
Allan Jude [Sat, 7 Jan 2017 04:57:21 +0000 (04:57 +0000)]
Capsicum: add capability mode to users binary

Submitted by: Tyler Littlefield <tyler@tysdomain.com>
Reviewed by: cem, oshogbo
Differential Revision: https://reviews.freebsd.org/D9046

7 years ago[net80211] add some more bits.
Adrian Chadd [Sat, 7 Jan 2017 02:16:48 +0000 (02:16 +0000)]
[net80211] add some more bits.

7 years ago[ifconfig] add initial VHT (802.11ac) configuration and channel support to ifconfig.
Adrian Chadd [Sat, 7 Jan 2017 02:07:05 +0000 (02:07 +0000)]
[ifconfig] add initial VHT (802.11ac) configuration and channel support to ifconfig.

This is very preliminary and mostly enough for me (with other patches)
to work on VHT support.

It adds:

* VHT20, VHT40 and VHT80 regulatory/band awareness
* VHT20, VHT40 and VHT80 channel configuration / population
* Parses vht channel specifications (eg ifconfig wlan0 create wlandev athp0 wlanmode monitor channel 36:vht/80)
* Configuration of VHT, VHT40, VHT80, VHT80+80, VHT160 channel
  width (IEEE80211_FVHT_VHT* flags in net80211)

TODO:

* No VHT80+80 or VHT160 channels yet - I don't yet have hardware, and I'm
  not yet sure how to support/populate VHT80+80 channels.
* No, I won't update the manpage until this is "more done", lest someone
  tries using vht and gets upset with me.
* No, I won't commit the regulatory database I'm testing with, so you'll
  just end up with no VHT channels ever populated.  Which is good, as there
  isn't an 11ac driver in-tree yet to try it with.

7 years ago[net80211] add VHT ioctl parameters and driver capabilities
Adrian Chadd [Sat, 7 Jan 2017 01:59:39 +0000 (01:59 +0000)]
[net80211] add VHT ioctl parameters and driver capabilities

* Add the VHT capability element to the driver capabilities so ifconfig
  can see if VHT is available
* Add ioctl plumbing for enabling/disabling VHT and each of the VHT
  widths.

Note: this DOES change the ABI (the driver caps ioctl struct size, sigh)
so this will require a recompile of at least ifconfig.

7 years ago[lib80211] add VHT bands and channel flags.
Adrian Chadd [Sat, 7 Jan 2017 01:56:10 +0000 (01:56 +0000)]
[lib80211] add VHT bands and channel flags.

This is preparation work for 11ac support.  The regulatory database
needs to know about VHT channel flags and 80MHz (and later 160MHz)
available channel bands.

Whilst here, add the 2GHz VHT band (which is a terrible, terrible vendor
extension that almost all vendors do) just in preparation, even though
I don't (yet) plan on supporting it.

7 years ago[net80211] add VHT IEs to scan elements.
Adrian Chadd [Sat, 7 Jan 2017 01:54:32 +0000 (01:54 +0000)]
[net80211] add VHT IEs to scan elements.

In preparation for VHT station support, we need to store VHT IEs when
scanning so we can choose to upgrade to VHT.

This doesn't change the ABI - it just steals spare[] entries.

7 years ago[net80211] add VHT node flag; parsed chanwidth.
Adrian Chadd [Sat, 7 Jan 2017 01:53:27 +0000 (01:53 +0000)]
[net80211] add VHT node flag; parsed chanwidth.

The VHT operational element (VHTOPMODE) isn't a uint32_t - it's
the MCS sets, freq1/freq2 parameters and channel width.
So, store the channel width too in lieu of just storing the
IE struct.

This changes the VHT parameter layout in ieee80211_node but it
doesn't change ABI at all.

7 years ago[net80211] add FVHT flags for channel widths.
Adrian Chadd [Sat, 7 Jan 2017 01:51:54 +0000 (01:51 +0000)]
[net80211] add FVHT flags for channel widths.

The 11n code uses these bits for both configuration /and/ controlling
the channel width on softmac chips - it uses it to find the widest
width for all VAPs (eg a HT20 vap and a HT40 vap) to know what to
configure the ic_curchan.

For fullmac devices it isn't /as/ important, as each virtual device
exposed by the firmware will likely have its own configuration and the
firmware figures out what to do to enable it.

7 years ago[net80211] Remove duplicate VHTOPMODE configuration bits.
Adrian Chadd [Sat, 7 Jan 2017 01:49:34 +0000 (01:49 +0000)]
[net80211] Remove duplicate VHTOPMODE configuration bits.

These came from Linux mac80211 headers and are configuration bits, not
VHTOPMODE field parameters.

Whilst here, add the field names for the VHTCAP bits.

Tested:

* ath10k, 11ac STA mode

7 years agoFix file descriptor leaks in cmp(1)
Alan Somers [Sat, 7 Jan 2017 00:59:06 +0000 (00:59 +0000)]
Fix file descriptor leaks in cmp(1)

Also, add a few test cases

Reported by: Coverity
CID: 271624 275338
Reviewed by: ngie
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D9074

7 years agoIn tcpdump's print-tcp.c, avoid increasing alignment when taking the
Dimitry Andric [Sat, 7 Jan 2017 00:17:01 +0000 (00:17 +0000)]
In tcpdump's print-tcp.c, avoid increasing alignment when taking the
addresses of members of struct ip, which is packed.  Since the pointers
are only used for memcmp'ing, they can be pointing to void instead.

Note that upstream has removed the src and dst variables, in the mean
time.

MFC after: 3 days

7 years agoFix comment in t4_tom. No functional change.
Navdeep Parhar [Sat, 7 Jan 2017 00:08:55 +0000 (00:08 +0000)]
Fix comment in t4_tom.  No functional change.

MFC after: 3 days

7 years agoSet MORETOCOME for AIO write requests on a socket.
John Baldwin [Fri, 6 Jan 2017 23:41:45 +0000 (23:41 +0000)]
Set MORETOCOME for AIO write requests on a socket.

Add a MSG_MOREOTOCOME message flag. When this flag is set, sosend*
set PRUS_MOREOTOCOME when invoking the protocol send method. The aio
worker tasks for sending on a socket set this flag when there are
additional write jobs waiting on the socket buffer.

Reviewed by: adrian
MFC after: 1 month
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D8955

7 years agoEnable /usr/lib32 for o32 binaries on mips64.
John Baldwin [Fri, 6 Jan 2017 23:30:54 +0000 (23:30 +0000)]
Enable /usr/lib32 for o32 binaries on mips64.

Build and install an o32 set of libraries on mips64 suitable for
running o32 binaries via COMPAT_FREEBSD32. Enable COMPAT_FREEBSD32 in
MALTA64.

Reviewed by: jmallett, imp
Sponsored by: DARPA / AFRL
Differential Revision: https://reviews.freebsd.org/D9032

7 years agoSet -m32 in MD LIB32CPUCFLAGS rather than MI LIB32CFLAGS.
John Baldwin [Fri, 6 Jan 2017 23:20:59 +0000 (23:20 +0000)]
Set -m32 in MD LIB32CPUCFLAGS rather than MI LIB32CFLAGS.

Both amd64 and powerpc64 use -m32 to compile 32-bit binaries, but not
all platforms follow this convention.  Move the -m32 compile flag into
the per-architecture flags to accomodate other architectures.

Sponsored by: DARPA / AFRL

7 years agoLink llvm-ar to llvm-ranlib, if WITH_CLANG_EXTRAS is enabled. When
Dimitry Andric [Fri, 6 Jan 2017 23:05:29 +0000 (23:05 +0000)]
Link llvm-ar to llvm-ranlib, if WITH_CLANG_EXTRAS is enabled.  When
invoked as llvm-ranlib, it can create an archive symbol table for
archives of objects compiled for LTO by an LLVM compiler.

Submitted by: Dan McGregor <danismostlikely@gmail.com>
MFC after: 3 days

7 years agoAfter r311459, some ports can break, because a few of the newly added
Dimitry Andric [Fri, 6 Jan 2017 21:40:30 +0000 (21:40 +0000)]
After r311459, some ports can break, because a few of the newly added
prototypes in <tcpd.h> use FILE.  Pull in a minimal forward declaration
of FILE from <stdio.h> to minimize impact.  Sorry for the breakage.

Reported by: Shawn Webb <shawn.webb@hardenedbsd.org>
X-MFC-With: r311459

7 years agoRegenerate src.conf(5) after r311548
Enji Cooper [Fri, 6 Jan 2017 21:14:07 +0000 (21:14 +0000)]
Regenerate src.conf(5) after r311548

MFC after: 1 week

7 years agoCarry over r311520 to tools/build/options/WITHOUT_USB_GADGET_EXAMPLES
Enji Cooper [Fri, 6 Jan 2017 21:08:19 +0000 (21:08 +0000)]
Carry over r311520 to tools/build/options/WITHOUT_USB_GADGET_EXAMPLES

Discussed with: wblock

r311520:

Fix src.conf(5) description of WITHOUT_USB_GADGET_EXAMPLES.

PR: 215831
Submitted by: p5B2E9A8F@t-online.de
MFC after: 1 week
X-MFC with: r311520
Sponsored by: iXsystems

7 years agotmpfs: perform a lockless check in tmpfs_itimes
Mateusz Guzik [Fri, 6 Jan 2017 19:58:20 +0000 (19:58 +0000)]
tmpfs: perform a lockless check in tmpfs_itimes

Most of the time the status is 0 as the function is repeatedly
called from tmpfs_getattr.

7 years agoFix clang 4.0.0 warnings about taking the address of a packed member of
Dimitry Andric [Fri, 6 Jan 2017 18:41:28 +0000 (18:41 +0000)]
Fix clang 4.0.0 warnings about taking the address of a packed member of
struct ip in ping(8):

sbin/ping/ping.c:1684:53: error: taking address of packed member
'ip_src' of class or structure 'ip' may result in an unaligned pointer
value [-Werror,-Waddress-of-packed-member]
        (void)printf(" %s ", inet_ntoa(*(struct in_addr *)&ip->ip_src.s_addr));
                                                           ^~~~~~~~~~~~~~~~~
sbin/ping/ping.c:1685:53: error: taking address of packed member
'ip_dst' of class or structure 'ip' may result in an unaligned pointer
value [-Werror,-Waddress-of-packed-member]
        (void)printf(" %s ", inet_ntoa(*(struct in_addr *)&ip->ip_dst.s_addr));
                                                           ^~~~~~~~~~~~~~~~~

MFC after: 3 days

7 years agoRemove '-vd' option to make iasl(8) reproducible.
Jung-uk Kim [Fri, 6 Jan 2017 18:08:53 +0000 (18:08 +0000)]
Remove '-vd' option to make iasl(8) reproducible.

PR: 215421

7 years agoShow that the crunchgen configuration file name is not optional.
Warren Block [Fri, 6 Jan 2017 18:04:34 +0000 (18:04 +0000)]
Show that the crunchgen configuration file name is not optional.

PR: 215087
Submitted by: Iblis Lin <iblis@hs.ntnu.edu.tw>
MFC after: 1 week
Sponsored by: iXsystems

7 years agotmpfs: enabled MNTK_EXTENDED_SHARED
Mateusz Guzik [Fri, 6 Jan 2017 18:01:46 +0000 (18:01 +0000)]
tmpfs: enabled MNTK_EXTENDED_SHARED

Discussed with: kib

7 years agoLock tmpfs node tn_status updates done under the shared vnode lock.
Konstantin Belousov [Fri, 6 Jan 2017 17:43:36 +0000 (17:43 +0000)]
Lock tmpfs node tn_status updates done under the shared vnode lock.

If tmpfs vnode is only shared locked, tn_status field still needs
updates to note the access time modification.  Use the same locking
scheme as for UFS, protect tn_status with the node interlock + shared
vnode lock.

Fix nearby style.

Noted and reviewed by: mjg
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoUse vnode lock assertion expression, and upgrade it to assert the
Konstantin Belousov [Fri, 6 Jan 2017 17:32:44 +0000 (17:32 +0000)]
Use vnode lock assertion expression, and upgrade it to assert the
required exclusive state of the vnode lock in tmpfs chflags, chmod,
chown, chsize, chtimes operations.

Fix nearby style.

Reviewed by: mjg
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoRemove dead code.
Konstantin Belousov [Fri, 6 Jan 2017 17:03:08 +0000 (17:03 +0000)]
Remove dead code.

Fifos overwrite file ops vector, and fifo VOP_KQFILTER is VOP_PANIC().

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoUse type-independent formats for printing nlink_t and ino_t.
Konstantin Belousov [Fri, 6 Jan 2017 16:59:33 +0000 (16:59 +0000)]
Use type-independent formats for printing nlink_t and ino_t.

Extracted from: ino64 work by gleb, mckusick
Discussed with: mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 1 week