Commit Graph

109198 Commits

Author SHA1 Message Date
Jared McNeill
e1f3a8ce54 Return BUS_PROBE_GENERIC instead of 0 from ofw_clkbus_probe, giving
platform specific drivers a chance to override the generic driver.

Reviewed by:		mmel, adrian (mentor)
Approved by:		adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D5701
2016-03-23 19:21:21 +00:00
Wojciech Macek
f3e730a1e5 ARM64 copyinout improvements
The first of set of patches.
Use wider load/stores when aligned buffer is being copied.

In a simple test:
  dd if=/dev/zero of=/dev/null bs=1M count=1024
the performance jumped from 410MB/s up to 3.6GB/s.

TODO:
 - better handling of unaligned buffers (WiP)
 - implement similar mechanism to bzero

Submitted by:          Dominik Ermel <der@semihalf.com>
Obtained from:         Semihalf
Sponsored by:          Cavium
Reviewed by:           kib, andrew, emaste
Differential Revision: https://reviews.freebsd.org/D5664
2016-03-23 13:29:52 +00:00
Michael Tuexen
ed65436366 Add const to several constants. Thanks to Nicholas Nethercote for
providing the patch via
https://bugzilla.mozilla.org/show_bug.cgi?id=1255655

MFC after:	1 week
2016-03-23 13:28:04 +00:00
Konstantin Belousov
6336aefc1d Fix locking mistake in softdep_waitidle(). The surrounding code
expects that the loop is always exited with the SU lock owned, even on
error.

Reported and tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2016-03-23 09:58:51 +00:00
Bryan Drewery
9b511ce96b Handle copyin failures.
Skip the log entry as there is nothing good to write out.  Don't fail
the syscall though since it already succeeded.  There's no reason
filemon's tracing failure should fail the already-succeeded syscall.

Record the error for later to return from close(2) on the filemon devfs
file descriptor.

Discussed with:	markj, sjg, kib (briefly with kib)
Reported by:	mjg
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-03-22 22:41:14 +00:00
Bryan Drewery
eac5c9f26f Remove unused done argument to copyinstr(9).
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-03-22 22:41:10 +00:00
Bryan Drewery
4177d9f7d3 Return any log write failure encountered when closing the filemon fd.
Discussed with:	sjg, markj
Reviewed by:	sjg
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-03-22 22:41:07 +00:00
Bryan Drewery
4d9fbc5518 Follow-up r297156: Close the log in filemon_dtr rather than in the last reference.
If the tracer has decided to the close the log then it should be fully
written, not getting more entries, when close(2) returns.  This was
a regression in r297156 in that it allowed a traced process to continue
a traced syscall and add more entries to the log while the tracer had
already closed its fd or exited.  This was only really part of the
daemonized process case which is abnormal.

MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-03-22 22:41:03 +00:00
Justin Hibbits
f8fd3fb518 Fix the resource_list_print_type() calls to use uintmax_t.
Missed a bunch from r297000.
2016-03-22 22:25:08 +00:00
Adrian Chadd
0d66701783 [net80211] add missing static declarations.
Submitted by:	Sascha Wildner <saw@online.de>
Obtained from:	dragonflybsd (https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/822aeeabc8c4c074deea46383f36e6d1cdcd19f5)
2016-03-22 22:07:14 +00:00
Navdeep Parhar
78552b23a5 cxgbe(4): Be consistent and call ETHER_BPF_MTAP before writing anything
to the descriptor ring no matter what path the frame takes within the
driver's tx.
2016-03-22 18:56:23 +00:00
Jonathan T. Looney
5d20f97461 to_flags is currently a 64-bit integer; however, we only use 7 bits.
Furthermore, there is no reason this needs to be a 64-bit integer
for the forseeable future.

Also, there is an inconsistency between to_flags and the mask in
tcp_addoptions(). Before r195654, to_flags was a u_long and the mask in
tcp_addoptions() was a u_int. r195654 changed to_flags to be a u_int64_t
but left the mask in tcp_addoptions() as a u_int, meaning that these
variables will only be the same width on platforms with 64-bit integers.

Convert both to_flags and the mask in tcp_addoptions() to be explicitly
32-bit variables. This may save a few cycles on 32-bit platforms, and
avoids unnecessarily mixing types.

