Commit Graph

28216 Commits

Author SHA1 Message Date
Bryan Venteicher
46822c484c Create the tty device after the port is completely initialized
This fixes a race with a tty open before the host is the ready.

MFC after:	1 month
2014-11-03 22:17:25 +00:00
Bryan Venteicher
04434c94dd Add support for the multiport feature and fix hot plug races
MFC after:	1 month
2014-11-03 16:57:01 +00:00
Jean-Sébastien Pédron
c15af11534 drm: When reading connector mode tunables, list connectors
... and their associated tunables. This gives a way to know the list of
available connectors, no matter the driver.

The problem is that xrandr(1) can list connectors but it uses a
different naming.

MFC after:	1 week
2014-11-03 14:35:07 +00:00
Konstantin Belousov
a0cc5254d9 agp_intel.c provides support for AGP on Intel chipsets from 440/BX to
875.  This intersects with the agp_i810.c, which supports all Intels
from i810 to Core i5/7.  Both agp_intel.c and agp_i810.c are compiled
into kernel when device agp is specified in config, and agp_i810
attach seems to be selected by chance due to linking order.

Strip support for 810 and later from agp_intel.c.  Since 440-class
chipsets do not support any long-mode capable CPUs, remove agp_intel.c
from amd64 kernel file list.  Note that agp_intel.c is not compiled
into agp.ko on amd64 already.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2014-11-03 11:49:35 +00:00
Edward Tomasz Napierala
d2d52b0013 s/icl_pdu_new_bhs/icl_pdu_new/; no functional changes, just a little
nicer code.

Sponsored by:	The FreeBSD Foundation
2014-11-03 11:15:51 +00:00
Baptiste Daroussin
775fcb6e63 Remove check for obsolete FreeBSD versions
PR:		194517
Submitted by:	François Tigeot <ftigeot@wolfpond.org>
2014-11-03 11:11:45 +00:00
Edward Tomasz Napierala
08c5dbaeb0 s/icl_pdu_new/icl_pdu_new_empty/g; no functional changes.
Sponsored by:	The FreeBSD Foundation
2014-11-03 11:05:23 +00:00
Jean-Sébastien Pédron
4a60312011 drm: Take vt(4) default mode from loader tunables
By default, vt(4) gets the "preferred mode" from DRM, when using a DRM
video driver as its backend. The preferred mode is usually the native
screen resolution.

Now, if this mode isn't appropriate, a user can use loader tunables to
select a mode. The tunables are read in the following order:
    1. kern.vt.fb.modes.$connector_name
    2. kern.vt.fb.default_mode

For example, to set a 1024x768 mode, no matter the connector:
    kern.vt.fb.default_mode="1024x768"

To set a 800x600 mode only on the laptop builtin screen:
    kern.vt.fb.modes.LVDS-1="800x600"

MFC after:	1 week
2014-11-03 10:42:27 +00:00
Hans Petter Selasky
87273b37bb Reduce boot verbosity.
MFC:		3 days
2014-11-03 09:02:09 +00:00
Xin LI
1077321975 Don't assert random_adaptors_lock in random_adaptor_read_rate().
Reported by:	many
Pointy hat to:	delphij (for not testing the commit with WITNESS)
Approved by:	so
2014-11-03 04:41:29 +00:00
Xin LI
57cd52ca4c - Make sure random_adaptor accesses happen only when
random_adaptors_lock is held.
 - Use sx_sleep instead of tsleep in read and write path to allow
   another thread that registers a new random adapter when waiting.
   Assert that random_adaptor is not NULL after reacquiring the lock.
 - Capture EINTR/ERESTART from sx_sleep to allow the blocking cycle be
   stopped when user requests so, while there also make short
   read/write's return 0.
 - Move M_WAITOK allocations out of lock scope.

In collobration with:	kib, markm, ian, jilles
Reviewed by:	kib, markm
Approved by:	so
2014-11-02 23:30:50 +00:00
Jean-Sébastien Pédron
9fc2d29ead vt(4): Fix keyboard allocation when kbdmux(4) isn't used
The problem was that only the kbdmux keyboard index was saved in
vd->vd_keyboard. This index is -1 when kbdmux isn't used. In this
case, the keyboard was correctly allocated, but the returned index was
discarded.

PR:		194718
MFC after:	1 week
2014-11-02 16:04:48 +00:00
Tijl Coosemans
fa360767db Use default memory type for TTM buffer objects that may be cached.
MFC after:	1 week
2014-11-02 14:08:54 +00:00
Tijl Coosemans
0de6ac2e3c - agp_generic_unbind_memory: flush AGP TLB before unwiring pages
- agp_bind_pages: assert that pages have been wired down

