Commit Graph

203533 Commits

Author SHA1 Message Date
Hans Petter Selasky
98d3afa551 Add new USB quirk.
MFC after:	1 week
PR:		202783
2015-08-31 07:18:13 +00:00
Xin LI
32e49abef0 - uri is expected to be nul-terminated (strchr used later),
so use strlcpy instead of strncpy.
 - unroll the other two cases of strncpy+\0 to strlcpy.

MFC after:	2 weeks
2015-08-31 06:11:39 +00:00
Xin LI
670f01434e Constify opt_f and opt_t and eliminate unneeded copying. This fixes
memory leaks.

Reported by:	clang static analyzer
MFC after:	2 weeks
2015-08-31 05:57:26 +00:00
Alexander V. Chernikov
3b0fd911fa Simplify lla_rt_output()/nd6_add_ifa_lle() by setting lle state in
alloc handler, based on flags.
2015-08-31 05:03:36 +00:00
Marcel Moolenaar
7aefa262d6 Add support for the UGA draw protocol. This includes adding a
command called 'uga' to show whether UGA is implemented by the
firmware and what the settings are. It also includes filling
the efi_fb structure from the UGA information when GOP isn't
implemented by the firmware.

Since UGA does not provide information about the stride, we
set the stride to the horizontal resolution. This is likely
not correct and we should determine the stride by trial and
error. For now, this should show something on the console
rather than nothing.

Refactor this file to maximize code reuse.

PR:		202730
2015-08-30 23:58:53 +00:00
Luiz Otavio O Souza
765701d193 Add the LED definitions from vendor's DTS.
Add gpioled support to A20 kernel.

While here rename the gpio phandle to match the one used in the vendor's
DTS.
2015-08-30 23:20:00 +00:00
Luiz Otavio O Souza
fbb065700c The vendor's DTS for Allwinner A20 uses a different way to map the gpio
pins, they specify the bank and the pin in two separated cells.

This allow the use of vendor's DTS definitions by adding a gpio map
routine that copes with that.
2015-08-30 22:38:06 +00:00
Adrian Chadd
883fafaf87 oops - mis-commit. 2015-08-30 21:55:01 +00:00
Adrian Chadd
267e3cf98d Convert this over to use the new cdev based ioctl path. 2015-08-30 21:54:47 +00:00
Adrian Chadd
4823a7500b Migrate the stats API for iwn(4) into a cdev ioctl, rather than tying
into the vap.

This allows for possible hardware interaction without needing a vap
configured.
2015-08-30 21:54:33 +00:00
George V. Neville-Neil
61b38905ce A bibliography of FreeBSD and BSD related papers and books.
Keep this file in order by primary key which is the first author's
last name and the year of publication.
2015-08-30 20:59:19 +00:00
Konstantin Belousov
8d830e02f5 Use P1B_PRIO_MAX to designate max posix priority for the RR/FIFO
scheduler types.  It was intended to be used there, compare with the
min value, and with the test for correctness in ksched_setscheduler().

Note that P1B_PRIO_MAX and RTP_PRIO_MAX do have the same numerical
values, the change is cosmetical.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2015-08-30 18:02:57 +00:00
Konstantin Belousov
44e629f18d Remove single-use macros obfuscating malloc(9) and free(9) calls.
Style.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2015-08-30 17:58:11 +00:00
Jilles Tjoelker
f0688a48d2 sh: Fix read with escaped IFS characters at the end.
Characters escaped with a backslash must be treated as if they were not in
IFS. This includes stripping trailing IFS characters.
2015-08-30 17:24:22 +00:00
Luiz Otavio O Souza
a7fc139721 Reduce the difference to vendor DTS by using the vendor compat strings (at
some point we have to use the complete vendor DTS files, but we're not
there yet).
2015-08-30 16:10:12 +00:00
Luiz Otavio O Souza
30f0be8ce0 In preparation to support other A20 based boards, rename the CUBIEBOARD2
kernel configuration to A20.

There are other boards (namely the banana pi) that use exactly the same
devices.

