Commit Graph

28713 Commits

Author SHA1 Message Date
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
Andrew Turner
deb7728379 Add support to get the cpu ID from its device driver in a generic way.
This will be needed by arm64 to find the value to pass to the psci (Power
State Coordination Interface) driver, among other things, used to enable
cores.

Differential Revision:	https://reviews.freebsd.org/D1824
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
2015-02-19 12:47:48 +00:00
Gleb Smirnoff
c578b6aca0 Provide a set of inline functions to manage simple mbuf(9) queues, based
on queue(3)'s STAILQ.  Utilize them in cxgb(4) and Xen, deleting home
grown implementations.

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2015-02-19 01:19:42 +00:00
Kenneth D. Merry
e8577fb489 Make sure that the flags for the XPT_DEV_ADVINFO CCB are initialized
properly.

If there is garbage in the flags field, it can sometimes include a
set CDAI_FLAG_STORE flag, which may cause either an error or
perhaps result in overwriting the field that was intended to be
read.

sys/cam/cam_ccb.h:
	Add a new flag to the XPT_DEV_ADVINFO CCB, CDAI_FLAG_NONE,
	that callers can use to set the flags field when no store
	is desired.

sys/cam/scsi/scsi_enc_ses.c:
	In ses_setphyspath_callback(), explicitly set the
	XPT_DEV_ADVINFO flags to CDAI_FLAG_NONE when fetching the
	physical path information.  Instead of ORing in the
	CDAI_FLAG_STORE flag when storing the physical path, set
	the flags field to CDAI_FLAG_STORE.

sys/cam/scsi/scsi_sa.c:
	Set the XPT_DEV_ADVINFO flags field to CDAI_FLAG_NONE when
	fetching extended inquiry information.

sys/cam/scsi/scsi_da.c:
	When storing extended READ CAPACITY information, set the
	XPT_DEV_ADVINFO flags field to CDAI_FLAG_STORE instead of
	ORing it into a field that isn't initialized.

sys/dev/mpr/mpr_sas.c,
sys/dev/mps/mps_sas.c:
	When fetching extended READ CAPACITY information, set the
	XPT_DEV_ADVINFO flags field to CDAI_FLAG_NONE instead of
	setting it to 0.

sbin/camcontrol/camcontrol.c:
	When fetching a device ID, set the XPT_DEV_ADVINFO flags
	field to CDAI_FLAG_NONE instead of 0.

sys/sys/param.h:
	Bump __FreeBSD_version to 1100061 for the new XPT_DEV_ADVINFO
	CCB flag, CDAI_FLAG_NONE.

Sponsored by:	Spectra Logic
MFC after:	1 week
2015-02-18 18:30:19 +00:00
Warner Losh
46b39c90f4 Add copyright statement I should have had on these files in 2006,
based on the spibus_if.m file.
2015-02-18 14:33:33 +00:00
Xin LI
8d45c8ab96 - fortuna.c: catch up with r278927 and fix a buffer overflow by using the
temporary buffer when remaining space is not enough to hold
	      a whole block.
 - yarrow.c:  add a comment that we intend to change the code and remove
	      memcpy's in the future. (*)

Requested by:	markm (*)
Reviewed by:	markm
Approved by:	so (self)
2015-02-18 08:21:51 +00:00
Andrew Rybchenko
d8574f4f45 sfxge: fix broken MCDI_EV_FIELD() macro
Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-18 06:26:07 +00:00
Andrew Rybchenko
1f69766845 sfxge: support variable-length response to MCDI GET_BOARD_CFG
Allocate the minimum or maximum response length for GET_BOARD_CFG as
appropriate.  When looking up firmware subtypes by partition ID,
check the ID against the actual response length.

Merge of the patch made by Ben Hutchings in 2011.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-18 06:23:16 +00:00
Andrew Rybchenko
097de6f518 sfxge: add driver context member with number of event queues
Mainly to unify with similar member for transmit and receive queues.
It will be used in the future for resources allocation processing.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-18 06:21:59 +00:00
Andrew Rybchenko
133366a6e5 sfxge: add driver context member with number of receive queues
Mainly to unify with similar member for transmit queues.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-18 06:20:59 +00:00
Andrew Rybchenko
e2b05fe21c sfxge: add driver context member with number of transmit queues
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-18 06:19:35 +00:00
Andrew Rybchenko
d0f7387777 sfxge: add TCP segment size to sfxge_tso_state
It avoids access to m_pkthdr when TSO packet is started and also makes
tso_start_new_packet() function smaller.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-18 06:18:51 +00:00
Warner Losh
8e5f761422 On my Lenovo T400, a Atheros 2413 has a problem powering up
sometimes. It will power up wrong and identify itself badly:

cardbus0: <network, ethernet> at device 0.0 (no driver attached)
cardbus0: <simple comms, UART> at device 0.1 (no driver attached)
cardbus0: <old, non-VGA display device> at device 0.2 (no driver attached)
cardbus0: <old, non-VGA display device> at device 0.3 (no driver attached)
cardbus0: <old, non-VGA display device> at device 0.4 (no driver attached)
cardbus0: <old, non-VGA display device> at device 0.5 (no driver attached)
cardbus0: <old, non-VGA display device> at device 0.6 (no driver attached)
cardbus0: <old, non-VGA display device> at device 0.7 (no driver attached)

All the higher numbered functions (.2 and above) have a config space
of all 0's. This smells a bit like a special debug mode, but the
current atheros driver doesn't cope. It is unclear if this card is
just a flake, or if we're doing something wrong in the power-up
sequence.

