Commit Graph

29045 Commits

Author SHA1 Message Date
Andrew Rybchenko
a411fe4e80 sfxge: remove obsolete Tx non-multi queue support
Tx multi queue is added in FreeBSD 8.0. So, the changeset drops earlier
versions support.

Sponsored by:   Solarflare Communications, Inc.
Differential Revision: https://reviews.freebsd.org/D2081
2015-03-23 15:47:37 +00:00
Andrew Rybchenko
1cc8febf4c sfxge: add barriers to BAR write macros
In theory the barriers are required to cope with write combining and
reordering. Two barriers are added (sometimes merged to one):
 1. Before the first write to guarantee that previous writes to the region
    have been done
 2. Before the last write to guarantee that write to the last dword/qword is
    done after previous writes
Barriers are inserted before in the assumption that it is better to
postpone barriers as much as it is possible (more chances that the
operation has already been already done and barrier does not stall CPU).

On x86 and amd64 bus space write barriers are just compiler memory barriers
which are definitely required.

Sponsored by:   Solarflare Communications, Inc.
Differential Revision: https://reviews.freebsd.org/D2077
2015-03-23 15:45:39 +00:00
Andrew Rybchenko
87581ab817 sfxge: assert either kernel or internal copy of interface flags
ioctl to put interface down sets ifp->if_flags which holds the intended
administratively defined state and calls driver callback to apply it.
When everything is done, driver updates internal copy of
interface flags sc->if_flags which holds the operational state.
So, transmit from Rx path is possible when interface is intended to be
administratively down in accordance with ifp->if_flags, but not applied
yet and the operational state is up in accordance with sc->if_flags.

Sponsored by:   Solarflare Communications, Inc.
Differential Revision: https://reviews.freebsd.org/D2075
2015-03-23 15:44:17 +00:00
Alexander Motin
6f954fb36b Remove MAXBSIZE use from drivers where it has nothing to do.
In some cases limits are just not needed, in others -- DFLTPHYS is the
right constant to use instead.

MFC after:	1 month
2015-03-22 16:10:28 +00:00
Hans Petter Selasky
85bad58226 The synchronisation value returned by the so-called feedback endpoint
appears to be too inaccurate that it can be used to synchronize the
playback data stream. If there is a recording endpoint associated with
the playback endpoint, use that instead. That means if the isochronous
OUT endpoint is asynchronus the USB audio driver will automatically
start recording, if possible, to get exact information about the
needed sample rate adjustments. In no recording endpoint is present,
no rate adaption will be done.

While at it fix an issue where the hardware buffer pointers don't get
reset at the first device PCM trigger.

Make some variables 32-bit to avoid problems with multithreading.

MFC after:	3 days
PR: 		198444
2015-03-21 09:45:45 +00:00
Luiz Otavio O Souza
d7eb38c008 Add a driver for the Dallas/Maxim DS1307, another common i2c RTC.
Many thanks to ian who gently provided me the DS1307 breakout board.

Tested on:		Raspberry pi
Differential Revision:	https://reviews.freebsd.org/D2022
Reviewed by:		rpaulo
2015-03-20 19:51:24 +00:00
Andrew Turner
6c85c62d00 Fix building ixgbe with gcc, it doesn't like nested extern declarations.
The fix is to move the extern declaration ix_crcstrip out of
ixgbe_setup_hw_rsc.
2015-03-19 13:00:02 +00:00
Jack F Vogel
bff38d637c Fix i386 LINT build issues, and remove unused variable. 2015-03-18 20:11:59 +00:00
Adrian Chadd
a1edda90b2 Fix ixgbe(4) to compile - with RSS; with ix+ixv in the kernel.
* Fix the multiple same-named devclasses; the duplicate name
  trips up the linker.

* Re-do the taskqueue stuff to use the new cpuset API, not the old
  pinned API.

* Add includes for the new location of the RSS configuration routines.

This allows ixgbe to compile as a module /and/ linked into the kernel,
along with RSS working.

Sponsored by:	Norse Corp, Inc.
2015-03-18 05:05:30 +00:00
Jack F Vogel
bc2e8d79c7 Resolve a few build issues, add module directories back into Makefile,
then correct a NETMAP problem resulting from the split, and finally
temporarily disable the X550 functionality.
2015-03-17 22:40:50 +00:00
Gleb Smirnoff
0ac23e997d Fix build.
Reviewed by:	dumbbell
2015-03-17 19:13:11 +00:00
Zbigniew Bodek
731a8268c5 Introduce Annapurna Labs AHCI support
Overview:
* implemented quirk for forcing SATA interface enable
* restore value to status register - this enables link autonegotiation

Modifications:
* devid:vendorid field
* quirk for forcing PI setting (BIOS is doing that on PC-like systems)
* write to capabilites field to enable phy link initialization

Submitted by:  Wojciech Macek <wma@semihalf.com>
Reviewed by:   imp, mav
Obtained from: Semihalf
2015-03-17 18:59:47 +00:00
Jean-Sébastien Pédron
455fa6518a drm: Update the device-independent code to match Linux 3.8.13
This update brings few features:
    o  Support for the setmaster/dropmaster ioctls. For instance, they
       are used to run multiple X servers simultaneously.
    o  Support for minor devices. The only user-visible change is a new
       entry in /dev/dri but it is useless at the moment. This is a
       first step to support render nodes [1].

The main benefit is to greatly reduce the diff with Linux (at the
expense of an unreadable commit diff). Hopefully, next upgrades will be
easier.

No updates were made to the drivers, beside adapting them to API
changes.

[1] https://en.wikipedia.org/wiki/Direct_Rendering_Manager#Render_nodes

Tested by:	Many people
MFC after:	1 month
Relnotes:	yes
2015-03-17 18:50:33 +00:00
Jack F Vogel
758cc3dcd5 Update to the Intel ixgbe driver:
- Split the driver into independent pf and vf loadables. This is
	  in preparation for SRIOV support which will be following shortly.
	  This also allows us to keep a seperate revision control over the
	  two parts, making for easier sustaining.
	- Make the TX/RX code a shared/seperated file, in the old code base
	  the ixv code would miss fixes that went into ixgbe, this model
	  will eliminate that problem.
	- The driver loadables will now match the device names, something that
	  has been requested for some time.
	- Rather than a modules/ixgbe there is now modules/ix and modules/ixv
	- It will also be possible to make your static kernel with only one
	  or the other for streamlined installs, or both.

Enjoy!

Submitted by: jfv and erj
2015-03-17 18:32:28 +00:00
Hans Petter Selasky
89c481cfd4 Remove no longer used allocation type.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
2015-03-17 11:07:59 +00:00
Hans Petter Selasky
5151af1dcb Use define instead of constant.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
2015-03-17 08:42:09 +00:00
Andrew Rybchenko
22ff426cc2 sfxge: increase default put-list limit to 1024
Drops are observed under multi-stream TCP traffic due to put-list
overflow with limit equal to 64.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-03-17 08:23:46 +00:00
Andrew Rybchenko
06824d2c88 sfxge: prefetch txq->common if TxQ is started only
Transmit may be called when TxQ is not started yet (i.e. txq->common is
invalid). TxQ state is checked below when mbuf is processed and dropped
if TxQ is not started.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-03-17 08:23:15 +00:00
Andrew Rybchenko
ebfb5f2546 sfxge: adding version info to device description
The information is required for NIC update and config tools.

Submitted by:   Artem V. Andreev <Artem.Andreev at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-03-17 08:21:31 +00:00
Andrew Rybchenko
95caaf0f54 sfxge: move deferred packet list statistics to dedicated node
It is done to structure sysctl and do not mix with Tx queue statistics
to be added.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-03-17 08:16:37 +00:00
Andrew Rybchenko
245d157651 sfxge: add tunables to control LRO parameters on driver load time
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-03-17 08:14:46 +00:00
John Baldwin
b12c0a9eeb Move special DDP handling for closing a connection into a new
handle_ddp_close() function in t4_ddp.c as the logic is similar
to handle_ddp_data().  This allows all knowledge of the special
DDP mbufs to be private to t4_ddp.c as well.
2015-03-16 15:56:06 +00:00
Konstantin Belousov
69a2ec4a19 Fix build with clang 3.6, silence -Wcast-qual warning.
Sponsored by:	The FreeBSD Foundation
Acked by:	adrian
2015-03-15 23:05:36 +00:00
Adrian Chadd
e2ad437112 Add a new taskqueue (device specific, not net80211 ic->tq); use it for
device restart.