Additionally, we are moving from static FDT support (DTB compiled
in-kernel) to DTB passed to kernel by the boot loader (ubldr).  The u-boot
for these boards are already available on ports and as the crochet support
for these boards isn't committed yet, this should not bring any issues.

Discussed with:		ian
2015-08-30 15:38:41 +00:00
Julien Charbon
2ea3089cb1 Revert r286880: If at first this change made sense, it turns out
it helps only the TCP timers callout(9) usage.  As the benefit for
others callout(9) usages did not reach a consensus the historical
usage should prevail.

Differential Revision:      https://reviews.freebsd.org/D3078
2015-08-30 13:44:46 +00:00
Julien Charbon
d6de19ac2f Put r284245 back in place: If at first this fix was seen as a temporary
workaround for a callout(9) issue, it turns out it is instead the right
way to use callout in mpsafe mode without using callout_drain().

r284245 commit message:

Fix a callout race condition introduced in TCP timers callouts with r281599.
In TCP timer context, it is not enough to check callout_stop() return value
to decide if a callout is still running or not, previous callout_reset()
return values have also to be checked.

Differential Revision:	https://reviews.freebsd.org/D2763
2015-08-30 13:44:39 +00:00
Xin LI
42404113e6 Remove support for FreeBSD < 602110. 2015-08-30 08:48:31 +00:00
Adrian Chadd
9b11ed5f9d Fix compilation error on gcc-5.2.0 - it now warns on non-paranthen'ed
logical negation when used in this fashion.

Tested:

* compile only
2015-08-30 08:46:50 +00:00
Xin LI
34a8cde09d Don't assign 'ptr' without using it.
Reported by:	clang static analyzer
MFC after:	2 weeks
2015-08-30 08:38:59 +00:00
Konstantin Belousov
3ea917837d Fix a mistake in r287292. Despite correctly stating intent in the
comment above, POSIX_SPAWN_SETSIGMASK and POSIX_SPAWN_SETSIGDEF
handlers used libthr interposed functions instead of syscalls.

Noted by:	jilles
Sponsored by:	The FreeBSD Foundation
MFC after:	6 days
2015-08-30 04:46:44 +00:00
Marcel Moolenaar
d81907ecbf Add a gop command to help diagnose VT efifb problems. The gop
command has the following sub-commands:
  list		- list all possible modes (paged)
  get		- return the current mode
  set <mode>	- set the current mode to <mode>
2015-08-30 01:39:59 +00:00
Craig Rodrigues
60caf0c9c2 - Replace N(a)/N(i)/N(T)/LEN(a)/ARRAY_SIZE(a) with nitems()
- Add missing <err.h> for err() and <sys/sysctl.h> for sysctlbyname()
- NULL -> 0 for 5th parameter of sysctlbyname()

Submitted by: Andriy Voskoboinyk <s3erios@gmail com>
Differential Revision: https://reviews.freebsd.org/D3442
2015-08-29 19:47:20 +00:00
Jilles Tjoelker
62c3711632 sh: Add set -o nolog.
POSIX requires this to prevent entering function definitions in history but
this implementation does nothing except retain the option's value. In ksh88,
function definitions were usually entered in the history file, even when
they came from ~/.profile and the $ENV file, to allow displaying their
definitions.

This is also the first option that does not have a letter.
2015-08-29 19:41:47 +00:00
Gavin Atkinson
c6cc7ec120 Support the ZTE MF112 HSUPA 3G USB stick.
MFC after:	1 week
2015-08-29 18:37:09 +00:00
Michael Tuexen
2e2d67945a Use 5 times RTO.Max as the default for the shutdown guard timer
as required by RFC 4960. The sysctl variable can be used to
overwrite this.

