Commit Graph

110876 Commits

Author SHA1 Message Date
Sepherosa Ziehau
ae39ebd8df hyperv: Move Hypercall setup to an early place.
It does not belong to the vmbus.

While I'm here rework the Hypercall setup, e.g. use busdma(9)
and avoid bit fields.

Discussed with:	Jun Su <junsu microsoft com>
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6445
2016-05-23 07:06:53 +00:00
Sepherosa Ziehau
a46b3df617 hyperv/hn: Use hyperv busdma(9) helper.
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6444
2016-05-23 06:52:42 +00:00
Sepherosa Ziehau
7e118515ca hyperv: Add helpers for busdma(9) operation
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6443
2016-05-23 06:35:11 +00:00
Adrian Chadd
ec607da0e5 [siba] update device ids.
Tested:

* BCM4322 11abgn, STA mode
2016-05-23 05:52:47 +00:00
Sepherosa Ziehau
b9f1312664 hyperv: Move guest id setup to early place
And
- Rework the guest id composition.
- Nuke useless saved guest_id.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6430
2016-05-23 05:11:38 +00:00
Adrian Chadd
0d1a968876 [bwn] convert another PHY-N workaround to the freebsd bwn format.
These were hidden behind an #ifdef that we weren't setting.

I don't have the hardware in question to check.
2016-05-23 04:17:27 +00:00
Adrian Chadd
2e79170e4f [nvram2env] fix nvram2env to scan all of memory, not 1/4th
The variable "size" stores number of words (4bytes). But the loop over
memory uses size as number of bytes to scan memory. As result it fetches
only 1/4th of memory.

This patch solves this problem and nvram2env fetches all NVRAM variables.

Test plan:

Pre-requisites: any MIPS board with ASCII-based NVRAM mapped into memory

* Add "device nvram2env" into kernel configuration
* Specify hints: base is mandatory (according to nvram2env(4))

hint.nvram.0.base=0x1c7f8000 (it's valid address for Asus RT-N53 with
flags = 0x4)

* Build & load kernel with bootverbose

Actual result: only part of nvram variables are found
Expected result: all variables are found

Submitted by:	Michael Zhilin <mizhka@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D6466
2016-05-23 03:51:15 +00:00
Adrian Chadd
9d292ea16d [bhnd] Add support for querying the attachment type of the bhnd bus.
This adds a BHND_BUS_GET_ATTACH_TYPE(); the primary use-case is to let
chipc make a coarse-grained determination as to whether UART, SPI, etc
drivers ought to be attached, and on fullmac devices, whether a real
CPU driver ought to be skipped for the ARM core, etc.

Tested:

* BCM4331 (BHND)
* BCM4312 (SIBA)

Submitted by:	Landon Fuller <landonf@landonf.org>
Differential Revision:	https://reviews.freebsd.org/D6492
2016-05-23 03:47:44 +00:00
Adrian Chadd
aa87465313 [ixl] fix build for RSS.
Untested.
2016-05-23 03:46:36 +00:00
Adrian Chadd
6dcd2b484d [bhnd] Fix DEFINE_CLASS_(2|3) multiple inheritance support.
This diff updates DEFINE_CLASS_2/_3 to support the specification of class
name separately from the class variable name, bringing them into sync
with their API documentation, as well as the behavior of DEFINE_CLASS_0/_1.

Nothing in the tree currently uses the _2/_3 variants, and I can't
find any references to the API outside of commits to the kobj.h
header itself; given the limitation that currently exists, I'd
be surprised if they've ever been used.

Submitted by:	Landon Fuller <landonf@landonf.org>
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D6491
2016-05-23 03:29:43 +00:00
Konstantin Belousov
4c36e917b2 Mark swap-related proc sysctls as not requiring Giant.
Reviewed by:	alc (as part of larger patch)
Sponsored by:	The FreeBSD Foundation
2016-05-22 23:28:23 +00:00
Konstantin Belousov
04533e1ef7 Replace hand-made exclusive lock, protecting against parallel
swapon/swapoff invocations, with sx.

Reviewed by:	alc (as part of larger patch)
Sponsored by:	The FreeBSD Foundation
2016-05-22 23:25:01 +00:00
Andriy Voskoboinyk
90ea1c8c7b urtwn: cleanup some unused code in urtwn_tx_data().
- Drop unused 'subtype' variable.
- Remove obsolete comment (hardware crypto support was added in r292175).
2016-05-22 20:12:07 +00:00
Andriy Voskoboinyk
db585a35a8 urtwn: setup per-frame retry limit.
Override global retry limit (which is set in R92C_RL) via per-frame
TX descriptor field. Obsoletes D3840 (should work better with 2+ vaps).

