Commit Graph

219329 Commits

Author SHA1 Message Date
Enji Cooper
b55d259a14 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
2017-01-09 06:13:27 +00:00
Enji Cooper
8406423362 Use calloc instead of malloc + memset(.., 0, ..)
MFC after:	5 days
2017-01-09 06:03:49 +00:00
Enji Cooper
c5f8d75113 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
2017-01-09 05:51:38 +00:00
Enji Cooper
c7af73f3fb Bump WARNS up from 0 to 6
MFC after:	5 days
2017-01-09 05:46:41 +00:00
Enji Cooper
22d6cc269c Document bsd.snmpmod.mk from a high-level
MFC after:	2 weeks
2017-01-09 04:35:55 +00:00
Sepherosa Ziehau
227bb849d3 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
2017-01-09 03:38:41 +00:00
Enji Cooper
fbd43e4c99 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
2017-01-09 03:21:21 +00:00
Enji Cooper
3fab006f0b 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
2017-01-09 03:18:19 +00:00
Enji Cooper
6fec23edd3 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
2017-01-09 03:14:04 +00:00
Enji Cooper
306324d7f2 Use SRCTOP instead of spelling out the full path with .CURDIR
This helps condense the output for CFLAGS and .PATH

MFC after:	3 days
2017-01-09 03:08:21 +00:00
Ian Lepore
8adb836cda Use the new sdhci_fdt_gpio helper functions to add full support for FDT
gpio pins for detecting card insert/remove and write protect.
2017-01-09 02:04:54 +00:00
Ian Lepore
e62eb51d5a Use the new sdhci_fdt_gpio helper functions to add full support for FDT
gpio pins for detecting card insert/remove and write protect.
2017-01-09 01:57:51 +00:00
Ian Lepore
78906a722f 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.
2017-01-09 01:54:36 +00:00
Enji Cooper
0ab7046959 Use nitems(mib) instead of hardcoding mib's length when calling sysctl(3)
MFC after:	3 days
2017-01-09 01:47:00 +00:00
Ian Lepore
639f59f02a 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!).
2017-01-09 01:15:18 +00:00
Enji Cooper
75b6a179ac Use nitems({mib,name}) instead of hardcoding their value
MFC after:	3 days
2017-01-09 00:54:18 +00:00
Enji Cooper
7adf46f0c6 lib/libutil/kinfo_*: style cleanup
- Use nitems(mib) instead of hardcoding mib's length
- Sort sys/ #includes

MFC after:	3 days
2017-01-09 00:47:23 +00:00
Enji Cooper
074a0dcceb Use nitems(mib) instead of hardcoding mib's length
MFC after:	3 days
2017-01-09 00:38:19 +00:00
Enji Cooper
240ecb400f Sort #includes
MFC after:	3 days
2017-01-09 00:37:09 +00:00
Enji Cooper
b3b69d9980 Clean up trailing whitespace
MFC after:	3 days
2017-01-09 00:33:27 +00:00
Enji Cooper
a22656f0b2 Style fixes
- Delete trailing whitespace
- Use nitems(mib) instead of hardcoding the mib length

MFC after:	3 days
2017-01-09 00:29:23 +00:00
Enji Cooper
cc94da1bea Style(9) fixes
- Sort sys/ #includes
- Use nitems instead of hardcoding the length of `mib`

MFC after:	3 days
2017-01-09 00:25:33 +00:00
Andriy Voskoboinyk
0866194cab 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.
2017-01-08 23:41:17 +00:00
Baptiste Daroussin
e02e924c76 Update pciids to 2017.01.08
MFC after:	1 day
2017-01-08 23:25:46 +00:00
Justin Hibbits
009dedabb3 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.
2017-01-08 21:12:46 +00:00
Peter Grehan
26e6e3e65d 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
2017-01-08 20:58:58 +00:00
Luiz Otavio O Souza
4723c14fa9 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
2017-01-08 20:41:32 +00:00
Luiz Otavio O Souza
bca353cacb 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)
2017-01-08 20:37:41 +00:00
Peter Grehan
6e616e4f4b 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
2017-01-08 20:29:35 +00:00
Mark Johnston
8cd3b2042c 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
2017-01-08 18:46:00 +00:00
Ian Lepore
90993663f8 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
2017-01-08 18:28:06 +00:00
Dimitry Andric
012039fd55 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
2017-01-08 17:56:54 +00:00
Alexander Motin
81241f2828 Make CTL_GETSTATS ioctl return partial data if buffer is small.
MFC after:	2 weeks
2017-01-08 13:26:34 +00:00
Andrey V. Elsukov
18b105c27b 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
2017-01-08 12:40:07 +00:00
Adrian Chadd
a1dce3c0a3 [net80211] add roaming parameters for 11ac.
These are mostly placeholders for now.
2017-01-08 10:13:05 +00:00
Adrian Chadd
72ad0cc6be [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.
2017-01-08 10:07:54 +00:00
Conrad Meyer
55cfad428b iso_rrip.h: Hide kernel definitions from makefs(8)
Reported by:	O. Hartmann <ohartmann at walstatt.org>
2017-01-08 09:16:07 +00:00
Conrad Meyer
f9d593d771 libprocstat: Include cd9660 headers in the same order as the kernel
Fix userspace build after r311665.
2017-01-08 08:36:37 +00:00
Conrad Meyer
bb577bb699 chown/chgrp: Add SIGINFO handler
PR:		191884
Submitted by:	Dan McGregor <dan.mcgregor at usask.ca>
Reviewed by:	mjg@ (earlier version)
2017-01-08 06:58:42 +00:00
Conrad Meyer
a758566cb8 chmod: Add SIGINFO handler
PR:		191884
Submitted by:	Dan McGregor <dan.mcgregor at usask.ca>
Reviewed by:	mjg@ (earlier version)
2017-01-08 06:50:53 +00:00
Conrad Meyer
8436bcc87d Add some additional ACPI methods for DRM
Add AcpiGetDataFull and AcpiGetTableWithSize.

Submitted by:	Matt Macy
2017-01-08 06:26:33 +00:00
Conrad Meyer
c8227de25f 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
2017-01-08 06:22:35 +00:00
Conrad Meyer
dbaab6e66f 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>
2017-01-08 06:21:49 +00:00
Conrad Meyer
0c6393a265 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
2017-01-08 06:20:21 +00:00
Adrian Chadd
b092fd69a8 [net80211] include the prototype VHT code into the build.
Note: it isn't called anywhere yet!
2017-01-08 04:27:08 +00:00
Adrian Chadd
b6fec8d603 [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.)
2017-01-08 04:25:41 +00:00
Adrian Chadd
cb4319e3b4 [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.
2017-01-08 04:23:05 +00:00
Ian Lepore
6e37fb2b62 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).
2017-01-08 02:32:53 +00:00
Baptiste Daroussin
0922cf8d32 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
2017-01-07 23:42:17 +00:00
Ian Lepore
ee2c73e559 Only write to *active once, even when GPIO_ACTIVE_LOW is set. 2017-01-07 22:55:23 +00:00