Commit Graph

26734 Commits

Author SHA1 Message Date
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
Adrian Chadd
a704cc7f5f Commit over some work to prepare the iwn(4) driver for further chipset
support.

* Extend the hardware base_params structure to include a bunch of hardware
  flags indicating what is and isn't supported.

* Convert a bunch of the initial hardware configuration conditionals to
  consult the base_params structure.

* Add new calibration code for temperature calibration for the Centrino 2xxx
  series NICs.

* Add new bluetooth coexistence code for Centrino 2xxx series NICs.

* For NICs that support PAN (personal area networking), use a different
  transmit queue and command queue setup, in preparation for said
  PAN support.

* Extend the calibration array in iwn_softc to include enough space for
  the new calibration types.

Tested (by myself, if not mentioned):

* Intel 4965
* Intel 5100
* Intel 6150
* Intel 2230
* Intel 2200 (eadler)
* Intel 1030
* Intel 6200
* Intel 6230
* Intel 6250
* Intel 6150
* Intel 100

What doesn't work:

* Intel 6235 - fails in calibration at startup

TODO:

* Testing on Intel 53xx series hardware

Submitted by:	Cedric Gross <cg@cgross.info>
2013-11-12 05:58:23 +00:00
Adrian Chadd
1c4ec1b709 Fix up the link quality lookup and re-enable multi-rate retry.
This is a terrible solution that at least behaves mostly correctly.

It walks the currently active rate table looking for rates to match.
It assumes that the code matches the setup path in the link quality
setup code (much like the previous, much simpler but even more hackish
math did.)

It's O(n), but n<15, so we're okay for the time being.

Tested:

* Intel 5100, STA - 11a, 11n, 11bg modes.
2013-11-12 05:49:01 +00:00
Adrian Chadd
f1705377c5 Grr. For some odd reason, setting this to a single antenna on my 5100
(which is a 1x2 device) panics the firmware.

But, for some 6xxx devices that require IWN_ANT_BC for the TX chainmask,
the link quality entries need to represent _that_.

So, revert this for now until I can figure out what is supposed to be
going on.
2013-11-12 05:08:24 +00:00
Adrian Chadd
a67bb1257f Use the negotiated HT rate set when generating the link quality table. 2013-11-12 05:00:18 +00:00
Adrian Chadd
47b078db0b Comment what 'mimo' does in the link quality table. 2013-11-12 04:57:31 +00:00
Adrian Chadd
42e0f858ad Don't default to antennas A+B; some NICs use Antennas B+C to transmit. 2013-11-12 04:56:00 +00:00
Kevin Lo
bf124fcf1e Use the real product name for Edimax rsu(4) id. 2013-11-12 02:34:48 +00:00
Nathan Whitehorn
629aa519d6 Make tsec work with the device tree present on the RB800. The previous code
assumed that the MDIO bus was a direct child of the Ethernet interface. It
may not be and indeed on many device trees is not. While here, add proper
locking for MII transactions, which may be on a bus shared by several MACs.

Hardware donated by:	Benjamin Perrault
2013-11-11 15:43:21 +00:00
Kevin Lo
67e73b2b2d Remove r257748 by accident. 2013-11-11 10:00:19 +00:00
Kevin Lo
64891211ca Add support for the MediaTek/Ralink RT5370/RT5372 chipset.
Tested with the TP-Link TL-WN727N (RT5370) and the D-Link DWA-140 (RT5372)
on i386/amd64/arm with WPA.
2013-11-11 09:47:33 +00:00
Adrian Chadd
825e355d1d If A-MPDU transmission fails entirely, then no BA is received from the
NIC and pushed up to the driver.  Unfortunately this means there's
no rate control notification done.  Thus, if the rate control code
makes a decision that hits a crappy rate that can't succeed, the
rate code would never lower the rate and packet loss would continue.

So, fake some rate control notification in this case.
2013-11-11 09:08:22 +00:00
Adrian Chadd
559abc28c0 Replace the hard-coded RX queue value check with IWN_UNSOLICITED_RX_NOTIF. 2013-11-11 08:56:40 +00:00
Adrian Chadd
6abfec88c3 Fix off-by-one. Sorry! 2013-11-11 08:55:38 +00:00
Adrian Chadd
8ea24d528f Use IWN_NBANDS rather than a hard-coded limit.
Tested:

* Intel 5100, STA
2013-11-11 08:54:45 +00:00
Adrian Chadd
7c1c3741c3 Send EAPOL frames at the management rate, not the data rate.
Without this, a far away station with low signal strength would
associate using the management rate (by default the lowest rate)
and then the EAPOL frames would go out at the current AMRR best
guess.  This would result in association failing authentication.

Tested:

* Intel 5100, STA
* Intel 2230, STA
2013-11-11 08:53:20 +00:00
Alexander Motin
07d925fa2f Use relaxed (write-only) memory barriers when writing some of queue index
registers (for now on ISP2400+).  We never read those registers back and
AFAIK their semantics does not require any immediate reaction on write.
2013-11-10 23:48:16 +00:00
Alexander Motin
748d188e18 Some more registers access optimizations:
- Process ATIO queue only if interrupt status tells so;
 - Do not update queue out pointers after each processed command, do it
only once at the end of the loop.
2013-11-10 23:34:32 +00:00