Tested with RTL8188EU and RTL8192CUS in STA mode (maxretry = [3-9]).
2016-05-22 19:43:40 +00:00
Konstantin Belousov
a525fd17cd Remove false claim. Giant is dropped by mi_startup() before passing
the control to swapper.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2016-05-22 19:25:53 +00:00
Dmitry Chagin
df964aa45d Convert proto family in both directions. The linux and native values for
local and inet are identical, but for inet6 values differ.

PR:		155040
Reported by:	Simon Walton
MFC after:	2 week
2016-05-22 19:08:29 +00:00
Dmitry Chagin
2664baadf3 Remove a now unused global declaration of some sysentvec struct.
MFC after:	2 week
2016-05-22 19:04:34 +00:00
Konstantin Belousov
df5905fe7d Remove drop/reacquire of Giant around geom calls for cd9660 and udf.
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2016-05-22 18:16:25 +00:00
Andrey A. Chernov
23b26e530d Improve panic message by specifying on which cpu it really is. 2016-05-22 15:22:45 +00:00
Kevin Lo
57d2ac2f90 arc4random() returns 0 to (2**32)−1, use an alternative to initialize
i_gen if it's zero rather than a divide by 2.

With inputs from  delphij, mckusick, rmacklem

Reviewed by:	mckusick
2016-05-22 14:31:20 +00:00
Pedro F. Giffuni
91460148b2 ndis(4): Undo unneeded workarounds in ndis' rand().
- Revert the change for seed(0) in r300384. I misunderstood the standard
and while our random() implementation in libkern may be improved, it
handles the seed(0) case fine.

Pointed out by:	bde, ache
2016-05-22 14:13:20 +00:00
Luiz Otavio O Souza
9d6672e13b Fix the deciKelvin to Celsius conversion in kernel.
After r285994, sysctl(8) was fixed to use 273.15 instead of 273.20 as 0C
reference and as result, the temperature read in sysctl(8) now exibits a
+0.1C difference.

This commit fix the kernel references to match the reference value used in
sysctl(8) after r285994.

Sponsored by:	Rubicon Communications (Netgate)
2016-05-22 13:58:32 +00:00
Baptiste Daroussin
306e53bce9 Fix typo introduced by me (not the submitter) when fixing typos 2016-05-22 13:10:48 +00:00
Baptiste Daroussin
2fd642c899 Fix typos in the comments
Submitted by:	cipherwraith666@gmail.com (via github)
2016-05-22 13:04:45 +00:00
Dmitry Chagin
d56e689e7d Add a missing errno translation for SO_ERROR optname.
PR:		135458
Reported by:	Stefan Schmidt @ stadtbuch.de
MFC after:	1 week
2016-05-22 12:49:08 +00:00
Dmitry Chagin
5437e1d103 Add macro to convert errno and use it when appropriate.
MFC after:	1 week
2016-05-22 12:46:34 +00:00
Dmitry Chagin
f8d72f5312 For future use move futex timeout code to the separate function and
switch to the high resolution sbintime_t.

MFC after:	1 week
2016-05-22 12:37:40 +00:00
Dmitry Chagin
a03566dd95 Due to lack the priority propagation feature replace sx by mutex. WIth this
commit NPTL tests are ends in 1 minute faster.

MFC after:	1 week
2016-05-22 12:35:50 +00:00
Dmitry Chagin
ea53658ed7 Add my copyright as I rewrote most of the futex code. Minor style(9) cleanup
while here.

MFC after:	1 week
2016-05-22 12:28:55 +00:00
Dmitry Chagin
56c4f83d2e Minor style(9) cleanup, no functional changes.
MFC after:	1 week
2016-05-22 12:26:03 +00:00
Svatopluk Kraus
babd771795 INTRNG - implement pic_post_filter method. This method is fundamental
one and must always be implemented for a PIC. There is no default for
it intentionally.
2016-05-22 11:42:34 +00:00
Svatopluk Kraus
143d397317 Fix some format strings to make them either correct or uniform.
No functional change.
2016-05-22 09:59:43 +00:00
Luiz Otavio O Souza
ad802dc4e3 Remove a couple of extra blank lines. 2016-05-22 04:09:05 +00:00
Luiz Otavio O Souza
0397efe813 Sort and remove a couple of unnecessary headers. 2016-05-22 04:02:34 +00:00
Luiz Otavio O Souza
03302aa37f Get rid of two consumers of gpiobus acquire/release.
The GPIO hardware should not be owned by a single device, this defeats any
chance of use of the GPIO controller as an interrupt source.

ow(4) is now the only consumer of this 'feature' before we can remove it
for good.

