Commit Graph

195021 Commits

Author SHA1 Message Date
Gleb Smirnoff
67af272bcf Do not allocate zero-length mbuf in sosend_generic().
Found by:	pho
Sponsored by:	Nginx, Inc.
2014-11-19 14:27:38 +00:00
Zbigniew Bodek
dc61566f95 Stop using early_putc immediately after configuring console with cninit()
Early UART should be released right after system console initialization is
completed. Otherwise, after cninit() both early and system console coexist
what may lead to various issues (i.a. writing to unmapped early
UART address). This cannot be done in cninit_finish() since it can be
called late at the end of MI configuration.

Obtained from:   Semihalf
Reviewed by:     andrew
Sponsored by:    The FreeBSD Foundation
2014-11-19 14:23:29 +00:00
Mark Felder
46ad509bf8 Expose groups by default in ifconfig output. This was never hidden by
OpenBSD; unsure why we chose to do so. As groups are a requirement for
pf, exposing them by default will make our pf implementation less
confusing.

While here add a missing free() that OpenBSD fixed 7 years ago.

PR:		194925
Differential Revision:	https://reviews.freebsd.org/D1185
Approved by:	des
Obtained from:	OpenBSD
2014-11-19 13:57:39 +00:00
Ermal Luçi
7b56cc430a pf(4) needs to have a correct checksum during its processing.
Calculate checksums for the IPv6 path when needed before
delving into pf(4) code as required.

PR:     172648, 179392
Reviewed by:    glebius@
Approved by:    gnn@
Obtained from:  pfSense
MFC after:      1 week
Sponsored by:   Netgate
2014-11-19 13:31:08 +00:00
Alexander Motin
b3a9e657c3 Fix build without INVARIANTS, broken by r274675. 2014-11-19 13:04:25 +00:00
Dmitry Chagin
34b3339810 Revert r274635 as it's completely wrong.
The parent of a pci dev device is a pciX device which do not
implement the PCIB_POWER_FOR_SLEEP method from pcib_if.m.
2014-11-19 11:05:45 +00:00
Edward Tomasz Napierala
9606f9b5c4 Fix typo.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2014-11-19 08:59:49 +00:00
Dimitry Andric
cfd2f3f928 Fix the following -Werror warning from clang 3.5.0, while building
lib/libngatm:

sys/contrib/ngatm/netnatm/saal/saal_sscop.c:4030:32: error: 'break' is bound to current loop, GCC binds it to the enclosing loop [-Werror,-Wgcc-compat]
                } while(sn < sscop->vr_h && !QFIND(&sscop->rbuf, sn));
                                             ^
sys/contrib/ngatm/netnatm/saal/saal_sscop.c:173:4: note: expanded from macro 'QFIND'
                        break;                                          \
                        ^
1 error generated.

The idea is to remove any ambiguity by replacing the macro with an
equivalent static inline function.

Reviewed by:	emaste, rpaulo
See also:	http://reviews.llvm.org/D2518
Differential Revision: https://reviews.freebsd.org/D1188
2014-11-19 07:47:37 +00:00
Dimitry Andric
c577699e4b Fix the following -Werror warning from clang 3.5.0, while building cddl/lib/libctf:
In file included from cddl/contrib/opensolaris/common/ctf/ctf_create.c:31:
In file included from sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h:34:
sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h:334:9: warning: '_ILP32' macro redefined [-Wmacro-redefined]
#define _ILP32
        ^
<built-in>:26:9: note: previous definition is here
#define _ILP32 1
        ^
1 warning generated.

This is because clang 3.5.0 started predefining _ILP32 and __ILP32__ for
the i386 arch.  (Earlier versions already predefined _LP64 and __LP64__
for the x86_64 arch.)