MFC after:	1 month
2014-11-02 11:47:40 +00:00
Tijl Coosemans
a8ac51bbb6 In agp_amd_bind_page don't flush the AGP TLB. It's done by the calling
function.
2014-11-02 11:28:15 +00:00
Tijl Coosemans
4e612cddb9 In agp(4) avoid the need to flush all cpu caches with wbinvd between
updating the GTT and flushing the AGP TLB by storing the GTT in
write-combining memory.

On x86 flushing the AGP TLB is done by an I/O operation or a store to a
MMIO register in uncacheable memory.  Both cases imply that WC buffers are
flushed so no memory barriers are needed.

On powerpc there is no WC memory type.  It maps to uncacheable memory and
two stores to uncacheable memory, such as to the GTT and then to an MMIO
register, are strongly ordered, so no memory barriers are needed either.

MFC after:	1 month
2014-11-02 11:26:37 +00:00
Jean-Sébastien Pédron
6e2c3e8562 drm: Lower priority of two messages related to invalid EDID
Like in r259717, the prority goes from "error" to "debug" to avoid
spamming logs when the connectors are polled.

MFC after:	1 week
2014-11-02 09:52:22 +00:00
Dag-Erling Smørgrav
8c9ba8414c Restore the auto-reseed logic, but move it to a much later point,
immediately before kick_init.

Approved by:	so (self)
2014-11-02 02:01:55 +00:00
Mateusz Guzik
cdcf242896 Fix up module unload for syscall_module_handler consumers.
After r273707 it was registering syscalls as static.

This fixes hwpmc module unload.

Reported by: markj
2014-11-01 22:36:40 +00:00
Jean-Sébastien Pédron
da49f6bcc3 vt(4): Adjust the cursor position after changing the window size
A new terminal_set_cursor() is added: it wraps the existing
teken_set_cursor() function.

In vtbuf_grow(), the cursor position is adjusted at the end of the
function. In vt_change_font(), we call terminal_set_cursor() just after
terminal_set_winsize_blank(), while the terminal is mute.

This fixes a bug where, after loading a kernel video driver which
increases the terminal window size, the cursor remains at its old
position, in other words, in the middle of the display content.

PR:		194421
MFC after:	1 week
2014-11-01 17:05:15 +00:00
Luiz Otavio O Souza
409c183904 Fix the build of non-FDT systems by moving the gpiobusvar.h header outside
the FDT #ifdef.

While here remove a few unused headers.
2014-11-01 10:40:29 +00:00
Luiz Otavio O Souza
9d35acacd3 Fix the gpiobus locking by using a more sane model where it isn't necessary
hold the gpiobus lock between the gpio calls.

gpiobus_acquire_lock() now accepts a third parameter which tells gpiobus
what to do when the bus is already busy.

When GPIOBUS_WAIT wait is used, the calling thread will be put to sleep
until the bus became free.

With GPIOBUS_DONTWAIT the calling thread will receive EWOULDBLOCK right
away and then it can act upon.

This fixes the gpioiic(4) locking issues that arises when doing multiple
concurrent access on the bus.
2014-10-31 19:15:14 +00:00
Mark Murray
10cb24248a This is the much-discussed major upgrade to the random(4) device, known to you all as /dev/random.
This code has had an extensive rewrite and a good series of reviews, both by the author and other parties. This means a lot of code has been simplified. Pluggable structures for high-rate entropy generators are available, and it is most definitely not the case that /dev/random can be driven by only a hardware souce any more. This has been designed out of the device. Hardware sources are stirred into the CSPRNG (Yarrow, Fortuna) like any other entropy source. Pluggable modules may be written by third parties for additional sources.

The harvesting structures and consequently the locking have been simplified. Entropy harvesting is done in a more general way (the documentation for this will follow). There is some GREAT entropy to be had in the UMA allocator, but it is disabled for now as messing with that is likely to annoy many people.

The venerable (but effective) Yarrow algorithm, which is no longer supported by its authors now has an alternative, Fortuna. For now, Yarrow is retained as the default algorithm, but this may be changed using a kernel option. It is intended to make Fortuna the default algorithm for 11.0. Interested parties are encouraged to read ISBN 978-0-470-47424-2 "Cryptography Engineering" By Ferguson, Schneier and Kohno for Fortuna's gory details. Heck, read it anyway.

