]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMigrate e1000 to the IFLIB framework:
Sean Bruno [Tue, 10 Jan 2017 03:23:22 +0000 (03:23 +0000)]
Migrate e1000 to the IFLIB framework:
- em(4) igb(4) and lem(4)
- deprecate the igb device from kernel configurations
- create a symbolic link in /boot/kernel from if_em.ko to if_igb.ko

Devices tested:
- 82574L
- I218-LM
- 82546GB
- 82579LM
- I350
- I217

Please report problems to freebsd-net@freebsd.org

Partial review from jhb and suggestions on how to *not* brick folks who
originally would have lost their igbX device.

Submitted by: mmacy@nextbsd.org
MFC after: 2 weeks
Relnotes: yes
Sponsored by: Limelight Networks and Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D8299

7 years agocxgbe(4): Attach to the 2x25 debug card. This is for internal use only.
Navdeep Parhar [Tue, 10 Jan 2017 01:36:50 +0000 (01:36 +0000)]
cxgbe(4): Attach to the 2x25 debug card.  This is for internal use only.

MFC after: 3 days

7 years agoAllow udbp(4) to claim Belkin "Windows Easy Transfer Cable" for Netgraph use.
Bruce M Simpson [Tue, 10 Jan 2017 01:31:26 +0000 (01:31 +0000)]
Allow udbp(4) to claim Belkin "Windows Easy Transfer Cable" for Netgraph use.

These have been tested back-to-back with Linux 3.x and a similar attachment
at the other end; a CDC EEM-like encapsulation can be used for emulated
Ethernet over udbp(4) with ng_ether.

7 years agocxgbe(4): Refresh t4_msg.h, mainly for definitions related to the crypto
Navdeep Parhar [Tue, 10 Jan 2017 01:30:41 +0000 (01:30 +0000)]
cxgbe(4): Refresh t4_msg.h, mainly for definitions related to the crypto
engine.

Obtained from: Chelsio Communications
MFC after: 2 weeks
Sponsored by: Chelsio Communications

7 years agortwn_pci(4): fix possible race while accessing 'matched_chip' variable.
Andriy Voskoboinyk [Tue, 10 Jan 2017 01:09:39 +0000 (01:09 +0000)]
rtwn_pci(4): fix possible race while accessing 'matched_chip' variable.

7 years agoAdd PID for Belkin F5U258 "Windows Easy Transfer Cable", a udbp-like device.
Bruce M Simpson [Tue, 10 Jan 2017 00:28:01 +0000 (00:28 +0000)]
Add PID for Belkin F5U258 "Windows Easy Transfer Cable", a udbp-like device.

7 years agoAdjust ACPI_EXPORT_SYMBOL for AcpiGetTableWithSize
Conrad Meyer [Tue, 10 Jan 2017 00:03:43 +0000 (00:03 +0000)]
Adjust ACPI_EXPORT_SYMBOL for AcpiGetTableWithSize

Suggested by: jbeich@

7 years agocd9660: typedef cd_ino_t in preference to #define
Conrad Meyer [Mon, 9 Jan 2017 23:56:45 +0000 (23:56 +0000)]
cd9660: typedef cd_ino_t in preference to #define

Suggested by: kib@

7 years agocd9660: Add a prototype for cd9660_vfs_hash_cmp
Conrad Meyer [Mon, 9 Jan 2017 23:51:31 +0000 (23:51 +0000)]
cd9660: Add a prototype for cd9660_vfs_hash_cmp

GCC warns (and errors, with -Werror) about it otherwise.  Clang doesn't care.

Introduced in r311665.

Reported by: np@

7 years agoWhite space cleanup from an cut-n-paste.
Sean Bruno [Mon, 9 Jan 2017 23:45:40 +0000 (23:45 +0000)]
White space cleanup from an cut-n-paste.

Submitted by: mmacy@nextbsd.org

7 years agortwn_usb(4): do not try to modify global static structure.
Andriy Voskoboinyk [Mon, 9 Jan 2017 23:42:02 +0000 (23:42 +0000)]
rtwn_usb(4): do not try to modify global static structure.

Use a local copy for modifications instead.

Tested with RTL8821AU (AP) + RTL8188EU (STA).

Reported by: hselasky