Reviewed by:	emaste, avg, smh, delphij, markj
Differential Revision: https://reviews.freebsd.org/D1187
2014-11-19 07:44:21 +00:00
Kevin Lo
fa20eb98a8 Add Trendnet TEW-646UBH.
Submitted by:	bolshakov_1 at yahoo dot com
2014-11-19 05:38:45 +00:00
Xin LI
8c3d6a4ab2 Make vfs.zfs.max_recordsize read-write at runtime.
MFC after:	2 weeks
2014-11-18 22:35:19 +00:00
John Baldwin
c1dffb2f08 Add locking to wds(4) and mark MPSAFE.
- Add per-softc mutex.
- Use mutex for CAM SIM lock.
- Use bus_*() instead of inb() and outb().
- Use bus_alloc_resource_any() when reasonable.

Tested by:	no one
2014-11-18 22:12:51 +00:00
John Baldwin
42e8c47b78 Add locking to scd(4) and mark MPSAFE.
- Actually use existing per-softc mutex.
- Use mutex in cdev routines and remove D_NEEDGIANT.
- Use callout(9) instead of timeout(9).
- Don't check for impossible conditions (e.g. SCDINIT being clear).
- Use bus_*() instead of bus_space_*().

Tested by:	no one
2014-11-18 22:02:37 +00:00
John Baldwin
369934d602 Cleanups to pst(4):
- Use callout(9) instead of timeout(9).
- Don't bother zero'ing the softc.
- Destroy mutex on detach.

Tested by:	no one
2014-11-18 21:58:57 +00:00
John Baldwin
caddd60abd Add locking to mly(4) and mark MPSAFE.
- Add a per-softc mutex.
- Use mutex as CAM sim lock.
- Use taskqueue_thread instead of taskqueue_swi_giant.
- Use callout(9) instead of timeout(9).
- Use bus_*() instead of bus_space_*().

Tested by:	no one
2014-11-18 21:55:50 +00:00
John Baldwin
23c31a3c5d Add locking to mcd(4) and mark MPSAFE.
- Actually use existing per-softc mutex.
- Use mutex in cdev routines and remove D_NEEDGIANT.
- Use callout(9) instead of timeout(9).
- Don't check for impossible conditions (e.g. MCDINIT being clear).
- Remove critical_enter/exit when sending a PIO command.
- Use bus_*() instead of bus_space_*().

Tested by:	no one
2014-11-18 21:51:01 +00:00
John Baldwin
2a0db815fe Convert the refire_notify_ack timer from timeout(9) to callout(9).
Tested by:	no one
2014-11-18 21:03:46 +00:00
Xin LI
8efcd876ca Add a tunable for spa_slop_shift which controls how much space we
would reserve by default.  Tuning is not recommended.

MFC after:	2 weeks
2014-11-18 18:52:38 +00:00
Xin LI
18144ab1a3 Allow tuning zfs_max_recordsize via loader tunable. Tuning is NOT
recommended.

Requested by:	Slawa Olhovchenkov <slw zxy spb ru>
MFC after:	2 weeks
2014-11-18 18:40:01 +00:00
Marcel Moolenaar
c600d3070d Upgrade libxo to 0.1.6.
Summary of changes:
1.  Coverity defect fixes

Obtained from:  https://github.com/Juniper/libxo/releases/tag/0.1.6
2014-11-18 18:03:40 +00:00
Luiz Otavio O Souza
edd14576c4 Make gpio_default_map_gpios() static. No functional changes. 2014-11-18 17:37:33 +00:00
Luiz Otavio O Souza
667357dc9b Moves all the duplicate code to a single function.
Verify for invalid modes and unwanted flags before pass the new flags to
driver.
2014-11-18 17:22:08 +00:00
Warner Losh
61c009a1a8 These delays aren't needed. Elimate them. They should be on the order
of a few cycles at most, not 10us. They make it impossible to
implement half-duplex protocols that are faster than about 1KHz.

Sponsored by: Netflix
2014-11-18 17:07:02 +00:00
Warner Losh
40e6bdaf1e opt_global.h is included automatically in the build. No need to
explicitly include it in these places.

Sponsored by: Netflix
2014-11-18 17:06:56 +00:00
Warner Losh
0a8fbf6472 No need to list opt_global.h. No need to force ALTQ here, since that's
not the normal default for the system and nothing else forces it on.