Many thanks to Arthur Mesh who did early grunt work, and who got caught in the crossfire rather more than he deserved to.

My thanks also to folks who helped me thresh this out on whiteboards and in the odd "Hallway track", or otherwise.

My Nomex pants are on. Let the feedback commence!

Reviewed by:	trasz,des(partial),imp(partial?),rwatson(partial?)
Approved by:	so(des)
2014-10-30 21:21:53 +00:00
Tijl Coosemans
cf99ea5d13 Avoid possible overflow in agp_generic_alloc_memory.
MFC after:	1 week
2014-10-30 14:36:27 +00:00
Tijl Coosemans
1f733a5646 Port the TTM AGP backend to the FreeBSD agp driver and enable AGP support
in the radeonkms driver.

Note: In PCI mode virtual addresses on the graphics card that map to system
RAM are translated to physical addresses by the graphics card itself.   In
AGP mode address translation is done by the AGP chipset so fictitious
addresses appear on the system bus.  For the CPU cache management to work
correctly when the CPU accesses this memory it needs to use the same
fictitious addresses (and let the chipset translate them) instead of using
the physical addresses directly.

Reviewed by:	kib
MFC after:	1 month
2014-10-30 14:26:36 +00:00
Tijl Coosemans
903fb143cf Add two new functions to the AGP driver KPI to bind/unbind arbitrary sets
of pages into the GTT.

Reviewed by:	kib
MFC after:	1 month
2014-10-30 11:27:03 +00:00
John-Mark Gurney
d14c434667 make this compile on arm... bus_size_t is not size_t, and it has
different sizes on different arches...
2014-10-29 02:23:50 +00:00
Navdeep Parhar
527e4e62ac Always request a completion for every work request for iWARP. The
initial MPA exchange must be tracked this way so that t4_tom's state for
the tid is all clean at the time the tid transitions to RDMA mode.  Once
it does, t4_tom is out of the way and iw_cxgbe uses the qp endpoints
directly.

Sponsored by:	Chelsio Communications
2014-10-28 18:10:57 +00:00
Hans Petter Selasky
0e1152fcc2 The SYSCTL data pointers can come from userspace and must not be
directly accessed. Although this will work on some platforms, it can
throw an exception if the pointer is invalid and then panic the kernel.

Add a missing SYSCTL_IN() of "SCTP_BASE_STATS" structure.

MFC after:	3 days
Sponsored by:	Mellanox Technologies
2014-10-28 12:00:39 +00:00
Marcelo Araujo
3bde81092c Drop __DECONST as well as few fixes of style(9).
Phabric:	D1012
Suggested by:	mjg, jhb
Reviewed by:	mjg, jhb
Sponsored by:	QNAP Systems Inc.
2014-10-28 03:42:09 +00:00
Navdeep Parhar
3030c8bce9 iwcm_event status needs to be populated for close_complete_upcall
Submitted by:	Hariprasad at Chelsio dot com
Sponsored by:	Chelsio Communications
2014-10-27 23:11:48 +00:00
Navdeep Parhar
d25d06afc0 Some cxgbe/iw_cxgbe fixes:
- Free rt in c4iw_connect only if it is allocated.
- Call soclose instead of so_shutdown if there is an abort from the peer.
- Close socket and return failure if TOE is not enabled.

Submitted by:	Hariprasad at Chelsio dot com
Sponsored by:	Chelsio Communications
2014-10-27 22:22:46 +00:00
Konstantin Belousov
9247911a58 Add a method to iicbus to request IIC_M_NOSTOP behaviour for multibyte
transfers to be default.  It simplifies porting code which assumes
such settings.

Discussed with:	avg, llos, nwhitehorn
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2014-10-27 07:51:26 +00:00
Konstantin Belousov
3f6732e8e0 Set the caching mode for the usermode mapping of the HPET registers
page to uncached.

Reviewed by:	rpaulo
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2014-10-25 21:01:50 +00:00
Navdeep Parhar
1284501329 cxgbe(4): bump up PF4's share of some global resources.
This increases the size of the per-port RSS slice and also allows the
driver to use a larger number of tx and rx queues.

MFC after:	2 weeks
2014-10-25 00:14:44 +00:00
Rui Paulo
f53389946d Add a sysctl to control the HPET allow_write behaviour.
Requested by:	kib
2014-10-24 21:08:36 +00:00
Rui Paulo
86b19a6984 HPET: avoid handling the multiple file-descriptor case.
It had two bugs: one where mmap was still allowed and another where
D_TRACKCLOSE doesn't handle all cases.

