Commit Graph

32778 Commits

Author SHA1 Message Date
Conrad Meyer
a0992979e9 ioat(4): Simplify by removing dynamic scaling
This paves the way for a contiguous descriptor array.

A contiguous descriptor array has the benefit that we can make strong
assertions about whether an address is a valid descriptor or not.  The
other benefit is that future generations of I/OAT hardware will require
a contiguous descriptor array anyway.  The downside is that after system
boot, big chunks of contiguous memory is much harder to find.  So
dynamic scaling after boot is basically impossible.

Reviewed by:	markj
Sponsored by:	Dell EMC Isilon
2016-11-01 19:18:52 +00:00
Sepherosa Ziehau
a457fab84c hyperv/vmbus: Avoid extra header copy.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8395
2016-11-01 08:30:06 +00:00
Sepherosa Ziehau
8966e5d5b3 hyperv/hn: Directly fill chimney sending buffer for small packets.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8394
2016-11-01 08:20:33 +00:00
Sepherosa Ziehau
edd3f31541 hyperv/hn: Move TSO packet fixup to an earlier place for if_transmit.
While TSO packet header may be still cache-hot.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8393
2016-11-01 07:41:26 +00:00
Hans Petter Selasky
d03403c4b1 Make sure the virtual T-axis buttons generate button release event(s)
for continuous tilting.

PR:		213957
MFC after:	3 days
2016-11-01 07:15:39 +00:00
Sepherosa Ziehau
23bf9e1527 hyperv/hn: Regroup if_start related functions.
And put them under HN_IFSTART_SUPPORT, which is by default on until
we whack the if_start related bits from base system.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8392
2016-11-01 07:10:43 +00:00
Sepherosa Ziehau
15516c776e hyperv/hn: Rename cleaned up file.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8390
2016-11-01 06:54:25 +00:00
Sepherosa Ziehau
ba015837bf hyperv/hn: Cosmetic cleanup; no functional changes.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8389
2016-11-01 04:44:11 +00:00
Li-Wen Hsu
d9fea9f287 - Fix make in sys/modules/bhnd
Reviewed by:	landonf, imp
Differential Revision:	https://reviews.freebsd.org/D8385
2016-11-01 03:49:31 +00:00
Conrad Meyer
8532d381a9 Add BUF_TRACKING and FULL_BUF_TRACKING buffer debugging
Upstream the BUF_TRACKING and FULL_BUF_TRACKING buffer debugging code.
This can be handy in tracking down what code touched hung bios and bufs
last. The full history is especially useful, but adds enough bloat that
it shouldn't be enabled in release builds.

Function names (or arbitrary string constants) are tracked in a
fixed-size ring in bufs. Bios gain a pointer to the upper buf for
tracking. SCSI CCBs gain a pointer to the upper bio for tracking.

Reviewed by:	markj
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D8366
2016-10-31 23:09:52 +00:00
Hans Petter Selasky
e2efc9becb Make sure the virtual T-axis buttons gets cleared for USB mice which has
less than 6 buttons.

PR:		213919
MFC after:	3 days
2016-10-31 18:38:50 +00:00
Roger Pau Monné
78eb32933b xen: add a grant-table user-space device
A grant-table user-space device will allow user-space applications to map
and share grants (Xen way to share memory) among Xen domains. This grant
table user-space device has been tested with the QEMU Qdisk Xen backed.

Submitted by:		jaggi
Reviewed by:		royger
Differential review:	https://reviews.freebsd.org/D7293
2016-10-31 13:12:58 +00:00
Roger Pau Monné
b2fd6999db xen/netfront: fix statistics
Fix the statistics used by netfront.

Reported by:    Trond.Endrestol@ximalas.info
Submitted by:   ae
Reviewed by:    royger, Wei Liu <wei.liu2@citrix.com>
MFC after:	4 weeks
PR:		213439
2016-10-31 11:31:11 +00:00
Kevin Lo
a24d62b533 Add preliminary support for the RTL8153.
Reviewed by:	hselasky
2016-10-31 05:58:11 +00:00
Sepherosa Ziehau
427e366e43 hyperv/hn: Don't start shared TX taskq, if the hypervisor is not Hyper-V.
- Move the SYSINIT to DRIVER/SECOND, i.e. after the vm_guest becomes
  determistic.
- Minor style changes.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8370
2016-10-31 05:22:00 +00:00
Sepherosa Ziehau
82d71ca917 hyperv/hn: Reset do_lro, if the hash types are not TCP related.
Mainly because the host side only set TCPCS and IPCS even for
UDP datagrams.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8369
2016-10-31 05:05:12 +00:00
Sepherosa Ziehau
7ccc20da6a hyperv/hn: Cleanup RXBUF ack processing.
- Increase the # of retries.
- Add comment.
- Log error, if RXBUF ack fails.
- Add stat for RXBUF ack failures.

RXBUF ack really should _not_ fail...

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8368
2016-10-31 04:54:15 +00:00
Sepherosa Ziehau
8ff20a73f6 hyperv/hn: Rework temporary channel packet buffer expanding.
And use large default temporary channel packer buffer; we really
don't want it to be expanded at run time.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8367
2016-10-31 04:46:02 +00:00
Sepherosa Ziehau
e6ed06f904 hyperv/hn: Rename cleaned up RNDIS source file.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8361
2016-10-31 01:36:28 +00:00
Andriy Gapon
448897d366 add iic interface to ig4 driver, move isl and cyapa to iicbus
Summary:
The hardware does not expose a classic SMBus interface.
Instead it has a lower level interface that can express a far richer
I2C protocol than what smbus offers.  However, the interface does not
provide a way to explicitly generate the I2C stop and start conditions.
It's only possible to request that the stop condition is generated
after transferring the next byte in either direction.  So, at least
one data byte must always be transferred.
Thus, some I2C sequences are impossible to generate, e.g., an equivalent
of smbus quick command (<start>-<slave addr>-<r/w bit>-<stop>).

At the same time isl(4) and cyapa(4) are moved to iicbus and now they use
iicbus_transfer for communication.  Previously they used smbus_trans()
interface that is not defined by the SMBus protocol and was implemented
only by ig4(4).  In fact, that interface was impossible to implement
for the typical SMBus controllers like intpm(4) or ichsmb(4) where
a type of the SMBus command must be programmed.

The plan is to remove smbus_trans() and all its uses.
As an aside, the smbus_trans() method deviates from the standard,
but perhaps backwards, FreeBSD convention of using 8-bit slave
addresses (shifted by 1 bit to the left).  The method expects
7-bit addresses.

There is a user facing consequence of this change.
A user must now provide device hints for isl and cyapa that specify an iicbus to use
and a slave address on it.
On Chromebook hardware where isl and cyapa devices are commonly found
it is also possible to use a new chromebook_platform(4) driver that
automatically configures isl and cyapa devices.  There is no need to
provide the device hints in that case,

Right now smbus(4) driver tries to discover all slaves on the bus.
That is very dangerous.  Fortunately, the probing code uses smbus_trans()
to do its job, so it is really enabled for ig4 only.
The plan is to remove that auto-probing code and smbus_trans().

Tested by:	grembo, Matthias Apitz <guru@unixarea.de> (w/o
		chromebook_platform)
Discussed with:	grembo, imp
Reviewed by:	wblock (docs)
MFC after:	1 month
Relnotes:	yes
Differential Revision: https://reviews.freebsd.org/D8172
2016-10-30 12:15:33 +00:00
Andriy Gapon
3c1f73b18d hwpmc: fix a race between amd_stop_pmc and amd_intr
It is possible that wrmsr in amd_stop_pmc() causes an overflow in a counter
that it disables.  In that case a non-maskable interrupt is generated.  The
interrupt handler code was written in such a way that it would re-enable the
counter.  That would lead to an unexpected interrupt later on.

This problem was easy to reproduce with
$ pmcstat -T -P instructions -t $pid
if the target process is sufficiently busy and there are context switches from
time to time.  There would be a lot of interrupts to "race" with amd_stop_pmc()
called during the context switches.  The problem affected only AMD processors.

While there, trace whether amd_intr() claimed an interrupt.

Reviewed by:	jhb
MFC after:	2 weeks
2016-10-30 09:38:10 +00:00
Conrad Meyer
0d0f264099 ioat(4): Use memory completion rather than device register
The CHANSTS register is a split 64-bit register on CBDMA units before
hardware v3.3.  If a torn read happens during ioat_process_events(),
software cannot know when to stop completing descriptors correctly.

So, just use the device-pushed main memory channel status instead.

Remove the ioat_get_active() seatbelt as well.  It does nothing if the
completion address is valid.

Sponsored by:	Dell EMC Isilon
2016-10-28 23:53:37 +00:00
Conrad Meyer
76305bb865 ioat(4): Add failpoint for delay() in ioat_release
Sponsored by:	Dell EMC Isilon
2016-10-28 23:53:36 +00:00
Conrad Meyer
5a8af401ae ioat(4): Assert the submit lock in ioat_submit_single
Sponsored by:	Dell EMC Isilon
2016-10-28 23:53:35 +00:00
Conrad Meyer
05e4cffbb0 ioat(4): Add additional tracing
These probes help track down driver bugs.

Sponsored by:	Dell EMC Isilon
2016-10-28 23:53:33 +00:00
Navdeep Parhar
041e5aed63 cxgbe(4): Accurate statistics for all chip settings.
There are 4 independent knobs in T5+ chips to include or exclude PAUSE
frames from the "total frames" and "multicast frames" counters in either
direction.  This change lets the driver deal with any combination of
these settings.
2016-10-28 23:01:11 +00:00
Warner Losh
aee4341421 Remove a PCI ID for a raid controller from Adaptec that was planned,
but never released. Since no real hardware was released with this ID,
just drop it from the aacraid driver. This paves the path for future
drivers for hardware that actually has this ID.

Submitted by: Scott Benesh from Microsemi.
Differential Revision: https://reviews.freebsd.org/D8377
MFC After: 3 days
2016-10-28 20:23:38 +00:00
Sean Bruno
c371f1143c The buffer address is always overwritten in the extended descriptor format,
we have to refresh it ... always.  This fixes problems reported in NetMap
with em(4) devices after conversion to extended descriptor format in
svn r293331.

