Commit Graph

26751 Commits

Author SHA1 Message Date
Ian Lepore
ff00fd81aa Look up a nand chip by id in the static table before trying to obtain
ONFI parameters.  This allows a static table entry to provide valid data
for chips known to provide invalid ONFI data.
2013-11-29 14:23:22 +00:00
Kevin Lo
5b7514646c Change run_rt2870_rf_write() prototype (no functional change) 2013-11-29 07:08:17 +00:00
Kevin Lo
5f7e329cec On the RT2870, rf registers are now 64-bit, not 32-bit after r257955.
Committed over a Buffalo WLI-UC-AG300N (RT2870).
2013-11-29 06:10:44 +00:00
Navdeep Parhar
2471928bf8 Disable an assertion that relies on some code[1] that isn't in HEAD yet.
[1] http://lists.freebsd.org/pipermail/freebsd-net/2013-August/036573.html
2013-11-27 19:54:19 +00:00
Sergey Kandaurov
d9140d3691 Bandaid for compiling with gcc. 2013-11-27 08:39:48 +00:00
Hans Petter Selasky
361f264ba0 Style changes. 2013-11-26 11:11:24 +00:00
Hans Petter Selasky
beb13f0407 Add missing static keyword.
MFC after:	2 weeks
2013-11-26 10:53:12 +00:00
Adrian Chadd
3b64bbd285 Add definitions for the microcode TLV flags entry (type 18.)
This isn't used anywhere just yet!

Obtained from:	Linux iwlwifi
2013-11-26 08:58:08 +00:00
Adrian Chadd
b9066e384d Add a new debug section. 2013-11-26 08:57:25 +00:00
Andriy Gapon
d9fae5ab88 dtrace sdt: remove the ugly sname parameter of SDT_PROBE_DEFINE
In its stead use the Solaris / illumos approach of emulating '-' (dash)
in probe names with '__' (two consecutive underscores).

Reviewed by:	markj
MFC after:	3 weeks
2013-11-26 08:46:27 +00:00
Adrian Chadd
39bb444c76 The bssid can change from underneath us, so take a reference before
we fiddle with it.
2013-11-26 01:30:10 +00:00
Jean-Sébastien Pédron
d52ba34e7b drm: Fix build with gcc, broken with r258549
The code was easier to read without __DECONST and clang didn't report
any error. I thought the cast was enough...