Discussed with:	rrs
MFC after:	1 week
2015-08-29 17:26:29 +00:00
Alexander Motin
7278725be5 Remove 600 bytes of port_priv from struct ctl_io_hdr.
This field used only for camtgt frontend, and once it any way preallocates
all requests, let it preallocate this memory too, not bothering core code.
2015-08-29 15:33:31 +00:00
Konstantin Belousov
bd6060a1c6 Switch libc from using _sig{procmask,action,suspend} symbols, which
are aliases for the syscall stubs and are plt-interposed, to the
libc-private aliases of internally interposed sigprocmask() etc.

Since e.g. _sigaction is not interposed by libthr, calling signal()
removes thr_sighandler() from the handler slot etc.  The result was
breaking signal semantic and rtld locking.

The added __libc_sigprocmask and other symbols are hidden, they are
not exported and cannot be called through PLT.  The setjmp/longjmp
functions for x86 were changed to use direct calls, and since
PIC_PROLOGUE only needed for functional PLT indirection on i386, it is
removed as well.

The PowerPC bug of calling the syscall directly in the setjmp/longjmp
implementation is kept as is.

Reported by:	Pete French <petefrench@ingresso.co.uk>
Tested by:	Michiel Boland <boland37@xs4all.nl>
Reviewed by:	jilles (previous version)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2015-08-29 14:25:01 +00:00
Alexander Motin
9202485814 Attach pass driver to LUNs is OFFLINE state.
Previously such LUNs were silently ignored.  But while they indeed unable
to process most of SCSI commands, some, like RTPG, they still can.

MFC after:	1 month
2015-08-29 11:21:20 +00:00
Michael Tuexen
0835304fea Use the userland exported states and handle them completely. 2015-08-29 09:27:29 +00:00
Xin LI
9053fe148b Fix a buffer overrun which may lead to data corruption, introduced in
r286951 by reinstating changes in r274628.

In l2arc_compress_buf(), we allocate a buffer to stash away the compressed
data in 'cdata', allocated of l2hdr->b_asize bytes.