(Committers note - once scan overhaul and a few other things have been
fixed in net80211 to not block things in the taskqueue, this can disappear
and the device specific taskqueues in other drivers can also go away.)

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:32:11 +00:00
Adrian Chadd
a5403e3157 Workaround delays caused by vmem_check().
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:30:20 +00:00
Adrian Chadd
2e79e29307 Fix scan timeouts with powersave enabled.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:29:36 +00:00
Adrian Chadd
fd06b53774 Don't unlock mutex in interrupt thread (except for wpi_rx_done() - for now) -
fixes various races between wpi_notif_intr() and wpi_stop_locked().

(attachment 154381)

Committers note: yes, unlock/if_input/lock has to go away, but that'll
have to be done later.

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:29:18 +00:00
Adrian Chadd
062c813943 Reformatting changes.
(attachment 154380)

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:27:50 +00:00
Adrian Chadd
b52207dbd2 Use correct types
(attachment 154379)

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:27:03 +00:00
Adrian Chadd
5effcbfd6c Add another lock for the TX path.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:26:22 +00:00
Adrian Chadd
fc5870b418 Add an extra mutex for qfullmsk / ring->queued variables.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:25:06 +00:00
Adrian Chadd
a6b6ca52c6 Regroup ring state checks in wpi_tx_done().
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:24:11 +00:00
Adrian Chadd
84ad7b3667 Don't use sc->qfullmsk in wpi_start().
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:23:45 +00:00
Adrian Chadd
d74e544a1d turn sc_tx_timeout into its own callout, rather than a global watchdog
timer.

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:22:03 +00:00
Adrian Chadd
446685e49c Add mutex for RXON structure; convert some callouts/lock use to use
RXON rather than the global WPI lock.

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:20:58 +00:00
Adrian Chadd
9e7aab73cd Use WPI_FILTER_BSS for checking current state.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:19:52 +00:00
Adrian Chadd
0bc39fc6f8 Split TX and scan timeouts; use a callout now for the scan timeout.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:19:15 +00:00
Adrian Chadd
726ddc2648 Add experimental HOSTAP support.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:18:18 +00:00
Adrian Chadd
8483c8c339 Merge wpi_start() and wpi_start_locked().
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:17:58 +00:00
Adrian Chadd
7d4ee533d4 Minor optimisation in wpi_limit_dwell()
PR:		kenr/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:17:03 +00:00
Adrian Chadd
cfe9b1ceb2 Rearrange checks in wpi_send_rxon().
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:12:57 +00:00
Adrian Chadd
cec45f0495 Fix some printfs(); add some debugging.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:12:05 +00:00
Adrian Chadd
39060fa992 Add more KASSERTs.
(Committer note: these checks will have to be re-established in a future
commit as /well/ as having the KASSERTs.)

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:11:00 +00:00
Adrian Chadd
0b90e84501 Disable powersave in IBSS mode (packet loss > 90%.)
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:09:29 +00:00
Adrian Chadd
e49a7038fc Do some cleanup before device startup.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:08:54 +00:00
Adrian Chadd
b9858d864a Acquire ifq lock when checking / modifying IFF_DRV_OACTIVE flag.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:08:24 +00:00
Adrian Chadd
77cf0b82c2 Merge wpi_init() and wpi_init_locked().
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:07:43 +00:00
Adrian Chadd
5ca7739522 Refactor wpi_ioctl().
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:06:36 +00:00
Adrian Chadd
0528191a1a Add WPI_DEBUG_NODE + some debugging.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:05:59 +00:00
Adrian Chadd
a6df6cfe65 * Add new debug category
* Refactor out / restructure / extend debugging information

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:04:55 +00:00
Adrian Chadd
32e4f2f7e9 Remove unrelated comment.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:03:48 +00:00
Adrian Chadd
419435b847 Remove unnecessary assignment.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:02:59 +00:00
Alexander Motin
61cefb9bcf Hide virtio features negotiation messages under bootverbose.
Those messages are noisy, but useless for average user.

MFC after:	2 weeks
2015-03-15 21:00:10 +00:00
Adrian Chadd
7b52621191 Remove unnecessary debug output.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:55:23 +00:00
Adrian Chadd
d29fcfb7c3 Add support for AES-CCMP group keys.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:54:40 +00:00
Adrian Chadd
735c606726 Encrypt frame if IEEE80211_BPF_CRYPTO is set.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:54:10 +00:00
Adrian Chadd
b56fed3da0 Use separate mutex for wv_bcbuf and wv_boff structures.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:53:46 +00:00
Adrian Chadd
d036bb20e3 Add prefixes to field names.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:52:47 +00:00
Adrian Chadd
6f8421f8a5 Use ieee80211_beacon_update() for dynamic beacon contents.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:51:56 +00:00
Adrian Chadd
21f6580ed8 Move beacon initialisation to wpi_init_beacon()
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:51:06 +00:00
Adrian Chadd
565248e2ad Use a static buffer in wpi_cmd - rather than alloc/free'ing the
beacon buffer frequently.

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:50:23 +00:00
Adrian Chadd
0b455e8fba Use WPI_RSSI_OFFSET instead of stat->noise (always 0 for me)
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:48:32 +00:00
Adrian Chadd
7e0d52321f Fix debug category in wpi_read_eeprom_band()
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:48:00 +00:00
Adrian Chadd
d138d3badc Move IBSS assocation processing to wpi_newassoc().
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:46:24 +00:00
Adrian Chadd
4eaf2ee348 wpi_tx_done() shouldn't wait for wpi_start().
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:45:43 +00:00
Adrian Chadd
7964dd56b7 Add node table lock - addresses LOR in wpi_node_free().
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:44:52 +00:00
Adrian Chadd
f736d89885 Optimise sc->rev processing.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:43:58 +00:00
Adrian Chadd
45ac43f30f Use ring->queued for WPI_CMD_TX_DATA only.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:43:22 +00:00
Adrian Chadd
10550f6135 Move some code under WPI_LOCK().
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:42:41 +00:00
Adrian Chadd
0b093122eb Remove unnecessary locking.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:41:57 +00:00
Adrian Chadd
ff62db1d9d Eliminate the WPI_FLAG_BUSY flag.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:40:59 +00:00
Adrian Chadd
63f576999e Add separate lock for TX queues.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:40:11 +00:00
Adrian Chadd
0ebca24555 Wrap node addition in STA mode into wpi_add_sta_node().
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:35:25 +00:00
Adrian Chadd
eca2eb395c Replace kernel unit allocator with local set of functions.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:34:26 +00:00
Adrian Chadd
f15520d9b0 Move key processing in wpi_tx_data.
(This is in preparation for further work to support hardware encryption.)

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:33:13 +00:00
Adrian Chadd
f319a41c66 Remove some un-needed variables.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:32:12 +00:00
Adrian Chadd
7167f5fc02 Reformatting - break lines ~ 80 characters.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:31:21 +00:00
Adrian Chadd
7f1299c5cd wpi_intr(): remove duplicate code
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:30:03 +00:00
Adrian Chadd
8e4cf38ac7 Replace few numbers with named constants.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:29:22 +00:00
Adrian Chadd
a5e093b0e0 Wrap cast to (struct wpi_node *) into WPI_NODE macros
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:23:58 +00:00
Adrian Chadd
76fdf7eb35 msleep() -> mtx_sleep()
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:22:16 +00:00
Adrian Chadd
cb0de40f2a Fix warning: Value stored to 'supportsa' is never read.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:21:30 +00:00
Adrian Chadd
96dadeb0aa Fix error handling in wpi_scan().
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:20:43 +00:00
Adrian Chadd
bb086d4e83 Fix indentation - non-functional change.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:19:54 +00:00
Adrian Chadd
ebf62e08fb Check some variables only on active TX rings
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:19:01 +00:00
Adrian Chadd
5f25a0e970 Use correct pointer for wpi_softc
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:18:09 +00:00
Adrian Chadd
01729242e5 Fix panics in wpi_tx_done() when powersave is enabled
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:17:25 +00:00
Adrian Chadd
71258eb207 Fix races between wpi_rx_done() and wpi_stop()
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:15:10 +00:00
Adrian Chadd
e336bd5499 Divide ackfailcnt by 2 (firmware decreases rate after two unsuccessful retries)
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:13:58 +00:00
Adrian Chadd
811fe0a8fb Run callout_reset() with mutex held.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:13:07 +00:00
Adrian Chadd
0c66281c5f Add missed ieee80211_draintask()
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:12:16 +00:00
Adrian Chadd
9facf2b90a Fix a typo (IEEE80211_S_SCAN -> IEEE80211_F_SCAN)
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:10:55 +00:00
Adrian Chadd
893edbea10 Fix mbuf mapping errors in wpi_cmd2() + add check for nsegs
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:09:47 +00:00
Ian Lepore
207e72288c Remove redundant sysctl_handle_string() calls, the sbuf auto-drain takes
care of that.

Reviewed by:	erj@
2015-03-15 17:39:38 +00:00
Ian Lepore
6ec9891291 Use sysctl_handle_string() and the sbuf printf routines instead of large
stack-allocated buffers and snprintf().