Thanks to jhb and kib for pointing them out.
MFC after:	1 week
2014-10-24 19:58:00 +00:00
Rui Paulo
3149cc9df6 HPET: create /dev/hpetN as a way to access HPET from userland.
In some cases, TSC is broken and special applications might benefit
from memory mapping HPET and reading the registers to count time.
Most often the main HPET counter is 32-bit only[1], so this only gives
the application a 300 second window based on the default HPET
interval.
Other applications, such as Intel's DPDK, expect /dev/hpet to be
present and use it to count time as well.

Although we have an almost userland version of gettimeofday() which
uses rdtsc in userland, it's not always possible to use it, depending
on how broken the multi-socket hardware is.

Install the acpi_hpet.h so that applications can use the HPET register
definitions.

[1] I haven't found a system where HPET's main counter uses more than
32 bit.  There seems to be a discrepancy in the Intel documentation
(claiming it's a 64-bit counter) and the actual implementation (a
32-bit counter in a 64-bit memory area).

MFC after:	1 week
Relnotes:	yes
2014-10-24 18:39:15 +00:00
Kevin Lo
66fef59616 Add D-Link DWA-123 rev D1 and Elecom WDC-150SU2M. 2014-10-24 15:36:30 +00:00
Xin LI
20e27addbf Return BUS_PROBE_DEFAULT instead of BUS_PROBE_VENDOR or 0 for in-tree
driver.  This change was verified by Microsoft.
2014-10-24 06:27:45 +00:00
Marcelo Araujo
f695e0468c Fix a leaked Storage Variable.
Phabric:	D981
Submitted by:	myself
Reported by:	Coverity
CID:		1248848
Reworked by:	kevlo
Reviewed by:	marcel, davide, ray, kevlo
Approved by:	marcel, kevlo
2014-10-24 05:39:32 +00:00
Luiz Otavio O Souza
88516632a7 Move the duplicated code to a single function.
No functional changes.
2014-10-23 23:20:04 +00:00
Luiz Otavio O Souza
b09d4398fa Provide a working GPIOBUS_IVAR() macro for FDT systems. 2014-10-23 23:12:30 +00:00
Rui Paulo
bdb4291f89 puc(4): add an entry for the Oxford Semiconductor OXPCIe952 1S1P card.
Submitted by:	Alex Burlyga <alex.burlyga.ietf at gmail.com>
MFC after:	1 week
2014-10-23 18:03:27 +00:00
Luiz Otavio O Souza
381fd7619b Fix a bug where some DTS layouts could cause the premature ending of the
search (i.e. without returning any result) and you would end up with a
random MAC address.

Change the search algorithm to a recursive one to ensure that all the nodes
on DTS will be verified.

The previous algorithm could not keep up if the DTS has too many sub-nodes.

While here, fix the punctuation on comments.
2014-10-23 13:47:19 +00:00
Jean-Sébastien Pédron
069f1c256a vt(4): Add PIO_VFONT_DEFAULT ioctl to restore the default builtin font
To restore the default font using vidcontrol(1), use the "-f" flag
without an argument:
    vidcontrol -f < /dev/ttyv0

PR:		193910
Differential Revision:	https://reviews.freebsd.org/D971
Submitted by:	Marcin Cieslak <saper@saper.info>
Reviewed by:	ray@, emaste@
Approved by:	ray@
MFC after:	1 week
2014-10-23 12:38:05 +00:00
Bryan Venteicher
6f744ddee4 Add VirtIO console driver
Support for the multiport feature is mostly implemented, but currently
disabled due to some potential races in the hot plug code paths.

Requested by:	marcel
MFC after:	1 month
Relnotes:	yes
2014-10-23 04:47:32 +00:00
Navdeep Parhar
53f49a7bd8 cxgbe/iw_cxgbe: wake up waiters after flushing the qp.
Obtained from:	Chelsio
2014-10-22 18:55:44 +00:00
Roger Pau Monné
ddcc16cf2f netback: change xnb naming convention
Current FreeBSD netback names the interface with xnb<device unit>, but
this is not suitable for usage with the Xen toolstack, which expects
something similar to <prefix><domid><handle>. In order to solve this,
change the netback naming convention to use xnb<domid>.<handle>.

Sponsored by: Citrix Systems R&D

dev/xen/netback/netback.c:
 - Change netback to use the nomenclature stated above.
