Commit Graph

27354 Commits

Author SHA1 Message Date
David C Somayajulu
e36ffbdd29 Modify Copyright information to reflect Qlogic Corporation's purchase
of Broadcom's NetXtreme business

Submitted by:David C Somayajulu (davidcs@freebsd.org) QLogic Corporation
MFC after:5 days
2014-05-06 02:32:27 +00:00
Adrian Chadd
67aaf73997 Modify the RX path to keep the previous RX descriptor around once it's
used.

It turns out that the RX DMA engine does the same last-descriptor-link-
pointer-re-reading trick that the TX DMA engine.  That is, the hardware
re-reads the link pointer before it moves onto the next descriptor.
Thus we can't free a descriptor before we move on; it's possible the
hardware will need to re-read the link pointer before we overwrite
it with a new one.

Tested:

* AR5416, STA mode

TODO:

* more thorough AP and STA mode testing!
* test on other pre-AR9380 NICs, just to be sure.
* Break out the RX descriptor grabbing bits from the RX completion
  bits, like what is done in the RX EDMA code, so ..
* .. the RX lock can be held during ath_rx_proc(), but not across
  packet input.
2014-05-06 01:15:42 +00:00
Aleksandr Rybalko
f3d2e242ec Switch vga drivers to use names and new vt(4) driver probe method.
Sponsored by:	The FreeBSD Foundation
2014-05-05 22:12:46 +00:00
Aleksandr Rybalko
5a0e08fb31 Revert r264997 and r265026. It is not required anymore.
Sponsored by:	The FreeBSD Foundation
2014-05-05 22:10:31 +00:00
Aleksandr Rybalko
ac7073a9d5 Add vt(4) driver name for ofwfb driver.
Sponsored by:	The FreeBSD Foundation
2014-05-05 21:49:31 +00:00
Aleksandr Rybalko
4dde16408c Switch fb and efifb drivers to use names and new vt(4) driver probe method.
Sponsored by:	The FreeBSD Foundation
2014-05-05 21:48:19 +00:00
Aleksandr Rybalko
1928c49270 Set of updates to vt(4) core part.
o Declare vt(4) drivers dataset.
o Create single static structures for all early drivers.
o Add vt(4) to be by default in the kernel consoles list.
o Create one more sysinit point, to be able to initialize memory and lock
	requirement of early drivers.
o Implement early drivers select. (Only best available will be selected).
o Fix one missed "return (0)" for VTYLOCK.
o Improve locking for cases when one driver replace another.
o Make driver replacement notification less debug-look-like.

Minor spell fixes.

Sponsored by:	The FreeBSD Foundation
2014-05-05 21:44:53 +00:00
Aleksandr Rybalko
90fdc1c6c2 Create dataset for vt(4) drivers.
Sponsored by:	The FreeBSD Foundation
2014-05-05 21:31:00 +00:00
Aleksandr Rybalko
f06a81663f Define a new method for probing vt(4) driver before attach it at early stage.
Sponsored by:	The FreeBSD Foundation
2014-05-05 21:29:56 +00:00
Kenneth D. Merry
c503306dc6 Adjust #if statements inside mprsas_send_smpcmd() to more accurately
reflect when unmapped I/O support was added.

For FreeBSD 10, it arrived just prior to __FreeBSD_version 1000028.
For FreeBSD 9, it arrived just prior to __FreeBSD_version 902001.

Also, fix compiler warnings in mprsas_send_smpcmd() that happen in the
i386 PAE build for non-unmapped I/O builds.  These were fixed in mps(4)
in revision 241145, but didn't make it into the mpr(4) driver.  This
change should only affect FreeBSD versions outside the above revisions,
and thus doesn't affect head.

MFC after:	3 days
Sponsored by:	Spectra Logic Corporation
2014-05-05 19:53:03 +00:00
Michael Tuexen
5a1a4f754a Fill in csum_data only for UDP or TCP packets. This fixes a bug where
SCTP were reported to have always a correct checksum if they don't
contain any ethernet padding.