Sponsored by: Netflix
2014-11-18 17:06:54 +00:00
Warner Losh
621dde6bf2 opt_global.h is never needed in SRCS lists.
Sponsored by: Netflix
2014-11-18 17:06:52 +00:00
Warner Losh
7faf4201b4 Document WITHOUT_USB_EXAMPLES and WITHOUT_TESTS_SUPPORT
Sponsored by: Netflix
2014-11-18 17:06:50 +00:00
Warner Losh
c0257988b3 LIB32 is supported for powerpc64 too. Make the note more general about
64-bit processors.

Sponsored by: Netflix
2014-11-18 17:06:48 +00:00
Warner Losh
260a867f85 Fix typo pointed out by avg@ and Joerg Sonnenberger. Add a clarifying
sentence too.

Sponsored by: Netflix
2014-11-18 17:06:46 +00:00
Warner Losh
590461a4b8 Acutally, replaces NO_INCS with WITHOUT_INCLUDES and make
WITHOUT_TOOLCHAIN imply it instead.

Sponsored by: Netflix
2014-11-18 17:06:44 +00:00
Warner Losh
73f49e9eef Implement the historic DIOCGDINFO ioctl for gpart on BSD
partitions. Several utilities still use this interface and require
additional information since gpart was activated than before. This
allows fsck of a UFS partition without having to specify it is UFS,
per historic behavior.
2014-11-18 17:06:40 +00:00
Justin Hibbits
c2384debfc Missed a terminating ';'.
X-MFC-with:	r273009
2014-11-18 16:31:00 +00:00
Ruslan Bukin
707aef95a0 Add Altera Parallel IO (PIO) device driver.
Sponsored by:	DARPA, AFRL
2014-11-18 14:12:19 +00:00
Ruslan Bukin
c141c5c6b6 Add Virtio MMIO bus driver.
Sponsored by:	DARPA, AFRL
2014-11-18 14:11:14 +00:00
Mark Felder
dfe9215b4e Re-work non-persistent filesystem detection as it was not possible to
detect /dev/md backed mfs filesystems that way.

Differential Revision:	https://reviews.freebsd.org/D1163
Approved by:	ian
2014-11-18 13:38:09 +00:00
Gleb Smirnoff
e122dfc1ce Collapse three contiguous comment blocks into one. Remove historical
note about wrong assumptions 20 years ago. Use proper casing.

Sponsored by:	Nginx, Inc.
2014-11-18 13:38:07 +00:00
Ian Lepore
e93af0f1b9 Fix the i2c bus speed divisors for TI OMAP4 and AM335x.
For OMAP4, the old values for 1MHz gave a bus frequency of about 890KHz.
The new numbers hit 1MHz exactly.

For AM335x the prescaler values are adjusted to give a 24MHz clock for
all 3 standard speeds, as the manual recommends (as near as we can tell,
there are errors and typos apparent in the document).  Also, 1MHz speed
is added, and has been tested successfully on a BeagleboneWhite board.

PR:		195009
2014-11-18 03:26:52 +00:00
Luiz Otavio O Souza
4d7318e076 Fix gpiobus_child_location_str() to return a real string with the mapped
pins.

Make gpiobus_print_pins() static again.
2014-11-18 02:41:35 +00:00
Luiz Otavio O Souza
f3e51f4ba0 Remove unnecessary code.
After r273566, the gpiobus version of bus_print_child() also works on FDT
systems.
2014-11-18 02:11:07 +00:00
Ian Lepore
844aff82a6 Allow i2c bus speed to be configured via hints, FDT data, and sysctl.
The current support for controlling i2c bus speed is an inconsistant mess.
There are 4 symbolic speed values defined, UNKNOWN, SLOW, FAST, FASTEST.
It seems to be universally assumed that SLOW means the standard 100KHz
rate from the original spec.  Nothing ever calls iicbus_reset() with a
speed of FAST, although some drivers would treat it as the 400KHz standard
speed.  Mostly iicbus_reset() is called with the speed set to UNKNOWN or
FASTEST, and there's really no telling what any individual driver will do
with those.