2014-10-22 17:09:12 +00:00
Roger Pau Monné
bf7313e3b7 xen: implement the privcmd user-space device
This device is only attached to priviledged domains, and allows the
toolstack to interact with Xen. The two functions of the privcmd
interface is to allow the execution of hypercalls from user-space, and
the mapping of foreign domain memory.

Sponsored by: Citrix Systems R&D

i386/include/xen/hypercall.h:
amd64/include/xen/hypercall.h:
 - Introduce a function to make generic hypercalls into Xen.

xen/interface/xen.h:
xen/interface/memory.h:
 - Import the new hypercall XENMEM_add_to_physmap_range used by
   auto-translated guests to map memory from foreign domains.

dev/xen/privcmd/privcmd.c:
 - This device has the following functions:
   - Allow user-space applications to make hypercalls into Xen.
   - Allow user-space applications to map memory from foreign domains,
     this is accomplished using the newly introduced hypercall
     (XENMEM_add_to_physmap_range).

xen/privcmd.h:
 - Public ioctl interface for the privcmd device.

x86/xen/hvm.c:
 - Remove declaration of hypercall_page, now it's declared in
   hypercall.h.

conf/files:
 - Add the privcmd device to the build process.
2014-10-22 17:07:20 +00:00
Roger Pau Monné
5779d8ad57 xen: import a proper event channel user-space device
The user-space event channel device is used by applications to receive
and send event channel interrupts. This device is based on the Linux
evtchn device.

Sponsored by: Citrix Systems R&D

xen/evtchn/evtchn_dev.c:
 - Remove the old event channel device, which was already disabled in
   the build system.

dev/xen/evtchn/evtchn_dev.c:
 - Import a new event channel device based on the one present in
   Linux.
 - This device allows the following operations:
   - Bind VIRQ event channels (ioctl).
   - Bind regular event channels (ioctl).
   - Create and bind new event channels (ioctl).
   - Unbind event channels (ioctl).
   - Send notifications to event channels (ioctl).
   - Reset the device shared memory ring (ioctl).
   - Unmask event channels (write).
   - Receive event channel upcalls (read).
 - The new code is MP safe, and can be used concurrently.

conf/files:
 - Add the new device to the build system.
2014-10-22 16:57:11 +00:00
Ruslan Bukin
2d3f1b38a9 Provide a character device allowing us to access BERI memory regions.
Sponsored by:	DARPA, AFRL
2014-10-22 11:30:03 +00:00
Hans Petter Selasky
c61ee529ff Actually change the USB_PORT_ROOT_RESET_DELAY definition as stated in
the r241987 commit message, instead of having users locally overriding
the value using tunables in /boot/loader.conf .

Found by:	Adam Parco
Discussed with:	Nick Hibma
2014-10-22 07:50:19 +00:00
Kevin Lo
b1c5d8f7c3 Fix the kernel panic in hostap mode.
rvp->beacon_mbuf was NULL in run_update_beacon().

PR:	189405
Submitted by:	Gabor Simon <gabor.simon75 at gmail.com>
MFC after:	3 days
2014-10-22 03:32:27 +00:00
Glen Barber
c379cfaf3c Fix an issue where a FreeBSD virtual machine provisioned in
the Microsoft Azure service does not recognize the second
attached disk on the system.

Submitted by:	kyliel@Microsoft
Patched by:	weh@Microsoft
PR:		194376
MFC after:	3 days
X-MFC-10.1:	yes, ASAP
Sponsored by:	The FreeBSD Foundation
2014-10-21 19:36:20 +00:00
Jim Harris
83a4c3f99e ixl: remove i40e_register_x710_int.h
This file is not used by the FreeBSD ixl driver.

Submitted by:	Eric Joyner <eric.joyner@intel.com>
MFC after:	3 days
2014-10-21 18:00:56 +00:00
Ruslan Bukin
8b62915e24 Add driver for Micrel KSZ9021 Gigabit Ethernet Transceiver (PHY).
Sponsored by:	DARPA, AFRL
2014-10-21 09:14:16 +00:00
Hans Petter Selasky
f0188618f2 Fix multiple incorrect SYSCTL arguments in the kernel:
- Wrong integer type was specified.

- Wrong or missing "access" specifier. The "access" specifier
sometimes included the SYSCTL type, which it should not, except for
procedural SYSCTL nodes.

- Logical OR where binary OR was expected.

- Properly assert the "access" argument passed to all SYSCTL macros,
using the CTASSERT macro. This applies to both static- and dynamically
created SYSCTLs.