7 years agoRemove unused mtx_held() macro.
Sean Bruno [Mon, 9 Jan 2017 23:41:10 +0000 (23:41 +0000)]
Remove unused mtx_held() macro.

7 years agocxgbe(4): Enable automatic cidx flush for all control queues.
Navdeep Parhar [Mon, 9 Jan 2017 22:20:09 +0000 (22:20 +0000)]
cxgbe(4): Enable automatic cidx flush for all control queues.

MFC after: 3 days

7 years agocxgbe(4): The wraparound logic in start_wrq_wr() should not get involved
Navdeep Parhar [Mon, 9 Jan 2017 22:18:08 +0000 (22:18 +0000)]
cxgbe(4): The wraparound logic in start_wrq_wr() should not get involved
in work requests that end at the end of the descriptor ring, even though
the pidx wraps around to 0.

MFC after: 3 days

7 years ago[rsu] add support for the "green" rsu NICs.
Adrian Chadd [Mon, 9 Jan 2017 21:46:24 +0000 (21:46 +0000)]
[rsu] add support for the "green" rsu NICs.

They're still a 1T2R NIC, so reuse the same rfconfig and
nstream configuration.

Submitted by: Idwer Vollering <vidwer@gmail.com>

7 years agoIn dummynet(4), random chunks of memory are casted to struct dn_*,
Marius Strobl [Mon, 9 Jan 2017 20:51:51 +0000 (20:51 +0000)]
In dummynet(4), random chunks of memory are casted to struct dn_*,
potentially leading to fatal unaligned accesses on architectures with
strict alignment requirements. This change fixes dummynet(4) as far
as accesses to 64-bit members of struct dn_* are concerned, tripping
up on sparc64 with accesses to 32-bit members happening to be correctly
aligned there. In other words, this only fixes the tip of the iceberg;
larger parts of dummynet(4) still need to be rewritten in order to
properly work on all of !x86.
In principle, considering the amount of code in dummynet(4) that needs
this erroneous pattern corrected, an acceptable workaround would be to
declare all struct dn_* packed, forcing compilers to do byte-accesses
as a side-effect. However, given that the structs in question aren't
laid out well either, this would break ABI/KBI.
While at it, replace all existing bcopy(9) calls with memcpy(9) for
performance reasons, as there is no need to check for overlap in these
cases.

PR: 189219
MFC after: 5 days

7 years agoForcibly remove the cached items from pseudofs vncache on module unload.
Konstantin Belousov [Mon, 9 Jan 2017 20:14:18 +0000 (20:14 +0000)]
Forcibly remove the cached items from pseudofs vncache on module unload.

If some process' nodes were accessed using procfs and the process
cannot exit properly at the time modunload event is reported to the
pseudofs-backed filesystem, the assertion in pfs_vncache_unload() is
triggered.  Assertion is correct, the cache should be cleaned.

Approved by: des (pseudofs maintainer)
Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoAvoid taking the address of a packed struct member in mfiutil
Dimitry Andric [Mon, 9 Jan 2017 19:39:35 +0000 (19:39 +0000)]
Avoid taking the address of a packed struct member in mfiutil

