Commit Graph

29045 Commits

Author SHA1 Message Date
Hans Petter Selasky
a998d1031c Put recycle pointer in own memory area which is not mmap'able. 2015-05-10 12:45:21 +00:00
Luiz Otavio O Souza
1b53f6c5a3 Remove unnecessary code and make use of generic implementations for
bus_alloc_resource(), bus_release_resource() and bus_set_resource()
(bus_generic_rl_alloc_resource(), bus_generic_rl_release_resource() and
bus_generic_rl_set_resource() respectively).

Do not print the resources for nomatch devices.

Use the inherited method for bus_get_resource_list() on ofw_iicbus.c.

Submitted by:	jhb and Michal Meloun (D2033)
2015-05-10 02:19:27 +00:00
Konstantin Belousov
b57a73f8e7 If x86 CPU implementation of the MWAIT instruction reasonably
interacts with interrupts, query ACPI and use MWAIT for entrance into
Cx sleep states.  Support C1 "I/O then halt" mode.  See Intel'
document 302223-007 "Intelб╝ Processor Vendor-Specific ACPI Interface
Specification" for description.

Move the acpi_cpu_c1() function into x86/cpu_machdep.c and use
it instead of inlining "sti; hlt" sequence in several places.

In the acpi(4) man page, besides documenting the dev.cpu.N.cx_methods
sysctl, correct the names for dev.cpu.N.{cx_usage,cx_lowest,cx_supported}
sysctls.

Both jkim and avg have some other patches implementing the mwait
functionality; this work is unrelated.  Linux does not rely on the
ACPI to provide correct tables describing Cx modes.  Instead, the
driver has pre-defined knowledge of the CPU models, it was supplied by
Intel.

Tested by:    pho (previous versions)
Sponsored by:	The FreeBSD Foundation
2015-05-09 12:28:48 +00:00
Bjoern A. Zeeb
62699f3424 Convert remaining hwpmc(4) debug printfs over to KTR to unbreak the build
for at least powerpc kernels.   Missed in r282658.

MFC after:	10 days
2015-05-09 09:21:59 +00:00
Luiz Otavio O Souza
3bb6bf473f Handle IRQ resources on iicbus and ofw_iicbus.
Based on a patch submitted by Michal Meloun <meloun@miracle.cz>.
2015-05-09 03:05:44 +00:00
Luiz Otavio O Souza
5791e134f7 Replace spaces with tabs, removes an extra blank line.
No functional changes.
2015-05-08 21:51:37 +00:00
John Baldwin
4a3690dfa1 Convert hwpmc(4) debug printfs over to KTR.
Differential Revision:	https://reviews.freebsd.org/D2487
Reviewed by:	davide, emaste
MFC after:	2 weeks
Sponsored by:	Norse Corp, Inc.
2015-05-08 19:40:00 +00:00
Hans Petter Selasky
8c20de927a Ensure the USB audio driver doesn't attach twice on the same USB
device by grabbing all the USB audio device interfaces.

MFC after:	1 week
2015-05-08 17:48:48 +00:00
Hans Petter Selasky
9dd1273385 Add support for more than 8 audio channels per PCM stream for USB
audio class compliant devices under FreeBSD. Tested using 16 recording
and 16 playback audio channels simultaneously.

MFC after:	2 weeks
2015-05-08 17:07:11 +00:00
Hans Petter Selasky
4ece1a889b Extend the maximum number of allowed PCM channels in a PCM stream to
127 and decrease the maximum number of sub-channels to 1. These
definitions are only used inside the kernel and can be changed later
if more than one sub-channel is desired. This has been done to allow
so-called USB audio rack modules to work with FreeBSD.

Bump the FreeBSD version to force recompiling all external modules.

MFC after:	2 weeks
Reviewed by:	mav
2015-05-08 17:00:33 +00:00
Hans Petter Selasky
e4a5ee711a The "SYSCTL_INT()" default value is only used for read only SYSCTLs
and is not applicable unless the integer pointer is NULL. Set it to
zero to avoid confusion. While at it remove extra semicolon at the end
of the "VT_SYSCTL_INT()" macro.

