Commit Graph

109063 Commits

Author SHA1 Message Date
Michal Meloun
3501273dec TEGRA: Fix tegra_pcie driver after rman_res_t size change. 2016-03-18 07:13:09 +00:00
Adrian Chadd
f3e24d74a7 [net80211] IE 127 is not MESHEXTCAP, just EXTCAP.
It's not a mesh extended capabilities; it's just extended capabilities.
This is from 802.11-2012 8.4.2.29 (Extended Capabilities element.)
2016-03-18 04:00:57 +00:00
Adrian Chadd
e426a812db Add initial 802.11ac IEs and fields.
This is a subset of what's in the linux 802.11ac implementation.

I've verified that the bits that mention an 802.11ac draft are
still the same in 802.11ac-2013 and noted it accordingly.

This is for the most part one big no-op.

Obtained from:	802.11ac-2013.pdf
2016-03-18 03:55:00 +00:00
Justin Hibbits
1c81bc8303 Increase booke bus max address to 36-bits.
Sponsored by:	Alex Perez/Inertial Computing
2016-03-18 01:30:58 +00:00
Justin Hibbits
da1b038af9 Use uintmax_t (typedef'd to rman_res_t type) for rman ranges.
On some architectures, u_long isn't large enough for resource definitions.
Particularly, powerpc and arm allow 36-bit (or larger) physical addresses, but
type `long' is only 32-bit.  This extends rman's resources to uintmax_t.  With
this change, any resource can feasibly be placed anywhere in physical memory
(within the constraints of the driver).

Why uintmax_t and not something machine dependent, or uint64_t?  Though it's
possible for uintmax_t to grow, it's highly unlikely it will become 128-bit on
32-bit architectures.  64-bit architectures should have plenty of RAM to absorb
the increase on resource sizes if and when this occurs, and the number of
resources on memory-constrained systems should be sufficiently small as to not
pose a drastic overhead.  That being said, uintmax_t was chosen for source
clarity.  If it's specified as uint64_t, all printf()-like calls would either
need casts to uintmax_t, or be littered with PRI*64 macros.  Casts to uintmax_t
aren't horrible, but it would also bake into the API for
resource_list_print_type() either a hidden assumption that entries get cast to
uintmax_t for printing, or these calls would need the PRI*64 macros.  Since
source code is meant to be read more often than written, I chose the clearest
path of simply using uintmax_t.

Tested on a PowerPC p5020-based board, which places all device resources in
0xfxxxxxxxx, and has 8GB RAM.
Regression tested on qemu-system-i386
Regression tested on qemu-system-mips (malta profile)

Tested PAE and devinfo on virtualbox (live CD)

Special thanks to bz for his testing on ARM.

Reviewed By: bz, jhb (previous)
Relnotes:	Yes
Sponsored by:	Alex Perez/Inertial Computing
Differential Revision: https://reviews.freebsd.org/D4544
2016-03-18 01:28:41 +00:00
Justin Hibbits
7b54043f17 Add ummax()/ummin() to libkern.
This is committed in isolation from a larger patch so that it can be MFC'd
separately if needed.
2016-03-18 01:26:55 +00:00
Luiz Otavio O Souza
23cd11b603 Add support for dual emac mode.
In dual emac mode, the CPSW subsystem provides two independent ethernets.

This is implemented (as recommended by TI's TRM) with a mixture of switch
settings (vlans) and specific features of CPSW subsystem.

The driver was splitted to accommodate the shared parts (RX and TX rings
for example) while it still provides two independent ethernets.

Each of the ethernet ports driver has it's own set of MDIO registers among
the other private settings.

Previously this driver always operate in promisc mode, now the Switch ALE
(address table entry) is properly initialized and enabled.

The driver is also tested (and known to work) with both ports operating in
single port mode (active_slave 0 or 1).

Tested on uBMC (dual emac mode, both ports in single mode, giga and fast
ethernet) and BBB (single port, fast ethernet).

Sponsored by:	Rubicon Communications (Netgate)
2016-03-17 19:35:08 +00:00
Mark Johnston
ff63037da1 Modify defrouter_remove() to perform the router lookup before removal.
This allows some simplification of its callers. No functional change
intended.

Tested by:	Larry Rosenman (as part of a larger change)
MFC after:	1 month
2016-03-17 19:01:44 +00:00
Mark Johnston
48cc2d5e22 Remove unused variables dtrace_in_probe and dtrace_in_probe_addr. 2016-03-17 18:55:54 +00:00
Hans Petter Selasky
9795b2c6ce Add missing curly brackets in for loop.
Sponsored by:	Mellanox Technologies
MFC after:	1 week
2016-03-17 12:30:21 +00:00
Andrey V. Elsukov
3e16fab37b Reduce the number of local variables. Remove redundant check that inp
pointer isn't NULL, it is safe, because we are handling IPV6_PKTINFO
socket option in this block of code. Also, use in6ifa_withaddr() instead
of ifa_withaddr().
2016-03-17 11:10:44 +00:00
Andrey V. Elsukov
04894769f4 Change in6_selectsrc() to allow usage of non-local IPv6 addresses in
IPV6_PKTINFO ancillary data when IPV6_BINDANY socket option is set.

Submitted by:	n_hibma
MFC after:	2 weeks
2016-03-17 10:59:30 +00:00
Michal Meloun
f645a5d9c7 A20: Gpiobus can be attached only after full gpio driver initialization.
While i'm in, remove now unused global variable.

Submited by:	Emmanuel Vadot <manu@bidouilliste.com>
2016-03-17 08:57:41 +00:00
Andrew Turner
f32a1d9808 Make it an error to build an ARM kernel with COMPAT_FREEBSDn where n < 10.
We changed the ABI for ARM in 10, an removed support for the old ABI in 11,
as such binaries from these releases are unable to be run on a head kernel.

Reviewed by:	bz, emast
Sponsored by:	ABT Systems Ltd
Differential Revision:	https://reviews.freebsd.org/D5652
2016-03-17 08:40:58 +00:00
Luiz Otavio O Souza
0620372f28 Fixes a few style(9) issues, remove extra blank lines.
No functional changes.

Sponsored by:	Rubicon Comunications (Netgate)
2016-03-17 06:23:48 +00:00
Navdeep Parhar
784a631dc5 cxgbe(4): Tidy up PAUSE frame accounting.
Figure out if the chip is counting PAUSE frames in the "normal" stats
and take them out if it is.  This fixes a bug in the tx stats because
the default hardware behavior is different for Tx and Rx but the driver
was treating both the same way.  The result was that OPACKETS, OBYTES,
and OMCASTS were under-reported (if tx_pause > 0) before this change.

Note that the mac_stats sysctl still gives you the raw value of these
statistics straight from the device registers.
2016-03-17 01:15:16 +00:00
Adrian Chadd
4215404617 [net80211] Add some more missing IEs.
There are a /lot/ more missing; I'll chase these down over time.

Obtained from:	802.11-2012 standard
2016-03-17 01:09:21 +00:00
Conrad Meyer
82e17adcb4 fail(9): Only gather/print stacks if STACK is enabled
This is a follow-up fix to the earlier r296927.

Reported by:	bz
Sponsored by:	EMC / Isilon Storage Division
2016-03-17 01:05:53 +00:00
Allan Jude
b996592c3e Implement GELI (AES-XTS and AES-CBC only) in gptboot and gptzfsboot
Allows booting from a GELI encrypted root file system, via UFS or ZFS

Reviewed by:	gnn, smh (previous version), delphij (previous version)
Relnotes:	yes
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D4593
2016-03-16 23:12:19 +00:00
Gleb Smirnoff
e33c2e6b06 Due to invalid use of a signed intermediate value in the bounds checking
during argument validity verification, unbound zero'ing of the process LDT
and adjacent memory can be initiated from usermode.

Submitted by:	CORE Security
Patch by:	kib
Security:	SA-16:15
2016-03-16 22:33:12 +00:00
Navdeep Parhar
460f25e5ca cxgbe(4): Enable PFs 0-3, and allow creation of SR-IOV VFs on these PFs
in the default configuration files.
2016-03-16 19:46:22 +00:00
Navdeep Parhar
fc2aa1fc0b cxgbe(4): Enable additional capabilities in the default configuration
files.  All features with FreeBSD drivers of some kind are now in the
default configuration.
2016-03-16 19:43:44 +00:00
Navdeep Parhar
c47c408a38 cxgbe(4): Update some register settings in the default configuration
files to match the "uwire" configuration.
2016-03-16 19:41:00 +00:00
Navdeep Parhar
78aa2c994c cxgbe(4): Remove a couple of pointless assignments in sysctl_meminfo.
Do not display range if start = stop (this is a workaround for some
unused regions).
2016-03-16 19:36:11 +00:00
Ed Maste
643a7039b0 Remove armeb FreeBSD 6 compat shim
r296861 addressed a build failure due to undefined SYS_freebsd6_lseek
by adding a COMPAT_FREEBSD6 conditional, but we do not support FreeBSD 6
compatibility on armeb anyway so remove it completely.

Reviewed by:	andrew, bz
Differential Revision:	https://reviews.freebsd.org/D5643
2016-03-16 18:55:17 +00:00
Warner Losh
11a6314a69 Fix debug printf 2016-03-16 16:56:28 +00:00
Andrew Turner
8ef1f44afe Remove old COMPAT_FREEBSD options from the ARM kernel configs. We replaced
the ABI in 10.0, and have removed support for the old ABI in 11. As such
any of these options to provide compatibility prior to 10 are unneeded.

Sponsored by:	ABT Systems Ltd
2016-03-16 15:31:09 +00:00
Edward Tomasz Napierala
f8eecb9709 Pacify Coverity in a better way, to avoid write-only variable when building
without INVARIANTS.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-03-16 14:00:45 +00:00
Michal Meloun
ef2ee5d07a Import basic support for Nvidia Jetson TK1 board and tegra124 SoC.
The following pheripherals are supported: UART, MMC, AHCI, EHCI, PCIe, I2C,
PMIC, GPIO, CPU temperature and clock.

Note: The PCIe driver is pure mash at this moment. It will be reworked
immediately when both D5237 and D2579 enter the current tree.
2016-03-16 13:01:48 +00:00
Hans Petter Selasky
d4d32b9fec Fix kernel build after adding new sysctl asserts in r296933. 2016-03-16 10:42:24 +00:00
Hans Petter Selasky
6d5aaa1af8 Fix crash in krping when run as a client due to NULL pointer access.
Initialize pointer in question which is used only when fast registers
mode is selected.

Sponsored by:	Mellanox Technologies
MFC after:	1 week
2016-03-16 08:49:38 +00:00
Hans Petter Selasky
a435d46fdf Improve the implementation and documentation of the
SYSCTL_COUNTER_U64_ARRAY() macro.

- Add proper asserts to the SYSCTL_COUNTER_U64_ARRAY() macro that checks
  the size of the first element of the array.
- Add an example to the counter(9) manual page how to use the
  SYSCTL_COUNTER_U64_ARRAY() macro.
- Add some missing symbolic links for counter(9) while at it.
2016-03-16 08:37:52 +00:00
Kristof Provost
0d8c93313e pf: Improve forwarding detection
When we guess the nature of the outbound packet (output vs. forwarding) we need
to take bridges into account. When bridging the input interface does not match
the output interface, but we're not forwarding. Similarly, it's possible for the
interface to actually be the bridge interface itself (and not a member interface).

PR:		202351
MFC after:	2 weeks
2016-03-16 06:42:15 +00:00
Adrian Chadd
8abb337a01 Add initial VHT IE's and action codes.
Yes, there's more to 802.11ac than this.
2016-03-16 06:26:50 +00:00
Conrad Meyer
70e20d4e1a fail(9): Upstreaming some fail point enhancements
This is several year's worth of fail point upgrades done at EMC Isilon. They
are interdependent enough that it makes sense to put a single diff up for them.
Primarily, we added:

- Changing all mainline execution paths to be lockless, which lets us use fail
  points in more sleep-sensitive areas, and allows more parallel execution
- A number of additional commands, including 'pause' that lets us do some
  interesting deterministic repros of race conditions
- The ability to dump the stacks of all threads sleeping on a fail point
- A number of other API changes to allow marking up the fail point's context in
  the code, and firing callbacks before and after execution
- A man page update

Submitted by:	Matthew Bryan <matthew.bryan@isilon.com>
Reviewed by:	cem (earlier version), jhb, kib, pho
With feedback from:	bdrewery
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D5427
2016-03-16 04:22:32 +00:00
Adrian Chadd
73931706e7 [net80211] Begin implementing rate control module stats.
* Implement a new ratectl method, which defaults to returning nothing;
* Add a top level sysctl (net.wlan.X.rate_stats) to extract it;
* Add ratectl info for the 'amrr' module.

Tested:

* urtwn(4), STA mode

Differential Revision:	https://reviews.freebsd.org/D5630
2016-03-16 02:07:04 +00:00
Steven Hartland
d775d23ac5 Prevent invalid ixgbe advertise setting warning
Prevent ixgbe outputting "Invalid advertised speed" warning on boot with
no customisations by moving test from sysctl handler to set handler.

PR:		208022
MFC after:	3 days
Sponsored by:	Multiplay
2016-03-16 01:41:55 +00:00
Alexander Motin
fa9de58388 Fix small memory leak on attempt to access deleted snapshot.
MFC after:	3 days
2016-03-15 21:21:28 +00:00
Edward Tomasz Napierala
ee4256cf01 Pacify Coverity.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-03-15 20:42:36 +00:00
Ed Maste
931ef67a96 Fix copy-n-pasteo in r296899 ukbdmap.h header generation for pc98
The ukbd default is specified by UKBD_DFLT_KEYMAP not ATKBD_DFLT_KEYMAP.

PR:		193865
Submitted by:	Harald Schmalzbauer
2016-03-15 17:32:29 +00:00
Hans Petter Selasky
1f20c68e07 Use hardware computed Toeplitz hash for incoming flowids
Use the Toeplitz hash value as source for the flowid. This makes the
hash value more suitable for so-called hash bucket algorithms which
are used in the FreeBSD's TCP/IP stack when RSS is enabled.

Sponsored by:	Mellanox Technologies
MFC after:	1 week
2016-03-15 15:53:37 +00:00
Hans Petter Selasky
9319562b86 Fix witness panic in the ipoib_ioctl() function when unloading the
ipoib module.

The bpfdetach() function is trying to turn off promiscious mode on the
network interface it is attached to while holding a mutex. The fix
consists of ignoring any further calls to the ipoib_ioctl() function
when the network interface is going to be detached. The ipoib_ioctl()
function might sleep.

Sponsored by:	Mellanox Technologies
MFC after:	1 week
2016-03-15 15:47:26 +00:00
Konstantin Belousov
3ef966c4c0 The PKRU state size is 4 bytes, its support makes the XSAVE area size
non-multiple of 64 bytes.  Thereafter, the user state save area is
misaligned, which triggers assertion in the debugging kernels, or
segmentation violation on accesses for non-debugging configs.

Force the desired alignment of the user save area as the fix
(workaround is to disable bit 9 in the hw.xsave_mask loader tunable).
This correction is required for booting on the upcoming Intel' Purley
platform.

Reported and tested by:	"Pieper, Jeffrey E" <jeffrey.e.pieper@intel.com>,
	jimharris
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2016-03-15 15:42:53 +00:00
Michal Meloun
4e3d35d76e Add phy framework, a next part of new 'extended resources' family of
support frameworks (i.e. clk/regulators/tsensors/fuses...).

It provides simple unified consumers interface for manipulations with
phy (USB/SATA/PCIe) resources.
2016-03-15 15:31:17 +00:00
Michal Meloun
878ca242eb Add regulator framework, a next part of new 'extended resources' family of
support frameworks(i.e. clk/reset/phy/tsensors/fuses...).

The framework is still far from perfect and probably doesn't have stable
interface yet, but we want to start testing it on more real boards and
different architectures.
2016-03-15 15:30:17 +00:00
Michal Meloun
cc42bd4f3d CLK: Add and use explicit locking for access to clock device registers.
Implicit locking (for read/write/modify) is not sufficient for complex
cases.
2016-03-15 15:28:24 +00:00
Michal Meloun
58de845996 CLK: Add enumerator for 'clocks' OFW node. Add bus device bindings
for clk_fixed class.
2016-03-15 15:27:15 +00:00
Michal Meloun
3ad8c0e5a1 CLK: Remove forgotten mutex from clk_fixed class. 2016-03-15 15:25:26 +00:00
Michal Meloun
12bc2abb4f Use EARLY_DRIVER_MODULE() with BUS_PASS_BUS priority for ofw_gpiobus
and ofw_iicbus. This causes enumeration of gpiobus/iicbus at the base driver
attach time. Due to this, childern drivers can be also attached early.
2016-03-15 15:24:18 +00:00
Ed Maste
3aa274f7d7 Fix atkbdmap.h generation for sc/vt consoles
Keymap header files have historically been generated using the build
host's /usr/sbin/kbdcontrol and using the host's keymap files.

However, that introduces an issue when building a kernel to use vt(4)
on a system using sc(4), or vice versa: kbdcontrol searches for keymap
files in the /usr/share subdirectory appropriate for the host, not the
target.

With this change the build searches both the and sc keymap directories
from the source tree.

PR:		193865
Submitted by:	Harald Schmalzbauer
2016-03-15 13:38:15 +00:00