- Properly assert the the data type for both static and dynamic
SYSCTLs. In the case of static SYSCTLs we only assert that the data
pointed to by the SYSCTL data pointer has the correct size, hence
there is no easy way to assert types in the C language outside a
C-function.

- Rewrote some code which doesn't pass a constant "access" specifier
when creating dynamic SYSCTL nodes, which is now a requirement.

- Updated "EXAMPLES" section in SYSCTL manual page.

MFC after:	3 days
Sponsored by:	Mellanox Technologies
2014-10-21 07:31:21 +00:00
Kevin Lo
7eb884645c Add the Intel BayTrail USB device which needs port routing for USB 3.0.
Tested on the BayTrail E3845 platform.
Reviewed by:	hselasky
2014-10-21 07:24:58 +00:00
Pyun YongHyeon
b8333e4546 It seems multicast filtering of RTL8168F does not work. Workaround
the silicon bug by accepting any multicast packets.

PR:	193488
MFC After:	1 week
2014-10-21 01:31:24 +00:00
Jean-Sébastien Pédron
2113857ae0 vt(4): Refuse to load a font if hw.vga.textmode is selected
Before, the font was loaded and the window size recalculated, giving an
unusable terminal, even if the actual font didn't change.

Reported by:	beeessdee@ruggedinbox.com
MFC after:	3 days
2014-10-20 14:25:23 +00:00
Alexander Motin
7bac11c78c Add another PCI ID for JMB368 PATA controller.
MFC after:	1 week
2014-10-20 13:18:52 +00:00
Ian Lepore
2a74fe2c96 Fail to probe on simplebus nodes that lack a "ranges" property.
Increasingly, FDT data has the "simple-bus" compatible string on nodes
that have children, but we wouldn't consider them to be busses.  If the
node lacks a ranges property then we will fail to attach successfully,
so fail to probe as well.
2014-10-19 18:31:11 +00:00
Navdeep Parhar
bb1800f1fa cxgb(4): reset the PHY if it generates an interrupt for no apparent reason.
MFC after:	1 week
2014-10-19 17:29:44 +00:00
Ruslan Bukin
b0da449e60 Add driver for BERI soft processor 'ring buffer' device.
Ring device provides a way for communicate to BERI
peripherals such as BERI debug unit and console.

Sponsored by:	DARPA, AFRL
2014-10-19 16:26:49 +00:00
Hans Petter Selasky
e17bdf9f1b Add support for new USB 3G device.
Submitted by:	gabor@zahemszky.hu
MFC after:	1 week
2014-10-18 15:11:13 +00:00
Mark Johnston
06796b6791 Use pmc_destroy_pmc_descriptor() to actually free the pmc, which is
consistent with pmc_destroy_owner_descriptor(). Also be sure to destroy
PMCs if a process exits or execs without explicitly releasing them.

Reviewed by:	bz, gnn
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D958
2014-10-17 19:04:24 +00:00
Davide Italiano
d9ca757cea Convert remaining {g,s}etenv->kern_{g,s}etenv
left over from r273174.

Reported by:    bz
2014-10-17 17:34:05 +00:00
Ed Maste
0e53ac55b7 Do nothing in vt_upgrade if there is no vt driver
Previously, if no drivers attached at boot we would panic with
"vtbuf_fill_locked begin.tp_row 0 must be < screen height 0".

PR:		192248
Reviewed by:	ray
MFC after:	3 days
Sponsored by:	DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D954
2014-10-17 13:55:45 +00:00
Hans Petter Selasky
d60bfba9d6 Add support for new USB 3G device.
Submitted by:	gabor@zahemszky.hu
MFC after:	1 week
2014-10-17 13:40:17 +00:00
Joerg Wunsch
374e43f2e3 Add the Dresden Elektronik deRFnode device to uftdi(4).
MFC after:	1 week
2014-10-16 19:53:32 +00:00
Warner Losh
a5928b20d5 fwsectors and fwheads used to be somehwat arbitrary. However, they are
used to align partitions in gpart. We also try to align partitions by
stripe size when creating new media. Align these two concepts by
making fwsectors the same as the stripe size. Select a sensible number
of heads so we wind up with about 20 cylinders. This number was
selected to keep the rounding effects to a few percent while keeping
the number of cylinder groups low.

Sadly, it is not possible to make these numbers match the numbers used
by SD card readers. There apperas to be much variation between brands
so there's no one universal number. These numbers are also not aligned
to the stripe size, so some performance problems may still be present
when SD cards are created this way.

Also, these numbers will differ from the far less common SD to ATA
adapters, which present a different, but more uniform, set of numbers
that also happened to match the old defaults.