The speed of an i2c bus is limited by the speed of the slowest device on
the bus.  This means that generally the bus speed needs to be configured
based on the board/system and the components within it.  Historically for
i2c we've configured with device hints.  Newer systems use FDT data and it
documents a clock-frequency property for i2c busses.  Hobbyists and
developers are likely to want on the fly changes.  These changes provide
all 3 methods, but do not require any existing drivers to change to use
the new facilities.

This adds an iicbus method, iicbus_get_frequency(dev, speed) that gets the
frequency for the requested symbolic speed.  If the symbolic speed is SLOW
or if there is no speed configured for the bus, the returned value is
100KHz, always.  Otherwise, if bus speed is configured by hints, fdt,
tunable, or sysctl, that speed is returned.  It also adds a helper
function, iicbus_init_frequency() that any bus driver subclassed from
iicbus can initialize the frequency from some other source of info.

Initial driver implementations are provided for Freescale and TI.

Differential Revision:        https://reviews.freebsd.org/D1174
PR:		195009
2014-11-18 01:54:31 +00:00
Warner Losh
668ed8aa02 Use automated MK_INET*_SUPPORT code here as well. 2014-11-18 01:39:23 +00:00
Warner Losh
7bfa86f62a Modernize comments about BIOSes being lame since in this detail they
aren't lame, the rules changed along the way. Catch up to 1999 or so
with the new rules.
2014-11-18 01:39:21 +00:00
Luiz Otavio O Souza
138bf90953 Add basic interrupt management code to gpiobus and ofw_gpiobus.
This is the general support to allow the use of GPIO pins as interrupt
sources for direct gpiobus children.

The use of GPIO pins as generic interrupt sources (for an ethernet driver
for example) will only be possible when arm/intrng is complete.  Then, most
of this code will need to be rewritten, but it works for now, is better
than what we have and will allow further developments.

Tested on:	ar71xx (RSPRO), am335x (BBB), bcm2835 (Raspberry pi)
Differential Revision:	https://reviews.freebsd.org/D999
Reviewed by:	rpaulo
2014-11-18 01:38:39 +00:00
Mark Johnston
af62c4ddd0 DTrace imposes a 128-byte limit on the length of the function component of
a probe name. When dtrace -G builds up a DOF section for the specified
provider(s), the probe function names are truncated to fit in this limit.
The DOF is later used to build the symbol table for the generated object
file, so the table can end up with truncated references, causing link
errors.

Instead of potentially truncating symbol table entries, write the full
function name to the DOF string table and allow the kernel to enforce the
128-byte function name limit when a process attempts to load its DOF.

PR:		194757
Differential Revision:	https://reviews.freebsd.org/D1175
Reviewed by:	rpaulo
MFC after:	2 weeks
2014-11-17 22:22:16 +00:00
Xin LI
4facd36ca0 Sync with userland variant.
MFC after:	2 weeks
2014-11-17 21:01:35 +00:00
Dmitry Chagin
91bd62caf5 Use the correct device as the power_for_sleep() method
always pass request up to parent bridge.

Reviewed by:	jhb
MFC after:	1 week
xMFC:		r274386,r274397
2014-11-17 20:25:21 +00:00
Warner Losh
707767a88c Remove stray empty comment. The code is adequately explained in the
block comment above, so there's nothing to add here.
2014-11-17 16:30:51 +00:00
Brad Davis
f3bcbf2399 Clean up some language
Reviewed by:	will
2014-11-17 15:44:00 +00:00
Mark Felder
e2d52f146f Fix geom's "usage" generation to not fabricate usage/help output for any
imaginary class we give it.

Differential Revision:	https://reviews.freebsd.org/D1150
Submitted by:	homerj
Approved by:	pjd
2014-11-17 15:19:57 +00:00
Mark Felder
f88076f062 Add logic for detecting non-persistent filesystems being utilized by
workdir which would break the upgrade process upon reboot.

Currently we check for tmpfs and mdmfs.

PR:		195006
Differential Revision:	https://reviews.freebsd.org/D1163
Approved by:	cperciva
2014-11-17 15:12:46 +00:00