We then ask zio_compress_data() to compress the buffer, b_l1hdr.b_tmp_cdata,
which is of l2hdr->b_asize bytes, and have the compressed size (or original
size, if compress didn't gain enough) stored in csize.

To pad the buffer to fit the optimal write size, we round up the compressed
size to L2 device's vdev_ashift.

Illumos code rounds up the size by at most SPA_MINBLOCKSIZE.  Because we
know csize <= b_asize, and b_asize is integer multiple of SPA_MINBLOCKSIZE,
we are guaranteed that the rounded up csize would be <= b_asize. However,
this is not necessarily true when we round up to 1 << vdev_ashift, because
it could be larger than SPA_MINBLOCKSIZE.

So, in the worst case scenario, we are overwriting at most

	(1 << vdev_ashift - SPA_MINBLOCKSIZE)

bytes of memory next to the compressed data buffer.

Andriy's original change in r274628 reorganized the code a little bit,
by moving the padding to after we determined that the compression was
beneficial.  At which point, we would check rounded size against the
allocated buffer size, and the buffer overrun would not be possible.
2015-08-29 09:22:32 +00:00
Michael Tuexen
e92c2a8d6a Fix the exporting of SCTP association states to userland. Without this,
associations in SHUTDOWN-PENDING were never reported correctly.

MFC after:	3 weeks
2015-08-29 09:14:32 +00:00
Michael Tuexen
c1eb13c74c Report CLOSED as state for bound sockets for consistency with
netstat and the way TCP is handled.

PR:		201585
MFC after:	3 weeks
2015-08-29 09:10:52 +00:00
Xin LI
253d699d3c In r286705 (Illumos 5960/a2cdcdd), a separate thread is created with curproc
as parent.  In the case of a send or receive, the curproc would be the
userland application that issues the ioctl.  This would trigger an assertion
failure introduced in Solaris compatibility shims in r196458 when kernel is
compiled with INVARIANTS.

Fix this by using p0 (proc0 or kernel) as the parent thread when creating
the kernel threads.
2015-08-29 08:16:57 +00:00
Gleb Smirnoff
8ed6922046 Add reminder to run etcupdate or mergemaster to get updated
rc.d scripts for wireless.

Poked by:	adrian
2015-08-29 07:59:31 +00:00
Adrian Chadd
0be189151f Implement RSS hashing/re-hashing for IPv6 ingress packets.
This mirrors the basic IPv4 implementation - IPv6 packets under RSS
now are checked for a correct RSS hash and if one isn't provided,
it's done in software.

This only handles the initial receive - it doesn't yet handle
reinjecting / rehashing packets after being decapsulated from
various tunneling setups.  That'll come in some follow-up work.

For non-RSS users, this is almost a giant no-op.

It does change a couple of ipv6 methods to use const mbuf * instead of
mbuf * but it doesn't have any functional changes.

So, the following now occurs:

* If the NIC doesn't do any RSS hashing, it's all done in software.
  Single-queue, non-RSS NICs will now have the RX path distributed
  into multiple receive netisr queues.

* If the NIC provides the wrong hash (eg only IPv6 hash when we needed
  an IPv6 TCP hash, or IPv6 UDP hash when we expected IPv6 hash)
  then the hash is recalculated.

* .. if the hash is recalculated, it'll end up being injected into
  the correct netisr queue for v6 processing.

Submitted by:	Tiwei Bie <btw@mail.ustc.edu.cn>
Differential Revision:	https://reviews.freebsd.org/D3504
2015-08-29 07:14:29 +00:00
Adrian Chadd
2527ccad2d Rename rss_soft_m2cpuid() -> rss_soft_m2cpuid_v4() in preparation for
an IPv6 version to show up.

Submitted by:	Tiwei Bie <btw@mail.ustc.edu.cn>
Differential Revision:	https://reviews.freebsd.org/D3504
2015-08-29 06:58:30 +00:00
Justin Hibbits
12d44566ae The TLB1 TSIZE is a multiple of 4, not 2, so shift 2 bits, not 1. 2015-08-29 06:52:14 +00:00
Adrian Chadd
8f1111cf0b Remove now unused (and #if 0'ed out) headers. 2015-08-29 04:33:31 +00:00
Baptiste Daroussin
21bba0ead0 Mark ValleyView/Bay Trail as not supported 2015-08-29 00:05:39 +00:00
Warner Losh
de830d432c Remove now obsolete comment.
MFC After: 2 days
2015-08-28 20:06:58 +00:00
Warner Losh
3f27281613 Per overwhelming sentiment in the code review, use FEATURE instead.
Differential Revision: https://reviews.freebsd.org/D3488
MFC After: 2 days
2015-08-28 19:53:19 +00:00
Warner Losh
fd449cdf1e Comment out cleaning files, since it cleans too much. 2015-08-28 16:29:38 +00:00
Warner Losh
4a64d1a23d Remove .WAIT hacks and put in specific dependencies. 2015-08-28 16:23:03 +00:00
Warner Losh
5e4fb9caca Add missing ofw_machdep.h. Make x86 ofw_machdep.h work pc98 too.
This allows the owc module to compile on pc98 and seems preferable to
adding another special case in the build system.
2015-08-28 15:41:09 +00:00
Pedro F. Giffuni
fa60bc2f86 Add underscores to attributes when checking for __has_attribute.
This is a good practice to avoid confusion with allowed macros.

Suggested by:	jilles
2015-08-28 15:36:05 +00:00
Andrew Turner
755eb18fd7 Move dwmmc.h to dwmmc_reg.h. This is in preperation for adding support to
subclass the dwmmc driver to allow SoC specific attachments.

Sponsored by:	ABT Systems Ltd
2015-08-28 15:27:55 +00:00
Warner Losh
93d5e88d46 Add back missing -m32 for amd64 and powerpc64 that was lost
in the move to bsd.stand.mk.
2015-08-28 14:50:36 +00:00
Edward Tomasz Napierala
1d4c0424c8 Fix an NFS server bug that manifested in "ls -al" displaying a plus
sign on every directory exported via NFSv4 with NFSv4 ACLs enabled.

Reviewed by:	rmacklem@
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D3502
2015-08-28 14:26:11 +00:00