Submitted by:	luigi@
Reported by:	franco@opnsense.org
MFC after:	2 days
2016-10-28 13:37:58 +00:00
Hans Petter Selasky
b133b47342 Fix indentation and remove duplicate queue stopped stats increment.
Found by:	Ryan Stone <rysto32@gmail.com>
Sponsored by:	Mellanox Technologies
MFC after:	1 week
2016-10-28 12:36:59 +00:00
Sepherosa Ziehau
fb448904d9 hyeprv/hn: Rename cleaned up RNDIS header file.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8360
2016-10-28 08:53:18 +00:00
Sepherosa Ziehau
ec60eff9ab hyperv/hn: Change header guardian; in preparation for the upcoming rename.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8359
2016-10-28 08:41:30 +00:00
Sepherosa Ziehau
d568f3ecfa hyperv/hn: Cleanup RNDIS related files.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8358
2016-10-28 08:32:54 +00:00
Sepherosa Ziehau
8ef7124558 hyperv/hn: Pull data path code up.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8357
2016-10-28 08:18:49 +00:00
Sepherosa Ziehau
91938ebba8 hyperv/hn: Reorganize RX path; mainly pull non-control code path up
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8356
2016-10-28 08:08:46 +00:00
Sepherosa Ziehau
96a98cbf14 hyperv/hn: Nuke unnecessary indirection.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8355
2016-10-28 07:59:02 +00:00
Sepherosa Ziehau
68468712a7 hyperv/hn: Rename cleaned up NVS source file.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8354
2016-10-28 07:48:17 +00:00
Sepherosa Ziehau
e61005fedc hyperv/hn: Rename cleaned up NVS header file.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8353
2016-10-28 05:56:23 +00:00
Sepherosa Ziehau
0cf2aff4fa hyperv/hn: Change header guardian; in preparation for the upcoming rename.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8352
2016-10-28 05:31:34 +00:00
Luigi Rizzo
844a6f0c53 Various fixes for ptnet/ptnetmap (passthrough of netmap ports). In detail:
- use PCI_VENDOR and PCI_DEVICE ids from a publicly allocated range
  (thanks to RedHat)
- export memory pool information through PCI registers
- improve mechanism for configuring passthrough on different hypervisors
Code is from Vincenzo Maffione as a follow up to his GSOC work.
2016-10-27 09:46:22 +00:00
Sepherosa Ziehau
2ae974568d hyperv/hn: NVS inclusion cleanup and forward declare functions.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8347
2016-10-27 05:33:48 +00:00
Sepherosa Ziehau
e3946ae44a hyperv/hn: Move send context to NVS domain.
Since all sends are encapsulated in NVS messages.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8346
2016-10-27 05:26:04 +00:00
Sepherosa Ziehau
19b2340a76 hyperv/hn: Move hn_softc to if_hnvar.h
While I'm here, use consistent macro names.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8345
2016-10-27 05:13:00 +00:00
Sepherosa Ziehau
d6e37dc70f hyperv/hn: Shuffle chimney sending buffer alloc/free around.
This paves way for more chimney sending buffer reorganization.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8343
2016-10-27 05:04:54 +00:00
Sepherosa Ziehau
14a31e99d7 hyperv/hn: Define empty packet filter.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8342
2016-10-27 04:55:19 +00:00
Sepherosa Ziehau
5341cc1c91 hyperv/hn: Move %b format string for capabilities near their definition.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8341
2016-10-27 04:42:39 +00:00
Sepherosa Ziehau
90321eb752 hyperv/hn: Nuke unnecessary M_NETVSC
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8340
2016-10-27 04:28:01 +00:00
Sepherosa Ziehau
20b3dcf039 hyperv/hn: Properly configure RSS according to RSS capabilities
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8338
2016-10-27 03:43:27 +00:00
Kevin Lo
3d8102824b Disable CLKREQ for ASPM since re(4) doesn't implement link level power saving.
Reviewed by:  yongari
2016-10-27 02:20:13 +00:00
Andrew Turner
0c5434ae58 Pull the common FDT interrupt values into a new header rather than be magic
numbers.

Sponsored by:	DARPA, AFRL
2016-10-26 15:18:08 +00:00
Andrew Turner
1fb2428f1c Stop including a possibly GPLd header from the GPIO code. Add the only
needed macro to ofw_gpiobus.c.

Reported by:	emaste
Sponsored by:	DARPA, AFRL
2016-10-26 12:41:44 +00:00
Sepherosa Ziehau
eaaa9935d4 hyperv/vmbus: Implement vmbus_chan_printf.
And use it for vmbus channel logging, which can log the channel
owner's name properly, instead of vmbus0.

Submitted by:	QianYue You <t-youqi microsoft com>
MFC after:	1 week
Sponsored by:	Microsoft
2016-10-26 05:06:23 +00:00
Sepherosa Ziehau
91833b0f3c hyperv/vmbus: Add missing white space.
Submitted by:	QianYue You <t-youqi microsoft com>
MFC after:	1 week
Sponsored by:	Microsoft
2016-10-26 04:26:17 +00:00
Conrad Meyer
b8acc2d67e uhso(4): Fix a null pointer dereference
The directly following m_defrag() call can wait, so there is no reason this
call can't as well.

Reported by:	Coverity
CID:		1353551
Sponsored by:	Dell EMC Isilon
2016-10-25 18:36:15 +00:00
Gleb Smirnoff
72b09927ed Check m_getcl() return value.
CID:	611376
2016-10-25 16:28:30 +00:00
Andrew Turner
c2dd354bf4 Create a new PSCI error code and use it to signal that starting the CPU is
impossible as the PSCI firmware is missing.

Sponsored by:	ABT Systmes Ltd
2016-10-25 14:18:27 +00:00
Edward Tomasz Napierala
88f9a4ff75 Make the USB attach strings in dmesg include product name.
Note to self: MFC this to 9 and 8.

Reviewed by:	hselasky@, imp@
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D8259
2016-10-25 07:48:19 +00:00
Bryan Drewery
1648616981 Use proper if_getdrvflags() API.
This is a NOP.

Sponsored by:	Dell EMC Isilon
2016-10-25 03:55:56 +00:00
Sepherosa Ziehau
7888d6422d hyperv/hn: Set baudrate properly
PR:		208931
Submitted by:	Eugene Grosbein <ports grosbein net>
Reported by:	Eugene Grosbein <ports grosbein net>
MFC after:	1 week
Sponsored by:	Microsoft
2016-10-25 01:41:39 +00:00
Navdeep Parhar
77e9044c47 cxgbe(4): Fix bug in the calculation of the number of physically
contiguous regions in an mbuf chain.

If the payload of an mbuf ends at a page boundary count_mbuf_nsegs would
incorrectly consider the next mbuf's payload physically contiguous based
solely on a KVA comparison.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2016-10-24 19:09:56 +00:00
Sepherosa Ziehau
5bf51473c0 hyperv/ic: Rework framework/message version negotiation.
Submitted by:	Hongjiang Zhang <honzhan microsoft com>
Modified by:	sephe
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8280
2016-10-24 05:36:19 +00:00
Sepherosa Ziehau
f0dcc3114c hyperv/hn: Nuke unused forward declaration.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8314
2016-10-24 05:20:02 +00:00
Sepherosa Ziehau
121e98e697 hyperv/hn: Fix RX filter settings.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8313
2016-10-24 05:10:35 +00:00
Sepherosa Ziehau
665bc5ff49 hyperv/hn: Start link status check, if no network changes were pending.
Link status check is much more lightweight than network change detection.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8311
2016-10-24 05:01:34 +00:00
Sepherosa Ziehau
6827d9497a hyperv/hn: Properly handle synthetic parts reattach failure.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8310
2016-10-24 03:42:34 +00:00
Sepherosa Ziehau
6aa8c9a4e0 hyperv/hn: Fix chimney sending buffer leakage upon NVS sending failure.
This will not happen in real world, since TX consumption of the vmbus
TX bufring is limitted.  Better safe than sorry.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8309
2016-10-24 03:34:19 +00:00
Sepherosa Ziehau
b7009d5392 hyperv/hn: Move chimney buffer index and size to txdesc.
All RNDIS control messages have used SG list for a while.  This makes
the send context suitable for further refactoring.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8308
2016-10-24 03:26:34 +00:00
Justin Hibbits
b474a02784 Use the correct name for the qm_portals class.
This file was copy&pasted from bman_fdt, and it still shows.
2016-10-23 19:59:56 +00:00
Oleksandr Tymoshenko
e012a280a5 EVDEV: ums evdev support improvements: locking and event reporting
- Use ums lock as evdev lock
- Do not cap axes values to sysmouse limits for evdev reports
- Do not map T-axis events to buttons for evdev reports
- Use shortcuts for event reporting

Submitted by:	Vladimir Kondratiev <wulf@cicgroup.ru>
MFC after:	1 week
2016-10-22 22:55:10 +00:00
Oleksandr Tymoshenko
73362d0e56 EVDEV: Add shortcut functions for event types
Add wrappers around generic evdev_push_event for specific event types:
EV_KEY/EV_REL/EV_ABS etc...

Submitted by:	Vladimir Kondratiev <wulf@cicgroup.ru>
2016-10-22 22:52:50 +00:00
Andriy Gapon
4afdfe9761 jedec_ts: a driver for thermal sensors on memory modules
The driver currently supports chips that are fully compliant with the
JEDEC SPD / EEPROM / TS standard (JEDEC Standard 21-C,
TSE2002 Specification, frequenlty referred to as JEDEC JC 42.4).

Additionally some chips from STMicroelectronics are supported as well.
They are compliant except for their Device ID pattern.

Given the continued lack of any common sensor infrastructure, the driver
uses an ad-hoc sysctl to report the temperature.