MFC after:		1 week
2015-05-08 16:37:40 +00:00
Hans Petter Selasky
4ee69cc712 Prevent switching to NULL or own window in the "vt_proc_window_switch"
function. This fixes an issue where X11 keyboard input can appear
stuck. The cause of the problem is a duplicate TTY device window
switch IOCTL during boot, which leaves the "vt_switch_timer" running,
because the current window is already selected. While at it factor out
some NULL checks.

PR:			200032
Differential Revision:	https://reviews.freebsd.org/D2480
Reported by:		several people
MFC after:		1 week
Reviewed by:		emaste
2015-05-08 16:19:01 +00:00
John Baldwin
680f1afd94 Move hwpmc(4) debugging code under a new HWPMC_DEBUG option instead of
the broader DEBUG option.

Reviewed by:	emaste
MFC after:	2 weeks
Sponsored by:	Norse Corp, Inc.
2015-05-08 15:57:23 +00:00
Roger Pau Monné
0df8b29da3 xen: introduce a newbus function to allocate unused memory
In order to map memory from other domains when running on Xen FreeBSD uses
unused physical memory regions. Until now this memory has been allocated
using bus_alloc_resource, but this is not completely safe as we can end up
using unreclaimed MMIO or ACPI regions.

Fix this by introducing a new newbus method that can be used by Xen drivers
to request for unused memory regions. On amd64 we make sure this memory
comes from regions above 4GB in order to prevent clashes with MMIO/ACPI
regions. On i386 there's nothing we can do, so just fall back to the
previous mechanism.

Sponsored by: Citrix Systems R&D
Tested by: Gustau Pérez <gperez@entel.upc.edu>
2015-05-08 14:48:40 +00:00
Kevin Lo
997d8c7a89 - Fix a wrong R92C_USTIME_TSF register definition
- Fix intitial transmit rate to an 11g rate for the RTL8188EU
- Add a comment about response rate settings
2015-05-08 09:01:00 +00:00
Hans Petter Selasky
415bcd89a6 Add support for DYMO LabelWriter PnP.
MFC after:		2 weeks
2015-05-07 12:54:27 +00:00
Andrew Turner
fe5d5d7d05 AcpiGbl_FACS will not be defined when building using the reduced hardware
model. This may be the case on ARM.
2015-05-06 14:14:14 +00:00
Andrew Turner
ef74544931 If the power management timer is unsupported the PmTimerLength value will
be zero.
2015-05-06 14:09:54 +00:00
Kashyap D Desai
dbcc81dfdc Corrected indentation on conflicted source files.
Reviewed by:	ambrisko
MFC after:	2 weeks
Sponsored by:	AVAGO Technologies
2015-05-06 10:46:28 +00:00
Kashyap D Desai
1bebd87179 Configured the mrsas(4) driver to support UNMAPPED I/O and updated driver version.
Reviewed by:	ambrisko
MFC after:	2 weeks
Sponsored by:	AVAGO Technologies
2015-05-06 10:45:56 +00:00
Kashyap D Desai
ecea5be464 1. All LSI namings are converted to AVAGO Tech.
2. Fix in AEN path(suggested by John Baldwin).
3. Fix IOCTL path w.r.t Sense key handling

Reviewed by:	ambrisko
MFC after:	2 weeks
Sponsored by:	AVAGO Technologies
2015-05-06 10:45:13 +00:00
Kashyap D Desai
2f863eb8d8 Bug fixes found internally as detailed below:
1. While disabling interrupt the FW disables interrupts for only 16 vectors.
In case of Invader which supports 96 MSI-x vectors, some spurious interrupts
may come on other vectors even after interrupt disable. So, driver uses a flag
and ignores the spurious interrupts.
2. Reply queue depth is made double the number of commands supported by FW.
3. Misplaced interrupt enable code is now moved down in the OCR path.
4. Updated error handling code in OCR path.
5. Removed un-necessary print.

Reviewed by:	ambrisko
MFC after:	2 weeks
Sponsored by:	AVAGO Technologies
2015-05-06 10:44:08 +00:00
Kashyap D Desai
daeed97380 Driver calls mrsas_complete_cmd() to call mrsas_wakeup() for each MFI frame that was
issued through the ioctl() interface prior to the kill adapter. This ensures
userspace ioctl() system calls issued just before a kill adapter don't get stuck in
wait state and IOCTLs are returned to application.