PR:		195668
2015-03-14 22:32:15 +00:00
Ian Lepore
8ddeeebf4b Use SYSCTL_OUT_STR() to return strings.
PR:		195668
2015-03-14 21:40:33 +00:00
Ian Lepore
1eafc07856 Set the SBUF_INCLUDENUL flag in sbuf_new_for_sysctl() so that sysctl
strings returned to userland include the nulterm byte.

Some uses of sbuf_new_for_sysctl() write binary data rather than strings;
clear the SBUF_INCLUDENUL flag after calling sbuf_new_for_sysctl() in
those cases.  (Note that the sbuf code still automatically adds a nulterm
byte in sbuf_finish(), but since it's not included in the length it won't
get copied to userland along with the binary data.)

Remove explicit adding of a nulterm byte in a couple places now that it
gets done automatically by the sbuf drain code.

PR:		195668
2015-03-14 17:08:28 +00:00
Ian Lepore
b36424bd4b Revert r279934, r279938; this is going to be fixed in sbuf instead.
PR:		195668
2015-03-14 13:04:39 +00:00
Ian Lepore
59daf5b0ce Revert r279933; this is going to be fixed in sbuf instead.
PR:		195668
2015-03-14 13:02:08 +00:00
Navdeep Parhar
070d262707 cxgbe(4): fix if_media handling for T520-BT cards. 1Gbps and 100Mbps
are valid for this card.

MFC after:	1 week
2015-03-14 00:02:53 +00:00
Alexander Motin
c21b342b8e Fix SATA Gen3 speed constants.
MFC after:	1 week
2015-03-13 20:08:35 +00:00
Adrian Chadd
036e1c7646 Commit 802.1q configuration support for the AR8327.
This is slightly different to the other switches - the VLAN table
(VTU) programs in the vlan port mapping /and/ the port config
(tagged, untagged, passthrough, any.)

So:

* Add VTU operations to program the VTU (vlan table)
* abstract out the mirror-disable function so it's .. well, a function.
* setup the port to have a dot1q configuration for dot1q - the
  port security is VLAN (not per-port VLAN) and requires an entry
  in the VLAN table;
* add set_dot1q / get_dot1q to program the VLAN table;
* since the tagged/untagged ports are now programmed into the VTU,
  rather than global - plumb the ports /and/ untagged ports bitmaps
  through the arswitch API.

Tested:

* AP135 - QCA9558 SoC + AR8327N switch
2015-03-13 02:16:39 +00:00
Pyun YongHyeon
ce18f7cde8 Restore auto MDIX for RTL8211B and newer revision PHYs which was
broken in r279903.

Reported by:	john <> feith . com
2015-03-13 01:16:14 +00:00
Ryan Stone
67e51766bd hwpmc: Fix event number to match enum name
Differential revision:	https://reviews.freebsd.org/D1592
Reviewed by:	Joseph Kong
MFC after:	1 month
2015-03-12 23:44:28 +00:00
Ian Lepore
2f01da7886 Fix a paste-o, sb is already a pointer in this one. 2015-03-12 23:31:29 +00:00
Ian Lepore
9bc58e3d33 Nullterminate strings returned via sysctl.
PR:		195668
2015-03-12 18:22:20 +00:00
Ian Lepore
0b9b8739c0 Nullterminate strings returned via sysctl.
PR:		195668
2015-03-12 18:09:39 +00:00
Jason A. Harmening
edf3c81a5c Using parent DMA tag in drm_pci_alloc(). This can allow drm2 devices to work with Intel DMAR enabled for the system, as long as DMAR is disabled for the drm2 device.
Approved by:	kib (mentor)
MFC after:	1 week
2015-03-12 14:18:36 +00:00
Pyun YongHyeon
72200a8ab5 Add RTL8211F gigabit PHY support.
PR:	197265
MFC after:	2 weeks
2015-03-12 07:05:28 +00:00
Randall Stewart
de8d8ca4c8 You need to have the capabilities and not skip it if you are
not on head.. otherwise the file pointer will be NULL and when
you try to do something with it you will crash. Make the #else
be the old capabilites, and then remove the erroneous ifdefs for
11.

MFC after:	1 week (with the other MFC I was going to do until the panic)
2015-03-11 20:15:49 +00:00
John Baldwin
69a088631e Resize receive socket buffers that support autosizing when receiving
TCP data via direct data placement.

Sponsored by:	Chelsio
MFC after:	1 week
2015-03-11 17:35:07 +00:00
Ryan Stone
1c229658b9 Fix SR-IOV passthrough devices to allow ppt to attach
A late change to the SR-IOV infrastructure broke passthrough of
VFs.  device_set_devclass() was being used to try to force the
ppt driver to attach to the device, but this didn't work because
the DF_FIXEDCLASS flag wasn't being set on the device, so the
ppt driver probe routine would not match when it returned
BUS_NOWILDCARD.  Fix this by adding a new device function that
both sets the devclass and sets the DF_FIXEDCLASS flag, and use
that to force the ppt driver to attach to VFs.

Differential Revision: https://reviews.freebsd.org/D2041
Reviewed by:	jhb
MFC after:	3 weeks
2015-03-10 23:27:13 +00:00
Jack F Vogel
31830672a6 Replace the DEV_NETMAP code that accidentally got removed in the
last commit.

MFC after: 1 week
2015-03-10 19:55:43 +00:00
Jack F Vogel
56c2c47b64 This delta introduces SRIOV support, thanks to Ryan Stone of Sandvine for
adding this major feature to the driver. Secondly, this updates the base
driver with new 20G device support, and with the new firmware levels some
changes to link handling and initialization were required.

MFC after: 1 week
2015-03-10 19:17:40 +00:00
Nathan Whitehorn
25023a8a88 Let unchangeable 8-bit frame buffers have vaguely correct colors.
MFC after:	2 weeks
2015-03-10 17:04:11 +00:00
Hans Petter Selasky
996f8471b1 Lock softc before clearing bits.
Found by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after:	1 week
2015-03-10 16:06:07 +00:00
Luiz Otavio O Souza
4a5fa7b2e3 Fix off-by-one bugs.
Spotted by:	rpaulo (on another review)
2015-03-10 14:55:05 +00:00
Ryan Stone
1761699194 Add missing counter definitions
Differential Revision:	https://reviews.freebsd.org/D1591
MFC after:	1 month
Sponsored by:	Sandvine Inc
2015-03-10 01:24:16 +00:00
Ryan Stone
bc0ad9a99d Fix Ivy Bridge+ MEM_UOPS_RETIRED counters
The MEM_UOPS_RETIRED actually work the same way as the Sandy
Bridge counters, but the counters were documented in a different
way and that seemed to cause the Ivy Bridge counters to be
implemented incorrectly.  Use the same counter definitions as
Sandy Bridge.  While I'm here, rename the counters to match
what's documented in the datasheet.

Differential Revision:	https://reviews.freebsd.org/D1590
MFC after:	1 month
Sponsored by:	Sandvine Inc.
2015-03-10 01:24:08 +00:00
Ryan Stone
e31c323f95 Support architectural events on Haswell/Ivy Bridge
Differential Revision:	https://reviews.freebsd.org/D1589
MFC after:	1 month
Sponsored by:	Sandvine Inc
2015-03-10 01:24:02 +00:00
Ryan Stone
9e60f3acd2 Fix Sandy Bridge+ hwpmc branch counters
On Sandy Bridge and later, to count branch-related events you
have to or together a mask indicating the type of branch
instruction to count (e.g. direct jump, branch, etc) and a bits
indicating whether to count taken and not-taken branches.  The
current counter definitions where defining this bits individually,
so the counters never worked and always just counted 0.

Fix the counter definitions to instead contain the proper
combination of masks.  Also update the man pages to reflect the
new counters.

Differential Revision:	https://reviews.freebsd.org/D1587
MFC after:	1 month
Sponsored by:	Sandvine Inc.
2015-03-10 01:23:47 +00:00
Ryan Stone
89d0633b86 Fix pmc unit restrictions to match documentation
A couple of pmc counters did not work because there were being
restricted to the wrong PMC unit.  I've verified that these
counters now work and match the documented restrictions.

Differential Revision:	https://reviews.freebsd.org/D1586
MFC after:	1 month
Sponsored by:	Sandvine Inc
2015-03-10 01:23:40 +00:00
Ryan Stone
d444c14119 Fix various bugs in Haswell counter definitions
1) The "WALK_COMPLETED_2M_4M" event incorrectly referenced 4K pages.
2) The umask for RING0 and RING123 events was reversed.