Reviewed by:	wblock (documentation)
MFC after:	2 weeks
Relnotes:	yes
Differential Revision: https://reviews.freebsd.org/D8174
2016-10-22 08:00:46 +00:00
Justin Hibbits
3413fe9770 Initialize the ofw_bus_devinfo on the portals to prevent a crash.
If the device tree doesn't contain a cpu-handle field in any bman-portal or
qman-portal, it will exit without setting up the devinfo, leaving it
uninitialized.  This will lead to attempts to free random memory, and ultimately
panic.
2016-10-22 02:11:53 +00:00
Navdeep Parhar
aaa4ddd9d0 cxgbe(4): Dump any mailbox command that times out. 2016-10-22 00:48:58 +00:00
Alexander Motin
a7a560be79 Add names for some DASP devices.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after:	1 week
2016-10-21 15:23:54 +00:00
Ed Maste
984ff0d910 netmap: fix kernel build on GCC-using architectures
GCC produced a multiple declaration warning from the
SYSCTL_DECL(_dev_netmap).
2016-10-21 13:51:47 +00:00
Sepherosa Ziehau
525607d10c hyperv/hn: Function renaming; consistent w/ hardware capabilities query.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8296
2016-10-21 08:21:23 +00:00
Sepherosa Ziehau
970ead008d hyperv/hn: Add network change support.
Currently the network change is simulated by link status changes.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8295
2016-10-21 08:02:05 +00:00
Sepherosa Ziehau
31f05efd89 hyperv/hn: Check NVS version for HASHVAL pktinfo on sending path.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8293
2016-10-21 07:46:35 +00:00
Sepherosa Ziehau
0634f75c72 hyperv/hn: Always query RSS capabilities.
- This avoid distributing NDIS version check.
- Only NDIS 6.20 required (earlier NDIS uses different indirect table
  format).

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8291
2016-10-21 07:37:29 +00:00
Sepherosa Ziehau
ffaa5deb38 netmap: Unbreak LINT-VIMAGE building
Sponsored by:	Microsoft
2016-10-21 06:32:45 +00:00
Sepherosa Ziehau
e3f94e5133 netmap: Unbreak i386 LINT building
Sponsored by:	Microsoft
2016-10-21 06:05:16 +00:00
Justin Hibbits
47cabd046d Remove a hack requiring dtsec0 to always be enabled for mdio.
Instead replace it with a different hack, that turns fman into a simplebus
subclass, and maps its children within its address space.

Since all PHY communication is done through dtsec0's mdio space, the FDT
contains a reference to the dtsec0 mdio handle in all nodes that need it.
Instead of using Freescale's implementation for MII access, use our own (copied
loosely from the eTSEC driver, and could possibly be merged eventually).  This
lets us access the registers directly rather than needing a full dtsec interface
just to access the registers.

Future directions will include turning fman into more of a simplebus, and not
mapping the region and playing games.  This will require changes to the dtsec
driver to make it a child of fman, and possibly other drivers as well.
2016-10-21 02:16:11 +00:00
Justin Hibbits
525b23c541 Remove an unnecessary debug printf. 2016-10-21 02:07:03 +00:00
Wojciech Macek
7902c8dca8 Driver for PCI Ethernet NIC on Alpine V1 and V2.
Obtained from:         Semihalf
Submitted by:          Michal Stanek <mst@semihalf.com>
Sponsored by:          Annapurna Labs
Reviewed by:           wma
Differential Revision: https://reviews.freebsd.org/D7814
2016-10-20 11:31:11 +00:00
Hans Petter Selasky
4d76235fe3 Add support for adjusting the hardware buffering delay for USB audio.
Requested by:	Goran Mekic <meka@tilda.center>
MFC after:	1 week
2016-10-19 18:45:06 +00:00
Konstantin Belousov
cb31871867 Partial workaround for Intel PCI adapters reading past the end of the
host-programmed DMA regions.  This change seemingly fixes the
descriptor fetches, but the packet memory accesses are left
problematic.

Reviewed by:	emaste, erj, sbruno
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D8282
2016-10-19 18:15:44 +00:00
Sepherosa Ziehau
e41136c060 hyperv/vmbus: Expose channel management taskqueue for driver to use.
MFC after:	3 days
Sponsored by:	Microsoft
2016-10-19 09:12:14 +00:00
David C Somayajulu
c7873d969c 1. Use taskqueue_create() instead of taskqueue_create_fast() for both
fastpath and slowpath taskqueues.
2. Service all transmits in taskqueue threads.
3. additional stats counters for  keeping track of
	- bd availability
	- tx buf ring not emptied in the fp task queue.
	  These are drained via timeout taskqueue.
	- tx attempts during link down.

MFC after: 5 days
2016-10-18 21:33:57 +00:00
Andriy Voskoboinyk
1a58c70409 rtwn(4): fix build with 'options IEEE80211_SUPPORT_SUPERG' 2016-10-18 21:17:31 +00:00
Luigi Rizzo
a2a7409151 remove stale and unused code from various files
fix build on 32 bit platforms
simplify logic in netmap_virt.h

The commands (in net/netmap.h) to configure communication with the
hypervisor may be revised soon.
At the moment they are unused so this will not be a change of API.
2016-10-18 16:18:25 +00:00
Luigi Rizzo
d782d9fd35 remove conditional code for an obsolete feature. if_ptnet now does better. 2016-10-18 15:50:20 +00:00
Luigi Rizzo
6ad42d71b2 remove trailing whitespace. No code changes. 2016-10-18 15:41:57 +00:00
Sean Bruno
225d33ff5c Restore svn r306772 that was overwritten by netmap import at svn r307394
#include <sys/selinfo.h> should be here as all drivers that support
netmap need to use this file regardless.
2016-10-18 14:48:41 +00:00
Michal Meloun
fd02931841 REGULATOR: Move functions for handling with regulator ranges to
common file. They can be useful for other PMICs.

MFC after: 2 weeks
2016-10-18 12:27:46 +00:00
Justin Hibbits
f77405e334 Use proper integer-pointer type conversions.
As part of an effort to extend Book-E to the 64-bit world, make the necessary
changes to the DPAA/dTSEC driver set to be integer-pointer conversion clean.
This means no more casts to int, and use uintptr_t where needed.

Since the NCSW source is effectively obsolete, direct changes to the source tree
are safe.
2016-10-18 00:55:15 +00:00
Navdeep Parhar
b806e571bf cxgbe(4): Adjust whitespace to line up the column titles in cim_qcfg
with the values displayed.
2016-10-17 20:57:54 +00:00
Andriy Voskoboinyk
7453645f2a rtwn(4), urtwn(4): merge common code, add support for 11ac devices.
All devices:
- add support for rate adaptation via ieee80211_amrr(9);
- use short preamble for transmitted frames when needed;
- multi-bss support:
 * for RTL8821AU: 2 VAPs at the same time;
 * other: 1 any VAP + 1 sta VAP.
RTL8188CE:
- fix IQ calibration bug (reason of significant speed degradation);
- add h/w crypto acceleration support.
USB:
- A-MPDU Tx support;
- short GI support;
Other:
- add support for RTL8812AU / RTL8821AU chipsets
(a/b/g/n only; no ac yet);
- split merged code into subparts:
 * bus glue (usb/*, pci/*, rtl*/usb/*, rtl*/pci/*)
 * common (if_rtwn*)
 * chip-specific (rtl*/*)
- various other bugfixes.

Due to code reorganization, module names / requirements were changed too:
urtwn urtwnfw -> rtwn rtwn_usb rtwnfw
rtwn  rtwnfw  -> rtwn rtwn_pci rtwnfw

Tested with RTL8188CE, RTL8188CUS, RTL8188EU and RTL8821AU.

Tested by:	kevlo, garga,
		Peter Garshtja <peter.garshtja@ambient-md.com>,
		Kevin McAleavey <kevin.mcaleavey@knosproject.com>,
		Ilias-Dimitrios Vrachnis <id@vrachnis.com>,
		<otacilio.neto@bsd.com.br>
Relnotes:	yes
2016-10-17 20:38:24 +00:00
Hans Petter Selasky
d3bf5efc1f Fix device delete child function.
When detaching device trees parent devices must be detached prior to
detaching its children. This is because parent devices can have
pointers to the child devices in their softcs which are not
invalidated by device_delete_child(). This can cause use after free
issues and panic().

Device drivers implementing trees, must ensure its detach function
detaches or deletes all its children before returning.

While at it remove now redundant device_detach() calls before
device_delete_child() and device_delete_children(), mostly in
the USB controller drivers.

Tested by:		Jan Henrik Sylvester <me@janh.de>
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D8070
MFC after:		2 weeks
2016-10-17 10:20:38 +00:00
Warner Losh
013da020e2 Assume all coreboot BIOSes have the need for these workarounds because
coreboot implements the keyboard controller and it's common to all
Chromebooks. The workaround won't hurt and may help.
2016-10-17 04:07:12 +00:00
Luigi Rizzo
a9e644cd24 add two missing files for the netmap import 2016-10-16 15:22:17 +00:00
Luigi Rizzo
37e3a6d349 Import the current version of netmap, aligned with the one on github.
This commit, long overdue, contains contributions in the last 2 years
from Stefano Garzarella, Giuseppe Lettieri, Vincenzo Maffione, including:
+ fixes on monitor ports
+ the 'ptnet' virtual device driver, and ptnetmap backend, for
  high speed virtual passthrough on VMs (bhyve fixes in an upcoming commit)
+ improved emulated netmap mode
+ more robust error handling
+ removal of stale code
+ various fixes to code and documentation (some mixup between RX and TX
  parameters, and private and public variables)

We also include an additional tool, nmreplay, which is functionally
equivalent to tcpreplay but operating on netmap ports.
2016-10-16 14:13:32 +00:00
Konstantin Belousov
e4b9ff3a9e Do not try to create /dev/efi device node before devfs is initialized.
Split efirt.ko initialization into early stage where runtime services
KPI environment is created, to be used e.g. for RTC, and the later
devfs node creation stage, per module.

Switch the efi device to use make_dev_s(9) instead of make_dev(9).  At
least, this gracefully handles the duplicated device name issue.