Reviewed by:	ambrisko
MFC after:	2 weeks
Sponsored by:	AVAGO Technologies
2015-05-06 10:43:19 +00:00
Kashyap D Desai
af51c29f66 In OCR(Online Controller Reset) path, driver sets adapter state to
MEGASAS_HBA_OPERATIONAL before getting new RAID map.
There will be a small window where IO will come from OS with old RAID map.
This patch will update adapter state to MEGASAS_HBA_OPERATIONAL,
only after driver has new RAID map to avoid any IOs getting build using old RAID map.

Reviewed by:	ambrisko
MFC after:	2 weeks
Sponsored by:	AVAGO Technologies
2015-05-06 10:42:44 +00:00
Kashyap D Desai
16dc2814ee Current driver does fast path read load balancing between arm and mirror disk
for two Drive Raid-1 configuration only.

Now, Driver support fast path read load balancing for all (any number of disk) Raid-1 configuration.

Reviewed by:	ambrisko
MFC after:	2 weeks
Sponsored by:	AVAGO Technologies
2015-05-06 10:41:27 +00:00
Kashyap D Desai
77cf7df804 Now Driver expose Secure Jbod Support via driver_operations in MFI INIT Frame.
FW expose Secure Jbod support via Controller properity.

Firmware expect IOs to be received from different IO path than
conventional fast path queue, in case of SED drives.

To have Secure jbod support user need driver and firmware support.

Reviewed by:    ambrisko
MFC after:  2 weeks
Sponsored by:   AVAGO Technologies
2015-05-06 10:36:53 +00:00
Kashyap D Desai
5844115e3a This patch adds the feature to provide PCI information via IOCTL query.
Reviewed by:	ambrisko
MFC after:	2 weeks
Sponsored by:	AVAGO Technologies
2015-05-06 10:32:27 +00:00
Hans Petter Selasky
0de2373fa2 Add new USB ID.
PR:		199843
MFC after:	1 week
2015-05-05 19:34:23 +00:00
Andrew Turner
2c0d026b52 Move the point we attach the ofw driver on arm64 to nexus.c. This will
allow us to have a single place to decide to use ofw or acpi.
2015-05-05 11:13:16 +00:00
Renato Botelho
8854b88e66 Add support for Sierra MC7354 card
Author:		Jeremy Porter <jporter@netgate.com>
Differential Revision:	https://reviews.freebsd.org/D2444
Reviewed by:	gnn, hselasky
MFC after:	1 week
Sponsored by:	Netgate
2015-05-05 10:19:43 +00:00
Warner Losh
531258ace4 Add some data found in TI's application note "SCPA035: PCI1510
Implementation Guide" about default values.
2015-05-05 04:23:55 +00:00
Warner Losh
55d793dc6e When dealing with the TI12XX family of parts, we sometimes need to
initialize the MFUNC registers. Our old test of assuming that if this
register is set at all is not quite right. Many scenarios (including
the power-on defaults for chips w/o EEPROMs) land us in trouble. The
MFUNC0 pin should be set to signal #INTA and the MFUNC1 pin should be
set to signal #INTB of multi-socketed devices. Since my memory recalls
issues with blindly clearing the upper bytes of this register, perform
the heuristic only when both MFUNC0 and 1 are clear. We won't work
well using these pins for GPIO, and the serial interrupts won't save
us because we go out of our way to generally disable them. They are
needed to support legacy drivers for 16-bit PC Cards that are
hard-wired to specific IRQ values. Since FreeBSD never had any of
these, we configure the more reliable direct signaling. This was just
one small piece of that which had been left out back in the day.
2015-05-05 04:13:48 +00:00
Justin Hibbits
98be38e7fb Implement a driver for the PowerPC-base RouterBoard (RB333/600/800/1100)
Summary:
This has been tested on the RB800, but should work on the RB333, RB600, and
RB1100 as well.

It's currently missing ECC support, but read and write are complete.

Reviewers: imp

Reviewed By: imp

Subscribers: imp

Differential Revision: https://reviews.freebsd.org/D2223
2015-05-04 20:36:00 +00:00
Ian Lepore
28315e27a7 Implement a mechanism for making changes in the kernel<->driver PPS
interface without breaking ABI or API compatibility with existing drivers.