MFC after: 3 days
2014-05-05 17:30:05 +00:00
Adrian Chadd
4b734a1c84 Wake up the hardware before calling ath_mode_init() in the ioctl() path.
Tested:

* AR5416, STA + powersave
2014-05-05 17:06:40 +00:00
Hans Petter Selasky
bc99048296 Improve DWC OTG USB host side support for isochronous FULL and HIGH
speed data traffic going directly to a USB device or through a
so-called USB transaction translator.

Add checks that we are not overusing the TX FIFO.

MFC after:	2 weeks
2014-05-05 11:50:52 +00:00
Adrian Chadd
e5bd159ed5 Break out the multicast programming into its own hardware specific
call, which assumes the hardware is awake.

Turn ath_update_mcast() into a routine that's only called from the
net80211 layer - and it forces the hardware awake first.

This fixes a LOR from the EDMA RX path which calls ath_mode_init()
with the RX lock held - the driver lock can't also be grabbed.
This path assumes that the ath_mode_init() callers all wake up
the NIC first.

Tested:

* AR9485, STA mode, powersave
2014-05-05 08:12:21 +00:00
Adrian Chadd
516a0ac28b Quieten the RX/TX descriptor and FIFO setup debugging.
Tested:

* AR9485, STA mode
2014-05-05 08:00:50 +00:00
Adrian Chadd
9a4cf01f45 Add Atheros AR1111 support to the HAL.
This seems to probe/attach as an AR9485 and thus nothing else besides
adding the device id seems to be required.

ath0: <Atheros AR1111> mem 0xf4800000-0xf487ffff irq 19 at device 0.0 on pci5
ath0: [HT] enabling HT modes
ath0: [HT] enabling short-GI in 20MHz mode
ath0: [HT] 1 stream STBC receive enabled
ath0: [HT] 1 RX streams; 1 TX streams
ath0: AR9485 mac 576.1 RF5110 phy 1926.8
ath0: 2GHz radio: 0x0000; 5GHz radio: 0x0000

The NIC I have here is a 1 antenna, 2GHz only device.

Thankyou to Jim Thompson <jim@netgate.com> for the AR1111 NIC.

Tested:

* AR1111 (pretending not to be an AR9485, but failing miserably);
  STA mode with powersave.

Relnotes:	yes
Sponsored by:	Netgate
2014-05-05 07:58:05 +00:00
Luiz Otavio O Souza
8d25059572 Move gpiobus routines to dev/gpio. Avoid polluting ofw_bus with bus
specific parts.

Requested by:	nwhitehorn
2014-05-04 04:01:26 +00:00
Luiz Otavio O Souza
002381df32 Really sort out the headers.
sys/systm.h must always come after sys/param.h.

Remove sys/types.h which should never be included together with sys/param.h.

Add sys/malloc.h for correctness even if it seems to don't be needed.

Remove more unused headers found by unusedinc (from bde@) and tested with a
universe build.

Reported by:	bde
2014-05-03 20:33:00 +00:00
Jean-Sébastien Pédron
b5cd65d1c7 drm/radeon: Add 32bit ioctls support
This allows to run 32bit applications on a 64bit host. This was tested
successfully with Wine (emulators/i386-wine-devel) and StarCraft II.

Submitted by:	Jan Kokemüller <jan.kokemueller@gmail.com>
MFC after:	1 week
2014-05-03 11:23:10 +00:00
Kenneth D. Merry
991554f2c4 Bring in the mpr(4) driver for LSI's MPT3 12Gb SAS controllers.
This is derived from the mps(4) driver, but it supports only the 12Gb
IT and IR hardware including the SAS 3004, SAS 3008 and SAS 3108.

Some notes about this driver:
 o The 12Gb hardware can do "FastPath" I/O, and that capability is included in
   this driver.

 o WarpDrive functionality has been removed, since it isn't supported in
   the 12Gb driver interface.

 o The Scatter/Gather list handling code is significantly different between
   the 6Gb and 12Gb hardware.  The 12Gb boards support IEEE Scatter/Gather
   lists.