Remove ARGSUSED comment from efidev_ioctl(), all unused arguments are
annotated with __unused attribute.

Reported by:	ambrisko, O. Hartmann <ohartman@zedat.fu-berlin.de>
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2016-10-16 06:07:43 +00:00
Jared McNeill
72f1cf0446 Add driver for GPIO controlled regulator.
Reviewed by:		gonzo, manu, mmel
Differential Revision:	https://reviews.freebsd.org/D8257
2016-10-15 20:04:14 +00:00
Andriy Gapon
2698bbbb5a aibs / atk0110: add support for querying sensors via GGRP and GITM
Comparing to the Linux driver there is still one missing feature.
The Linux driver finds and enables "Embedded Controller" item in
the 0x11 group if it's not enabled yet.

I tested the new method, Torfinn Ingolfsen tested the old method
and helped to fix several bugs in the earlier versions of the patch.

Tested by:	Torfinn Ingolfsen <torfinn.ingolfsen@getmail.no>
Reviewed by:	rpaulo
MFC after:	3 weeks
Differential Revision: https://reviews.freebsd.org/D8227
2016-10-15 09:10:35 +00:00
Sepherosa Ziehau
4e3e6410ad hyperv/vmbus: Add __FBSDID
Sponsored by:	Microsoft
2016-10-14 05:47:59 +00:00
Sepherosa Ziehau
857d55affe hyperv/hn: Management parts always need suspend and resume.
MFC after:	3 days
Sponsored by:	Microsoft
2016-10-14 05:41:51 +00:00
Sepherosa Ziehau
e52a79e5c1 hyperv/stor: Fix off-by-one bug; this brings back TRIM support.
Submitted by:	Hongjiang Zhang <honzhan microsoft com>
Reported by:	Lili Deng <v-lide microsoft com>
MFC after:	3 days
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8238
2016-10-14 05:32:47 +00:00
Navdeep Parhar
721f5406c8 cxgbe(4): Allow the interface MTU to be set as high as the actual
hardware limit.

Submitted by:	jpaetzel@
Differential Revision:	https://reviews.freebsd.org/D8237
2016-10-13 19:40:21 +00:00
Konstantin Belousov
5975e53d40 Fix a race in vm_page_busy_sleep(9).
Suppose that we have an exclusively busy page, and a thread which can
accept shared-busy page.  In this case, typical code waiting for the
page xbusy state to pass is
again:
	VM_OBJECT_WLOCK(object);
	...
	if (vm_page_xbusied(m)) {
		vm_page_lock(m);
 		VM_OBJECT_WUNLOCK(object);    <---1
		vm_page_busy_sleep(p, "vmopax");
 		goto again;
	}

Suppose that the xbusy state owner locked the object, unbusied the
page and unlocked the object after we are at the line [1], but before we
executed the load of the busy_lock word in vm_page_busy_sleep().  If it
happens that there is still no waiters recorded for the busy state,
the xbusy owner did not acquired the page lock, so it proceeded.

More, suppose that some other thread happen to share-busy the page
after xbusy state was relinquished but before the m->busy_lock is read
in vm_page_busy_sleep().  Again, that thread only needs vm_object lock
to proceed.  Then, vm_page_busy_sleep() reads busy_lock value equal to
the VPB_SHARERS_WORD(1).

In this case, all tests in vm_page_busy_sleep(9) pass and we are going
to sleep, despite the page being share-busied.

Update check for m->busy_lock == VPB_UNBUSIED in vm_page_busy_sleep(9)
to also accept shared-busy state if we only wait for the xbusy state to
pass.

Merge sequential if()s with the same 'then' clause in
vm_page_busy_sleep().

Note that the current code does not share-busy pages from parallel
threads, the only way to have more that one sbusy owner is right now
is to recurse.

Reported and tested by:	pho (previous version)
Reviewed by:	alc, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D8196
2016-10-13 14:41:05 +00:00
Andriy Gapon
f1519c0157 convert iicsmb to use iicbus_transfer for all operations
Previously the driver used more low level operations like iicbus_start
and iicbus_write.  The problem is that those operations are not
implemented by iicbus(4) and the calls were effectively routed to
a driver to which the bus is attached.
But not all of the controllers implement such low level operations
while all of the drivers are expected to have iicbus_transfer.

While there fix incorrect implementation of iicsmb_bwrite and iicsmb_bread.
The former should send a byte count before the actual bytes, while the
latter should first receive the byte count and then receive the bytes.

I have tested only these commands:
- quick (r/w)
- send byte
- receive byte
- read byte
- write byte

MFC after:	1 month
Differential Revision: https://reviews.freebsd.org/D8170
2016-10-13 07:25:18 +00:00
Warner Losh
b2a7ac4802 Fix building on i386 and arm. But 'public domain' headers on the files
with no creative content. Include "lost" changes from git:
o Use /dev/efi instead of /dev/efidev
o Remove redundant NULL checks.

Submitted by: kib@, dim@, zbb@, emaste@
2016-10-13 06:56:23 +00:00
Andriy Voskoboinyk
bdc7291ec9 net80211: convert all ieee80211_input_mimo*() consumers
to ieee80211_add_rx_params() + drop last (ieee80211_rx_stats) parameter

Note: there is an additional check for ieee80211_get_rx_params()
return value (which does not exist in the original diff).

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D8207
2016-10-12 20:50:13 +00:00
Oleksandr Tymoshenko
968d859d09 [fdt] Add one more heuristic to determine MAC address of the SMSC device
- If check for net,ethernet/usb,device compatible node fails, try to find
    .../usb/hub/ethernet, where ... is bus path that can depend on actual HW.
    net,ethernet/usb,device compatibity strings are FreeBSD custom invention
    that is used only in RPi DTBs and since there is no other way to tie USB
    device to FDT node we just do our best effort here to work with upstream
    device tree

- Use -1 value to indicate invalid phandle_t, 0 is valid phandle value and
    shouldn't be used as error signal
2016-10-12 19:53:10 +00:00
Ed Maste
c874ff0f63 Use M_WAITOK in PIO_KEYMAP ioctl
The malloc return value is not checked.

Submitted by:	CTurt <ecturt@gmail.com>
MFC after:	1 week
2016-10-12 12:56:18 +00:00
Andriy Gapon
94dce59911 smbus: allow child devices to be added via hints
This will allow to add slave drivers in the same fashion as for iicbus.

Also, allow other code to add a child device and set its 'addr' ivar.
The ivar can only be set if it's unset, it can not be changed.
That could be used, for example, by a platform driver that has
a precise description of the hardware and, thus, knows what drivers
can handle what slaves.

The slave auto-probing code is unsafe and broken because it uses
7-bit slave addresses.  It's going to be removed.

Note: internally the driver uses address of zero as an unset address
while smbus_get_addr() returns it as -1 for compatibility reasons.
The address is expected to be unset only for children that do not
work with slaves like, for example, smb(4).

Reviewed by:	jhb
Differential Revision: https://reviews.freebsd.org/D8173
2016-10-12 06:58:01 +00:00
Oleksandr Tymoshenko
bf798f819a Make BCM28x USB driver compatible with upstream device tree
This should have been committed in r307093: resource allocation depends
on source of the device tree. upstream dts has extra interrupt that we can
ignore
2016-10-12 03:36:46 +00:00
Warner Losh
f79d484dff Create /dev/efidev to provide an ioctl interface to
userland.  It supports userland interfaces to UEFI Runtime Services. This is
indended to the the MI portion of EFI RuntimeServices support.

Differential Revision: https://reviews.freebsd.org/D8128
Reviewed by: kib@, wblock@, Ganael Laplanche
2016-10-11 22:24:30 +00:00
Andrew Rybchenko
b36a7ad2c9 sfxge(4): update external port mapping for Medford
Extend the mapping table for external port numbering to support port modes
which output to the second external port only. Where supported, map from
the current port mode rather than inferring from all the available modes.
Updated comments for clarity.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D8210
2016-10-11 13:08:48 +00:00
Sepherosa Ziehau
4afe249835 hyperv/hn: Rework link status support.
This is the preamble for network device SR-IOV and
NDIS_STATUS_NETWORK_CHANGE handling.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8209
2016-10-11 02:54:56 +00:00
Sepherosa Ziehau
cca23e7c3c hyperv/vmbus: Allow driver to inject synchronous task into channel taskq.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8208
2016-10-11 02:43:23 +00:00
Andrew Rybchenko
622429035a sfxge(4): sync tlv_layout.h with firmwaresrc and update port-mode definition use
It fixes driver attach issue to a new firmware which reports a new
port-modes.

Reviewed by:    gnn
Submitted by:   Tom Millington <tmillington at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D8203
2016-10-10 09:54:01 +00:00
Sepherosa Ziehau
5d67f6752b hyperv/hn: Suffix NDIS offload size with NDIS version.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8091
2016-10-10 06:14:38 +00:00
Sepherosa Ziehau
43147058fd hyperv/hn: Generalize RSS capabilities query.
- Support NDIS < 6.30.
- Stringent response checks.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8090
2016-10-10 05:59:30 +00:00
Sepherosa Ziehau
c21d553cfa hyperv/hn: Fix if_hw_tsomax setup.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8089
2016-10-10 05:50:01 +00:00
Sepherosa Ziehau
65ca331080 hyperv/hn: Fix checksum offload settings
The _correct_ way to identify the supported checksum offloading and
TSO parameters is to query OID_TCP_OFFLOAD_HARDWARE_CAPABILITIES.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8088
2016-10-10 05:41:39 +00:00
Andriy Voskoboinyk
4623c73135 iwm: add missing 'Rx errors' counter incrementation. 2016-10-09 10:21:28 +00:00
Andriy Voskoboinyk
3f3d4d6100 wpi: restore frame header before submitting an mbuf to
ieee80211_tx_complete()

This change allows to pass packet length to rate control modules and
fixes IFCOUNTER_OBYTES calculation.

Tested with Intel 3945BG, STA mode.
2016-10-08 20:41:08 +00:00
Oleksandr Tymoshenko
c736a75712 Implement EVDEV_FLAG_MT_AUTOREL flag (autorelease touchpoints)
Automaticaly release (send ABS_MT_TRACKING_ID = -1) MT-slots
that has not been listed in current MT protocol type B report.