Fix a clang 4.0.0 warning about taking the address of a packed member of
struct mfi_evt in mfiutil:

    usr.sbin/mfiutil/mfi_evt.c:583:30: error: taking address of packed
    member 'members' of class or structure 'mfi_evt' may result in an
    unaligned pointer value [-Werror,-Waddress-of-packed-member]
                            if (parse_locale(optarg, &filter.members.locale) < 0) {
                                                      ^~~~~~~~~~~~~~~~~~~~~

Use a local variable instead, and copy that into the struct.

Reviewed by: jhb
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D9069

7 years agoAdd recently added libc++ headers to OptionalObsoleteFiles.inc.
Dimitry Andric [Mon, 9 Jan 2017 19:22:29 +0000 (19:22 +0000)]
Add recently added libc++ headers to OptionalObsoleteFiles.inc.

MFC after: 3 days

7 years agoAfter r311565, also remove llvm-ranlib from ObsoleteFiles.inc.
Dimitry Andric [Mon, 9 Jan 2017 19:12:41 +0000 (19:12 +0000)]
After r311565, also remove llvm-ranlib from ObsoleteFiles.inc.

7 years agoRewrite CTL statistics in more simple and scalable way.
Alexander Motin [Mon, 9 Jan 2017 18:18:15 +0000 (18:18 +0000)]
Rewrite CTL statistics in more simple and scalable way.

Instead of collecting statistics for each combination of ports and logical
units, that consumed ~45KB per LU with present number of ports, collect
separate statistics for every port and every logical unit separately, that
consume only 176 bytes per each single LU/port.  This reduces struct
ctl_lun size down to just 6KB.

Also new IOCTL API/ABI does not hardcode number of LUs/ports, and should
allow handling of very large quantities.

MFC after: 2 weeks (probably keeping old API enabled for some time)

7 years agoAdd sdhci_handle_card_present_locked() that can be called from the interrupt
Ian Lepore [Mon, 9 Jan 2017 17:10:50 +0000 (17:10 +0000)]
Add sdhci_handle_card_present_locked() that can be called from the interrupt
handler which already holds the mutex, and have sdhci_handle_card_present()
be just a tiny wrapper that does the locking for external callers.

This should fix the recursive locking panics seen on rpi3.

Reported by: Shawn Webb

7 years ago- Add support for Intel Apollo Lake and Bay Trail eMMC controllers.
Marius Strobl [Mon, 9 Jan 2017 17:07:13 +0000 (17:07 +0000)]
- Add support for Intel Apollo Lake and Bay Trail eMMC controllers.
  Besides slots always having non-removable media, these HCIs require
  a custom hardware reset sequence after power-up.
- Flesh out the support for Intel Braswell eMMC controllers further.
  Apart from also requiring said reset code, the timeout clock needs to
  be hardcoded to 1 MHz for these.
  Both the special reset and timeout clock handlings are implemented as
  global sdhci(4) quirks as the same treatment will be necessary for
  Intel eMMC controllers attached via ACPI (once sdhci(4) grows such a
  front-end).
- In sdhci_init_slot(), use the right capability field for determining
  the announced bus width based on MMC_CAP_*_BIT_DATA.
- Correct inverted sdhci_pci_softc member comments added in r276469. [1]

Submitted by: Anton Yuzhaninov [1]
MFC after: 5 days

7 years agoIn mmcsd_task(), bio_resid was not being set to 0 on a successful read
Marius Strobl [Mon, 9 Jan 2017 17:05:39 +0000 (17:05 +0000)]
In mmcsd_task(), bio_resid was not being set to 0 on a successful read
or write, resulting in random short-read and short-write returns for
requests. Fixing this fixes nominal block I/O via mmcsd(4).

Obtained from: DragonFlyBSD (fd4b97583be1a1e57234713c25f6e81bc0411cb0)
MFC after: 5 days

7 years agoAllocate memory for prevent flags only for removable LUs.
Alexander Motin [Mon, 9 Jan 2017 16:21:06 +0000 (16:21 +0000)]
Allocate memory for prevent flags only for removable LUs.

This array takes 64KB of RAM now, that was more then half of struct ctl_lun
size.  If at some point we support more ports, this may need another tune.

MFC after: 2 weeks

7 years agoUse standard Versions.def for libprocstat.
Konstantin Belousov [Mon, 9 Jan 2017 11:11:52 +0000 (11:11 +0000)]
Use standard Versions.def for libprocstat.

This makes the versions inheritance consistent for our versioned libraries.

Extracted from: ino64
Discussed with: kan
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoUse tab for indent.
Konstantin Belousov [Mon, 9 Jan 2017 10:47:20 +0000 (10:47 +0000)]
Use tab for indent.

Extracted from: ino64 work by gleb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoFix rstat: symbol not in namelist from netstat
Steven Hartland [Mon, 9 Jan 2017 09:28:03 +0000 (09:28 +0000)]
Fix rstat: symbol not in namelist from netstat

Load kvm symbols earlier to prevent rstat: symbol not in namelist
error when running netstat -rs.

Submitted by: Sebastian Huber <sebastian.huber@embedded-brains.de>
MFC after: 1 week
Sponsored by: Multiplay

7 years agoFix typo.
Xin LI [Mon, 9 Jan 2017 07:36:31 +0000 (07:36 +0000)]
Fix typo.

MFC after: 3 days

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