Thanks to LSI for developing and testing this driver for FreeBSD.

share/man/man4/mpr.4:
	mpr(4) man page.

sys/dev/mpr/*:
	mpr(4) driver files.

sys/modules/Makefile,
sys/modules/mpr/Makefile:
	Add a module Makefile for the mpr(4) driver.

sys/conf/files:
	Add the mpr(4) driver.

sys/amd64/conf/GENERIC,
sys/i386/conf/GENERIC,
sys/mips/conf/OCTEON1,
sys/sparc64/conf/GENERIC:
	Add the mpr(4) driver to all config files that currently
	have the mps(4) driver.

sys/ia64/conf/GENERIC:
	Add the mps(4) and mpr(4) drivers to the ia64 GENERIC
	config file.

sys/i386/conf/XEN:
	Exclude the mpr module from building here.

Submitted by:	Steve McConnell <Stephen.McConnell@lsi.com>
MFC after:	3 days
Tested by:	Chris Reeves <chrisr@spectralogic.com>
Sponsored by:	LSI, Spectra Logic
Relnotes:	LSI 12Gb SAS driver mpr(4) added
2014-05-02 20:25:09 +00:00
Eitan Adler
461dbce2d9 lindev(4): remove the device
lindev(4) was only used to provide /dev/full which is now a standard feature of
FreeBSD.  /dev/full was never linux-specific and provides a generally useful
feature.

Document this in UPDATING and bump __FreeBSD_version.  This will be documented
in the PH shortly.

Reported by:	jkim
2014-05-02 05:30:49 +00:00
Ian Lepore
e625c10b2f Honor the max-frequency property if it appears in the fdt data.
Adjust the exynos and zedboard dts files to use max-frequency (the
documented standard property) instead of clock-frequency.

Submitted by:	Thomas Skibo <ThomasSkibo@sbcglobal.net>
2014-05-02 01:28:19 +00:00
Adrian Chadd
7d567ed66f Add tracking for self-generated frames when the VAP is in sleep state.
The hardware can generate its own frames (eg RTS/CTS exchanges, other
kinds of 802.11 management stuff, especially when it comes to 802.11n)
and these also have PWRMGT flags.  So if the VAP is asleep but the
NIC is in force-awake for some reason, ensure that the self-generated
frames have PWRMGT set to 1.

Now, this (like basically everything to do with powersave) is still
racy - the only way to guarantee that it's all actually consistent
is to pause transmit and let it finish before transitioning the VAP
to sleep, but this at least gets the basic method of tracking and
updating the state debugged.

Tested:

* AR5416, STA mode
* AR9380, STA mode
2014-05-02 00:48:09 +00:00
Luiz Otavio O Souza
160ca719c3 Remove unnecessary headers. Sort out the headers. Add a missing header on
ofw_gpiobus.c (it was working because of sys/libkern.h).
2014-05-01 14:09:47 +00:00
Steven Hartland
8197f45b6a Make uninteresting PCI devices with no attached drivers only print out
on a verbose boot

MFC after:	2 weeks
2014-04-30 16:42:12 +00:00
Eitan Adler
9ca1db6598 null.c: uio is unused
Mark another parameter as unused

Reported by:	rpaulo
2014-04-30 06:40:30 +00:00
Eitan Adler
7a07ae0a8e null.c: fix ordering
Use a consistent ordering of full -> null -> zero (alphabetical) in null.c

Reported by:	mjg
2014-04-30 06:30:37 +00:00
Eitan Adler
a345aa5953 Add a /dev/full device.
/dev/full is similar to /dev/zero except it always returns
ENOSPC when you attempt to write to it.

Reviewed by:	jhibbits
Discussed with:	rpaulo
2014-04-30 06:20:48 +00:00
Adrian Chadd
8cc3f9c9e1 * Modify the beacon interval in debugging to be ni_intval, not 102400
* Be paranoid about avoiding divide-by-zero.

Tested:

* AR9380, STA mode
2014-04-30 02:44:07 +00:00
Adrian Chadd
f5c30c4e8d Bring over some initial power save management support, reset path
fixes and beacon programming / debugging into the ath(4) driver.

The basic power save tracking:

* Add some new code to track the current desired powersave state; and
* Add some reference count tracking so we know when the NIC is awake; then
* Add code in all the points where we're about to touch the hardware and
  push it to force-wake.

Then, how things are moved into power save:

* Only move into network-sleep during a RUN->SLEEP transition;
* Force wake the hardware up everywhere that we're about to touch
  the hardware.

The net80211 stack takes care of doing RUN<->SLEEP<->(other) state
transitions so we don't have to do it in the driver.

Next, when to wake things up:

* In short - everywhere we touch the hardware.
* The hardware will take care of staying awake if things are queued
  in the transmit queue(s); it'll then transit down to sleep if
  there's nothing left.  This way we don't have to track the
  software / hardware transmit queue(s) and keep the hardware
  awake for those.

Then, some transmit path fixes that aren't related but useful:

* Force EAPOL frames to go out at the lowest rate.  This improves
  reliability during the encryption handshake after 802.11
  negotiation.

Next, some reset path fixes!

* Fix the overlap between reset and transmit pause so we don't
  transmit frames during a reset.
* Some noisy environments will end up taking a lot longer to reset
  than normal, so extend the reset period and drop the raise the
  reset interval to be more realistic and give the hardware some
  time to finish calibration.
* Skip calibration during the reset path.  Tsk!

Then, beacon fixes in station mode!

* Add a _lot_ more debugging in the station beacon reset path.
  This is all quite fluid right now.
* Modify the STA beacon programming code to try and take
  the TU gap between desired TSF and the target TU into
  account.  (Lifted from QCA.)

Tested:

* AR5210
* AR5211
* AR5212
* AR5413
* AR5416
* AR9280
* AR9285

TODO:

* More AP, IBSS, mesh, TDMA testing
* Thorough AR9380 and later testing!
* AR9160 and AR9287 testing

Obtained from:	QCA
2014-04-30 02:19:41 +00:00
Adrian Chadd
ce3f9a8950 * Only update ah_powerMode if we're setting the chip sleep state.
Some code will appear soon that is actually setting the chip powerstate
  separate from the self-generated frames power state.
* Allow the AR5416 family chips to actually have the power state changed
  from the self generated state change.

Tested (STA mode):

* AR5210
* AR5211
* AR5412
* AR5413
* AR5416
* AR9285
2014-04-30 02:03:13 +00:00
Ryan Stone
a998d4b50e Be consistent with the whitespace in the rest of these files.
X-MFC-With: r264007
2014-04-29 20:49:47 +00:00
Konstantin Belousov
d3f44b8d74 Fix two cases of recursive acquisitions of the vm object lock, only
possible in rare failure situations.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2014-04-29 19:02:34 +00:00
Marcel Moolenaar
67fb10f30c Add proto(4): A driver for prototyping and diagnostics.
It exposes I/O resources to user space, so that programs can peek
and poke at the hardware. It does not itself have knowledge about
the hardware device it attaches to.

Sponsored by:	Juniper Networks, Inc.
2014-04-28 17:58:40 +00:00
Adrian Chadd
a4e6347b86 Note that the AR5416 and later hardware supports the MYBEACON RX filter. 2014-04-27 23:37:03 +00:00
Adrian Chadd
dd7b232e39 * Add a new capability which returns whether the hardware supports
the MYBEACON RX filter (only receive beacons which match the BSSID)
  or all beacons on the current channel.

* Add the relevant RX filter entry for MYBEACON.

Tested:

* AR5416, STA
* AR9285, STA

TODO:

* once the code is in -HEAD, just make sure that the code which uses it
  correctly sets BEACON for pre-AR5416 chips.

Obtained from:	QCA, Linux ath9k
2014-04-27 23:36:44 +00:00
Adrian Chadd
ee6325ab56 Program the AR_TSFOOR_THRESHOLD register with a default lifted from
the QCA HAL.

This fires off an interrupt if the TSF from the AP / IBSS peer is
wildly out of range.  I'll add some code to the ath(4) driver soon
which makes use of this.

TODO:

* verify this didn't break TDMA!
2014-04-27 23:35:05 +00:00
Adrian Chadd
3e9b8fe01b Fix the AR_SLEEP1 and AR_SLEEP2 definitions. Oops!
Tested:

* AR9285, STA
* AR5416, STA

Obtained from:	QCA, Linux ath9k
2014-04-27 23:33:37 +00:00
Adrian Chadd
552c550628 Do a read-after-write to ensure the interrupt register update is flushed
to the hardware.

The QCA HAL has a comment noting that if this isn't done, modifications
to AR_IMR_S2 before AR_IMR is flushed may produce spurious interrupts.

Obtained from:	QCA
2014-04-27 23:31:42 +00:00
Nathan Whitehorn
43336b6385 No EFI on i386. This unbreaks the i386 VT kernel build. 2014-04-27 20:36:19 +00:00
Hans Petter Selasky
8237c62b5d Setting the IMOD value below 0x3F8 can cause IRQ lockups in the Intel
LynxPoint USB 3.0 controllers found in MacBookPro 2013's.

MFC after:	2 days
Tested by:	Huang Wen Hui <huanghwh@gmail.com>
2014-04-27 15:41:44 +00:00
Luiz Otavio O Souza
628a40b5c4 Fix the gpio-specifier decoding by respecting the GPIO controller's
#gpio-cells property.

Add a new ofw_bus method (OFW_BUS_MAP_GPIOS()) that allows the GPIO
controller to implement its own mapping to deal with gpio-specifiers,
allowing the decoding of gpio-specifiers to be controller specific.

The default ofw_bus_map_gpios() decodes the linux standard (#gpio-cells =
<2>) and the FreeBSD standard (#gpio-cells = <3>).

It pass the gpio-specifier flag field to the children as an ivar variable so
they can act upon.
2014-04-27 12:11:00 +00:00
Nathan Whitehorn
b2d52f78cf Increase the maximum framebuffer size to more reasonable values reflecting
the high-resolution boot consoles present on Open Firmware and EFI systems.
2014-04-27 02:20:51 +00:00
Nathan Whitehorn
7ff9cf1d06 Disable vga if EFI framebuffer present. vt(9) should handle this internally
based on efifb's higher priority, but it doesn't, and this at least lets
us build a kernel that boots on both BIOS and EFI systems for now.
2014-04-27 02:19:53 +00:00
Ian Lepore
49d0a4c3ff Reword a comment block a bit; no functional changes. 2014-04-26 20:27:58 +00:00
Ian Lepore
2d40ec16a8 Flesh out imx_uart_init() so that we're not relying on u-boot to init
the hardware (meaning uarts other than the console will work).
2014-04-26 20:03:04 +00:00
Andreas Tobler
269aedcff5 Fix gcc build, initialize off variable. 2014-04-26 19:30:04 +00:00
Ian Lepore
a90f19753f The freescale imx uart driver works for the whole i.MX family, so rename the
header file to not have "5xx" in the name.
2014-04-26 17:56:39 +00:00
Ian Lepore
a7fa939bb3 Stop calling imx51_ccm_foo() clock functions from imx6 code. Instead
define a few imx_ccm_foo() functions that are implemented by the imx51 or
imx6 ccm code.  Of course, the imx6 ccm code is still more a wish than
reality, so for now its implementations just return hard-coded numbers.
2014-04-26 16:48:09 +00:00
Kevin Lo
11a4d354a2 Initialize rssi variable. 2014-04-26 14:39:58 +00:00