Differential Revision:	https://reviews.freebsd.org/D5584
Reviewed by:	hiren
MFC after:	2 weeks
Sponsored by:	Juniper Networks
2016-03-22 15:55:17 +00:00
Bjoern A. Zeeb
9901091eba Mfp4 @180378:
Factor out nd6 and in6_attach initialization to their own files.
  Also move destruction into those files though still called from
  the central initialization.

  Sponsored by:	CK Software GmbH
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Reviewed by:	gnn
Differential Revision:	https://reviews.freebsd.org/D5033
2016-03-22 15:43:47 +00:00
Edward Tomasz Napierala
68d35798b9 Wait for root mount tokens before showing the root mount prompt.
This restores the pre-r290196 behaviour, eliminating the need to manually
press '.' a couple of times to get USB to finish probing.

Note that there's still something wrong with the console (character
echoing doesn't quite work), and there's also a reported problem with
BHyVe, but those two don't seem related to the problem above.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-03-22 13:46:01 +00:00
George V. Neville-Neil
480f4e946d Add an mbuf provider to DTrace.
The mbuf provider is made up of a set of Statically Defined Tracepoints
which help us look into mbufs as they are allocated and freed.  This can be
used to inspect the buffers or for a simplified mbuf leak detector.

New tracepoints are:

mbuf:::m-init
mbuf:::m-gethdr
mbuf:::m-get
mbuf:::m-getcl
mbuf:::m-clget
mbuf:::m-cljget
mbuf:::m-cljset
mbuf:::m-free
mbuf:::m-freem

There is also a translator for mbufs which gives some visibility into the structure,
see mbuf.d for more details.

Reviewed by:	bz, markj
MFC after:	2 weeks
Sponsored by:	Rubicon Communications (Netgate)
Differential Revision:	https://reviews.freebsd.org/D5682
2016-03-22 13:16:52 +00:00
Michael Tuexen
e180827abc Support checksum offloading for TCP/IPV6 and UDP/IPV6.
Support SCTP checksum offloading for SCTP/IPV6.
Support SCTP checksum offloading on all controllers except 82575.

Reviewed by:	sbruno@, erj@
MFC after: 	4 weeks
Differential Revision:	D5193
2016-03-22 12:40:09 +00:00
Bjoern A. Zeeb
9e9a7326dd Adding pci_host_generic unconditionally breaks ARM boards with a PCI(e) interface.
Make it a device option to be included in the kernel configs that request this file.

Reported by:	mmel
Suggested by:	mmel
Reviewed by:	mmel
Differential Revision:	https://reviews.freebsd.org/D5699
2016-03-22 12:12:01 +00:00
Andrew Turner
f6c7371c81 Use the saved program state register to detect when an exception frame is
from userpsace. Previously we could have triggered a panic by trying to
jump to a kernel address from userland as the trap handling code thought we
received an ast in kernel mode.

Obtained from:	ABT Systems Ltd
Sponsored by:	The FreeBSD Foundation
2016-03-22 08:36:25 +00:00
Sepherosa Ziehau
2e4dba97bd hyperv/hn: When short of mbufs on the RX path, don't spam the console.
Instead, increase the IQDROPS counter.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5693
2016-03-22 07:08:47 +00:00
Sepherosa Ziehau
59526d4ac7 hyperv/hn: Factor out hn_set_lro_lenlim()
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5692
2016-03-22 06:42:24 +00:00
Sepherosa Ziehau
16ac3db526 hyperv/hn: Reduce TCP segment aggregation limit for multiple RX rings
This mainly used to improve ACK timeliness when multiple RX rings
are enabled.

This value gives the best performance in both Azure and Hyper-V
environment, w/ both 10Ge and 40Ge using non-{INVARIANTS,WITNESS}
kernel.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5691
2016-03-22 06:31:39 +00:00
Alexander Motin
ea2ef9931c Optimize IPMI watchdog patting.
Set watchdog timer parameters only when they really need to be changed.
In other cases just restart the timer with single Reset command instead
of two (Set and Reset).

From one side this visually reduces amount of CPU time burned in tight
loop waiting while some slow BMC configures its watchdog hardware, that
seems to be much more complicated task then just resetting the timer.

From another side on some BMCs those slow Set commands sometimes tend to
timeout, that leads to noisy log messages and even more CPU time burned,
so avoiding them can provide even bigger bonuses.

