Commit Graph

29765 Commits

Author SHA1 Message Date
Adrian Chadd
99feb20233 run(4): Add initial support for IBSS merge.
Submitted by:	<s3erios@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D3592
2015-10-03 15:48:21 +00:00
Adrian Chadd
30c00a2d89 Remove beacon offsets usage from if_rum.
Differential Revision: https://reviews.freebsd.org/D3658
2015-10-03 06:35:17 +00:00
Adrian Chadd
3eaa0cd531 urtwn(4): fix sequence numbering for QoS frames
Tested:

* urtwn0: MAC/BB RTL8188EU, RF 6052 1T1R, STA mode

Submitted by:	<s3erios@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D3684
2015-10-03 06:07:01 +00:00
Adrian Chadd
1517a7ba0b ural(4): reduce copy-paste in ural_newstate().
Submitted by:	<s3erios@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D3656
2015-10-03 05:55:16 +00:00
Adrian Chadd
f28c2f5e54 rum(4): add command queue for running sleepable tasks in non-sleepable contexts
Tested:

* Tested on WUSB54GC, STA mode.
* rum0: MAC/BBP RT2573 (rev 0x2573a), RF RT2528

Submitted by:	<s3erios@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D3629
2015-10-03 05:46:35 +00:00
Adrian Chadd
e7b7db3d59 rum(4): some non-functional changes / cleanup
* Remove unused sc_txtap_len/sc_rxtap_len fields.
* Remove unused ackrate variable.
* Remove unneded warning in rum_update_mcast().
* Use nitems().
* Replace some hardcoded values for RT2573_MAC_CSR1 register.
* Remove second argument for RUM_LOCK_ASSERT() - it is always the same.

Submitted by:	<s3erios@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D3605
2015-10-03 05:44:05 +00:00
Adrian Chadd
d847071cf6 rum(4): sync rum_enable_tsf(_sync) with run(4).
Submitted by:	<s3erios@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D3611
2015-10-02 15:30:37 +00:00
Adrian Chadd
a05022b22c rum(4): create few wrappers.
Tested:

rum0: <Belkin Belkin 54g USB Network Adapter, class 0/0, rev 2.00/0.01, addr 22> on usbus0
rum0: MAC/BBP RT2573 (rev 0x2573a), RF RT2528

Submitted by:	<s3erios@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D3609
2015-10-02 15:28:44 +00:00
Adrian Chadd
cc9ae76160 rum(4): move common part of rum_bbp_write() and rum_bbp_read() into rum_bbp_busy().
Submitted by:	<s3erios@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D3608
2015-10-02 15:26:33 +00:00
Adrian Chadd
6d8043213d rum(4): reduce code duplication.
Tested:

rum0: <Belkin Belkin 54g USB Network Adapter, class 0/0, rev 2.00/0.01, addr 21> on usbus0
rum0: MAC/BBP RT2573 (rev 0x2573a), RF RT2528

Submitted by:	<s3erios@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D3606
2015-10-02 15:22:00 +00:00
John Baldwin
2ad026889e Most error cases in i915_gem_do_execbuffer() jump to one of two labels to
release resources (such as unholding pages) when errors occur.  Some
recently added error checks return immediately instead of jumping to a
label resulting in leaks.  Fix these to jump to a label to do cleanup
instead.

Reviewed by:	kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D3745
2015-10-01 16:59:07 +00:00
Colin Percival
2eb0015ab7 Disable suspend when we're shutting down. This solves the "tell FreeBSD
to shut down; close laptop lid" scenario which otherwise tended to end
with a laptop overheating or the battery dying.

The implementation uses a new sysctl, kern.suspend_blocked; init(8) sets
this while rc.suspend runs, and the ACPI sleep code ignores requests while
the sysctl is set.

Discussed on:	freebsd-acpi (35 emails)
MFC after:	1 week
2015-10-01 10:52:26 +00:00
Adrian Chadd
a3767659f0 modify the rssi logic a bit to actually return a useful rssi.
The fullmac firmware doesn't seem to populate a useful rssi indicator
in the RX descriptor, so if one plotted said values, they'd basically
look like garbage.

The reference driver implements a "get current rssi" firmware command
which I guess is really meant for station operation only (as hostap
operation would need rssi per station, not a single firmware read.)

So:

* populate sc_currssi during each calibration run;
* use this in the RX path instead of trying to reconstruct the RSSI
  value and passing it around as a pointer;
* do up a quick hack to map the rssi hardware value to some useful
  signal level;
* the survey results provide an RSSI value between 0..100, so just
  do another quick hack to map it into some usefulish signal level;
* supply a faked noise floor - I haven't yet found how to pull it
  out of the firmware.

The scan results and the station RSSI information is now more useful
for indicating signal strength / distance.
2015-09-30 05:19:16 +00:00
Adrian Chadd
d46e82d63c Fix locking after my EDCA update change.
The net80211 lock is no longer held during this call, so we don't have
to unlock/relock.

Noticed by:	David Wolfskill
2015-09-29 19:15:08 +00:00
Adrian Chadd
85dafc6977 rsu(4): Add support for 1T2R and 2T2R NICs.
This logic is mostly crimed from the reference driver and the linux
r92su driver.

I verified that it (a) worked on the rsu hardware I have, and (b)
did traffic testing whilst watching what ath(4) sent as a hostap.
It successfully sent MCS8..15 rates (which requires 2-stream reception)
as well as MCS0..7 (which is 1-stream.)

Tested:

* RTL8712, 1T1R NIC, MCS rates 0..7.
* RTL8712, 1T2R NIC, MCS rates 0..15

TODO:

* Find a 2T2R NIC!
2015-09-29 06:56:00 +00:00
Adrian Chadd
24c2763fb1 urtwn driver fixes - missing include, free node references, shut down xfers first
* include opt_wlan.h like a good little wlan driver;
* add a function to free the mbufq /and/ the node references on it, or we will leak
  said node references;
* free the mbufq upon NIC shutdown otherwise we may end up with a full list that
  we never begin transmit work on, and thus never drain it;
* .. which frees it upon NIC detach too;
* ensure urtwn_start() gets called after the completion of frame TX even if the
  pending queue is empty, otherwise transmit will stall.  It's highly unlikely that
  the usb tx queue would be empty whilst the incoming send queue is full, but hey,
  who knows.

This passes some iperf testing with and without the NIC being actively removed during
said active iperf test.

Tested:

* urtwn0: MAC/BB RTL8188EU, RF 6052 1T1R ; STA mode
2015-09-29 05:03:24 +00:00
Adrian Chadd
b94ab33751 Remove the references to the TX IC lock - i ended up solving this
using net80211 to seralise encap+xmit, so now it's a non-issue.
2015-09-29 03:37:17 +00:00
Adrian Chadd
3a8545c312 include opt_wlan.h . Tsk adrian. 2015-09-28 01:16:44 +00:00
Adrian Chadd
c74d474720 if_otus fixes; add fast-frames support.
Fast-frames:

* include opt_wlan.h ; tsk to not doing it earlier;
* add a tx pending tracking counter for seeing how deep
  the hardware TX queue is;
* add the frame aging code from if_ath;
* add fast-frames capability to the driver setup.

Bugs:

* free the buffers (and node references) before
  detaching net80211 state.  This prevents a use-after-free in
  the node free path where we've destroyed net80211 underneath it.
2015-09-28 01:09:48 +00:00
Bjoern A. Zeeb
cd44287c16 Fix what looks like a consistent copy&paste error.
Don't make an integer to a boolean and then compare to a value which
needs an integer comparison.

Spotted by:	reading kernel compile time log
MFC after:	2 weeks
2015-09-27 12:19:36 +00:00
Bjoern A. Zeeb
23d56b1e9c Compare the correct variable to see if memory allocation succeeded.
I don't even want to know where the symbol "version" comes from.

Spotted by:	reading kernel compile time log
MFC after:	2 weeks
2015-09-27 12:17:03 +00:00
Adrian Chadd
c4dabdf78a Track the command response code buffer size and verify it in the
receive path.
2015-09-27 03:46:55 +00:00
Adrian Chadd
ac9e537ce0 Free the TX/RX list buffers /before/ tearing down net80211 state.
Otherwise buffers in the RX queue get freed with their parent vap
being gone and you end up with a juicy kernel panic.
2015-09-26 22:20:30 +00:00
Adrian Chadd
cc43c3e8a7 Don't duplicate checks; net80211 now does this for us.
Submitted by:	s3erios@gmail.com
2015-09-26 13:22:44 +00:00
Adrian Chadd
74d7b9a832 * Add 11n HT40 support - i needed to send both HTINFO and HTCAP fields
in the join message so the firmware would pick it up.