Slot is counted as listed if corresponding ABS_MT_SLOT event
has been sent regardless of other MT events.

Events are sent on SYN_REPORT event.

Submitted by:	Vladimir Kondratiev <wulf@cicgroup.ru>
2016-10-08 17:59:53 +00:00
Oleksandr Tymoshenko
bfbd1bb744 Allow using of driver's mutex instead internal one for evdev locking.
Add new API call: evdev_register_mtx which takes lock argument that
should be used instead of internal one for evdev locking. Useful for
cases if evdev_push_event() is always called with driver's lock taken
and reduces amount of lock aquisitions. This allows to avoid LOR
between ev_open/ev_close invocations and evdev_push_event() Such LOR
can happen when ev_open/ev_close methods acquire driver lock and
evdev_push_event() is called with this lock taken.

Submitted by:	Vladimir Kondratiev <wulf@cicgroup.ru>
2016-10-08 17:58:26 +00:00
Adrian Chadd
e97796e2b6 [net80211] extend the ieee80211_rx_stats struct to include more information.
There are a variety of more interesting RX statistics that we should
keep track of but we don't.  This is a starting point for adding more
information.

Specifically:

* now the RX rate information and some of the packet status is
  passed up;
* The 32 bit or 64 bit TSF is passed up;
* the PHY mode is passed up;
* the "I'm decap'ed AMSDU!" state is passed up;
* number of RX chains is bumped to 4.

This is all mostly a placeholder for getting the data into the RX status
before we pass it up to net80211 - unfortunately we don't yet enforce
that drivers provide it, nor do we pass the provided info back up the
stack so anyone can use the data.

We're going to need to use some of this data moving forward.
Notably, now that some hardware can do AMSDU decap for us (the intel iwm
driver can do it when we flip it on; the ath10k port I'm doing does
it for us) then we need to pass it up through the stack so the duplicate
RX sequence numbers and crypto/IV details don't cause the packet to
be dropped and/or counted against a replay counter.

It's also the beginning of being able to do more interesting node
accounting in net80211.  Specifically, once drivers start populating
per-packet rate information, AMPDU information, timestamps, etc,
we can start providing histograms of rate-versus-RSSI, account
for receive time spent per node and other such interesting things.

(Note: I'm also hoping to include ranging and RTT information for
future chipset support; and it's likely going to include it in
this kind of fashion.)
2016-10-08 01:12:29 +00:00
Navdeep Parhar
35b5ef914c cxgbe(4): Add an ioctl to copy a firmware config file to the card's flash. 2016-10-07 19:02:39 +00:00
David C Somayajulu
da834d52c1 Add support for adding up to 64 Multicast addresses with a single
mailbox command

MFC after:5 days
2016-10-06 21:39:04 +00:00
Navdeep Parhar
d4d953bf37 cxgbe(4): Fix whitespace in the pm_stats display. 2016-10-06 21:25:17 +00:00
Sean Bruno
87de0cd185 Move netmap selinfo.h in to sensible location.
netmap_kern.h currently requires all drivers including it to include
selinfo.h.

Submitted by:	mmacy@nextbsd.org
Reviewed by:	gnn
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D5334
2016-10-06 17:54:34 +00:00
Oleksandr Tymoshenko
0901b57792 Fix extended buttons support on synaptic clickpad
Fix regression introduced by r306355 on synaptic clickpads with
extended buttons (buttons stopped working)

PR:		205690
Submitted by:	Vladimir Kondratyev <wulf@cicgroup.ru>
2016-10-06 01:01:00 +00:00
Jung-uk Kim
493deb390b Merge ACPICA 20160930. 2016-10-04 20:27:15 +00:00
Gleb Smirnoff
37d0ac15e6 Fix indentation.
CID:	1363671
2016-10-04 16:44:40 +00:00
Oleksandr Tymoshenko
5163e77fad const-ify struct evdev_methods
Submitted by:	Vladimir Kondratiev <wulf@cicgroup.ru>
Suggested by:	hselasky
2016-10-03 17:20:34 +00:00
Andriy Voskoboinyk
f6930bec33 net80211: ieee80211_ratectl*: switch to reusable KPI
Replace various void * / int argument combinations with common structures:
- ieee80211_ratectl_tx_status for *_tx_complete();
- ieee80211_ratectl_tx_stats for *_tx_update();

While here, improve amrr_tx_update() for a bit:
1. In case, if receiver is not known (typical for Ralink USB drivers),
refresh Tx rate for all nodes on the interface.
2. There was a misuse:
- otus(4) sends non-decreasing counters (as originally intended);
- but ural(4), rum(4) and run(4) are using 'read & clear' registers
to obtain statistics for some period of time (and those 'last period'
values are used as arguments for tx_update()). If arguments are not big
enough, they are just discarded after the next call.

Fix: move counting into *_tx_update()
(now otus(4) will zero out all node counters after every tx_update() call)

Tested with:
- Intel 3945BG (wpi(4)), STA mode.
- WUSB54GC (rum(4)), STA / HOSTAP mode.
- RTL8188EU (urtwn(4)), STA mode.

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D8037
2016-10-02 20:35:55 +00:00
Warner Losh
604d83bdce Implement iicbus_write_ivar and impelemnt the NOSTOP ivar in both read
and write.
2016-10-02 17:36:55 +00:00
Oleksandr Tymoshenko
a6b15a3429 Modularize evdev
- Convert "options EVDEV" to "device evdev" and "device uinput", add
    modules for both new devices. They are isolated subsystems and do not
    require any compile-time changes to general kernel subsytems
- For hybrid drivers that have evdev as an optional way to deliver input
    events add option EVDEV_SUPPORT. Update all existing hybrid drivers
    to use it instead of EVDEV
- Remove no-op DECLARE_MODULE in evdev, it's not required, MODULE_VERSION
    is enough
- Add evdev module dependency to uinput

Submitted by:	Vladimir Kondratiev <wulf@cicgroup.ru>
2016-10-02 03:20:31 +00:00
Oleksandr Tymoshenko
886f6623f6 Fix gcc compilation error
input_absinfo.code is unsigned so condition is always false
2016-10-02 03:06:58 +00:00
Eric van Gyzen
fb6ddd454a lmc(4): fix the build without the bpf device
"make buildkernel" now works with and without "device bpf".

Reported by:	Dave Mischler <dave@mischler.com>
MFC after:	3 days
Sponsored by:	Dell EMC
2016-10-01 22:21:10 +00:00
Oleksandr Tymoshenko
2685a39acf Provide way for framebuffer driver to request mmap(2) mapping type
On ARM if memattr is not overriden mmap(2) maps framebuffer
memory as WBWA which means part of changes to content in userland
end up in cache and appear on screen gradually as cache lines are
evicted. This change adds configurable memattr that hardware fb
implementation can set to get the memory mapping type it
requires:

- Add new flag FB_FLAG_MEMATTR that indicates that framebuffer
    driver overrides default memattr
- Add new field fb_memattr to struct fb_info to specify requested
    memattr

Reviewed by:	ray
Differential Revision:	https://reviews.freebsd.org/D8064
2016-10-01 17:43:02 +00:00
Justin Hibbits
a3ee15f9bf Revert r306473.
Some objections were noted, and it was purely a cosmetic change anyway.
2016-10-01 01:10:51 +00:00
Oleksandr Tymoshenko
fa26e8edee Declare a module for evdev and add dependency to ukbd(4) and ums(4)
Prepare for making evdev a module. "Pure" evdev device drivers (like
touchscreen) and evdev itself can be built as a modules regardless of
"options EVDEV" in kernel config. So if people does not require evdev
functionality in hybrid drivers like ums and ukbd they can, for instance,
kldload evdev and utouchscreen to run FreeBSD in kiosk mode.
2016-09-30 21:04:56 +00:00
David C Somayajulu
999a0d8658 Upgrade Firmware/Bootloader/ResetSeq/Minidump to revision 5.4.62
MFC after:5 days
2016-09-30 19:21:02 +00:00
David C Somayajulu
106961b640 Revert commit
r306284 - Fixes for issues under high workloads

Will fix and recommit patch
2016-09-30 18:08:16 +00:00
Andriy Voskoboinyk
d6c3624cce ral (rt2860): eliminate duplicate ieee80211_process_callback() call
(left after r287197)

MFC after:	1 week
2016-09-30 13:37:50 +00:00
Hans Petter Selasky
97549c34ec Move the ConnectX-3 and ConnectX-2 driver from sys/ofed into sys/dev/mlx4
like other PCI network drivers. The sys/ofed directory is now mainly
reserved for generic infiniband code, with exception of the mthca driver.

- Add new manual page, mlx4en(4), describing how to configure and load
mlx4en.

- All relevant driver C-files are now prefixed mlx4, mlx4_en and
mlx4_ib respectivly to avoid object filename collisions when compiling
the kernel. This also fixes an issue with proper dependency file
generation for the C-files in question.

- Device mlxen is now device mlx4en and depends on device mlx4, see
mlx4en(4). Only the network device name remains unchanged.

- The mlx4 and mlx4en modules are now built by default on i386 and
amd64 targets. Only building the mlx4ib module depends on
WITH_OFED=YES .

Sponsored by:	Mellanox Technologies
2016-09-30 08:23:06 +00:00
Sepherosa Ziehau
1a3c881209 hyperv/hn: Add stubs for OFFLOAD_CURRENT_CONFIG and NETWORK_CHANGE status
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8068
2016-09-30 06:58:45 +00:00
Sepherosa Ziehau
2530eba1c4 hyperv/hn: Fix detach and attach error handling.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8066
2016-09-30 06:30:16 +00:00
Sepherosa Ziehau
fed9f4df75 hyperv/hn: If synthetic parts are detached, don't touch them.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8065
2016-09-30 06:21:00 +00:00
Hans Petter Selasky
2cb568fc23 Add new USB ID.
While at it remove some whitespaces.