Discussed with:	ian, bsdimp
2016-05-22 03:55:57 +00:00
Luiz Otavio O Souza
16119eeded Use a better prefix for defines, return BUS_PROBE_DEFAULT for probe routine.
Refuse to attach if the number of given pins is not enough for our needs.
2016-05-22 03:34:18 +00:00
Luiz Otavio O Souza
fc5f218ade Fix probe routine to return BUS_PROBE_DEFAULT instead of BUS_PROBE_SPECIFIC.
While here fix a few style(9) issues.
2016-05-22 03:12:49 +00:00
Pedro F. Giffuni
b9c52b50a7 ndis(4): adjustments for our random() specific implementation.
- Revert r300377: The implementation claims to return a value
  within the range. [1]
- Adjust the value for the case of a zero seed, whihc according
  to standards should be equivalent to a seed of value 1.

Pointed out by:	cem
2016-05-22 00:29:25 +00:00
Andriy Voskoboinyk
cd7d06ac7e net80211: send RTM_IEEE80211_SCAN event when scan was cancelled.
wpa_supplicant(8) expects to see 'scan complete' event after every
scan command; in case, when event is not sent it will hang for
indefinite time.

PR:		209198
2016-05-21 23:21:42 +00:00
Alan Cox
6753423ccb When descending a shadow chain of objects, it makes no sense to update
the current offset (spelled: "fs.pindex") until it is known whether a
backing object exists.  In fact, if not for the fact that the backing
object offset is zero when there is no backing object, this update would
produce a broken offset.

Reviewed by:	kib
2016-05-21 23:18:23 +00:00
Pedro F. Giffuni
c515200599 ndis(4): Avoid overflow.
This is a long standing problem: our random() function returns an
unsigned integer but the rand provided by ndis(4) returns an int.
Scale it down.

MFC after:	2 weeks
2016-05-21 17:52:44 +00:00
Pedro F. Giffuni
0e6d3c6d16 ndis(4): Better mimic the behavior of rand() on Windows.
In ndis(4) we expose a rand() function that was constantly reseeding
with a time depending function every time it was called. This
essentially broke the reasoning behind seeding, and rendered srand()
a no-op.

Keep it simple, just use random() and srandom() as it's meant to work.
It  would have been tempting to just go for arc4random() but we
want to mimic Microsoft, and we don't need crypto-grade randomness
here.

PR:		209616
MFC after:	2 weeks
2016-05-21 17:38:43 +00:00
Ian Lepore
da6da1575b Adjust _ALIGNBYTES to the proper value for arm and armv6 arches. Modern
compilers can emit arm instructions that require 8-byte alignment.  The
alignment-sensitive instructions were added in armv5, which has to be
supported by our combined v4/v5 kernels, so the value is set uncoditionally
for all arm architecture versions.

Also adjust the comment to explain in more detail why the macros have the
form and values they do.

Per advice from bde@, maintain the unsignedness of the value of _ALIGNBYTES
(but do so using his second choice of allowing sizeof() to supply the
unsignedness, rather than just hardcoding '8U', which in my mind would
require an even more verbose comment to explain why it's right).  Also
explain in the comment that the resulting type of _ALIGN() is equivelent
to uinptr_t on arm (32-bit unsigned int), but it's purposely spelled as
"unsigned" to avoid problems with including other header files.  Even
including machine/_types.h to allow use of __uintptr_t causes compilation
failures because of this header being included (indirectly) in asm code.

The discussion that led to this change (albeit at a glacial pace) is at
https://lists.freebsd.org/pipermail/svn-src-head/2014-November/064593.html
2016-05-21 16:52:38 +00:00
Andriy Gapon
7107bed0f0 fix loss of taskqueue wakeups (introduced in r300113)
Submitted by:	kmacy
Tested by:	dchagin
2016-05-21 14:51:49 +00:00
Konstantin Belousov
bb8297e6d4 Same as for UFS, remove drop/reacquire of Giant, and use si_mountpt as
the mount semaphore.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2016-05-21 11:40:41 +00:00
Edward Tomasz Napierala
a3fd63f223 Properly reset session state when using proxy and fail_on_disconnection=1.
Without it the reconnection would fail due to mismatched sequence numbers.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-05-21 11:26:03 +00:00
Edward Tomasz Napierala
7deb68ab2c Provide a way for ICL modules to declare they support PIM_UNMAPPED.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-05-21 11:10:48 +00:00
Edward Tomasz Napierala
b218ca6fdd Pass maxtags value to the ICL module. iSER needs it.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-05-21 10:59:36 +00:00
Konstantin Belousov
5f36cc5bfa Stop dropping and reacquiring Giant around geom calls in UFS.
Sponsored by:	The FreeBSD Foundation
2016-05-21 10:13:25 +00:00
Konstantin Belousov
ae40237874 Remove zero assignments in the cdev allocator. cdp memory is
requested with M_ZERO.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2016-05-21 09:55:32 +00:00