Commit Graph

198491 Commits

Author SHA1 Message Date
Adrian Chadd
771df80a72 Fix the LED configuration so the switch PHY LEDs work fine.
Tested:

* TP-Link TL-WDR3600; yes, by testing all five ethernet ports.

Obtained from:	Linux OpenWRT
2015-03-21 06:44:41 +00:00
Adrian Chadd
5daec26c5c Migrate these configs to use the geom map search function.
Now that the search function reliably works, this allows for
smaller images.
2015-03-21 06:18:25 +00:00
Adrian Chadd
d9b9920b70 Add support for the TP-Link TL-WDR4300 and TL-WDR3600.
These are actually almost the same units; except one is 3x3 5GHz, and
one is 2x2 5GHz.

Tested:

* TP-Link TL-WDR3600

TODO:

* The ath0/ath1 MAC addresses are ye garbage (00:02:03:04:05:06); fixing
  that will take a little more time.  It works fine with the ath0/ath1
  MAC addresses set manually.

* Go through and yank the AR9344 on-board switch config (arswitch1);
  it's not required here for this AP.
2015-03-21 06:16:23 +00:00
Adrian Chadd
0137d8b46e Re-enable the modules for now; I'm using them in some other test builds. 2015-03-21 06:13:30 +00:00
Adrian Chadd
9182d53e8c Now that the switch PHY fully works, don't limit arge0 to only being up
if the WAN port is up.

This way I can use it for arbitrary ports/vlans.
2015-03-21 06:12:46 +00:00
Adrian Chadd
753370121e Add GPIO function mux configuration for AR934x SoCs.
The AR934x (and maybe others in this family) have a more complicated
GPIO mux.  The AR71xx just has a single function register for a handful
of "GPIO or X" options, however the AR934x allows for one of roughly
100 behaviours for each GPIO pin.

So, this adds a quick hints based mechanism to configure the output
functions, which is required for some of the more interesting board
configurations.  Specifically, some use external LNAs to improve
RX, and without the MUX/output configured right, the 2GHz RX side
will be plain terrible.

It doesn't yet configure the "input" side yet; I'll add that if
it's required.

Tested:

* TP-Link TL-WDR3600, testing 2GHz STA/AP modes, checking some
  basic RX sensitivity things (ie, "can I see the AP on the other
  side of the apartment that intentionally has poor signal reception
  from where I am right now.")

Whilst here, fix a silly bug in the maxpin routine; I was missing
a break.
2015-03-21 06:08:35 +00:00
Adrian Chadd
358811c4e3 add QCA955x PCIe configuration registers.
These are /not/ absolute addresses, as the QCA955x SoC has 2 PCIe RC's
(and 1 PCIe EP.)
2015-03-21 06:00:46 +00:00
Adrian Chadd
3d58374a29 Note that the AR724x PCIe registers are actually from the PCI_CTRL
register range.
2015-03-21 05:59:45 +00:00
Mateusz Guzik
5bc0ff888a coredump: protect corefilename access with a lock
Previously format string traversal could happen while the string itself was
being modified.

Use allproc_lock as coredumping is a rare operation and as such we don't
have to create a dedicated lock.

Submitted by:	Tiwei Bie <btw mail.ustc.edu.cn>
Reviewed by:	kib
X-Additional:	JuniorJobs project
2015-03-21 04:39:33 +00:00
Devin Teske
febd9e9c94 Update copyright(s)
MFC after:	3 days
X-MFC-to:	stable/10
2015-03-21 03:54:11 +00:00
Devin Teske
33112d9e9f Whitespace cleanup(s).
MFC after:	3 days
X-MFC-to:	stable/10
2015-03-21 03:52:43 +00:00
Xin LI
4f9343fc7c Disable timestamping on devfs read/write operations by default.
Currently we update timestamps unconditionally when doing read or
write operations.  This may slow things down on hardware where
reading timestamps is expensive (e.g. HPET, because of the default
vfs.timestamp_precision setting is nanosecond now) with limited
benefit.

A new sysctl variable, vfs.devfs.dotimes is added, which can be
set to non-zero value when the old behavior is desirable.

Differential Revision:	https://reviews.freebsd.org/D2104
Reported by:	Mike Tancsa <mike sentex net>
Reviewed by:	kib
Relnotes:	yes
Sponsored by:	iXsystems, Inc.
MFC after:	2 weeks
2015-03-21 01:14:11 +00:00
Pedro F. Giffuni
2fa7a2afac bsdgrep: fix regression in the -f option since r268799
Caused by an incomplete merge from NetBSD.

PR:		198725
MFC after:	3 days
2015-03-21 00:21:30 +00:00
Jung-uk Kim
3fde12b6f8 Disable insecure SSLv2 support from the base OpenSSL.
Differential Revision:	https://reviews.freebsd.org/D1304
2015-03-20 23:48:11 +00:00
Gleb Smirnoff
b1828acf05 Make vlan_config() the signle point of validity checks.
Sponsored by:	Nginx, Inc.
2015-03-20 21:09:03 +00:00
Gleb Smirnoff
f941c31aae In vlan_clone_match_ethervid():
- Use ifunit() instead of going through the interface list ourselves.
- Remove unused parameter.
- Move the most important comment above the function.

Sponsored by:	Nginx, Inc.
2015-03-20 20:42:58 +00:00
Allan Jude
1ea7a21e36 Fix grammar in epair(4) man page
PR:		196839
Differential Revision:	https://reviews.freebsd.org/D2090
Submitted by:	Jason Unovitch (original)
Approved by:	wblock (mentor)
Sponsored by:	ScaleEngine Inc.
2015-03-20 20:08:36 +00:00
Luiz Otavio O Souza
d7eb38c008 Add a driver for the Dallas/Maxim DS1307, another common i2c RTC.
Many thanks to ian who gently provided me the DS1307 breakout board.

Tested on:		Raspberry pi
Differential Revision:	https://reviews.freebsd.org/D2022
Reviewed by:		rpaulo
2015-03-20 19:51:24 +00:00
Colin Percival
25c1155771 When creating VM images, copy the contents of the created filesystem into
a new filesystem before packaging it into a disk image.  This prevents
"remnants" of deleted files from showing up in the VM images, and reduces
their compressed size (by about 10% for the cloudware images) as a result.

Looks good to:	gjb
2015-03-20 19:40:19 +00:00
Luiz Otavio O Souza
4e8058e313 Add the missing manual page link to the recently added function. 2015-03-20 19:29:59 +00:00
Jung-uk Kim
6f9291cea8 Merge OpenSSL 1.0.1m. 2015-03-20 19:16:18 +00:00
Andrew Turner
27eb3304cd Add a helper function to read clock frequencies from videocore and use this
to get the default frequency of the sdhci device.

While here use a u_int to hold the frequency as it may be too large to fit
in a 32-bit signed integer. This is the case when we have a 250MHz clock.
2015-03-20 16:54:21 +00:00
Alexander Motin
8187174a9b Add missing variable initialization.
Reported by:	Coverity
CID:		1288938
MFC after:	3 days
2015-03-20 16:05:13 +00:00
Jung-uk Kim
3d2030852d Import OpenSSL 1.0.1m. 2015-03-20 15:28:40 +00:00
Alexander Motin
0e2a18e657 Add comment explaining existing powerd behavior on SMP systems.
MFC after:	1 week
2015-03-20 15:07:05 +00:00
Andrew Turner
e5e85011ae Split out the common bcm283x fixes from the bcm2835 specific files. 2015-03-20 14:25:51 +00:00
Andrew Turner
df0968e45e Remove now unneeded headers from the Broadcom DWC driver 2015-03-20 14:23:40 +00:00
Andrew Turner
b812d0ad85 Move the code to set the device power to the bcm2835 mailbox driver so it
can be reused by other drivers.
2015-03-20 14:16:39 +00:00
Gleb Smirnoff
67975c79be Tiny comment fix. 2015-03-20 14:16:26 +00:00
Gleb Smirnoff
a58ea6b1cf Now, when r272244 introduced counter(9) based counters for all interfaces,
revert the r271538, which did that for vlan(4) only.

No objections:	melifaro
Sponsored by:	Nginx, Inc.
2015-03-20 14:05:17 +00:00
John Baldwin
589b2c1c1e Expand the bitcount* API to support 64-bit integers, plain ints and longs
and create a "hidden" API that can be used in other system headers without
adding namespace pollution.
- If the POPCNT instruction is enabled at compile time, use
  __builtin_popcount*() to implement __bitcount*(), otherwise fall back
  to software implementations.
- Use the existing bitcount16() and bitcount32() from <sys/systm.h> to
  implement the non-POPCNT __bitcount16() and __bitcount32() in
  <sys/types.h>.
- For the non-POPCNT __bitcount64(), use a similar SWAR method on 64-bit
  systems.  For 32-bit systems, use two __bitcount32() operations on the
  two halves.
- Use __bitcount32() to provide a __bitcount() that operates on plain ints.
- Use either __bitcount32() or __bitcount64() to provide a
  __bitcountl() that operates on longs.
- Add public bitcount*() wrappers for __bitcount*() for use in the kernel
  in <sys/libkern.h>.
- Use __builtinl() instead of __builtin_popcountl() in BIT_COUNT().

Discussed with:	bde
2015-03-20 10:27:06 +00:00
Zbigniew Bodek
37143b98d4 Allow to override default kernel virtual address assignment on ARM
Each plaform performs virtual memory split between kernel and user space
and assigns kernel certain amount of memory space. However, is is sometimes
reasonable to change the default values. Such situation may happen on
systems where the demand for kernel buffers is high, many devices occupying
memory etc. This of course comes with the cost of decreasing user space
memory range so shall be used with care. Most embedded systems will not
suffer from this limtation but rather take advantage of this potential
since default behavior is left unchanged.

Submitted by:  Wojciech Macek <wma@semihalf.com>
Reviewed by:   imp
Obtained from: Semihalf
2015-03-20 10:15:34 +00:00
Pedro F. Giffuni
f608a55f18 Permit multiple arguments for the nonnull attribute.
This is very useful for non-trivial functions and doesn't
affect existing uses.

MFC after:	5 days
2015-03-20 01:07:48 +00:00
Hans Petter Selasky
ec0e626baf Define BINDIR for some test utilities.
MFC after:	3 days
Sponsored by:	Mellanox Technologies
2015-03-19 15:55:02 +00:00
Hans Petter Selasky
bcc1697214 Fix some style issues.
MFC after:	1 week
2015-03-19 15:36:36 +00:00
Hans Petter Selasky
7de4fe34aa Add more known bugs to the USB audio manual page.
MFC after:	1 week
2015-03-19 15:32:55 +00:00
Konstantin Belousov
0a110d5b17 Use VT-d interrupt remapping block (IR) to perform FSB messages
translation.  In particular, despite IO-APICs only take 8bit apic id,
IR translation structures accept 32bit APIC Id, which allows x2APIC
mode to function properly.  Extend msi_cpu of struct msi_intrsrc and
io_cpu of ioapic_intsrc to full int from one byte.

KPI of IR is isolated into the x86/iommu/iommu_intrmap.h, to avoid
bringing all dmar headers into interrupt code. The non-PCI(e) devices
which generate message interrupts on FSB require special handling. The
HPET FSB interrupts are remapped, while DMAR interrupts are not.

For each msi and ioapic interrupt source, the iommu cookie is added,
which is in fact index of the IRE (interrupt remap entry) in the IR
table. Cookie is made at the source allocation time, and then used at
the map time to fill both IRE and device registers. The MSI
address/data registers and IO-APIC redirection registers are
programmed with the special values which are recognized by IR and used
to restore the IRE index, to find proper delivery mode and target.
Map all MSI interrupts in the block when msi_map() is called.

Since an interrupt source setup and dismantle code are done in the
non-sleepable context, flushing interrupt entries cache in the IR
hardware, which is done async and ideally waits for the interrupt,
requires busy-wait for queue to drain.  The dmar_qi_wait_for_seq() is
modified to take a boolean argument requesting busy-wait for the
written sequence number instead of waiting for interrupt.

Some interrupts are configured before IR is initialized, e.g. ACPI
SCI.  Add intr_reprogram() function to reprogram all already
configured interrupts, and call it immediately before an IR unit is
enabled.  There is still a small window after the IO-APIC redirection
entry is reprogrammed with cookie but before the unit is enabled, but
to fix this properly, IR must be started much earlier.

Add workarounds for 5500 and X58 northbridges, some revisions of which
have severe flaws in handling IR.  Use the same identification methods
as employed by Linux.

Review:	https://reviews.freebsd.org/D1892
Reviewed by:	neel
Discussed with:	jhb
Tested by:	glebius, pho (previous versions)
Sponsored by:	The FreeBSD Foundation
MFC after:	3 weeks
2015-03-19 13:57:47 +00:00
Andrew Turner
8daa81674e Start to import support for the AArch64 architecture from ARM. This change
only adds support for kernel-toolchain, however it is expected further
changes to add kernel and userland support will be committed as they are
reviewed.

As our copy of binutils is too old the devel/aarch64-binutils port needs
to be installed to pull in a linker.

To build either TARGET needs to be set to arm64, or TARGET_ARCH set to
aarch64. The latter is set so uname -p will return aarch64 as existing
third party software expects this.

Differential Revision:	https://reviews.freebsd.org/D2005
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
2015-03-19 13:53:47 +00:00
Konstantin Belousov
dcc33b0a8a Provide definitions for all descriptors types in the DMAR invalidation
queue.  They are for first-level translations and device TLB.

Review:	https://reviews.freebsd.org/D1892
Reviewed by:	neel
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2015-03-19 13:05:55 +00:00
Konstantin Belousov
0f5830b045 Fix syntax error.
Review:	https://reviews.freebsd.org/D1892
Found by:	neel
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2015-03-19 13:03:58 +00:00
Andrew Turner
6c85c62d00 Fix building ixgbe with gcc, it doesn't like nested extern declarations.
The fix is to move the extern declaration ix_crcstrip out of
ixgbe_setup_hw_rsc.
2015-03-19 13:00:02 +00:00
Alexander Motin
e7affda584 Add camcontrol subcommands to control APM and AAM levels.
MFC after:	1 week
Sponsored by:	iXsystems, Inc.
2015-03-19 12:22:57 +00:00
Andrew Turner
2fb34dae14 Use the dsb macro to use the correct instruction when building for ARMv7. 2015-03-19 11:34:51 +00:00
Adrian Chadd
28d507fcec Fix the label search routine in geom_map to not trip up on '\0' bytes.
* Just do the buf check early and fail out
* If the offset being searched is:

00110000  00 b5 7e 45 61 e2 76 d3  c1 78 dd 15 95 cd 1f f1  |..~Ea.v..x......|

.. and the match string is '.!/bin/sh'

.. then it'll set the match string[0] to '\0', do a strncmp() against
the read buffer, find it's matching two zero-length strings, and think
that's where to start.

MFC after:	2 weeks
2015-03-19 03:58:25 +00:00
Alan Cox
dfdf9abd94 Fix the root cause of the "vm_reserv_populate: reserv <address> is already
promoted" panics.  The sequence of events that leads to a panic is rather
long and circuitous.  First, suppose that process P has a promoted
superpage S within vm object O that it can write to.  Then, suppose that P
forks, which leads to S being write protected.  Now, before P's child
exits, suppose that P writes to another virtual page within O.  Since the
pages within O are copy on write, a shadow object for O is created to
house the new physical copy of the faulted on virtual page.  Then, before
P can fault on S, P's child exists.  Now, when P faults on S, it will
follow the "optimized" path for copy-on-write faults in vm_fault(),
wherein the underlying physical page is moved from O to its shadow object
rather than allocating a new page and copying the new page's contents from
the old page.  Moreover, suppose that every 4 KB physical page making up S
is moved to the shadow object in this way.  However, the optimized path
does not move the underlying superpage reservation, which is the root
cause of the panics!  Ultimately, P performs vm_object_collapse() on O's
shadow object, which destroys O and in doing so breaks any reservations
still belonging to O.  This leaves the reservation underlying S in an
inconsistent state: It's simultaneously not in use and promoted.  Breaking
a reservation does not demote it because I never intended for a promoted
reservation to be broken.  It makes little sense.  Finally, this
inconsistency leads to an assertion failure the next time that the
reservation is used.

The failing assertion does not (currently) exist in FreeBSD 10.x or
earlier.  There, we will quietly break the promoted reservation.  While
illogical and unintended, breaking the reservation is essentially
harmless.

PR:		198163
Reviewed by:	kib
Tested by:	pho
X-MFC after:	r267213
Sponsored by:	EMC / Isilon Storage Division
2015-03-19 01:40:43 +00:00
Hiren Panchasara
d0a8b2a5ae Add connection flow type to siftr(4).
Suggested by:	adrian
Sponsored by:	Limelight Networks
2015-03-19 00:23:16 +00:00
Andrey V. Elsukov
ff9f2a36de To avoid a possible race, release the reference to ifa after return
from nd6_dad_na_input().

Submitted by:	Alexandre Martins
MFC after:	1 week
2015-03-19 00:04:25 +00:00
Allan Jude
efd6e672e4 Remove a non-required unsafe condition added in the previous commit
Reviewed by:	bapt
Approved by:	dteske
Sponsored by:	ScaleEngine Inc.
2015-03-18 23:47:30 +00:00
Allan Jude
d421870917 Fix the handbook install option in bsdinstall
bsdconfig's f_package_add doesn't seem to support using the pkg repo from /etc/pkg/FreeBSD.conf, it also tries to run the commands on the installer image, not in the destination chroot

Instead, manually bootstrap pkg in the chroot, and then install the requested packages (in the chroot)

Doesn't use pkg -c, because pkg is not installed on the installer image

PR:		196250
Differential Revision:	https://reviews.freebsd.org/D2026
Approved by:	bapt
Sponsored by:	ScaleEngine Inc.
2015-03-18 23:24:38 +00:00
Hiren Panchasara
a025fd1487 Add connection flowid to siftr(4).
Reviewed by:	lstewart
MFC after:	1 week
Sponsored by:	Limelight Networks
Differential Revision:	https://reviews.freebsd.org/D2089
2015-03-18 23:24:25 +00:00