Submitted by:	Jose Luis Duran <jlduran@gmail.com>
PR:		213110
MFC after:	1 week
2016-09-30 05:28:11 +00:00
Oleksandr Tymoshenko
da464e7181 Replace explicit TUNABLE_INT to sysctl with CTLFLAG_TUN
- Replace tunables-only hw.psm.synaptics_support, hw.psm.trackpoint_support,
    and hw.psm.elantech_support with respective sysctls declared with
    CTLFLAG_TUN. It simplifies checking them in userland, also makes them
    easier to get discovered by user
- Get rid of debug.psm.loglevel and hw.psm.tap_enabled TUNABLE_INT
    declaration by adding CTLFLAG_TUN to read/write sysctls that were
    already declared for these tunables.

Suggested by: jhb
2016-09-30 03:03:42 +00:00
Justin Hibbits
0ca922cad9 Use the cell-index property as the unit number if available.
Summary:
NXP/Freescale, among others, includes an optional cell-index property
on nodes to denote the SoC block number of the node.  This can be useful if, for
example, a node is disabled or nonexistent in the fdt, or the blocks are not
organized in address-sorted order.  For instance, on the P1022, DMA2 is located
at CCSR offset 0xC000, while DMA1 is located at 0x21000.

Reviewed By: jmcneill

Differential Revision: https://reviews.freebsd.org/D8054
2016-09-30 02:48:40 +00:00
Navdeep Parhar
4e6b9efc86 cxgbe(4): Claim the T6 -DBG card. 2016-09-30 00:16:54 +00:00
Hans Petter Selasky
478c1a9932 Set hardware stats flag to avoid double counting the number of incoming bytes.
Found by:	Ben RUBSON <ben.rubson@gmail.com>
Sponsored by:	Mellanox Technologies
MFC after:	1 week
2016-09-29 16:35:52 +00:00
Eitan Adler
eb1c1a7f24 Remove a a duplicated word. 2016-09-29 13:59:14 +00:00
Sepherosa Ziehau
a53b5f81c2 hyperv/hn: Don't set HASHVAL pktinfo for NDIS < 6.30
This unbreaks packet sending on WS2008R2.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8057
2016-09-29 05:13:58 +00:00
Sepherosa Ziehau
e77ed95960 hyperv/hn: Consolidate hn_init() and hn_stop()
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8056
2016-09-29 05:01:20 +00:00
Sepherosa Ziehau
2f8350c30f hyperv/hn: Move TX tasks' draining into hn_suspend().
This prepares to consolidate hn_stop() and netvsc_detach().

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8055
2016-09-29 04:53:21 +00:00
Sepherosa Ziehau
cdf2c7a5da hyperv/storvsc: Fix the blkvsc disk attachment issues.
- The original 'disengage' ATA controller model does not work properly
  for all possible disk configurations.  Use the newly added ATA disk
  veto eventhandler to fit into all possible disk configuration.
- If the 'invalid LUN' happens on blkvsc controllers, return
  CAM_DEV_NOT_THERE so that CAM will not destroy attached disks under
  the blkvsc controllers.

Submitted by:	Hongjiang Zhang <honzhan microsoft com>
Discussed with:	mav
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7693
2016-09-29 01:41:52 +00:00
Sepherosa Ziehau
2f1f7f4527 hyperv/hn: Flatten RX filter configuration.
This paves way for more fixes.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8049
2016-09-28 05:12:09 +00:00
Sepherosa Ziehau
ec3eaa6fb0 hyperv/hn: Reorder the comment a little bit.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8048
2016-09-28 05:01:53 +00:00
Sepherosa Ziehau
c04dad64e2 hyperv/hn: Reorganize the synthetic parts detach.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8047
2016-09-28 04:45:00 +00:00
Sepherosa Ziehau
65fe5a4627 hyperv/hn: Suspend and resume the backend properly upon MTU change.
Suspend:
- Prevent the backend from being touched on TX path.
- Clear the RNDIS RX filter, and wait for RX to drain.
- Make sure that NVS see the chimney sending buffer and RXBUF
  disconnection, before unlink these buffers from the channel.

Resume:
- Reconfigure the RNDIS filter.
- Allow TX path to work on the backend.
- Kick start the TX eof task, in case the OACTIVE is set.

This fixes various panics, when the interface has traffic and MTU
is being changed.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8046
2016-09-28 04:34:21 +00:00
Sepherosa Ziehau
c8e8d13398 hyperv/vmbus: Add function to drain channel interrupt task.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8045
2016-09-28 04:25:25 +00:00
Sepherosa Ziehau
e8223cc6cf hyperv/vmbus: Add functions to test RX/TX bufring emptiness
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8044
2016-09-28 04:08:20 +00:00
Sepherosa Ziehau
9f06037b0d hyperv/vmbus: Add dynamic device add and remove support
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8008
2016-09-27 06:30:24 +00:00
Sepherosa Ziehau
4d6e19e457 pci: Clear the MEM/PORT_EN bit when updating PCI BAR
It's unsafe to update the BAR when the related EN bit is set.

Submitted by:	Dexuan Cui <decui microsoft com>
Reviewed by:	jhb
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7914
2016-09-27 06:00:10 +00:00
Oleksandr Tymoshenko
0fe98e8f2c Add Elantech trackpad support
Elantech trackpads are found in some laptops like the Asus UX31E. They
are "synaptics compatible" but use a slightly different protocol.

Elantech hardware support is not enabled by default and just like
Synaptic or TrackPoint devices it should be enabled by setting
tunable, in this case hw.psm.elantech_support, to non-zero value

PR:		205690
Submitted by:	Vladimir Kondratyev <wulf@cicgroup.ru>
MFC after:	1 week
2016-09-26 22:06:19 +00:00
Adrian Chadd
3e0d0fcee9 [ath_hal] add a new regdomain flag - I think this means "yes, you can use this
NIC in channel 144 if you're in FCC6."

I have to go figure out more details about this before I enable it..
2016-09-26 02:05:02 +00:00
Adrian Chadd
5b06614ce3 [ath_hal] add a comment for the channel 144 regdomain flag.
I'm .. still trying to figure out what's going on.
2016-09-25 22:17:46 +00:00
Adrian Chadd
85bc19eb22 [ath_hal] Add FCC6_FCCA regulatory domain (0x0014).
Tested:

* TP-Link N900, AR9380, regdomain 0x0014 (FCC6_FCCA).
2016-09-25 22:07:41 +00:00
Andriy Voskoboinyk
fbc9d202d8 rsu: do not restart calibration task when going out of RUN state.
Clear 'sc_calibrating' flag and stop calibration task when interface
is not associated; this fixes possible panic after detach.

Reported and tested by:	hselasky
Reviewed by:	adrian
MFC after:	6 days
2016-09-25 19:13:07 +00:00
Navdeep Parhar
788f3c06f6 cxgbe(4): Use the port's top speed to figure out whether it is "high
speed" or not (for the purpose of calculating the number of queues etc.)
This does the right thing for 25Gbps and 100Gbps ports.
2016-09-24 19:03:05 +00:00
Navdeep Parhar
d44268d135 cxgbe(4): Support SIOGIFXMEDIA so that ifconfig displays correct media
for 25Gbps and 100Gbps ports.   This should have been part of r305713,
which is when the driver first started reporting extended media types.
2016-09-24 13:23:47 +00:00
Andriy Gapon
b2b4f88476 the rest of changes intended to be committed in r306290
MFC after:	5 days
X-MFC with:	r306218
2016-09-24 07:59:54 +00:00
Andriy Gapon
149a5d40c9 clarify description of the 0x790b1022 / "KERNCZ"/ "CZ" device
MFC after:	5 days
X-MFC with:	r306218
2016-09-24 07:55:49 +00:00
Justin Hibbits
4332304f56 Fix ds1307 probing
'compat' can never be NULL, because the compatible check loop ends when
compat->ocd_str is NULL.  This causes ds1307 to attach to any unclaimed i2c
device.
2016-09-24 05:27:12 +00:00
Landon J. Fuller
8a03f98a8b bhnd(4): Implement common API for IOST/IOCTL register access and core reset
- Added bhnd(4) bus APIs for per-core ioctl/iost register access.
- Updated reset/suspend bhnd(4) APIs for compatibility with ioctl/iost
  changes.
- Implemented core reset/suspend support for both bcma(4) and siba(4).
- Implemented explicit release of all outstanding PMU requests at the bus
  level when putting a core into reset.

Approved by:    adrian (mentor, implicit)
Differential Revision:  https://reviews.freebsd.org/D8009
2016-09-24 04:08:16 +00:00
Adrian Chadd
6f87599bdf [iwm] fix default antenna selection a bit; fix 5GHz rate control handling.
* Don't do the antenna switching when setting up the rate table - we don't
  take into account whether it's an active antenna or not (eg shared with BT.)
  I'll look into this a bit more later.

* The default antenna is still 1, I'll look into that a bit more later.
  (So no, this doesn't fix it for Larry who needs ANT_B to be active, not
  ANT_A.)

* My changes to the rate control setup used the wrong method for finding
  a suitable rate, which led to 1M CCK frames being queued for 11a operation.
  This is .. sub-optimal.  Change the rate control lookup path to use
  the global table instead of the per-node table, which won't be setup
  until the node rate table is setup (which happens way too late in this
  game.)

Tested:

* Intel 7260, 2G and 5G operation.
2016-09-24 01:21:42 +00:00
David C Somayajulu
678b8d82ee Fixes for issues under high workloads
MFC after:5 days
2016-09-23 23:18:54 +00:00
Navdeep Parhar
aa93b99aa0 cxgbe(4): Make the location/length of all descriptor rings available in
the sysctl MIB.
2016-09-23 20:03:28 +00:00
Oleksandr Tymoshenko
7dd7ec2c6b Do not perform extra check for NULL, evdev_free can handle NULL value
Submitted by:	Vladimir Kondratiev <wulf@cicgroup.ru>
2016-09-23 18:55:32 +00:00
Oleksandr Tymoshenko
c3f2135cfc Handle NULL argument in evdev_free
Add check for evdev argument of evdev_free being NULL. This is valid
value and should not cause crash. In this case evdev_free does nothing