MFC after:	3 days
X-MFC-With:	r258549
2013-11-25 15:01:59 +00:00
Jean-Sébastien Pédron
1eafa5d8b0 drm: Dereference pointers given to qsort_r()'s cmp callback
drm_le_cmp() (qsort_r()'s callback) receives pointers to elements in the
array passed to qsort_r(), not the elements themselves.

Before this fix, the use of qsort_r() shuffled the array, not sorted it,
because the compare callback accessed random memory locations, not the
expected elements.

This bug triggered an infinite loop in KDE/xserver:

    1. KDE has a kded module called "randrmonitor" which queries xserver
       for current monitors at startup and then listens to RandR
       notifications from xserver.

    2. xserver handles the query from "randrmonitor" by polling the
       video device using the "drm_mode_getconnector()" ioctl. This
       ioctl returns a list of connectors and, for those with a
       connected monitor, the available modes. Each modes list is sorted
       by the kernel before returning. When xserver gets the connectors
       list, it sorts the modes lists again.

       In the case of this bug, when two modes are equal (in xserver's
       compare function PoV), their order is kept stable (ie. the
       kernel order is kept for those two modes). And because the list
       was shuffled by the kernel, the order of two equal modes was
       frequently changed in the final modes list in xserver.

    3. xserver compares the returned connectors list with the list
       obtained earlier. In particular, it compares the sorted
       modes lists for each connector. If a property of a connector
       changes (eg. modes), xserver sends a "RRNotify_OutputChange"
       notification.

       Because of the change of order between equal modes, xserver sent
       a notification after each polling of the connectors.

    4. "randrmonitor" receives a notification, triggered by its query. The
       notification doesn't contain the new connectors list, therefore, it
       asks for the new list using the same function: go back to step #2.

MFC after:	3 days
2013-11-25 11:15:51 +00:00
Hans Petter Selasky
5c0f828a07 Comply to the XHCI specification. Certain input context fields should
always be zero.

MFC after:	1 week
2013-11-25 10:58:02 +00:00
Attilio Rao
54366c0bd7 - For kernel compiled only with KDTRACE_HOOKS and not any lock debugging
option, unbreak the lock tracing release semantic by embedding
  calls to LOCKSTAT_PROFILE_RELEASE_LOCK() direclty in the inlined
  version of the releasing functions for mutex, rwlock and sxlock.
  Failing to do so skips the lockstat_probe_func invokation for
  unlocking.
- As part of the LOCKSTAT support is inlined in mutex operation, for
  kernel compiled without lock debugging options, potentially every
  consumer must be compiled including opt_kdtrace.h.
  Fix this by moving KDTRACE_HOOKS into opt_global.h and remove the
  dependency by opt_kdtrace.h for all files, as now only KDTRACE_FRAMES
  is linked there and it is only used as a compile-time stub [0].

[0] immediately shows some new bug as DTRACE-derived support for debug
in sfxge is broken and it was never really tested.  As it was not
including correctly opt_kdtrace.h before it was never enabled so it
was kept broken for a while.  Fix this by using a protection stub,
leaving sfxge driver authors the responsibility for fixing it
appropriately [1].

Sponsored by:	EMC / Isilon storage division
Discussed with:	rstone
[0] Reported by:	rstone
[1] Discussed with:	philip
2013-11-25 07:38:45 +00:00
Navdeep Parhar
245a0bd40a cxgbe(4): update the internal list of device features.
MFC after:	3 days
2013-11-21 20:07:58 +00:00
Grzegorz Bernacki
364871328e Unbreak compilation with GCC. 2013-11-21 09:19:14 +00:00
Grzegorz Bernacki
8e16e025ac Split raw reading/programming into smaller chunks to avoid allocating too
big chunk of kernel memory. Validate size of data. Add error handling to
avoid calling copyout() when data has not been read correctly.

Reviewed by:    zbb
Reported by:    x90c <geinblues@gmail.com>
MFC after:      2 days
2013-11-20 11:10:23 +00:00
Don Lewis
3ca52b0d34 Add alternate ID for Novatel MiFi 2200 CDMA, which is used by my
Virgin Mobile branded device.  It needs the U3GINIT_SCSIEJECT quirk.

Reviewed by:	hselasky
MFC after:	1 month
2013-11-20 02:16:47 +00:00
Mark Johnston
da089c1410 Import the axge(4) driver for the ASIX AX88178A and AX88179 USB Ethernet
adapters. Both devices support Gigabit Ethernet and USB 2.0, and the AX88179
supports USB 3.0. The driver was written by kevlo@ and lwhsu@, with a few
bug fixes from me.

MFC after:	2 months
2013-11-19 00:37:53 +00:00
Jean-Sébastien Pédron
05ad6397b3 drm: Support DRM_CAP_TIMESTAMP_MONOTONIC capability
This fixes DPMS with KDE and radeonkms. Without this, the display would
freeze when the monitor is put into sleep state, and only resumes after
several dozens of minutes once the monitor is powered on again.

Tested by:	Mathias Picker <Mathias.Picker@virtual-earth.de>
2013-11-17 16:07:52 +00:00
Eitan Adler
c1e1ddd57f Centrino Wireless-N 2200 does not have bluetooth support. 2013-11-16 04:29:02 +00:00
Ian Lepore
774b082ca9 Rework the routine that returns a pointer to the table of software ECC
byte positions within the OOB area to support chips with unusual OOB
sizes such as 218 or 224 bytes.

The table for 128 byte OOB works for these but it assumes 3 bytes of ECC
per 256 byte block, and in the case of an ONFI chip the params page may
ask for something different.  In other words, this is better but not
yet perfect.
2013-11-15 23:48:51 +00:00
Ian Lepore
8fad47e60f Move the luns field to the end of the struct, for serendipitous packing.
(I was supposed to do this before committing it initially.)
2013-11-15 23:45:13 +00:00
Ian Lepore
c3c04faa3a ONFI parameters are little-endian, hence we must take care to convert them
to native endianness.  We must also pay attention to unaligned accesses.

Copy the interesting parameters to a new struct so the rest of the code can
forget about these problems.

Submitted by:	Kristof Provost <kristof@sigsegv.be> (cleanup) and me (orig).
2013-11-15 23:41:32 +00:00
Ian Lepore
1b45c6cd53 Search for and validate the ONFI params as specified in the standard.
The ONFI spec states that at least two bytes of the signature ("ONFI")
must be present, and the CRC must be correct to have a valid parameter
page.  If the page is not valid there are at least two backup pages where
the data can also be found.

Submitted by:	Kristof Provost <kristof@sigsegv.be> (cleanup) and me (orig).
2013-11-15 23:37:33 +00:00
Ian Lepore
7aa6428bc6 Update the onfi_params struct to ONFI revision 3.2 (06 12 2013).
Submitted by:	Kristof Provost <kristof@sigsegv.be> (cleanup) and me (orig).
2013-11-15 23:35:10 +00:00
Ian Lepore
1337b92635 The vendor specified field is 88 bytes, not 8 bytes.
Submitted by:	Kristof Provost <kristof@sigsegv.be>
2013-11-15 23:31:39 +00:00
Eric Davis
5e33beca59 Fixed a tx watchdog chip reset that could occur on mostly idle links.
Fixed various link related issues and 10GBaseT is now linking properly.
Modified the types for the driver tunables to be consistent with the sysctl APIs.

Approved by:	davidch (mentor)
2013-11-15 20:26:14 +00:00
Justin T. Gibbs
70046ce650 Improve robustness of the Xen balloon driver.
sys/dev/xen/balloon/balloon.c:
	Remove unused and commented out code.

	Fix deadlock caused by performing a sleepable malloc
	while holding the balloon mutex.

	Perform proper accounting of the memory used by the domain.

Submitted by:	Roger Pau Monné
Sponsored by:	Citrix Systems R&D
Reviewed by:	gibbs
MFC after:	2 days
2013-11-15 16:35:28 +00:00
Alexander Motin
9a6b4cb929 Add few more minor parts of DevSleep support from AHCI 1.3.1 proposal. 2013-11-15 15:14:07 +00:00
Alexander Motin
c9b3a5a00b Add some more Intel HDA controller IDs and rename HDMI CODEC to Haswell. 2013-11-15 13:55:55 +00:00
Alexander Motin
f00fac180f Add ID for Intel Avoton SMBus controller. 2013-11-15 13:19:15 +00:00
Alexander Motin
667b72800a Add ID for Intel Lynx Point HDMI CODEC.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
2013-11-15 13:12:53 +00:00
Alexander Motin
d46bdcabdb Handle case when ACPI reports HPET device, but does not provide memory
resource for it.  In such case take the address range from the HPET table.

This fixes hpet(4) driver attach on Asrock C2750D4I board.
2013-11-15 11:32:19 +00:00
Alexander Motin
eda36fb4f5 Add some more IDs for Intel ATA, AHCI and USB controllers. 2013-11-15 10:28:59 +00:00
David C Somayajulu
280c10eba5 Validate the buffer and its length passed to QLA_MPI_DUMP.
copyout dump only if qls_mpi_core_dump() is successful.
(like to credit x90c for pointing the issue)
Submitted by:David C Somayajulu
2013-11-15 01:44:58 +00:00
David C Somayajulu
c12c5bfbe1 ql_hw.[c,h]: set minimum thresholds on pkt size for lro path.
ql_ioctl.c: validate the length and address of buffer passed to QL_RD_FW_DUMP

Submitted by:David C Somayajulu
2013-11-15 01:26:24 +00:00
Xin LI
d8f7bfb8bd The previous code makes a memory allocation in size of
struct mbx_common_read_write_flashrom plus 32KB and caps the actual
transfer size at 32KB.  This is harmless as it is but may confuse
static code analyzer, so allocate a full 32KB instead.

Reported by:	Coverity via mjacob
Submitted by:	Venkata Duvvuru <VenkatKumar.Duvvuru Emulex Com>
Coverity CID:	1125820
2013-11-14 18:53:17 +00:00
Adrian Chadd
6171f42c9f Fix (I think!) the scan timeouts on the intel NICs.
This field needs to be (a) set, and (b) greater than the other timeouts
(passive, active, maxquiet, etc.)  It also is in microseconds, not
milliseconds.

I hope this will fix the scan hangs that people are seeing.

Obtained from:	Linux iwlwifi
2013-11-14 07:27:00 +00:00
Adrian Chadd
1650f039d0 This is "scan_flags" from Linux. 2013-11-14 07:21:09 +00:00
Adrian Chadd
48777c4c5a Leave a note that the 5300 is a 3x3 NIC. 2013-11-13 09:32:11 +00:00
Adrian Chadd
ade5fbb745 Correctly initialise the 2-chain antenna mask in the link quality table.
The previous code simply hard-coded IWN_ANT_AB which is only correct for
some of the NICs.

Now, if the NIC is a 1-stream TX, you need to set IWN_ANT_AB and _not_
just a single antenna.  The Intel 5100 firmware panics the moment the
link quality table is updated.

So!

* no secondary antenna? Set it to IWN_ANT_AB;
* two-stream device? Transmit on the full transmit antenna configuration.

Tested:

* Intel 5100, STA
* Intel 2200 (eadler)

Obtained from:	Linux iwlwifi
2013-11-13 07:09:00 +00:00
Kevin Lo
0f3728be20 Remove a couple of unused macros. 2013-11-13 05:22:39 +00:00
Kevin Lo
28dfd8415b - Use bit twiddling macro to set IEEE80211_MODE_11A
- On the RT3572 chipset, there's no need to configure BBP register 86
2013-11-13 05:21:41 +00:00
Ruslan Bukin
5c263f43ef Add support for Freescale Vybrid Family VF600 heterogeneous
ARM Cortex-A5/M4 SoC (M4 core is not used in this work).

Support includes device drivers for:
- NAND Flash Controller (NFC)
- USB Enhanced Host Controller Interface (EHCI)
- General-Purpose Input/Output (GPIO)
- Universal Asynchronous Receiver/Transmitter (UART)

Also supported:
- Generic Interrupt Controller (GIC)
- MPCore timer
- ffec ethernet driver

Reviewed by:	ray
Approved by:	cognet (mentor)
2013-11-12 18:02:56 +00:00
Luiz Otavio O Souza
ea5d5118ae Fix gpiobus to return BUS_PROBE_GENERIC insted of BUS_PROBE_SPECIFIC (0) so
it can be overriden by its OFW/FDT version.

Give a chance for GPIO devices that implement the device_identify method to
attach.

Approved by:	adrian (mentor)
2013-11-12 16:08:23 +00:00
Luiz Otavio O Souza
a1f621566e Move the KASSERT() check to the point before the increase of number of pins.
Approved by:	adrian (mentor)
2013-11-12 13:55:19 +00:00
Luiz Otavio O Souza
8ad579cac3 Fix a typo on a comment in ofw_bus_if.m, the default method will return -1
when a node doesn't exist.

Reviewed by:	nwhitehorn
Approved by:	adrian (mentor)
2013-11-12 13:44:50 +00:00
Mark Johnston
aae2e36cd5 Add IDs for the ASIX 88179 and 88178A USB to GigE adapters. 2013-11-12 06:14:12 +00:00