Nothing should change for current users. Any suboptimal performance
caused by misalignment will still be there. gpart will honor the
partitions that aren't on proper boudnaries, but editing the partition
tables may result in different alignments being used than before when
editing things natively.

Ideally, there'd be some way to override these values in the disk
subsystem by the user for the USB adapter use case where all "native"
notions of geometry disappear. This does not implement that.
2014-10-16 19:52:12 +00:00
Davide Italiano
2be111bf7d Follow up to r225617. In order to maximize the re-usability of kernel code
in userland rename in-kernel getenv()/setenv() to kern_setenv()/kern_getenv().
This fixes a namespace collision with libc symbols.

Submitted by:   kmacy
Tested by:      make universe
2014-10-16 18:04:43 +00:00
Edward Tomasz Napierala
6cc1e267f3 When removing an iSCSI session, check whether all conditions match,
not if any of them matches.  This fixes "iscsictl -Rn" removing
unrelated sessions.

PR:		194034
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2014-10-16 09:09:43 +00:00
Justin Hibbits
e9152038d3 Move the adm1030 driver to the proper location, and rename it.
For compatibility, 'device windtunnel' is still supported, but one should use
'device adm1030' instead, and this has been updated in GENERIC and NOTES.
2014-10-16 01:32:22 +00:00
Hans Petter Selasky
2c6eb461a7 Update the OFED Linux compatibility layer and
Mellanox hardware driver(s):

- Properly name an inclusion guard
- Fix compile warnings regarding unsigned enums
- Add two new sysctl nodes
- Remove all empty linux header files
- Make an error printout more verbose
- Use "mod_delayed_work()" instead of
  cancelling and starting a timeout.
- Implement more Linux scatterlist
  functions.

MFC after:	3 days
Sponsored by:	Mellanox Technologies
2014-10-15 13:40:29 +00:00
Adrian Chadd
bba61d1a89 Set the DROP_EN bit before the RX queue is brought up and active.
He noticed issues setting this bit in SRRCTL after the queue was up,
so doing it from the sysctl handler isn't enough and may not actually
work correctly.

This commit doesn't remove the sysctl path or try to change its
behaviour.  I'll talk with others about how to finish fixing that
before I tackle that.

PR:		kern/194311
Submitted by:	luigi
MFC after:	3 days
Sponsored by:	Norse Corp, Inc
2014-10-15 01:22:56 +00:00
Warner Losh
756906b40e Use the C99 flexible array construct to denote a variable amount of
data rather than the old-school [1] construct. We have required c99
compilers for some time.
2014-10-13 16:23:58 +00:00
Warner Losh
5df0ffc762 class, subclass and progif were never used, so don't bother setting
them.
2014-10-13 16:23:51 +00:00
Kashyap D Desai
f5fb223710 Fix for build issue on i386.xen and amd64.xen.
This is a duplicate variable reference in mrsas, so now this patch isolate atomic_ variable and relavent
function call using prefix mrsas_xx.

Issue was introduced in r272737.

MFC after:	2 weeks
Sponsored by:	Avago Technology
2014-10-13 15:33:27 +00:00
Christian Brueffer
9bfafa1055 Add one more AMD Kaveri APU device ID.
Submitted by:	Remy Nonnenmacher <remy.nonnenmacher@activnetworks.com>
MFC after:	1 week
2014-10-13 13:13:42 +00:00
Robert Watson
6ad1954bcb Eliminate unnecessary checking for M_EXT on mbufs returned by m_getjcl().
Reviewed by:	bz, glebius, yongari
MFC after:	3 days
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D938
2014-10-13 06:51:40 +00:00
Navdeep Parhar
3f52cae506 Make sure correct object code is generated at -O0.
Submitted by:	grehan@
Approved by:	so@ (des)
MFC after:	1 month
2014-10-13 06:50:08 +00:00
Pyun YongHyeon
416f6852e3 Remove ALC_LOCK_ASSERT in alc_stop_queue(). This function is now
called in device attach without holding a driver lock so it
resulted in panic.

Reported by:	markj
2014-10-13 01:06:40 +00:00
Justin Hibbits
6ab4d70393 Check error return from reading integer part of temperature.
There's a very remote, but possible, chance that the integer part read will
fail, but the fraction read succeeds, at which point the reported temperature is
invalid.