Submitted by:	Vladimir Kondratiev <wulf@cicgroup.ru>
2016-09-23 18:54:08 +00:00
Navdeep Parhar
3cdfcb51aa cxgbe(4): Fix netmap with T6, which doesn't encapsulate SGE_EGR_UPDATE
message inside a FW_MSG.  The base NIC already deals with updates in
either form.

Sponsored by:	Chelsio Communications
2016-09-23 17:24:06 +00:00
Andrew Turner
0a4c0732a9 Restrict where we need to define fdt_fixup_table to just PowerPC and
Marvell.

Sponsored by:	ABT Systems Ltd
2016-09-23 14:11:23 +00:00
Josh Paetzel
c2625e6e38 Update oce to version 11.0.50.0
Submitted by:	Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
2016-09-22 22:51:11 +00:00
Andriy Gapon
3673f7136a amdsbwd, intpm: unify bits specific to AMD chipsets (FCHs, southbridges)
AMD chipsets have proprietary mechanisms for dicovering resources.
Those resources are not discoverable via plug-and-play mechanisms
like PCI configuration registers or ACPI.
For this reason a chipset-specific knowledge of proprietary registers
is required.

At present there are two FreeBSD drivers that require the proprietary
resource discovery.  One is amdsbwd which is a driver for the watchdog
timer in the AMD chipsets.  The other is intpm SMBus driver when it
attaches to the newer AMD chipsets where the resources of the SMBus HBA
are not described in the regular PCI way.

In both cases the resources are discovered by accessing AMD PMIO space.
Thus, many definitions are shared between the two drivers.
This change puts those defintions into a common header file.

As an added benefit, intpm driver now supports newest FCHs built into
AMD processors of Family 15h, models 70h-7Fh and Family 16h, models
30h-3Fh.

Reviewed by:	kib
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D8004
2016-09-22 21:34:35 +00:00
Navdeep Parhar
de58013128 cxgbe(4): Fix the output of the "tids" sysctl on T6. 2016-09-22 21:19:25 +00:00
Navdeep Parhar
d4759c89e5 cxgbe(4): Catch up with the different layout of WHOAMI in T6.
Note that the code moved below t4_prep_adapter() as part of this change
because now it needs a working chip_id().
2016-09-22 18:47:07 +00:00
Luiz Otavio O Souza
38d1af45cd Add the ID for the Huawei ME909S LTE modem.
Submitted by:	svenauhagen at github
MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC (Netgate)
2016-09-22 18:45:25 +00:00
Kevin Lo
32f7d047c3 Add TP-Link Archer T4U.
It will be used by the updated rtwn(4) / urtwn(4) driver.
2016-09-22 09:33:22 +00:00
Conrad Meyer
14410265b6 Revert r306148 to fix build
Requested by:	jpaetzel
Reported by:	Larry Rosenman <ler at lerctr.org>, Jenkins
2016-09-22 00:25:23 +00:00
Josh Paetzel
764c812d84 Update oce driver to 11.0.50.0
Submitted by:	Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
2016-09-21 22:53:16 +00:00
Adrian Chadd
cf4f71f1e5 [iwm] use rate control info from the node txrates; use mgmtrate for EAPOL frames
This changes the transmit rate control code to do a few things:

* use fixed rates (mcast, ucast, mgmt) where required.
* Don't use a hard-coded 11a or 11bg rate for non-data frames -
  use what net80211 says we should use.
* use mgmtrate for EAPOL frames.

Reviewed by:	avos
Differential Revision:	https://reviews.freebsd.org/D7994
2016-09-21 20:56:10 +00:00
Oleksandr Tymoshenko
c3af259a20 Add evdev support to ums(4)
event generation is disabled by default in favour of sysmouse. This
behavoiur is controlled by kern.evdev.rcpt_mask sysctl, bit 2 should
be set to give priority to hw over sysmouse

Submitted by:	Vladimir Kondratiev <wulf@cicgroup.ru>
Reviewed by:	hans
Differential Revision:	https://reviews.freebsd.org/D7863
2016-09-21 18:52:03 +00:00
Oleksandr Tymoshenko
10063b791c Add evdev support to ukbd driver
event generation is disabled by default in favour of kbdmux. This
behavoiur is controlled by kern.evdev.rcpt_mask sysctl, bit 3 should
be set to give priority to hw over mux

Submitted by:	Vladimir Kondratiev <wulf@cicgroup.ru>
Reviewed by:	hans
Differential Revision:	https://reviews.freebsd.org/D7957
2016-09-21 18:47:21 +00:00
John Baldwin
bd71669277 Fix invalid vendor ID constant (typo).
During a bus rescan the check for an invalid vendor ID of a subfunction
used the wrong constant.

Submitted by:	Dexuan Cui <decui@microsoft.com>
MFC after:	3 days
2016-09-21 16:51:56 +00:00
Kevin Lo
938e9a89c4 Add support for the TP-Link TG-3468 v2.
This is an RTL8168 chip, which we already support so all we have to do is add
the vendor ID.

PR:	212876
Submitted by:	Tobias Kortkamp <t@tobik.me>
MFC after:	3 days
2016-09-21 14:15:15 +00:00
Sepherosa Ziehau
b1699fab98 hyperv/hn: Put debug messages under bootverbose
While I'm here, strip blank line.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7963
2016-09-21 06:54:26 +00:00
Sepherosa Ziehau
d1c1d97e6a hyperv/vmbus: Assert that the bufring address is page aligned.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7962
2016-09-21 06:43:52 +00:00
Sepherosa Ziehau
7a7e4e4449 hyperv/hn: Allocate bufrings in attach DEVMETHOD.
So that reinitialization, e.g. MTU change, will not fail when the system
memory is excessively fragmented.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7961
2016-09-21 06:27:42 +00:00
Sepherosa Ziehau
9613ad24b0 hyperv/vmbus: Allow bufrings preallocation.
The assumption that the channel is only opened upon synthetic device
attach time no longer holds, e.g. Hyper-V network device MTU changes.
We have to allow device drivers to preallocate bufrings, e.g. in
attach DEVMETHOD, to prevent bufring allocation failure once the
system memory is fragmented after running for a while.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7960
2016-09-21 05:56:47 +00:00
Justin Hibbits
9ed9b26792 Add a ofw_parse_bootargs function, and use it for powerpc
Summary:
If the environment variable is set, U-boot adds a 'bootargs' property to
/chosen.  This is already handled by ARM and MIPS, but should be handled in a
central location.  For now, ofw_subr.c is a good place until we determine if it
should be moved to init_main.c, or somewhere more central to all architectures.

Eventually arm and mips should be modified to use ofw_parse_bootargs() as well,
rather than using the duplicate code already.

Reviewed By: adrian
Differential Revision: https://reviews.freebsd.org/D7846
2016-09-21 02:28:39 +00:00
Navdeep Parhar
8c0ca00b72 cxgbe(4): Setup congestion response for T6 rx queues. 2016-09-21 00:50:22 +00:00
Navdeep Parhar
6a0cae68b4 cxgbe(4): Show wcwr_stats for T6 cards. 2016-09-21 00:46:08 +00:00
Andriy Voskoboinyk
887a63246c net80211: remove IEEE80211_RADIOTAP_TSFT field from transmit definitions.
This field may be used for received frames only.

Differential Revision:	https://reviews.freebsd.org/D3826
Differential Revision:	https://reviews.freebsd.org/D3827
2016-09-20 18:53:42 +00:00
Ed Maste
6f70040b38 mrsas: update for sys/capability.h rename in r263232 2016-09-20 12:59:30 +00:00
Ed Maste
cec1957ae1 hwpmc: remove sys/capability.h backwards compatibility
The Capsicum header is installed as sys/capsicum.h in stable/10 as well.
2016-09-20 12:56:03 +00:00
Sepherosa Ziehau
fa8c981396 hyperv/storvsc: Fix SRB length setting.
This fixes disk discovery issue on WS2008R2 Hyper-V, which plagued
us since 10.2-release.

Reported by:	many
MFC after:	3 days
Sponsored by:	Microsoft
2016-09-20 08:52:45 +00:00
Sepherosa Ziehau
5260781e82 hyperv/hn: Let the caller of hn_nvs_doinit() do the error logging.
So that NVS version probing failure does not look too scary.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7950
2016-09-20 05:45:18 +00:00
Sepherosa Ziehau
a572f6042a hyperv/hn: Fix ifnet hwassist setup.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7948
2016-09-20 05:26:40 +00:00
Imre Vadász
bff11ce594 [iwm] Improve reliability of iwm_release on disassociation a bit.
* We need to first call ivp->iv_newstate(), to enqueue the deauth/deassoc
  mgmt frame, then flush the tx queue, before actually calling
  iwm_release().

* cycling a wlan connection via wpa_cli frontend to wpa_supplicant, by
  issuing disconnect and reconnect commandos works quite well.
  (There is still an issue when disconnecting/reconnecting too quickly)

* Reassociating or roaming via wpa_supplicant is still broken.

Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D7943
2016-09-19 22:36:30 +00:00
Imre Vadász
e4dc86e060 [iwm] Remove dead fw_totlen from struct iwm_fw_sects; clean up struct iwm_nvm_data.
* No functional change, none of these values were ever read.

* The values removed from struct iwm_nvm_data are only used for old dvm
  devices in Linux iwlwifi, and irrelevant to iwm hence.

Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D7945
2016-09-19 22:26:37 +00:00
Imre Vadász
0ba35431ee [iwm] Use IWM_DEFAULT_SCAN_CHANNELS define as default for sc_capa_n_scan_channels.
Approved by:	adrian (mentor)
Obtained from:	Linux iwlwifi
Differential Revision:	https://reviews.freebsd.org/D7938
2016-09-19 22:23:46 +00:00
Imre Vadász
22359652af [iwm] Remove deprecated scan API definitions.
* This removes deprecated scan API definitions, which have been unused
  since the upgrade to version 16 firmware in change r303327.