* Strip out the direct hardware fiddling for 40MHz mode - the firmware
  we're using doesn't require it (the rtl8712su firmware does; it
  is less 'fullmac' than what we're using.)

* Fix the mbuf handling during errors - rsu_tx shouldn't free mbufs;
  it's up to the caller to do so.  This brings it in line with
  what other drivers do or should be doing.

Tested:

* RTL8712, HT40 channel, STA mode (during this commit)
2015-09-26 07:25:53 +00:00
Adrian Chadd
436ed6b50d Fix a bug in the TX command handling - log when a too-large payload is
sent, and fix a bug I found when doing so.
2015-09-26 07:14:00 +00:00
Adrian Chadd
a9fcb51fbb Add an initial driver for the AR9170 series draft-11n hardware from
Atheros.

Thanks to OpenBSD for providing a driver based on the original
Atheros open source driver circa 2008.  This uses the early, pre-carl9170
atheros provided firmware.

It only supports 11bg at the moment.  I've not tested it with 11a
(and so the TX rate control logic may be slightly wrong!) so if
you do have the dual-band version of this hardware please do let me know.

Tested:

* AR9170, TP-Link WN821N 2GHz.

TODO:

* Hook this up to a non-module build.
2015-09-26 07:08:35 +00:00
Adrian Chadd
4c794fa51a Update USB device IDs for the upcoming AR9170 support. 2015-09-26 06:57:08 +00:00
Hans Petter Selasky
a130076f26 Implement support for reading USB quirks from the kernel environment.
Refer to the usb_quirk(4) manual page for more details on how to use
this new feature.

Submitted by:	Maxime Soule <btik-fbsd@scoubidou.com>
PR:		203249
MFC after:	2 weeks
2015-09-24 17:37:30 +00:00
Adrian Chadd
1ff8129a59 Fix up error path handling after the recent churn.
* Don't free the mbuf in the tx path - it uses the transmit path now,
  so the caller frees the mbuf.
* Don't decrement the node ref upon error - that's up to the caller to
  do as well.

Tested:

* Intel 5300 3x3 wifi, station mode

Noticed by: <s3erios@gmail.com>
2015-09-24 17:23:41 +00:00
Bjoern A. Zeeb
9293cfeb42 Hide an unused in FreeBSD function behind #ifdef linux to get rid of
the compile time warning.

Reviewed by:		gnn
MFC after:		2 weeks
Differential Revision:	https://reviews.freebsd.org/D3710
2015-09-22 15:32:27 +00:00
Alexander Motin
98ef2a6198 Allow AHCI driver attach to all known chips reporting RAID class.
Reported by:	Michael BlackHeart <amdmiek@gmail.com>
MFC after:	1 week
2015-09-22 15:06:26 +00:00
Adrian Chadd
0cf00015be net80211: include one copy of struct ieee80211_beacon_offsets into ieee80211vap
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D3658
2015-09-22 06:34:07 +00:00
Adrian Chadd
44369387a1 Send a power command to the firmware to shut down the radio as well
during rsu_stop().
2015-09-22 05:48:51 +00:00
Adrian Chadd
6acf853d7a Begin fleshing out basic power-on / power-off and A-MPDU TX support.
* Add a new method to control NIC poweron / network-sleep / power off;
* Add in A-MPDU TX negotiation support, but comment it out because it
  does break TX traffic;
* blank out the tx buffer before sending a firmware message, just in case;
* go into network-sleep once associated;

TODO:

* figure out why ampdu negotiation isn't working and breaking TX traffic,
  then enable it.
2015-09-22 02:57:18 +00:00
Adrian Chadd
82e8c646b4 net80211 & wireless drivers: remove duplicate defines (noop)
- IEEE80211_DIR_DSTODS(wh) -> IEEE80211_IS_DSTODS(wh).
- N(a) -> nitems(a).
- Remove LE_READ_2(p)/LE_READ_4(p) definitions (and include ieee80211_input.h instead).
- <drvname>_TXOP_TO_US(txop) -> IEEE80211_TXOP_TO_US(txop).
- Put IEEE80211_RV(v) into ieee80211_proto.h and remove local RV(v) definitions.

Submitted by:   Andriy Voskoboinyk <s3erios@gmail.com>
Differential Revision:  https://reviews.freebsd.org/D3705
2015-09-22 02:48:59 +00:00
Adrian Chadd
d6166def28 net80211 & wireless drivers: remove duplicate defines (noop)
* IEEE80211_DIR_DSTODS(wh) -> IEEE80211_IS_DSTODS(wh).
* N(a) -> nitems(a).
* Remove LE_READ_2(p)/LE_READ_4(p) definitions (and include ieee80211_input.h instead).
* <drvname>_TXOP_TO_US(txop) -> IEEE80211_TXOP_TO_US(txop).
* Put IEEE80211_RV(v) into ieee80211_proto.h and remove local RV(v) definitions.

Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D3705
2015-09-22 02:44:59 +00:00
Adrian Chadd
39089f06bf Flip on 11n by default; update TODO items. 2015-09-21 02:32:11 +00:00
Adrian Chadd
77435f1835 Convert if_rsu to use a deferred transmit task rather than using rsu_start()
to do it directly.

Ensure that we re-queue starting transmit upon TX completion.

This solves two issues:

* It stops tx stalls - before this, if the transmit path filled the
  mbuf queue then it'd never start another transmit.

* It enforces ordering - this is very required for 802.11n which
  requires frames to be transmitted in the order they're queued.
  Since everything remotely involved in USB has an unlock/thing/relock
  pattern with that mutex, the only way to guarantee TX ordering is
  to 100% defer it into a separate thread.

This now survives an iperf test and gets a reliable 30mbit/sec.
2015-09-21 02:30:22 +00:00
Adrian Chadd
829e0b0b84 Drain the mbuf queue upon rsu_stop().
Correctly (I hope!) remove net80211 references before doing so.
Just doing a dumb mbufq drain isn't enough.

If enough traffic occurs and the mbuf queue fills up then transmit
stalls (which I'm not fixing in this commit!) but then the mbuf queue
stays full until the driver is removed.  There's also the net80211
node refcounting leak.

This just ensures that during rsu_stop and detach the mbuf queue
is purged (and references!) so the queue-full situation can be
recovered from.
2015-09-21 02:12:01 +00:00
Adrian Chadd
3d07cc29cf Disable HT40 in if_rsu for now. There's something missing in the HT40
setup pieces and so (at least) transmit doesn't work.

It'll just fall back to being a straight HT20 device and negotiate
HT20 only.

Tested by: Idwer Vollering <vidwer@gmail.com>
2015-09-20 22:52:40 +00:00
Luiz Otavio O Souza
715a136ddf Fix the build by adding the alternate descriptors and MII clock defines.
This obviously should be in the last commit.
2015-09-20 14:28:06 +00:00
Luiz Otavio O Souza
5df539274f Add alternate descriptors support for if_dwc.
This also adds a newbus interface that allows a SoC to override the
following settings:

 - if_dwc specific SoC initialization;
 - if_dwc descriptor type;
 - if_dwc MII clock.

This seems to be an old version of the hardware descriptors but it is
still in use in a few SoCs (namely Allwinner A20 and Amlogic at least).

Tested on Cubieboard2 and Banana pi.

Tested for regressions on Altera Cyclone by br@ (old version).

Obtained from:	NetBSD
2015-09-20 14:13:29 +00:00
Luiz Otavio O Souza
da9a326be3 Remove unnecessary includes and, while here, sort them. 2015-09-20 13:15:09 +00:00
Sean Bruno
e373323fe2 Revert 287914,287762.
Reports of breakage on igb(4) have been narrowed down to 287762 and 287914
is an dependant change.

Submitted by:	erj
2015-09-19 18:22:59 +00:00
Adrian Chadd
413bae20bb Ensure the ring state is also blanked upon reset, otherwise
duplicate rx events get handled during reset paths.

Submitted by:	Matthew Dillion <dillon@apollo.backplane.com>
Obtained from:	DragonflyBSD
2015-09-18 17:39:31 +00:00
Adrian Chadd
23386fa4b6 Add in a temporary (hah!) workaround for net80211 scanning versus NIC
requirements.

Don't start the opmode and join path until a pending survey is finished.
This seems to reliably fix things.

Ideally I'd just finish off the net80211 pluggable scan stuff and implement
the methods here so if_rsu can just drive the scan machinery.
However, that's a .. later thing.

Whilst here, remove the getbuf debugging; it's okay to run out of transmit
buffers under load; it however isn't okay to not be able to send commands.
I'll fix that later.
2015-09-18 07:55:33 +00:00
Adrian Chadd
de76b5b7fe Refactor out the tx buffer free code into a routine, rsu_freebuf().
This makes it easier to add more transmit buffers, have different buffer
pools for things, etc.
2015-09-18 07:26:34 +00:00
Adrian Chadd
a12cbef7b0 Set AMPDU density/size parameters during vap creation.
Inspired from: Linux r92su
2015-09-18 05:59:15 +00:00
Adrian Chadd
237c4b4378 Add a very hacked up station only A-MPDU negotiation path.
This is enough to set things up; there are still lots of retransmits
seen but it's enough to get things working.
2015-09-18 05:03:01 +00:00
Adrian Chadd
4b9d9eee03 Add initial 11n support to if_rsu.
* Add a tunable to enable 11n if it's available, so to not anger people
  who upgrade.

  kenv hw.usb.rsu.enable_11n=1 before inserting the device.

* Add initial 11n htconfig bits;
* Enable 40MHz mode if it's available;
* Add 11n channels;
* Set 11n bits in the firmware.

It works for RX; I haven't tested TX aggregation just yet.
However the firmware doesn't do RX re-ordering, so I have to tie it into
the net80211 A-MPDU RX reorder path before I flip this on by default.

I've verified that I'm indeed actually seeing MCS 0->7 rates being received.
I haven't dug into whether it's actually transmitting 11n rates; I'll dig into
that later.
2015-09-18 04:12:11 +00:00
Sean Bruno
25fd5dd9a0 Add Intel Skylake/I219 Support
- New em(4) device in currently shipping products

Differential Revision:	https://reviews.freebsd.org/D3163
Submitted by:	erj@freebsd.org
Reviewed by:	jfv@freebsd.org
MFC after:	2 weeks
Sponsored by:	Intel Corporation
2015-09-17 15:11:45 +00:00
Adrian Chadd
a851c66778 .. oops, flip on QoS. 2015-09-17 07:04:15 +00:00
Adrian Chadd
b4d4079c85 Bring over the QoS logic from the Linux r92su driver.
* the tx descriptor TID is priority, not TID.
* the tx descriptor queue id mapping is separate from the
  TID/priority; rather than just "BE".

TODO:

* go and re-re-re-verify the queue mappings; the linux and openbsd
  mappings aren't exactly the same.  I need to verify all of this
  before I try to flip on 11n RX.
2015-09-17 04:45:29 +00:00
Adrian Chadd
b8303685fa Program the firmware setup stuff with the current hardware setup:
* Do 1T1R for now, until we read the config out of ROM and use it.
* Disable turbo mode, I dunno what this is, but the linux drivers
  have this disabled.
* Set the firmware endpoints to what we read from USB.

Tested:

* RTL8712 cut 3, STA mode
2015-09-17 03:42:18 +00:00
Adrian Chadd
bc6a9865d6 Use the H2C endpoint for sending firmware commands, rather than the voice
data queues.

This is similar to the openbsd and rtlwifi/r92su drivers.

Note: this driver still assumes it's a 4-endpoint device; I'll enforce
that in a follow-up commit.
2015-09-17 03:19:09 +00:00
Adrian Chadd
882704d0ce Add 11n and QoS methods.
The firmware takes care of ampdu tx/rx (except for RX reordering, grr),
QoS/WME and other bits/pieces.  So they're stubs, just in case.
2015-09-17 03:13:01 +00:00
Adrian Chadd
47b0d9dd88 Prepare for 11n - get the number of endpoints and whether 11n is available. 2015-09-17 03:08:02 +00:00
Adrian Chadd
ddf4995dc5 Bump RX_LIST_COUNT so we don't fall behind during active traffic. 2015-09-17 03:01:55 +00:00
Adrian Chadd
17ebf55362 Use DELAY() rather than usb_pause_mtx() - the latter releases the lock
before waiting, which prevents the lock from really acting like
a hardware serialiser.  Sigh.
2015-09-17 03:01:19 +00:00
Zbigniew Bodek
18c72666ce Add domain support to PCI bus allocation
When the system has more than a single PCI domain, the bus numbers
are not unique, thus they cannot be used for "pci" device numbering.
Change bus numbers to -1 (i.e. to-be-determined automatically)
wherever the code did not care about domains.

Reviewed by:   jhb
Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3406
2015-09-16 23:34:51 +00:00
Kevin Lo
97ad4604d7 Use M_WAITOK rather than M_NOWAIT since it's not used within
interrupt context.
2015-09-16 07:26:18 +00:00
Kevin Lo
4bae831003 Fix a debug message which didn't quite get it right about eeprom version. 2015-09-16 07:18:54 +00:00
Kevin Lo
f75281b8f2 Remove checks for a NULL return value from M_WAITOK allocations. 2015-09-16 07:16:21 +00:00
Renato Botelho
1a2b77cf2e Add support for Sierra MC7355 card
Submitted by:	Jeremy Porter <jporter@netgate.com>
Approved by:	loos
Obtained from:	pfSense
MFC after:	1 week
Sponsored by:	Rubicon Communications (Netgate)
2015-09-15 18:21:56 +00:00
Ed Maste
aafbd0257a Add Cavium ThunderX xHCI controller PCI ID
There is an issue with interrupts at the moment, but it works with
polling mode set (hw.usb.xhci.use_polling=1).

Reviewed by:	hselasky
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D3665
2015-09-15 16:08:25 +00:00
Adrian Chadd
89fd823782 Replace the scan event input path hack with the new rx-stats based method.
This allows for arbitrary channel info to be placed in the input call rather
than the totally gross hack of overriding ic_curchan.

Without this I'm sure ic_curchan setting was racing with the scan code
setting the channel itself..
2015-09-15 03:01:40 +00:00
Hans Petter Selasky
6eed0dd7c4 Correct PCI ID.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after:	1 month
PR:		202807
2015-09-14 07:08:29 +00:00
Marius Strobl
96b2c26ae1 Add preliminary support for RTL8168H, tested by Sreenath Battalahalli.
MFC after:	1 week
2015-09-13 22:22:30 +00:00
Adrian Chadd
cf52bbe053 Disable mgmt frame sending in if_rsu.
The firmware in this NIC sends management frames.  So far I'm not sure which
ones it handles and which ones it doesn't handle - but this is what openbsd
does.

The association messages are handled by the firmware; the key negotiation
for 802.1x and WPA are done as raw frames, not management frames.

This successfully allows it to associate to my home networks whereas it didn't
work beforehand.

Tested:

* RTL8712, cut 3, STA mode

TODO:

* The firmware does send a join response with a status code; that should be
  logged in a more obvious way to assist with debugging.  Ie, the firmware
  is the thing that is saying "couldn't join, sorry!", not net80211.
2015-09-13 19:17:26 +00:00
Sean Bruno
a44aa8e030 Update em(4) with D3162 after testing further on hardware that failed
to attach with the last version of this commit. This commit fixes
attach failures on "ICH8" class devices via modifications to
e1000_init_nvm_params_ich8lan()

-   Fix compiler warning in 80003es2lan.c
-   Add return value handler for e1000_*_kmrn_reg_80003es2lan
-   Fix usage of DEBUGOUT
-   Remove unnecessary variable initializations.
-   Removed unused variables (complaints from gcc).
-   Edit defines in 82571.h.
-   Add workaround for igb hw errata.
-   Shared code changes for Skylake/I219 support.
-   Remove unused OBFF and LTR functions.

Tested by some of the folks that reported breakage in previous incarnation.
Thanks to AllanJude, gjb, gnn, tijl for tempting fate with their machines.

Submitted by:	erj@freebsd.org
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D3162
2015-09-13 18:26:05 +00:00
Alexander Motin
0a5c75e53c Add ID for Intel Panther Point KT Controller
Found on ASUS P8Q77-M motherboard.

Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after:	2 weeks
2015-09-13 12:08:25 +00:00
Adrian Chadd
a934198b02 Add RSSI logging to the event survey results. 2015-09-13 05:22:20 +00:00
Adrian Chadd
9b6916dbed After reading the linux driver, document what this bit is doing
(doing a full NIC awake.)
2015-09-13 04:41:13 +00:00
Adrian Chadd
e6d258f6ac * fiddle with some more of the debugging output
* yes, when a "sta disconnect" message comes through we should, like,
  disconnect things.  We're not currently generating beacon miss messages,
  and net80211 isn't disconnecting things via software beacon miss receive.

Tested:

* RTL8712, cut 3, STA mode
2015-09-13 04:12:51 +00:00
Adrian Chadd
4914fa0fd6 if_rsu debug fixes:
* use an ath/iwn style debug bitmap - it's still global rather than per-device,
  but it's better than debug levels
* disable bgscan - it just makes things unstable/unpredictable for now.

Tested:

* if_rsu - RTL8712 cut 3, STA mode
2015-09-12 23:10:34 +00:00
Luiz Otavio O Souza
8fbc5d1840 Do not call mii_mediachg() from NIC interrupt handler.
This fixes the link instability on banana pi (A20).

Suggested by:	yongari
2015-09-12 16:46:41 +00:00
Andriy Gapon
8f875df090 radeon_suspend_kms: don't mess with pci state that's managed by the bus
The pci bus driver handles the power state, it also manages
configuration state saving and restoring for its child devices.  Thus a
PCI device driver does not have to worry about those things.  In fact, I
observe a hard system hang when trying to suspend a system with active
radeonkms driver where both the bus driver and radeonkms driver try to
do the same thing.  I suspect that it could be because of an access to a
PCI configuration register after the device is placed into D3 state.

Reviewed by:	dumbbell, jhb
MFC after:	13 days
Differential Revision:	https://reviews.freebsd.org/D3561
2015-09-11 15:51:20 +00:00
John Baldwin
8fb15ddb00 Add a comment that to clarify how to determine the amount of received DDP
data.

Reviewed by:	np
Differential Revision:	https://reviews.freebsd.org/D3619
2015-09-10 21:41:11 +00:00
Hans Petter Selasky
8c626ca5dc Update USB quirk.
MFC after:	1 month
PR:		202968
2015-09-10 07:36:54 +00:00
Hans Petter Selasky
b28014dd0b Add new USB ID.
MFC after:	1 month
PR:		202968
2015-09-09 07:04:00 +00:00
Kevin Lo
b904ffbde5 Correct setting R92C_TDECTRL_BLK_DESC_NUM_M bit. 2015-09-09 01:51:38 +00:00
Renato Botelho
22a5bb4c2a Remove duplicate entry for Sierra Wireless Aircard 875
Approved by:	loos
MFC after:	3 days
Sponsored by:	Rubicon Communications (Netgate)
2015-09-08 20:07:32 +00:00
Renato Botelho
5effc557d5 - Fix Sierra MC7354 ID from a bad copy/paste, correct ID is 68C0
Approved by:	loos
Obtained from:	pfSense
MFC after:	3 days
Sponsored by:	Rubicon Communications (Netgate)
2015-09-08 19:57:02 +00:00
Jean-Sébastien Pédron
7bead7ac28 drm/ttm: Drain taskqueue if taskqueue_cancel_timeout() returned an error
Before, this was done if `pending` was true. This is not what the
manpage suggests and not what was done elsewhere in the same file.
2015-09-08 19:41:19 +00:00
Andrew Turner
d5ad1d0d6d Allow us to set the console device tree node. This is needed as not all
vendor supplied device trees contain the needed properties for us to select
the correct uart to use as the kernel console.

An example of this would be to add the following to loader.conf.
hw.fdt.console="/smb/uart@f7113000"

The intention of this is slightly different than the existing
hw.uart.console option. The new option will mean the boot serial
configuration will be derived from the device node, while the existing
option expects the user to configure all this themselves.

Further work is planned to allow the uart configuration to be set based on
the stdout-path property devicetree bindings.

Sponsored by:	ABT Systems Ltd
Differential Revision:	https://reviews.freebsd.org/D3559
2015-09-08 16:06:04 +00:00
Jim Harris
854c31980e isci: check return value of pci_alloc_msix()
Certain VM guest types (VMware, Xen) do not support MSI, so pci_alloc_msix()
always fails.  isci(4) was not properly detecting the allocation failure,
and would try to proceed with MSIx resource initialization rather than
reverting to INTx.

Reported and tested by: Bradley W. Dutton (brad-fbsd-stable@duttonbros.com)
MFC after:	3 days
Sponsored by:	Intel
2015-09-08 16:05:18 +00:00
Jim Harris
c16120409b isci: explicitly enable/disable PCI busmaster
BIOS always enables PCI busmaster on the isci device, which effectively
worked around this omission.  But when passing the isci device through
to a guest VM, the hypervisor will disable busmaster and isci will not
work without calling pci_enable_busmaster().

MFC after:	3 days
Sponsored by:	Intel
2015-09-08 15:59:55 +00:00
Kevin Lo
599acbbcd8 Enable TSF timer in monitor mode.
Tested on RT5370, sta mode.
Submitted by:	Andriy Voskoboinyk <s3erios at gmail com>
Differential Revision:	https://reviews.freebsd.org/D3591
2015-09-08 08:06:20 +00:00
Kevin Lo
ef9c07684c Add TSF field into TX/RX radiotap headers
Tested on RT5370, sta mode.
Submitted by:	Andriy Voskoboinyk <s3erios at gmail com>
Differential Revision:	https://reviews.freebsd.org/D3590
2015-09-08 08:02:14 +00:00
Kevin Lo
3257f9021a Fix comparison in run_key_set_cb().
Tested on RT5370, sta mode.

Submitted by:	Andriy Voskoboinyk <s3erios at gmail com>
Differential Revision:	https://reviews.freebsd.org/D3589
2015-09-08 07:53:10 +00:00
Kevin Lo
de7eb46ed4 - Remove empty key_update_* functions.
- Hide "struct ieee80211_node *" -> "struct run_node *" casting behind
  RUN_NODE() macro.
- Simplify IEEE80211_HAS_ADDR4 macro definition
- Fix a comment (desn't -> doesn't)

Submitted by:	Andriy Voskoboinyk <s3erios at gmail com>
Differential Revision:	https://reviews.freebsd.org/D3588
2015-09-08 07:50:35 +00:00
Adrian Chadd
15b1492c9b Don't call enable_all_rings if the adapter has been freed.
This is a subtle use-after-free race that results in some very undesirable
hang behaviour.

Reviewed by:	pkelsey
Obtained from:	Kip Macy, NextBSD (91a9bd1dbb)
2015-09-07 23:16:39 +00:00
Luiz Otavio O Souza
c80b6ca937 Fix off-by-one bugs.
While here, only set the GPIO pin state for output pins.

Pointy hat to:	loos
Sponsored by:	Rubicon Communications (Netgate)
2015-09-07 21:59:11 +00:00
Baptiste Daroussin
dc6c827749 Reduce diff with linux 3.8.13 on i915 headers 2015-09-05 23:22:59 +00:00
Sean Bruno
c597a0199e Revert last two commits to em(4)/igb(4). Reports are coming in that
this breaks initialization and reads from EEPROM on boot/driver load.

r287469 is being reverted as a dependancy on r287467
2015-09-05 21:12:19 +00:00
Sean Bruno
d751decc98 Add more BCM gigabit PHYs
Gleaned from a public header file. 5402 and 5404 look like they may be
used on embedded devices. 5478 and 5488 are switch PHYs. 5754 change is just
to note a product alias.

Differential Revision:	https://reviews.freebsd.org/D3338
Submitted by:	kevin.bowling@kev009.com
2015-09-04 17:48:19 +00:00
Sean Bruno
98ae230f07 em(4): Add Skylake/I219 support.
- driver rev 7.5.2
- use new functions em_flush* for i219 devices

Differential Revision:	https://reviews.freebsd.org/D3163
Submitted by:	erj jfv
Reviewed by:	jfv
MFC after:	1 month
Relnotes:	Yes
Sponsored by:	Intel Corporation
2015-09-04 17:21:55 +00:00
Sean Bruno
67ebffd348 e1000: Shared code updates
-    Fix compiler warning in 80003es2lan.c
-    Add return value handler for e1000_*_kmrn_reg_80003es2lan
-    Fix usage of DEBUGOUT
-    Remove unnecessary variable initializations.
-    Removed unused variables (complaints from gcc).
-    Edit defines in 82571.h.
-    Add workaround for igb hw errata.
-    Shared code changes for Skylake/I219 support.
-    Remove unused OBFF and LTR functions.

Differential Revision:	https://reviews.freebsd.org/D3162
Submitted by:	erj
MFC after:	1 month
Sponsored by:	Intel Corporation
2015-09-04 16:30:48 +00:00
Sean Bruno
02415af2ee igb(4): Update and fix HW errata
- HW errata workaround for IPv6 offload w/ extension headers
- Edited start of if_igb.c (Device IDs / #includes) to match ixgbe/ixl

Differential Revision:	https://reviews.freebsd.org/D3165
Submitted by:	erj
MFC after:	1 month
Sponsored by:	Intel Corporation
2015-09-04 16:07:27 +00:00
Sean Bruno
e6aa141248 r249170 was just plain wrong. The effect of the change is to always
delete a logic volume on status change which is NOT what we want here.

The original code is correct in that when the volume changes status
the driver will only delete the volume if the status is one of the
fatal errors.  A drive failure in a mirrored volume is NOT a situtation
where the volume should dissapear.

Reported on freebsd-scsi@:
https://lists.freebsd.org/pipermail/freebsd-scsi/2015-September/006800.html

MFC after:	3 days
2015-09-03 17:46:57 +00:00
Marcelo Araujo
804fc8c859 Lower the compiler warning: unused-but-set-variable.
Approved by:		bapt (mentor)
Differential Revision:	D3556
2015-09-03 06:53:17 +00:00
Conrad Meyer
0d1a05d9e6 ioat(4): pci_save/restore_state to persist MSI-X registers over BDXDE reset
Also for BWD devices, per jimharris@.

Reviewed by:	jhb
Approved by:	markj (mentor)
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D3552
2015-09-02 22:48:41 +00:00
Conrad Meyer
4253ea5083 ioat: re-initialize interrupts after resetting hw on BDXDE
Resetting some generations of the I/OAT hardware (just BDXDE for now)
resets the corresponding MSI-X registers.  So, teardown and
re-initialize interrupts after resetting the hardware.

Reviewed by:	jimharris
Approved by:	markj (mentor)
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D3549
2015-09-02 16:48:03 +00:00
Gleb Smirnoff
b0f99291de Remove the software queue, which is a remnant of ifnet ifqueue.
Reviewed by:	adrian
Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2015-09-02 15:23:51 +00:00
Andrew Turner
504a0067c7 Add support for the dwc usb in the HiSilicon hi6220 in the HiKey board. For
this we need to force the driver into host mode, as without this the driver
fails to detect any devices.

Relnotes:	yes
Sponsored by:	ABT Systems Ltd
2015-09-01 17:13:04 +00:00
Andrew Turner
c0e5e17237 Add support for the DesignWare MMC hardware in the HiSilicon hi6220. This
SoC is used in the HiKey board from 96boards.

Currently on the SD card is working on the HiKey, as such devices 0 and 2
will need to be disabled, for example by adding the following to
loader.conf:

hint.hisi_dwmmc.0.disabled=1
hint.hisi_dwmmc.2.disabled=1

Relnotes:	yes (Hikey board booting)
Sponsored by:	ABT Systems Ltd
2015-09-01 16:25:12 +00:00
Andrew Turner
fa6ea9962e Finish allowing the dwmmc driver to be subclassed, move the softc to a new
header, along with the hwtype enum, device attach prototype, and driver_t.

Sponsored by:	ABT Systems Ltd
2015-09-01 15:26:21 +00:00
Andrew Turner
0e308268b0 Remove an variable we only ever write to, and stop assigning 0 to values
in the softc as it's the default value. The latter helps with subclassing
this driver.

Sponsored by:	ABT Systems Ltd
2015-09-01 10:47:42 +00:00
Hans Petter Selasky
6840adf6da Add new PCI ID.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after:	1 month
PR:		202807
2015-09-01 09:33:24 +00:00
Sean Bruno
fac8243601 Restrict tso_max to IP_MAXPACKET to avoid the panic reported in:
https://lists.freebsd.org/pipermail/freebsd-current/2015-August/057192.html

Submitted by:	pyunyh@gmail.com
MFC after:	2 weeks
2015-08-31 19:12:10 +00:00
Gleb Smirnoff
a465d49ffa Remove now unneeded includes. 2015-08-31 10:43:00 +00:00
Hans Petter Selasky
98d3afa551 Add new USB quirk.
MFC after:	1 week
PR:		202783
2015-08-31 07:18:13 +00:00
Adrian Chadd
4823a7500b Migrate the stats API for iwn(4) into a cdev ioctl, rather than tying
into the vap.

This allows for possible hardware interaction without needing a vap
configured.
2015-08-30 21:54:33 +00:00
Xin LI
42404113e6 Remove support for FreeBSD < 602110. 2015-08-30 08:48:31 +00:00
Gavin Atkinson
c6cc7ec120 Support the ZTE MF112 HSUPA 3G USB stick.
MFC after:	1 week
2015-08-29 18:37:09 +00:00
Baptiste Daroussin
21bba0ead0 Mark ValleyView/Bay Trail as not supported 2015-08-29 00:05:39 +00:00
Andrew Turner
755eb18fd7 Move dwmmc.h to dwmmc_reg.h. This is in preperation for adding support to
subclass the dwmmc driver to allow SoC specific attachments.

Sponsored by:	ABT Systems Ltd
2015-08-28 15:27:55 +00:00
Andrew Turner
725b72d5e0 Only check for the bus frequency if it has not already been set, for
example through a driver running as a subclass of this.

Sponsored by:	ABT Systems Ltd
2015-08-28 10:34:37 +00:00
Warner Losh
d63180f2df Simply to appease gcc's warnings. 2015-08-28 02:29:31 +00:00
Pyun YongHyeon
97c477f86f Set DMA alignment constraint of status, TX and RX LEs(List Elements
in Marvell terms) to 32768.  32768 looks overkill but it will
ensure correct DMAed update.  This change addresses occasional
watchdog timeouts reported on 10.2-RELEASE.

Tested by:	Johann Hugo <jhugo@meraka.csir.co.za>
MFC after:	2 weeks
2015-08-28 01:32:42 +00:00
Warner Losh
ae1f3df434 New 1-Wire bus implementation. 1-Wire controller is abstracted, though
only gpiobus configured via FDT is supported. Bus enumeration is
supported. Devices are created for each device found. 1-Wire
temperature controllers are supported, but other drivers could be
written. Temperatures are polled and reported via a sysctl.  Errors
are reported via sysctl counters. Mis-wired bus detection is included
for more trouble shooting. See ow(4), owc(4) and ow_temp(4) for
details of what's supported and known issues.

This has been tested on Raspberry Pi-B, Pi2 and Beagle Bone Black
with up to 7 devices.

Differential Revision: https://reviews.freebsd.org/D2956
Relnotes: yes
MFC after: 2 weeks
Reviewed by: loos@ (with many insightful comments)
2015-08-27 23:33:38 +00:00
Andrew Turner
2640322a2e There is no need to get the bus tag or handle.
Sponsored by:	ABT Systems Ltd
2015-08-27 16:27:51 +00:00
Andrew Turner
fd59e3a9d8 Limit the speed to the bus frequency.
Sponsored by:	ABT Systems Ltd
2015-08-27 16:24:30 +00:00
Andrew Turner
488d593a0c Allow the fifo-depth and num-slots to be missing. For the former we read
the value from the hardware, for the latter assume a single slot.

Sponsored by:	ABT Systems Ltd
2015-08-27 16:18:22 +00:00
Andrew Turner
26f0e89a6d Allow us to select the transfer count. This allows us to work with hardware
that seems to only work with a single block at a time.

Sponsored by:	ABT Systems Ltd
2015-08-27 13:08:45 +00:00
Gleb Smirnoff
7a79cebfba Replay r286410. Change KPI of how device drivers that provide wireless
connectivity interact with the net80211 stack.

Historical background: originally wireless devices created an interface,
just like Ethernet devices do. Name of an interface matched the name of
the driver that created. Later, wlan(4) layer was introduced, and the
wlanX interfaces become the actual interface, leaving original ones as
"a parent interface" of wlanX. Kernelwise, the KPI between net80211 layer
and a driver became a mix of methods that pass a pointer to struct ifnet
as identifier and methods that pass pointer to struct ieee80211com. From
user point of view, the parent interface just hangs on in the ifconfig
list, and user can't do anything useful with it.

Now, the struct ifnet goes away. The struct ieee80211com is the only
KPI between a device driver and net80211. Details:

- The struct ieee80211com is embedded into drivers softc.
- Packets are sent via new ic_transmit method, which is very much like
  the previous if_transmit.
- Bringing parent up/down is done via new ic_parent method, which notifies
  driver about any changes: number of wlan(4) interfaces, number of them
  in promisc or allmulti state.
- Device specific ioctls (if any) are received on new ic_ioctl method.
- Packets/errors accounting are done by the stack. In certain cases, when
  driver experiences errors and can not attribute them to any specific
  interface, driver updates ic_oerrors or ic_ierrors counters.

Details on interface configuration with new world order:
- A sequence of commands needed to bring up wireless DOESN"T change.
- /etc/rc.conf parameters DON'T change.
- List of devices that can be used to create wlan(4) interfaces is
  now provided by net.wlan.devices sysctl.

Most drivers in this change were converted by me, except of wpi(4),
that was done by Andriy Voskoboinyk. Big thanks to Kevin Lo for testing
changes to at least 8 drivers. Thanks to pluknet@, Oliver Hartmann,
Olivier Cochard, gjb@, mmoll@, op@ and lev@, who also participated in
testing.

Reviewed by:	adrian
Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2015-08-27 08:56:39 +00:00
Baptiste Daroussin
de84ba19e3 More fixes to the new macros 2015-08-27 05:39:32 +00:00
Baptiste Daroussin
43eb73d456 Fix typo in new macros 2015-08-27 05:27:18 +00:00
Justin Hibbits
5d6961b0dc Fix freescale sdhc driver, and add it to the files list.
Also, add it to the mmc DRIVER_MODULE attachment list.
2015-08-27 03:47:56 +00:00
Baptiste Daroussin
612c465eed Merge i915_emit_box_p and i915_emit_box as done in linux 3.8
Reviewed by:	dumbbell
Differential Revision:	https://reviews.freebsd.org/D3495
2015-08-26 22:19:53 +00:00
Baptiste Daroussin
81a1afdcc9 Back out a change which should not have been committed yet 2015-08-26 22:09:12 +00:00
Baptiste Daroussin
bcdb2347c5 backout a change that should not have crept in 2015-08-26 22:00:40 +00:00
Baptiste Daroussin
736a911f22 Reduce diff against linux 3.8
Reviewed by:	dumbbell
Differential Revision:	https://reviews.freebsd.org/D3492
2015-08-26 21:35:16 +00:00
Baptiste Daroussin
85b8a32aea Reduce diff with linux 3.8.13 on i915_drv.c
While here update the list of devices id to match the one in linux 3.8.13

Reviewed by:	dumbbell
Differential Revision:	https://reviews.freebsd.org/D3489
2015-08-26 21:33:43 +00:00
Baptiste Daroussin
95fb5cf717 Add more DRM_* debug macros from linux 3.8.13 2015-08-26 21:31:04 +00:00
Baptiste Daroussin
e402f9113b Synchronize i915_reg.h with linux 3.8.13 version
Keep a couple of old macros that will be removed lated when the rest of the code
will be updated to 3.8.13 equivalent.
Chase the renamed macros

Reviewed by:	dumbbell
Differential Revision:	https://reviews.freebsd.org/D3487
2015-08-26 21:17:48 +00:00
Jung-uk Kim
70e6ab8f6b Merge ACPICA 20150818. 2015-08-26 17:13:47 +00:00
Baptiste Daroussin
5b5117af3b Reduce diff on i915_dma.c against linux 3.8.13
No functional changes

Discussed with:	dumbbell
Reviewed by:	dumbbell
2015-08-26 13:23:56 +00:00
Andrew Turner
4f768055bd Only access the Samsung registers when targeting Samsung hardware.
Sponsored by:	ABT Systems Ltd
2015-08-26 10:54:14 +00:00
Bryan Drewery
8183f2e312 Fix filemon locking races.
Convert filemon_lock and struct filemon* lock to sx(9), rather than a
self-rolled reader-writer lock, and hold it for the entire time needed.

At least filemon_lock_write() was not checking for active readers when
it would successfully return with the write lock "held".  This led to
a race with reading entries from filemon_inuse as they were removed.  This
could be seen with QUEUE_MACRO_DEBUG enabled, causing -1 to be read as an
entry rather than a valid struct filemon*.

Fixing filemon_lock_write() to check readers was insufficient to fix the
races.

sx(9) was used as the lock could be held while taking proctree_lock and sleeping
in fo_write.

Sponsored by:	EMC / Isilon Storage Division
MFC after:	2 weeks
2015-08-26 03:44:48 +00:00
Bryan Drewery
8b64fa1e12 Avoid taking proctree_lock and searching parents in wrappers if not needed.
This should help the case where filemon is loaded but not in use.

Sponsored by:	EMC / Isilon Storage Division
MFC after:	2 weeks
2015-08-26 03:37:18 +00:00
Bryan Drewery
9fa45e4864 Remove unneeded inuse list locking in filemon_comment().
Sponsored by:	EMC / Isilon Storage Division
MFC after:	2 weeks
2015-08-26 03:33:34 +00:00
Bryan Drewery
1ab9f216d2 Move common locking for filemon_inuse and struct filemon* to filemon_pid_check().
This keeps the lock for the filemon_inuse list held only while reading
the list.

Sponsored by:	EMC / Isilon Storage Division
MFC after:	2 weeks
2015-08-26 03:32:47 +00:00
Conrad Meyer
8c8e848710 ioat(4): Minor style cleanups
Suggested by:	ngie
Reviewed by:	jimharris
Approved by:	markj (mentor)
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D3481
2015-08-25 17:39:03 +00:00
Marcelo Araujo
f0c2f5e202 Code cleanup unused-but-set-variable spotted by gcc.
Reviewed by:	royger
Approved by:	bapt (mentor)
Differential Revision:	D3476
2015-08-25 15:34:28 +00:00
Conrad Meyer
e974f91c38 Import ioat(4) driver
I/OAT is also referred to as Crystal Beach DMA and is a Platform Storage
Extension (PSE) on some Intel server platforms.

This driver currently supports DMA descriptors only and is part of a
larger effort to upstream an interconnect between multiple systems using
the Non-Transparent Bridge (NTB) PSE.

For now, this driver is only built on AMD64 platforms.  It may be ported
to work on i386 later, if that is desired.  The hardware is exclusive to
x86.

Further documentation on ioat(4), including API documentation and usage,
can be found in the new manual page.

Bring in a test tool, ioatcontrol(8), in tools/tools/ioat.  The test
tool is not hooked up to the build and is not intended for end users.

Submitted by:	jimharris, Carl Delsey <carl.r.delsey@intel.com>
Reviewed by:	jimharris (reviewed my changes)
Approved by:	markj (mentor)
Relnotes:	yes
Sponsored by:	Intel
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D3456
2015-08-24 19:32:03 +00:00
Bjoern A. Zeeb
e6f4757735 When forking a child process with PMC_F_DESCENDANTS set in pmc_attach()
in the parent, we will inherit the pmcids but cannot execute any operations
on them in the child.  The reason for this is that pmc_find_pmc() only
tries to find the current process on the owners hash list, but given the
child does not own the attachment, we cannot find it.
Thus, in case the initial lookup fails, try to find the pmc_process state
affiliated with the child process, lookup the pmc from there using the
row index, and get the owner process from that pmc.
Then continue as normal and lookup the pmc context of the owner (process).

This allows us to call, e.g., pmc_start() in the child process before we
start the work there, but to collect the accumulated results later in
the parent.

Sponsored by:		DARPA,AFRL
Obtained from:		L41
Tested by:		rwatson, L41
MFC after:		4 weeks
Reviewed by:		gnn
Differential Revision:	https://reviews.freebsd.org/D2052
2015-08-24 18:57:32 +00:00
Sean Bruno
48600901a8 Style/whitespace cleanup in shared/common code.
Differential Revision:	https://reviews.freebsd.org/D3159
Submitted by:	erj
MFC after:	2 weeks
2015-08-24 16:32:57 +00:00
Mark Murray
e866d8f05b Make the UMA harvesting go away completely if not wanted. Default to "not wanted".
Provide and document the RANDOM_ENABLE_UMA option.

Change RANDOM_FAST to RANDOM_UMA to clarify the harvesting.

Remove RANDOM_DEBUG option, replace with SDT probes. These will be of
use to folks measuring the harvesting effect when deciding whether to
use RANDOM_ENABLE_UMA.

Requested by:	scottl and others.
Approved by:	so (/dev/random blanket)
Differential Revision:    https://reviews.freebsd.org/D3197
2015-08-22 12:59:05 +00:00
Justin Hibbits
6aabc119b6 Create a RouterBoard platform and use it to create a flash map
Summary:
The RouterBoard uses a predefined partition map which doesn't exist in the fdt.
This change allows overriding the fdt slicer with a custom slicer, and uses this
custom slicer to define the flash map on the RouterBoard RB800.
D3305 converts the mpc85xx platform into a base class, so that systems based on
the mpc85xx platform can add their own overrides.  This change builds on D3305,
and creates a RouterBoard (RB800) platform to initialize the slicer override.

Reviewed By: nwhitehorn, imp
Differential Revision: https://reviews.freebsd.org/D3345
2015-08-22 05:50:18 +00:00
Warner Losh
e64ac86eb4 We're waiting on a struct proc *, not a struct thread *. Fix a
comment that was wrong.
2015-08-21 21:47:29 +00:00
Roger Pau Monné
f8f1bb83f7 xen: allow disabling PV disks and nics
Introduce two new loader tunnables that can be used to disable PV disks and
PV nics at boot time. They default to 0 and should be set to 1 (or any
number different than 0) in order to disable the PV devices:

hw.xen.disable_pv_disks=1
hw.xen.disable_pv_nics=1

In /boot/loader.conf will disable both PV disks and nics.

Sponsored by:	Citrix Systems R&D
Tested by:	Karl Pielorz <kpielorz_lst@tdx.co.uk>
MFC after:	1 week
2015-08-21 15:53:08 +00:00
Conrad Meyer
15d449a5ad vt_cpulogos: Resize all terms/windows when tearing down logos
PR:		202288 (partial)
Tested by:	Jakob Alvermark
Reviewed by:	ed
Approved by:	markj (mentor)
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D3388
2015-08-21 15:21:56 +00:00
Adrian Chadd
d3fdd08cf3 Further conversions from ifp->if_softc -> ic_softc. 2015-08-20 05:13:54 +00:00
Adrian Chadd
3843c5e486 Remove some if_softc references from urtwn(4).
The only ones that are left are in if_start, if_stop and ioctl.

Tested:

* urtwn0: MAC/BB RTL8188CUS, RF 6052 1T1R, STA mode
2015-08-20 03:57:41 +00:00
Navdeep Parhar
8faf57012b cxgbe(4): Save the flags for the last adapter-wide synchronized
operation that was initiated successfully.  (The caller and thread are
already recorded).

MFC after:	1 week
2015-08-19 15:40:03 +00:00
Michael Gmelin
12e413be27 Allow building a kernel with baked in ig4, isl and cyapa drivers.
Also addresses jhb's remarks on D2811 and D3068.

PR:		202059
Differential Revision:	https://reviews.freebsd.org/D3351
Reviewed by:	jhb
Approved by:	jhb
2015-08-19 09:49:29 +00:00
Luiz Otavio O Souza
c0dca72a18 Fix the use of plural in two cases that I missed on r285784.
This should cause no functional change.
2015-08-18 21:37:14 +00:00
Luiz Otavio O Souza
3df058ffaf Add the GPIO driver for the ADI Engineering RCC-VE and RCC-DFF/DFFv2.
This driver allows read the software reset switch state and control the
status LEDs.

The GPIO pins have their direction (input/output) locked down to prevent
possible short circuits.

Note that most people get a reset button that is a hardware reset.  The
software reset button is available on boards from Netgate.

Sponsored by:	Rubicon Communications (Netgate)
2015-08-18 21:05:56 +00:00
Fabien Thomas
078246e50f Add ichwd TCO version 3 support (Bay Trail / Rangeley...)
Reviewed by: jhb
Obtained from: Cas-well
Sponsored by: Stormshield
2015-08-18 14:54:29 +00:00
Tai-hwa Liang
076cf2dd66 Using the error return code documented in the comment.
Though there is no direct midi_uninit() caller amongst existing drivers
at this moment, a quick experiment indicates that EBUSY gives users more
precise error message once drivers start to honour this result.  For example,
emu_midi_detach() should check the result of mpu401_uninit() and block
module unloading if there is any MIDI I/O in progress.

MFC after:	2 weeks
2015-08-18 13:16:06 +00:00
Tai-hwa Liang
7cbd5add2f Fixing typo as well as improving readability of a few comments.
MFC after:	3 days
2015-08-18 12:50:46 +00:00
Marcel Moolenaar
ec6b1f6acc Support frame buffers that are larger than the default screen
size as defined by VT_FB_DEFAULT_WIDTH and VT_FB_DEFAULT_HEIGHT
(at this time 2048x1200). The default is really a max. We cap
the height and width to those defaults and position the screen
in the center of the frame buffer.

Ideally we use a bigger font to utility the entire real estate
that is the frame buffer, but that's seen as an improvement over
making it work first.

PR:		193745
2015-08-18 00:47:02 +00:00
Adrian Chadd
2cb71df183 Convert more ifp->if_softc -> ic->ic_softc.
These should be a big no-op.

Tested:

* make universe
2015-08-17 23:44:38 +00:00
Adrian Chadd
122d43f3fb Migrate ifp->if_softc -> ic->ic_softc.
Tested:

* Lenovo T400 (Intel 5300)
* make universe
2015-08-17 23:35:31 +00:00
Luiz Otavio O Souza
e9aebbb018 gpioled(4) depends on gpiobus.
This fixes the loading of gpioled as a module.

Sponsored by:	Rubicon Communications (Netgate)
2015-08-17 17:09:57 +00:00
Luiz Otavio O Souza
978cdbedcd Fix a few bugs when gpiobus is detaching:
- Detach the gpiobus and the gpioc devices from the GPIO controller.

 - Fix the leak of gpiobus IRQ rman(9) region descriptor.

 - Fix the leak of child ivars and IRQ resource list.

While here return NULL (instead of 0) for a device_t that fails to allocate
the ivar memory.

Tested with gpiobus built as a module.

Sponsored by:	Rubicon Communications (Netgate)
2015-08-17 16:51:37 +00:00
Mark Murray
646041a89a Add DEV_RANDOM pseudo-option and use it to "include out" random(4)
if desired.

Retire randomdev_none.c and introduce random_infra.c for resident
infrastructure. Completely stub out random(4) calls in the "without
DEV_RANDOM" case.

Add RANDOM_LOADABLE option to allow loadable Yarrow/Fortuna/LocallyWritten
algorithm.  Add a skeleton "other" algorithm framework for folks
to add their own processing code. NIST, anyone?

Retire the RANDOM_DUMMY option.

Build modules for Yarrow, Fortuna and "other".

Use atomics for the live entropy rate-tracking.

Convert ints to bools for the 'seeded' logic.

Move _write() function from the algorithm-specific areas to randomdev.c

Get rid of reseed() function - it is unused.

Tidy up the opt_*.h includes.

Update documentation for random(4) modules.

Fix test program (reviewers, please leave this).

Differential Revision:    https://reviews.freebsd.org/D3354
Reviewed by:              wblock,delphij,jmg,bjk
Approved by:              so (/dev/random blanket)
2015-08-17 07:36:12 +00:00
Adrian Chadd
3797bf0896 Remove most of the references of ifp->if_softc and replace with
references to ic->ic_softc.

This is in preparation for gleb's ifnet work.

Tested:

* ath(4), STA mode
* ath(4), hostap mode
* make universe
2015-08-17 02:04:11 +00:00
Sean Bruno
7c669ab6cc Bump all copywrite dates to 2015
Differential Revision:	https://reviews.freebsd.org/D3160
Submitted by:	erj
MFC after:	2 weeks
Sponsored by:	Intel Corportation
2015-08-16 20:13:58 +00:00
Sean Bruno
d2635c677b e1000/if_lem.c bump to 1.1.0
- deprecate fbsd 8

Differential Revision:	https://reviews.freebsd.org/D3164
Submitted by:	erj
MFC after:	2 weeks
Sponsored by:	Intel Corporation
2015-08-16 20:10:43 +00:00
Sean Bruno
df40405fab Increase EM_MAX_SCATTER to 64 such that the size of em_xmit()::segs[EM_MAX_SCATTER]
doesn't get overrun by things like NFS that can and do shove more than 32 segs when
being used with em(4) and TSO4.

Update tso handling code in em_xmit() with update from jhb@ in email thread:
https://lists.freebsd.org/pipermail/freebsd-net/2014-July/039306.html

set ifp->if_hw_tsomax, ifp->if_hw_tsomaxsegcount & ifp->if_hw_tsomaxsegsize
to appropriate values.

Define a TSO workaround "magic" number  of 4 that is used to avoid an
alignment issue in hardware.

Change a couple of integer values that were used as booleans to actual
bool types.

Ensure that em_enable_intr() enables the appropriate mask of interrupts
and not just a hardcoded define of values.

PR:		200221 199174 195078
Differential Revision:	https://reviews.freebsd.org/D3192
Reviewed by:	erj jhb hiren
MFC after:	2 weeks
Sponsored by:	Limelight Networks
2015-08-16 19:43:44 +00:00
Sean Bruno
38be29d321 Add capability to disable CRC stripping. This breaks IPMI/BMC capabilities on certain adatpers.
Linux has been doing the exact same thing since 2008

eb7c3adb1c

PR:	161277
Differential Revision:	https://reviews.freebsd.org/D3282
Submitted by:	Fravadona@gmail.com
Reviewed by:	erj wblock
MFC after:	2 weeks
Relnotes:	yes
Sponsored by:	Limelight Networks
2015-08-16 19:06:23 +00:00
Alexander Motin
4ab41168ac Small addition to r286814.
Submitted by:	bz
MFC after:	2 weeks
2015-08-15 22:55:32 +00:00
Alexander Motin
217b4e023d Remove UMA allocation of ATA requests.
After CAM replaced old ATA stack, this driver processes no more then one
request at a time per channel.  Using UMA after that is overkill, so
replace it with simple preallocation of one request per channel.

MFC after:	2 weeks
2015-08-15 21:46:02 +00:00
Marcel Moolenaar
296a51148d Improve support for Macs that have a stride not equal to the
horizonal resolution (width). In those cases fb_bpp ended up
completely wrong -- as in 6 bytes per pixel or something like
that. Since we already have a way to calculate fb_depth given
the masks and fb_bpp is effectively the same as fb_depth, all
we need to do is make sure fb_bpp is rounded to the next
multiple of the number of bits in a byte -- we assume we can
divide by the number of bits in a byte throughout vt(4).
While here:
-   simplify how we calculate fb_depth.
-   use fb_bpp instead of fb_depth to calculate fb_stride;
    we know we can divide fb_bpp.
-   don't limit fb_width and fb_height by VT_FB_DEFAULT_WIDTH
    and VT_FB_DEFAULT_HEIGHT (resp.). Those constants have
    not relation to the size of the frame buffer.

This at least fixes "lower-resolution" Macs. We're talking
1280x1024 or so. There still is a problem with 27" Macs,
which typically have a horizontal resolution over 2K.

PR:		193745 (partial)
Ok'd by:	emaste@
2015-08-15 16:13:28 +00:00
Marcel Moolenaar
8bd2e88e36 Improve the VT initialization message: have it say what the
resolution is. For text mode this is the number of columns
by the number of rows. Include the name of the driver in a
much less prominent way.
2015-08-15 15:44:09 +00:00
Hans Petter Selasky
ce842cec42 Fixes for HIGH speed ISOCHRONOUS traffic. HS ISOCHRONOUS traffic at
intervals less than 250us was not handled properly. Add support for
high-bandwidth ISOCHRONOUS packets. USB webcams, USB audio and USB DVB
devices are expected to work better. High-bandwidth INTERRUPT
endpoints is not yet supported.

MFC after:	2 weeks
2015-08-15 12:06:15 +00:00
Hans Petter Selasky
22ef3de712 Fix race in USB PF which can happen if we stop tracing exactly when
the kernel is tapping an USB transfer. This leads to a NULL pointer
access. The solution is to only trace while the USB bus lock is
locked.

MFC after:	2 weeks
2015-08-15 09:00:36 +00:00
John Baldwin
3ebe4c01f7 Remove another remnant of PV domU support and assume that we always run
with an automatically translated physmap under XEN.

Reviewed by:	royger (earlier version)
Differential Revision:	https://reviews.freebsd.org/D3325
2015-08-14 18:38:39 +00:00
Hans Petter Selasky
e4344dae5b Handle NYET high speed tokens and predict NAK'ing is up next.
MFC after:	2 weeks
2015-08-14 14:20:10 +00:00
Hans Petter Selasky
7462a4dda1 Minor code refactor to avoid duplicating code.
MFC after:	2 weeks
2015-08-14 13:58:18 +00:00
Hans Petter Selasky
43ea03d756 Improve the realtime properties of USB transfers for embedded systems
like RPI-B and RPI-2.

Description of problem:
USB transfers can process data in their callbacks sometimes causing
unacceptable latency for other USB transfers. Separate BULK completion
callbacks from CONTROL, INTERRUPT and ISOCHRONOUS callbacks, and give
BULK completion callbacks lesser execution priority than the
others. This way USB audio won't be interfered by heavy USB ethernet
usage for example.

Further serve USB transfer completion in a round robin fashion,
instead of only serving the most CPU hungry. This has been done by
adding a third flag to USB transfer queue structure which keeps track
of looping callbacks. The "command" callback function then decides
what to do when looping.

MFC after:		2 weeks
2015-08-14 12:57:53 +00:00
Marcel Moolenaar
c68ea8a640 s/as/at/ in previous commit.
Pointed out by: jmallett@
2015-08-13 19:12:55 +00:00
Dimitry Andric
5bf328b6f4 Avoid left-shifting negative signed values in bxe(4).
Reviewed by:	davidcs
MFC after:	3 days
2015-08-13 18:24:41 +00:00
Marcel Moolenaar
cc787e3d0e Change md(4) to use weak symbols as start, end and size for the embedded
root disk. The embedded image is linked into the kernel in the .mfs
section.

Add rules and variables to kern.pre.mk and kern.post.mk that handle the
linking of the image. First objcopy is used to generate an object file.
Then, the object file is linked into the kernel.

Submitted by:	Steve Kiernan <stevek@juniper.net>
Reviewed by:	brooks@
Obtained from: Juniper Networks, Inc.
Differential Revision:	https://reviews.freebsd.org/D2903
2015-08-13 15:16:34 +00:00
Marcel Moolenaar
6280434f9a Fix text mode operation.
We first map 64KB at 0xA0000 and then determine whether to work
in text or graphics mode.  When graphics mode, the mapping is
precisely what we need and everything is fine.  But text mode,
has the frame buffer relocated to 0xB8000. We didn't map that
much to safely add 0x18000 bytes to the base address.

Now we first check whether to work in text or graphics mode and
then map the frame buffer at the right address and with the
right size (0xA0000+64KB for graphics, 0xB8000+32KB for text).

PR:		202276
Tested by:	ed@
2015-08-13 14:43:11 +00:00
Andrey V. Elsukov
ec170744a7 Use g_conf_printf_escaped() to escape illegal symbols in file name.
PR:		202289
MFC after:	1 week
2015-08-13 13:20:29 +00:00
Marcel Moolenaar
7bd6f3d060 Add support for the Broadcom TruManage integrated serial port.
PR:		191266
2015-08-12 15:48:14 +00:00
Marcel Moolenaar
7ef5e8bc80 Better support memory mapped console devices, such as VGA and EFI
frame buffers and memory mapped UARTs.

1.  Delay calling cninit() until after pmap_bootstrap(). This makes
    sure we have PMAP initialized enough to add translations. Keep
    kdb_init() after cninit() so that we have console when we need
    to break into the debugger on boot.
2.  Unfortunately, the ATPIC code had be moved as well so as to
    avoid a spurious trap #30. The reason for which is not known
    at this time.
3.  In pmap_mapdev_attr(), when we need to map a device prior to the
    VM system being initialized, use virtual_avail as the KVA to map
    the device at. In particular, avoid using the direct map on amd64
    because we can't demote by virtue of not being able to allocate
    yet. Keep track of the translation.
    Re-use the translation after the VM has been initialized to not
    waste KVA and to satisfy the assumption in uart(4) that the handle
    returned for the low-level console is the same as later returned
    when the device is probed and attached.
4.  In pmap_unmapdev() remove the mapping from the table when called
    pre-init. Otherwise keep the mapping. During bus probe and attach
    device resources are mapped and unmapped multiple times, which
    would have us destroy the mapping used by the low-level console.
5.  In pmap_init(), set pmap_initialized to signal that we're not
    pre-init anymore. On amd64, bring the direct map in sync with the
    translations created at that time.
6.  Implement bus_space_map() and bus_space_unmap() for real: when
    the tag corresponds to memory space, call the corresponding
    pmap_mapdev() and pmap_unmapdev() functions to construct and
    actual handle.
7.  In efifb.c and vt_vga.c, remove the crutches and hacks and simply
    call pmap_mapdev_attr() or bus_space_map() as desired.

Notes:
1.  uart(4) already used bus_space_map() during low-level console
    setup but since serial ports have traditionally been I/O port
    based, the lack of a proper implementation for said function
    was not a problem. It has always supported memory mapped UARTs
    for low-level consoles by setting hw.uart.console accordingly.
2.  The use of the direct map on amd64 without setting caching
    attributes has been a bigger problem than previously thought.
    This change has the fortunate (and unexpected) side-effect of
    fixing various EFI frame buffer problems (though not all).

PR: 191564, 194952

Special thanks to:
1.  XipLink, Inc -- generously donated an Intel Bay Trail E3800
    based eval board (ADLE3800PC).
2.  The FreeBSD Foundation, in particular emaste@ -- for UEFI
    support in general and testing.
3.  Everyone who tested the proposed for PR 191564.
4.  jhb@ and kib@ for being a soundboard and applying a clue bat
    if so needed.
2015-08-12 15:26:32 +00:00
Marcel Moolenaar
9def69ec5f Use bus_alloc_resource_any(), rather than bus_alloc_resource()
with start 0 and end ~0. This avoids confusion WRT to what the
value of length can or should be.
2015-08-12 04:03:04 +00:00
Koop Mast
d8f4b93526 Instead of defining the actualy user and group id in the drmP.h files
define GID_VIDEO in sys/conf.h, and use it together with UID_ROOT
to define DRM_DEV_UID and DRM_DEV_GID in the drmP.h files.

So there is one place where the UID's and GID's are defined.

Submitted by:	ed@
Reviewed by:	ed@, dumbbell@
Differential Revision:	https://reviews.freebsd.org/D3360
2015-08-11 16:51:44 +00:00
Andrew Turner
6e3244f594 Start to support PSCI 1.0. For all the functions we currently support this
can be seen as the same as 0.2. There are changes with the data passed to
CPU_SUSPEND, however we don't yet use this call.

Sponsored by:	ABT Systems Ltd
2015-08-11 13:42:58 +00:00
Ian Lepore
dc4aaf6dd1 Style fix, no functional changes -- do the braces for switches correctly. 2015-08-11 02:30:54 +00:00
Ian Lepore
fac6a198c3 Correct the polarity of the PPS assert and clear events with respect to the
electrical signals on the serial port.  Virtually all devices which output a
PPS signal generate a brief higher-voltage pulse, the leading edge of which
is the on-time point.

Both DCD and CTS are active-low signals on the wire, meaning the assertion
of their status bits in the modem status register corresponds to the lower
voltage level on the wire.  So when the status bit transitions to not-set,
create a PPS assert event; when the status bit transitions to set, create a
PPS clear event.
2015-08-10 20:54:03 +00:00
Ian Lepore
196d3019a8 Allow the choice of PPS signal captured by uart(4) to be runtime-configured,
eliminating the need to build a custom kernel to use the CTS signal.

The historical UART_PPS_ON_CTS kernel option is still honored, but now it
can be overridden at runtime using a tunable to configure all uart devices
(hw.uart.pps_mode) or specific devices (dev.uart.#.pps_mode).  The per-
device config is both a tunable and a writable sysctl.

This syncs the PPS capabilities of uart(4) with the enhancements recently
recently added to ucom(4) for capturing from USB serial devices.

Relnotes:	yes
2015-08-10 20:08:09 +00:00
Scott Long
ac7d1ed24c Remove mps_request_polled(), it's redundant to mps_wait_command()
Obtained from:	Netflix, Inc.
2015-08-10 09:02:34 +00:00
Scott Long
44f2b87692 Remove some unused code.
Obtained from:	Netflix, Inx.
2015-08-10 08:57:34 +00:00
Koop Mast
34c7eb57ed Add a new group named 'video' with the id of 44. And make drm create
devices in /dev/dri/ with this new group.

This will allow ports and users to more easily access to these devices
for OpenGL and OpenCL support.

Reviewed by:	dumbbell@
Approved by:	dumbbell@
Differential Revision:	https://reviews.freebsd.org/D1260
2015-08-09 12:58:56 +00:00
Zbigniew Bodek
4718610d0d Treat internal bridge as subtractive on ThunderX ARM64
Internal bridges in Cavium ThunderX SoC behave as subtractive,
but they are unable to be identified. Force setting an appropriate
flag.

Reviewed by:   emaste, imp
Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3277
2015-08-08 21:46:38 +00:00
Rui Paulo
49fdbf0a92 iwm: use the proper include path for iwm headers. 2015-08-08 21:08:35 +00:00
Ian Lepore
b59236cece Provide the tty-layer mutex when initializing the pps api. This allows
time_pps_fetch() to be used in blocking mode.

Also, don't init the pps api for system devices (consoles) that provide a
custom attach routine.  The device may actually be a keyboard or other non-
tty device.  If it wants to do pps processing (unlikely) it must handle
everything for itself.  (In reality, only a sun keyboard uses a custom
attach routine, and it doesn't make a good pps device.)
2015-08-08 20:11:47 +00:00
Rui Paulo
2e7b8b8b51 iwm: fix a KASSERT: s/ds_size/ds_len/. 2015-08-08 20:07:25 +00:00
Alexander Motin
709c835a5a Disable 32-bit PIO for 6Gbit/s Intel SATA controllers.
For some reason 32-bit PIO writes are not working on 6Gbit/s Intel SATA
ports, while 16/32-bit PIO reads and 16-bit PIO writes are working fine.
3Gbit/s ports on the same controllers have no this problem.

Workaround this by disabling 32-bit PIO for all Intel controllers that may
have 6Gbit/s ports.  It halves PIO performance from 6MB/s to 3MB/s, but
who bother about speed of such rare and slow mode, which is also highly
discouraged by SATA specifications?

MFC after:	2 weeks
2015-08-08 11:48:11 +00:00
Rui Paulo
d4886179cb Import OpenBSD's iwm WiFi driver for Intel 3160/7260/7265.
There are still several bugs, but I've been using it for a while now.
Thanks to all the testers and to Adrian for his help with this
driver.

This driver isn't connected to the build yet, but it will be soon.

There's no MFC planned because the driver isn't very stable yet.

Reviewed by:	adrian
Obtained from:	https://github.com/rpaulo/iwm
Tested by:	adrian, gjb, dumbbell (others that I forgot).
Relnotes:	yes
2015-08-08 06:06:48 +00:00
Adrian Chadd
ba2c1fbc03 Revert the wifi ifnet changes until things are more baked and tested.
* 286410
* 286413
* 286416

The initial commit broke a variety of debug and features that aren't
in the GENERIC kernels but are enabled in other platforms.
2015-08-08 01:10:17 +00:00
Gleb Smirnoff
ad30bc5aec Fix mtx_assert() argument. 2015-08-07 16:23:16 +00:00
Alexander Motin
ebef81ecea Add unmapped I/O support to ata(4) driver.
Main problem there was PIO mode support, that required KVA mapping.
Handle that case using recently added pmap_quick_enter_page(9) KPI,
mapping data pages to KVA one at a time.
2015-08-07 14:38:26 +00:00
Gleb Smirnoff
7a3151955b Fix !MWL_DEBUG build. 2015-08-07 12:34:20 +00:00
Gleb Smirnoff
79d2c5e857 Change KPI of how device drivers that provide wireless connectivity interact
with the net80211 stack.

Historical background: originally wireless devices created an interface,
just like Ethernet devices do. Name of an interface matched the name of
the driver that created. Later, wlan(4) layer was introduced, and the
wlanX interfaces become the actual interface, leaving original ones as
"a parent interface" of wlanX. Kernelwise, the KPI between net80211 layer
and a driver became a mix of methods that pass a pointer to struct ifnet
as identifier and methods that pass pointer to struct ieee80211com. From
user point of view, the parent interface just hangs on in the ifconfig
list, and user can't do anything useful with it.

Now, the struct ifnet goes away. The struct ieee80211com is the only
KPI between a device driver and net80211. Details:

- The struct ieee80211com is embedded into drivers softc.
- Packets are sent via new ic_transmit method, which is very much like
  the previous if_transmit.
- Bringing parent up/down is done via new ic_parent method, which notifies
  driver about any changes: number of wlan(4) interfaces, number of them
  in promisc or allmulti state.
- Device specific ioctls (if any) are received on new ic_ioctl method.
- Packets/errors accounting are done by the stack. In certain cases, when
  driver experiences errors and can not attribute them to any specific
  interface, driver updates ic_oerrors or ic_ierrors counters.

Details on interface configuration with new world order:
- A sequence of commands needed to bring up wireless DOESN"T change.
- /etc/rc.conf parameters DON'T change.
- List of devices that can be used to create wlan(4) interfaces is
  now provided by net.wlan.devices sysctl.

Most drivers in this change were converted by me, except of wpi(4),
that was done by Andriy Voskoboinyk. Big thanks to Kevin Lo for testing
changes to at least 8 drivers. Thanks to Olivier Cochard, gjb@, mmoll@,
op@ and lev@, who also participated in testing. Details here:

https://wiki.freebsd.org/projects/ifnet/net80211

Still, drivers: ndis, wtap, mwl, ipw, bwn, wi, upgt, uath were not
tested. Changes to mwl, ipw, bwn, wi, upgt are trivial and chances
of problems are low. The wtap wasn't compilable even before this change.
But the ndis driver is complex, and it is likely to be broken with this
commit. Help with testing and debugging it is appreciated.

Differential Revision:	D2655, D2740
Sponsored by:	Nginx, Inc.
Sponsored by:	Netflix
2015-08-07 11:43:14 +00:00
Andrew Turner
d1b2133d03 Attach dwmmc to the ofwbus, som devicetrees place it here.
Sponsored by:	ABT Systems Ltd
2015-08-07 08:57:58 +00:00
Andrew Turner
a336c37514 Stop including machine/fdt.h, it's unneeded, and purposefully
unimplemented on arm64.

Sponsored by:	ABT Systems Ltd
2015-08-07 08:54:50 +00:00
Ian Lepore
a046541623 Return the current ftdi bitbang mode with the UFTDIIOC_GET_BITMODE ioctl.
The ftdi chip itself has a "get bitmode" command that doesn't actually
return the current bitmode, just a snapshot of the gpio lines.  The chip
apparently has no way to provide the current bitmode.

This implements the functionality at the driver level.  The driver starts
out assuming the chip is in UART mode (which it will be, coming out of
reset) and keeps track of every successful set-bitmode operation so that
it can always return the current mode with UFTDIIOC_GET_BITMODE.
2015-08-06 19:47:04 +00:00
Ian Lepore
fc43ff0865 Add support to the uftdi driver for reading and writing the serial eeprom
that can be attached to the chips, via ioctl() calls.
2015-08-06 19:29:26 +00:00
John Baldwin
3c790178c5 Remove some more vestiges of the Xen PV domu support. Specifically,
use vtophys() directly instead of vtomach() and retire the no-longer-used
headers <machine/xenfunc.h> and <machine/xenvar.h>.

Reported by:	bde (stale bits in <machine/xenfunc.h>)
Reviewed by:	royger (earlier version)
Differential Revision:	https://reviews.freebsd.org/D3266
2015-08-06 17:07:21 +00:00
Gleb Smirnoff
e369e734f4 Make it compilable. No idea if it works. 2015-08-06 14:05:17 +00:00
Adrian Chadd
70c81b2077 Add a hack-around to this fatal taskqueue running whilst the NIC
is detaching.

This mostly fixes a panic - the reset path shouldn't run whilst
the NIC is being torn down.

It's not locked, so it's "mostly" ok, but most of the rest of
the driver doesn't read sc->invalid with sensible locking. Grr.

The real solution is to cleanly tear down taskqueues in the detach/suspend
phase, but ..
2015-08-05 21:22:25 +00:00
Navdeep Parhar
d94b89b915 cxgbe(4): Update T5 and T4 firmwares bundled with the driver to 1.14.4.0. The
changes in the firmwares since 1.11.27.0 are listed here (straight copy-paste
from the "Release Notes.txt" accompanying the Chelsio Unified Wire 2.11.1.0
release on the website).

22.1. T5 Firmware
+++++++++++++++++++++++++++++++++

Version : 1.14.4.0
Date    : 08/05/2015
================================================================================

FIXES
-----

BASE:
- Fixes a potential data path hang by properly programming PMTX congestion
  threshold settings.
- Fixes a potential initialization error when accessing a configuration file
  stored on the flash.
- Fixes a regression where SGE resources can be miss-sized if iWARP is disabled.

ETH:
- Fixes a timing issue that would prevent CR4 links from coming up with some
  switches.

FOFCoE:
- Defers fcoe linkdown mailbox command handling till LOGO is sent.
- Updates vlan prio for all outstanding IOs during dcbx update.

ENHANCEMENTS
------------

BASE:
- Adds support for PAUSE OFF watchdog.
- Reports devlog access information in PCIE_FW_PF register 7.

ETH:
- Enhances segmentation offload to include VxLAN and Geneve.
- Adds PTP support.
- Adds new interface to allow the driver to query the VI rss table base
  addresses.
- Allows the driver to program the SGE ingrext contxt CongDrop field.

OFLD:
- Adds new interface for the driver to specify offloaded connections TCP snd
  and rcv scale factors.

iSCSI:
- Adds support for iscsi segmentatation offload (ISO).
- Adds support for iscsi t10-dif offload.

FOiSCSI:
- Sets FORCE_BIT for cut through processing for FOiSCSI.

FOFCoE:
- Adds support for FCoE BB6.
- Improves WRITE performance.

================================================================================
================================================================================

Version : 1.13.32.0
Date    : 03/25/2015
================================================================================

FIXES
-----

BASE:
- Fixes FW_CAPS_CONFIG_CMD return value on error (was positive instead of
   negative)
- Fixes FW_PARAMS_PARAM_DEV_FLOWC_BUFFIFO_SZ indication (was wrong on certain
   adapter configurations)
- Fixes config file based PL_TIMEOUT register programming

ETH:
- Fixes a potential EO UDP SEG header corruption
- Fixes an issue where 1000Base-X was not enabled correctly when using QSA
   modules

OFLD:
- Fixes timeout issue with half-open connections
- Fixes FW_FLOWC_WR processing when state is set to finwait1

FOFCoE:
- Fixes fcoe xchg leaks in linkdown/peer down path
- Fixes cleanup in FCoE linkdown and fixed buf timer flowid abuse
- Fixes fw crash by clearing fcf flowc during bye

FOiSCSI:
- Don't create a new tcp socket if ERL0 attempt has timed out.

ENHANCEMENTS
------------

BASE:
- Adds support for VFs on PFs 4 to 7
- Adds support for QPs/CQs on any physical and virtual function

ETH:
- Stops sending LACP frames on loopback interface
- Adds an AUTOEQU indication to CPL_SGE_EGR_UPDATE
- Adds support for CR4 links (BEAN/AEC on 40G TwinAx cables)

OFLD:
- Improves default settings of LAN and CLUSTER TCP timer settings
- Sends Negative Advice CPLs to software

FOISCSI:
- Adds IPv6 support for foiscsi. Keeps backward compatibility with
   old foiscsi drivers which doesn't support ipv6.

FOFCoE:
- Added fcoe debug support in flowc dump

================================================================================
================================================================================

Version : 1.12.25.0
Date    : 10/22/2014
================================================================================

FIXES
-----

BASE:
- Improves precision of the Weight Round Robing Traffic Management Algorithm
- Fixes an issue where the link would intermittently fail to come up
- Fixes an issue where adapters with an external PHY couldn't run at 100Mbps
- Fixes an issue where active optical cables were not recognized
- Fixes link advertising issues on T520-BT (speed and pause frames) that would
  cause the link to negotiate unexpected settings
- Forces link restart when auto-negotiation is disabled
- Fix an issue where pause frames wouldn't be fully disabled even if requested

ETH:
- Fixes NVGRE Segmentation Offload network header generation.

DCBX:
- Fixes an issue where some settings were not being sent to the switch
  correctly
- Fixes an issue where back-to-back DCBX port updates could get overwritten by
  FW
- Fixes a firmware crash on DCBX APP information request before link up

FOiSCSI:
- Fixes abort task leak in tmf response handling
- Fixes TCP RST handling while in iSCSI ERL0
- Fixes a firmware crash on BYE without INIT

ENHANCEMENTS
-------------

BASE:
- Adds link partner settings reporting when available
- Adds QSA support (in conjunction with QSA VPD)
- Adds T520-BT LED support
- Reports NOTSUPPORTED for modules with an unhandled identifier

DCBX:
- Adds version reporting (indicating which version FW is trying to negotiate)
- Adds IEEE support
- Reports LLDP time outs

FOiSCSI:
- Add support for multiple iSCSI DDP client
- Sends DHCP renew request when lease expires

================================================================================

22.2. T4 Firmware
+++++++++++++++++

Version : 1.14.4.0
Date    : 08/05/2015
================================================================================

FIXES
-----

BASE:
- Fixes a potential initialization error when accessing a configuration file
  stored on the flash.
- Initialize PCIE_DBG_INDIR_REQ.Enable to 0, as hardware failed to do so and
  register dumps could result in errors.

ETH:
- Fixes an issue that sometimes prevented the link from coming up in CR adapters.

ENHANCEMENTS
------------

BASE:
- Adds support for PAUSE OFF watchdog.
- Reports devlog access information in PCIE_FW_PF register 7.

ETH:
- Adds new interface to allow the driver to query the VI rss table base
  addresses.

OFLD:
- Adds new interface for the driver to specify offloaded connections TCP snd
  and rcv scale factors.

================================================================================
================================================================================

Version : 1.13.32.0
Date    : 03/25/2015
================================================================================

FIXES
-----

BASE:
- Fixes FW_CAPS_CONFIG_CMD return value on error (was positive instead of
    negative)
- Fixes FW_PARAMS_PARAM_DEV_FLOWC_BUFFIFO_SZ indication (was wrong on certain
    adapter configurations)
- Fixes config file based PL_TIMEOUT register programming

ETH:
- Fixes a potential EO UDP SEG header corruption

OFLD:
- Fixes timeout issue with half-open connections
- Fixes FW_FLOWC_WR processing when state is set to finwait1

FOiSCSI:
- Don't create a new tcp socket if ERL0 attempt has timed out.

ENHANCEMENTS
------------

ETH:
- Stops sending LACP frames on loopback interface
- Adds an AUTOEQU indication to CPL_SGE_EGR_UPDATE

OFLD:
- Improves default settings of LAN and CLUSTER TCP timer settings
- Sends Negative Advice CPLs to software

================================================================================
================================================================================

Version : 1.12.25.0
Date    : 10/22/2014
================================================================================

FIXES
-----

BASE:
- Improves precision of the Weight Round Robing Traffic Management Algorithm
- Forces link restart when auto-negotiation is disabled
- Fix an issue where pause frames wouldn't be fully disabled even if requested

DCBX:
- Fixes an issue where some settings were not being sent to the switch
  correctly
- Fixes an issue where back-to-back DCBX port updates could get overwritten by
  FW
- Fixes a firmware crash on DCBX APP information request before link up

FOiSCSI:
- Fixes abort task leak in tmf response handling
- Fixes TCP RST handling while in iSCSI ERL0
- Fixes a firmware crash on BYE without INIT

ENHANCEMENTS
------------

BASE:
- Adds link partner settings reporting when available
- Firmware now reports NOTSUPPORTED for modules with an unhandled identifier

DCBX:
- Adds version reporting (indicating which version FW is trying to negotiate)
- Adds IEEE support
- Reports LLDP time outs

FOiSCSI:
- Adds support for multiple iSCSI DDP clients
- Sends DHCP renew request when lease expires

================================================================================

Obtained from:	Chelsio Communications
MFC after:	2 weeks
Sponsored by:	Chelsio Communications
2015-08-05 19:45:11 +00:00
Justin Hibbits
daebf39a41 Remove one more that crept in unnecessarily from previous commit. 2015-08-05 01:52:52 +00:00
Justin Hibbits
6ee5cf50ee Remove some unnecessary includes. 2015-08-05 01:52:11 +00:00
Sean Bruno
e5cb6169d3 A misplaced #endif in ixgbe_ioctl() causes interface MTU to become
zero when INET and INET6 are undefined.

PR:		162028
Differential Revision:	https://reviews.freebsd.org/D3187
Submitted by:	hoomanfazaeli@gmail.com pluknet
Reviewed by:	erj hiren gelbius
MFC after:	2 weeks
2015-08-03 16:39:25 +00:00
Julien Charbon
ff9b006d61 Decompose TCP INP_INFO lock to increase short-lived TCP connections scalability:
- The existing TCP INP_INFO lock continues to protect the global inpcb list
  stability during full list traversal (e.g. tcp_pcblist()).

- A new INP_LIST lock protects inpcb list actual modifications (inp allocation
  and free) and inpcb global counters.

It allows to use TCP INP_INFO_RLOCK lock in critical paths (e.g. tcp_input())
and INP_INFO_WLOCK only in occasional operations that walk all connections.

PR:			183659
Differential Revision:	https://reviews.freebsd.org/D2599
Reviewed by:		jhb, adrian
Tested by:		adrian, nitroboost-gmail.com
Sponsored by:		Verisign, Inc.
2015-08-03 12:13:54 +00:00
Edward Tomasz Napierala
e553ca4994 Rework the way iSCSI initiator handles system shutdown. This fixes
hangs on shutdown with LUNs with mounted filesystems over a disconnected
iSCSI session.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D3052
2015-08-03 11:57:11 +00:00
Warner Losh
123049cf36 Don't forget to check the vendor when probing. Also, there's no need
to double check for if the card has probed before. In fact, there's no
reason to single check either. Simplify the code as a result.
$FreeBSD$ added to lxutil.c in a non-standard way to help keep the
diffs with upstream to a minimum.

Differential Revision: https://reviews.freebsd.org/D3263
2015-08-02 16:26:41 +00:00
Hans Petter Selasky
577c341353 Free mbufs when busdma loading fails.
Reviewed by:	erj, sbruno
MFC after:	1 month
2015-08-01 20:40:37 +00:00
Hans Petter Selasky
56d6361d92 Limit the number of times we loop inside the DWC OTG poll handler to
avoid starving other fast interrupts. Fix a comment while at it.

MFC after:	1 week
Suggested by:	Svatopluk Kraus <onwahe@gmail.com>
2015-07-31 09:12:31 +00:00
Navdeep Parhar
3d3169c858 cxgbe(4): initialize debug_flags from the kernel environment.
MFC after:	3 days
2015-07-31 04:50:47 +00:00
Oleksandr Tymoshenko
40ebf1626f Add GPIO backlight driver compatible with Linux FDT bindings.
Brightness is controlled through sysctl dev.gpiobacklight.X.brightness:
  - any value greater than 0: backlight is on
  - any value less than or equal to  0: backlight is off

FDT bindings docs in Linux tree:
    Documentation/devicetree/bindings/video/backlight/gpio-backlight.txt
2015-07-30 19:04:14 +00:00
Colin Percival
aaebf69062 Add support for Xen blkif indirect segment I/Os. This makes it possible for
the blkfront driver to perform I/Os of up to 2 MB, subject to support from
the blkback to which it is connected and the initiation of such large I/Os
by the rest of the kernel.  In practice, the I/O size is increased from 40 kB
to 128 kB.

The changes to xen/interface/io/blkif.h consist merely of merging updates
from the upstream Xen repository.

In dev/xen/blkfront/block.h we add some convenience macros and structure
fields used for indirect-page I/Os: The device records its negotiated limit
on the number of indirect pages used, while each I/O command structure gains
permanently allocated page(s) for indirect page references and the Xen grant
references for those pages.

In dev/xen/blkfront/blkfront.c we now check in xbd_queue_cb whether a request
is small enough to handle without an indirection page, and either follow the
previous behaviour or use new code for issuing an indirect segment I/O.  In
xbd_connect we read the size of indirect segment I/Os supported by the backend
and select the maximum size we will use; then allocate the pages and Xen grant
references for each I/O command structure.  In xbd_free those grants and pages
are released.

A new loader tunable, hw.xbd.xbd_enable_indirect, can be set to 0 in order to
disable this functionality; it works by pretending that the backend does not
support this feature.  Some backends exhibit a loss of performance with large
I/Os, so users may wish to test with and without this functionality enabled.

Reviewed by:	royger
MFC after:	3 days
Relnotes:	yes
2015-07-30 03:50:01 +00:00
Jim Harris
0e1fd2dda3 nvme: do not notify a consumer about failures that occur during initialization
MFC after:	3 days
Sponsored by:	Intel
2015-07-29 21:29:50 +00:00
Sean Bruno
e0fe6b4835 Add support for BCM5466 PHY
Differential Revision:	D3232
Submitted by:	kevin.bowling@kev009.com
2015-07-29 20:50:48 +00:00
Andrey V. Elsukov
cc0a3c8ca4 Convert in_ifaddr_lock and in6_ifaddr_lock to rmlock.
Both are used to protect access to IP addresses lists and they can be
acquired for reading several times per packet. To reduce lock contention
it is better to use rmlock here.

Reviewed by:	gnn (previous version)
Obtained from:	Yandex LLC
Sponsored by:	Yandex LLC
Differential Revision:	https://reviews.freebsd.org/D3149
2015-07-29 08:12:05 +00:00
Jean-Sébastien Pédron
133362912c drm/i915: Sort functions in i915_gem.c to match Linux 3.8's ordering
While here, reduce the style diff with Linux.

There is no functional change. The goal is to ease the future update to
Linux 3.8's i915 driver.

MFC after:	2 months
2015-07-28 21:47:37 +00:00
David C Somayajulu
ab97207add - Avoid lock contention in the if_transmit callback by using trylock and
enqueueing the frames when it fails. This way there is some latency
 removed from the transmitting path.
- If IFF_DRV_OACTIVE is set (and also if IFF_DRV_RUNNING is not) just
 enqueue the desired frames and return successful transmit. This way we
 avoid to return errors on transmit side and resulting in
 possible out-of-order frames. Please note that IFF_DRV_OACTIVE is set
 everytime we get the threshold ring hit, so this can be happening quite
 often.

Submitted by:	Attilio.Rao@isilon.com
MFC after:5 days
2015-07-28 19:15:44 +00:00
Zbigniew Bodek
8b21d6ae5a Limit ofw_cpu_early_foreach() to CPUs only
On some platforms, the /cpus node contains cpu-to-cluster
map which deffinitely is not a CPU node. Its presence was
causing incrementing of "id" variable and reporting more
CPUs available than it should.
To make "id" valid, increment it only when an entry really
is a CPU device.

Reviewed by:   andrew
Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3216
2015-07-28 13:16:08 +00:00
Hans Petter Selasky
ed0ed9b424 Optimise the DWC OTG host mode driver's receive path:
Remove NAKing limit and pause IN and OUT transactions for 125us in
case of NAK response for BULK and CONTROL endpoints. This gets the
receive latency down and improves USB network throughput at the cost
of some CPU usage.

MFC after:	1 month
2015-07-28 07:30:07 +00:00
Marcel Moolenaar
f40c76d8de Check the sync operation. 2015-07-28 04:54:05 +00:00
Marius Strobl
43bc87c459 - Move the remainder of host controller capability registers reading from
xhci_start_controller() to xhci_init(). These values don't change at run-
  time so there's no point of acquiring them on every USB_HW_POWER_RESUME
  instead of only once during initialization. In r276717, reading the first
  couple of registers in question already had been moved as a prerequisite
  for the changes in that revision.
- Identify ASMedia ASM1042A controllers.
- Use NULL instead of 0 for pointers.

MFC after:	3 days
2015-07-27 15:26:50 +00:00
Marius Strobl
891c57d8a9 - Fix compilation after r285909 with USB_DEBUG defined.
- Regenerate usb.conf.
2015-07-27 14:43:14 +00:00
Marius Strobl
d75accb539 - Use __FBSDID().
- Const'ify cons_to_vga_colors.
- Fix line wrapping.

MFC after:	3 days
2015-07-27 14:34:32 +00:00
Marius Strobl
0309276c28 - Nuke dupe $FreeBSD$.
- Fix whitespace.

MFC after:	3 days
2015-07-27 14:03:34 +00:00
Marius Strobl
fecf9642ba - Probe UICLASS_CDC/UISUBCLASS_ABSTRACT_CONTROL_MODEL/0xff again. This
variant of Microsoft RNDIS, i. e. their unofficial version of CDC ACM,
  has been disabled in r261544 for resolving a conflict with umodem(4).
  Eventually, in r275790 that problem was dealt with in the right way.
  However, r275790 failed to put probing of RNDIS devices in question
  back.
- Initialize the device prior to querying it, as required by the RNDIS
  specification. Otherwise already determining the MAC address may fail
  rightfully.
- On detach, halt the device again.
- Use UCDC_SEND_ENCAPSULATED_{COMMAND,RESPONSE}. While these macros are
  resolving to the same values as UR_{CLEAR_FEATURE,GET_STATUS}, the
  former set is way more appropriate in this context.
- Report unknown - rather: unimplemented - events unconditionally and
  not just in debug mode. This ensures that we'll get some hint of what
  is going wrong instead of the driver silently failing.
- Deal with the Microsoft ActiveSync requirement of using an input buffer
  the size of the expected reply or larger - except for variably sized
  replies - when querying a device.
- Fix some pointless NULL checks, style bugs etc.

This changes allow urndis(4) to communicate with a Microsoft-certified
USB RNDIS test token.

MFC after:	3 days
Sponsored by:	genua mbh
2015-07-27 12:14:14 +00:00
Marcel Moolenaar
b2ce196ca1 o make sure the boundary is a power of 2, when not zero.
o   don't convert 0 to ~0 just so that we can use MIN. ~0 is not a
    valid boundary. Introduce BNDRY_MIN that deals with 0 values
    that mean no boundary.
2015-07-26 16:39:37 +00:00
Michael Gmelin
ca2e4ecd73 isl(4), driver for Intersil I2C ISL29018 Digital Ambient Light Sensor
Differential Revision:	https://reviews.freebsd.org/D2811
Reviewed by:	adrian, wblock
Approved by:	adrian, wblock
Relnotes:	yes
2015-07-25 20:17:19 +00:00
Sean Bruno
a82cd51680 Remove unused txd_saved.
Intialize txd_upper, txd_lower and txd_used at declaration.

Differential Revision:	D3174
Reviewed by:	erj hiren
MFC after:	2 weeks
Sponsored by:	Limelight Networks
2015-07-25 19:24:33 +00:00
Michael Gmelin
46f07718f7 cyapa(4), driver for the Cypress APA I2C trackpad
Differential Revision:	https://reviews.freebsd.org/D3068
Reviewed by:	kib, wblock
Approved by:	kib
Relnotes:	yes
2015-07-25 18:14:35 +00:00
Oleksandr Tymoshenko
7339f7821b OF_getencprop_alloc shouldn't be used to get string value. If string
length + 1 is not divisible by 4 this function returns NULL property
value. Otherwise - string with each 4 letters inverted
2015-07-25 00:58:50 +00:00
Marius Strobl
86fb540033 - Since r253161, uart_intr() abuses FILTER_SCHEDULE_THREAD for signaling
uart_bus_attach() during its test that 20 iterations weren't sufficient
  for clearing all pending interrupts, assuming this means that hardware
  is broken and doesn't deassert interrupts. However, under pressure, 20
  iterations also can be insufficient for clearing all pending interrupts,
  leading to a panic as intr_event_handle() tries to schedule an interrupt
  handler not registered. Solve this by introducing a flag that is set in
  test mode and otherwise restores pre-r253161 behavior of uart_intr(). The
  approach of additionally registering uart_intr() as handler as suggested
  in PR 194979 is not taken as that in turn would abuse special pccard and
  pccbb handling code of intr_event_handle(). [1]
- Const'ify uart_driver_name.
- Fix some minor style bugs.

PR:		194979 [1]
Reviewed by:	marcel (earlier version)
MFC after:	3 days
2015-07-24 17:01:16 +00:00
Marius Strobl
e18e2adaae - In mpt_send_handshake_cmd(), use bus_space_write_stream_4(9) for writing
raw data to the doorbell offset in order to clarify the intent and for
  avoiding unnecessarily converting the endianess back and forth.
  Unfortunately, the same can't be done in mpt_recv_handshake_reply() as
  16-bit data needs to be read using 32-bit bus accessors.
- In mpt_recv_handshake_reply(), get rid of a redundant variable.

MFC after:	1 fortnight
2015-07-24 16:00:35 +00:00