Reported by: Matthew Rezny
MFC after:	3 weeks
2014-10-12 23:48:55 +00:00
Ian Lepore
0dc54d18b2 Use the FIFOs in the imx5/imx6 uart hardware instead of interrupting on
each byte sent or received.
2014-10-12 17:56:02 +00:00
John Baldwin
d0d8c133c7 Add locking and mark MPSAFE.
- Add a mutex to protect the softc.
- Use callout(9) instead of timeout(9).
- Consolidate duplicated detach routines into a bus-independent detach
  routine.
- Add an extra sleep lock flag (MSESC_READING) to prevent other readers
  from reading while the first reader is copying data out of sc_bytes[]
  via uiomove().
- Use bus_*() instead of bus_space_*().

Tested by:	nyan
2014-10-11 19:36:59 +00:00
Alexander Motin
bb829be508 Fix r272936 build with old GCC.
MFC after:	1 week
2014-10-11 08:50:19 +00:00
Alexander Motin
829485ba7e Update isp_tgt_map and send new arrival notification if target that departed
earlier has returned.  Previously that code worked only once, confusing CTL.

MFC after:	1 month
2014-10-11 07:59:15 +00:00
John Baldwin
97dc3d98cb Don't pass RF_ALLOCATED to bus_alloc_resource(). 2014-10-10 19:12:04 +00:00
John Baldwin
8423f42aa8 Various fixes to stats:
- Read the counts of received, dropped, and transmitted management
  packets and add sysctl nodes for them.
- Fix the total octets received/transmitted to read all 64 bits of
  the counters.
- Add missing sysctl nodes for rlec, tncrs, fcruc, tor, and tot.
- Remove spurious spaces.

Reviewed by:	Eric Joyner @ Intel
MFC after:	1 week
2014-10-10 16:36:25 +00:00
Baptiste Daroussin
277c7d7b98 Use FreeBSD-bit-checking-style
This appease gcc 4.9 issuing warnings about parentheses

Differential Revision:	https://reviews.freebsd.org/D933
Reviewed by:	marius
2014-10-10 14:17:42 +00:00
Hans Petter Selasky
77d68af5df Add sysctl knob to disable port power on a specific USB HUB. You need
to reset the USB HUB using "usbconfig -d X.Y reset" or boot having the
setting in /boot/loader.conf before it activates.
2014-10-09 14:43:43 +00:00
Alexander Motin
259f12da87 Make iSCSI connection close somewhat less aggressive.
It allows to push out some final data from the send queue to the socket
before its close.  In particular, it increases chances for logout response
to be delivered to the initiator.
2014-10-09 09:12:08 +00:00
Hans Petter Selasky
f80ccb40c7 Refine support for disabling USB enumeration to allow device detach
and suspend and resume of existing devices.

MFC after:	2 weeks
2014-10-09 06:24:06 +00:00
Adrian Chadd
ffcf962dab Add a bus method to fetch the VM domain for the given device/bus.
* Add a bus_if.m method - get_domain() - returning the VM domain or
  ENOENT if the device isn't in a VM domain;
* Add bus methods to print out the domain of the device if appropriate;
* Add code in srat.c to save the PXM -> VM domain mapping that's done and
  expose a function to translate VM domain -> PXM;
* Add ACPI and ACPI PCI methods to check if the bus has a _PXM attribute
  and if so map it to the VM domain;
* (.. yes, this works recursively.)
* Have the pci bus glue print out the device VM domain if present.

Note: this is just the plumbing to start enumerating information -
it doesn't at all modify behaviour.

Differential Revision:	D906
Reviewed by:	jhb
Sponsored by:	Norse Corp
2014-10-09 05:33:25 +00:00
Alexander Motin
3b4ae4621f Remove one second wait for threads exit from icl_conn_close().
Switch it from polling with pause() to using cv_wait()/cv_signal().
2014-10-08 19:54:42 +00:00
Gavin Atkinson
c5dcd62615 It looks like an entry for the R215 is not required in cdce(4) after all. 2014-10-08 19:49:10 +00:00
Konstantin Belousov
07a92f34d6 Add an argument to the x86 pmap_invalidate_cache_range() to request
forced invalidation of the cache range regardless of the presence of
self-snoop feature.  Some recent Intel GPUs in some modes are not
coherent, and dirty lines in CPU cache must be flushed before the
pages are transferred to GPU domain.

Reviewed by:	alc (previous version)
Tested by:	pho (amd64)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2014-10-08 16:48:03 +00:00
Alexander Motin
82315915e0 Properly report 12Gbps connection rate.
Reviewed by:	kadesai, slm
MFC after:	1 week
2014-10-08 16:22:26 +00:00