Differential Revision:	https://reviews.freebsd.org/D1585
MFC after:	1 month
Sponsored by:	Sandvine Inc
2015-03-10 01:23:34 +00:00
Ian Lepore
023911aa01 Use the new ifnet API. Also, allocate bus_dma_maps as needed instead of
pre-allocating them all at start-up.  Also fix a bug in cgem_stop(); before,
it wasn't properly unloading dma maps due to a cut-and-paste error.
2015-03-09 22:39:58 +00:00
Xin LI
394e3bd088 Fix CARP when in use in a HyperV environment:
- Bump link state when stopping or starting the interface;
 - Don't handle SIOCGIFADDR specially, similar to r277103.

This change is based on a previous revision from Andy Zhang
(Microsoft) who did the diagnostic work and many thanks to
them for their help in supporting the HyperV work.

PR:		kern/187203
MFC after:	2 weeks
2015-03-09 20:11:16 +00:00
Marcelo Araujo
53f7fd617c Fix style(9) from my previous commit r279803.
Spotted by:	kevlo
2015-03-09 10:29:15 +00:00
Marcelo Araujo
18733a0b76 Now ifconfig(8) can set the media option as 10Gbase-T for ixgbe(4).
Differential Revision:	D823
Reviewed by:	jfvogel
Approved by:	jfvogel
Sponsored by:	QNAP Systems Inc.
2015-03-09 08:43:27 +00:00
Marcelo Araujo
df634d45d3 Fix the media detected for copper cables NIC based on chipset X540T.
Phabric:        D811
Reviewed by:    jfvogel
Approved by:	jfvogel
Sponsored by:   QNAP Systems Inc.
2015-03-09 08:22:11 +00:00
Adrian Chadd
f35f94f4fd Methodise a couple more of the VLAN methods. 2015-03-08 23:02:15 +00:00
Adrian Chadd
749cac133f Add per-port vlan support for the AR8327.
All the per-port support is really doing is applying a port visibility
mask to each of the switchports.  Everything still look like a single
portgroup (vlan id 1), but the per-port visibility mask is modified.

Whilst I'm here, also add some initial dot1q support - the pvid stuff
is doing the right thing, but it's not useful without the rest of
the VLAN table programming.

It's enough for me to be able to use the LAN/WAN port distinction
on the AP135, where there isn't (for now!) a dedicated PHY for the
"WAN" port.

Tested:

* AP135, QCA9558 SoC + AR8327 switch
2015-03-08 21:59:03 +00:00
Pedro F. Giffuni
049855d88f bge(4): Small memory leak
CID:		1229985
Reviewed by:	marcel
Differential Review:	https://reviews.freebsd.org/D2024
2015-03-08 19:55:46 +00:00
Andrew Turner
8f3ad0f84e Add support for enabling the USB on the Raspberry Pi boards when it hasn't
been done by U-Boot. This allows the USB to work when we load the kernel
directly.

No dma sync is performed after these operations as the data we read/write
is not used by the cpu after the calls to the maimbox driver.

Differential Revision:	https://reviews.freebsd.org/D1940
Reviewed by:	imp, Michal Meloun (meloun AT miracle.cz)
MFC after:	1 Week
Sponsored by:	ABT Systems Ltd
2015-03-08 13:52:07 +00:00
Hans Petter Selasky
efccd9f054 Switch polarity of PPS events.
PR:		196897
Submitted by:	ian @
MFC after:	1 week
2015-03-08 08:34:49 +00:00
Adrian Chadd
78549b94cd Fix up support for the AR8327.
* Even though I got the registers around "right", it seems
  I'm not tickling the MDIO access correctly for the internal PHY
  bus.  Some of the switches are fine poking at the external PHY
  registers; others aren't.  So, enable direct PHY bus access
  for the AR8327, and leave the existing code in place for the
  others.

* Go and shuffle the register access around.  Whilst here,
  restore the 2ms delay if changing page.

* Comment out some of the stub printf()s; there's some upcoming
  work to add port VLAN support.

Tested:

* AP135 development board
* Carambola2 - AR9331 SoC
2015-03-08 03:53:36 +00:00
Adrian Chadd
8a28176add Undo some issues from the previous big patch - there's no padding on RX,
so remove DATAPAD and re-do the padding in the TX path manually.

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-08 01:47:10 +00:00
Adrian Chadd
3de934a7a4 Use the correct mac addresses when initialising things.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3rios@gmail.com>
2015-03-08 01:44:57 +00:00
Luiz Otavio O Souza
d752f0f69d Add a new ioctl to allow the setting of GPIO pin names.
When a gpiobus child is added, use its name to identify the mapped pin
names.

Make the respective changes to libgpio.

Add a new '-n' flag to gpioctl(8) to set the pin name.

Differential Revision:	https://reviews.freebsd.org/D2002
Reviewed by:	rpaulo
Requested by:	many
2015-03-08 00:47:50 +00:00
Hans Petter Selasky
ef826045f8 Use correct mode variable for PPS support.
PR:		196897
Submitted by:	ian @
MFC after:	1 week
2015-03-07 22:46:35 +00:00
Hans Petter Selasky
61948b2577 Allow the UDL screen refresh rate to be runtime configurable through a
sysctl. Increase the default frame rate to 25 FPS. Add a comment about
memory constraints.
2015-03-07 20:49:32 +00:00
Hans Petter Selasky
a985ae9b4a Add support for USB display link adapters to the FB and VT drivers.
The vtophys() function is used to get the physical page address for
the virtually allocated frame buffers when a physically continuous
memory area is not available. This change also allows removing the
masking of the FB_FLAG_NOMMAP flag in the PS3 syscons driver.

The FB and VT drivers were tested using X.org/xf86-video-scfb and
syscons.
2015-03-07 20:45:15 +00:00
Hans Petter Selasky
bb057644cf Add PPS support to USB serial drivers.
Bump kernel version to reflect structure change.

PR:		196897
MFC after:	1 week
2015-03-07 18:25:58 +00:00
Hans Petter Selasky
68492bc279 Add more USB IDs.
PR:		197753
MFC after:	1 week
2015-03-07 17:11:07 +00:00
Ian Lepore
3bb693af87 Move the uart_class definitions and fdt compat data into the individual
uart implementations, and export them using the new linker-set mechanism.

Differential Revision:	https://reviews.freebsd.org/D1993
Submitted by:	Michal Meloun
2015-03-07 15:24:15 +00:00
Ian Lepore
bd69e3ad2f Define new linker set, UART_FDT_CLASS_AND_DEVICE, for registering full
(class and device) FDT UART. Define second one, UART_FDT_CLASS, for UART
class only.

This paves the way for declaring uart_class data and ofw/fdt compat data
with a uart implementation, rather than needing a big global table of
compat data and weak-symbol declarations of every existing implementation.

Differential Revision:	https://reviews.freebsd.org/D1992
Submitted by:	Michal Meloun
2015-03-07 15:18:57 +00:00
John Baldwin
15ae88baaa Fix a typo. 2015-03-06 20:53:56 +00:00
Navdeep Parhar
08aeb15136 cxgbe(4): experimental rx packet sink for netmap queues. This is not
intended for general use.

MFC after:	1 month
2015-03-06 20:41:28 +00:00
Navdeep Parhar
1cdfce07df cxgbe(4): knobs to experiment with the interrupt coalescing timer for
netmap rx queues, and the "batchiness" of rx updates sent to the chip.

These knobs will probably become per-rxq in the near future and will be
documented only after their final form is decided.

MFC after:	1 month
2015-03-06 20:39:19 +00:00
Stephen McConnell
b256e37b8e This setting of stop_at_shutdown should have been removed with r279253
Approved by:	ken
MFC after:	1 week
2015-03-06 16:17:08 +00:00
Navdeep Parhar
7f93d696bf cxgbe(4): provide the correct size of freelists associated with netmap
rx queues to the chip.  This will fix many problems with native netmap
rx on ncxl/ncxgbe interfaces.

MFC after:	1 week
2015-03-06 16:05:20 +00:00
Alexander Motin
dc2e31d4db Size of opt_io_size field is 32 bit.
MFC after:	2 weeks
2015-03-05 10:29:46 +00:00
Alexander Motin
d8e32bb64e Reenable VIRTIO_BLK_F_TOPOLOGY feature.
MFC after:	2 weeks
2015-03-05 09:51:59 +00:00
Luiz Otavio O Souza
6153d46515 Use the child device name here is lame because at the point that this
happens, the child device is not yet specified.
2015-03-05 03:11:47 +00:00
Luiz Otavio O Souza
6ad7f49152 Change ofw_gpiobus_destroy_devinfo() to unmap the GPIO pins and then
rework the code a little bit to use this function consistently to cleanup
all the changes made as part of the probe phase.