Put a work around into the code that tests for this rather unusual
condition. If we power a CardBus device up, and the device says it is
multi-function, and any of the functions have a 0 device ID, try the
power-up sequence again.
2015-02-18 05:53:04 +00:00
John-Mark Gurney
5da74e04ec Fix a bug where this function overflowed it's buffer... This was
causing ZFS panics on boot...

This is purely reviewed and tested by peter.

Reviewed by:	peter
Approved by:	so (implicit), peter
2015-02-17 23:14:26 +00:00
Luiz Otavio O Souza
91e38bd663 Replace hardcoded sizes by sizeof() and nitems().
Set all the sysctls as CTLFLAG_MPSAFE.
2015-02-17 20:29:42 +00:00
Luiz Otavio O Souza
7628ccf06e Fix the display of negative temperatures.
Fix the setting of TOS (overtemperature shutdown) and THYST (hysteresis
temperature).
2015-02-17 20:08:40 +00:00
John-Mark Gurney
601e8bcdf4 When the new random adaptor code was brought it in r273872, a call to
randomdev_init_reader to change read_random over to the newly installed
adaptor was missed.  This means both read_random and arc4random (seeded
from read_random) were not returning very random data.  This also
effects userland arc4random as it is seeded from kernel arc4random.

The random devices are uneffected and have returned good randomness
since the change.

All keys generated with a kernel of r273872 must be regenerated with
a kernel with this patch.  Keys generated may be predictable.

Remove the warning as log is too early to print anything, and it would
always get printed due to early use of arc4random...

Reviewed by:	delphij, markm
Approved by:    so (delphij)
2015-02-17 17:37:00 +00:00
Hans Petter Selasky
b5c1e0cb8d Update the infiniband stack to Mellanox's OFED version 2.1.
Highlights:
 - Multiple verbs API updates
 - Support for RoCE, RDMA over ethernet

All hardware drivers depending on the common infiniband stack has been
updated aswell.

Discussed with:	np @
Sponsored by:	Mellanox Technologies
MFC after:	1 month
2015-02-17 08:40:27 +00:00
Hans Petter Selasky
fa592170fe Try to resolve infinite interrupts by clearing an undocumented
interrupt status bit. According to the UHCI controller specification
the host controller halted interrupt is non-maskable.

PR:		156596
Tested by:	adrian @
MFC after:	1 week
2015-02-17 07:52:50 +00:00
Warner Losh
2859a64a1a Remove compat code for pre-FreeBSD 7 systems. 2015-02-17 05:10:41 +00:00
Warner Losh
80bd9c9682 This should have been GC'd 6 years ago when ar(4) was removed. 2015-02-17 05:07:38 +00:00
Konstantin Belousov
d19b0f3ea5 Array cannot be NULL, remove always true comparision. ACPI spec
identifies the tested condition for _PRT as "BYTE value of 0", so the
remaining part of the conditionals is sufficient.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2015-02-16 22:18:43 +00:00
John-Mark Gurney
69d4c287d3 remove NULL check as M_WAITOK will not return NULL
Reviewed by:	jhb
Sponsored by:	FreeBSD Foundation
2015-02-16 18:43:52 +00:00
Hans Petter Selasky
537116c230 Reduce number of memory buffers a bit. 2015-02-16 15:47:55 +00:00
Hans Petter Selasky
b41892e1f8 Avoid recursive locking. 2015-02-16 15:46:16 +00:00
Hans Petter Selasky
4464c5e5e6 Swap screen dimensions back to normal. 2015-02-16 15:39:51 +00:00
Hans Petter Selasky
2d759c8259 Handle VBUS error interrupts.
Submitted by:	SAITOU Toshihide <toshi@ruby.ocn.ne.jp>
PR:		190471
MFC after:	1 week
2015-02-16 15:34:10 +00:00
Andriy Gapon
7116636e6b vt: move suspend/resume event handlers registration outside of mutex scope
This is to avoid a witness warning about a waiting memory allocation in
the evnt hanlder registration code.

Reported by:	markj
MFC after:	3 days
X-MFC with:	r277795
2015-02-16 13:02:00 +00:00
Hans Petter Selasky
00ad411a77 Allow the display port to be powered off. 2015-02-16 11:54:45 +00:00
Hans Petter Selasky
b914a5291b Forward the FBIO_BLANK IOCTL to framebuffer clients. Bump the FreeBSD
version to force re-compilation of external video driver kernel
modules.

Discussed with:		ray @
2015-02-16 11:49:48 +00:00
Roger Pau Monné
f79cdf2998 xen: fix xenstore dev
Xenstore user-space device has two problems currently:
 - It does not correctly handle concurrent clients, because it's storing
   each client data in dev->si_drv1.
 - It does not correctly free this data when the client closes the device.

In order to solve both of this issues store the per-client data using
cdevpriv, which also comes with a hook in order to perform the necessary
cleanup on device close.

While there also make the device eternal.

Sponsored by: Citrix Systems R&D
Reported and Tested by: thompsa
MFC after: 2 weeks
2015-02-16 09:53:43 +00:00
Andrew Rybchenko
2cd617a883 sfxge: flush all Tx queues from if_qflush
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor), glebius
2015-02-16 06:16:38 +00:00
Andrew Rybchenko
0ff2378988 sfxge: style fixes
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-16 06:12:04 +00:00