MFC after:	2 weeks
2016-03-22 06:24:52 +00:00
Sepherosa Ziehau
1f0dfd9918 hyperv/vmbus: Remove NULL check for taskqueue_create_fast(M_WAITOK)
Submitted by:	Jun Su <junsu microsoft com>
Reviewed by:	Dexuan Cui <decui microsoft com>, sephe
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5215
2016-03-22 06:23:09 +00:00
Sepherosa Ziehau
595a21e69e hyperv/vmbus: Use taskqueue_fast for non-performance critical messages
This gets rid of the per-cpu SWIs.

Submitted by:	Jun Su <junsu microsoft com>
Reviewed by:	Dexuan Cui <decui microsoft com>, sephe
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5215
2016-03-22 06:13:27 +00:00
Sepherosa Ziehau
1948628a54 hyperv/evttimer: Use an independent message slot so that it can work
Using the same message slot as the other types of the messages has
the side effect that the event timer message could be deferred to
the swi threads to run (lacking of trapframe and the original code
didn't even handle that, so the event timer was actually broken).

As of this commit we use an independent message slot for event timer,
so that we could handle all of event timer messages in the interrupt
handler directly.  Note, the message slot for event timer is still
bind to the same interrupt vector as the other types of messages.

Submitted by:	Jun Su <junsu microsoft com>
Reviewed by:	sephe
Discussed with: Jun Su <junsu microsoft com>, Dexuan Cui <decui microsoft com>
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5696
2016-03-22 05:48:51 +00:00
Adrian Chadd
cf9be7c92a [urtwn] welcome basic 11n support to urtwn.
This is a pretty good reference for teaching an almost-11n-capable
driver about 11n.

It enables HT20 operation, A-MPDU/A-MSDU RX, but no aggregate support
for transmit.  That'll come later.  This means that receive throughput
should be higher, but transmit throughput won't have changed much.

* Disable bgscan - for now, bgscan will interfere with AMPDU TX/RX,
  so until we correctly handle it in software driven scans, disable.
* Add null 11n methods for channel width / ampdu_enable.
  the firmware can apparently handle ampdu tx (and hopefully block-ack
  handling and retransmission) so I'll go review the linux code and
  figure it out.
* Set the number of tx/rx streams.  I /hope/ that nchains == nstreams
  here.
* Add 11n channels in the call to ieee80211_init_channels().
* Don't enable HT40 for now - I'll have to verify the channel set command
  and tidy it up a bit first.
* Teach the RX path about M_AMPDU for 11n nodes.  Kinda wonder why
  we aren't just doing this in net80211 already, this is the fourth
  driver I've had to do this to.
* Teach rate2ridx() about MCS rates and what hardware rates to use.
* Teach the urtwn_tx_data() routine about MCS/11ng transmission.
  It doesn't know about short-gi and 40MHz modes yet; that'll come
  later.
* For 8192CU firmware, teach the rate table code about MCS rates.
* Ensure that the fixed rate transmit sets the right transmit flag
  so the firmware obeys the driver transmit path.
* Set the default transmit rate to MCS4 if no rate control is available.
* Add HT protection (RTS-CTS exchange) support.

* Add appropriate XXX TODO entries.

TODO:

* 40MHz, short-gi, etc - channel tuning, TX, RX;
* teach urtwn_tx_raw() about (more) 11n stuff;
* A-MPDU TX would be nice!

Thanks to Andriy (avos@) for reviewing the code and testing it on IRC.

Tested:

* RTL8188EU - STA (me)
* RTL8192CU - STA (me)
* RTL8188EU - hostap (avos)
* RTL8192CU - STA (avos)

Reviewed by:	avos
2016-03-22 01:09:15 +00:00
Ian Lepore
c6fa17beae Build the zfs module on armv6, but not on older arm.
There have been reports in the past that zfs works on armv6, and now people
are wanting to test it again, so let's give them something to work with.
2016-03-21 23:32:13 +00:00
Andriy Voskoboinyk
abd89aa292 wpi: remove internal taskqueue
- Replace sc_reinittask() by ieee80211_restart_all() (mostly the same).
- Revert r282377 (seems to be unneeded now).

Tested with Intel 3945BG, STA mode.

Differential Revision:	https://reviews.freebsd.org/D5056
2016-03-21 23:25:41 +00:00
Bryan Drewery
d77f7e8c9d Consolidate common link(2) logic.
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-03-21 23:22:19 +00:00
Andriy Voskoboinyk
349156a945 rum: add legacy power saving support (STA mode).
Tested with WUSB54GC, STA mode + WRT54GC / RTL8188EU in HOSTAP mode.

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D5546
2016-03-21 22:29:24 +00:00
Justin Hibbits
d8d7c6b11e Fix some more long -> rman_res_t
Reported by:	Michael Butler (siis breakage)
2016-03-21 22:19:53 +00:00
Andriy Voskoboinyk
96e29c261d rum: simplify error handling in rum_newstate().
Tested with WUSB54GC, STA mode.

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D5544
2016-03-21 22:14:48 +00:00
John Baldwin
70f52fd69f Regen. 2016-03-21 21:38:35 +00:00
John Baldwin
bb430bc740 Fully handle size_t lengths in AIO requests.
First, update the return types of aio_return() and aio_waitcomplete() to
ssize_t.

POSIX requires aio_return() to return a ssize_t so that it can represent
all return values from read() and write().  aio_waitcomplete() should use
ssize_t for the same reason.

aio_return() has used ssize_t in <aio.h> since r31620 but the manpage and
system call entry were not updated.  aio_waitcomplete() has always
returned int.

Note that this does not require new system call stubs as this is
effectively only an API change in how the compiler interprets the return
value.

Second, allow aio_nbytes values up to IOSIZE_MAX instead of just INT_MAX.

aio_read/write should now honor the same length limits as normal read/write.

Third, use longs instead of ints in the aio_return() and aio_waitcomplete()
system call functions so that the 64-bit size_t in the in-kernel aiocb
isn't truncated to 32-bits before being copied out to userland or
being returned.

Finally, a simple test has been added to verify the bounds checking on the
maximum read size from a file.
2016-03-21 21:37:33 +00:00
Andriy Voskoboinyk
3770442708 rum: do not try to restore bssid/TSF synchronization when device
is not associated.

Tested with WUSB54GC, STA mode.

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D5543
2016-03-21 21:33:30 +00:00
Andriy Voskoboinyk
fd7dae9c98 rum: separate some microcontroller vendor-specific requests into
rum_do_mcu_request()

This change should be no-op.

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D5542
2016-03-21 21:02:57 +00:00
Andriy Voskoboinyk
d8c364fbed net80211: enable software beacon miss timer in SLEEP state
Tested with WUSB54GC, STA mode (w/ power saving enabled)

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D5545
2016-03-21 20:52:09 +00:00
Andriy Voskoboinyk
8a54c0614b net80211: add missing SLEEP -> AUTH state transition for station mode.
Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D5269
2016-03-21 20:39:45 +00:00
Bryan Drewery
8536d1b7e1 Attempt to use the namecache for openat(2) path resolution.
This finishes the work done in D2810.

MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-03-21 20:29:53 +00:00
Bryan Drewery
4f0d785142 Use curthread for vn_fullpath.
No functional change.

MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-03-21 20:29:46 +00:00
Bryan Drewery
4d3cfa1d9c Consolidate open(2) and openat(2) code.
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-03-21 20:29:43 +00:00
Bryan Drewery
6d2077c2be Stop tracking stat(2).
None of lstat(2), fstat(2), fstatat(2) were tracked either.

The other filemon implementations also do not track stat(2), nor
does bmake utilize it.  The act of opening a file for read should
be enough to decide that a file is a dependency.  There could be
rare cases where just having a file would cause a dependency but it
is unlikely.

MFC after:	2 weeks
Also noted by:	sjg
Sponsored by:	EMC / Isilon Storage Division
2016-03-21 20:29:39 +00:00
Bryan Drewery
e0d84b9ee9 Track filemon usage via a proc.p_filemon pointer rather than its own lists.
- proc.p_filemon is added which is protected by PROC_LOCK.  This improves
  performance and avoids double-fork issues, taking allproc_lock
  while in syscalls, and walking the process tree in syscalls.  A
  particular proc.p_filemon can only be changed to NULL or another
  filemon, or the filemon inherited, while the filemon->lock is held.
- Filemon are reference counted.  On the last reference the log will be closed.
- When closing the devfs file handle, the filemon will be detached from all
  processes and inheritance prevented.
- Disallow attaching to a process already being traced since filemon is
  typically intended to be used on children only.  This is allowed for
  curproc as bmake relies on this behavior for rare cases when combining
  .MAKE with .META.
- Detach any previously tracked process on ioctl(FILEMON_SET_PID).
- Handle error from devfs_set_cdevpriv() in filemon_open().
- The global filemon lock and lists are removed.
- A free list is no longer kept.  Previously this list was
  forever-expanding and never garbage cleaned.
- No longer loses track of double-forks.  If the process holding the filemon
  handle closes it will close the log rather than wait on a daemonized process,
  but it will log all activity until it closes its handle.  The filemon
  will be removed from the process and not inherited.
- A separate process count is kept only as an optimization for
  forced detachment to avoid taking allproc_lock and walking the entire
  process tree.
- struct filemon access is protected by sx(9) filemon->lock as it was before.
- Add more comments and KASSERTS.

MFC after:	2 weeks
Reviewed by:	kib, mjg, markj (all on previous versions)
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D5520
2016-03-21 20:29:27 +00:00
David C Somayajulu
32020557a6 Modifications to achieve a common source base from FreeBSD7.x thru 10.x
MFC after:5 days
2016-03-21 18:48:20 +00:00
Bryan Drewery
a774e11017 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	EMC / Isilon Storage Division
2016-03-21 18:02:26 +00:00
Ian Lepore
98acd232ad If the dhcp server provided an interface-mtu option, transcribe the value
to the boot.netif.mtu env var, which will be picked up by pre-existing code
in nfs_mountroot() and used to configure the interface accordingly.

This should bring the same functionality when the bootp/dhcp work is done
by loader(8) as r297150 does for the in-kernel BOOTP case.
2016-03-21 15:06:50 +00:00
Ian Lepore
a6c1490807 If the dhcp server provides an interface-mtu option, parse the value and
set that mtu on the interface.

These changes are based on the patch submitted by Robert Blayzor in the
PR, but I changed things around a bit, so the blame for any mistakes
belongs to me.

PR:		187094
2016-03-21 14:51:51 +00:00
Maxim Konovalov
ab77175063 o "avaliable" -> "available".
PR:		208141
Submitted by:	Tyler Littlefield
2016-03-21 08:03:50 +00:00
Sepherosa Ziehau
b6ba8b778a hyperv/vmbus: Implement bus_child_pnpinfo_str method
Submitted by:	Jun Su <junsu microsoft com>
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5669
2016-03-21 07:16:30 +00:00
Sepherosa Ziehau
57a339543d hyperv: Factor out snprinf_hv_guid()
Submitted by:	Ju Sun <junsu microsoft com>
Reviewed by:	Dexuan Cui <decui microsoft com>, sephe
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5651
2016-03-21 06:54:21 +00:00
Adrian Chadd
4f980f9fe3 Remove from NOTES - it's built as a module now.
Noticed by: sephe
2016-03-21 05:51:21 +00:00
Luiz Otavio O Souza
e5ee119ae0 Use the internal references for ADC, this fixes the ADC readings on uBMC.
Tested on BBB and uBMC.

Sponsored by:	Rubicon Communications (Netgate)
2016-03-21 03:39:38 +00:00
Luiz Otavio O Souza
51f8a15cad Enable multicast addresses on vlan ports. Fixes the reception of broadcast
packets on vlan aware mode.

Sponsored by:	Rubicon Communications (Netgate)
2016-03-21 03:16:56 +00:00
Adrian Chadd
672145ff55 Remove urtwn/urtwnfw; it's built as a module now. 2016-03-21 02:38:21 +00:00
Ed Maste
7fd08d3b59 i915: disable GEN6_MBCTL write in gen6_init_clock_gating
This write came from Linux commit b4ae3f22d238 which has been implicated
in Sandy Bridge power consumption issues (albeit under different
conditions on Linux). Disabling it restores normal power consumption on
my Sandy Bridge laptop (Thinkpad X220).

PR:		207889
Reviewed by:	cem, dumbbell
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D5665
2016-03-21 00:59:30 +00:00
Ian Lepore
dec4873723 Fix fallout from r292180 (Dec 2015)... ensure that every driver which has
a DRIVER_MODULE() referencing mmc_driver has a MODULE_DEPEND() on mmc.  This
is because the kernel linker only searches for symbols in dependent modules,
so loading sdhci_pci (and other bus-flavors of sdhci) would fail when mmc
was not compiled into the kernel (even if you hand-loaded mmc first).

(Thanks to jilles@ for providing the vital clue about the kernel linker.)
2016-03-21 00:52:24 +00:00
Navdeep Parhar
8d814a458c iw_cxgbe/libcxgb4: Pull in many applicable fixes from the upstream Linux
iWARP driver and userspace library to the FreeBSD iw_cxgbe and libcxgb4.

This commit includes internal changesets 6785 8111 8149 8478 8617 8648
8650 9110 9143 9440 9511 9894 10164 10261 10450 10980 10981 10982 11730
11792 12218 12220 12222 12223 12225 12226 12227 12228 12229 12654.

Submitted by:	Krishnamraju Eraparaju @ Chelsio
Sponsored by:	Chelsio Communications
2016-03-21 00:29:45 +00:00
Ian Lepore
b50d46df09 It appears nfs_mountroot() will use the env var "boot.netif.mtu" if it
exists, so mention that along with all the other boot.netif vars.
2016-03-20 21:48:26 +00:00
Dmitry Chagin
2ad0231309 Check bsd_to_linux_statfs() return value. Forgotten in r297070.
MFC after:	1 week
2016-03-20 19:06:21 +00:00
Dmitry Chagin
525c9796c3 Return EOVERFLOW in case when actual statfs values are large enough and
not fit into 32 bit fileds of a Linux struct statfs.

PR:		181012
MFC after:	1 week
2016-03-20 18:31:30 +00:00
Adrian Chadd
f6b5fa42e4 Now that urtwn is its own device, and it'll get hotplug loaded by
devd/ifconfig/etc, don't build it in the kernel.

This should fix the build as well!

Notice by: dchagin
2016-03-20 17:53:30 +00:00
Ian Lepore
fd8e1198f8 Remove FREEBSD_BOOT_LOADER that already exists in std.armv6 config file.
PR:		207728
Submitted by:	Jia-Shiun Li <jiashiun@gmail.com>
2016-03-20 16:48:29 +00:00
Justin Hibbits
d6f8b9168f Convert a long to rman_res_t, fixing a sign extension bug.
ahci.c had one signed long, which was passed into rman, rather than u_long.
After the switch of rman_res_t from size u_long to size uintmax_t, the sign
extension caused ranges to get messed up, and ahcich* to not attach.

There may be more signed longs used in this way, which will be fixed as they're
reported.

Reported by:	pho
2016-03-20 14:21:07 +00:00
Dmitry Chagin
7958a34cb5 Whitespaces, style(9) fixes. No functional changes.
MFC after:	1 week
2016-03-20 14:06:27 +00:00
Dmitry Chagin
351cf753eb Regen for r297061 (fstatfs64 Linux syscall).
MFC after:	1 week
2016-03-20 13:23:01 +00:00
Dmitry Chagin
99546279d6 Implement fstatfs64 system call.
PR:		181012
Submitted by:	John Wehle
MFC after:	1 week
2016-03-20 13:21:20 +00:00
Dmitry Chagin
4525bb829f Rework r296543:
1. Limit secs to INT32_MAX / 2 to avoid errors from kern_setitimer().
   Assert that kern_setitimer() returns 0.
   Remove bogus cast of secs.
   Fix style(9) issues.

2. Increment the return value if the remaining tv_usec value more than 500000 as a Linux does.

Pointed out by: [1] Bruce Evans

MFC after:	1 week
2016-03-20 11:40:52 +00:00
Adrian Chadd
0c91dc1d08 [urtwn] migrate urtwn out into sys/dev/urtwn/ .
There's some upcoming work to add new chipset support here and I'd
like to only add 802.11n support to one driver, instead of both
urtwn and rtwn.

There's also missing support for things like 802.11n, some powersave
work, bluetooth integration/coexistence, etc, and also newer parts
(like 8192EU, maybe some 11ac parts, not sure yet.)

So, this is hopefully the first step in a longer set of steps to unify
rtwn/urtwn and extend it with more interesting chipset and functionality
support.

Reviewed by:	kevlo
2016-03-20 03:54:57 +00:00
Alexander Motin
8576dc0092 Fix incorrect (fortunately bigger) malloc size.
Submitted by:	pfg
MFC after:	1 week
2016-03-19 11:48:06 +00:00
Alexander Motin
cb6b0ad147 Add IDs for Intel Wellsburg USB controllers.
MFC after:	1 week
2016-03-19 09:20:18 +00:00
Adrian Chadd
e4d96dcfad [net80211] Add VHT Transmit Power Envelope element - 802.11ac-2013 8.4.2.164
This .. seems inconsistently transmitted from various vendors.
2016-03-19 04:37:33 +00:00
Bjoern A. Zeeb
667060fe6c Allow pci_host_generic to be compiled into ARM kernels, used, e.g., in
simulators.

Sponsored by:	DARPA/AFRL
2016-03-18 23:55:25 +00:00
Luiz Otavio O Souza
9c2dedde34 Count the input and output packets.
Sponsored by:	Rubicon Communications (Netgate)
2016-03-18 20:24:31 +00:00
Luiz Otavio O Souza
7996fcdcc3 Increase the arbitrary limit of TX segments.
Sponsored by:	Rubicon Communications (Netgate)
2016-03-18 20:09:54 +00:00
Luiz Otavio O Souza
3419d34598 Set the destination port in all TX segments.
Sponsored by:	Rubicon Communications (Netgate)
2016-03-18 20:04:34 +00:00
John Baldwin
4a5202f9c4 Check IPI status more frequently when waiting.
An IPI cannot be sent via the local APIC if a previous IPI is still
being delivered.  Attempts to send an IPI will wait for a pending IPI
to clear.  Prior to r278325 these checks used a spin loop with a
hardcoded maximum count which broke AP startup on some systems.
However, r278325 also enforced a minimum latency of 5 microseconds if an
IPI was still pending which resulted in a measurable performance hit.
This change reduces that minimum latency to 1 microsecond.

Tested by:	stas
MFC after:	3 days
2016-03-18 19:48:49 +00:00
Bjoern A. Zeeb
9b0c982b47 Convert the printfs here from %lx to %jx as well after r297000 in order
to be able to compile this into arm kernels.

Sponsored by:	DARPA/AFRL
2016-03-18 19:36:43 +00:00
Pedro F. Giffuni
5166fdde7f aio_qphysio(): Avoid uninitialized pointer read on error.
For the !unmap case it may happen that pbuf gets called unreferenced
when vm_fault_quick_hold_pages() fails.
Initialize it so it doesn't cause trouble.

CID:		1352776
Reviewed by:	jhb
MFC after:	1 week
2016-03-18 19:04:01 +00:00
Andrew Turner
b011fce09f Move the opt_ files to be included first so their definitions can be used
from within all further included files.

Obtained from:	ABT Systems Ltd
Sponsored by:	The FreeBSD Foundation
2016-03-18 16:32:22 +00:00
Andrew Turner
a9056bbb93 Rename COUNT_IPI to INTR_IPI_COUNT to reduce the diff with intrng.
Obtained from:	ABT Systems Ltd
Sponsored by:	The FreeBSD Foundation
2016-03-18 16:29:58 +00:00
Andrew Turner
4d00d27b3a Reduce the diff with intrng by renaming similar functions. This is a noop,
but will help move to use the common interrupt handling code later.

Obtained from:	ABT Systems Ltd
Sponsored by:	The FreeBSD Foundation
2016-03-18 16:18:29 +00:00
Michal Meloun
b44a097edb TEGRA: Connect TEGRA124 to universe build. 2016-03-18 15:27:57 +00:00
Edward Tomasz Napierala
e204e2cd93 Add lock assertion.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-03-18 13:26:16 +00:00
Andrew Turner
7285efe8cd Remove the invalid L0_BLOCK definition. ARMv8 doesn't support block
translation in the level 0 descriptor.

Obtained from:	ABT Systems Ltd
Sponsored by:	The FreeBSD Foundation
2016-03-18 10:01:25 +00:00
Andrey V. Elsukov
6f814d0ec1 Fix handling of net.inet.ipsec.dfbit=2 variable.
IP_DF macro is in host bytes order, but ip_off field is in network bytes
order. So, use htons() for correct check.
2016-03-18 09:03:00 +00:00
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