This fixes an issue where a FDT child node without a matching driver could
leave the GPIO pins mapped and prevent the further use of them.
2015-03-05 02:54:30 +00:00
Luiz Otavio O Souza
9fe03b8c0a Add a bus_probe_nomatch() method for gpiobus/ofw_gpiobus.
This prints a warning when your system have a hinted child or a FDT child
node for which you don't have a matching driver:

gpiobus0: <unknown device> at pin(s) 24 irq 24
2015-03-05 01:49:58 +00:00
Jean-Sébastien Pédron
bc346eefbd drm: Import Linux commit b7ea85a4fed37835eec78a7be3039c8dc22b8178
Author: Huacai Chen <chenhc@lemote.com>
Date:   Tue May 21 06:23:43 2013 +0000

    drm: fix a use-after-free when GPU acceleration disabled

    When GPU acceleration is disabled, drm_vblank_cleanup() will free the
    vblank-related data, such as vblank_refcount, vblank_inmodeset, etc.
    But we found that drm_vblank_post_modeset() may be called after the
    cleanup, which use vblank_refcount and vblank_inmodeset. And this will
    cause a kernel panic.

    Fix this by return immediately if dev->num_crtcs is zero. This is the
    same thing that drm_vblank_pre_modeset() does.

    Call trace of a drm_vblank_post_modeset() after drm_vblank_cleanup():
    [   62.628906] [<ffffffff804868d0>] drm_vblank_post_modeset+0x34/0xb4
    [   62.628906] [<ffffffff804c7008>] atombios_crtc_dpms+0xb4/0x174
    [   62.628906] [<ffffffff804c70e0>] atombios_crtc_commit+0x18/0x38
    [   62.628906] [<ffffffff8047f038>] drm_crtc_helper_set_mode+0x304/0x3cc
    [   62.628906] [<ffffffff8047f92c>] drm_crtc_helper_set_config+0x6d8/0x988
    [   62.628906] [<ffffffff8047dd40>] drm_fb_helper_set_par+0x94/0x104
    [   62.628906] [<ffffffff80439d14>] fbcon_init+0x424/0x57c
    [   62.628906] [<ffffffff8046a638>] visual_init+0xb8/0x118
    [   62.628906] [<ffffffff8046b9f8>] take_over_console+0x238/0x384
    [   62.628906] [<ffffffff80436df8>] fbcon_takeover+0x7c/0xdc
    [   62.628906] [<ffffffff8024fa20>] notifier_call_chain+0x44/0x94
    [   62.628906] [<ffffffff8024fcbc>] __blocking_notifier_call_chain+0x48/0x68
    [   62.628906] [<ffffffff8042d990>] register_framebuffer+0x228/0x260
    [   62.628906] [<ffffffff8047e010>] drm_fb_helper_single_fb_probe+0x260/0x314
    [   62.628906] [<ffffffff8047e2c4>] drm_fb_helper_initial_config+0x200/0x234
    [   62.628906] [<ffffffff804e5560>] radeon_fbdev_init+0xd4/0xf4
    [   62.628906] [<ffffffff804e0e08>] radeon_modeset_init+0x9bc/0xa18
    [   62.628906] [<ffffffff804bfc14>] radeon_driver_load_kms+0xdc/0x12c
    [   62.628906] [<ffffffff8048b548>] drm_get_pci_dev+0x148/0x238
    [   62.628906] [<ffffffff80423564>] local_pci_probe+0x5c/0xd0
    [   62.628906] [<ffffffff80241ac4>] work_for_cpu_fn+0x1c/0x30
    [   62.628906] [<ffffffff802427c8>] process_one_work+0x274/0x3bc
    [   62.628906] [<ffffffff80242934>] process_scheduled_works+0x24/0x44
    [   62.628906] [<ffffffff8024515c>] worker_thread+0x31c/0x3f4
    [   62.628906] [<ffffffff802497a8>] kthread+0x88/0x90
    [   62.628906] [<ffffffff80206794>] kernel_thread_helper+0x10/0x18

    Signed-off-by: Huacai Chen <chenhc@lemote.com>
    Signed-off-by: Binbin Zhou <zhoubb@lemote.com>
    Cc: <stable@vger.kernel.org>
    Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
    Acked-by: Paul Menzel <paulepanter@users.sourceforge.net>
    Signed-off-by: Dave Airlie <airlied@gmail.com>

Reported by:	J.R. Oldroyd <fbsd@opal.com>
MFC after:	2 weeks
2015-03-04 20:43:46 +00:00
Ed Maste
4e56f96440 Update ThunderX SATA quirk
Add quirk to ThunderX AHCI forcing only 1 MSI-X interrupt.
  Shorten Thunder quirk description to avoid printing 'SATA' twice.

Obtained from:	Semihalf
Sponsored by:	The FreeBSD Foundation
2015-03-04 02:17:36 +00:00
Luiz Otavio O Souza
10defbbd80 Sort and remove unnecessary headers. 2015-03-03 17:20:19 +00:00
Hans Petter Selasky
0c31a8b000 Add quirk for USB 3.0 controllers which don't support 64-bit DMA.
MFC after:	3 days
Submitted by:	Gary Jennejohn <gljennjohn@gmail.com>
2015-03-03 10:21:54 +00:00
Andrew Turner
83724a87a4 Fix the pl011 driver to work when the uart will write in zero cycles. This
is the case, depending on the options, in some of the ARM hardware
simulators. In these cases we don't get an interrupt so will need to
schedule the task to write more data to the uart.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2015-03-03 09:48:19 +00:00
Kevin Lo
429b844ba6 Check the return value of config_intrhook_establish(). 2015-03-03 02:08:17 +00:00
Luiz Otavio O Souza
da3b488d62 Move duplicate code to a new public function.
This new function can be used by other drivers to reserve the use of GPIO
pins.

Anyway, the use of ofw_gpiobus_parse_gpios() is preferred when possible.

Requested by:	Michal Meloun
2015-03-02 22:28:47 +00:00
Hans Petter Selasky
2ac11c1199 Add quirk to disable 64-bit XHCI DMA after r276717.
Requested by:	Gary Jennejohn <gljennjohn@gmail.com>
MFC after:	3 days
2015-03-02 20:42:06 +00:00
Adrian Chadd
0d327de13d Lay some groundwork for having this stuff hang off of AHB rather than
the CPU nexus.

* Add ahb as a possible bus attachment
* Lay a comment down to remind me or whoever else ends up trying
  to debug why the EEPROM isn't mapped in as to what's going on.
2015-03-02 02:14:44 +00:00
Warner Losh
be2c6c0dbd Don't leak 'used' in a few error cases.
Reported by: Maxime Villard
2015-03-01 21:41:35 +00:00
Warner Losh
679f3f62a8 Unlock the main lock before returning rather than after to eliminate
dead code that shouldn't have been dead.

Reported by: Maxime Villard
2015-03-01 21:41:33 +00:00
Jean-Sébastien Pédron
3d7f3c9d52 Record the dependency to x86bios in vga_pci
This fixes the build of XEN and XBOX kernels on i386, which was broken
in r279487.

While here, do not build vga_pci_repost() on PC98.

Reported by:	bz@
2015-03-01 20:54:29 +00:00
Adrian Chadd
db37238f70 AR8327: Disable energy-efficient ethernet support in the PHYs.
I noticed that openwrt/linux does this, citing "instability", so
until they figure out why I'm going to disable it here as well.

Tested:

* QCA AP135 - QCA955x SoC + AR8327 switch.
2015-03-01 20:32:35 +00:00
Adrian Chadd
7190a55c3e Bump the port mask on the AR8327 ethernet switch from 0x3f to 0x7f.
So, it turns out that the AR8327 has 7 ports internally:

* GMAC0 / external (CPU) MAC0
* GMAC1 / port1 -> GMAC5 / port5: external switch port PHYs
* GMAC6 / external (CPU) MAC1

Now, depending upon how things are wired up, the second CPU port (MAC1)
can be wired to either the switch (port6), or through port5's PHY, bypassing
the GMAC+switch entirely.  Ie, it can pretend to be a boring PHY, saving
system designers from having to include a separate PHY for a "WAN" port.