* Part of this change matches the header-file changes in Linux git commit
  1f9403863c080478ad78247c89b018e95bdfb027.

* No functional change.

Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D7937
2016-09-19 22:20:46 +00:00
Imre Vadász
fbb27a30bf [iwm] Remove wrappers around iwm_dma_contig_free() calls.
No functional changes.

Inspired by:	OpenBSD
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D7933
2016-09-19 22:16:03 +00:00
Imre Vadász
0cd7fa558e [iwm] Fix iwm_poll_bit() error value check in iwm_attach().
The iwm(4) iwm_poll_bit() function returns 1 on success, and 0 on failure,
whereas the iwl_poll_bit() in Linux iwlwifi returns < 0 on failure.

So the (ret < 0) check ended up ignoring any error returned by
iwm_poll_bit().

Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D7932
2016-09-19 22:13:08 +00:00
Imre Vadász
739e99ba69 [iwm] Fix off-by-one check in iwm_read_firmware().
This fixes a potential buffer overrun in the firmware parsing code.

Reported by:	Coverity
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D7931
2016-09-19 22:11:34 +00:00
Imre Vadász
ef81578c9f [iwm] Remove unused field from iwm_rx_data. Use uint32_t instead of enum type.
The wantresp field in struct iwm_rx_data has never been used for anything,
so we can just delete it.

Apparently struct iwm_sf_cfg_cmd was compiled correctly (using a 32bit
value to represent the enum), but it still seems like a very bad idea to use
an enum type in a __packed struct.

Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D7930
2016-09-19 22:08:47 +00:00
Imre Vadász
b47237ce60 [iwm] Use htole16 for policy field in struct iwm_time_event_cmd_v2.
The htole32 was working fine for little-endian machines, but would have
been broken on big-endian.

Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D7929
2016-09-19 22:06:00 +00:00
Andriy Voskoboinyk
07fa0846ca dev/usb: add USB IDs for Realtek 802.11ac wireless adapters.
They are will be used by the updated rtwn(4) / urtwn(4) driver.

Suggested by:	adrian
2016-09-19 18:36:26 +00:00
Navdeep Parhar
0459a175eb cxgbe(4): Fixes to wrq stats.
- Increment tx_wrs_copied in the correct place.
- Add tx_wrs_sspace to the sysctl MIB.

Sponsored by:	Chelsio Communications
2016-09-19 17:16:51 +00:00
Sepherosa Ziehau
8377ced7ee hyperv/hn: Allow RSS capability flipping upon attach/reinit.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7927
2016-09-19 07:47:56 +00:00
Sepherosa Ziehau
12fe8fd761 hyperv/hn: Stringent RSS sysctl checks
- Don't change RNDIS RSS configuration for RSS key sysctl, if the
  interface is not capable of RSS yet.
- Don't change RSS indirect table (both cached one and RNDIS RSS
  configuration), if the interface is not capable of RSS yet.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7924
2016-09-19 07:39:42 +00:00
Sepherosa Ziehau
6be919751f hyperv/hn: Don't allow MTU change, if it is not supported by the NVS.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7923
2016-09-19 07:32:08 +00:00
Sepherosa Ziehau
ae75f7ee26 hyperv/hn: Save capabilities for later use.
And don't allow capability changes during reinitialization, which
breaks too much static configuration.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7922
2016-09-19 07:17:43 +00:00
Sepherosa Ziehau
363b7d88f6 hyperv/hn: Don't allow NVS and NDIS version change upon reinitailization
NVS and NDIS version change would break too much assumption and static
configuration.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7919
2016-09-19 07:07:23 +00:00
Sepherosa Ziehau
7547506a79 hyperv/hn: Apply RSS indirect table fixup before configure RNDIS RSS.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7916
2016-09-19 06:46:22 +00:00
Landon J. Fuller
f75615f26f Split bcm_mipscore.c into bcm_bmips (BMIPS32/BMIPS3300) and bcm_mips74k
drivers.

The BMIPS32/BMIPS3300 cores use a register layout distinct from the MIPS74K
core, and are only found on siba(4) devices.

Reviewed by:	mizhka
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D7791
2016-09-18 21:28:09 +00:00
Sepherosa Ziehau
8084aabec1 hyperv/hn: Add sysctls to dynamic adjust RSS key and indirect table
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7890
2016-09-18 08:19:33 +00:00
Sepherosa Ziehau
b07c8af155 hyperv/hn: Don't mess up RSS key and indirect table after attachment.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7889
2016-09-18 08:10:40 +00:00
Sepherosa Ziehau
5bc2bbe347 hyperv/hn: Put debug message under bootverbose
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7875
2016-09-18 07:47:57 +00:00
Sepherosa Ziehau
174e02e003 hyperv/hn: Regroup ifnet setup code.
While I'm here, add comment along the attach DEVMETHOD.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7874
2016-09-18 07:37:59 +00:00
Adrian Chadd
4083793433 [iwm] fix up RSSI calculations for both scan results and normal RX operations.
* hard code a noise floor of -96 for now. The noise floor update code returns
  some "interesting" values that I can't map to anything useful right now.
* Ensure a default noise floor is set - otherwise the initial scan results
  have a noise floor of '0'.
* Fix up the RSSI calculation to be correctly relative to the noise floor.
  The RSSI routines return an absolute value in dBm - so fix this up.
* Cap RSSI values appropriately.
* Ensure we pass in a 1/2 dB unit value in to net80211.

Tested:

* Intel 7260, STA mode

iwm0: <Intel Dual Band Wireless AC 7260> mem 0xf1400000-0xf1401fff irq 17 at device 0.0 on pci2
iwm0: hw rev 0x140, fw ver 16.242414.0, address xx:xx:xx:xx:xx:xx
2016-09-18 05:07:18 +00:00
Navdeep Parhar
efe00fd923 cxgbe/t4_tom: Update the active/passive open code to support T6. Data
path works as-is.

Sponsored by:	Chelsio Communications
2016-09-17 23:08:49 +00:00
Landon J. Fuller
315cf4daba bhnd(4): Fix regression in BCM4331 SPROM pin reference counting.
In r304870, refcount handling was lifted out into a common OTP/SPROM code
path, but the refcount assertions in chipc_disable_sprom_pins() were not
updated accordingly; this triggered an assertion on BCM4331 devices when
releasing a SPROM pin reservation.

Approved by:	adrian (mentor, implicit)
2016-09-17 22:18:32 +00:00
Navdeep Parhar
b0c554c3a5 cxgbe/t4_tom: The SMAC entry for a VI is at a different location in the T6.
Sponsored by:	Chelsio Communications
2016-09-17 22:13:03 +00:00
Jakub Wojciech Klama
cb9813432a Create aliases for named virtio-console ports.
Make virtio_console(4) create `/dev/vtcon/<port_name>` alias pointing
to /dev/ttyVx.y upon receiving PORT_NAME (id = 7) event over the control
queue.

Approved by:	trasz
MFC after:	1 month
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D7182
2016-09-17 16:03:33 +00:00
Hans Petter Selasky
a2c320d7c7 mlx5en: Fix duplicate mbuf free-by-code.
When mlx5e_sq_xmit() returns an error code and the mbuf pointer is set,
we should not free the mbuf, because the caller will keep the mbuf in
the drbr. Make sure the mbuf pointer is correctly set upon function
exit.

Sponsored by:	Mellanox Technologies
MFC after:	1 week
2016-09-16 11:57:48 +00:00
Hans Petter Selasky
14997cc16a mlx5en: Remove unused pdev pointer.
Sponsored by:	Mellanox Technologies
MFC after:	1 week
2016-09-16 11:55:38 +00:00
Hans Petter Selasky
f5344e8333 mlx5en: Verify port type is ethernet before creating network device
Else the mlx5en driver might attach to infiniband ports.

Sponsored by:	Mellanox Technologies
MFC after:	1 week
2016-09-16 11:53:53 +00:00
Hans Petter Selasky
431fe47416 mlx5en: Allow setting the software MTU size below 1500 bytes
The hardware MTU size can't be set to a value less than 1500 bytes due
to side-band management support. Allow setting the software MTU size
below 1500 bytes, thus creating a mismatch between hardware and
software MTU sizes.

Sponsored by:	Mellanox Technologies
MFC after:	1 week
2016-09-16 11:51:31 +00:00
Hans Petter Selasky
7b4e6e4ac9 mlx5en: Factor out common sendqueue code for use with rate limiting SQs.
Try to reuse code to setup sendqueues when possible by making some static
functions global. Further split the mlx5e_close_sq_wait() function to
separate out reusable parts.

Sponsored by:	Mellanox Technologies
MFC after:	1 week
2016-09-16 11:47:16 +00:00
Hans Petter Selasky
81b3cdc1bb mlx5en: Properly declare doorbell lock for 32-bit CPUs.
Sponsored by:	Mellanox Technologies
MFC after:	1 week
2016-09-16 11:45:35 +00:00
Hans Petter Selasky
5eadc44ceb mlx5en: Optimise away duplicate UAR pointers.
This change also reduces the size of the mlx5e_sq structure so that the last
queue_state element will fit into the previous cacheline and then the mlx5e_sq
structure becomes one cacheline less for amd64.

Sponsored by:	Mellanox Technologies
MFC after:	1 week
2016-09-16 11:40:45 +00:00
Hans Petter Selasky
28f22ccea3 mlx5en: Make the mlx5e_open_cq() and mlx5e_close_cq() functions global.
Make some functions and structures global to allow for code reuse
when creating rate limiting sendqueues.

Sponsored by:	Mellanox Technologies
MFC after:	1 week
2016-09-16 11:39:15 +00:00
Hans Petter Selasky
941cd5d1a4 mlx5en: Minor completion queue control path code refactor.
Move setting of CQ moderation mode together with the other
CQ moderation parameters. Pass completion event vector as
a separate argument to mlx5e_open_cq(), because its value is
different for each call. Pass mlx5e_priv pointer instead of
mlx5e_channel pointer so that code can be used by rate
limiting sendqueues.

Sponsored by:	Mellanox Technologies
MFC after:	1 week
2016-09-16 11:37:35 +00:00