The existing data structures used to communicate between the kernel and
driver portions of PPS processing contain no spare/padding fields and no
flags field or other straightforward mechanism for communicating changes
in the structures or behaviors of the code.  This makes it difficult to
MFC new features added to the PPS facility.  ABI compatibility is
important; out-of-tree drivers in module form are known to exist.  (Note
that the existing api_version field in the pps_params structure must
contain the value mandated by RFC 2783 and any RFCs that come along after.)

These changes introduce a pair of abi-version fields which are filled in
by the driver and the kernel respectively to indicate the interface
version.  The driver sets its version field before calling the new
pps_init_abi() function.  That lets the kernel know how much of the
pps_state structure is understood by the driver and it can avoid using
newer fields at the end of the structure that it knows about if the driver
is a lower version.  The kernel fills in its version field during the init
call, letting the driver know what features and data the kernel supports.

To implement the new version information in a way that is backwards
compatible with code from before these changes, the high bit of the
lightly-used 'kcmode' field is repurposed as a flag bit that indicates the
driver is aware of the abi versioning scheme.  Basically if this bit is
clear that indicates a "version 0" driver and if it is set the driver_abi
field indicates the version.

These changes also move the recently-added 'mtx' field of pps_state from
the middle to the end of the structure, and make the kernel code that uses
this field conditional on the driver being abi version 1 or higher.  It
changes the only driver currently supplying the mtx field, usb_serial, to
use pps_init_abi().

Reviewed by:	hselasky@
2015-05-04 17:59:39 +00:00
Adrian Chadd
3077c104f5 [iwn] Do not filter control frames in monitor mode.
PR:		kern/197143
Submitted by:	 Andriy Voskoboinyk <s3erios@gmail.com>
2015-05-03 23:40:12 +00:00
Adrian Chadd
a20c9aff42 Handle properly IBSS merges (works with patch from bug 199632).
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-05-03 23:39:44 +00:00
Adrian Chadd
5cacb17fa2 Fix various powersave races + optimize tx/rx pointer update when powersave is off.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-05-03 23:39:02 +00:00
Adrian Chadd
9b7cc717ed [iwn?] Use correct sequence numbers with non-QoS STAs.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-05-03 23:38:32 +00:00
Adrian Chadd
e43b274af6 Fix warning about comparison of integers of different signs.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-05-03 23:37:13 +00:00
Adrian Chadd
978d805f34 [iwn?] Fix memory leak in wpi_reset_tx_ring().
PR:		kern/197143
Differential Revision:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-05-03 23:36:25 +00:00
Adrian Chadd
12e0ff3b76 Use nitems() for counting elements in arrays.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-05-03 23:35:44 +00:00
Adrian Chadd
cbaa708073 Do not include WPI_START_SCAN event processing into non-debug builds.
PR:		kern/197143
Submitted by:	 Andriy Voskoboinyk <s3erios@gmail.com>
2015-05-03 23:35:11 +00:00
Adrian Chadd
c39df5f423 Fix sequence number generation for beacon frames.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-05-03 23:34:24 +00:00
Adrian Chadd
6ddc7d4d45 Add debug output for WPI_BEACON_SENT event.
PR:		kern/197143
Submitted by:	 Andriy Voskoboinyk <s3erios@gmail.com>
2015-05-03 23:30:04 +00:00
Adrian Chadd
6f5066748d Try to fix passive scanning hang on beacon miss.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-05-03 23:28:54 +00:00
Adrian Chadd
89023da2eb Add comment about AUTH -> AUTH state transition + fix some style issues.
PR:		kern/197143
Submitted by:	 Andriy Voskoboinyk <s3erios@gmail.com>
2015-05-03 23:27:36 +00:00
Adrian Chadd
cf990903c7 Display more information for beacon miss debugging.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-05-03 23:25:33 +00:00
Adrian Chadd
5c0159195d Limit minimum threshold of missed beacons.
PR:		kern/197143
Submitted by:	 Andriy Voskoboinyk <s3erios@gmail.com>
2015-05-03 23:24:20 +00:00
Adrian Chadd
b4324a50bd Improve beacon miss detection.
PR:		kern/197143
Submitted by:	 Andriy Voskoboinyk <s3erios@gmail.com>
2015-05-03 23:21:16 +00:00
Adrian Chadd
3e54d9fdc0 Create another debug category for WPI_BEACON_MISSED notification.
Differential Revision:	kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-05-03 23:18:28 +00:00