Here's the rub - the AP135 board (QCA955x SoC) hooks up arge0 to
the second CPU port on the AR8327, but it's hooked up as RGMII.
So, in order to hook it up to the rest of the switch, it isn't configured
as a separate PHY - OpenWRT has it setup as connected via RGMII to
GMAC6 and (I'm guessing) it's set to be a WAN port by configuring up
port-based VLANs or something.

Thus, with a port mask of 0x3f, GMAC6 was never allowed to receive traffic
from any other port.  It could transmit fine, but not receive anything.

So, now it works enough for me to continue doing board bootstrapping.
Note, this isn't enough to make the QCA955x + AR8327 work - there's
a bunch of uncommitted work to both the platform SoC (interrupt handling,
ethernet, etc) and the ethernet switch (register access space, setup, etc)
that needs to happen.  However, this particular change is also relevant to
other SoCs, like the AR934x and AR7161, both of which can be glued to
this switch.

Tested:

* AP135 development board

TODO:

* Figure out whether I can somehow abuse another port mode to have this
  be a pass-through PHY, or whether I should just create some more boot
  time hints to explicitly set up port-based isolation so this works
  in a more useful way by default.
2015-03-01 20:22:28 +00:00
Jean-Sébastien Pédron
76e2f97656 vt(4): Add support to "downgrade" from eg. vt_fb to vt_vga
The main purpose of this feature is to be able to unload a KMS driver.

When going back from the current vt(4) backend to the previous backend,
the previous backend is reinitialized with the special VDF_DOWNGRADE
flag set. Then the current driver is terminated with the new "vd_fini"
callback.

In the case of vt_fb and vt_vga, this allows the former to pass the
vgapci device vt_fb used to vt_vga so the device can be rePOSTed.

Differential Revision:	https://reviews.freebsd.org/D687
2015-03-01 12:54:22 +00:00
Jean-Sébastien Pédron
be440d689d vgapci: New vga_pci_repost() function
This can be used to restore the VGA mode after a KMS driver is unloaded.

Differential Revision:	https://reviews.freebsd.org/D687
2015-03-01 12:47:36 +00:00
Ryan Stone
bdc48af264 Validate the schema that the PF driver passed to us
Differential Revision:	https://reviews.freebsd.org/D90
Reviewed by:		emaste
MFC after: 		1 month
Sponsored by:		Sandvine Inc.
2015-03-01 00:59:28 +00:00
Ryan Stone
5cc26e6342 Pass SR-IOV configuration to kernel using an nvlist
Pass all SR-IOV configuration to the kernel using an nvlist.  The
main benefit that this offers is flexibility.  It allows a driver
to accept any number of parameters of any type supported by the
SR-IOV configuration infrastructure with having to make any
changes outside of the driver.

It also offers the user very fine-grained control over the
configuration of the VFs -- if they want, they can have different
configuration applied to every VF.

Differential Revision:	https://reviews.freebsd.org/D82
Reviewed by:		jhb
MFC after: 		1 month
Sponsored by:		Sandvine Inc.
2015-03-01 00:40:57 +00:00
Ryan Stone
3c22f2153c Add function to validate the consistency of SR-IOV config
Add a function that validates that the user-provided SR-IOV
configuration is valid.  This includes basic checks that the
structure of the configuration is correct (e.g. all required
configuration nodes are present) as well as validating against
a configuration schema.

The schema validation consists of:
 - Ensuring that all required config parameters are present.
 - If the schema defines a default value for a parameter,
   adding the default value if the parameter is not set.
 - Ensuring that no parameters are specified in the config
   that are not defined in the schema.
 - Ensuring that have the correct type defined in the schema.
 - Ensuring that no configuration nodes are present for devices
   that do not exist.  For example, if 2 VFs are configured,
   then we validate that a node called VF-5 does not exist.

Differential Revision:	https://reviews.freebsd.org/D81
Reviewed by:		jhb
MFC after: 		1 month
Sponsored by:		Sandvine Inc.
2015-03-01 00:40:51 +00:00
Ryan Stone
1191f7156f Add infrastructure for exporting config schema from PF drivers
Differential Revision:	https://reviews.freebsd.org/D80
MFC after: 		1 month
Sponsored by:		Sandvine Inc.
2015-03-01 00:40:42 +00:00
Ryan Stone
6c3162c4df Add interface to destroy SR-IOV VFs
Differential Revision:	https://reviews.freebsd.org/D79
Reviewed by:		jhb
MFC after: 		1 month
Sponsored by:		Sandvine Inc.
2015-03-01 00:40:34 +00:00
Ryan Stone
e9309eac19 Allocate PCI I/O memory spaces for VFs
When creating VFs, we must size each SR-IOV BAR on the PF and
allocate a configuous I/O memory window large enough for every VF.
However, the window only needs to be aligned to a boundary equal
to the size of the window for a single VF.

When a VF attempts to allocate an I/O memory resource, we must
intercept the request in the pci driver and pass it off to the
SR-IOV code, which will allocate the correct window from the
pre-allocated memory space for the PF.

Inform the pci driver about the size and address of the BARs on
the VF when the VF is created.  This is required by pciconf -b and
bhyve.

Differential Revision:	https://reviews.freebsd.org/D78
Reviewed by:		jhb
MFC after: 		1 month
Sponsored by:		Sandvine Inc.
2015-03-01 00:40:26 +00:00
Ryan Stone
5060ec97d4 Emulate the Device ID and Vendor ID registers for VFs
The SR-IOV standard requires VFs to read all-ones when the VID
and DID registers are read.  The VMM (hypervisor) is required to
emulate them instead.  Make pci_read_config() do this emulation.

Change pci_user.c to use pci_read_config() to read config space
registers instead of going directly to the pcib so that the
emulated VID/DID registers work correctly on VFs.  This is
required both for pciconf and bhyve PCI passthrough.

Differential Revision:	https://reviews.freebsd.org/D77
Reviewed by:		jhb
MFC after: 		1 month
Sponsored by:		Sandvine Inc.
2015-03-01 00:40:19 +00:00
Ryan Stone
9bfb1e36d9 Implement interface to create SR-IOV Virtual Functions
Implement the interace to create SR-IOV Virtual Functions (VFs).
When a driver registers that they support SR-IOV by calling
pci_setup_iov(), the SR-IOV code creates a new node in /dev/iov
for that device.  An ioctl can be invoked on that device to
create VFs and have the driver initialize them.

At this point, allocating memory I/O windows (BARs) is not
supported.

Differential Revision:	https://reviews.freebsd.org/D76
Reviewed by:		jhb
MFC after: 		1 month
Sponsored by:		Sandvine Inc.
2015-03-01 00:40:09 +00:00
Ryan Stone
2397d2d817 Add some pcib methods to get ARI-related information
Differential Revision:	https://reviews.freebsd.org/D72
Reviewed by:		jhb
MFC after: 		1 month
Sponsored by:		Sandvine Inc.
2015-03-01 00:39:40 +00:00
Ryan Stone
5ce88dc6da Refactor PCI resource allocation
Refactor PCI resource allocation code to allow a request for a
memory-mapped I/O window that is a multiple of a requested size.
This is needed by the SR-IOV code because the VF BARs are all
allocated contiguously.  We can't just allocate a resource that is
a multiple of a single VF BAR because the size of an allocation
implies its alignment requirement.

Differential Revision:	https://reviews.freebsd.org/D71
Reviewed by:		jhb
MFC after: 		1 month
Sponsored by:		Sandvine Inc.
2015-03-01 00:39:33 +00:00
Ryan Stone
2f5055a9b0 Refactor PCI device creation
Refactor creation of PCI devices into helper methods that can be
used by the VF creation code.

Differential Revision:	https://reviews.freebsd.org/D67
Reviewed by:		jhb
MFC after: 		1 month
Sponsored by:		Sandvine Inc.
2015-03-01 00:39:26 +00:00
Adrian Chadd
0f3ec57676 Add another register definition for the AR8327.
Obtained from:	OpenWRT
2015-02-28 23:59:29 +00:00
Ryan Stone
ce6682d990 Add a missing include of an options header.
watchdog.c does an #ifdef DDB but does not #include "opt_ddb.h".
Fixing this turned up a missing include file.

MFC after:	1 week
X-MFC-With:	r261495, r279410
2015-02-28 22:37:48 +00:00
Enji Cooper
c14bdeb07e Unbreak 'make depend' with sfxge by removing debugging code activated in the
INET || INET6 case

X-MFC with: r279398
Pointyhat to: arybchik
2015-02-28 21:50:04 +00:00
Luiz Otavio O Souza
e8da3e8aaf Add ofw_gpiobus_parse_gpios(), a new public function, to parse the gpios
property for devices that doesn't descend directly from gpiobus.

The parser supports multiple pins, different GPIO controllers and can use
arbitrary names for the property (to match the many linux variants:
cd-gpios, power-gpios, wp-gpios, etc.).

Pass the driver name on ofw_gpiobus_add_fdt_child().  Update gpioled to
match.

An usage example of ofw_gpiobus_parse_gpios() will follow soon.
2015-02-28 21:01:01 +00:00
Luiz Otavio O Souza
5019630122 Rename and move gpiobus_alloc_ivars() and gpiobus_free_ivars() so they can
be used on non FDT systems.

This prevents access to uninitialized memory on drivers that try to access
pin flags on non FDT systems.
2015-02-28 20:02:41 +00:00
Luiz Otavio O Souza
befcc3e26b Add a driver for the Maxim DS3231 a low-cost, extremely accurate (+-2PPM)
I2C real-time clock (RTC).

The DS3231 has an integrated temperature-compensated crystal oscillator
(TXCO) and crystal.

DS3231 has a temperature sensor, an independent 32kHz output (which can be
turned on and off by the driver) and another output that can be used as
interrupt for alarms or as a second square-wave output, which frequency and
operation mode can be set by driver sysctl(8) knobs.

Differential Revision:	https://reviews.freebsd.org/D1016
Reviewed by:	ian, rpaulo
Tested on:	Raspberry pi model B
2015-02-28 19:02:44 +00:00
Andrew Rybchenko
18daa0ee9a sfxge: compile out LRO if kernel is compiled without IPv4 and IPv6
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-28 19:01:43 +00:00
Roger Pau Monné
691a22f94e netback: disable GSO
The current GSO implementation in netback is broken and causes errors on the
guest tx path. While this is fixed disable GSO in order to have a working
netback.

Sponsored by: Citrix Systems R&D
Discussed with: gibbs
2015-02-28 15:21:06 +00:00
Enji Cooper
74c1c91c47 Pad RX copy alignment calculation to avoid illegal memory accesses
The optimization made in r239940 is valid for struct mbuf's current structure
and size in FreeBSD, but hardcodes assumptions about sizes of struct mbuf,
which are unfortunately broken if additional data is added to the beginning of
struct mbuf

X-MFC note (discussed with rwatson):

This change requires the MPKTHSIZE definition, which is only available after
head@r277203 and will not be MFCed as it breaks mbuf(9) KPI.

A direct commit to stable/10 and merges to other branches to add the necessary
definitions to work with the code as-is will be done to facilitate this MFC

PR: 194314
MFC after: 2 weeks
Approved/Reviewed by: erj, jfv
Sponsored by: EMC / Isilon Storage Division
2015-02-28 14:57:57 +00:00
Jayachandran C.
2cc1ad9c56 Allow creating subclass of FDT simplebus
Provide sys/dev/fdt/simplebus.h with the class declaration so that it
is possible to subclass FDT simplebus.

Differential Revision:	https://reviews.freebsd.org/D1886
Reviewed by:	nwhitehorn, imp
2015-02-27 20:11:02 +00:00
Gleb Smirnoff
c2d9c6f035 Use m_getjcl() instead of old mbuf(9) KPIs.
Tested by:	royger
2015-02-27 19:12:35 +00:00
Ian Lepore
2d1731b857 Detect, report and use 8-bit bus if is available.
Differential Revision:	https://reviews.freebsd.org/D1921
Submitted by:	Michal Meloun
2015-02-27 15:47:30 +00:00
Ian Lepore
16c413064b MMC: Signal HC capability to (e)MMC.
Summary:
For new eMMC chips, we must signal controller HC capability in OP_COND command.

Reviewers: imp, ian

Reviewed By: ian

Differential Revision: https://reviews.freebsd.org/D1920
2015-02-27 15:14:25 +00:00
Andrew Rybchenko
851128b8de sfxge: expect required init_state on data path and in periodic calls
With the patch applied the number of instruction events is 1% less and
number of mispredicted branch events is 5% less under multistream TCP
traffic load close to line rate.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-27 07:39:09 +00:00
Kenneth D. Merry
6c0541fa8e Add FreeBSD stable/10 version checks for the availability of the
CDAI_FLAG_NONE advanced information CCB flag.

Support for the flag was merged to stable/10 in r279329, and the
__FreeBSD_version in stable/10 was bumped to 1001510.

Check for that version in the mps(4) and mpr(4) drivers when determining
whether to use the flag.

Sponsored by:	Spectra Logic
MFC after:	3 days
2015-02-26 22:22:06 +00:00
Alexander Motin
3e78ee6328 For some uniformity move ahci_ch_init() call under the lock.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after:	2 weeks
2015-02-26 12:51:05 +00:00
Adrian Chadd
977dc4e243 Migrate using CPU_ZERO() + CPU_SET() -> CPU_SETOF().
Tested:

* ixgbe, igb, RSS enabled

Submitted by:	jhb
Sponsored by:	Norse Corp, Inc.
2015-02-25 21:44:53 +00:00
Hans Petter Selasky
6fc22e8f35 Add ugen keyword to USB pnpinfo. Remove extra space from existing pnpinfo.
PR:		198015
PR:		198019
PR:		198026
MFC after:	1 week
2015-02-25 08:35:00 +00:00
Andrew Rybchenko
f86f4cd2ae sfxge: use tab to indent instead of spaces
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-25 06:19:23 +00:00
Andrew Rybchenko
75ba9e1e51 sfxge: correct limit for number of Rx queues
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-25 06:19:00 +00:00
Adrian Chadd
9756bd5982 Change uses of taskqueue_start_threads_pinned() -> taskqueue_start_threads_cpuset()
Differential Revision:	https://reviews.freebsd.org/D1897
Reviewed by:	jfv
2015-02-24 22:17:12 +00:00
Stephen McConnell
ef065d89e9 - Updated all files with 2015 Avago copyright, and updated LSI's copyright
dates.

- Changed all of the PCI device strings from LSI to Avago Technologies (LSI).

- Added a sysctl variable to control how StartStopUnit behavior works. User can
  select to spin down disks based on if disk is SSD or HDD.

- Inquiry data is required to tell if a disk will support SSU at shutdown or
  not. Due to the addition of mpssas_async, which gets Advanced Info but not
  Inquiry data, the setting of supports_SSU was moved to the
  mpssas_scsiio_complete function, which snoops for any Inquiry commands. And,
  since disks are shutdown as a target and not a LUN, this process was
  simplified by basing it on targets and not LUNs.

- Added a sysctl variable that sets the amount of time to retry after sending a
  failed SATA ID command. This helps with some bad disks and large disks that
  require a lot of time to spin up. Part of this change was to add a callout to
  handle timeouts with the SATA ID command. The callout function is called
  mpssas_ata_id_timeout(). (Fixes PR 191348)

- Changed the way resets work by allowing I/O to continue to devices that are
  not currently under a reset condition. This uses devq's instead of simq's and
  makes use of the MPSSAS_TARGET_INRESET flag. This change also adds a function
  called mpssas_prepare_tm().

- Some changes were made to reduce code duplication when getting a SAS address
  for a SATA disk.

- Fixed some formatting and whitespace.

- Bump version of mps driver to 20.00.00.00-fbsd

PR:		191348
Reviewed by:	ken, scottl
Approved by:	ken, scottl
MFC after:	2 weeks
2015-02-24 22:07:42 +00:00
Navdeep Parhar
1c468ed975 cxgbe(4): allow tx hardware checksumming on the netmap interface.
It is disabled by default but users can set IFCAP_TXCSUM on the
netmap ifnet (ifconfig ncxl0 txcsum) to override netmap and force
the hardware to calculate and insert proper IP and L4 checksums in
outbound frames.

MFC after:	2 weeks
2015-02-24 21:31:13 +00:00
Navdeep Parhar
1605bac6fb cxgbe(4): set up congestion management for netmap rx queues.
The hw.cxgbe.cong_drop knob controls the response of the chip when
netmap queues are congested.
2015-02-24 18:40:10 +00:00
Navdeep Parhar
b91cbdda76 cxgbe(4): do not set the netmap rxq interrupts on a hair-trigger.
MFC after:	2 weeks
2015-02-24 18:32:17 +00:00
Navdeep Parhar
b46fad7b6a cxgbe(4): wait for the hardware to catch up before destroying a netmap txq.
MFC after:	2 weeks
2015-02-24 18:22:24 +00:00
Navdeep Parhar
f8e30f9cf1 cxgbe(4): request an automatic tx update when a netmap txq idles.
MFC after:	2 weeks
2015-02-24 18:19:25 +00:00
Ruslan Bukin
83dbea149e Enable 'receive timeout' interrupt allowing us to not
loose 'rx buffer full' event.

This fixes operation on ARMv8 Foundation Model.

Sponsored by:	DARPA, AFRL
2015-02-24 15:35:26 +00:00
Hans Petter Selasky
bcb1c16516 Ensure that the XHCI driver will refresh the control endpoint settings
when re-enumerating a FULL speed device. Else the wrong max packet
setting might be used when trying to re-enumerate a FULL speed device.

MFC after:	3 days
2015-02-24 08:53:47 +00:00
Luigi Rizzo
bc8b78d393 Add native netmap support to ixl.
Preliminary tests indicate 32 Mpps on tx, 24 Mpps on rx
with source and receiver on two different ports of the same 40G card.
Optimizations are likely possible.
The code follows closely the one for ixgbe so i do not
expect stability issues.

Hardware kindly supplied by Intel.

Reviewed by:	Jack Vogel
MFC after:	1 week
2015-02-24 06:20:50 +00:00
Andrew Rybchenko
bce6d281d8 sfxge: add put-list high watermark
It is interesting to know how long put-list grows.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-24 06:09:31 +00:00
Andrew Rybchenko
08664e0d60 sfxge: use goto to cleanup to avoid duplicate cleanup code
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-24 06:08:55 +00:00
Pyun YongHyeon
9e251ed6d5 Correct a typo.
Reported by:	jmg
2015-02-24 01:00:46 +00:00
Gleb Smirnoff
49e6be9c3d Previous version of mbufq were fine initialized by M_ZERO, while
new one require explicti initialization.

Reported by:	royger
2015-02-23 18:55:26 +00:00
Hans Petter Selasky
f5757453dc Add support for the DWC OTG v2 chipset found in the STM32F4 series of
processors. Make sure we pullup the data lines in device mode when we
power on the port.

MFC after:	1 week
2015-02-23 17:01:38 +00:00
Luigi Rizzo
735c8d9528 add MODULE_VERSION, needed to track module dependencies
MFC after:	3 days
2015-02-23 07:28:31 +00:00
Andrew Rybchenko
3d8fce2701 sfxge: implement if_get_counter callback
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-22 19:25:57 +00:00
Andrew Rybchenko
2fc13da641 sfxge: add common code support for changing TX queue pace
To delay packets from a particular TX queue by a particular time, write a value
into the TX Pace table s.t. pace time <= TX Pace Clock Period * (2 ^ pace value)
- the TX pace clock is 1/13 of the system clock, so its period should be 104 or
52 ns depending on whether turbo mode is active.

EFX_TX_PACE_CLOCK_BASE added by me.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-22 19:24:08 +00:00
Andrew Rybchenko
af9078c3f1 sfxge: correct event queue interrupt moderation timer quanta
Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-22 19:13:52 +00:00
Andrew Rybchenko
72ca6d78f1 sfxge: DMA allocated memory is set to zeros because of BUS_DMA_ZERO flag
It is not required to set it to zeros once again.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-22 18:56:03 +00:00
Andrew Rybchenko
83488e1827 sfxge: do no allow EFSYS_MEM_ALLOC sleep
It solves locking problem when EFSYS_MEM_ALLOC is called in
the context holding a mutex (not allowed to sleep).
E.g. on interface bring up or multicast addresses addition.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-22 18:54:16 +00:00
Andrew Rybchenko
7f979e0e92 sfxge: assert event queue lock in event handlers
It is useful to highlight lock context.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-22 18:52:15 +00:00
Andrew Rybchenko
1a4bd60bf9 sfxge: pass correct address to free allocated memory in the case of load error
It is one more place missed in the previous fix.
Most likely is was just memory leak on the error handling path since
typically efsys_mem_t is filled in by zeros on allocation.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-22 18:50:59 +00:00
Andrew Rybchenko
d9ff48ab2c sfxge: using bus_space_*_stream_* API for better portability
Host-bus byte order translation is not requred.

Submitted by:   Artem V. Andreev <Artem.Andreev at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-22 18:48:54 +00:00
Andrew Rybchenko
24422f5d39 sfxge: add missing Siena sensors to common code
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-22 18:47:30 +00:00
Andrew Rybchenko
fd7a9912f6 sfxge: add missing common code NVRAM types and map from MCDI
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-22 18:46:11 +00:00
Andrew Rybchenko
d880a0b3c8 sfxge: add new identities to Siena static config
Submitted by:   Andrew Jackson <ajackson at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-22 18:44:37 +00:00
Andrew Rybchenko
4944888783 sfxge: TxQ block level should use EFX_TXQ_LIMIT as maximum TxQ size
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-22 07:20:04 +00:00
Andrew Rybchenko
bce3678745 sfxge: use sparse index to retrieve sensor value
Submitted by:   Andrew Jackson <ajackson at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-22 07:18:38 +00:00
Andrew Rybchenko
687adefa70 sfxge: use macros to acquire and release BAR locks everywhere
It was the result of invalid merge of the patch from out-of-tree driver.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-22 07:17:35 +00:00
Andrew Rybchenko
4d0b294b00 sfxge: packet can't require more than n_dma_seg descriptors plus one
Use remaining number of DMA segment instead of maximum number in mapping
when checking space for one more TSO segment packet.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-22 07:16:11 +00:00
Andrew Rybchenko
685d4bc2f2 sfxge: use common definitions of MC shared memory offsets and PDU length
Submitted by:   Ben Hutchings
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-22 07:14:12 +00:00
Andrew Rybchenko
3f6a8fe3b4 sfxge: synchronize EF10 registers header
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-22 07:11:55 +00:00
Andrew Rybchenko
c071447ac1 sfxge: style fixes and cleanup
Sync endif comment with conditional.
BOOTROM and SIENA_BOOTROM are the same, but highlight that it is Siena.
Restore commented out assertion.
Sync comments with out-of-tree driver.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-22 07:08:57 +00:00
Andrew Rybchenko
9ab060a7cb sfxge: allow TX and RX queue limits to be changed
Before the common code had hard coded limits on the IDs RXQs and TXQs could
be created with which were suited for the Windows driver with VMQ, and so
would prevent queues with IDs greater than or equal to 259 (for TXQs) or 768
(for RXQs) from being created. This change allows the limits to be set in
efsys.h, so that all 1024 queues can be created during new manftest tests.
Also, the descriptor cache sizes were also hard coded to values suited to
the smaller queue counts, and so it was necessary to make them configurable
as well.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-21 06:28:31 +00:00
Andrew Rybchenko
1924cbe5d3 sfxge: check allocations are non-NULL before freeing them
Caught when efx_filter_init() failed and called efx_filter_fini() in the
teardown path.

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-21 06:27:45 +00:00
Andrew Rybchenko
4e41fb10cb sfxge: keep fw and driver view of autoneg parameters consistent
Previously the driver's view was the expected outcome of any
reconfiguration even if that reconfiguration failed.

Submitted by:   Ben Horgan
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-21 06:27:16 +00:00
Andrew Rybchenko
f95b698965 sfxge: never set RX_DESCQ_EN during self-test
We must not enable RX queues with random parameters when they are
mapped into a VF with an untrusted driver.  It's probably not a good
idea to do this anyway, so take this bit out of the table test masks.

Submitted by:   Ben Hutchings
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-21 06:26:10 +00:00
Andrew Rybchenko
45923e7690 sfxge: more accurate calculation of maximum number of TSO segments
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-21 06:24:48 +00:00
Navdeep Parhar
c5bb375553 cxgbe(4): there is no need to force an "unimplemented" panic needlessly.
The calls to free_nm_txq and free_nm_rxq are made just a few lines prior
to the panic.
2015-02-20 22:57:54 +00:00
Andrew Rybchenko
6d73545e5d sfxge: reap Tx descriptors on unblock
Otherwise when processing finally comes to efx_tx_qdesc_post() it could
be insufficient space between reaped and added to post pending
descriptors.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-20 19:44:02 +00:00
Andrew Rybchenko
6da0beb5ac sfxge: add assertions that required event handlers are implemented
efx_ev_mcdi() does not assert or check that all event handlers it
calls are non-null.  Add assertions at the top for all required
event handlers, as some events (in the case of this bug, monitor
events) are rare.

Submitted by:   Ben Hutchings
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-20 19:42:05 +00:00
Andrew Rybchenko
612d8e2828 sfxge: style fixes
Use nitem() to get number of array elements.
Remove unused define.
Use TAB to indent.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-20 19:39:40 +00:00
Andrew Rybchenko
9bdc809c17 sfxge: regenerate sensor map
Add Florence R7 and Modena sensors.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-20 19:37:10 +00:00
Andrew Rybchenko
8bf93a0428 sfxge: add Florence R7 turbo mode support to common code
Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-20 07:57:59 +00:00
Andrew Rybchenko
9013400b1c sfxge: regenerate MCDI protocol headers
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-20 07:54:35 +00:00
Andrew Rybchenko
b2c43c38e7 sfxge: handle fragmented TCP header in mbuf
TCP header is fragmented in the case of VLAN tagged IPv6 traffic without
HW VLAN tagging.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-20 07:53:46 +00:00
Jack F Vogel
b6c8f26052 Bring the XL710 drivers up to the SW3 release level.
MFC after: 1 week
2015-02-20 00:40:26 +00:00
Andrew Turner
16a1c0a829 Adda function to iterate over the cpu nodes in the OFW or FDT data. This
will be used with arm64 to find which cpus to enable, and could also be
used with 32-bit arm and mips for the same purpose.

Differential Revision:	https://reviews.freebsd.org/D1825
Sponsored by:	The FreeBSD Foundation
2015-02-19 16:34:48 +00:00